@riverbankcms/sdk 0.181.0 → 0.183.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/CHANGELOG.md +79 -0
- package/README.md +49 -3
- package/dist/_dts/{BlocksIslandsHydrator-CVCasDPz.d.ts → BlocksIslandsHydrator-X1_G96iN.d.ts} +1 -1
- package/dist/_dts/{Page-Dtj2Ui3S.d.ts → Page-CEqZJZEE.d.ts} +7 -7
- package/dist/_dts/{SdkPreviewMode-D1f_60WW.d.ts → SdkPreviewMode-DQejfbXL.d.ts} +2 -2
- package/dist/_dts/{client-Chr9pNVW.d.ts → client-B_B_amKD.d.ts} +2 -3
- package/dist/_dts/{content-types-kjccgopX.d.ts → content-types-Dhx5Ocvx.d.ts} +9 -16
- package/dist/_dts/{contracts-BodaiS00.d.ts → contracts-FeOnfoa1.d.ts} +3 -3
- package/dist/_dts/{generatePageMetadata-BS6kaJFp.d.ts → generatePageMetadata-m70J6tit.d.ts} +2 -2
- package/dist/_dts/{index-Brl6_I2j.d.ts → index-BOpUh8kO.d.ts} +1 -1
- package/dist/_dts/{index-CJkefwYh.d.ts → index-Bizdaxji.d.ts} +2 -2
- package/dist/_dts/{index-Diqt0PvG.d.ts → index-BxCmCit0.d.ts} +1 -1
- package/dist/_dts/{index-DG0OvBs0.d.ts → index-CjAkEWAp.d.ts} +4 -4
- package/dist/_dts/{index-D1WpKwQe.d.ts → index-iuFrbIjt.d.ts} +1 -1
- package/dist/_dts/{index-Dy50xUMK.d.ts → index-liuhlOX7.d.ts} +2 -2
- package/dist/_dts/{loadContent-BgxshKrA.d.ts → loadContent-D4wrTIIw.d.ts} +7 -7
- package/dist/_dts/{request-CA0izds5.d.ts → request-Gn0O1blj.d.ts} +25042 -23761
- package/dist/_dts/{resolveBlockData-ChQmwEd3.d.ts → resolveBlockData-D5duwuqS.d.ts} +5 -5
- package/dist/_dts/{resolvePageContent-BvGyvblj.d.ts → resolvePageContent-xzJ3c9Na.d.ts} +1 -1
- 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 +7 -7
- 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/gifting/client.d.ts +1 -1
- 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 +3 -3
- 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/portal/index.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 -4
- 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 +6 -6
- 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 +91 -2
- package/dist/_dts/{serviceBookingOutline-BgFbJQhU.d.ts → serviceBookingOutline-B1gyJon_.d.ts} +7 -7
- package/dist/_dts/{types-CgS3xLk8.d.ts → types-BoITy0rA.d.ts} +41 -4
- package/dist/_dts/{types-CQrsP1x_.d.ts → types-DBNuMtSk.d.ts} +16 -5
- package/dist/_dts/{types-R65DKjPn.d.ts → types-DHMcuoeQ.d.ts} +7 -7
- package/dist/_dts/{validation-6LTIbuBA.d.ts → validation-BIPO-XlE.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-DqZPz6oW.mjs → BlocksIslandsHydrator-Ct8slgRk.mjs} +22 -18
- package/dist/client/{BookingMailingListNote-uWfR2kaG.mjs → BookingMailingListNote-qqTxGGS4.mjs} +7 -7
- package/dist/client/{BookingQuestionFields-CyNIKw6k.mjs → BookingQuestionFields-DCh9MUIF.mjs} +2 -2
- package/dist/client/{CalendarAction-D_Glwvz2.mjs → CalendarAction-RcdaStG7.mjs} +1 -1
- package/dist/client/{CalendarNavigationChevron-BGCX3zwG.mjs → CalendarNavigationChevron-D7Wt-Oaa.mjs} +27 -10
- package/dist/client/{CheckboxChoice-C8i4NraK.mjs → CheckboxChoice-BdGxZWeg.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-DFLPyuqe.mjs → DemoBookingPortalAccess-HFVkoOac.mjs} +5 -5
- package/dist/client/{EventCalendar.client-zDL4-t-B.mjs → EventCalendar.client-BtkJW8bA.mjs} +10 -10
- package/dist/client/{EventCombined.client-uciDKLID.mjs → EventCombined.client-DxaGjFFS.mjs} +9 -9
- package/dist/client/{EventEmbeddedCheckoutStep-BGkbUhuw.mjs → EventEmbeddedCheckoutStep-B2c5dR49.mjs} +1 -1
- package/dist/client/{EventItem-CwzrjcRw.mjs → EventItem-Fr2qi2C2.mjs} +33 -186
- package/dist/client/{EventListWeekNavigation-ChvcnPma.mjs → EventListWeekNavigation-BRMaq0ky.mjs} +1 -1
- package/dist/client/{EventListing.client-DA57Qoyx.mjs → EventListing.client-BhGxfbjt.mjs} +3 -3
- package/dist/client/{EventListing.view-DZ0qMFF4.mjs → EventListing.view-COuEJzbO.mjs} +8 -8
- package/dist/client/{EventRegistrationPayment-DSqCJL8E.mjs → EventRegistrationPayment-BTLYhVxD.mjs} +41 -195
- package/dist/client/{Page-C7mygH_f.mjs → Page-CgbQZP5g.mjs} +2947 -1018
- package/dist/client/{ProtectedSubmitButton-BNnKuir8.mjs → ProtectedSubmitButton-BG7my0Qf.mjs} +1 -1
- package/dist/client/{SiteTermsAgreementField-B4z-e4Wq.mjs → SiteTermsAgreementField-DQNkfNLA.mjs} +3 -3
- package/dist/client/{StepIndicator-Dn_DY4oY.mjs → StepIndicator-DvPekKeM.mjs} +1 -1
- package/dist/client/{StepIndicator-atfDU82W.mjs → StepIndicator-DyXoI3ob.mjs} +221 -20
- package/dist/client/{ThemedButton-PFOhXktM.mjs → ThemedButton-Bc9DBbVp.mjs} +42 -9
- package/dist/client/{accessibleSurfaces-n6kS6Hct.mjs → accessibleSurfaces-wj4Rloo5.mjs} +1214 -724
- package/dist/client/{accordion-CsW8U3ff.mjs → accordion-BVXfjnh-.mjs} +1 -1
- package/dist/client/{booking-form.client-cBWM392H.mjs → booking-form.client-DycPGtke.mjs} +191 -71
- package/dist/client/{bookingForm-DgySpp6C.mjs → bookingForm-DrWSUqL3.mjs} +4 -4
- package/dist/client/bookings.mjs +5 -5
- package/dist/client/{boxStyleClassNames-BpGVdLFD.mjs → boxStyleClassNames-CduDRcIk.mjs} +2 -2
- package/dist/client/buttonParts-CJEtVOUy.mjs +1511 -0
- package/dist/client/{carousel-DJoleFV3.mjs → carousel-DyCLMP8s.mjs} +2 -2
- package/dist/client/{carousel.client-BtLwHefX.mjs → carousel.client-DffP_Nv0.mjs} +1 -1
- package/dist/client/{cart-EO5o6uPH.mjs → cart-BuEp_cj4.mjs} +3 -3
- package/dist/client/{cart.client-D_gPw45z.mjs → cart.client-CAO39uDG.mjs} +1 -1
- package/dist/client/{checkout-NVfZW0kR.mjs → checkout-BoxzT64s.mjs} +3 -3
- package/dist/client/{checkout.client-DD3JuqOy.mjs → checkout.client-IGUy7XOx.mjs} +1 -1
- package/dist/client/{checkoutUrls-z2gXvlGw.mjs → checkoutUrls-D0UsiFmm.mjs} +1 -1
- package/dist/client/client.mjs +466 -94
- package/dist/client/{constants-CoOkvw__.mjs → constants-C_8AxMdm.mjs} +1 -1
- package/dist/client/{context-CRhn9qzS.mjs → context-D1L0pe__.mjs} +23 -5
- package/dist/client/{dateFormatting-BnWB4L1s.mjs → dateFormatting-HvfmS_cH.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-CWDGSTBu.mjs → demoPortalMagicLink-BunFTnIq.mjs} +1 -1
- package/dist/client/{enhanceHeaderSection-tdP_-Z9o.mjs → enhanceHeaderSection-CtLAG651.mjs} +4 -4
- package/dist/client/{event-registration.client-D7YYKySQ.mjs → event-registration.client-DiSxkBUP.mjs} +15 -15
- package/dist/client/{eventCalendar-CsAfu5d0.mjs → eventCalendar-DUnhwZ1o.mjs} +4 -4
- package/dist/client/{eventCombined-VXJB5CoS.mjs → eventCombined-BvBQo0nF.mjs} +4 -4
- package/dist/client/{eventListing-B3KIZNfY.mjs → eventListing-aTLifOX7.mjs} +4 -4
- package/dist/client/{eventRegistration-BP-dEk1c.mjs → eventRegistration-DFd7pr09.mjs} +4 -4
- package/dist/client/{form-DM8Zbxbv.mjs → form-Dikmc2AO.mjs} +3 -3
- package/dist/client/{form.client-e2z_Tlgk.mjs → form.client-zHaQK5I9.mjs} +5 -5
- package/dist/client/{form.parts-Ctljy1a3.mjs → form.parts-BLl9n8TH.mjs} +3 -3
- package/dist/client/gifting/client.mjs +16 -9
- package/dist/client/{gifting-DWIsqQru.mjs → gifting-CufPM38H.mjs} +4 -4
- package/dist/client/{gifting.client-QsSWF0uA.mjs → gifting.client--N1GaSY8.mjs} +155 -84
- package/dist/client/gifting.interactive-D9MK4HkV.mjs +157 -0
- package/dist/client/gifting.parts-CRtiRzo-.mjs +119 -0
- package/dist/client/{headerSection-DAkRkwb-.mjs → headerSection-BIaBpmk3.mjs} +2 -2
- package/dist/client/{noop-Dl4mZ-rr.mjs → islands-DJDLGQEm.mjs} +16008 -8676
- package/dist/client/{newsletter-form.client-WYja9-WN.mjs → newsletter-form.client-wg_JHTxm.mjs} +6 -6
- package/dist/client/{newsletter-form.interactive-RuM86VAv.mjs → newsletter-form.interactive-hzpkW9NQ.mjs} +384 -326
- package/dist/client/{newsletter-form.parts-2petDnWv.mjs → newsletter-form.parts-CgzpSv9p.mjs} +2 -2
- package/dist/client/{newsletterForm-BUbXdA_e.mjs → newsletterForm-CvxLiEBT.mjs} +3 -3
- package/dist/client/portal/client.mjs +291 -101
- package/dist/client/{portalOrders-COGn4BKG.mjs → portalOrders-tCxS04g0.mjs} +3 -2
- package/dist/client/{portalRoutes-D72yvtDh.mjs → portalRoutes-DTHlWg_F.mjs} +33 -7
- package/dist/client/{product-detail.client-pOAryevt.mjs → product-detail.client-22Q7zgjN.mjs} +1 -1
- package/dist/client/{product-list.client-CcUpUiud.mjs → product-list.client-DFWYvK8z.mjs} +1 -1
- package/dist/client/{productDetail-BZJCfqat.mjs → productDetail-DhZAwo60.mjs} +3 -3
- package/dist/client/{productList-CiRs3mNb.mjs → productList-BiVpbZK2.mjs} +3 -3
- package/dist/client/{propsDecoder--uHW4tFM.mjs → propsDecoder-DFYqKnLy.mjs} +4 -2
- package/dist/client/{registry.server-CDNNd8wC.mjs → registry.server-C3OBRg7x.mjs} +2305 -873
- package/dist/client/rendering/client.mjs +29 -26
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +5 -5
- package/dist/client/{richText-coerce-CQGE_wHV.mjs → richText-coerce-ms477Z08.mjs} +2 -2
- package/dist/client/{routeIslandApiConfig-BtCg87-N.mjs → routeIslandApiConfig-B6nQeqvH.mjs} +1 -1
- package/dist/client/{runtimeResponse-Ds9cmBUf.mjs → runtimeResponse-BYqsV1Kb.mjs} +1 -1
- package/dist/client/runtimeResponse-CUX_lldL.mjs +3 -0
- package/dist/client/{shop-commerce-D8evQnMT.mjs → shop-commerce-DVsIcPaI.mjs} +16 -15
- package/dist/client/{shop-commerce-store-C9PcsSTj.mjs → shop-commerce-store-7mO6KY7_.mjs} +1 -1
- package/dist/client/{shop-discount-apply.state-D5CtGfJI.mjs → shop-discount-apply.state-L1Vge8tG.mjs} +2 -2
- package/dist/client/{shop-Rx_gEMK8.mjs → shop-xt4dQ3HH.mjs} +3 -3
- package/dist/client/{shop.client-D4lzQ9oY.mjs → shop.client-DNJfD3VQ.mjs} +28 -17
- package/dist/client/{shopShared-BVbq7Nm-.mjs → shopShared-DS8t6749.mjs} +2 -2
- package/dist/client/spam-protection.mjs +1 -1
- package/dist/client/{src-ZSqRK3dD.mjs → src-Do_s2lqH.mjs} +16 -19
- package/dist/client/{timetableModel-BQJrSK0K.mjs → timetableModel-Dy3nNfTG.mjs} +13 -17
- package/dist/client/{useAvailableSlots-Dm3lKJKR.mjs → useAvailableSlots-DcjtDpUu.mjs} +2 -2
- package/dist/client/{useDiscountCodeUi-klgfGn7f.mjs → useDiscountCodeUi-DvdFFWOT.mjs} +1 -1
- package/dist/client/{useEventPagination-Jnjt7_ly.mjs → useEventPagination-Cq-7sU5_.mjs} +8 -8
- package/dist/client/{view-CC_yQLSA.mjs → view-4gnPcpWJ.mjs} +24 -9
- package/dist/client/{wizardSteps-BliJOzEX.mjs → wizardSteps-DDvL3iza.mjs} +375 -186
- package/dist/preview-next/client/{EventEmbeddedCheckoutStep-aRJjq4x8.mjs → EventEmbeddedCheckoutStep-CLqSRUpt.mjs} +1 -1
- package/dist/preview-next/client/{LocationPickerEnvironment-BW3dRFIv.mjs → LocationPickerEnvironment-CIdAg-Tm.mjs} +1 -1
- package/dist/preview-next/client/{MapLibreEditMap-Db9BHyXh.mjs → MapLibreEditMap-Bm85jX35.mjs} +2 -2
- package/dist/preview-next/client/{PageSectionToolbar-BhL0uADo.mjs → PageSectionToolbar-D8srnz9R.mjs} +445 -18
- package/dist/preview-next/client/{PreviewEditorSidebar-Ct8eIm0i.mjs → PreviewEditorSidebar-DVpk5cqp.mjs} +3871 -1947
- package/dist/preview-next/client/{PreviewEditorUI-BS32G4V9.mjs → PreviewEditorUI-XoTtHSFH.mjs} +11 -36
- package/dist/preview-next/client/{PreviewShell-RL0WfZXD.mjs → PreviewShell-VQHsRg2u.mjs} +40 -35
- package/dist/preview-next/client/{SdkPreviewModeRuntime-MK_gHeGy.mjs → SdkPreviewModeRuntime-CLdF9f6o.mjs} +51 -20
- package/dist/preview-next/client/{ThemedButton-CVYz7h68.mjs → ThemedButton-ORNN4x-3.mjs} +782 -16
- package/dist/preview-next/client/{lucide-react-00FF_oar.mjs → lucide-react-eAi3tDAr.mjs} +11 -1
- package/dist/preview-next/client/{previewAssistantSlot-CQyS8pcq.mjs → previewAssistantSlot-CqH91EwA.mjs} +20687 -8562
- package/dist/preview-next/client/{previewChromeRoot-BSxp3Mfu.mjs → previewChromeRoot-B3ySEu6p.mjs} +3 -90
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-DKnTzy74.mjs → sdk-runtime-CdpSupcr.mjs} +2 -2
- package/dist/preview-next/client/{siteStyleAccess-BlmbvbLN.mjs → siteStyleAccess-C6eOP6QW.mjs} +35 -6
- package/dist/preview-next/client/{useAutosaveStatus-D-7GwZOQ.mjs → useAutosaveStatus-BhPg4e-r.mjs} +49 -3
- package/dist/preview-next/client/{useOpenBlockForSetup-BNZtGM5g.mjs → useOpenBlockForSetup-BaWUF9D7.mjs} +2007 -448
- package/dist/preview-next/container-responsive.css +320 -0
- package/dist/preview-next/editor-chrome.css +23 -2
- package/dist/preview-next/keepAlive.mjs +1 -1
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-R3PcMmax.mjs → route-contract-Ch0X99vE.mjs} +183 -18
- package/dist/server/{Block.shared-CniF9tSu.mjs → Block.shared-B2FmczLO.mjs} +5 -5
- package/dist/server/{ThemeScopeCore-BQWsnGT6.mjs → ThemeScopeCore-DtAyv9qA.mjs} +51 -29
- package/dist/server/{accessibleSurfaces-WPzUAHp4.mjs → accessibleSurfaces-BtPqb76u.mjs} +509 -389
- package/dist/server/{accordions-By_0Ykks.mjs → accordions-vzdZ2Wt1.mjs} +1 -1
- package/dist/server/{bindings-DxojjtK3.mjs → bindings-B_9JuU66.mjs} +7 -7
- package/dist/server/{client-CDndhbYO.mjs → client-DC7cjiSw.mjs} +489 -93
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/{constants-VyF5nEhL.mjs → constants-d6nPNJpe.mjs} +33 -6
- package/dist/server/{customCss-C9kgPHvr.mjs → customCss-rtIfEYwQ.mjs} +1 -18
- package/dist/server/data/resolveBlockData.mjs +1 -1
- package/dist/server/{resolveButtonColourStates-B0O1IM16.mjs → expandPalette-DxPrNOAB.mjs} +950 -316
- package/dist/server/index.mjs +3 -3
- package/dist/server/{loadContent-BKstMBmX.mjs → loadContent-hb27HYic.mjs} +11 -10
- package/dist/server/{loadPage-IgNnZaqr.mjs → loadPage-JToD8wDD.mjs} +3 -3
- package/dist/server/{lookMediaFrame-TFjgNG61.mjs → lookMediaFrame-CTsycLLK.mjs} +94 -39
- package/dist/server/manifest.mjs +2 -2
- package/dist/server/{navigation-quBYlSKD.mjs → navigation-B2WhGofA.mjs} +1 -1
- package/dist/server/navigation.mjs +1 -1
- package/dist/server/next.mjs +8 -8
- package/dist/server/{overrideResolution-CCaAPpIa.mjs → overrideResolution-vD5KTClL.mjs} +1 -1
- package/dist/server/page-converter.mjs +3 -3
- package/dist/server/{pageRenderPlan-B7iULvKe.mjs → pageRenderPlan-CdqJ1NQZ.mjs} +242 -336
- package/dist/server/{pageRuntimeSupport-BytMroxn.mjs → pageRuntimeSupport-CAhr4oOf.mjs} +3 -3
- package/dist/server/{pageShared-Dcs_XTIO.mjs → pageShared-m80Xu2pd.mjs} +1292 -877
- package/dist/server/{parseThemeForPersistence-Bihl4W5K.mjs → parseThemeForPersistence-CRwOZfpa.mjs} +3 -3
- package/dist/server/{portal-CMW_b9mG.mjs → portal-B2wCQno_.mjs} +1 -1
- package/dist/server/portal.mjs +2 -2
- package/dist/server/{prebuild-agaH-vZV.mjs → prebuild-BWIkFaXq.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-DwpRjqw4.mjs → prefetchBlockData-D1PHU-K9.mjs} +3 -3
- package/dist/server/{registry-DM9dHfDC.mjs → registry-KtsOsAzY.mjs} +21703 -10936
- 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 +4 -4
- package/dist/server/rendering.mjs +9 -9
- package/dist/server/{resolveBlockData-CinHGf8l.mjs → resolveBlockData-sjIDJYl7.mjs} +1 -1
- package/dist/server/{schema-CwfxQjc4.mjs → schema-BBEqquBM.mjs} +44 -28
- package/dist/server/server.mjs +3 -3
- package/dist/server/{servicePageContent-BBBhOtdE.mjs → servicePageContent-ChEZDRwU.mjs} +38 -15
- package/dist/server/theme-bridge.mjs +34 -9
- package/dist/server/theme.mjs +2 -2
- package/dist/server/{three-pass-converter-DPaUPTfl.mjs → three-pass-converter-DKCIBeb1.mjs} +2 -2
- package/dist/server/{titleSourceSchema-NhK6azFS.mjs → titleSourceSchema-DybHErxH.mjs} +4 -4
- package/dist/server/{typeGuards-CTW_9AXq.mjs → typeGuards-DZOaGTEv.mjs} +126 -126
- package/dist/server/{types-BKaBZFjD.mjs → types-vyz09w64.mjs} +479 -8
- package/dist/server/{validation-DG5jX3jH.mjs → validation-Cvi-1TZZ.mjs} +13 -9
- package/dist/server/{version-CipbxPHL.mjs → version-B-icAIV1.mjs} +1 -1
- package/dist/server/{video-Cdr3wh-q.mjs → video-DBaeSawZ.mjs} +1 -1
- package/dist/styles/index.css +2568 -154
- package/package.json +1 -1
- package/dist/client/gifting.parts-CedLgwa_.mjs +0 -86
- package/dist/client/runtimeResponse-DL_ARBpa.mjs +0 -3
- package/dist/client/types-BEaKfam_.mjs +0 -778
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client";
|
|
3
3
|
import { m as ok, p as err } from "../renderableMediaAssetAdmission-BsOWd9lf.mjs";
|
|
4
|
-
import { An as formatCurrencyAmount, Fn as unsafeAsAppointmentResourceId, On as parsePositiveMoneyInputToCents, Sn as parseUtcIsoDateTimeString, _t as unknownKind, an as formatDateTimeRange, bn as parseBookingLocalDate, cn as formatTime, gt as exactSchema, ht as evolvingSchema, in as formatDateTime, ln as formatTimeRange, nn as formatDate, rn as formatDateRange, t as assertNever, vt as unknownTag } from "../src-
|
|
5
|
-
import { a as withPortalArrival, c as portalBookingViewSchema, d as portalWaitlistOfferPriceSchema, h as parseOrderPaymentReceiptId, i as portalPath, l as portalBookingsResponseSchema, m as parseOrderId, n as isServerPortalTarget, o as portalBookingPath, r as parsePortalLocation, s as portalBookingResponseSchema, u as portalRegularSessionsResponseSchema } from "../portalRoutes-
|
|
4
|
+
import { An as formatCurrencyAmount, Fn as unsafeAsAppointmentResourceId, On as parsePositiveMoneyInputToCents, Sn as parseUtcIsoDateTimeString, _t as unknownKind, an as formatDateTimeRange, bn as parseBookingLocalDate, cn as formatTime, gt as exactSchema, ht as evolvingSchema, in as formatDateTime, ln as formatTimeRange, nn as formatDate, rn as formatDateRange, t as assertNever, vt as unknownTag } from "../src-Do_s2lqH.mjs";
|
|
5
|
+
import { a as withPortalArrival, c as portalBookingViewSchema, d as portalWaitlistOfferPriceSchema, h as parseOrderPaymentReceiptId, i as portalPath, l as portalBookingsResponseSchema, m as parseOrderId, n as isServerPortalTarget, o as portalBookingPath, r as parsePortalLocation, s as portalBookingResponseSchema, u as portalRegularSessionsResponseSchema } from "../portalRoutes-DTHlWg_F.mjs";
|
|
6
6
|
import { a as calendarEntryEnd, h as assertNever$1, i as bookingCalendarFromEntries, l as getInitialFieldValue, m as unansweredRequiredBookingQuestions, n as ONLINE_CALENDAR_LOCATION, o as UNANSWERED_QUESTION_MESSAGE, t as ONLINE_CALENDAR_DESCRIPTION, u as initialBookingQuestionValues } from "../bookingCalendar--aWnqFDn.mjs";
|
|
7
7
|
import { t as generateUuidV4 } from "../uuid-BETKW8rS.mjs";
|
|
8
|
-
import { a as questionControlProps, i as isChoiceGroup, o as clientPersonPhrases, t as BookingQuestionFieldInput } from "../BookingQuestionFields-
|
|
9
|
-
import { C as customerProfileSchema, _ as portalPaymentToDoSchema, f as portalDeadlineSchema, g as portalPaymentDueSchema, h as portalOrderNameSchema, i as bookingContextRefSchema, l as eventAttendeeRefSchema, m as portalOrderBreakdownSchema, n as customerOrderSchema, p as portalMoneySchema, x as customerPassUseCaseSchema } from "../portalOrders-
|
|
10
|
-
import { C as portalMeUpdateResponseSchema, E as portalTransferEventRegistrationResultSchema, S as portalMeResponseSchema, T as portalRescheduleAppointmentResponseSchema, _ as portalDigitalProductsResponseSchema, a as createPortalTransport, b as portalEventRescheduleResultSchema, c as PORTAL, d as portalBookingQuestionsTaskResponseSchema, f as portalBookingQuestionsUploadUrlResponseSchema, g as portalDigitalProductDownloadUrlResponseSchema, h as portalDigitalProductAccessResponseSchema, l as magicLinkResponseSchema, m as portalCancelOutcomeSchema, n as useBlockApi, o as field, p as portalCancelMembershipAtPeriodEndResultSchema, s as isUncertainPortalFailure, t as BlockApiProvider, u as portalBookingQuestionsFinalizeUploadResponseSchema, v as portalEventGuestsResponseSchema, w as portalOrderCheckoutResponseSchema, x as portalEventTicketResponseSchema, y as portalEventRescheduleDatesSchema } from "../context-
|
|
11
|
-
import { a as ThemedFileChooser, n as ThemedButton, r as ThemedButtonLink, x as clsx } from "../ThemedButton-
|
|
8
|
+
import { a as questionControlProps, i as isChoiceGroup, o as clientPersonPhrases, t as BookingQuestionFieldInput } from "../BookingQuestionFields-DCh9MUIF.mjs";
|
|
9
|
+
import { C as customerProfileSchema, _ as portalPaymentToDoSchema, f as portalDeadlineSchema, g as portalPaymentDueSchema, h as portalOrderNameSchema, i as bookingContextRefSchema, l as eventAttendeeRefSchema, m as portalOrderBreakdownSchema, n as customerOrderSchema, p as portalMoneySchema, x as customerPassUseCaseSchema } from "../portalOrders-tCxS04g0.mjs";
|
|
10
|
+
import { C as portalMeUpdateResponseSchema, E as portalTransferEventRegistrationResultSchema, S as portalMeResponseSchema, T as portalRescheduleAppointmentResponseSchema, _ as portalDigitalProductsResponseSchema, a as createPortalTransport, b as portalEventRescheduleResultSchema, c as PORTAL, d as portalBookingQuestionsTaskResponseSchema, f as portalBookingQuestionsUploadUrlResponseSchema, g as portalDigitalProductDownloadUrlResponseSchema, h as portalDigitalProductAccessResponseSchema, l as magicLinkResponseSchema, m as portalCancelOutcomeSchema, n as useBlockApi, o as field, p as portalCancelMembershipAtPeriodEndResultSchema, s as isUncertainPortalFailure, t as BlockApiProvider, u as portalBookingQuestionsFinalizeUploadResponseSchema, v as portalEventGuestsResponseSchema, w as portalOrderCheckoutResponseSchema, x as portalEventTicketResponseSchema, y as portalEventRescheduleDatesSchema } from "../context-D1L0pe__.mjs";
|
|
11
|
+
import { a as ThemedFileChooser, n as ThemedButton, r as ThemedButtonLink, x as clsx } from "../ThemedButton-Bc9DBbVp.mjs";
|
|
12
12
|
import { n as assertSafeAppPath } from "../src-Al4ooTl_.mjs";
|
|
13
13
|
import { t as resolveDedicatedBookingHref } from "../bookingRoute-D6DlxYx6.mjs";
|
|
14
14
|
import { t as FieldValidationMessage } from "../FieldValidationMessage-CsqxShw4.mjs";
|
|
15
|
-
import { n as useAvailableDates, t as useAvailableSlots } from "../useAvailableSlots-
|
|
16
|
-
import { i as getDemoBookingPass, n as buildPortalCallbackUrl, t as PORTAL_CALLBACK_PATH } from "../demoPortalMagicLink-
|
|
17
|
-
import { n as downloadCalendar } from "../CalendarAction-
|
|
18
|
-
import { a as formatPortalSessionTime, c as portalSessionDisplay, i as formatPortalSessionDay, o as formatPortalSessionWithWeekday, r as formatPortalSession, s as lastCoveredInstant, t as formatDateTime$1 } from "../dateFormatting-
|
|
15
|
+
import { n as useAvailableDates, t as useAvailableSlots } from "../useAvailableSlots-DcjtDpUu.mjs";
|
|
16
|
+
import { i as getDemoBookingPass, n as buildPortalCallbackUrl, t as PORTAL_CALLBACK_PATH } from "../demoPortalMagicLink-BunFTnIq.mjs";
|
|
17
|
+
import { n as downloadCalendar } from "../CalendarAction-RcdaStG7.mjs";
|
|
18
|
+
import { a as formatPortalSessionTime, c as portalSessionDisplay, i as formatPortalSessionDay, o as formatPortalSessionWithWeekday, r as formatPortalSession, s as lastCoveredInstant, t as formatDateTime$1 } from "../dateFormatting-HvfmS_cH.mjs";
|
|
19
19
|
import * as React$1 from "react";
|
|
20
20
|
import { forwardRef, useCallback, useEffect, useId, useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
|
|
21
21
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -269,6 +269,8 @@ const knownTaskSchema = evolvingSchema()(z.discriminatedUnion("kind", [
|
|
|
269
269
|
...taskBase,
|
|
270
270
|
kind: z.literal("pay"),
|
|
271
271
|
orderId: z.string(),
|
|
272
|
+
orderNumber: z.string(),
|
|
273
|
+
placedAt: z.string(),
|
|
272
274
|
for: portalPaymentForViewSchema,
|
|
273
275
|
due: portalPaymentDueSchema,
|
|
274
276
|
moneyLine: z.string()
|
|
@@ -570,6 +572,7 @@ const knownEntrySchema = exactSchema()(z.discriminatedUnion("kind", [z.object({
|
|
|
570
572
|
kind: z.literal("refund"),
|
|
571
573
|
key: z.string(),
|
|
572
574
|
order: paymentOrderSchema,
|
|
575
|
+
paymentReceiptId: z.string().nullable(),
|
|
573
576
|
...refundFields
|
|
574
577
|
})]));
|
|
575
578
|
const unsupportedEntrySchema = unknownKind(ENTRY_KINDS).extend({
|
|
@@ -1145,7 +1148,9 @@ function portalResourceShown(state) {
|
|
|
1145
1148
|
value,
|
|
1146
1149
|
stale: state.status === "failed" || !portalResourceCurrent(state)
|
|
1147
1150
|
};
|
|
1148
|
-
|
|
1151
|
+
if (state.status !== "failed") return { kind: "failed" };
|
|
1152
|
+
if (state.error.kind === "not_found") return { kind: "not_found" };
|
|
1153
|
+
return state.error.kind === "rejected" && state.error.status === 410 ? { kind: "gone" } : { kind: "failed" };
|
|
1149
1154
|
}
|
|
1150
1155
|
/** The failed reload the showing value is under, kept through retries and next pages until a reload works. */
|
|
1151
1156
|
function outOfDateBy(state) {
|
|
@@ -1849,6 +1854,19 @@ function portalLocalTime(local, site) {
|
|
|
1849
1854
|
function holdsPlace(booking) {
|
|
1850
1855
|
return booking.standing.kind === "booked" || booking.standing.kind === "awaiting_payment";
|
|
1851
1856
|
}
|
|
1857
|
+
/** Cancelled, given away or a request that didn't go ahead: they won't be going, so where it is no longer matters to them. */
|
|
1858
|
+
function wontGo(booking) {
|
|
1859
|
+
switch (booking.standing.kind) {
|
|
1860
|
+
case "cancelled":
|
|
1861
|
+
case "given_away":
|
|
1862
|
+
case "request_not_accepted": return true;
|
|
1863
|
+
case "booked":
|
|
1864
|
+
case "awaiting_payment":
|
|
1865
|
+
case "requested":
|
|
1866
|
+
case "waitlisted":
|
|
1867
|
+
case "missed": return false;
|
|
1868
|
+
}
|
|
1869
|
+
}
|
|
1852
1870
|
/** Still to come and still theirs, or still asked for: the bookings with plans to change and things to do. */
|
|
1853
1871
|
function isLive(booking) {
|
|
1854
1872
|
return booking.timing === "upcoming" && (holdsPlace(booking) || booking.standing.kind === "requested");
|
|
@@ -2569,6 +2587,8 @@ function sendingLine(to, context) {
|
|
|
2569
2587
|
const PAYMENT_ON_ITS_WAY = "A payment for this is already on its way. If you've just paid, it can take a minute or two to show here.";
|
|
2570
2588
|
/** The button that takes them back into a checkout they started and didn't finish. */
|
|
2571
2589
|
const CONTINUE_TO_PAYMENT = "Continue to payment";
|
|
2590
|
+
/** For a link that opens the order page, where Continue to payment is, so it says where it goes. */
|
|
2591
|
+
const SEE_WHATS_LEFT_TO_PAY = "See what's left to pay";
|
|
2572
2592
|
/**
|
|
2573
2593
|
* What to say when paying isn't a button: a payment already on its way, who
|
|
2574
2594
|
* to ask when it can't be paid online, or that we couldn't tell just now.
|
|
@@ -2877,7 +2897,7 @@ function onlineLines(booking, standing) {
|
|
|
2877
2897
|
const ONLINE_JOIN_ABOVE = "Online. Use the Join online button at the top of this page.";
|
|
2878
2898
|
const HYBRID_JOIN_ABOVE = "You can also join online, with the Join online button at the top of this page.";
|
|
2879
2899
|
function where(booking, standing) {
|
|
2880
|
-
if (booking.where.kind === "not_given") return null;
|
|
2900
|
+
if (booking.where.kind === "not_given" || wontGo(booking)) return null;
|
|
2881
2901
|
const venue = venueOf(booking);
|
|
2882
2902
|
return {
|
|
2883
2903
|
venue: venue ? venueLines(venue) : null,
|
|
@@ -2928,7 +2948,7 @@ function rescheduleNote(booking, until, context) {
|
|
|
2928
2948
|
}
|
|
2929
2949
|
function rescheduleItem(booking, context) {
|
|
2930
2950
|
if (booking.kind === "course") return null;
|
|
2931
|
-
const label = booking.kind === "appointment" ? "Change the time" : "Change
|
|
2951
|
+
const label = booking.kind === "appointment" ? "Change the time" : "Change the date";
|
|
2932
2952
|
const { reschedule } = booking.actions;
|
|
2933
2953
|
const note = reschedule.kind === "available" ? rescheduleNote(booking, reschedule.until, context) : null;
|
|
2934
2954
|
return planItem("reschedule", label, reschedule, portalLink(label, {
|
|
@@ -3004,7 +3024,7 @@ function payButton(order, target) {
|
|
|
3004
3024
|
switch (toDo.kind) {
|
|
3005
3025
|
case "pay":
|
|
3006
3026
|
case "instalment_failed": return toDo.online.kind === "available" ? portalLink(toDo.kind === "pay" ? `Pay ${money$1(toDo.amount)} now` : "Pay now", target, "primary") : null;
|
|
3007
|
-
case "finish_paying": return portalLink(
|
|
3027
|
+
case "finish_paying": return portalLink(SEE_WHATS_LEFT_TO_PAY, target, "primary");
|
|
3008
3028
|
case "payment_underway":
|
|
3009
3029
|
case "plan_running":
|
|
3010
3030
|
case "nothing":
|
|
@@ -3755,7 +3775,8 @@ function BookingLoad({ session, bookingRef, you, onSignOut, children }) {
|
|
|
3755
3775
|
count: 1,
|
|
3756
3776
|
label: "Loading your booking"
|
|
3757
3777
|
});
|
|
3758
|
-
case "not_found":
|
|
3778
|
+
case "not_found":
|
|
3779
|
+
case "gone": return /* @__PURE__ */ jsx(DifferentEmail, {
|
|
3759
3780
|
email: you?.email ?? null,
|
|
3760
3781
|
onSignOut
|
|
3761
3782
|
});
|
|
@@ -4274,14 +4295,19 @@ const ORDER_TONE = {
|
|
|
4274
4295
|
function isOnline(booking) {
|
|
4275
4296
|
return booking.where.kind === "online";
|
|
4276
4297
|
}
|
|
4277
|
-
function
|
|
4278
|
-
switch (
|
|
4279
|
-
case "
|
|
4280
|
-
|
|
4281
|
-
return venue.name ?? (venue.address.kind === "shown" ? venue.address.address : null);
|
|
4282
|
-
}
|
|
4283
|
-
case "hybrid": return booking.where.venue.name ? `${booking.where.venue.name} or online` : "In person or online";
|
|
4298
|
+
function locationLabel(mode, venueName, address = null) {
|
|
4299
|
+
switch (mode) {
|
|
4300
|
+
case "in_person": return venueName ?? address;
|
|
4301
|
+
case "hybrid": return venueName ? `${venueName} or online` : "In person or online";
|
|
4284
4302
|
case "online": return "Online";
|
|
4303
|
+
}
|
|
4304
|
+
}
|
|
4305
|
+
function whereLabel(booking) {
|
|
4306
|
+
const where = booking.where;
|
|
4307
|
+
switch (where.kind) {
|
|
4308
|
+
case "venue": return locationLabel("in_person", where.venue.name, where.venue.address.kind === "shown" ? where.venue.address.address : null);
|
|
4309
|
+
case "hybrid": return locationLabel("hybrid", where.venue.name);
|
|
4310
|
+
case "online": return locationLabel("online", null);
|
|
4285
4311
|
case "not_given": return null;
|
|
4286
4312
|
}
|
|
4287
4313
|
}
|
|
@@ -4321,7 +4347,7 @@ function cardWhen(booking) {
|
|
|
4321
4347
|
function metaLines(booking, context) {
|
|
4322
4348
|
const when = cardWhen(booking);
|
|
4323
4349
|
const time = when ? portalWhenSummary(when, context.site, isOnline(booking)) : null;
|
|
4324
|
-
return [booking.kind === "course" && booking.timing === "upcoming" && when && time ? `Next session ${portalShortDay(when.startsAt, context.site, when.timeZone, isOnline(booking)) ?? ""}, ${time}` : time, whereLabel(booking)].filter((line) => Boolean(line));
|
|
4350
|
+
return [booking.kind === "course" && booking.timing === "upcoming" && when && time ? `Next session ${portalShortDay(when.startsAt, context.site, when.timeZone, isOnline(booking)) ?? ""}, ${time}` : time, wontGo(booking) ? null : whereLabel(booking)].filter((line) => Boolean(line));
|
|
4325
4351
|
}
|
|
4326
4352
|
/**
|
|
4327
4353
|
* A whole money sentence as a chip: a chip is a label, so a one-sentence line
|
|
@@ -4578,9 +4604,13 @@ function waitlistWhen(entry) {
|
|
|
4578
4604
|
timeZone: entry.subject.timeZone
|
|
4579
4605
|
} : null;
|
|
4580
4606
|
}
|
|
4607
|
+
/** Where it is, as a booking card says it: the venue, "Online", or the venue "or online" when it's both. */
|
|
4608
|
+
function waitlistWhere(entry) {
|
|
4609
|
+
return locationLabel(entry.subject.deliveryMode, entry.venueName);
|
|
4610
|
+
}
|
|
4581
4611
|
function waitlistCardBase(entry, context) {
|
|
4582
4612
|
const when = waitlistWhen(entry);
|
|
4583
|
-
const online = entry.subject.
|
|
4613
|
+
const online = entry.subject.deliveryMode !== "in_person";
|
|
4584
4614
|
const schedule = entry.subject.kind === "wholeSeries" ? entry.subject.scheduleSummary : null;
|
|
4585
4615
|
return {
|
|
4586
4616
|
key: `waitlist:${entry.id}`,
|
|
@@ -4589,7 +4619,7 @@ function waitlistCardBase(entry, context) {
|
|
|
4589
4619
|
kind: placesSuffix(entry.requestedPlaces),
|
|
4590
4620
|
title: entry.eventTitle,
|
|
4591
4621
|
titleLink: entry.eventPath ? hrefLink(entry.eventTitle, entry.eventPath, "link") : null,
|
|
4592
|
-
meta: [when ? portalWhenSummary(when, context.site, online) : schedule,
|
|
4622
|
+
meta: [when ? portalWhenSummary(when, context.site, online) : schedule, waitlistWhere(entry)].filter((line) => Boolean(line)),
|
|
4593
4623
|
quiet: false
|
|
4594
4624
|
};
|
|
4595
4625
|
}
|
|
@@ -4647,7 +4677,15 @@ function waitlistCardModel(entry, context) {
|
|
|
4647
4677
|
}
|
|
4648
4678
|
}
|
|
4649
4679
|
//#endregion
|
|
4650
|
-
//#region ../blocks/src/portal/app/model/
|
|
4680
|
+
//#region ../blocks/src/portal/app/model/listWithAnd.ts
|
|
4681
|
+
/** "A", "A and B", "A, B and C". */
|
|
4682
|
+
function listWithAnd(items) {
|
|
4683
|
+
return items.length < 2 ? items.join("") : `${items.slice(0, -1).join(", ")} and ${items.slice(-1).join("")}`;
|
|
4684
|
+
}
|
|
4685
|
+
/** The label for revealing a folded group's hidden cards: "Show 4 more". */
|
|
4686
|
+
function showMoreLabel(group) {
|
|
4687
|
+
return group.folded === null ? null : `Show ${group.cards.length - group.folded} more`;
|
|
4688
|
+
}
|
|
4651
4689
|
const GROUP_TITLES = {
|
|
4652
4690
|
waitlist: "From the waitlist",
|
|
4653
4691
|
coming_up: "Coming up",
|
|
@@ -4659,22 +4697,26 @@ function bookingsPageModel(view, regular, context) {
|
|
|
4659
4697
|
{
|
|
4660
4698
|
id: "waitlist",
|
|
4661
4699
|
title: GROUP_TITLES.waitlist,
|
|
4662
|
-
cards: view.waitlist.map((entry) => waitlistCardModel(entry, context))
|
|
4700
|
+
cards: view.waitlist.map((entry) => waitlistCardModel(entry, context)),
|
|
4701
|
+
folded: null
|
|
4663
4702
|
},
|
|
4664
4703
|
{
|
|
4665
4704
|
id: "coming_up",
|
|
4666
4705
|
title: GROUP_TITLES.coming_up,
|
|
4667
|
-
cards: view.comingUp.map((booking) => bookingCardModel(booking, context))
|
|
4706
|
+
cards: view.comingUp.map((booking) => bookingCardModel(booking, context)),
|
|
4707
|
+
folded: null
|
|
4668
4708
|
},
|
|
4669
4709
|
{
|
|
4670
4710
|
id: "cancelled",
|
|
4671
4711
|
title: GROUP_TITLES.cancelled,
|
|
4672
|
-
cards: view.cancelled.map((booking) => bookingCardModel(booking, context))
|
|
4712
|
+
cards: view.cancelled.map((booking) => bookingCardModel(booking, context)),
|
|
4713
|
+
folded: view.cancelled.length > 3 ? 3 : null
|
|
4673
4714
|
},
|
|
4674
4715
|
{
|
|
4675
4716
|
id: "past",
|
|
4676
4717
|
title: GROUP_TITLES.past,
|
|
4677
|
-
cards: view.past.map((booking) => bookingCardModel(booking, context))
|
|
4718
|
+
cards: view.past.map((booking) => bookingCardModel(booking, context)),
|
|
4719
|
+
folded: null
|
|
4678
4720
|
}
|
|
4679
4721
|
].filter((group) => group.cards.length > 0);
|
|
4680
4722
|
const regularModel = regularSessionsModel(regular, shown.length > 0, context);
|
|
@@ -4719,14 +4761,20 @@ const NTH = {
|
|
|
4719
4761
|
4: "fourth",
|
|
4720
4762
|
last: "last"
|
|
4721
4763
|
};
|
|
4764
|
+
/**
|
|
4765
|
+
* "Mondays, Wednesdays and Thursdays at 6:30am", "Mondays at 6:30am and Thursdays at
|
|
4766
|
+
* 7am", "Every other Monday and Thursday at 6:30am", or a monthly day as before.
|
|
4767
|
+
*/
|
|
4722
4768
|
function cadenceLine(session, context) {
|
|
4723
|
-
const { cadence,
|
|
4724
|
-
const time = portalLocalTime(localStart, context.site);
|
|
4725
|
-
const
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4769
|
+
const { cadence, days } = session.pattern;
|
|
4770
|
+
const time = (day) => portalLocalTime(day.localStart, context.site);
|
|
4771
|
+
const name = (day) => portalWeekday(day.weekday, context.site);
|
|
4772
|
+
const [first] = days;
|
|
4773
|
+
if (!first) return "";
|
|
4774
|
+
if (cadence.kind === "monthly") return `The ${NTH[cadence.nth]} ${name(first)} of each month at ${time(first)}`;
|
|
4775
|
+
const sameTime = days.every((day) => day.localStart === first.localStart);
|
|
4776
|
+
if (cadence.everyWeeks === 2) return sameTime ? `Every other ${listWithAnd(days.map(name))} at ${time(first)}` : `Every other ${listWithAnd(days.map((day) => `${name(day)} at ${time(day)}`))}`;
|
|
4777
|
+
return sameTime ? `${listWithAnd(days.map((day) => `${name(day)}s`))} at ${time(first)}` : listWithAnd(days.map((day) => `${name(day)}s at ${time(day)}`));
|
|
4730
4778
|
}
|
|
4731
4779
|
function dateChip(date, trainer) {
|
|
4732
4780
|
switch (date.state) {
|
|
@@ -5103,28 +5151,43 @@ function BookingsList({ session, bookPath, value, state }) {
|
|
|
5103
5151
|
});
|
|
5104
5152
|
}
|
|
5105
5153
|
function GroupSection({ group, leave, read, more }) {
|
|
5154
|
+
const [unfolded, setUnfolded] = React$1.useState(false);
|
|
5155
|
+
const moreLabel = unfolded ? null : showMoreLabel(group);
|
|
5156
|
+
const cards = moreLabel && group.folded !== null ? group.cards.slice(0, group.folded) : group.cards;
|
|
5106
5157
|
return /* @__PURE__ */ jsxs(PortalSection, {
|
|
5107
5158
|
id: group.id,
|
|
5108
5159
|
title: group.title,
|
|
5109
5160
|
hang: true,
|
|
5110
|
-
children: [
|
|
5111
|
-
card,
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
|
|
5127
|
-
|
|
5161
|
+
children: [
|
|
5162
|
+
cards.map((card) => group.id === "waitlist" ? /* @__PURE__ */ jsx(WaitlistCard, {
|
|
5163
|
+
card,
|
|
5164
|
+
leave,
|
|
5165
|
+
read
|
|
5166
|
+
}, card.key) : /* @__PURE__ */ jsx(BookingCard, { card }, card.key)),
|
|
5167
|
+
moreLabel ? /* @__PURE__ */ jsx("div", {
|
|
5168
|
+
className: "rb-portal-more",
|
|
5169
|
+
children: /* @__PURE__ */ jsx(PortalButton, {
|
|
5170
|
+
type: "button",
|
|
5171
|
+
variant: "secondary",
|
|
5172
|
+
label: moreLabel,
|
|
5173
|
+
onClick: () => setUnfolded(true)
|
|
5174
|
+
})
|
|
5175
|
+
}) : null,
|
|
5176
|
+
more?.show ? /* @__PURE__ */ jsxs("div", {
|
|
5177
|
+
className: "rb-portal-more",
|
|
5178
|
+
children: [/* @__PURE__ */ jsx(PortalButton, {
|
|
5179
|
+
type: "button",
|
|
5180
|
+
variant: "secondary",
|
|
5181
|
+
disabled: more.loading,
|
|
5182
|
+
label: more.loading ? "Loading…" : "Show older bookings",
|
|
5183
|
+
onClick: more.load
|
|
5184
|
+
}), more.failed ? /* @__PURE__ */ jsx("p", {
|
|
5185
|
+
className: "rb-portal-inline-error",
|
|
5186
|
+
role: "alert",
|
|
5187
|
+
children: "We couldn't load older bookings. Try again in a moment."
|
|
5188
|
+
}) : null]
|
|
5189
|
+
}) : null
|
|
5190
|
+
]
|
|
5128
5191
|
});
|
|
5129
5192
|
}
|
|
5130
5193
|
function RegularSessionsBlock({ regular, onRetry }) {
|
|
@@ -5231,6 +5294,7 @@ function questionsTask$1(task, context) {
|
|
|
5231
5294
|
urgent: task.urgent,
|
|
5232
5295
|
title: `Answer your questions for ${task.bookingTitle}`,
|
|
5233
5296
|
text: due ? [textPart(due)] : [],
|
|
5297
|
+
sub: null,
|
|
5234
5298
|
action: !("tag" in task.ref) ? portalLink("See your bookings", { page: "bookings" }, "quiet") : portalLink("Answer questions", {
|
|
5235
5299
|
page: "booking_questions",
|
|
5236
5300
|
ref: task.ref
|
|
@@ -5245,6 +5309,7 @@ function guestNamesTask(task, context) {
|
|
|
5245
5309
|
urgent: task.urgent,
|
|
5246
5310
|
title: one ? "Add the name of someone coming with you" : `Add the names of ${task.namesMissing} people coming with you`,
|
|
5247
5311
|
text: [textPart(`${task.bookingTitle}${day ? ` on ${day}` : ""}. ${businessNameAtStart(context)} would like to know who's coming.`)],
|
|
5312
|
+
sub: null,
|
|
5248
5313
|
action: portalLink(one ? "Add name" : "Add names", {
|
|
5249
5314
|
page: "booking",
|
|
5250
5315
|
ref: task.ref
|
|
@@ -5260,6 +5325,7 @@ function waitlistTask(task, context) {
|
|
|
5260
5325
|
urgent: task.urgent,
|
|
5261
5326
|
title: many ? `Your places for ${task.eventTitle} are ready` : `A place for ${task.eventTitle} is ready for you`,
|
|
5262
5327
|
text: [...by ? [textPart(`Book by ${by} to take ${many ? "them" : "it"}. After that, we'll offer ${many ? "them" : "it"} to the next person on the waitlist.`)] : [], ...free ? [textPart(by ? ` ${free}` : free)] : []],
|
|
5328
|
+
sub: null,
|
|
5263
5329
|
action: task.claimPath ? hrefLink(many ? "Book these places" : "Book this place", task.claimPath, "quiet") : portalLink("See the offer", { page: "bookings" }, "quiet")
|
|
5264
5330
|
};
|
|
5265
5331
|
}
|
|
@@ -5276,7 +5342,7 @@ function payTaskWords(task, name, contact, context) {
|
|
|
5276
5342
|
case "finish_paying": return {
|
|
5277
5343
|
title: `Finish paying for ${name}`,
|
|
5278
5344
|
note: [],
|
|
5279
|
-
action:
|
|
5345
|
+
action: SEE_WHATS_LEFT_TO_PAY
|
|
5280
5346
|
};
|
|
5281
5347
|
case "payment_underway": return {
|
|
5282
5348
|
title: `Your payment for ${name}`,
|
|
@@ -5285,6 +5351,11 @@ function payTaskWords(task, name, contact, context) {
|
|
|
5285
5351
|
};
|
|
5286
5352
|
}
|
|
5287
5353
|
}
|
|
5354
|
+
/** When it was booked (or ordered) and its order number, since two tasks for the same thing differ only by these. */
|
|
5355
|
+
function payTaskSub(task, context) {
|
|
5356
|
+
const on = portalSentenceDate(task.placedAt, context.site, context.now);
|
|
5357
|
+
return [on ? `${task.for.kind === "order" ? "Ordered" : "Booked"} on ${on}` : null, `Order ${task.orderNumber}`].filter(Boolean).join(" · ");
|
|
5358
|
+
}
|
|
5288
5359
|
function payTask$1(task, contact, context) {
|
|
5289
5360
|
const order = parseOrderId(task.orderId);
|
|
5290
5361
|
const words = payTaskWords(task, paymentName(task.for), contact, context);
|
|
@@ -5293,6 +5364,7 @@ function payTask$1(task, contact, context) {
|
|
|
5293
5364
|
urgent: task.urgent,
|
|
5294
5365
|
title: words.title,
|
|
5295
5366
|
text: words.note.length > 0 ? [textPart(`${task.moneyLine} `), ...words.note] : [textPart(task.moneyLine)],
|
|
5367
|
+
sub: payTaskSub(task, context),
|
|
5296
5368
|
action: order.ok ? portalLink(words.action, {
|
|
5297
5369
|
page: "order",
|
|
5298
5370
|
orderId: order.value
|
|
@@ -5305,6 +5377,7 @@ function membershipTask$1(task, contact, context) {
|
|
|
5305
5377
|
urgent: task.urgent,
|
|
5306
5378
|
title: `Your last payment for ${task.membershipName} didn't go through`,
|
|
5307
5379
|
text: membershipText(membershipPaymentFailedLine(task, context, task.membershipName), contact, context),
|
|
5380
|
+
sub: null,
|
|
5308
5381
|
action: portalLink("See membership", { page: "passes" }, "quiet")
|
|
5309
5382
|
};
|
|
5310
5383
|
}
|
|
@@ -5315,6 +5388,7 @@ function unsupportedTask(task, contact, context) {
|
|
|
5315
5388
|
urgent: task.urgent,
|
|
5316
5389
|
title: "There's something waiting for you that we can't show here yet",
|
|
5317
5390
|
text: contactSentence("To find out what it is, get in touch with", contact, context),
|
|
5391
|
+
sub: null,
|
|
5318
5392
|
action: null
|
|
5319
5393
|
};
|
|
5320
5394
|
}
|
|
@@ -5451,7 +5525,7 @@ function homePageModel(view, context) {
|
|
|
5451
5525
|
* bringing it up to date failed (what's showing stays). A failed next page is
|
|
5452
5526
|
* the page's own to say, beside the button that asked for it.
|
|
5453
5527
|
*/
|
|
5454
|
-
function PortalResourcePage({ session, resource, loading, failedTitle, notFound, children }) {
|
|
5528
|
+
function PortalResourcePage({ session, resource, loading, failedTitle, notFound, gone, children }) {
|
|
5455
5529
|
const state = usePortalResource(session.resources, resource);
|
|
5456
5530
|
const retry = () => session.resources.refresh(resource);
|
|
5457
5531
|
const shown = portalResourceShown(state);
|
|
@@ -5462,6 +5536,7 @@ function PortalResourcePage({ session, resource, loading, failedTitle, notFound,
|
|
|
5462
5536
|
switch (shown.kind) {
|
|
5463
5537
|
case "loading": return /* @__PURE__ */ jsx(Fragment, { children: loading });
|
|
5464
5538
|
case "not_found": return notFound ? /* @__PURE__ */ jsx(Fragment, { children: notFound }) : failed;
|
|
5539
|
+
case "gone": return gone ? /* @__PURE__ */ jsx(Fragment, { children: gone }) : notFound ? /* @__PURE__ */ jsx(Fragment, { children: notFound }) : failed;
|
|
5465
5540
|
case "failed": return failed;
|
|
5466
5541
|
case "shown": break;
|
|
5467
5542
|
}
|
|
@@ -5595,16 +5670,24 @@ function Task({ task }) {
|
|
|
5595
5670
|
"data-portal": "todo-mark",
|
|
5596
5671
|
"aria-hidden": "true"
|
|
5597
5672
|
}),
|
|
5598
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
|
|
5602
|
-
|
|
5603
|
-
|
|
5604
|
-
|
|
5605
|
-
|
|
5606
|
-
|
|
5607
|
-
|
|
5673
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
5674
|
+
/* @__PURE__ */ jsxs("p", {
|
|
5675
|
+
className: "rb-portal-todo__title",
|
|
5676
|
+
children: [task.urgent ? /* @__PURE__ */ jsx("span", {
|
|
5677
|
+
className: "rb-sr-only",
|
|
5678
|
+
children: "Needs doing soon: "
|
|
5679
|
+
}) : null, task.title]
|
|
5680
|
+
}),
|
|
5681
|
+
task.text.length > 0 ? /* @__PURE__ */ jsx("p", {
|
|
5682
|
+
className: "rb-portal-todo__text",
|
|
5683
|
+
children: /* @__PURE__ */ jsx(TextParts, { parts: task.text })
|
|
5684
|
+
}) : null,
|
|
5685
|
+
task.sub ? /* @__PURE__ */ jsx("p", {
|
|
5686
|
+
className: "rb-portal-todo__text rb-portal-small",
|
|
5687
|
+
"data-portal": "todo-sub",
|
|
5688
|
+
children: task.sub
|
|
5689
|
+
}) : null
|
|
5690
|
+
] }),
|
|
5608
5691
|
task.action ? /* @__PURE__ */ jsx(ActionView, { action: task.action }) : null
|
|
5609
5692
|
]
|
|
5610
5693
|
});
|
|
@@ -10841,7 +10924,8 @@ function QuestionsPage({ session, bookingRef, you, onSignOut }) {
|
|
|
10841
10924
|
count: 1,
|
|
10842
10925
|
label: "Loading your questions"
|
|
10843
10926
|
});
|
|
10844
|
-
case "not_found":
|
|
10927
|
+
case "not_found":
|
|
10928
|
+
case "gone": return /* @__PURE__ */ jsx(DifferentEmail, {
|
|
10845
10929
|
email: you?.email ?? null,
|
|
10846
10930
|
onSignOut
|
|
10847
10931
|
});
|
|
@@ -11992,10 +12076,6 @@ const studioName = (studio) => studio?.trim() || "the organiser";
|
|
|
11992
12076
|
function firstName(name) {
|
|
11993
12077
|
return name.trim().split(/\s+/)[0] ?? name;
|
|
11994
12078
|
}
|
|
11995
|
-
function joinNames(names) {
|
|
11996
|
-
if (names.length <= 1) return names[0] ?? "";
|
|
11997
|
-
return `${names.slice(0, -1).join(", ")} and ${names.at(-1) ?? ""}`;
|
|
11998
|
-
}
|
|
11999
12079
|
const guestCount = (subject) => Math.max(0, subject.ticketsCount - 1);
|
|
12000
12080
|
/** Every guest has a name, so the copy can use them. */
|
|
12001
12081
|
const allGuestsNamed = (subject) => guestCount(subject) > 0 && subject.guestNames.length === guestCount(subject);
|
|
@@ -12004,7 +12084,7 @@ function guestsPhrase(count) {
|
|
|
12004
12084
|
}
|
|
12005
12085
|
/** "you, Tom Nair and Asha Patel", or "you and your 2 guests". */
|
|
12006
12086
|
function everyonePhrase(subject) {
|
|
12007
|
-
if (allGuestsNamed(subject)) return
|
|
12087
|
+
if (allGuestsNamed(subject)) return listWithAnd(["you", ...subject.guestNames]);
|
|
12008
12088
|
return `you and ${guestsPhrase(guestCount(subject))}`;
|
|
12009
12089
|
}
|
|
12010
12090
|
const sessionFacts = (facts) => ({
|
|
@@ -12031,7 +12111,7 @@ function rescheduleCurrentCard(subject, site) {
|
|
|
12031
12111
|
}
|
|
12032
12112
|
function reschedulePickLead(subject) {
|
|
12033
12113
|
if (guestCount(subject) === 0) return "Choose a new date for your booking.";
|
|
12034
|
-
return `Choose a new date. Your whole booking moves together, so ${allGuestsNamed(subject) ?
|
|
12114
|
+
return `Choose a new date. Your whole booking moves together, so ${allGuestsNamed(subject) ? listWithAnd(subject.guestNames.map(firstName)) : guestsPhrase(guestCount(subject))} will come with you.`;
|
|
12035
12115
|
}
|
|
12036
12116
|
const BLOCKED_BADGES = {
|
|
12037
12117
|
full: "Full",
|
|
@@ -13120,7 +13200,11 @@ function creditModel(account, context) {
|
|
|
13120
13200
|
return {
|
|
13121
13201
|
available: money(account.available),
|
|
13122
13202
|
setAside: account.setAside.amountCents > 0 ? `${money(account.setAside)} more is held for a payment that's still going through.` : null,
|
|
13123
|
-
history: account.history.map((entry) => creditEntry(entry, context))
|
|
13203
|
+
history: account.history.map((entry) => creditEntry(entry, context)),
|
|
13204
|
+
balance: `Balance: ${money({
|
|
13205
|
+
...account.available,
|
|
13206
|
+
amountCents: account.available.amountCents + account.setAside.amountCents
|
|
13207
|
+
})}`
|
|
13124
13208
|
};
|
|
13125
13209
|
}
|
|
13126
13210
|
function passesPageModel(view, context) {
|
|
@@ -13477,17 +13561,25 @@ function CreditCard({ credit }) {
|
|
|
13477
13561
|
className: "rb-portal-muted rb-portal-small rb-portal-mt-s",
|
|
13478
13562
|
children: credit.setAside
|
|
13479
13563
|
}) : null,
|
|
13480
|
-
credit.history.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
13481
|
-
|
|
13482
|
-
|
|
13483
|
-
|
|
13484
|
-
|
|
13485
|
-
|
|
13486
|
-
|
|
13487
|
-
|
|
13488
|
-
children: entry.
|
|
13489
|
-
|
|
13490
|
-
|
|
13564
|
+
credit.history.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
13565
|
+
/* @__PURE__ */ jsx("h4", {
|
|
13566
|
+
className: "rb-portal-mt-m",
|
|
13567
|
+
children: "Credit history"
|
|
13568
|
+
}),
|
|
13569
|
+
/* @__PURE__ */ jsx("ul", {
|
|
13570
|
+
className: "rb-portal-uses",
|
|
13571
|
+
"data-portal": "uses",
|
|
13572
|
+
children: credit.history.map((entry) => /* @__PURE__ */ jsxs("li", { children: [/* @__PURE__ */ jsx(Line, { line: entry.line }), /* @__PURE__ */ jsx("span", {
|
|
13573
|
+
className: entry.incoming ? "rb-portal-ok" : "rb-portal-muted",
|
|
13574
|
+
children: entry.amount
|
|
13575
|
+
})] }, entry.key))
|
|
13576
|
+
}),
|
|
13577
|
+
/* @__PURE__ */ jsx("p", {
|
|
13578
|
+
className: "rb-portal-mt-s",
|
|
13579
|
+
"data-portal": "credit-balance",
|
|
13580
|
+
children: /* @__PURE__ */ jsx("strong", { children: credit.balance })
|
|
13581
|
+
})
|
|
13582
|
+
] }) : null
|
|
13491
13583
|
] });
|
|
13492
13584
|
}
|
|
13493
13585
|
//#endregion
|
|
@@ -13930,6 +14022,10 @@ const STATUS_TONE = {
|
|
|
13930
14022
|
problem: "problem",
|
|
13931
14023
|
neutral: "plain"
|
|
13932
14024
|
};
|
|
14025
|
+
/** "So far" only while the order can still take a payment; on a settled order it's simply what they paid. */
|
|
14026
|
+
function paidLabel(toDo) {
|
|
14027
|
+
return toDo.kind === "nothing" ? "Paid" : "Paid so far";
|
|
14028
|
+
}
|
|
13933
14029
|
function totals(page, credit) {
|
|
13934
14030
|
const { order } = page;
|
|
13935
14031
|
const figure = (cents) => moneyFigure({
|
|
@@ -13938,10 +14034,19 @@ function totals(page, credit) {
|
|
|
13938
14034
|
});
|
|
13939
14035
|
return [
|
|
13940
14036
|
...credit ? [[credit.label, credit.amount]] : [],
|
|
13941
|
-
...order.paidCents > 0 ? [[
|
|
14037
|
+
...order.paidCents > 0 ? [[paidLabel(order.toDo), figure(order.paidCents)]] : [],
|
|
13942
14038
|
...order.refundedCents > 0 ? [["Refunded", figure(order.refundedCents)]] : []
|
|
13943
14039
|
];
|
|
13944
14040
|
}
|
|
14041
|
+
/** What's left of what they paid once refunds are taken off, said only when something has been refunded. */
|
|
14042
|
+
function netLine(page) {
|
|
14043
|
+
const { order } = page;
|
|
14044
|
+
if (order.refundedCents <= 0) return null;
|
|
14045
|
+
return `You've paid ${moneyWords({
|
|
14046
|
+
amountCents: Math.max(0, order.paidCents - order.refundedCents),
|
|
14047
|
+
currency: order.currency
|
|
14048
|
+
})} after refunds`;
|
|
14049
|
+
}
|
|
13945
14050
|
function shipment(entry, context, showItems) {
|
|
13946
14051
|
const on = portalSentenceDate(entry.sentAt, context.site, context.now);
|
|
13947
14052
|
const line = [on ? `Posted on ${on}` : "Posted", entry.carrier ? `with ${entry.carrier}` : null].filter(Boolean).join(" ");
|
|
@@ -14000,6 +14105,7 @@ function orderPageModel(page, context) {
|
|
|
14000
14105
|
lines: breakdown.rows,
|
|
14001
14106
|
total: breakdown.total,
|
|
14002
14107
|
totals: totals(page, breakdown.credit),
|
|
14108
|
+
net: netLine(page),
|
|
14003
14109
|
plan: planModel(page, context),
|
|
14004
14110
|
payments: page.payments.map((payment) => ({
|
|
14005
14111
|
key: payment.receiptId,
|
|
@@ -14037,6 +14143,7 @@ function OrderPage({ session, orderId }) {
|
|
|
14037
14143
|
label: "Loading your order"
|
|
14038
14144
|
}),
|
|
14039
14145
|
notFound: /* @__PURE__ */ jsx(NotFound$1, {}),
|
|
14146
|
+
gone: /* @__PURE__ */ jsx(Unfinished, {}),
|
|
14040
14147
|
children: (value) => /* @__PURE__ */ jsx(OrderView, {
|
|
14041
14148
|
page: orderPageModel(value, context),
|
|
14042
14149
|
session,
|
|
@@ -14254,6 +14361,11 @@ function OrderSummary({ page }) {
|
|
|
14254
14361
|
page.totals.length > 0 ? /* @__PURE__ */ jsx("div", {
|
|
14255
14362
|
className: "rb-portal-mt-m rb-portal-order-totals",
|
|
14256
14363
|
children: /* @__PURE__ */ jsx(Facts, { facts: page.totals })
|
|
14364
|
+
}) : null,
|
|
14365
|
+
page.net ? /* @__PURE__ */ jsx("p", {
|
|
14366
|
+
className: "rb-portal-mt-s",
|
|
14367
|
+
"data-portal": "order-net",
|
|
14368
|
+
children: page.net
|
|
14257
14369
|
}) : null
|
|
14258
14370
|
] })
|
|
14259
14371
|
});
|
|
@@ -14486,6 +14598,27 @@ function CustomAmountField({ custom, task, onOpen, onType, onPay }) {
|
|
|
14486
14598
|
]
|
|
14487
14599
|
});
|
|
14488
14600
|
}
|
|
14601
|
+
/** Their own checkout that never finished, which the portal doesn't list. */
|
|
14602
|
+
function Unfinished() {
|
|
14603
|
+
return /* @__PURE__ */ jsxs(PortalCard, { children: [
|
|
14604
|
+
/* @__PURE__ */ jsx("h1", {
|
|
14605
|
+
className: "rb-portal-title",
|
|
14606
|
+
children: "This booking wasn't finished"
|
|
14607
|
+
}),
|
|
14608
|
+
/* @__PURE__ */ jsx("p", {
|
|
14609
|
+
className: "rb-portal-muted rb-portal-mt-s",
|
|
14610
|
+
children: "Nothing was paid, and no place is being held."
|
|
14611
|
+
}),
|
|
14612
|
+
/* @__PURE__ */ jsx("div", {
|
|
14613
|
+
className: "rb-portal-actions",
|
|
14614
|
+
children: /* @__PURE__ */ jsx(PortalPageLink, {
|
|
14615
|
+
className: "rb-portal-link",
|
|
14616
|
+
to: { page: "payments" },
|
|
14617
|
+
children: "Go to your payments"
|
|
14618
|
+
})
|
|
14619
|
+
})
|
|
14620
|
+
] });
|
|
14621
|
+
}
|
|
14489
14622
|
function NotFound$1() {
|
|
14490
14623
|
return /* @__PURE__ */ jsxs(PortalCard, { children: [
|
|
14491
14624
|
/* @__PURE__ */ jsx("h1", {
|
|
@@ -14522,11 +14655,24 @@ const orderLink = (orderId, text) => {
|
|
|
14522
14655
|
target
|
|
14523
14656
|
} : null;
|
|
14524
14657
|
};
|
|
14658
|
+
/** A pay task whose payment has started and is going through, with nothing for them to do. */
|
|
14659
|
+
function isProcessing(task) {
|
|
14660
|
+
if (task.kind !== "pay") return false;
|
|
14661
|
+
switch (task.due.kind) {
|
|
14662
|
+
case "payment_underway": return true;
|
|
14663
|
+
case "pay": return task.due.online.kind === "in_progress";
|
|
14664
|
+
case "instalment_failed":
|
|
14665
|
+
case "finish_paying": return false;
|
|
14666
|
+
}
|
|
14667
|
+
}
|
|
14525
14668
|
function toPayModel(view, context) {
|
|
14526
|
-
const
|
|
14669
|
+
const card = (task) => portalTaskCard(task, view.contact, context);
|
|
14670
|
+
const processing = view.toPay.tasks.filter(isProcessing).map(card);
|
|
14671
|
+
const tasks = view.toPay.tasks.filter((task) => !isProcessing(task)).map(card);
|
|
14527
14672
|
const checking = checkingLine(view.checking, context, "list");
|
|
14528
14673
|
const notes = [...view.toPay.kind === "partly_checked" ? [uncheckedSourcesLine(view.toPay.unchecked, "to pay")] : [], ...checking ? [checking] : []];
|
|
14529
14674
|
return {
|
|
14675
|
+
processing,
|
|
14530
14676
|
tasks,
|
|
14531
14677
|
notes,
|
|
14532
14678
|
nothing: tasks.length === 0 && notes.length === 0 ? "There's nothing to pay right now." : null
|
|
@@ -14590,6 +14736,27 @@ function historyRow(entry, context) {
|
|
|
14590
14736
|
};
|
|
14591
14737
|
}
|
|
14592
14738
|
}
|
|
14739
|
+
/**
|
|
14740
|
+
* Newest first, except that a refund reads after the payment it sends back
|
|
14741
|
+
* when both fall on the same day, so the money going out is never listed
|
|
14742
|
+
* before the money it reverses. The refund moves to just below the
|
|
14743
|
+
* older payment with the receipt it reverses and the same date; everything else keeps
|
|
14744
|
+
* the server's order.
|
|
14745
|
+
*/
|
|
14746
|
+
function refundsAfterTheirPayments(rows) {
|
|
14747
|
+
const reverses = (refund, payment) => refund.entry.kind === "refund" && payment.entry.kind === "payment" && payment.date === refund.date && refund.entry.paymentReceiptId === payment.entry.receiptId;
|
|
14748
|
+
const anchors = rows.map((row, index) => {
|
|
14749
|
+
if (row.entry.kind !== "refund") return index;
|
|
14750
|
+
const payment = rows.findIndex((other, at) => at > index && reverses(row, other));
|
|
14751
|
+
return payment === -1 ? index : payment;
|
|
14752
|
+
});
|
|
14753
|
+
return rows.map((row, index) => ({
|
|
14754
|
+
row,
|
|
14755
|
+
index,
|
|
14756
|
+
anchor: anchors[index] ?? index,
|
|
14757
|
+
after: anchors[index] !== index ? 1 : 0
|
|
14758
|
+
})).sort((a, b) => a.anchor - b.anchor || a.after - b.after || a.index - b.index).map(({ row }) => row);
|
|
14759
|
+
}
|
|
14593
14760
|
function otherOrder(order, context) {
|
|
14594
14761
|
return {
|
|
14595
14762
|
key: order.order.orderId,
|
|
@@ -14604,11 +14771,14 @@ function paymentsPageModel(view, context) {
|
|
|
14604
14771
|
const toPay = toPayModel(view, context);
|
|
14605
14772
|
const plans = partOf(view.plans, ({ plans: list }) => nonEmpty(list.map((plan) => planCard(plan, context))));
|
|
14606
14773
|
const history = partOf(view.history, ({ entries, nextCursor }) => entries.length === 0 ? null : {
|
|
14607
|
-
rows: entries.map((entry) =>
|
|
14774
|
+
rows: refundsAfterTheirPayments(entries.map((entry) => ({
|
|
14775
|
+
entry,
|
|
14776
|
+
date: portalListDate(entry.at, context.site, context.now) ?? ""
|
|
14777
|
+
}))).map(({ entry }) => historyRow(entry, context)),
|
|
14608
14778
|
more: nextCursor !== null
|
|
14609
14779
|
});
|
|
14610
14780
|
const otherOrders = partOf(view.otherOrders, ({ orders }) => nonEmpty(orders.map((order) => otherOrder(order, context))));
|
|
14611
|
-
if (toPay.nothing && plans.kind === "none" && history.kind === "none" && otherOrders.kind === "none") return { kind: "empty" };
|
|
14781
|
+
if (toPay.nothing && toPay.processing.length === 0 && plans.kind === "none" && history.kind === "none" && otherOrders.kind === "none") return { kind: "empty" };
|
|
14612
14782
|
return {
|
|
14613
14783
|
kind: "shown",
|
|
14614
14784
|
toPay,
|
|
@@ -14646,6 +14816,15 @@ function PaymentsPage({ session }) {
|
|
|
14646
14816
|
return /* @__PURE__ */ jsxs("div", {
|
|
14647
14817
|
className: "rb-portal-stack",
|
|
14648
14818
|
children: [
|
|
14819
|
+
page.toPay.processing.length > 0 ? /* @__PURE__ */ jsx(PortalSection, {
|
|
14820
|
+
id: "processing",
|
|
14821
|
+
title: "Being processed",
|
|
14822
|
+
hang: true,
|
|
14823
|
+
children: /* @__PURE__ */ jsx(TaskCards, {
|
|
14824
|
+
tasks: page.toPay.processing,
|
|
14825
|
+
paying: false
|
|
14826
|
+
})
|
|
14827
|
+
}) : null,
|
|
14649
14828
|
/* @__PURE__ */ jsx(PortalSection, {
|
|
14650
14829
|
id: "to-pay",
|
|
14651
14830
|
title: "To pay",
|
|
@@ -14719,13 +14898,10 @@ function payingAction(action) {
|
|
|
14719
14898
|
}
|
|
14720
14899
|
function ToPay({ model }) {
|
|
14721
14900
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
14722
|
-
|
|
14723
|
-
|
|
14724
|
-
|
|
14725
|
-
|
|
14726
|
-
children: /* @__PURE__ */ jsx(TextParts, { parts: task.text })
|
|
14727
|
-
}) : null] }), task.action ? /* @__PURE__ */ jsx(ActionView, { action: payingAction(task.action) }) : null]
|
|
14728
|
-
}) }, task.key)),
|
|
14901
|
+
/* @__PURE__ */ jsx(TaskCards, {
|
|
14902
|
+
tasks: model.tasks,
|
|
14903
|
+
paying: true
|
|
14904
|
+
}),
|
|
14729
14905
|
model.notes.map((note) => /* @__PURE__ */ jsx("p", {
|
|
14730
14906
|
className: "rb-portal-muted",
|
|
14731
14907
|
children: note
|
|
@@ -14736,6 +14912,24 @@ function ToPay({ model }) {
|
|
|
14736
14912
|
}) : null
|
|
14737
14913
|
] });
|
|
14738
14914
|
}
|
|
14915
|
+
/** `paying`: the order link is the one thing to do, so it's the button; a payment already on its way keeps a quiet link. */
|
|
14916
|
+
function TaskCards({ tasks, paying }) {
|
|
14917
|
+
return /* @__PURE__ */ jsx(Fragment, { children: tasks.map((task) => /* @__PURE__ */ jsx(PortalCard, { children: /* @__PURE__ */ jsxs("div", {
|
|
14918
|
+
className: "rb-portal-split",
|
|
14919
|
+
children: [/* @__PURE__ */ jsxs("div", { children: [
|
|
14920
|
+
/* @__PURE__ */ jsx("h3", { children: task.title }),
|
|
14921
|
+
task.text.length > 0 ? /* @__PURE__ */ jsx("p", {
|
|
14922
|
+
className: "rb-portal-muted rb-portal-mt-s",
|
|
14923
|
+
children: /* @__PURE__ */ jsx(TextParts, { parts: task.text })
|
|
14924
|
+
}) : null,
|
|
14925
|
+
task.sub ? /* @__PURE__ */ jsx("p", {
|
|
14926
|
+
className: "rb-portal-muted rb-portal-small rb-portal-mt-s",
|
|
14927
|
+
"data-portal": "todo-sub",
|
|
14928
|
+
children: task.sub
|
|
14929
|
+
}) : null
|
|
14930
|
+
] }), task.action ? /* @__PURE__ */ jsx(ActionView, { action: paying ? payingAction(task.action) : task.action }) : null]
|
|
14931
|
+
}) }, task.key)) });
|
|
14932
|
+
}
|
|
14739
14933
|
const TONE_CLASS = {
|
|
14740
14934
|
ok: "rb-portal-ok",
|
|
14741
14935
|
problem: "rb-portal-problem",
|
|
@@ -15138,10 +15332,6 @@ function newsletterModel(newsletter, contact, context) {
|
|
|
15138
15332
|
}
|
|
15139
15333
|
}
|
|
15140
15334
|
}
|
|
15141
|
-
/** "A", "A and B", "A, B and C". */
|
|
15142
|
-
function listWithAnd(names) {
|
|
15143
|
-
return names.length < 2 ? names.join("") : `${names.slice(0, -1).join(", ")} and ${names.slice(-1).join("")}`;
|
|
15144
|
-
}
|
|
15145
15335
|
const firstFieldError = (errors, field) => errors.find((error) => error.field === field)?.message ?? null;
|
|
15146
15336
|
/** One field at a time, as the rows are edited one at a time. A name can't be blank; a blank phone clears it. */
|
|
15147
15337
|
const profileEditTask = {
|