@riverbankcms/sdk 0.167.0 → 0.168.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.
- package/dist/_dts/{BlocksIslandsHydrator-Dgb-ptph.d.ts → BlocksIslandsHydrator-CiD_VVGM.d.ts} +1 -1
- package/dist/_dts/{Page-Bs3WxFgr.d.ts → Page-Bj6VJRS5.d.ts} +7 -6
- package/dist/_dts/{SdkPreviewMode-DtUCsaHY.d.ts → SdkPreviewMode-ChpsnwDX.d.ts} +2 -2
- package/dist/_dts/{client-CwsI23pj.d.ts → client-C8mfUxrJ.d.ts} +65 -35
- package/dist/_dts/{content-types-CAeP_-cV.d.ts → content-types-_vXZyR4H.d.ts} +2 -2
- package/dist/_dts/{contracts-BXHCiF-b.d.ts → contracts-CJFfrVKU.d.ts} +5 -4
- package/dist/_dts/{footerPageOutline-Bb2gbppW.d.ts → footerPageOutline-CMegb23G.d.ts} +6 -6
- package/dist/_dts/{generatePageMetadata-DaBBDx7M.d.ts → generatePageMetadata-D9YdAIMh.d.ts} +2 -2
- package/dist/_dts/{index-CS6b1B-c.d.ts → index-BQXaZ7aY.d.ts} +4 -4
- package/dist/_dts/{index-5_jf52sZ.d.ts → index-Bpr-wT5k.d.ts} +2 -2
- package/dist/_dts/{index-DeHDwMfu.d.ts → index-C7_Rz8EY.d.ts} +3 -3
- package/dist/_dts/{index-D7EbliE3.d.ts → index-Cx2BQlHL.d.ts} +3 -3
- package/dist/_dts/{index-C20yUyob.d.ts → index-Dgz6yhsy.d.ts} +1 -1
- package/dist/_dts/index-Vh8B9FSa.d.ts +14 -0
- package/dist/_dts/{index-bDln38Hm.d.ts → index-vR3p9Bu-.d.ts} +2 -2
- package/dist/_dts/{loadContent-CTqcL7CS.d.ts → loadContent-dhWSgLeS.d.ts} +7 -7
- package/dist/_dts/previewCompiler-BVVgDSdq.d.ts +1 -0
- package/dist/_dts/{index-ChpjHK0U.d.ts → request-BrYhNV9Z.d.ts} +80718 -47665
- package/dist/_dts/{resolveBlockData-C3s9WMPs.d.ts → resolveBlockData-BfSHm8Ms.d.ts} +5 -5
- package/dist/_dts/{resolvePageContent-JPwgRxwh.d.ts → resolvePageContent-gZJ4i1wN.d.ts} +2 -2
- package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
- package/dist/_dts/sdk/src/client/types.d.ts +2 -2
- package/dist/_dts/sdk/src/client.d.ts +7 -7
- package/dist/_dts/sdk/src/config/index.d.ts +6 -6
- package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
- package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
- package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +2 -2
- package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
- package/dist/_dts/sdk/src/data/types.d.ts +2 -2
- package/dist/_dts/sdk/src/index.d.ts +8 -8
- package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
- package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
- package/dist/_dts/sdk/src/navigation/index.d.ts +2 -2
- package/dist/_dts/sdk/src/next/index.d.ts +7 -7
- package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
- package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
- package/dist/_dts/sdk/src/portal/client.d.ts +1 -1
- package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
- package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +4 -5
- package/dist/_dts/sdk/src/rendering/index.d.ts +6 -6
- package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
- package/dist/_dts/sdk/src/routing/index.d.ts +5 -5
- package/dist/_dts/sdk/src/server.d.ts +5 -5
- package/dist/_dts/sdk/src/spam-protection/index.d.ts +2 -2
- package/dist/_dts/sdk/src/theme/index.d.ts +1 -1
- package/dist/_dts/{types-CwtTcaQP.d.ts → types-BB33-Spd.d.ts} +3 -3
- package/dist/_dts/{types-D-WElMCy.d.ts → types-BVFXYtRg.d.ts} +7 -7
- package/dist/_dts/{types-BlaCuPLr.d.ts → types-FOsJ-KYb.d.ts} +4 -2
- package/dist/_dts/{validation-Y5wD9fGK.d.ts → validation-DckTc6TQ.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-DFqkx158.mjs → BlocksIslandsHydrator-DcwEaliO.mjs} +21 -21
- package/dist/client/BookingMailingListNote-Dsugoe-n.mjs +946 -0
- package/dist/client/BookingQuestionFields-Bhh0cvsl.mjs +359 -0
- package/dist/client/{CalendarNavigationChevron-DQwJ7BPx.mjs → CalendarNavigationChevron-CNe3ZjdC.mjs} +7 -7
- package/dist/client/{CheckboxChoice-CZ-anOqV.mjs → CheckboxChoice-W_uiRgDK.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-DdkY86qI.mjs → DemoBookingPortalAccess-BeiZxEUJ.mjs} +7 -7
- package/dist/client/{EventCalendar.client-DAeQPV76.mjs → EventCalendar.client-BL943-tl.mjs} +9 -9
- package/dist/client/{EventCombined.client-Bus9R0bj.mjs → EventCombined.client-BFVxECTp.mjs} +8 -8
- package/dist/client/{EventEmbeddedCheckoutStep-D_14yqAU.mjs → EventEmbeddedCheckoutStep-Cf-HRHtb.mjs} +1 -1
- package/dist/client/{EventItem-DPBLjGwj.mjs → EventItem-BIc4gjiD.mjs} +37 -15
- package/dist/client/{EventListWeekNavigation-D6cwU82_.mjs → EventListWeekNavigation-a0QEIEf0.mjs} +1 -1
- package/dist/client/{EventListing.client-Bogi_SnJ.mjs → EventListing.client-CEFTC3jH.mjs} +3 -3
- package/dist/client/{EventListing.view-CEumpN7i.mjs → EventListing.view-Bt2sBBms.mjs} +34 -16
- package/dist/client/{EventRegistrationPayment-CIQw6vNy.mjs → EventRegistrationPayment-D9YBNb_E.mjs} +250 -40
- package/dist/client/{LocationMapActions-BVO-qx4q.mjs → LocationMapActions-gqzt5gkW.mjs} +2 -2
- package/dist/client/{MapDrawingSvg-CcGaFawl.mjs → MapDrawingSvg-13JQI7_z.mjs} +1 -1
- package/dist/client/{Page-D4_H_u9V.mjs → Page-D_M2Vxz3.mjs} +4471 -1601
- package/dist/client/{ProtectedSubmitButton-8DuDw2ag.mjs → ProtectedSubmitButton-C3H26pN9.mjs} +1 -1
- package/dist/client/{StepIndicator-Dptantmg.mjs → StepIndicator-CaN8snZ8.mjs} +3 -3
- package/dist/client/{TabBarFragment-BxEGsKUx.mjs → TabBarFragment-DkVKtK5a.mjs} +1 -1
- package/dist/client/{ThemedButton-8jUc02mZ.mjs → ThemedButton-BdnEwA38.mjs} +2 -5
- package/dist/client/accessibleSurfaces-chpD4C2c.mjs +4278 -0
- package/dist/client/{accordion--EUHmEGa.mjs → accordion-DE7OG--d.mjs} +1 -1
- package/dist/client/{booking-form.client-BCXwOnhc.mjs → booking-form.client-CS1PPjw7.mjs} +842 -374
- package/dist/client/{bookingForm-sHHcdism.mjs → bookingForm-DE2CwIU9.mjs} +5 -4
- package/dist/client/{src-DjnxOjXG.mjs → bookingQuestionValues-BjcyCru5.mjs} +88 -1
- package/dist/client/bookingQuestions-BHq83mzS.mjs +13 -0
- package/dist/client/bookings.mjs +18 -13
- package/dist/client/{carousel-Cp9xPBFZ.mjs → carousel-DZyUdnFh.mjs} +3 -3
- package/dist/client/{carousel.client-BO7sCEpH.mjs → carousel.client-BD4DXMtI.mjs} +62 -16
- package/dist/client/{carousel.shared-DBnWEJzo.mjs → carousel.shared-BFQ3kBEw.mjs} +6 -3
- package/dist/client/{cart-CCZZC-Lq.mjs → cart-D7HkkNwe.mjs} +3 -3
- package/dist/client/{cart.client-B7JfA19I.mjs → cart.client-H4sv2TpD.mjs} +1 -1
- package/dist/client/{checkout-CipmYL4A.mjs → checkout-2qVyG-Sh.mjs} +3 -3
- package/dist/client/{checkout.client-DraalWdH.mjs → checkout.client-DAjrBZ74.mjs} +1 -1
- package/dist/client/client.mjs +240 -63
- package/dist/client/{context-Cv3QHjAF.mjs → context-DXmIbXCK.mjs} +297 -3
- package/dist/client/{cta-P2vJVTEn.mjs → cta-DP_IBnq3.mjs} +2 -2
- package/dist/client/{dateFormatting-D8D47VT4.mjs → dateFormatting-CwrkFZTr.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-CXWZoV-d.mjs → demoPortalMagicLink-DQXK-Fh6.mjs} +1 -1
- package/dist/client/{enhanceHeaderSection-BkAro1DJ.mjs → enhanceHeaderSection-DheQj7rg.mjs} +3 -3
- package/dist/client/{event-details.client-dLmyuPap.mjs → event-details.client-C5UufcRp.mjs} +1 -1
- package/dist/client/{event-registration.client-BEhC2_-Y.mjs → event-registration.client-CMGg63IU.mjs} +72 -235
- package/dist/client/{eventCalendar-FBMS2Cpb.mjs → eventCalendar-DlD0GCEy.mjs} +4 -4
- package/dist/client/{eventCombined-BrBhUvGe.mjs → eventCombined-DoSi8p_l.mjs} +4 -4
- package/dist/client/{eventDetails-C7WUrbZ2.mjs → eventDetails-DzuQYgmO.mjs} +2 -2
- package/dist/client/{eventListing-Bih-BgQM.mjs → eventListing-CkiMjl0g.mjs} +4 -4
- package/dist/client/{eventRegistration-DfTlqGbl.mjs → eventRegistration-CjS3Zpjp.mjs} +4 -4
- package/dist/client/{form-Bw1uuiUs.mjs → form-DgQqm7T2.mjs} +3 -3
- package/dist/client/{form.client-pZ-9gN33.mjs → form.client-BI9Dcsq5.mjs} +5 -5
- package/dist/client/{form.parts-PXlu6XQO.mjs → form.parts-DevF0L_A.mjs} +3 -3
- package/dist/client/{formatDate-DI3DP48e.mjs → formatDate-DDyURjoe.mjs} +1 -1
- package/dist/client/gifting/client.mjs +3 -3
- package/dist/client/{headerSection-BpJYUMd6.mjs → headerSection-DYIG6Pwb.mjs} +2 -2
- package/dist/client/{mediaAssets-DpPauppt.mjs → mediaAssets-B99AP7ai.mjs} +1 -1
- package/dist/client/{mediaContext-BLo4NtjP.mjs → mediaContext-Fusweriw.mjs} +1 -1
- package/dist/client/{newsletter-form.client-CSoP0cGR.mjs → newsletter-form.client-BWp7Y1e1.mjs} +6 -6
- package/dist/client/{newsletter-form.parts-DDbX_Sj0.mjs → newsletter-form.parts-Dg8s9NwJ.mjs} +2 -2
- package/dist/client/{newsletterForm-vCxYRar_.mjs → newsletterForm-DnPraMzx.mjs} +3 -3
- package/dist/client/{noop-ByVtIWf4.mjs → noop-ByFRHYQ2.mjs} +437 -496
- package/dist/client/portal/client.mjs +76 -229
- package/dist/client/{product-detail.client-7Pi6avM-.mjs → product-detail.client-BFAgHrdg.mjs} +1 -1
- package/dist/client/{product-list.client-DEad-Pma.mjs → product-list.client-DVrs_DyY.mjs} +1 -1
- package/dist/client/{productDetail-G1SMXG13.mjs → productDetail-D4rvl6Xg.mjs} +3 -3
- package/dist/client/{productList-B21TGdpT.mjs → productList-B8o5AOMX.mjs} +3 -3
- package/dist/client/{propsDecoder-B3vIBkex.mjs → propsDecoder-hhotPP6P.mjs} +5 -4
- package/dist/client/{registry.server-B8aQhJpO.mjs → registry.server-Ch3EpupA.mjs} +2213 -2433
- package/dist/client/{surfaceTransportMarker-BXepAVF6.mjs → renderableMediaAssetAdmission-BlfqYLJW.mjs} +1 -18
- package/dist/client/rendering/client.mjs +30 -30
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +10 -9
- package/dist/client/{richText-coerce-DHkBtO0G.mjs → richText-coerce-C3LabQ1O.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-DbHX4JOS.mjs → routeIslandApiConfig-CQGlxId8.mjs} +1 -1
- package/dist/client/runtimeResponse-BP-L6exS.mjs +3 -0
- package/dist/client/runtimeResponse-Dg4XFsuM.mjs +9 -0
- package/dist/client/{shop-commerce-B2UmrQg_.mjs → shop-commerce-VDbVaKY-.mjs} +12 -12
- package/dist/client/{shop-commerce-store-B7n-Z7nY.mjs → shop-commerce-store-DqdgJ8Zw.mjs} +1 -1
- package/dist/client/{shop-mqyoOvOK.mjs → shop-rRXplPGZ.mjs} +3 -3
- package/dist/client/{shop.client-BH-BBnA9.mjs → shop.client-DdwvMvaK.mjs} +13 -13
- package/dist/client/{shop.interactive-mdM3UMWG.mjs → shop.interactive-C8OvFY06.mjs} +141 -66
- package/dist/client/{shopShared-CXF5wxdg.mjs → shopShared-BeuJiGPU.mjs} +2 -2
- package/dist/client/spam-protection.mjs +1 -1
- package/dist/client/surfaceTransportMarker-BuwkYxsI.mjs +19 -0
- package/dist/client/{timetableModel-CrC80EOG.mjs → timetableModel-Cko9LRKy.mjs} +11 -11
- package/dist/client/{types-sF-IrGQr.mjs → types-5fOsPIpL.mjs} +248 -111
- package/dist/client/{useAvailableSlots-C4LOaI_Z.mjs → useAvailableSlots-M6QIEiWf.mjs} +3 -3
- package/dist/client/{useDiscountApply-6Q0nToVA.mjs → useDiscountApply-BJSnyO0f.mjs} +3 -3
- package/dist/client/{useDiscountCodeUi-CM-DTX5X.mjs → useDiscountCodeUi-D3XnOSCi.mjs} +1 -1
- package/dist/client/{useEventPagination-Bcs89BR5.mjs → useEventPagination-PhTIoFVX.mjs} +7 -7
- package/dist/client/{view-BN-fxyfq.mjs → view-448wvvEY.mjs} +11 -7
- package/dist/client/{view-Dh2tGoS0.mjs → view-L_mkgtnk.mjs} +4 -4
- package/dist/client/{site-styles-D56hT2u1.mjs → wizardSteps-CFulHWnT.mjs} +19660 -18565
- package/dist/preview-next/client/{ArrangementLookControls-D4VjPs-r.mjs → ArrangementLookControls-BpvnOGlN.mjs} +26 -17
- package/dist/preview-next/client/{EventEmbeddedCheckoutStep-C_h1cMYm.mjs → EventEmbeddedCheckoutStep-8-qtHjpb.mjs} +1 -1
- package/dist/preview-next/client/{LocationPickerEnvironment-D56RD3e_.mjs → LocationPickerEnvironment-CZQ4vkRe.mjs} +1 -1
- package/dist/preview-next/client/{MapLibreEditMap-DFnyCckr.mjs → MapLibreEditMap-CP4w7T_0.mjs} +2 -2
- package/dist/preview-next/client/{PreviewEditorSidebar-Ckr2zk_L.mjs → PreviewEditorSidebar-C0OtdWu_.mjs} +128 -21
- package/dist/preview-next/client/{PreviewEditorUI-KOZgw_gS.mjs → PreviewEditorUI-Csc5vH5k.mjs} +6 -6
- package/dist/preview-next/client/{PreviewShell-CyO2V4kB.mjs → PreviewShell-BOLH_pm-.mjs} +199 -155
- package/dist/preview-next/client/{SdkPreviewModeRuntime-DW3uKvNF.mjs → SdkPreviewModeRuntime-CKodLReY.mjs} +31 -32
- package/dist/preview-next/client/{SiteChromeCustomizeButton-CU9VD-7O.mjs → SiteChromeCustomizeButton-BeEZpeKn.mjs} +3780 -3436
- package/dist/preview-next/client/{ThemedButton-C0dgGJ5k.mjs → ThemedButton-BQU45t-E.mjs} +260 -121
- package/dist/preview-next/client/{lucide-react-CPBCf6QT.mjs → lucide-react-DkZ8fO-G.mjs} +1 -1
- package/dist/preview-next/client/{previewAssistantSlot-DBi-WybM.mjs → previewAssistantSlot-BBdN5kfY.mjs} +18697 -15557
- package/dist/preview-next/client/{previewChromeSurface-BhkUJst9.mjs → previewChromeSurface-VZtGwPuH.mjs} +1 -1
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-BjCb6lOn.mjs → sdk-runtime-kiZkMcuR.mjs} +2 -2
- package/dist/preview-next/client/{useAutosaveStatus-CKxTaC3j.mjs → useAutosaveStatus-BiIHEeE0.mjs} +2 -2
- package/dist/preview-next/client/{useBlockCustomizeControls-B7MLTjBX.mjs → useBlockCustomizeControls-BuFLIpmX.mjs} +2 -2
- package/dist/preview-next/client/{useOpenBlockForSetup-BTUc0g9X.mjs → useOpenBlockForSetup-DlxYgmh_.mjs} +1 -1
- package/dist/preview-next/keepAlive.mjs +1 -1
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-Bv3nkdpV.mjs → route-contract-C0sCvCYL.mjs} +165 -0
- package/dist/server/{Block.shared-4fMqzltx.mjs → Block.shared-Dnhc0Wu5.mjs} +5 -5
- package/dist/server/{ThemeScopeCore-C72VC_lR.mjs → ThemeScopeCore-NAQ_zsFu.mjs} +461 -128
- package/dist/server/{accessibleSurfaces-B_Y_dA20.mjs → accessibleSurfaces-108nxyGc.mjs} +319 -131
- package/dist/server/{bindings-ConMYJ2U.mjs → bindings-DLoZYUxG.mjs} +2 -2
- package/dist/server/{client-Cot-H5fQ.mjs → client-Bc8jI8zN.mjs} +261 -61
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +1 -1
- package/dist/server/{validation-CDd6m8Ry.mjs → customCss-QymcmOZ-.mjs} +12 -55
- package/dist/server/data/resolveBlockData.mjs +1 -1
- package/dist/server/headerVariant-BwR9NV4b.mjs +463 -0
- package/dist/server/{identity-Bn9OQiT1.mjs → identity-20XHqyuO.mjs} +1 -1
- package/dist/server/index.mjs +3 -3
- package/dist/server/{loadContent-BkaWYEwt.mjs → loadContent-D61gpqHB.mjs} +4 -5
- package/dist/server/{loadPage-kviUdH8c.mjs → loadPage-B4ZYpIcd.mjs} +2 -2
- package/dist/server/manifest.mjs +1 -1
- package/dist/server/{media-DnlczCMA.mjs → media-Brn9FW5s.mjs} +15 -1
- package/dist/server/{mode-Cv_TG9gP.mjs → mode-bkFS8glh.mjs} +4 -2
- package/dist/server/next.mjs +6 -6
- package/dist/server/{opaqueSurface-BTnS09GS.mjs → opaqueSurface-BawlEAd_.mjs} +6 -6
- package/dist/server/{overrideResolution-itXZCXs7.mjs → overrideResolution-CDReKy2P.mjs} +1 -1
- package/dist/server/page-converter.mjs +3 -3
- package/dist/server/{pageRenderPlan-CDyn7iLy.mjs → pageRenderPlan-ByVTA7-4.mjs} +255 -158
- package/dist/server/{pageRuntimeSupport-DZ6cLxrM.mjs → pageRuntimeSupport-Dzz_Dze6.mjs} +291 -5
- package/dist/server/{pageShared-Q_Vij87H.mjs → pageShared-Dk5Ku6hs.mjs} +1285 -897
- package/dist/server/{schema-DEizlyi4.mjs → parseThemeForPersistence-pJPGfMrf.mjs} +593 -1592
- package/dist/server/{prebuild-DOG4MkOy.mjs → prebuild-CW4M0WEZ.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-DlprLLsc.mjs → prefetchBlockData-Bvx0SiIM.mjs} +5 -4
- package/dist/server/{registry-BPFcpn6k.mjs → registry-Bh0Y25zH.mjs} +4399 -4065
- package/dist/server/rendering/components/pageShared.mjs +1 -1
- package/dist/server/rendering/helpers/loadPage.mjs +1 -1
- package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +1 -1
- package/dist/server/rendering/server.mjs +3 -3
- package/dist/server/rendering.mjs +8 -8
- package/dist/server/{resolveBlockData-BHvfGD4y.mjs → resolveBlockData-CnHHst9r.mjs} +1 -1
- package/dist/server/{resolveButtonColourStates-OXFRGn5M.mjs → resolveButtonColourStates-Cn6j8Ee0.mjs} +399 -518
- package/dist/server/{responseMedia-D8J3VAFs.mjs → responseMedia-t6gs0cB7.mjs} +2 -2
- package/dist/server/{richTextSchema-Euhuj-7V.mjs → richTextSchema-DQ2NBP0n.mjs} +5 -16
- package/dist/server/server.mjs +3 -3
- package/dist/server/theme-bridge.mjs +2 -3
- package/dist/server/theme.mjs +1 -2
- package/dist/server/{three-pass-converter-_j2UE2tR.mjs → three-pass-converter-CQWdnfjV.mjs} +1 -1
- package/dist/server/{validation-bl6WcAi_.mjs → validation-D2bHWSxJ.mjs} +57 -8
- package/dist/server/{version-BLXZ31S-.mjs → version-DkM1eAxG.mjs} +1 -1
- package/dist/styles/index.css +340 -68
- package/package.json +4 -3
- package/dist/_dts/index-CXsnaCGe.d.ts +0 -10
- package/dist/_dts/index-RugyUnqR.d.ts +0 -31535
- package/dist/client/BookingMailingListNote-CCVXX1LN.mjs +0 -331
- package/dist/client/DemoPortalSignInLink-B9YrzZt2.mjs +0 -19
- package/dist/client/site-styles-CMCUxsIM.mjs +0 -3
- package/dist/client/useBookingNowIso-BDmWkYUW.mjs +0 -58
- package/dist/client/wizardSteps-DtkhwKXK.mjs +0 -6933
- package/dist/server/parseThemeForPersistence-CDrF51tJ.mjs +0 -52
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { a as formatTime$1, c as unsafeAsAppointmentServiceId, i as formatDatePillParts, n as useAvailableDates, o as getRuntimeTimeZone, r as formatDate$1, s as unsafeAsAppointmentResourceId, t as useAvailableSlots } from "./useAvailableSlots-
|
|
5
|
-
import {
|
|
6
|
-
import { d as DiscountCodeDisclosure, i as SiteTermsChangedNotice, o as useSiteTermsAgreement, r as SiteTermsAgreementField, t as BookingConfirmation } from "./DemoBookingPortalAccess-
|
|
2
|
+
import { B as paymentChoiceDetails, Dr as BOOKING_FORM_DATA_RESERVED_KEYS, Gn as readOverrideServiceCategories, Jn as formatBookingSubmissionPreparationError, Kn as deriveBookingFormViewState, Kt as createSignInReturnDraftStore, La as resolveBookingSignupOffer, R as buildBookingPaymentSelectionViewModel, Tr as toBookingQuestionsAnswerDraft, Ur as readRuntimeNow, V as paymentChoicePrice, Wn as buildBookingFormInteractiveIslandProps, Wr as resolveDateRuntimeContext, Xn as getBookingServiceSlidingScale, Yn as getBookingRedirectStateFromLocation, Zn as getBookingSuccessCopy, _r as isAppointmentBookingQuestionsEvent, ar as resolveAppointmentCheckoutVerificationState, cr as resolveDefaultBookingServiceId, dr as projectSelectedAppointmentConsentIntoForm, eo as unsafeAsSiteId, er as isBookingServiceSlidingAmountInRange, fr as resolveSelectedAppointmentConsent, gr as deriveAppointmentBookingQuestions, hr as appointmentQuestionsRefusal, ir as prepareBookingSubmission, lr as selectedBookingCollectionOptionKind, mr as applyAppointmentBookingQuestionsEvent, nr as normalizeBookingServices, or as resolveBookingPaymentStep, pr as EMPTY_APPOINTMENT_BOOKING_QUESTIONS, qn as formatBookingCentsAsCurrencyInput, rr as parseBookingCurrencyInputToCents, sr as resolveBookingSiteId, tr as normalizeBookingFormConfig, ur as toSelectedCollectionOptionKind, vr as needsAppointmentQuestionsRefresh, wr as restoreBookingQuestionsAnswers, xr as decideBookingQuestionsRestoration, yr as bookingQuestionsAnswerDraftSchema, z as buildReviewedBookingPaymentViewModel } from "./wizardSteps-CFulHWnT.mjs";
|
|
3
|
+
import { $t as formatCurrencyAmount, Gt as resolveBookingTimeZoneId, Jt as toUtcIsoDateTimeString, Nt as resolveBookingDisplayContext, Ot as formatDateTimeRange, Tt as formatDate, V as isBookingRequirementConsentFieldId, Wt as resolveBookingBusinessTimeZone, jt as formatTimeZoneCityLabel, kt as formatTime, qt as parseUtcIsoDateTimeString, t as logger } from "./noop-ByFRHYQ2.mjs";
|
|
4
|
+
import { a as formatTime$1, c as unsafeAsAppointmentServiceId, i as formatDatePillParts, n as useAvailableDates, o as getRuntimeTimeZone, r as formatDate$1, s as unsafeAsAppointmentResourceId, t as useAvailableSlots } from "./useAvailableSlots-M6QIEiWf.mjs";
|
|
5
|
+
import { _ as reportWorkflowSuccess, d as assertNever, f as err, g as reportWorkflowError, h as clearWorkflowFeedback, i as checkBookingQuestionsAnswered, m as okWith } from "./bookingQuestionValues-BjcyCru5.mjs";
|
|
6
|
+
import { d as DiscountCodeDisclosure, i as SiteTermsChangedNotice, o as useSiteTermsAgreement, r as SiteTermsAgreementField, t as BookingConfirmation } from "./DemoBookingPortalAccess-BeiZxEUJ.mjs";
|
|
7
7
|
import { t as layoutServicesByCategory } from "./appointment-service-categories-Cl2pqw-z.mjs";
|
|
8
|
-
import {
|
|
8
|
+
import { n as useBlockApi, t as BlockApiProvider } from "./context-DXmIbXCK.mjs";
|
|
9
|
+
import { l as SpinnerNode, r as ThemedButton } from "./ThemedButton-BdnEwA38.mjs";
|
|
9
10
|
import { t as buildCheckoutReturnUrls } from "./checkoutUrls-CYj06rX1.mjs";
|
|
10
11
|
import { t as scrollToBlock } from "./scrollToBlock-DrgKE0qZ.mjs";
|
|
11
|
-
import { t as CheckboxChoice } from "./CheckboxChoice-
|
|
12
|
+
import { t as CheckboxChoice } from "./CheckboxChoice-W_uiRgDK.mjs";
|
|
12
13
|
import { t as CheckIcon } from "./CheckIcon-CVcKteXH.mjs";
|
|
13
14
|
import { n as getFieldValidationControlProps, t as FieldValidationMessage } from "./FieldValidationMessage-CsqxShw4.mjs";
|
|
14
15
|
import { t as FeedbackMessage } from "./FeedbackMessage-CSJrAuXH.mjs";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
16
|
+
import { i as useBookingNowIso, n as OptionalMark, r as parseBookingSubmissionFailure } from "./BookingQuestionFields-Bhh0cvsl.mjs";
|
|
17
|
+
import { n as TerminalPanel, r as StateIcon, t as useDiscountCodeUi } from "./useDiscountCodeUi-D3XnOSCi.mjs";
|
|
18
|
+
import { a as usePolling, c as useBookingQuestionsRefresh, i as BookingConsentAgreement, l as PaymentChoiceRows, n as BookingQuestionSections, o as portalSessionIdentity, s as useSignInReturn, t as BookingMailingListNote } from "./BookingMailingListNote-Dsugoe-n.mjs";
|
|
17
19
|
import { t as StepIndicator } from "./StepIndicator-BK0GEDoP.mjs";
|
|
18
|
-
import {
|
|
19
|
-
import { t as useBookingNowIso } from "./useBookingNowIso-BDmWkYUW.mjs";
|
|
20
|
-
import { s as storeDemoBookingPassIfAvailable } from "./demoPortalMagicLink-CXWZoV-d.mjs";
|
|
20
|
+
import { s as storeDemoBookingPassIfAvailable } from "./demoPortalMagicLink-DQXK-Fh6.mjs";
|
|
21
21
|
import React, { useCallback, useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
|
|
22
|
+
import { z } from "zod";
|
|
22
23
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
23
24
|
//#region ../core/src/branded/entitlements.ts
|
|
24
25
|
const unsafeAsPassId = (id) => id;
|
|
@@ -70,6 +71,199 @@ function useSelectedAppointmentConsentForm(form, selectedService) {
|
|
|
70
71
|
return useMemo(() => projectSelectedAppointmentConsentIntoForm(form, resolveSelectedAppointmentConsent(selectedService)), [form, selectedService]);
|
|
71
72
|
}
|
|
72
73
|
//#endregion
|
|
74
|
+
//#region ../blocks/src/system/runtime/nodes/booking-form.field-values.ts
|
|
75
|
+
function collectInitialBookingFieldValues(initialData) {
|
|
76
|
+
const values = {};
|
|
77
|
+
for (const [key, value] of Object.entries(initialData)) if (!BOOKING_FORM_DATA_RESERVED_KEYS.has(key) && !isBookingRequirementConsentFieldId(key) && isBookingFieldValue(value)) values[key] = value;
|
|
78
|
+
return values;
|
|
79
|
+
}
|
|
80
|
+
function omitBookingConsentEntries(record) {
|
|
81
|
+
return Object.fromEntries(Object.entries(record).filter(([key]) => !isBookingRequirementConsentFieldId(key)));
|
|
82
|
+
}
|
|
83
|
+
function isBookingFieldValue(value) {
|
|
84
|
+
return value === null || typeof value === "string" || typeof value === "number" || typeof value === "boolean" || Array.isArray(value) && value.every((item) => typeof item === "string");
|
|
85
|
+
}
|
|
86
|
+
/** The appointment form's drafts, for the shared `useSignInReturn` owner. */
|
|
87
|
+
const bookingSignInDraftStore = createSignInReturnDraftStore(z.object({
|
|
88
|
+
nonce: z.string().min(1),
|
|
89
|
+
email: z.string(),
|
|
90
|
+
currentStepId: z.enum([
|
|
91
|
+
"service-selection",
|
|
92
|
+
"datetime-selection",
|
|
93
|
+
"payment-selection",
|
|
94
|
+
"custom-fields"
|
|
95
|
+
]),
|
|
96
|
+
selectedServiceId: z.string().optional(),
|
|
97
|
+
selectedResourceId: z.string().optional(),
|
|
98
|
+
selectedDate: z.string().optional(),
|
|
99
|
+
selectedSlot: z.object({
|
|
100
|
+
startAt: z.string(),
|
|
101
|
+
endAt: z.string(),
|
|
102
|
+
resourceId: z.string(),
|
|
103
|
+
resourceName: z.string().optional(),
|
|
104
|
+
label: z.string().optional()
|
|
105
|
+
}).nullable(),
|
|
106
|
+
fieldValues: z.record(z.string(), z.union([
|
|
107
|
+
z.string(),
|
|
108
|
+
z.number(),
|
|
109
|
+
z.boolean(),
|
|
110
|
+
z.null(),
|
|
111
|
+
z.array(z.string())
|
|
112
|
+
])),
|
|
113
|
+
mailingListOptIn: z.boolean(),
|
|
114
|
+
selectedSlidingAmountInput: z.string(),
|
|
115
|
+
selectedCollectionOptionKind: z.enum([
|
|
116
|
+
"upfront",
|
|
117
|
+
"deferred_manual",
|
|
118
|
+
"instalment_plan",
|
|
119
|
+
"flexible_balance"
|
|
120
|
+
]).optional(),
|
|
121
|
+
discountCode: z.string(),
|
|
122
|
+
questions: bookingQuestionsAnswerDraftSchema
|
|
123
|
+
}));
|
|
124
|
+
/** The booker's progress, minus consent ticks, which they give again on return. */
|
|
125
|
+
function toBookingSignInDraft(state, attempt) {
|
|
126
|
+
return {
|
|
127
|
+
nonce: attempt.nonce,
|
|
128
|
+
email: attempt.email,
|
|
129
|
+
currentStepId: state.currentStepId,
|
|
130
|
+
selectedServiceId: state.selectedServiceId,
|
|
131
|
+
selectedResourceId: state.selectedResourceId,
|
|
132
|
+
selectedDate: state.selectedDate,
|
|
133
|
+
selectedSlot: state.selectedSlot ? {
|
|
134
|
+
startAt: state.selectedSlot.startAt,
|
|
135
|
+
endAt: state.selectedSlot.endAt,
|
|
136
|
+
resourceId: state.selectedSlot.resourceId,
|
|
137
|
+
...state.selectedSlot.resourceName ? { resourceName: state.selectedSlot.resourceName } : {},
|
|
138
|
+
...state.selectedSlot.label ? { label: state.selectedSlot.label } : {}
|
|
139
|
+
} : null,
|
|
140
|
+
fieldValues: omitBookingConsentEntries(state.fieldValues),
|
|
141
|
+
mailingListOptIn: state.mailingListOptIn,
|
|
142
|
+
selectedSlidingAmountInput: state.selectedSlidingAmountInput,
|
|
143
|
+
selectedCollectionOptionKind: state.selectedCollectionOptionKind,
|
|
144
|
+
discountCode: state.discountCode,
|
|
145
|
+
questions: toBookingQuestionsAnswerDraft(state.bookingQuestions)
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Puts the booker back where they were, once `useSignInReturn` has matched the
|
|
150
|
+
* return to the signed-in profile. Field values they typed win over the page's
|
|
151
|
+
* prefill; the availability check then drops the slot if it's gone. The
|
|
152
|
+
* answers come back only as `decideBookingQuestionsRestoration` decided.
|
|
153
|
+
*/
|
|
154
|
+
function restoreBookingSignInDraft(state, draft, questions) {
|
|
155
|
+
const slot = draft.selectedSlot ? {
|
|
156
|
+
...draft.selectedSlot,
|
|
157
|
+
key: `${draft.selectedSlot.startAt}|${draft.selectedSlot.endAt}|${draft.selectedSlot.resourceId}`,
|
|
158
|
+
resourceId: unsafeAsAppointmentResourceId(draft.selectedSlot.resourceId)
|
|
159
|
+
} : null;
|
|
160
|
+
return {
|
|
161
|
+
...state,
|
|
162
|
+
currentStepId: draft.currentStepId,
|
|
163
|
+
selectedServiceId: draft.selectedServiceId ? unsafeAsAppointmentServiceId(draft.selectedServiceId) : state.selectedServiceId,
|
|
164
|
+
selectedResourceId: draft.selectedResourceId ? unsafeAsAppointmentResourceId(draft.selectedResourceId) : void 0,
|
|
165
|
+
selectedDate: draft.selectedDate,
|
|
166
|
+
selectedSlot: slot,
|
|
167
|
+
fieldValues: {
|
|
168
|
+
...state.fieldValues,
|
|
169
|
+
...draft.fieldValues
|
|
170
|
+
},
|
|
171
|
+
mailingListOptIn: draft.mailingListOptIn,
|
|
172
|
+
selectedSlidingAmountInput: draft.selectedSlidingAmountInput,
|
|
173
|
+
selectedCollectionOptionKind: draft.selectedCollectionOptionKind,
|
|
174
|
+
discountCode: draft.discountCode,
|
|
175
|
+
bookingQuestions: restoreBookingQuestionsAnswers(state.bookingQuestions, questions)
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region ../blocks/src/system/runtime/hooks/useAppointmentBookingQuestions.ts
|
|
180
|
+
/** Completing the booking ends every draft; changing service leaves this tab's attempt behind. */
|
|
181
|
+
function appointmentSignInEnds(previous, next) {
|
|
182
|
+
if (next.phase === "completed" && previous.phase !== "completed") return "finished";
|
|
183
|
+
return previous.selectedServiceId !== next.selectedServiceId ? "abandoned" : null;
|
|
184
|
+
}
|
|
185
|
+
/** The signed-in read for the selected service, once per service and session. */
|
|
186
|
+
function useAppointmentQuestionsRefresh(input) {
|
|
187
|
+
const { api, state, selectedService, identity, dispatch } = input;
|
|
188
|
+
const serviceId = needsAppointmentQuestionsRefresh({
|
|
189
|
+
service: selectedService,
|
|
190
|
+
identity,
|
|
191
|
+
refreshed: state.bookingQuestions.refreshed
|
|
192
|
+
}) ? selectedService?.id ?? null : null;
|
|
193
|
+
useBookingQuestionsRefresh({
|
|
194
|
+
api,
|
|
195
|
+
target: serviceId ? {
|
|
196
|
+
kind: "appointment_service",
|
|
197
|
+
serviceId
|
|
198
|
+
} : null,
|
|
199
|
+
targetKey: serviceId,
|
|
200
|
+
identity,
|
|
201
|
+
dispatch
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* The appointment flow's during-booking questions: what to show, the
|
|
206
|
+
* authenticated refresh, and keeping progress across a sign-in link.
|
|
207
|
+
*/
|
|
208
|
+
function useAppointmentBookingQuestions(input) {
|
|
209
|
+
const { state, selectedService, identity, dispatch } = input;
|
|
210
|
+
const view = useMemo(() => deriveAppointmentBookingQuestions(state.bookingQuestions, selectedService, identity), [
|
|
211
|
+
identity,
|
|
212
|
+
selectedService,
|
|
213
|
+
state.bookingQuestions
|
|
214
|
+
]);
|
|
215
|
+
useAppointmentQuestionsRefresh(input);
|
|
216
|
+
const signIn = useSignInReturn({
|
|
217
|
+
siteId: input.siteId,
|
|
218
|
+
formId: input.formId,
|
|
219
|
+
state,
|
|
220
|
+
store: bookingSignInDraftStore,
|
|
221
|
+
toDraft: toBookingSignInDraft,
|
|
222
|
+
ends: appointmentSignInEnds,
|
|
223
|
+
session: {
|
|
224
|
+
api: input.api,
|
|
225
|
+
identity
|
|
226
|
+
},
|
|
227
|
+
ready: true,
|
|
228
|
+
restore: (draft, verifiedIdentity) => dispatch({
|
|
229
|
+
type: "sign-in-draft-restored",
|
|
230
|
+
draft,
|
|
231
|
+
questions: decideBookingQuestionsRestoration({
|
|
232
|
+
kind: "sign_in_draft",
|
|
233
|
+
draft: draft.questions,
|
|
234
|
+
verifiedIdentity
|
|
235
|
+
})
|
|
236
|
+
})
|
|
237
|
+
});
|
|
238
|
+
const { scope } = view;
|
|
239
|
+
const answer = useCallback((fieldId, value) => dispatch({
|
|
240
|
+
type: "booking-question-answered",
|
|
241
|
+
scope,
|
|
242
|
+
fieldId,
|
|
243
|
+
value
|
|
244
|
+
}), [dispatch, scope]);
|
|
245
|
+
const chooseAnswerMode = useCallback((mode) => dispatch({
|
|
246
|
+
type: "booking-questions-answer-mode-set",
|
|
247
|
+
scope,
|
|
248
|
+
mode
|
|
249
|
+
}), [dispatch, scope]);
|
|
250
|
+
const keepRefused = useCallback(() => dispatch({
|
|
251
|
+
type: "booking-questions-keep-refused",
|
|
252
|
+
scope
|
|
253
|
+
}), [dispatch, scope]);
|
|
254
|
+
return {
|
|
255
|
+
presentation: view.presentation,
|
|
256
|
+
values: view.values,
|
|
257
|
+
answerMode: view.answerMode,
|
|
258
|
+
submission: view.submission,
|
|
259
|
+
fieldErrors: state.questionFieldErrors,
|
|
260
|
+
answer,
|
|
261
|
+
chooseAnswerMode,
|
|
262
|
+
keepRefused,
|
|
263
|
+
...signIn
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
//#endregion
|
|
73
267
|
//#region ../blocks/src/system/runtime/hooks/useBookingSubmission.state.ts
|
|
74
268
|
const initialBookingSubmissionState = {
|
|
75
269
|
status: { tag: "idle" },
|
|
@@ -154,12 +348,12 @@ function useBookingSubmission(_siteId, terms) {
|
|
|
154
348
|
return okWith(response);
|
|
155
349
|
} catch (error) {
|
|
156
350
|
console.error("Booking submission error:", error);
|
|
157
|
-
const
|
|
351
|
+
const failure = parseBookingSubmissionFailure(error, "Failed to book appointment");
|
|
158
352
|
dispatch({
|
|
159
353
|
type: "submission-failed",
|
|
160
|
-
message
|
|
354
|
+
message: failure.message
|
|
161
355
|
});
|
|
162
|
-
return err(
|
|
356
|
+
return err(failure);
|
|
163
357
|
}
|
|
164
358
|
};
|
|
165
359
|
return {
|
|
@@ -181,6 +375,7 @@ function executeBookingSubmission$1(api, data) {
|
|
|
181
375
|
startAt: data.startAt,
|
|
182
376
|
endAt: data.endAt,
|
|
183
377
|
customFields: data.customFields,
|
|
378
|
+
bookingQuestions: data.bookingQuestions,
|
|
184
379
|
mailingListOptIn: data.mailingListOptIn,
|
|
185
380
|
timezone: data.timezone,
|
|
186
381
|
customerPassId: data.customerPassId
|
|
@@ -191,6 +386,7 @@ function executeBookingSubmission$1(api, data) {
|
|
|
191
386
|
startAt: data.startAt,
|
|
192
387
|
endAt: data.endAt,
|
|
193
388
|
customFields: data.customFields,
|
|
389
|
+
bookingQuestions: data.bookingQuestions,
|
|
194
390
|
mailingListOptIn: data.mailingListOptIn,
|
|
195
391
|
timezone: data.timezone,
|
|
196
392
|
shownTerms: data.shownTerms,
|
|
@@ -277,19 +473,6 @@ function applyBookingContactEvent(state, event) {
|
|
|
277
473
|
}
|
|
278
474
|
}
|
|
279
475
|
//#endregion
|
|
280
|
-
//#region ../blocks/src/system/runtime/nodes/booking-form.field-values.ts
|
|
281
|
-
function collectInitialBookingFieldValues(initialData) {
|
|
282
|
-
const values = {};
|
|
283
|
-
for (const [key, value] of Object.entries(initialData)) if (!BOOKING_FORM_DATA_RESERVED_KEYS.has(key) && !isBookingRequirementConsentFieldId(key) && isBookingFieldValue(value)) values[key] = value;
|
|
284
|
-
return values;
|
|
285
|
-
}
|
|
286
|
-
function omitBookingConsentEntries(record) {
|
|
287
|
-
return Object.fromEntries(Object.entries(record).filter(([key]) => !isBookingRequirementConsentFieldId(key)));
|
|
288
|
-
}
|
|
289
|
-
function isBookingFieldValue(value) {
|
|
290
|
-
return value === null || typeof value === "string" || typeof value === "number" || typeof value === "boolean" || Array.isArray(value) && value.every((item) => typeof item === "string");
|
|
291
|
-
}
|
|
292
|
-
//#endregion
|
|
293
476
|
//#region ../blocks/src/system/runtime/nodes/booking-form.headless.state.ts
|
|
294
477
|
const unsafeAsBookingFieldId = (id) => id;
|
|
295
478
|
function createInitialBookingFlowReducerState(input) {
|
|
@@ -310,6 +493,8 @@ function createInitialBookingFlowReducerState(input) {
|
|
|
310
493
|
selectedCollectionOptionKind: toSelectedCollectionOptionKind(initialData.selectedCollectionOptionKind),
|
|
311
494
|
selectedAppointmentPackageId: toOptionalCustomerPassId(toOptionalString(initialData.selectedAppointmentPackageId)),
|
|
312
495
|
review: null,
|
|
496
|
+
bookingQuestions: EMPTY_APPOINTMENT_BOOKING_QUESTIONS,
|
|
497
|
+
questionFieldErrors: {},
|
|
313
498
|
validationErrors: createEmptyBookingValidationErrors(),
|
|
314
499
|
feedback: { kind: "none" }
|
|
315
500
|
};
|
|
@@ -357,6 +542,7 @@ function applyAvailabilitySelectionInvalidation(state, invalidation) {
|
|
|
357
542
|
function reduceBookingFlowEvent(state, event) {
|
|
358
543
|
if (isBookingContactEvent(event)) return applyBookingContactEvent(state, event);
|
|
359
544
|
if (isBookingPaymentEvent(event)) return applyBookingPaymentEvent(state, event);
|
|
545
|
+
if (isAppointmentBookingQuestionsEvent(event)) return applyBookingQuestionsFlowEvent(state, event);
|
|
360
546
|
switch (event.type) {
|
|
361
547
|
case "resources-received": return planBookingResourceAcceptance({
|
|
362
548
|
...event,
|
|
@@ -403,6 +589,16 @@ function reduceBookingFlowEvent(state, event) {
|
|
|
403
589
|
...state,
|
|
404
590
|
validationErrors: event.errors
|
|
405
591
|
};
|
|
592
|
+
case "submission-failed": return {
|
|
593
|
+
...state,
|
|
594
|
+
phase: "editing",
|
|
595
|
+
questionFieldErrors: event.failure.questionFieldErrors,
|
|
596
|
+
feedback: {
|
|
597
|
+
kind: "error",
|
|
598
|
+
scope: "submission",
|
|
599
|
+
message: event.failure.message
|
|
600
|
+
}
|
|
601
|
+
};
|
|
406
602
|
case "feedback-set": return {
|
|
407
603
|
...state,
|
|
408
604
|
phase: event.feedback.kind === "success" ? "completed" : "editing",
|
|
@@ -412,7 +608,8 @@ function reduceBookingFlowEvent(state, event) {
|
|
|
412
608
|
case "feedback-cleared": return {
|
|
413
609
|
...state,
|
|
414
610
|
phase: "editing",
|
|
415
|
-
feedback: { kind: "none" }
|
|
611
|
+
feedback: { kind: "none" },
|
|
612
|
+
questionFieldErrors: {}
|
|
416
613
|
};
|
|
417
614
|
case "review-required": return {
|
|
418
615
|
...state,
|
|
@@ -435,19 +632,37 @@ function reduceBookingFlowEvent(state, event) {
|
|
|
435
632
|
};
|
|
436
633
|
case "submission-started": return {
|
|
437
634
|
...state,
|
|
438
|
-
phase: "submitting"
|
|
635
|
+
phase: "submitting",
|
|
636
|
+
questionFieldErrors: {}
|
|
439
637
|
};
|
|
440
638
|
case "submission-finished": return state.phase === "submitting" ? {
|
|
441
639
|
...state,
|
|
442
640
|
phase: "editing"
|
|
443
641
|
} : state;
|
|
642
|
+
case "sign-in-draft-restored": return restoreBookingSignInDraft(state, event.draft, event.questions);
|
|
444
643
|
case "reset": return event.initial;
|
|
445
644
|
default: return assertNever(event);
|
|
446
645
|
}
|
|
447
646
|
}
|
|
647
|
+
/** Answering a question clears the server's complaint about that question. */
|
|
648
|
+
function applyBookingQuestionsFlowEvent(state, event) {
|
|
649
|
+
const bookingQuestions = applyAppointmentBookingQuestionsEvent(state.bookingQuestions, event);
|
|
650
|
+
if (event.type !== "booking-question-answered" || !(event.fieldId in state.questionFieldErrors)) return {
|
|
651
|
+
...state,
|
|
652
|
+
bookingQuestions
|
|
653
|
+
};
|
|
654
|
+
const { [event.fieldId]: _answered, ...questionFieldErrors } = state.questionFieldErrors;
|
|
655
|
+
return {
|
|
656
|
+
...state,
|
|
657
|
+
bookingQuestions,
|
|
658
|
+
questionFieldErrors
|
|
659
|
+
};
|
|
660
|
+
}
|
|
448
661
|
function applyBookingServiceSelection(state, serviceId) {
|
|
449
662
|
return {
|
|
450
663
|
...state,
|
|
664
|
+
bookingQuestions: EMPTY_APPOINTMENT_BOOKING_QUESTIONS,
|
|
665
|
+
questionFieldErrors: {},
|
|
451
666
|
selectedServiceId: serviceId,
|
|
452
667
|
selectedResourceId: void 0,
|
|
453
668
|
selectedDate: void 0,
|
|
@@ -539,12 +754,12 @@ function buildBookingStepResolution(input) {
|
|
|
539
754
|
steps: [
|
|
540
755
|
{
|
|
541
756
|
id: "service-selection",
|
|
542
|
-
label: "
|
|
757
|
+
label: "Service",
|
|
543
758
|
visible: needsServiceSelection
|
|
544
759
|
},
|
|
545
760
|
{
|
|
546
761
|
id: "datetime-selection",
|
|
547
|
-
label: "
|
|
762
|
+
label: "Date and time",
|
|
548
763
|
visible: true
|
|
549
764
|
},
|
|
550
765
|
{
|
|
@@ -554,7 +769,7 @@ function buildBookingStepResolution(input) {
|
|
|
554
769
|
},
|
|
555
770
|
{
|
|
556
771
|
id: "custom-fields",
|
|
557
|
-
label: "Your
|
|
772
|
+
label: "Your details",
|
|
558
773
|
visible: hasFields
|
|
559
774
|
}
|
|
560
775
|
],
|
|
@@ -577,10 +792,16 @@ function resolveBookingStepVisibility(input, defaultServiceId, payment) {
|
|
|
577
792
|
function needsBookingPaymentStep(input, payment) {
|
|
578
793
|
return Boolean(getBookingServiceSlidingScale(payment.service)) || payment.mode !== "hidden" || Boolean(input.enableAppointmentPackages && (payment.service?.priceAmount ?? 0) > 0);
|
|
579
794
|
}
|
|
795
|
+
/** The service step needs a service, and a practitioner when the form insists on one. */
|
|
796
|
+
function serviceSelectionMessage(input) {
|
|
797
|
+
if (input.requiresResourceSelection && !(input.data.resourceId ?? input.defaultResourceId)) return "Please select a practitioner";
|
|
798
|
+
return input.data.serviceId ? null : "Please select a service";
|
|
799
|
+
}
|
|
580
800
|
function validateBookingStep(input) {
|
|
801
|
+
const refusal = input.questionsRefusal ?? null;
|
|
581
802
|
switch (input.stepId) {
|
|
582
|
-
case "service-selection": return bookingStepValidationFromMessage(
|
|
583
|
-
case "datetime-selection": return bookingStepValidationFromMessage(input.data.selectedSlot ? null : "Please select a date and time");
|
|
803
|
+
case "service-selection": return bookingStepValidationFromMessage(refusal ?? serviceSelectionMessage(input));
|
|
804
|
+
case "datetime-selection": return bookingStepValidationFromMessage(refusal ?? (input.data.selectedSlot ? null : "Please select a date and time"));
|
|
584
805
|
case "payment-selection": return validateBookingPaymentStep(input);
|
|
585
806
|
case "custom-fields": {
|
|
586
807
|
const errors = validateBookingFields({
|
|
@@ -708,11 +929,16 @@ function buildBookingAvailabilityQuery(input) {
|
|
|
708
929
|
timezone: input.timezone
|
|
709
930
|
};
|
|
710
931
|
}
|
|
932
|
+
/** The contact email says what it's for unless the site form gives it its own hint. */
|
|
933
|
+
const CONTACT_EMAIL_HINT = "We’ll send your confirmation here.";
|
|
934
|
+
function defaultBookingFieldHint(field) {
|
|
935
|
+
return field.id === "email" && field.type === "email" ? CONTACT_EMAIL_HINT : null;
|
|
936
|
+
}
|
|
711
937
|
function deriveBookingFieldViews(input) {
|
|
712
938
|
return (input.form?.schema?.fields ?? []).map((field) => {
|
|
713
939
|
const fieldId = unsafeAsBookingFieldId(field.id);
|
|
714
940
|
const inputId = `${input.idPrefix}-${fieldId}`;
|
|
715
|
-
const helpText = field.type === "booking_requirement_consent" ? null : field.helpText ??
|
|
941
|
+
const helpText = field.type === "booking_requirement_consent" ? null : field.helpText ?? defaultBookingFieldHint(field);
|
|
716
942
|
const helpTextId = helpText ? `${inputId}-help` : null;
|
|
717
943
|
const fieldValue = input.values[field.id] ?? null;
|
|
718
944
|
const localError = input.touched?.[field.id] ? validateBookingField(field, fieldValue) : null;
|
|
@@ -738,10 +964,17 @@ function deriveBookingFieldViews(input) {
|
|
|
738
964
|
});
|
|
739
965
|
}
|
|
740
966
|
function buildBookingSubmitPlan(input) {
|
|
967
|
+
const refusal = appointmentQuestionsRefusal(input.bookingQuestions.presentation);
|
|
968
|
+
if (refusal) return {
|
|
969
|
+
ok: false,
|
|
970
|
+
errors: createFormBookingValidationError(refusal),
|
|
971
|
+
message: refusal
|
|
972
|
+
};
|
|
741
973
|
const invalid = validateBookingSubmissionContact(input);
|
|
742
974
|
if (invalid) return invalid;
|
|
743
975
|
const prepared = prepareBookingSubmission({
|
|
744
976
|
shownTerms: input.shownTerms,
|
|
977
|
+
bookingQuestions: input.bookingQuestions.submission,
|
|
745
978
|
promisedDiscountId: input.promisedDiscountId,
|
|
746
979
|
formId: input.formId,
|
|
747
980
|
nowIso: input.nowIso,
|
|
@@ -910,7 +1143,8 @@ function resolveAppointmentPackagesModel(input) {
|
|
|
910
1143
|
value: items
|
|
911
1144
|
},
|
|
912
1145
|
items,
|
|
913
|
-
selected
|
|
1146
|
+
selected,
|
|
1147
|
+
heldWithTeamMembers: input.heldWithTeamMembers ?? []
|
|
914
1148
|
};
|
|
915
1149
|
}
|
|
916
1150
|
default: return assertNever(input.state);
|
|
@@ -1100,6 +1334,8 @@ function planBookingSubmissionStart(input) {
|
|
|
1100
1334
|
...input,
|
|
1101
1335
|
shownTerms: input.intent.kind === "accept-review" ? input.intent.review.terms : void 0
|
|
1102
1336
|
});
|
|
1337
|
+
const unanswered = planUnansweredBookingQuestions(input.bookingQuestions, plan);
|
|
1338
|
+
if (unanswered) return unanswered;
|
|
1103
1339
|
return plan.ok ? {
|
|
1104
1340
|
kind: "submit",
|
|
1105
1341
|
plan,
|
|
@@ -1117,6 +1353,31 @@ function planBookingSubmissionStart(input) {
|
|
|
1117
1353
|
}
|
|
1118
1354
|
};
|
|
1119
1355
|
}
|
|
1356
|
+
/** Point at unanswered questions before a round trip, alongside any other highlighted fields. */
|
|
1357
|
+
function planUnansweredBookingQuestions(bookingQuestions, plan) {
|
|
1358
|
+
const questions = checkBookingQuestionsAnswered(bookingQuestions);
|
|
1359
|
+
if (questions.kind !== "unanswered") return null;
|
|
1360
|
+
const failure = {
|
|
1361
|
+
message: questions.message,
|
|
1362
|
+
questionFieldErrors: questions.fieldErrors,
|
|
1363
|
+
answersNeeded: false
|
|
1364
|
+
};
|
|
1365
|
+
return {
|
|
1366
|
+
kind: "invalid",
|
|
1367
|
+
events: [...plan.ok ? [] : [{
|
|
1368
|
+
type: "validation-errors-set",
|
|
1369
|
+
errors: plan.errors
|
|
1370
|
+
}], {
|
|
1371
|
+
type: "submission-failed",
|
|
1372
|
+
failure
|
|
1373
|
+
}],
|
|
1374
|
+
result: {
|
|
1375
|
+
ok: false,
|
|
1376
|
+
reason: "submission-failed",
|
|
1377
|
+
...failure
|
|
1378
|
+
}
|
|
1379
|
+
};
|
|
1380
|
+
}
|
|
1120
1381
|
/** Reset from the same accepted resource facts as initial loading, scoped to the reset service. */
|
|
1121
1382
|
function planBookingFlowReset(input) {
|
|
1122
1383
|
const { initialState, resourceFacts } = input;
|
|
@@ -1185,6 +1446,7 @@ function applyBookingPaymentChoices(services, choices) {
|
|
|
1185
1446
|
}
|
|
1186
1447
|
//#endregion
|
|
1187
1448
|
//#region ../blocks/src/system/runtime/hooks/useBookingChoices.ts
|
|
1449
|
+
const NO_PACKAGES = { packages: [] };
|
|
1188
1450
|
/** Accept remote facts here; payment/navigation controllers do not own request lifetime. */
|
|
1189
1451
|
function useBookingChoices(input) {
|
|
1190
1452
|
const latest = useRef(input);
|
|
@@ -1197,9 +1459,18 @@ function useBookingChoices(input) {
|
|
|
1197
1459
|
label: item.label
|
|
1198
1460
|
}));
|
|
1199
1461
|
}, [input.api]);
|
|
1200
|
-
const loadPackages = useCallback(async (
|
|
1201
|
-
|
|
1202
|
-
|
|
1462
|
+
const loadPackages = useCallback(async (_key) => {
|
|
1463
|
+
const serviceId = input.serviceId;
|
|
1464
|
+
if (!serviceId) return NO_PACKAGES;
|
|
1465
|
+
return input.api.getEligibleAppointmentPackages({
|
|
1466
|
+
serviceId,
|
|
1467
|
+
...input.selectedResourceId ? { teamMemberId: input.selectedResourceId } : {}
|
|
1468
|
+
});
|
|
1469
|
+
}, [
|
|
1470
|
+
input.api,
|
|
1471
|
+
input.serviceId,
|
|
1472
|
+
input.selectedResourceId
|
|
1473
|
+
]);
|
|
1203
1474
|
const acceptResources = useCallback((resources) => {
|
|
1204
1475
|
const current = latest.current;
|
|
1205
1476
|
current.dispatch({
|
|
@@ -1209,20 +1480,24 @@ function useBookingChoices(input) {
|
|
|
1209
1480
|
autoSelect: current.autoSelectSingleResource
|
|
1210
1481
|
});
|
|
1211
1482
|
}, []);
|
|
1212
|
-
const acceptPackages = useCallback((
|
|
1483
|
+
const acceptPackages = useCallback((response) => {
|
|
1213
1484
|
latest.current.dispatch({
|
|
1214
1485
|
type: "packages-received",
|
|
1215
|
-
packages
|
|
1486
|
+
packages: response.packages
|
|
1216
1487
|
});
|
|
1217
1488
|
}, []);
|
|
1218
1489
|
const resources = useBookingChoicesRequest(input.serviceId ?? null, loadResources, acceptResources, "Failed to load booking resources.");
|
|
1219
|
-
const
|
|
1490
|
+
const packagesResponse = useBookingChoicesRequest(input.canLoadPackages && input.serviceId ? `${input.serviceId}:${input.selectedResourceId ?? "any"}` : null, loadPackages, acceptPackages, "Could not check package credits.");
|
|
1220
1491
|
useEffect(() => {
|
|
1221
|
-
if (!input.canLoadPackages) acceptPackages(
|
|
1492
|
+
if (!input.canLoadPackages) acceptPackages(NO_PACKAGES);
|
|
1222
1493
|
}, [input.canLoadPackages, acceptPackages]);
|
|
1223
1494
|
return {
|
|
1224
1495
|
resources,
|
|
1225
|
-
packages
|
|
1496
|
+
packages: useMemo(() => packagesResponse.tag === "loaded" ? {
|
|
1497
|
+
tag: "loaded",
|
|
1498
|
+
value: packagesResponse.value.packages
|
|
1499
|
+
} : packagesResponse, [packagesResponse]),
|
|
1500
|
+
heldPackageTeamMembers: packagesResponse.tag === "loaded" && !input.selectedResourceId ? packagesResponse.value.heldPackageTeamMembers ?? [] : [],
|
|
1226
1501
|
resourceFacts: input.serviceId && resources.tag === "loaded" ? {
|
|
1227
1502
|
serviceId: input.serviceId,
|
|
1228
1503
|
resources: resources.value
|
|
@@ -1425,6 +1700,7 @@ function useBookingFlowController(input) {
|
|
|
1425
1700
|
latestRef.current.setDiscountCode("");
|
|
1426
1701
|
},
|
|
1427
1702
|
reset: () => {
|
|
1703
|
+
latestRef.current.endSignInReturn?.();
|
|
1428
1704
|
input.dispatch({
|
|
1429
1705
|
type: "reset",
|
|
1430
1706
|
initial: latestRef.current.resetState
|
|
@@ -1482,7 +1758,11 @@ async function executeBookingSubmission(start, latest, latestRef) {
|
|
|
1482
1758
|
reason: "blocked",
|
|
1483
1759
|
message: "booking-details-changed"
|
|
1484
1760
|
};
|
|
1485
|
-
if (!result.ok)
|
|
1761
|
+
if (!result.ok) {
|
|
1762
|
+
if (result.error.answersNeeded) latest.bookingQuestions.keepRefused();
|
|
1763
|
+
return failBookingSubmission(result.error, latest.dispatch);
|
|
1764
|
+
}
|
|
1765
|
+
if (result.data.type !== "review_required" && result.data.type !== "payment_choice_required") latest.endSignInReturn?.();
|
|
1486
1766
|
return completeBookingSubmission({
|
|
1487
1767
|
data: result.data,
|
|
1488
1768
|
redirect: start.plan.redirect,
|
|
@@ -1536,19 +1816,15 @@ function bookingEditActions(dispatch) {
|
|
|
1536
1816
|
})
|
|
1537
1817
|
};
|
|
1538
1818
|
}
|
|
1539
|
-
function failBookingSubmission(
|
|
1819
|
+
function failBookingSubmission(failure, dispatch) {
|
|
1540
1820
|
dispatch({
|
|
1541
|
-
type: "
|
|
1542
|
-
|
|
1543
|
-
kind: "error",
|
|
1544
|
-
scope: "submission",
|
|
1545
|
-
message
|
|
1546
|
-
}
|
|
1821
|
+
type: "submission-failed",
|
|
1822
|
+
failure
|
|
1547
1823
|
});
|
|
1548
1824
|
return {
|
|
1549
1825
|
ok: false,
|
|
1550
1826
|
reason: "submission-failed",
|
|
1551
|
-
|
|
1827
|
+
...failure
|
|
1552
1828
|
};
|
|
1553
1829
|
}
|
|
1554
1830
|
function sameBookingIntent(left, right) {
|
|
@@ -1601,7 +1877,18 @@ function useHeadlessBookingFlow(options) {
|
|
|
1601
1877
|
}
|
|
1602
1878
|
});
|
|
1603
1879
|
const runtimeForm = useSelectedAppointmentConsentForm(options.form, selectedService);
|
|
1604
|
-
const
|
|
1880
|
+
const portalIdentity = portalSessionIdentity(api.config);
|
|
1881
|
+
const hasPortalBearerAuth = portalIdentity !== null;
|
|
1882
|
+
const questions = useAppointmentBookingQuestions({
|
|
1883
|
+
api,
|
|
1884
|
+
siteId: options.siteId,
|
|
1885
|
+
formId: options.formId,
|
|
1886
|
+
state,
|
|
1887
|
+
selectedService,
|
|
1888
|
+
identity: portalIdentity,
|
|
1889
|
+
dispatch
|
|
1890
|
+
});
|
|
1891
|
+
const questionsRefusal = appointmentQuestionsRefusal(questions.presentation);
|
|
1605
1892
|
const selectedServiceSlidingScale = getBookingServiceSlidingScale(selectedService);
|
|
1606
1893
|
const selectedSlidingAmount = parseBookingCurrencyInputToCents(state.selectedSlidingAmountInput);
|
|
1607
1894
|
const selectedAppointmentPriceAmount = selectedServiceSlidingScale && selectedSlidingAmount !== null ? selectedSlidingAmount : selectedService?.priceAmount ?? 0;
|
|
@@ -1643,8 +1930,10 @@ function useHeadlessBookingFlow(options) {
|
|
|
1643
1930
|
requiresServiceSelection: options.requiresServiceSelection,
|
|
1644
1931
|
requiresResourceSelection: options.requiresResourceSelection,
|
|
1645
1932
|
enableAppointmentPackages: options.enableAppointmentPackages,
|
|
1646
|
-
attemptedStepIds: state.attemptedStepIds
|
|
1933
|
+
attemptedStepIds: state.attemptedStepIds,
|
|
1934
|
+
questionsRefusal
|
|
1647
1935
|
}), [
|
|
1936
|
+
questionsRefusal,
|
|
1648
1937
|
data,
|
|
1649
1938
|
bookingNowIso,
|
|
1650
1939
|
state.attemptedStepIds,
|
|
@@ -1720,6 +2009,7 @@ function useHeadlessBookingFlow(options) {
|
|
|
1720
2009
|
const choices = useBookingChoices({
|
|
1721
2010
|
api,
|
|
1722
2011
|
serviceId: selectedServiceId,
|
|
2012
|
+
selectedResourceId: selectedResourceId ?? null,
|
|
1723
2013
|
defaultResourceId,
|
|
1724
2014
|
canLoadPackages: canLoadAppointmentPackages,
|
|
1725
2015
|
autoSelectSingleResource: options.shouldAutoSelectSingleResource !== false,
|
|
@@ -1766,6 +2056,8 @@ function useHeadlessBookingFlow(options) {
|
|
|
1766
2056
|
autoSelect: options.shouldAutoSelectSingleResource !== false
|
|
1767
2057
|
}),
|
|
1768
2058
|
mailingListEligible,
|
|
2059
|
+
bookingQuestions: questions,
|
|
2060
|
+
endSignInReturn: questions.endSignInReturn,
|
|
1769
2061
|
dispatch
|
|
1770
2062
|
});
|
|
1771
2063
|
const paymentResolution = stepState.paymentResolution;
|
|
@@ -1810,7 +2102,8 @@ function useHeadlessBookingFlow(options) {
|
|
|
1810
2102
|
unavailableReason: appointmentPackagesUnavailableReason,
|
|
1811
2103
|
state: appointmentPackages,
|
|
1812
2104
|
items: appointmentPackageItems,
|
|
1813
|
-
selected: selectedAppointmentPackage
|
|
2105
|
+
selected: selectedAppointmentPackage,
|
|
2106
|
+
heldWithTeamMembers: choices.heldPackageTeamMembers
|
|
1814
2107
|
});
|
|
1815
2108
|
const payment = paymentResolution.kind === "unavailable" ? {
|
|
1816
2109
|
kind: "unsupported",
|
|
@@ -1906,6 +2199,8 @@ function useHeadlessBookingFlow(options) {
|
|
|
1906
2199
|
clear: actions.clearDiscountCode
|
|
1907
2200
|
},
|
|
1908
2201
|
feedback: state.feedback,
|
|
2202
|
+
questions,
|
|
2203
|
+
questionFieldErrors: state.questionFieldErrors,
|
|
1909
2204
|
actions
|
|
1910
2205
|
};
|
|
1911
2206
|
}
|
|
@@ -1974,14 +2269,12 @@ function useAppointmentCheckoutVerificationWithDeps(config, deps) {
|
|
|
1974
2269
|
* states. Selection uses button-toggle semantics: each pill is a button with
|
|
1975
2270
|
* aria-pressed and a full accessible date name, inside a labelled group.
|
|
1976
2271
|
*/
|
|
1977
|
-
|
|
1978
|
-
|
|
2272
|
+
/** Required state is on the grid (aria-required); the label carries no asterisk. */
|
|
2273
|
+
function DateFieldLabel({ labelId }) {
|
|
2274
|
+
return /* @__PURE__ */ jsx("span", {
|
|
1979
2275
|
className: "form-label",
|
|
1980
2276
|
id: labelId,
|
|
1981
|
-
children:
|
|
1982
|
-
className: "required-marker",
|
|
1983
|
-
children: "*"
|
|
1984
|
-
})]
|
|
2277
|
+
children: "Select Date"
|
|
1985
2278
|
});
|
|
1986
2279
|
}
|
|
1987
2280
|
/** Focus is the only effect: newly loaded dates continue keyboard selection. */
|
|
@@ -2077,10 +2370,7 @@ const DatePicker = (props) => {
|
|
|
2077
2370
|
return /* @__PURE__ */ jsxs("div", {
|
|
2078
2371
|
className: "rb-reg-stack rb-reg-stack--sm",
|
|
2079
2372
|
children: [
|
|
2080
|
-
/* @__PURE__ */ jsx(DateFieldLabel, {
|
|
2081
|
-
labelId,
|
|
2082
|
-
required
|
|
2083
|
-
}),
|
|
2373
|
+
/* @__PURE__ */ jsx(DateFieldLabel, { labelId }),
|
|
2084
2374
|
state === "loading" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", { className: "rb-shell-block" }), /* @__PURE__ */ jsx("p", {
|
|
2085
2375
|
className: "ab-text ab-text--sm rb-on-surface--muted",
|
|
2086
2376
|
children: "Loading available dates..."
|
|
@@ -2146,13 +2436,10 @@ const TimeSlotSelector = ({ value, onChange, slots, isLoading, dateContext, zone
|
|
|
2146
2436
|
return /* @__PURE__ */ jsxs("div", {
|
|
2147
2437
|
className: "rb-reg-stack rb-reg-stack--sm",
|
|
2148
2438
|
children: [
|
|
2149
|
-
/* @__PURE__ */
|
|
2439
|
+
/* @__PURE__ */ jsx("span", {
|
|
2150
2440
|
className: "form-label",
|
|
2151
2441
|
id: labelId,
|
|
2152
|
-
children:
|
|
2153
|
-
className: "required-marker",
|
|
2154
|
-
children: "*"
|
|
2155
|
-
})]
|
|
2442
|
+
children: "Select Time"
|
|
2156
2443
|
}),
|
|
2157
2444
|
/* @__PURE__ */ jsx(TimeSlotZoneNote, {
|
|
2158
2445
|
id: noteId,
|
|
@@ -2183,25 +2470,6 @@ const TimeSlotSelector = ({ value, onChange, slots, isLoading, dateContext, zone
|
|
|
2183
2470
|
});
|
|
2184
2471
|
};
|
|
2185
2472
|
//#endregion
|
|
2186
|
-
//#region ../blocks/src/system/runtime/nodes/booking-form.mailing-list-choice.tsx
|
|
2187
|
-
function BookingMailingListChoice({ booking }) {
|
|
2188
|
-
const id = React.useId();
|
|
2189
|
-
if (!booking.mailingList) return null;
|
|
2190
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
2191
|
-
className: "rb-space-y-2",
|
|
2192
|
-
children: [/* @__PURE__ */ jsx(CheckboxChoice, {
|
|
2193
|
-
id,
|
|
2194
|
-
name: "mailingListOptIn",
|
|
2195
|
-
checked: booking.mailingListOptIn,
|
|
2196
|
-
onChange: (event) => booking.actions.setMailingListOptIn(event.target.checked),
|
|
2197
|
-
label: `Email me news and updates from ${booking.mailingList.siteName}.`
|
|
2198
|
-
}), /* @__PURE__ */ jsx("p", {
|
|
2199
|
-
className: "rb-caption status-muted",
|
|
2200
|
-
children: "Optional. You can unsubscribe at any time."
|
|
2201
|
-
})]
|
|
2202
|
-
});
|
|
2203
|
-
}
|
|
2204
|
-
//#endregion
|
|
2205
2473
|
//#region ../blocks/src/system/runtime/nodes/booking-form.service-choices.tsx
|
|
2206
2474
|
function optionCardClassName(isSelected) {
|
|
2207
2475
|
return `rb-option-card${isSelected ? " rb-option-card--selected" : ""}`;
|
|
@@ -2224,15 +2492,9 @@ function DefaultServiceChoices({ booking }) {
|
|
|
2224
2492
|
categoryId: service.categoryId ?? null
|
|
2225
2493
|
})), { keepEmptyGroups: false });
|
|
2226
2494
|
switch (layout.kind) {
|
|
2227
|
-
case "uncategorized-site": return /* @__PURE__ */
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
className: "ab-subtitle",
|
|
2231
|
-
children: "Service"
|
|
2232
|
-
}), /* @__PURE__ */ jsx(ServiceChoiceGrid, {
|
|
2233
|
-
booking,
|
|
2234
|
-
choices: layout.services
|
|
2235
|
-
})]
|
|
2495
|
+
case "uncategorized-site": return /* @__PURE__ */ jsx(ServiceChoiceGrid, {
|
|
2496
|
+
booking,
|
|
2497
|
+
choices: layout.services
|
|
2236
2498
|
});
|
|
2237
2499
|
case "categorized-site": return /* @__PURE__ */ jsx("div", {
|
|
2238
2500
|
className: "rb-reg-stack",
|
|
@@ -2295,7 +2557,7 @@ function ServiceChoiceGrid({ booking, choices }) {
|
|
|
2295
2557
|
//#region ../blocks/src/system/runtime/nodes/booking-form.submit-actions.tsx
|
|
2296
2558
|
function resolvePrimaryActionLabel(isLastStep, requiresPayment) {
|
|
2297
2559
|
if (!isLastStep) return "Continue";
|
|
2298
|
-
return requiresPayment ? "Continue to payment" : "
|
|
2560
|
+
return requiresPayment ? "Continue to payment" : "Confirm booking";
|
|
2299
2561
|
}
|
|
2300
2562
|
/** Only the date step and explicit review identity display the selected stored slot. */
|
|
2301
2563
|
function resolveBookingConfirmationSlot(booking, includeSelection) {
|
|
@@ -2435,6 +2697,391 @@ function BookingReviewIdentity({ booking }) {
|
|
|
2435
2697
|
});
|
|
2436
2698
|
}
|
|
2437
2699
|
//#endregion
|
|
2700
|
+
//#region ../blocks/src/system/runtime/nodes/booking-form.mailing-list-choice.tsx
|
|
2701
|
+
function BookingMailingListChoice({ booking }) {
|
|
2702
|
+
const id = React.useId();
|
|
2703
|
+
if (!booking.mailingList) return null;
|
|
2704
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
2705
|
+
className: "rb-space-y-2",
|
|
2706
|
+
children: [/* @__PURE__ */ jsx(CheckboxChoice, {
|
|
2707
|
+
id,
|
|
2708
|
+
name: "mailingListOptIn",
|
|
2709
|
+
checked: booking.mailingListOptIn,
|
|
2710
|
+
onChange: (event) => booking.actions.setMailingListOptIn(event.target.checked),
|
|
2711
|
+
label: `Email me news and updates from ${booking.mailingList.siteName}.`
|
|
2712
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
2713
|
+
className: "rb-caption status-muted",
|
|
2714
|
+
children: "Optional. You can unsubscribe at any time."
|
|
2715
|
+
})]
|
|
2716
|
+
});
|
|
2717
|
+
}
|
|
2718
|
+
//#endregion
|
|
2719
|
+
//#region ../blocks/src/system/runtime/nodes/booking-form.details-step.tsx
|
|
2720
|
+
/**
|
|
2721
|
+
* The appointment form's "Your details" step: a recap of the chosen service
|
|
2722
|
+
* and time, the site form's fields, the service's during-booking questions,
|
|
2723
|
+
* then consent and the site's terms.
|
|
2724
|
+
*/
|
|
2725
|
+
/**
|
|
2726
|
+
* The chosen service and time at the top of the details step, with a way back
|
|
2727
|
+
* to change them. "Change" goes to the first step that holds the choice.
|
|
2728
|
+
*/
|
|
2729
|
+
function BookingDetailsRecap({ booking }) {
|
|
2730
|
+
const service = booking.services.selected;
|
|
2731
|
+
const slot = booking.availability.selectedSlot;
|
|
2732
|
+
if (!service || !slot) return null;
|
|
2733
|
+
const when = formatRecapTime(booking, slot);
|
|
2734
|
+
const practitioner = booking.resources.selected?.label ?? slot.resourceName ?? null;
|
|
2735
|
+
const changeStep = booking.steps.find((step) => step.id === "service-selection" || step.id === "datetime-selection");
|
|
2736
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
2737
|
+
className: "rb-reg-summary rb-flex rb-items-start rb-justify-between rb-gap-4",
|
|
2738
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
2739
|
+
className: "rb-flex-1",
|
|
2740
|
+
children: [/* @__PURE__ */ jsxs("p", {
|
|
2741
|
+
className: "ab-subtitle",
|
|
2742
|
+
children: [service.title, service.durationMinutes ? `, ${service.durationMinutes} minutes` : ""]
|
|
2743
|
+
}), when ? /* @__PURE__ */ jsxs("p", {
|
|
2744
|
+
className: "ab-text rb-on-surface--muted",
|
|
2745
|
+
children: [when, practitioner ? `, with ${practitioner}` : ""]
|
|
2746
|
+
}) : null]
|
|
2747
|
+
}), changeStep ? /* @__PURE__ */ jsx("button", {
|
|
2748
|
+
type: "button",
|
|
2749
|
+
className: "rb-bq-link",
|
|
2750
|
+
onClick: () => {
|
|
2751
|
+
booking.actions.goToStep(changeStep.id);
|
|
2752
|
+
},
|
|
2753
|
+
children: "Change"
|
|
2754
|
+
}) : null]
|
|
2755
|
+
});
|
|
2756
|
+
}
|
|
2757
|
+
function formatRecapTime(booking, slot) {
|
|
2758
|
+
const start = parseUtcIsoDateTimeString(slot.startAt);
|
|
2759
|
+
const end = parseUtcIsoDateTimeString(slot.endAt);
|
|
2760
|
+
return start.ok && end.ok && end.value >= start.value ? formatDateTimeRange({
|
|
2761
|
+
start: start.value,
|
|
2762
|
+
end: end.value
|
|
2763
|
+
}, booking.availability.dateContext, {
|
|
2764
|
+
date: "long",
|
|
2765
|
+
zone: booking.availability.zone
|
|
2766
|
+
}) : null;
|
|
2767
|
+
}
|
|
2768
|
+
function DefaultBookingDetailsStep({ booking }) {
|
|
2769
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
2770
|
+
className: "rb-reg-stack",
|
|
2771
|
+
children: [/* @__PURE__ */ jsx(BookingDetailsRecap, { booking }), /* @__PURE__ */ jsx(DefaultDynamicFields, {
|
|
2772
|
+
fields: booking.fields.items,
|
|
2773
|
+
booking
|
|
2774
|
+
})]
|
|
2775
|
+
});
|
|
2776
|
+
}
|
|
2777
|
+
function DefaultDynamicFields({ booking, fields }) {
|
|
2778
|
+
const lastContactIndex = fields.reduce((last, field, index) => [
|
|
2779
|
+
"name",
|
|
2780
|
+
"email",
|
|
2781
|
+
"phone"
|
|
2782
|
+
].includes(field.id) ? index : last, -1);
|
|
2783
|
+
const formFields = fields.filter((field) => field.field.type !== "booking_requirement_consent");
|
|
2784
|
+
const consentFields = fields.filter((field) => field.field.type === "booking_requirement_consent");
|
|
2785
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
2786
|
+
className: "rb-space-y-6",
|
|
2787
|
+
children: [
|
|
2788
|
+
/* @__PURE__ */ jsx(SiteTermsChangedNotice, { message: booking.siteTerms.notice }),
|
|
2789
|
+
formFields.map((field, index) => /* @__PURE__ */ jsxs(React.Fragment, { children: [/* @__PURE__ */ jsx(DefaultDynamicField, {
|
|
2790
|
+
booking,
|
|
2791
|
+
field
|
|
2792
|
+
}), index === lastContactIndex && booking.mailingList ? /* @__PURE__ */ jsx(BookingMailingListChoice, { booking }) : null] }, field.id)),
|
|
2793
|
+
/* @__PURE__ */ jsx(DefaultBookingQuestions, { booking }),
|
|
2794
|
+
consentFields.map((field) => /* @__PURE__ */ jsx(DefaultDynamicField, {
|
|
2795
|
+
booking,
|
|
2796
|
+
field
|
|
2797
|
+
}, field.id)),
|
|
2798
|
+
/* @__PURE__ */ jsx(SiteTermsAgreementField, {
|
|
2799
|
+
agreement: booking.siteTerms.view,
|
|
2800
|
+
onChange: booking.siteTerms.onChange,
|
|
2801
|
+
error: booking.siteTerms.error,
|
|
2802
|
+
disabled: booking.siteTerms.disabled,
|
|
2803
|
+
requiredMark: "none"
|
|
2804
|
+
})
|
|
2805
|
+
]
|
|
2806
|
+
});
|
|
2807
|
+
}
|
|
2808
|
+
/** The selected service's during-booking questions: after the site form's fields, before consent. */
|
|
2809
|
+
function DefaultBookingQuestions({ booking }) {
|
|
2810
|
+
const questions = booking.questions;
|
|
2811
|
+
const email = booking.fields.values.email;
|
|
2812
|
+
return /* @__PURE__ */ jsx(BookingQuestionSections, {
|
|
2813
|
+
presentation: questions.presentation,
|
|
2814
|
+
values: questions.values,
|
|
2815
|
+
fieldErrors: questions.fieldErrors,
|
|
2816
|
+
onChange: questions.answer,
|
|
2817
|
+
answerMode: questions.answerMode,
|
|
2818
|
+
onAnswerModeChange: questions.chooseAnswerMode,
|
|
2819
|
+
signInEmail: typeof email === "string" && email.trim() ? email.trim() : void 0,
|
|
2820
|
+
signInReturnPath: questions.signInReturnPath,
|
|
2821
|
+
disabled: booking.status.tag === "submitting"
|
|
2822
|
+
});
|
|
2823
|
+
}
|
|
2824
|
+
/** Radios and multi-choice checkboxes answer one question with several controls, so they're a named group. */
|
|
2825
|
+
function isChoiceGroupField(field) {
|
|
2826
|
+
return field.type === "radio" || field.type === "checkbox" && (field.options?.length ?? 0) > 1;
|
|
2827
|
+
}
|
|
2828
|
+
function DefaultDynamicField({ booking, field }) {
|
|
2829
|
+
const error = field.error;
|
|
2830
|
+
const errorId = error ? field.errorId ?? `${field.inputId}-error` : `${field.inputId}-error`;
|
|
2831
|
+
const describedBy = [field.helpTextId, error ? errorId : null].filter(Boolean).join(" ") || void 0;
|
|
2832
|
+
return /* @__PURE__ */ jsxs(DynamicFieldFrame, {
|
|
2833
|
+
field,
|
|
2834
|
+
describedBy,
|
|
2835
|
+
children: [
|
|
2836
|
+
/* @__PURE__ */ jsx(DynamicFieldLabel, { field }),
|
|
2837
|
+
field.helpText ? /* @__PURE__ */ jsx("p", {
|
|
2838
|
+
id: field.helpTextId ?? void 0,
|
|
2839
|
+
className: "rb-caption status-muted",
|
|
2840
|
+
children: field.helpText
|
|
2841
|
+
}) : null,
|
|
2842
|
+
/* @__PURE__ */ jsx(DefaultFieldInput, {
|
|
2843
|
+
field,
|
|
2844
|
+
value: field.value ?? "",
|
|
2845
|
+
onChange: (nextValue) => booking.actions.updateField(field.id, nextValue),
|
|
2846
|
+
onBlur: () => booking.actions.markFieldTouched(field.id),
|
|
2847
|
+
error,
|
|
2848
|
+
errorId,
|
|
2849
|
+
describedBy
|
|
2850
|
+
}),
|
|
2851
|
+
error ? /* @__PURE__ */ jsx(FieldValidationMessage, {
|
|
2852
|
+
id: errorId,
|
|
2853
|
+
className: "rb-caption status-error",
|
|
2854
|
+
children: error
|
|
2855
|
+
}) : null
|
|
2856
|
+
]
|
|
2857
|
+
});
|
|
2858
|
+
}
|
|
2859
|
+
/** A choice group is a fieldset whose legend is the question, as in the shared question fields. */
|
|
2860
|
+
function DynamicFieldFrame({ children, describedBy, field }) {
|
|
2861
|
+
if (!isChoiceGroupField(field.field)) return /* @__PURE__ */ jsx("div", {
|
|
2862
|
+
className: "rb-space-y-2",
|
|
2863
|
+
children
|
|
2864
|
+
});
|
|
2865
|
+
return /* @__PURE__ */ jsx("fieldset", {
|
|
2866
|
+
className: "rb-space-y-2 rb-border-0 rb-p-0 rb-m-0 rb-min-w-0",
|
|
2867
|
+
"aria-describedby": describedBy,
|
|
2868
|
+
...field.field.type === "radio" ? {
|
|
2869
|
+
role: "radiogroup",
|
|
2870
|
+
...field.required ? { "aria-required": true } : {}
|
|
2871
|
+
} : {},
|
|
2872
|
+
children
|
|
2873
|
+
});
|
|
2874
|
+
}
|
|
2875
|
+
/** Optional fields say so and required ones carry no mark, matching the question fields beside them. */
|
|
2876
|
+
function DynamicFieldLabel({ field }) {
|
|
2877
|
+
if (field.field.type === "booking_requirement_consent") return /* @__PURE__ */ jsx(BookingConsentAgreement, {
|
|
2878
|
+
agreement: field.field.agreement,
|
|
2879
|
+
title: field.label,
|
|
2880
|
+
titleId: field.labelId,
|
|
2881
|
+
requiredMark: "none"
|
|
2882
|
+
});
|
|
2883
|
+
const text = /* @__PURE__ */ jsxs(Fragment, { children: [field.label, field.required ? null : /* @__PURE__ */ jsx(OptionalMark, {})] });
|
|
2884
|
+
return isChoiceGroupField(field.field) ? /* @__PURE__ */ jsx("legend", {
|
|
2885
|
+
id: field.labelId,
|
|
2886
|
+
className: "form-label rb-p-0",
|
|
2887
|
+
children: text
|
|
2888
|
+
}) : /* @__PURE__ */ jsx("label", {
|
|
2889
|
+
id: field.labelId,
|
|
2890
|
+
htmlFor: field.inputId,
|
|
2891
|
+
className: "form-label",
|
|
2892
|
+
children: text
|
|
2893
|
+
});
|
|
2894
|
+
}
|
|
2895
|
+
function toFieldControl(props) {
|
|
2896
|
+
const validation = getFieldValidationControlProps({
|
|
2897
|
+
message: props.error,
|
|
2898
|
+
messageId: props.errorId,
|
|
2899
|
+
describedBy: props.describedBy
|
|
2900
|
+
});
|
|
2901
|
+
const { field, onBlur, value } = props;
|
|
2902
|
+
return {
|
|
2903
|
+
props,
|
|
2904
|
+
text: typeof value === "string" ? value : String(value ?? ""),
|
|
2905
|
+
validation,
|
|
2906
|
+
common: {
|
|
2907
|
+
id: field.inputId,
|
|
2908
|
+
name: field.id,
|
|
2909
|
+
onBlur,
|
|
2910
|
+
required: field.required,
|
|
2911
|
+
...validation
|
|
2912
|
+
}
|
|
2913
|
+
};
|
|
2914
|
+
}
|
|
2915
|
+
function DefaultFieldInput(props) {
|
|
2916
|
+
const control = toFieldControl(props);
|
|
2917
|
+
const field = props.field.field;
|
|
2918
|
+
switch (field.type) {
|
|
2919
|
+
case "textarea": return /* @__PURE__ */ jsx(TextareaInput, { control });
|
|
2920
|
+
case "select": return field.multiple ? /* @__PURE__ */ jsx(MultiSelectInput, { control }) : /* @__PURE__ */ jsx(SelectInput, { control });
|
|
2921
|
+
case "radio": return /* @__PURE__ */ jsx(RadioInput, { control });
|
|
2922
|
+
case "checkbox": return field.options && field.options.length > 1 ? /* @__PURE__ */ jsx(CheckboxGroupInput, { control }) : /* @__PURE__ */ jsx(SingleCheckboxInput, {
|
|
2923
|
+
control,
|
|
2924
|
+
label: field.placeholder || props.field.label
|
|
2925
|
+
});
|
|
2926
|
+
case "booking_requirement_consent": return /* @__PURE__ */ jsx(SingleCheckboxInput, {
|
|
2927
|
+
control,
|
|
2928
|
+
label: field.checkboxLabel,
|
|
2929
|
+
presentation: "tile"
|
|
2930
|
+
});
|
|
2931
|
+
case "number":
|
|
2932
|
+
case "date":
|
|
2933
|
+
case "time": return /* @__PURE__ */ jsx(NumberOrDateInput, { control });
|
|
2934
|
+
case "text":
|
|
2935
|
+
case "email":
|
|
2936
|
+
case "tel":
|
|
2937
|
+
case "url": return /* @__PURE__ */ jsx(TextInput, { control });
|
|
2938
|
+
}
|
|
2939
|
+
}
|
|
2940
|
+
function fieldOptions(control) {
|
|
2941
|
+
const field = control.props.field.field;
|
|
2942
|
+
return "options" in field ? field.options ?? [] : [];
|
|
2943
|
+
}
|
|
2944
|
+
function TextareaInput({ control }) {
|
|
2945
|
+
const field = control.props.field.field;
|
|
2946
|
+
if (field.type !== "textarea") return null;
|
|
2947
|
+
return /* @__PURE__ */ jsx("textarea", {
|
|
2948
|
+
...control.common,
|
|
2949
|
+
value: control.text,
|
|
2950
|
+
onChange: (event) => control.props.onChange(event.target.value),
|
|
2951
|
+
placeholder: field.placeholder,
|
|
2952
|
+
minLength: field.minLength,
|
|
2953
|
+
maxLength: field.maxLength,
|
|
2954
|
+
rows: 4,
|
|
2955
|
+
className: "form-textarea"
|
|
2956
|
+
});
|
|
2957
|
+
}
|
|
2958
|
+
function MultiSelectInput({ control }) {
|
|
2959
|
+
const { value, onChange } = control.props;
|
|
2960
|
+
return /* @__PURE__ */ jsx("select", {
|
|
2961
|
+
...control.common,
|
|
2962
|
+
value: Array.isArray(value) ? value : [],
|
|
2963
|
+
onChange: (event) => onChange(Array.from(event.target.selectedOptions, (option) => option.value)),
|
|
2964
|
+
multiple: true,
|
|
2965
|
+
className: "form-select rb-h-32",
|
|
2966
|
+
children: fieldOptions(control).map((option) => /* @__PURE__ */ jsx("option", {
|
|
2967
|
+
value: option.value,
|
|
2968
|
+
children: option.label
|
|
2969
|
+
}, option.value))
|
|
2970
|
+
});
|
|
2971
|
+
}
|
|
2972
|
+
function SelectInput({ control }) {
|
|
2973
|
+
return /* @__PURE__ */ jsxs("select", {
|
|
2974
|
+
...control.common,
|
|
2975
|
+
value: control.text,
|
|
2976
|
+
onChange: (event) => control.props.onChange(event.target.value),
|
|
2977
|
+
className: "form-select",
|
|
2978
|
+
children: [/* @__PURE__ */ jsx("option", {
|
|
2979
|
+
value: "",
|
|
2980
|
+
children: "Select an option..."
|
|
2981
|
+
}), fieldOptions(control).map((option) => /* @__PURE__ */ jsx("option", {
|
|
2982
|
+
value: option.value,
|
|
2983
|
+
children: option.label
|
|
2984
|
+
}, option.value))]
|
|
2985
|
+
});
|
|
2986
|
+
}
|
|
2987
|
+
function RadioInput({ control }) {
|
|
2988
|
+
const { field, value, onChange, onBlur } = control.props;
|
|
2989
|
+
return /* @__PURE__ */ jsx("div", {
|
|
2990
|
+
className: "rb-space-y-2",
|
|
2991
|
+
children: fieldOptions(control).map((option) => /* @__PURE__ */ jsxs("label", {
|
|
2992
|
+
className: "form-check",
|
|
2993
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
2994
|
+
type: "radio",
|
|
2995
|
+
name: field.id,
|
|
2996
|
+
value: option.value,
|
|
2997
|
+
checked: value === option.value,
|
|
2998
|
+
onChange: (event) => onChange(event.target.value),
|
|
2999
|
+
onBlur,
|
|
3000
|
+
required: field.required,
|
|
3001
|
+
...control.validation,
|
|
3002
|
+
className: "form-radio"
|
|
3003
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
3004
|
+
className: "form-check-label",
|
|
3005
|
+
children: option.label
|
|
3006
|
+
})]
|
|
3007
|
+
}, option.value))
|
|
3008
|
+
});
|
|
3009
|
+
}
|
|
3010
|
+
function CheckboxGroupInput({ control }) {
|
|
3011
|
+
const { field, value, onChange, onBlur } = control.props;
|
|
3012
|
+
const checkedValues = toStringArray(value);
|
|
3013
|
+
return /* @__PURE__ */ jsx("div", {
|
|
3014
|
+
className: "rb-space-y-2",
|
|
3015
|
+
children: fieldOptions(control).map((option) => /* @__PURE__ */ jsx(CheckboxChoice, {
|
|
3016
|
+
name: field.id,
|
|
3017
|
+
value: option.value,
|
|
3018
|
+
checked: checkedValues.includes(option.value),
|
|
3019
|
+
onChange: (event) => {
|
|
3020
|
+
onChange(event.target.checked ? [...checkedValues, option.value] : checkedValues.filter((item) => item !== option.value));
|
|
3021
|
+
},
|
|
3022
|
+
onBlur,
|
|
3023
|
+
...control.validation,
|
|
3024
|
+
label: option.label
|
|
3025
|
+
}, option.value))
|
|
3026
|
+
});
|
|
3027
|
+
}
|
|
3028
|
+
function SingleCheckboxInput({ control, label, presentation }) {
|
|
3029
|
+
const { field, value, onChange, onBlur } = control.props;
|
|
3030
|
+
return /* @__PURE__ */ jsx(CheckboxChoice, {
|
|
3031
|
+
id: field.inputId,
|
|
3032
|
+
name: field.id,
|
|
3033
|
+
checked: Boolean(value),
|
|
3034
|
+
onChange: (event) => onChange(event.target.checked),
|
|
3035
|
+
onBlur,
|
|
3036
|
+
required: field.required,
|
|
3037
|
+
...control.validation,
|
|
3038
|
+
label,
|
|
3039
|
+
...presentation ? { presentation } : {}
|
|
3040
|
+
});
|
|
3041
|
+
}
|
|
3042
|
+
function boundAttribute(bound) {
|
|
3043
|
+
return bound ? String(bound) : void 0;
|
|
3044
|
+
}
|
|
3045
|
+
function NumberOrDateInput({ control }) {
|
|
3046
|
+
const field = control.props.field.field;
|
|
3047
|
+
if (field.type !== "number" && field.type !== "date" && field.type !== "time") return null;
|
|
3048
|
+
const bounds = field.type === "time" ? {} : field.type === "number" ? {
|
|
3049
|
+
min: field.min,
|
|
3050
|
+
max: field.max,
|
|
3051
|
+
placeholder: field.placeholder
|
|
3052
|
+
} : {
|
|
3053
|
+
min: boundAttribute(field.min),
|
|
3054
|
+
max: boundAttribute(field.max)
|
|
3055
|
+
};
|
|
3056
|
+
return /* @__PURE__ */ jsx("input", {
|
|
3057
|
+
...control.common,
|
|
3058
|
+
type: field.type,
|
|
3059
|
+
value: control.text,
|
|
3060
|
+
onChange: (event) => control.props.onChange(event.target.value),
|
|
3061
|
+
...bounds,
|
|
3062
|
+
className: "form-input"
|
|
3063
|
+
});
|
|
3064
|
+
}
|
|
3065
|
+
function TextInput({ control }) {
|
|
3066
|
+
const view = control.props.field;
|
|
3067
|
+
const field = view.field;
|
|
3068
|
+
if (field.type !== "text" && field.type !== "email" && field.type !== "tel" && field.type !== "url") return null;
|
|
3069
|
+
return /* @__PURE__ */ jsx("input", {
|
|
3070
|
+
...control.common,
|
|
3071
|
+
type: view.type,
|
|
3072
|
+
value: control.text,
|
|
3073
|
+
onChange: (event) => control.props.onChange(event.target.value),
|
|
3074
|
+
placeholder: field.placeholder,
|
|
3075
|
+
minLength: field.minLength,
|
|
3076
|
+
maxLength: field.maxLength,
|
|
3077
|
+
pattern: field.pattern,
|
|
3078
|
+
className: "form-input"
|
|
3079
|
+
});
|
|
3080
|
+
}
|
|
3081
|
+
function toStringArray(value) {
|
|
3082
|
+
return Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
|
|
3083
|
+
}
|
|
3084
|
+
//#endregion
|
|
2438
3085
|
//#region ../blocks/src/system/runtime/nodes/booking-form.default-ui.tsx
|
|
2439
3086
|
function formatBookingAmount(amount, currency) {
|
|
2440
3087
|
return formatCurrencyAmount(amount, currency, { decimals: "auto" });
|
|
@@ -2459,6 +3106,7 @@ function HeadlessBookingDefaultForm({ booking, onSubmit }) {
|
|
|
2459
3106
|
stepLabels: booking.steps.map((step) => step.label),
|
|
2460
3107
|
emitSharedClasses: true
|
|
2461
3108
|
}) : null,
|
|
3109
|
+
/* @__PURE__ */ jsx(DefaultQuestionsRefusal, { booking }),
|
|
2462
3110
|
/* @__PURE__ */ jsx("div", {
|
|
2463
3111
|
className: "step-content",
|
|
2464
3112
|
children: /* @__PURE__ */ jsx(DefaultBookingStepContent, {
|
|
@@ -2479,6 +3127,21 @@ function HeadlessBookingDefaultForm({ booking, onSubmit }) {
|
|
|
2479
3127
|
]
|
|
2480
3128
|
});
|
|
2481
3129
|
}
|
|
3130
|
+
/**
|
|
3131
|
+
* A service whose questions can't be shown can't be booked. Say so before the
|
|
3132
|
+
* booker picks a time; the details step shows the same message in place of
|
|
3133
|
+
* the questions.
|
|
3134
|
+
*/
|
|
3135
|
+
function DefaultQuestionsRefusal({ booking }) {
|
|
3136
|
+
const presentation = booking.questions.presentation;
|
|
3137
|
+
if (presentation.kind !== "unavailable" || booking.currentStep?.id === "custom-fields") return null;
|
|
3138
|
+
return /* @__PURE__ */ jsx(FeedbackMessage, {
|
|
3139
|
+
tone: "error",
|
|
3140
|
+
className: "alert alert-error",
|
|
3141
|
+
role: "alert",
|
|
3142
|
+
children: presentation.message
|
|
3143
|
+
});
|
|
3144
|
+
}
|
|
2482
3145
|
function DefaultBookingStepContent({ booking, errorSummaryId }) {
|
|
2483
3146
|
const stepId = booking.currentStep?.id;
|
|
2484
3147
|
if (!stepId) return null;
|
|
@@ -2489,10 +3152,7 @@ function DefaultBookingStepContent({ booking, errorSummaryId }) {
|
|
|
2489
3152
|
errorSummaryId
|
|
2490
3153
|
});
|
|
2491
3154
|
case "payment-selection": return /* @__PURE__ */ jsx(HeadlessBookingPaymentSelectionStep, { booking });
|
|
2492
|
-
case "custom-fields": return /* @__PURE__ */ jsx(
|
|
2493
|
-
fields: booking.fields.items,
|
|
2494
|
-
booking
|
|
2495
|
-
});
|
|
3155
|
+
case "custom-fields": return /* @__PURE__ */ jsx(DefaultBookingDetailsStep, { booking });
|
|
2496
3156
|
default: return assertNever(stepId);
|
|
2497
3157
|
}
|
|
2498
3158
|
}
|
|
@@ -2506,14 +3166,10 @@ function DefaultServiceSelectionStep({ booking }) {
|
|
|
2506
3166
|
return /* @__PURE__ */ jsxs("div", {
|
|
2507
3167
|
className: "rb-reg-stack",
|
|
2508
3168
|
children: [
|
|
2509
|
-
/* @__PURE__ */ jsxs(
|
|
3169
|
+
showServiceSelect ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("h2", {
|
|
2510
3170
|
className: "ab-title",
|
|
2511
|
-
children: "
|
|
2512
|
-
}), /* @__PURE__ */ jsx(
|
|
2513
|
-
className: "ab-text rb-on-surface--muted",
|
|
2514
|
-
children: "Choose the service you'd like to book"
|
|
2515
|
-
})] }),
|
|
2516
|
-
showServiceSelect ? /* @__PURE__ */ jsx(DefaultServiceChoices, { booking }) : null,
|
|
3171
|
+
children: "Choose a service"
|
|
3172
|
+
}), /* @__PURE__ */ jsx(DefaultServiceChoices, { booking })] }) : null,
|
|
2517
3173
|
booking.resources.state.tag === "loading" ? /* @__PURE__ */ jsxs("div", {
|
|
2518
3174
|
className: "ab-center",
|
|
2519
3175
|
children: [/* @__PURE__ */ jsx(SpinnerNode, {
|
|
@@ -2536,47 +3192,52 @@ function DefaultServiceSelectionStep({ booking }) {
|
|
|
2536
3192
|
role: "alert",
|
|
2537
3193
|
children: "No practitioners are available for this service right now."
|
|
2538
3194
|
}) : null,
|
|
2539
|
-
showResourceSelect && booking.resources.state.tag !== "loading" && (allowAnyResource || resources.length > 0) ? /* @__PURE__ */
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
children: ["Practitioner", booking.resources.requiresSelection ? "" : " (Optional)"]
|
|
2545
|
-
}),
|
|
2546
|
-
/* @__PURE__ */ jsx("p", {
|
|
2547
|
-
className: "ab-text rb-on-surface--muted",
|
|
2548
|
-
children: allowAnyResource ? "Choose a specific practitioner or select \"Any Available\"" : "Choose the practitioner you'd like to book"
|
|
2549
|
-
}),
|
|
2550
|
-
/* @__PURE__ */ jsxs("div", {
|
|
2551
|
-
className: "rb-reg-grid",
|
|
2552
|
-
children: [allowAnyResource ? /* @__PURE__ */ jsxs("button", {
|
|
2553
|
-
type: "button",
|
|
2554
|
-
onClick: () => booking.actions.selectResource(null),
|
|
2555
|
-
className: optionCardClassName(!selectedResourceId),
|
|
2556
|
-
"aria-pressed": !selectedResourceId,
|
|
2557
|
-
children: [/* @__PURE__ */ jsx("div", {
|
|
2558
|
-
className: "rb-flex-1 ab-subtitle",
|
|
2559
|
-
children: "Any Available"
|
|
2560
|
-
}), !selectedResourceId ? /* @__PURE__ */ jsx(SelectedCheck, {}) : null]
|
|
2561
|
-
}) : null, resources.map((resource) => {
|
|
2562
|
-
const isSelected = selectedResourceId === resource.id;
|
|
2563
|
-
return /* @__PURE__ */ jsxs("button", {
|
|
2564
|
-
type: "button",
|
|
2565
|
-
onClick: () => booking.actions.selectResource(resource.id),
|
|
2566
|
-
className: optionCardClassName(isSelected),
|
|
2567
|
-
"aria-pressed": isSelected,
|
|
2568
|
-
children: [/* @__PURE__ */ jsx("div", {
|
|
2569
|
-
className: "rb-flex-1 ab-subtitle",
|
|
2570
|
-
children: resource.label
|
|
2571
|
-
}), isSelected ? /* @__PURE__ */ jsx(SelectedCheck, {}) : null]
|
|
2572
|
-
}, resource.id);
|
|
2573
|
-
})]
|
|
2574
|
-
})
|
|
2575
|
-
]
|
|
3195
|
+
showResourceSelect && booking.resources.state.tag !== "loading" && (allowAnyResource || resources.length > 0) ? /* @__PURE__ */ jsx(DefaultResourceChoices, {
|
|
3196
|
+
booking,
|
|
3197
|
+
resources,
|
|
3198
|
+
selectedResourceId,
|
|
3199
|
+
allowAnyResource
|
|
2576
3200
|
}) : null
|
|
2577
3201
|
]
|
|
2578
3202
|
});
|
|
2579
3203
|
}
|
|
3204
|
+
function DefaultResourceChoices({ allowAnyResource, booking, resources, selectedResourceId }) {
|
|
3205
|
+
const headingId = React.useId();
|
|
3206
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
3207
|
+
className: "rb-reg-stack rb-reg-stack--sm",
|
|
3208
|
+
role: "group",
|
|
3209
|
+
"aria-labelledby": headingId,
|
|
3210
|
+
children: [/* @__PURE__ */ jsxs("h3", {
|
|
3211
|
+
id: headingId,
|
|
3212
|
+
className: "ab-subtitle",
|
|
3213
|
+
children: ["Who would you like to see?", booking.resources.requiresSelection ? null : /* @__PURE__ */ jsx(OptionalMark, {})]
|
|
3214
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
3215
|
+
className: "rb-reg-grid",
|
|
3216
|
+
children: [allowAnyResource ? /* @__PURE__ */ jsxs("button", {
|
|
3217
|
+
type: "button",
|
|
3218
|
+
onClick: () => booking.actions.selectResource(null),
|
|
3219
|
+
className: optionCardClassName(!selectedResourceId),
|
|
3220
|
+
"aria-pressed": !selectedResourceId,
|
|
3221
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
3222
|
+
className: "rb-flex-1 ab-subtitle",
|
|
3223
|
+
children: "Anyone available"
|
|
3224
|
+
}), !selectedResourceId ? /* @__PURE__ */ jsx(SelectedCheck, {}) : null]
|
|
3225
|
+
}) : null, resources.map((resource) => {
|
|
3226
|
+
const isSelected = selectedResourceId === resource.id;
|
|
3227
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
3228
|
+
type: "button",
|
|
3229
|
+
onClick: () => booking.actions.selectResource(resource.id),
|
|
3230
|
+
className: optionCardClassName(isSelected),
|
|
3231
|
+
"aria-pressed": isSelected,
|
|
3232
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
3233
|
+
className: "rb-flex-1 ab-subtitle",
|
|
3234
|
+
children: resource.label
|
|
3235
|
+
}), isSelected ? /* @__PURE__ */ jsx(SelectedCheck, {}) : null]
|
|
3236
|
+
}, resource.id);
|
|
3237
|
+
})]
|
|
3238
|
+
})]
|
|
3239
|
+
});
|
|
3240
|
+
}
|
|
2580
3241
|
function BookingSelectedServiceSummary({ services }) {
|
|
2581
3242
|
const service = services.items.length === 1 ? services.items[0] : void 0;
|
|
2582
3243
|
if (!service) return null;
|
|
@@ -2697,6 +3358,28 @@ function HeadlessBookingPaymentSelectionStep({ booking }) {
|
|
|
2697
3358
|
role: "status",
|
|
2698
3359
|
children: [booking.payment.appointmentPackages.state.message, " You can continue with the normal payment option."]
|
|
2699
3360
|
}) : null,
|
|
3361
|
+
booking.payment.appointmentPackages.kind === "ready" ? booking.payment.appointmentPackages.heldWithTeamMembers.map((member) => /* @__PURE__ */ jsxs("div", {
|
|
3362
|
+
className: "rb-reg-summary rb-space-y-2",
|
|
3363
|
+
children: [/* @__PURE__ */ jsxs("p", {
|
|
3364
|
+
className: "ab-text",
|
|
3365
|
+
children: [
|
|
3366
|
+
"You have sessions with ",
|
|
3367
|
+
member.name,
|
|
3368
|
+
". Book with ",
|
|
3369
|
+
member.name,
|
|
3370
|
+
" to use them."
|
|
3371
|
+
]
|
|
3372
|
+
}), /* @__PURE__ */ jsx(ThemedButton, {
|
|
3373
|
+
type: "button",
|
|
3374
|
+
variant: "secondary",
|
|
3375
|
+
size: "sm",
|
|
3376
|
+
label: `Book with ${member.name}`,
|
|
3377
|
+
onClick: () => {
|
|
3378
|
+
booking.actions.selectResource(member.id);
|
|
3379
|
+
booking.actions.goToStep("datetime-selection");
|
|
3380
|
+
}
|
|
3381
|
+
})]
|
|
3382
|
+
}, member.id)) : null,
|
|
2700
3383
|
slidingScale ? /* @__PURE__ */ jsxs("div", {
|
|
2701
3384
|
className: "rb-space-y-2",
|
|
2702
3385
|
children: [
|
|
@@ -2786,228 +3469,6 @@ function PaymentOptionContent({ description, helperText, id, summaryRows, title
|
|
|
2786
3469
|
]
|
|
2787
3470
|
});
|
|
2788
3471
|
}
|
|
2789
|
-
function DefaultDynamicFields({ booking, fields }) {
|
|
2790
|
-
const lastContactIndex = fields.reduce((last, field, index) => [
|
|
2791
|
-
"name",
|
|
2792
|
-
"email",
|
|
2793
|
-
"phone"
|
|
2794
|
-
].includes(field.id) ? index : last, -1);
|
|
2795
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
2796
|
-
className: "rb-space-y-6",
|
|
2797
|
-
children: [
|
|
2798
|
-
/* @__PURE__ */ jsx(SiteTermsChangedNotice, { message: booking.siteTerms.notice }),
|
|
2799
|
-
fields.map((field, index) => /* @__PURE__ */ jsxs(React.Fragment, { children: [/* @__PURE__ */ jsx(DefaultDynamicField, {
|
|
2800
|
-
booking,
|
|
2801
|
-
field
|
|
2802
|
-
}), index === lastContactIndex && booking.mailingList ? /* @__PURE__ */ jsx(BookingMailingListChoice, { booking }) : null] }, field.id)),
|
|
2803
|
-
/* @__PURE__ */ jsx(SiteTermsAgreementField, {
|
|
2804
|
-
agreement: booking.siteTerms.view,
|
|
2805
|
-
onChange: booking.siteTerms.onChange,
|
|
2806
|
-
error: booking.siteTerms.error,
|
|
2807
|
-
disabled: booking.siteTerms.disabled
|
|
2808
|
-
})
|
|
2809
|
-
]
|
|
2810
|
-
});
|
|
2811
|
-
}
|
|
2812
|
-
function DefaultDynamicField({ booking, field }) {
|
|
2813
|
-
const value = field.value ?? "";
|
|
2814
|
-
const error = field.error;
|
|
2815
|
-
const errorId = error ? field.errorId ?? `${field.inputId}-error` : null;
|
|
2816
|
-
const describedBy = [field.helpTextId, errorId].filter(Boolean).join(" ") || void 0;
|
|
2817
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
2818
|
-
className: "rb-space-y-2",
|
|
2819
|
-
children: [
|
|
2820
|
-
field.field.type === "booking_requirement_consent" ? /* @__PURE__ */ jsx(BookingConsentAgreement, {
|
|
2821
|
-
agreement: field.field.agreement,
|
|
2822
|
-
title: field.label,
|
|
2823
|
-
titleId: field.labelId
|
|
2824
|
-
}) : /* @__PURE__ */ jsxs("label", {
|
|
2825
|
-
id: field.labelId,
|
|
2826
|
-
htmlFor: field.inputId,
|
|
2827
|
-
className: "form-label",
|
|
2828
|
-
children: [field.label, field.required ? /* @__PURE__ */ jsx("span", {
|
|
2829
|
-
className: "required-marker",
|
|
2830
|
-
children: "*"
|
|
2831
|
-
}) : null]
|
|
2832
|
-
}),
|
|
2833
|
-
field.helpText ? /* @__PURE__ */ jsx("p", {
|
|
2834
|
-
id: field.helpTextId ?? void 0,
|
|
2835
|
-
className: "rb-caption status-muted",
|
|
2836
|
-
children: field.helpText
|
|
2837
|
-
}) : null,
|
|
2838
|
-
/* @__PURE__ */ jsx(DefaultFieldInput, {
|
|
2839
|
-
field,
|
|
2840
|
-
value,
|
|
2841
|
-
onChange: (nextValue) => booking.actions.updateField(field.id, nextValue),
|
|
2842
|
-
onBlur: () => booking.actions.markFieldTouched(field.id),
|
|
2843
|
-
error,
|
|
2844
|
-
errorId: errorId ?? `${field.inputId}-error`,
|
|
2845
|
-
describedBy
|
|
2846
|
-
}),
|
|
2847
|
-
error ? /* @__PURE__ */ jsx(FieldValidationMessage, {
|
|
2848
|
-
id: errorId ?? `${field.inputId}-error`,
|
|
2849
|
-
className: "rb-caption status-error",
|
|
2850
|
-
children: error
|
|
2851
|
-
}) : null
|
|
2852
|
-
]
|
|
2853
|
-
});
|
|
2854
|
-
}
|
|
2855
|
-
function DefaultFieldInput({ describedBy, error, errorId, field, onBlur, onChange, value }) {
|
|
2856
|
-
const strValue = typeof value === "string" ? value : String(value ?? "");
|
|
2857
|
-
const validationProps = getFieldValidationControlProps({
|
|
2858
|
-
message: error,
|
|
2859
|
-
messageId: errorId,
|
|
2860
|
-
describedBy
|
|
2861
|
-
});
|
|
2862
|
-
const commonProps = {
|
|
2863
|
-
id: field.inputId,
|
|
2864
|
-
name: field.id,
|
|
2865
|
-
onBlur,
|
|
2866
|
-
required: field.required,
|
|
2867
|
-
...validationProps
|
|
2868
|
-
};
|
|
2869
|
-
switch (field.field.type) {
|
|
2870
|
-
case "textarea": return /* @__PURE__ */ jsx("textarea", {
|
|
2871
|
-
...commonProps,
|
|
2872
|
-
value: strValue,
|
|
2873
|
-
onChange: (event) => onChange(event.target.value),
|
|
2874
|
-
placeholder: field.field.placeholder,
|
|
2875
|
-
minLength: field.field.minLength,
|
|
2876
|
-
maxLength: field.field.maxLength,
|
|
2877
|
-
rows: 4,
|
|
2878
|
-
className: "form-textarea"
|
|
2879
|
-
});
|
|
2880
|
-
case "select":
|
|
2881
|
-
if (field.field.multiple) return /* @__PURE__ */ jsx("select", {
|
|
2882
|
-
...commonProps,
|
|
2883
|
-
value: Array.isArray(value) ? value : [],
|
|
2884
|
-
onChange: (event) => {
|
|
2885
|
-
onChange(Array.from(event.target.selectedOptions, (option) => option.value));
|
|
2886
|
-
},
|
|
2887
|
-
multiple: true,
|
|
2888
|
-
className: "form-select rb-h-32",
|
|
2889
|
-
children: field.field.options?.map((option) => /* @__PURE__ */ jsx("option", {
|
|
2890
|
-
value: option.value,
|
|
2891
|
-
children: option.label
|
|
2892
|
-
}, option.value))
|
|
2893
|
-
});
|
|
2894
|
-
return /* @__PURE__ */ jsxs("select", {
|
|
2895
|
-
...commonProps,
|
|
2896
|
-
value: strValue,
|
|
2897
|
-
onChange: (event) => onChange(event.target.value),
|
|
2898
|
-
className: "form-select",
|
|
2899
|
-
children: [/* @__PURE__ */ jsx("option", {
|
|
2900
|
-
value: "",
|
|
2901
|
-
children: "Select an option..."
|
|
2902
|
-
}), field.field.options?.map((option) => /* @__PURE__ */ jsx("option", {
|
|
2903
|
-
value: option.value,
|
|
2904
|
-
children: option.label
|
|
2905
|
-
}, option.value))]
|
|
2906
|
-
});
|
|
2907
|
-
case "radio": return /* @__PURE__ */ jsx("div", {
|
|
2908
|
-
className: "rb-space-y-2",
|
|
2909
|
-
children: field.field.options?.map((option) => /* @__PURE__ */ jsxs("label", {
|
|
2910
|
-
className: "form-check",
|
|
2911
|
-
children: [/* @__PURE__ */ jsx("input", {
|
|
2912
|
-
type: "radio",
|
|
2913
|
-
name: field.id,
|
|
2914
|
-
value: option.value,
|
|
2915
|
-
checked: value === option.value,
|
|
2916
|
-
onChange: (event) => onChange(event.target.value),
|
|
2917
|
-
onBlur,
|
|
2918
|
-
required: field.required,
|
|
2919
|
-
...validationProps,
|
|
2920
|
-
className: "form-radio"
|
|
2921
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
2922
|
-
className: "form-check-label",
|
|
2923
|
-
children: option.label
|
|
2924
|
-
})]
|
|
2925
|
-
}, option.value))
|
|
2926
|
-
});
|
|
2927
|
-
case "checkbox":
|
|
2928
|
-
if (field.field.options && field.field.options.length > 1) {
|
|
2929
|
-
const checkedValues = toStringArray(value);
|
|
2930
|
-
return /* @__PURE__ */ jsx("div", {
|
|
2931
|
-
className: "rb-space-y-2",
|
|
2932
|
-
children: field.field.options.map((option) => /* @__PURE__ */ jsx(CheckboxChoice, {
|
|
2933
|
-
name: field.id,
|
|
2934
|
-
value: option.value,
|
|
2935
|
-
checked: checkedValues.includes(option.value),
|
|
2936
|
-
onChange: (event) => {
|
|
2937
|
-
onChange(event.target.checked ? [...checkedValues, option.value] : checkedValues.filter((item) => item !== option.value));
|
|
2938
|
-
},
|
|
2939
|
-
onBlur,
|
|
2940
|
-
...validationProps,
|
|
2941
|
-
label: option.label
|
|
2942
|
-
}, option.value))
|
|
2943
|
-
});
|
|
2944
|
-
}
|
|
2945
|
-
return /* @__PURE__ */ jsx(CheckboxChoice, {
|
|
2946
|
-
id: field.inputId,
|
|
2947
|
-
name: field.id,
|
|
2948
|
-
checked: Boolean(value),
|
|
2949
|
-
onChange: (event) => onChange(event.target.checked),
|
|
2950
|
-
onBlur,
|
|
2951
|
-
required: field.required,
|
|
2952
|
-
...validationProps,
|
|
2953
|
-
label: field.field.placeholder || field.label
|
|
2954
|
-
});
|
|
2955
|
-
case "booking_requirement_consent": return /* @__PURE__ */ jsx(CheckboxChoice, {
|
|
2956
|
-
id: field.inputId,
|
|
2957
|
-
name: field.id,
|
|
2958
|
-
checked: Boolean(value),
|
|
2959
|
-
onChange: (event) => onChange(event.target.checked),
|
|
2960
|
-
onBlur,
|
|
2961
|
-
required: field.required,
|
|
2962
|
-
...validationProps,
|
|
2963
|
-
label: field.field.checkboxLabel,
|
|
2964
|
-
presentation: "tile"
|
|
2965
|
-
});
|
|
2966
|
-
case "number": return /* @__PURE__ */ jsx("input", {
|
|
2967
|
-
...commonProps,
|
|
2968
|
-
type: "number",
|
|
2969
|
-
value: strValue,
|
|
2970
|
-
onChange: (event) => onChange(event.target.value),
|
|
2971
|
-
placeholder: field.field.placeholder,
|
|
2972
|
-
min: field.field.min,
|
|
2973
|
-
max: field.field.max,
|
|
2974
|
-
className: "form-input"
|
|
2975
|
-
});
|
|
2976
|
-
case "date": return /* @__PURE__ */ jsx("input", {
|
|
2977
|
-
...commonProps,
|
|
2978
|
-
type: "date",
|
|
2979
|
-
value: strValue,
|
|
2980
|
-
onChange: (event) => onChange(event.target.value),
|
|
2981
|
-
min: field.field.min ? String(field.field.min) : void 0,
|
|
2982
|
-
max: field.field.max ? String(field.field.max) : void 0,
|
|
2983
|
-
className: "form-input"
|
|
2984
|
-
});
|
|
2985
|
-
case "time": return /* @__PURE__ */ jsx("input", {
|
|
2986
|
-
...commonProps,
|
|
2987
|
-
type: "time",
|
|
2988
|
-
value: strValue,
|
|
2989
|
-
onChange: (event) => onChange(event.target.value),
|
|
2990
|
-
className: "form-input"
|
|
2991
|
-
});
|
|
2992
|
-
case "text":
|
|
2993
|
-
case "email":
|
|
2994
|
-
case "tel":
|
|
2995
|
-
case "url": return /* @__PURE__ */ jsx("input", {
|
|
2996
|
-
...commonProps,
|
|
2997
|
-
type: field.type,
|
|
2998
|
-
value: strValue,
|
|
2999
|
-
onChange: (event) => onChange(event.target.value),
|
|
3000
|
-
placeholder: field.field.placeholder,
|
|
3001
|
-
minLength: field.field.minLength,
|
|
3002
|
-
maxLength: field.field.maxLength,
|
|
3003
|
-
pattern: field.field.pattern,
|
|
3004
|
-
className: "form-input"
|
|
3005
|
-
});
|
|
3006
|
-
}
|
|
3007
|
-
}
|
|
3008
|
-
function toStringArray(value) {
|
|
3009
|
-
return Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
|
|
3010
|
-
}
|
|
3011
3472
|
function DefaultBookingDiscount({ booking }) {
|
|
3012
3473
|
if (!(!booking.payment.selectedAppointmentPackageId && !booking.discount.loading && (booking.discount.manualCodeEntryAllowed || Boolean(booking.discount.autoAppliedDiscount)))) return null;
|
|
3013
3474
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -3056,14 +3517,16 @@ function DefaultBookingFeedback({ booking }) {
|
|
|
3056
3517
|
})]
|
|
3057
3518
|
});
|
|
3058
3519
|
}
|
|
3520
|
+
/** Each field shows its own message, so the summary only says where to look. */
|
|
3521
|
+
const FIELD_ERRORS_SUMMARY = "Please check the details above.";
|
|
3059
3522
|
function DefaultBookingErrorSummary({ errors, id }) {
|
|
3060
3523
|
if (!hasBookingValidationErrors(errors)) return null;
|
|
3061
|
-
return /* @__PURE__ */
|
|
3524
|
+
return /* @__PURE__ */ jsx(FeedbackMessage, {
|
|
3062
3525
|
tone: "error",
|
|
3063
3526
|
treatment: "field-note",
|
|
3064
3527
|
id,
|
|
3065
3528
|
role: "alert",
|
|
3066
|
-
children:
|
|
3529
|
+
children: /* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx("strong", { children: errors.formError ?? FIELD_ERRORS_SUMMARY }) })
|
|
3067
3530
|
});
|
|
3068
3531
|
}
|
|
3069
3532
|
//#endregion
|
|
@@ -3348,10 +3811,15 @@ const BookingFormClient = ({ siteId: siteIdProp, render }) => {
|
|
|
3348
3811
|
viewState.kind,
|
|
3349
3812
|
viewState.kind === "error" ? viewState.message : null
|
|
3350
3813
|
]);
|
|
3814
|
+
const { endSignInReturn } = booking.questions;
|
|
3351
3815
|
React.useEffect(() => {
|
|
3352
|
-
if (viewState.kind === "success" && redirectState.kind === "success")
|
|
3816
|
+
if (viewState.kind === "success" && redirectState.kind === "success") {
|
|
3817
|
+
scrollToBlock(bookingAnchorId);
|
|
3818
|
+
endSignInReturn();
|
|
3819
|
+
}
|
|
3353
3820
|
}, [
|
|
3354
3821
|
bookingAnchorId,
|
|
3822
|
+
endSignInReturn,
|
|
3355
3823
|
redirectState.kind,
|
|
3356
3824
|
viewState.kind
|
|
3357
3825
|
]);
|