@riverbankcms/sdk 0.172.0 → 0.174.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 (215) hide show
  1. package/README.md +6 -1
  2. package/dist/_dts/{BlocksIslandsHydrator-DtrzTJ77.d.ts → BlocksIslandsHydrator-GqVX3I8E.d.ts} +1 -1
  3. package/dist/_dts/{Page-DViYbakk.d.ts → Page-BhUH31M-.d.ts} +27 -16
  4. package/dist/_dts/{SdkPreviewMode-D-5OeDbT.d.ts → SdkPreviewMode-DBn2x0UL.d.ts} +14 -7
  5. package/dist/_dts/{client-DZBOzd3U.d.ts → client-Cr-sOeSl.d.ts} +1002 -139
  6. package/dist/_dts/{content-types-DS3DrYn_.d.ts → content-types-DKw1yJdN.d.ts} +2 -2
  7. package/dist/_dts/{contracts-C3QGPCUf.d.ts → contracts-CJ2O03nB.d.ts} +6 -4
  8. package/dist/_dts/{footerPageOutline-D9Q7VIul.d.ts → footerPageOutline-DoGHHKr_.d.ts} +6 -6
  9. package/dist/_dts/{generatePageMetadata-R7NeFT1u.d.ts → generatePageMetadata-CJGu4hoa.d.ts} +2 -2
  10. package/dist/_dts/{index-Dns7OHyl.d.ts → index--39uLjrr.d.ts} +1 -1
  11. package/dist/_dts/{index-Da4UMgbs.d.ts → index-3GzargmS.d.ts} +2 -2
  12. package/dist/_dts/{index-DkFV_1Bc.d.ts → index-Bq-488M7.d.ts} +1 -1
  13. package/dist/_dts/{index-BnMavhoh.d.ts → index-DQZ5L0Gb.d.ts} +2 -2
  14. package/dist/_dts/{index-C0zjLMAW.d.ts → index-DYlfdT1O.d.ts} +2 -1
  15. package/dist/_dts/{index-CpOkfBt1.d.ts → index-DYsP4k6S.d.ts} +3 -3
  16. package/dist/_dts/{index-MuMYjetm.d.ts → index-DdEi2iXd.d.ts} +4 -4
  17. package/dist/_dts/{loadContent-DJmXHzfi.d.ts → loadContent-BVPagYmy.d.ts} +11 -11
  18. package/dist/_dts/{request-wQ28JWbr.d.ts → request-Be1E-H-V.d.ts} +4892 -1720
  19. package/dist/_dts/{resolveBlockData-C-IP53u9.d.ts → resolveBlockData-D1pL25bD.d.ts} +5 -5
  20. package/dist/_dts/{resolvePageContent-Cc4zqaEC.d.ts → resolvePageContent-B4sbTf96.d.ts} +2 -2
  21. package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
  22. package/dist/_dts/sdk/src/client/types.d.ts +2 -2
  23. package/dist/_dts/sdk/src/client.d.ts +9 -9
  24. package/dist/_dts/sdk/src/config/index.d.ts +6 -6
  25. package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
  26. package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
  27. package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +2 -2
  28. package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
  29. package/dist/_dts/sdk/src/data/types.d.ts +2 -2
  30. package/dist/_dts/sdk/src/index.d.ts +8 -8
  31. package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
  32. package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
  33. package/dist/_dts/sdk/src/navigation/index.d.ts +6 -2
  34. package/dist/_dts/sdk/src/next/index.d.ts +7 -7
  35. package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
  36. package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
  37. package/dist/_dts/sdk/src/portal/client.d.ts +4 -2
  38. package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
  39. package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
  40. package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
  41. package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
  42. package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
  43. package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -1
  44. package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
  45. package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +13 -8
  46. package/dist/_dts/sdk/src/rendering/index.d.ts +6 -6
  47. package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
  48. package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
  49. package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
  50. package/dist/_dts/sdk/src/routing/index.d.ts +5 -5
  51. package/dist/_dts/sdk/src/server.d.ts +5 -5
  52. package/dist/_dts/sdk/src/spam-protection/index.d.ts +2 -2
  53. package/dist/_dts/sdk/src/theme/index.d.ts +36 -204
  54. package/dist/_dts/{types-CpjyP5I4.d.ts → types-5MeDI1w8.d.ts} +7 -7
  55. package/dist/_dts/{types-DrinAfeW.d.ts → types-Bm5_3VEd.d.ts} +3 -3
  56. package/dist/_dts/{types-ZuZoGsZV.d.ts → types-CVoCc_Ia.d.ts} +2 -2
  57. package/dist/_dts/{validation-CIZ_fP5l.d.ts → validation-lEtYD-Rh.d.ts} +4 -4
  58. package/dist/client/{BlocksIslandsHydrator-UFmQB1BE.mjs → BlocksIslandsHydrator-DkflFLGQ.mjs} +17 -17
  59. package/dist/client/{BookingMailingListNote-VjRYhx1c.mjs → BookingMailingListNote-CAyoiAGD.mjs} +18 -12
  60. package/dist/client/{BookingPanelArrangement-DpqnRo-t.mjs → BookingPanelArrangement-C7yiJrxm.mjs} +1 -1
  61. package/dist/client/{BookingQuestionFields-CzOT8ZWo.mjs → BookingQuestionFields-DZMrGvBh.mjs} +3 -3
  62. package/dist/client/{CalendarNavigationChevron-CNckKZct.mjs → CalendarNavigationChevron-BPQU5Snc.mjs} +41 -34
  63. package/dist/client/{DemoBookingPortalAccess-CmZLVXOy.mjs → DemoBookingPortalAccess-BnEgvJas.mjs} +22 -22
  64. package/dist/client/{EventCalendar.client-BU-SxLCn.mjs → EventCalendar.client-BiWQc28-.mjs} +11 -10
  65. package/dist/client/{EventCombined.client-f28VltfY.mjs → EventCombined.client-B_ytWQtn.mjs} +10 -9
  66. package/dist/client/{EventItem-sKBofjiW.mjs → EventItem-C-mxXpX_.mjs} +25 -16
  67. package/dist/client/{EventListWeekNavigation-IAcax47T.mjs → EventListWeekNavigation-Bm3Ap1Rd.mjs} +1 -1
  68. package/dist/client/{EventListing.client-BEtnRvZr.mjs → EventListing.client-Bs_8im5_.mjs} +3 -3
  69. package/dist/client/{EventListing.view-BZ4l_rmT.mjs → EventListing.view-CN7BjGgC.mjs} +37 -14
  70. package/dist/client/{EventRegistrationPayment-BWb295cD.mjs → EventRegistrationPayment-DPkRcSdw.mjs} +848 -146
  71. package/dist/client/{LocationMapActions-Hsj2HC_1.mjs → LocationMapActions-BJT7MqP2.mjs} +1 -1
  72. package/dist/client/{MapDrawingSvg-C7E7Lyfa.mjs → MapDrawingSvg-DCIwlON6.mjs} +1 -1
  73. package/dist/client/{Page-Ds1s3DuC.mjs → Page--xJ23nA5.mjs} +1160 -521
  74. package/dist/client/{StepIndicator-CSCyAaKY.mjs → StepIndicator-D391QRNc.mjs} +85 -13
  75. package/dist/client/{accessibleSurfaces-OsAseM7H.mjs → accessibleSurfaces-DN8it_Cx.mjs} +36 -27
  76. package/dist/client/{accordion-DgwFZJSx.mjs → accordion-BQtTkDN8.mjs} +1 -1
  77. package/dist/client/bookability-CE637yDE.mjs +17 -0
  78. package/dist/client/{booking-form.client-CKY9oksp.mjs → booking-form.client-D9M7TKGV.mjs} +362 -47
  79. package/dist/client/{bookingForm-CsHhcdSF.mjs → bookingForm-BsOS0sl9.mjs} +4 -4
  80. package/dist/client/bookings.mjs +6 -6
  81. package/dist/client/{boxStyleClassNames-B1Z_TGAe.mjs → boxStyleClassNames-CNDLpT06.mjs} +1 -1
  82. package/dist/client/{carousel-0sw2Kc3a.mjs → carousel-CPsW-FPh.mjs} +1 -1
  83. package/dist/client/{cart-CPfvMDGJ.mjs → cart-CwElmocm.mjs} +3 -3
  84. package/dist/client/{cart.client-BJBPUTmg.mjs → cart.client-RpqI56w8.mjs} +1 -1
  85. package/dist/client/{checkout-DU4JFjGT.mjs → checkout-CfMgqY8H.mjs} +3 -3
  86. package/dist/client/{checkout.client-BbNCO4xa.mjs → checkout.client-BpuPyOuJ.mjs} +1 -1
  87. package/dist/client/{checkoutUrls-BQ3OlWlM.mjs → checkoutUrls-VeHY6WYj.mjs} +1 -1
  88. package/dist/client/client.mjs +206 -7
  89. package/dist/client/{context-xNC1Cyjw.mjs → context-CNlesLfF.mjs} +81 -14
  90. package/dist/client/{cta-CNVQHLKs.mjs → course-q1sA4Cj-.mjs} +77 -3
  91. package/dist/client/{creditProducts-BTRX4edc.mjs → creditProducts-KYMVIH3J.mjs} +2 -84
  92. package/dist/client/{dateFormatting-B6ea-egy.mjs → dateFormatting-B73Ll0s4.mjs} +9 -1
  93. package/dist/client/{demoPortalMagicLink-BhjGxhX3.mjs → demoPortalMagicLink-BVbLD4pi.mjs} +1 -1
  94. package/dist/client/{display-B5DfNb6A.mjs → display-D8MW2b0e.mjs} +3076 -819
  95. package/dist/client/{enhanceHeaderSection-BFcHLuqk.mjs → enhanceHeaderSection-BzjY6AiY.mjs} +3 -3
  96. package/dist/client/{event-details.client-WHT5GLn2.mjs → event-details.client-CseTWUFC.mjs} +1 -1
  97. package/dist/client/{event-registration.client-CmnRKELC.mjs → event-registration.client-b5TLxntR.mjs} +1315 -553
  98. package/dist/client/{eventCalendar-2NbdCyov.mjs → eventCalendar-C-kJNIc9.mjs} +4 -4
  99. package/dist/client/{eventCombined-D1lH1n2T.mjs → eventCombined-BgHJGhwE.mjs} +4 -4
  100. package/dist/client/{eventDetails-BHvnF2Tw.mjs → eventDetails-CAwbreD0.mjs} +2 -2
  101. package/dist/client/{eventListing-EhSDk4UL.mjs → eventListing-_14atrj8.mjs} +4 -4
  102. package/dist/client/{eventRegistration-z_0jN_KS.mjs → eventRegistration-BOqSdstJ.mjs} +4 -4
  103. package/dist/client/{form-BfChzSkS.mjs → form-DfAB-llc.mjs} +3 -3
  104. package/dist/client/{form.client-D1zehtPk.mjs → form.client-DN-I9_qC.mjs} +6 -6
  105. package/dist/client/{form.parts-rMDlUQIv.mjs → form.parts-t2Q1neM6.mjs} +1 -1
  106. package/dist/client/{formatDate-ymSVT9Y5.mjs → formatDate-Dp7POa9Y.mjs} +1 -1
  107. package/dist/client/gifting/client.mjs +2 -2
  108. package/dist/client/{headerSection-BX9bQ84k.mjs → headerSection-Dces54pb.mjs} +2 -2
  109. package/dist/client/{newsletter-form.client-DMbuJCtJ.mjs → newsletter-form.client-D_YFUlR2.mjs} +9 -7
  110. package/dist/client/{newsletter-form.parts-BxrVsoI0.mjs → newsletter-form.parts-URO5Mn_I.mjs} +1 -1
  111. package/dist/client/{newsletterForm-B_I3FJFS.mjs → newsletterForm-_c9fKIzS.mjs} +3 -3
  112. package/dist/client/{noop-CamIX2yK.mjs → noop-D5mFWXtN.mjs} +139 -12
  113. package/dist/client/portal/client.mjs +346 -272
  114. package/dist/client/{product-detail.client-qxuiYCof.mjs → product-detail.client-CVW1UIxJ.mjs} +1 -1
  115. package/dist/client/{product-list.client-CDL-jihv.mjs → product-list.client-CF9hO23G.mjs} +1 -1
  116. package/dist/client/{productDetail-B97m0uZy.mjs → productDetail-C_qbmUuP.mjs} +3 -3
  117. package/dist/client/{productList-DE4vSSG_.mjs → productList-Df5qDD0z.mjs} +3 -3
  118. package/dist/client/{propsDecoder-BTde6Syh.mjs → propsDecoder-BiEyK2ii.mjs} +3 -3
  119. package/dist/client/{registry.server-Cn8XjRte.mjs → registry.server-ClcfWpvM.mjs} +93 -63
  120. package/dist/client/rendering/client.mjs +26 -26
  121. package/dist/client/rendering/islands.mjs +1 -1
  122. package/dist/client/rendering.mjs +34 -61
  123. package/dist/client/{richText-coerce-Bcl3vTb4.mjs → richText-coerce-C32cRQ03.mjs} +1 -1
  124. package/dist/client/{routeIslandApiConfig-BjRoLoMD.mjs → routeIslandApiConfig-DAypPzSo.mjs} +1 -1
  125. package/dist/client/{runtimeResponse-B-lrAGhX.mjs → runtimeResponse-9v8q2NBc.mjs} +1 -1
  126. package/dist/client/runtimeResponse-CVkM0dHy.mjs +3 -0
  127. package/dist/client/{shop-commerce-BsY7a71m.mjs → shop-commerce-Bw4_BXQg.mjs} +12 -11
  128. package/dist/client/{shop-commerce-store-BZ5j90HD.mjs → shop-commerce-store-Da6Ah-_4.mjs} +1 -1
  129. package/dist/client/shop-discount-apply.state-DidgH7ow.mjs +166 -0
  130. package/dist/client/{shop-BC4H0oYT.mjs → shop-gteEpeO5.mjs} +3 -3
  131. package/dist/client/{shop.client-WgGVGelc.mjs → shop.client-CbbdjWWd.mjs} +13 -12
  132. package/dist/client/{shop.interactive-Bb67gPLL.mjs → shop.interactive-CKFORzux.mjs} +45 -29
  133. package/dist/client/{shopShared-BE6TEk2A.mjs → shopShared-C7QjoywZ.mjs} +2 -2
  134. package/dist/client/stable-json-D0XAEIXc.mjs +22 -0
  135. package/dist/client/{timetableModel-Bbz_ECL5.mjs → timetableModel-CtZiIj9q.mjs} +25 -15
  136. package/dist/client/{useAvailableSlots-CdP14E_b.mjs → useAvailableSlots-CUVRD1nx.mjs} +39 -8
  137. package/dist/client/{useDiscountApply-DvOSso2l.mjs → useDiscountApply-BZU5DWZQ.mjs} +4 -167
  138. package/dist/client/{useDiscountCodeUi-B4fRd2jy.mjs → useDiscountCodeUi-BuLgof7O.mjs} +1 -1
  139. package/dist/client/{useEventPagination-M3jC8lgP.mjs → useEventPagination-B4VPtSEF.mjs} +6 -6
  140. package/dist/client/{view-DNNNbnNj.mjs → view-CvlTplao.mjs} +2 -2
  141. package/dist/client/{view-B0TFnP4y.mjs → view-CxUpgcM6.mjs} +56 -34
  142. package/dist/preview-next/client/{LocationPickerEnvironment-D4F_5rnr.mjs → LocationPickerEnvironment-8iKKoYZr.mjs} +1 -1
  143. package/dist/preview-next/client/{MapLibreEditMap-BKMNxSEJ.mjs → MapLibreEditMap-AIUPN1Zx.mjs} +2 -2
  144. package/dist/preview-next/client/{PageSectionToolbar-D59tHj_L.mjs → PageSectionToolbar-BFbSrDbi.mjs} +80 -160
  145. package/dist/preview-next/client/{PreviewEditorSidebar-CjOIZlUk.mjs → PreviewEditorSidebar-BtpzqQ-i.mjs} +780 -1634
  146. package/dist/preview-next/client/{PreviewEditorUI--kS9Cwsc.mjs → PreviewEditorUI-z22h-CCY.mjs} +29 -26
  147. package/dist/preview-next/client/{PreviewShell-Bi8-rclb.mjs → PreviewShell-BW3Qpoa_.mjs} +52 -32
  148. package/dist/preview-next/client/{SdkPreviewModeRuntime-CWTUw-3L.mjs → SdkPreviewModeRuntime-BvVeK1hR.mjs} +47 -69
  149. package/dist/preview-next/client/{lucide-react-BCNn8dEQ.mjs → lucide-react-Dfgl3Vtq.mjs} +7 -1
  150. package/dist/preview-next/client/{previewAssistantSlot-Caofnr1Z.mjs → previewAssistantSlot-BUqAh1FL.mjs} +98429 -46667
  151. package/dist/preview-next/client/{previewChromeRoot-CbAI_jSH.mjs → previewChromeRoot-NCy5zHO8.mjs} +1 -1
  152. package/dist/preview-next/client/runtime.mjs +3 -3
  153. package/dist/preview-next/client/{sdk-runtime-DY65_hLk.mjs → sdk-runtime-CxmKDVGZ.mjs} +2 -2
  154. package/dist/preview-next/client/siteStyleAccess-B_UaDyJO.mjs +9356 -0
  155. package/dist/preview-next/client/{useAutosaveStatus-CakNU3lp.mjs → useAutosaveStatus-BqmWvPLY.mjs} +2 -2
  156. package/dist/preview-next/client/{useOpenBlockForSetup-CCEMkosU.mjs → useOpenBlockForSetup-LAllV0rU.mjs} +8 -4
  157. package/dist/preview-next/container-responsive.css +117 -32
  158. package/dist/preview-next/keepAlive.mjs +1 -1
  159. package/dist/preview-next/middleware.mjs +1 -1
  160. package/dist/preview-next/{route-contract-DsKDQoVW.mjs → route-contract-DV6SeCNv.mjs} +200 -2
  161. package/dist/server/{Block.shared-D7Qy9F4a.mjs → Block.shared-Ch2FKAvU.mjs} +11 -6
  162. package/dist/server/{ThemeScopeCore-D1NTXZdX.mjs → ThemeScopeCore-DFvjDVzi.mjs} +23 -6
  163. package/dist/server/{accessibleSurfaces-Dbd2__Le.mjs → accessibleSurfaces-CM3QANtw.mjs} +22 -5
  164. package/dist/server/{bindings-Bp6OnR3n.mjs → bindings-CQg2lzZn.mjs} +6 -4
  165. package/dist/server/{client-dROAfMRa.mjs → client-aYRTVneD.mjs} +205 -6
  166. package/dist/server/config-validation.mjs +1 -1
  167. package/dist/server/config.mjs +2 -2
  168. package/dist/server/customCss-BGB8gMVb.mjs +210 -0
  169. package/dist/server/data/resolveBlockData.mjs +1 -1
  170. package/dist/server/{identity-20XHqyuO.mjs → identity-DQD_8lNO.mjs} +1 -1
  171. package/dist/server/index.mjs +3 -3
  172. package/dist/server/{loadContent-zOIrtqz-.mjs → loadContent-Cgpfr44e.mjs} +8 -10
  173. package/dist/server/{loadPage-vwFiq1Rk.mjs → loadPage-RDk10NMP.mjs} +3 -3
  174. package/dist/server/lookMediaFrame-CQtkvlDn.mjs +2528 -0
  175. package/dist/server/manifest.mjs +2 -2
  176. package/dist/server/{media-Brn9FW5s.mjs → media-luf7RF22.mjs} +2 -2
  177. package/dist/server/{navigation-DAwbICEL.mjs → navigation-iC_hXjJI.mjs} +3 -1
  178. package/dist/server/navigation.mjs +1 -1
  179. package/dist/server/next.mjs +9 -8
  180. package/dist/server/{overrideResolution-DjboggbB.mjs → overrideResolution-VhhN94d8.mjs} +3 -4
  181. package/dist/server/page-converter.mjs +2 -2
  182. package/dist/server/{pageRenderPlan-BR4t1rOw.mjs → pageRenderPlan-CkFTsxkd.mjs} +166 -42
  183. package/dist/server/{pageRuntimeSupport-BKo6XVK-.mjs → pageRuntimeSupport-CpAtzNxD.mjs} +15 -7
  184. package/dist/server/{pageShared-BJjptSGp.mjs → pageShared-B8yLPjs0.mjs} +531 -117
  185. package/dist/server/{parseThemeForPersistence-B18KDEue.mjs → parseThemeForPersistence-Cwqb5pZx.mjs} +2 -2
  186. package/dist/server/{portal-Ce1Prfl3.mjs → portal-BjVHMAUC.mjs} +1 -1
  187. package/dist/server/portal.mjs +1 -1
  188. package/dist/server/{prebuild-CntSkZQI.mjs → prebuild-DOu6QceG.mjs} +1 -1
  189. package/dist/server/prebuild.mjs +1 -1
  190. package/dist/server/{prefetchBlockData-BM9Ds0OQ.mjs → prefetchBlockData-CfOXFKYG.mjs} +3 -3
  191. package/dist/server/{registry-wYH0LH5f.mjs → registry-34rkAfaU.mjs} +1409 -3314
  192. package/dist/server/rendering/components/pageShared.mjs +1 -1
  193. package/dist/server/rendering/helpers/loadPage.mjs +1 -1
  194. package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +2 -2
  195. package/dist/server/rendering/server.mjs +3 -3
  196. package/dist/server/rendering.mjs +8 -8
  197. package/dist/server/{resolveBlockData-Bu_p4HxZ.mjs → resolveBlockData-D7VeoWgr.mjs} +1 -1
  198. package/dist/server/{resolveButtonColourStates-CCPUY9Xh.mjs → resolveButtonColourStates--6yJp9Tq.mjs} +15 -4
  199. package/dist/server/{responseMedia-t6gs0cB7.mjs → responseMedia-DpBC1hTM.mjs} +1 -1
  200. package/dist/server/{schema-BFOqYIMQ.mjs → schema-CUDHMirj.mjs} +440 -154
  201. package/dist/server/server.mjs +3 -3
  202. package/dist/server/{src-Cxucn-1P.mjs → src-DHK4JUlp.mjs} +4 -1
  203. package/dist/server/theme-bridge.mjs +21 -15
  204. package/dist/server/theme.mjs +2 -2
  205. package/dist/server/{three-pass-converter-Bsfdy_ZV.mjs → three-pass-converter-39SXCCnh.mjs} +1 -1
  206. package/dist/server/{titleSourceSchema-DwKJfMYb.mjs → titleSourceSchema-Cu-3PRvv.mjs} +0 -1
  207. package/dist/server/{validation-DAQdPDku.mjs → validation-CLVKoJrX.mjs} +5 -5
  208. package/dist/server/{version-DAB0O3yx.mjs → version-HVfdvBJ0.mjs} +1 -1
  209. package/dist/styles/index.css +1038 -200
  210. package/package.json +1 -1
  211. package/dist/client/runtimeResponse-CPcA8xSm.mjs +0 -3
  212. package/dist/preview-next/client/SiteChromeCustomizeButton-CrgS3I8d.mjs +0 -53534
  213. package/dist/server/customCss-QymcmOZ-.mjs +0 -97
  214. package/dist/server/opaqueSurface-COEKXVwk.mjs +0 -54
  215. package/dist/server/rich-text-CRcONdyM.mjs +0 -33
@@ -1,9 +1,10 @@
1
1
  "use client";
2
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 { $ as externalMediaSchema, A as eyebrowTreatmentValues, Bt as formatTime$2, D as accordionIconSetValues, E as accordionIconMotionValues, F as visibleHeadingDecorationFamilyValues, G as toBookingRequirementConsentField, H as blockBookingConsentSchema, It as formatDate$2, K as beforeBookingQuestionsPresentationSchema, Kt as toScheduledBookingDateTime, Lt as formatDateRange, M as headingDecorationOverrideValues, N as isArrangementMode, O as arrangementModes, P as tileTreatmentValues, Q as assetMediaSchema, Qt as getLocalScheduleDate, Rt as formatDateTime, T as accordionIconColorTokenValues, Ut as inferSiteDateLocale, V as blockBookingPaymentTermsSchema, Vt as formatTimeRange, Wt as resolveBookingDisplayContext, Yt as compareLocalScheduleDates, Zt as getBookingLocalDateKey, an as toUtcIsoDateTimeString, ct as normalizeCurrencyCode, en as parseLocalScheduleTime, et as imageMediaSchema, ft as eventCalendarListLayoutValues, in as parseUtcIsoDateTimeString, it as videoMediaSchema, j as headingDecorationColorTokenValues, k as eventListTreatmentValues, ln as toNonNegativeCents, lt as eventCalendarDefaultViewValues, n as blockSiteTermsSchema, nn as resolveBookingTimeZoneId, on as validateBookingPaymentOptionKinds, q as bookingQuestionsAnswerValueSchema, rn as toBookingTimeZone, rt as runtimeMediaSchema, tn as resolveBookingBusinessTimeZone, tt as mediaSchema, un as formatCurrencyAmount, ut as eventCalendarDisplayModeValues, zt as formatDateTimeRange } from "./noop-CamIX2yK.mjs";
4
- import { A as resolveFlexibleBalanceDueAt, C as addIntervalPreservingMonthAnchor, D as getBookingInstalmentPlanIntervalCount, E as getBookingInstalmentDepositRefundability, N as assertNever$2, O as omitZeroAmountFutureRows, P as parseAppointmentServiceId, S as formatCreditProductUnits, a as buildBookingQuestionsSubmission, b as creditProductUnitNoun, d as resolveBookingQuestionsAnswerMode, j as resolveFlexibleBalanceInitialPaymentCents, k as splitAmountWithRemainderInFirst, l as initialBookingQuestionsAnswerMode, p as assertNever$3, t as deriveCreditProductLabels, u as initialBookingQuestionsValues, w as clampConfiguredAmount } from "./creditProducts-BTRX4edc.mjs";
5
- import { Ct as paletteValueKey, Dt as preparePaletteColourIndex, F as defineButtonStyleRecipe, G as mergeStyles, H as backgroundColorStyle, I as mapButtonRoleAppearances, J as textColorStyle, K as rgbColorValue, L as mapButtonVisualAppearances, P as PUBLIC_BUTTON_ROLES, St as resolveOpaqueSurfaceHex, Tt as requirePaletteColorsFromEntries, X as resolveSurfaceForeground, _ as contextualButtonSurfaceResetStyles, _t as surfaceInkDeclarations, a as requireResolvedSurface, b as BUTTON_CONTRAST_POLICY, bt as ownedThemeSnapshot, c as surfaceButtonRequest, d as toAccessibleColorSurfaceIntent, dt as SURFACE_INK_CSS_VARS, ft as surfaceForegroundDeclarations, h as scrimTone, ht as surfaceForegroundValue, i as prepareThemeSurfaceRevision, it as contrastThresholdByPolicy, j as ELEVATION_OFFSET, kt as featuresFromHex, m as minimumScrimOpacity, o as resolveSurface, ot as expandPalette, p as gradientScrimSamples, t as parseResolvedSurface, u as surfaceTransportContext, ut as SURFACE_FOREGROUND_CSS_VARS, wt as paletteValueKeySchema, xt as resolveConcreteColorHex, yt as freezeOwnedThemeValue } from "./accessibleSurfaces-OsAseM7H.mjs";
3
+ import { $ as assetMediaSchema, $t as compareLocalScheduleDates, A as eventListTreatmentValues, Bt as formatDate$2, D as accordionIconSetValues, E as accordionIconMotionValues, Et as normalizeCurrencyCode, F as tileTreatmentValues, Gt as formatTimeRange, H as blockBookingPaymentTermsSchema, Ht as formatDateTime, I as visibleHeadingDecorationFamilyValues, J as bookingQuestionsAnswerValueSchema, Jt as resolveBookingDisplayContext, K as toBookingRequirementConsentField, M as headingDecorationColorTokenValues, N as headingDecorationOverrideValues, O as arrangementModes, P as isArrangementMode, Qt as addLocalScheduleDays, T as accordionIconColorTokenValues, Tt as allocateReductionCents, U as blockBookingConsentSchema, Ut as formatDateTimeRange, Vt as formatDateRange, Wt as formatTime$2, Xt as toScheduledBookingDateTime, an as resolveBookingBusinessTimeZone, at as videoMediaSchema, cn as parseUtcIsoDateTimeString, en as formatLocalScheduleDate, et as externalMediaSchema, ft as eventCalendarListLayoutValues, in as parseLocalScheduleTime, it as runtimeMediaSchema, j as eyebrowTreatmentValues, k as decorativeTransitionIntentValues, ln as toUtcIsoDateTimeString, lt as eventCalendarDefaultViewValues, mn as formatCurrencyAmount, n as blockSiteTermsSchema, nn as getLocalScheduleDate, nt as mediaSchema, on as resolveBookingTimeZoneId, pn as toNonNegativeCents, q as beforeBookingQuestionsPresentationSchema, qt as inferSiteDateLocale, rn as parseBookingLocalDate, sn as toBookingTimeZone, tn as getBookingLocalDateKey, tt as imageMediaSchema, un as validateBookingPaymentOptionKinds, ut as eventCalendarDisplayModeValues, wt as unsafeAsPositiveCheckoutQuantity } from "./noop-D5mFWXtN.mjs";
4
+ import { A as assertNever$2, C as addIntervalPreservingMonthAnchor, D as getBookingInstalmentPlanIntervalCount, E as getBookingInstalmentDepositRefundability, O as omitZeroAmountFutureRows, S as formatCreditProductUnits, a as buildBookingQuestionsSubmission, b as creditProductUnitNoun, d as resolveBookingQuestionsAnswerMode, j as parseAppointmentServiceId, k as splitAmountWithRemainderInFirst, l as initialBookingQuestionsAnswerMode, o as checkBookingQuestionsAnswered, p as assertNever$3, t as deriveCreditProductLabels, u as initialBookingQuestionsValues, w as clampConfiguredAmount } from "./creditProducts-KYMVIH3J.mjs";
5
+ import { t as stableJsonStringify } from "./stable-json-D0XAEIXc.mjs";
6
6
  import { l as buildCalendarViewport$1, n as calendarLinks, r as groupItemsByDate } from "./src-xrjaKaCj.mjs";
7
+ import { At as featuresFromHex, Ct as resolveOpaqueSurfaceHex, Et as requirePaletteColorsFromEntries, F as defineButtonStyleRecipe, G as mergeStyles, H as backgroundColorStyle, I as mapButtonRoleAppearances, K as rgbColorValue, L as mapButtonVisualAppearances, Ot as preparePaletteColourIndex, P as PUBLIC_BUTTON_ROLES, St as resolveConcreteColorHex, Tt as paletteValueKeySchema, Y as resolveSurfaceForeground, _ as contextualButtonSurfaceResetStyles, _t as surfaceInkDeclarations, a as requireResolvedSurface, b as BUTTON_CONTRAST_POLICY, bt as freezeOwnedThemeValue, c as surfaceButtonRequest, d as toAccessibleColorSurfaceIntent, dt as SURFACE_INK_CSS_VARS, ft as surfaceForegroundDeclarations, h as scrimTone, ht as surfaceForegroundValue, i as prepareThemeSurfaceRevision, it as contrastThresholdByPolicy, j as ELEVATION_OFFSET, m as minimumScrimOpacity, o as resolveSurface, ot as expandPalette, p as gradientScrimSamples, q as textColorStyle, t as parseResolvedSurface, u as surfaceTransportContext, ut as SURFACE_FOREGROUND_CSS_VARS, wt as paletteValueKey, xt as ownedThemeSnapshot } from "./accessibleSurfaces-DN8it_Cx.mjs";
7
8
  import { C as paletteColorsFromEntries, D as parseThemeColorToken, E as parseColorTokenParts, O as themeColorTokenSchema, S as paletteColorEntries, T as paletteModeSchema, b as isThemeColorToken, c as buttonEffectApplicationSchema, f as buttonVisualStatesSchema, g as VARIANT_ROLES, l as buttonPressOffsetSchema, s as unsafeAsOpaqueButtonColourToken, u as buttonSystemSchema, w as paletteColorsSchema, y as hexColorSchema } from "./types-DjWUR_O6.mjs";
8
9
  import { S as clsx } from "./ThemedButton-DuaYtnvG.mjs";
9
10
  import { a as getSupabaseUrl, i as getSiteId, n as getCurrentResolveImageUrlContext, r as getMediaAssetIndex } from "./mediaContext-Fusweriw.mjs";
@@ -409,6 +410,14 @@ function deriveTotalTicketQuantity(lines) {
409
410
  return parsed.ok ? parsed.value : null;
410
411
  }
411
412
  //#endregion
413
+ //#region ../core/src/booking-flexible-balance.ts
414
+ function clampFlexibleBalanceConfiguredAmount(amountCents, totalAmountCents) {
415
+ return Math.max(0, Math.min(amountCents, totalAmountCents));
416
+ }
417
+ function resolveFlexibleBalanceInitialPaymentCents(input) {
418
+ return clampFlexibleBalanceConfiguredAmount(input.config.upfrontAmountCents, input.totalAmountCents);
419
+ }
420
+ //#endregion
412
421
  //#region ../core/src/mailing-list-identifiers.ts
413
422
  const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu;
414
423
  const OPAQUE_ID_PATTERN = /^[A-Za-z0-9_-]{1,100}$/u;
@@ -867,6 +876,54 @@ function getBookingLaterInstalments(schedule) {
867
876
  return schedule.filter((row) => row.stateAtBooking === "scheduled");
868
877
  }
869
878
  //#endregion
879
+ //#region ../commerce/src/purchase/stripeMinimumCharge.ts
880
+ const STRIPE_MINIMUM_CHARGE_CENTS_BY_CURRENCY = {
881
+ GBP: 30,
882
+ USD: 50,
883
+ EUR: 50,
884
+ AED: 200,
885
+ AUD: 50,
886
+ BGN: 100,
887
+ BRL: 50,
888
+ CAD: 50,
889
+ CHF: 50,
890
+ CZK: 1500,
891
+ DKK: 250,
892
+ HKD: 400,
893
+ HUF: 17500,
894
+ JPY: 50,
895
+ MXN: 1e3,
896
+ MYR: 200,
897
+ NOK: 300,
898
+ NZD: 50,
899
+ PLN: 200,
900
+ RON: 200,
901
+ SEK: 300,
902
+ SGD: 50,
903
+ THB: 1e3
904
+ };
905
+ function isStripeMinimumChargeCurrency(currency) {
906
+ return currency in STRIPE_MINIMUM_CHARGE_CENTS_BY_CURRENCY;
907
+ }
908
+ function getStripeMinimumChargeRequirement(rawCurrency) {
909
+ let currency;
910
+ try {
911
+ currency = normalizeCurrencyCode(rawCurrency);
912
+ } catch {
913
+ return null;
914
+ }
915
+ const currencyKey = currency;
916
+ if (!isStripeMinimumChargeCurrency(currencyKey)) return null;
917
+ return {
918
+ currency,
919
+ minimumAmountCents: STRIPE_MINIMUM_CHARGE_CENTS_BY_CURRENCY[currencyKey]
920
+ };
921
+ }
922
+ function isStripeChargeBelowMinimum(options) {
923
+ const requirement = getStripeMinimumChargeRequirement(options.currency);
924
+ return Boolean(requirement && options.amountCents > 0 && options.amountCents < requirement.minimumAmountCents);
925
+ }
926
+ //#endregion
870
927
  //#region ../commerce/src/purchase/bookingPaymentSelection.ts
871
928
  /** Identity is decided against the authoritative quote, before display repricing. */
872
929
  function resolveAvailableBookingCollectionOptions(input) {
@@ -877,17 +934,15 @@ function resolveAvailableBookingCollectionOptions(input) {
877
934
  option,
878
935
  totalCents: input.totalCents,
879
936
  anchorAt: input.now,
880
- bookingStartAt: input.bookingStartAt
881
- })).filter((option) => option.kind !== "instalment_plan" || deadline !== null && canInstalmentPlanCompleteBefore({
882
- now: input.now,
883
- deadline,
884
- schedule: option.schedule
885
- }));
937
+ bookingStartAt: input.bookingStartAt,
938
+ timeZone: input.timeZone
939
+ })).filter((option) => canOfferBookingCollectionOption(option, input.currency ?? "USD", deadline));
886
940
  const upfront = resolveBookingCollectionOptionFacts({
887
941
  option: { kind: "upfront" },
888
942
  totalCents: input.totalCents,
889
943
  anchorAt: input.now,
890
- bookingStartAt: input.bookingStartAt
944
+ bookingStartAt: input.bookingStartAt,
945
+ timeZone: input.timeZone
891
946
  });
892
947
  const collapsed = available.map((option) => isBookingCollectionEquivalentToUpfront(option) ? upfront : option);
893
948
  const unique = collapsed.filter((option, index) => collapsed.findIndex((other) => other.kind === option.kind) === index);
@@ -906,7 +961,8 @@ function resolveBookingCollectionOptionFacts(input) {
906
961
  const money = {
907
962
  totalCents: input.totalCents,
908
963
  anchorAt: input.anchorAt,
909
- bookingStartAt: input.bookingStartAt
964
+ bookingStartAt: input.bookingStartAt,
965
+ timeZone: input.timeZone ?? "UTC"
910
966
  };
911
967
  switch (input.option.kind) {
912
968
  case "upfront": return {
@@ -945,10 +1001,7 @@ function resolveBookingCollectionOptionFacts(input) {
945
1001
  config: input.option.config,
946
1002
  dueNowCents,
947
1003
  remainingBalanceCents: Math.max(0, input.totalCents - dueNowCents),
948
- balanceDueAt: resolveFlexibleBalanceDueAt({
949
- bookingStartAt: input.bookingStartAt ?? input.anchorAt,
950
- dueDateRule: input.option.config.dueDateRule
951
- })
1004
+ balanceDueDay: flexibleBalanceDueDay(input.option.config, input.bookingStartAt ?? input.anchorAt, money.timeZone)
952
1005
  };
953
1006
  }
954
1007
  default: return assertNever$1(input.option);
@@ -956,13 +1009,63 @@ function resolveBookingCollectionOptionFacts(input) {
956
1009
  }
957
1010
  /** Discounts change preview money, never an already admitted collection identity. */
958
1011
  function repriceBookingCollectionOptions(input) {
959
- return input.options.map((option) => option.totalCents === input.totalCents ? option : resolveBookingCollectionOptionFacts({
1012
+ const repriced = input.options.map((option) => option.totalCents === input.totalCents ? option : resolveBookingCollectionOptionFacts({
960
1013
  option,
961
1014
  totalCents: input.totalCents,
962
1015
  anchorAt: option.anchorAt,
963
- bookingStartAt: option.bookingStartAt
1016
+ bookingStartAt: option.bookingStartAt,
1017
+ timeZone: option.timeZone
1018
+ }));
1019
+ const available = repriced.filter((option) => canOfferBookingCollectionOption(option, input.currency, input.instalmentCollectionDeadlineAt));
1020
+ const first = repriced[0];
1021
+ return available.length > 0 || !first ? available : [resolveBookingCollectionOptionFacts({
1022
+ option: { kind: "upfront" },
1023
+ totalCents: input.totalCents,
1024
+ anchorAt: first.anchorAt,
1025
+ bookingStartAt: first.bookingStartAt,
1026
+ timeZone: first.timeZone
1027
+ })];
1028
+ }
1029
+ /** The same admission is used for the offer and the submitted selection. */
1030
+ function canOfferBookingCollectionOption(option, currency, deadline = option.bookingStartAt) {
1031
+ if (option.kind === "upfront" || option.kind === "deferred_manual") return true;
1032
+ const window = bookingCollectionWindow(option);
1033
+ if (!window) return false;
1034
+ const { now, start } = window;
1035
+ if (option.kind === "flexible_balance") return flexibleBalanceCanBeCollected(option, currency, now, start);
1036
+ return deadline !== null && canInstalmentPlanCompleteBefore({
1037
+ now: option.anchorAt,
1038
+ deadline,
1039
+ schedule: option.schedule
1040
+ }) && laterInstalmentsCanBeCollected(option, currency, now);
1041
+ }
1042
+ function laterInstalmentsCanBeCollected(option, currency, now) {
1043
+ return option.schedule.filter((row) => row.stateAtBooking === "scheduled").every((row) => Date.parse(row.dueAt) > now && !isStripeChargeBelowMinimum({
1044
+ amountCents: row.amountCents,
1045
+ currency
964
1046
  }));
965
1047
  }
1048
+ function flexibleBalanceCanBeCollected(option, currency, now, start) {
1049
+ const today = formatLocalScheduleDate(getLocalScheduleDate(new Date(now), option.timeZone));
1050
+ const startDay = formatLocalScheduleDate(getLocalScheduleDate(new Date(start), option.timeZone));
1051
+ return option.balanceDueDay >= today && option.balanceDueDay < startDay && !isStripeChargeBelowMinimum({
1052
+ amountCents: option.remainingBalanceCents,
1053
+ currency
1054
+ });
1055
+ }
1056
+ function bookingCollectionWindow(option) {
1057
+ const now = Date.parse(option.anchorAt);
1058
+ const start = Date.parse(option.bookingStartAt ?? "");
1059
+ return Number.isFinite(now) && Number.isFinite(start) && start > now ? {
1060
+ now,
1061
+ start
1062
+ } : null;
1063
+ }
1064
+ /** Mirrors private.flexible_balance_due_day: fixed civil date, or local start minus calendar days. */
1065
+ function flexibleBalanceDueDay(config, bookingStartAt, timeZone) {
1066
+ const rule = config.dueDateRule;
1067
+ return formatLocalScheduleDate(rule.kind === "fixed_calendar_date" ? parseBookingLocalDate(rule.dueAt.slice(0, 10)) : addLocalScheduleDays(getLocalScheduleDate(new Date(bookingStartAt), timeZone), -rule.daysBeforeStart));
1068
+ }
966
1069
  //#endregion
967
1070
  //#region ../commerce/src/purchase/checkoutPaymentFlow.ts
968
1071
  function planCheckoutPaymentFlow(options) {
@@ -1043,50 +1146,6 @@ function planFlexibleBalanceCreditFirst(input) {
1043
1146
  };
1044
1147
  }
1045
1148
  //#endregion
1046
- //#region ../commerce/src/purchase/stripeMinimumCharge.ts
1047
- const STRIPE_MINIMUM_CHARGE_CENTS_BY_CURRENCY = {
1048
- GBP: 30,
1049
- USD: 50,
1050
- EUR: 50,
1051
- AED: 200,
1052
- AUD: 50,
1053
- BGN: 100,
1054
- BRL: 50,
1055
- CAD: 50,
1056
- CHF: 50,
1057
- CZK: 1500,
1058
- DKK: 250,
1059
- HKD: 400,
1060
- HUF: 17500,
1061
- JPY: 50,
1062
- MXN: 1e3,
1063
- MYR: 200,
1064
- NOK: 300,
1065
- NZD: 50,
1066
- PLN: 200,
1067
- RON: 200,
1068
- SEK: 300,
1069
- SGD: 50,
1070
- THB: 1e3
1071
- };
1072
- function isStripeMinimumChargeCurrency(currency) {
1073
- return currency in STRIPE_MINIMUM_CHARGE_CENTS_BY_CURRENCY;
1074
- }
1075
- function getStripeMinimumChargeRequirement(rawCurrency) {
1076
- let currency;
1077
- try {
1078
- currency = normalizeCurrencyCode(rawCurrency);
1079
- } catch {
1080
- return null;
1081
- }
1082
- const currencyKey = currency;
1083
- if (!isStripeMinimumChargeCurrency(currencyKey)) return null;
1084
- return {
1085
- currency,
1086
- minimumAmountCents: STRIPE_MINIMUM_CHARGE_CENTS_BY_CURRENCY[currencyKey]
1087
- };
1088
- }
1089
- //#endregion
1090
1149
  //#region ../commerce/src/purchase/checkoutCopy.ts
1091
1150
  /**
1092
1151
  * Customer copy shared by checkout surfaces, so one approved wording reaches
@@ -1099,6 +1158,279 @@ const checkoutCopy = {
1099
1158
  checkoutAssistanceRequired: "We can’t confirm your last payment attempt yet. Please don’t pay again – contact the business so they can check it."
1100
1159
  };
1101
1160
  //#endregion
1161
+ //#region ../commerce/src/purchase/combinationPricing.ts
1162
+ const cents = toNonNegativeCents;
1163
+ const compareText = (a, b) => a < b ? -1 : a > b ? 1 : 0;
1164
+ const compareLine = (a, b) => compareText(a.date, b.date) || compareText(a.lineId, b.lineId);
1165
+ const compareOffer = (a, b) => a.sortOrder - b.sortOrder || compareText(a.id, b.id);
1166
+ const sumPrices = (lines) => lines.reduce((sum, line) => sum + line.unitPriceCents, 0);
1167
+ function application(offer, lines, places) {
1168
+ const ordered = [...lines].sort(compareLine);
1169
+ const savingCents = cents((sumPrices(lines) - offer.priceCents) * places);
1170
+ const allocation = allocateReductionCents(ordered.map((line) => ({
1171
+ lineId: line.lineId,
1172
+ basisCents: cents(line.unitPriceCents * places),
1173
+ maxReducibleCents: cents(line.unitPriceCents * places)
1174
+ })), savingCents);
1175
+ return {
1176
+ offer,
1177
+ lines: ordered,
1178
+ totalCents: cents(offer.priceCents * places),
1179
+ savingCents,
1180
+ allocations: allocation.allocations.map((row, index) => ({
1181
+ lineId: row.lineId,
1182
+ reductionCents: row.amountCents,
1183
+ totalCents: cents((ordered[index]?.unitPriceCents ?? 0) * places - row.amountCents)
1184
+ }))
1185
+ };
1186
+ }
1187
+ const compareApplication = (a, b) => compareOffer(a.offer, b.offer) || compareText(JSON.stringify(a.lines.map((line) => [line.date, line.lineId])), JSON.stringify(b.lines.map((line) => [line.date, line.lineId])));
1188
+ const saving = (apps) => apps.reduce((sum, app) => sum + app.savingCents, 0);
1189
+ function prefer(a, b) {
1190
+ const money = saving(b) - saving(a);
1191
+ if (money !== 0) return money < 0 ? a : b;
1192
+ if (a.length !== b.length) return a.length < b.length ? a : b;
1193
+ const left = [...a].sort(compareApplication);
1194
+ const right = [...b].sort(compareApplication);
1195
+ const offerDifference = left.map((app, index) => right[index] ? compareOffer(app.offer, right[index].offer) : 0).find((value) => value !== 0) ?? 0;
1196
+ if (offerDifference !== 0) return offerDifference < 0 ? left : right;
1197
+ return (left.map((app, index) => right[index] ? compareApplication(app, right[index]) : 0).find((value) => value !== 0) ?? 0) <= 0 ? left : right;
1198
+ }
1199
+ function cheaperSelection(a, b) {
1200
+ if (!a) return b;
1201
+ if (a.priceCents !== b.priceCents) return a.priceCents < b.priceCents ? a : b;
1202
+ if (a.offers.length !== b.offers.length) return a.offers.length < b.offers.length ? a : b;
1203
+ return (a.offers.map((offer, index) => b.offers[index] ? compareOffer(offer, b.offers[index]) : 0).find((value) => value !== 0) ?? 0) <= 0 ? a : b;
1204
+ }
1205
+ /** Cheapest exact cover of each count, independent of which dates fill it. */
1206
+ function anySelections(count, offers) {
1207
+ const memo = /* @__PURE__ */ new Map([[0, {
1208
+ offers: [],
1209
+ priceCents: 0
1210
+ }]]);
1211
+ const visit = (size) => {
1212
+ if (memo.has(size)) return memo.get(size) ?? null;
1213
+ const best = offers.reduce((best, offer) => {
1214
+ if (offer.itemCount > size) return best;
1215
+ const previous = visit(size - offer.itemCount);
1216
+ return previous ? cheaperSelection(best, {
1217
+ offers: [...previous.offers, offer].sort(compareOffer),
1218
+ priceCents: previous.priceCents + offer.priceCents
1219
+ }) : best;
1220
+ }, null);
1221
+ memo.set(size, best);
1222
+ return best;
1223
+ };
1224
+ return Array.from({ length: count + 1 }, (_, size) => visit(size));
1225
+ }
1226
+ /**
1227
+ * Covering k items always uses the k highest list prices (earliest dates on ties).
1228
+ * Once offer counts are fixed, grouping cannot change the total. A globally best
1229
+ * candidate cannot contain a non-saving group: dropping it would improve the
1230
+ * total or the application-count tie. So canonical date grouping is sufficient.
1231
+ */
1232
+ function planAny(lines, offers, places) {
1233
+ const ranked = [...lines].sort((a, b) => b.unitPriceCents - a.unitPriceCents || compareLine(a, b));
1234
+ return anySelections(lines.length, offers.filter((offer) => offer.kind === "any")).reduce((best, selected, count) => {
1235
+ if (!selected) return best;
1236
+ const chosen = ranked.slice(0, count).sort(compareLine);
1237
+ const grouped = selected.offers.reduce((state, offer) => {
1238
+ const size = offer.itemCount;
1239
+ const group = chosen.slice(state.offset, state.offset + size);
1240
+ return {
1241
+ offset: state.offset + size,
1242
+ apps: [...state.apps, application(offer, group, places)]
1243
+ };
1244
+ }, {
1245
+ offset: 0,
1246
+ apps: []
1247
+ });
1248
+ return grouped.apps.every((app) => app.savingCents > 0) ? prefer(best, grouped.apps) : best;
1249
+ }, []);
1250
+ }
1251
+ /** Search particular-set subsets; memoised masks collapse different application orders. */
1252
+ function search(input) {
1253
+ const memo = /* @__PURE__ */ new Map();
1254
+ const visit = (mask) => {
1255
+ const cached = memo.get(mask);
1256
+ if (cached) return cached;
1257
+ const remaining = input.lines.filter((_, index) => (mask & 1 << index) !== 0);
1258
+ const best = input.offers.reduce((best, offer) => {
1259
+ if (offer.kind !== "particular") return best;
1260
+ const group = remaining.filter((line) => offer.lineIds.includes(line.lineId));
1261
+ if (group.length !== offer.lineIds.length || sumPrices(group) <= offer.priceCents) return best;
1262
+ const used = input.lines.reduce((bits, line, index) => group.includes(line) ? bits | 1 << index : bits, 0);
1263
+ return prefer(best, [application(offer, group, input.places), ...visit(mask ^ used)]);
1264
+ }, planAny(remaining, input.offers, input.places));
1265
+ memo.set(mask, best);
1266
+ return best;
1267
+ };
1268
+ return visit((1 << input.lines.length) - 1);
1269
+ }
1270
+ function validate(input) {
1271
+ if (input.lines.length > 20 || new Set(input.lines.map((line) => line.lineId)).size !== input.lines.length) throw new Error("Combination pricing requires at most 20 distinct lines");
1272
+ if (input.offers.some((offer) => offer.kind === "any" ? offer.itemCount < 2 : offer.lineIds.length < 2 || new Set(offer.lineIds).size !== offer.lineIds.length)) throw new Error("Combination offers require at least two distinct items");
1273
+ }
1274
+ function planCombinationPrices(input) {
1275
+ validate(input);
1276
+ const applications = [...search(input)].sort(compareApplication);
1277
+ const lines = [...input.lines].sort(compareLine).map((line) => {
1278
+ const allocated = applications.flatMap((app) => app.allocations).find((row) => row.lineId === line.lineId);
1279
+ const listCents = cents(line.unitPriceCents * input.places);
1280
+ return {
1281
+ line,
1282
+ listCents,
1283
+ totalCents: allocated?.totalCents ?? listCents,
1284
+ combined: allocated !== void 0
1285
+ };
1286
+ });
1287
+ return {
1288
+ places: input.places,
1289
+ applications,
1290
+ lines,
1291
+ totalCents: cents(lines.reduce((sum, line) => sum + line.totalCents, 0)),
1292
+ listTotalCents: cents(sumPrices(input.lines) * input.places)
1293
+ };
1294
+ }
1295
+ /**
1296
+ * The offers a selection can use, with particular offers mapped from the item
1297
+ * ids they name to this basket's line ids. A particular offer applies only
1298
+ * when every item it names is selected. Which items an offer may cover at all
1299
+ * (fixed-price ones) is decided when offers are stored and published, so the
1300
+ * offers arriving here already exclude ticket types and sliding scales.
1301
+ */
1302
+ function combinationOffersForSelection(offers, items) {
1303
+ const lineIds = new Map(items.map((item) => [item.itemId, item.lineId]));
1304
+ return offers.flatMap((offer) => {
1305
+ if (offer.kind === "any") return [offer];
1306
+ const selected = offer.lineIds.map((id) => lineIds.get(id));
1307
+ return selected.every((id) => id !== void 0) ? [{
1308
+ ...offer,
1309
+ lineIds: selected
1310
+ }] : [];
1311
+ });
1312
+ }
1313
+ /**
1314
+ * Checkout and the booking block price a selection here (issue 1725). Every
1315
+ * item enters at its resolved price, so an item no offer covers (a run with
1316
+ * ticket types next to "Part 1 and Part 2 for £120") stays at the price
1317
+ * chosen for it and still counts in the total.
1318
+ */
1319
+ function planSelectionCombinationPrices(input) {
1320
+ const plan = planCombinationPrices({
1321
+ lines: input.items.map(({ lineId, date, label, unitPriceCents }) => ({
1322
+ lineId,
1323
+ date,
1324
+ label,
1325
+ unitPriceCents
1326
+ })),
1327
+ offers: combinationOffersForSelection(input.offers, input.items),
1328
+ places: input.places
1329
+ });
1330
+ const uncovered = (input.uncovered ?? []).map(({ line, subtotalCents }) => ({
1331
+ line,
1332
+ listCents: subtotalCents,
1333
+ totalCents: subtotalCents,
1334
+ combined: false
1335
+ }));
1336
+ const extra = uncovered.reduce((sum, row) => sum + row.totalCents, 0);
1337
+ return {
1338
+ ...plan,
1339
+ lines: [...plan.lines, ...uncovered],
1340
+ totalCents: cents(plan.totalCents + extra),
1341
+ listTotalCents: cents(plan.listTotalCents + extra)
1342
+ };
1343
+ }
1344
+ /** One completion per offer, never arbitrary subsets of the available items. */
1345
+ function missingOfferLines(input, offer) {
1346
+ const selected = new Set(input.lines.map((line) => line.lineId));
1347
+ if (offer.kind === "particular") {
1348
+ const missing = offer.lineIds.filter((id) => !selected.has(id));
1349
+ const added = missing.flatMap((id) => input.addable.filter((line) => line.lineId === id));
1350
+ return added.length === missing.length ? added.sort(compareLine) : null;
1351
+ }
1352
+ const count = Math.max(0, offer.itemCount - input.lines.length);
1353
+ return [...input.addable].sort((a, b) => a.unitPriceCents - b.unitPriceCents || compareLine(a, b)).slice(0, count);
1354
+ }
1355
+ function nextCombinationHint(input) {
1356
+ const current = planCombinationPrices(input);
1357
+ const used = new Set(current.applications.map((app) => app.offer.id));
1358
+ return input.offers.filter((offer) => !used.has(offer.id)).flatMap((offer) => {
1359
+ const added = missingOfferLines(input, offer);
1360
+ if (!added?.length || input.lines.length + added.length > 20) return [];
1361
+ const plan = planCombinationPrices({
1362
+ ...input,
1363
+ lines: [...input.lines, ...added]
1364
+ });
1365
+ const fresh = plan.applications.find((app) => !used.has(app.offer.id) && app.lines.some((line) => added.some((item) => item.lineId === line.lineId)));
1366
+ return fresh ? [{
1367
+ added,
1368
+ offer: fresh.offer,
1369
+ plan,
1370
+ savingCents: cents(plan.listTotalCents - plan.totalCents)
1371
+ }] : [];
1372
+ }).sort((a, b) => a.added.length - b.added.length || a.plan.totalCents - b.plan.totalCents || compareOffer(a.offer, b.offer))[0] ?? null;
1373
+ }
1374
+ //#endregion
1375
+ //#region ../site-contracts/src/siteData/eventSelection.ts
1376
+ function isHybrid(item) {
1377
+ return item.deliveryMode === "hybrid";
1378
+ }
1379
+ function offeredModes(item) {
1380
+ const delivery = item.deliveryMode ?? "in_person";
1381
+ return delivery === "hybrid" ? (item.attendanceModes ?? []).map((row) => row.mode) : [delivery];
1382
+ }
1383
+ function decideSelectionAttendance(items) {
1384
+ const [first, ...rest] = items;
1385
+ if (!first) return { kind: "none" };
1386
+ const common = rest.reduce((modes, item) => modes.filter((mode) => offeredModes(item).includes(mode)), offeredModes(first));
1387
+ const [only, ...others] = common;
1388
+ if (!items.every(isHybrid)) return only && others.length === 0 ? {
1389
+ kind: "fixed",
1390
+ mode: only
1391
+ } : { kind: "incompatible" };
1392
+ return rest.length > 0 && common.length === 0 ? { kind: "incompatible" } : {
1393
+ kind: "choose",
1394
+ modes: common
1395
+ };
1396
+ }
1397
+ /** The way of attending the booking uses: the fixed one, or the visitor's choice while it's still offered. */
1398
+ function resolveSelectionAttendanceMode(attendance, selected) {
1399
+ switch (attendance.kind) {
1400
+ case "none":
1401
+ case "incompatible": return null;
1402
+ case "fixed": return attendance.mode;
1403
+ case "choose": return selected !== null && attendance.modes.includes(selected) ? selected : null;
1404
+ }
1405
+ }
1406
+ const INCOMPATIBLE_ATTENDANCE_MESSAGE = "These runs can’t be booked together, because they don’t share a way to attend. Book them one at a time.";
1407
+ //#endregion
1408
+ //#region ../site-contracts/src/siteData/eventSelectionRequirements.ts
1409
+ /** The consent text is its version: attachment IDs alone do not change when copy is edited. */
1410
+ function eventBookingConsentContentKey(consent) {
1411
+ return stableJsonStringify({
1412
+ title: consent.title,
1413
+ agreement: consent.agreement,
1414
+ checkboxLabel: consent.checkboxLabel
1415
+ });
1416
+ }
1417
+ /** Unavailable or older question payloads cannot prove that sharing is safe. */
1418
+ function areEventBookingRequirementsIdentical(requirements) {
1419
+ const keys = requirements.map(requirementsKey);
1420
+ const first = keys[0];
1421
+ return first !== void 0 && first !== null && keys.every((key) => key === first);
1422
+ }
1423
+ function requirementsKey(view) {
1424
+ const questions = view.bookingQuestions;
1425
+ if (questions.kind === "unavailable") return null;
1426
+ const questionKey = questions.kind === "none" ? null : questions.set.sharingKey;
1427
+ if (questionKey === void 0) return null;
1428
+ return stableJsonStringify({
1429
+ consent: view.consent ? eventBookingConsentContentKey(view.consent) : null,
1430
+ questions: questionKey
1431
+ });
1432
+ }
1433
+ //#endregion
1102
1434
  //#region ../media-core/src/fileSafety.ts
1103
1435
  const CONTROL_CHARACTER_PATTERN = /[\u0000-\u001f\u007f]/u;
1104
1436
  function containsUnsafePathSegmentCharacter(value) {
@@ -2153,6 +2485,398 @@ const gradientsSchema = z.object({
2153
2485
  background: z.string().min(1).nullable().optional()
2154
2486
  });
2155
2487
  //#endregion
2488
+ //#region ../site-contracts/src/theme/bodyFontFamilies.generated.ts
2489
+ const bodyFontFamilies = [
2490
+ "AR One Sans",
2491
+ "Abhaya Libre",
2492
+ "Advent Pro",
2493
+ "Afacad",
2494
+ "Afacad Flux",
2495
+ "Agdasima",
2496
+ "Akatab",
2497
+ "Akshar",
2498
+ "Albert Sans",
2499
+ "Alef",
2500
+ "Alegreya",
2501
+ "Alegreya Sans",
2502
+ "Aleo",
2503
+ "Alexandria",
2504
+ "Almarai",
2505
+ "Alumni Sans",
2506
+ "Amaranth",
2507
+ "Amiko",
2508
+ "Amiri",
2509
+ "Anaheim",
2510
+ "Andada Pro",
2511
+ "Andika",
2512
+ "Anek Bangla",
2513
+ "Anek Latin",
2514
+ "Anek Telugu",
2515
+ "Anuphan",
2516
+ "Archivo",
2517
+ "Aref Ruqaa",
2518
+ "Arimo",
2519
+ "Arsenal",
2520
+ "Arvo",
2521
+ "Asap",
2522
+ "Asap Sharp",
2523
+ "Assistant",
2524
+ "Asul",
2525
+ "Athiti",
2526
+ "Atkinson Hyperlegible",
2527
+ "Atkinson Hyperlegible Next",
2528
+ "B612",
2529
+ "BIZ UDGothic",
2530
+ "BIZ UDMincho",
2531
+ "BIZ UDPGothic",
2532
+ "BIZ UDPMincho",
2533
+ "Bai Jamjuree",
2534
+ "Barlow",
2535
+ "Baskervville",
2536
+ "Be Vietnam Pro",
2537
+ "Belanosima",
2538
+ "BenchNine",
2539
+ "Besley",
2540
+ "BioRhyme",
2541
+ "Biryani",
2542
+ "Bitter",
2543
+ "Blinker",
2544
+ "Bodoni Moda",
2545
+ "Bona Nova",
2546
+ "Bricolage Grotesque",
2547
+ "Brygada 1918",
2548
+ "Buenard",
2549
+ "Cabin",
2550
+ "Cairo",
2551
+ "Caladea",
2552
+ "Cambay",
2553
+ "Cantarell",
2554
+ "Cardo",
2555
+ "Carlito",
2556
+ "Castoro",
2557
+ "Catamaran",
2558
+ "Caudex",
2559
+ "Changa",
2560
+ "Charis SIL",
2561
+ "Chiron GoRound TC",
2562
+ "Chivo",
2563
+ "Commissioner",
2564
+ "Cormorant",
2565
+ "Cormorant Garamond",
2566
+ "Cormorant Infant",
2567
+ "Cormorant Upright",
2568
+ "Crimson Pro",
2569
+ "Crimson Text",
2570
+ "Cuprum",
2571
+ "DM Sans",
2572
+ "Darker Grotesque",
2573
+ "David Libre",
2574
+ "Domine",
2575
+ "Dongle",
2576
+ "Dosis",
2577
+ "EB Garamond",
2578
+ "Economica",
2579
+ "Eczar",
2580
+ "El Messiri",
2581
+ "Elms Sans",
2582
+ "Encode Sans",
2583
+ "Encode Sans Expanded",
2584
+ "Encode Sans Semi Expanded",
2585
+ "Enriqueta",
2586
+ "Epilogue",
2587
+ "Estedad",
2588
+ "Exo",
2589
+ "Exo 2",
2590
+ "Fahkwang",
2591
+ "Familjen Grotesk",
2592
+ "Farro",
2593
+ "Faustina",
2594
+ "Figtree",
2595
+ "Finlandica Text",
2596
+ "Fira Sans",
2597
+ "Frank Ruhl Libre",
2598
+ "Fraunces",
2599
+ "Fredoka",
2600
+ "Funnel Sans",
2601
+ "Fustat",
2602
+ "Gantari",
2603
+ "Gayathri",
2604
+ "Geist",
2605
+ "Gelasio",
2606
+ "Gentium Book Plus",
2607
+ "Gentium Plus",
2608
+ "Geologica",
2609
+ "Geom",
2610
+ "Georama",
2611
+ "Glegoo",
2612
+ "Glory",
2613
+ "Golos Text",
2614
+ "Google Sans",
2615
+ "Google Sans Flex",
2616
+ "Gothic A1",
2617
+ "Gowun Batang",
2618
+ "Gudea",
2619
+ "Halant",
2620
+ "Hanken Grotesk",
2621
+ "Hanuman",
2622
+ "Heebo",
2623
+ "Hepta Slab",
2624
+ "Hind",
2625
+ "Hind Guntur",
2626
+ "Hind Madurai",
2627
+ "Hind Siliguri",
2628
+ "Hind Vadodara",
2629
+ "Host Grotesk",
2630
+ "IBM Plex Sans",
2631
+ "IBM Plex Sans Arabic",
2632
+ "IBM Plex Sans Hebrew",
2633
+ "IBM Plex Sans JP",
2634
+ "IBM Plex Sans KR",
2635
+ "IBM Plex Sans Thai",
2636
+ "IBM Plex Sans Thai Looped",
2637
+ "IBM Plex Serif",
2638
+ "Ibarra Real Nova",
2639
+ "Inclusive Sans",
2640
+ "Inknut Antiqua",
2641
+ "Inria Sans",
2642
+ "Inria Serif",
2643
+ "Instrument Sans",
2644
+ "Inter",
2645
+ "Inter Tight",
2646
+ "Istok Web",
2647
+ "Josefin Sans",
2648
+ "Jost",
2649
+ "Jura",
2650
+ "K2D",
2651
+ "Kaisei Decol",
2652
+ "Kaisei Opti",
2653
+ "Kalnia",
2654
+ "Kameron",
2655
+ "Kanit",
2656
+ "Kantumruy Pro",
2657
+ "Karla",
2658
+ "Karma",
2659
+ "Khula",
2660
+ "KoHo",
2661
+ "Kreon",
2662
+ "Krub",
2663
+ "Kumbh Sans",
2664
+ "LINE Seed JP",
2665
+ "Laila",
2666
+ "Lateef",
2667
+ "Lato",
2668
+ "League Spartan",
2669
+ "Lexend",
2670
+ "Lexend Deca",
2671
+ "Lexend Exa",
2672
+ "Lexend Giga",
2673
+ "Lexend Mega",
2674
+ "Lexend Zetta",
2675
+ "Libertinus Sans",
2676
+ "Libre Baskerville",
2677
+ "Libre Bodoni",
2678
+ "Libre Caslon Text",
2679
+ "Libre Franklin",
2680
+ "Literata",
2681
+ "Livvic",
2682
+ "Lora",
2683
+ "Lusitana",
2684
+ "M PLUS 1",
2685
+ "M PLUS 1p",
2686
+ "M PLUS 2",
2687
+ "M PLUS Rounded 1c",
2688
+ "Mada",
2689
+ "Maitree",
2690
+ "Manrope",
2691
+ "Markazi Text",
2692
+ "Martel",
2693
+ "Martel Sans",
2694
+ "Marvel",
2695
+ "Maven Pro",
2696
+ "Menbere",
2697
+ "Merriweather",
2698
+ "Merriweather Sans",
2699
+ "Mina",
2700
+ "Miriam Libre",
2701
+ "Mitr",
2702
+ "Moderustic",
2703
+ "Mona Sans",
2704
+ "Monda",
2705
+ "Montagu Slab",
2706
+ "Montserrat",
2707
+ "Montserrat Underline",
2708
+ "Mozilla Headline",
2709
+ "Mozilla Text",
2710
+ "Mukta",
2711
+ "Mukta Malar",
2712
+ "Mukta Vaani",
2713
+ "Mulish",
2714
+ "Murecho",
2715
+ "Nanum Gothic",
2716
+ "Nanum Myeongjo",
2717
+ "Neuton",
2718
+ "News Cycle",
2719
+ "Newsreader",
2720
+ "Niramit",
2721
+ "Nokora",
2722
+ "Noticia Text",
2723
+ "Noto Emoji",
2724
+ "Noto Kufi Arabic",
2725
+ "Noto Naskh Arabic",
2726
+ "Noto Nastaliq Urdu",
2727
+ "Noto Sans",
2728
+ "Noto Sans Arabic",
2729
+ "Noto Sans Armenian",
2730
+ "Noto Sans Bengali",
2731
+ "Noto Sans Devanagari",
2732
+ "Noto Sans Duployan",
2733
+ "Noto Sans Georgian",
2734
+ "Noto Sans Gujarati",
2735
+ "Noto Sans Gurmukhi",
2736
+ "Noto Sans HK",
2737
+ "Noto Sans Hebrew",
2738
+ "Noto Sans JP",
2739
+ "Noto Sans KR",
2740
+ "Noto Sans Kannada",
2741
+ "Noto Sans Khmer",
2742
+ "Noto Sans Malayalam",
2743
+ "Noto Sans Meetei Mayek",
2744
+ "Noto Sans Mono",
2745
+ "Noto Sans Myanmar",
2746
+ "Noto Sans Ol Chiki",
2747
+ "Noto Sans Oriya",
2748
+ "Noto Sans Sinhala",
2749
+ "Noto Sans Sundanese",
2750
+ "Noto Sans Symbols",
2751
+ "Noto Sans TC",
2752
+ "Noto Sans Tamil",
2753
+ "Noto Sans Telugu",
2754
+ "Noto Sans Thai",
2755
+ "Noto Sans Thai Looped",
2756
+ "Noto Serif",
2757
+ "Noto Serif Bengali",
2758
+ "Noto Serif Devanagari",
2759
+ "Noto Serif Georgian",
2760
+ "Noto Serif JP",
2761
+ "Noto Serif KR",
2762
+ "Noto Serif Malayalam",
2763
+ "Noto Serif TC",
2764
+ "Noto Serif Tamil",
2765
+ "Noto Serif Thai",
2766
+ "Nunito",
2767
+ "Nunito Sans",
2768
+ "Ojuju",
2769
+ "Old Standard TT",
2770
+ "Onest",
2771
+ "Open Sans",
2772
+ "Outfit",
2773
+ "Overpass",
2774
+ "Oxygen",
2775
+ "PT Sans",
2776
+ "PT Sans Caption",
2777
+ "PT Serif",
2778
+ "Padauk",
2779
+ "Palanquin",
2780
+ "Palanquin Dark",
2781
+ "Parkinsans",
2782
+ "Petrona",
2783
+ "Philosopher",
2784
+ "Piazzolla",
2785
+ "Platypi",
2786
+ "Play",
2787
+ "Playfair",
2788
+ "Plus Jakarta Sans",
2789
+ "Podkova",
2790
+ "Pontano Sans",
2791
+ "Poppins",
2792
+ "Pridi",
2793
+ "Prompt",
2794
+ "Proza Libre",
2795
+ "Public Sans",
2796
+ "Quattrocento",
2797
+ "Quattrocento Sans",
2798
+ "Quicksand",
2799
+ "REM",
2800
+ "Radio Canada",
2801
+ "Radio Canada Big",
2802
+ "Raleway",
2803
+ "Rasa",
2804
+ "Readex Pro",
2805
+ "Recursive",
2806
+ "Red Hat Text",
2807
+ "Reddit Sans",
2808
+ "Reem Kufi",
2809
+ "Rethink Sans",
2810
+ "Roboto",
2811
+ "Roboto Serif",
2812
+ "Roboto Slab",
2813
+ "Rokkitt",
2814
+ "Rosario",
2815
+ "Rubik",
2816
+ "Ruda",
2817
+ "Rufina",
2818
+ "Ruwudu",
2819
+ "STIX Two Text",
2820
+ "Saira",
2821
+ "Sansita",
2822
+ "Sarabun",
2823
+ "Sarala",
2824
+ "Scada",
2825
+ "Schibsted Grotesk",
2826
+ "Sen",
2827
+ "Share",
2828
+ "Shippori Mincho",
2829
+ "Shippori Mincho B1",
2830
+ "Signika",
2831
+ "Signika Negative",
2832
+ "Sintony",
2833
+ "Sofia Sans",
2834
+ "Solway",
2835
+ "Sora",
2836
+ "Sour Gummy",
2837
+ "Source Sans 3",
2838
+ "Source Serif 4",
2839
+ "Space Grotesk",
2840
+ "Special Gothic",
2841
+ "Spectral",
2842
+ "Spline Sans",
2843
+ "Sulphur Point",
2844
+ "Sumana",
2845
+ "Sura",
2846
+ "Syne",
2847
+ "TASA Orbiter",
2848
+ "Tajawal",
2849
+ "Taviraj",
2850
+ "TikTok Sans",
2851
+ "Tinos",
2852
+ "Titillium Web",
2853
+ "Trirong",
2854
+ "Trispace",
2855
+ "Ubuntu",
2856
+ "Ubuntu Sans",
2857
+ "Unbounded",
2858
+ "Unna",
2859
+ "Urbanist",
2860
+ "Vazirmatn",
2861
+ "Vesper Libre",
2862
+ "Volkhov",
2863
+ "Vollkorn",
2864
+ "Wix Madefor Text",
2865
+ "Work Sans",
2866
+ "Xmind",
2867
+ "Yanone Kaffeesatz",
2868
+ "Yantramanav",
2869
+ "Yrsa",
2870
+ "Ysabeau",
2871
+ "Zalando Sans",
2872
+ "Zalando Sans SemiExpanded",
2873
+ "Zen Kaku Gothic Antique",
2874
+ "Zen Kaku Gothic New",
2875
+ "Zen Maru Gothic",
2876
+ "Zen Old Mincho",
2877
+ "Zilla Slab"
2878
+ ];
2879
+ //#endregion
2156
2880
  //#region ../site-contracts/src/theme/fonts.ts
2157
2881
  const fontWeightListSchema = z.array(z.number().int().min(100).max(900));
2158
2882
  const fontLoadingSchema = z.object({
@@ -2176,6 +2900,7 @@ const curatedFontWidths = {
2176
2900
  function getFontWidthRange(family) {
2177
2901
  return curatedFontWidths[(family.split(",")[0] ?? "").trim().replace(/^["']|["']$/g, "")];
2178
2902
  }
2903
+ new Set(bodyFontFamilies.map((family) => family.toLocaleLowerCase()));
2179
2904
  //#endregion
2180
2905
  //#region ../site-contracts/src/theme/typography.ts
2181
2906
  const typographyStyleSchema = z.object({
@@ -2416,6 +3141,19 @@ const componentShadowSchema = z.object({ elevation: z.enum([
2416
3141
  "2xl"
2417
3142
  ]).default("sm") });
2418
3143
  //#endregion
3144
+ //#region ../site-contracts/src/siteStyle/footerPreferences.ts
3145
+ const footerEdgeIntentValues = decorativeTransitionIntentValues.filter((id) => id !== "wave-edge-echo");
3146
+ const footerEdgePreferenceSchema = z.discriminatedUnion("kind", [
3147
+ z.strictObject({ kind: z.literal("style-default") }),
3148
+ z.strictObject({ kind: z.literal("none") }),
3149
+ z.strictObject({
3150
+ kind: z.literal("option"),
3151
+ id: z.enum(footerEdgeIntentValues)
3152
+ })
3153
+ ]);
3154
+ z.strictObject({ edge: footerEdgePreferenceSchema });
3155
+ z.strictObject({ edge: footerEdgePreferenceSchema });
3156
+ //#endregion
2419
3157
  //#region ../site-contracts/src/theme/tokenOrColor.ts
2420
3158
  /**
2421
3159
  * Runtime color-reference fields intentionally accept any string, including
@@ -3267,26 +4005,7 @@ const headerSchema = z.object({
3267
4005
  ctaInMobileBar: z.literal(true).optional(),
3268
4006
  dropdownStyle: dropdownStyleSchema
3269
4007
  });
3270
- const footerVariant = z.enum([
3271
- "simple",
3272
- "columns",
3273
- "split",
3274
- "centred"
3275
- ]).transform((value) => value === "columns" ? "simple" : value);
3276
4008
  const footerMaxWidth = z.enum(["container", "full"]);
3277
- const footerNavLayoutMode = z.enum([
3278
- "stack",
3279
- "inline",
3280
- "inline-wrap"
3281
- ]);
3282
- const footerSpacing = z.enum([
3283
- "none",
3284
- "tight",
3285
- "compact",
3286
- "default",
3287
- "relaxed",
3288
- "spacious"
3289
- ]);
3290
4009
  const footerLogoSize = z.enum([
3291
4010
  "sm",
3292
4011
  "md",
@@ -3305,53 +4024,49 @@ const footerBottomTextLinkStyleSchema = z.object({
3305
4024
  decorationColorToken: themeColorTokenSchema.nullable().optional(),
3306
4025
  underline: z.boolean().optional()
3307
4026
  });
3308
- const footerBottomBarSchema = z.object({
3309
- enabled: z.boolean().optional(),
3310
- fullBleed: z.boolean().optional(),
3311
- background: headerBackgroundSchema.optional(),
3312
- textColor: themeColorTokenSchema.nullable().optional(),
3313
- textAlign: z.enum([
3314
- "left",
3315
- "center",
3316
- "right"
3317
- ]).optional(),
3318
- paddingY: footerSpacing.optional(),
3319
- paddingX: footerSpacing.optional(),
3320
- borderTop: z.object({
3321
- colorToken: themeColorTokenSchema.nullable().optional(),
3322
- width: z.enum([
3323
- "none",
3324
- "thin",
3325
- "medium",
3326
- "thick"
3327
- ]).optional()
3328
- }).optional()
4027
+ /**
4028
+ * One footer area's paint: a solid ground and, only where a style needs it, the
4029
+ * text colour to try first. Inks come from the ground's surface resolution.
4030
+ */
4031
+ const footerBandPaintSchema = z.object({
4032
+ ground: themeColorTokenSchema,
4033
+ textColor: themeColorTokenSchema.optional()
4034
+ });
4035
+ /**
4036
+ * The footer's areas. `main` is the footer's own ground; an unpainted area
4037
+ * (`null`) sits on it under a hairline rule.
4038
+ */
4039
+ const footerBandsSchema = z.object({
4040
+ main: footerBandPaintSchema,
4041
+ band: footerBandPaintSchema.nullable(),
4042
+ strip: footerBandPaintSchema.nullable(),
4043
+ base: footerBandPaintSchema.nullable()
3329
4044
  });
3330
- const footerNavLayoutSchema = z.object({ layout: footerNavLayoutMode.optional() });
3331
4045
  const footerLogoSchema = z.object({
3332
4046
  size: footerLogoSize.optional(),
3333
- maxHeight: footerLogoMaxHeight.optional(),
3334
- align: z.enum([
3335
- "start",
3336
- "center",
3337
- "end"
3338
- ]).optional()
4047
+ maxHeight: footerLogoMaxHeight.optional()
3339
4048
  });
3340
4049
  const footerSchema = z.object({
3341
- variant: footerVariant,
4050
+ layout: z.enum([
4051
+ "beside-links",
4052
+ "centred",
4053
+ "compact"
4054
+ ]).default("beside-links"),
3342
4055
  maxWidth: footerMaxWidth,
3343
- background: headerBackgroundSchema.default({
3344
- type: "color",
3345
- color: "surface"
4056
+ bands: footerBandsSchema.default({
4057
+ main: { ground: "surface" },
4058
+ band: null,
4059
+ strip: null,
4060
+ base: null
3346
4061
  }),
3347
4062
  navStyle: headerNavStyle.default("minimal"),
3348
4063
  navColor: themeColorTokenSchema.nullable().optional(),
3349
4064
  navWeight: navFontWeight.default("medium"),
3350
4065
  navLinkStyle: navLinkStyleSchema.optional(),
3351
4066
  bottomTextLinkStyle: footerBottomTextLinkStyleSchema.optional(),
3352
- navLayout: footerNavLayoutSchema.optional(),
3353
4067
  logo: footerLogoSchema.optional(),
3354
- bottomBar: footerBottomBarSchema.optional()
4068
+ /** The shape the footer draws where the page above meets it; absent draws none. */
4069
+ edge: z.enum(footerEdgeIntentValues).optional()
3355
4070
  });
3356
4071
  const containerPaddingPresetSchema = z.enum([
3357
4072
  "tight",
@@ -3647,7 +4362,14 @@ const arrangementSlotNames = [
3647
4362
  "controls",
3648
4363
  "control",
3649
4364
  "counter",
3650
- "point"
4365
+ "point",
4366
+ "band",
4367
+ "main",
4368
+ "brand",
4369
+ "links",
4370
+ "details",
4371
+ "signup",
4372
+ "strip"
3651
4373
  ];
3652
4374
  //#endregion
3653
4375
  //#region ../theme-core/src/surfaces/logoVariant.ts
@@ -3796,6 +4518,7 @@ const lookKnobBlocks = {
3796
4518
  showPhotos: cardListKnobBlocks,
3797
4519
  cardMarker: cardListFamilyBlocks,
3798
4520
  dates: "block.offerings-preview",
4521
+ grouping: "block.offerings-preview",
3799
4522
  columns: "block.feature-cards",
3800
4523
  listColumns: "block.event-calendar",
3801
4524
  blackAndWhite: "block.image-gallery",
@@ -3996,8 +4719,13 @@ function defineCardListLook(id, name, arrangement, requires, knobs, input) {
3996
4719
  blockKinds: cardListFamilyBlocks.filter((block) => requires.every((part) => cardListBlockParts[block].includes(part))),
3997
4720
  structure: {
3998
4721
  ...base.structure,
3999
- knobs: [...base.structure.knobs, "dates"],
4722
+ knobs: [
4723
+ ...base.structure.knobs,
4724
+ "dates",
4725
+ "grouping"
4726
+ ],
4000
4727
  knobDefaults: {
4728
+ grouping: "by-kind",
4001
4729
  dates: arrangement === "cards" || arrangement === "plates" ? "next-dates" : "summary",
4002
4730
  ...base.structure.knobDefaults
4003
4731
  },
@@ -4334,9 +5062,7 @@ const arrangementLookFits = {
4334
5062
  "intro-photo-beside-text": { needs: ["photo"] },
4335
5063
  "intro-large-photo-beside-text": { needs: ["photo"] }
4336
5064
  };
4337
- //#endregion
4338
- //#region ../theme-core/src/site-styles/appearancePresetCatalog.ts
4339
- const appearancePresets = [
5065
+ const blockAppearancePresets = [
4340
5066
  defineBlockAppearancePreset({
4341
5067
  structure: {
4342
5068
  kind: "recipe",
@@ -5268,12 +5994,29 @@ const appearancePresets = [
5268
5994
  ])], { align: "center" }),
5269
5995
  styleFallback: [id$1("newsletter-signup-text-beside")]
5270
5996
  }),
5271
- defineArrangementLook("image-gallery-square-tiles", "image-gallery", "Square tiles", "tiles", ["blackAndWhite"], { thumbnail: sketch.page([
5272
- sketch.title(.4),
5273
- sketch.across(4, [sketch.photo("short")]),
5274
- sketch.across(4, [sketch.photo("short")])
5275
- ]) }),
5997
+ defineArrangementLook("image-gallery-square-tiles", "image-gallery", "Square tiles", "tiles", ["blackAndWhite"], {
5998
+ mediaFrame: { default: {
5999
+ kind: "fixed",
6000
+ aspectRatio: "1/1"
6001
+ } },
6002
+ thumbnail: sketch.page([
6003
+ sketch.title(.4),
6004
+ sketch.across(4, [sketch.photo("short")]),
6005
+ sketch.across(4, [sketch.photo("short")])
6006
+ ])
6007
+ }),
5276
6008
  defineArrangementLook("image-gallery-arched-captions", "image-gallery", "Arched photos with captions", "tiles", ["blackAndWhite"], {
6009
+ mediaFrame: {
6010
+ default: {
6011
+ kind: "fixed",
6012
+ aspectRatio: "1/1"
6013
+ },
6014
+ bySkin: { lantern: {
6015
+ kind: "fixed",
6016
+ aspectRatio: "3/4",
6017
+ borderRadius: "9999px 9999px 0 0"
6018
+ } }
6019
+ },
5277
6020
  thumbnail: sketch.page([sketch.title(.4), sketch.across(3, [sketch.photo("tall", "arch"), sketch.text(1, .7)])]),
5278
6021
  styleFallback: [id$1("image-gallery-square-tiles")]
5279
6022
  }),
@@ -5781,6 +6524,7 @@ const appearancePresets = [
5781
6524
  ])])], { arrows: true })]),
5782
6525
  itemRoles: { items: "card" },
5783
6526
  slotRoles: { date: "highlight" },
6527
+ forcedKnobs: { grouping: "one-list" },
5784
6528
  knobDefaults: {
5785
6529
  actionStyle: "button",
5786
6530
  dates: "summary"
@@ -5800,6 +6544,7 @@ const appearancePresets = [
5800
6544
  ])], { overflow: true })]),
5801
6545
  itemRoles: { items: "card" },
5802
6546
  slotRoles: { date: "highlight" },
6547
+ forcedKnobs: { grouping: "one-list" },
5803
6548
  knobDefaults: {
5804
6549
  actionStyle: "button",
5805
6550
  dates: "summary"
@@ -5843,18 +6588,58 @@ const appearancePresets = [
5843
6588
  styleFallback: [id$1("faq-questions-two-columns")]
5844
6589
  }),
5845
6590
  defineArrangementLook("image-gallery-lead-photo", "image-gallery", "One large photo, then smaller ones", "tiles", ["blackAndWhite"], {
6591
+ mediaFrame: { default: {
6592
+ kind: "variable",
6593
+ because: "The lead fills two rows; on phones the lead and a trailing full-width tile are landscape.",
6594
+ aspectRatio: "1/1",
6595
+ firstAspectRatio: "auto",
6596
+ mobileAspectRatio: "4/3"
6597
+ } },
5846
6598
  thumbnail: sketch.page([sketch.row(sketch.weight(2, [sketch.photo("tall")]), sketch.weight(1, [sketch.photo("short"), sketch.photo("short")]))]),
5847
6599
  styleFallback: [id$1("image-gallery-square-tiles")]
5848
6600
  }),
5849
6601
  defineArrangementLook("image-gallery-captions-under", "image-gallery", "Photos with captions underneath", "tiles", ["blackAndWhite"], {
6602
+ mediaFrame: {
6603
+ default: {
6604
+ kind: "fixed",
6605
+ aspectRatio: "4/3"
6606
+ },
6607
+ bySkin: { loom: {
6608
+ kind: "fixed",
6609
+ aspectRatio: "1/1"
6610
+ } }
6611
+ },
5850
6612
  thumbnail: sketch.page([sketch.title(.4), sketch.across(3, [sketch.photo("medium"), sketch.text(1, .8)])]),
5851
6613
  styleFallback: [id$1("image-gallery-arched-captions"), id$1("image-gallery-square-tiles")]
5852
6614
  }),
5853
6615
  defineArrangementLook("image-gallery-photo-band", "image-gallery", "One photo across the page", "tiles", ["blackAndWhite"], {
6616
+ mediaFrame: {
6617
+ default: {
6618
+ kind: "fixed",
6619
+ aspectRatio: "1/1"
6620
+ },
6621
+ bySkin: { orbit: {
6622
+ kind: "variable",
6623
+ because: "The full-width band has a clamped height and curved edges.",
6624
+ aspectRatio: "auto",
6625
+ height: "clamp(18rem, 38cqi, 36rem)"
6626
+ } }
6627
+ },
5854
6628
  thumbnail: sketch.band([sketch.photo("short")]),
5855
6629
  styleFallback: [id$1("image-gallery-square-tiles")]
5856
6630
  }),
5857
6631
  defineArrangementLook("image-gallery-moving-row", "image-gallery", "A moving row of photos", "moving-row", ["blackAndWhite"], {
6632
+ mediaFrame: {
6633
+ default: {
6634
+ kind: "fixed",
6635
+ aspectRatio: "1/1"
6636
+ },
6637
+ bySkin: { orbit: {
6638
+ kind: "fixed",
6639
+ aspectRatio: "1/1",
6640
+ borderRadius: "50%"
6641
+ } }
6642
+ },
5858
6643
  thumbnail: sketch.band([sketch.across(5, [sketch.photo("short")], { overflow: true })]),
5859
6644
  styleFallback: [id$1("image-gallery-square-tiles")]
5860
6645
  }),
@@ -6075,7 +6860,10 @@ const appearancePresets = [
6075
6860
  sketch.button
6076
6861
  ])])]),
6077
6862
  knobDefaults: { actionStyle: "button" },
6078
- forcedKnobs: { dates: "summary" },
6863
+ forcedKnobs: {
6864
+ dates: "summary",
6865
+ grouping: "by-kind"
6866
+ },
6079
6867
  styleFallback: [id$1("card-list-photos-on-top")]
6080
6868
  }),
6081
6869
  blockKinds: ["block.offerings-preview"]
@@ -6093,6 +6881,7 @@ const appearancePresets = [
6093
6881
  sketch.link
6094
6882
  ])])]),
6095
6883
  itemRoles: { items: "card" },
6884
+ forcedKnobs: { grouping: "by-kind" },
6096
6885
  styleFallback: [id$1("card-list-photos-on-top")]
6097
6886
  }),
6098
6887
  blockKinds: ["block.offerings-preview"]
@@ -6105,6 +6894,7 @@ const appearancePresets = [
6105
6894
  ], [], {
6106
6895
  thumbnail: sketch.page([sketch.title(.4), sketch.across(2, [sketch.panel([sketch.title(.5, "small"), sketch.down(3, [sketch.row(sketch.weight(1, [sketch.title(.6, "small")]), sketch.weight(3, [sketch.text(2, .8)]))], { ruled: true })])])]),
6107
6896
  slotRoles: { panel: "card" },
6897
+ forcedKnobs: { grouping: "by-kind" },
6108
6898
  knobDefaults: { dates: "summary" },
6109
6899
  styleFallback: [id$1("feature-cards-index")]
6110
6900
  }),
@@ -6112,6 +6902,9 @@ const appearancePresets = [
6112
6902
  }
6113
6903
  ];
6114
6904
  //#endregion
6905
+ //#region ../theme-core/src/site-styles/appearancePresetCatalog.ts
6906
+ const appearancePresets = blockAppearancePresets;
6907
+ //#endregion
6115
6908
  //#region ../theme-core/src/site-styles/rawStyleFields.ts
6116
6909
  const themeV2RuntimeStyleFieldNames = [
6117
6910
  "_frameStyles",
@@ -8970,8 +9763,8 @@ function footerForegroundCandidates(footer, proseHoverCandidate) {
8970
9763
  if (!footer) return {};
8971
9764
  const style = effectiveFooterNavLinkStyle(footer);
8972
9765
  return {
8973
- text: footer.background?.textColor ?? (footer.variant === "centred" ? "text" : void 0),
8974
- link: style?.colorToken ?? footer.navColor ?? footer.background?.textColor,
9766
+ text: footer.bands?.main.textColor ?? (footer.layout === "centred" ? "text" : void 0),
9767
+ link: style?.colorToken ?? footer.navColor ?? footer.bands?.main.textColor,
8975
9768
  linkHover: navLinkOwnsHoverForeground(style) ? proseHoverCandidate : navLinkHoverColorCandidate(style)
8976
9769
  };
8977
9770
  }
@@ -9041,15 +9834,14 @@ function generateFooterNavLinkStyles(footer, themeId, tokens, theme) {
9041
9834
  theme,
9042
9835
  style,
9043
9836
  className: "footer-nav-link",
9044
- surfaceDependent: true,
9045
- surfaceRestingColor: footer.background?.contentOwner === siteChromeBackgroundOverrideOwner
9837
+ surfaceDependent: true
9046
9838
  });
9047
9839
  }
9048
9840
  function generateFooterBottomTextLinkStyles(footer, themeId, tokens) {
9049
9841
  const style = footer.bottomTextLinkStyle;
9050
9842
  if (!style) return "";
9051
9843
  const scope = `:where([data-theme-scope="${themeId}"])`;
9052
- const selectors = [`${scope} .block-site-footer [data-footer-region="bottom"] .rb-prose a`, `${scope} .block-siteFooter [data-footer-region="bottom"] .rb-prose a`];
9844
+ const selectors = [`${scope} .block-site-footer [data-slot="base"] .rb-prose a`, `${scope} .block-siteFooter [data-slot="base"] .rb-prose a`];
9053
9845
  const baseRules = [];
9054
9846
  const decorationColorToken = style.decorationColorToken?.trim();
9055
9847
  if (decorationColorToken) baseRules.push(`text-decoration-color: ${tokens.getColor(decorationColorToken)};`);
@@ -9061,20 +9853,29 @@ function generateFooterBottomTextLinkStyles(footer, themeId, tokens) {
9061
9853
  }
9062
9854
  //#endregion
9063
9855
  //#region ../theme-core/src/site-styles/footerLookRecipe.ts
9856
+ const footerSideBands = [
9857
+ "band",
9858
+ "strip",
9859
+ "base"
9860
+ ];
9064
9861
  /** Reject undeclared references when the curated catalogue is loaded, before rendering. */
9065
9862
  function validateFooterRecipeSurfaces(style, recipe) {
9066
- [recipe.ground, ...recipe.legal.bar ? [recipe.legal.bar.background] : []].forEach((ground) => {
9863
+ [recipe.bands.main, ...footerSideBands.flatMap((band) => recipe.bands[band] ?? [])].forEach(({ ground }) => {
9067
9864
  if (ground.kind === "style-surface" && (style.looks.kind !== "offers" || !style.looks.surfaces[ground.surface])) throw new Error(`Undeclared footer surface: ${ground.surface}`);
9068
9865
  });
9069
9866
  }
9070
9867
  //#endregion
9071
9868
  //#region ../theme-core/src/site-styles/footerLookDefaults.ts
9072
9869
  const defaultFooterLookRecipes = {
9073
- "footer-centred-name": {
9074
- arrangement: "centred",
9075
- ground: {
9076
- kind: "token",
9077
- token: "surface"
9870
+ "footer-centred": {
9871
+ bands: {
9872
+ main: { ground: {
9873
+ kind: "token",
9874
+ token: "surface"
9875
+ } },
9876
+ band: null,
9877
+ strip: null,
9878
+ base: null
9078
9879
  },
9079
9880
  nav: {
9080
9881
  weight: "regular",
@@ -9082,14 +9883,35 @@ const defaultFooterLookRecipes = {
9082
9883
  hoverColorToken: "primary",
9083
9884
  typography: "body"
9084
9885
  },
9085
- legal: { bar: null },
9086
- brandAlign: "center"
9886
+ edges: []
9087
9887
  },
9088
- "footer-links-row": {
9089
- arrangement: "simple",
9090
- ground: {
9091
- kind: "token",
9092
- token: "surface"
9888
+ "footer-beside-links": {
9889
+ bands: {
9890
+ main: { ground: {
9891
+ kind: "token",
9892
+ token: "surface"
9893
+ } },
9894
+ band: null,
9895
+ strip: null,
9896
+ base: null
9897
+ },
9898
+ nav: {
9899
+ weight: "regular",
9900
+ colorToken: "text",
9901
+ hoverColorToken: "primary",
9902
+ typography: "body"
9903
+ },
9904
+ edges: []
9905
+ },
9906
+ "footer-compact": {
9907
+ bands: {
9908
+ main: { ground: {
9909
+ kind: "token",
9910
+ token: "surface"
9911
+ } },
9912
+ band: null,
9913
+ strip: null,
9914
+ base: null
9093
9915
  },
9094
9916
  nav: {
9095
9917
  weight: "regular",
@@ -9097,8 +9919,7 @@ const defaultFooterLookRecipes = {
9097
9919
  hoverColorToken: "primary",
9098
9920
  typography: "body"
9099
9921
  },
9100
- legal: { bar: null },
9101
- brandAlign: "start"
9922
+ edges: []
9102
9923
  }
9103
9924
  };
9104
9925
  /** A whole authored recipe replaces the default; facets are never deep-merged. */
@@ -25215,6 +26036,195 @@ const measureLooks = {
25215
26036
  ],
25216
26037
  ownLayoutBlocks
25217
26038
  };
26039
+ /** The layouts a style offers (the first is its default), all dressed by one recipe. */
26040
+ function styleFooter(offers, recipe) {
26041
+ return {
26042
+ footerLookRecipes: Object.fromEntries(offers.map((lookId) => [lookId, recipe])),
26043
+ recommendedFooterLookIds: offers
26044
+ };
26045
+ }
26046
+ const footerSurface = (surface) => ({ ground: {
26047
+ kind: "style-surface",
26048
+ surface
26049
+ } });
26050
+ const footerToken = (token) => ({ ground: {
26051
+ kind: "token",
26052
+ token
26053
+ } });
26054
+ /** Orbit: the brand colour under the arc, the signup band and base strip in the darker band colour. */
26055
+ const orbitFooter = styleFooter(["footer-beside-links", "footer-compact"], {
26056
+ bands: {
26057
+ band: footerSurface("deep"),
26058
+ main: footerSurface("brand"),
26059
+ strip: null,
26060
+ base: footerSurface("deep")
26061
+ },
26062
+ nav: {
26063
+ weight: "regular",
26064
+ colorToken: "primaryForeground",
26065
+ hoverColorToken: "primaryForeground",
26066
+ typography: "body"
26067
+ },
26068
+ brandLogoSize: "md",
26069
+ edges: ["arc-edge-echo"]
26070
+ });
26071
+ /** Lantern: the near-black deep ground, a slightly lifted details strip, and rules rather than bands elsewhere. */
26072
+ const lanternFooter = styleFooter(["footer-centred", "footer-compact"], {
26073
+ bands: {
26074
+ band: null,
26075
+ main: footerSurface("deep"),
26076
+ strip: footerToken("secondary-900"),
26077
+ base: null
26078
+ },
26079
+ nav: {
26080
+ weight: "regular",
26081
+ colorToken: "text",
26082
+ hoverColorToken: "primary",
26083
+ typography: "heading"
26084
+ },
26085
+ edges: []
26086
+ });
26087
+ /** Poster: flat blocks of colour, the pop colour for the signup band, the brand block, a deeper brand strip and an ink base. */
26088
+ const posterFooter = styleFooter(["footer-beside-links", "footer-compact"], {
26089
+ bands: {
26090
+ band: footerSurface("pop"),
26091
+ main: footerSurface("brand"),
26092
+ strip: footerToken("primary-800"),
26093
+ base: footerSurface("inverse")
26094
+ },
26095
+ nav: {
26096
+ weight: "medium",
26097
+ colorToken: "primaryForeground",
26098
+ hoverColorToken: "primaryForeground",
26099
+ typography: "body"
26100
+ },
26101
+ edges: []
26102
+ });
26103
+ /** Haven: the soft band colour, the signup on a sheet (the skin sets it in as a rounded card), a page-colour strip and the wash for the base. */
26104
+ const havenFooter = styleFooter([
26105
+ "footer-beside-links",
26106
+ "footer-centred",
26107
+ "footer-compact"
26108
+ ], {
26109
+ bands: {
26110
+ band: footerSurface("sheet"),
26111
+ main: footerSurface("band"),
26112
+ strip: footerSurface("base"),
26113
+ base: footerSurface("deep")
26114
+ },
26115
+ nav: {
26116
+ weight: "regular",
26117
+ colorToken: "text",
26118
+ hoverColorToken: "text",
26119
+ typography: "body"
26120
+ },
26121
+ brandLogoSize: "md",
26122
+ edges: ["wave-edge-gentle"]
26123
+ });
26124
+ /** Brook: a dark shade of the secondary colour under the wave, the accent for the signup band, and a deeper shade for the strip and base. */
26125
+ const brookFooter = styleFooter([
26126
+ "footer-beside-links",
26127
+ "footer-centred",
26128
+ "footer-compact"
26129
+ ], {
26130
+ bands: {
26131
+ band: footerToken("accent"),
26132
+ main: footerToken("secondary-800"),
26133
+ strip: footerToken("secondary-900"),
26134
+ base: footerToken("secondary-900")
26135
+ },
26136
+ nav: {
26137
+ weight: "regular",
26138
+ colorToken: "background",
26139
+ hoverColorToken: "background",
26140
+ typography: "body"
26141
+ },
26142
+ brandLogoSize: "md",
26143
+ edges: ["wave-edge-balanced"]
26144
+ });
26145
+ /** Fulcrum: one quiet tinted ground, with hairlines rather than bands between the areas. */
26146
+ const fulcrumFooter = styleFooter(["footer-beside-links", "footer-compact"], {
26147
+ bands: {
26148
+ band: null,
26149
+ main: footerSurface("band"),
26150
+ strip: null,
26151
+ base: null
26152
+ },
26153
+ nav: {
26154
+ weight: "regular",
26155
+ colorToken: "text",
26156
+ hoverColorToken: "primary",
26157
+ typography: "body"
26158
+ },
26159
+ edges: []
26160
+ });
26161
+ /** Measure: the page ground, opened by the heavy rule every section has (in the skin). */
26162
+ const measureFooter = styleFooter(["footer-beside-links", "footer-compact"], {
26163
+ bands: {
26164
+ band: null,
26165
+ main: footerSurface("base"),
26166
+ strip: null,
26167
+ base: null
26168
+ },
26169
+ nav: {
26170
+ weight: "regular",
26171
+ colorToken: "text",
26172
+ hoverColorToken: "text",
26173
+ typography: "body"
26174
+ },
26175
+ edges: []
26176
+ });
26177
+ /** Folio: a quiet tinted ground with thin rules between the areas. */
26178
+ const folioFooter = styleFooter(["footer-beside-links", "footer-compact"], {
26179
+ bands: {
26180
+ band: null,
26181
+ main: footerSurface("band"),
26182
+ strip: null,
26183
+ base: null
26184
+ },
26185
+ nav: {
26186
+ weight: "regular",
26187
+ colorToken: "text",
26188
+ hoverColorToken: "primary",
26189
+ typography: "body"
26190
+ },
26191
+ brandLogoSize: "md",
26192
+ edges: []
26193
+ });
26194
+ /** Loom: the deep ground, with the brand colour as the one strong patch behind the signup. */
26195
+ const loomFooter = styleFooter(["footer-beside-links", "footer-compact"], {
26196
+ bands: {
26197
+ band: footerSurface("brand"),
26198
+ main: footerSurface("deep"),
26199
+ strip: null,
26200
+ base: null
26201
+ },
26202
+ nav: {
26203
+ weight: "regular",
26204
+ colorToken: "primaryForeground",
26205
+ hoverColorToken: "primaryForeground",
26206
+ typography: "body"
26207
+ },
26208
+ brandLogoSize: "md",
26209
+ edges: []
26210
+ });
26211
+ /** Poise: the inverse ground, drawn by the skin as a rounded field set in from the page edge like its inverse sections. */
26212
+ const poiseFooter = styleFooter(["footer-beside-links", "footer-compact"], {
26213
+ bands: {
26214
+ band: null,
26215
+ main: footerSurface("inverse"),
26216
+ strip: null,
26217
+ base: null
26218
+ },
26219
+ nav: {
26220
+ weight: "semibold",
26221
+ colorToken: "background",
26222
+ hoverColorToken: "background",
26223
+ typography: "body"
26224
+ },
26225
+ brandLogoSize: "md",
26226
+ edges: []
26227
+ });
25218
26228
  const curatedSiteStyles = [
25219
26229
  defineCuratedSiteStyle({
25220
26230
  id: "site-style:south-west-twerk-school",
@@ -25268,11 +26278,21 @@ const curatedSiteStyles = [
25268
26278
  join: asBoundaryOptionId("break:wave")
25269
26279
  }]
25270
26280
  },
25271
- footerLookRecipes: { "footer-links-row": {
25272
- arrangement: "split",
25273
- ground: {
25274
- kind: "token",
25275
- token: "primary-800"
26281
+ footerLookRecipes: { "footer-beside-links": {
26282
+ bands: {
26283
+ main: { ground: {
26284
+ kind: "token",
26285
+ token: "primary-800"
26286
+ } },
26287
+ band: null,
26288
+ strip: null,
26289
+ base: {
26290
+ ground: {
26291
+ kind: "token",
26292
+ token: "primary-900"
26293
+ },
26294
+ textColor: "primaryForeground"
26295
+ }
25276
26296
  },
25277
26297
  nav: {
25278
26298
  weight: "medium",
@@ -25280,28 +26300,14 @@ const curatedSiteStyles = [
25280
26300
  hoverColorToken: "secondary",
25281
26301
  typography: "body"
25282
26302
  },
25283
- legal: {
25284
- bar: {
25285
- fullBleed: true,
25286
- background: {
25287
- kind: "token",
25288
- token: "primary-900"
25289
- },
25290
- textColor: "primaryForeground",
25291
- textAlign: "center",
25292
- paddingY: "compact",
25293
- paddingX: "default",
25294
- borderTop: { width: "none" }
25295
- },
25296
- linkStyle: {
25297
- colorToken: "secondary",
25298
- decorationColorToken: "secondary"
25299
- }
26303
+ legalLinkStyle: {
26304
+ colorToken: "secondary",
26305
+ decorationColorToken: "secondary"
25300
26306
  },
25301
- brandAlign: "start",
26307
+ edges: [],
25302
26308
  brandLogoSize: "sm"
25303
26309
  } },
25304
- recommendedFooterLookIds: ["footer-links-row"],
26310
+ recommendedFooterLookIds: ["footer-beside-links"],
25305
26311
  buttonStyleChoices: [
25306
26312
  buttonChoice("showtime-pill"),
25307
26313
  buttonChoice("confident-chip"),
@@ -25363,7 +26369,7 @@ const curatedSiteStyles = [
25363
26369
  },
25364
26370
  testimonialQuote: serifDisplayQuote
25365
26371
  },
25366
- recommendedFooterLookIds: ["footer-links-row"],
26372
+ ...fulcrumFooter,
25367
26373
  buttonStyleChoices: [
25368
26374
  buttonChoice("fulcrum"),
25369
26375
  buttonChoice("editorial-link"),
@@ -25406,22 +26412,7 @@ const curatedSiteStyles = [
25406
26412
  accordions: boldBorderedAccordionSystem,
25407
26413
  testimonialQuote: accentGlyphQuote
25408
26414
  },
25409
- footerLookRecipes: { "footer-links-row": {
25410
- arrangement: "simple",
25411
- ground: {
25412
- kind: "token",
25413
- token: "surface"
25414
- },
25415
- nav: {
25416
- weight: "medium",
25417
- colorToken: "text",
25418
- hoverColorToken: "primary",
25419
- typography: "body"
25420
- },
25421
- legal: { bar: null },
25422
- brandAlign: "start"
25423
- } },
25424
- recommendedFooterLookIds: ["footer-links-row"],
26415
+ ...posterFooter,
25425
26416
  buttonStyleChoices: [
25426
26417
  buttonChoice("offset-block"),
25427
26418
  buttonChoice("ink-stamp"),
@@ -25461,22 +26452,7 @@ const curatedSiteStyles = [
25461
26452
  accordions: warmInsetAccordionSystem,
25462
26453
  testimonialQuote: serifDisplayQuote
25463
26454
  },
25464
- footerLookRecipes: { "footer-centred-name": {
25465
- arrangement: "centred",
25466
- ground: {
25467
- kind: "style-surface",
25468
- surface: "deep"
25469
- },
25470
- nav: {
25471
- weight: "regular",
25472
- colorToken: "text",
25473
- hoverColorToken: "primary",
25474
- typography: "heading"
25475
- },
25476
- legal: { bar: null },
25477
- brandAlign: "center"
25478
- } },
25479
- recommendedFooterLookIds: ["footer-centred-name", "footer-links-row"],
26455
+ ...lanternFooter,
25480
26456
  buttonStyleChoices: [
25481
26457
  buttonChoice("gilt-slab"),
25482
26458
  buttonChoice("hairline-tab"),
@@ -25519,7 +26495,7 @@ const curatedSiteStyles = [
25519
26495
  accordions: editorialDividedAccordionSystem,
25520
26496
  testimonialQuote: serifDisplayQuote
25521
26497
  },
25522
- recommendedFooterLookIds: ["footer-links-row"],
26498
+ ...measureFooter,
25523
26499
  buttonStyleChoices: [
25524
26500
  buttonChoice("flat-ink", void 0, { corners: "square" }),
25525
26501
  buttonChoice("editorial-link"),
@@ -25538,7 +26514,7 @@ const curatedSiteStyles = [
25538
26514
  kind: "public",
25539
26515
  generation: { kind: "explicit_only" }
25540
26516
  },
25541
- description: "Calm and editorial: a classic serif over a plain sans, soft corners, thin rules and photos with room around them. For practitioners who teach classes, see clients and run workshops.",
26517
+ description: "Calm and editorial: a classic serif over a plain sans, soft corners, thin rules and photos with room around them. For people who teach classes, see clients and run workshops.",
25542
26518
  generationBrief: "Use restrained serif headings, clear sans-serif body copy, natural photography, practical calls to action and concrete class and workshop details.",
25543
26519
  headingDecoration: noHeadingDecoration,
25544
26520
  tokenRecipes: {
@@ -25587,34 +26563,7 @@ const curatedSiteStyles = [
25587
26563
  cta: { treatment: "default" },
25588
26564
  openingPlacement: "photo-behind-text"
25589
26565
  } },
25590
- footerLookRecipes: { "footer-links-row": {
25591
- arrangement: "simple",
25592
- ground: {
25593
- kind: "token",
25594
- token: "surface"
25595
- },
25596
- nav: {
25597
- weight: "regular",
25598
- colorToken: "text",
25599
- hoverColorToken: "primary",
25600
- typography: "body"
25601
- },
25602
- legal: { bar: {
25603
- fullBleed: false,
25604
- background: {
25605
- kind: "token",
25606
- token: "surface"
25607
- },
25608
- textColor: "text",
25609
- textAlign: "left",
25610
- paddingY: "tight",
25611
- paddingX: "none",
25612
- borderTop: { width: "none" }
25613
- } },
25614
- brandAlign: "start",
25615
- brandLogoSize: "md"
25616
- } },
25617
- recommendedFooterLookIds: ["footer-links-row"],
26566
+ ...folioFooter,
25618
26567
  buttonStyleChoices: [
25619
26568
  buttonChoice("quiet-arrow", void 0, {
25620
26569
  secondaryTreatment: "solid-accent",
@@ -25684,37 +26633,7 @@ const curatedSiteStyles = [
25684
26633
  },
25685
26634
  cta: { treatment: "primary" }
25686
26635
  } },
25687
- footerLookRecipes: { "footer-links-row": {
25688
- arrangement: "simple",
25689
- ground: {
25690
- kind: "style-surface",
25691
- surface: "deep"
25692
- },
25693
- nav: {
25694
- weight: "regular",
25695
- colorToken: "primaryForeground",
25696
- hoverColorToken: "primaryForeground",
25697
- typography: "body"
25698
- },
25699
- legal: { bar: {
25700
- fullBleed: false,
25701
- background: {
25702
- kind: "style-surface",
25703
- surface: "deep"
25704
- },
25705
- textColor: "primaryForeground",
25706
- textAlign: "left",
25707
- paddingY: "compact",
25708
- paddingX: "none",
25709
- borderTop: {
25710
- width: "medium",
25711
- colorToken: "primaryForeground"
25712
- }
25713
- } },
25714
- brandAlign: "start",
25715
- brandLogoSize: "md"
25716
- } },
25717
- recommendedFooterLookIds: ["footer-links-row"],
26636
+ ...loomFooter,
25718
26637
  buttonStyleChoices: [
25719
26638
  buttonChoice("sewn-label"),
25720
26639
  buttonChoice("square-outline", void 0, {
@@ -25783,37 +26702,7 @@ const curatedSiteStyles = [
25783
26702
  },
25784
26703
  cta: { treatment: "primary" }
25785
26704
  } },
25786
- footerLookRecipes: { "footer-links-row": {
25787
- arrangement: "simple",
25788
- ground: {
25789
- kind: "style-surface",
25790
- surface: "inverse"
25791
- },
25792
- nav: {
25793
- weight: "semibold",
25794
- colorToken: "background",
25795
- hoverColorToken: "background",
25796
- typography: "body"
25797
- },
25798
- legal: { bar: {
25799
- fullBleed: false,
25800
- background: {
25801
- kind: "style-surface",
25802
- surface: "inverse"
25803
- },
25804
- textColor: "background",
25805
- textAlign: "left",
25806
- paddingY: "compact",
25807
- paddingX: "none",
25808
- borderTop: {
25809
- width: "thin",
25810
- colorToken: "background"
25811
- }
25812
- } },
25813
- brandAlign: "start",
25814
- brandLogoSize: "md"
25815
- } },
25816
- recommendedFooterLookIds: ["footer-links-row"],
26705
+ ...poiseFooter,
25817
26706
  buttonStyleChoices: [
25818
26707
  buttonChoice("edged-pill"),
25819
26708
  buttonChoice("soft-pill"),
@@ -25853,37 +26742,7 @@ const curatedSiteStyles = [
25853
26742
  accordions: editorialDividedAccordionSystem,
25854
26743
  testimonialQuote: accentGlyphQuote
25855
26744
  },
25856
- footerLookRecipes: { "footer-links-row": {
25857
- arrangement: "simple",
25858
- ground: {
25859
- kind: "style-surface",
25860
- surface: "band"
25861
- },
25862
- nav: {
25863
- weight: "regular",
25864
- colorToken: "text",
25865
- hoverColorToken: "text",
25866
- typography: "body"
25867
- },
25868
- legal: { bar: {
25869
- fullBleed: false,
25870
- background: {
25871
- kind: "style-surface",
25872
- surface: "band"
25873
- },
25874
- textColor: "text",
25875
- textAlign: "left",
25876
- paddingY: "compact",
25877
- paddingX: "none",
25878
- borderTop: {
25879
- width: "thin",
25880
- colorToken: "border"
25881
- }
25882
- } },
25883
- brandAlign: "start",
25884
- brandLogoSize: "md"
25885
- } },
25886
- recommendedFooterLookIds: ["footer-links-row"],
26745
+ ...havenFooter,
25887
26746
  buttonStyleChoices: [
25888
26747
  buttonChoice("soft-pill"),
25889
26748
  buttonChoice("pebble"),
@@ -25922,37 +26781,7 @@ const curatedSiteStyles = [
25922
26781
  accordions: editorialDividedAccordionSystem,
25923
26782
  testimonialQuote: serifDisplayQuote
25924
26783
  },
25925
- footerLookRecipes: { "footer-links-row": {
25926
- arrangement: "simple",
25927
- ground: {
25928
- kind: "style-surface",
25929
- surface: "base"
25930
- },
25931
- nav: {
25932
- weight: "regular",
25933
- colorToken: "text",
25934
- hoverColorToken: "primary",
25935
- typography: "body"
25936
- },
25937
- legal: { bar: {
25938
- fullBleed: false,
25939
- background: {
25940
- kind: "style-surface",
25941
- surface: "base"
25942
- },
25943
- textColor: "text",
25944
- textAlign: "left",
25945
- paddingY: "compact",
25946
- paddingX: "none",
25947
- borderTop: {
25948
- width: "thin",
25949
- colorToken: "border"
25950
- }
25951
- } },
25952
- brandAlign: "start",
25953
- brandLogoSize: "md"
25954
- } },
25955
- recommendedFooterLookIds: ["footer-links-row"],
26784
+ ...brookFooter,
25956
26785
  buttonStyleChoices: [
25957
26786
  buttonChoice("pebble"),
25958
26787
  buttonChoice("showtime-pill"),
@@ -26010,37 +26839,7 @@ const curatedSiteStyles = [
26010
26839
  mobileBar: "beside-menu"
26011
26840
  }
26012
26841
  } },
26013
- footerLookRecipes: { "footer-links-row": {
26014
- arrangement: "simple",
26015
- ground: {
26016
- kind: "style-surface",
26017
- surface: "brand"
26018
- },
26019
- nav: {
26020
- weight: "regular",
26021
- colorToken: "primaryForeground",
26022
- hoverColorToken: "primaryForeground",
26023
- typography: "body"
26024
- },
26025
- legal: { bar: {
26026
- fullBleed: false,
26027
- background: {
26028
- kind: "style-surface",
26029
- surface: "brand"
26030
- },
26031
- textColor: "primaryForeground",
26032
- textAlign: "left",
26033
- paddingY: "compact",
26034
- paddingX: "none",
26035
- borderTop: {
26036
- width: "thin",
26037
- colorToken: "primaryForeground"
26038
- }
26039
- } },
26040
- brandAlign: "start",
26041
- brandLogoSize: "md"
26042
- } },
26043
- recommendedFooterLookIds: ["footer-links-row"],
26842
+ ...orbitFooter,
26044
26843
  buttonStyleChoices: [
26045
26844
  buttonChoice("orbit-pill"),
26046
26845
  buttonChoice("soft-pill"),
@@ -26697,6 +27496,30 @@ function sectionRhythmSurfaces(style, flow) {
26697
27496
  });
26698
27497
  }
26699
27498
  //#endregion
27499
+ //#region ../theme-core/src/site-styles/lookMediaFrame.ts
27500
+ function resolveLookMediaFrame(frames, skin) {
27501
+ return (skin ? frames?.bySkin?.[skin] : void 0) ?? frames?.default;
27502
+ }
27503
+ function frameVars(frame) {
27504
+ return [
27505
+ `--rb-look-media-ratio: ${frame.aspectRatio};`,
27506
+ ...frame.kind === "fixed" && frame.borderRadius ? [`--rb-look-media-radius: ${frame.borderRadius};`] : [],
27507
+ ...frame.kind === "variable" && frame.firstAspectRatio ? [`--rb-look-media-first-ratio: ${frame.firstAspectRatio};`] : [],
27508
+ ...frame.kind === "variable" && frame.height ? [`--rb-look-media-height: ${frame.height};`] : [],
27509
+ ...frame.kind === "variable" && frame.mobileAspectRatio ? [`--rb-look-media-mobile-ratio: ${frame.mobileAspectRatio};`] : []
27510
+ ].join(" ");
27511
+ }
27512
+ /** The same declaration supplies the editor frame and the CSS's crop values. */
27513
+ function generateLookMediaFrameCss(themeId) {
27514
+ return blockAppearancePresets.flatMap((look) => {
27515
+ const frames = look.structure.kind === "arrangement" ? look.structure.mediaFrame : void 0;
27516
+ if (!frames) return [];
27517
+ const scope = `:where([data-theme-scope="${themeId}"])`;
27518
+ const selector = `[data-look="${look.id}"]`;
27519
+ return [`${scope} ${selector} { ${frameVars(frames.default)} }`, ...Object.entries(frames.bySkin ?? {}).map(([skin, frame]) => `${scope} :is([data-skin="${skin}"], [data-skin="${skin}"] *)${selector} { ${frameVars(frame)} }`)];
27520
+ }).join("\n");
27521
+ }
27522
+ //#endregion
26700
27523
  //#region ../theme-core/src/site-styles/lookSurfacePresentation.ts
26701
27524
  /** Selection is the only per-item operation; all paint has already been decided. */
26702
27525
  function selectItemSurfacePresentation(presentation, role) {
@@ -27622,14 +28445,16 @@ function sessionFingerprint(identity) {
27622
28445
  const pass = (seed) => codes.reduce((hash, code) => Math.imul(hash ^ code, 16777619) >>> 0, seed).toString(16).padStart(8, "0");
27623
28446
  return `${pass(2166136261)}${pass(84696351)}`;
27624
28447
  }
27625
- function ownerOf(identity) {
28448
+ /** Whose saved answers (or agreement) these are, for the current portal identity. */
28449
+ function bookingQuestionsOwnerOf(identity) {
27626
28450
  return identity === null ? { kind: "signed_out" } : {
27627
28451
  kind: "session",
27628
28452
  fingerprint: sessionFingerprint(identity)
27629
28453
  };
27630
28454
  }
27631
- function ownedBy(owner, identity) {
27632
- const current = ownerOf(identity);
28455
+ /** Whether something saved for `owner` belongs to the current portal identity. */
28456
+ function isBookingQuestionsOwner(owner, identity) {
28457
+ const current = bookingQuestionsOwnerOf(identity);
27633
28458
  if (current.kind === "signed_out") return owner.kind === "signed_out";
27634
28459
  return owner.kind === "session" && owner.fingerprint === current.fingerprint;
27635
28460
  }
@@ -27641,7 +28466,7 @@ const bookingQuestionsAnswerDraftSchema = z.object({
27641
28466
  });
27642
28467
  function toBookingQuestionsAnswerDraft(state) {
27643
28468
  return {
27644
- owner: ownerOf(state.scope?.identity ?? null),
28469
+ owner: bookingQuestionsOwnerOf(state.scope?.identity ?? null),
27645
28470
  requirementId: state.scope?.requirementId ?? null,
27646
28471
  edits: state.edits,
27647
28472
  answerMode: state.answerMode
@@ -27660,7 +28485,7 @@ function toBookingQuestionsPaymentSnapshot(view) {
27660
28485
  const { submission } = view;
27661
28486
  if (!submission) return void 0;
27662
28487
  return {
27663
- owner: ownerOf(view.scope.identity),
28488
+ owner: bookingQuestionsOwnerOf(view.scope.identity),
27664
28489
  requirementId: submission.requirementId,
27665
28490
  answers: submission.kind === "keep_existing" ? { kind: "keep_existing" } : {
27666
28491
  kind: "answers",
@@ -27675,7 +28500,7 @@ function decided(restoration) {
27675
28500
  function decideBookingQuestionsRestoration(source) {
27676
28501
  if (source.kind === "sign_in_draft") {
27677
28502
  const { draft, verifiedIdentity } = source;
27678
- if (draft.owner.kind === "session" && !ownedBy(draft.owner, verifiedIdentity)) return null;
28503
+ if (draft.owner.kind === "session" && !isBookingQuestionsOwner(draft.owner, verifiedIdentity)) return null;
27679
28504
  return decided({
27680
28505
  scope: {
27681
28506
  identity: verifiedIdentity,
@@ -27686,7 +28511,7 @@ function decideBookingQuestionsRestoration(source) {
27686
28511
  });
27687
28512
  }
27688
28513
  const { snapshot, currentIdentity } = source;
27689
- if (!ownedBy(snapshot.owner, currentIdentity)) return null;
28514
+ if (!isBookingQuestionsOwner(snapshot.owner, currentIdentity)) return null;
27690
28515
  const scope = {
27691
28516
  identity: currentIdentity,
27692
28517
  requirementId: snapshot.requirementId
@@ -27819,6 +28644,12 @@ function resolveAppointmentCheckoutVerificationState(input) {
27819
28644
  if (!input.config) return { tag: "idle" };
27820
28645
  const sessionId = input.config.sessionId;
27821
28646
  if (input.pollingStatus === "completed") {
28647
+ if (input.result?.checkoutRecovery) return {
28648
+ tag: "unpaid",
28649
+ sessionId,
28650
+ ...input.result.checkoutRecovery,
28651
+ startAt: input.result.appointment.startAt
28652
+ };
27822
28653
  const confirmed = confirmedAppointmentCheckout(sessionId, input.result);
27823
28654
  if (confirmed) return confirmed;
27824
28655
  }
@@ -27844,6 +28675,11 @@ function resolveAppointmentCheckoutVerificationState(input) {
27844
28675
  };
27845
28676
  }
27846
28677
  }
28678
+ /** Whether a fresh status read still says exactly what an open checkout's page is showing. */
28679
+ function isSameOpenCheckout(shown, latest) {
28680
+ const recovery = latest.checkoutRecovery;
28681
+ return recovery?.kind === "unpaid" && recovery.checkoutUrl === shown.checkoutUrl && recovery.heldUntil === shown.heldUntil;
28682
+ }
27847
28683
  /** Verified payment carries its booked facts instead of asking the view to rebuild them. */
27848
28684
  function confirmedAppointmentCheckout(sessionId, result) {
27849
28685
  if (!result || !result.appointmentId) return null;
@@ -27885,11 +28721,17 @@ function deriveBookingFormViewState(input) {
27885
28721
  kind: "success",
27886
28722
  resourceName: input.localSuccessResourceName
27887
28723
  };
27888
- if (input.redirectState.kind === "cancelled") return {
28724
+ if (input.redirectState.kind === "cancelled" && input.verificationState.tag === "idle") return {
27889
28725
  kind: "error",
27890
28726
  message: "Checkout was cancelled before your appointment was confirmed."
27891
28727
  };
27892
28728
  switch (input.verificationState.tag) {
28729
+ case "unpaid": return {
28730
+ kind: "unpaid",
28731
+ checkoutUrl: input.verificationState.checkoutUrl,
28732
+ heldUntil: input.verificationState.heldUntil,
28733
+ startAt: input.verificationState.startAt
28734
+ };
27893
28735
  case "idle": return { kind: "form" };
27894
28736
  case "verifying": return {
27895
28737
  kind: "verifying",
@@ -28087,6 +28929,8 @@ function resolveBookingPaymentStep(input) {
28087
28929
  };
28088
28930
  const [first, ...rest] = resolveAvailableBookingCollectionOptions({
28089
28931
  paymentTerms: service.paymentTerms ?? { allowedOptions: [{ kind: "upfront" }] },
28932
+ currency: service.priceCurrency,
28933
+ timeZone: input.timeZone,
28090
28934
  totalCents,
28091
28935
  bookingStartAt: input.data.selectedSlot ?? null,
28092
28936
  now: input.nowIso
@@ -28524,6 +29368,11 @@ const bookingMailingListContextSchema = z.unknown().transform((value) => {
28524
29368
  const parsed = parseMailingListRuntimeContext(value);
28525
29369
  return parsed.ok ? parsed.value : void 0;
28526
29370
  });
29371
+ /** Missing on older payloads and SDK sites, which then word things without a noun. */
29372
+ const businessPersonSchema = z.object({
29373
+ singular: z.string(),
29374
+ plural: z.string()
29375
+ }).nullable().optional();
28527
29376
  const bookingDateContextSchema = z.object({
28528
29377
  locale: z.string(),
28529
29378
  timeZone: z.string().transform(resolveBookingBusinessTimeZone)
@@ -28537,6 +29386,7 @@ const bookingSourceSchema = z.object({
28537
29386
  siteTerms: blockSiteTermsSchema.optional(),
28538
29387
  pageNavigation: pageNavigationSchema.optional(),
28539
29388
  siteName: z.string().optional(),
29389
+ businessPerson: businessPersonSchema,
28540
29390
  siteId: z.string().optional(),
28541
29391
  apiBaseUrl: z.string().optional(),
28542
29392
  portalToken: z.string().nullable().optional(),
@@ -28573,6 +29423,7 @@ const bookingHydrationSchema = z.object({
28573
29423
  siteTerms: blockSiteTermsSchema.optional(),
28574
29424
  pageNavigation: pageNavigationSchema.optional(),
28575
29425
  siteName: z.string().optional(),
29426
+ businessPerson: businessPersonSchema,
28576
29427
  formId: z.string().nullable(),
28577
29428
  serviceId: z.string().nullable(),
28578
29429
  resourceId: z.string().nullable(),
@@ -28627,6 +29478,7 @@ const bookingFormBlockRuntime = defineClientOwnedBlockRuntime({
28627
29478
  siteTerms: source.siteTerms,
28628
29479
  pageNavigation: source.pageNavigation,
28629
29480
  siteName: source.siteName,
29481
+ businessPerson: source.businessPerson,
28630
29482
  formId: form?.id ?? source.formId ?? null,
28631
29483
  serviceId: source.serviceId ?? form?.settings?.serviceId ?? null,
28632
29484
  resourceId: source.resourceId ?? form?.settings?.resourceId ?? null,
@@ -29604,14 +30456,34 @@ function resolveStrategyDelivery(blockKind, fieldPath, slotPath, values) {
29604
30456
  if (blockKind === "block.site-header" && slotPath === "logo") return resolveSmallLogoDeliveryContract();
29605
30457
  if (blockKind === "block.site-footer" && slotPath === "logo") return resolveSmallLogoDeliveryContract();
29606
30458
  }
29607
- function resolveMediaSlotContract({ blockKind, fieldPath, values, fieldAspectRatio, fieldUi }) {
30459
+ /** Only gallery photos use the gallery Look's frame; backgrounds keep their own contract. */
30460
+ function galleryMediaFrame(blockKind, path, frame, values) {
30461
+ if (blockKind !== "block.image-gallery" || !/^images\.\d+\.image$/.test(path)) return void 0;
30462
+ const effective = asRecord(values?._effectiveLook);
30463
+ const look = blockAppearancePresets.find((candidate) => candidate.id === effectiveLookId(values));
30464
+ const declared = frame ?? resolveLookMediaFrame(look?.structure.kind === "arrangement" ? look.structure.mediaFrame : void 0, asString(effective?.skin));
30465
+ return declared?.kind === "fixed" ? declared : void 0;
30466
+ }
30467
+ /** The slot contract plus the gallery Look frame it was decided from, so callers needn't resolve the frame again. */
30468
+ function resolveMediaSlot({ blockKind, fieldPath, values, fieldAspectRatio, fieldUi, lookMediaFrame }) {
29608
30469
  const slotPath = normalizeSlotPath(fieldPath);
29609
30470
  const variant = asString(values?.variant);
29610
- const edit = resolveEditContract(blockKind, fieldPath, slotPath, values, fieldAspectRatio);
30471
+ const frame = galleryMediaFrame(blockKind, fieldPath, lookMediaFrame, values);
30472
+ const edit = frame ? {
30473
+ mode: "fixed-aspect",
30474
+ aspectRatio: frame.aspectRatio,
30475
+ ...getMinSourceConstraints(frame.aspectRatio, DEFAULT_MIN_SOURCE_WIDTH)
30476
+ } : resolveEditContract(blockKind, fieldPath, slotPath, values, fieldAspectRatio);
29611
30477
  const defaultDelivery = resolveDefaultDeliveryContract(slotPath);
29612
30478
  const fieldDelivery = resolveFieldUiDeliveryConfig(fieldUi, variant);
29613
30479
  const strategyDelivery = resolveStrategyDelivery(blockKind, fieldPath, slotPath, values);
29614
- return buildContract(edit, mergeDelivery(mergeDelivery(defaultDelivery, fieldDelivery), strategyDelivery));
30480
+ return {
30481
+ contract: buildContract(edit, mergeDelivery(mergeDelivery(defaultDelivery, fieldDelivery), strategyDelivery)),
30482
+ galleryFrame: frame
30483
+ };
30484
+ }
30485
+ function resolveMediaSlotContract(input) {
30486
+ return resolveMediaSlot(input).contract;
29615
30487
  }
29616
30488
  //#endregion
29617
30489
  //#region ../blocks/src/system/runtime/nodes/media.tsx
@@ -29886,10 +30758,17 @@ const debugMediaNodeLog = (...args) => {
29886
30758
  if (typeof window === "undefined") return;
29887
30759
  if (Reflect.get(window, "__DEBUG_MEDIA_NODE__") === true) console.log("[MediaNode]", ...args);
29888
30760
  };
30761
+ /** Keep responsive delivery and transform selection on the slot's decided crop. */
30762
+ function resolveMediaNodeAspectRatios(size, style, slotContract) {
30763
+ const slotAspect = slotContract?.edit.mode === "fixed-aspect" ? slotContract.edit.aspectRatio : void 0;
30764
+ return {
30765
+ targetAspectRatio: parseAspectRatioValue(slotAspect),
30766
+ transformAspectRatio: resolveStyleAspectRatio(style) ?? slotAspect ?? resolveTargetAspectRatio(size)
30767
+ };
30768
+ }
29889
30769
  function resolveMediaNodeResponsiveImage(value, size, style, slot, context) {
29890
- const transformAspectRatio = resolveStyleAspectRatio(style) ?? resolveTargetAspectRatio(size);
29891
30770
  const slotContract = resolveSlotContract(slot);
29892
- const targetAspectRatio = parseAspectRatioValue(slotContract?.edit.mode === "fixed-aspect" ? slotContract.edit.aspectRatio : void 0);
30771
+ const { targetAspectRatio, transformAspectRatio } = resolveMediaNodeAspectRatios(size, style, slotContract);
29893
30772
  const responsive = slotContract ? resolveImageSourceSetWithContext(value, {
29894
30773
  widthCandidates: slotContract.delivery.widthCandidates,
29895
30774
  sizes: slotContract.delivery.sizes,
@@ -30685,292 +31564,6 @@ function readSignInReturn(location) {
30685
31564
  };
30686
31565
  }
30687
31566
  //#endregion
30688
- //#region ../blocks/src/system/runtime/nodes/event-registration/registrationSignInReturn.ts
30689
- /**
30690
- * What event registration keeps while the booker follows a sign-in link, so
30691
- * they come back to the same step with what they'd typed. The storage, nonce
30692
- * and return address are shared with the appointment booking form
30693
- * (`shared/signInReturnDrafts.ts`, owned by `useSignInReturn`); this file owns
30694
- * the event draft and how it's put back.
30695
- */
30696
- /** Steps a draft can bring the booker back to; payment and later are never resumed this way. */
30697
- const RESUMABLE_STEPS = [
30698
- "select-event",
30699
- "select-tickets",
30700
- "enter-details",
30701
- "select-payment"
30702
- ];
30703
- /** Event registration's drafts, for the shared `useSignInReturn` owner. */
30704
- const eventSignInDraftStore = createSignInReturnDraftStore(z.object({
30705
- nonce: z.string().min(1),
30706
- email: z.string(),
30707
- step: z.enum(RESUMABLE_STEPS),
30708
- selectedEventId: z.string().nullable(),
30709
- selectedAttendanceMode: z.enum(["in_person", "online"]).nullable(),
30710
- ticketSelections: z.array(z.object({
30711
- pricingOptionId: z.string().nullable(),
30712
- quantity: z.number().int().positive()
30713
- })),
30714
- ticketsCount: z.number().int().positive(),
30715
- selectedSlidingAmountInput: z.string(),
30716
- formData: z.object({
30717
- name: z.string(),
30718
- email: z.string(),
30719
- phone: z.string(),
30720
- notes: z.string(),
30721
- mailingListOptIn: z.boolean().optional()
30722
- }),
30723
- guests: z.array(z.object({
30724
- name: z.string(),
30725
- email: z.string().nullable(),
30726
- phone: z.string().nullable()
30727
- })),
30728
- discountCode: z.string(),
30729
- questions: bookingQuestionsAnswerDraftSchema
30730
- }));
30731
- /** The flow's key in sign-in storage: one registration surface per page. */
30732
- const EVENT_SIGN_IN_FORM_ID = "event-registration";
30733
- function resumableStep(step) {
30734
- return RESUMABLE_STEPS.includes(step) ? step : "enter-details";
30735
- }
30736
- function toEventSignInDraft(source, attempt) {
30737
- const { flow } = source;
30738
- const { draft } = flow;
30739
- const { consentAccepted: _consent, ...formData } = draft.formData;
30740
- return {
30741
- nonce: attempt.nonce,
30742
- email: attempt.email,
30743
- step: resumableStep(flow.step),
30744
- selectedEventId: draft.selectedEvent?.selectionId ?? null,
30745
- selectedAttendanceMode: draft.selectedAttendanceMode,
30746
- ticketSelections: draft.selectedTicketLines,
30747
- ticketsCount: flow.ticketsCount,
30748
- selectedSlidingAmountInput: draft.selectedSlidingAmountInput,
30749
- formData,
30750
- guests: draft.guests,
30751
- discountCode: source.discountCode,
30752
- questions: toBookingQuestionsAnswerDraft(draft.bookingQuestions)
30753
- };
30754
- }
30755
- const HANDED_ON = [
30756
- "success",
30757
- "payment",
30758
- "verifying-payment",
30759
- "verifying-timeout",
30760
- "payment-status"
30761
- ];
30762
- /**
30763
- * A booking that's confirmed or has gone to checkout ends every draft. Picking
30764
- * another event doesn't: the draft follows what the booker is doing.
30765
- */
30766
- function eventSignInEnds(previous, next) {
30767
- return HANDED_ON.includes(next.flow.step) && !HANDED_ON.includes(previous.flow.step) ? "finished" : null;
30768
- }
30769
- /**
30770
- * How a returned draft lands once `useSignInReturn` has matched it to the
30771
- * signed-in profile and the page's events have loaded.
30772
- */
30773
- function eventSignInRestoration(draft, events, verifiedIdentity) {
30774
- const event = draft.selectedEventId === null ? null : events.find((candidate) => candidate.selectionId === draft.selectedEventId) ?? null;
30775
- return {
30776
- draft,
30777
- event,
30778
- selectionFound: draft.selectedEventId === null || event !== null,
30779
- questions: decideBookingQuestionsRestoration({
30780
- kind: "sign_in_draft",
30781
- draft: draft.questions,
30782
- verifiedIdentity
30783
- })
30784
- };
30785
- }
30786
- /**
30787
- * Puts the booker's draft back. Details and answers always return; the event
30788
- * choice, tickets and step only when that event is still offered and no
30789
- * waiting-list invitation owns the selection.
30790
- */
30791
- /** What the booker typed comes back; a blank field never erases details already filled in. */
30792
- function restoredFormData(current, saved) {
30793
- const typed = Object.fromEntries(Object.entries(saved).filter(([, value]) => typeof value !== "string" || value.trim() !== ""));
30794
- return {
30795
- ...current,
30796
- ...typed,
30797
- consentAccepted: false
30798
- };
30799
- }
30800
- function restoreEventSignInDraft(state, restoration) {
30801
- const { draft } = restoration;
30802
- const details = {
30803
- ...state.draft,
30804
- formData: restoredFormData(state.draft.formData, draft.formData),
30805
- guests: draft.guests.map((guest) => ({ ...guest })),
30806
- bookingQuestions: restoreBookingQuestionsAnswers(state.draft.bookingQuestions, restoration.questions)
30807
- };
30808
- if (!restoration.selectionFound || state.invitation.kind !== "none") return {
30809
- ...state,
30810
- draft: details
30811
- };
30812
- return {
30813
- ...state,
30814
- step: draft.step,
30815
- ticketsCount: draft.ticketsCount,
30816
- draft: {
30817
- ...details,
30818
- selectedEvent: restoration.event ?? state.draft.selectedEvent,
30819
- selectedAttendanceMode: draft.selectedAttendanceMode,
30820
- selectedTicketLines: draft.ticketSelections.map((line) => ({ ...line })),
30821
- selectedSlidingAmountInput: draft.selectedSlidingAmountInput
30822
- }
30823
- };
30824
- }
30825
- //#endregion
30826
- //#region ../blocks/src/system/runtime/shared/bookingPaymentOptionCopy.ts
30827
- function buildUpfrontBookingPaymentOptionCopy(formattedTotal) {
30828
- return {
30829
- title: "Pay in full",
30830
- description: "Pay everything today and your booking is confirmed.",
30831
- ctaLabel: `Pay ${formattedTotal} now`
30832
- };
30833
- }
30834
- /** Reused after booking; payment remains outside the platform. */
30835
- const OFFLINE_BOOKING_PAYMENT_INSTRUCTIONS = "Pay the business later, outside the platform.";
30836
- function buildDeferredManualBookingPaymentOptionCopy() {
30837
- return {
30838
- title: "Pay offline",
30839
- description: `Book now and ${OFFLINE_BOOKING_PAYMENT_INSTRUCTIONS.toLowerCase()}`,
30840
- helperText: "Nothing is due today.",
30841
- ctaLabel: "Book now"
30842
- };
30843
- }
30844
- function buildInstalmentBookingPaymentOptionCopy(input) {
30845
- return {
30846
- title: "Payment plan",
30847
- description: describeInstalmentPlanCopy(input),
30848
- helperText: input.futurePaymentCount > 0 ? "You can pay the rest early any time in your customer portal." : void 0,
30849
- ctaLabel: `Pay ${input.formattedDueToday} now`
30850
- };
30851
- }
30852
- function describeInstalmentPlanCopy(input) {
30853
- if (input.futurePaymentCount === 0) {
30854
- const depositPolicy = input.depositRefundability ? ` Your deposit is ${formatDepositRefundabilityLabel(input.depositRefundability)}.` : "";
30855
- return `Pay ${input.formattedDueToday} today.${depositPolicy}`;
30856
- }
30857
- if (input.depositRefundability) return `Pay ${input.formattedDueToday} today, then continue with scheduled payments. Your deposit is ${formatDepositRefundabilityLabel(input.depositRefundability)}.`;
30858
- if (input.futurePaymentCount === 1) return `Pay ${input.formattedDueToday} today, then one more payment later.`;
30859
- const formattedFirstFuture = input.formattedFirstFuture ?? input.formattedDueToday;
30860
- return `Pay ${input.formattedDueToday} today, then ${input.futurePaymentCount} more ${input.cadenceLabel} payments from ${formattedFirstFuture}.`;
30861
- }
30862
- function buildFlexibleBalanceBookingPaymentOptionCopy(input) {
30863
- return {
30864
- title: "Deposit now, pay the rest later",
30865
- description: `Pay ${input.formattedDueToday} today, then pay the remaining balance any time before ${input.dueDateLabel}. Your deposit is ${formatDepositRefundabilityLabel(input.depositRefundability)}.`,
30866
- helperText: "You can return in your customer portal to pay the rest before the due date.",
30867
- ctaLabel: `Pay ${input.formattedDueToday} now`
30868
- };
30869
- }
30870
- function formatDepositRefundabilityLabel(depositRefundability) {
30871
- return depositRefundability === "non_refundable" ? "non-refundable" : "refundable";
30872
- }
30873
- /** Configured cadence for the existing instalment description. */
30874
- function buildBookingInstalmentCadenceLabel(plan) {
30875
- const interval = getBookingInstalmentPlanIntervalCount(plan);
30876
- const unit = interval === 1 ? plan.intervalUnit : `${plan.intervalUnit}s`;
30877
- return interval === 1 ? unit : `every ${interval} ${unit}`;
30878
- }
30879
- //#endregion
30880
- //#region ../blocks/src/system/runtime/nodes/event-registration/bookingCalendar.ts
30881
- /** Public schedule plus the authorised outcome's arrival text; online access stays in email. */
30882
- function bookingCalendar(event, outcome) {
30883
- if (!event) return null;
30884
- const { identity } = outcome;
30885
- const sessions = event.registrationSubject.kind === "wholeSeries" ? event.registrationSubject.sessions : [{
30886
- occurrenceId: event.registrationSubject.occurrenceId,
30887
- startsAt: event.startsAt,
30888
- endsAt: event.endsAt
30889
- }];
30890
- const bookingId = identity.scope === "occurrence" ? identity.attendeeId : identity.registrationId;
30891
- const entries = sessions.map((session) => ({
30892
- uid: `booking-${bookingId}-${session.occurrenceId}@riverbankcms.com`,
30893
- sequence: 0,
30894
- title: event.title,
30895
- startsAt: new Date(session.startsAt),
30896
- endsAt: new Date(session.endsAt),
30897
- timezone: "UTC",
30898
- status: "confirmed",
30899
- location: identity.attendanceMode === "online" ? "Online" : outcome.arrivalVenues?.[session.occurrenceId] ?? event.venue?.name,
30900
- description: identity.attendanceMode === "online" ? "See your confirmation email for joining instructions." : void 0
30901
- }));
30902
- const first = entries[0];
30903
- if (!first) return null;
30904
- const common = {
30905
- fileName: `${slugify(event.title) || "event"}.ics`,
30906
- feed: {
30907
- timezone: "UTC",
30908
- entries
30909
- }
30910
- };
30911
- return entries.length === 1 ? {
30912
- ...common,
30913
- kind: "single",
30914
- ...calendarLinks(first)
30915
- } : {
30916
- ...common,
30917
- kind: "sessions",
30918
- sessionCount: entries.length
30919
- };
30920
- }
30921
- //#endregion
30922
- //#region ../blocks/src/system/runtime/nodes/event-registration/registrationEventAdapter.ts
30923
- function toRegistrationEvent(event) {
30924
- return {
30925
- ...event,
30926
- selectionId: event.id,
30927
- registrationSubject: {
30928
- kind: "occurrence",
30929
- occurrenceId: event.occurrenceId
30930
- }
30931
- };
30932
- }
30933
- function toRegistrationEvents(events) {
30934
- return events.filter((event) => event.bookingScope === "single_occurrence").map(toRegistrationEvent);
30935
- }
30936
- /**
30937
- * Project one whole-series run onto the registration surface.
30938
- *
30939
- * Capacity, pricing, payment terms and consent come straight off the canonical
30940
- * Event record; only the schedule is widened from the single occurrence to the
30941
- * live run. A run without live sessions has no registration event.
30942
- */
30943
- function toWholeSeriesRegistrationEvent(group) {
30944
- const { representative, run } = group;
30945
- const sessions = orderedLiveRunSessions(run.sessions);
30946
- const firstSession = sessions[0];
30947
- if (!firstSession) return null;
30948
- const lastSession = sessions[sessions.length - 1] ?? firstSession;
30949
- return {
30950
- ...representative,
30951
- selectionId: run.eventSeriesId,
30952
- registrationSubject: {
30953
- kind: "wholeSeries",
30954
- eventSeriesId: run.eventSeriesId,
30955
- sessions
30956
- },
30957
- startsAt: firstSession.startsAt,
30958
- endsAt: lastSession.endsAt,
30959
- timeZone: firstSession.timeZone
30960
- };
30961
- }
30962
- function toWholeSeriesRegistrationEvents(events) {
30963
- return groupPublicEventsByRun(events).map(toWholeSeriesRegistrationEvent).filter((event) => event !== null);
30964
- }
30965
- /** An occurrence-page context must not replace a whole run's booking start. */
30966
- function getRegistrationStartAt(event, occurrenceContext) {
30967
- return event?.registrationSubject.kind === "wholeSeries" ? event.startsAt : occurrenceContext?.startsAt ?? event?.startsAt;
30968
- }
30969
- /** Confirmation identifies its persisted subject, independently of the current draft. */
30970
- function findBookedEvent(events, identity) {
30971
- return events.find((event) => identity.scope === "occurrence" ? event.seriesId === identity.seriesId && event.registrationSubject.kind === "occurrence" && event.registrationSubject.occurrenceId === identity.occurrenceId : event.registrationSubject.kind === "wholeSeries" && event.registrationSubject.eventSeriesId === identity.seriesId) ?? null;
30972
- }
30973
- //#endregion
30974
31567
  //#region ../blocks/src/system/runtime/nodes/event-registration/ticketSelectionLines.ts
30975
31568
  /** Waitlists request places; bookings can only request currently available capacity. */
30976
31569
  function canRequestTicketOption(availability, purpose) {
@@ -31042,6 +31635,92 @@ function getHeldPlacesBySelection(current, held) {
31042
31635
  return held?.selectionId === current.selectionId && held?.attendanceMode === current.attendanceMode ? held.lines : [];
31043
31636
  }
31044
31637
  //#endregion
31638
+ //#region ../blocks/src/system/runtime/nodes/event-registration/registrationWizardContext.ts
31639
+ function getEventSelectionDefaults(event) {
31640
+ const suggestedAmount = getSlidingScaleForEvent(event)?.suggestedAmount;
31641
+ return {
31642
+ slidingAmountInput: suggestedAmount == null ? "" : formatCentsAsCurrencyInput(suggestedAmount),
31643
+ attendanceMode: event.deliveryMode === "hybrid" ? null : event.deliveryMode ?? "in_person"
31644
+ };
31645
+ }
31646
+ function parseCurrencyInputToCents(value) {
31647
+ const trimmed = value.trim();
31648
+ if (!trimmed) return null;
31649
+ const amount = Number(trimmed);
31650
+ return Number.isFinite(amount) && amount >= 0 ? Math.round(amount * 100) : null;
31651
+ }
31652
+ function getSlidingScaleForEvent(event) {
31653
+ const pricing = event?.pricing ?? null;
31654
+ return pricing?.kind === "sliding_scale" ? {
31655
+ minAmount: pricing.minimum,
31656
+ maxAmount: pricing.maximum,
31657
+ suggestedAmount: pricing.suggested
31658
+ } : null;
31659
+ }
31660
+ function getSlidingScaleSelectionMessage(input) {
31661
+ if (!input.slidingScale) return null;
31662
+ if (input.selectedAmount === null) return "Choose an amount to continue.";
31663
+ const { minAmount, maxAmount } = input.slidingScale;
31664
+ return input.selectedAmount < minAmount || input.selectedAmount > maxAmount ? "Choose an amount within the sliding scale." : null;
31665
+ }
31666
+ function getRegistrationOccurrenceId(target) {
31667
+ return target?.subject.kind === "occurrence" ? target.subject.occurrenceId : "";
31668
+ }
31669
+ function shouldLoadRegistrationOptions(authState, step) {
31670
+ return authState === "authenticated" || step === "select-tickets" || step === "enter-details" || step === "select-payment";
31671
+ }
31672
+ function getEligibilityFlowFlags(input) {
31673
+ const hasPass = (input.eligibility?.eligiblePasses.length ?? 0) > 0;
31674
+ const hasMembership = (input.eligibility?.eligibleMemberships.length ?? 0) > 0;
31675
+ return {
31676
+ hasEligibility: hasPass || hasMembership,
31677
+ hasMembershipEligibility: hasMembership,
31678
+ isMembershipFastTrack: input.portalAuthState === "authenticated" && hasMembership && input.ticketsCount === 1 && input.paymentMethod === "membership"
31679
+ };
31680
+ }
31681
+ /** Prefer refreshed capacity, including a known zero; fall back while options load. */
31682
+ function getTicketSelectionRemainingPlaces(input) {
31683
+ const availability = input.eligibility?.availability;
31684
+ if (availability && "remainingPlaces" in availability) return availability.remainingPlaces ?? null;
31685
+ return input.event ? getEventAvailability(selectEventCapacitySource(input.event, input.attendanceMode)).available : null;
31686
+ }
31687
+ /** Keep the card and ticket step on the same fresh capacity as admission. */
31688
+ function withRegistrationAvailability(event, eligibility, attendanceMode) {
31689
+ const availability = eligibility?.availability;
31690
+ if (!event || !availability || !("remainingPlaces" in availability)) return event;
31691
+ const mode = attendanceMode ?? (event.deliveryMode === "hybrid" ? null : event.deliveryMode ?? "in_person");
31692
+ if (!mode) return event;
31693
+ const source = selectEventCapacitySource(event, mode);
31694
+ const remaining = availability.remainingPlaces ?? null;
31695
+ const refreshed = {
31696
+ capacity: remaining === null ? null : source.capacity ?? remaining,
31697
+ availableSpots: remaining,
31698
+ waitlistEnabled: availability.waitlistEnabled
31699
+ };
31700
+ return {
31701
+ ...event,
31702
+ ...event.deliveryMode === "hybrid" ? {} : refreshed,
31703
+ attendanceModes: event.attendanceModes?.map((row) => row.mode === mode ? {
31704
+ ...row,
31705
+ ...refreshed
31706
+ } : row)
31707
+ };
31708
+ }
31709
+ function resolveHeldTicketPlaces(current, invitation, paymentHold) {
31710
+ return getHeldPlacesBySelection(current, invitation.kind === "ready" ? {
31711
+ selectionId: invitation.restoration.event?.selectionId ?? current.selectionId,
31712
+ attendanceMode: invitation.restoration.attendanceMode,
31713
+ lines: invitation.restoration.ticketSelections
31714
+ } : paymentHold);
31715
+ }
31716
+ function getCurrentTicketSelection(event, attendanceMode, lines) {
31717
+ return {
31718
+ selectionId: event?.selectionId ?? null,
31719
+ attendanceMode,
31720
+ lines
31721
+ };
31722
+ }
31723
+ //#endregion
31045
31724
  //#region ../blocks/src/system/runtime/nodes/event-registration/utils.ts
31046
31725
  function getPortalSubjectEmail(profile) {
31047
31726
  return profile?.email ?? null;
@@ -31167,6 +31846,7 @@ function withOccurrenceTitle(event, occurrence) {
31167
31846
  title
31168
31847
  } : event;
31169
31848
  }
31849
+ /** A course runs from its first session's start until its last session ends. */
31170
31850
  function courseSchedule(sessions, siteTimeZone, deliveryMode) {
31171
31851
  const first = sessions[0];
31172
31852
  if (!first) return null;
@@ -31176,8 +31856,12 @@ function courseSchedule(sessions, siteTimeZone, deliveryMode) {
31176
31856
  siteTimeZone,
31177
31857
  deliveryMode
31178
31858
  });
31179
- if (last.startsAt === first.startsAt) return `${sessions.length} session${sessions.length === 1 ? "" : "s"} · ${firstLabel}`;
31180
- const lastLabel = formatEventDateTime(last.startsAt, {
31859
+ if (sessions.length === 1) return `1 session · ${formatBookingWhen({
31860
+ ...first,
31861
+ siteTimeZone,
31862
+ deliveryMode
31863
+ }, "long")}`;
31864
+ const lastLabel = formatEventDateTime(last.endsAt, {
31181
31865
  timeZone: last.timeZone,
31182
31866
  siteTimeZone,
31183
31867
  deliveryMode
@@ -31270,6 +31954,7 @@ function transformRegistrationOptionsResponse(response) {
31270
31954
  ticketTypes: response.pricing.options,
31271
31955
  price: response.pricing.subtotalCents,
31272
31956
  currency: response.pricing.currency,
31957
+ requiresAuthForCredit: response.entitlements.requiresLoginForCredit ?? false,
31273
31958
  requiresAuthForPasses: response.entitlements.requiresLoginForPasses,
31274
31959
  requiresAuthForMemberships: response.entitlements.requiresLoginForMemberships,
31275
31960
  eligiblePasses,
@@ -31352,6 +32037,1384 @@ function findSelectedTicketType(input) {
31352
32037
  }).find((ticketType) => ticketType.pricingOptionId === input.selectedPricingOptionId) ?? null;
31353
32038
  }
31354
32039
  //#endregion
32040
+ //#region ../blocks/src/system/runtime/nodes/event-registration/combinationPrices.state.ts
32041
+ /**
32042
+ * Combination prices in the registration block (issue 1725): "any 4 dates for
32043
+ * £40", "Part 1 and Part 2 for £120". Everything here is pure.
32044
+ *
32045
+ * Prices come from the commerce planner checkout uses, so the block shows the
32046
+ * total checkout will charge. Once the server has priced the order (a code
32047
+ * preview), its figures win over the planner's. Offer labels are the stored
32048
+ * ones the server sends ("4 dates for £40"), never rebuilt here.
32049
+ */
32050
+ /** Dates and runs of one event share its offers, so the first item's are everyone's. */
32051
+ function combinationOffersOf(events) {
32052
+ return events[0]?.combinationPrices ?? [];
32053
+ }
32054
+ /** Offers name dates by occurrence and runs by series. */
32055
+ function lineIdOf(event) {
32056
+ const subject = event.registrationSubject;
32057
+ return subject.kind === "occurrence" ? subject.occurrenceId : subject.eventSeriesId;
32058
+ }
32059
+ /**
32060
+ * What a date or run is called among the items named with it: "Fri 30 Oct,
32061
+ * 7pm", or the run's name. Runs of one course can share a name, so a run
32062
+ * whose name another of `peers` has also gets its start day:
32063
+ * "Beginners Yoga (starts Thu 5 Nov)". Dates already differ by date and time.
32064
+ */
32065
+ function selectionItemName(event, peers) {
32066
+ if (event.registrationSubject.kind !== "wholeSeries") return formatBookingWhen(event, "short");
32067
+ return peers.some((peer) => peer.selectionId !== event.selectionId && peer.title === event.title) ? `${event.title} (starts ${formatBookingWhen(event, "day")})` : event.title;
32068
+ }
32069
+ /** A selected item as checkout prices it, at its resolved price for one place. */
32070
+ function toItem(event, unitPriceCents, peers) {
32071
+ if (unitPriceCents === null) return null;
32072
+ const id = lineIdOf(event);
32073
+ return {
32074
+ itemId: id,
32075
+ lineId: id,
32076
+ date: event.startsAt,
32077
+ label: selectionItemName(event, peers),
32078
+ unitPriceCents: toNonNegativeCents(unitPriceCents)
32079
+ };
32080
+ }
32081
+ /** `peers` are every item named alongside these, so two runs sharing a name read apart. */
32082
+ function toItems(events, itemPrice, peers = events) {
32083
+ const items = events.map((event) => {
32084
+ const price = itemPrice(event);
32085
+ return price === null ? null : {
32086
+ line: {
32087
+ lineId: lineIdOf(event),
32088
+ date: event.startsAt,
32089
+ label: selectionItemName(event, peers)
32090
+ },
32091
+ subtotalCents: toNonNegativeCents(price.subtotalCents),
32092
+ item: toItem(event, price.unitPriceCents, peers)
32093
+ };
32094
+ });
32095
+ return items.every((item) => item !== null) ? items : null;
32096
+ }
32097
+ /** A row that could still be ticked, at its one fixed price; the hint never guesses a ticket type. */
32098
+ function addableLine(event, peers) {
32099
+ return event.pricing.kind === "single" ? toItem(event, event.pricing.amount, peers) : null;
32100
+ }
32101
+ /**
32102
+ * The planner's price for the selection, or null when it can't apply: no
32103
+ * offers, one item, or an item whose price isn't known yet. Checkout's own
32104
+ * projection decides it (`planSelectionCombinationPrices`): every item enters
32105
+ * at its resolved price, so a run with ticket types that no offer covers keeps
32106
+ * the price chosen for it. The planner refuses input checkout would refuse
32107
+ * too, which leaves the usual prices.
32108
+ */
32109
+ function planSelectionCombination(input) {
32110
+ const items = toItems(input.selection, input.itemPrice);
32111
+ if (input.offers.length === 0 || input.selection.length < 2 || items === null || input.places < 1) return null;
32112
+ try {
32113
+ return planSelectionCombinationPrices({
32114
+ items: items.flatMap(({ item }) => item ? [item] : []),
32115
+ offers: input.offers,
32116
+ places: unsafeAsPositiveCheckoutQuantity(input.places),
32117
+ uncovered: items.filter(({ item }) => item === null)
32118
+ });
32119
+ } catch {
32120
+ return null;
32121
+ }
32122
+ }
32123
+ /** Whether the plan takes anything off. */
32124
+ function planCombines(plan) {
32125
+ return plan !== null && plan.applications.length > 0;
32126
+ }
32127
+ /** "£40.00", matching the totals beside it; stored offer labels keep their own wording. */
32128
+ function money(cents, currency) {
32129
+ return formatCurrencyAmount(cents, currency);
32130
+ }
32131
+ /** "Part 1 and Part 2", "A, B and C". */
32132
+ function joinNames$1(names) {
32133
+ const last = names[names.length - 1] ?? "";
32134
+ return names.length < 2 ? last : `${names.slice(0, -1).join(", ")} and ${last}`;
32135
+ }
32136
+ function plural(count, singular) {
32137
+ return `${count} ${singular}${count === 1 ? "" : "s"}`;
32138
+ }
32139
+ /** "Book any **4 dates for £40**, or any **8 dates for £75**." Particular offers name their items. */
32140
+ function combinationOfferLine(offers) {
32141
+ const sorted = [...offers].sort((a, b) => a.sortOrder - b.sortOrder);
32142
+ if (sorted.length === 0) return null;
32143
+ return [...sorted.flatMap((offer, index) => {
32144
+ const lead = index === 0 ? "Book " : ", or ";
32145
+ return [{ text: offer.kind === "any" ? `${lead}any ` : lead }, {
32146
+ text: offer.label,
32147
+ strong: true
32148
+ }];
32149
+ }), { text: "." }];
32150
+ }
32151
+ /** The usual-price items after the combinations: "plus 1 at £12", "plus Part 3 at £70". */
32152
+ function leftoverText(plan, several, currency) {
32153
+ const leftover = plan.lines.filter((row) => !row.combined).map((row) => ({
32154
+ ...row.line,
32155
+ unitPriceCents: row.listCents / plan.places
32156
+ }));
32157
+ if (leftover.length === 0) return null;
32158
+ if (several === "runs") return `plus ${joinNames$1(leftover.map((line) => `${line.label} at ${money(line.unitPriceCents, currency)}`))}`;
32159
+ return `plus ${joinNames$1([...new Set(leftover.map((line) => line.unitPriceCents))].map((price) => `${leftover.filter((line) => line.unitPriceCents === price).length} at ${money(price, currency)}`))}`;
32160
+ }
32161
+ /** "4 dates for £40", or "2 × 4 dates for £40" when an offer repeats. */
32162
+ function applicationsText(plan) {
32163
+ return [...new Set(plan.applications.map((app) => app.offer.id))].flatMap((id) => {
32164
+ const apps = plan.applications.filter((app) => app.offer.id === id);
32165
+ const label = apps[0]?.offer.label;
32166
+ if (label === void 0) return [];
32167
+ return [apps.length > 1 ? `${apps.length} × ${label}` : label];
32168
+ });
32169
+ }
32170
+ /**
32171
+ * The summary bar's detail line: "4 dates for £40, plus 1 at £12" and
32172
+ * "You save £8"; with places, "…, for each place".
32173
+ */
32174
+ function combinationWorking(input) {
32175
+ const { plan } = input;
32176
+ if (!planCombines(plan)) return null;
32177
+ const leftover = leftoverText(plan, input.several, input.currency);
32178
+ const working = [...applicationsText(plan), ...leftover ? [leftover] : []].join(", ");
32179
+ return {
32180
+ working: plan.places > 1 ? `${working}, for each place` : working,
32181
+ saving: `You save ${money(plan.listTotalCents - plan.totalCents, input.currency)}`
32182
+ };
32183
+ }
32184
+ /**
32185
+ * The next saving, worked out by the planner from the items the visitor could
32186
+ * still tick, so it never promises a price checkout won't give.
32187
+ */
32188
+ function selectionCombinationHint(input) {
32189
+ const peers = [...input.selection, ...input.addable];
32190
+ const items = toItems(input.selection, input.itemPrice, peers);
32191
+ if (input.offers.length === 0 || input.selection.length === 0 || items === null || input.places < 1) return null;
32192
+ if (items.some(({ item }) => item === null)) return null;
32193
+ const chosen = new Set(items.map(({ line }) => line.lineId));
32194
+ const addable = input.addable.flatMap((event) => {
32195
+ const line = addableLine(event, peers);
32196
+ return line && !chosen.has(line.lineId) ? [line] : [];
32197
+ });
32198
+ const lines = items.flatMap(({ item }) => item ? [item] : []);
32199
+ try {
32200
+ return nextCombinationHint({
32201
+ lines,
32202
+ addable,
32203
+ offers: input.offers,
32204
+ places: unsafeAsPositiveCheckoutQuantity(input.places)
32205
+ });
32206
+ } catch {
32207
+ return null;
32208
+ }
32209
+ }
32210
+ /**
32211
+ * "**Add 1 more date** to get 4 dates for £40." · "**Add Part 2** to get Part
32212
+ * 1 and Part 2 for £120. You’d save £20." Particular dates are named.
32213
+ */
32214
+ function combinationHintCopy(input) {
32215
+ const { hint } = input;
32216
+ const count = hint.added.length;
32217
+ const lead = input.several === "dates" && hint.offer.kind === "any" ? `Add ${count} more ${count === 1 ? "date" : "dates"}` : `Add ${joinNames$1(hint.added.map((line) => line.label))}`;
32218
+ const saving = input.several === "runs" ? ` You’d save ${money(hint.savingCents, input.currency)}.` : "";
32219
+ return [{
32220
+ text: lead,
32221
+ strong: true
32222
+ }, { text: ` to get ${hint.offer.label}.${saving}` }];
32223
+ }
32224
+ /**
32225
+ * The lines the server prices a selection from, for a typed code or the
32226
+ * automatic one: each date by occurrence, each run with its places, each at
32227
+ * its resolved price, so the server prices them as checkout will.
32228
+ */
32229
+ function selectionPreviewLines(input) {
32230
+ const lines = input.selection.map((event) => {
32231
+ const currency = publicEventPricingCurrency(event.pricing);
32232
+ const price = input.itemPrice(event);
32233
+ if (price === null || currency === null) return null;
32234
+ const { subtotalCents } = price;
32235
+ const subject = event.registrationSubject;
32236
+ return subject.kind === "occurrence" ? {
32237
+ occurrenceId: subject.occurrenceId,
32238
+ quantity: input.places,
32239
+ subtotalCents,
32240
+ currency,
32241
+ ...price.ticketUnits ? { ticketUnits: price.ticketUnits } : {},
32242
+ context: {
32243
+ type: "event",
32244
+ eventSeriesId: event.seriesId,
32245
+ eventCategoryId: event.eventCategory?.id ?? null,
32246
+ ticketsCount: input.places
32247
+ }
32248
+ } : {
32249
+ quantity: input.places,
32250
+ subtotalCents,
32251
+ currency,
32252
+ context: {
32253
+ type: "whole_series",
32254
+ eventSeriesId: subject.eventSeriesId
32255
+ }
32256
+ };
32257
+ });
32258
+ return lines.length > 0 && lines.every((line) => line !== null) ? lines : null;
32259
+ }
32260
+ /** A preview belongs to one code (or none, for the automatic one), one set of items and one number of places. */
32261
+ function selectionPreviewKey(code, lines) {
32262
+ const trimmed = code === null ? "" : code.trim().toUpperCase();
32263
+ if (code !== null && !trimmed || !lines) return null;
32264
+ return JSON.stringify([trimmed, lines]);
32265
+ }
32266
+ const USUAL_PRICE = "At the usual price";
32267
+ function plannedGroups(plan) {
32268
+ const label = (lineId) => plan.lines.find((row) => row.line.lineId === lineId)?.line.label ?? "";
32269
+ const combined = plan.applications.map((app, index) => ({
32270
+ key: `combination-${index}`,
32271
+ heading: app.offer.label,
32272
+ lines: app.allocations.map((row) => ({
32273
+ key: row.lineId,
32274
+ label: label(row.lineId),
32275
+ amountCents: row.totalCents
32276
+ }))
32277
+ }));
32278
+ const usual = plan.lines.filter((row) => !row.combined).map((row) => ({
32279
+ key: row.line.lineId,
32280
+ label: row.line.label,
32281
+ amountCents: row.listCents
32282
+ }));
32283
+ return [...combined, ...usual.length > 0 ? [{
32284
+ key: "usual",
32285
+ heading: USUAL_PRICE,
32286
+ lines: usual
32287
+ }] : []];
32288
+ }
32289
+ function usualGroups(plan) {
32290
+ return [{
32291
+ key: "usual",
32292
+ heading: null,
32293
+ lines: plan.lines.map((row) => ({
32294
+ key: row.line.lineId,
32295
+ label: row.line.label,
32296
+ amountCents: row.listCents
32297
+ }))
32298
+ }];
32299
+ }
32300
+ function sumKind(reductions, kind) {
32301
+ return reductions.filter((row) => row.kind === kind).reduce((sum, row) => sum + row.amountCents, 0);
32302
+ }
32303
+ /** "Code WELCOME10 (10% off)", or just the code when its label says nothing more. */
32304
+ function codeLineLabel(preview) {
32305
+ const label = preview.publicLabel.trim();
32306
+ return label && label.toUpperCase() !== preview.code.toUpperCase() ? `Code ${preview.code} (${label})` : `Code ${preview.code}`;
32307
+ }
32308
+ /** An automatic code is named by its label, as the summary bar names it for one booking. */
32309
+ function quoteLineLabel(quote) {
32310
+ if (quote.preview.type === "priced") return "";
32311
+ return quote.source === "automatic" ? quote.preview.publicLabel.trim() || quote.preview.code : codeLineLabel(quote.preview);
32312
+ }
32313
+ /** "This code can’t be used with the “4 dates for £40” price, so it’s been taken off your other date." */
32314
+ function codeNote(plan, several) {
32315
+ const label = plan.applications[0]?.offer.label;
32316
+ const others = plan.lines.filter((row) => !row.combined).length;
32317
+ if (label === void 0 || others === 0) return null;
32318
+ const noun = several === "dates" ? "date" : "run";
32319
+ return `This code can’t be used with the “${label}” price, so it’s been taken off your other ${others === 1 ? noun : `${noun}s`}.`;
32320
+ }
32321
+ function placesLabel$1(several, places) {
32322
+ return `${plural(places, "place")} on each ${several === "runs" ? "run" : "date"}`;
32323
+ }
32324
+ /**
32325
+ * The payment step's list when combinations apply: each combination's items
32326
+ * with what each now costs, the rest at the usual price, any code, the total
32327
+ * and the saving. Once the server has priced the selection (a typed code, or
32328
+ * the automatic one) its figures decide: when its combinations match the
32329
+ * planner's, the planner's working is shown with the server's code amount and
32330
+ * total; otherwise only the server's own figures.
32331
+ */
32332
+ function summariseCombinedPayment(input) {
32333
+ const { plan, quote } = input;
32334
+ if (quote) return previewedPayment({
32335
+ ...input,
32336
+ quote
32337
+ });
32338
+ if (!planCombines(plan)) return null;
32339
+ return {
32340
+ kind: "combined",
32341
+ placesLabel: placesLabel$1(input.several, plan.places),
32342
+ groups: plannedGroups(plan),
32343
+ subtotalCents: plan.totalCents,
32344
+ reductions: [],
32345
+ note: null,
32346
+ totalCents: plan.totalCents,
32347
+ savingCents: savingFrom(plan, plan.totalCents)
32348
+ };
32349
+ }
32350
+ function savingFrom(plan, totalCents) {
32351
+ return plan.listTotalCents > totalCents ? plan.listTotalCents - totalCents : null;
32352
+ }
32353
+ /** The server's reductions; an older server reports only the code's amount. */
32354
+ function serverReductions(preview) {
32355
+ return preview.priceReductions ?? (preview.type === "applied" ? [{
32356
+ kind: "discount_code",
32357
+ label: preview.publicLabel,
32358
+ amountCents: preview.discountCents
32359
+ }] : []);
32360
+ }
32361
+ /** Which of the planner's working the server's price keeps: all of it, the items only, or none. */
32362
+ function previewAgreement(plan, preview) {
32363
+ const combinationCents = sumKind(serverReductions(preview), "combination_price");
32364
+ if (preview.subtotalCents !== plan.listTotalCents) return "server";
32365
+ if (planCombines(plan) && combinationCents === plan.listTotalCents - plan.totalCents) return "combinations";
32366
+ return combinationCents === 0 ? "usual" : "server";
32367
+ }
32368
+ function previewedPayment(input) {
32369
+ const { plan, quote } = input;
32370
+ const { preview } = quote;
32371
+ const server = serverReductions(preview);
32372
+ const code = {
32373
+ key: "code",
32374
+ label: quoteLineLabel(quote),
32375
+ amountCents: sumKind(server, "discount_code")
32376
+ };
32377
+ const codeRows = code.amountCents > 0 ? [code] : [];
32378
+ const base = {
32379
+ kind: "combined",
32380
+ placesLabel: placesLabel$1(input.several, plan.places),
32381
+ note: null,
32382
+ totalCents: preview.totalAfterDiscountCents,
32383
+ savingCents: savingFrom(plan, preview.totalAfterDiscountCents)
32384
+ };
32385
+ switch (previewAgreement(plan, preview)) {
32386
+ case "combinations": {
32387
+ const limited = quote.source === "typed" && preview.type === "applied" && preview.codeCombinesWithCombinationPrices === false && code.amountCents > 0;
32388
+ return {
32389
+ ...base,
32390
+ groups: plannedGroups(plan),
32391
+ subtotalCents: plan.totalCents,
32392
+ reductions: codeRows,
32393
+ note: limited ? codeNote(plan, input.several) : null
32394
+ };
32395
+ }
32396
+ case "usual": return {
32397
+ ...base,
32398
+ groups: usualGroups(plan),
32399
+ subtotalCents: plan.listTotalCents,
32400
+ reductions: codeRows
32401
+ };
32402
+ case "server": {
32403
+ const rows = server.map((row, index) => ({
32404
+ key: `reduction-${index}`,
32405
+ label: row.kind === "discount_code" ? code.label : row.label,
32406
+ amountCents: row.amountCents
32407
+ }));
32408
+ const sameBasket = preview.subtotalCents === plan.listTotalCents;
32409
+ return {
32410
+ ...base,
32411
+ groups: sameBasket ? usualGroups(plan) : [],
32412
+ subtotalCents: preview.subtotalCents,
32413
+ reductions: rows
32414
+ };
32415
+ }
32416
+ }
32417
+ }
32418
+ /**
32419
+ * What the visitor pays, once checkout has priced the order: the usual total
32420
+ * less every reduction it reports. Null when it hasn't.
32421
+ */
32422
+ function serverPricedTotalCents(input) {
32423
+ if (input.listTotalCents === null || input.reductions === null) return null;
32424
+ return Math.max(0, input.listTotalCents - input.reductions.reduce((sum, row) => sum + row.amountCents, 0));
32425
+ }
32426
+ //#endregion
32427
+ //#region ../blocks/src/system/runtime/nodes/event-registration/registrationSelection.state.ts
32428
+ const SINGLE = { kind: "single" };
32429
+ function sameOffering(events) {
32430
+ const offerings = new Set(events.map((event) => event.registrationSubject.kind === "wholeSeries" ? event.registrationSubject.eventOfferingId : null));
32431
+ return offerings.size === 1 && !offerings.has(null);
32432
+ }
32433
+ function registrationSelectionMode(input) {
32434
+ const { events } = input;
32435
+ if (input.hasPreSelectedContext || events.length < 2) return SINGLE;
32436
+ if (!events.every((event) => event.allowsMultipleBooking)) return SINGLE;
32437
+ const firstSeriesId = events[0]?.seriesId;
32438
+ if (events.every((event) => event.registrationSubject.kind === "occurrence" && event.seriesId === firstSeriesId)) return {
32439
+ kind: "several",
32440
+ items: "dates"
32441
+ };
32442
+ return events.every((event) => event.registrationSubject.kind === "wholeSeries") && sameOffering(events) ? {
32443
+ kind: "several",
32444
+ items: "runs"
32445
+ } : SINGLE;
32446
+ }
32447
+ /**
32448
+ * The kind of several items chosen, or null for a selection of one. Only a
32449
+ * page that allows several lets a second item in, so the list alone decides.
32450
+ */
32451
+ function severalItemsOf(selection) {
32452
+ if (selection.length < 2) return null;
32453
+ return selection[0]?.registrationSubject.kind === "wholeSeries" ? "runs" : "dates";
32454
+ }
32455
+ function selectionRowAvailability(event) {
32456
+ if (!isEventFull(event)) return "open";
32457
+ return canJoinEventWaitlistOnAnyMode(event) ? "waitlist" : "full";
32458
+ }
32459
+ /** One booking names at most this many items; the request parser refuses more. */
32460
+ const MAX_SELECTION_ITEMS = 20;
32461
+ const SELECTION_LIMIT_NOTE = `You can book up to ${MAX_SELECTION_ITEMS} at once.`;
32462
+ function selectionAtLimit(selection) {
32463
+ return selection.length >= MAX_SELECTION_ITEMS;
32464
+ }
32465
+ /** An open row can be ticked until the limit; a ticked row can always be unticked. */
32466
+ function canToggleSelectionItem(selection, event) {
32467
+ if (selectionIncludes(selection, event)) return true;
32468
+ return selectionRowAvailability(event) === "open" && !selectionAtLimit(selection);
32469
+ }
32470
+ /**
32471
+ * Ticking adds a row and unticking removes it; the list stays in date order.
32472
+ * A row that can't be ticked leaves the selection as it is.
32473
+ */
32474
+ function toggleSelectionItem(selection, event) {
32475
+ if (!canToggleSelectionItem(selection, event)) return selection;
32476
+ return [...selection.some((item) => item.selectionId === event.selectionId) ? selection.filter((item) => item.selectionId !== event.selectionId) : [...selection, event]].sort((left, right) => Date.parse(left.startsAt) - Date.parse(right.startsAt));
32477
+ }
32478
+ /** What the visitor is booking: the ticked items, or the page's own event before anything is ticked. */
32479
+ function effectiveSelection(selection, preSelectedEvent) {
32480
+ if (selection.length > 0) return selection;
32481
+ return preSelectedEvent ? [preSelectedEvent] : [];
32482
+ }
32483
+ function primarySelectionItem(selection) {
32484
+ return selection[0] ?? null;
32485
+ }
32486
+ function selectionIncludes(selection, event) {
32487
+ return selection.some((item) => item.selectionId === event.selectionId);
32488
+ }
32489
+ function nonEmpty(items) {
32490
+ const [first, ...rest] = items;
32491
+ return first === void 0 ? null : [first, ...rest];
32492
+ }
32493
+ function singleBookingSelection(subject, eventSeriesId) {
32494
+ return subject.kind === "occurrence" ? {
32495
+ kind: "dates",
32496
+ ...eventSeriesId ? { eventSeriesId } : {},
32497
+ occurrenceIds: [subject.occurrenceId]
32498
+ } : {
32499
+ kind: "runs",
32500
+ eventOfferingId: subject.eventOfferingId,
32501
+ eventSeriesIds: [subject.eventSeriesId]
32502
+ };
32503
+ }
32504
+ function severalBookingSelection(selection) {
32505
+ const subjects = selection.map((event) => event.registrationSubject);
32506
+ const occurrenceIds = nonEmpty(subjects.flatMap((subject) => subject.kind === "occurrence" ? [subject.occurrenceId] : []));
32507
+ if (occurrenceIds && occurrenceIds.length === subjects.length) return {
32508
+ kind: "dates",
32509
+ eventSeriesId: selection[0]?.seriesId,
32510
+ occurrenceIds
32511
+ };
32512
+ const runs = subjects.flatMap((subject) => subject.kind === "wholeSeries" ? [subject] : []);
32513
+ const eventSeriesIds = nonEmpty(runs.map((run) => run.eventSeriesId));
32514
+ return eventSeriesIds && runs.length === subjects.length ? {
32515
+ kind: "runs",
32516
+ eventOfferingId: runs[0]?.eventOfferingId,
32517
+ eventSeriesIds
32518
+ } : null;
32519
+ }
32520
+ /**
32521
+ * The booking request's selection. One item keeps the subject the page
32522
+ * decided (a dated page books its date); several items name them all.
32523
+ */
32524
+ function toBookingSelection(input) {
32525
+ return (input.selection.length > 1 ? severalBookingSelection(input.selection) : null) ?? singleBookingSelection(input.subject, input.selection[0]?.seriesId);
32526
+ }
32527
+ function toBookingSelectionRequest(selection, attendanceMode) {
32528
+ const mode = attendanceMode ? { attendanceMode } : {};
32529
+ return {
32530
+ ...selection,
32531
+ ...mode
32532
+ };
32533
+ }
32534
+ /** "Part 1 and Part 2", "A, B and C". */
32535
+ function joinNames(names) {
32536
+ const last = names[names.length - 1] ?? "";
32537
+ return names.length < 2 ? last : `${names.slice(0, -1).join(", ")} and ${last}`;
32538
+ }
32539
+ function countLabel(count, singular) {
32540
+ return `${count} ${singular}${count === 1 ? "" : "s"}`;
32541
+ }
32542
+ /** The summary bar's "what": "3 dates", or the runs by name. */
32543
+ function selectionItemsLabel(kind, selection) {
32544
+ return kind === "dates" ? countLabel(selection.length, "date") : joinNames(selection.map((event) => selectionItemName(event, selection)));
32545
+ }
32546
+ /** "5 dates × 2 places" once places are counted; just the items for one place. */
32547
+ function selectionPlacesLabel(kind, selection, places) {
32548
+ const items = selectionItemsLabel(kind, selection);
32549
+ return places > 1 ? `${items} × ${countLabel(places, "place")}` : items;
32550
+ }
32551
+ /** The tickets step's note: one number covers every chosen item. */
32552
+ function selectionPlacesNote(kind, count) {
32553
+ return `You’ll have this many places on each of your ${count} ${kind === "dates" ? "dates" : "runs"}.`;
32554
+ }
32555
+ /** The details step's email hint. */
32556
+ function selectionConfirmationHint(kind) {
32557
+ switch (kind) {
32558
+ case null: return "We’ll send your confirmation here.";
32559
+ case "dates": return "We’ll send a confirmation for each date here.";
32560
+ case "runs": return "We’ll send a confirmation for each run here.";
32561
+ }
32562
+ }
32563
+ /** The consent tick for dates covers them all; runs keep their own wording. */
32564
+ function selectionConsentLabel(kind, count, label) {
32565
+ return kind === "dates" ? `I agree. This applies to all ${count} dates.` : label;
32566
+ }
32567
+ /** The confirmation's line for several bookings: each gets its own email. */
32568
+ function severalConfirmationSentence(kind, email) {
32569
+ const each = kind === "dates" ? "date" : "run";
32570
+ const to = email.trim();
32571
+ return to ? `We’ve emailed a confirmation for each ${each} to ${to}.` : `We’ve emailed a confirmation for each ${each}.`;
32572
+ }
32573
+ const SEVERAL_BOOKINGS_ACCOUNT_NOTE = "You can see and manage your bookings in your account.";
32574
+ /**
32575
+ * Why passes and memberships, and the first item's deposit or instalments
32576
+ * when it had them, aren't offered while several items are ticked.
32577
+ */
32578
+ function selectionEntitlementNote(kind, hadDepositOrInstalments) {
32579
+ return `${hadDepositOrInstalments ? "Deposits, instalments, class passes and memberships" : "Class passes and memberships"} can be used when you book one ${kind === "dates" ? "date" : "run"} at a time.`;
32580
+ }
32581
+ const NO_RUN_PRICING_CHOICES = {};
32582
+ /** Runs whose price needs a choice get their own section on the tickets step. */
32583
+ function runNeedsPricingChoice(run) {
32584
+ const strategy = publicEventPricingStrategy(run.pricing);
32585
+ return strategy === "tiered" || strategy === "sliding_scale";
32586
+ }
32587
+ function firstOpenTicketType(pricing) {
32588
+ return pricing.kind === "tiered" ? pricing.options.find((option) => option.isActive && option.availability.kind === "available")?.id ?? null : null;
32589
+ }
32590
+ /** A run starts on its first open ticket type, or its suggested amount, as a single booking does. */
32591
+ function defaultRunPricingChoice(run) {
32592
+ const suggested = run.pricing.kind === "sliding_scale" ? run.pricing.suggested : null;
32593
+ return {
32594
+ pricingOptionId: firstOpenTicketType(run.pricing),
32595
+ slidingAmountInput: suggested === null ? "" : formatCentsAsCurrencyInput(suggested)
32596
+ };
32597
+ }
32598
+ function runPricingChoice(choices, run) {
32599
+ return choices[run.selectionId] ?? defaultRunPricingChoice(run);
32600
+ }
32601
+ /** Keeps the choices of runs still selected, so unticking a run forgets it. */
32602
+ function keepRunPricingChoices(choices, selection) {
32603
+ return Object.fromEntries(Object.entries(choices).filter(([id]) => selection.some((event) => event.selectionId === id)));
32604
+ }
32605
+ /** One run's price per place under its choice, or null while the choice is incomplete. */
32606
+ function runUnitPriceCents(run, choice) {
32607
+ const pricing = run.pricing;
32608
+ switch (pricing.kind) {
32609
+ case "free": return 0;
32610
+ case "single": return pricing.amount;
32611
+ case "sliding_scale": {
32612
+ const amount = parseCurrencyInputToCents(choice.slidingAmountInput);
32613
+ return amount !== null && amount >= pricing.minimum && amount <= pricing.maximum ? amount : null;
32614
+ }
32615
+ case "tiered": return pricing.options.find((option) => option.id === choice.pricingOptionId)?.priceAmount ?? null;
32616
+ case "external": return null;
32617
+ }
32618
+ }
32619
+ /**
32620
+ * Whether a run's choice can be booked. A ticket type passes the same rules
32621
+ * a single booking's ticket lines do (active, available in this way of
32622
+ * attending, enough places left), so a choice restored from an earlier visit
32623
+ * is checked again rather than trusted because its ID still exists.
32624
+ */
32625
+ function runChoiceUsable(run, choice, facts) {
32626
+ if (runUnitPriceCents(run, choice) === null) return false;
32627
+ if (run.pricing.kind !== "tiered") return true;
32628
+ const lines = [{
32629
+ pricingOptionId: choice.pricingOptionId,
32630
+ quantity: facts.places
32631
+ }];
32632
+ return hasValidPricingOptionSelection({
32633
+ selectionRequired: true,
32634
+ purpose: "book",
32635
+ maxTickets: facts.maxTickets,
32636
+ overallRemainingPlaces: getTicketSelectionRemainingPlaces({
32637
+ event: run,
32638
+ eligibility: null,
32639
+ attendanceMode: facts.attendanceMode
32640
+ }),
32641
+ lines,
32642
+ visibleOptions: getVisibleTicketTypes({
32643
+ event: run,
32644
+ eligibility: null,
32645
+ selectedAttendanceMode: facts.attendanceMode,
32646
+ ticketSelections: lines
32647
+ })
32648
+ });
32649
+ }
32650
+ /** The first run whose choice can't be booked yet, with why. */
32651
+ function incompleteRunChoiceMessage(input) {
32652
+ const incomplete = input.selection.find((run) => !runChoiceUsable(run, runPricingChoice(input.runChoices, run), input.facts));
32653
+ if (!incomplete) return null;
32654
+ const name = selectionItemName(incomplete, input.selection);
32655
+ return incomplete.pricing.kind === "tiered" ? `Choose a ticket for ${name}.` : `Choose an amount for ${name} within the sliding scale.`;
32656
+ }
32657
+ /**
32658
+ * How the visitor attends, decided once for the whole selection. One way of
32659
+ * attending applies to every item: the visitor picks from the ways every
32660
+ * item offers, and an item that only runs one way decides it. Items with no
32661
+ * way in common can't be booked together.
32662
+ */
32663
+ /**
32664
+ * What several runs still need before the tickets step can go on: one way
32665
+ * of attending for them all, then a usable ticket or amount for each run.
32666
+ */
32667
+ function severalRunsChoiceMessage(input) {
32668
+ if (input.attendance.kind === "incompatible") return INCOMPATIBLE_ATTENDANCE_MESSAGE;
32669
+ if (input.attendance.kind === "choose" && input.facts.attendanceMode === null) return "Choose whether you want to attend in person or online.";
32670
+ return incompleteRunChoiceMessage(input);
32671
+ }
32672
+ function selectionTicketInputs(input) {
32673
+ const priced = pricedTicketInputs(input);
32674
+ const ticketsCount = input.invitation.kind === "ready" ? input.invitation.restoration.ticketsCount : priced.usesTicketLines ? getTicketSelectionTotal(priced.lines) : input.placeCount;
32675
+ return {
32676
+ ...priced,
32677
+ ticketsCount
32678
+ };
32679
+ }
32680
+ function pricedTicketInputs(input) {
32681
+ if (input.several === "runs" && input.primary) {
32682
+ const choice = runPricingChoice(input.runChoices, input.primary);
32683
+ return {
32684
+ usesTicketLines: false,
32685
+ lines: [{
32686
+ pricingOptionId: choice.pricingOptionId,
32687
+ quantity: input.placeCount
32688
+ }],
32689
+ slidingAmountInput: choice.slidingAmountInput
32690
+ };
32691
+ }
32692
+ const tiered = input.primary ? publicEventPricingStrategy(input.primary.pricing) === "tiered" : input.lines.some((line) => line.pricingOptionId !== null);
32693
+ return {
32694
+ usesTicketLines: tiered,
32695
+ lines: tiered ? input.lines : [{
32696
+ pricingOptionId: null,
32697
+ quantity: input.placeCount
32698
+ }],
32699
+ slidingAmountInput: input.slidingAmountInput
32700
+ };
32701
+ }
32702
+ function planSelectionPrice(input) {
32703
+ const listTotalCents = selectionListTotalCents(input);
32704
+ const combination = input.several === null ? null : planSelectionCombination({
32705
+ offers: combinationOffersOf(input.selection),
32706
+ selection: input.selection,
32707
+ places: input.places,
32708
+ itemPrice: selectionItemPrice(input)
32709
+ });
32710
+ return planCombines(combination) ? {
32711
+ listTotalCents: combination.listTotalCents,
32712
+ totalCents: combination.totalCents,
32713
+ combination
32714
+ } : {
32715
+ listTotalCents,
32716
+ totalCents: listTotalCents,
32717
+ combination
32718
+ };
32719
+ }
32720
+ function publicSinglePriceCents(event, places) {
32721
+ const pricing = event?.pricing;
32722
+ if (pricing?.kind === "free") return 0;
32723
+ return pricing?.kind === "single" ? pricing.amount * places : null;
32724
+ }
32725
+ function selectionListTotalCents(input) {
32726
+ switch (input.several) {
32727
+ case null: return input.primarySubtotalCents;
32728
+ case "dates": {
32729
+ const each = input.primarySubtotalCents ?? publicSinglePriceCents(input.selection[0], input.places);
32730
+ return each === null ? null : each * input.selection.length;
32731
+ }
32732
+ case "runs": {
32733
+ const units = input.selection.map((run) => runUnitPriceCents(run, runPricingChoice(input.runChoices, run)));
32734
+ return units.every((unit) => unit !== null) ? units.reduce((total, unit) => total + unit * input.places, 0) : null;
32735
+ }
32736
+ }
32737
+ }
32738
+ function summariseSelectionPayment(input) {
32739
+ const { listTotalCents } = input.price;
32740
+ const { several, quote } = input;
32741
+ if (several === null || input.ready === false) return null;
32742
+ const combination = input.price.combination;
32743
+ return (combination ? summariseCombinedPayment({
32744
+ plan: combination,
32745
+ several,
32746
+ quote
32747
+ }) : null) ?? plainSelectionPayment({
32748
+ ...input,
32749
+ several,
32750
+ listTotalCents
32751
+ });
32752
+ }
32753
+ /** Several items without combination prices: each at its price, the places, any automatic code, the total. */
32754
+ function plainSelectionPayment(input) {
32755
+ const { several, quote, listTotalCents } = input;
32756
+ const lines = input.selection.map((event) => ({
32757
+ key: event.selectionId,
32758
+ label: selectionItemName(event, input.selection),
32759
+ price: itemPriceCents(input, event)
32760
+ }));
32761
+ const priced = lines.flatMap((line) => line.price === null ? [] : [{
32762
+ key: line.key,
32763
+ label: line.price.unitPriceCents === null ? `${line.label} (${countLabel(input.places, "place")})` : line.label,
32764
+ amountCents: line.price.unitPriceCents ?? line.price.subtotalCents
32765
+ }]);
32766
+ const totalCents = quote ? quote.preview.totalAfterDiscountCents : input.price.totalCents;
32767
+ if (priced.length !== lines.length || listTotalCents === null || totalCents === null) return null;
32768
+ return {
32769
+ kind: "plain",
32770
+ lines: priced,
32771
+ placesLabel: `${countLabel(input.places, "place")} on each ${several === "runs" ? "run" : "date"}`,
32772
+ subtotalCents: listTotalCents,
32773
+ reductions: quoteReductions(quote),
32774
+ totalCents
32775
+ };
32776
+ }
32777
+ /** The code's line, when it takes anything off. */
32778
+ function quoteReductions(quote) {
32779
+ if (!quote) return [];
32780
+ if (quote.preview.priceReductions) return quote.preview.priceReductions.map((row, index) => ({
32781
+ key: `reduction-${index}`,
32782
+ label: row.kind === "discount_code" ? quoteLineLabel(quote) : row.label,
32783
+ amountCents: row.amountCents
32784
+ }));
32785
+ return quote.preview.type === "applied" && quote.preview.discountCents > 0 ? [{
32786
+ key: "code",
32787
+ label: quoteLineLabel(quote),
32788
+ amountCents: quote.preview.discountCents
32789
+ }] : [];
32790
+ }
32791
+ /** Exact totals are never reconstructed from an average ticket price. */
32792
+ function itemPriceCents(input, event) {
32793
+ const unitPriceCents = input.several === "runs" ? runUnitPriceCents(event, runPricingChoice(input.runChoices, event)) : publicSinglePriceCents(event, 1);
32794
+ const subtotalCents = input.several === "runs" ? unitPriceCents === null ? null : unitPriceCents * input.places : input.primarySubtotalCents ?? publicSinglePriceCents(event, input.places);
32795
+ return subtotalCents === null ? null : {
32796
+ subtotalCents,
32797
+ unitPriceCents,
32798
+ ...input.several !== "runs" && input.primaryTicketUnits?.length ? { ticketUnits: input.primaryTicketUnits } : {}
32799
+ };
32800
+ }
32801
+ /** Exact item totals, with a unit price only when its places have one price. */
32802
+ function selectionItemPrice(input) {
32803
+ return (event) => itemPriceCents(input, event);
32804
+ }
32805
+ function decideSelectionPayment(input) {
32806
+ const several = severalItemsOf(input.selection);
32807
+ if (several === null) return { kind: "one-item" };
32808
+ return {
32809
+ kind: "several",
32810
+ due: selectionCostsNothing(several, input) ? "nothing" : "card"
32811
+ };
32812
+ }
32813
+ function selectionCostsNothing(several, input) {
32814
+ switch (several) {
32815
+ case "runs": return input.selection.every((run) => runUnitPriceCents(run, runPricingChoice(input.runChoices, run)) === 0);
32816
+ case "dates": {
32817
+ const first = input.selection[0];
32818
+ if (input.eligibility) return input.eligibility.isFree;
32819
+ return first !== void 0 && publicEventPricingType(first.pricing) === "free";
32820
+ }
32821
+ }
32822
+ }
32823
+ //#endregion
32824
+ //#region ../blocks/src/system/runtime/nodes/event-registration/selectionRequirements.state.ts
32825
+ const ONE = { kind: "one" };
32826
+ function decideSelectionRequirementsLayout(selection) {
32827
+ const [first, ...rest] = selection;
32828
+ if (severalItemsOf(selection) !== "runs" || first === void 0) return ONE;
32829
+ return areEventBookingRequirementsIdentical(selection.map((run) => ({
32830
+ consent: run.consent ?? null,
32831
+ bookingQuestions: run.bookingQuestions
32832
+ }))) ? {
32833
+ kind: "shared",
32834
+ source: first
32835
+ } : {
32836
+ kind: "per_run",
32837
+ runs: [first, ...rest]
32838
+ };
32839
+ }
32840
+ /**
32841
+ * Keeping earlier answers is offered only when every run offers it. Shared
32842
+ * questions are shown for one run, so they're always answered afresh (with
32843
+ * the earlier answers filled in); the server checks each run either way.
32844
+ */
32845
+ function withoutKeptAnswers(state) {
32846
+ const refreshed = state.refreshed;
32847
+ if (refreshed?.presentation.kind !== "already_answered") return state;
32848
+ const { set, answers } = refreshed.presentation;
32849
+ return {
32850
+ ...state,
32851
+ refreshed: {
32852
+ ...refreshed,
32853
+ presentation: {
32854
+ kind: "prefill",
32855
+ set,
32856
+ answers
32857
+ }
32858
+ }
32859
+ };
32860
+ }
32861
+ const runConsentAcceptanceSchema = z.object({
32862
+ requirementId: z.string().min(1),
32863
+ contentKey: z.string().min(1),
32864
+ owner: bookingQuestionsOwnerSchema
32865
+ });
32866
+ const NO_RUN_REQUIREMENTS = {};
32867
+ const EMPTY_RUN_ANSWERS = {
32868
+ questions: EMPTY_BOOKING_QUESTIONS_ANSWERS,
32869
+ consent: null,
32870
+ readFailedFor: null
32871
+ };
32872
+ function runAnswers(state, seriesId) {
32873
+ return state[seriesId] ?? EMPTY_RUN_ANSWERS;
32874
+ }
32875
+ function acceptanceOf(consent, identity) {
32876
+ return {
32877
+ requirementId: consent.requirementId,
32878
+ contentKey: eventBookingConsentContentKey(consent),
32879
+ owner: bookingQuestionsOwnerOf(identity)
32880
+ };
32881
+ }
32882
+ /** Whether a tick still stands for this run's agreement as it is now, and for this visitor. */
32883
+ function isRunConsentAccepted(acceptance, consent, identity) {
32884
+ if (!acceptance || !consent) return false;
32885
+ return acceptance.requirementId === consent.requirementId && acceptance.contentKey === eventBookingConsentContentKey(consent) && isBookingQuestionsOwner(acceptance.owner, identity);
32886
+ }
32887
+ function applyRunEvent(current, event) {
32888
+ switch (event.type) {
32889
+ case "consent-accepted": return {
32890
+ ...current,
32891
+ consent: acceptanceOf(event.consent, event.identity)
32892
+ };
32893
+ case "consent-withdrawn": return {
32894
+ ...current,
32895
+ consent: null
32896
+ };
32897
+ case "questions-read-failed": return {
32898
+ ...current,
32899
+ readFailedFor: event.identity
32900
+ };
32901
+ case "questions": {
32902
+ const questions = applyBookingQuestionsAnswerEvent(current.questions, event.event);
32903
+ const readAgain = event.event.type === "booking-questions-refreshed" || event.event.type === "booking-questions-keep-refused";
32904
+ return {
32905
+ ...current,
32906
+ questions,
32907
+ readFailedFor: readAgain ? null : current.readFailedFor
32908
+ };
32909
+ }
32910
+ }
32911
+ }
32912
+ function applyRunRequirementsEvent(state, seriesId, event) {
32913
+ return {
32914
+ ...state,
32915
+ [seriesId]: applyRunEvent(runAnswers(state, seriesId), event)
32916
+ };
32917
+ }
32918
+ function deriveRunRequirements(state, runs, identity) {
32919
+ return runs.map((run) => {
32920
+ const answers = runAnswers(state, run.seriesId);
32921
+ const consent = run.consent ?? null;
32922
+ return {
32923
+ run,
32924
+ questions: deriveBookingQuestions(answers.questions, runQuestionsTarget(run), identity),
32925
+ consent,
32926
+ consentAccepted: isRunConsentAccepted(answers.consent, consent, identity)
32927
+ };
32928
+ });
32929
+ }
32930
+ /**
32931
+ * The next run whose signed-in read is still owed: the first that needs one
32932
+ * and hasn't already failed for this identity. Null when none is owed.
32933
+ */
32934
+ function nextRunToRead(state, runs, identity) {
32935
+ return runs.find((run) => {
32936
+ const answers = runAnswers(state, run.seriesId);
32937
+ return answers.readFailedFor !== identity && needsBookingQuestionsRefresh({
32938
+ target: runQuestionsTarget(run),
32939
+ identity,
32940
+ refreshed: answers.questions.refreshed
32941
+ });
32942
+ })?.seriesId ?? null;
32943
+ }
32944
+ /**
32945
+ * The server refused "keep my earlier answers" for a booking of several runs.
32946
+ * Its refusal doesn't say which run, so every run that chose to keep its
32947
+ * answers is asked afresh.
32948
+ */
32949
+ function runsKeepingAnswers(runs) {
32950
+ return runs.filter((view) => view.questions.submission?.kind === "keep_existing");
32951
+ }
32952
+ function runQuestionsTarget(run) {
32953
+ return {
32954
+ targetKey: run.seriesId,
32955
+ publicPresentation: run.bookingQuestions
32956
+ };
32957
+ }
32958
+ /** The agreement is pinned to the attachment and the exact words shown. */
32959
+ function runSubmission(consent, consentAccepted, questions) {
32960
+ return {
32961
+ ...questions ? { bookingQuestions: questions } : {},
32962
+ ...consent ? { consent: {
32963
+ requirementId: consent.requirementId,
32964
+ contentKey: eventBookingConsentContentKey(consent),
32965
+ accepted: consentAccepted
32966
+ } } : {}
32967
+ };
32968
+ }
32969
+ /**
32970
+ * What a runs selection sends for its questions and agreement; nothing for
32971
+ * `one`, which keeps the request a single booking has always sent.
32972
+ */
32973
+ function buildSelectionRequirementsSubmission(input) {
32974
+ const { layout } = input;
32975
+ switch (layout.kind) {
32976
+ case "one": return;
32977
+ case "shared": return {
32978
+ kind: "shared",
32979
+ sourceEventSeriesId: layout.source.seriesId,
32980
+ submission: runSubmission(layout.source.consent ?? null, input.shared.consentAccepted, input.shared.questions)
32981
+ };
32982
+ case "per_run": return {
32983
+ kind: "per_run",
32984
+ bySeriesId: Object.fromEntries(input.runs.map((view) => [view.run.seriesId, runSubmission(view.consent, view.consentAccepted, view.questions.submission)]))
32985
+ };
32986
+ }
32987
+ }
32988
+ /** Field errors for one run's questions are kept apart, since two runs can share field IDs. */
32989
+ function runFieldErrorKey(seriesId, fieldId) {
32990
+ return `${seriesId}:${fieldId}`;
32991
+ }
32992
+ /**
32993
+ * One run's field errors: its own, plus any the server named by field alone
32994
+ * for a question this run asks.
32995
+ */
32996
+ function runFieldErrors(errors, seriesId, presentation) {
32997
+ const fieldIds = presentation.kind === "none" || presentation.kind === "unavailable" ? [] : presentation.set.sections.flatMap((section) => section.items.map((field) => field.id));
32998
+ return Object.fromEntries(fieldIds.flatMap((fieldId) => {
32999
+ const message = errors[runFieldErrorKey(seriesId, fieldId)] ?? errors[fieldId];
33000
+ return message === void 0 ? [] : [[fieldId, message]];
33001
+ }));
33002
+ }
33003
+ const RUN_CONSENT_REQUIRED_MESSAGE = "Please read and accept the agreement before continuing.";
33004
+ /**
33005
+ * Every run's questions and agreement before the details step moves on. A
33006
+ * run whose questions can't be shown stops the booking; otherwise each
33007
+ * unanswered question and unticked agreement is pointed at.
33008
+ */
33009
+ function checkRunRequirements(runs) {
33010
+ const checks = runs.map((view) => ({
33011
+ seriesId: view.run.seriesId,
33012
+ check: checkBookingQuestionsAnswered(view.questions)
33013
+ }));
33014
+ const refused = checks.find((entry) => entry.check.kind === "refused")?.check;
33015
+ const unanswered = checks.flatMap(({ seriesId, check }) => check.kind === "unanswered" ? [{
33016
+ message: check.message,
33017
+ fieldErrors: Object.entries(check.fieldErrors).map(([fieldId, message]) => [runFieldErrorKey(seriesId, fieldId), message])
33018
+ }] : []);
33019
+ const first = unanswered[0];
33020
+ return {
33021
+ questions: refused ?? (first ? {
33022
+ kind: "unanswered",
33023
+ message: first.message,
33024
+ fieldErrors: Object.fromEntries(unanswered.flatMap((entry) => entry.fieldErrors))
33025
+ } : { kind: "ok" }),
33026
+ consentErrors: Object.fromEntries(runs.flatMap((view) => view.consent && !view.consentAccepted ? [[view.run.seriesId, RUN_CONSENT_REQUIRED_MESSAGE]] : []))
33027
+ };
33028
+ }
33029
+ /** Entries saved before a tick named its agreement carry only a boolean, which is dropped: the box comes back unticked. */
33030
+ const runRequirementsSnapshotSchema = z.object({
33031
+ bookingQuestions: bookingQuestionsPaymentSnapshotSchema.optional(),
33032
+ consent: z.optional(runConsentAcceptanceSchema)
33033
+ });
33034
+ function toRunRequirementsSnapshots(state, runs) {
33035
+ return Object.fromEntries(runs.map((view) => {
33036
+ const questions = toBookingQuestionsPaymentSnapshot(view.questions);
33037
+ const consent = view.consentAccepted ? runAnswers(state, view.run.seriesId).consent : null;
33038
+ return [view.run.seriesId, {
33039
+ ...questions ? { bookingQuestions: questions } : {},
33040
+ ...consent ? { consent } : {}
33041
+ }];
33042
+ }));
33043
+ }
33044
+ /** Each run's answers come back only for whoever started the checkout, as a single booking's do. */
33045
+ function decideRunRequirementsRestoration(snapshots, currentIdentity) {
33046
+ return Object.fromEntries(Object.entries(snapshots).map(([seriesId, snapshot]) => [seriesId, {
33047
+ questions: snapshot.bookingQuestions ? decideBookingQuestionsRestoration({
33048
+ kind: "payment_snapshot",
33049
+ snapshot: snapshot.bookingQuestions,
33050
+ currentIdentity
33051
+ }) : null,
33052
+ consent: snapshot.consent ?? null
33053
+ }]));
33054
+ }
33055
+ function restoreRunRequirements(state, restoration) {
33056
+ return Object.entries(restoration).reduce((restored, [seriesId, run]) => {
33057
+ const current = runAnswers(restored, seriesId);
33058
+ return {
33059
+ ...restored,
33060
+ [seriesId]: {
33061
+ ...current,
33062
+ questions: restoreBookingQuestionsAnswers(current.questions, run.questions),
33063
+ consent: run.consent
33064
+ }
33065
+ };
33066
+ }, state);
33067
+ }
33068
+ /** Each run's answers in progress, kept in the sign-in draft. The agreement is ticked again, as a single booking's is. */
33069
+ function toRunQuestionsSignInDrafts(state) {
33070
+ return Object.fromEntries(Object.entries(state).map(([seriesId, answers]) => [seriesId, toBookingQuestionsAnswerDraft(answers.questions)]));
33071
+ }
33072
+ /** Each run's answers come back through the same verified decision as a single booking's. */
33073
+ function decideRunSignInRestoration(drafts, verifiedIdentity) {
33074
+ return Object.fromEntries(Object.entries(drafts).map(([seriesId, draft]) => [seriesId, {
33075
+ questions: decideBookingQuestionsRestoration({
33076
+ kind: "sign_in_draft",
33077
+ draft,
33078
+ verifiedIdentity
33079
+ }),
33080
+ consent: null
33081
+ }]));
33082
+ }
33083
+ //#endregion
33084
+ //#region ../blocks/src/system/runtime/nodes/event-registration/registrationPaymentReturn.ts
33085
+ /**
33086
+ * How a saved checkout lands once the page's events are ready. Its answers
33087
+ * come back only for the session (or signed-out visitor) that started it.
33088
+ */
33089
+ function paymentReturnRestoration(pending, events, currentIdentity) {
33090
+ return {
33091
+ selection: findSelection(pending.selectedEventIds, events),
33092
+ runChoices: pending.runChoices ?? NO_RUN_PRICING_CHOICES,
33093
+ ticketLines: pending.ticketSelections,
33094
+ placeCount: getTicketSelectionTotal(pending.ticketSelections),
33095
+ formData: pending.formData,
33096
+ guests: pending.guests,
33097
+ slidingAmountInput: pending.selectedSlidingAmount === null ? "" : formatCentsAsCurrencyInput(pending.selectedSlidingAmount),
33098
+ attendanceMode: pending.selectedAttendanceMode ?? null,
33099
+ paymentSelection: pending.paymentSelection,
33100
+ questions: pending.bookingQuestions ? decideBookingQuestionsRestoration({
33101
+ kind: "payment_snapshot",
33102
+ snapshot: pending.bookingQuestions,
33103
+ currentIdentity
33104
+ }) : null,
33105
+ runRequirements: decideRunRequirementsRestoration(pending.runRequirements ?? {}, currentIdentity)
33106
+ };
33107
+ }
33108
+ /** Every saved item found again, in order, or none. */
33109
+ function findSelection(ids, events) {
33110
+ const found = ids.flatMap((id) => events.filter((event) => event.selectionId === id).slice(0, 1));
33111
+ return found.length === ids.length ? found : [];
33112
+ }
33113
+ //#endregion
33114
+ //#region ../blocks/src/system/runtime/nodes/event-registration/registrationSignInReturn.ts
33115
+ /**
33116
+ * What event registration keeps while the booker follows a sign-in link, so
33117
+ * they come back to the same step with what they'd typed. The storage, nonce
33118
+ * and return address are shared with the appointment booking form
33119
+ * (`shared/signInReturnDrafts.ts`, owned by `useSignInReturn`); this file owns
33120
+ * the event draft and how it's put back.
33121
+ */
33122
+ /** Steps a draft can bring the booker back to; payment and later are never resumed this way. */
33123
+ const RESUMABLE_STEPS = [
33124
+ "select-event",
33125
+ "select-tickets",
33126
+ "enter-details",
33127
+ "select-payment"
33128
+ ];
33129
+ /** Drafts saved before booking several existed name one event (or none). */
33130
+ const savedSelection = z.union([z.object({
33131
+ selectedEventIds: z.array(z.string()),
33132
+ runChoices: z.record(z.string(), z.object({
33133
+ pricingOptionId: z.string().nullable(),
33134
+ slidingAmountInput: z.string()
33135
+ }))
33136
+ }), z.object({ selectedEventId: z.string().nullable() }).transform(({ selectedEventId }) => ({
33137
+ selectedEventIds: selectedEventId === null ? [] : [selectedEventId],
33138
+ runChoices: NO_RUN_PRICING_CHOICES
33139
+ }))]);
33140
+ const draftFields = z.object({
33141
+ nonce: z.string().min(1),
33142
+ email: z.string(),
33143
+ step: z.enum(RESUMABLE_STEPS),
33144
+ selectedAttendanceMode: z.enum(["in_person", "online"]).nullable(),
33145
+ ticketSelections: z.array(z.object({
33146
+ pricingOptionId: z.string().nullable(),
33147
+ quantity: z.number().int().positive()
33148
+ })),
33149
+ ticketsCount: z.number().int().positive(),
33150
+ selectedSlidingAmountInput: z.string(),
33151
+ formData: z.object({
33152
+ name: z.string(),
33153
+ email: z.string(),
33154
+ phone: z.string(),
33155
+ notes: z.string(),
33156
+ mailingListOptIn: z.boolean().optional()
33157
+ }),
33158
+ guests: z.array(z.object({
33159
+ name: z.string(),
33160
+ email: z.string().nullable(),
33161
+ phone: z.string().nullable()
33162
+ })),
33163
+ discountCode: z.string(),
33164
+ questions: bookingQuestionsAnswerDraftSchema,
33165
+ runQuestions: z.record(z.string(), bookingQuestionsAnswerDraftSchema).default({})
33166
+ });
33167
+ /** Event registration's drafts, for the shared `useSignInReturn` owner. */
33168
+ const eventSignInDraftStore = createSignInReturnDraftStore(z.intersection(draftFields, savedSelection).transform((draft) => draft));
33169
+ /** The flow's key in sign-in storage: one registration surface per page. */
33170
+ const EVENT_SIGN_IN_FORM_ID = "event-registration";
33171
+ function resumableStep(step) {
33172
+ return RESUMABLE_STEPS.includes(step) ? step : "enter-details";
33173
+ }
33174
+ function toEventSignInDraft(source, attempt) {
33175
+ const { flow } = source;
33176
+ const { draft } = flow;
33177
+ const { consentAccepted: _consent, ...formData } = draft.formData;
33178
+ return {
33179
+ nonce: attempt.nonce,
33180
+ email: attempt.email,
33181
+ step: resumableStep(flow.step),
33182
+ selectedEventIds: draft.selection.map((event) => event.selectionId),
33183
+ runChoices: draft.runChoices,
33184
+ selectedAttendanceMode: draft.selectedAttendanceMode,
33185
+ ticketSelections: draft.selectedTicketLines,
33186
+ ticketsCount: flow.placeCount,
33187
+ selectedSlidingAmountInput: draft.selectedSlidingAmountInput,
33188
+ formData,
33189
+ guests: draft.guests,
33190
+ discountCode: source.discountCode,
33191
+ questions: toBookingQuestionsAnswerDraft(draft.bookingQuestions),
33192
+ runQuestions: toRunQuestionsSignInDrafts(draft.runRequirements)
33193
+ };
33194
+ }
33195
+ const HANDED_ON = [
33196
+ "success",
33197
+ "payment",
33198
+ "verifying-payment",
33199
+ "verifying-timeout",
33200
+ "payment-status"
33201
+ ];
33202
+ /**
33203
+ * A booking that's confirmed or has gone to checkout ends every draft. Picking
33204
+ * another event doesn't: the draft follows what the booker is doing.
33205
+ */
33206
+ function eventSignInEnds(previous, next) {
33207
+ return HANDED_ON.includes(next.flow.step) && !HANDED_ON.includes(previous.flow.step) ? "finished" : null;
33208
+ }
33209
+ /**
33210
+ * How a returned draft lands once `useSignInReturn` has matched it to the
33211
+ * signed-in profile and the page's events have loaded.
33212
+ */
33213
+ function eventSignInRestoration(draft, events, verifiedIdentity) {
33214
+ const selection = findSelection(draft.selectedEventIds, events);
33215
+ return {
33216
+ draft,
33217
+ selection,
33218
+ selectionFound: draft.selectedEventIds.length === selection.length,
33219
+ questions: decideBookingQuestionsRestoration({
33220
+ kind: "sign_in_draft",
33221
+ draft: draft.questions,
33222
+ verifiedIdentity
33223
+ }),
33224
+ runRequirements: decideRunSignInRestoration(draft.runQuestions, verifiedIdentity)
33225
+ };
33226
+ }
33227
+ /**
33228
+ * Puts the booker's draft back. Details and answers always return; the event
33229
+ * choice, tickets and step only when that event is still offered and no
33230
+ * waiting-list invitation owns the selection.
33231
+ */
33232
+ /** What the booker typed comes back; a blank field never erases details already filled in. */
33233
+ function restoredFormData(current, saved) {
33234
+ const typed = Object.fromEntries(Object.entries(saved).filter(([, value]) => typeof value !== "string" || value.trim() !== ""));
33235
+ return {
33236
+ ...current,
33237
+ ...typed,
33238
+ consentAccepted: false
33239
+ };
33240
+ }
33241
+ function restoreEventSignInDraft(state, restoration) {
33242
+ const { draft } = restoration;
33243
+ const details = {
33244
+ ...state.draft,
33245
+ formData: restoredFormData(state.draft.formData, draft.formData),
33246
+ guests: draft.guests.map((guest) => ({ ...guest })),
33247
+ bookingQuestions: restoreBookingQuestionsAnswers(state.draft.bookingQuestions, restoration.questions),
33248
+ runRequirements: restoreRunRequirements(state.draft.runRequirements, restoration.runRequirements)
33249
+ };
33250
+ if (!restoration.selectionFound || state.invitation.kind !== "none") return {
33251
+ ...state,
33252
+ draft: details
33253
+ };
33254
+ return {
33255
+ ...state,
33256
+ step: draft.step,
33257
+ placeCount: draft.ticketsCount,
33258
+ draft: {
33259
+ ...details,
33260
+ selection: restoration.selection.length > 0 ? restoration.selection : state.draft.selection,
33261
+ runChoices: draft.runChoices,
33262
+ selectedAttendanceMode: draft.selectedAttendanceMode,
33263
+ selectedTicketLines: draft.ticketSelections.map((line) => ({ ...line })),
33264
+ selectedSlidingAmountInput: draft.selectedSlidingAmountInput
33265
+ }
33266
+ };
33267
+ }
33268
+ //#endregion
33269
+ //#region ../blocks/src/system/runtime/shared/bookingPaymentOptionCopy.ts
33270
+ function buildUpfrontBookingPaymentOptionCopy(formattedTotal) {
33271
+ return {
33272
+ title: "Pay in full",
33273
+ description: "Pay everything today and your booking is confirmed.",
33274
+ ctaLabel: `Pay ${formattedTotal} now`
33275
+ };
33276
+ }
33277
+ /** Reused after booking; payment remains outside the platform. */
33278
+ const OFFLINE_BOOKING_PAYMENT_INSTRUCTIONS = "Pay the business later, outside the platform.";
33279
+ function buildDeferredManualBookingPaymentOptionCopy() {
33280
+ return {
33281
+ title: "Pay offline",
33282
+ description: `Book now and ${OFFLINE_BOOKING_PAYMENT_INSTRUCTIONS.toLowerCase()}`,
33283
+ helperText: "Nothing is due today.",
33284
+ ctaLabel: "Book now"
33285
+ };
33286
+ }
33287
+ function buildInstalmentBookingPaymentOptionCopy(input) {
33288
+ return {
33289
+ title: "Payment plan",
33290
+ description: describeInstalmentPlanCopy(input),
33291
+ helperText: input.futurePaymentCount > 0 ? "You can pay the rest early any time in your customer portal." : void 0,
33292
+ ctaLabel: `Pay ${input.formattedDueToday} now`
33293
+ };
33294
+ }
33295
+ function describeInstalmentPlanCopy(input) {
33296
+ if (input.futurePaymentCount === 0) {
33297
+ const depositPolicy = input.depositRefundability ? ` Your deposit is ${formatDepositRefundabilityLabel(input.depositRefundability)}.` : "";
33298
+ return `Pay ${input.formattedDueToday} today.${depositPolicy}`;
33299
+ }
33300
+ if (input.depositRefundability) return `Pay ${input.formattedDueToday} today, then continue with scheduled payments. Your deposit is ${formatDepositRefundabilityLabel(input.depositRefundability)}.`;
33301
+ if (input.futurePaymentCount === 1) return `Pay ${input.formattedDueToday} today, then one more payment later.`;
33302
+ const formattedFirstFuture = input.formattedFirstFuture ?? input.formattedDueToday;
33303
+ return `Pay ${input.formattedDueToday} today, then ${input.futurePaymentCount} more ${input.cadenceLabel} payments from ${formattedFirstFuture}.`;
33304
+ }
33305
+ function buildFlexibleBalanceBookingPaymentOptionCopy(input) {
33306
+ return {
33307
+ title: "Deposit now, pay the rest later",
33308
+ description: `Pay ${input.formattedDueToday} today, then pay the remaining balance any time before ${input.dueDateLabel}. Your deposit is ${formatDepositRefundabilityLabel(input.depositRefundability)}.`,
33309
+ helperText: "You can return in your customer portal to pay the rest before the due date.",
33310
+ ctaLabel: `Pay ${input.formattedDueToday} now`
33311
+ };
33312
+ }
33313
+ function formatDepositRefundabilityLabel(depositRefundability) {
33314
+ return depositRefundability === "non_refundable" ? "non-refundable" : "refundable";
33315
+ }
33316
+ /** Configured cadence for the existing instalment description. */
33317
+ function buildBookingInstalmentCadenceLabel(plan) {
33318
+ const interval = getBookingInstalmentPlanIntervalCount(plan);
33319
+ const unit = interval === 1 ? plan.intervalUnit : `${plan.intervalUnit}s`;
33320
+ return interval === 1 ? unit : `every ${interval} ${unit}`;
33321
+ }
33322
+ //#endregion
33323
+ //#region ../blocks/src/system/runtime/nodes/event-registration/bookingCalendar.ts
33324
+ /** Public schedule plus the authorised outcome's arrival text; online access stays in email. */
33325
+ function bookingCalendar(event, outcome) {
33326
+ if (!event) return null;
33327
+ const { identity } = outcome;
33328
+ const sessions = event.registrationSubject.kind === "wholeSeries" ? event.registrationSubject.sessions : [{
33329
+ occurrenceId: event.registrationSubject.occurrenceId,
33330
+ startsAt: event.startsAt,
33331
+ endsAt: event.endsAt
33332
+ }];
33333
+ const bookingId = identity.scope === "occurrence" ? identity.attendeeId : identity.registrationId;
33334
+ const entries = sessions.map((session) => ({
33335
+ uid: `booking-${bookingId}-${session.occurrenceId}@riverbankcms.com`,
33336
+ sequence: 0,
33337
+ title: event.title,
33338
+ startsAt: new Date(session.startsAt),
33339
+ endsAt: new Date(session.endsAt),
33340
+ timezone: "UTC",
33341
+ status: "confirmed",
33342
+ location: identity.attendanceMode === "online" ? "Online" : outcome.arrivalVenues?.[session.occurrenceId] ?? event.venue?.name,
33343
+ description: identity.attendanceMode === "online" ? "See your confirmation email for joining instructions." : void 0
33344
+ }));
33345
+ const first = entries[0];
33346
+ if (!first) return null;
33347
+ const common = {
33348
+ fileName: `${slugify(event.title) || "event"}.ics`,
33349
+ feed: {
33350
+ timezone: "UTC",
33351
+ entries
33352
+ }
33353
+ };
33354
+ return entries.length === 1 ? {
33355
+ ...common,
33356
+ kind: "single",
33357
+ ...calendarLinks(first)
33358
+ } : {
33359
+ ...common,
33360
+ kind: "sessions",
33361
+ sessionCount: entries.length
33362
+ };
33363
+ }
33364
+ //#endregion
33365
+ //#region ../blocks/src/system/runtime/nodes/event-registration/registrationEventAdapter.ts
33366
+ function toRegistrationEvent(event) {
33367
+ return {
33368
+ ...event,
33369
+ selectionId: event.id,
33370
+ registrationSubject: {
33371
+ kind: "occurrence",
33372
+ occurrenceId: event.occurrenceId
33373
+ }
33374
+ };
33375
+ }
33376
+ function toRegistrationEvents(events) {
33377
+ return events.filter((event) => event.bookingScope === "single_occurrence").map(toRegistrationEvent);
33378
+ }
33379
+ /**
33380
+ * Project one whole-series run onto the registration surface.
33381
+ *
33382
+ * Capacity, pricing, payment terms and consent come straight off the canonical
33383
+ * Event record; only the schedule is widened from the single occurrence to the
33384
+ * live run. A run without live sessions has no registration event.
33385
+ */
33386
+ function toWholeSeriesRegistrationEvent(group) {
33387
+ const { representative, run } = group;
33388
+ const sessions = orderedLiveRunSessions(run.sessions);
33389
+ const firstSession = sessions[0];
33390
+ if (!firstSession) return null;
33391
+ const lastSession = sessions[sessions.length - 1] ?? firstSession;
33392
+ return {
33393
+ ...representative,
33394
+ selectionId: run.eventSeriesId,
33395
+ registrationSubject: {
33396
+ kind: "wholeSeries",
33397
+ eventSeriesId: run.eventSeriesId,
33398
+ eventOfferingId: run.eventOfferingId,
33399
+ sessions
33400
+ },
33401
+ startsAt: firstSession.startsAt,
33402
+ endsAt: lastSession.endsAt,
33403
+ timeZone: firstSession.timeZone
33404
+ };
33405
+ }
33406
+ function toWholeSeriesRegistrationEvents(events) {
33407
+ return groupPublicEventsByRun(events).map(toWholeSeriesRegistrationEvent).filter((event) => event !== null);
33408
+ }
33409
+ /** An occurrence-page context must not replace a whole run's booking start. */
33410
+ function getRegistrationStartAt(event, occurrenceContext) {
33411
+ return event?.registrationSubject.kind === "wholeSeries" ? event.startsAt : occurrenceContext?.startsAt ?? event?.startsAt;
33412
+ }
33413
+ /** Confirmation identifies its persisted subject, independently of the current draft. */
33414
+ function findBookedEvent(events, identity) {
33415
+ return events.find((event) => identity.scope === "occurrence" ? event.seriesId === identity.seriesId && event.registrationSubject.kind === "occurrence" && event.registrationSubject.occurrenceId === identity.occurrenceId : event.registrationSubject.kind === "wholeSeries" && event.registrationSubject.eventSeriesId === identity.seriesId) ?? null;
33416
+ }
33417
+ //#endregion
31355
33418
  //#region ../blocks/src/system/runtime/nodes/event-registration/finishedBooking.ts
31356
33419
  /**
31357
33420
  * What a finished booking says, decided once (issue 1581).
@@ -31469,7 +33532,15 @@ function completedBookingPlaces(outcomes, identity) {
31469
33532
  return total === null || quantity === null ? null : total + quantity;
31470
33533
  }, 0);
31471
33534
  }
33535
+ /** Every booking a confirmation covers, in order: several when booked together, otherwise the one. */
33536
+ function confirmedOutcomes(result) {
33537
+ return result.outcomes && result.outcomes.length > 0 ? result.outcomes : [result.outcome];
33538
+ }
31472
33539
  function bookedBooking(result, context) {
33540
+ const outcomes = confirmedOutcomes(result);
33541
+ return outcomes.length > 1 ? severalBookings(result, outcomes, context) : oneBooking(result, context);
33542
+ }
33543
+ function oneBooking(result, context) {
31473
33544
  const { identity } = result.outcome;
31474
33545
  const event = findBookedEvent(context.events, identity);
31475
33546
  const dates = entryFacts(event);
@@ -31489,7 +33560,67 @@ function bookedBooking(result, context) {
31489
33560
  ...facts.rows
31490
33561
  ],
31491
33562
  payment: facts.payment,
31492
- calendar: bookingCalendar(event, result.outcome)
33563
+ calendar: bookingCalendar(event, result.outcome),
33564
+ several: null
33565
+ };
33566
+ }
33567
+ /**
33568
+ * Several bookings made together: a line for each, in order, then the places
33569
+ * each one has and what was paid in all. The finished card and bar keep the
33570
+ * first booking's facts; there's no single calendar entry for them all.
33571
+ */
33572
+ function severalBookings(result, outcomes, context) {
33573
+ const several = outcomes[0]?.identity.scope === "occurrence" ? "dates" : "runs";
33574
+ const items = outcomes.flatMap((outcome) => {
33575
+ const event = findBookedEvent(context.events, outcome.identity);
33576
+ return event ? [bookedItemRow(several, event)] : [];
33577
+ });
33578
+ return {
33579
+ entry: oneBooking(result, context).entry,
33580
+ summary: [...items, ...placesOnEachRow(several, outcomes)],
33581
+ payment: severalPayment(outcomes),
33582
+ calendar: null,
33583
+ several
33584
+ };
33585
+ }
33586
+ /** Runs by name and dates; dates by day, both with their times. */
33587
+ function bookedItemRow(several, event) {
33588
+ return several === "runs" ? {
33589
+ label: event.title,
33590
+ value: formatRegistrationSchedule(event) ?? ""
33591
+ } : {
33592
+ label: formatBookingWhen(event, "dayLong"),
33593
+ value: formatBookingWhen(event, "timeRange")
33594
+ };
33595
+ }
33596
+ /** Every booking has the same places; said only when there's more than one. */
33597
+ function placesOnEachRow(several, outcomes) {
33598
+ const first = outcomes[0];
33599
+ const places = first?.kind === "detailsAvailable" ? deriveTotalTicketQuantity(first.ticketLines) : null;
33600
+ return places !== null && places > 1 ? [{
33601
+ label: "Places",
33602
+ value: `${places} on each ${several === "runs" ? "run" : "date"}`
33603
+ }] : [];
33604
+ }
33605
+ /**
33606
+ * What several bookings cost together. They're always paid up front by card
33607
+ * or free, so anything else (or a booking whose details didn't load) shows
33608
+ * no payment rather than a partial sum.
33609
+ */
33610
+ function severalPayment(outcomes) {
33611
+ const payments = outcomes.flatMap((outcome) => outcome.kind === "detailsAvailable" ? [outcome.payment] : []);
33612
+ if (payments.length !== outcomes.length) return { kind: "none" };
33613
+ const paid = payments.flatMap((payment) => payment.kind === "monetary" && payment.balance.kind === "settled" ? [payment] : []);
33614
+ const free = payments.filter((payment) => payment.kind === "free" || payment.kind === "waived");
33615
+ const currency = paid[0]?.currency;
33616
+ if (paid.length + free.length !== payments.length || paid.some((payment) => payment.currency !== currency)) return { kind: "none" };
33617
+ const total = paid.reduce((sum, payment) => sum + payment.amountPaidCents, 0);
33618
+ return {
33619
+ kind: "settled",
33620
+ rows: currency && total > 0 ? [{
33621
+ label: "Paid",
33622
+ value: formatPrice(total, currency)
33623
+ }] : []
31493
33624
  };
31494
33625
  }
31495
33626
  function waitlistedBooking(context) {
@@ -31502,7 +33633,8 @@ function waitlistedBooking(context) {
31502
33633
  },
31503
33634
  summary: scheduleRows(event, dates.shortWhen, "venue", context.display),
31504
33635
  payment: { kind: "none" },
31505
- calendar: null
33636
+ calendar: null,
33637
+ several: null
31506
33638
  };
31507
33639
  }
31508
33640
  /**
@@ -31553,103 +33685,19 @@ function registrationQuestionsMessage(questionFieldErrors, errorMessage) {
31553
33685
  return Object.keys(questionFieldErrors).length > 0 ? errorMessage : "";
31554
33686
  }
31555
33687
  //#endregion
31556
- //#region ../blocks/src/system/runtime/nodes/event-registration/registrationWizardContext.ts
31557
- function getEventSelectionDefaults(event) {
31558
- const suggestedAmount = getSlidingScaleForEvent(event)?.suggestedAmount;
31559
- return {
31560
- slidingAmountInput: suggestedAmount == null ? "" : formatCentsAsCurrencyInput(suggestedAmount),
31561
- attendanceMode: event.deliveryMode === "hybrid" ? null : event.deliveryMode ?? "in_person"
31562
- };
31563
- }
31564
- function parseCurrencyInputToCents(value) {
31565
- const trimmed = value.trim();
31566
- if (!trimmed) return null;
31567
- const amount = Number(trimmed);
31568
- return Number.isFinite(amount) && amount >= 0 ? Math.round(amount * 100) : null;
31569
- }
31570
- function getSlidingScaleForEvent(event) {
31571
- const pricing = event?.pricing ?? null;
31572
- return pricing?.kind === "sliding_scale" ? {
31573
- minAmount: pricing.minimum,
31574
- maxAmount: pricing.maximum,
31575
- suggestedAmount: pricing.suggested
31576
- } : null;
31577
- }
31578
- function getSlidingScaleSelectionMessage(input) {
31579
- if (!input.slidingScale) return null;
31580
- if (input.selectedAmount === null) return "Choose an amount to continue.";
31581
- const { minAmount, maxAmount } = input.slidingScale;
31582
- return input.selectedAmount < minAmount || input.selectedAmount > maxAmount ? "Choose an amount within the sliding scale." : null;
31583
- }
31584
- function getRegistrationOccurrenceId(target) {
31585
- return target?.subject.kind === "occurrence" ? target.subject.occurrenceId : "";
31586
- }
31587
- function shouldLoadRegistrationOptions(authState, step) {
31588
- return authState === "authenticated" || step === "select-tickets" || step === "enter-details" || step === "select-payment";
31589
- }
31590
- function getEligibilityFlowFlags(input) {
31591
- const hasPass = (input.eligibility?.eligiblePasses.length ?? 0) > 0;
31592
- const hasMembership = (input.eligibility?.eligibleMemberships.length ?? 0) > 0;
31593
- return {
31594
- hasEligibility: hasPass || hasMembership,
31595
- hasMembershipEligibility: hasMembership,
31596
- isMembershipFastTrack: input.portalAuthState === "authenticated" && hasMembership && input.ticketsCount === 1 && input.paymentMethod === "membership"
31597
- };
31598
- }
31599
- /** Prefer refreshed capacity, including a known zero; fall back while options load. */
31600
- function getTicketSelectionRemainingPlaces(input) {
31601
- const availability = input.eligibility?.availability;
31602
- if (availability && "remainingPlaces" in availability) return availability.remainingPlaces ?? null;
31603
- return input.event ? getEventAvailability(selectEventCapacitySource(input.event, input.attendanceMode)).available : null;
31604
- }
31605
- /** Keep the card and ticket step on the same fresh capacity as admission. */
31606
- function withRegistrationAvailability(event, eligibility, attendanceMode) {
31607
- const availability = eligibility?.availability;
31608
- if (!event || !availability || !("remainingPlaces" in availability)) return event;
31609
- const mode = attendanceMode ?? (event.deliveryMode === "hybrid" ? null : event.deliveryMode ?? "in_person");
31610
- if (!mode) return event;
31611
- const source = selectEventCapacitySource(event, mode);
31612
- const remaining = availability.remainingPlaces ?? null;
31613
- const refreshed = {
31614
- capacity: remaining === null ? null : source.capacity ?? remaining,
31615
- availableSpots: remaining,
31616
- waitlistEnabled: availability.waitlistEnabled
31617
- };
31618
- return {
31619
- ...event,
31620
- ...event.deliveryMode === "hybrid" ? {} : refreshed,
31621
- attendanceModes: event.attendanceModes?.map((row) => row.mode === mode ? {
31622
- ...row,
31623
- ...refreshed
31624
- } : row)
31625
- };
31626
- }
31627
- function resolveHeldTicketPlaces(current, invitation, paymentHold) {
31628
- return getHeldPlacesBySelection(current, invitation.kind === "ready" ? {
31629
- selectionId: invitation.restoration.event?.selectionId ?? current.selectionId,
31630
- attendanceMode: invitation.restoration.attendanceMode,
31631
- lines: invitation.restoration.ticketSelections
31632
- } : paymentHold);
31633
- }
31634
- function getCurrentTicketSelection(event, attendanceMode, lines) {
31635
- return {
31636
- selectionId: event?.selectionId ?? null,
31637
- attendanceMode,
31638
- lines
31639
- };
31640
- }
31641
- //#endregion
31642
33688
  //#region ../blocks/src/system/runtime/nodes/event-registration/registrationDraft.state.ts
31643
33689
  function createRegistrationDraftData(event) {
31644
33690
  const defaults = event ? getEventSelectionDefaults(event) : null;
31645
33691
  return {
31646
- selectedEvent: event,
33692
+ selection: event ? [event] : [],
33693
+ runChoices: NO_RUN_PRICING_CHOICES,
31647
33694
  formData: createInitialRegistrationFormData(),
31648
33695
  guests: [],
31649
33696
  selectedAttendanceMode: defaults?.attendanceMode ?? null,
31650
33697
  selectedTicketLines: [],
31651
33698
  selectedSlidingAmountInput: defaults?.slidingAmountInput ?? "",
31652
- bookingQuestions: EMPTY_BOOKING_QUESTIONS_ANSWERS
33699
+ bookingQuestions: EMPTY_BOOKING_QUESTIONS_ANSWERS,
33700
+ runRequirements: NO_RUN_REQUIREMENTS
31653
33701
  };
31654
33702
  }
31655
33703
  function updated(current, value) {
@@ -31657,9 +33705,17 @@ function updated(current, value) {
31657
33705
  }
31658
33706
  function editRegistrationDraft(draft, edit) {
31659
33707
  switch (edit.field) {
31660
- case "selectedEvent": return {
33708
+ case "selection": {
33709
+ const selection = updated(draft.selection, edit.value);
33710
+ return {
33711
+ ...draft,
33712
+ selection,
33713
+ selectedAttendanceMode: resolveSelectionAttendanceMode(decideSelectionAttendance(selection), draft.selectedAttendanceMode)
33714
+ };
33715
+ }
33716
+ case "runChoices": return {
31661
33717
  ...draft,
31662
- selectedEvent: updated(draft.selectedEvent, edit.value)
33718
+ runChoices: updated(draft.runChoices, edit.value)
31663
33719
  };
31664
33720
  case "formData": return {
31665
33721
  ...draft,
@@ -31671,7 +33727,7 @@ function editRegistrationDraft(draft, edit) {
31671
33727
  };
31672
33728
  case "selectedAttendanceMode": return {
31673
33729
  ...draft,
31674
- selectedAttendanceMode: updated(draft.selectedAttendanceMode, edit.value)
33730
+ selectedAttendanceMode: resolveSelectionAttendanceMode(decideSelectionAttendance(draft.selection), updated(draft.selectedAttendanceMode, edit.value))
31675
33731
  };
31676
33732
  case "selectedTicketLines": return {
31677
33733
  ...draft,
@@ -31701,7 +33757,9 @@ function receiveWaitlistInvitation(invitation, credential) {
31701
33757
  function restoreRegistrationDraft(draft, claim, restoration) {
31702
33758
  return {
31703
33759
  bookingQuestions: draft.bookingQuestions,
31704
- selectedEvent: restoration.event ?? draft.selectedEvent,
33760
+ runRequirements: NO_RUN_REQUIREMENTS,
33761
+ selection: restoration.event ? [restoration.event] : draft.selection,
33762
+ runChoices: NO_RUN_PRICING_CHOICES,
31705
33763
  selectedAttendanceMode: restoration.attendanceMode,
31706
33764
  selectedTicketLines: [...restoration.ticketSelections],
31707
33765
  selectedSlidingAmountInput: restoration.slidingAmountInput ?? draft.selectedSlidingAmountInput,
@@ -31774,7 +33832,7 @@ function findPreSelectedEvent(input) {
31774
33832
  })) === contextDate) ?? null;
31775
33833
  }
31776
33834
  function resolveRegistrationTarget(input) {
31777
- const selectedSubject = input.selectedEvent?.registrationSubject ?? null;
33835
+ const selectedSubject = input.selection[0]?.registrationSubject ?? null;
31778
33836
  const subject = selectedSubject?.kind === "wholeSeries" ? selectedSubject : input.occurrenceContext ? {
31779
33837
  kind: "occurrence",
31780
33838
  occurrenceId: input.occurrenceContext.id
@@ -31782,7 +33840,12 @@ function resolveRegistrationTarget(input) {
31782
33840
  if (!subject) return null;
31783
33841
  return {
31784
33842
  subject,
31785
- selectedEventId: input.selectedEvent?.selectionId ?? null
33843
+ selectedEventIds: input.selection.map((event) => event.selectionId),
33844
+ selection: toBookingSelection({
33845
+ subject,
33846
+ selection: input.selection
33847
+ }),
33848
+ ...subject.kind === "wholeSeries" && input.selection.length > 1 ? { runs: input.selection } : {}
31786
33849
  };
31787
33850
  }
31788
33851
  function resolveEventRequiresPayment(input) {
@@ -31822,6 +33885,28 @@ function resolveDiscountContext(input) {
31822
33885
  ticketsCount: input.ticketsCount
31823
33886
  };
31824
33887
  }
33888
+ /** Each run carries its own ticket choice; dates retain the shared top-level choice. */
33889
+ function buildRegistrationSelectionRequest(input) {
33890
+ const selection = toBookingSelectionRequest(input.target.selection, input.attendanceMode);
33891
+ if (selection.kind !== "runs" || selection.eventSeriesIds.length === 1) return selection;
33892
+ const requirements = input.requirements ? { requirements: input.requirements } : {};
33893
+ const runs = input.target.runs;
33894
+ if (!runs || runs.length !== selection.eventSeriesIds.length) throw new Error("Choose tickets for every run.");
33895
+ return {
33896
+ ...selection,
33897
+ ...requirements,
33898
+ ticketChoicesBySeriesId: Object.fromEntries(runs.map((run) => {
33899
+ const choice = runPricingChoice(input.runChoices, run);
33900
+ return [run.seriesId, {
33901
+ ticketSelections: [{
33902
+ pricingOptionId: choice.pricingOptionId,
33903
+ quantity: input.places
33904
+ }],
33905
+ ...run.pricing.kind === "sliding_scale" ? { selectedSlidingAmount: parseCurrencyInputToCents(choice.slidingAmountInput) ?? void 0 } : {}
33906
+ }];
33907
+ }))
33908
+ };
33909
+ }
31825
33910
  //#endregion
31826
33911
  //#region ../blocks/src/system/runtime/nodes/event-registration/waitlistClaimRestoration.ts
31827
33912
  function findClaimEvent(subject, events) {
@@ -31948,7 +34033,10 @@ function buildInstalmentOption(input) {
31948
34033
  function buildFlexibleBalanceOption(input) {
31949
34034
  const balance = {
31950
34035
  remainingBalance: formatPrice(input.option.remainingBalanceCents, input.currency, input.locale),
31951
- balanceDueBy: formatScheduleDate(input.option.balanceDueAt, input.dateContext),
34036
+ balanceDueBy: formatDate$2({
34037
+ kind: "civil",
34038
+ value: parseBookingLocalDate(input.option.balanceDueDay)
34039
+ }, input.dateContext, { date: "short" }),
31952
34040
  depositPolicy: depositPolicy(input.option.config.depositRefundability)
31953
34041
  };
31954
34042
  return {
@@ -31957,7 +34045,10 @@ function buildFlexibleBalanceOption(input) {
31957
34045
  flexibleBalance: balance,
31958
34046
  ...buildFlexibleBalanceBookingPaymentOptionCopy({
31959
34047
  formattedDueToday: formatPrice(input.option.dueNowCents, input.currency, input.locale),
31960
- dueDateLabel: formatScheduleDate(input.option.balanceDueAt, input.dateContext, "long"),
34048
+ dueDateLabel: formatDate$2({
34049
+ kind: "civil",
34050
+ value: parseBookingLocalDate(input.option.balanceDueDay)
34051
+ }, input.dateContext, { date: "long" }),
31961
34052
  depositRefundability: input.option.config.depositRefundability
31962
34053
  }),
31963
34054
  ...summaryFor({
@@ -32057,7 +34148,8 @@ function buildReviewedBookingPaymentViewModel(input) {
32057
34148
  option: input.terms.paymentOption,
32058
34149
  totalCents: input.terms.totalCents,
32059
34150
  anchorAt: input.anchorAt,
32060
- bookingStartAt: input.bookingStartAt
34151
+ bookingStartAt: input.bookingStartAt,
34152
+ timeZone: input.dateContext.timeZone
32061
34153
  }), input.terms);
32062
34154
  return {
32063
34155
  ...buildBookingPaymentOptionViewModel({
@@ -32572,11 +34664,22 @@ function resolveRegistrationTicketContinuation(input) {
32572
34664
  pending: false,
32573
34665
  message: fullyBookedMessage(input.admission)
32574
34666
  };
32575
- if (input.ticketSelectionRequired && !input.hasValidTicketSelection) return {
34667
+ if (input.selectionChoiceMessage) return {
34668
+ kind: "blocked",
34669
+ label: "Continue",
34670
+ pending: false,
34671
+ message: input.selectionChoiceMessage
34672
+ };
34673
+ const pricingBlocker = resolvePricingSelectionBlocker({
34674
+ selectionRequired: input.ticketSelectionRequired,
34675
+ hasValidSelection: input.hasValidTicketSelection,
34676
+ slidingScaleSelectionMessage: input.slidingScaleSelectionMessage
34677
+ });
34678
+ if (pricingBlocker) return {
32576
34679
  kind: "blocked",
32577
- label: "Choose a ticket",
34680
+ label: input.slidingScaleSelectionMessage ? "Continue" : "Choose a ticket",
32578
34681
  pending: false,
32579
- message: "Choose at least one available ticket to continue."
34682
+ message: pricingBlocker
32580
34683
  };
32581
34684
  switch (input.admission.kind) {
32582
34685
  case "checking": return {
@@ -32609,18 +34712,25 @@ function planRegistrationDetailsCheck(input) {
32609
34712
  const errors = validateFormData(input.formData, input.requiresConsent);
32610
34713
  const guestErrors = Object.fromEntries(input.requireGuestDetails ? input.guests.flatMap((guest, index) => guest.name.trim() ? [] : [[index, { name: "Name is required" }]]) : []);
32611
34714
  const questionFieldErrors = input.questions.kind === "unanswered" ? input.questions.fieldErrors : {};
32612
- const fieldsInvalid = Object.keys(errors).length > 0 || Object.keys(guestErrors).length > 0;
34715
+ const { runConsentErrors } = input;
34716
+ const fieldsInvalid = [
34717
+ errors,
34718
+ guestErrors,
34719
+ runConsentErrors
34720
+ ].some((group) => Object.keys(group).length > 0);
32613
34721
  if (!fieldsInvalid && input.questions.kind === "ok") return {
32614
34722
  kind: "check-recovery",
32615
34723
  errors,
32616
34724
  guestErrors,
32617
- questionFieldErrors
34725
+ questionFieldErrors,
34726
+ runConsentErrors
32618
34727
  };
32619
34728
  return {
32620
34729
  kind: "invalid",
32621
34730
  errors,
32622
34731
  guestErrors,
32623
34732
  questionFieldErrors,
34733
+ runConsentErrors,
32624
34734
  message: detailsCheckMessage(input.questions, fieldsInvalid)
32625
34735
  };
32626
34736
  }
@@ -32646,7 +34756,7 @@ function planRegistrationDetailsContinuation(input) {
32646
34756
  message: input.next.message
32647
34757
  };
32648
34758
  const canJoinWaitlist = input.next.kind === "waitlist";
32649
- if (!canJoinWaitlist && requiresPaymentStep(input)) return { kind: "payment-step" };
34759
+ if (!canJoinWaitlist && (input.quoteReady === false || requiresPaymentStep(input))) return { kind: "payment-step" };
32650
34760
  const plan = resolveEventRegistrationSubmitPlan({
32651
34761
  ...input,
32652
34762
  canJoinWaitlist
@@ -32682,10 +34792,14 @@ function buildEventRegistrationPaymentOptionsViewModel(input) {
32682
34792
  dateContext: input.dateContext,
32683
34793
  serviceTitle: input.eventTitle,
32684
34794
  availableOptions: repriceBookingCollectionOptions({
34795
+ currency: input.currency,
34796
+ instalmentCollectionDeadlineAt: input.instalmentCollectionDeadlineAt,
32685
34797
  options: resolveAvailableBookingCollectionOptions({
32686
34798
  paymentTerms: { allowedOptions: approvedOptions },
32687
34799
  now: input.nowIso,
34800
+ timeZone: input.dateContext.timeZone,
32688
34801
  instalmentCollectionDeadlineAt: input.instalmentCollectionDeadlineAt,
34802
+ currency: input.currency,
32689
34803
  bookingStartAt: input.startsAt ?? null,
32690
34804
  totalCents: input.quotedSubtotalCents
32691
34805
  }),
@@ -32780,9 +34894,25 @@ function decideEventRegistrationPayment(input) {
32780
34894
  showLoginPrompt: shouldPromptForLogin(status, input.isAuthenticated, input.eligibility)
32781
34895
  },
32782
34896
  directPaymentOptions: input.directPaymentOptions,
32783
- canShowDirectPaymentOptions: input.directPaymentOptions.length > 0
34897
+ canShowDirectPaymentOptions: input.directPaymentOptions.length > 0,
34898
+ ...selectionPaymentPresentation(input.selectionPayment, input.eligibility)
32784
34899
  };
32785
34900
  }
34901
+ /** Whether nothing is due, and whether passes and memberships are offered, for the whole selection. */
34902
+ function selectionPaymentPresentation(payment, eligibility) {
34903
+ switch (payment.kind) {
34904
+ case "one-item": return {
34905
+ paysNothing: eligibility?.isFree ?? false,
34906
+ offersEntitlements: true,
34907
+ paysInFullBecauseSeveral: false
34908
+ };
34909
+ case "several": return {
34910
+ paysNothing: payment.due === "nothing",
34911
+ offersEntitlements: false,
34912
+ paysInFullBecauseSeveral: payment.due === "card" && (eligibility?.paymentOptions ?? []).some((option) => option.kind === "flexibleBalance" || option.kind === "instalmentPlan")
34913
+ };
34914
+ }
34915
+ }
32786
34916
  /**
32787
34917
  * Label for the button that acts on the chosen payment method.
32788
34918
  *
@@ -32829,7 +34959,8 @@ function shouldPromptForLogin(status, isAuthenticated, eligibility) {
32829
34959
  /** Identity, not clicking a row, decides whether this is a new booking. */
32830
34960
  function decideEventChoice(state, event) {
32831
34961
  const reservedEvent = state.invitation.kind === "ready" ? state.invitation.restoration.event : null;
32832
- return event.selectionId === state.draft.selectedEvent?.selectionId || event.selectionId === reservedEvent?.selectionId ? { type: "event-continued" } : {
34962
+ const chosen = state.draft.selection.length === 1 ? state.draft.selection[0] : void 0;
34963
+ return event.selectionId === chosen?.selectionId || event.selectionId === reservedEvent?.selectionId ? { type: "event-continued" } : {
32833
34964
  type: "event-replaced",
32834
34965
  event
32835
34966
  };
@@ -32864,7 +34995,7 @@ function resetRegistrationDraft(session, hasPreSelectedContext) {
32864
34995
  formData: session.draft.formData
32865
34996
  },
32866
34997
  invitation: { kind: "none" },
32867
- ticketsCount: 1,
34998
+ placeCount: 1,
32868
34999
  isAuthenticated: session.isAuthenticated,
32869
35000
  completedOutcomes: session.completedOutcomes,
32870
35001
  eligibility: null,
@@ -32893,11 +35024,41 @@ function normalizePaymentSelection(selection) {
32893
35024
  if (!selection || !selection.method) return { method: null };
32894
35025
  return selection;
32895
35026
  }
32896
- function computeAutoSelection(input) {
32897
- const { isAuthenticated, eligibility, ticketsCount, passOptOut } = input;
35027
+ /**
35028
+ * How many places each item gets, at least one, from the draft as it stands.
35029
+ * The wizard reads the same derivation (`selectionTicketInputs`); nothing stores it.
35030
+ */
35031
+ function flowTicketsCount(state) {
35032
+ const { ticketsCount } = selectionTicketInputs({
35033
+ several: severalItemsOf(state.draft.selection),
35034
+ primary: state.draft.selection[0] ?? null,
35035
+ lines: state.draft.selectedTicketLines,
35036
+ slidingAmountInput: state.draft.selectedSlidingAmountInput,
35037
+ placeCount: state.placeCount,
35038
+ runChoices: state.draft.runChoices,
35039
+ invitation: state.invitation
35040
+ });
35041
+ return Math.max(1, ticketsCount);
35042
+ }
35043
+ /** How the whole selection is paid; the wizard reads the same decision. */
35044
+ function flowSelectionPayment(state) {
35045
+ return decideSelectionPayment({
35046
+ selection: state.draft.selection,
35047
+ runChoices: state.draft.runChoices,
35048
+ eligibility: state.eligibility
35049
+ });
35050
+ }
35051
+ /** Passes, memberships and bundles cover one item for one person. */
35052
+ function entitlementsAllowed(state) {
35053
+ return flowTicketsCount(state) === 1 && severalItemsOf(state.draft.selection) === null;
35054
+ }
35055
+ function computeAutoSelection(state) {
35056
+ const { isAuthenticated, eligibility, passOptOut } = state;
32898
35057
  if (!eligibility) return { method: null };
35058
+ const payment = flowSelectionPayment(state);
35059
+ if (payment.kind === "several") return payment.due === "nothing" ? { method: "free" } : { method: null };
32899
35060
  if (eligibility.isFree) return { method: "free" };
32900
- if (isAuthenticated && ticketsCount === 1) {
35061
+ if (isAuthenticated && entitlementsAllowed(state)) {
32901
35062
  const membership = eligibility.eligibleMemberships[0];
32902
35063
  if (membership) return {
32903
35064
  method: "membership",
@@ -32914,21 +35075,36 @@ function computeAutoSelection(input) {
32914
35075
  return { method: null };
32915
35076
  }
32916
35077
  function isSelectionValid(input) {
32917
- const { selection, isAuthenticated, eligibility, ticketsCount } = input;
35078
+ const { selection, isAuthenticated, eligibility } = input;
32918
35079
  if (!selection.method) return false;
35080
+ if (input.payment.kind === "several") return isSeveralItemsSelectionValid(selection, input.payment.due);
32919
35081
  if (!eligibility) return selection.method === "stripe" || selection.method === "pass_bundle" || selection.method === "membership_bundle";
32920
35082
  switch (selection.method) {
32921
35083
  case "free": return eligibility.isFree;
32922
- case "stripe": return Boolean(eligibility.requiresPayment && eligibility.price) && getApprovedDirectPaymentCollectionOptionKinds(eligibility.paymentOptions).includes(selection.collectionOptionKind);
35084
+ case "stripe": return isCardSelectionValid(selection, eligibility);
32923
35085
  case "pass":
32924
35086
  case "membership":
32925
35087
  case "pass_bundle":
32926
- case "membership_bundle": return isEntitlementSelectionValid(selection, eligibility, isAuthenticated, ticketsCount);
35088
+ case "membership_bundle": return input.entitlementsAllowed && isEntitlementSelectionValid(selection, eligibility, isAuthenticated);
32927
35089
  default: return false;
32928
35090
  }
32929
35091
  }
32930
- function isEntitlementSelectionValid(selection, eligibility, isAuthenticated, ticketsCount) {
32931
- if (ticketsCount !== 1) return false;
35092
+ /**
35093
+ * Several items are free when nothing is due, otherwise paid up front by card
35094
+ * (issue 1725). The first item's own options don't apply: a free first run
35095
+ * doesn't make a paid second one free.
35096
+ */
35097
+ function isSeveralItemsSelectionValid(selection, due) {
35098
+ switch (due) {
35099
+ case "nothing": return selection.method === "free";
35100
+ case "card": return selection.method === "stripe" && selection.collectionOptionKind === "upfront";
35101
+ }
35102
+ }
35103
+ function isCardSelectionValid(selection, eligibility) {
35104
+ if (!eligibility.requiresPayment || !eligibility.price) return false;
35105
+ return getApprovedDirectPaymentCollectionOptionKinds(eligibility.paymentOptions).includes(selection.collectionOptionKind);
35106
+ }
35107
+ function isEntitlementSelectionValid(selection, eligibility, isAuthenticated) {
32932
35108
  if ((selection.method === "pass" || selection.method === "membership") && !isAuthenticated) return false;
32933
35109
  switch (selection.method) {
32934
35110
  case "pass": return eligibility.eligiblePasses.some((pass) => pass.id === selection.passId);
@@ -32943,7 +35119,8 @@ function normalizeRegistrationFlowState(state) {
32943
35119
  selection: state.paymentSelection,
32944
35120
  isAuthenticated: state.isAuthenticated,
32945
35121
  eligibility: state.eligibility,
32946
- ticketsCount: state.ticketsCount
35122
+ entitlementsAllowed: entitlementsAllowed(state),
35123
+ payment: flowSelectionPayment(state)
32947
35124
  });
32948
35125
  const nextSelection = canKeepManualSelection ? state.paymentSelection : autoSelection;
32949
35126
  const nextSource = canKeepManualSelection ? "manual" : "auto";
@@ -32990,7 +35167,8 @@ function restorePaymentReturn(state, restoration) {
32990
35167
  ...state.draft,
32991
35168
  formData: restoration.formData,
32992
35169
  guests: restoration.guests.map((guest) => ({ ...guest })),
32993
- bookingQuestions: restoreBookingQuestionsAnswers(state.draft.bookingQuestions, restoration.questions)
35170
+ bookingQuestions: restoreBookingQuestionsAnswers(state.draft.bookingQuestions, restoration.questions),
35171
+ runRequirements: restoreRunRequirements(state.draft.runRequirements, restoration.runRequirements)
32994
35172
  };
32995
35173
  if (state.invitation.kind !== "none") return {
32996
35174
  ...state,
@@ -32998,10 +35176,11 @@ function restorePaymentReturn(state, restoration) {
32998
35176
  };
32999
35177
  const restored = {
33000
35178
  ...state,
33001
- ticketsCount: Math.max(1, restoration.ticketsCount),
35179
+ placeCount: Math.max(1, restoration.placeCount),
33002
35180
  draft: {
33003
35181
  ...details,
33004
- selectedEvent: restoration.event ?? state.draft.selectedEvent,
35182
+ selection: restoration.selection.length > 0 ? restoration.selection : state.draft.selection,
35183
+ runChoices: restoration.runChoices,
33005
35184
  selectedTicketLines: restoration.ticketLines.map((line) => ({ ...line })),
33006
35185
  selectedAttendanceMode: restoration.attendanceMode,
33007
35186
  selectedSlidingAmountInput: restoration.slidingAmountInput
@@ -33038,12 +35217,10 @@ function reduceActiveRegistration(state, action) {
33038
35217
  ...state,
33039
35218
  invitation: state.invitation.kind === "none" ? state.invitation : beginWaitlistInvitation(state.invitation.request.credential)
33040
35219
  };
33041
- case "draft-edited": return canEditInvitedDraft(state.invitation, action.edit) ? {
33042
- ...state,
33043
- draft: editRegistrationDraft(state.draft, action.edit),
33044
- questionFieldErrors: {}
33045
- } : state;
35220
+ case "draft-edited": return canEditInvitedDraft(state.invitation, action.edit) ? applyDraftEdit(state, action.edit) : state;
35221
+ case "selection-toggled": return state.invitation.kind === "ready" ? state : toggleRegistrationSelection(state, action.event);
33046
35222
  case "booking-questions": return applyRegistrationQuestionsEvent(state, action.event);
35223
+ case "run-requirements": return applyRunRequirementsAction(state, action);
33047
35224
  case "question-errors-set": return {
33048
35225
  ...state,
33049
35226
  questionFieldErrors: action.fieldErrors
@@ -33089,6 +35266,70 @@ function applyRegistrationQuestionsEvent(state, event) {
33089
35266
  questionFieldErrors
33090
35267
  };
33091
35268
  }
35269
+ /**
35270
+ * One run's answer or agreement. Answering a question clears the complaint
35271
+ * about it in that run's section, and nowhere else.
35272
+ */
35273
+ function applyRunRequirementsAction(state, action) {
35274
+ const draft = {
35275
+ ...state.draft,
35276
+ runRequirements: applyRunRequirementsEvent(state.draft.runRequirements, action.seriesId, action.event)
35277
+ };
35278
+ const answered = action.event.type === "questions" && action.event.event.type === "booking-question-answered" ? action.event.event.fieldId : null;
35279
+ if (answered === null) return {
35280
+ ...state,
35281
+ draft
35282
+ };
35283
+ const cleared = /* @__PURE__ */ new Set([runFieldErrorKey(action.seriesId, answered), answered]);
35284
+ const questionFieldErrors = Object.fromEntries(Object.entries(state.questionFieldErrors).filter(([key]) => !cleared.has(key)));
35285
+ return {
35286
+ ...state,
35287
+ draft,
35288
+ questionFieldErrors
35289
+ };
35290
+ }
35291
+ /** Edits that change what's booked, or how many, re-decide the payment choice. */
35292
+ const SELECTION_FIELDS = /* @__PURE__ */ new Set([
35293
+ "selection",
35294
+ "selectedTicketLines",
35295
+ "runChoices"
35296
+ ]);
35297
+ function applyDraftEdit(state, edit) {
35298
+ const edited = {
35299
+ ...state,
35300
+ draft: editRegistrationDraft(state.draft, edit),
35301
+ questionFieldErrors: {}
35302
+ };
35303
+ return SELECTION_FIELDS.has(edit.field) ? normalizeRegistrationFlowState(edited) : edited;
35304
+ }
35305
+ /**
35306
+ * Ticking or unticking a row while booking several. The details typed so far
35307
+ * stay; when the first item changes, its own defaults (amount, attendance)
35308
+ * start again, as they do when a single booking picks another event.
35309
+ */
35310
+ function toggleRegistrationSelection(state, event) {
35311
+ const selection = toggleSelectionItem(state.draft.selection, event);
35312
+ if (selection === state.draft.selection) return state;
35313
+ const previousPrimary = state.draft.selection[0]?.selectionId;
35314
+ const primary = selection[0] ?? null;
35315
+ const fresh = primary?.selectionId === previousPrimary ? null : createRegistrationDraftData(primary);
35316
+ const draft = {
35317
+ ...state.draft,
35318
+ ...fresh ? {
35319
+ selectedTicketLines: fresh.selectedTicketLines,
35320
+ selectedSlidingAmountInput: fresh.selectedSlidingAmountInput,
35321
+ selectedAttendanceMode: fresh.selectedAttendanceMode
35322
+ } : {},
35323
+ selection,
35324
+ selectedAttendanceMode: resolveSelectionAttendanceMode(decideSelectionAttendance(selection), fresh?.selectedAttendanceMode ?? state.draft.selectedAttendanceMode),
35325
+ runChoices: keepRunPricingChoices(state.draft.runChoices, selection)
35326
+ };
35327
+ return normalizeRegistrationFlowState({
35328
+ ...state,
35329
+ draft,
35330
+ questionFieldErrors: {}
35331
+ });
35332
+ }
33092
35333
  function isRegistrationLocked(step) {
33093
35334
  return [
33094
35335
  "success",
@@ -33104,7 +35345,7 @@ function updateRegistrationDraft(state, action) {
33104
35345
  switch (action.type) {
33105
35346
  case "set-tickets-count": return {
33106
35347
  ...state,
33107
- ticketsCount: state.invitation.kind === "ready" ? state.invitation.restoration.ticketsCount : Math.max(1, action.ticketsCount)
35348
+ placeCount: Math.max(1, action.ticketsCount)
33108
35349
  };
33109
35350
  case "eligibility-updated": return {
33110
35351
  ...state,
@@ -33188,9 +35429,11 @@ function reduceCompletedRegistration(state, action) {
33188
35429
  step: "select-event"
33189
35430
  }, action);
33190
35431
  case "event-continued": return state;
35432
+ case "selection-toggled": return state;
33191
35433
  case "submission-failed":
33192
35434
  case "draft-edited":
33193
35435
  case "booking-questions":
35436
+ case "run-requirements":
33194
35437
  case "question-errors-set":
33195
35438
  case "payment-return-restored":
33196
35439
  case "sign-in-draft-restored":
@@ -33240,7 +35483,7 @@ function applyWaitlistClaimLookup(state, action) {
33240
35483
  case "awaitingEvents": return state;
33241
35484
  case "ready": return normalizeRegistrationFlowState({
33242
35485
  ...state,
33243
- ticketsCount: restoration.ticketsCount,
35486
+ placeCount: restoration.ticketsCount,
33244
35487
  draft: restoreRegistrationDraft(state.draft, lookup.claim, restoration),
33245
35488
  invitation: {
33246
35489
  kind: "ready",
@@ -33272,7 +35515,7 @@ function completeRegistration(state, result) {
33272
35515
  step: "success",
33273
35516
  result,
33274
35517
  invitation: { kind: "none" },
33275
- completedOutcomes: result.status === "confirmed" ? recordCompletedOutcome(state.completedOutcomes, result.outcome) : state.completedOutcomes
35518
+ completedOutcomes: result.status === "confirmed" ? confirmedOutcomes(result).reduce(recordCompletedOutcome, state.completedOutcomes) : state.completedOutcomes
33276
35519
  };
33277
35520
  }
33278
35521
  //#endregion
@@ -33382,7 +35625,9 @@ function panelShouldOpen(step) {
33382
35625
  }
33383
35626
  const REGISTRATION_STEP_LABELS = [
33384
35627
  "Event",
35628
+ "Choose what to book",
33385
35629
  "Date",
35630
+ "Dates",
33386
35631
  "Tickets",
33387
35632
  "Places",
33388
35633
  "Your details",
@@ -33394,17 +35639,29 @@ function getEventSelectionMode(events) {
33394
35639
  const firstSeriesId = events[0]?.seriesId;
33395
35640
  return events.length > 1 && firstSeriesId && events.every((event) => event.seriesId === firstSeriesId) ? "date" : "event";
33396
35641
  }
35642
+ /** Several runs of one course that can be booked together, as the selection step lists them. */
35643
+ function severalRuns(events) {
35644
+ const offerings = new Set(events.map((event) => event.registrationSubject?.kind === "wholeSeries" ? event.registrationSubject.eventOfferingId : null));
35645
+ return events.length > 1 && offerings.size === 1 && !offerings.has(null) && events.every((event) => event.allowsMultipleBooking === true);
35646
+ }
33397
35647
  /** The label facts for a surface: what the visitor chooses from, and what they book. */
33398
35648
  function registrationStepLabelContext(scopedEvents, bookedEvent) {
35649
+ const mode = getEventSelectionMode(scopedEvents);
35650
+ const several = scopedEvents.every((event) => event.allowsMultipleBooking === true);
33399
35651
  return {
33400
- eventSelection: getEventSelectionMode(scopedEvents),
35652
+ eventSelection: mode === "date" && several ? "dates" : severalRuns(scopedEvents) ? "runs" : mode,
33401
35653
  booksWholeSeries: bookedEvent?.registrationSubject.kind === "wholeSeries"
33402
35654
  };
33403
35655
  }
33404
35656
  /** One label owner for the live progress and the server placeholder. */
33405
35657
  function registrationStepLabel(step, context) {
33406
35658
  switch (step) {
33407
- case "select-event": return context.eventSelection === "date" ? "Date" : "Event";
35659
+ case "select-event": switch (context.eventSelection) {
35660
+ case "date": return "Date";
35661
+ case "dates": return "Dates";
35662
+ case "runs": return "Choose what to book";
35663
+ case "event": return "Event";
35664
+ }
33408
35665
  case "select-tickets": return context.booksWholeSeries ? "Places" : "Tickets";
33409
35666
  case "enter-details": return "Your details";
33410
35667
  case "select-payment": return "How you’ll pay";
@@ -33834,4 +36091,4 @@ function membershipCardListContent(display) {
33834
36091
  };
33835
36092
  }
33836
36093
  //#endregion
33837
- export { resolveHeadlessEventRegistrationStatus as $, softBoundaryOption as $a, resolveLookSurfacePresentation as $i, canJoinEventWaitlist as $n, asLayoutVariantKey as $o, bookingHasPackagePaymentChoices as $r, normalizeTicketSelectionLines as $t, createInitialRegistrationFlowState as A, generateDefaultCardSystem as Aa, PAGE_NAVIGATION as Ai, resolveImageUrl as An, opaqueSurfaceDeclarations as Ao, selectedBookingCollectionOptionKind as Ar, resolvePricingOptionsPriceDisplay as As, resolveFinishedPresentation as At, placeCountCeiling as B, navLinkOwnsUnderline as Ba, normalizeEventRegistrationPageSurfaceSubject as Bi, formatDate$1 as Bn, boxBackgroundOverlaySchema as Bo, isAppointmentBookingQuestionsEvent as Br, getImplicitSingleTicketType as Bt, panelShouldOpen as C, compilePageRuntimeFields as Ca, blockButtonRoleSchema as Ci, ImagePresets as Cn, plainFrame as Co, parseBookingCurrencyInputToCents as Cr, formatEventPricing as Cs, parseCurrencyInputToCents as Ct, registrationStepLabel as D, gradientToCss as Da, browserReadAuthoritySchema as Di, renderAudio as Dn, cardListFamilyBlocks as Do, resolveBookingSelectedService as Dr, publicEventPricingStrategy as Ds, registrationQuestionsMessage as Dt, registrationRoute as E, surfaceResolutionContextFromTheme as Ea, resolveDateRuntimeContext as Ei, mediaImageHostProps as En, toNonEmptyReadonlyArray as Eo, resolveBookingPaymentStep as Er, publicEventPricingDisplay as Es, withRegistrationAvailability as Et, buildEventRegistrationPaymentOptionsViewModel as F, generateNavLinkCSS as Fa, bookingPageKindSchema as Fi, eventCalendarWeekStart as Fn, sectionStylesOverrideSchema as Fo, resolveSelectedAppointmentConsent as Fr, formatDate as Ft, resolveRegistrationAvailabilityBlocker as G, sectionShapeFromContent as Ga, isDecodeSuccess as Gi, formatEventNextDateFact as Gn, cardVariantRoleValues as Go, deriveBookingQuestions as Gr, transformRegistrationOptionsResponse as Gt, planRegistrationDetailsContinuation as H, resolvePageDesignBlockLookChoice as Ha, createZodCodec as Hi, formatEventCompactDateRail as Hn, runtimeBoxBackgroundSchema as Ho, bookingQuestionsAnswerDraftSchema as Hr, getTicketTypeAvailabilityLabel as Ht, decideEventRegistrationPayment as I, generateEffectsCSS as Ia, buildInteractiveIslandProps as Ii, eventDateLocale as In, themeSchema as Io, EMPTY_APPOINTMENT_BOOKING_QUESTIONS as Ir, formatEventDateTime as It, visitorHoldsOwnPlace as J, boundaryOptions as Ja, listLookSlot as Ji, formatEventWeekdayTime as Jn, surfaceCardRoleValues as Jo, toBookingQuestionsAnswerDraft as Jr, getSingleSelectedPricingOptionId as Jt, resolveRegistrationTicketContinuation as K, sectionShapeHook as Ka, listItemPresentation as Ki, formatEventRunDates as Kn, itemRoleValues as Ko, needsBookingQuestionsRefresh as Kr, withOccurrenceTitle as Kt, shouldPromptForLogin as L, generateInteractiveChildInheritanceCSS as La, createInteractiveIslandCodec as Li, eventDateOptions as Ln, headerVariantValues as Lo, applyAppointmentBookingQuestionsEvent as Lr, formatPassCreditUsageLabel as Lt, getDeclinedPass as M, footerForegroundCandidates as Ma, leavePage as Mi, resolveMediaNodeResponsiveImage as Mn, surfaceToneFromForegroundToken as Mo, formatCentsAsCurrencyInput as Mr, unsafeAsSiteId as Ms, areEntitlementsDisabledForTicketCount as Mt, isRegistrationLocked as N, getNavLinkPreset as Na, pageNavigationSchema as Ni, resolvePublicMediaUrl as Nn, arrangementSlotNames as No, formatPrice as Nr, parseEventSeriesId as Ns, findSelectedTicketType as Nt, registrationStepLabelContext as O, getGradientPreset as Oa, createHostedBlockApiConfig as Oi, renderVideo as On, cardListKnobBlocks as Oo, resolveBookingSiteId as Or, publicEventPricingType as Os, validateFormData as Ot, registrationFlowReducer as P, buildTextContrastShadow as Pa, requestSignIn as Pi, buildCalendarViewport as Pn, TokenResolver as Po, projectSelectedAppointmentConsentIntoForm as Pr, unsafeAsEventCategoryId as Ps, formatBookingWhen as Pt, resolveEventRegistrationSubmitPlan as Q, noneBoundaryOption as Qa, lookPresentationOnPalette as Qi, resolveRuntimeEventDestination as Qn, asDesignBlockId as Qo, applyBookingPaymentAdmission as Qr, hasValidPricingOptionSelection as Qt, fullyBookedLabel as R, navLinkHoverColorCandidate as Ra, defineInteractiveIslandMetaKeys as Ri, eventLocalDateKey as Rn, blockCustomCssRuleSchema as Ro, appointmentQuestionsRefusal as Rr, formatRegistrationSchedule as Rt, getEventSelectionMode as S, requireCuratedSiteStyle as Sa, BLOCK_BUTTON_ROLE_OPTIONS as Si, RichText as Sn, offeringsPreviewCompositionTreatmentValues as So, normalizeBookingServices as Sr, formatBookingPriceDisplay as Ss, getTicketSelectionRemainingPlaces as St, registrationPresentation as T, stripCompiledRuntimeStyleFields as Ta, readRuntimeNow as Ti, computeMediaTransformStyle as Tn, testimonialsCompositionTreatmentValues as To, resolveAppointmentCheckoutVerificationState as Tr, publicEventPricingCurrency as Ts, shouldLoadRegistrationOptions as Tt, resolveGuestNextStepCheck as U, resolvePageDesignBoundaryChoice as Ua, defineClientOwnedBlockRuntime as Ui, formatEventDateParts as Un, boxlessCardVariantValue as Uo, bookingQuestionsPaymentSnapshotSchema as Ur, getVisibleTicketTypes as Ut, planRegistrationDetailsCheck as V, parsePageDesignIntent as Va, resolveEventRegistrationScopedEvents as Vi, formatEventClockLabel as Vn, boxBackgroundSchema as Vo, needsAppointmentQuestionsRefresh as Vr, getPortalSubjectEmail as Vt, resolveRegistrationAdmission as W, sectionShapeForGround as Wa, defineProgressiveBlockRuntime as Wi, formatEventHourLabel as Wn, cardRoleSchema as Wo, decideBookingQuestionsRestoration as Wr, occurrenceTitleOverride as Wt, isEventRegistrationAvailable as X, boundaryTreatmentForBoundaryOptionId as Xa, resolvedItemSurfaceProps as Xi, groupEventsByDate as Xn, siteChromeBackgroundOverrideOwner as Xo, BOOKING_FORM_DATA_RESERVED_KEYS as Xr, getTicketSelectionTotal as Xt, deriveEventRegistrationSteps as Y, boundaryRuntimeMetricsForDecorativeTransition as Ya, lookListPresentationSchemaShape as Yi, formatTime$1 as Yn, parseGradientPresetId as Yo, toBookingQuestionsPaymentSnapshot as Yr, getTicketLineQuantity as Yt, normalizeEventRegistrationMaxTickets as Z, isDecorativeTransitionIntent as Za, itemRole as Zi, resolveEventTimeZone as Zn, asAppearancePresetId as Zo, BOOKING_FORM_DATA_RESERVED_KEY_VALUES as Zr, getTicketTypeLineMax as Zt, parseStoredCommerceCartState as _, filterLayoutProfilesForPolicy as _a, eventLayoutSchema as _i, bookingPresentation as _n, defineFrameCapability as _o, getBookingSuccessCopy as _r, parseMailchimpAudienceId as _s, getCurrentTicketSelection as _t, buildProductDetailDisplay as a, compileArrangementLookRuntime as aa, resolveBookingPaymentAvailability as ai, EVENT_SIGN_IN_FORM_ID as an, deriveSectionGround as ao, getEventAvailabilityStatus as ar, isRecord$4 as as, buildReviewedBookingPaymentViewModel as at, resolveSelectedProduct as b, designRuntimeRulesForSiteStyle as ba, registrationButtonVariantSchema as bi, resolveRegistrationDisplay as bn, featureCardCompositionTreatmentValues as bo, isBookingServiceSlidingAmountInRange as br, offeringLabelForPageSurfaceSubject as bs, getSlidingScaleForEvent as bt, formatInterval as c, resolveLookForBlock as ca, resolveBookingPurchasablePackages as ci, eventSignInRestoration as cn, sectionForegroundBackground as co, selectEventCapacitySource as cr, nextLiveRunSessionStartMs as cs, findPreSelectedEvent as ct, membershipClassesLabel as d, readStoredMode as da, bookingNowSchema as di, createSignInReturnDraftStore as dn, themeV2CompilerOwnedFieldNames as do, bookingFormInteractiveIslandPropsCodec as dr, resolveWholeSeriesRunLifecycle as ds, resolveRegistrationTarget as dt, selectItemSurfacePresentation as ea, bookingPackageRequestKey as ei, setTicketLineQuantity as en, spaciousBoundaryOption as eo, canJoinEventWaitlistOnAnyMode as er, asPageFlowPresetId as es, resolveHeadlessEventRegistrationView as et, passCardListContent as f, resolveEffectiveArrangement as fa, calendarTabViewsSchema as fi, decideSignInReturn as fn, appearancePresets as fo, buildBookingFormInteractiveIslandProps as fr, parseMailingListRuntimeContext as fs, resolveRouteRequiresPayment as ft, deriveCommerceCheckoutState as g, deriveSiteStyleBlockPolicy as ga, eventCalendarDisplayModeSchema as gi, sweepExpiredSignInReturnDrafts as gn, defineBlockDesignCapability as go, getBookingRedirectStateFromLocation as gr, parseBrevoListId as gs, invitationSubmission as gt, buildProductCartItem as h, buildInitialPolicyPageDesignIntent as ha, eventCalendarDefaultViewSchema as hi, signInReturnPath as hn, assertNever as ho, formatBookingSubmissionPreparationError as hr, DEFAULT_MAILING_LIST_SUCCESS_MESSAGE as hs, createRegistrationDraftData as ht, buildProductCardDisplay as i, automaticArrangementLook as ia, resolveBookingPackageSources as ii, toWholeSeriesRegistrationEvents as in, applyLookPhotoTreatment as io, getEventAvailability as ir, parseAspectRatioValue as is, buildBookingPaymentSelectionViewModel as it, decideEventChoice as j, generateFooterCss as ja, canonicalUrl as ji, resolveImageUrlWithContext as jn, selectLogoVariant as jo, toSelectedCollectionOptionKind as jr, parseSiteId as js, ENTITLEMENT_SINGLE_TICKET_TOOLTIP as jt, areEventRegistrationPaymentSelectionsEqual as k, resolveCardRole as ka, getBlockApiReadStage as ki, resolveImageSourceSetWithContext as kn, opaqueSurfaceContextFromTheme as ko, resolveDefaultBookingServiceId as kr, resolveExactOrFreePriceDisplay as ks, confirmationPaymentRows as kt, formatValidity as l, styleSectionBackgroundForColour as la, toBookingPurchasablePackages as li, toEventSignInDraft as ln, sectionSurfaceBase as lo, selectMostOpenCapacitySource as lr, orderedLiveRunSessions as ls, resolveDiscountContext as lt, buildPassCartItem as m, resolvePublishedLook as ma, eventButtonVariantSchema as mi, readSignInReturn as mn, lookModes as mo, deriveBookingFormViewState as mr, DEFAULT_MAILING_LIST_PRIVACY_NOTE as ms, beginWaitlistInvitation as mt, buildCheckoutDisplay as n, arrangementLookHooks as na, reconcileBookingPackagePurchase as ni, toRegistrationEvents as nn, anglePolygonCss as no, formatRemainingPlaces as nr, makeBoundaryId as ns, toInternalPaymentSelection as nt, buildProductListDisplay as o, getCompatibleBlockAppearancePresets as oa, resolveBookingPaymentChoice as oi, eventSignInDraftStore as on, parseCanonicalRuntimeBackground as oo, getRemainingPlaces as or, CANCELLED_SESSION_STATUS as os, paymentChoiceDetails as ot, EMPTY_COMMERCE_CART_STATE as p, resolveModeArrangement as pa, columnOptionSchema as pi, nextSignInReturnExpiry as pn, resolveEffectiveKnobs as po, readOverrideServiceCategories as pr, resolveBookingSignupOffer as ps, toRegistrationRequestSubject as pt, settledRemainingPlaces as q, boundaryOptionForTransitionIntent as qa, listLookControl as qi, formatEventTimeRange as qn, openCardRoleValue as qo, restoreBookingQuestionsAnswers as qr, canRequestTicketOption as qt, buildPassesMembershipsDisplay as r, arrangementStyleAvailability as ra, resolveBookingPackagePaymentSelection as ri, toWholeSeriesRegistrationEvent as rn, transitionCatalogueEntries as ro, formatTotalCapacity as rr, sanitizeHref as rs, calculateEventRegistrationPreviewTotal as rt, formatCommercePrice as s, resolveArrangementLookForBlock as sa, resolveBookingPaymentMode as si, eventSignInEnds as sn, resolveSectionBackground as so, isEventFull as sr, firstLiveRunSessionStartMs as ss, paymentChoicePrice as st, buildCartDisplay as t, arrangementAppearancePresets as ta, bookingRequiresResourceSelection as ti, getRegistrationStartAt as tn, transitionIntentForTreatment as to, formatEventRemainingPlaces as tr, asSiteStyleId as ts, toHeadlessPaymentSelection as tt, membershipCardListContent as u, arrangementManifestFromVariants as ua, getBookingServiceSlidingScale as ui, clearSignInReturnDrafts as un, stripStaleTransitionStyleGroup as uo, groupPublicEventsByRun as ur, resolveWholeSeriesBookingPhase as us, resolveEventRequiresPayment as ut, productItemKey as v, filterLookIdsForPolicy as va, filterAutoShowSchema as vi, placesLeftLabel as vn, defineNoBlockDesignCapability as vo, getRegistrationSuccessCopy as vr, parseMailchimpInterestId as vs, getEligibilityFlowFlags as vt, registrationPaymentRoute as w, compiledRuntimeStyleFieldNames as wa, isBlockButtonRole as wi, MediaPlaceholder as wn, sectionBackgroundPaintValues as wo, prepareBookingSubmission as wr, isPublicEventPricingOptionDisplayable as ws, resolveHeldTicketPlaces as wt, REGISTRATION_STEP_LABELS as x, getCuratedSiteStyle as xa, weekStartSchema as xi, shownVenue as xn, introCompositionTreatmentValues as xo, normalizeBookingFormConfig as xr, EVENT_PRESET_VOCABULARY as xs, getSlidingScaleSelectionMessage as xt, reduceCommerceCart as y, componentRuntimeRulesForSiteStyle as ya, previewStageSchema as yi, registrationDisplaySchema as yn, designIssueSeverityForPolicy as yo, getShopSuccessCopy as yr, parseNewsletterListId as ys, getRegistrationOccurrenceId as yt, getTicketSelectionPurpose as z, navLinkOwnsHoverForeground as za, eventRegistrationPageSurfaceSubjectSchema as zi, formatCalendarTitle as zn, customCssRuleSchema as zo, deriveAppointmentBookingQuestions as zr, formatTime as zt };
36094
+ export { resolveHeadlessEventRegistrationStatus as $, arrangementAppearancePresets as $a, reconcileBookingPackagePurchase as $i, getSingleSelectedPricingOptionId as $n, transitionIntentForTreatment as $o, formatTotalCapacity as $r, asDesignBlockId as $s, runPricingChoice as $t, createInitialRegistrationFlowState as A, pageNavigationSchema as Aa, publicEventPricingStrategy as Ac, formatPrice as Ai, formatDate as An, footerForegroundCandidates as Ao, buildCalendarViewport as Ar, selectLogoVariant as As, toEventSignInDraft as At, placeCountCeiling as B, defineClientOwnedBlockRuntime as Ba, bookingQuestionsPaymentSnapshotSchema as Bi, transformRegistrationOptionsResponse as Bn, resolvePageDesignBlockLookChoice as Bo, formatEventHourLabel as Br, boxBackgroundSchema as Bs, toRunRequirementsSnapshots as Bt, panelShouldOpen as C, resolveDateRuntimeContext as Ca, offeringLabelForPageSurfaceSubject as Cc, resolveBookingPaymentStep as Ci, selectionPreviewKey as Cn, stripCompiledRuntimeStyleFields as Co, renderAudio as Cr, sectionBackgroundPaintValues as Cs, toRegistrationEvents as Ct, registrationStepLabel as D, PAGE_NAVIGATION as Da, isPublicEventPricingOptionDisplayable as Dc, selectedBookingCollectionOptionKind as Di, areEntitlementsDisabledForTicketCount as Dn, resolveCardRole as Do, resolveImageUrlWithContext as Dr, cardListKnobBlocks as Ds, eventSignInDraftStore as Dt, registrationRoute as E, getBlockApiReadStage as Ea, formatEventPricing as Ec, resolveDefaultBookingServiceId as Ei, ENTITLEMENT_SINGLE_TICKET_TOOLTIP as En, getGradientPreset as Eo, resolveImageUrl as Er, cardListFamilyBlocks as Es, EVENT_SIGN_IN_FORM_ID as Et, buildEventRegistrationPaymentOptionsViewModel as F, defineInteractiveIslandMetaKeys as Fa, unsafeAsSiteId as Fc, appointmentQuestionsRefusal as Fi, getImplicitSingleTicketType as Fn, generateInteractiveChildInheritanceCSS as Fo, formatCalendarTitle as Fr, themeSchema as Fs, deriveRunRequirements as Ft, resolveRegistrationAvailabilityBlocker as G, listLookSlot as Ga, toBookingQuestionsAnswerDraft as Gi, getSlidingScaleForEvent as Gn, boundaryOptionForTransitionIntent as Go, formatTime$1 as Gr, itemRoleValues as Gs, decideSelectionPayment as Gt, planRegistrationDetailsContinuation as H, isDecodeSuccess as Ha, deriveBookingQuestions as Hi, getCurrentTicketSelection as Hn, sectionShapeForGround as Ho, formatEventRunDates as Hr, boxlessCardVariantValue as Hs, SELECTION_LIMIT_NOTE as Ht, decideEventRegistrationPayment as I, eventRegistrationPageSurfaceSubjectSchema as Ia, parseEventSeriesId as Ic, deriveAppointmentBookingQuestions as Ii, getPortalSubjectEmail as In, navLinkHoverColorCandidate as Io, formatDate$1 as Ir, headerVariantValues as Is, nextRunToRead as It, visitorHoldsOwnPlace as J, itemRole as Ja, BOOKING_FORM_DATA_RESERVED_KEY_VALUES as Ji, parseCurrencyInputToCents as Jn, boundaryTreatmentForBoundaryOptionId as Jo, resolveRuntimeEventDestination as Jr, parseGradientPresetId as Js, planSelectionPrice as Jt, resolveRegistrationTicketContinuation as K, lookListPresentationSchemaShape as Ka, toBookingQuestionsPaymentSnapshot as Ki, getSlidingScaleSelectionMessage as Kn, boundaryOptions as Ko, groupEventsByDate as Kr, openCardRoleValue as Ks, effectiveSelection as Kt, shouldPromptForLogin as L, normalizeEventRegistrationPageSurfaceSubject as La, unsafeAsEventCategoryId as Lc, isAppointmentBookingQuestionsEvent as Li, getTicketTypeAvailabilityLabel as Ln, navLinkOwnsHoverForeground as Lo, formatEventClockLabel as Lr, blockCustomCssRuleSchema as Ls, runFieldErrors as Lt, getDeclinedPass as M, bookingPageKindSchema as Ma, resolveExactOrFreePriceDisplay as Mc, resolveSelectedAppointmentConsent as Mi, formatPassCreditUsageLabel as Mn, buildTextContrastShadow as Mo, eventDateLocale as Mr, arrangementSlotNames as Ms, buildSelectionRequirementsSubmission as Mt, isRegistrationLocked as N, buildInteractiveIslandProps as Na, resolvePricingOptionsPriceDisplay as Nc, EMPTY_APPOINTMENT_BOOKING_QUESTIONS as Ni, formatRegistrationSchedule as Nn, generateNavLinkCSS as No, eventDateOptions as Nr, TokenResolver as Ns, checkRunRequirements as Nt, registrationStepLabelContext as O, canonicalUrl as Oa, publicEventPricingCurrency as Oc, toSelectedCollectionOptionKind as Oi, findSelectedTicketType as On, generateDefaultCardSystem as Oo, resolveMediaNodeResponsiveImage as Or, opaqueSurfaceContextFromTheme as Os, eventSignInEnds as Ot, registrationFlowReducer as P, createInteractiveIslandCodec as Pa, parseSiteId as Pc, applyAppointmentBookingQuestionsEvent as Pi, formatTime as Pn, generateEffectsCSS as Po, eventLocalDateKey as Pr, sectionStylesOverrideSchema as Ps, decideSelectionRequirementsLayout as Pt, resolveEventRegistrationSubmitPlan as Q, generateLookMediaFrameCss as Qa, bookingRequiresResourceSelection as Qi, canRequestTicketOption as Qn, spaciousBoundaryOption as Qo, formatRemainingPlaces as Qr, asAppearancePresetId as Qs, runNeedsPricingChoice as Qt, fullyBookedLabel as R, resolveEventRegistrationScopedEvents as Ra, needsAppointmentQuestionsRefresh as Ri, getVisibleTicketTypes as Rn, navLinkOwnsUnderline as Ro, formatEventCompactDateRail as Rr, customCssRuleSchema as Rs, runRequirementsSnapshotSchema as Rt, getEventSelectionMode as S, readRuntimeNow as Sa, parseNewsletterListId as Sc, resolveAppointmentCheckoutVerificationState as Si, selectionItemName as Sn, compiledRuntimeStyleFieldNames as So, mediaImageHostProps as Sr, plainFrame as Ss, getRegistrationStartAt as St, registrationPresentation as T, createHostedBlockApiConfig as Ta, formatBookingPriceDisplay as Tc, resolveBookingSiteId as Ti, serverPricedTotalCents as Tn, gradientToCss as To, resolveImageSourceSetWithContext as Tr, toNonEmptyReadonlyArray as Ts, toWholeSeriesRegistrationEvents as Tt, resolveGuestNextStepCheck as U, listItemPresentation as Ua, needsBookingQuestionsRefresh as Ui, getEligibilityFlowFlags as Un, sectionShapeFromContent as Uo, formatEventTimeRange as Ur, cardRoleSchema as Us, SEVERAL_BOOKINGS_ACCOUNT_NOTE as Ut, planRegistrationDetailsCheck as V, defineProgressiveBlockRuntime as Va, decideBookingQuestionsRestoration as Vi, withOccurrenceTitle as Vn, resolvePageDesignBoundaryChoice as Vo, formatEventNextDateFact as Vr, runtimeBoxBackgroundSchema as Vs, withoutKeptAnswers as Vt, resolveRegistrationAdmission as W, listLookControl as Wa, restoreBookingQuestionsAnswers as Wi, getRegistrationOccurrenceId as Wn, sectionShapeHook as Wo, formatEventWeekdayTime as Wr, cardVariantRoleValues as Ws, canToggleSelectionItem as Wt, isEventRegistrationAvailable as X, resolveLookSurfacePresentation as Xa, bookingHasPackagePaymentChoices as Xi, shouldLoadRegistrationOptions as Xn, noneBoundaryOption as Xo, canJoinEventWaitlistOnAnyMode as Xr, asHeaderStyleId as Xs, registrationSelectionMode as Xt, deriveEventRegistrationSteps as Y, lookPresentationOnPalette as Ya, applyBookingPaymentAdmission as Yi, resolveHeldTicketPlaces as Yn, isDecorativeTransitionIntent as Yo, canJoinEventWaitlist as Yr, asHeaderLayoutId as Ys, primarySelectionItem as Yt, normalizeEventRegistrationMaxTickets as Z, selectItemSurfacePresentation as Za, bookingPackageRequestKey as Zi, withRegistrationAvailability as Zn, softBoundaryOption as Zo, formatEventRemainingPlaces as Zr, siteChromeBackgroundOverrideOwner as Zs, runChoiceUsable as Zt, parseStoredCommerceCartState as _, registrationButtonVariantSchema as _a, DEFAULT_MAILING_LIST_PRIVACY_NOTE as _c, isSameOpenCheckout as _i, combinationHintCopy as _n, componentRuntimeRulesForSiteStyle as _o, shownVenue as _r, defineNoBlockDesignCapability as _s, invitationSubmission as _t, buildProductDetailDisplay as a, resolveBookingPurchasablePackages as aa, parseAspectRatioValue as ac, selectMostOpenCapacitySource as ai, selectionIncludes as an, resolveArrangementLookForBlock as ao, setTicketLineQuantity as ar, resolveSectionBackground as as, buildReviewedBookingPaymentViewModel as at, resolveSelectedProduct as b, blockButtonRoleSchema as ba, parseMailchimpAudienceId as bc, parseBookingCurrencyInputToCents as bi, combinationWorking as bn, requireCuratedSiteStyle as bo, MediaPlaceholder as br, introCompositionTreatmentValues as bs, confirmationPaymentRows as bt, formatInterval as c, bookingNowSchema as ca, decideSelectionAttendance as cc, buildBookingFormInteractiveIslandProps as ci, selectionPlacesLabel as cn, arrangementManifestFromVariants as co, decideSignInReturn as cr, stripStaleTransitionStyleGroup as cs, buildRegistrationSelectionRequest as ct, membershipClassesLabel as d, eventButtonVariantSchema as da, nextLiveRunSessionStartMs as dc, formatBookingSubmissionPreparationError as di, selectionTicketInputs as dn, resolveModeArrangement as do, signInReturnPath as dr, resolveEffectiveKnobs as ds, resolveEventRequiresPayment as dt, resolveBookingPackagePaymentSelection as ea, asLayoutVariantKey as ec, getEventAvailability as ei, runUnitPriceCents as en, arrangementLookHooks as eo, getTicketLineQuantity as er, anglePolygonCss as es, resolveHeadlessEventRegistrationView as et, passCardListContent as f, eventCalendarDefaultViewSchema as fa, orderedLiveRunSessions as fc, getBookingRedirectStateFromLocation as fi, severalConfirmationSentence as fn, resolvePublishedLook as fo, sweepExpiredSignInReturnDrafts as fr, lookModes as fs, resolveRegistrationTarget as ft, deriveCommerceCheckoutState as g, previewStageSchema as ga, resolveBookingSignupOffer as gc, isBookingServiceSlidingAmountInRange as gi, toggleSelectionItem as gn, filterLookIdsForPolicy as go, resolveRegistrationDisplay as gr, defineFrameCapability as gs, createRegistrationDraftData as gt, buildProductCartItem as h, filterAutoShowSchema as ha, parseMailingListRuntimeContext as hc, getShopSuccessCopy as hi, summariseSelectionPayment as hn, filterLayoutProfilesForPolicy as ho, registrationDisplaySchema as hr, defineExactCatalog as hs, beginWaitlistInvitation as ht, buildProductCardDisplay as i, resolveBookingPaymentMode as ia, sanitizeHref as ic, selectEventCapacitySource as ii, selectionEntitlementNote as in, getCompatibleBlockAppearancePresets as io, normalizeTicketSelectionLines as ir, parseCanonicalRuntimeBackground as is, buildBookingPaymentSelectionViewModel as it, decideEventChoice as j, requestSignIn as ja, publicEventPricingType as jc, projectSelectedAppointmentConsentIntoForm as ji, formatEventDateTime as jn, getNavLinkPreset as jo, eventCalendarWeekStart as jr, surfaceToneFromForegroundToken as js, paymentReturnRestoration as jt, areEventRegistrationPaymentSelectionsEqual as k, leavePage as ka, publicEventPricingDisplay as kc, formatCentsAsCurrencyInput as ki, formatBookingWhen as kn, generateFooterCss as ko, resolvePublicMediaUrl as kr, opaqueSurfaceDeclarations as ks, eventSignInRestoration as kt, formatValidity as l, calendarTabViewsSchema as la, CANCELLED_SESSION_STATUS as lc, readOverrideServiceCategories as li, selectionPlacesNote as ln, readStoredMode as lo, nextSignInReturnExpiry as lr, themeV2CompilerOwnedFieldNames as ls, findPreSelectedEvent as lt, buildPassCartItem as m, eventLayoutSchema as ma, resolveWholeSeriesRunLifecycle as mc, getRegistrationSuccessCopy as mi, severalRunsChoiceMessage as mn, deriveSiteStyleBlockPolicy as mo, placesLeftLabel as mr, defineBlockDesignCapability as ms, toRegistrationRequestSubject as mt, buildCheckoutDisplay as n, resolveBookingPaymentAvailability as na, asSiteStyleId as nc, getRemainingPlaces as ni, selectionConfirmationHint as nn, automaticArrangementLook as no, getTicketTypeLineMax as nr, applyLookPhotoTreatment as ns, toInternalPaymentSelection as nt, buildProductListDisplay as o, toBookingPurchasablePackages as oa, isRecord$4 as oc, groupPublicEventsByRun as oi, selectionItemPrice as on, resolveLookForBlock as oo, clearSignInReturnDrafts as or, sectionForegroundBackground as os, paymentChoiceDetails as ot, EMPTY_COMMERCE_CART_STATE as p, eventCalendarDisplayModeSchema as pa, resolveWholeSeriesBookingPhase as pc, getBookingSuccessCopy as pi, severalItemsOf as pn, buildInitialPolicyPageDesignIntent as po, bookingPresentation as pr, assertNever as ps, resolveRouteRequiresPayment as pt, settledRemainingPlaces as q, resolvedItemSurfaceProps as qa, BOOKING_FORM_DATA_RESERVED_KEYS as qi, getTicketSelectionRemainingPlaces as qn, boundaryRuntimeMetricsForDecorativeTransition as qo, resolveEventTimeZone as qr, surfaceCardRoleValues as qs, incompleteRunChoiceMessage as qt, buildPassesMembershipsDisplay as r, resolveBookingPaymentChoice as ra, makeBoundaryId as rc, isEventFull as ri, selectionConsentLabel as rn, compileArrangementLookRuntime as ro, hasValidPricingOptionSelection as rr, deriveSectionGround as rs, calculateEventRegistrationPreviewTotal as rt, formatCommercePrice as s, getBookingServiceSlidingScale as sa, INCOMPATIBLE_ATTENDANCE_MESSAGE as sc, bookingFormInteractiveIslandPropsCodec as si, selectionItemsLabel as sn, styleSectionBackgroundForColour as so, createSignInReturnDraftStore as sr, sectionSurfaceBase as ss, paymentChoicePrice as st, buildCartDisplay as t, resolveBookingPackageSources as ta, asPageFlowPresetId as tc, getEventAvailabilityStatus as ti, selectionAtLimit as tn, arrangementStyleAvailability as to, getTicketSelectionTotal as tr, transitionCatalogueEntries as ts, toHeadlessPaymentSelection as tt, membershipCardListContent as u, columnOptionSchema as ua, firstLiveRunSessionStartMs as uc, deriveBookingFormViewState as ui, selectionRowAvailability as un, resolveEffectiveArrangement as uo, readSignInReturn as ur, appearancePresets as us, resolveDiscountContext as ut, productItemKey as v, weekStartSchema as va, DEFAULT_MAILING_LIST_SUCCESS_MESSAGE as vc, normalizeBookingFormConfig as vi, combinationOfferLine as vn, designRuntimeRulesForSiteStyle as vo, RichText as vr, designIssueSeverityForPolicy as vs, registrationQuestionsMessage as vt, registrationPaymentRoute as w, browserReadAuthoritySchema as wa, EVENT_PRESET_VOCABULARY as wc, resolveBookingSelectedService as wi, selectionPreviewLines as wn, surfaceResolutionContextFromTheme as wo, renderVideo as wr, testimonialsCompositionTreatmentValues as ws, toWholeSeriesRegistrationEvent as wt, REGISTRATION_STEP_LABELS as x, isBlockButtonRole as xa, parseMailchimpInterestId as xc, prepareBookingSubmission as xi, selectionCombinationHint as xn, compilePageRuntimeFields as xo, computeMediaTransformStyle as xr, offeringsPreviewCompositionTreatmentValues as xs, resolveFinishedPresentation as xt, reduceCommerceCart as y, BLOCK_BUTTON_ROLE_OPTIONS as ya, parseBrevoListId as yc, normalizeBookingServices as yi, combinationOffersOf as yn, getCuratedSiteStyle as yo, ImagePresets as yr, featureCardCompositionTreatmentValues as ys, validateFormData as yt, getTicketSelectionPurpose as z, createZodCodec as za, bookingQuestionsAnswerDraftSchema as zi, occurrenceTitleOverride as zn, parsePageDesignIntent as zo, formatEventDateParts as zr, boxBackgroundOverlaySchema as zs, runsKeepingAnswers as zt };