@riverbankcms/sdk 0.180.0 → 0.181.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 (232) hide show
  1. package/dist/_dts/{BlocksIslandsHydrator-DC_AvZwy.d.ts → BlocksIslandsHydrator-CVCasDPz.d.ts} +1 -1
  2. package/dist/_dts/{Page-DQOxVtp3.d.ts → Page-Dtj2Ui3S.d.ts} +7 -7
  3. package/dist/_dts/{SdkPreviewMode-DrLgY9_f.d.ts → SdkPreviewMode-D1f_60WW.d.ts} +2 -2
  4. package/dist/_dts/{client-BP7VBRvs.d.ts → client-Chr9pNVW.d.ts} +58 -70
  5. package/dist/_dts/{content-types-1-K2qi__.d.ts → content-types-kjccgopX.d.ts} +2 -2
  6. package/dist/_dts/{contracts-Dfqz0Tcu.d.ts → contracts-BodaiS00.d.ts} +3 -3
  7. package/dist/_dts/{generatePageMetadata-CSfAqmry.d.ts → generatePageMetadata-BS6kaJFp.d.ts} +2 -2
  8. package/dist/_dts/{index-BeM5Ylwf.d.ts → index-Brl6_I2j.d.ts} +1 -2
  9. package/dist/_dts/{index-CB5Csefo.d.ts → index-CJkefwYh.d.ts} +2 -2
  10. package/dist/_dts/{index-DQBGwBPx.d.ts → index-D1WpKwQe.d.ts} +1 -1
  11. package/dist/_dts/{index-DQr358-m.d.ts → index-DG0OvBs0.d.ts} +8 -8
  12. package/dist/_dts/{index-Blrw2oVk.d.ts → index-Diqt0PvG.d.ts} +1 -1
  13. package/dist/_dts/{index-DCcxLa8p.d.ts → index-Dy50xUMK.d.ts} +2 -2
  14. package/dist/_dts/{loadContent-BG2tLGXj.d.ts → loadContent-BgxshKrA.d.ts} +7 -7
  15. package/dist/_dts/{request-P08l6mkr.d.ts → request-CA0izds5.d.ts} +2498 -1108
  16. package/dist/_dts/{resolveBlockData-BDHc8lFs.d.ts → resolveBlockData-ChQmwEd3.d.ts} +5 -5
  17. package/dist/_dts/{resolvePageContent-Y3IZBbtL.d.ts → resolvePageContent-BvGyvblj.d.ts} +1 -1
  18. package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
  19. package/dist/_dts/sdk/src/client/types.d.ts +2 -2
  20. package/dist/_dts/sdk/src/client.d.ts +7 -7
  21. package/dist/_dts/sdk/src/config/index.d.ts +6 -6
  22. package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
  23. package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
  24. package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +2 -2
  25. package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
  26. package/dist/_dts/sdk/src/data/types.d.ts +2 -2
  27. package/dist/_dts/sdk/src/gifting/client.d.ts +1 -2
  28. package/dist/_dts/sdk/src/index.d.ts +104 -8
  29. package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
  30. package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
  31. package/dist/_dts/sdk/src/navigation/index.d.ts +3 -3
  32. package/dist/_dts/sdk/src/next/index.d.ts +83 -52
  33. package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
  34. package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
  35. package/dist/_dts/sdk/src/portal/client.d.ts +43 -56
  36. package/dist/_dts/sdk/src/portal/index.d.ts +3 -18
  37. package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
  38. package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
  39. package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
  40. package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
  41. package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
  42. package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -1
  43. package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
  44. package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +4 -4
  45. package/dist/_dts/sdk/src/rendering/index.d.ts +6 -6
  46. package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
  47. package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
  48. package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
  49. package/dist/_dts/sdk/src/routing/index.d.ts +6 -6
  50. package/dist/_dts/sdk/src/server.d.ts +5 -5
  51. package/dist/_dts/sdk/src/spam-protection/index.d.ts +2 -2
  52. package/dist/_dts/sdk/src/theme/index.d.ts +1 -1
  53. package/dist/_dts/{serviceBookingOutline-BvtNagjw.d.ts → serviceBookingOutline-BgFbJQhU.d.ts} +6 -6
  54. package/dist/_dts/{types-HAy1-Jjo.d.ts → types-CQrsP1x_.d.ts} +3 -3
  55. package/dist/_dts/{types-DpEAnP4F.d.ts → types-CgS3xLk8.d.ts} +2 -2
  56. package/dist/_dts/{types-BrK6SS5c.d.ts → types-R65DKjPn.d.ts} +7 -7
  57. package/dist/_dts/{validation-D6q3tOBA.d.ts → validation-6LTIbuBA.d.ts} +4 -4
  58. package/dist/client/{BlocksIslandsHydrator-DJSmdNUJ.mjs → BlocksIslandsHydrator-DqZPz6oW.mjs} +19 -19
  59. package/dist/client/{BookingMailingListNote-CGxg37zx.mjs → BookingMailingListNote-uWfR2kaG.mjs} +93 -18
  60. package/dist/client/{BookingQuestionFields-DXegGSnS.mjs → BookingQuestionFields-CyNIKw6k.mjs} +7 -87
  61. package/dist/client/CalendarAction-D_Glwvz2.mjs +105 -0
  62. package/dist/client/{CalendarNavigationChevron-VfP50sYm.mjs → CalendarNavigationChevron-BGCX3zwG.mjs} +6 -6
  63. package/dist/client/{CheckboxChoice-BZPLCgTU.mjs → CheckboxChoice-C8i4NraK.mjs} +1 -1
  64. package/dist/client/{DemoBookingPortalAccess-0Ua44F1j.mjs → DemoBookingPortalAccess-DFLPyuqe.mjs} +9 -6
  65. package/dist/client/{EventCalendar.client-CrpiyDSP.mjs → EventCalendar.client-zDL4-t-B.mjs} +10 -10
  66. package/dist/client/{EventCombined.client-D0me9wnz.mjs → EventCombined.client-uciDKLID.mjs} +60 -10
  67. package/dist/client/{EventEmbeddedCheckoutStep-BDnicDM6.mjs → EventEmbeddedCheckoutStep-BGkbUhuw.mjs} +1 -1
  68. package/dist/client/{EventItem-CJITrGkF.mjs → EventItem-CwzrjcRw.mjs} +6 -6
  69. package/dist/client/{EventListWeekNavigation-BlEm_xjq.mjs → EventListWeekNavigation-ChvcnPma.mjs} +1 -1
  70. package/dist/client/{EventListing.client-BNM_HuS0.mjs → EventListing.client-DA57Qoyx.mjs} +3 -3
  71. package/dist/client/{EventListing.view-CXfb7RRy.mjs → EventListing.view-DZ0qMFF4.mjs} +6 -6
  72. package/dist/client/{EventRegistrationPayment-DiD9uYs6.mjs → EventRegistrationPayment-DSqCJL8E.mjs} +700 -514
  73. package/dist/client/{Page-bX7iy_MK.mjs → Page-C7mygH_f.mjs} +389 -248
  74. package/dist/client/{ProtectedSubmitButton-De6AzhE6.mjs → ProtectedSubmitButton-BNnKuir8.mjs} +1 -1
  75. package/dist/client/{SiteTermsAgreementField-BAdW5DvE.mjs → SiteTermsAgreementField-B4z-e4Wq.mjs} +7 -11
  76. package/dist/client/{StepIndicator-DCfdcb7s.mjs → StepIndicator-Dn_DY4oY.mjs} +1 -1
  77. package/dist/client/{StepIndicator-DCqorVne.mjs → StepIndicator-atfDU82W.mjs} +21 -13
  78. package/dist/client/{ThemedButton-CnSa7o-I.mjs → ThemedButton-PFOhXktM.mjs} +1 -33
  79. package/dist/client/{accessibleSurfaces-Wl8-_OVJ.mjs → accessibleSurfaces-n6kS6Hct.mjs} +77 -1
  80. package/dist/client/{accordion-wofJY8xY.mjs → accordion-CsW8U3ff.mjs} +1 -1
  81. package/dist/client/{booking-form.client-CYl9NrqS.mjs → booking-form.client-cBWM392H.mjs} +52 -29
  82. package/dist/client/bookingCalendar--aWnqFDn.mjs +180 -0
  83. package/dist/client/{bookingForm-kgVWtuMe.mjs → bookingForm-DgySpp6C.mjs} +4 -4
  84. package/dist/client/bookings.mjs +17 -11
  85. package/dist/client/{boxStyleClassNames-CQHWz5gJ.mjs → boxStyleClassNames-BpGVdLFD.mjs} +2 -2
  86. package/dist/client/{carousel-BE1dEFsD.mjs → carousel-DJoleFV3.mjs} +2 -2
  87. package/dist/client/{carousel.client-DMtGYTTM.mjs → carousel.client-BtLwHefX.mjs} +1 -1
  88. package/dist/client/{cart-BsjsdGZE.mjs → cart-EO5o6uPH.mjs} +3 -3
  89. package/dist/client/{cart.client-DylGUWXY.mjs → cart.client-D_gPw45z.mjs} +1 -1
  90. package/dist/client/{checkout-B5KxEUDr.mjs → checkout-NVfZW0kR.mjs} +3 -3
  91. package/dist/client/{checkout.client-C98fhch3.mjs → checkout.client-DD3JuqOy.mjs} +1 -1
  92. package/dist/client/{checkoutUrls-BMLYTf38.mjs → checkoutUrls-z2gXvlGw.mjs} +1 -1
  93. package/dist/client/client.mjs +87 -43
  94. package/dist/client/{constants-PfYJsEZF.mjs → constants-CoOkvw__.mjs} +1 -2
  95. package/dist/client/{context-DtKdUdkO.mjs → context-CRhn9qzS.mjs} +732 -370
  96. package/dist/client/{dateFormatting-BaGPvQS3.mjs → dateFormatting-BnWB4L1s.mjs} +15 -25
  97. package/dist/client/{demoPortalMagicLink-B8eDjhuG.mjs → demoPortalMagicLink-CWDGSTBu.mjs} +2 -3
  98. package/dist/client/{enhanceHeaderSection-DvhD-8eE.mjs → enhanceHeaderSection-tdP_-Z9o.mjs} +4 -5
  99. package/dist/client/{event-registration.client-Du9a_xAN.mjs → event-registration.client-D7YYKySQ.mjs} +191 -210
  100. package/dist/client/{eventCalendar-Di9wDfzl.mjs → eventCalendar-CsAfu5d0.mjs} +4 -4
  101. package/dist/client/{eventCombined-CNW6nBsB.mjs → eventCombined-VXJB5CoS.mjs} +4 -4
  102. package/dist/client/{eventListing-CQMxQ8By.mjs → eventListing-B3KIZNfY.mjs} +4 -4
  103. package/dist/client/{eventRegistration-CprS9k1D.mjs → eventRegistration-BP-dEk1c.mjs} +4 -4
  104. package/dist/client/{form-Zl1_8RJ6.mjs → form-DM8Zbxbv.mjs} +3 -3
  105. package/dist/client/{form.client-TaMUys6I.mjs → form.client-e2z_Tlgk.mjs} +5 -5
  106. package/dist/client/{form.parts-CpNPbPPM.mjs → form.parts-Ctljy1a3.mjs} +3 -3
  107. package/dist/client/gifting/client.mjs +32 -29
  108. package/dist/client/{gifting-DNVa7-Wj.mjs → gifting-DWIsqQru.mjs} +4 -4
  109. package/dist/client/{gifting.client-CFUq3GVx.mjs → gifting.client-QsSWF0uA.mjs} +5 -5
  110. package/dist/client/{gifting.parts-CDQvxA4A.mjs → gifting.parts-CedLgwa_.mjs} +2 -2
  111. package/dist/client/{headerSection-Cg6083rn.mjs → headerSection-DAkRkwb-.mjs} +2 -2
  112. package/dist/client/{mediaAssets-B99AP7ai.mjs → mediaAssets-COfQolI3.mjs} +1 -1
  113. package/dist/client/{mediaContext-Fusweriw.mjs → mediaContext-DzvnjYXm.mjs} +1 -1
  114. package/dist/client/{newsletter-form.client-VuL9I96G.mjs → newsletter-form.client-WYja9-WN.mjs} +7 -7
  115. package/dist/client/{newsletter-form.interactive-7Of3eYn0.mjs → newsletter-form.interactive-RuM86VAv.mjs} +23 -24
  116. package/dist/client/{newsletter-form.parts-OBqsfT24.mjs → newsletter-form.parts-2petDnWv.mjs} +2 -2
  117. package/dist/client/{newsletterForm-BkJe_RTv.mjs → newsletterForm-BUbXdA_e.mjs} +3 -3
  118. package/dist/client/{lookSurfaces-gJ3OqPf9.mjs → noop-Dl4mZ-rr.mjs} +167 -49
  119. package/dist/client/portal/client.mjs +13040 -8190
  120. package/dist/client/portalOrders-COGn4BKG.mjs +596 -0
  121. package/dist/client/portalRoutes-D72yvtDh.mjs +862 -0
  122. package/dist/client/{product-detail.client-B2hdxqJN.mjs → product-detail.client-pOAryevt.mjs} +1 -1
  123. package/dist/client/{product-list.client-CCEgu9rx.mjs → product-list.client-CcUpUiud.mjs} +1 -1
  124. package/dist/client/{productDetail-CRX_ZRfS.mjs → productDetail-BZJCfqat.mjs} +3 -3
  125. package/dist/client/{productList-BAdJ6z5S.mjs → productList-CiRs3mNb.mjs} +3 -3
  126. package/dist/client/{propsDecoder-BLKAmX0S.mjs → propsDecoder--uHW4tFM.mjs} +2 -2
  127. package/dist/client/{registry.server-Bj9cmHHF.mjs → registry.server-CDNNd8wC.mjs} +247 -203
  128. package/dist/client/{renderableMediaAssetAdmission-BlfqYLJW.mjs → renderableMediaAssetAdmission-BsOWd9lf.mjs} +1 -1
  129. package/dist/client/rendering/client.mjs +26 -26
  130. package/dist/client/rendering/islands.mjs +1 -1
  131. package/dist/client/rendering.mjs +16 -8
  132. package/dist/client/{richText-coerce-Z45OLLEX.mjs → richText-coerce-CQGE_wHV.mjs} +2 -1
  133. package/dist/client/{routeIslandApiConfig-DHpTTK77.mjs → routeIslandApiConfig-BtCg87-N.mjs} +1 -1
  134. package/dist/client/{runtimeResponse-D2j2-mOk.mjs → runtimeResponse-DL_ARBpa.mjs} +1 -1
  135. package/dist/client/{runtimeResponse-DtWSfWSZ.mjs → runtimeResponse-Ds9cmBUf.mjs} +1 -1
  136. package/dist/client/{shop-BKsgxm_-.mjs → shop-Rx_gEMK8.mjs} +3 -3
  137. package/dist/client/{shop-commerce-Cbtk_kUW.mjs → shop-commerce-D8evQnMT.mjs} +53 -16
  138. package/dist/client/{shop-commerce-store-B-rv2p5h.mjs → shop-commerce-store-C9PcsSTj.mjs} +22 -5
  139. package/dist/client/{shop-discount-apply.state-CiCDLNh7.mjs → shop-discount-apply.state-D5CtGfJI.mjs} +2 -2
  140. package/dist/client/{shop.client-Rnqa74Tk.mjs → shop.client-D4lzQ9oY.mjs} +17 -39
  141. package/dist/client/{shopShared-BaBfhjCq.mjs → shopShared-BVbq7Nm-.mjs} +2 -2
  142. package/dist/client/spam-protection.mjs +1 -1
  143. package/dist/client/src-Al4ooTl_.mjs +164 -0
  144. package/dist/client/{src-o7WEvbK1.mjs → src-ZSqRK3dD.mjs} +228 -90
  145. package/dist/client/{timetableModel-BOff1Kk5.mjs → timetableModel-BQJrSK0K.mjs} +9 -78
  146. package/dist/client/{shop-add-feedback-DvC2kP1K.mjs → urlParams-C2QHo1Pa.mjs} +1 -42
  147. package/dist/client/{useAvailableSlots-DQJNh10g.mjs → useAvailableSlots-Dm3lKJKR.mjs} +2 -3
  148. package/dist/client/{useDiscountCodeUi-BcFQRI_7.mjs → useDiscountCodeUi-klgfGn7f.mjs} +1 -1
  149. package/dist/client/{useEventPagination-BvdcexDC.mjs → useEventPagination-Jnjt7_ly.mjs} +8 -8
  150. package/dist/client/{view-CTBwSpKv.mjs → view-CC_yQLSA.mjs} +4 -4
  151. package/dist/client/{wizardSteps-CWIQyRIw.mjs → wizardSteps-BliJOzEX.mjs} +953 -279
  152. package/dist/preview-next/client/{PageSectionToolbar-CG6KwITA.mjs → PageSectionToolbar-BhL0uADo.mjs} +3 -3
  153. package/dist/preview-next/client/{PreviewEditorSidebar-BGBqrC9m.mjs → PreviewEditorSidebar-Ct8eIm0i.mjs} +5 -5
  154. package/dist/preview-next/client/{PreviewEditorUI-Bwkyx28x.mjs → PreviewEditorUI-BS32G4V9.mjs} +4 -4
  155. package/dist/preview-next/client/{PreviewShell-DB1l6JNU.mjs → PreviewShell-RL0WfZXD.mjs} +5 -5
  156. package/dist/preview-next/client/{SdkPreviewModeRuntime-Bs6Cwzr3.mjs → SdkPreviewModeRuntime-MK_gHeGy.mjs} +29 -5
  157. package/dist/preview-next/client/{previewAssistantSlot-T-oDD_Dd.mjs → previewAssistantSlot-CQyS8pcq.mjs} +5011 -2074
  158. package/dist/preview-next/client/{previewChromeRoot-BeukcDRy.mjs → previewChromeRoot-BSxp3Mfu.mjs} +1 -1
  159. package/dist/preview-next/client/runtime.mjs +3 -3
  160. package/dist/preview-next/client/{sdk-runtime-ceDW_9q2.mjs → sdk-runtime-DKnTzy74.mjs} +2 -2
  161. package/dist/preview-next/client/{siteStyleAccess-CCB9bScO.mjs → siteStyleAccess-BlmbvbLN.mjs} +3 -3
  162. package/dist/preview-next/client/{useAutosaveStatus-D4o0CKq7.mjs → useAutosaveStatus-D-7GwZOQ.mjs} +1 -1
  163. package/dist/preview-next/client/{useOpenBlockForSetup-Seccrvwu.mjs → useOpenBlockForSetup-BNZtGM5g.mjs} +1 -1
  164. package/dist/preview-next/container-responsive.css +203 -174
  165. package/dist/preview-next/keepAlive.mjs +1 -1
  166. package/dist/preview-next/middleware.mjs +1 -1
  167. package/dist/preview-next/{route-contract-FwFj8zGL.mjs → route-contract-R3PcMmax.mjs} +71 -37
  168. package/dist/server/{Block.shared-D6WrRCxX.mjs → Block.shared-CniF9tSu.mjs} +5 -5
  169. package/dist/server/{ThemeScopeCore-BQzjDQ2q.mjs → ThemeScopeCore-BQWsnGT6.mjs} +126 -120
  170. package/dist/server/{accessibleSurfaces-CM3QANtw.mjs → accessibleSurfaces-WPzUAHp4.mjs} +33 -2
  171. package/dist/server/accordions-By_0Ykks.mjs +111 -0
  172. package/dist/server/{bindings-CS6ih1Yc.mjs → bindings-DxojjtK3.mjs} +7 -7
  173. package/dist/server/{client-m0ylCj_f.mjs → client-CDndhbYO.mjs} +86 -42
  174. package/dist/server/config-validation.mjs +1 -1
  175. package/dist/server/config.mjs +2 -2
  176. package/dist/server/constants-VyF5nEhL.mjs +1474 -0
  177. package/dist/server/{customCss-BZ8YSrQg.mjs → customCss-C9kgPHvr.mjs} +41 -5
  178. package/dist/server/data/resolveBlockData.mjs +1 -1
  179. package/dist/server/index.mjs +3 -3
  180. package/dist/server/{loadContent-vgWMz1uD.mjs → loadContent-BKstMBmX.mjs} +5 -4
  181. package/dist/server/{loadPage-CIOL3-9t.mjs → loadPage-IgNnZaqr.mjs} +3 -3
  182. package/dist/server/{lookMediaFrame-m-91jGGn.mjs → lookMediaFrame-TFjgNG61.mjs} +38 -18
  183. package/dist/server/manifest.mjs +36 -25
  184. package/dist/server/{mapLocation-BM5WX7FY.mjs → mapLocation-MDDSubTp.mjs} +1 -1
  185. package/dist/server/media-BRmYrnzb.mjs +31 -0
  186. package/dist/server/{media-luf7RF22.mjs → media-gvfIw3z8.mjs} +2 -31
  187. package/dist/server/{navigation-BcNfYYuu.mjs → navigation-quBYlSKD.mjs} +2 -2
  188. package/dist/server/navigation.mjs +1 -1
  189. package/dist/server/next.mjs +134 -81
  190. package/dist/server/{overrideResolution-BiHmsvTZ.mjs → overrideResolution-CCaAPpIa.mjs} +1 -1
  191. package/dist/server/page-converter.mjs +3 -3
  192. package/dist/server/{pageRenderPlan-DJo_obpi.mjs → pageRenderPlan-B7iULvKe.mjs} +8 -7
  193. package/dist/server/{pageRuntimeSupport-BnSuoHON.mjs → pageRuntimeSupport-BytMroxn.mjs} +5 -5
  194. package/dist/server/{pageShared-BJuOzxzn.mjs → pageShared-Dcs_XTIO.mjs} +243 -323
  195. package/dist/server/{parseThemeForPersistence-DOsfofCy.mjs → parseThemeForPersistence-Bihl4W5K.mjs} +3 -2
  196. package/dist/server/{portal-B4JVkdjc.mjs → portal-CMW_b9mG.mjs} +62 -46
  197. package/dist/server/portal.mjs +3 -3
  198. package/dist/server/portalQuestions-oUyohgL9.mjs +225 -0
  199. package/dist/server/{prebuild-Cr8p8T7V.mjs → prebuild-agaH-vZV.mjs} +1 -1
  200. package/dist/server/prebuild.mjs +1 -1
  201. package/dist/server/{prefetchBlockData-BZh57-ua.mjs → prefetchBlockData-DwpRjqw4.mjs} +4 -3
  202. package/dist/server/{registry-CvhFwbXJ.mjs → registry-DM9dHfDC.mjs} +345 -449
  203. package/dist/server/rendering/components/pageShared.mjs +1 -1
  204. package/dist/server/rendering/helpers/loadPage.mjs +1 -1
  205. package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +1 -1
  206. package/dist/server/rendering/server.mjs +4 -4
  207. package/dist/server/rendering.mjs +10 -9
  208. package/dist/server/{resolveBlockData-Cv_W1LVB.mjs → resolveBlockData-CinHGf8l.mjs} +2 -2
  209. package/dist/server/{resolveButtonColourStates--6yJp9Tq.mjs → resolveButtonColourStates-B0O1IM16.mjs} +2 -1028
  210. package/dist/server/{responseMedia-KRKguBC5.mjs → responseMedia-IfH65QAH.mjs} +1 -1
  211. package/dist/server/{schema-BpsqaSSU.mjs → schema-CwfxQjc4.mjs} +10 -113
  212. package/dist/server/server.mjs +3 -3
  213. package/dist/server/{servicePageContent-CRKbTm_7.mjs → servicePageContent-BBBhOtdE.mjs} +21 -20
  214. package/dist/server/theme-bridge.mjs +3 -2
  215. package/dist/server/theme.mjs +2 -2
  216. package/dist/server/{three-pass-converter-39SXCCnh.mjs → three-pass-converter-DPaUPTfl.mjs} +34 -16
  217. package/dist/server/titleSourceSchema-NhK6azFS.mjs +2018 -0
  218. package/dist/server/typeGuards-CTW_9AXq.mjs +413 -0
  219. package/dist/server/types-BKaBZFjD.mjs +1085 -0
  220. package/dist/server/{validation-DCl-FCk_.mjs → validation-DG5jX3jH.mjs} +70 -17
  221. package/dist/server/{version-DT_R5JAR.mjs → version-CipbxPHL.mjs} +1 -1
  222. package/dist/server/video-Cdr3wh-q.mjs +272 -0
  223. package/dist/styles/index.css +1013 -1840
  224. package/package.json +2 -1
  225. package/dist/_dts/index-B0_2-65A.d.ts +0 -101
  226. package/dist/client/TabBarFragment-DlKQRhP4.mjs +0 -56
  227. package/dist/client/checkoutRoute-DKlZRNZD.mjs +0 -22
  228. package/dist/client/creditProducts-BQ1t1erI.mjs +0 -266
  229. package/dist/client/formatDate-hhI1-tzt.mjs +0 -26
  230. package/dist/server/constants-Cj7hfbrA.mjs +0 -41
  231. package/dist/server/richTextSchema-QLaQrbII.mjs +0 -212
  232. package/dist/server/titleSourceSchema-Cu-3PRvv.mjs +0 -122
@@ -1,24 +1,17 @@
1
1
  "use client";
2
- import { c as unsafeAsMediaAssetId, d as parseUuidBrand, f as err, i as resolveManagedMediaReference, l as unsafeAsStorageBucketName, o as parseCanonicalMediaIdentifier, p as ok$1, u as unsafeAsStoragePath } from "./renderableMediaAssetAdmission-BlfqYLJW.mjs";
3
- import { $t as formatDateTime, A as toBookingRequirementConsentField, Ct as eventCalendarListLayoutCompatibleDisplayModeValues, D as blockBookingConsentSchema, E as blockBookingPaymentTermsSchema, M as bookingQuestionsAnswerValueSchema, P as eventCalendarListLayoutOptions, Qt as formatDateRange, St as eventCalendarDisplayModeValues, Tn as formatCurrencyAmount, Xt as validateBookingPaymentOptionKinds, Z as runtimeMediaSchema, Zt as formatDate$2, _n as parseUtcIsoDateTimeString, _t as roomChoicesSchema, bn as resolveBookingTimeZoneId, bt as normalizeCurrencyCode, c as blockSiteTermsSchema, ct as eyebrowTreatmentValues, dn as compareLocalScheduleDates, en as formatDateTimeRange, fn as formatLocalScheduleDate, gn as parseLocalScheduleTime, gt as reviewedRoomsSchema, hn as parseBookingLocalDate, ht as placesFor, in as formatTimeRange, j as beforeBookingQuestionsPresentationSchema, ln as toScheduledBookingDateTime, lt as headingDecorationColorTokenValues, mn as getLocalScheduleDate, mt as ROOM_PLACES, nn as formatSiteInstantTime, on as inferSiteDateLocale, pn as getBookingLocalDateKey, pt as visibleHeadingDecorationFamilyValues, rn as formatTime$2, sn as resolveBookingDisplayContext, t as assertNever$1, tn as formatSiteInstantDate, un as addLocalScheduleDays, vn as toUtcIsoDateTimeString, vt as unsafeAsPositiveCheckoutQuantity, wn as toNonNegativeCents, wt as eventCalendarListLayoutValues, xn as toBookingTimeZone, xt as eventCalendarDefaultViewValues, yn as resolveBookingBusinessTimeZone, yt as allocateReductionCents } from "./src-o7WEvbK1.mjs";
4
- import { C as omitZeroAmountFutureRows, E as parseAppointmentServiceId, T as assertNever$2, _ as addIntervalPreservingMonthAnchor, a as buildBookingQuestionsSubmission, b as getBookingInstalmentDepositRefundability, d as resolveBookingQuestionsAnswerMode, g as formatCreditProductUnits, h as formatCreditProductPayment, l as initialBookingQuestionsAnswerMode, o as checkBookingQuestionsAnswered, p as creditProductUnitNoun, t as deriveCreditProductLabels, u as initialBookingQuestionsValues, v as clampConfiguredAmount, w as splitAmountWithRemainderInFirst, x as getBookingInstalmentPlanIntervalCount } from "./creditProducts-BQ1t1erI.mjs";
2
+ import { d as unsafeAsStoragePath, f as parseUuidBrand, i as resolveManagedMediaReference, l as unsafeAsMediaAssetId, m as ok$1, o as parseCanonicalMediaIdentifier, p as err, u as unsafeAsStorageBucketName } from "./renderableMediaAssetAdmission-BsOWd9lf.mjs";
3
+ import { An as formatCurrencyAmount, Bn as parseEventSeriesId, Cn as toUtcIsoDateTimeString, Ct as unsafeAsPositiveCheckoutQuantity, Dn as parsePositiveCents, Dt as eventCalendarDisplayModeValues, En as toBookingTimeZone, Et as eventCalendarDefaultViewValues, J as runtimeMediaSchema, Nn as parseAppointmentServiceId, O as toBookingRequirementConsentField, Ot as eventCalendarListLayoutCompatibleDisplayModeValues, Sn as parseUtcIsoDateTimeString, St as roomChoicesSchema, T as blockBookingConsentSchema, Tn as resolveBookingTimeZoneId, Tt as normalizeCurrencyCode, _n as formatLocalScheduleDate, an as formatDateTimeRange, at as eyebrowTreatmentValues, bn as parseBookingLocalDate, bt as placesFor, c as blockSiteTermsSchema, cn as formatTime$2, dn as inferSiteDateLocale, dt as bookingQuestionsAnswerValueSchema, fn as resolveBookingDisplayContext, gn as compareLocalScheduleDates, hn as addLocalScheduleDays, in as formatDateTime, j as eventCalendarListLayoutOptions, k as beforeBookingQuestionsPresentationSchema, kn as toNonNegativeCents, kt as eventCalendarListLayoutValues, ln as formatTimeRange, mn as toScheduledBookingDateTime, nn as formatDate$2, on as formatSiteInstantDate, ot as headingDecorationColorTokenValues, rn as formatDateRange, sn as formatSiteInstantTime, t as assertNever$2, tn as validateBookingPaymentOptionKinds, ut as visibleHeadingDecorationFamilyValues, vn as getBookingLocalDateKey, w as blockBookingPaymentTermsSchema, wn as resolveBookingBusinessTimeZone, wt as allocateReductionCents, xn as parseLocalScheduleTime, xt as reviewedRoomsSchema, yn as getLocalScheduleDate, yt as ROOM_PLACES, zn as parseEventOfferingId } from "./src-ZSqRK3dD.mjs";
4
+ import { c as checkBookingQuestionsAnswered, d as initialBookingQuestionsAnswerMode, f as initialBookingQuestionsValues, h as assertNever$3, p as resolveBookingQuestionsAnswerMode, r as bookingCalendar, s as buildBookingQuestionsSubmission } from "./bookingCalendar--aWnqFDn.mjs";
5
5
  import { t as stableJsonStringify } from "./stable-json-D0XAEIXc.mjs";
6
- import { $t as cardListFamilyBlocks, Mt as resolveEffectiveKnobs, en as cardListKnobBlocks, jt as blockAppearancePresets, n as listLookControl, r as listLookSlot } from "./lookSurfaces-gJ3OqPf9.mjs";
6
+ import { Mt as blockAppearancePresets, Nt as resolveEffectiveKnobs, en as cardListFamilyBlocks, i as listLookSlot, r as listLookControl, tn as cardListKnobBlocks } from "./noop-Dl4mZ-rr.mjs";
7
7
  import { g as blockColorTokenNames, w as parseColorTokenParts } from "./types-BEaKfam_.mjs";
8
- import { G as mergeStyles, H as backgroundColorStyle, K as rgbColorValue, P as PUBLIC_BUTTON_ROLES, q as textColorStyle } from "./accessibleSurfaces-Wl8-_OVJ.mjs";
9
- import { S as clsx } from "./ThemedButton-CnSa7o-I.mjs";
10
- import { a as getSupabaseUrl, i as getSiteId, n as getCurrentResolveImageUrlContext, r as getMediaAssetIndex } from "./mediaContext-Fusweriw.mjs";
11
- import { l as buildCalendarViewport$1, n as calendarLinks, r as groupItemsByDate } from "./src-uwCpbHXG.mjs";
8
+ import { G as mergeStyles, H as backgroundColorStyle, K as rgbColorValue, P as PUBLIC_BUTTON_ROLES, q as textColorStyle } from "./accessibleSurfaces-n6kS6Hct.mjs";
9
+ import { x as clsx } from "./ThemedButton-PFOhXktM.mjs";
10
+ import { a as getSupabaseUrl, i as getSiteId, n as getCurrentResolveImageUrlContext, r as getMediaAssetIndex } from "./mediaContext-DzvnjYXm.mjs";
11
+ import { l as buildCalendarViewport$1, r as groupItemsByDate } from "./src-uwCpbHXG.mjs";
12
12
  import React from "react";
13
13
  import { Fragment, jsx } from "react/jsx-runtime";
14
14
  import { z } from "zod";
15
- //#region ../core/src/branded/events.ts
16
- const unsafeAsEventOfferingId = (id) => id;
17
- const unsafeAsEventSeriesId = (id) => id;
18
- const unsafeAsEventCategoryId = (id) => id;
19
- const parseEventOfferingId = (value) => parseUuidBrand(value, unsafeAsEventOfferingId);
20
- const parseEventSeriesId = (value) => parseUuidBrand(value, unsafeAsEventSeriesId);
21
- //#endregion
22
15
  //#region ../core/src/branded/identity.ts
23
16
  const unsafeAsSiteId = (id) => id;
24
17
  const parseSiteId = (value) => parseUuidBrand(value, unsafeAsSiteId);
@@ -45,7 +38,7 @@ function isPublicEventPricingOptionDisplayable(option) {
45
38
  case "not_on_sale_yet":
46
39
  case "sale_ended":
47
40
  case "attendance_mode_unavailable": return false;
48
- default: return assertNever$2(reason);
41
+ default: return assertNever$3(reason);
49
42
  }
50
43
  }
51
44
  function publicEventPricingDisplay(pricing) {
@@ -186,7 +179,7 @@ function canonicalEventPricingDisplay(pricing) {
186
179
  currency: pricing.currency,
187
180
  purpose: "configured"
188
181
  });
189
- default: return assertNever$2(pricing);
182
+ default: return assertNever$3(pricing);
190
183
  }
191
184
  }
192
185
  /**
@@ -205,7 +198,7 @@ function formatBookingPriceDisplay(display, options = {}) {
205
198
  case "mixed": return display.paidToAmount > display.paidFromAmount ? `Free or ${formatCurrencyAmount(display.paidFromAmount, display.currency, options)}–${formatCurrencyAmount(display.paidToAmount, display.currency, options)}` : `Free or ${formatCurrencyAmount(display.paidFromAmount, display.currency, options)}`;
206
199
  case "unavailable": return "Pricing unavailable";
207
200
  case "external": return display.label;
208
- default: return assertNever$2(display);
201
+ default: return assertNever$3(display);
209
202
  }
210
203
  }
211
204
  /** Render an event's price directly from its pricing value. */
@@ -456,6 +449,69 @@ function resolveFlexibleBalanceInitialPaymentCents(input) {
456
449
  return clampFlexibleBalanceConfiguredAmount(input.config.upfrontAmountCents, input.totalAmountCents);
457
450
  }
458
451
  //#endregion
452
+ //#region ../core/src/booking-instalments.ts
453
+ function isDepositBearingBookingInstalmentPlan(plan) {
454
+ switch (plan.kind) {
455
+ case "deposit_plus_one_remainder":
456
+ case "deposit_plus_scheduled_instalments": return true;
457
+ case "equal_scheduled_instalments": return false;
458
+ default: return assertNever$1(plan);
459
+ }
460
+ }
461
+ function getBookingInstalmentDepositRefundability(plan) {
462
+ return isDepositBearingBookingInstalmentPlan(plan) ? plan.depositRefundability : null;
463
+ }
464
+ function getBookingInstalmentProtectedDepositAmountCents(plan) {
465
+ return isDepositBearingBookingInstalmentPlan(plan) ? plan.depositAmountCents : null;
466
+ }
467
+ function clampConfiguredAmount(amountCents, totalAmountCents) {
468
+ return Math.max(0, Math.min(amountCents, totalAmountCents));
469
+ }
470
+ function splitAmountWithRemainderInFirst(totalAmountCents, partCount) {
471
+ if (partCount <= 0) return [];
472
+ const baseAmountCents = Math.floor(totalAmountCents / partCount);
473
+ const remainderCents = totalAmountCents - baseAmountCents * partCount;
474
+ return Array.from({ length: partCount }, (_, index) => index === 0 ? baseAmountCents + remainderCents : baseAmountCents);
475
+ }
476
+ function addIntervalPreservingMonthAnchor(isoString, intervalCount, intervalUnit) {
477
+ const date = new Date(isoString);
478
+ if (!Number.isFinite(date.getTime())) return isoString;
479
+ switch (intervalUnit) {
480
+ case "day":
481
+ date.setUTCDate(date.getUTCDate() + intervalCount);
482
+ return date.toISOString();
483
+ case "week":
484
+ date.setUTCDate(date.getUTCDate() + intervalCount * 7);
485
+ return date.toISOString();
486
+ case "month": return addMonthsPreservingAnchorDay(date, intervalCount).toISOString();
487
+ default: return assertNever$1(intervalUnit);
488
+ }
489
+ }
490
+ function getBookingInstalmentPlanIntervalCount(plan) {
491
+ switch (plan.kind) {
492
+ case "deposit_plus_one_remainder": return plan.remainderDueCount;
493
+ case "deposit_plus_scheduled_instalments":
494
+ case "equal_scheduled_instalments": return plan.intervalCount;
495
+ default: return assertNever$1(plan);
496
+ }
497
+ }
498
+ function omitZeroAmountFutureRows(rows) {
499
+ if (rows.length <= 1) return rows;
500
+ const firstRow = rows[0];
501
+ if (firstRow === void 0) return [];
502
+ return [firstRow, ...rows.slice(1).filter((row) => row.amountCents > 0)];
503
+ }
504
+ function addMonthsPreservingAnchorDay(date, intervalCount) {
505
+ const anchorDay = date.getUTCDate();
506
+ const nextMonth = new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth() + intervalCount, 1, date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds()));
507
+ const lastDayOfTargetMonth = new Date(Date.UTC(nextMonth.getUTCFullYear(), nextMonth.getUTCMonth() + 1, 0)).getUTCDate();
508
+ nextMonth.setUTCDate(Math.min(anchorDay, lastDayOfTargetMonth));
509
+ return nextMonth;
510
+ }
511
+ function assertNever$1(value) {
512
+ throw new Error(`Unexpected value: ${String(value)}`);
513
+ }
514
+ //#endregion
459
515
  //#region ../core/src/venue-location.ts
460
516
  /** The owner's option and what visitors read are the same words, so the option says what you'll see. */
461
517
  const EVENT_ADDRESS_AFTER_BOOKING_LABEL = "Address shared after booking";
@@ -704,38 +760,6 @@ function invalidRuntimeContext() {
704
760
  return err({ tag: "invalid_mailing_list_runtime_context" });
705
761
  }
706
762
  //#endregion
707
- //#region ../core/src/slug.ts
708
- const REMOVED_CHARACTERS = /['\u2019]/g;
709
- const COMBINING_DIACRITICS = /[\u0300-\u036f]/g;
710
- const SEPARATOR_RUN = /[^a-z0-9]+/g;
711
- const TRAILING_SLUG_SEPARATORS = /[-/]+$/g;
712
- function slugifySegment(text) {
713
- return text.normalize("NFD").replace(COMBINING_DIACRITICS, "").toLowerCase().replace(REMOVED_CHARACTERS, "").replace(SEPARATOR_RUN, "-").replace(/^-+|-+$/g, "");
714
- }
715
- /**
716
- * Convert a string to a URL-safe slug.
717
- *
718
- * Every non-alphanumeric character (underscores included) is a separator and
719
- * collapses to a single hyphen, which keeps output inside the `site_routes`
720
- * slug constraint `^[a-z0-9]+([a-z0-9\-/]*[a-z0-9])?$`.
721
- *
722
- * This is the single slug implementation for the monorepo: block-form and the
723
- * shop admin catalog delegate here rather than keeping their own variants.
724
- *
725
- * @example
726
- * slugify("Initial Consultation") // "initial-consultation"
727
- * slugify("Reiki & Energy Healing") // "reiki-energy-healing"
728
- * slugify("Don't Stop") // "dont-stop"
729
- * slugify("draft_post") // "draft-post"
730
- * slugify("Blog / My Post", { preserveSegments: true }) // "blog/my-post"
731
- */
732
- function slugify(text, options = {}) {
733
- const source = text.toString().trim();
734
- const slug = options.preserveSegments === true ? source.split("/").map(slugifySegment).filter((segment) => segment.length > 0).join("/") : slugifySegment(source);
735
- if (options.maxLength === void 0) return slug;
736
- return slug.slice(0, options.maxLength).replace(TRAILING_SLUG_SEPARATORS, "");
737
- }
738
- //#endregion
739
763
  //#region ../core/src/whole-series-run-schedule.ts
740
764
  /**
741
765
  * A session that is not happening.
@@ -850,6 +874,58 @@ function resolveWholeSeriesPaymentDates(input) {
850
874
  };
851
875
  }
852
876
  //#endregion
877
+ //#region ../core/src/credit-product-nouns.ts
878
+ const CREDIT_PRODUCT_NOUNS = {
879
+ event_pass: {
880
+ product: {
881
+ singular: "pass",
882
+ plural: "passes"
883
+ },
884
+ productTitle: {
885
+ singular: "Pass",
886
+ plural: "Passes"
887
+ },
888
+ unit: {
889
+ singular: "class",
890
+ plural: "classes"
891
+ }
892
+ },
893
+ appointment_package: {
894
+ product: {
895
+ singular: "package",
896
+ plural: "packages"
897
+ },
898
+ productTitle: {
899
+ singular: "Package",
900
+ plural: "Packages"
901
+ },
902
+ unit: {
903
+ singular: "session",
904
+ plural: "sessions"
905
+ }
906
+ }
907
+ };
908
+ function countedNoun(noun, count) {
909
+ return count === 1 ? noun.singular : noun.plural;
910
+ }
911
+ /** "class" or "classes", to follow a number the caller formats. */
912
+ function creditProductUnitNoun(useCase, count) {
913
+ return countedNoun(CREDIT_PRODUCT_NOUNS[useCase].unit, count);
914
+ }
915
+ /** "1 class", "4 sessions". */
916
+ function formatCreditProductUnits(useCase, count) {
917
+ return `${count} ${creditProductUnitNoun(useCase, count)}`;
918
+ }
919
+ /** "4 of 10 sessions left". */
920
+ function formatCreditProductBalance(useCase, balance) {
921
+ return `${balance.remaining} of ${balance.total} ${creditProductUnitNoun(useCase, balance.total)} left`;
922
+ }
923
+ /** Confirmation copy shared by booking screens and editable email wording. */
924
+ function formatCreditProductPayment(input) {
925
+ const used = input.creditsUsed;
926
+ return (used !== void 0 && used !== 0 && !Number.isNaN(used) ? `${used} credit${used === 1 ? "" : "s"} from your ${input.name}` : `Paid with your ${input.name}`) + (input.creditsRemaining === void 0 ? "" : ` (${input.creditsRemaining} left)`);
927
+ }
928
+ //#endregion
853
929
  //#region ../commerce/src/utils/assertNever.ts
854
930
  function assertNever(value, message) {
855
931
  if (message) throw new Error(message);
@@ -1090,30 +1166,38 @@ function repriceBookingCollectionOptions(input) {
1090
1166
  }
1091
1167
  /** The same admission is used for the offer and the submitted selection. */
1092
1168
  function canOfferBookingCollectionOption(option, currency, deadline = option.bookingStartAt) {
1169
+ return collectionDatesOpen(option, deadline) && laterCollectionsChargeable(option, currency);
1170
+ }
1171
+ /** The one date rule: whether an option's due dates still fall between now and the booking (or the owner's deadline). */
1172
+ function collectionDatesOpen(option, deadline) {
1093
1173
  if (option.kind === "upfront" || option.kind === "deferred_manual") return true;
1094
1174
  const window = bookingCollectionWindow(option);
1095
1175
  if (!window) return false;
1096
- const { now, start } = window;
1097
- if (option.kind === "flexible_balance") return flexibleBalanceCanBeCollected(option, currency, now, start);
1176
+ if (option.kind === "flexible_balance") {
1177
+ const localDay = (at) => formatLocalScheduleDate(getLocalScheduleDate(new Date(at), option.timeZone));
1178
+ return option.balanceDueDay >= localDay(window.now) && option.balanceDueDay < localDay(window.start);
1179
+ }
1098
1180
  return deadline !== null && canInstalmentPlanCompleteBefore({
1099
1181
  now: option.anchorAt,
1100
1182
  deadline,
1101
1183
  schedule: option.schedule
1102
- }) && laterInstalmentsCanBeCollected(option, currency, now);
1103
- }
1104
- function laterInstalmentsCanBeCollected(option, currency, now) {
1105
- return option.schedule.filter((row) => row.stateAtBooking === "scheduled").every((row) => Date.parse(row.dueAt) > now && !isStripeChargeBelowMinimum({
1106
- amountCents: row.amountCents,
1107
- currency
1108
- }));
1184
+ }) && option.schedule.every((row) => row.stateAtBooking !== "scheduled" || Date.parse(row.dueAt) > window.now);
1109
1185
  }
1110
- function flexibleBalanceCanBeCollected(option, currency, now, start) {
1111
- const today = formatLocalScheduleDate(getLocalScheduleDate(new Date(now), option.timeZone));
1112
- const startDay = formatLocalScheduleDate(getLocalScheduleDate(new Date(start), option.timeZone));
1113
- return option.balanceDueDay >= today && option.balanceDueDay < startDay && !isStripeChargeBelowMinimum({
1114
- amountCents: option.remainingBalanceCents,
1115
- currency
1116
- });
1186
+ /** The amount rule: every later collection is big enough to charge to a card. */
1187
+ function laterCollectionsChargeable(option, currency) {
1188
+ switch (option.kind) {
1189
+ case "upfront":
1190
+ case "deferred_manual": return true;
1191
+ case "flexible_balance": return !isStripeChargeBelowMinimum({
1192
+ amountCents: option.remainingBalanceCents,
1193
+ currency
1194
+ });
1195
+ case "instalment_plan": return option.schedule.every((row) => row.stateAtBooking !== "scheduled" || !isStripeChargeBelowMinimum({
1196
+ amountCents: row.amountCents,
1197
+ currency
1198
+ }));
1199
+ default: return assertNever(option);
1200
+ }
1117
1201
  }
1118
1202
  function bookingCollectionWindow(option) {
1119
1203
  const now = Date.parse(option.anchorAt);
@@ -1134,33 +1218,17 @@ const SCHEDULE_DATES_TOTAL_CENTS = 1e9;
1134
1218
  */
1135
1219
  function bookingCollectionDatesOpen(option, dates) {
1136
1220
  if (option.kind === "upfront" || option.kind === "deferred_manual") return true;
1137
- const window = bookingCollectionWindow({
1221
+ if (!bookingCollectionWindow({
1138
1222
  anchorAt: dates.nowIso,
1139
1223
  bookingStartAt: dates.bookingStartAt
1140
- });
1141
- if (!window || dates.bookingStartAt === null) return false;
1142
- switch (option.kind) {
1143
- case "flexible_balance": {
1144
- const due = flexibleBalanceDueDay(option.config, dates.bookingStartAt, dates.timeZone);
1145
- const localDay = (at) => formatLocalScheduleDate(getLocalScheduleDate(new Date(at), dates.timeZone));
1146
- return due >= localDay(window.now) && due < localDay(window.start);
1147
- }
1148
- case "instalment_plan": {
1149
- const deadline = dates.instalmentCollectionDeadlineAt === void 0 ? dates.bookingStartAt : dates.instalmentCollectionDeadlineAt;
1150
- if (deadline === null) return false;
1151
- const schedule = buildBookingInstalmentSchedule({
1152
- anchorAt: dates.nowIso,
1153
- totalAmountCents: SCHEDULE_DATES_TOTAL_CENTS,
1154
- plan: option.plan
1155
- });
1156
- return canInstalmentPlanCompleteBefore({
1157
- now: dates.nowIso,
1158
- deadline,
1159
- schedule
1160
- }) && schedule.every((row) => row.stateAtBooking !== "scheduled" || Date.parse(row.dueAt) > window.now);
1161
- }
1162
- default: return assertNever(option);
1163
- }
1224
+ })) return false;
1225
+ return collectionDatesOpen(resolveBookingCollectionOptionFacts({
1226
+ option,
1227
+ totalCents: SCHEDULE_DATES_TOTAL_CENTS,
1228
+ anchorAt: dates.nowIso,
1229
+ bookingStartAt: dates.bookingStartAt,
1230
+ timeZone: dates.timeZone
1231
+ }), dates.instalmentCollectionDeadlineAt === void 0 ? dates.bookingStartAt : dates.instalmentCollectionDeadlineAt);
1164
1232
  }
1165
1233
  /** Mirrors private.flexible_balance_due_day: fixed civil date, or local start minus calendar days. */
1166
1234
  function flexibleBalanceDueDay(config, bookingStartAt, timeZone) {
@@ -1259,6 +1327,9 @@ const checkoutCopy = {
1259
1327
  checkoutAssistanceRequired: "We can’t confirm your last payment attempt yet. Please don’t pay again – contact the business so they can check it."
1260
1328
  };
1261
1329
  //#endregion
1330
+ //#region ../commerce/src/purchase/eventCheckoutRecoveryWindow.ts
1331
+ const EVENT_CHECKOUT_HOLD_DURATION_MS = 2100 * 1e3;
1332
+ //#endregion
1262
1333
  //#region ../commerce/src/purchase/roomWords.ts
1263
1334
  const PEOPLE_WORD = {
1264
1335
  guest: "you",
@@ -1313,6 +1384,15 @@ const ROOM_REFUSAL_REASON_MESSAGES = {
1313
1384
  };
1314
1385
  //#endregion
1315
1386
  //#region ../commerce/src/purchase/event-registration-errors.ts
1387
+ /**
1388
+ * Said to a booker whose earlier unfinished booking this one can't replace, because nothing shows the
1389
+ * earlier one is theirs (#1832). They aren't where that booking is, so it can't ask them to pay for it
1390
+ * or cancel it here: it sends them back to where they started, or tells them when the places free up.
1391
+ */
1392
+ function earlierBookingUnpaid(subject, otherwise = "") {
1393
+ return `You’ve already started ${subject === null ? "a booking" : `a booking for ${subject}`} that isn’t paid yet. Go back to where you started it to pay, ${otherwise}or try again in about 40 minutes.`;
1394
+ }
1395
+ earlierBookingUnpaid("this date"), earlierBookingUnpaid("this run");
1316
1396
  const eventRegistrationErrors = {
1317
1397
  invalidAnswers: {
1318
1398
  endsCommand: false,
@@ -1440,12 +1520,50 @@ const eventRegistrationErrors = {
1440
1520
  message: "You’ve already started booking this event. Please finish in the other tab if it’s still open, or check your booking status before starting again.",
1441
1521
  action: "portal"
1442
1522
  },
1523
+ /**
1524
+ * The server's own message says which date or run. This one is only shown if that's missing. The
1525
+ * earlier booking still stands, so the command isn't ended: the same attempt works once the hold lapses.
1526
+ */
1527
+ earlierBookingUnpaid: {
1528
+ endsCommand: false,
1529
+ message: earlierBookingUnpaid(null),
1530
+ action: "retry"
1531
+ },
1532
+ /**
1533
+ * Several dates or runs were chosen where only one can be booked at a time: the event's setting
1534
+ * changed after the form loaded, or the booking uses a waitlist invitation. The server's own message
1535
+ * says which, so this one is only shown if that's missing.
1536
+ */
1537
+ bookOneAtATime: {
1538
+ endsCommand: false,
1539
+ message: "These can’t be booked together. Untick all but one, then book the others separately.",
1540
+ action: "places"
1541
+ },
1443
1542
  invalidCommitInput: {
1444
1543
  endsCommand: false,
1445
1544
  message: "We couldn’t accept your booking details. Please check the information you entered and try again. If this keeps happening, contact the organiser for help.",
1446
1545
  action: "details"
1447
1546
  }
1448
1547
  };
1548
+ /**
1549
+ * The refusals said in the server's own words, because only the server knows what to name. The public
1550
+ * route sends a refusal's reason and never its service tag, so the reason is all a form has to go on.
1551
+ *
1552
+ * - An earlier unpaid booking: the words name the date or run, and say whether there's a date to untick.
1553
+ * - Several chosen where one is allowed: the words say whether it's dates or runs.
1554
+ * - A date or run that filled up while several were being booked: the words name it, so the booker
1555
+ * knows which to untick. One booking has nothing to name, so it keeps the reason's own message.
1556
+ */
1557
+ const serverWordedRefusals = {
1558
+ earlierBookingUnpaid: "always",
1559
+ bookOneAtATime: "always",
1560
+ capacityChanged: "several_bookings"
1561
+ };
1562
+ /** What a refusal says: the server's words where they say more, and the reason's own otherwise or when none came. */
1563
+ function eventRegistrationRefusalMessage(reason, serverMessage, bookings) {
1564
+ const worded = serverWordedRefusals[reason];
1565
+ return (worded === "always" || worded === "several_bookings" && bookings === "several") && serverMessage.trim().length > 0 ? serverMessage : eventRegistrationErrors[reason].message;
1566
+ }
1449
1567
  function parseEventRegistrationErrorReason(value) {
1450
1568
  return typeof value === "string" && Object.prototype.hasOwnProperty.call(eventRegistrationErrors, value) ? value : null;
1451
1569
  }
@@ -2898,7 +3016,7 @@ const headingClassFromAlignment = {
2898
3016
  summary: "Append text alignment class to a base heading class",
2899
3017
  run: (value, options) => {
2900
3018
  const alignClass = (typeof value === "string" && value === "center" ? "center" : "left") === "center" ? "rb-text-center" : "rb-text-left";
2901
- return `${options.base} ${alignClass}`.trim();
3019
+ return `${options.base ?? ""} ${alignClass}`.trim();
2902
3020
  }
2903
3021
  };
2904
3022
  const bodyClassFromAlignment = {
@@ -2907,7 +3025,7 @@ const bodyClassFromAlignment = {
2907
3025
  summary: "Append body alignment helper classes to a base class",
2908
3026
  run: (value, options) => {
2909
3027
  const extra = (typeof value === "string" && value === "center" ? "center" : "left") === "center" ? "rb-mx-auto rb-text-center" : "";
2910
- return `${options.base} ${extra}`.trim();
3028
+ return `${options.base ?? ""} ${extra}`.trim();
2911
3029
  }
2912
3030
  };
2913
3031
  const stackAlignFromAlignment = {
@@ -6552,7 +6670,7 @@ function deriveBookingFormViewState(input) {
6552
6670
  kind: "success",
6553
6671
  resourceName: input.verificationState.resourceName
6554
6672
  };
6555
- default: return assertNever$1(input.verificationState);
6673
+ default: return assertNever$2(input.verificationState);
6556
6674
  }
6557
6675
  }
6558
6676
  function resolveBookingSiteId(siteId, form) {
@@ -6938,7 +7056,7 @@ function formatBookingSubmissionPreparationError(error) {
6938
7056
  case "sliding-amount-out-of-range": return `Please choose an amount within the sliding scale for "${error.serviceTitle}".`;
6939
7057
  case "payment-option-unsupported": return `Service "${error.serviceTitle}" has a payment option that is not supported yet.`;
6940
7058
  case "service-missing-duration": return `Service "${error.serviceTitle}" is missing duration. Please update the service in the dashboard to include a duration (e.g., 30 minutes).`;
6941
- default: return assertNever$1(error);
7059
+ default: return assertNever$2(error);
6942
7060
  }
6943
7061
  }
6944
7062
  const DEFAULT_BOOKING_SUCCESS_COPY = {
@@ -7758,7 +7876,11 @@ function resolveEventRegistrationChoices(events, context, now) {
7758
7876
  const runs = groupPublicEventsByRun(scoped);
7759
7877
  if (context.occurrenceContext || context.subject?.kind === "eventSeries" && context.subject.bookingScope === "whole_series" || runs.length === 1 && scoped.every((event) => event.bookingScope === "whole_series")) return scoped;
7760
7878
  const eligibleRunIds = new Set(runs.filter((group) => resolveWholeSeriesChooserEligibility(group, now).kind === "eligible").map((group) => group.eventSeriesId));
7761
- return scoped.filter((event) => event.bookingScope === "whole_series" ? eligibleRunIds.has(event.seriesId) : Date.parse(event.startsAt) > now.getTime() && !hasEventBookingClosedEarly(event, now));
7879
+ return scoped.filter((event) => event.bookingScope === "whole_series" ? eligibleRunIds.has(event.seriesId) : isUpcomingDateChoice(event, now));
7880
+ }
7881
+ /** A date a new booking can still choose: it hasn't started and its bookings haven't closed. */
7882
+ function isUpcomingDateChoice(event, now) {
7883
+ return Date.parse(event.startsAt) > now.getTime() && !hasEventBookingClosedEarly(event, now);
7762
7884
  }
7763
7885
  //#endregion
7764
7886
  //#region ../blocks/src/system/runtime/nodes/event-registration/closedEarlyCopy.ts
@@ -7856,6 +7978,34 @@ function closedDatesCopy(dates, now) {
7856
7978
  };
7857
7979
  }
7858
7980
  //#endregion
7981
+ //#region ../blocks/src/system/runtime/api/creditProducts.ts
7982
+ function useCasesFromModules(modules) {
7983
+ if (!modules) return [];
7984
+ return [...modules.events ? ["event_pass"] : [], ...modules.appointments ? ["appointment_package"] : []];
7985
+ }
7986
+ function deriveUseCases(products, modules) {
7987
+ if (products.length > 0) return products.map((product) => product.productUseCase);
7988
+ return useCasesFromModules(modules);
7989
+ }
7990
+ function deriveCreditProductLabels(products, options = {}) {
7991
+ const style = options.style ?? "generic";
7992
+ const useCases = deriveUseCases(products, options.modules);
7993
+ const hasEventPass = useCases.includes("event_pass");
7994
+ const hasAppointmentPackage = useCases.includes("appointment_package");
7995
+ if (hasEventPass && hasAppointmentPackage) return {
7996
+ heading: "Passes & Packages",
7997
+ emptyMessage: "You don't have any passes or packages yet."
7998
+ };
7999
+ if (hasAppointmentPackage) return {
8000
+ heading: style === "class" ? "Appointment Packages" : "Packages",
8001
+ emptyMessage: "You don't have any packages yet."
8002
+ };
8003
+ return {
8004
+ heading: style === "class" ? "Class Passes" : "Passes",
8005
+ emptyMessage: "You don't have any passes yet."
8006
+ };
8007
+ }
8008
+ //#endregion
7859
8009
  //#region ../blocks/src/system/runtime/nodes/shop-commerce.shared.ts
7860
8010
  const EMPTY_COMMERCE_CART_STATE = { items: [] };
7861
8011
  const storedProductCartItemSchema = z.object({
@@ -8315,7 +8465,7 @@ function capacityPlacesLabel(source, display, wording) {
8315
8465
  case "low": return formatRemainingPlaces(source, wording);
8316
8466
  case "unlimited": return wording.unlimited ?? null;
8317
8467
  case "open": return wording.open ?? null;
8318
- default: return assertNever$2(remaining);
8468
+ default: return assertNever$3(remaining);
8319
8469
  }
8320
8470
  }
8321
8471
  function hybridPlacesLabel(event, display, wording) {
@@ -8798,6 +8948,26 @@ function courseSchedule(sessions, siteTimeZone, deliveryMode) {
8798
8948
  return `${sessions.length} sessions · ${firstLabel} – ${lastLabel}`;
8799
8949
  }
8800
8950
  /**
8951
+ * A course run's schedule as a row in the list of runs shows it, one line
8952
+ * each: how many sessions, then the span with its times ("Wed 6 Jan – Wed 27
8953
+ * Jan, 6:30pm–8pm"). The times are the first session's; a run's sessions
8954
+ * usually share them.
8955
+ */
8956
+ function formatRunScheduleLines(event) {
8957
+ if (event.registrationSubject.kind !== "wholeSeries") return [];
8958
+ const { sessions } = event.registrationSubject;
8959
+ const first = sessions[0];
8960
+ if (!first) return [];
8961
+ const last = sessions[sessions.length - 1] ?? first;
8962
+ const at = (session) => ({
8963
+ ...session,
8964
+ siteTimeZone: event.siteTimeZone,
8965
+ deliveryMode: event.deliveryMode
8966
+ });
8967
+ const days = sessions.length === 1 ? formatBookingWhen(at(first), "day") : `${formatBookingWhen(at(first), "day")} – ${formatBookingWhen(at(last), "day")}`;
8968
+ return [sessions.length === 1 ? "1 session" : `${sessions.length} sessions`, `${days}, ${formatBookingWhen(at(first), "timeRange")}`];
8969
+ }
8970
+ /**
8801
8971
  * When a booking happens, in one line: the occurrence's date and time, or a
8802
8972
  * course's session count and first and last dates. The default retains the
8803
8973
  * stored end time; an explicitly requested `short` variant shows the start.
@@ -9382,7 +9552,7 @@ function sameOffering(events) {
9382
9552
  }
9383
9553
  function registrationSelectionMode(input) {
9384
9554
  const { events } = input;
9385
- if (input.hasPreSelectedContext || events.length < 2) return SINGLE;
9555
+ if (events.length < 2) return SINGLE;
9386
9556
  if (events.some((event) => event.rooms)) return SINGLE;
9387
9557
  if (!events.every((event) => event.allowsMultipleBooking)) return SINGLE;
9388
9558
  const firstSeriesId = events[0]?.seriesId;
@@ -9523,15 +9693,15 @@ function severalConfirmationSentence(kind, email) {
9523
9693
  }
9524
9694
  const SEVERAL_BOOKINGS_ACCOUNT_NOTE = "You can see and manage your bookings in your account.";
9525
9695
  /**
9526
- * What several items can't use. Runs can't use passes, memberships, or the
9527
- * first run's deposit or instalments. Dates can use a pass or membership
9528
- * (issue 1767, set 6), which the payment step's own options explain, so only a
9529
- * deposit or instalments need saying; otherwise there's no note.
9696
+ * What several items can't use. Runs can't use passes or memberships. Dates
9697
+ * can (issue 1767, set 6), and the payment step's own options explain them, so
9698
+ * there's no note. A deposit or instalments never get this far: an event that
9699
+ * offers one doesn't book several (decision 6).
9530
9700
  */
9531
- function selectionEntitlementNote(kind, hadDepositOrInstalments) {
9701
+ function selectionEntitlementNote(kind) {
9532
9702
  switch (kind) {
9533
- case "dates": return hadDepositOrInstalments ? "Deposits and instalments can be used when you book one date at a time." : null;
9534
- case "runs": return `${hadDepositOrInstalments ? "Deposits, instalments, class passes and memberships" : "Class passes and memberships"} can be used when you book one run at a time.`;
9703
+ case "dates": return null;
9704
+ case "runs": return "Class passes and memberships can be used when you book one run at a time.";
9535
9705
  }
9536
9706
  }
9537
9707
  const NO_RUN_PRICING_CHOICES = {};
@@ -9616,13 +9786,21 @@ function incompleteRunChoiceMessage(input) {
9616
9786
  * item offers, and an item that only runs one way decides it. Items with no
9617
9787
  * way in common can't be booked together.
9618
9788
  */
9789
+ const ATTENDANCE_CHOICE_MESSAGE = "Choose whether you want to attend in person or online.";
9790
+ /**
9791
+ * The visitor still has to say how they'll attend. Places and prices depend
9792
+ * on it, so nothing is quoted until they have.
9793
+ */
9794
+ function attendanceChoicePending(attendance, selected) {
9795
+ return attendance.kind === "choose" && resolveSelectionAttendanceMode(attendance, selected) === null;
9796
+ }
9619
9797
  /**
9620
9798
  * What several runs still need before the tickets step can go on: one way
9621
9799
  * of attending for them all, then a usable ticket or amount for each run.
9622
9800
  */
9623
9801
  function severalRunsChoiceMessage(input) {
9624
9802
  if (input.attendance.kind === "incompatible") return INCOMPATIBLE_ATTENDANCE_MESSAGE;
9625
- if (input.attendance.kind === "choose" && input.facts.attendanceMode === null) return "Choose whether you want to attend in person or online.";
9803
+ if (attendanceChoicePending(input.attendance, input.facts.attendanceMode)) return ATTENDANCE_CHOICE_MESSAGE;
9626
9804
  return incompleteRunChoiceMessage(input);
9627
9805
  }
9628
9806
  function selectionTicketInputs(input) {
@@ -9766,24 +9944,6 @@ function itemPriceCents(input, event) {
9766
9944
  function selectionItemPrice(input) {
9767
9945
  return (event) => itemPriceCents(input, event);
9768
9946
  }
9769
- function decideSelectionPayment(input) {
9770
- const several = severalItemsOf(input.selection);
9771
- if (several === null) return { kind: "one-item" };
9772
- return {
9773
- kind: "several",
9774
- due: selectionCostsNothing(several, input) ? "nothing" : "card"
9775
- };
9776
- }
9777
- function selectionCostsNothing(several, input) {
9778
- switch (several) {
9779
- case "runs": return input.selection.every((run) => runUnitPriceCents(run, runPricingChoice(input.runChoices, run)) === 0);
9780
- case "dates": {
9781
- const first = input.selection[0];
9782
- if (input.eligibility) return input.eligibility.isFree;
9783
- return first !== void 0 && publicEventPricingType(first.pricing) === "free";
9784
- }
9785
- }
9786
- }
9787
9947
  //#endregion
9788
9948
  //#region ../blocks/src/system/runtime/nodes/event-registration/registrationPaymentReturn.ts
9789
9949
  /** On an event with rooms, what was asked for: the room lines come from placement, not from here. */
@@ -10289,48 +10449,6 @@ function buildBookingInstalmentCadenceLabel(plan) {
10289
10449
  return interval === 1 ? unit : `every ${interval} ${unit}`;
10290
10450
  }
10291
10451
  //#endregion
10292
- //#region ../blocks/src/system/runtime/nodes/event-registration/bookingCalendar.ts
10293
- /** Public schedule plus the authorised outcome's arrival text; online access stays in email. */
10294
- function bookingCalendar(event, outcome) {
10295
- if (!event) return null;
10296
- const { identity } = outcome;
10297
- const sessions = event.registrationSubject.kind === "wholeSeries" ? event.registrationSubject.sessions : [{
10298
- occurrenceId: event.registrationSubject.occurrenceId,
10299
- startsAt: event.startsAt,
10300
- endsAt: event.endsAt
10301
- }];
10302
- const bookingId = identity.scope === "occurrence" ? identity.attendeeId : identity.registrationId;
10303
- const entries = sessions.map((session) => ({
10304
- uid: `booking-${bookingId}-${session.occurrenceId}@riverbankcms.com`,
10305
- sequence: 0,
10306
- title: event.title,
10307
- startsAt: new Date(session.startsAt),
10308
- endsAt: new Date(session.endsAt),
10309
- timezone: "UTC",
10310
- status: "confirmed",
10311
- location: identity.attendanceMode === "online" ? "Online" : outcome.arrivalVenues?.[session.occurrenceId] ?? event.venue?.name,
10312
- description: identity.attendanceMode === "online" ? "See your confirmation email for joining instructions." : void 0
10313
- }));
10314
- const first = entries[0];
10315
- if (!first) return null;
10316
- const common = {
10317
- fileName: `${slugify(event.title) || "event"}.ics`,
10318
- feed: {
10319
- timezone: "UTC",
10320
- entries
10321
- }
10322
- };
10323
- return entries.length === 1 ? {
10324
- ...common,
10325
- kind: "single",
10326
- ...calendarLinks(first)
10327
- } : {
10328
- ...common,
10329
- kind: "sessions",
10330
- sessionCount: entries.length
10331
- };
10332
- }
10333
- //#endregion
10334
10452
  //#region ../blocks/src/system/runtime/nodes/event-registration/registrationEventAdapter.ts
10335
10453
  function toRegistrationEvent(event) {
10336
10454
  return {
@@ -10404,7 +10522,7 @@ function confirmationPaymentRows(payment) {
10404
10522
  case "none": return [];
10405
10523
  case "settled": return payment.rows;
10406
10524
  case "due": return [...payment.paidRows, payment.amountDueRow];
10407
- default: return assertNever$2(payment);
10525
+ default: return assertNever$3(payment);
10408
10526
  }
10409
10527
  }
10410
10528
  function row(label, value) {
@@ -10416,20 +10534,21 @@ function row(label, value) {
10416
10534
  function placesLabel(count) {
10417
10535
  return count === 1 ? "1 place" : `${count} places`;
10418
10536
  }
10419
- function duePayment(balance, currency, paidRows, instructions) {
10537
+ function duePayment(balance, currency, paidRows, instructions, dueDay) {
10538
+ const amount = formatPrice(balance.amountCents, currency);
10420
10539
  return {
10421
10540
  kind: "due",
10422
10541
  paidRows,
10423
10542
  amountDueRow: {
10424
10543
  label: "Still to pay",
10425
- value: formatPrice(balance.amountCents, currency)
10544
+ value: balance.dueAt !== null && dueDay ? `${amount} by ${dueDay(balance.dueAt)}` : amount
10426
10545
  },
10427
10546
  instructions
10428
10547
  };
10429
10548
  }
10430
10549
  /** Every evidenced debt carries its required amount row, independently of success prose. */
10431
- function presentConfirmationPayment(payment) {
10432
- const presentation = presentPayment(payment);
10550
+ function presentConfirmationPayment(payment, dueDay = null) {
10551
+ const presentation = presentPayment(payment, dueDay);
10433
10552
  if (!payment.discount) return presentation;
10434
10553
  const discountRow = {
10435
10554
  label: `Discount code ${payment.discount.code}`,
@@ -10450,32 +10569,62 @@ function presentConfirmationPayment(payment) {
10450
10569
  };
10451
10570
  }
10452
10571
  }
10453
- function presentPayment(payment) {
10572
+ function presentPayment(payment, dueDay) {
10454
10573
  switch (payment.kind) {
10455
- case "free":
10574
+ case "free": return {
10575
+ kind: "settled",
10576
+ rows: row("Payment", "Free")
10577
+ };
10456
10578
  case "waived": return {
10457
10579
  kind: "settled",
10458
- rows: []
10580
+ rows: row("Payment", "Nothing to pay")
10459
10581
  };
10460
10582
  case "pass": return presentPassPayment(payment);
10461
10583
  case "membership": return {
10462
10584
  kind: "settled",
10463
10585
  rows: row("Paid with", payment.membershipName?.trim() || "Membership")
10464
10586
  };
10465
- case "manual_due": return duePayment(payment.balance, payment.currency, [], OFFLINE_BOOKING_PAYMENT_INSTRUCTIONS);
10587
+ case "manual_due": return duePayment(payment.balance, payment.currency, [], paymentInstructions(payment), dueDay);
10466
10588
  case "monetary":
10467
10589
  case "managed_balance_due": {
10468
10590
  const paidRows = row("Paid", payment.amountPaidCents > 0 ? formatPrice(payment.amountPaidCents, payment.currency) : null);
10469
10591
  return payment.balance.kind === "settled" ? {
10470
10592
  kind: "settled",
10471
10593
  rows: paidRows
10472
- } : duePayment(payment.balance, payment.currency, paidRows, payment.kind === "monetary" && payment.paymentMethod === "manual" ? OFFLINE_BOOKING_PAYMENT_INSTRUCTIONS : null);
10594
+ } : duePayment(payment.balance, payment.currency, paidRows, paymentInstructions(payment), dueDay);
10473
10595
  }
10474
- default: return assertNever$2(payment);
10596
+ default: return assertNever$3(payment);
10475
10597
  }
10476
10598
  }
10599
+ /** How to pay what's still owed: only money paid to the organiser directly has instructions. */
10600
+ function paymentInstructions(payment) {
10601
+ return payment.kind === "manual_due" || payment.kind === "monetary" && payment.paymentMethod === "manual" ? OFFLINE_BOOKING_PAYMENT_INSTRUCTIONS : null;
10602
+ }
10603
+ function isOwed(payment) {
10604
+ return payment.balance.kind === "due" && "currency" in payment;
10605
+ }
10606
+ /**
10607
+ * What several bookings still owe in all, worded as one booking's debt is:
10608
+ * the dates paid by card, pass or membership owe nothing, so only the rest
10609
+ * count. Nothing's said when a date's details didn't load, so the total is
10610
+ * never short, and a due date is given only when every debt shares it.
10611
+ */
10612
+ function severalOwed(outcomes, dueDay) {
10613
+ const owed = (detailedPayments(outcomes) ?? []).filter(isOwed);
10614
+ const [first] = owed;
10615
+ if (!first || owed.some((payment) => payment.currency !== first.currency)) return { kind: "none" };
10616
+ const amountCents = parsePositiveCents(owed.reduce((sum, payment) => sum + payment.balance.amountCents, 0));
10617
+ if (!amountCents.ok) return { kind: "none" };
10618
+ const dueAt = owed.every((payment) => payment.balance.dueAt === first.balance.dueAt) ? first.balance.dueAt : null;
10619
+ const instructions = owed.map(paymentInstructions).find((text) => text !== null) ?? null;
10620
+ return duePayment({
10621
+ kind: "due",
10622
+ amountCents: amountCents.value,
10623
+ dueAt
10624
+ }, first.currency, [], instructions, dueDay);
10625
+ }
10477
10626
  /** Places and payment, only when the outcome carries the booking's details. */
10478
- function outcomeFacts(outcome) {
10627
+ function outcomeFacts(outcome, dueDay) {
10479
10628
  switch (outcome.kind) {
10480
10629
  case "detailsUnavailable": return {
10481
10630
  places: null,
@@ -10487,10 +10636,10 @@ function outcomeFacts(outcome) {
10487
10636
  return {
10488
10637
  places,
10489
10638
  rows: row("Places", places === null ? null : String(places)),
10490
- payment: presentConfirmationPayment(outcome.payment)
10639
+ payment: presentConfirmationPayment(outcome.payment, dueDay)
10491
10640
  };
10492
10641
  }
10493
- default: return assertNever$2(outcome);
10642
+ default: return assertNever$3(outcome);
10494
10643
  }
10495
10644
  }
10496
10645
  function scheduleRows(event, when, where, display) {
@@ -10537,7 +10686,7 @@ function oneBooking(result, context) {
10537
10686
  const { identity } = result.outcome;
10538
10687
  const event = findBookedEvent(context.events, identity);
10539
10688
  const dates = entryFacts(event);
10540
- const facts = outcomeFacts(result.outcome);
10689
+ const facts = outcomeFacts(result.outcome, eventDueDay(event));
10541
10690
  const totalPlaces = completedBookingPlaces(context.completedOutcomes, identity);
10542
10691
  const where = identity.attendanceMode === "online" ? "none" : "venue";
10543
10692
  const arrival = identity.attendanceMode === "in_person" && context.display.venue === "shown" ? [...new Set(Object.values(result.outcome.arrivalVenues ?? {}))].join("\n\n") : "";
@@ -10576,17 +10725,28 @@ function severalBookings(result, outcomes, context) {
10576
10725
  ...placesOnEachRow(several, outcomes),
10577
10726
  ...severalFundingRow(outcomes)
10578
10727
  ],
10579
- payment: withSubmissionPayment({ kind: "none" }, result.submissionPayment),
10728
+ payment: withSubmissionPayment(severalOwed(outcomes, eventDueDay(firstEvent(outcomes, context))), result.submissionPayment),
10580
10729
  calendar: null,
10581
10730
  several,
10582
10731
  creditsLeftSentence: creditsLeftSentence(outcomes, result.passCreditsRemaining)
10583
10732
  };
10584
10733
  }
10734
+ /** A balance's due day in the booked event's own dates. */
10735
+ function eventDueDay(event) {
10736
+ return event ? (dueAt) => formatBookingWhen({
10737
+ ...event,
10738
+ startsAt: dueAt,
10739
+ endsAt: null
10740
+ }, "day") : null;
10741
+ }
10742
+ function firstEvent(outcomes, context) {
10743
+ return outcomes[0] ? findBookedEvent(context.events, outcomes[0].identity) : null;
10744
+ }
10585
10745
  /** "3 dates from Mon 9 Nov" on the card and bar, with the first booking's places. */
10586
10746
  function severalEntry(several, outcomes, first, context) {
10587
- const firstEvent = outcomes[0] ? findBookedEvent(context.events, outcomes[0].identity) : null;
10747
+ const event = firstEvent(outcomes, context);
10588
10748
  const count = `${outcomes.length} ${several === "runs" ? "runs" : "dates"}`;
10589
- const when = firstEvent ? `${count} from ${formatBookingWhen(firstEvent, "day")}` : count;
10749
+ const when = event ? `${count} from ${formatBookingWhen(event, "day")}` : count;
10590
10750
  return {
10591
10751
  ...first,
10592
10752
  when,
@@ -10642,13 +10802,13 @@ function fundingGroup(payment) {
10642
10802
  case "store_credit": return "paid with account credit";
10643
10803
  case "mixed": return "paid by card and account credit";
10644
10804
  case "manual": return null;
10645
- default: return assertNever$2(payment.paymentMethod);
10805
+ default: return assertNever$3(payment.paymentMethod);
10646
10806
  }
10647
10807
  case "free":
10648
10808
  case "waived": return "free of charge";
10649
10809
  case "manual_due":
10650
10810
  case "managed_balance_due": return null;
10651
- default: return assertNever$2(payment);
10811
+ default: return assertNever$3(payment);
10652
10812
  }
10653
10813
  }
10654
10814
  function detailedPayments(outcomes) {
@@ -10725,7 +10885,7 @@ function resolveFinishedPresentation(presentation, context) {
10725
10885
  case "paymentStatus":
10726
10886
  case "paymentFailed":
10727
10887
  case "error": return presentation;
10728
- default: return assertNever$2(presentation);
10888
+ default: return assertNever$3(presentation);
10729
10889
  }
10730
10890
  }
10731
10891
  /** Entitlement confirmations name what was spent and the balance, when supplied. */
@@ -11062,7 +11222,7 @@ function findPreSelectedEvent(input) {
11062
11222
  startsAt: occurrenceContext.startsAt,
11063
11223
  timeZone: occurrenceContext.timeZone
11064
11224
  }));
11065
- return input.scopedEvents.find((event) => eventMatchesOccurrenceId(event, occurrenceContext.id) || getBookingLocalDateKey(toScheduledBookingDateTime({
11225
+ return input.scopedEvents.find((event) => eventMatchesOccurrenceId(event, occurrenceContext.id)) ?? input.scopedEvents.find((event) => getBookingLocalDateKey(toScheduledBookingDateTime({
11066
11226
  startsAt: event.startsAt,
11067
11227
  timeZone: event.timeZone
11068
11228
  })) === contextDate) ?? null;
@@ -11143,7 +11303,7 @@ function findClaimEvent(subject, events) {
11143
11303
  switch (subject.kind) {
11144
11304
  case "event_occurrence": return findEventByOccurrenceId(events, subject.occurrenceId);
11145
11305
  case "whole_series": return events.find((event) => event.registrationSubject.kind === "wholeSeries" && event.registrationSubject.eventSeriesId === subject.eventSeriesId) ?? null;
11146
- default: return assertNever$1(subject);
11306
+ default: return assertNever$2(subject);
11147
11307
  }
11148
11308
  }
11149
11309
  /** Reserved quantities and amounts have one interpretation across restoration and submission. */
@@ -11159,7 +11319,7 @@ function claimedPlaces(subject) {
11159
11319
  ticketSelections: subject.ticketSelections,
11160
11320
  slidingAmountInput: subject.selectedSlidingAmount === null ? null : formatCentsAsCurrencyInput(subject.selectedSlidingAmount)
11161
11321
  };
11162
- default: return assertNever$1(subject);
11322
+ default: return assertNever$2(subject);
11163
11323
  }
11164
11324
  }
11165
11325
  /** The tickets they're booking: the reserved ones, or what they've chosen for the places held. */
@@ -11275,7 +11435,7 @@ function editRegistrationDraft(draft, edit) {
11275
11435
  ...draft,
11276
11436
  selectedSlidingAmountInput: updated(draft.selectedSlidingAmountInput, edit.value)
11277
11437
  };
11278
- default: return assertNever$1(edit);
11438
+ default: return assertNever$2(edit);
11279
11439
  }
11280
11440
  }
11281
11441
  /** Ready invitations own their reserved selection; identity fields remain editable. */
@@ -11337,10 +11497,96 @@ function invitationSubmission(invitation) {
11337
11497
  kind: "blocked",
11338
11498
  message: invitation.message
11339
11499
  };
11340
- default: return assertNever$1(invitation);
11500
+ default: return assertNever$2(invitation);
11341
11501
  }
11342
11502
  }
11343
11503
  //#endregion
11504
+ //#region ../blocks/src/system/runtime/nodes/event-registration/registrationEntry.ts
11505
+ function decideRegistrationEntry(input) {
11506
+ const event = findPreSelectedEvent({
11507
+ scopedEvents: input.events,
11508
+ occurrenceContext: input.occurrenceContext
11509
+ });
11510
+ if (!input.occurrenceContext && !event) return {
11511
+ kind: "chooseEvent",
11512
+ choices: input.events
11513
+ };
11514
+ if (input.offer === "eventsAsGiven") return {
11515
+ kind: "pageDate",
11516
+ event,
11517
+ choices: input.events
11518
+ };
11519
+ if (!event) return {
11520
+ kind: "pageDate",
11521
+ event,
11522
+ choices: input.events
11523
+ };
11524
+ const moreDates = input.occurrenceContext ? addableDates(event, input) : [];
11525
+ const [first, ...rest] = moreDates;
11526
+ return first ? {
11527
+ kind: "pageDateAndMore",
11528
+ event,
11529
+ moreDates: [first, ...rest],
11530
+ choices: [event, ...moreDates]
11531
+ } : {
11532
+ kind: "pageDate",
11533
+ event,
11534
+ choices: [event]
11535
+ };
11536
+ }
11537
+ /**
11538
+ * The class's other dates a visitor could add to the page's date, as the
11539
+ * class's own page lists them, or none when the page's date books on its own:
11540
+ * a return to finish a booking, a date that can't be ticked, a class that
11541
+ * doesn't book several dates or has rooms, or no other date open to book.
11542
+ */
11543
+ function addableDates(pageDate, input) {
11544
+ if (input.arrival !== "none") return [];
11545
+ if (pageDate.registrationSubject.kind !== "occurrence") return [];
11546
+ if (selectionRowAvailability(pageDate) !== "open" || !isUpcomingDateChoice(pageDate, input.now)) return [];
11547
+ const others = input.events.filter((event) => event.selectionId !== pageDate.selectionId && event.seriesId === pageDate.seriesId && isUpcomingDateChoice(event, input.now));
11548
+ const mode = registrationSelectionMode({ events: [pageDate, ...others] });
11549
+ if (mode.kind !== "several" || mode.items !== "dates") return [];
11550
+ return others.some((event) => selectionRowAvailability(event) === "open") ? others : [];
11551
+ }
11552
+ /** Whether the route starts by choosing (and so Back and "Change dates" lead there). */
11553
+ function entryChoosesEvent(entry) {
11554
+ return entry.kind !== "pageDate";
11555
+ }
11556
+ /** The date this page is about, if it names one the events include. */
11557
+ function entryPageEvent(entry) {
11558
+ return entry.kind === "chooseEvent" ? null : entry.event;
11559
+ }
11560
+ /** A booking that starts by choosing, with nothing ticked. */
11561
+ const CHOOSING_START = {
11562
+ step: "select-event",
11563
+ event: null
11564
+ };
11565
+ /** A booking that starts on Tickets, before the page's date is known. */
11566
+ const TICKETS_START = {
11567
+ step: "select-tickets",
11568
+ event: null
11569
+ };
11570
+ function entryStart(entry) {
11571
+ return {
11572
+ ...entryChoosesEvent(entry) ? CHOOSING_START : TICKETS_START,
11573
+ event: entryPageEvent(entry)
11574
+ };
11575
+ }
11576
+ function entrySelectionMode(entry) {
11577
+ return entry.kind === "pageDate" ? { kind: "single" } : registrationSelectionMode({ events: entry.choices });
11578
+ }
11579
+ /**
11580
+ * The page's occurrence names the booking only while the booking is for the
11581
+ * page's date: a date page that lets the visitor tick others books those as
11582
+ * themselves.
11583
+ */
11584
+ function bookingOccurrenceContext(occurrenceContext, pageEvent, selection) {
11585
+ const primary = selection[0];
11586
+ if (!occurrenceContext) return null;
11587
+ return !primary || primary.selectionId === pageEvent?.selectionId ? occurrenceContext : null;
11588
+ }
11589
+ //#endregion
11344
11590
  //#region ../blocks/src/system/runtime/nodes/event-registration/registrationBrowserDraft.ts
11345
11591
  const browserDraftSteps = [
11346
11592
  "select-event",
@@ -11353,12 +11599,13 @@ const BROWSER_DRAFT_LIFETIME_MS = 10800 * 1e3;
11353
11599
  /**
11354
11600
  * An allowlist of what the booker typed or chose, kept in this tab only, for
11355
11601
  * `BROWSER_DRAFT_LIFETIME_MS`: the selection and tickets, their contact
11356
- * details, the guests' names and contact details, and their answers to the
11602
+ * details, the rooms they asked for and, for a signed-in customer only, their
11603
+ * note ("Anything we should know?"), the guests' names and contact details, and their answers to the
11357
11604
  * questions, by question ID (`BookingQuestionsTabDraft`: plain answers only,
11358
11605
  * never file uploads, and dropped on restore if the question has gone or
11359
11606
  * changed kind), once for the selection or per run when runs ask their own.
11360
11607
  * `owner` is whoever was signed in (or nobody) when it was saved: contact,
11361
- * guests and answers come back only to that same visitor. Notes, the terms agreement, payment choices and anything
11608
+ * the note, guests and answers come back only to that same visitor. The terms agreement, payment choices and anything
11362
11609
  * else payment-related never go to storage. The discount code is its text
11363
11610
  * only, never a price or amount, and the server checks it again on restore.
11364
11611
  */
@@ -11377,11 +11624,14 @@ const registrationBrowserDraftSchema = z.object({
11377
11624
  pricingOptionId: z.string().nullable(),
11378
11625
  slidingAmountInput: z.string()
11379
11626
  })),
11627
+ roomChoices: roomChoicesSchema.default([]),
11628
+ reviewedRooms: reviewedRoomsSchema.default([]),
11380
11629
  contact: z.object({
11381
11630
  name: z.string(),
11382
11631
  email: z.string(),
11383
11632
  phone: z.string()
11384
11633
  }),
11634
+ notes: z.string().default(""),
11385
11635
  discountCode: z.string().default(""),
11386
11636
  guests: z.array(z.object({
11387
11637
  name: z.string(),
@@ -11395,11 +11645,24 @@ const registrationBrowserDraftSchema = z.object({
11395
11645
  function isBrowserDraftStep(step) {
11396
11646
  return browserDraftSteps.some((candidate) => candidate === step);
11397
11647
  }
11648
+ /**
11649
+ * The note ("Anything we should know?") often holds health details, so it's
11650
+ * kept only for a signed-in customer. A signed-out draft could be opened by the
11651
+ * next person on a shared device, such as a studio's front-desk tablet.
11652
+ */
11653
+ function keepsNote(owner) {
11654
+ return owner.kind === "session";
11655
+ }
11656
+ /** The saved note to put back, or nothing for a signed-out draft (including one saved before this rule). */
11657
+ function restoredNote(saved) {
11658
+ return keepsNote(saved.owner) ? { notes: saved.notes } : {};
11659
+ }
11398
11660
  function registrationBrowserDraft(flow, discountCode, identity) {
11399
11661
  if (!isBrowserDraftStep(flow.step)) return null;
11400
11662
  const { draft } = flow;
11663
+ const owner = bookingQuestionsOwnerOf(identity);
11401
11664
  return {
11402
- owner: bookingQuestionsOwnerOf(identity),
11665
+ owner,
11403
11666
  step: flow.step,
11404
11667
  selectedEventIds: draft.selection.map((event) => event.selectionId),
11405
11668
  placeCount: flow.placeCount,
@@ -11407,11 +11670,14 @@ function registrationBrowserDraft(flow, discountCode, identity) {
11407
11670
  selectedSlidingAmountInput: draft.selectedSlidingAmountInput,
11408
11671
  selectedAttendanceMode: draft.selectedAttendanceMode,
11409
11672
  runChoices: draft.runChoices,
11673
+ roomChoices: [...draft.roomChoices],
11674
+ reviewedRooms: [...draft.reviewedRooms],
11410
11675
  contact: {
11411
11676
  name: draft.formData.name,
11412
11677
  email: draft.formData.email,
11413
11678
  phone: draft.formData.phone
11414
11679
  },
11680
+ notes: keepsNote(owner) ? draft.formData.notes : "",
11415
11681
  discountCode,
11416
11682
  guests: draft.guests.map(({ name, email, phone }) => ({
11417
11683
  name,
@@ -11462,7 +11728,8 @@ function restoreRegistrationBrowserDraft(state, saved, events, identity) {
11462
11728
  const theirs = isBookingQuestionsOwner(saved.owner, identity);
11463
11729
  const contact = theirs ? {
11464
11730
  ...state.draft.formData,
11465
- ...saved.contact
11731
+ ...saved.contact,
11732
+ ...restoredNote(saved)
11466
11733
  } : state.draft.formData;
11467
11734
  if (selection.length !== saved.selectedEventIds.length) return {
11468
11735
  ...state,
@@ -11486,7 +11753,9 @@ function restoreRegistrationBrowserDraft(state, saved, events, identity) {
11486
11753
  selectedTicketLines: saved.selectedTicketLines,
11487
11754
  selectedSlidingAmountInput: saved.selectedSlidingAmountInput,
11488
11755
  selectedAttendanceMode: resolveSelectionAttendanceMode(decideSelectionAttendance(selection.length ? selection : state.draft.selection), saved.selectedAttendanceMode),
11489
- runChoices: saved.runChoices
11756
+ runChoices: saved.runChoices,
11757
+ roomChoices: saved.roomChoices,
11758
+ reviewedRooms: saved.reviewedRooms
11490
11759
  }
11491
11760
  };
11492
11761
  }
@@ -11556,7 +11825,7 @@ function buildBookingPaymentOptionViewModel(input) {
11556
11825
  ...input,
11557
11826
  option: input.option
11558
11827
  });
11559
- default: return assertNever$1(input.option);
11828
+ default: return assertNever$2(input.option);
11560
11829
  }
11561
11830
  }
11562
11831
  function depositPolicy(refundability) {
@@ -11750,7 +12019,7 @@ function projectReviewedBookingCollectionMoney(facts, terms) {
11750
12019
  };
11751
12020
  case "upfront":
11752
12021
  case "deferred_manual": return money;
11753
- default: return assertNever$1(facts);
12022
+ default: return assertNever$2(facts);
11754
12023
  }
11755
12024
  }
11756
12025
  function requireReviewedLaterPaymentAmount(terms, index) {
@@ -11936,7 +12205,7 @@ function resolveHeadlessEventRegistrationStatus(wizard) {
11936
12205
  case "select-tickets":
11937
12206
  case "enter-details":
11938
12207
  case "select-payment": return { tag: "ready" };
11939
- default: return assertNever$1(wizard.flow);
12208
+ default: return assertNever$2(wizard.flow);
11940
12209
  }
11941
12210
  }
11942
12211
  const BOOKING_CLOSED_MESSAGE = "Booking is currently closed for this event. Please contact the organiser if you’d like to find out more.";
@@ -11991,7 +12260,7 @@ function resolveHeadlessEventRegistrationView(wizard) {
11991
12260
  case "select-payment":
11992
12261
  case "submitting":
11993
12262
  case "payment": return { kind: "form" };
11994
- default: return assertNever$1(wizard.flow);
12263
+ default: return assertNever$2(wizard.flow);
11995
12264
  }
11996
12265
  }
11997
12266
  function deriveEventRegistrationSteps(input) {
@@ -12055,7 +12324,7 @@ function resolveRegistrationAdmission(input) {
12055
12324
  if (input.eligibilityLoading) return { kind: "checking" };
12056
12325
  if (input.eligibilityError) return {
12057
12326
  kind: "closed",
12058
- reason: "optionsUnavailable",
12327
+ reason: input.bookingsClosed ? "bookingsClosed" : "optionsUnavailable",
12059
12328
  message: input.eligibilityError
12060
12329
  };
12061
12330
  if (!input.eligibility) return { kind: "checking" };
@@ -12067,15 +12336,22 @@ function resolveRegistrationAdmission(input) {
12067
12336
  message: "You're already on the waitlist for this event."
12068
12337
  };
12069
12338
  const admission = admissionFromAvailability(availability, input.isAuthenticated, input.businessName);
12070
- return admission.kind === "open" && input.severalRunsNeedCard ? admissionWithCardDue(input.eligibility.onlinePayments, input.businessName) : admission;
12339
+ return admission.kind === "open" && input.selectionPayment ? admissionForSelectionPayment(input.selectionPayment, input.businessName) : admission;
12071
12340
  }
12072
- /** Several runs whose total has to go to card payment (issue 1725), priced from every run. */
12073
- function severalRunsNeedCard(several, payment) {
12074
- return several === "runs" && payment.kind === "several" && payment.due === "card";
12075
- }
12076
- /** An open selection that has to go to card payment, which the site may not be able to take. */
12077
- function admissionWithCardDue(onlinePayments, businessName) {
12078
- return onlinePayments?.kind === "unavailable" ? cannotBookOnline(businessName, onlinePayments.organiserContact) : { kind: "open" };
12341
+ /** The checkout refusal's words, for a selection the page shouldn't have offered together. */
12342
+ const BOOK_SEPARATELY_MESSAGE = "These can’t be booked together. Book them one at a time.";
12343
+ /** An open selection the server says can't be paid: the site can't take the money, or the items' ways to pay don't combine. */
12344
+ function admissionForSelectionPayment(payment, businessName) {
12345
+ switch (payment.kind) {
12346
+ case "bookable": return { kind: "open" };
12347
+ case "cannotBookOnline": return cannotBookOnline(businessName, payment.organiserContact ?? void 0);
12348
+ case "bookSeparately": return {
12349
+ kind: "closed",
12350
+ reason: "unavailable",
12351
+ message: BOOK_SEPARATELY_MESSAGE
12352
+ };
12353
+ case "noPaymentOption": return cannotBookOnline(businessName, void 0);
12354
+ }
12079
12355
  }
12080
12356
  /** The site can't take this payment now, so the client books with the business instead. */
12081
12357
  function cannotBookOnline(businessName, contact) {
@@ -12142,6 +12418,7 @@ function settledRemainingPlaces(eligibility) {
12142
12418
  function closedAdmissionLabel(reason) {
12143
12419
  switch (reason) {
12144
12420
  case "alreadyWaitlisted": return "Already on waitlist";
12421
+ case "bookingsClosed": return "Bookings closed";
12145
12422
  case "optionsUnavailable": return "Couldn’t load times";
12146
12423
  case "unavailable": return "Can’t book online";
12147
12424
  }
@@ -12152,7 +12429,7 @@ function closedAdmissionLabel(reason) {
12152
12429
  * form shows no places to choose and no button to press.
12153
12430
  */
12154
12431
  function registrationStopsHere(admission) {
12155
- return admission.kind === "closed" && admission.reason === "unavailable";
12432
+ return admission.kind === "closed" && (admission.reason === "unavailable" || admission.reason === "bookingsClosed");
12156
12433
  }
12157
12434
  function resolveRegistrationAvailabilityBlocker(admission) {
12158
12435
  switch (admission.kind) {
@@ -12420,6 +12697,63 @@ function toEventDirectPaymentOption(option, mode, totalCents) {
12420
12697
  };
12421
12698
  }
12422
12699
  }
12700
+ /**
12701
+ * Several items' ways to pay, as the server's answer collects their money:
12702
+ * in full by card, or directly with the business, each booking owing its own
12703
+ * amount. Nothing here resolves terms; the answer already did.
12704
+ */
12705
+ function buildSelectionCollectionOptions(input) {
12706
+ const choice = input.collections.length > 1;
12707
+ return input.collections.flatMap((collection) => {
12708
+ const totalCents = input.orderTotalCents ?? collection.amountCents;
12709
+ switch (collection.kind) {
12710
+ case "upfront": return [payInFullOption(collection.currency, totalCents, choice)];
12711
+ case "deferred_manual": return [payDirectlyOption(collection, totalCents, input.itemLabel)];
12712
+ case "instalment_plan":
12713
+ case "flexible_balance": return [];
12714
+ }
12715
+ });
12716
+ }
12717
+ function payInFullOption(currency, totalCents, choice) {
12718
+ const { title: _title, ...copy } = buildUpfrontBookingPaymentOptionCopy(formatPrice(totalCents, currency));
12719
+ return {
12720
+ ...copy,
12721
+ ...summaryFor({
12722
+ totalCents,
12723
+ dueTodayCents: totalCents,
12724
+ currency
12725
+ }),
12726
+ kind: "upfront",
12727
+ presentationKind: "upfront",
12728
+ flexibleBalance: null,
12729
+ label: choice ? "Pay in full now" : "Pay by card",
12730
+ totalCents,
12731
+ configuredPaymentDueNowCents: totalCents
12732
+ };
12733
+ }
12734
+ /** One pay-directly choice, listing what each booking owes when their prices add up to the total. */
12735
+ function payDirectlyOption(collection, totalCents, itemLabel) {
12736
+ const { title, ...copy } = buildDeferredManualBookingPaymentOptionCopy();
12737
+ const termRows = (totalCents === collection.amountCents ? collection.bookings ?? [] : []).map((booking) => ({
12738
+ label: itemLabel(booking.itemId),
12739
+ value: formatPrice(booking.amountCents, collection.currency)
12740
+ }));
12741
+ return {
12742
+ ...copy,
12743
+ ...summaryFor({
12744
+ totalCents,
12745
+ dueTodayCents: 0,
12746
+ currency: collection.currency,
12747
+ termRows
12748
+ }),
12749
+ kind: "deferred_manual",
12750
+ presentationKind: "deferred_manual",
12751
+ flexibleBalance: null,
12752
+ label: title,
12753
+ totalCents,
12754
+ configuredPaymentDueNowCents: 0
12755
+ };
12756
+ }
12423
12757
  function resolveEventRegistrationDirectPaymentSelection(input) {
12424
12758
  if (input.selection.method !== null && input.selection.method !== "stripe") return { kind: "not-stripe" };
12425
12759
  const [onlyOption, ...otherOptions] = input.options;
@@ -12463,24 +12797,10 @@ function decideEventRegistrationPayment(input) {
12463
12797
  },
12464
12798
  directPaymentOptions: input.directPaymentOptions,
12465
12799
  canShowDirectPaymentOptions: input.directPaymentOptions.length > 0,
12466
- ...selectionPaymentPresentation(input.selectionPayment, input.eligibility)
12800
+ paysNothing: input.paysNothing,
12801
+ offersEntitlements: input.offersEntitlements
12467
12802
  };
12468
12803
  }
12469
- /** Whether nothing is due, and whether passes and memberships are offered, for the whole selection. */
12470
- function selectionPaymentPresentation(payment, eligibility) {
12471
- switch (payment.kind) {
12472
- case "one-item": return {
12473
- paysNothing: eligibility?.isFree ?? false,
12474
- offersEntitlements: true,
12475
- paysInFullBecauseSeveral: false
12476
- };
12477
- case "several": return {
12478
- paysNothing: payment.due === "nothing",
12479
- offersEntitlements: false,
12480
- paysInFullBecauseSeveral: payment.due === "card" && (eligibility?.paymentOptions ?? []).some((option) => option.kind === "flexibleBalance" || option.kind === "instalmentPlan")
12481
- };
12482
- }
12483
- }
12484
12804
  /**
12485
12805
  * Label for the button that acts on the chosen payment method.
12486
12806
  *
@@ -12518,6 +12838,356 @@ function shouldPromptForLogin(status, isAuthenticated, eligibility) {
12518
12838
  return Boolean(status === "not-eligible" && !isAuthenticated && eligibility && (eligibility.requiresAuthForPasses || eligibility.requiresAuthForMemberships));
12519
12839
  }
12520
12840
  //#endregion
12841
+ //#region ../blocks/src/system/runtime/nodes/event-registration/useSelectionFunding.state.ts
12842
+ /**
12843
+ * How the dates are paid, one date or several (issue 1767, sets 6 and 7). The server
12844
+ * plans every option, its order and the one to select; the block keeps which one
12845
+ * the visitor picked and sends that option back with the split it showed.
12846
+ */
12847
+ /** The pass or membership an entitlement option uses, as the server names it on submit. */
12848
+ function entitlementSource(entitlement) {
12849
+ switch (entitlement.kind) {
12850
+ case "ownedPass": return {
12851
+ kind: "ownedPass",
12852
+ passId: entitlement.passId
12853
+ };
12854
+ case "ownedMembership": return {
12855
+ kind: "ownedMembership",
12856
+ membershipId: entitlement.membershipId
12857
+ };
12858
+ case "buyPass": return {
12859
+ kind: "buyPass",
12860
+ productId: entitlement.productId
12861
+ };
12862
+ case "buyMembership": return {
12863
+ kind: "buyMembership",
12864
+ productId: entitlement.productId
12865
+ };
12866
+ default: return assertNever$2(entitlement);
12867
+ }
12868
+ }
12869
+ function sourceKey(source) {
12870
+ switch (source.kind) {
12871
+ case "ownedPass": return `ownedPass:${source.passId}`;
12872
+ case "ownedMembership": return `ownedMembership:${source.membershipId}`;
12873
+ case "buyPass": return `buyPass:${source.productId}`;
12874
+ case "buyMembership": return `buyMembership:${source.productId}`;
12875
+ default: return assertNever$2(source);
12876
+ }
12877
+ }
12878
+ /** One key per option, so a pick survives a refetch that still offers it. */
12879
+ function fundingPickKey(pick) {
12880
+ switch (pick.kind) {
12881
+ case "money": return "money";
12882
+ case "entitlement": return sourceKey(pick.source);
12883
+ default: return assertNever$2(pick);
12884
+ }
12885
+ }
12886
+ function fundingOptionPick(option) {
12887
+ switch (option.kind) {
12888
+ case "money": return { kind: "money" };
12889
+ case "entitlement": return {
12890
+ kind: "entitlement",
12891
+ source: entitlementSource(option.entitlement)
12892
+ };
12893
+ default: return assertNever$2(option);
12894
+ }
12895
+ }
12896
+ function fundingOptionKey(option) {
12897
+ return fundingPickKey(fundingOptionPick(option));
12898
+ }
12899
+ function findOption(funding, pick) {
12900
+ const key = fundingPickKey(pick);
12901
+ return funding.options.find((option) => fundingOptionKey(option) === key);
12902
+ }
12903
+ /** The picked option, or the server's own selection when the pick isn't offered. */
12904
+ function chosenFundingOption(funding, pick) {
12905
+ return findOption(funding, pick) ?? findOption(funding, funding.selected) ?? funding.options[0];
12906
+ }
12907
+ /** The dates the option charges money for, earliest first. */
12908
+ function fundingMoneyDates(option) {
12909
+ switch (option.kind) {
12910
+ case "money": return option.moneyDates;
12911
+ case "entitlement": return option.uncovered.map((date) => date.occurrenceId);
12912
+ default: return assertNever$2(option);
12913
+ }
12914
+ }
12915
+ /** What submit sends: the option's source and the split the visitor saw. */
12916
+ function fundingChoice(option) {
12917
+ switch (option.kind) {
12918
+ case "money": return { kind: "money" };
12919
+ case "entitlement": return {
12920
+ kind: "entitlement",
12921
+ source: entitlementSource(option.entitlement),
12922
+ expected: {
12923
+ covered: [...option.covered],
12924
+ moneyDates: [...fundingMoneyDates(option)]
12925
+ }
12926
+ };
12927
+ default: return assertNever$2(option);
12928
+ }
12929
+ }
12930
+ /**
12931
+ * The options request for the dates of one event, one date or several; null
12932
+ * for anything else, which keeps its own payment step. A waitlist claim asks the
12933
+ * same way: the claim admits the held place, and the funding pays for it.
12934
+ */
12935
+ function selectionFundingRequest(input) {
12936
+ const selection = input.target?.selection;
12937
+ if (selection?.kind !== "dates") return null;
12938
+ const eventSeriesId = datesSeries(selection, input.eventSeriesId);
12939
+ const lines = normalizeTicketSelectionLines(input.ticketSelections);
12940
+ if (!eventSeriesId || lines.length === 0) return null;
12941
+ return {
12942
+ subject: {
12943
+ kind: "dates",
12944
+ eventSeriesId,
12945
+ occurrenceIds: selection.occurrenceIds,
12946
+ ...input.attendanceMode ? { attendanceMode: input.attendanceMode } : {}
12947
+ },
12948
+ selections: lines.map(({ pricingOptionId, quantity }) => ({
12949
+ pricingOptionId,
12950
+ quantity
12951
+ })),
12952
+ ...input.selectedSlidingAmount !== null ? { selectedSlidingAmount: input.selectedSlidingAmount } : {}
12953
+ };
12954
+ }
12955
+ /** Several dates name their series; one date's comes from the event being booked. */
12956
+ function datesSeries(selection, eventSeriesId) {
12957
+ return selection.eventSeriesId ?? (selection.occurrenceIds.length === 1 ? eventSeriesId : null);
12958
+ }
12959
+ /**
12960
+ * What the quote prices for the dates: nothing while the ways to pay are on their way or when the
12961
+ * visitor's own pass or membership covers every date, and otherwise the chosen option's whole order,
12962
+ * which the server funds and prices itself. Null for anything that isn't dates. One date paid with
12963
+ * money keeps its own booking's quote, so its card options, deposits and automatic discount stay
12964
+ * as they are, and it waits for nothing.
12965
+ */
12966
+ function selectionDatesQuote(lookup, request) {
12967
+ if (request === null) return null;
12968
+ const oneDate = request.subject.occurrenceIds.length === 1;
12969
+ switch (lookup.tag) {
12970
+ case "idle": return null;
12971
+ case "loading":
12972
+ case "failed": return oneDate ? null : { kind: "waiting" };
12973
+ case "loaded": {
12974
+ const option = chosenFundingOption(lookup.funding, lookup.pick);
12975
+ if (oneDate && option.kind === "money") return null;
12976
+ return ownCoverPaysEveryDate(option) ? { kind: "nothingToPay" } : {
12977
+ kind: "order",
12978
+ selection: {
12979
+ ...request,
12980
+ funding: fundingChoice(option)
12981
+ }
12982
+ };
12983
+ }
12984
+ default: return assertNever$2(lookup);
12985
+ }
12986
+ }
12987
+ /** A pass or membership the visitor already has, covering every date: submit books them with no order. */
12988
+ function ownCoverPaysEveryDate(option) {
12989
+ if (option.kind === "money" || option.uncovered.length > 0) return false;
12990
+ switch (option.entitlement.kind) {
12991
+ case "ownedPass":
12992
+ case "ownedMembership": return true;
12993
+ case "buyPass":
12994
+ case "buyMembership": return false;
12995
+ default: return assertNever$2(option.entitlement);
12996
+ }
12997
+ }
12998
+ /**
12999
+ * One date with nothing but money to offer, no note and no change to explain keeps
13000
+ * the card step it always had; anything else shows the ways to pay.
13001
+ */
13002
+ function cardStepServesDates(lookup, dateCount) {
13003
+ if (dateCount !== 1 || lookup.tag !== "loaded" || lookup.notice !== null || lookup.reload !== null) return false;
13004
+ const { options, entitlementNote } = lookup.funding;
13005
+ return options.length === 1 && options[0].kind === "money" && entitlementNote === "none";
13006
+ }
13007
+ /** The option the visitor has chosen, once the options are in. */
13008
+ function lookupChosenOption(lookup) {
13009
+ return lookup.tag === "loaded" ? chosenFundingOption(lookup.funding, lookup.pick) : null;
13010
+ }
13011
+ /** What the visitor is looking at now, for a quote or submit to say which options it was about. */
13012
+ function selectionFundingBasis(lookup) {
13013
+ return lookup.tag === "loaded" ? {
13014
+ requestKey: lookup.requestKey,
13015
+ pickKey: fundingPickKey(lookup.pick)
13016
+ } : null;
13017
+ }
13018
+ const initialSelectionFundingLookup = { tag: "idle" };
13019
+ function settles(state, requestKey) {
13020
+ if (state.tag === "idle" || state.requestKey !== requestKey) return false;
13021
+ return state.tag === "loading" || state.tag === "loaded" && state.reload !== null && state.reload.sent;
13022
+ }
13023
+ function stillCurrent(state, basis) {
13024
+ const now = selectionFundingBasis(state);
13025
+ return now !== null && basis !== null && now.requestKey === basis.requestKey && now.pickKey === basis.pickKey;
13026
+ }
13027
+ /**
13028
+ * The options as the visitor may choose them: with a payment answer, only those it can take payment
13029
+ * for. An option it doesn't answer for isn't offered, rather than free. Null when the answer leaves
13030
+ * nothing, or not the server's own selection, which the server never sends.
13031
+ */
13032
+ function offeredSelectionFunding(funding, payment) {
13033
+ if (payment === null || payment.kind !== "bookable") return funding;
13034
+ const offered = new Set(payment.options.map((option) => fundingPickKey(option.funding)));
13035
+ const [first, ...rest] = funding.options.filter((option) => offered.has(fundingOptionKey(option)));
13036
+ if (first === void 0 || !offered.has(fundingPickKey(funding.selected))) return null;
13037
+ return {
13038
+ ...funding,
13039
+ options: [first, ...rest]
13040
+ };
13041
+ }
13042
+ function settle(state, action) {
13043
+ const funding = offeredSelectionFunding(action.funding, action.payment);
13044
+ if (funding === null) return {
13045
+ tag: "failed",
13046
+ requestKey: action.requestKey
13047
+ };
13048
+ const revised = state.tag === "loaded" ? state.reload : null;
13049
+ const pick = revised && findOption(funding, revised.pick) ? revised.pick : funding.selected;
13050
+ return {
13051
+ tag: "loaded",
13052
+ requestKey: action.requestKey,
13053
+ funding,
13054
+ payment: action.payment,
13055
+ pick,
13056
+ notice: state.tag === "loaded" && revised ? state.notice : null,
13057
+ reload: null
13058
+ };
13059
+ }
13060
+ /** A reload after a refusal keeps the options on screen; anything else starts afresh. */
13061
+ function startLoading(state, requestKey) {
13062
+ return state.tag === "loaded" && state.requestKey === requestKey && state.reload !== null ? {
13063
+ ...state,
13064
+ reload: {
13065
+ ...state.reload,
13066
+ sent: true
13067
+ }
13068
+ } : {
13069
+ tag: "loading",
13070
+ requestKey
13071
+ };
13072
+ }
13073
+ function selectionFundingReducer(state, action) {
13074
+ switch (action.type) {
13075
+ case "loading": return startLoading(state, action.requestKey);
13076
+ case "loaded": return settles(state, action.requestKey) ? settle(state, action) : state;
13077
+ case "failed": return settles(state, action.requestKey) ? {
13078
+ tag: "failed",
13079
+ requestKey: action.requestKey
13080
+ } : state;
13081
+ case "picked": return state.tag === "loaded" && state.reload === null && findOption(state.funding, action.pick) ? {
13082
+ ...state,
13083
+ pick: action.pick,
13084
+ notice: null
13085
+ } : state;
13086
+ case "changed": return stillCurrent(state, action.basis) ? {
13087
+ ...state,
13088
+ notice: action.message,
13089
+ reload: {
13090
+ pick: action.funding.selected,
13091
+ sent: false
13092
+ }
13093
+ } : state;
13094
+ case "reset": return initialSelectionFundingLookup;
13095
+ default: return assertNever$2(action);
13096
+ }
13097
+ }
13098
+ /** The lookup for this request: another request's answer, or none yet, is still loading. */
13099
+ function currentSelectionFundingLookup(state, requestKey) {
13100
+ if (requestKey === null) return initialSelectionFundingLookup;
13101
+ if (state.tag !== "idle" && state.requestKey === requestKey) return state;
13102
+ return {
13103
+ tag: "loading",
13104
+ requestKey
13105
+ };
13106
+ }
13107
+ /** Whether the hook should ask the server now. */
13108
+ function selectionFundingFetchWanted(state, requestKey, enabled) {
13109
+ if (!enabled || requestKey === null) return false;
13110
+ if (state.tag === "idle" || state.requestKey !== requestKey) return true;
13111
+ return state.tag === "loaded" && state.reload !== null && !state.reload.sent;
13112
+ }
13113
+ //#endregion
13114
+ //#region ../blocks/src/system/runtime/nodes/event-registration/selectionPaymentAnswer.state.ts
13115
+ /**
13116
+ * How several dates or runs can be paid, as the server's selection payment
13117
+ * owner answered (P3). The block formats this answer and decides nothing about
13118
+ * it: which ways to pay exist, what each collects and whether the site can take
13119
+ * the money are all the server's.
13120
+ */
13121
+ /** The answer's option for a funding pick (money, or a pass or membership). */
13122
+ function paymentOptionFor(payment, pick) {
13123
+ if (payment.kind !== "bookable") return null;
13124
+ const key = fundingPickKey(pick);
13125
+ return payment.options.find((option) => fundingPickKey(option.funding) === key) ?? null;
13126
+ }
13127
+ const MONEY = { kind: "money" };
13128
+ /** How the selection's money is collected, one way per collection. Empty when nothing is due. */
13129
+ function collectionsOf(option) {
13130
+ if (!option) return [];
13131
+ switch (option.collect.kind) {
13132
+ case "nothing": return [];
13133
+ case "money": return option.collect.collections;
13134
+ default: return assertNever$2(option.collect);
13135
+ }
13136
+ }
13137
+ /** How a funding pick's money is collected. Empty with no answer yet, or when nothing is due. */
13138
+ function pickCollections(payment, pick) {
13139
+ return payment ? collectionsOf(paymentOptionFor(payment, pick)) : [];
13140
+ }
13141
+ /** The money option's ways to pay: what the visitor pays with no pass or membership. */
13142
+ function moneyCollections(payment) {
13143
+ return pickCollections(payment, MONEY);
13144
+ }
13145
+ /** Nothing to pay with money: the selection books free. False with no answer yet. */
13146
+ function selectionPaysNothing(payment) {
13147
+ return payment !== null && paymentOptionFor(payment, MONEY)?.collect.kind === "nothing";
13148
+ }
13149
+ /** Every way any option collects money, which a choice on the payment step must be one of. */
13150
+ function selectionCollectionKinds(payment) {
13151
+ if (payment.kind !== "bookable") return [];
13152
+ return [...new Set(payment.options.flatMap((option) => collectionsOf(option).map((collection) => collection.kind)))];
13153
+ }
13154
+ /** Each chosen item's name, keyed by the ID the server's per-booking amounts use. */
13155
+ function selectionItemLabels(selection) {
13156
+ const names = new Map(selection.map((event) => {
13157
+ const subject = event.registrationSubject;
13158
+ return [subject.kind === "occurrence" ? subject.occurrenceId : subject.eventSeriesId, selectionItemName(event, selection)];
13159
+ }));
13160
+ return (itemId) => names.get(itemId) ?? "";
13161
+ }
13162
+ /**
13163
+ * What the runs read is asked: each run with its own ticket or amount, at the
13164
+ * places chosen for them all. Null for anything but several runs, and while a
13165
+ * run's choice is unfinished.
13166
+ */
13167
+ function runsSelectionPaymentRequest(input) {
13168
+ if (input.selection.length < 2) return null;
13169
+ const runs = input.selection.flatMap((run) => {
13170
+ if (run.registrationSubject.kind !== "wholeSeries") return [];
13171
+ const choice = runPricingChoice(input.runChoices, run);
13172
+ const sliding = run.pricing.kind === "sliding_scale" ? parseCurrencyInputToCents(choice.slidingAmountInput) : null;
13173
+ return [{
13174
+ eventSeriesId: run.registrationSubject.eventSeriesId,
13175
+ selections: [{
13176
+ pricingOptionId: choice.pricingOptionId,
13177
+ quantity: input.places
13178
+ }],
13179
+ ...sliding !== null ? { selectedSlidingAmount: sliding } : {}
13180
+ }];
13181
+ });
13182
+ const [first, ...rest] = runs;
13183
+ if (!first || runs.length !== input.selection.length) return null;
13184
+ return { subject: {
13185
+ kind: "runs",
13186
+ runs: [first, ...rest],
13187
+ ...input.attendanceMode ? { attendanceMode: input.attendanceMode } : {}
13188
+ } };
13189
+ }
13190
+ //#endregion
12521
13191
  //#region ../blocks/src/system/runtime/nodes/event-registration/registrationStateMachine.ts
12522
13192
  /** Identity, not clicking a row, decides whether this is a new booking. */
12523
13193
  function decideEventChoice(state, event) {
@@ -12530,10 +13200,14 @@ function decideEventChoice(state, event) {
12530
13200
  }
12531
13201
  /** A replacement owns all new-event defaults and detaches invitation authority atomically. */
12532
13202
  function replaceRegistrationEvent(state, action) {
13203
+ const fresh = resetRegistrationDraft(state, {
13204
+ step: action.navigation === "advance" ? "select-tickets" : "select-event",
13205
+ event: action.event
13206
+ });
12533
13207
  return {
12534
- ...resetRegistrationDraft(state, action.navigation === "advance"),
13208
+ ...fresh,
12535
13209
  draft: {
12536
- ...createRegistrationDraftData(action.event),
13210
+ ...fresh.draft,
12537
13211
  formData: {
12538
13212
  ...state.draft.formData,
12539
13213
  consentAccepted: false
@@ -12541,21 +13215,24 @@ function replaceRegistrationEvent(state, action) {
12541
13215
  }
12542
13216
  };
12543
13217
  }
12544
- function createInitialRegistrationFlowState(hasPreSelectedContext) {
13218
+ function createInitialRegistrationFlowState(start) {
12545
13219
  return resetRegistrationDraft({
12546
13220
  isAuthenticated: false,
12547
13221
  completedOutcomes: [],
12548
13222
  spentClaim: null,
12549
13223
  draft: createRegistrationDraftData(null)
12550
- }, hasPreSelectedContext);
13224
+ }, start);
12551
13225
  }
12552
- /** Reset booking choices; live session facts are required and carried through. */
12553
- function resetRegistrationDraft(session, hasPreSelectedContext) {
13226
+ /**
13227
+ * Reset booking choices to the start's, with that item's own defaults; the
13228
+ * details typed so far and live session facts are carried through.
13229
+ */
13230
+ function resetRegistrationDraft(session, start) {
12554
13231
  return {
12555
13232
  questionFieldErrors: {},
12556
- step: hasPreSelectedContext ? "select-tickets" : "select-event",
13233
+ step: start.step,
12557
13234
  draft: {
12558
- ...createRegistrationDraftData(null),
13235
+ ...createRegistrationDraftData(start.event),
12559
13236
  formData: session.draft.formData
12560
13237
  },
12561
13238
  invitation: { kind: "none" },
@@ -12564,6 +13241,7 @@ function resetRegistrationDraft(session, hasPreSelectedContext) {
12564
13241
  completedOutcomes: session.completedOutcomes,
12565
13242
  spentClaim: session.spentClaim,
12566
13243
  eligibility: null,
13244
+ selectionPayment: null,
12567
13245
  roomFacts: null,
12568
13246
  paymentSelection: { method: null },
12569
13247
  selectionSource: "auto"
@@ -12602,26 +13280,14 @@ function flowTicketsCount(state) {
12602
13280
  });
12603
13281
  return Math.max(1, ticketsCount);
12604
13282
  }
12605
- /** How the whole selection is paid; the wizard reads the same decision. */
12606
- function flowSelectionPayment(state) {
12607
- return decideSelectionPayment({
12608
- selection: state.draft.selection,
12609
- runChoices: state.draft.runChoices,
12610
- eligibility: state.eligibility
12611
- });
12612
- }
12613
- /**
12614
- * A membership covers one run for one person, so it's chosen for the visitor
12615
- * then. Dates are paid with the server's funding options instead (issue 1767).
12616
- */
13283
+ /** A membership covers one place on one run, so it's chosen for the visitor then. Dates are paid with the server's funding options instead (issue 1767). */
12617
13284
  function membershipAllowed(state) {
12618
- return flowTicketsCount(state) === 1 && severalItemsOf(state.draft.selection) === null && state.draft.selection[0]?.registrationSubject.kind === "wholeSeries";
13285
+ return flowTicketsCount(state) === 1 && state.draft.selection[0]?.registrationSubject.kind === "wholeSeries";
12619
13286
  }
12620
13287
  function computeAutoSelection(state) {
12621
13288
  const { isAuthenticated, eligibility } = state;
12622
13289
  if (!eligibility) return { method: null };
12623
- const payment = flowSelectionPayment(state);
12624
- if (payment.kind === "several") return payment.due === "nothing" ? { method: "free" } : { method: null };
13290
+ if (severalItemsOf(state.draft.selection) !== null) return selectionPaysNothing(state.selectionPayment) ? { method: "free" } : { method: null };
12625
13291
  if (eligibility.isFree) return { method: "free" };
12626
13292
  const membership = isAuthenticated && membershipAllowed(state) ? eligibility.eligibleMemberships[0] : void 0;
12627
13293
  return membership ? {
@@ -12630,27 +13296,32 @@ function computeAutoSelection(state) {
12630
13296
  productName: membership.membershipName
12631
13297
  } : { method: null };
12632
13298
  }
12633
- function isSelectionValid(input) {
12634
- const { selection, isAuthenticated, eligibility } = input;
13299
+ function isSelectionValid(state, selection) {
13300
+ const { isAuthenticated, eligibility } = state;
12635
13301
  if (!selection.method) return false;
12636
- if (input.payment.kind === "several") return isSeveralItemsSelectionValid(selection, input.payment.due);
13302
+ if (severalItemsOf(state.draft.selection) !== null) return isSeveralItemsSelectionValid(selection, state.selectionPayment);
12637
13303
  if (!eligibility) return selection.method === "stripe";
12638
13304
  switch (selection.method) {
12639
13305
  case "free": return eligibility.isFree;
12640
13306
  case "stripe": return isCardSelectionValid(selection, eligibility);
12641
- case "membership": return input.membershipAllowed && isAuthenticated && eligibility.eligibleMemberships.some((membership) => membership.id === selection.membershipId);
13307
+ case "membership": return membershipAllowed(state) && isAuthenticated && eligibility.eligibleMemberships.some((membership) => membership.id === selection.membershipId);
12642
13308
  default: return false;
12643
13309
  }
12644
13310
  }
12645
13311
  /**
12646
- * Several items are free when nothing is due, otherwise paid up front by card
12647
- * (issue 1725). The first item's own options don't apply: a free first run
12648
- * doesn't make a paid second one free.
13312
+ * Several items are free when the server says nothing is due, otherwise paid
13313
+ * one of the ways its answer collects money. The first item's own options
13314
+ * don't apply. While the answer is being asked again, a chosen way to pay
13315
+ * stands until it arrives.
12649
13316
  */
12650
- function isSeveralItemsSelectionValid(selection, due) {
12651
- switch (due) {
12652
- case "nothing": return selection.method === "free";
12653
- case "card": return selection.method === "stripe" && selection.collectionOptionKind === "upfront";
13317
+ function isSeveralItemsSelectionValid(selection, payment) {
13318
+ if (payment === null) return selection.method === "stripe";
13319
+ switch (selection.method) {
13320
+ case "free": return selectionPaysNothing(payment);
13321
+ case "stripe": return selectionCollectionKinds(payment).includes(selection.collectionOptionKind);
13322
+ case "membership":
13323
+ case null: return false;
13324
+ default: return assertNever$2(selection);
12654
13325
  }
12655
13326
  }
12656
13327
  function isCardSelectionValid(selection, eligibility) {
@@ -12659,13 +13330,7 @@ function isCardSelectionValid(selection, eligibility) {
12659
13330
  }
12660
13331
  function normalizeRegistrationFlowState(state) {
12661
13332
  const autoSelection = computeAutoSelection(state);
12662
- const canKeepManualSelection = state.step !== "select-tickets" && state.selectionSource === "manual" && isSelectionValid({
12663
- selection: state.paymentSelection,
12664
- isAuthenticated: state.isAuthenticated,
12665
- eligibility: state.eligibility,
12666
- membershipAllowed: membershipAllowed(state),
12667
- payment: flowSelectionPayment(state)
12668
- });
13333
+ const canKeepManualSelection = state.step !== "select-tickets" && state.selectionSource === "manual" && isSelectionValid(state, state.paymentSelection);
12669
13334
  const nextSelection = canKeepManualSelection ? state.paymentSelection : autoSelection;
12670
13335
  const nextSource = canKeepManualSelection ? "manual" : "auto";
12671
13336
  const normalizedSelection = normalizePaymentSelection(nextSelection);
@@ -12697,7 +13362,7 @@ function reduceUnlockedAction(state, action) {
12697
13362
  questionFieldErrors: action.failure.questionFieldErrors
12698
13363
  };
12699
13364
  case "payment-return-restored": return restorePaymentReturn(state, action.restoration);
12700
- default: return assertNever$1(action);
13365
+ default: return assertNever$2(action);
12701
13366
  }
12702
13367
  }
12703
13368
  /**
@@ -12786,17 +13451,25 @@ function reduceActiveRegistration(state, action) {
12786
13451
  ...state,
12787
13452
  step: action.step
12788
13453
  });
12789
- case "reset": return resetRegistrationDraft(state, action.hasPreSelectedContext);
13454
+ case "reset": return resetRegistrationDraft(state, action.start);
12790
13455
  case "set-tickets-count":
12791
13456
  case "eligibility-updated": return normalizeRegistrationFlowState(backToRoomsWhenTheyveGone(updateRegistrationDraft(state, action)));
13457
+ case "selection-payment-updated": return withSelectionPayment(state, action.payment);
12792
13458
  case "event-continued": return action.navigation === "advance" ? {
12793
13459
  ...state,
12794
13460
  step: "select-tickets"
12795
13461
  } : state;
12796
13462
  case "event-replaced": return replaceRegistrationEvent(state, action);
12797
- default: return assertNever$1(action);
13463
+ default: return assertNever$2(action);
12798
13464
  }
12799
13465
  }
13466
+ /** A new answer from the server can change which ways to pay are still valid. */
13467
+ function withSelectionPayment(state, payment) {
13468
+ return state.selectionPayment === payment ? state : normalizeRegistrationFlowState({
13469
+ ...state,
13470
+ selectionPayment: payment
13471
+ });
13472
+ }
12800
13473
  /** Answering a question clears the complaint about that question, and only that one. */
12801
13474
  function applyRegistrationQuestionsEvent(state, event) {
12802
13475
  const draft = {
@@ -12915,7 +13588,7 @@ function updateRegistrationDraft(state, action) {
12915
13588
  eligibility: action.eligibility,
12916
13589
  roomFacts: action.eligibility?.rooms ?? state.roomFacts
12917
13590
  };
12918
- default: return assertNever$1(action);
13591
+ default: return assertNever$2(action);
12919
13592
  }
12920
13593
  }
12921
13594
  /** A run's membership books without a payment step. */
@@ -12937,9 +13610,9 @@ function reduceRegistrationPaymentChoice(state, action) {
12937
13610
  function reduceCompletedRegistration(state, action) {
12938
13611
  const { result: _result, ...draft } = state;
12939
13612
  switch (action.type) {
12940
- case "reset": return resetRegistrationDraft(state, action.hasPreSelectedContext);
13613
+ case "reset": return resetRegistrationDraft(state, action.start);
12941
13614
  case "set-step": return {
12942
- ...resetRegistrationDraft(state, action.step !== "select-event"),
13615
+ ...resetRegistrationDraft(state, CHOOSING_START),
12943
13616
  step: action.step
12944
13617
  };
12945
13618
  case "event-replaced": return registrationFlowReducer({
@@ -12962,8 +13635,9 @@ function reduceCompletedRegistration(state, action) {
12962
13635
  case "tickets-completed":
12963
13636
  case "set-tickets-count":
12964
13637
  case "eligibility-updated":
13638
+ case "selection-payment-updated":
12965
13639
  case "set-manual-payment-selection": return state;
12966
- default: return assertNever$1(action);
13640
+ default: return assertNever$2(action);
12967
13641
  }
12968
13642
  }
12969
13643
  /** A lookup can restore only the active request, never a completed or replaced draft. */
@@ -13019,10 +13693,10 @@ function applyWaitlistClaimLookup(state, action) {
13019
13693
  action: "none"
13020
13694
  }
13021
13695
  };
13022
- default: return assertNever$1(restoration);
13696
+ default: return assertNever$2(restoration);
13023
13697
  }
13024
13698
  }
13025
- default: return assertNever$1(lookup);
13699
+ default: return assertNever$2(lookup);
13026
13700
  }
13027
13701
  }
13028
13702
  /** Completion remembers places; resetting the draft leaves this visit's outcomes intact. */
@@ -13118,7 +13792,7 @@ function registrationPresentation(state, route) {
13118
13792
  layout: "whole",
13119
13793
  screen: "paymentFailed"
13120
13794
  };
13121
- default: return assertNever$1(step);
13795
+ default: return assertNever$2(step);
13122
13796
  }
13123
13797
  }
13124
13798
  /**
@@ -13191,4 +13865,4 @@ function registrationStepLabel(step, context) {
13191
13865
  }
13192
13866
  }
13193
13867
  //#endregion
13194
- export { withOfferedEvent as $, RichText as $a, resolveBookingPaymentChoice as $i, getTicketSelectionTotal as $n, decideSelectionAttendance as $o, resolveSelectionBookingClosedDetail as $r, runNeedsPricingChoice as $t, visitorHoldsOwnPlace as A, bookingPageKindSchema as Aa, appointmentQuestionsRefusal as Ai, formatEventDateTime as An, systemCustomizeFacetDefinitionsForBlock as Ao, buildPassCartItem as Ar, publicEventPricingDisplay as As, eventSignInRestoration as At, calculateEventRegistrationPreviewTotal as B, canJoinEventWaitlistOnAnyMode as Ba, toBookingQuestionsPaymentSnapshot as Bi, isEmailAddress as Bn, inlineTextToPlainText as Bo, eventRegistrationPageSurfaceSubjectSchema as Br, withoutKeptAnswers as Bt, registrationStopsHere as C, createHostedBlockApiConfig as Ca, selectedBookingCollectionOptionKind as Ci, selectionCombinationHint as Cn, renderVideo as Co, formatCommercePrice as Cr, EVENT_ADDRESS_AFTER_BOOKING_LABEL as Cs, getRegistrationStartAt as Ct, resolveRegistrationTicketContinuation as D, leavePage as Da, resolveSelectedAppointmentConsent as Di, findSelectedTicketType as Dn, resolveMediaNodeResponsiveImage as Do, membershipClassesLabel as Dr, formatEventPricing as Ds, EVENT_SIGN_IN_FORM_ID as Dt, resolveRegistrationAvailabilityBlocker as E, canonicalUrl as Ea, projectSelectedAppointmentConsentIntoForm as Ei, serverPricedTotalCents as En, resolveImageUrlWithContext as Eo, membershipCardListContent as Er, formatBookingPriceDisplay as Es, toWholeSeriesRegistrationEvents as Et, resolveHeadlessEventRegistrationStatus as F, formatEventLocation as Fa, decideBookingQuestionsRestoration as Fi, getTicketTypeAvailabilityLabel as Fn, SECTION_STATE_KINDS as Fo, reduceCommerceCart as Fr, parseSiteId as Fs, deriveRunRequirements as Ft, BROWSER_DRAFT_LIFETIME_MS as G, getEventAvailabilityStatus as Ga, applyBookingPaymentAdmission as Gi, getTicketSelectionRemainingPlaces as Gn, resolveLookMediaFrame as Go, getPublicEventCanonicalPath as Gr, decideSelectionPayment as Gt, buildReviewedBookingPaymentViewModel as H, formatRemainingPlaces as Ha, formatPrice as Hi, getRegistrationOccurrenceId as Hn, parseInlineTextFromUnknown as Ho, resolveEventRegistrationChoices as Hr, SELECTION_LIMIT_NOTE as Ht, resolveHeadlessEventRegistrationView as I, resolveRuntimeEventDestination as Ia, deriveBookingQuestions as Ii, getVisibleTicketTypes as In, sectionStateToneFromKind as Io, resolveSelectedProduct as Ir, unsafeAsSiteId as Is, nextRunToRead as It, restorableBrowserDraftCode as J, selectEventCapacitySource as Ja, bookingRequiresResourceSelection as Ji, shouldLoadRegistrationOptions as Jn, resolveDateRuntimeContext as Jo, planOrdinarySeriesSelection as Jr, planSelectionPrice as Jt, registrationBrowserDraft as K, getRemainingPlaces as Ka, bookingHasPackagePaymentChoices as Ki, parseCurrencyInputToCents as Kn, parseBlockColorToken as Ko, isOrdinaryPublicEvent as Kr, effectiveSelection as Kt, toHeadlessPaymentSelection as L, hasEventBookingClosedEarly as La, needsBookingQuestionsRefresh as Li, occurrenceTitleOverride as Ln, asPartialObject as Lo, closedDatesCopy as Lr, parseEventSeriesId as Ls, runFieldErrors as Lt, isEventRegistrationAvailable as M, eventOnlinePlace as Ma, isAppointmentBookingQuestionsEvent as Mi, formatTime as Mn, heroTitleSizeOptions as Mo, deriveCommerceCheckoutState as Mr, publicEventPricingType as Ms, buildSelectionRequirementsSubmission as Mt, normalizeEventRegistrationMaxTickets as N, eventPlaceName as Na, needsAppointmentQuestionsRefresh as Ni, getImplicitSingleTicketType as Nn, createAspectRatioField as No, parseStoredCommerceCartState as Nr, resolveExactOrFreePriceDisplay as Ns, checkRunRequirements as Nt, settledRemainingPlaces as O, pageNavigationSchema as Oa, EMPTY_APPOINTMENT_BOOKING_QUESTIONS as Oi, formatBookingWhen as On, resolvePublicMediaUrl as Oo, passCardListContent as Or, isPublicEventPricingOptionDisplayable as Os, eventSignInDraftStore as Ot, resolveEventRegistrationSubmitPlan as P, eventVenuePlace as Pa, bookingQuestionsAnswerDraftSchema as Pi, getPortalSubjectEmail as Pn, uiTransforms as Po, productItemKey as Pr, resolvePricingOptionsPriceDisplay as Ps, decideSelectionRequirementsLayout as Pt, invitationBooking as Q, isBlockButtonRole as Qa, resolveBookingPaymentAvailability as Qi, getTicketLineQuantity as Qn, INCOMPATIBLE_ATTENDANCE_MESSAGE as Qo, registrationDataForEventSelection as Qr, runChoiceUsable as Qt, toInternalPaymentSelection as R, isBookableEvent as Ra, restoreBookingQuestionsAnswers as Ri, transformRegistrationOptionsResponse as Rn, createTransformRegistry as Ro, closedRunCopy as Rr, unsafeAsEventCategoryId as Rs, runsKeepingAnswers as Rt, planRegistrationDetailsContinuation as S, browserReadAuthoritySchema as Sa, resolveLowestBookingPaymentStep as Si, paymentCaption as Sn, renderAudio as So, buildProductListDisplay as Sr, parseNewsletterListId as Ss, resolveFinishedPresentation as St, resolveRegistrationAdmission as T, PAGE_NAVIGATION as Ta, toSelectedCollectionOptionKind as Ti, selectionPreviewLines as Tn, resolveImageUrl as To, formatValidity as Tr, EVENT_PRESET_VOCABULARY as Ts, toWholeSeriesRegistrationEvent as Tt, paymentChoiceDetails as U, formatTotalCapacity as Ua, BOOKING_FORM_DATA_RESERVED_KEYS as Ui, getSlidingScaleForEvent as Un, plainTextToInlineText as Uo, resolveEventRegistrationScopedEvents as Ur, SEVERAL_BOOKINGS_ACCOUNT_NOTE as Ut, buildBookingPaymentSelectionViewModel as V, formatEventRemainingPlaces as Va, formatCentsAsCurrencyInput as Vi, getCurrentTicketSelection as Vn, isInlineTextEmpty as Vo, normalizeEventRegistrationPageSurfaceSubject as Vr, paymentReturnRestoration as Vt, paymentChoicePrice as W, getEventAvailability as Wa, BOOKING_FORM_DATA_RESERVED_KEY_VALUES as Wi, getSlidingScaleSelectionMessage as Wn, generateLookMediaFrameCss as Wo, eventOccurrenceContext as Wr, canToggleSelectionItem as Wt, createRegistrationDraftData as X, BLOCK_BUTTON_ROLE_OPTIONS as Xa, resolveBookingPackagePaymentSelection as Xi, canRequestTicketOption as Xn, parseAspectRatioValue as Xo, planWholeSeriesParentSelection as Xr, quoteReductions as Xt, beginWaitlistInvitation as Y, selectMostOpenCapacitySource as Ya, reconcileBookingPackagePurchase as Yi, withRegistrationAvailability as Yn, sanitizeHref as Yo, planWholeSeriesParentBooking as Yr, primarySelectionItem as Yt, invitationSubmission as Z, blockButtonRoleSchema as Za, resolveBookingPackageSources as Zi, getSingleSelectedPricingOptionId as Zn, isRecord$3 as Zo, planWholeSeriesRunSelection as Zr, registrationSelectionMode as Zt, closedAdmissionLabel as _, eventLayoutSchema as _a, resolveAppointmentCheckoutVerificationState as _i, toggleSelectionItem as _n, resolveEventTimeZone as _o, buildCartDisplay as _r, DEFAULT_MAILING_LIST_PRIVACY_NOTE as _s, roomSubmission as _t, registrationPresentation as a, createInteractiveIslandCodec as aa, deriveBookingFormViewState as ai, selectionEntitlementNote as an, formatCalendarTitle as ao, clearSignInReturnDrafts as ar, bookingCollectionDatesOpen as as, resolveRouteRequiresPayment as at, placeCountCeiling as b, registrationButtonVariantSchema as ba, resolveBookingSiteId as bi, combinationOffersOf as bn, computeMediaTransformStyle as bo, buildProductCardDisplay as br, parseMailchimpAudienceId as bs, toWaitlistClaimResolveFailure as bt, registrationStepLabelContext as c, defineClientOwnedBlockRuntime as ca, getBookingSuccessCopy as ci, selectionItemsLabel as cn, formatEventCompactDateRail as co, nextSignInReturnExpiry as cr, getStripeMinimumChargeRequirement as cs, validateFormData as ct, decideEventChoice as d, bookingNowSchema as da, isBookingServiceSlidingAmountInRange as di, selectionRowAvailability as dn, formatEventNextDateFact as do, sweepExpiredSignInReturnDrafts as dr, orderedLiveRunSessions as ds, dayOptionsOf as dt, resolveBookingPaymentMode as ea, selectionRepresentativeEvent as ei, runPricingChoice as en, buildCalendarViewport as eo, getTicketTypeLineMax as er, setRoomChoicePeople as es, buildRegistrationSelectionRequest as et, isRegistrationLocked as f, calendarTabViewsSchema as fa, isSameOpenCheckout as fi, selectionTicketInputs as fn, formatEventRunDates as fo, placesLeftLabel as fr, resolveWholeSeriesBookingPhase as fs, decideRoomStay as ft, shouldPromptForLogin as g, eventCalendarDisplayModeSchema as ga, prepareBookingSubmission as gi, summariseSelectionPayment as gn, groupEventsByDate as go, appliedDiscountHint as gr, resolveBookingSignupOffer as gs, roomChoiceMessage as gt, decideEventRegistrationPayment as h, eventCalendarDefaultViewSchema as ha, parseBookingCurrencyInputToCents as hi, severalRunsChoiceMessage as hn, formatTime$1 as ho, shownVenue as hr, parseMailingListRuntimeContext as hs, presentRoomChooser as ht, registrationPaymentRoute as i, buildInteractiveIslandProps as ia, readOverrideServiceCategories as ii, selectionConsentLabel as in, eventLocalDateKey as io, BOOKING_SIGN_IN_RETURN_PARAM as ir, planCheckoutPaymentFlow as is, resolveRegistrationTarget as it, deriveEventRegistrationSteps as j, bookingPresentation as ja, deriveAppointmentBookingQuestions as ji, formatRegistrationSchedule as jn, createImageShapeField as jo, buildProductCartItem as jr, publicEventPricingStrategy as js, toEventSignInDraft as jt, severalRunsNeedCard as k, requestSignIn as ka, applyAppointmentBookingQuestionsEvent as ki, formatDate as kn, resolveArrangementKnobs as ko, EMPTY_COMMERCE_CART_STATE as kr, publicEventPricingCurrency as ks, eventSignInEnds as kt, areEventRegistrationPaymentSelectionsEqual as l, defineProgressiveBlockRuntime as la, getRegistrationSuccessCopy as li, selectionPlacesLabel as ln, formatEventDateParts as lo, readSignInReturn as lr, CANCELLED_SESSION_STATUS as ls, ADD_A_PLACE as lt, buildEventRegistrationPaymentOptionsViewModel as m, eventButtonVariantSchema as ma, normalizeBookingServices as mi, severalItemsOf as mn, formatEventWeekdayTime as mo, resolveRegistrationDisplay as mr, resolveWholeSeriesRunLifecycle as ms, isRoomChoiceRefusal as mt, getEventSelectionMode as n, toBookingPurchasablePackages as na, bookingFormInteractiveIslandPropsCodec as ni, selectionAtLimit as nn, eventDateLocale as no, normalizeTicketSelectionLines as nr, eventRegistrationErrors as ns, resolveDiscountContext as nt, registrationRoute as o, defineInteractiveIslandMetaKeys as oa, formatBookingSubmissionPreparationError as oi, selectionIncludes as on, formatDate$1 as oo, createSignInReturnDraftStore as or, flexibleBalanceDueDay as os, toRegistrationRequestSubject as ot, registrationFlowReducer as p, columnOptionSchema as pa, normalizeBookingFormConfig as pi, severalConfirmationSentence as pn, formatEventTimeRange as po, registrationDisplaySchema as pr, resolveWholeSeriesPaymentDates as ps, defaultTicketOptions as pt, registrationBrowserDraftSchema as q, isEventFull as qa, bookingPackageRequestKey as qi, resolveHeldTicketPlaces as qn, readRuntimeNow as qo, planDropInPanel as qr, incompleteRunChoiceMessage as qt, panelShouldOpen as r, getBookingServiceSlidingScale as ra, buildBookingFormInteractiveIslandProps as ri, selectionConfirmationHint as rn, eventDateOptions as ro, setTicketLineQuantity as rr, parseEventRegistrationErrorReason as rs, resolveEventRequiresPayment as rt, registrationStepLabel as s, createZodCodec as sa, getBookingRedirectStateFromLocation as si, selectionItemPrice as sn, formatEventClockLabel as so, decideSignInReturn as sr, repriceBookingCollectionOptions as ss, registrationQuestionsMessage as st, REGISTRATION_STEP_LABELS as t, resolveBookingPurchasablePackages as ta, groupPublicEventsByRun as ti, runUnitPriceCents as tn, eventCalendarWeekStart as to, hasValidPricingOptionSelection as tr, eventRegistrationErrorEndsCommand as ts, findPreSelectedEvent as tt, createInitialRegistrationFlowState as u, isDecodeSuccess as ua, getShopSuccessCopy as ui, selectionPlacesNote as un, formatEventHourLabel as uo, signInReturnPath as ur, nextLiveRunSessionStartMs as us, bookingLines as ut, fullyBookedLabel as v, filterAutoShowSchema as va, resolveBookingPaymentStep as vi, combinationHintCopy as vn, ImagePresets as vo, buildCheckoutDisplay as vr, DEFAULT_MAILING_LIST_SUCCESS_MESSAGE as vs, selectRoomOffer as vt, resolveGuestNextStepCheck as w, getBlockApiReadStage as wa, snapshotBookingShownTerms as wi, selectionItemName as wn, resolveImageSourceSetWithContext as wo, formatInterval as wr, offeringLabelForPageSurfaceSubject as ws, toRegistrationEvents as wt, planRegistrationDetailsCheck as x, weekStartSchema as xa, resolveDefaultBookingServiceId as xi, combinationWorking as xn, mediaImageHostProps as xo, buildProductDetailDisplay as xr, parseMailchimpInterestId as xs, confirmationPaymentRows as xt, getTicketSelectionPurpose as y, previewStageSchema as ya, resolveBookingSelectedService as yi, combinationOfferLine as yn, MediaPlaceholder as yo, buildPassesMembershipsDisplay as yr, parseBrevoListId as ys, isSameWaitlistClaim as yt, onlineBookingUnavailableMessage as z, canJoinEventWaitlist as za, toBookingQuestionsAnswerDraft as zi, withOccurrenceTitle as zn, runTransforms as zo, closedDateCopy as zr, toRunRequirementsSnapshots as zt };
13868
+ export { deriveEventRegistrationSteps as $, PAGE_NAVIGATION as $a, toSelectedCollectionOptionKind as $i, serverPricedTotalCents as $n, resolveImageUrl as $o, formatValidity as $r, parseMailchimpAudienceId as $s, toWholeSeriesRegistrationEvents as $t, ownCoverPaysEveryDate as A, toBookingPurchasablePackages as Aa, bookingFormInteractiveIslandPropsCodec as Ai, selectionConfirmationHint as An, eventDateLocale as Ao, normalizeTicketSelectionLines as Ar, eventRegistrationErrors as As, resolveEventRequiresPayment as At, closedAdmissionLabel as B, calendarTabViewsSchema as Ba, isSameOpenCheckout as Bi, severalConfirmationSentence as Bn, formatEventRunDates as Bo, placesLeftLabel as Br, formatCreditProductPayment as Bs, defaultTicketOptions as Bt, currentSelectionFundingLookup as C, reconcileBookingPackagePurchase as Ca, planWholeSeriesParentBooking as Ci, primarySelectionItem as Cn, selectMostOpenCapacitySource as Co, withRegistrationAvailability as Cr, sanitizeHref as Cs, beginWaitlistInvitation as Ct, fundingOptionPick as D, resolveBookingPaymentChoice as Da, resolveSelectionBookingClosedDetail as Di, runPricingChoice as Dn, RichText as Do, getTicketSelectionTotal as Dr, decideSelectionAttendance as Ds, buildRegistrationSelectionRequest as Dt, fundingOptionKey as E, resolveBookingPaymentAvailability as Ea, registrationDataForEventSelection as Ei, runNeedsPricingChoice as En, isBlockButtonRole as Eo, getTicketLineQuantity as Er, INCOMPATIBLE_ATTENDANCE_MESSAGE as Es, withOfferedEvent as Et, selectionFundingRequest as F, createZodCodec as Fa, getBookingRedirectStateFromLocation as Fi, selectionItemsLabel as Fn, formatEventClockLabel as Fo, decideSignInReturn as Fr, bookingCollectionDatesOpen as Fs, validateFormData as Ft, planRegistrationDetailsContinuation as G, eventLayoutSchema as Ga, resolveAppointmentCheckoutVerificationState as Gi, combinationHintCopy as Gn, resolveEventTimeZone as Go, buildCartDisplay as Gr, resolveWholeSeriesBookingPhase as Gs, selectRoomOffer as Gt, getTicketSelectionPurpose as H, eventButtonVariantSchema as Ha, normalizeBookingServices as Hi, severalRunsChoiceMessage as Hn, formatEventWeekdayTime as Ho, resolveRegistrationDisplay as Hr, CANCELLED_SESSION_STATUS as Hs, presentRoomChooser as Ht, buildEventRegistrationPaymentOptionsViewModel as I, defineClientOwnedBlockRuntime as Ia, getBookingSuccessCopy as Ii, selectionPlacesLabel as In, formatEventCompactDateRail as Io, nextSignInReturnExpiry as Ir, flexibleBalanceDueDay as Is, ADD_A_PLACE as It, resolveRegistrationAdmission as J, registrationButtonVariantSchema as Ja, resolveBookingSiteId as Ji, combinationWorking as Jn, computeMediaTransformStyle as Jo, buildProductCardDisplay as Jr, parseMailingListRuntimeContext as Js, confirmationPaymentRows as Jt, registrationStopsHere as K, filterAutoShowSchema as Ka, resolveBookingPaymentStep as Ki, combinationOfferLine as Kn, ImagePresets as Ko, buildCheckoutDisplay as Kr, resolveWholeSeriesPaymentDates as Ks, isSameWaitlistClaim as Kt, buildSelectionCollectionOptions as L, defineProgressiveBlockRuntime as La, getRegistrationSuccessCopy as Li, selectionPlacesNote as Ln, formatEventDateParts as Lo, readSignInReturn as Lr, repriceBookingCollectionOptions as Ls, bookingLines as Lt, selectionFundingBasis as M, buildInteractiveIslandProps as Ma, readOverrideServiceCategories as Mi, selectionEntitlementNote as Mn, eventLocalDateKey as Mo, BOOKING_SIGN_IN_RETURN_PARAM as Mr, parseEventRegistrationErrorReason as Ms, resolveRouteRequiresPayment as Mt, selectionFundingFetchWanted as N, createInteractiveIslandCodec as Na, deriveBookingFormViewState as Ni, selectionIncludes as Nn, formatCalendarTitle as No, clearSignInReturnDrafts as Nr, EVENT_CHECKOUT_HOLD_DURATION_MS as Ns, toRegistrationRequestSubject as Nt, initialSelectionFundingLookup as O, resolveBookingPaymentMode as Oa, selectionRepresentativeEvent as Oi, runUnitPriceCents as On, buildCalendarViewport as Oo, getTicketTypeLineMax as Or, setRoomChoicePeople as Os, findPreSelectedEvent as Ot, selectionFundingReducer as P, defineInteractiveIslandMetaKeys as Pa, formatBookingSubmissionPreparationError as Pi, selectionItemPrice as Pn, formatDate$1 as Po, createSignInReturnDraftStore as Pr, planCheckoutPaymentFlow as Ps, registrationQuestionsMessage as Pt, visitorHoldsOwnPlace as Q, getBlockApiReadStage as Qa, snapshotBookingShownTerms as Qi, selectionPreviewLines as Qn, resolveImageSourceSetWithContext as Qo, formatInterval as Qr, parseBrevoListId as Qs, toWholeSeriesRegistrationEvent as Qt, decideEventRegistrationPayment as R, isDecodeSuccess as Ra, getShopSuccessCopy as Ri, selectionRowAvailability as Rn, formatEventHourLabel as Ro, signInReturnPath as Rr, getStripeMinimumChargeRequirement as Rs, dayOptionsOf as Rt, chosenFundingOption as S, bookingRequiresResourceSelection as Sa, planOrdinarySeriesSelection as Si, planSelectionPrice as Sn, selectEventCapacitySource as So, shouldLoadRegistrationOptions as Sr, resolveDateRuntimeContext as Ss, entryStart as St, fundingMoneyDates as T, resolveBookingPackageSources as Ta, planWholeSeriesRunSelection as Ti, runChoiceUsable as Tn, blockButtonRoleSchema as To, getSingleSelectedPricingOptionId as Tr, isRecord$3 as Ts, invitationBooking as Tt, placeCountCeiling as U, eventCalendarDefaultViewSchema as Ua, parseBookingCurrencyInputToCents as Ui, summariseSelectionPayment as Un, formatTime$1 as Uo, shownVenue as Ur, nextLiveRunSessionStartMs as Us, roomChoiceMessage as Ut, fullyBookedLabel as V, columnOptionSchema as Va, normalizeBookingFormConfig as Vi, severalItemsOf as Vn, formatEventTimeRange as Vo, registrationDisplaySchema as Vr, formatCreditProductUnits as Vs, isRoomChoiceRefusal as Vt, planRegistrationDetailsCheck as W, eventCalendarDisplayModeSchema as Wa, prepareBookingSubmission as Wi, toggleSelectionItem as Wn, groupEventsByDate as Wo, appliedDiscountHint as Wr, orderedLiveRunSessions as Ws, roomSubmission as Wt, resolveRegistrationTicketContinuation as X, browserReadAuthoritySchema as Xa, resolveLowestBookingPaymentStep as Xi, selectionCombinationHint as Xn, renderAudio as Xo, buildProductListDisplay as Xr, DEFAULT_MAILING_LIST_PRIVACY_NOTE as Xs, getRegistrationStartAt as Xt, resolveRegistrationAvailabilityBlocker as Y, weekStartSchema as Ya, resolveDefaultBookingServiceId as Yi, paymentCaption as Yn, mediaImageHostProps as Yo, buildProductDetailDisplay as Yr, resolveBookingSignupOffer as Ys, resolveFinishedPresentation as Yt, settledRemainingPlaces as Z, createHostedBlockApiConfig as Za, selectedBookingCollectionOptionKind as Zi, selectionItemName as Zn, renderVideo as Zo, formatCommercePrice as Zr, DEFAULT_MAILING_LIST_SUCCESS_MESSAGE as Zs, toRegistrationEvents as Zt, pickCollections as _, BOOKING_FORM_DATA_RESERVED_KEYS as _a, resolveEventRegistrationScopedEvents as _i, SEVERAL_BOOKINGS_ACCOUNT_NOTE as _n, formatTotalCapacity as _o, getSlidingScaleForEvent as _r, plainTextToInlineText as _s, bookingOccurrenceContext as _t, registrationPresentation as a, deriveAppointmentBookingQuestions as aa, EVENT_PRESET_VOCABULARY as ac, buildProductCartItem as ai, buildSelectionRequirementsSubmission as an, bookingPresentation as ao, formatRunScheduleLines as ar, createImageShapeField as as, toHeadlessPaymentSelection as at, selectionPaysNothing as b, bookingHasPackagePaymentChoices as ba, isOrdinaryPublicEvent as bi, effectiveSelection as bn, getRemainingPlaces as bo, parseCurrencyInputToCents as br, parseBlockColorToken as bs, entryPageEvent as bt, registrationStepLabelContext as c, bookingQuestionsAnswerDraftSchema as ca, isPublicEventPricingOptionDisplayable as cc, productItemKey as ci, deriveRunRequirements as cn, eventVenuePlace as co, getPortalSubjectEmail as cr, uiTransforms as cs, calculateEventRegistrationPreviewTotal as ct, decideEventChoice as d, needsBookingQuestionsRefresh as da, publicEventPricingStrategy as dc, closedDatesCopy as di, runsKeepingAnswers as dn, hasEventBookingClosedEarly as do, occurrenceTitleOverride as dr, asPartialObject as ds, paymentChoiceDetails as dt, projectSelectedAppointmentConsentIntoForm as ea, parseMailchimpInterestId as ec, membershipCardListContent as ei, EVENT_SIGN_IN_FORM_ID as en, canonicalUrl as eo, findSelectedTicketType as er, resolveImageUrlWithContext as es, isEventRegistrationAvailable as et, isRegistrationLocked as f, restoreBookingQuestionsAnswers as fa, publicEventPricingType as fc, closedRunCopy as fi, toRunRequirementsSnapshots as fn, isBookableEvent as fo, transformRegistrationOptionsResponse as fr, createTransformRegistry as fs, paymentChoicePrice as ft, paymentOptionFor as g, formatPrice as ga, unsafeAsSiteId as gc, resolveEventRegistrationChoices as gi, SELECTION_LIMIT_NOTE as gn, formatRemainingPlaces as go, getRegistrationOccurrenceId as gr, parseInlineTextFromUnknown as gs, restorableBrowserDraftCode as gt, moneyCollections as h, formatCentsAsCurrencyInput as ha, parseSiteId as hc, normalizeEventRegistrationPageSurfaceSubject as hi, ATTENDANCE_CHOICE_MESSAGE as hn, formatEventRemainingPlaces as ho, getCurrentTicketSelection as hr, isInlineTextEmpty as hs, registrationBrowserDraftSchema as ht, registrationPaymentRoute as i, appointmentQuestionsRefusal as ia, offeringLabelForPageSurfaceSubject as ic, buildPassCartItem as ii, toEventSignInDraft as in, bookingPageKindSchema as io, formatRegistrationSchedule as ir, systemCustomizeFacetDefinitionsForBlock as is, resolveHeadlessEventRegistrationView as it, selectionDatesQuote as j, getBookingServiceSlidingScale as ja, buildBookingFormInteractiveIslandProps as ji, selectionConsentLabel as jn, eventDateOptions as jo, setTicketLineQuantity as jr, eventRegistrationRefusalMessage as js, resolveRegistrationTarget as jt, lookupChosenOption as k, resolveBookingPurchasablePackages as ka, groupPublicEventsByRun as ki, selectionAtLimit as kn, eventCalendarWeekStart as ko, hasValidPricingOptionSelection as kr, eventRegistrationErrorEndsCommand as ks, resolveDiscountContext as kt, areEventRegistrationPaymentSelectionsEqual as l, decideBookingQuestionsRestoration as la, publicEventPricingCurrency as lc, reduceCommerceCart as li, nextRunToRead as ln, formatEventLocation as lo, getTicketTypeAvailabilityLabel as lr, SECTION_STATE_KINDS as ls, buildBookingPaymentSelectionViewModel as lt, collectionsOf as m, toBookingQuestionsPaymentSnapshot as ma, resolvePricingOptionsPriceDisplay as mc, eventRegistrationPageSurfaceSubjectSchema as mi, paymentReturnRestoration as mn, canJoinEventWaitlistOnAnyMode as mo, isEmailAddress as mr, inlineTextToPlainText as ms, registrationBrowserDraft as mt, getEventSelectionMode as n, EMPTY_APPOINTMENT_BOOKING_QUESTIONS as na, EVENT_ADDRESS_AFTER_BOOKING_LABEL as nc, passCardListContent as ni, eventSignInEnds as nn, pageNavigationSchema as no, formatDate as nr, resolvePublicMediaUrl as ns, resolveEventRegistrationSubmitPlan as nt, registrationRoute as o, isAppointmentBookingQuestionsEvent as oa, formatBookingPriceDisplay as oc, deriveCommerceCheckoutState as oi, checkRunRequirements as on, eventOnlinePlace as oo, formatTime as or, heroTitleSizeOptions as os, toInternalPaymentSelection as ot, registrationFlowReducer as p, toBookingQuestionsAnswerDraft as pa, resolveExactOrFreePriceDisplay as pc, closedDateCopy as pi, withoutKeptAnswers as pn, canJoinEventWaitlist as po, withOccurrenceTitle as pr, runTransforms as ps, BROWSER_DRAFT_LIFETIME_MS as pt, resolveGuestNextStepCheck as q, previewStageSchema as qa, resolveBookingSelectedService as qi, combinationOffersOf as qn, MediaPlaceholder as qo, buildPassesMembershipsDisplay as qr, resolveWholeSeriesRunLifecycle as qs, toWaitlistClaimResolveFailure as qt, panelShouldOpen as r, applyAppointmentBookingQuestionsEvent as ra, getBookingInstalmentProtectedDepositAmountCents as rc, EMPTY_COMMERCE_CART_STATE as ri, eventSignInRestoration as rn, requestSignIn as ro, formatEventDateTime as rr, resolveArrangementKnobs as rs, resolveHeadlessEventRegistrationStatus as rt, registrationStepLabel as s, needsAppointmentQuestionsRefresh as sa, formatEventPricing as sc, parseStoredCommerceCartState as si, decideSelectionRequirementsLayout as sn, eventPlaceName as so, getImplicitSingleTicketType as sr, createAspectRatioField as ss, onlineBookingUnavailableMessage as st, REGISTRATION_STEP_LABELS as t, resolveSelectedAppointmentConsent as ta, parseNewsletterListId as tc, membershipClassesLabel as ti, eventSignInDraftStore as tn, leavePage as to, formatBookingWhen as tr, resolveMediaNodeResponsiveImage as ts, normalizeEventRegistrationMaxTickets as tt, createInitialRegistrationFlowState as u, deriveBookingQuestions as ua, publicEventPricingDisplay as uc, resolveSelectedProduct as ui, runFieldErrors as un, resolveRuntimeEventDestination as uo, getVisibleTicketTypes as ur, sectionStateToneFromKind as us, buildReviewedBookingPaymentViewModel as ut, runsSelectionPaymentRequest as v, BOOKING_FORM_DATA_RESERVED_KEY_VALUES as va, eventOccurrenceContext as vi, attendanceChoicePending as vn, getEventAvailability as vo, getSlidingScaleSelectionMessage as vr, generateLookMediaFrameCss as vs, decideRegistrationEntry as vt, fundingChoice as w, resolveBookingPackagePaymentSelection as wa, planWholeSeriesParentSelection as wi, quoteReductions as wn, BLOCK_BUTTON_ROLE_OPTIONS as wo, canRequestTicketOption as wr, parseAspectRatioValue as ws, invitationSubmission as wt, cardStepServesDates as x, bookingPackageRequestKey as xa, planDropInPanel as xi, incompleteRunChoiceMessage as xn, isEventFull as xo, resolveHeldTicketPlaces as xr, readRuntimeNow as xs, entrySelectionMode as xt, selectionItemLabels as y, applyBookingPaymentAdmission as ya, getPublicEventCanonicalPath as yi, canToggleSelectionItem as yn, getEventAvailabilityStatus as yo, getTicketSelectionRemainingPlaces as yr, resolveLookMediaFrame as ys, entryChoosesEvent as yt, shouldPromptForLogin as z, bookingNowSchema as za, isBookingServiceSlidingAmountInRange as zi, selectionTicketInputs as zn, formatEventNextDateFact as zo, sweepExpiredSignInReturnDrafts as zr, formatCreditProductBalance as zs, decideRoomStay as zt };