@riverbankcms/sdk 0.168.0 → 0.169.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 (192) hide show
  1. package/dist/_dts/{BlocksIslandsHydrator-CiD_VVGM.d.ts → BlocksIslandsHydrator-DpROiz12.d.ts} +1 -1
  2. package/dist/_dts/{Page-Bj6VJRS5.d.ts → Page-DHBBDRC_.d.ts} +7 -7
  3. package/dist/_dts/{SdkPreviewMode-ChpsnwDX.d.ts → SdkPreviewMode-CG7Qib7u.d.ts} +2 -2
  4. package/dist/_dts/{client-C8mfUxrJ.d.ts → client-MURxFla9.d.ts} +39 -397
  5. package/dist/_dts/{content-types-_vXZyR4H.d.ts → content-types-ClBGjxBV.d.ts} +2 -2
  6. package/dist/_dts/{contracts-CJFfrVKU.d.ts → contracts-CHNvzh0y.d.ts} +4 -3
  7. package/dist/_dts/{footerPageOutline-CMegb23G.d.ts → footerPageOutline-DQM934Fm.d.ts} +6 -6
  8. package/dist/_dts/{generatePageMetadata-D9YdAIMh.d.ts → generatePageMetadata-ConZaEqB.d.ts} +2 -2
  9. package/dist/_dts/{index-BQXaZ7aY.d.ts → index-BaDqRekr.d.ts} +4 -4
  10. package/dist/_dts/{index-vR3p9Bu-.d.ts → index-CVB5wgbz.d.ts} +2 -2
  11. package/dist/_dts/{index-Cx2BQlHL.d.ts → index-CiR_oPYT.d.ts} +1 -1
  12. package/dist/_dts/{index-Bpr-wT5k.d.ts → index-CovKPftP.d.ts} +2 -2
  13. package/dist/_dts/{index-Dgz6yhsy.d.ts → index-DCw8LO4M.d.ts} +1 -1
  14. package/dist/_dts/{index-Vh8B9FSa.d.ts → index-DDaX-K2D.d.ts} +1 -1
  15. package/dist/_dts/{index-C7_Rz8EY.d.ts → index-rfAssXq0.d.ts} +3 -3
  16. package/dist/_dts/{loadContent-dhWSgLeS.d.ts → loadContent-CRLKVVDP.d.ts} +7 -7
  17. package/dist/_dts/{request-BrYhNV9Z.d.ts → request-DeVetKBr.d.ts} +1840 -599
  18. package/dist/_dts/{resolveBlockData-BfSHm8Ms.d.ts → resolveBlockData-C5KYFeig.d.ts} +5 -5
  19. package/dist/_dts/{resolvePageContent-gZJ4i1wN.d.ts → resolvePageContent-D8MZWyNO.d.ts} +2 -2
  20. package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
  21. package/dist/_dts/sdk/src/client/types.d.ts +2 -2
  22. package/dist/_dts/sdk/src/client.d.ts +7 -7
  23. package/dist/_dts/sdk/src/config/index.d.ts +6 -6
  24. package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
  25. package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
  26. package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +2 -2
  27. package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
  28. package/dist/_dts/sdk/src/data/types.d.ts +2 -2
  29. package/dist/_dts/sdk/src/index.d.ts +8 -8
  30. package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
  31. package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
  32. package/dist/_dts/sdk/src/navigation/index.d.ts +2 -2
  33. package/dist/_dts/sdk/src/next/index.d.ts +7 -7
  34. package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
  35. package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
  36. package/dist/_dts/sdk/src/portal/client.d.ts +1 -1
  37. package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
  38. package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
  39. package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
  40. package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
  41. package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
  42. package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -1
  43. package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
  44. package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +4 -4
  45. package/dist/_dts/sdk/src/rendering/index.d.ts +6 -6
  46. package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
  47. package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
  48. package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
  49. package/dist/_dts/sdk/src/routing/index.d.ts +5 -5
  50. package/dist/_dts/sdk/src/server.d.ts +5 -5
  51. package/dist/_dts/sdk/src/spam-protection/index.d.ts +2 -2
  52. package/dist/_dts/sdk/src/theme/index.d.ts +1 -1
  53. package/dist/_dts/{types-FOsJ-KYb.d.ts → types-B4MBlP_B.d.ts} +2 -2
  54. package/dist/_dts/{types-BVFXYtRg.d.ts → types-Fj31kIi2.d.ts} +7 -7
  55. package/dist/_dts/{types-BB33-Spd.d.ts → types-OwqfS8Gn.d.ts} +3 -3
  56. package/dist/_dts/{validation-DckTc6TQ.d.ts → validation-B1Fa8o_b.d.ts} +4 -4
  57. package/dist/client/{BlocksIslandsHydrator-DcwEaliO.mjs → BlocksIslandsHydrator-qq4Vhs7k.mjs} +16 -16
  58. package/dist/client/{BookingMailingListNote-Dsugoe-n.mjs → BookingMailingListNote-y3qWjnOo.mjs} +17 -6
  59. package/dist/client/{BookingQuestionFields-Bhh0cvsl.mjs → BookingQuestionFields-DjLjd0vc.mjs} +3 -3
  60. package/dist/client/{CalendarNavigationChevron-CNe3ZjdC.mjs → CalendarNavigationChevron-VM7C2fdh.mjs} +7 -7
  61. package/dist/client/{DemoBookingPortalAccess-BeiZxEUJ.mjs → DemoBookingPortalAccess-C2QCj_Ta.mjs} +65 -9
  62. package/dist/client/{EventCalendar.client-BL943-tl.mjs → EventCalendar.client-DDjz7tuX.mjs} +9 -9
  63. package/dist/client/{EventCombined.client-BFVxECTp.mjs → EventCombined.client-CeYbNsch.mjs} +7 -7
  64. package/dist/client/{EventItem-BIc4gjiD.mjs → EventItem-B5J0IeF4.mjs} +3 -3
  65. package/dist/client/{EventListWeekNavigation-a0QEIEf0.mjs → EventListWeekNavigation-eH04D8-V.mjs} +1 -1
  66. package/dist/client/{EventListing.client-CEFTC3jH.mjs → EventListing.client-slpvrTrM.mjs} +3 -3
  67. package/dist/client/{EventListing.view-Bt2sBBms.mjs → EventListing.view-BYBaElec.mjs} +5 -5
  68. package/dist/client/{EventRegistrationPayment-D9YBNb_E.mjs → EventRegistrationPayment-Do7Q0wRG.mjs} +121 -59
  69. package/dist/client/{LocationMapActions-gqzt5gkW.mjs → LocationMapActions-BFp2uQQQ.mjs} +1 -1
  70. package/dist/client/{MapDrawingSvg-13JQI7_z.mjs → MapDrawingSvg-DDWfmgpA.mjs} +1 -1
  71. package/dist/client/{Page-D_M2Vxz3.mjs → Page-Dv9eIOGr.mjs} +20 -15
  72. package/dist/client/{StepIndicator-CaN8snZ8.mjs → StepIndicator-BZNUd0-v.mjs} +2 -2
  73. package/dist/client/{accordion-DE7OG--d.mjs → accordion-BCtVxnDZ.mjs} +1 -1
  74. package/dist/client/{booking-form.client-CS1PPjw7.mjs → booking-form.client-Cr5G-HHO.mjs} +504 -216
  75. package/dist/client/{bookingForm-DE2CwIU9.mjs → bookingForm-B1Fc62Sl.mjs} +8 -5
  76. package/dist/client/{bookingRoute-Bqlyu5Vb.mjs → bookingRoute-D6DlxYx6.mjs} +6 -2
  77. package/dist/client/bookings.mjs +16 -13
  78. package/dist/client/{carousel-DZyUdnFh.mjs → carousel-DW-HgjvT.mjs} +1 -1
  79. package/dist/client/{cart-D7HkkNwe.mjs → cart-D1zWe4R7.mjs} +3 -3
  80. package/dist/client/{cart.client-H4sv2TpD.mjs → cart.client-CIfbTLHS.mjs} +1 -1
  81. package/dist/client/{checkout-2qVyG-Sh.mjs → checkout-fDCNZ3IT.mjs} +3 -3
  82. package/dist/client/{checkout.client-DAjrBZ74.mjs → checkout.client-C4l2KjtV.mjs} +1 -1
  83. package/dist/client/{checkoutUrls-CYj06rX1.mjs → checkoutUrls-cWL6I-Vz.mjs} +3 -2
  84. package/dist/client/client.mjs +50 -3
  85. package/dist/client/{context-DXmIbXCK.mjs → context-DQnTyApV.mjs} +24 -2
  86. package/dist/client/{bookingQuestionValues-BjcyCru5.mjs → creditProducts-CMOmhWm2.mjs} +71 -11
  87. package/dist/client/{cta-DP_IBnq3.mjs → cta-Bj5WHgcv.mjs} +2 -2
  88. package/dist/client/{dateFormatting-CwrkFZTr.mjs → dateFormatting-Bv6kjUW3.mjs} +1 -1
  89. package/dist/client/{demoPortalMagicLink-DQXK-Fh6.mjs → demoPortalMagicLink-3uVu3WgG.mjs} +1 -1
  90. package/dist/client/{wizardSteps-CFulHWnT.mjs → display-CT8KMSpH.mjs} +893 -68
  91. package/dist/client/{enhanceHeaderSection-DheQj7rg.mjs → enhanceHeaderSection-B27KFGDv.mjs} +3 -2
  92. package/dist/client/{event-details.client-C5UufcRp.mjs → event-details.client-CL4Lqz2c.mjs} +1 -1
  93. package/dist/client/{event-registration.client-CMGg63IU.mjs → event-registration.client-Dj3Kyp5X.mjs} +56 -16
  94. package/dist/client/{eventCalendar-DlD0GCEy.mjs → eventCalendar-DGsdSF8J.mjs} +4 -4
  95. package/dist/client/{eventCombined-DoSi8p_l.mjs → eventCombined-DFSVDJ3D.mjs} +4 -4
  96. package/dist/client/{eventDetails-DzuQYgmO.mjs → eventDetails-DzMskXYA.mjs} +2 -2
  97. package/dist/client/{eventListing-CkiMjl0g.mjs → eventListing-CpFFcAUr.mjs} +4 -4
  98. package/dist/client/{eventRegistration-CjS3Zpjp.mjs → eventRegistration-BipMUOCw.mjs} +8 -5
  99. package/dist/client/{form-DgQqm7T2.mjs → form-57k2JQnm.mjs} +3 -3
  100. package/dist/client/{form.client-BI9Dcsq5.mjs → form.client-CCl6CpRJ.mjs} +4 -4
  101. package/dist/client/{form.parts-DevF0L_A.mjs → form.parts-BOJ1yDDf.mjs} +1 -1
  102. package/dist/client/{formatDate-DDyURjoe.mjs → formatDate-BGlhrmhF.mjs} +1 -1
  103. package/dist/client/gifting/client.mjs +2 -2
  104. package/dist/client/{headerSection-DYIG6Pwb.mjs → headerSection-q_bEzfhW.mjs} +2 -2
  105. package/dist/client/{newsletter-form.client-BWp7Y1e1.mjs → newsletter-form.client-CiqKAmPs.mjs} +5 -5
  106. package/dist/client/{newsletter-form.parts-Dg8s9NwJ.mjs → newsletter-form.parts-x1RzAMNO.mjs} +1 -1
  107. package/dist/client/{newsletterForm-DnPraMzx.mjs → newsletterForm-Cn7h4zFe.mjs} +3 -3
  108. package/dist/client/{noop-ByFRHYQ2.mjs → noop-B_f7RqLD.mjs} +111 -2
  109. package/dist/client/portal/client.mjs +20 -12
  110. package/dist/client/{product-detail.client-BFAgHrdg.mjs → product-detail.client-rWUvpVvZ.mjs} +1 -1
  111. package/dist/client/{product-list.client-DVrs_DyY.mjs → product-list.client-J0wDOmKv.mjs} +1 -1
  112. package/dist/client/{productDetail-D4rvl6Xg.mjs → productDetail-LtCkMrJ0.mjs} +3 -3
  113. package/dist/client/{productList-B8o5AOMX.mjs → productList-C0MLeh-v.mjs} +3 -3
  114. package/dist/client/{propsDecoder-hhotPP6P.mjs → propsDecoder-CAmEkJ6Y.mjs} +3 -3
  115. package/dist/client/{registry.server-Ch3EpupA.mjs → registry.server-Bf2YX_4v.mjs} +22 -19
  116. package/dist/client/rendering/client.mjs +25 -25
  117. package/dist/client/rendering/islands.mjs +1 -1
  118. package/dist/client/rendering.mjs +4 -4
  119. package/dist/client/{richText-coerce-C3LabQ1O.mjs → richText-coerce-BTurYEao.mjs} +1 -1
  120. package/dist/client/{routeIslandApiConfig-CQGlxId8.mjs → routeIslandApiConfig-UdAlnZGQ.mjs} +1 -1
  121. package/dist/client/{shop-rRXplPGZ.mjs → shop-Dkn6EasY.mjs} +3 -3
  122. package/dist/client/{shop-commerce-VDbVaKY-.mjs → shop-commerce-bo0Z6kwf.mjs} +11 -11
  123. package/dist/client/{shop-commerce-store-DqdgJ8Zw.mjs → shop-commerce-store-Ckxa4_jI.mjs} +1 -1
  124. package/dist/client/{shop.client-DdwvMvaK.mjs → shop.client-B_GqU6_U.mjs} +109 -30
  125. package/dist/client/{shop.interactive-C8OvFY06.mjs → shop.interactive-C6L_Ig5F.mjs} +7 -523
  126. package/dist/client/{shopShared-BeuJiGPU.mjs → shopShared-CO1Y8lFd.mjs} +2 -2
  127. package/dist/client/src-BozhJ43Z.mjs +3 -0
  128. package/dist/client/{src-1PJxc8KO.mjs → src-xrjaKaCj.mjs} +6 -8
  129. package/dist/client/{timetableModel-Cko9LRKy.mjs → timetableModel-D62jfOxZ.mjs} +10 -10
  130. package/dist/client/{useAvailableSlots-M6QIEiWf.mjs → useAvailableSlots-CStfVmyY.mjs} +3 -3
  131. package/dist/client/{useDiscountApply-BJSnyO0f.mjs → useDiscountApply-Ca2pHUDu.mjs} +5 -3
  132. package/dist/client/{useDiscountCodeUi-D3XnOSCi.mjs → useDiscountCodeUi-AEifktGO.mjs} +1 -1
  133. package/dist/client/{useEventPagination-PhTIoFVX.mjs → useEventPagination-uxnUWI2v.mjs} +6 -6
  134. package/dist/client/{view-448wvvEY.mjs → view-B6KSxQMO.mjs} +7 -7
  135. package/dist/client/{view-L_mkgtnk.mjs → view-SVnWic7i.mjs} +2 -3
  136. package/dist/preview-next/client/{ArrangementLookControls-BpvnOGlN.mjs → ArrangementLookControls-kbdqYkWM.mjs} +3 -3
  137. package/dist/preview-next/client/{PreviewEditorSidebar-C0OtdWu_.mjs → PreviewEditorSidebar-DI_LhsMQ.mjs} +89 -39
  138. package/dist/preview-next/client/{PreviewEditorUI-Csc5vH5k.mjs → PreviewEditorUI-yyD-ZREP.mjs} +5 -5
  139. package/dist/preview-next/client/{PreviewShell-BOLH_pm-.mjs → PreviewShell-YauP65Gi.mjs} +5 -5
  140. package/dist/preview-next/client/{SdkPreviewModeRuntime-CKodLReY.mjs → SdkPreviewModeRuntime-Bl7jQMI1.mjs} +8 -7
  141. package/dist/preview-next/client/{SiteChromeCustomizeButton-BeEZpeKn.mjs → SiteChromeCustomizeButton-CQFRP9aM.mjs} +1057 -316
  142. package/dist/preview-next/client/{previewAssistantSlot-BBdN5kfY.mjs → previewAssistantSlot-DSR0IdAw.mjs} +417 -56
  143. package/dist/preview-next/client/{previewChromeSurface-VZtGwPuH.mjs → previewChromeSurface-uSnVzeNs.mjs} +1 -1
  144. package/dist/preview-next/client/runtime.mjs +3 -3
  145. package/dist/preview-next/client/{sdk-runtime-kiZkMcuR.mjs → sdk-runtime-6Q0RVJTQ.mjs} +2 -2
  146. package/dist/preview-next/client/{src-DY8JCJdE.mjs → src-DzXUmsyK.mjs} +6 -8
  147. package/dist/preview-next/client/src-LUhVXBEQ.mjs +3 -0
  148. package/dist/preview-next/client/{useAutosaveStatus-BiIHEeE0.mjs → useAutosaveStatus-Cdx3kAGm.mjs} +1 -1
  149. package/dist/preview-next/client/{useBlockCustomizeControls-BuFLIpmX.mjs → useBlockCustomizeControls-ZrWdhcB6.mjs} +1 -1
  150. package/dist/preview-next/client/{useOpenBlockForSetup-DlxYgmh_.mjs → useOpenBlockForSetup-CK-GWb9k.mjs} +1 -1
  151. package/dist/preview-next/keepAlive.mjs +1 -1
  152. package/dist/preview-next/middleware.mjs +1 -1
  153. package/dist/preview-next/{route-contract-C0sCvCYL.mjs → route-contract-BU1m9SV3.mjs} +47 -0
  154. package/dist/server/{Block.shared-Dnhc0Wu5.mjs → Block.shared-4vx7wzxj.mjs} +4 -4
  155. package/dist/server/{ThemeScopeCore-NAQ_zsFu.mjs → ThemeScopeCore-C3HLgqBF.mjs} +6 -3
  156. package/dist/server/{bindings-DLoZYUxG.mjs → bindings-TAQbo2P5.mjs} +1 -1
  157. package/dist/server/{booking-form.reserved-fields-BWRF7509.mjs → booking-form.reserved-fields-Cqp13TKc.mjs} +1 -0
  158. package/dist/server/{client-Bc8jI8zN.mjs → client-DzCxEl3L.mjs} +48 -1
  159. package/dist/server/config-validation.mjs +1 -1
  160. package/dist/server/config.mjs +1 -1
  161. package/dist/server/data/resolveBlockData.mjs +1 -1
  162. package/dist/server/{headerVariant-BwR9NV4b.mjs → headerVariant-8O5MvxIU.mjs} +2 -1
  163. package/dist/server/index.mjs +2 -2
  164. package/dist/server/{loadContent-D61gpqHB.mjs → loadContent-BO1M9Hdf.mjs} +4 -4
  165. package/dist/server/{loadPage-B4ZYpIcd.mjs → loadPage-BvWzmZcD.mjs} +2 -2
  166. package/dist/server/next.mjs +6 -6
  167. package/dist/server/{overrideResolution-CDReKy2P.mjs → overrideResolution-fxuB1zZg.mjs} +1 -1
  168. package/dist/server/page-converter.mjs +1 -1
  169. package/dist/server/{pageRenderPlan-ByVTA7-4.mjs → pageRenderPlan-DzduDSqY.mjs} +2 -2
  170. package/dist/server/{pageRuntimeSupport-Dzz_Dze6.mjs → pageRuntimeSupport-BU8pwTNx.mjs} +2 -2
  171. package/dist/server/{pageShared-Dk5Ku6hs.mjs → pageShared-CSOJ8p8E.mjs} +24 -16
  172. package/dist/server/{parseThemeForPersistence-pJPGfMrf.mjs → parseThemeForPersistence-BebSeE17.mjs} +1 -1
  173. package/dist/server/{prebuild-CW4M0WEZ.mjs → prebuild-C5ZYo7wA.mjs} +1 -1
  174. package/dist/server/prebuild.mjs +1 -1
  175. package/dist/server/{prefetchBlockData-Bvx0SiIM.mjs → prefetchBlockData-BvbxqeKn.mjs} +2 -2
  176. package/dist/server/{registry-Bh0Y25zH.mjs → registry-Fv-7D8o2.mjs} +264 -48
  177. package/dist/server/rendering/components/pageShared.mjs +1 -1
  178. package/dist/server/rendering/helpers/loadPage.mjs +1 -1
  179. package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +1 -1
  180. package/dist/server/rendering/server.mjs +3 -3
  181. package/dist/server/rendering.mjs +7 -7
  182. package/dist/server/{resolveBlockData-CnHHst9r.mjs → resolveBlockData-xPgkvoWS.mjs} +1 -1
  183. package/dist/server/server.mjs +3 -3
  184. package/dist/server/theme-bridge.mjs +1 -1
  185. package/dist/server/theme.mjs +1 -1
  186. package/dist/server/{validation-D2bHWSxJ.mjs → validation-DddhgNdb.mjs} +4 -4
  187. package/dist/server/{version-DkM1eAxG.mjs → version-D_W2mt8w.mjs} +1 -1
  188. package/dist/styles/index.css +6 -3
  189. package/package.json +1 -1
  190. package/dist/client/creditProducts-BOWi1QLp.mjs +0 -62
  191. package/dist/client/src-CdRISvQp.mjs +0 -3
  192. package/dist/preview-next/client/src-BP8771hw.mjs +0 -3
@@ -1,8 +1,8 @@
1
1
  "use client";
2
- import { $ as pageEvidenceEvents, $c as resolveEventTimeZone, $f as featureCardCompositionTreatmentValues, $h as surfaceInkStyle, $i as getEventIdentity, $l as teamMemberBiography, $o as paymentChoicePrice, $r as getShopDisplayForItems, $s as normalizeTicketSelectionLines, $u as resolveSectionSurfaceForeground, $v as unsafeAsSiteId, A_ as generateUuidV4, Ac as getInitialFieldValue, Ag as surfaceInkPublication, Ao as isRegistrationLocked, Ap as editorAdmissionRefusal, As as ENTITLEMENT_SINGLE_TICKET_TOOLTIP, Av as parseLocalScheduleTime, Ba as EVENT_BOOKING_ARRIVAL_QUERY, Bc as buildCalendarViewport, Bf as boundaryRuntimeMetricsForDecorativeTransition, Bg as expandPalette, Bh as generateInteractiveChildInheritanceCSS, Bi as eventCollectionHydrationSchema, Bm as Item$1, Bo as resolveGuestNextStepCheck, Bp as ApiEnvelopeError, Br as newsletterBlockSubmissionMessage, Bs as getPortalSubjectEmail, Bv as publicEventPricingStrategy, C_ as getBookingLaterInstalments, Ca as computeMediaTransformStyle, Cc as deriveBookingQuestions, Cd as buildGeneratedBlockIconRenderAssetLookupFromUnknown, Cf as compiledRuntimeStyleFieldNames, Cg as FONT_SIZE_MAP, Ci as buildEventCalendarListingDisplay, Cl as blockBookingConsentSchema, Co as registrationRoute, Cs as ok, Cu as resolvedItemSurfaceProps, Cv as formatBookingCompactEnglishTime, D_ as nextLiveRunSessionStartMs, Dc as toBookingQuestionsAnswerDraft, Dd as resolveBlockIconRenderValue, Df as getGradientPreset, Dg as ownedThemeSnapshot, Dl as beforeBookingQuestionsPresentationSchema, Dm as DialogTrigger, Do as createInitialRegistrationFlowState, Dp as EDITOR_LOADING_NOTICE, Ds as reportWorkflowSuccess, Dv as getBookingLocalDateKey, E_ as CANCELLED_SESSION_STATUS, Ea as renderVideo, Ec as restoreBookingQuestionsAnswers, Ed as parseBlockIconValue, Eg as freezeOwnedThemeValue, Eh as bindingSchema, El as toBookingRequirementConsentField, Em as DialogTitle, Eo as areEventRegistrationPaymentSelectionsEqual, Ep as isRecord$14, Es as reportWorkflowError, Eu as Grid, Ev as formatLocalScheduleDate, Fc as formatEventPrice, Ff as buildTextContrastShadow, Fg as inkReference, Fi as eventListingBlockRuntime, Fo as fullyBookedLabel, Fp as BEFORE_BOOKING_QUESTIONS_ROUTE, Fs as formatEventDateTime, Fv as toUtcIsoDateTimeString, Ga as bookingNowSchema, Gc as formatEventClockLabel, Gf as anglePolygonCss, Gg as oklchToHexGamut, Gh as SURFACE_FOREGROUND_CSS_VARS, Gi as calendarWindowBounds, Go as visitorHoldsOwnPlace, Gr as productDetailBlockDefinition, Gs as withOccurrenceTitle, Gt as ApiRequestError, Gv as toNonNegativeCents, H_ as sameMailingListPlacementTargeting, Ha as buildEventRegistrationDisplayFromScopedEvents, Hc as eventDateOptions, Hg as hexToRgb, Hh as BUTTON_CONTRAST_POLICY, Hi as calendarMonthKey, Hm as createRovingFocusGroupScope, Ho as resolveRegistrationAvailabilityBlocker, Hp as unwrapResponse, Hr as buildGiftingInteractiveIslandProps, Hs as getVisibleTicketTypes, Hu as isBlockButtonRole, Hv as resolveExactOrFreePriceDisplay, Ic as formatEventPriceAmount, If as generateNavLinkCSS, Ig as resolveConcreteColorHex, Ii as buildEventCollectionDisplay, Io as getTicketSelectionPurpose, Ip as calendarMonthDate, Is as formatPassCreditUsageLabel, Iv as formatBookingPriceDisplay, Ja as resolveEventCalendarReadPlan, Jc as formatEventHourLabel, Jd as heroPhotoPaintsGround, Jh as surfaceForegroundInputFromResolved, Ji as planCalendarMonthRanges, Jl as composeHeaderSectionWrapperClassName, Jo as resolveEventRegistrationSubmitPlan, Jp as Select, Jr as buildCartInteractiveIslandProps, Js as getSingleSelectedPricingOptionId, Ju as normalizeBoxStylesBorder, K as createSessionJournalBindings, Ka as previewStageSchema, Kc as formatEventCompactDateRail, Kf as transitionCatalogueEntries, Kg as rgbToHex, Kh as SURFACE_INK_CSS_VARS, Ki as calendarWindowMonths$1, Kl as siteTopChromeMeasurementTargets$1, Ko as isEventRegistrationAvailable, Kr as productListBlockDefinition, Ks as formatPrice, Ku as boxStylesTransforms, Kv as formatCurrencyAmount, La as getCardOrientation, Lc as formatEventPriceDisplay, Ld as inlineTextToPlainText, Lf as formatSiteChromeBackgroundTokenLabel, Lg as resolveOpaqueSurfaceHex, Li as buildEventCollectionHydration, Ll as siteFooterManifest, Lo as placeCountCeiling, Lr as newsletterSignupBlockDefinition, Ls as formatRegistrationSchedule, Lv as isPublicEventPricingOptionDisplayable, Mc as eventListWeekDays, Md as coerceInlineTextWithFallback, Mf as generateDefaultCardSystem, Mg as HOVER_TEXT_THRESHOLD, Mo as buildEventRegistrationPaymentOptionsViewModel, Mp as observeEditorAdmission, Ms as findSelectedTicketType, Mv as resolveBookingTimeZoneId, N_ as parseMailingListRuntimeContext, Nc as buildMonthDay, Nd as deriveInlineTextFieldChanges, Ng as certifyPaint, Ni as eventListingBlockDefinition, Nl as resolveFeatureCardGeneratedIconSizePx, No as decideEventRegistrationPayment, Ns as formatBookingWhen, Nv as toBookingTimeZone, O_ as orderedLiveRunSessions, Oc as toBookingQuestionsPaymentSnapshot, Og as resolveSurfaceForeground, Oo as decideEventChoice, Os as confirmationPaymentRows, Ov as getLocalScheduleDate, P_ as resolveBookingSignupOffer, Pc as resolveMonthSelectedDay, Pf as generateFooterCss, Pg as contrastThresholdByPolicy, Pi as buildEventListingInteractiveIslandProps, Pl as shouldReserveFeatureCardIconZone, Po as shouldPromptForLogin, Pp as API_ENDPOINTS, Pr as normalizeLocationMapProps, Ps as formatDate$3, Pv as parseUtcIsoDateTimeString, Qc as groupEventsByDate, Qh as surfaceInkDeclarations, Qi as eventPaginationLoadReducer, Ql as parseTeamMemberSpecialties, Qo as paymentChoiceDetails, Qp as SelectValue, Qr as buildShopInteractiveIslandProps, Qs as hasValidPricingOptionSelection, Qu as parseRuntimeBackgroundContent, R_ as parseMailingListPlacementTargeting, Ra as getContainerClass, Rc as formatEventTeacherLine, Rd as isInlineTextEmpty, Rf as headerNeedsPhotoShade, Ri as buildEventCollectionListingDisplay, Rl as siteHeaderManifest, Ro as planRegistrationDetailsCheck, Rp as pageCommitReasonMessage, Rr as NEWSLETTER_SIGNUPS_PAUSED_MESSAGE, Rs as formatTime$3, Rv as publicEventPricingCurrency, S_ as resolveAvailableBookingCollectionOptions, Sa as MediaPlaceholder, Sc as decideBookingQuestionsRestoration, Sd as sanitizeHref, Sf as requireCuratedSiteStyle, Sg as DEFAULT_BUTTON_SIZES, Si as buildEventCalendarInteractiveIslandProps, Sl as blockBookingPaymentTermsSchema, Sm as DialogContent, So as registrationPresentation, Sp as MQ_TABLET_ONLY, Ss as err, Su as lookListPresentationSchemaShape, Sv as resolveBookingDisplayContext, T_ as authoredValuesEqual, Ta as renderAudio, Tc as needsBookingQuestionsRefresh, Tf as gradientToCss, Tg as mapButtonVisualAppearances, Th as unmanagedSurfaceEditability, Tl as isBookingRequirementConsentFieldId, Tm as DialogPortal, To as registrationStepLabelContext, Tp as isObjectRecord, Ts as clearWorkflowFeedback, Tv as addLocalScheduleDays, Ua as buildEventRegistrationInteractiveIslandProps, Uc as formatCalendarTitle, Ug as oklabToOklch, Uh as formatButtonColourContractError, Ui as calendarPageResponseError, Um as Presence, Uo as resolveRegistrationTicketContinuation, Ur as checkoutBlockDefinition, Us as occurrenceTitleOverride, Uv as resolvePricingOptionsPriceDisplay, Va as eventRegistrationBlockDefinition, Vc as eventCalendarWeekStart, Vd as parseInlineTextFromUnknown, Vg as contrastRatio, Vh as compileButtonColourStates, Vi as eventCollectionSourceSchemaShape, Vm as Root$1, Vo as resolveRegistrationAdmission, Vp as extractApiEnvelopeErrorDetails, Vr as giftingBlockDefinition, Vs as getTicketTypeAvailabilityLabel, Vv as publicEventPricingType, Wa as displayButtonText, Wc as formatDate$1, Wg as oklabToSrgb, Wh as DEFAULT_SURFACE_TEXT_COLOR, Wi as calendarQueryKey, Wl as measureSiteTopChromeBottomPx, Wo as settledRemainingPlaces, Wr as cartBlockDefinition, Ws as transformRegistrationOptionsResponse, Wv as parsePositiveCents, Xa as resolveEventRegistrationScopedEvents, Xc as formatEventTimeRange, Xd as readOpeningToneProjection, Xg as customCssRuleSchema, Xh as surfaceForegroundValue, Xi as createInitialEventPaginationLoadState, Xl as splitPositioningClasses, Xm as useSize, Xo as buildBookingPaymentSelectionViewModel, Xp as SelectItem, Xr as buildProductDetailInteractiveIslandProps, Xs as getTicketSelectionTotal, Xu as parseBackgroundContent, Xv as unsafeAsPositiveByteCount, Y as SessionJournalProvider, Ya as normalizeEventRegistrationPageSurfaceSubject, Yc as formatEventNextDateFact, Yd as effectiveHeaderNavLinkStyle, Yg as blockCustomCssRuleSchema, Yh as surfaceForegroundStyle, Yi as resolveCalendarReadProfile, Yl as markEditableSurfaceForwarding, Yn as planArrangementContent, Yo as calculateEventRegistrationPreviewTotal, Yp as SelectContent, Yr as buildCheckoutInteractiveIslandProps, Ys as getTicketLineQuantity, Yu as resolveCardRoleForBoxStyles, Z_ as publishedContactDetails, Za as offeringNounForEvent, Zc as formatTime$1, Zg as boxBackgroundSchema, Zh as surfaceForegroundValueWithOpacity, Zi as eventPageOperationQuery, Zl as contentTransforms, Zm as useId$1, Zo as buildReviewedBookingPaymentViewModel, Zp as SelectTrigger, Zr as buildProductListInteractiveIslandProps, Zs as getTicketTypeLineMax, Zu as parseBackgroundOverlay, Zv as unsafeAsPositiveSeconds, _ as applyBindingsToContent, __ as siteChromeBackgroundOverrideOwner, _a as MapPinIcon, _c as NO_BOOKING_QUESTIONS, _f as designRuntimeRulesForTheme, _g as buttonStateAppearanceDeclarations, _h as useComposedRefs, _l as selectMostOpenCapacitySource, _n as remoteDraftValues, _o as bookingEntryProgress, _p as MQ_LG_UP, _s as resolveHeldTicketPlaces, _u as defineClientOwnedBlockRuntime, aa as getEventRuntimeFiltersKey, ac as eventSignInDraftStore, ad as lookCarouselRegionTransform, af as skinTokenCssVars, ag as textColorValue, ah as useLayoutEffect2, ai as formatInterval, al as getBlockApiReadStage, ap as PUBLIC_DOWNLOAD_MEDIA_TYPES, ar as getAtPath, as as toRegistrationRequestSubject, au as chromeLogoTransforms, bc as bookingQuestionsPaymentSnapshotSchema, bg as paddingDeclarations, bi as eventCalendarBlockDefinition, bl as groupPublicEventsByRun, bm as Dialog, bn as resolveRenderedValues, bo as panelShouldOpen, bp as MQ_SM_DOWN, bs as validateFormData, bu as listLookControl, bv as formatTimeZoneCityLabel, c as usePreviewShownTheme, ca as normalizeOptionalId, cc as toEventSignInDraft, cd as lookSkinSlotTransform, cg as parseSurfaceTree, ch as Primitive, ci as passCardListContent, cl as canJoinEventWaitlist, cr as EventHeader, cs as invitationSubmission, da as EmptyState, dc as decideSignInReturn, dd as runTransforms, dg as serializeSurfaceTree, di as buildProductCartItem, dl as formatTotalCapacity, dm as NATIVE_CHOICE_CLASS, do as resolveOfferingsPreviewGroups, dr as eventCardListContent, ds as getEligibilityFlowFlags, dt as JournalWriteRefused, du as formBlockDefinition, ea as getEventPaginationView, ec as setTicketLineQuantity, ed as resolveSurfaceForegroundStyles, eg as backgroundColorStyle, ei as shopProductPresentation, el as resolveEventCardBooking, em as usePrevious, ep as introCompositionTreatmentValues, es as findPreSelectedEvent, eu as teamMemberCardBiography, fa as CardListCollection, fc as nextSignInReturnExpiry, fd as el, ff as arrangementManifestFromVariants, fg as compositeHex, fh as useControlReadiness, fi as deriveCommerceCheckoutState, fl as getEventAvailability, fo as resolveOfferingsRenderInput, fr as deriveEventScheduleSummary, fs as getRegistrationOccurrenceId, ft as journalFailureReason, fu as buildFormInteractiveIslandProps, g_ as parseGradientPresetId, ga as CalendarIcon, gc as EMPTY_BOOKING_QUESTIONS_ANSWERS, gf as componentRuntimeRulesForTheme, gg as buttonShadow, gl as selectEventCapacitySource, go as bookingEntry, gs as parseCurrencyInputToCents, gu as createZodCodec, gv as formatDate$2, h as composePreviewTheme, h_ as surfaceCardRoleValues, ha as eventCategoryBadge, hc as sweepExpiredSignInReturnDrafts, hg as buttonRadius, hi as reduceCommerceCart, hl as isEventFull, ho as bookingCardEntry, hr as EventListingFrameView, hs as getTicketSelectionRemainingPlaces, hu as defineInteractiveIslandMetaKeys, ia as buildEventRuntimeFilters, ic as EVENT_SIGN_IN_FORM_ID, id as getAnchorClasses, if as restoreCompiledRuntimeFieldsFromContent, ig as textColorStyle, ih as useControllableState, ii as formatCommercePrice, il as browserReadAuthoritySchema, ir as lookPartShown, is as resolveRouteRequiresPayment, iu as headerRuntimeTransforms, ja as resolvePublicMediaUrl, jc as buildEventListWeek, jf as resolveCardRole, jg as solveSurfaceInks, jo as registrationFlowReducer, jp as editorAdmissionSession, jr as getBlockDefinition, js as areEntitlementsDisabledForTicketCount, jv as resolveBookingBusinessTimeZone, k_ as resolveWholeSeriesBookingPhase, ka as resolveMediaNodeResponsiveImage, kc as checkBookingQuestionsAnswered, kg as safeTokenOr, kl as FEATURE_CARD_ICON_TREATMENTS, ko as getDeclinedPass, ks as resolveFinishedPresentation, kv as parseBookingLocalDate, l_ as indexRenderableMediaAssets, la as catalogueEventCardProps, lc as clearSignInReturnDrafts, ld as asPartialObject, lg as prepareSurfaceIndex, li as EMPTY_COMMERCE_CART_STATE, ll as canJoinEventWaitlistOnAnyMode, lm as FIELD_SURFACE_CLASS, lo as resolveOfferingsPreviewGroupCta, lr as EVENT_REGISTRATION_ANCHOR_ID, ls as formatCentsAsCurrencyInput, lt as getEditorClientId, lu as uiTransforms, ma as EventItem, mc as signInReturnPath, md as parseStoredVariant, mf as resolveEffectiveArrangement, mg as buttonBorder, mi as productItemKey, ml as getRemainingPlaces, mo as bookingBarPlacement, mr as MonthLookView, ms as getSlidingScaleSelectionMessage, mu as createInteractiveIslandCodec, mv as unsafeAsEditorBlockId, na as toEventPaginationLoadError, nc as toRegistrationEvents, nf as compileEditorModelRuntime, ng as mergeStyles, nh as useDirection, ni as buildProductCardDisplay, nl as resolveEventLinkProps, nn as useOptionalEditorUiStoreInstance, no as buildOfferingsPreviewListing, np as testimonialsCompositionTreatmentValues, ns as resolveEventRequiresPayment, nu as resolveDateRuntimeContext, nv as EDITOR_SESSION_GENERATION_HEADER, o_ as runtimeMediaSchema, oa as normalizeCsvIds, oc as eventSignInEnds, od as lookLeadSlotTransform, of as mergeHeaderNavTypographyPreference, og as opaqueSurfaceContextFromTheme, oh as createContextScope, oi as membershipCardListContent, ol as placesLeftLabel, om as FIELD_CONTROL_CLASS, oo as normalizeOfferingsPreviewItemLimit, os as beginWaitlistInvitation, ou as layoutTransforms, pa as CardListItems, pc as readSignInReturn, pd as when, pg as actionVariableFallback, pi as parseStoredCommerceCartState, pl as getEventAvailabilityStatus, po as DEFAULT_BOOKING_BUTTON_TEXT, pr as derivePreviewRunSchedule, ps as getSlidingScaleForEvent, pt as sendPageCommand, pu as buildInteractiveIslandProps, q_ as knownSocialPlatformLabels, qa as eventCalendarListGroupingDecision, qc as formatEventDateParts, qd as selectItemSurfacePresentation, qf as resolveCompiledSectionContextFromContent, qg as srgbToOklab, qh as surfaceForegroundDeclarations, qi as calendarWindowPageSchema, qo as normalizeEventRegistrationMaxTickets, qp as trustedJournalState, qr as shopBlockDefinition, qs as canRequestTicketOption, qu as boxStyleClassNames, qv as assertNever$1, ra as toError, rc as toWholeSeriesRegistrationEvents, rd as BACKGROUND_POSITION_PRESET_VALUES, rg as rgbColorValue, rh as createCollection, ri as buildProductDetailDisplay, rl as resolveRuntimeEventDestination, rs as resolveRegistrationTarget, ru as mediaTransforms, s as usePreviewPageDesignRenderState, sa as normalizeCsvString, sc as eventSignInRestoration, sd as lookQuoteLimitTransform, sf as readHeaderNavFontSizePreference, sg as opaqueSurfaceDeclarations, sh as composeEventHandlers, si as membershipClassesLabel, sl as shownVenue, sm as FIELD_FOCUS_CLASS, so as offeringsListingFor, sr as withValueAtPath, ss as createRegistrationDraftData, su as staticHeaderChromeRuntime, ta as planEventPageOperation, tc as getRegistrationStartAt, td as resolveBackgroundColorValue, tf as applyCompiledRuntimeFieldsToContent, tg as cssVarValue, ti as buildCartDisplay, tl as resolveEventCta, to as OFFERINGS_PREVIEW_EVENT_PRESET_DEFINITIONS, tp as offeringsPreviewCompositionTreatmentValues, ts as resolveDiscountContext, tu as readRuntimeNow, ty as parseUuidBrand, u as useSiteChromeCustomizeOptional, ua as listingEventCardProps, uc as createSignInReturnDraftStore, ud as createTransformRegistry, uf as arrangementLookHooks, ug as resolveSurface, uh as Button, ui as buildPassCartItem, ul as formatEventRemainingPlaces, um as FIELD_TEXTAREA_CLASS, ur as EVENT_REGISTRATION_CHECKOUT_ATTEMPT_PARAM, us as getCurrentTicketSelection, ut as createSessionJournal, uu as formattingTransforms, v_ as asDesignBlockId, va as MediaNodeServer, vc as applyBookingQuestionsAnswerEvent, vg as buttonTypographyDeclarations, vh as cn$1, vi as buildOfferingsCatalogueListing, vl as blockSiteTermsSchema, vn as renderSourceFor, vo as bookingPanelHeading, vp as MQ_MD_DOWN, vs as shouldLoadRegistrationOptions, vu as defineProgressiveBlockRuntime, vv as formatDateTimeRange, w_ as journalReplayValue, wa as mediaImageHostProps, wc as isBookingQuestionsAnswerEvent, wf as surfaceResolutionContextFromTheme, wg as generateShadowValue$1, wi as buildEventCalendarListingRender, wo as registrationStepLabel, ws as okWith, wu as itemRole, wv as toScheduledBookingDateTime, x_ as normalizeCurrencyCode, xa as ImagePresets, xc as bookingQuestionsRefusal, xg as BORDER_WIDTH_MAP, xm as DialogClose, xo as registrationPaymentRoute, xp as MQ_SM_UP, xs as assertNever$2, xu as listLookSlot, xv as inferSiteDateLocale, ya as RichText, yc as bookingQuestionsAnswerDraftSchema, yd as RichTextDocSchema, yf as headerStyleRecipeForTheme, yg as materializeRuntimeButtonAppearance, yi as offeringsCatalogueShape, yl as verifiedSiteTermsAcceptanceSchema, yo as getEventSelectionMode, yp as MQ_MD_UP, ys as registrationQuestionsMessage, yu as listItemPresentation, yv as formatTime$2, z_ as parseMailingListVisitorSelection, za as resolveEventSelection, zc as formatEventDuration, zf as headerRootPaint, zg as TokenResolver, zh as generateEffectsCSS, zi as eventCollectionDisplaySchemaShape, zl as SITE_CHROME_VISIBLE_HEADER_SELECTOR, zo as planRegistrationDetailsContinuation, zp as pageCommitReasonTag, zr as buildNewsletterFormInteractiveIslandProps, zs as getImplicitSingleTicketType, zv as publicEventPricingDisplay } from "./previewAssistantSlot-BBdN5kfY.mjs";
2
+ import { $ as pageEvidenceEvents, $c as formatTime$1, $f as anglePolygonCss, $g as oklchToHexGamut, $h as SURFACE_FOREGROUND_CSS_VARS, $i as eventPaginationLoadReducer, $o as paymentChoiceDetails, $r as getShopDisplayForItems, $s as getTicketTypeLineMax, $v as toNonNegativeCents, A_ as resolveAvailableBookingCollectionOptions, Aa as resolveMediaNodeResponsiveImage, Ac as toBookingQuestionsPaymentSnapshot, Ad as sanitizeHref, Af as requireCuratedSiteStyle, Ag as DEFAULT_BUTTON_SIZES, Al as blockBookingPaymentTermsSchema, Am as DialogContent, Ao as getDeclinedPass, Ap as MQ_TABLET_ONLY, As as confirmationPaymentRows, Au as lookListPresentationSchemaShape, Av as resolveBookingDisplayContext, Ba as resolveEventSelection, Bc as formatEventTeacherLine, Bd as coerceInlineTextWithFallback, Bf as generateDefaultCardSystem, Bg as HOVER_TEXT_THRESHOLD, Bi as eventCollectionDisplaySchemaShape, Bo as planRegistrationDetailsContinuation, Bp as observeEditorAdmission, Br as newsletterBlockSubmissionMessage, Bs as formatTime$3, Bv as resolveBookingTimeZoneId, C_ as surfaceCardRoleValues, Ca as MediaPlaceholder, Cc as bookingQuestionsRefusal, Cg as buttonRadius, Ci as buildEventCalendarInteractiveIslandProps, Cl as canonicalUrl, Co as registrationPresentation, Cs as assertNever$2, Cu as defineInteractiveIslandMetaKeys, Da as renderVideo, Dc as needsBookingQuestionsRefresh, Dd as RichTextDocSchema, Df as headerStyleRecipeForTheme, Dg as materializeRuntimeButtonAppearance, Dl as publicPassProductCollectionSchema, Do as areEventRegistrationPaymentSelectionsEqual, Dp as MQ_MD_UP, Ds as clearWorkflowFeedback, Du as listItemPresentation, Dv as formatTime$2, E_ as asDesignBlockId, Ea as renderAudio, Ec as isBookingQuestionsAnswerEvent, Eg as buttonTypographyDeclarations, Eh as cn$1, El as requestSignIn, Eo as registrationStepLabelContext, Ep as MQ_MD_DOWN, Es as okWith, Eu as defineProgressiveBlockRuntime, Ev as formatDateTimeRange, F_ as nextLiveRunSessionStartMs, Fc as buildMonthDay, Fd as resolveBlockIconRenderValue, Ff as getGradientPreset, Fg as ownedThemeSnapshot, Fi as buildEventListingInteractiveIslandProps, Fl as beforeBookingQuestionsPresentationSchema, Fm as DialogTrigger, Fo as shouldPromptForLogin, Fp as EDITOR_LOADING_NOTICE, Fs as formatBookingWhen, Fv as getBookingLocalDateKey, Ga as displayButtonText, Gc as formatCalendarTitle, Gd as inlineTextToPlainText, Gf as formatSiteChromeBackgroundTokenLabel, Gg as resolveOpaqueSurfaceHex, Gi as calendarQueryKey, Gl as siteFooterManifest, Go as settledRemainingPlaces, Gr as productDetailBlockDefinition, Gs as occurrenceTitleOverride, Gt as ApiRequestError, Gv as isPublicEventPricingOptionDisplayable, H_ as resolveBookingSignupOffer, Ha as eventRegistrationBlockDefinition, Hc as buildCalendarViewport, Hf as generateFooterCss, Hg as contrastThresholdByPolicy, Hi as eventCollectionSourceSchemaShape, Hl as shouldReserveFeatureCardIconZone, Ho as resolveRegistrationAdmission, Hp as API_ENDPOINTS, Hr as buildGiftingInteractiveIslandProps, Hs as getPortalSubjectEmail, Hv as parseUtcIsoDateTimeString, I_ as orderedLiveRunSessions, Ic as resolveMonthSelectedDay, Ig as resolveSurfaceForeground, Ii as eventListingBlockRuntime, Io as fullyBookedLabel, Is as formatDate$3, Iv as getLocalScheduleDate, Ja as eventCalendarListGroupingDecision, Jc as formatEventCompactDateRail, Jf as boundaryRuntimeMetricsForDecorativeTransition, Jg as expandPalette, Jh as generateInteractiveChildInheritanceCSS, Ji as calendarWindowPageSchema, Jm as Item$1, Jo as normalizeEventRegistrationMaxTickets, Jp as ApiEnvelopeError, Jr as buildCartInteractiveIslandProps, Js as formatPrice, Jv as publicEventPricingStrategy, K as createSessionJournalBindings, K_ as parseMailingListPlacementTargeting, Ka as bookingNowSchema, Kc as formatDate$1, Kd as isInlineTextEmpty, Kf as headerNeedsPhotoShade, Ki as calendarWindowBounds, Kl as siteHeaderManifest, Ko as visitorHoldsOwnPlace, Kp as pageCommitReasonMessage, Kr as productListBlockDefinition, Ks as transformRegistrationOptionsResponse, Kv as publicEventPricingCurrency, L_ as resolveWholeSeriesBookingPhase, Lc as formatEventPrice, Lg as safeTokenOr, Li as buildEventCollectionDisplay, Ll as FEATURE_CARD_ICON_TREATMENTS, Lo as getTicketSelectionPurpose, Lr as newsletterSignupBlockDefinition, Ls as formatEventDateTime, Lv as parseBookingLocalDate, M_ as journalReplayValue, Ma as resolvePublicMediaUrl, Mc as getInitialFieldValue, Mf as surfaceResolutionContextFromTheme, Mg as generateShadowValue$1, Mo as registrationFlowReducer, Ms as ENTITLEMENT_SINGLE_TICKET_TOOLTIP, Mu as itemRole, Mv as toScheduledBookingDateTime, N_ as authoredValuesEqual, Nc as buildEventListWeek, Nf as gradientToCss, Ng as mapButtonVisualAppearances, Nh as unmanagedSurfaceEditability, Nl as isBookingRequirementConsentFieldId, Nm as DialogPortal, No as buildEventRegistrationPaymentOptionsViewModel, Np as isObjectRecord, Ns as areEntitlementsDisabledForTicketCount, Nv as addLocalScheduleDays, Oc as restoreBookingQuestionsAnswers, Og as paddingDeclarations, Ol as groupPublicEventsByRun, Om as Dialog, Oo as createInitialRegistrationFlowState, Op as MQ_SM_DOWN, Os as reportWorkflowError, Ou as listLookControl, Ov as formatTimeZoneCityLabel, P_ as CANCELLED_SESSION_STATUS, Pc as eventListWeekDays, Pd as parseBlockIconValue, Pg as freezeOwnedThemeValue, Ph as bindingSchema, Pi as eventListingBlockDefinition, Pl as toBookingRequirementConsentField, Pm as DialogTitle, Po as decideEventRegistrationPayment, Pp as isRecord$14, Pr as normalizeLocationMapProps, Ps as findSelectedTicketType, Pu as Grid, Pv as formatLocalScheduleDate, Qa as offeringNounForEvent, Qc as formatEventTimeRange, Qg as oklabToSrgb, Qh as DEFAULT_SURFACE_TEXT_COLOR, Qi as eventPageOperationQuery, Ql as measureSiteTopChromeBottomPx, Qo as buildReviewedBookingPaymentViewModel, Qr as buildShopInteractiveIslandProps, Qs as getTicketSelectionTotal, Qv as parsePositiveCents, R_ as generateUuidV4, Ra as getCardOrientation, Rc as formatEventPriceAmount, Rg as surfaceInkPublication, Ri as buildEventCollectionHydration, Ro as placeCountCeiling, Rp as editorAdmissionRefusal, Rr as NEWSLETTER_SIGNUPS_PAUSED_MESSAGE, Rs as formatPassCreditUsageLabel, Rv as parseLocalScheduleTime, Sa as ImagePresets, Sc as bookingQuestionsPaymentSnapshotSchema, Sd as parseStoredVariant, Sf as resolveEffectiveArrangement, Sg as buttonBorder, Sl as PAGE_NAVIGATION, So as registrationPaymentRoute, Ss as validateFormData, Su as createInteractiveIslandCodec, Sv as unsafeAsEditorBlockId, T_ as siteChromeBackgroundOverrideOwner, Ta as mediaImageHostProps, Tc as deriveBookingQuestions, Tf as designRuntimeRulesForTheme, Tg as buttonStateAppearanceDeclarations, Th as useComposedRefs, Ti as buildEventCalendarListingRender, Tl as pageNavigationSchema, To as registrationStepLabel, Tp as MQ_LG_UP, Ts as ok, Tu as defineClientOwnedBlockRuntime, Ua as buildEventRegistrationDisplayFromScopedEvents, Uc as eventCalendarWeekStart, Uf as buildTextContrastShadow, Ug as inkReference, Ui as calendarMonthKey, Uo as resolveRegistrationAvailabilityBlocker, Up as BEFORE_BOOKING_QUESTIONS_ROUTE, Ur as checkoutBlockDefinition, Us as getTicketTypeAvailabilityLabel, Uv as toUtcIsoDateTimeString, V_ as parseMailingListRuntimeContext, Va as EVENT_BOOKING_ARRIVAL_QUERY, Vc as formatEventDuration, Vd as deriveInlineTextFieldChanges, Vg as certifyPaint, Vi as eventCollectionHydrationSchema, Vl as resolveFeatureCardGeneratedIconSizePx, Vo as resolveGuestNextStepCheck, Vr as giftingBlockDefinition, Vs as getImplicitSingleTicketType, Vv as toBookingTimeZone, Wa as buildEventRegistrationInteractiveIslandProps, Wc as eventDateOptions, Wf as generateNavLinkCSS, Wg as resolveConcreteColorHex, Wi as calendarPageResponseError, Wo as resolveRegistrationTicketContinuation, Wp as calendarMonthDate, Wr as cartBlockDefinition, Ws as getVisibleTicketTypes, Wv as formatBookingPriceDisplay, X_ as sameMailingListPlacementTargeting, Xa as normalizeEventRegistrationPageSurfaceSubject, Xc as formatEventHourLabel, Xg as hexToRgb, Xh as BUTTON_CONTRAST_POLICY, Xi as resolveCalendarReadProfile, Xm as createRovingFocusGroupScope, Xo as calculateEventRegistrationPreviewTotal, Xp as unwrapResponse, Xr as buildProductDetailInteractiveIslandProps, Xs as getSingleSelectedPricingOptionId, Xu as isBlockButtonRole, Xv as resolveExactOrFreePriceDisplay, Y as SessionJournalProvider, Ya as resolveEventCalendarReadPlan, Yc as formatEventDateParts, Yd as parseInlineTextFromUnknown, Yg as contrastRatio, Yh as compileButtonColourStates, Yi as planCalendarMonthRanges, Ym as Root$1, Yn as planArrangementContent, Yo as resolveEventRegistrationSubmitPlan, Yp as extractApiEnvelopeErrorDetails, Yr as buildCheckoutInteractiveIslandProps, Ys as canRequestTicketOption, Yv as publicEventPricingType, Za as resolveEventRegistrationScopedEvents, Zc as formatEventNextDateFact, Zg as oklabToOklch, Zh as formatButtonColourContractError, Zi as createInitialEventPaginationLoadState, Zm as Presence, Zo as buildBookingPaymentSelectionViewModel, Zr as buildProductListInteractiveIslandProps, Zs as getTicketLineQuantity, Zv as resolvePricingOptionsPriceDisplay, _ as applyBindingsToContent, __ as indexRenderableMediaAssets, _a as CalendarIcon, _c as sweepExpiredSignInReturnDrafts, _d as asPartialObject, _g as prepareSurfaceIndex, _l as isEventFull, _m as FIELD_SURFACE_CLASS, _n as remoteDraftValues, _o as bookingEntry, _s as parseCurrencyInputToCents, _u as uiTransforms, a_ as boxBackgroundSchema, aa as buildEventRuntimeFilters, ac as toWholeSeriesRegistrationEvents, ad as parseBackgroundOverlay, ag as surfaceForegroundValueWithOpacity, ah as useId$1, ai as formatInterval, al as resolveRuntimeEventDestination, am as SelectTrigger, ar as getAtPath, as as resolveRouteRequiresPayment, au as contentTransforms, av as publishedContactDetails, ay as unsafeAsPositiveSeconds, ba as RichText, bc as applyBookingQuestionsAnswerEvent, bd as el, bf as arrangementManifestFromVariants, bg as compositeHex, bh as useControlReadiness, bi as offeringsCatalogueShape, bl as blockSiteTermsSchema, bn as resolveRenderedValues, bo as getEventSelectionMode, bs as withRegistrationAvailability, bu as buildFormInteractiveIslandProps, c as usePreviewShownTheme, ca as normalizeCsvString, cc as eventSignInEnds, cd as resolveSurfaceForegroundStyles, cg as backgroundColorStyle, ci as membershipClassesLabel, cl as placesLeftLabel, cm as usePrevious, co as offeringsListingFor, cp as introCompositionTreatmentValues, cr as EventHeader, cs as createRegistrationDraftData, cu as teamMemberCardBiography, da as listingEventCardProps, dc as clearSignInReturnDrafts, dd as BACKGROUND_POSITION_PRESET_VALUES, dg as rgbColorValue, dh as createCollection, di as buildPassCartItem, dl as canJoinEventWaitlistOnAnyMode, dr as eventCardListContent, ds as getCurrentTicketSelection, dt as JournalWriteRefused, du as mediaTransforms, e_ as rgbToHex, ea as getEventIdentity, ec as hasValidPricingOptionSelection, ed as boxStylesTransforms, eg as SURFACE_INK_CSS_VARS, ei as shopProductPresentation, el as groupEventsByDate, ep as transitionCatalogueEntries, es as paymentChoicePrice, eu as siteTopChromeMeasurementTargets$1, ey as formatCurrencyAmount, fa as EmptyState, fc as createSignInReturnDraftStore, fd as getAnchorClasses, ff as restoreCompiledRuntimeFieldsFromContent, fg as textColorStyle, fh as useControllableState, fi as buildProductCartItem, fl as formatEventRemainingPlaces, fo as resolveOfferingsPreviewGroups, fr as deriveEventScheduleSummary, fs as getEligibilityFlowFlags, ft as journalFailureReason, fu as headerRuntimeTransforms, ga as eventCategoryBadge, gc as signInReturnPath, gd as lookSkinSlotTransform, gg as parseSurfaceTree, gh as Primitive, gi as reduceCommerceCart, gl as getRemainingPlaces, go as bookingCardEntry, gs as getTicketSelectionRemainingPlaces, h as composePreviewTheme, ha as EventItem, hc as readSignInReturn, hd as lookQuoteLimitTransform, hf as readHeaderNavFontSizePreference, hg as opaqueSurfaceDeclarations, hh as composeEventHandlers, hi as productItemKey, hl as getEventAvailabilityStatus, hm as FIELD_FOCUS_CLASS, ho as bookingBarPlacement, hr as EventListingFrameView, hs as getSlidingScaleSelectionMessage, hu as staticHeaderChromeRuntime, i_ as customCssRuleSchema, ia as toError, ic as toRegistrationEvents, id as parseBackgroundContent, if as readOpeningToneProjection, ig as surfaceForegroundValue, ih as useSize, ii as formatCommercePrice, il as resolveEventLinkProps, im as SelectItem, ir as lookPartShown, is as resolveRegistrationTarget, iu as splitPositioningClasses, iy as unsafeAsPositiveByteCount, j_ as getBookingLaterInstalments, jc as checkBookingQuestionsAnswered, jd as buildGeneratedBlockIconRenderAssetLookupFromUnknown, jf as compiledRuntimeStyleFieldNames, jg as FONT_SIZE_MAP, jl as blockBookingConsentSchema, jo as isRegistrationLocked, jr as getBlockDefinition, js as resolveFinishedPresentation, ju as resolvedItemSurfaceProps, jv as formatBookingCompactEnglishTime, k_ as normalizeCurrencyCode, kc as toBookingQuestionsAnswerDraft, kg as BORDER_WIDTH_MAP, km as DialogClose, ko as decideEventChoice, kp as MQ_SM_UP, ks as reportWorkflowSuccess, ku as listLookSlot, kv as inferSiteDateLocale, la as normalizeOptionalId, lc as eventSignInRestoration, ld as resolveBackgroundColorValue, lf as applyCompiledRuntimeFieldsToContent, lg as cssVarValue, li as passCardListContent, ll as shownVenue, lp as offeringsPreviewCompositionTreatmentValues, lr as EVENT_REGISTRATION_ANCHOR_ID, ls as invitationSubmission, lt as getEditorClientId, lu as readRuntimeNow, ly as parseUuidBrand, m_ as runtimeMediaSchema, ma as CardListItems, mc as nextSignInReturnExpiry, md as lookLeadSlotTransform, mf as mergeHeaderNavTypographyPreference, mg as opaqueSurfaceContextFromTheme, mh as createContextScope, mi as parseStoredCommerceCartState, ml as getEventAvailability, mm as FIELD_CONTROL_CLASS, mo as DEFAULT_BOOKING_BUTTON_TEXT, mr as MonthLookView, ms as getSlidingScaleForEvent, mu as layoutTransforms, na as planEventPageOperation, nc as setTicketLineQuantity, nd as normalizeBoxStylesBorder, nf as heroPhotoPaintsGround, ng as surfaceForegroundInputFromResolved, ni as buildProductCardDisplay, nl as resolveEventCardBooking, nm as Select, nn as useOptionalEditorUiStoreInstance, no as OFFERINGS_PREVIEW_EVENT_PRESET_DEFINITIONS, ns as resolveDiscountContext, nu as composeHeaderSectionWrapperClassName, oa as getEventRuntimeFiltersKey, oc as EVENT_SIGN_IN_FORM_ID, od as parseRuntimeBackgroundContent, og as surfaceInkDeclarations, oi as formatValidity, ol as browserReadAuthoritySchema, om as SelectValue, os as toRegistrationRequestSubject, ou as parseTeamMemberSpecialties, pa as CardListCollection, pc as decideSignInReturn, pd as lookCarouselRegionTransform, pf as skinTokenCssVars, pg as textColorValue, ph as useLayoutEffect2, pi as deriveCommerceCheckoutState, pl as formatTotalCapacity, po as resolveOfferingsRenderInput, pp as PUBLIC_DOWNLOAD_MEDIA_TYPES, pr as derivePreviewRunSchedule, ps as getRegistrationOccurrenceId, pt as sendPageCommand, pu as chromeLogoTransforms, q_ as parseMailingListVisitorSelection, qa as previewStageSchema, qc as formatEventClockLabel, qf as headerRootPaint, qg as TokenResolver, qh as generateEffectsCSS, qi as calendarWindowMonths$1, ql as SITE_CHROME_VISIBLE_HEADER_SELECTOR, qo as isEventRegistrationAvailable, qp as pageCommitReasonTag, qr as shopBlockDefinition, qs as withOccurrenceTitle, qv as publicEventPricingDisplay, r_ as blockCustomCssRuleSchema, ra as toEventPaginationLoadError, rc as getRegistrationStartAt, rd as resolveCardRoleForBoxStyles, rf as effectiveHeaderNavLinkStyle, rg as surfaceForegroundStyle, ri as buildProductDetailDisplay, rl as resolveEventCta, rm as SelectContent, ro as buildOfferingsPreviewListing, rs as resolveEventRequiresPayment, ru as markEditableSurfaceForwarding, s as usePreviewPageDesignRenderState, sa as normalizeCsvIds, sc as eventSignInDraftStore, sd as resolveSectionSurfaceForeground, sg as surfaceInkStyle, si as membershipCardListContent, sl as getBlockApiReadStage, so as normalizeOfferingsPreviewItemLimit, sp as featureCardCompositionTreatmentValues, sr as withValueAtPath, ss as beginWaitlistInvitation, su as teamMemberBiography, sy as unsafeAsSiteId, t_ as srgbToOklab, ta as getEventPaginationView, tc as normalizeTicketSelectionLines, td as boxStyleClassNames, tf as selectItemSurfacePresentation, tg as surfaceForegroundDeclarations, ti as buildCartDisplay, tl as resolveEventTimeZone, tm as trustedJournalState, tp as resolveCompiledSectionContextFromContent, ts as findPreSelectedEvent, tv as knownSocialPlatformLabels, ty as assertNever$1, u as useSiteChromeCustomizeOptional, ua as catalogueEventCardProps, uc as toEventSignInDraft, uf as compileEditorModelRuntime, ug as mergeStyles, uh as useDirection, ui as EMPTY_COMMERCE_CART_STATE, ul as canJoinEventWaitlist, uo as resolveOfferingsPreviewGroupCta, up as testimonialsCompositionTreatmentValues, ur as EVENT_REGISTRATION_CHECKOUT_ATTEMPT_PARAM, us as formatCentsAsCurrencyInput, ut as createSessionJournal, uu as resolveDateRuntimeContext, uv as EDITOR_SESSION_GENERATION_HEADER, va as MapPinIcon, vc as EMPTY_BOOKING_QUESTIONS_ANSWERS, vd as createTransformRegistry, vf as arrangementLookHooks, vg as resolveSurface, vh as Button, vl as selectEventCapacitySource, vm as FIELD_TEXTAREA_CLASS, vn as renderSourceFor, vo as bookingEntryProgress, vs as resolveHeldTicketPlaces, vu as formattingTransforms, w_ as parseGradientPresetId, wa as computeMediaTransformStyle, wc as decideBookingQuestionsRestoration, wf as componentRuntimeRulesForTheme, wg as buttonShadow, wi as buildEventCalendarListingDisplay, wl as leavePage, wo as registrationRoute, ws as err, wu as createZodCodec, wv as formatDate$2, xc as bookingQuestionsAnswerDraftSchema, xd as when, xg as actionVariableFallback, xi as eventCalendarBlockDefinition, xl as verifiedSiteTermsAcceptanceSchema, xo as panelShouldOpen, xs as registrationQuestionsMessage, xu as buildInteractiveIslandProps, ya as MediaNodeServer, yc as NO_BOOKING_QUESTIONS, yd as runTransforms, yg as serializeSurfaceTree, yi as buildOfferingsCatalogueListing, yl as selectMostOpenCapacitySource, ym as NATIVE_CHOICE_CLASS, yo as bookingPanelHeading, ys as shouldLoadRegistrationOptions, yu as formBlockDefinition, za as getContainerClass, zc as formatEventPriceDisplay, zf as resolveCardRole, zg as solveSurfaceInks, zi as buildEventCollectionListingDisplay, zo as planRegistrationDetailsCheck, zp as editorAdmissionSession, zr as buildNewsletterFormInteractiveIslandProps, zs as formatRegistrationSchedule, zv as resolveBookingBusinessTimeZone } from "./previewAssistantSlot-DSR0IdAw.mjs";
3
3
  import { At as sameMeaningfulAddress, Ct as LOCATION_MATCH_THRESHOLDS_METRES, D as Minus, Dt as editLocationValue, Et as decideLocationSave, Ft as locationPinSchema, Gt as err$1, Kt as ok$1, Lt as normalizeLocationAddressText, Mt as decideLocationSourcePermission, Nt as formatLocationAddress, Ot as locationDistanceMetres, Pt as locationAddressSchema, R as Info, Rt as parseLocationValue, T as Mountain, Tt as decideLocationRelationship, U as House, Wt as mapDrawingSchema, _ as RotateCcw, _t as Building2, b as Pencil, c as Trash2, ct as CircleMinus, d as Sparkles, ft as ChevronRight, g as Route, h as Search, k as MapPin, kt as sameLocationSpatialPair, lt as CircleCheck, mt as ChevronDown, n as X, ot as Circle, pt as ChevronLeft, r as WifiOff, s as TriangleAlert, st as CirclePlus, tt as Crosshair, u as Store, w as Move, wt as confirmLocationPair, xt as ArrowDown, y as Plus } from "./lucide-react-DkZ8fO-G.mjs";
4
4
  import { A as buttonSizeNameSchema, C as MinusIcon, D as AFFORDANCE_SUPPRESS_CLASS, E as themeButtonSelector, M as unsafeAsOpaqueButtonColourToken, O as DEFAULT_VARIANT_ALIAS_ID, S as FileTextIcon, T as parseThemeButtonVariantId, X as parseThemeColorToken, Y as parseColorTokenParts, _ as ClockIcon$1, a as ThemedDownloadLink, b as FileAudioIcon, g as CirclePlusIcon, h as CircleMinusIcon, j as createStandardButtonSurfacePolicy, m as ChevronDownIcon, n as ThemedButton, nt as SpinnerNode, o as getIconComponent, p as ArrowDownIcon, r as ThemedButtonLink, rt as clsx, t as ThemedAuthoredButton, w as PlusIcon, x as FileSpreadsheetIcon, y as FileArchiveIcon } from "./ThemedButton-BQU45t-E.mjs";
5
- import { a as buildTimetableModel$1, b as shiftCalendarAnchorDate, f as formatDateKey, g as getWeekCalendarDayTuple, h as getOrderedDayNames, l as addMonths, p as getDayOfWeek, v as isSameCalendarDay, y as isToday } from "./src-DY8JCJdE.mjs";
5
+ import { a as buildTimetableModel$1, b as shiftCalendarAnchorDate, f as formatDateKey, g as getWeekCalendarDayTuple, h as getOrderedDayNames, l as addMonths, p as getDayOfWeek, v as isSameCalendarDay, y as isToday } from "./src-DzXUmsyK.mjs";
6
6
  import { a as NO_EDIT_MAP_OVERLAY, i as useOptionalLocationPickerEnvironment, l as EMPTY_EDIT_MAP_VIEW, r as useLocationPickerWidgetContext, t as LocationDashboardLink } from "./LocationPickerEnvironment-CZQ4vkRe.mjs";
7
7
  import * as React$1 from "react";
8
8
  import React, { Suspense, cloneElement, createContext, createElement, forwardRef, isValidElement, lazy, startTransition, useCallback, useContext, useEffect, useEffectEvent, useId, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore, useTransition } from "react";
@@ -10815,8 +10815,8 @@ function compareTimestamp(left, right) {
10815
10815
  * @param anchorId - Block anchor ID for the return URL hash fragment.
10816
10816
  * @returns Object with success and cancel URLs
10817
10817
  */
10818
- function buildCheckoutReturnUrls(paramName, anchorId, returnParams = {}) {
10819
- const currentUrl = new URL(window.location.href);
10818
+ function buildCheckoutReturnUrls(paramName, anchorId, returnParams = {}, navigation) {
10819
+ const currentUrl = new URL(canonicalUrl(window.location.href, navigation));
10820
10820
  const hash = `#${anchorId}`;
10821
10821
  const successParams = new URLSearchParams(currentUrl.search);
10822
10822
  successParams.set(paramName, "success");
@@ -10836,9 +10836,11 @@ const BOOK_TARGET_PARAMS = {
10836
10836
  service: "service",
10837
10837
  resource: "resource",
10838
10838
  occurrence: "occurrence",
10839
- event: "event"
10839
+ event: "event",
10840
+ category: "category"
10840
10841
  };
10841
10842
  function resolveDedicatedBookingTarget(pathname) {
10843
+ if (pathname === "/embed" || pathname.startsWith("/embed/")) return { kind: "embed" };
10842
10844
  const internalPublishedMatch = pathname.match(/^\/internal-sites\/([^/]+)\/([^/]+)\/published(?:\/.*)?$/);
10843
10845
  if (internalPublishedMatch) {
10844
10846
  const hostKey = internalPublishedMatch[1];
@@ -10854,7 +10856,7 @@ function resolveDedicatedBookingTarget(pathname) {
10854
10856
  function resolveDedicatedBookingPath(pathname) {
10855
10857
  const target = resolveDedicatedBookingTarget(pathname);
10856
10858
  if (target.kind === "internal_published_preview") return `/internal-sites/${target.hostKey}/${target.siteIdentifier}/published/book`;
10857
- return "/book";
10859
+ return target.kind === "embed" ? "/embed/book" : "/book";
10858
10860
  }
10859
10861
  function resolveDedicatedBookingHref(pathname, bookingTarget = { kind: "chooser" }) {
10860
10862
  const bookingPath = resolveDedicatedBookingPath(pathname);
@@ -10876,6 +10878,8 @@ function resolveDedicatedBookingHref(pathname, bookingTarget = { kind: "chooser"
10876
10878
  const queryString = params.toString();
10877
10879
  return queryString ? `${bookingPath}?${queryString}` : bookingPath;
10878
10880
  }
10881
+ const EMBED_SEGMENT = "[a-z0-9][a-z0-9-]*";
10882
+ new RegExp(`^/(?:events/${EMBED_SEGMENT}(?:/${EMBED_SEGMENT})?|services/${EMBED_SEGMENT})$`, "i");
10879
10883
  //#endregion
10880
10884
  //#region ../blocks/src/system/runtime/shared/utils/checkoutRoute.ts
10881
10885
  function resolveDedicatedCheckoutTarget(pathname) {
@@ -14656,6 +14660,7 @@ const publicAppointmentServiceSchema = z.object({
14656
14660
  pricing: publicPricingSchema.optional(),
14657
14661
  priceAmount: z.number().nullable(),
14658
14662
  priceCurrency: z.string().nullable(),
14663
+ onlinePaymentMode: z.enum(["session_or_package", "package_only"]).optional(),
14659
14664
  location: publicLocationSchema,
14660
14665
  categoryId: z.string().nullable().optional().transform((value) => value ?? null)
14661
14666
  });
@@ -14712,6 +14717,7 @@ function formatVenue(venue) {
14712
14717
  return venue.area ? `${venue.name}, ${venue.area}` : venue.name;
14713
14718
  }
14714
14719
  function formatAppointmentPrice(service) {
14720
+ if (service.onlinePaymentMode === "package_only") return "Book with a package";
14715
14721
  const pricing = service.pricing;
14716
14722
  if (pricing) {
14717
14723
  const display = (() => {
@@ -15143,6 +15149,141 @@ function TeamMembersNode(props) {
15143
15149
  }
15144
15150
  });
15145
15151
  }
15152
+ //#endregion
15153
+ //#region ../blocks/src/system/runtime/nodes/booking-form.service-pricing.ts
15154
+ function getBookingServiceSlidingScale(service) {
15155
+ const pricing = service?.pricing;
15156
+ if (!pricing || pricing.pricingStrategy !== "sliding_scale" || pricing.slidingMinAmount === null || pricing.slidingMinAmount === void 0 || pricing.slidingMaxAmount === null || pricing.slidingMaxAmount === void 0) return null;
15157
+ return {
15158
+ minAmount: pricing.slidingMinAmount,
15159
+ maxAmount: pricing.slidingMaxAmount,
15160
+ suggestedAmount: pricing.slidingSuggestedAmount ?? null,
15161
+ currency: pricing.currency
15162
+ };
15163
+ }
15164
+ //#endregion
15165
+ //#region ../blocks/src/system/runtime/nodes/booking-form.package-purchase.ts
15166
+ function bookingRequiresResourceSelection(service, configured = false) {
15167
+ return configured || service?.onlinePaymentChoices?.anyAvailable === false;
15168
+ }
15169
+ function toBookingPurchasablePackages(products) {
15170
+ return products.filter((product) => product.productUseCase === "appointment_package" && product.purchaseAvailability === "purchasable").map(({ id, name, price, currency, creditsTotal, validDays, heldWithTeamMember }) => ({
15171
+ id,
15172
+ name,
15173
+ price,
15174
+ currency,
15175
+ creditsTotal,
15176
+ validDays,
15177
+ heldWithTeamMember: heldWithTeamMember ?? null
15178
+ }));
15179
+ }
15180
+ function resolveBookingPurchasablePackages(enabled, state) {
15181
+ if (!enabled) return { kind: "disabled" };
15182
+ switch (state.tag) {
15183
+ case "idle":
15184
+ case "loading": return { kind: "loading" };
15185
+ case "error": return {
15186
+ kind: "error",
15187
+ message: state.message
15188
+ };
15189
+ case "loaded": return {
15190
+ kind: "ready",
15191
+ items: state.value
15192
+ };
15193
+ }
15194
+ }
15195
+ function resolveBookingPaymentAvailability(perSession, held, purchase) {
15196
+ if (perSession || held.items.length > 0 || purchase.kind === "ready" && purchase.items.length > 0) return { kind: "available" };
15197
+ if (held.kind === "loading" || held.kind === "idle" || purchase.kind === "loading") return { kind: "loading" };
15198
+ if (held.kind === "error" || purchase.kind === "error") return { kind: "load_error" };
15199
+ return { kind: "no_choices" };
15200
+ }
15201
+ /** Disclose the package's purchase price; server settlement may require a review for discounts or credit. */
15202
+ function bookingPackagePurchaseTerms(product, promisedDiscountId) {
15203
+ return {
15204
+ currency: product.currency,
15205
+ totalCents: product.price,
15206
+ dueNowCents: product.price,
15207
+ laterPaymentAmountsCents: [],
15208
+ paymentOption: { kind: product.price > 0 ? "upfront" : "not_required" },
15209
+ promisedDiscountId
15210
+ };
15211
+ }
15212
+ function reconcileBookingPackagePurchase(selection, packages) {
15213
+ if (selection.kind === "none") return selection;
15214
+ const product = packages.find((product) => product.id === selection.package.id);
15215
+ if (!product) return { kind: "none" };
15216
+ return JSON.stringify(product) === JSON.stringify(selection.package) ? selection : {
15217
+ kind: "selected",
15218
+ package: product
15219
+ };
15220
+ }
15221
+ function resolveBookingPaymentChoice(purchase, heldId, option) {
15222
+ if (purchase.kind === "selected") return {
15223
+ kind: "buy_package",
15224
+ package: purchase.package
15225
+ };
15226
+ if (heldId) return {
15227
+ kind: "held_package",
15228
+ customerPassId: heldId
15229
+ };
15230
+ return option ? {
15231
+ kind: "per_session",
15232
+ option
15233
+ } : { kind: "unselected" };
15234
+ }
15235
+ function bookingHasPackagePaymentChoices(service) {
15236
+ return service?.onlinePaymentChoices?.buyPackage === true || service?.onlinePaymentChoices?.heldPackage !== false && service?.onlinePaymentChoices?.perSession === false;
15237
+ }
15238
+ function resolveBookingPackageSources(service, enabled, bearerAuth) {
15239
+ const packageOnly = service?.onlinePaymentChoices?.perSession === false;
15240
+ return {
15241
+ packageOnly,
15242
+ held: resolveHeldPackageSource(service, service?.onlinePaymentChoices?.heldPackage !== false && (enabled || packageOnly), bearerAuth),
15243
+ canBuy: service?.onlinePaymentChoices?.buyPackage === true
15244
+ };
15245
+ }
15246
+ function resolveHeldPackageSource(service, enabled, bearerAuth) {
15247
+ if (!enabled) return "disabled";
15248
+ if (!heldPackageServiceEligible(service)) return "missing-priced-service";
15249
+ return bearerAuth ? "enabled" : "missing-portal-auth";
15250
+ }
15251
+ function heldPackageServiceEligible(service) {
15252
+ if (!service) return false;
15253
+ return service.onlinePaymentChoices?.perSession === false || !getBookingServiceSlidingScale(service) && (service.priceAmount ?? 0) > 0;
15254
+ }
15255
+ function resolveBookingPackagePaymentSelection(data, service) {
15256
+ if (data.selectedAppointmentPackageId || data.packagePurchase?.kind === "selected") return "selected";
15257
+ return service?.onlinePaymentChoices?.perSession === false ? "required" : "per_session";
15258
+ }
15259
+ function bookingPackageRequestKey(enabled, serviceId, resourceId) {
15260
+ return enabled && serviceId ? `${serviceId}:${resourceId ?? "any"}` : null;
15261
+ }
15262
+ /** Resolve form admission and existing holdings before any payment/resource consumer sees service offers. */
15263
+ function applyBookingPaymentAdmission(services, requiresApproval, unrestrictedHeldServiceId) {
15264
+ return services.map((service) => {
15265
+ const choices = service.onlinePaymentChoices;
15266
+ if (requiresApproval) return {
15267
+ ...service,
15268
+ onlinePaymentChoices: {
15269
+ perSession: choices?.perSession ?? true,
15270
+ heldPackage: false,
15271
+ buyPackage: false,
15272
+ anyAvailable: true
15273
+ }
15274
+ };
15275
+ return choices && service.id === unrestrictedHeldServiceId ? {
15276
+ ...service,
15277
+ onlinePaymentChoices: {
15278
+ ...choices,
15279
+ anyAvailable: true
15280
+ }
15281
+ } : service;
15282
+ });
15283
+ }
15284
+ function resolveBookingPaymentMode(service, payment) {
15285
+ return bookingHasPackagePaymentChoices(service) || payment.kind === "unavailable" ? "choice_required" : payment.mode;
15286
+ }
15146
15287
  const BOOKING_FORM_DATA_RESERVED_KEYS = /* @__PURE__ */ new Set([
15147
15288
  "serviceId",
15148
15289
  "resourceId",
@@ -15152,6 +15293,7 @@ const BOOKING_FORM_DATA_RESERVED_KEYS = /* @__PURE__ */ new Set([
15152
15293
  "selectedSlidingAmountInput",
15153
15294
  "selectedCollectionOptionKind",
15154
15295
  "selectedAppointmentPackageId",
15296
+ "packagePurchase",
15155
15297
  "mailingListOptIn"
15156
15298
  ]);
15157
15299
  //#endregion
@@ -15442,16 +15584,6 @@ function readOptionalString(value) {
15442
15584
  function readOptionalNumber(value) {
15443
15585
  return typeof value === "number" && Number.isFinite(value) ? value : void 0;
15444
15586
  }
15445
- function getBookingServiceSlidingScale(service) {
15446
- const pricing = service?.pricing;
15447
- if (!pricing || pricing.pricingStrategy !== "sliding_scale" || pricing.slidingMinAmount === null || pricing.slidingMinAmount === void 0 || pricing.slidingMaxAmount === null || pricing.slidingMaxAmount === void 0) return null;
15448
- return {
15449
- minAmount: pricing.slidingMinAmount,
15450
- maxAmount: pricing.slidingMaxAmount,
15451
- suggestedAmount: pricing.slidingSuggestedAmount ?? null,
15452
- currency: pricing.currency
15453
- };
15454
- }
15455
15587
  function parseBookingCurrencyInputToCents(value) {
15456
15588
  const trimmed = value?.trim() ?? "";
15457
15589
  if (!trimmed) return null;
@@ -15490,15 +15622,11 @@ function resolveBookingSelectedService(input) {
15490
15622
  /** One resolved choice set drives step visibility, selection and submission. */
15491
15623
  function resolveBookingPaymentStep(input) {
15492
15624
  const service = resolveBookingSelectedService(input);
15493
- if (!service) return input.services.length === 0 || resolveRequestedBookingServiceId(input) ? {
15494
- kind: "unavailable",
15495
- mode: "unsupported",
15496
- service: null,
15497
- errorMessage: "Payment options are unavailable for the selected service right now."
15498
- } : {
15499
- kind: "unselected",
15625
+ if (!service) return resolveMissingBookingPaymentStep(input);
15626
+ if (service.onlinePaymentChoices?.perSession === false) return {
15627
+ kind: "not_required",
15500
15628
  mode: "hidden",
15501
- service: null
15629
+ service
15502
15630
  };
15503
15631
  const totalCents = resolveBookingServiceTotalCents(service, input.data);
15504
15632
  if (totalCents <= 0) return {
@@ -15561,6 +15689,16 @@ function prepareBookingSubmission(input) {
15561
15689
  customerPassId
15562
15690
  }
15563
15691
  };
15692
+ if (input.data.packagePurchase?.kind === "selected") return {
15693
+ ok: true,
15694
+ value: {
15695
+ ...common,
15696
+ kind: "package_purchase",
15697
+ purchasePassId: input.data.packagePurchase.package.id,
15698
+ discountCode: toTrimmedString(input.data.discountCode),
15699
+ shownTerms: input.shownTerms ?? bookingPackagePurchaseTerms(input.data.packagePurchase.package, input.promisedDiscountId)
15700
+ }
15701
+ };
15564
15702
  const payment = prepareStandardBookingPayment(input, service);
15565
15703
  return payment.ok ? {
15566
15704
  ok: true,
@@ -15616,6 +15754,14 @@ function buildBookingSubmissionCommon(input, service, startAt) {
15616
15754
  };
15617
15755
  }
15618
15756
  function prepareStandardBookingPayment(input, service) {
15757
+ if (service.onlinePaymentChoices?.perSession === false) return {
15758
+ ok: false,
15759
+ error: {
15760
+ tag: "payment-option-required",
15761
+ serviceId: service.id,
15762
+ serviceTitle: service.title
15763
+ }
15764
+ };
15619
15765
  const amount = validateBookingSlidingSelection(service, input.data);
15620
15766
  if (!amount.ok) return amount;
15621
15767
  const payment = resolveBookingPaymentStep(input);
@@ -15765,6 +15911,18 @@ function snapshotBookingShownTerms(payment, promisedDiscountId) {
15765
15911
  promisedDiscountId
15766
15912
  };
15767
15913
  }
15914
+ function resolveMissingBookingPaymentStep(input) {
15915
+ return input.services.length === 0 || resolveRequestedBookingServiceId(input) ? {
15916
+ kind: "unavailable",
15917
+ mode: "unsupported",
15918
+ service: null,
15919
+ errorMessage: "Payment options are unavailable for the selected service right now."
15920
+ } : {
15921
+ kind: "unselected",
15922
+ mode: "hidden",
15923
+ service: null
15924
+ };
15925
+ }
15768
15926
  //#endregion
15769
15927
  //#region ../blocks/src/system/runtime/nodes/booking-form.service-categories.ts
15770
15928
  function isRecord$7(value) {
@@ -15917,6 +16075,7 @@ const bookingSourceSchema = z.object({
15917
16075
  demoEmailSuppressed: z.boolean().optional(),
15918
16076
  mailingList: bookingMailingListContextSchema.optional(),
15919
16077
  siteTerms: blockSiteTermsSchema.optional(),
16078
+ pageNavigation: pageNavigationSchema.optional(),
15920
16079
  siteName: z.string().optional(),
15921
16080
  siteId: z.string().optional(),
15922
16081
  apiBaseUrl: z.string().optional(),
@@ -15951,6 +16110,7 @@ const bookingHydrationSchema = z.object({
15951
16110
  demoEmailSuppressed: z.boolean().optional(),
15952
16111
  mailingList: bookingMailingListContextSchema.optional(),
15953
16112
  siteTerms: blockSiteTermsSchema.optional(),
16113
+ pageNavigation: pageNavigationSchema.optional(),
15954
16114
  siteName: z.string().optional(),
15955
16115
  formId: z.string().nullable(),
15956
16116
  serviceId: z.string().nullable(),
@@ -16003,6 +16163,7 @@ const bookingFormBlockRuntime = defineClientOwnedBlockRuntime({
16003
16163
  demoEmailSuppressed: source.demoEmailSuppressed,
16004
16164
  mailingList: source.mailingList,
16005
16165
  siteTerms: source.siteTerms,
16166
+ pageNavigation: source.pageNavigation,
16006
16167
  siteName: source.siteName,
16007
16168
  formId: form?.id ?? source.formId ?? null,
16008
16169
  serviceId: source.serviceId ?? form?.settings?.serviceId ?? null,
@@ -37763,7 +37924,8 @@ const containerResponsiveThemeCss = `/*
37763
37924
  /* ===================================================== CALENDAR LIST */
37764
37925
  .theme-scope :where([data-arrangement][data-mode="list"]) [data-slot="list"] { list-style: none; margin: 0; padding: 0; }
37765
37926
  .theme-scope :where([data-arrangement="ledger"], [data-arrangement="timetable-rows"], [data-arrangement="compact"]) :is([data-slot="row"], [data-slot="row-continued"]) { display: grid; grid-template-columns: 7rem minmax(0, 1fr) auto; column-gap: 1.25rem; align-items: center; padding-block: 1.125rem; }
37766
- .theme-scope :is([data-arrangement="ledger"], [data-arrangement="timetable-rows"]) [data-slot="row-continued"] [data-slot="date"] { visibility: hidden; }
37927
+ /* A ledger leaves the date off a second session on the same day; the timetable repeats it, so each row reads on its own. */
37928
+ .theme-scope [data-arrangement="ledger"] [data-slot="row-continued"] [data-slot="date"] { visibility: hidden; }
37767
37929
  .theme-scope :where([data-arrangement="ledger"], [data-arrangement="timetable-rows"], [data-arrangement="compact"]) [data-slot="date"] { grid-column: 1; }
37768
37930
  .theme-scope :where([data-arrangement="ledger"], [data-arrangement="timetable-rows"], [data-arrangement="compact"]) [data-slot="what"] { grid-column: 2; }
37769
37931
  .theme-scope :where([data-arrangement="ledger"], [data-arrangement="timetable-rows"], [data-arrangement="compact"]) [data-slot="action"] { grid-column: 3; justify-self: end; }
@@ -37993,6 +38155,8 @@ const containerResponsiveThemeCss = `/*
37993
38155
  .theme-scope :is([data-slot="item-actions"], [data-slot="action"], .rb-feature-card .cta-row):not(:where([data-arrangement] *)) :is(a, button):only-child { padding: 0; min-height: 0; }
37994
38156
  .theme-scope [data-arrangement] :is([data-slot="item-actions"], [data-slot="action"], .cta-row) :is(a, button):only-child:not(.button-primary, .button-secondary) { padding: 0; min-height: 0; }
37995
38157
  .theme-scope [data-arrangement] [data-slot="more"] { grid-column: 1 / -1; }
38158
+ /* A group's "View all" link sits under its list; a group on its own panel spaces it with the panel's gap. */
38159
+ .theme-scope [data-arrangement] [data-list-group]:not([data-slot="panel"]) > [data-slot="more"] { display: inline-block; margin-top: 1.5rem; }
37996
38160
  /* Capacity decoration is attached only to the places phrase. */
37997
38161
  .theme-scope [data-arrangement] :is([data-availability="low"], [data-availability="full"]) [data-event-places]::before { content: ""; display: inline-block; width: 0.4em; height: 0.4em; margin-right: 0.45em; border-radius: 50%; vertical-align: 0.1em; }
37998
38162
  .theme-scope [data-arrangement] [data-availability="low"] [data-event-places]::before { background: var(--rb-surface-mark-color); }
@@ -44462,12 +44626,12 @@ const containerResponsiveThemeCss = `/*
44462
44626
  @scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
44463
44627
  /* On phones the date is a line above the title, as on the session cards, so the session has the
44464
44628
  * row's full width; the time and button take their own line under it. A row on the same day as the
44465
- * one above leaves the date out. */
44629
+ * one above leaves the date out, except in the timetable, which repeats it on every row. */
44466
44630
  [data-skin="brook"]:is(*, :scope) [data-arrangement]:is([data-treat="rows"], [data-treat="rows-panel"], [data-treat="timetable"], [data-treat="week-list"]) :is([data-slot="row"], [data-slot="row-continued"]) { grid-template-columns: minmax(0, 1fr); row-gap: 0.375rem; }
44467
44631
  [data-skin="brook"]:is(*, :scope) [data-arrangement]:is([data-treat="rows"], [data-treat="rows-panel"], [data-treat="timetable"], [data-treat="week-list"]) :is([data-slot="date"], [data-slot="what"], [data-slot="time"], [data-slot="places"], [data-slot="action"]) { grid-column: 1; grid-row: auto; }
44468
44632
  [data-skin="brook"]:is(*, :scope) [data-arrangement]:is([data-treat="rows"], [data-treat="rows-panel"], [data-treat="timetable"], [data-treat="week-list"]) [data-slot="date"] { display: flex; flex-direction: row; align-items: baseline; justify-content: start; gap: 0.375rem; min-width: 0; padding: 0; border: 0; text-align: start; }
44469
44633
  [data-skin="brook"]:is(*, :scope) [data-arrangement]:is([data-treat="rows"], [data-treat="rows-panel"], [data-treat="timetable"], [data-treat="week-list"]) [data-slot="date"] [data-slot="day"] { font: 600 0.8125rem/1.2 var(--font-body); letter-spacing: 0.06em; color: var(--rb-surface-link-color); }
44470
- [data-skin="brook"]:is(*, :scope) [data-arrangement]:is([data-treat="rows"], [data-treat="rows-panel"], [data-treat="timetable"], [data-treat="week-list"]) [data-slot="row-continued"] [data-slot="date"] { display: none; }
44634
+ [data-skin="brook"]:is(*, :scope) [data-arrangement]:is([data-treat="rows"], [data-treat="rows-panel"], [data-treat="week-list"]) [data-slot="row-continued"] [data-slot="date"] { display: none; }
44471
44635
  [data-skin="brook"]:is(*, :scope) [data-arrangement][data-treat="timetable"] :is([data-slot="row"], [data-slot="row-continued"]) > [data-slot="item-actions"] { grid-column: 1; grid-row: auto; margin-top: 0.375rem; }
44472
44636
  }
44473
44637
  }
@@ -44833,7 +44997,8 @@ function planEditorReveal(target, ancestors, alignment = "nearest") {
44833
44997
  const ancestorIndex = ancestors.findIndex(({ overflowY }) => /^(auto|scroll)$/.test(overflowY));
44834
44998
  const viewport = ancestors[ancestorIndex];
44835
44999
  if (!viewport || viewport.height <= 0 || viewport.scale <= 0) return null;
44836
- const delta = revealDelta((target.top - viewport.top) / viewport.scale, (target.bottom - viewport.top) / viewport.scale, viewport.height, alignment);
45000
+ const inset = viewport.inset ?? 0;
45001
+ const delta = revealDelta((target.top - viewport.top) / viewport.scale - inset, (target.bottom - viewport.top) / viewport.scale - inset, viewport.height - inset, alignment);
44837
45002
  const next = Math.max(0, Math.min(viewport.scrollHeight - viewport.height, viewport.scrollTop + delta));
44838
45003
  return next === viewport.scrollTop ? null : {
44839
45004
  ancestorIndex,
@@ -44842,11 +45007,23 @@ function planEditorReveal(target, ancestors, alignment = "nearest") {
44842
45007
  }
44843
45008
  function revealDelta(top, bottom, height, alignment) {
44844
45009
  if (alignment === "start") return top;
44845
- if (alignment === "center") return (top + bottom - height) / 2;
45010
+ if (alignment === "center") return bottom - top > height ? top : (top + bottom - height) / 2;
44846
45011
  if (top <= 0 && bottom >= height) return 0;
44847
45012
  if (top < 0 || bottom > height && bottom - top > height) return top;
44848
45013
  return bottom > height ? bottom - height : 0;
44849
45014
  }
45015
+ function documentViewport(root) {
45016
+ const inset = Number.parseFloat(getComputedStyle(root).scrollPaddingTop);
45017
+ return {
45018
+ overflowY: "auto",
45019
+ top: 0,
45020
+ height: root.clientHeight,
45021
+ scrollTop: root.scrollTop,
45022
+ scrollHeight: root.scrollHeight,
45023
+ scale: 1,
45024
+ inset: Number.isFinite(inset) ? inset : 0
45025
+ };
45026
+ }
44850
45027
  function ancestorElements(element) {
44851
45028
  const parent = element.parentElement;
44852
45029
  return parent ? [parent, ...ancestorElements(parent)] : [];
@@ -44855,7 +45032,9 @@ function ancestorElements(element) {
44855
45032
  function revealEditorElement(element, options = {}) {
44856
45033
  if (!element || element.getClientRects().length === 0) return;
44857
45034
  const ancestors = ancestorElements(element);
45035
+ const root = options.scrollDocument ? document.scrollingElement : null;
44858
45036
  const measurements = ancestors.map((ancestor) => {
45037
+ if (ancestor === root) return documentViewport(ancestor);
44859
45038
  const rect = ancestor.getBoundingClientRect();
44860
45039
  const scale = ancestor.offsetHeight > 0 ? rect.height / ancestor.offsetHeight : 1;
44861
45040
  return {
@@ -45554,6 +45733,11 @@ const WHOLE_SERIES = { waitlistClaimResolve: {
45554
45733
  authScope: "portal"
45555
45734
  } };
45556
45735
  const SHOP = {
45736
+ listPublicPasses: {
45737
+ path: "/public/sites/{siteId}/bookings/products/passes",
45738
+ method: "GET",
45739
+ authScope: "public"
45740
+ },
45557
45741
  listProducts: {
45558
45742
  path: "/public/sites/{siteId}/products",
45559
45743
  method: "GET",
@@ -46124,6 +46308,14 @@ function createBlockApi(config) {
46124
46308
  async submitBookingWithPackage(data) {
46125
46309
  return request(BOOKINGS.createAppointmentWithPackage, { body: data });
46126
46310
  },
46311
+ async listPublicPasses(params) {
46312
+ const path = buildPath(SHOP.listPublicPasses.path, { siteId: requireSiteId() });
46313
+ const result = await request(SHOP.listPublicPasses, {
46314
+ path,
46315
+ query: params
46316
+ });
46317
+ return publicPassProductCollectionSchema.parse(result);
46318
+ },
46127
46319
  async getEligibleAppointmentPackages(params) {
46128
46320
  return request(BOOKINGS.getEligibleAppointmentPackages, { query: {
46129
46321
  serviceId: params.serviceId,
@@ -46692,6 +46884,15 @@ function useBlockApi() {
46692
46884
  if (!client) throw new Error("useBlockApi must be used within a BlockApiProvider. Make sure your component is wrapped with <BlockApiProvider>.");
46693
46885
  return client;
46694
46886
  }
46887
+ /**
46888
+ * Hook to optionally access the Block API Client
46889
+ *
46890
+ * Returns null if not within a BlockApiProvider.
46891
+ * Useful for components that can work with or without the API client.
46892
+ */
46893
+ function useBlockApiOptional() {
46894
+ return useContext(BlockApiContext);
46895
+ }
46695
46896
  //#endregion
46696
46897
  //#region ../blocks/src/system/runtime/api/types/discounts.ts
46697
46898
  function discountAvailabilityHasDiscounts(availability) {
@@ -46709,6 +46910,52 @@ function getAutoAppliedDiscountPreview(availability) {
46709
46910
  }
46710
46911
  }
46711
46912
  //#endregion
46913
+ //#region ../blocks/src/system/runtime/shared/navigation/NavigationHandOffPanel.tsx
46914
+ function NavigationHandOffPanel(props) {
46915
+ const [opened, setOpened] = useState(false);
46916
+ const payment = props.purpose === "payment";
46917
+ const offering = props.offeringLabel?.toLowerCase() ?? "event";
46918
+ return /* @__PURE__ */ jsxs("section", {
46919
+ className: "rb-reg-stack er-stack",
46920
+ "aria-live": "polite",
46921
+ children: [
46922
+ /* @__PURE__ */ jsx("h3", {
46923
+ className: "er-title",
46924
+ children: opened ? "Finish booking in the new tab" : payment ? "Finish paying in a new tab" : "Continue in a new tab"
46925
+ }),
46926
+ !opened && /* @__PURE__ */ jsx("p", {
46927
+ className: "er-text",
46928
+ children: handOffDescription(props, offering)
46929
+ }),
46930
+ opened && /* @__PURE__ */ jsxs("p", { children: ["Tab didn't open? ", /* @__PURE__ */ jsx("a", {
46931
+ href: props.handOff.url,
46932
+ target: "_blank",
46933
+ rel: "noopener",
46934
+ children: "Open the booking page"
46935
+ })] }),
46936
+ !opened && /* @__PURE__ */ jsx("a", {
46937
+ className: "rb-button",
46938
+ href: props.handOff.url,
46939
+ target: "_blank",
46940
+ rel: "noopener",
46941
+ onClick: () => setOpened(true),
46942
+ children: payment ? "Pay in a new tab" : "Continue in a new tab"
46943
+ }),
46944
+ /* @__PURE__ */ jsx("button", {
46945
+ type: "button",
46946
+ className: "er-portal-auth-link",
46947
+ onClick: props.onBack,
46948
+ children: props.purpose === "signIn" ? `Back to pay for this ${offering} instead` : "Back to my booking"
46949
+ })
46950
+ ]
46951
+ });
46952
+ }
46953
+ function handOffDescription(props, offering) {
46954
+ if (props.purpose === "payment") return "We'll open a secure payment page in a new tab. Your booking is confirmed once you've paid.";
46955
+ if (props.purpose === "signIn") return `You'll need to sign in to use a pass or membership. We'll open ${props.businessName ?? "the business"}'s booking page in a new tab, with this ${offering} already picked, and you can finish booking there. You'll need to enter your booking details again.`;
46956
+ return "Open the booking page in a new tab to continue.";
46957
+ }
46958
+ //#endregion
46712
46959
  //#region ../blocks/src/system/runtime/nodes/booking-form.date-display.ts
46713
46960
  /**
46714
46961
  * Appointments happen at the business, so every day and clock in the flow is
@@ -47129,6 +47376,23 @@ function omitBookingConsentEntries(record) {
47129
47376
  function isBookingFieldValue(value) {
47130
47377
  return value === null || typeof value === "string" || typeof value === "number" || typeof value === "boolean" || Array.isArray(value) && value.every((item) => typeof item === "string");
47131
47378
  }
47379
+ //#endregion
47380
+ //#region ../blocks/src/system/runtime/nodes/booking-form.sign-in-return.ts
47381
+ const packagePurchaseSchema = z.discriminatedUnion("kind", [z.object({ kind: z.literal("none") }), z.object({
47382
+ kind: z.literal("selected"),
47383
+ package: z.object({
47384
+ id: z.string(),
47385
+ name: z.string(),
47386
+ price: z.number(),
47387
+ currency: z.string(),
47388
+ creditsTotal: z.number(),
47389
+ validDays: z.number().nullable(),
47390
+ heldWithTeamMember: z.object({
47391
+ id: z.string(),
47392
+ name: z.string()
47393
+ }).nullable()
47394
+ })
47395
+ })]);
47132
47396
  /** The appointment form's drafts, for the shared `useSignInReturn` owner. */
47133
47397
  const bookingSignInDraftStore = createSignInReturnDraftStore(z.object({
47134
47398
  nonce: z.string().min(1),
@@ -47164,6 +47428,8 @@ const bookingSignInDraftStore = createSignInReturnDraftStore(z.object({
47164
47428
  "instalment_plan",
47165
47429
  "flexible_balance"
47166
47430
  ]).optional(),
47431
+ selectedAppointmentPackageId: z.string().optional(),
47432
+ packagePurchase: packagePurchaseSchema,
47167
47433
  discountCode: z.string(),
47168
47434
  questions: bookingQuestionsAnswerDraftSchema
47169
47435
  }));
@@ -47187,6 +47453,8 @@ function toBookingSignInDraft(state, attempt) {
47187
47453
  mailingListOptIn: state.mailingListOptIn,
47188
47454
  selectedSlidingAmountInput: state.selectedSlidingAmountInput,
47189
47455
  selectedCollectionOptionKind: state.selectedCollectionOptionKind,
47456
+ selectedAppointmentPackageId: state.selectedAppointmentPackageId,
47457
+ packagePurchase: state.packagePurchase,
47190
47458
  discountCode: state.discountCode,
47191
47459
  questions: toBookingQuestionsAnswerDraft(state.bookingQuestions)
47192
47460
  };
@@ -47217,6 +47485,8 @@ function restoreBookingSignInDraft(state, draft, questions) {
47217
47485
  mailingListOptIn: draft.mailingListOptIn,
47218
47486
  selectedSlidingAmountInput: draft.selectedSlidingAmountInput,
47219
47487
  selectedCollectionOptionKind: draft.selectedCollectionOptionKind,
47488
+ selectedAppointmentPackageId: draft.selectedAppointmentPackageId ? unsafeAsCustomerPassId(draft.selectedAppointmentPackageId) : void 0,
47489
+ packagePurchase: draft.packagePurchase,
47220
47490
  discountCode: draft.discountCode,
47221
47491
  bookingQuestions: restoreBookingQuestionsAnswers(state.bookingQuestions, questions)
47222
47492
  };
@@ -48259,6 +48529,7 @@ function executeBookingSubmission$1(api, data) {
48259
48529
  bookingQuestions: data.bookingQuestions,
48260
48530
  mailingListOptIn: data.mailingListOptIn,
48261
48531
  timezone: data.timezone,
48532
+ ...data.kind === "package_purchase" ? { purchasePassId: data.purchasePassId } : {},
48262
48533
  shownTerms: data.shownTerms,
48263
48534
  discountCode: data.discountCode,
48264
48535
  selectedSlidingAmount: data.selectedSlidingAmount,
@@ -48348,6 +48619,7 @@ const unsafeAsBookingFieldId = (id) => id;
48348
48619
  function createInitialBookingFlowReducerState(input) {
48349
48620
  const initialData = input.initialData ?? {};
48350
48621
  return {
48622
+ packagePurchase: { kind: "none" },
48351
48623
  phase: "editing",
48352
48624
  currentStepId: "service-selection",
48353
48625
  selectedServiceId: toOptionalAppointmentServiceId(toOptionalString(initialData.serviceId) ?? input.defaultServiceId),
@@ -48415,6 +48687,11 @@ function reduceBookingFlowEvent(state, event) {
48415
48687
  ...event,
48416
48688
  state
48417
48689
  }).reduce(reduceBookingFlowEvent, state);
48690
+ case "purchasable-packages-received": return applyBookingPackagePurchaseRefresh(state, event.packages);
48691
+ case "unrestricted-held-packages-received": return {
48692
+ ...state,
48693
+ unrestrictedHeldPackageServiceId: event.serviceId
48694
+ };
48418
48695
  case "packages-received": return planBookingPackageAcceptance({
48419
48696
  ...event,
48420
48697
  state
@@ -48423,6 +48700,7 @@ function reduceBookingFlowEvent(state, event) {
48423
48700
  case "resource-selected": return {
48424
48701
  ...state,
48425
48702
  selectedResourceId: event.resourceId ?? void 0,
48703
+ packagePurchase: { kind: "none" },
48426
48704
  selectedDate: void 0,
48427
48705
  selectedSlot: null,
48428
48706
  validationErrors: clearBookingFormError(state.validationErrors)
@@ -48490,6 +48768,7 @@ function reduceBookingFlowEvent(state, event) {
48490
48768
  review: null,
48491
48769
  paymentChoices: event.paymentChoices,
48492
48770
  selectedCollectionOptionKind: void 0,
48771
+ packagePurchase: { kind: "none" },
48493
48772
  currentStepId: "payment-selection",
48494
48773
  feedback: {
48495
48774
  kind: "error",
@@ -48511,6 +48790,15 @@ function reduceBookingFlowEvent(state, event) {
48511
48790
  default: return assertNever$2(event);
48512
48791
  }
48513
48792
  }
48793
+ /** Changed purchase facts invalidate a price review; identical refreshes preserve the current intent. */
48794
+ function applyBookingPackagePurchaseRefresh(state, packages) {
48795
+ const packagePurchase = reconcileBookingPackagePurchase(state.packagePurchase, packages);
48796
+ return packagePurchase === state.packagePurchase ? state : {
48797
+ ...state,
48798
+ packagePurchase,
48799
+ review: null
48800
+ };
48801
+ }
48514
48802
  /** Answering a question clears the server's complaint about that question. */
48515
48803
  function applyBookingQuestionsFlowEvent(state, event) {
48516
48804
  const bookingQuestions = applyAppointmentBookingQuestionsEvent(state.bookingQuestions, event);
@@ -48528,9 +48816,11 @@ function applyBookingQuestionsFlowEvent(state, event) {
48528
48816
  function applyBookingServiceSelection(state, serviceId) {
48529
48817
  return {
48530
48818
  ...state,
48819
+ packagePurchase: { kind: "none" },
48531
48820
  bookingQuestions: EMPTY_APPOINTMENT_BOOKING_QUESTIONS,
48532
48821
  questionFieldErrors: {},
48533
48822
  selectedServiceId: serviceId,
48823
+ unrestrictedHeldPackageServiceId: void 0,
48534
48824
  selectedResourceId: void 0,
48535
48825
  selectedDate: void 0,
48536
48826
  selectedSlot: null,
@@ -48601,6 +48891,7 @@ function toBookingFormData(state) {
48601
48891
  discountCode: state.discountCode || void 0,
48602
48892
  selectedSlidingAmountInput: state.selectedSlidingAmountInput || void 0,
48603
48893
  selectedCollectionOptionKind: state.selectedCollectionOptionKind,
48894
+ ...state.packagePurchase.kind === "selected" ? { packagePurchase: state.packagePurchase } : {},
48604
48895
  selectedAppointmentPackageId: state.selectedAppointmentPackageId
48605
48896
  };
48606
48897
  }
@@ -48645,10 +48936,14 @@ function buildBookingStepResolution(input) {
48645
48936
  }
48646
48937
  function resolveBookingStepVisibility(input, defaultServiceId, payment) {
48647
48938
  const hasValidConfiguredService = Boolean(defaultServiceId) && input.services.some((service) => service.id === defaultServiceId);
48939
+ const service = resolveBookingSelectedService({
48940
+ ...input,
48941
+ defaultServiceId
48942
+ });
48648
48943
  return {
48649
48944
  needsServiceSelection: [
48650
48945
  input.requiresServiceSelection,
48651
- input.requiresResourceSelection,
48946
+ bookingRequiresResourceSelection(service, input.requiresResourceSelection),
48652
48947
  !hasValidConfiguredService && input.services.length > 1,
48653
48948
  (input.form?.settings?.serviceIds?.length ?? 0) > 1
48654
48949
  ].some(Boolean),
@@ -48657,11 +48952,17 @@ function resolveBookingStepVisibility(input, defaultServiceId, payment) {
48657
48952
  };
48658
48953
  }
48659
48954
  function needsBookingPaymentStep(input, payment) {
48660
- return Boolean(getBookingServiceSlidingScale(payment.service)) || payment.mode !== "hidden" || Boolean(input.enableAppointmentPackages && (payment.service?.priceAmount ?? 0) > 0);
48955
+ if (input.form?.settings?.requiresApproval) return false;
48956
+ return [
48957
+ bookingHasPackagePaymentChoices(payment.service),
48958
+ getBookingServiceSlidingScale(payment.service),
48959
+ payment.mode !== "hidden",
48960
+ input.enableAppointmentPackages && (payment.service?.priceAmount ?? 0) > 0
48961
+ ].some(Boolean);
48661
48962
  }
48662
48963
  /** The service step needs a service, and a practitioner when the form insists on one. */
48663
48964
  function serviceSelectionMessage(input) {
48664
- if (input.requiresResourceSelection && !(input.data.resourceId ?? input.defaultResourceId)) return "Please select a practitioner";
48965
+ if (bookingRequiresResourceSelection(resolveBookingSelectedService(input), input.requiresResourceSelection) && !(input.data.resourceId ?? input.defaultResourceId)) return "Please select a practitioner";
48665
48966
  return input.data.serviceId ? null : "Please select a service";
48666
48967
  }
48667
48968
  function validateBookingStep(input) {
@@ -48690,7 +48991,8 @@ function bookingStepValidationFromMessage(message) {
48690
48991
  } : { ok: true };
48691
48992
  }
48692
48993
  function validateBookingPaymentStep(input) {
48693
- if (input.data.selectedAppointmentPackageId) return { ok: true };
48994
+ const packageValidation = validateBookingPackagePayment(input);
48995
+ if (packageValidation) return packageValidation;
48694
48996
  const resolution = input.paymentResolution ?? resolveBookingPaymentStep(input);
48695
48997
  const slidingScale = getBookingServiceSlidingScale(resolution.service);
48696
48998
  if (slidingScale && !isBookingServiceSlidingAmountInRange(slidingScale, parseBookingCurrencyInputToCents(input.data.selectedSlidingAmountInput))) return bookingStepValidationFromMessage("Please choose an amount within the sliding scale");
@@ -48861,12 +49163,15 @@ function buildBookingSubmitPlan(input) {
48861
49163
  }
48862
49164
  return {
48863
49165
  ok: true,
48864
- redirect: input.redirect,
48865
49166
  value: finalizeBookingSubmissionCommand(prepared.value, input)
48866
49167
  };
48867
49168
  }
48868
49169
  function validateBookingSubmissionContact(input) {
48869
- if (input.requiresResourceSelection && !(input.state.selectedResourceId ?? input.defaultResourceId)) {
49170
+ if (bookingRequiresResourceSelection(resolveBookingSelectedService({
49171
+ services: input.services,
49172
+ data: toBookingFormData(input.state),
49173
+ defaultServiceId: input.defaultServiceId
49174
+ }), input.requiresResourceSelection) && !(input.state.selectedResourceId ?? input.defaultResourceId)) {
48870
49175
  const message = "Please select a practitioner";
48871
49176
  return {
48872
49177
  ok: false,
@@ -49198,7 +49503,7 @@ function planBookingPackageAcceptance(input) {
49198
49503
  }] : [];
49199
49504
  }
49200
49505
  function isBookingPaymentEvent(event) {
49201
- return event.type === "payment-option-selected" || event.type === "sliding-amount-changed" || event.type === "appointment-package-selected" || event.type === "discount-code-changed";
49506
+ return event.type === "payment-option-selected" || event.type === "sliding-amount-changed" || event.type === "appointment-package-selected" || event.type === "purchase-package-selected" || event.type === "discount-code-changed";
49202
49507
  }
49203
49508
  function applyBookingPaymentEvent(state, event) {
49204
49509
  const change = bookingPaymentEventChange(event);
@@ -49211,17 +49516,28 @@ function applyBookingPaymentEvent(state, event) {
49211
49516
  function bookingPaymentEventChange(event) {
49212
49517
  switch (event.type) {
49213
49518
  case "payment-option-selected": return {
49519
+ packagePurchase: { kind: "none" },
49214
49520
  selectedCollectionOptionKind: event.kind ?? void 0,
49215
49521
  selectedAppointmentPackageId: void 0
49216
49522
  };
49217
49523
  case "sliding-amount-changed": return {
49524
+ packagePurchase: { kind: "none" },
49218
49525
  selectedSlidingAmountInput: event.value,
49219
49526
  selectedAppointmentPackageId: void 0
49220
49527
  };
49221
49528
  case "appointment-package-selected": return {
49529
+ packagePurchase: { kind: "none" },
49222
49530
  selectedAppointmentPackageId: event.packageId ?? void 0,
49223
49531
  selectedCollectionOptionKind: void 0
49224
49532
  };
49533
+ case "purchase-package-selected": return {
49534
+ packagePurchase: event.package ? {
49535
+ kind: "selected",
49536
+ package: event.package
49537
+ } : { kind: "none" },
49538
+ selectedAppointmentPackageId: void 0,
49539
+ selectedCollectionOptionKind: void 0
49540
+ };
49225
49541
  case "discount-code-changed": return { discountCode: event.code };
49226
49542
  }
49227
49543
  }
@@ -49229,7 +49545,8 @@ function changesBookingIntent(event) {
49229
49545
  return changesBookingPaymentFacts(event) || [
49230
49546
  "field-updated",
49231
49547
  "discount-code-changed",
49232
- "appointment-package-selected"
49548
+ "appointment-package-selected",
49549
+ "purchase-package-selected"
49233
49550
  ].includes(event.type);
49234
49551
  }
49235
49552
  /** Applies server-owned recovery facts to the existing catalogue model. */
@@ -49239,6 +49556,13 @@ function applyBookingPaymentChoices(services, choices) {
49239
49556
  ...choices
49240
49557
  } : service) : services;
49241
49558
  }
49559
+ function validateBookingPackagePayment(input) {
49560
+ switch (resolveBookingPackagePaymentSelection(input.data, resolveBookingSelectedService(input))) {
49561
+ case "selected": return { ok: true };
49562
+ case "required": return bookingStepValidationFromMessage("Please choose a payment option");
49563
+ case "per_session": return null;
49564
+ }
49565
+ }
49242
49566
  //#endregion
49243
49567
  //#region ../blocks/src/system/runtime/hooks/useBookingChoices.ts
49244
49568
  const NO_PACKAGES = { packages: [] };
@@ -49254,18 +49578,23 @@ function useBookingChoices(input) {
49254
49578
  label: item.label
49255
49579
  }));
49256
49580
  }, [input.api]);
49257
- const loadPackages = useCallback(async (_key) => {
49258
- const serviceId = input.serviceId;
49259
- if (!serviceId) return NO_PACKAGES;
49260
- return input.api.getEligibleAppointmentPackages({
49261
- serviceId,
49581
+ const loadPurchasablePackages = useCallback(async (_key) => {
49582
+ if (!input.serviceId) return [];
49583
+ return toBookingPurchasablePackages((await input.api.listPublicPasses({
49584
+ serviceId: input.serviceId,
49262
49585
  ...input.selectedResourceId ? { teamMemberId: input.selectedResourceId } : {}
49263
- });
49586
+ })).passes);
49264
49587
  }, [
49265
49588
  input.api,
49266
49589
  input.serviceId,
49267
49590
  input.selectedResourceId
49268
49591
  ]);
49592
+ const acceptPurchasablePackages = useCallback((packages) => {
49593
+ latest.current.dispatch({
49594
+ type: "purchasable-packages-received",
49595
+ packages
49596
+ });
49597
+ }, []);
49269
49598
  const acceptResources = useCallback((resources) => {
49270
49599
  const current = latest.current;
49271
49600
  current.dispatch({
@@ -49275,23 +49604,19 @@ function useBookingChoices(input) {
49275
49604
  autoSelect: current.autoSelectSingleResource
49276
49605
  });
49277
49606
  }, []);
49278
- const acceptPackages = useCallback((response) => {
49279
- latest.current.dispatch({
49280
- type: "packages-received",
49281
- packages: response.packages
49282
- });
49283
- }, []);
49284
49607
  const resources = useBookingChoicesRequest(input.serviceId ?? null, loadResources, acceptResources, "Failed to load booking resources.");
49285
- const packagesResponse = useBookingChoicesRequest(input.canLoadPackages && input.serviceId ? `${input.serviceId}:${input.selectedResourceId ?? "any"}` : null, loadPackages, acceptPackages, "Could not check package credits.");
49608
+ const packagesResponse = useBookingPackageEligibility(input);
49609
+ const purchasablePackages = useBookingChoicesRequest(bookingPackageRequestKey(input.canLoadPurchasablePackages, input.serviceId, input.selectedResourceId), loadPurchasablePackages, acceptPurchasablePackages, "Failed to load packages.");
49286
49610
  useEffect(() => {
49287
- if (!input.canLoadPackages) acceptPackages(NO_PACKAGES);
49288
- }, [input.canLoadPackages, acceptPackages]);
49611
+ if (!input.canLoadPurchasablePackages) acceptPurchasablePackages([]);
49612
+ }, [input.canLoadPurchasablePackages, acceptPurchasablePackages]);
49289
49613
  return {
49290
49614
  resources,
49291
49615
  packages: useMemo(() => packagesResponse.tag === "loaded" ? {
49292
49616
  tag: "loaded",
49293
49617
  value: packagesResponse.value.packages
49294
49618
  } : packagesResponse, [packagesResponse]),
49619
+ purchasablePackages,
49295
49620
  heldPackageTeamMembers: packagesResponse.tag === "loaded" && !input.selectedResourceId ? packagesResponse.value.heldPackageTeamMembers ?? [] : [],
49296
49621
  resourceFacts: input.serviceId && resources.tag === "loaded" ? {
49297
49622
  serviceId: input.serviceId,
@@ -49299,6 +49624,56 @@ function useBookingChoices(input) {
49299
49624
  } : null
49300
49625
  };
49301
49626
  }
49627
+ /** Unscoped eligibility resolves practitioner admission independently of the selected practitioner. */
49628
+ function useBookingPackageEligibility(input) {
49629
+ const latest = useRef(input);
49630
+ useLayoutEffect(() => {
49631
+ latest.current = input;
49632
+ }, [input]);
49633
+ const loadAny = useCallback(async () => input.serviceId ? input.api.getEligibleAppointmentPackages({ serviceId: input.serviceId }) : NO_PACKAGES, [input.api, input.serviceId]);
49634
+ const loadScoped = useCallback(async () => input.serviceId && input.selectedResourceId ? input.api.getEligibleAppointmentPackages({
49635
+ serviceId: input.serviceId,
49636
+ teamMemberId: input.selectedResourceId
49637
+ }) : NO_PACKAGES, [
49638
+ input.api,
49639
+ input.serviceId,
49640
+ input.selectedResourceId
49641
+ ]);
49642
+ const accept = useCallback((response) => {
49643
+ latest.current.dispatch({
49644
+ type: "packages-received",
49645
+ packages: response.packages
49646
+ });
49647
+ }, []);
49648
+ const acceptAny = useCallback((response) => {
49649
+ const current = latest.current;
49650
+ current.dispatch({
49651
+ type: "unrestricted-held-packages-received",
49652
+ serviceId: response.packages.length ? current.serviceId : void 0
49653
+ });
49654
+ if (!current.selectedResourceId) accept(response);
49655
+ }, [accept]);
49656
+ const any = useBookingChoicesRequest(bookingPackageRequestKey(input.canLoadPackages, input.serviceId, null), loadAny, acceptAny, "Could not check package credits.");
49657
+ const scoped = useBookingChoicesRequest(bookingPackageRequestKey(input.canLoadPackages && !!input.selectedResourceId, input.serviceId, input.selectedResourceId), loadScoped, accept, "Could not check package credits.");
49658
+ useEffect(() => {
49659
+ if (!input.canLoadPackages) {
49660
+ accept(NO_PACKAGES);
49661
+ acceptAny(NO_PACKAGES);
49662
+ }
49663
+ }, [
49664
+ input.canLoadPackages,
49665
+ accept,
49666
+ acceptAny
49667
+ ]);
49668
+ useEffect(() => {
49669
+ if (!input.selectedResourceId && any.tag === "loaded") accept(any.value);
49670
+ }, [
49671
+ input.selectedResourceId,
49672
+ any,
49673
+ accept
49674
+ ]);
49675
+ return input.selectedResourceId ? scoped : any;
49676
+ }
49302
49677
  function useBookingChoicesRequest(key, load, accept, errorMessage) {
49303
49678
  const [receipt, setReceipt] = useState({
49304
49679
  key: null,
@@ -49348,7 +49723,6 @@ function useBookingChoicesRequest(key, load, accept, errorMessage) {
49348
49723
  function planBookingSubmissionCompletion(input) {
49349
49724
  const { data } = input;
49350
49725
  if (data.type === "review_required") return {
49351
- navigation: { kind: "none" },
49352
49726
  events: [{
49353
49727
  type: "review-required",
49354
49728
  review: data.review
@@ -49360,7 +49734,6 @@ function planBookingSubmissionCompletion(input) {
49360
49734
  }
49361
49735
  };
49362
49736
  if (data.type === "payment_choice_required") return {
49363
- navigation: { kind: "none" },
49364
49737
  events: [{
49365
49738
  type: "payment-choice-required",
49366
49739
  paymentChoices: data.paymentChoices
@@ -49378,10 +49751,6 @@ function planBookingSubmissionCompletion(input) {
49378
49751
  };
49379
49752
  if (data.type === "checkout_redirect") return {
49380
49753
  events: [],
49381
- navigation: input.redirect === "auto" ? {
49382
- kind: "checkout",
49383
- url: data.checkoutUrl
49384
- } : { kind: "none" },
49385
49754
  result: {
49386
49755
  ok: true,
49387
49756
  outcome: {
@@ -49393,7 +49762,6 @@ function planBookingSubmissionCompletion(input) {
49393
49762
  }
49394
49763
  };
49395
49764
  if (data.type === "requested") return {
49396
- navigation: { kind: "none" },
49397
49765
  events: [{
49398
49766
  type: "feedback-set",
49399
49767
  feedback: {
@@ -49418,7 +49786,6 @@ function planBookingSubmissionCompletion(input) {
49418
49786
  }
49419
49787
  };
49420
49788
  return {
49421
- navigation: { kind: "none" },
49422
49789
  events: [{
49423
49790
  type: "feedback-set",
49424
49791
  feedback: bookingSuccessFeedback(data, input.successMessage)
@@ -49447,7 +49814,6 @@ function bookingSuccessFeedback(data, successMessage) {
49447
49814
  function completeBookingSubmission(input) {
49448
49815
  const plan = planBookingSubmissionCompletion(input);
49449
49816
  plan.events.forEach(input.dispatch);
49450
- if (plan.navigation.kind === "checkout" && typeof window !== "undefined") input.navigateToCheckout(plan.navigation.url);
49451
49817
  return plan.result;
49452
49818
  }
49453
49819
  //#endregion
@@ -49470,6 +49836,14 @@ function useBookingFlowController(input) {
49470
49836
  }, [latestRef]);
49471
49837
  return useMemo(() => ({
49472
49838
  ...bookingEditActions(input.dispatch),
49839
+ selectPackageToBuy: (passId) => {
49840
+ const source = latestRef.current.purchasablePackages;
49841
+ const product = source.tag === "loaded" ? source.value.find((product) => product.id === passId) ?? null : null;
49842
+ input.dispatch({
49843
+ type: "purchase-package-selected",
49844
+ package: product
49845
+ });
49846
+ },
49473
49847
  next: async () => navigate("next"),
49474
49848
  back: () => {
49475
49849
  navigate("back");
@@ -49524,7 +49898,6 @@ function useBookingSubmitAction(latestRef) {
49524
49898
  ...latest.state,
49525
49899
  discountCode: latest.discountCode
49526
49900
  },
49527
- redirect: options?.redirect ?? "manual",
49528
49901
  successUrl: options?.successUrl,
49529
49902
  cancelUrl: options?.cancelUrl
49530
49903
  });
@@ -49560,9 +49933,7 @@ async function executeBookingSubmission(start, latest, latestRef) {
49560
49933
  if (result.data.type !== "review_required" && result.data.type !== "payment_choice_required") latest.endSignInReturn?.();
49561
49934
  return completeBookingSubmission({
49562
49935
  data: result.data,
49563
- redirect: start.plan.redirect,
49564
49936
  successMessage: latest.successMessage,
49565
- navigateToCheckout: latest.navigateToCheckout,
49566
49937
  dispatch: latest.dispatch
49567
49938
  });
49568
49939
  }
@@ -49623,7 +49994,17 @@ function failBookingSubmission(failure, dispatch) {
49623
49994
  };
49624
49995
  }
49625
49996
  function sameBookingIntent(left, right) {
49626
- return left.selectedServiceId === right.selectedServiceId && left.selectedResourceId === right.selectedResourceId && left.selectedSlot?.key === right.selectedSlot?.key && left.selectedSlidingAmountInput === right.selectedSlidingAmountInput && left.selectedCollectionOptionKind === right.selectedCollectionOptionKind && left.selectedAppointmentPackageId === right.selectedAppointmentPackageId && left.discountCode === right.discountCode && left.fieldValues === right.fieldValues;
49997
+ return [
49998
+ left.selectedServiceId === right.selectedServiceId,
49999
+ left.selectedResourceId === right.selectedResourceId,
50000
+ left.selectedSlot?.key === right.selectedSlot?.key,
50001
+ left.selectedSlidingAmountInput === right.selectedSlidingAmountInput,
50002
+ left.selectedCollectionOptionKind === right.selectedCollectionOptionKind,
50003
+ left.selectedAppointmentPackageId === right.selectedAppointmentPackageId,
50004
+ left.packagePurchase === right.packagePurchase,
50005
+ left.discountCode === right.discountCode,
50006
+ left.fieldValues === right.fieldValues
50007
+ ].every(Boolean);
49627
50008
  }
49628
50009
  function isOutdatedBookingReview(result, submitted, current) {
49629
50010
  return result.ok && (result.data.type === "review_required" || result.data.type === "payment_choice_required") && !sameBookingIntent(submitted, current);
@@ -49808,14 +50189,19 @@ function useHeadlessBookingFlow(options) {
49808
50189
  options.services
49809
50190
  ]);
49810
50191
  const [state, dispatch] = useReducer((previous, event) => bookingFlowReducer(previous, event, {
49811
- services: applyBookingPaymentChoices(options.services, previous.paymentChoices),
50192
+ services: applyBookingPaymentAdmission(applyBookingPaymentChoices(options.services, previous.paymentChoices), Boolean(options.form?.settings?.requiresApproval), previous.unrestrictedHeldPackageServiceId),
49812
50193
  defaultServiceId,
49813
50194
  nowIso: bookingNowIso
49814
50195
  }), initialState);
49815
50196
  const api = useBlockApi();
49816
50197
  const selectedServiceId = state.selectedServiceId ?? defaultServiceId;
49817
50198
  const selectedResourceId = state.selectedResourceId ?? defaultResourceId;
49818
- const services = useMemo(() => applyBookingPaymentChoices(options.services, state.paymentChoices), [options.services, state.paymentChoices]);
50199
+ const services = useMemo(() => applyBookingPaymentAdmission(applyBookingPaymentChoices(options.services, state.paymentChoices), Boolean(options.form?.settings?.requiresApproval), state.unrestrictedHeldPackageServiceId), [
50200
+ options.services,
50201
+ options.form?.settings?.requiresApproval,
50202
+ state.paymentChoices,
50203
+ state.unrestrictedHeldPackageServiceId
50204
+ ]);
49819
50205
  const selectedService = services.find((service) => service.id === selectedServiceId) ?? null;
49820
50206
  const siteTerms = useSiteTermsAgreement({
49821
50207
  terms: options.siteTerms,
@@ -49837,32 +50223,36 @@ function useHeadlessBookingFlow(options) {
49837
50223
  dispatch
49838
50224
  });
49839
50225
  const questionsRefusal = appointmentQuestionsRefusal(questions.presentation);
50226
+ const requiresResourceSelection = bookingRequiresResourceSelection(selectedService, options.requiresResourceSelection);
50227
+ const packageSources = resolveBookingPackageSources(selectedService, Boolean(options.enableAppointmentPackages), hasPortalBearerAuth);
50228
+ const { packageOnly, canBuy: canLoadPurchasablePackages } = packageSources;
49840
50229
  const selectedServiceSlidingScale = getBookingServiceSlidingScale(selectedService);
49841
50230
  const selectedSlidingAmount = parseBookingCurrencyInputToCents(state.selectedSlidingAmountInput);
49842
50231
  const selectedAppointmentPriceAmount = selectedServiceSlidingScale && selectedSlidingAmount !== null ? selectedSlidingAmount : selectedService?.priceAmount ?? 0;
49843
- const canLoadAppointmentPackages = Boolean(options.enableAppointmentPackages && hasPortalBearerAuth && selectedService && !selectedServiceSlidingScale && (selectedService.priceAmount ?? 0) > 0);
49844
- const appointmentPackagesUnavailableReason = !options.enableAppointmentPackages ? "disabled" : !selectedService || selectedServiceSlidingScale || (selectedService.priceAmount ?? 0) <= 0 ? "missing-priced-service" : !hasPortalBearerAuth ? "missing-portal-auth" : null;
50232
+ const canLoadAppointmentPackages = packageSources.held === "enabled";
50233
+ const appointmentPackagesUnavailableReason = packageSources.held === "enabled" ? null : packageSources.held;
49845
50234
  const data = useMemo(() => toBookingFormData(state), [state]);
49846
50235
  const mailingList = resolveBookingSignupOffer(options.mailingList, options.siteName);
49847
50236
  const mailingListEligible = mailingList !== null;
50237
+ const availabilityServiceId = requiresResourceSelection && !selectedResourceId ? void 0 : selectedServiceId;
49848
50238
  const availabilityDatesQuery = useMemo(() => buildBookingAvailabilityQuery({
49849
- serviceId: selectedServiceId,
50239
+ serviceId: availabilityServiceId,
49850
50240
  resourceId: selectedResourceId,
49851
50241
  timezone: availabilityTimeZone
49852
50242
  }), [
49853
50243
  selectedResourceId,
49854
- selectedServiceId,
50244
+ availabilityServiceId,
49855
50245
  availabilityTimeZone
49856
50246
  ]);
49857
50247
  const availabilitySlotsQuery = useMemo(() => buildBookingAvailabilityQuery({
49858
- serviceId: selectedServiceId,
50248
+ serviceId: availabilityServiceId,
49859
50249
  resourceId: selectedResourceId,
49860
50250
  selectedDate: state.selectedDate,
49861
50251
  timezone: availabilityTimeZone,
49862
50252
  requireDate: true
49863
50253
  }), [
49864
50254
  selectedResourceId,
49865
- selectedServiceId,
50255
+ availabilityServiceId,
49866
50256
  state.selectedDate,
49867
50257
  availabilityTimeZone
49868
50258
  ]);
@@ -49876,7 +50266,7 @@ function useHeadlessBookingFlow(options) {
49876
50266
  defaultResourceId,
49877
50267
  currentStepId: state.currentStepId,
49878
50268
  requiresServiceSelection: options.requiresServiceSelection,
49879
- requiresResourceSelection: options.requiresResourceSelection,
50269
+ requiresResourceSelection,
49880
50270
  enableAppointmentPackages: options.enableAppointmentPackages,
49881
50271
  attemptedStepIds: state.attemptedStepIds,
49882
50272
  questionsRefusal
@@ -49889,7 +50279,7 @@ function useHeadlessBookingFlow(options) {
49889
50279
  defaultResourceId,
49890
50280
  options.enableAppointmentPackages,
49891
50281
  runtimeForm,
49892
- options.requiresResourceSelection,
50282
+ requiresResourceSelection,
49893
50283
  options.requiresServiceSelection,
49894
50284
  services,
49895
50285
  state.paymentChoices,
@@ -49960,19 +50350,29 @@ function useHeadlessBookingFlow(options) {
49960
50350
  selectedResourceId: selectedResourceId ?? null,
49961
50351
  defaultResourceId,
49962
50352
  canLoadPackages: canLoadAppointmentPackages,
50353
+ canLoadPurchasablePackages,
49963
50354
  autoSelectSingleResource: options.shouldAutoSelectSingleResource !== false,
49964
50355
  dispatch
49965
50356
  });
49966
50357
  const resourcesState = choices.resources;
49967
50358
  const appointmentPackages = choices.packages;
49968
50359
  const resources = resourcesState.tag === "loaded" ? resourcesState.value : [];
50360
+ const purchase = state.packagePurchase;
50361
+ const paymentPriceAmount = purchase.kind === "selected" ? purchase.package.price : selectedAppointmentPriceAmount;
49969
50362
  const discountUi = useDiscountCodeUi({
49970
50363
  api,
49971
- discountContext: useMemo(() => selectedService && selectedAppointmentPriceAmount > 0 ? {
50364
+ discountContext: useMemo(() => purchase.kind === "selected" ? {
50365
+ type: "pass",
50366
+ passId: purchase.package.id
50367
+ } : selectedService && selectedAppointmentPriceAmount > 0 ? {
49972
50368
  type: "appointment",
49973
50369
  serviceId: selectedService.id
49974
- } : null, [selectedAppointmentPriceAmount, selectedService?.id]),
49975
- subtotalCents: selectedAppointmentPriceAmount
50370
+ } : null, [
50371
+ purchase,
50372
+ selectedAppointmentPriceAmount,
50373
+ selectedService?.id
50374
+ ]),
50375
+ subtotalCents: paymentPriceAmount
49976
50376
  });
49977
50377
  const { submit, clearFeedback } = useBookingSubmission(options.siteId, siteTerms);
49978
50378
  const actions = useBookingFlowController({
@@ -49982,9 +50382,10 @@ function useHeadlessBookingFlow(options) {
49982
50382
  formId: formKey,
49983
50383
  services,
49984
50384
  promisedDiscountId: resolveDisclosedBookingDiscountId(discountUi),
50385
+ purchasablePackages: choices.purchasablePackages,
49985
50386
  defaultServiceId,
49986
50387
  defaultResourceId,
49987
- requiresResourceSelection: options.requiresResourceSelection,
50388
+ requiresResourceSelection,
49988
50389
  successMessage: options.successMessage,
49989
50390
  viewerTimeZone,
49990
50391
  discountCode: discountUi.discountCode,
@@ -49992,7 +50393,6 @@ function useHeadlessBookingFlow(options) {
49992
50393
  requireSiteTerms: siteTerms.requireAgreement,
49993
50394
  clearFeedback,
49994
50395
  setDiscountCode: discountUi.setDiscountCode,
49995
- navigateToCheckout: options.navigateToCheckout ?? navigateToCheckout,
49996
50396
  steps: stepState.steps,
49997
50397
  currentStep: stepState.currentStep,
49998
50398
  currentStepIndex: stepState.currentStepIndex,
@@ -50026,7 +50426,7 @@ function useHeadlessBookingFlow(options) {
50026
50426
  const paymentConfirmationSummary = resolveBookingPaymentConfirmationSummary({
50027
50427
  service: selectedService,
50028
50428
  priceAmount: selectedAppointmentPriceAmount,
50029
- hasSelectedAppointmentPackage: Boolean(state.selectedAppointmentPackageId),
50429
+ hasSelectedAppointmentPackage: Boolean(state.selectedAppointmentPackageId) || purchase.kind === "selected",
50030
50430
  paymentResolution
50031
50431
  });
50032
50432
  const availabilityDisplay = resolveBookingFormDateDisplay({
@@ -50045,7 +50445,7 @@ function useHeadlessBookingFlow(options) {
50045
50445
  feedback: state.feedback
50046
50446
  });
50047
50447
  const appointmentPackagesModel = resolveAppointmentPackagesModel({
50048
- enabled: Boolean(options.enableAppointmentPackages),
50448
+ enabled: packageSources.held !== "disabled",
50049
50449
  canLoad: canLoadAppointmentPackages,
50050
50450
  unavailableReason: appointmentPackagesUnavailableReason,
50051
50451
  state: appointmentPackages,
@@ -50053,7 +50453,14 @@ function useHeadlessBookingFlow(options) {
50053
50453
  selected: selectedAppointmentPackage,
50054
50454
  heldWithTeamMembers: choices.heldPackageTeamMembers
50055
50455
  });
50056
- const payment = paymentResolution.kind === "unavailable" ? {
50456
+ const purchasablePackages = resolveBookingPurchasablePackages(canLoadPurchasablePackages, choices.purchasablePackages);
50457
+ const packagePaymentModel = {
50458
+ choice: resolveBookingPaymentChoice(state.packagePurchase, state.selectedAppointmentPackageId, packageOnly ? void 0 : selectedCollectionOptionKind),
50459
+ purchasablePackages,
50460
+ availability: resolveBookingPaymentAvailability(!packageOnly && paymentResolution.kind !== "unavailable", appointmentPackagesModel, purchasablePackages)
50461
+ };
50462
+ const payment = paymentResolution.kind === "unavailable" && packagePaymentModel.availability.kind === "no_choices" ? {
50463
+ ...packagePaymentModel,
50057
50464
  kind: "unsupported",
50058
50465
  mode: "unsupported",
50059
50466
  selection: null,
@@ -50066,8 +50473,9 @@ function useHeadlessBookingFlow(options) {
50066
50473
  errorMessage: paymentResolution.errorMessage,
50067
50474
  confirmationSummary: null
50068
50475
  } : {
50476
+ ...packagePaymentModel,
50069
50477
  kind: "ok",
50070
- mode: paymentResolution.mode,
50478
+ mode: resolveBookingPaymentMode(selectedService, paymentResolution),
50071
50479
  selection: paymentSelection,
50072
50480
  selectedCollectionOptionKind,
50073
50481
  selectedAppointmentPackageId: state.selectedAppointmentPackageId,
@@ -50101,7 +50509,8 @@ function useHeadlessBookingFlow(options) {
50101
50509
  selected: resources.find((resource) => resource.id === selectedResourceId) ?? null,
50102
50510
  selectedResourceId,
50103
50511
  state: resourcesState,
50104
- requiresSelection: Boolean(options.requiresResourceSelection)
50512
+ requiresSelection: requiresResourceSelection,
50513
+ configuredRequiresSelection: Boolean(options.requiresResourceSelection)
50105
50514
  },
50106
50515
  availability: {
50107
50516
  selectedDate: state.selectedDate,
@@ -50156,9 +50565,6 @@ const EMPTY_SERVICE_CATEGORIES = [];
50156
50565
  function readServiceCategories(options) {
50157
50566
  return options.serviceCategories ?? EMPTY_SERVICE_CATEGORIES;
50158
50567
  }
50159
- function navigateToCheckout(checkoutUrl) {
50160
- window.location.href = checkoutUrl;
50161
- }
50162
50568
  function resolveDisclosedBookingDiscountId(discount) {
50163
50569
  return discount.discountsAvailableLoading || discount.discountCode.trim() ? void 0 : discount.autoAppliedDiscount?.id;
50164
50570
  }
@@ -50880,6 +51286,84 @@ function BookingReviewIdentity({ booking }) {
50880
51286
  });
50881
51287
  }
50882
51288
  //#endregion
51289
+ //#region ../blocks/src/system/runtime/nodes/booking-form.payment-packages.tsx
51290
+ /** Copy for one package the client can buy and use for this booking. */
51291
+ function purchasablePackageRowCopy(item, serviceTitle) {
51292
+ const heldWith = item.heldWithTeamMember;
51293
+ const sessions = item.creditsTotal === 1 ? "1 session" : `${item.creditsTotal} sessions`;
51294
+ return {
51295
+ label: heldWith ? `${item.name} with ${heldWith.name}` : item.name,
51296
+ details: [
51297
+ `${sessions}. This booking uses one.`,
51298
+ heldWith ? `Use them with ${heldWith.name}.` : `Use them with anyone who offers ${serviceTitle}.`,
51299
+ ...item.validDays ? [`${formatValidity(item.validDays)} from when you buy it.`] : []
51300
+ ],
51301
+ price: formatCurrencyAmount(item.price, item.currency, { decimals: "auto" })
51302
+ };
51303
+ }
51304
+ function heldPackageRows(booking) {
51305
+ return booking.payment.appointmentPackages.items.map((held) => ({
51306
+ id: held.customerPassId,
51307
+ label: held.passName,
51308
+ details: ["Use 1 package credit", `Balance: ${held.creditsRemaining} of ${held.creditsTotal} credits remaining`],
51309
+ price: "1 credit",
51310
+ selected: booking.payment.choice.kind === "held_package" && booking.payment.choice.customerPassId === held.customerPassId,
51311
+ onSelect: () => booking.actions.selectAppointmentPackage(held.customerPassId)
51312
+ }));
51313
+ }
51314
+ function purchasableItems(payment) {
51315
+ return payment.purchasablePackages.kind === "ready" ? payment.purchasablePackages.items : [];
51316
+ }
51317
+ function hasPurchasablePackages(payment) {
51318
+ return purchasableItems(payment).length > 0;
51319
+ }
51320
+ /** "Or buy a package and use it now", below the other ways to pay. */
51321
+ function PurchasablePackageChoices(props) {
51322
+ const { payment, actions } = props.booking;
51323
+ const items = purchasableItems(payment);
51324
+ if (items.length === 0) return null;
51325
+ const heading = props.hasOtherChoices ? "Or buy a package and use it now" : "Buy a package to book this";
51326
+ return /* @__PURE__ */ jsxs("div", {
51327
+ className: "rb-reg-stack rb-reg-stack--sm",
51328
+ children: [/* @__PURE__ */ jsx("span", {
51329
+ className: "ab-subtitle",
51330
+ children: heading
51331
+ }), /* @__PURE__ */ jsx(PaymentChoiceRows, {
51332
+ label: heading,
51333
+ rows: items.map((item) => ({
51334
+ id: item.id,
51335
+ ...purchasablePackageRowCopy(item, props.serviceTitle),
51336
+ selected: payment.choice.kind === "buy_package" && payment.choice.package.id === item.id,
51337
+ onSelect: () => actions.selectPackageToBuy(item.id)
51338
+ }))
51339
+ })]
51340
+ });
51341
+ }
51342
+ /** Explains a packages-only service while packages load, or when there's nothing to use or buy. */
51343
+ function PackagePaymentAvailabilityNotice(props) {
51344
+ switch (props.payment.availability.kind) {
51345
+ case "available": return null;
51346
+ case "loading": return /* @__PURE__ */ jsx(FeedbackMessage, {
51347
+ tone: "info",
51348
+ className: "alert alert-info",
51349
+ role: "status",
51350
+ children: "Checking packages..."
51351
+ });
51352
+ case "load_error": return /* @__PURE__ */ jsx(FeedbackMessage, {
51353
+ tone: "error",
51354
+ className: "alert alert-error",
51355
+ role: "alert",
51356
+ children: "We couldn't load the packages for this booking. Please try again in a moment."
51357
+ });
51358
+ case "no_choices": return /* @__PURE__ */ jsx(FeedbackMessage, {
51359
+ tone: "info",
51360
+ className: "alert alert-info",
51361
+ role: "status",
51362
+ children: "You need a package to book this, and there isn't one you can buy online at the moment. Please get in touch and we'll help you book."
51363
+ });
51364
+ }
51365
+ }
51366
+ //#endregion
50883
51367
  //#region ../blocks/src/system/runtime/shared/components/SiteTermsAgreementField.tsx
50884
51368
  function SiteTermsAgreementField(props) {
50885
51369
  const id = useId();
@@ -51612,7 +52096,17 @@ function AlreadyAnswered(input) {
51612
52096
  }
51613
52097
  function SignInNotice(props) {
51614
52098
  const [open, setOpen] = React$1.useState(false);
52099
+ const [handOff, setHandOff] = React$1.useState(null);
52100
+ const api = useBlockApiOptional();
52101
+ const signIn = () => {
52102
+ const outcome = requestSignIn(window.location.href, () => setOpen(true), api?.config.pageNavigation);
52103
+ if (outcome.kind === "handOff") setHandOff(outcome);
52104
+ };
51615
52105
  const titleId = `${React$1.useId()}-sign-in-title`;
52106
+ if (handOff) return /* @__PURE__ */ jsx(NavigationHandOffPanel, {
52107
+ handOff,
52108
+ onBack: () => setHandOff(null)
52109
+ });
51616
52110
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("p", {
51617
52111
  className: "rb-bq-note",
51618
52112
  children: [
@@ -51621,7 +52115,7 @@ function SignInNotice(props) {
51621
52115
  /* @__PURE__ */ jsx("button", {
51622
52116
  type: "button",
51623
52117
  className: "rb-bq-link",
51624
- onClick: () => setOpen(true),
52118
+ onClick: signIn,
51625
52119
  children: "Sign in"
51626
52120
  }),
51627
52121
  " ",
@@ -52145,35 +52639,39 @@ function DefaultResourceChoices({ allowAnyResource, booking, resources, selected
52145
52639
  className: "rb-reg-stack rb-reg-stack--sm",
52146
52640
  role: "group",
52147
52641
  "aria-labelledby": headingId,
52148
- children: [/* @__PURE__ */ jsxs("h3", {
52149
- id: headingId,
52150
- className: "ab-subtitle",
52151
- children: ["Who would you like to see?", booking.resources.requiresSelection ? null : /* @__PURE__ */ jsx(OptionalMark$1, {})]
52152
- }), /* @__PURE__ */ jsxs("div", {
52153
- className: "rb-reg-grid",
52154
- children: [allowAnyResource ? /* @__PURE__ */ jsxs("button", {
52155
- type: "button",
52156
- onClick: () => booking.actions.selectResource(null),
52157
- className: optionCardClassName(!selectedResourceId),
52158
- "aria-pressed": !selectedResourceId,
52159
- children: [/* @__PURE__ */ jsx("div", {
52160
- className: "rb-flex-1 ab-subtitle",
52161
- children: "Anyone available"
52162
- }), !selectedResourceId ? /* @__PURE__ */ jsx(SelectedCheck, {}) : null]
52163
- }) : null, resources.map((resource) => {
52164
- const isSelected = selectedResourceId === resource.id;
52165
- return /* @__PURE__ */ jsxs("button", {
52642
+ children: [
52643
+ /* @__PURE__ */ jsxs("h3", {
52644
+ id: headingId,
52645
+ className: "ab-subtitle",
52646
+ children: ["Who would you like to see?", booking.resources.requiresSelection ? null : /* @__PURE__ */ jsx(OptionalMark$1, {})]
52647
+ }),
52648
+ /* @__PURE__ */ jsx(PackageOnlyResourceNote, { booking }),
52649
+ /* @__PURE__ */ jsxs("div", {
52650
+ className: "rb-reg-grid",
52651
+ children: [allowAnyResource ? /* @__PURE__ */ jsxs("button", {
52166
52652
  type: "button",
52167
- onClick: () => booking.actions.selectResource(resource.id),
52168
- className: optionCardClassName(isSelected),
52169
- "aria-pressed": isSelected,
52653
+ onClick: () => booking.actions.selectResource(null),
52654
+ className: optionCardClassName(!selectedResourceId),
52655
+ "aria-pressed": !selectedResourceId,
52170
52656
  children: [/* @__PURE__ */ jsx("div", {
52171
52657
  className: "rb-flex-1 ab-subtitle",
52172
- children: resource.label
52173
- }), isSelected ? /* @__PURE__ */ jsx(SelectedCheck, {}) : null]
52174
- }, resource.id);
52175
- })]
52176
- })]
52658
+ children: "Anyone available"
52659
+ }), !selectedResourceId ? /* @__PURE__ */ jsx(SelectedCheck, {}) : null]
52660
+ }) : null, resources.map((resource) => {
52661
+ const isSelected = selectedResourceId === resource.id;
52662
+ return /* @__PURE__ */ jsxs("button", {
52663
+ type: "button",
52664
+ onClick: () => booking.actions.selectResource(resource.id),
52665
+ className: optionCardClassName(isSelected),
52666
+ "aria-pressed": isSelected,
52667
+ children: [/* @__PURE__ */ jsx("div", {
52668
+ className: "rb-flex-1 ab-subtitle",
52669
+ children: resource.label
52670
+ }), isSelected ? /* @__PURE__ */ jsx(SelectedCheck, {}) : null]
52671
+ }, resource.id);
52672
+ })]
52673
+ })
52674
+ ]
52177
52675
  });
52178
52676
  }
52179
52677
  function BookingSelectedServiceSummary({ services }) {
@@ -52253,24 +52751,45 @@ function DefaultDateTimeSelectionStep({ booking, errorSummaryId }) {
52253
52751
  ]
52254
52752
  });
52255
52753
  }
52754
+ /** Which ways to pay the step lists: held packages and per-session options, but no per-session payment for a packages-only service. */
52755
+ function planPaymentStepChoices(booking) {
52756
+ const viewModel = booking.payment.selection;
52757
+ const perSessionOffered = booking.services.selected?.onlinePaymentChoices?.perSession !== false;
52758
+ const perSessionOptions = perSessionOffered && viewModel ? viewModel.options : [];
52759
+ const choice = booking.payment.choice;
52760
+ const otherRows = [...heldPackageRows(booking), ...perSessionOptions.map((option) => ({
52761
+ id: option.kind,
52762
+ label: option.title,
52763
+ details: paymentChoiceDetails(option),
52764
+ price: paymentChoicePrice(option.amounts),
52765
+ selected: choice.kind === "per_session" ? choice.option === option.kind : choice.kind === "unselected" && viewModel?.mode === "single_option",
52766
+ onSelect: () => booking.actions.selectPaymentOption(option.kind)
52767
+ }))];
52768
+ return {
52769
+ perSessionOffered,
52770
+ perSessionOptions,
52771
+ otherRows,
52772
+ onlyOneWayToPay: viewModel?.mode === "single_option" && otherRows.length === perSessionOptions.length && !hasPurchasablePackages(booking.payment)
52773
+ };
52774
+ }
52775
+ function paymentStepUnavailableMessage(booking) {
52776
+ if (booking.payment.kind === "unsupported") return booking.payment.errorMessage;
52777
+ if (!booking.services.selected) return "Payment options are unavailable for this service right now.";
52778
+ return null;
52779
+ }
52780
+ function paymentStepTitle(booking) {
52781
+ return booking.payment.selection?.sectionTitle ?? "How would you like to pay?";
52782
+ }
52256
52783
  function HeadlessBookingPaymentSelectionStep({ booking }) {
52257
52784
  const service = booking.services.selected;
52258
- const viewModel = booking.payment.selection;
52259
- if (booking.payment.kind === "unsupported") return /* @__PURE__ */ jsx(FeedbackMessage, {
52260
- tone: "error",
52261
- className: "alert alert-error",
52262
- role: "alert",
52263
- children: booking.payment.errorMessage
52264
- });
52265
- if (!service || !viewModel) return /* @__PURE__ */ jsx(FeedbackMessage, {
52785
+ const { perSessionOffered, perSessionOptions, otherRows, onlyOneWayToPay } = planPaymentStepChoices(booking);
52786
+ const unavailableMessage = paymentStepUnavailableMessage(booking);
52787
+ if (unavailableMessage !== null || !service) return /* @__PURE__ */ jsx(FeedbackMessage, {
52266
52788
  tone: "error",
52267
52789
  className: "alert alert-error",
52268
52790
  role: "alert",
52269
- children: "Payment options are unavailable for this service right now."
52791
+ children: unavailableMessage
52270
52792
  });
52271
- const packageOptions = booking.payment.appointmentPackages.items;
52272
- const hasPackageOptions = packageOptions.length > 0;
52273
- const slidingScale = booking.payment.slidingScale;
52274
52793
  return /* @__PURE__ */ jsxs("div", {
52275
52794
  className: "rb-reg-stack",
52276
52795
  children: [
@@ -52278,76 +52797,16 @@ function HeadlessBookingPaymentSelectionStep({ booking }) {
52278
52797
  className: "rb-reg-summary",
52279
52798
  children: [/* @__PURE__ */ jsx("h3", {
52280
52799
  className: "ab-subtitle",
52281
- children: viewModel.sectionTitle
52800
+ children: paymentStepTitle(booking)
52282
52801
  }), /* @__PURE__ */ jsx("p", {
52283
52802
  className: "ab-text rb-on-surface--muted",
52284
52803
  children: service.title
52285
52804
  })]
52286
52805
  }),
52287
- booking.payment.appointmentPackages.state.tag === "loading" ? /* @__PURE__ */ jsx(FeedbackMessage, {
52288
- tone: "info",
52289
- className: "alert alert-info",
52290
- role: "status",
52291
- children: "Checking package credits..."
52292
- }) : null,
52293
- booking.payment.appointmentPackages.state.tag === "error" ? /* @__PURE__ */ jsxs(FeedbackMessage, {
52294
- tone: "info",
52295
- className: "alert alert-info",
52296
- role: "status",
52297
- children: [booking.payment.appointmentPackages.state.message, " You can continue with the normal payment option."]
52298
- }) : null,
52299
- booking.payment.appointmentPackages.kind === "ready" ? booking.payment.appointmentPackages.heldWithTeamMembers.map((member) => /* @__PURE__ */ jsxs("div", {
52300
- className: "rb-reg-summary rb-space-y-2",
52301
- children: [/* @__PURE__ */ jsxs("p", {
52302
- className: "ab-text",
52303
- children: [
52304
- "You have sessions with ",
52305
- member.name,
52306
- ". Book with ",
52307
- member.name,
52308
- " to use them."
52309
- ]
52310
- }), /* @__PURE__ */ jsx(ThemedButton, {
52311
- type: "button",
52312
- variant: "secondary",
52313
- size: "sm",
52314
- label: `Book with ${member.name}`,
52315
- onClick: () => {
52316
- booking.actions.selectResource(member.id);
52317
- booking.actions.goToStep("datetime-selection");
52318
- }
52319
- })]
52320
- }, member.id)) : null,
52321
- slidingScale ? /* @__PURE__ */ jsxs("div", {
52322
- className: "rb-space-y-2",
52323
- children: [
52324
- /* @__PURE__ */ jsx("label", {
52325
- htmlFor: "appointment-sliding-amount",
52326
- className: "form-label",
52327
- children: "Choose your price"
52328
- }),
52329
- /* @__PURE__ */ jsxs("p", {
52330
- className: "rb-caption status-muted",
52331
- children: [
52332
- formatBookingAmount(slidingScale.minAmount, slidingScale.currency),
52333
- " to ",
52334
- formatBookingAmount(slidingScale.maxAmount, slidingScale.currency),
52335
- slidingScale.suggestedAmount !== null ? `, suggested ${formatBookingAmount(slidingScale.suggestedAmount, slidingScale.currency)}` : ""
52336
- ]
52337
- }),
52338
- /* @__PURE__ */ jsx("input", {
52339
- id: "appointment-sliding-amount",
52340
- type: "number",
52341
- className: "form-input",
52342
- min: slidingScale.minAmount / 100,
52343
- max: slidingScale.maxAmount / 100,
52344
- step: "0.01",
52345
- value: booking.payment.selectedSlidingAmountInput,
52346
- onChange: (event) => booking.actions.setSlidingAmountInput(event.target.value)
52347
- })
52348
- ]
52349
- }) : null,
52350
- viewModel.mode === "single_option" && !hasPackageOptions ? viewModel.options.map((option) => /* @__PURE__ */ jsx("div", {
52806
+ /* @__PURE__ */ jsx(HeldPackageStatus, { booking }),
52807
+ /* @__PURE__ */ jsx(PackagePaymentAvailabilityNotice, { payment: booking.payment }),
52808
+ perSessionOffered ? /* @__PURE__ */ jsx(SlidingScaleField, { booking }) : null,
52809
+ onlyOneWayToPay ? perSessionOptions.map((option) => /* @__PURE__ */ jsx("div", {
52351
52810
  className: "rb-reg-summary",
52352
52811
  children: /* @__PURE__ */ jsx(PaymentOptionContent, {
52353
52812
  id: option.kind,
@@ -52356,23 +52815,93 @@ function HeadlessBookingPaymentSelectionStep({ booking }) {
52356
52815
  summaryRows: option.summaryRows,
52357
52816
  helperText: option.helperText
52358
52817
  })
52359
- }, option.kind)) : /* @__PURE__ */ jsx(PaymentChoiceRows, {
52818
+ }, option.kind)) : otherRows.length > 0 ? /* @__PURE__ */ jsx(PaymentChoiceRows, {
52360
52819
  label: "Payment options",
52361
- rows: [...packageOptions.map((appointmentPackage) => ({
52362
- id: appointmentPackage.customerPassId,
52363
- label: appointmentPackage.passName,
52364
- details: ["Use 1 package credit", `Balance: ${appointmentPackage.creditsRemaining} of ${appointmentPackage.creditsTotal} credits remaining`],
52365
- price: "1 credit",
52366
- selected: booking.payment.selectedAppointmentPackageId === appointmentPackage.customerPassId,
52367
- onSelect: () => booking.actions.selectAppointmentPackage(appointmentPackage.customerPassId)
52368
- })), ...viewModel.options.map((option) => ({
52369
- id: option.kind,
52370
- label: option.title,
52371
- details: paymentChoiceDetails(option),
52372
- price: paymentChoicePrice(option.amounts),
52373
- selected: !booking.payment.selectedAppointmentPackageId && (booking.payment.selectedCollectionOptionKind === option.kind || viewModel.mode === "single_option"),
52374
- onSelect: () => booking.actions.selectPaymentOption(option.kind)
52375
- }))]
52820
+ rows: otherRows
52821
+ }) : null,
52822
+ /* @__PURE__ */ jsx(PurchasablePackageChoices, {
52823
+ booking,
52824
+ serviceTitle: service.title,
52825
+ hasOtherChoices: otherRows.length > 0
52826
+ })
52827
+ ]
52828
+ });
52829
+ }
52830
+ function PackageOnlyResourceNote({ booking }) {
52831
+ if (booking.services.selected?.onlinePaymentChoices?.anyAvailable !== false) return null;
52832
+ return /* @__PURE__ */ jsx("p", {
52833
+ className: "ab-text rb-on-surface--muted",
52834
+ children: "You book this with a package, and each package is with one practitioner. Choose who you'd like to see, and you'll see their packages when you pay."
52835
+ });
52836
+ }
52837
+ function HeldPackageStatus({ booking }) {
52838
+ const held = booking.payment.appointmentPackages;
52839
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
52840
+ held.state.tag === "loading" ? /* @__PURE__ */ jsx(FeedbackMessage, {
52841
+ tone: "info",
52842
+ className: "alert alert-info",
52843
+ role: "status",
52844
+ children: "Checking package credits..."
52845
+ }) : null,
52846
+ held.state.tag === "error" ? /* @__PURE__ */ jsxs(FeedbackMessage, {
52847
+ tone: "info",
52848
+ className: "alert alert-info",
52849
+ role: "status",
52850
+ children: [held.state.message, " You can continue with the normal payment option."]
52851
+ }) : null,
52852
+ held.kind === "ready" ? held.heldWithTeamMembers.map((member) => /* @__PURE__ */ jsxs("div", {
52853
+ className: "rb-reg-summary rb-space-y-2",
52854
+ children: [/* @__PURE__ */ jsxs("p", {
52855
+ className: "ab-text",
52856
+ children: [
52857
+ "You have sessions with ",
52858
+ member.name,
52859
+ ". Book with ",
52860
+ member.name,
52861
+ " to use them."
52862
+ ]
52863
+ }), /* @__PURE__ */ jsx(ThemedButton, {
52864
+ type: "button",
52865
+ variant: "secondary",
52866
+ size: "sm",
52867
+ label: `Book with ${member.name}`,
52868
+ onClick: () => {
52869
+ booking.actions.selectResource(member.id);
52870
+ booking.actions.goToStep("datetime-selection");
52871
+ }
52872
+ })]
52873
+ }, member.id)) : null
52874
+ ] });
52875
+ }
52876
+ function SlidingScaleField({ booking }) {
52877
+ const slidingScale = booking.payment.slidingScale;
52878
+ if (!slidingScale) return null;
52879
+ return /* @__PURE__ */ jsxs("div", {
52880
+ className: "rb-space-y-2",
52881
+ children: [
52882
+ /* @__PURE__ */ jsx("label", {
52883
+ htmlFor: "appointment-sliding-amount",
52884
+ className: "form-label",
52885
+ children: "Choose your price"
52886
+ }),
52887
+ /* @__PURE__ */ jsxs("p", {
52888
+ className: "rb-caption status-muted",
52889
+ children: [
52890
+ formatBookingAmount(slidingScale.minAmount, slidingScale.currency),
52891
+ " to ",
52892
+ formatBookingAmount(slidingScale.maxAmount, slidingScale.currency),
52893
+ slidingScale.suggestedAmount !== null ? `, suggested ${formatBookingAmount(slidingScale.suggestedAmount, slidingScale.currency)}` : ""
52894
+ ]
52895
+ }),
52896
+ /* @__PURE__ */ jsx("input", {
52897
+ id: "appointment-sliding-amount",
52898
+ type: "number",
52899
+ className: "form-input",
52900
+ min: slidingScale.minAmount / 100,
52901
+ max: slidingScale.maxAmount / 100,
52902
+ step: "0.01",
52903
+ value: booking.payment.selectedSlidingAmountInput,
52904
+ onChange: (event) => booking.actions.setSlidingAmountInput(event.target.value)
52376
52905
  })
52377
52906
  ]
52378
52907
  });
@@ -52480,7 +53009,11 @@ function BookingConfirmation(props) {
52480
53009
  })] });
52481
53010
  }
52482
53011
  function DemoBookingPortalAccess(props) {
52483
- const { state, openPortal } = useDemoBookingPortalAccess(props.email);
53012
+ const { state, openPortal, back } = useDemoBookingPortalAccess(props.email);
53013
+ if (state.tag === "handOff") return /* @__PURE__ */ jsx(NavigationHandOffPanel, {
53014
+ handOff: state.handOff,
53015
+ onBack: back
53016
+ });
52484
53017
  return /* @__PURE__ */ jsxs("div", {
52485
53018
  className: "rb-mt-4 rb-flex rb-flex-col rb-items-start rb-gap-3",
52486
53019
  "data-testid": "demo-booking-portal-access",
@@ -52539,7 +53072,11 @@ function useDemoBookingPortalAccess(email) {
52539
53072
  });
52540
53073
  switch (result.kind) {
52541
53074
  case "demo_sign_in":
52542
- window.location.assign(result.url);
53075
+ const outcome = leavePage(result.url, api.config.pageNavigation);
53076
+ if (outcome.kind === "handOff") setState({
53077
+ tag: "handOff",
53078
+ handOff: outcome
53079
+ });
52543
53080
  return;
52544
53081
  case "refused":
52545
53082
  setState({
@@ -52557,7 +53094,8 @@ function useDemoBookingPortalAccess(email) {
52557
53094
  };
52558
53095
  return {
52559
53096
  state,
52560
- openPortal
53097
+ openPortal,
53098
+ back: () => setState({ tag: "idle" })
52561
53099
  };
52562
53100
  }
52563
53101
  function handlePortalAccessError(error) {
@@ -52777,9 +53315,8 @@ function appendRebookFlag(url, enabled) {
52777
53315
  }
52778
53316
  function createBookingFormSubmitHandler(input) {
52779
53317
  return async () => {
52780
- const { successUrl, cancelUrl } = buildCheckoutReturnUrls("booking", input.bookingAnchorId);
53318
+ const { successUrl, cancelUrl } = buildCheckoutReturnUrls("booking", input.bookingAnchorId, {}, input.pageNavigation);
52781
53319
  const options = {
52782
- redirect: "manual",
52783
53320
  successUrl: appendRebookFlag(successUrl, input.isPortalRebook),
52784
53321
  cancelUrl: appendRebookFlag(cancelUrl, input.isPortalRebook)
52785
53322
  };
@@ -52791,7 +53328,10 @@ function createBookingFormSubmitHandler(input) {
52791
53328
  customerEmail: result.outcome.customerEmail,
52792
53329
  mailingListNote: result.outcome.mailingListSignupNote ?? null
52793
53330
  });
52794
- window.location.href = result.outcome.checkoutUrl;
53331
+ const outcome = leavePage(result.outcome.checkoutUrl, input.pageNavigation, (url) => {
53332
+ window.location.href = url;
53333
+ });
53334
+ if (outcome.kind === "handOff") input.onHandOff(outcome);
52795
53335
  return;
52796
53336
  }
52797
53337
  input.setLocalMailingListNote(result.outcome.mailingListSignupNote ?? null);
@@ -52837,6 +53377,7 @@ const BookingFormClient = ({ siteId: siteIdProp, render }) => {
52837
53377
  const [localMailingListNote, setLocalMailingListNote] = useState(null);
52838
53378
  const [localCustomerEmail, setLocalCustomerEmail] = useState(null);
52839
53379
  const api = useBlockApi();
53380
+ const [handOff, setHandOff] = useState(null);
52840
53381
  const hasPortalAuth = api.config.auth.type === "bearer" || api.config.authOverrides?.portal?.type === "bearer";
52841
53382
  const formId = render.hydration.formId ?? form?.id ?? "booking-form";
52842
53383
  const booking = useHeadlessBookingFlow({
@@ -52921,6 +53462,8 @@ const BookingFormClient = ({ siteId: siteIdProp, render }) => {
52921
53462
  })
52922
53463
  });
52923
53464
  const handleComplete = createBookingFormSubmitHandler({
53465
+ pageNavigation: render.hydration.pageNavigation,
53466
+ onHandOff: setHandOff,
52924
53467
  booking,
52925
53468
  bookingAnchorId,
52926
53469
  isPortalRebook,
@@ -52974,33 +53517,37 @@ const BookingFormClient = ({ siteId: siteIdProp, render }) => {
52974
53517
  onClick: verification.retry
52975
53518
  })]
52976
53519
  });
52977
- return /* @__PURE__ */ jsxs(BookingSurface, {
53520
+ return /* @__PURE__ */ jsx(BookingSurface, {
52978
53521
  id: bookingAnchorId,
52979
53522
  className: render.display.className,
52980
- children: [
52981
- render.hydration.noticeMessage ? /* @__PURE__ */ jsx(FeedbackMessage, {
52982
- tone: "info",
52983
- className: "alert alert-info rb-mb-4",
52984
- role: "status",
52985
- children: /* @__PURE__ */ jsx("p", {
52986
- className: "ab-text",
52987
- children: render.hydration.noticeMessage
52988
- })
52989
- }) : null,
52990
- viewState.kind === "error" ? /* @__PURE__ */ jsx(FeedbackMessage, {
52991
- tone: "error",
52992
- className: "alert alert-error rb-mb-4",
52993
- role: "alert",
52994
- children: /* @__PURE__ */ jsx("p", {
52995
- className: "ab-text",
52996
- children: viewState.message
53523
+ children: /* @__PURE__ */ jsxs(AppointmentNavigationContent, {
53524
+ handOff,
53525
+ onBack: () => setHandOff(null),
53526
+ children: [
53527
+ render.hydration.noticeMessage ? /* @__PURE__ */ jsx(FeedbackMessage, {
53528
+ tone: "info",
53529
+ className: "alert alert-info rb-mb-4",
53530
+ role: "status",
53531
+ children: /* @__PURE__ */ jsx("p", {
53532
+ className: "ab-text",
53533
+ children: render.hydration.noticeMessage
53534
+ })
53535
+ }) : null,
53536
+ viewState.kind === "error" ? /* @__PURE__ */ jsx(FeedbackMessage, {
53537
+ tone: "error",
53538
+ className: "alert alert-error rb-mb-4",
53539
+ role: "alert",
53540
+ children: /* @__PURE__ */ jsx("p", {
53541
+ className: "ab-text",
53542
+ children: viewState.message
53543
+ })
53544
+ }) : null,
53545
+ /* @__PURE__ */ jsx(HeadlessBookingDefaultForm, {
53546
+ booking,
53547
+ onSubmit: handleComplete
52997
53548
  })
52998
- }) : null,
52999
- /* @__PURE__ */ jsx(HeadlessBookingDefaultForm, {
53000
- booking,
53001
- onSubmit: handleComplete
53002
- })
53003
- ]
53549
+ ]
53550
+ })
53004
53551
  });
53005
53552
  };
53006
53553
  /**
@@ -53015,6 +53562,13 @@ const BookingFormNodeClient = (props) => /* @__PURE__ */ jsx(BookingFormClient,
53015
53562
  function buildBookingFormNodeClientProps(props) {
53016
53563
  return buildBookingFormInteractiveIslandProps(props);
53017
53564
  }
53565
+ function AppointmentNavigationContent(props) {
53566
+ return props.handOff ? /* @__PURE__ */ jsx(NavigationHandOffPanel, {
53567
+ handOff: props.handOff,
53568
+ purpose: "payment",
53569
+ onBack: props.onBack
53570
+ }) : props.children;
53571
+ }
53018
53572
  //#endregion
53019
53573
  //#region ../blocks/src/system/runtime/nodes/event-registration/registrationSurface.ts
53020
53574
  /** Admission only limits fresh bookings; existing purchases always reach recovery. */
@@ -53086,32 +53640,6 @@ function planEventRegistrationSurface(input) {
53086
53640
  } : { kind: "unavailableWholeSeries" };
53087
53641
  }
53088
53642
  //#endregion
53089
- //#region ../blocks/src/system/runtime/nodes/event-registration/useRegistrationAdmission.ts
53090
- /** Owns admission and its navigation commands; renderers receive decisions. */
53091
- function useRegistrationAdmission(input) {
53092
- const { admission, isAuthenticated, dispatchFlow } = input;
53093
- const ticketContinuation = resolveRegistrationTicketContinuation({
53094
- admission,
53095
- ticketSelectionRequired: input.ticketSelectionRequired,
53096
- hasValidTicketSelection: input.hasValidTicketSelection,
53097
- isCheckingExistingRegistration: isAuthenticated && input.existingRegistrationLoading
53098
- });
53099
- const handleTicketsComplete = () => {
53100
- if (ticketContinuation.kind === "blocked") return {
53101
- ok: false,
53102
- reason: "blocked",
53103
- message: ticketContinuation.message
53104
- };
53105
- dispatchFlow({ type: "tickets-completed" });
53106
- return { ok: true };
53107
- };
53108
- return {
53109
- admission,
53110
- ticketContinuation,
53111
- handleTicketsComplete
53112
- };
53113
- }
53114
- //#endregion
53115
53643
  //#region ../blocks/src/system/runtime/nodes/event-registration/registrationErrorRecovery.ts
53116
53644
  function resolveRegistrationRecoveryAction(step, action) {
53117
53645
  if (step === "payment-failed") return "payment-options";
@@ -53134,36 +53662,113 @@ function resetRegistrationAfterExpiry(input) {
53134
53662
  input.setErrorMessage("");
53135
53663
  }
53136
53664
  /** Retry the retained submission in place; explicit payment uncertainty stays status-only. */
53137
- function recoverRegistrationError(action, handlers) {
53665
+ function recoverRegistrationError(action, handlers, navigation) {
53138
53666
  switch (action) {
53139
- case "none": return;
53140
- case "portal":
53141
- window.location.assign(CUSTOMER_PORTAL_PATH);
53142
- return;
53143
- case "event":
53144
- window.location.assign(window.location.pathname);
53145
- return;
53667
+ case "none": return { kind: "navigated" };
53668
+ case "portal": return leavePage(CUSTOMER_PORTAL_PATH, navigation);
53669
+ case "event": return leavePage(window.location.pathname, navigation);
53146
53670
  case "retry":
53147
53671
  handlers.clearError();
53148
53672
  handlers.setStep("select-payment");
53149
- return;
53673
+ return { kind: "navigated" };
53150
53674
  case "details":
53151
53675
  handlers.clearError();
53152
53676
  handlers.setStep("enter-details");
53153
- return;
53677
+ return { kind: "navigated" };
53154
53678
  case "payment-options":
53155
53679
  case "places":
53156
53680
  handlers.refreshOptions();
53157
53681
  handlers.clearError();
53158
53682
  handlers.setStep(action === "places" ? handlers.canJoinWaitlist ? "enter-details" : "select-tickets" : "select-payment");
53159
- return;
53683
+ return { kind: "navigated" };
53160
53684
  case "start":
53161
53685
  handlers.refreshOptions();
53162
53686
  handlers.reset();
53163
- return;
53687
+ return { kind: "navigated" };
53164
53688
  }
53165
53689
  }
53166
53690
  //#endregion
53691
+ //#region ../blocks/src/system/runtime/nodes/event-registration/useRegistrationNavigation.ts
53692
+ function signInBookingPath(target) {
53693
+ const subject = target?.subject;
53694
+ return resolveDedicatedBookingHref("/", subject?.kind === "wholeSeries" ? {
53695
+ kind: "event_series",
53696
+ eventId: subject.eventSeriesId
53697
+ } : subject ? {
53698
+ kind: "event_occurrence",
53699
+ occurrenceId: subject.occurrenceId
53700
+ } : { kind: "chooser" });
53701
+ }
53702
+ /** Presentation state for leaving the frame stays outside registration's state machine. */
53703
+ function useRegistrationNavigation(input) {
53704
+ const navigation = input.pageNavigation ?? PAGE_NAVIGATION;
53705
+ const [showMagicLinkModal, openMagicLinkModal] = useState(false);
53706
+ const [handOff, setHandOff] = useState(null);
53707
+ const returnPath = signInBookingPath(input.target);
53708
+ const changeSignInVisibility = useCallback((show) => {
53709
+ if (!show) {
53710
+ openMagicLinkModal(false);
53711
+ return;
53712
+ }
53713
+ const outcome = requestSignIn(returnPath, () => openMagicLinkModal(true), navigation);
53714
+ if (outcome.kind === "handOff") setHandOff({
53715
+ ...outcome,
53716
+ purpose: "signIn"
53717
+ });
53718
+ }, [navigation, returnPath]);
53719
+ const recover = (action, handlers) => {
53720
+ receiveHandOff(recoverRegistrationError(action, handlers, navigation), setHandOff);
53721
+ };
53722
+ return {
53723
+ showMagicLinkModal,
53724
+ changeSignInVisibility,
53725
+ recover,
53726
+ interceptPaymentSelection: useCallback((selection) => {
53727
+ if (navigation.kind === "page" || selection.method === null || selection.method === "stripe" || selection.method === "free") return false;
53728
+ changeSignInVisibility(true);
53729
+ return true;
53730
+ }, [navigation, changeSignInVisibility]),
53731
+ presentation: handOff ? {
53732
+ handOff,
53733
+ dismissHandOff: () => setHandOff(null),
53734
+ handOffBusinessName: input.businessName,
53735
+ handOffOfferingLabel: input.offeringNoun?.label
53736
+ } : {}
53737
+ };
53738
+ }
53739
+ function receiveHandOff(outcome, receive) {
53740
+ if (outcome.kind === "handOff") receive({
53741
+ ...outcome,
53742
+ purpose: "navigation"
53743
+ });
53744
+ }
53745
+ //#endregion
53746
+ //#region ../blocks/src/system/runtime/nodes/event-registration/useRegistrationAdmission.ts
53747
+ /** Owns admission and its navigation commands; renderers receive decisions. */
53748
+ function useRegistrationAdmission(input) {
53749
+ const { admission, isAuthenticated, dispatchFlow } = input;
53750
+ const ticketContinuation = resolveRegistrationTicketContinuation({
53751
+ admission,
53752
+ ticketSelectionRequired: input.ticketSelectionRequired,
53753
+ hasValidTicketSelection: input.hasValidTicketSelection,
53754
+ isCheckingExistingRegistration: isAuthenticated && input.existingRegistrationLoading
53755
+ });
53756
+ const handleTicketsComplete = () => {
53757
+ if (ticketContinuation.kind === "blocked") return {
53758
+ ok: false,
53759
+ reason: "blocked",
53760
+ message: ticketContinuation.message
53761
+ };
53762
+ dispatchFlow({ type: "tickets-completed" });
53763
+ return { ok: true };
53764
+ };
53765
+ return {
53766
+ admission,
53767
+ ticketContinuation,
53768
+ handleTicketsComplete
53769
+ };
53770
+ }
53771
+ //#endregion
53167
53772
  //#region ../blocks/src/system/runtime/nodes/event-registration/useEventRegistrationQuestions.ts
53168
53773
  /** The event series is the booking target: its question set applies to every date. */
53169
53774
  function eventTarget(event) {
@@ -53358,18 +53963,18 @@ function eligibilityLookupReducer(state, action) {
53358
53963
  }
53359
53964
  const initialExistingRegistrationLookupState = {
53360
53965
  tag: "idle",
53361
- registration: null
53966
+ registrations: []
53362
53967
  };
53363
53968
  function existingRegistrationLookupReducer(state, action) {
53364
53969
  switch (action.type) {
53365
53970
  case "reset": return initialExistingRegistrationLookupState;
53366
53971
  case "loading-started": return {
53367
53972
  tag: "loading",
53368
- registration: state.registration
53973
+ registrations: state.registrations
53369
53974
  };
53370
53975
  case "resolved": return {
53371
53976
  tag: "resolved",
53372
- registration: action.registration
53977
+ registrations: action.registrations
53373
53978
  };
53374
53979
  default: return assertNever$2(action);
53375
53980
  }
@@ -53563,13 +54168,13 @@ function useExistingEventRegistrationWithDeps({ isAuthenticated, occurrenceId },
53563
54168
  if (cancelled || requestIdRef.current !== requestId) return;
53564
54169
  dispatch({
53565
54170
  type: "resolved",
53566
- registration: events.find((event) => event.occurrenceId === occurrenceId && event.status !== "cancelled" && event.transferState !== "transferred_out") ?? null
54171
+ registrations: events.filter((event) => event.occurrenceId === occurrenceId && event.status !== "cancelled" && event.transferState !== "transferred_out")
53567
54172
  });
53568
54173
  } catch {
53569
54174
  if (cancelled || requestIdRef.current !== requestId) return;
53570
54175
  dispatch({
53571
54176
  type: "resolved",
53572
- registration: null
54177
+ registrations: []
53573
54178
  });
53574
54179
  }
53575
54180
  }
@@ -53584,7 +54189,7 @@ function useExistingEventRegistrationWithDeps({ isAuthenticated, occurrenceId },
53584
54189
  ]);
53585
54190
  return {
53586
54191
  state,
53587
- registration: state.registration,
54192
+ registrations: state.registrations,
53588
54193
  isLoading: state.tag === "loading"
53589
54194
  };
53590
54195
  }
@@ -54936,7 +55541,6 @@ function useEventRegistrationWizardWithDeps(options, deps) {
54936
55541
  ]);
54937
55542
  const errorMessage = waitlistClaim.kind === "error" ? waitlistClaim.message : submissionErrorMessage;
54938
55543
  const errorAction = waitlistClaim.kind === "error" ? waitlistClaim.action : submissionErrorAction;
54939
- const [showMagicLinkModal, setShowMagicLinkModal] = useState(false);
54940
55544
  const selectionLocked = isRegistrationLocked(step);
54941
55545
  useEffect(() => {
54942
55546
  if (selectionLocked || portalAuthState !== "authenticated" || !portalProfile) return;
@@ -54953,6 +55557,13 @@ function useEventRegistrationWizardWithDeps(options, deps) {
54953
55557
  selectedEvent
54954
55558
  }), [options.occurrenceContext, selectedEvent]);
54955
55559
  const registrationOccurrenceId = getRegistrationOccurrenceId(registrationTarget);
55560
+ const registrationNavigation = useRegistrationNavigation({
55561
+ pageNavigation: options.pageNavigation,
55562
+ target: registrationTarget,
55563
+ businessName: options.siteName,
55564
+ offeringNoun: options.offeringNoun
55565
+ });
55566
+ const { showMagicLinkModal, changeSignInVisibility: setShowMagicLinkModal, interceptPaymentSelection } = registrationNavigation;
54956
55567
  const currentEvent = selectedEvent ?? preSelectedEvent;
54957
55568
  const commandRef = useRef(null);
54958
55569
  const setStep = useCallback((nextStep) => {
@@ -55008,6 +55619,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
55008
55619
  isAuthenticated: portalAuthState === "authenticated",
55009
55620
  occurrenceId: registrationOccurrenceId
55010
55621
  });
55622
+ const existingRegistrations = useMemo(() => existingRegistrationResult.registrations.filter((registration) => registration.occurrenceId === registrationOccurrenceId), [existingRegistrationResult.registrations, registrationOccurrenceId]);
55011
55623
  const eligibility = eligibilityResult.eligibility;
55012
55624
  const eligibilityLoading = eligibilityResult.isLoading;
55013
55625
  const eligibilityError = eligibilityResult.error;
@@ -55429,7 +56041,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
55429
56041
  commandRef.current = null;
55430
56042
  setOptionsRefreshKey((value) => value + 1);
55431
56043
  };
55432
- const handleRetry = () => recoverRegistrationError(resolveRegistrationRecoveryAction(step, errorAction), {
56044
+ const handleRetry = () => registrationNavigation.recover(resolveRegistrationRecoveryAction(step, errorAction), {
55433
56045
  canJoinWaitlist: admission.kind === "waitlist",
55434
56046
  refreshOptions: () => setOptionsRefreshKey((value) => value + 1),
55435
56047
  clearError: () => setErrorMessage(""),
@@ -55448,11 +56060,12 @@ function useEventRegistrationWizardWithDeps(options, deps) {
55448
56060
  }
55449
56061
  });
55450
56062
  const handlePaymentSelectionChange = useCallback((selection) => {
56063
+ if (interceptPaymentSelection(selection)) return;
55451
56064
  dispatchFlow({
55452
56065
  type: "set-manual-payment-selection",
55453
56066
  selection
55454
56067
  });
55455
- }, []);
56068
+ }, [interceptPaymentSelection]);
55456
56069
  const presentation = presentWizardStep({
55457
56070
  step,
55458
56071
  flow: flowState,
@@ -55471,7 +56084,9 @@ function useEventRegistrationWizardWithDeps(options, deps) {
55471
56084
  ticketsCount,
55472
56085
  paymentMethod: paymentSelection.method
55473
56086
  });
56087
+ const displayEvent = withRegistrationAvailability(currentEvent, eligibilityLoading ? null : eligibility, selectedAttendanceMode);
55474
56088
  return {
56089
+ ...registrationNavigation.presentation,
55475
56090
  api,
55476
56091
  nowIso,
55477
56092
  directPaymentOptions,
@@ -55483,7 +56098,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
55483
56098
  events,
55484
56099
  maxTicketsNum: waitlistClaim.kind === "ready" ? waitlistClaim.restoration.ticketsCount : options.maxTicketsNum,
55485
56100
  scopedEvents,
55486
- preSelectedEvent,
56101
+ preSelectedEvent: preSelectedEvent?.selectionId === currentEvent?.selectionId ? displayEvent : preSelectedEvent,
55487
56102
  hasPreSelectedContext,
55488
56103
  presentation,
55489
56104
  flow: flowState,
@@ -55494,7 +56109,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
55494
56109
  admission,
55495
56110
  ticketContinuation,
55496
56111
  handleTicketsComplete,
55497
- selectedEvent,
56112
+ selectedEvent: selectedEvent ? displayEvent : null,
55498
56113
  setSelectedEvent: (value) => {
55499
56114
  if (!selectionLocked) setSelectedEvent(value);
55500
56115
  },
@@ -55569,7 +56184,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
55569
56184
  registrationOptionsState: eligibilityResult.state,
55570
56185
  eligibilityLoading: eligibilityLoading || checkingNextStep,
55571
56186
  eligibilityError,
55572
- existingRegistration: existingRegistrationResult.registration,
56187
+ existingRegistrations,
55573
56188
  existingRegistrationLoading: existingRegistrationResult.isLoading || portalAuthState === "authenticated" && eligibilityLoading,
55574
56189
  existingRegistrationState: existingRegistrationResult.state,
55575
56190
  registrationState,
@@ -56717,6 +57332,26 @@ function ClosedPaymentPanel({ message }) {
56717
57332
  });
56718
57333
  }
56719
57334
  //#endregion
57335
+ //#region ../blocks/src/system/runtime/nodes/event-registration/existingBookingsSummary.ts
57336
+ function places(count) {
57337
+ return count === 1 ? "1 place" : `${count} places`;
57338
+ }
57339
+ /** Waitlist entries have their own notice, so only confirmed bookings count here. */
57340
+ function summariseExistingBookings(registrations) {
57341
+ const confirmed = registrations.filter((registration) => registration.status === "confirmed");
57342
+ const [only] = confirmed;
57343
+ if (!only) return { kind: "none" };
57344
+ if (confirmed.length === 1) return {
57345
+ kind: "booked",
57346
+ detail: only.ticketBreakdown ?? places(only.ticketsCount)
57347
+ };
57348
+ const placeCount = confirmed.reduce((total, registration) => total + registration.ticketsCount, 0);
57349
+ return {
57350
+ kind: "booked",
57351
+ detail: `${confirmed.length} bookings · ${places(placeCount)}`
57352
+ };
57353
+ }
57354
+ //#endregion
56720
57355
  //#region ../blocks/src/system/runtime/nodes/event-registration/EventSelectionStep.tsx
56721
57356
  /** Dates in order, grouped by the month and year they fall in, both in the date's own zone. */
56722
57357
  function groupByMonth(events) {
@@ -57973,7 +58608,7 @@ function entitlementRows(props) {
57973
58608
  //#region ../blocks/src/system/runtime/nodes/event-registration/CalendarAction.tsx
57974
58609
  /** Download effects happen only after a click, including in editor preview. */
57975
58610
  async function downloadCalendar(calendar) {
57976
- const { renderCalendarFeedIcs } = await import("./src-BP8771hw.mjs");
58611
+ const { renderCalendarFeedIcs } = await import("./src-LUhVXBEQ.mjs");
57977
58612
  const url = URL.createObjectURL(new Blob([renderCalendarFeedIcs(calendar.feed)], { type: "text/calendar;charset=utf-8" }));
57978
58613
  const link = document.createElement("a");
57979
58614
  link.href = url;
@@ -58276,6 +58911,7 @@ function ExistingRegistrationNotice(props) {
58276
58911
  className: "er-existing-registration-notice",
58277
58912
  titleClassName: "er-existing-registration-title",
58278
58913
  bodyClassName: "er-existing-registration-copy",
58914
+ secondaryBodyClassName: "er-existing-registration-copy",
58279
58915
  icon: /* @__PURE__ */ jsx(StateIcon, {
58280
58916
  variant: isBooked ? "success" : "info",
58281
58917
  children: /* @__PURE__ */ jsx("svg", {
@@ -58290,9 +58926,14 @@ function ExistingRegistrationNotice(props) {
58290
58926
  })
58291
58927
  })
58292
58928
  }),
58293
- title: isBooked ? "You're already booked on this event." : "You're already on the waitlist for this event.",
58294
- body: "Sign out to book for someone else.",
58295
- actions: /* @__PURE__ */ jsx("button", {
58929
+ title: isBooked ? "You're already booked for this date" : "You're already on the waitlist for this event.",
58930
+ body: isBooked ? props.detail : "Sign out to book for someone else.",
58931
+ secondaryBody: isBooked ? "Need more tickets? You can book them below. They'll come as a new booking with its own confirmation email, and your first booking won't change." : void 0,
58932
+ actions: isBooked ? /* @__PURE__ */ jsx("a", {
58933
+ href: "/portal",
58934
+ className: "er-existing-registration-link",
58935
+ children: "View my bookings"
58936
+ }) : /* @__PURE__ */ jsx("button", {
58296
58937
  type: "button",
58297
58938
  className: "er-existing-registration-link",
58298
58939
  onClick: props.onBookForSomeoneElse,
@@ -58398,8 +59039,14 @@ function ClosedAdmissionNotice({ wizard }) {
58398
59039
  }
58399
59040
  function TicketSelectionContent({ wizard, display }) {
58400
59041
  if (!wizard.selectedEvent && !wizard.occurrenceContext) return null;
59042
+ const isWaitlisted = wizard.admission.kind === "closed" && wizard.admission.reason === "alreadyWaitlisted";
59043
+ const existingBookings = summariseExistingBookings(wizard.existingRegistrations);
58401
59044
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
58402
- wizard.admission.kind === "closed" && wizard.admission.reason === "alreadyWaitlisted" && /* @__PURE__ */ jsx(ExistingRegistrationNotice, {
59045
+ existingBookings.kind === "booked" && !isWaitlisted && /* @__PURE__ */ jsx(ExistingRegistrationNotice, {
59046
+ kind: "booked",
59047
+ detail: existingBookings.detail
59048
+ }),
59049
+ isWaitlisted && /* @__PURE__ */ jsx(ExistingRegistrationNotice, {
58403
59050
  kind: "waitlisted",
58404
59051
  onBookForSomeoneElse: wizard.handleBookForSomeoneElse
58405
59052
  }),
@@ -58777,7 +59424,13 @@ function EventRegistrationSurface(props) {
58777
59424
  return /* @__PURE__ */ jsxs("div", {
58778
59425
  ref: useRegistrationStepFocus(wizard.step, props.variant),
58779
59426
  className: `rb-reg-surface er-container${props.variant === "overlay" ? " er-container--overlay" : ""}`,
58780
- children: [presentation.layout === "steps" ? /* @__PURE__ */ jsx(EventRegistrationStepLayout, {
59427
+ children: [wizard.handOff ? /* @__PURE__ */ jsx(NavigationHandOffPanel, {
59428
+ handOff: wizard.handOff,
59429
+ purpose: wizard.handOff.purpose,
59430
+ businessName: wizard.handOffBusinessName,
59431
+ offeringLabel: wizard.handOffOfferingLabel,
59432
+ onBack: () => wizard.dismissHandOff?.()
59433
+ }, wizard.handOff.url) : presentation.layout === "steps" ? /* @__PURE__ */ jsx(EventRegistrationStepLayout, {
58781
59434
  ...props,
58782
59435
  progress: presentation.progress
58783
59436
  }) : /* @__PURE__ */ jsxs("div", {
@@ -58913,6 +59566,8 @@ function useConfiguredEventRegistrationWizard(props) {
58913
59566
  maxTicketsNum: normalizeEventRegistrationMaxTickets(props.maxTickets ?? "5"),
58914
59567
  mailingList: props.mailingList,
58915
59568
  siteTerms: props.siteTerms,
59569
+ pageNavigation: props.pageNavigation,
59570
+ offeringNoun: props.offeringNoun,
58916
59571
  siteName: props.siteName
58917
59572
  });
58918
59573
  }
@@ -60089,7 +60744,8 @@ function shopPassesMembershipsReducer(state, action) {
60089
60744
  ...state,
60090
60745
  checkout: createOpenCheckoutState({
60091
60746
  productType: "pass",
60092
- product: action.pass
60747
+ product: action.pass,
60748
+ teamMember: action.teamMember
60093
60749
  })
60094
60750
  };
60095
60751
  case "openMembershipCheckout": return {
@@ -60202,6 +60858,7 @@ function planDirectShopCheckoutRequest(input) {
60202
60858
  return ok$1({
60203
60859
  productType: input.productType,
60204
60860
  productId: input.productId,
60861
+ ...input.teamMemberId ? { teamMemberId: input.teamMemberId } : {},
60205
60862
  customerEmail: contact.value.email,
60206
60863
  customerName: contact.value.name,
60207
60864
  ...discountCode ? { discountCode } : {},
@@ -60218,7 +60875,8 @@ function buildUnifiedCheckoutItems(checkout) {
60218
60875
  quantity: item.quantity
60219
60876
  } : {
60220
60877
  type: "pass",
60221
- passId: item.passId
60878
+ passId: item.passId,
60879
+ ...item.teamMember ? { teamMemberId: item.teamMember.id } : {}
60222
60880
  });
60223
60881
  }
60224
60882
  function planUnifiedCheckoutRequest(input) {
@@ -60496,6 +61154,7 @@ function buildDirectShopCheckoutPlan(input) {
60496
61154
  command: planDirectShopCheckoutRequest({
60497
61155
  productType: input.checkout.item.productType,
60498
61156
  productId: input.checkout.item.product.id,
61157
+ ...input.checkout.item.productType === "pass" && input.checkout.item.teamMember ? { teamMemberId: input.checkout.item.teamMember.id } : {},
60499
61158
  form,
60500
61159
  successUrl: successUrl.toString(),
60501
61160
  cancelUrl: cancelUrl.toString(),
@@ -60538,33 +61197,113 @@ async function submitDirectShopCheckout(input) {
60538
61197
  function ShopClient(props) {
60539
61198
  return /* @__PURE__ */ jsx(PassesMembershipsController, { render: props.render });
60540
61199
  }
61200
+ function initialPassTeamMember(selection) {
61201
+ if (!selection || selection.kind === "any") return null;
61202
+ if (selection.kind === "owner") return selection.teamMember;
61203
+ return selection.teamMembers.length === 1 ? selection.teamMembers[0] ?? null : null;
61204
+ }
61205
+ function PassTeamMemberChoice(props) {
61206
+ const selection = props.selection;
61207
+ if (!selection || selection.kind === "any") return null;
61208
+ if (selection.kind === "owner") return /* @__PURE__ */ jsxs("p", {
61209
+ className: "shop__card-team-member",
61210
+ children: ["With ", selection.teamMember.name]
61211
+ });
61212
+ const selectId = `shop-pass-team-member-${props.passId}`;
61213
+ return /* @__PURE__ */ jsxs("div", {
61214
+ className: "shop__card-team-member-choice rb-flex rb-flex-col rb-gap-1",
61215
+ children: [
61216
+ /* @__PURE__ */ jsx("label", {
61217
+ className: "rb-label",
61218
+ htmlFor: selectId,
61219
+ children: "Choose your practitioner"
61220
+ }),
61221
+ /* @__PURE__ */ jsxs("select", {
61222
+ id: selectId,
61223
+ className: "form-input",
61224
+ value: props.chosen?.id ?? "",
61225
+ "aria-invalid": props.missing || void 0,
61226
+ onChange: (event) => props.onChoose(selection.teamMembers.find((member) => member.id === event.target.value) ?? null),
61227
+ children: [selection.teamMembers.length > 1 ? /* @__PURE__ */ jsx("option", {
61228
+ value: "",
61229
+ children: "Choose…"
61230
+ }) : null, selection.teamMembers.map((member) => /* @__PURE__ */ jsx("option", {
61231
+ value: member.id,
61232
+ children: member.name
61233
+ }, member.id))]
61234
+ }),
61235
+ props.chosen ? /* @__PURE__ */ jsxs("p", {
61236
+ className: "rb-caption status-muted",
61237
+ children: [
61238
+ "You'll book these sessions with ",
61239
+ props.chosen.name,
61240
+ "."
61241
+ ]
61242
+ }) : props.missing ? /* @__PURE__ */ jsx("p", {
61243
+ className: "rb-caption status-error",
61244
+ role: "alert",
61245
+ children: "Choose who you'd like to book these sessions with."
61246
+ }) : null
61247
+ ]
61248
+ });
61249
+ }
60541
61250
  function PassProductCard(props) {
60542
61251
  const action = props.display.action;
60543
- if (action.kind === "unavailable") return /* @__PURE__ */ jsx(PassCardView, {
61252
+ const nobodyToChoose = action.kind === "purchase" && action.product.teamMemberSelection?.kind === "choose" && action.product.teamMemberSelection.teamMembers.length === 0;
61253
+ if (action.kind === "unavailable" || nobodyToChoose) return /* @__PURE__ */ jsx(PassCardView, {
60544
61254
  display: props.display,
60545
61255
  presentation: props.presentation,
60546
61256
  index: props.index,
60547
- action: /* @__PURE__ */ jsx(PassPurchaseUnavailable, { label: action.label })
61257
+ action: /* @__PURE__ */ jsx(PassPurchaseUnavailable, { label: action.kind === "unavailable" ? action.label : "Not available to buy online yet" })
61258
+ });
61259
+ return /* @__PURE__ */ jsx(PurchasablePassCard, {
61260
+ ...props,
61261
+ action
60548
61262
  });
61263
+ }
61264
+ function PurchasablePassCard(props) {
61265
+ const { product } = props.action;
61266
+ const selection = product.teamMemberSelection;
61267
+ const [chosen, setChosen] = useState(() => initialPassTeamMember(selection));
61268
+ const [missing, setMissing] = useState(false);
61269
+ const buy = () => {
61270
+ if (selection?.kind === "choose" && !chosen) {
61271
+ setMissing(true);
61272
+ return;
61273
+ }
61274
+ props.onBuy(product, chosen);
61275
+ };
60549
61276
  return /* @__PURE__ */ jsx(PassCardView, {
60550
61277
  display: props.display,
60551
61278
  presentation: props.presentation,
60552
61279
  index: props.index,
60553
- action: /* @__PURE__ */ jsx(ShopPurchaseAction, {
61280
+ action: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(PassTeamMemberChoice, {
61281
+ passId: product.id,
61282
+ selection,
61283
+ chosen,
61284
+ missing,
61285
+ onChoose: (teamMember) => {
61286
+ setChosen(teamMember);
61287
+ setMissing(false);
61288
+ }
61289
+ }), /* @__PURE__ */ jsx(ShopPurchaseAction, {
60554
61290
  presentation: props.presentation,
60555
61291
  type: "button",
60556
61292
  variant: props.buttonVariant,
60557
61293
  size: "md",
60558
61294
  extraClassName: "shop__cta",
60559
- label: action.label,
60560
- onClick: () => props.onBuy(action.product)
60561
- }),
61295
+ label: props.action.label,
61296
+ onClick: buy
61297
+ })] }),
60562
61298
  feedback: /* @__PURE__ */ jsx(ShopAddFeedback, {
60563
61299
  active: props.feedbackActive,
60564
- itemLabel: action.product.name
61300
+ itemLabel: chosen ? `${product.name} with ${chosen.name}` : product.name
60565
61301
  })
60566
61302
  });
60567
61303
  }
61304
+ function checkoutProductLabel(checkout) {
61305
+ return `${checkout.item.productType === "pass" && checkout.item.teamMember ? `${checkout.item.product.name} with ${checkout.item.teamMember.name}` : checkout.item.product.name} — ${formatCommercePrice(checkout.item.product.price, checkout.item.product.currency)}`;
61306
+ }
60568
61307
  function getCheckoutModalTitle(checkout) {
60569
61308
  if (!checkout) return "";
60570
61309
  if (checkout.item.productType === "membership") return "Subscribe to Membership";
@@ -60616,11 +61355,12 @@ function PassesMembershipsController({ render }) {
60616
61355
  subtotalCents: checkout?.item.product.price
60617
61356
  });
60618
61357
  const discountApplyFeedback = getDiscountApplyFeedback(discountApply.status, formatCommercePrice);
60619
- const handleBuyPass = useCallback((pass) => {
61358
+ const handleBuyPass = useCallback((pass, teamMember) => {
60620
61359
  if (hydration.passPurchaseMode === "add_to_cart") {
60621
61360
  addPassToCommerceCart(api.config.siteId, {
60622
61361
  passId: pass.id,
60623
61362
  title: pass.name,
61363
+ ...teamMember ? { teamMember } : {},
60624
61364
  unitPriceCents: pass.price,
60625
61365
  currency: pass.currency
60626
61366
  });
@@ -60629,7 +61369,8 @@ function PassesMembershipsController({ render }) {
60629
61369
  }
60630
61370
  dispatch({
60631
61371
  type: "openPassCheckout",
60632
- pass
61372
+ pass,
61373
+ teamMember
60633
61374
  });
60634
61375
  }, [
60635
61376
  api.config.siteId,
@@ -60804,15 +61545,10 @@ function PassesMembershipsController({ render }) {
60804
61545
  children: [
60805
61546
  /* @__PURE__ */ jsxs("p", {
60806
61547
  className: "shop__modal-product",
60807
- children: [
60808
- checkout.item.product.name,
60809
- " — ",
60810
- formatCommercePrice(checkout.item.product.price, checkout.item.product.currency),
60811
- checkout.item.productType === "membership" ? /* @__PURE__ */ jsx("span", {
60812
- className: "shop__modal-interval",
60813
- children: formatInterval(checkout.item.product.billingInterval)
60814
- }) : null
60815
- ]
61548
+ children: [checkoutProductLabel(checkout), checkout.item.productType === "membership" ? /* @__PURE__ */ jsx("span", {
61549
+ className: "shop__modal-interval",
61550
+ children: formatInterval(checkout.item.product.billingInterval)
61551
+ }) : null]
60816
61552
  }),
60817
61553
  /* @__PURE__ */ jsx(SiteTermsChangedNotice, { message: siteTerms.notice }),
60818
61554
  checkout.duplicateWarning ? /* @__PURE__ */ jsxs(FeedbackMessage, {
@@ -67335,9 +68071,14 @@ async function applyBatch(input, batch) {
67335
68071
  return commitReserved(input, batch);
67336
68072
  });
67337
68073
  } catch (error) {
68074
+ const reason = journalFailureReason(error);
68075
+ if (reason === "lease-lost") return {
68076
+ kind: "refused",
68077
+ reason
68078
+ };
67338
68079
  return {
67339
68080
  kind: "failed",
67340
- uncertain: journalFailureReason(error) === "reconcile"
68081
+ uncertain: reason === "reconcile"
67341
68082
  };
67342
68083
  }
67343
68084
  } catch {
@@ -70531,7 +71272,7 @@ async function loadLocationSourceAvailability(port) {
70531
71272
  status: "ready",
70532
71273
  businessAddress: formatLocationAddress(business.value.locationValue?.address ?? null, business.value.siteCountry) ?? (business.value.locationValue ? "Map pin only, no address" : null),
70533
71274
  businessHidden: profile.value.profile.addressVisibility === "hidden",
70534
- venueCount: venues.value.length
71275
+ venueCount: venues.value.filter((venue) => venue.archivedAt === null).length
70535
71276
  };
70536
71277
  }
70537
71278
  const sourcePort = (siteId, apiClient) => ({