@riverbankcms/sdk 0.173.0 → 0.174.1
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/README.md +6 -1
- package/dist/_dts/{BlocksIslandsHydrator-O50mTMCY.d.ts → BlocksIslandsHydrator-YRmc-Yxz.d.ts} +1 -1
- package/dist/_dts/{Page-Bk99sJwV.d.ts → Page-Du0zX1B-.d.ts} +27 -16
- package/dist/_dts/{SdkPreviewMode-DzAue6Kj.d.ts → SdkPreviewMode-4L8v3FkY.d.ts} +14 -7
- package/dist/_dts/{client-ZlNEIvlU.d.ts → client-B1J6Akyf.d.ts} +1 -1
- package/dist/_dts/{content-types-DBXPNc0h.d.ts → content-types-CGGYI0u_.d.ts} +2 -2
- package/dist/_dts/{contracts-D9bhu0bb.d.ts → contracts-CHMlw9hT.d.ts} +5 -4
- package/dist/_dts/{footerPageOutline-Bfap3soN.d.ts → footerPageOutline-DIHSU1Vr.d.ts} +6 -6
- package/dist/_dts/{generatePageMetadata-DwCdg31h.d.ts → generatePageMetadata-JITXD6BU.d.ts} +2 -2
- package/dist/_dts/{index-Dq_AboWN.d.ts → index-BLEKFHt1.d.ts} +1 -1
- package/dist/_dts/{index-BnatulTs.d.ts → index-BgOr1Xyz.d.ts} +3 -3
- package/dist/_dts/{index-KXh8FQ2s.d.ts → index-CF62FntA.d.ts} +2 -2
- package/dist/_dts/{index-CJzs-yIJ.d.ts → index-CXZSy_9M.d.ts} +2 -2
- package/dist/_dts/{index-DutLU2d2.d.ts → index-D9ZYmGAJ.d.ts} +2 -1
- package/dist/_dts/{index-DW3eeNph.d.ts → index-DpJm0NpL.d.ts} +4 -4
- package/dist/_dts/{index-C611wjIL.d.ts → index-yWDbUojb.d.ts} +1 -1
- package/dist/_dts/{loadContent-Bde2y870.d.ts → loadContent-M-s0p0rq.d.ts} +11 -11
- package/dist/_dts/{request-Bysk4QPI.d.ts → request-BK-pHf0P.d.ts} +3685 -1762
- package/dist/_dts/{resolveBlockData-ChbNvpSF.d.ts → resolveBlockData-DZAlnhwt.d.ts} +5 -5
- package/dist/_dts/{resolvePageContent-CGa6QMgc.d.ts → resolvePageContent-DXUCWJ3y.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 +9 -9
- 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 +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 +4 -2
- 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 +13 -8
- 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 +36 -204
- package/dist/_dts/{types-BwitGNTl.d.ts → types-CwmB2NHU.d.ts} +7 -7
- package/dist/_dts/{types-BoEk9ZON.d.ts → types-DjVNADXR.d.ts} +3 -3
- package/dist/_dts/{types-kpp8XyXv.d.ts → types-Dmow_FI6.d.ts} +2 -2
- package/dist/_dts/{validation-ChftKX-o.d.ts → validation-h8t1HLlL.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-BnUeSE3d.mjs → BlocksIslandsHydrator-DRVx_XLi.mjs} +17 -17
- package/dist/client/{BookingMailingListNote-LHQMODqB.mjs → BookingMailingListNote-CwrMzj-k.mjs} +10 -10
- package/dist/client/{BookingPanelArrangement-Be704P85.mjs → BookingPanelArrangement-C2_hFT6K.mjs} +1 -1
- package/dist/client/{BookingQuestionFields-BewbU_cV.mjs → BookingQuestionFields-DZMrGvBh.mjs} +3 -3
- package/dist/client/{CalendarNavigationChevron-BMZp3RS3.mjs → CalendarNavigationChevron-Az1-TIEI.mjs} +6 -6
- package/dist/client/{DemoBookingPortalAccess-CARUWQ_E.mjs → DemoBookingPortalAccess-1p-pJ1lg.mjs} +5 -5
- package/dist/client/{EventCalendar.client-CaI6upCX.mjs → EventCalendar.client-CDkkP-Lv.mjs} +9 -9
- package/dist/client/{EventCombined.client-CoRUaYHY.mjs → EventCombined.client-DK3aaz62.mjs} +7 -7
- package/dist/client/{EventItem-Doe4KodB.mjs → EventItem-WeUipfIP.mjs} +4 -4
- package/dist/client/{EventListWeekNavigation-CXWLKDfa.mjs → EventListWeekNavigation-D3sbAeDo.mjs} +1 -1
- package/dist/client/{EventListing.client-DvJ5tGTx.mjs → EventListing.client-DL3gGGmF.mjs} +3 -3
- package/dist/client/{EventListing.view-BmfyK7S5.mjs → EventListing.view-DKFImKOx.mjs} +6 -6
- package/dist/client/{EventRegistrationPayment-DwMlJB2V.mjs → EventRegistrationPayment-Dn9TpWyL.mjs} +45 -18
- package/dist/client/{LocationMapActions-CdRPU6gp.mjs → LocationMapActions-BJT7MqP2.mjs} +1 -1
- package/dist/client/{MapDrawingSvg-DCLtxOnt.mjs → MapDrawingSvg-DCIwlON6.mjs} +1 -1
- package/dist/client/{Page-D46Dmr7b.mjs → Page-BpeP9xdt.mjs} +731 -1549
- package/dist/client/{StepIndicator-CrSZCZn1.mjs → StepIndicator-CP6zrwkl.mjs} +6 -242
- package/dist/client/{accessibleSurfaces-D4DhWo9j.mjs → accessibleSurfaces-DN8it_Cx.mjs} +35 -7
- package/dist/client/{accordion-P8xcfKxq.mjs → accordion-nR7D4m1a.mjs} +1 -1
- package/dist/client/{booking-form.client-BM2s-NqR.mjs → booking-form.client-Ce-mQZ7W.mjs} +362 -47
- package/dist/client/{bookingForm-JnaZPZge.mjs → bookingForm-B-qT_AQB.mjs} +4 -4
- package/dist/client/bookings.mjs +6 -6
- package/dist/client/{boxStyleClassNames-Cahps5kR.mjs → boxStyleClassNames-CrE3TDpW.mjs} +2 -29
- package/dist/client/{carousel-CQQ_m0KA.mjs → carousel-CVUOatsY.mjs} +1 -1
- package/dist/client/{cart-0Q4fjw_K.mjs → cart-DE0K6E0R.mjs} +3 -3
- package/dist/client/{cart.client-BI0IaHX3.mjs → cart.client-C23E6WQ5.mjs} +1 -1
- package/dist/client/{checkout-1J-3ftxF.mjs → checkout-76cdHyPL.mjs} +3 -3
- package/dist/client/{checkout.client-DOGYDlDk.mjs → checkout.client-DJOzqb26.mjs} +1 -1
- package/dist/client/{checkoutUrls-CwHqcqzP.mjs → checkoutUrls-CvIP5DCO.mjs} +1 -1
- package/dist/client/client.mjs +159 -7
- package/dist/client/{context-D0KCgbOq.mjs → context-CNlesLfF.mjs} +1 -1
- package/dist/client/{course-CmOuoZHN.mjs → course-DHIrXqNT.mjs} +2 -2
- package/dist/client/{creditProducts-BTRX4edc.mjs → creditProducts-KYMVIH3J.mjs} +2 -84
- package/dist/client/{dateFormatting-Dmfaczzq.mjs → dateFormatting-B73Ll0s4.mjs} +9 -1
- package/dist/client/{demoPortalMagicLink-CL7KGRta.mjs → demoPortalMagicLink-BVbLD4pi.mjs} +1 -1
- package/dist/client/{display-lL-YRApN.mjs → display-Cf_j5stk.mjs} +2574 -763
- package/dist/client/{enhanceHeaderSection-B-eLGs2C.mjs → enhanceHeaderSection-5GD5o4Mt.mjs} +3 -3
- package/dist/client/{event-details.client-DH1-Jxsh.mjs → event-details.client-D7Oz1q2L.mjs} +1 -1
- package/dist/client/{event-registration.client-GuuElczW.mjs → event-registration.client-zbuX36aA.mjs} +137 -131
- package/dist/client/{eventCalendar-BiCINPkV.mjs → eventCalendar-uZrksODt.mjs} +4 -4
- package/dist/client/{eventCombined-BtzmH6FW.mjs → eventCombined-DxhvNAx8.mjs} +4 -4
- package/dist/client/{eventDetails-BJpAD10-.mjs → eventDetails-DCIH4BYG.mjs} +2 -2
- package/dist/client/{eventListing-jLB8iRqp.mjs → eventListing-B9KrnPvc.mjs} +4 -4
- package/dist/client/{eventRegistration-WhtpDEbq.mjs → eventRegistration-TjnURMKl.mjs} +4 -4
- package/dist/client/{form-DO6qKH3M.mjs → form-CfqIAhfN.mjs} +3 -3
- package/dist/client/{form.client-D12ljYiX.mjs → form.client-CL6fF0cW.mjs} +6 -6
- package/dist/client/{form.parts-C8QHaQOI.mjs → form.parts-Bf-L66Gg.mjs} +1 -1
- package/dist/client/{formatDate-BnhfIpCa.mjs → formatDate-Dp7POa9Y.mjs} +1 -1
- package/dist/client/gifting/client.mjs +2 -2
- package/dist/client/{headerSection-BtFWtoUm.mjs → headerSection-WVXtOcuW.mjs} +2 -2
- package/dist/client/{newsletter-form.client-oHrqM_Ao.mjs → newsletter-form.client-Bb7GAZpO.mjs} +9 -7
- package/dist/client/{newsletter-form.parts-D5U-FuVy.mjs → newsletter-form.parts-BqOVRdIc.mjs} +1 -1
- package/dist/client/{newsletterForm-CBYbFxSx.mjs → newsletterForm-DOVe-qY3.mjs} +3 -3
- package/dist/client/{noop-CN0o0yjH.mjs → noop-D5mFWXtN.mjs} +30 -6
- package/dist/client/portal/client.mjs +346 -272
- package/dist/client/{product-detail.client-d_sNCapC.mjs → product-detail.client-CNzeFnFf.mjs} +1 -1
- package/dist/client/{product-list.client-DkSpw6WQ.mjs → product-list.client-LKpzC7pj.mjs} +1 -1
- package/dist/client/{productDetail-DaqM-LgL.mjs → productDetail-D2JNeEgx.mjs} +3 -3
- package/dist/client/{productList-CMx4-XlG.mjs → productList-DTgZXOEq.mjs} +3 -3
- package/dist/client/{propsDecoder-BZbUKstC.mjs → propsDecoder-mpBQt2AT.mjs} +3 -3
- package/dist/client/{registry.server-Cdot3dMk.mjs → registry.server-DdTJyar2.mjs} +31 -47
- package/dist/client/rendering/client.mjs +26 -26
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +16 -13
- package/dist/client/{richText-coerce-ByApwB4q.mjs → richText-coerce-C32cRQ03.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-DTET8f__.mjs → routeIslandApiConfig-8cfSgT0E.mjs} +1 -1
- package/dist/client/{runtimeResponse-IkOwKZD0.mjs → runtimeResponse-9v8q2NBc.mjs} +1 -1
- package/dist/client/runtimeResponse-CVkM0dHy.mjs +3 -0
- package/dist/client/{shop-Cy6xXDM7.mjs → shop-5LBhftWx.mjs} +3 -3
- package/dist/client/{shop-commerce-oDR76k1q.mjs → shop-commerce-DkValjZj.mjs} +12 -12
- package/dist/client/{shop-commerce-store-DjoUpL3a.mjs → shop-commerce-store-BOmXFmk_.mjs} +1 -1
- package/dist/client/{shop-discount-apply.state-WsGb9DD8.mjs → shop-discount-apply.state-D0ifS6KX.mjs} +2 -2
- package/dist/client/{shop.client-Brha4BSM.mjs → shop.client-BTtZqNmv.mjs} +13 -13
- package/dist/client/{shop.interactive-CXhYl0DW.mjs → shop.interactive-DNRqG4aX.mjs} +18 -24
- package/dist/client/{shopShared-JCa_SRhP.mjs → shopShared-Nky6kPYr.mjs} +2 -2
- package/dist/client/{timetableModel-CZeJwMxP.mjs → timetableModel-DZArznD_.mjs} +25 -152
- package/dist/client/{useAvailableSlots-DfbSkWop.mjs → useAvailableSlots-CUVRD1nx.mjs} +24 -4
- package/dist/client/{useDiscountApply-Dq-wjb1d.mjs → useDiscountApply-BBnStWXU.mjs} +1 -1
- package/dist/client/{useDiscountCodeUi-Cyy0meCH.mjs → useDiscountCodeUi-d7viY_mu.mjs} +1 -1
- package/dist/client/{useEventPagination-CCAGQHsD.mjs → useEventPagination-Da2JqxGC.mjs} +6 -6
- package/dist/client/{view-Sw075FOY.mjs → view-BvuYmQJ5.mjs} +2 -2
- package/dist/client/{view-D6yebI4r.mjs → view-D9ObkFtz.mjs} +12 -11
- package/dist/preview-next/client/{LocationPickerEnvironment-D4F_5rnr.mjs → LocationPickerEnvironment-8iKKoYZr.mjs} +1 -1
- package/dist/preview-next/client/{MapLibreEditMap-BKMNxSEJ.mjs → MapLibreEditMap-AIUPN1Zx.mjs} +2 -2
- package/dist/preview-next/client/{PageSectionToolbar-DG2rXUmo.mjs → PageSectionToolbar-DwxHT-2k.mjs} +57 -144
- package/dist/preview-next/client/{PreviewEditorSidebar-BDY5vdHU.mjs → PreviewEditorSidebar-D4SBxGU6.mjs} +758 -1279
- package/dist/preview-next/client/{PreviewEditorUI-CqZCfOaz.mjs → PreviewEditorUI-D8mUct32.mjs} +29 -26
- package/dist/preview-next/client/{PreviewShell-Bv2HZ7JY.mjs → PreviewShell-L2AEdNUQ.mjs} +50 -30
- package/dist/preview-next/client/{SdkPreviewModeRuntime-BMTcR-MW.mjs → SdkPreviewModeRuntime-bhVAU2D2.mjs} +47 -19
- package/dist/preview-next/client/{lucide-react-BCNn8dEQ.mjs → lucide-react-Dfgl3Vtq.mjs} +7 -1
- package/dist/preview-next/client/{previewAssistantSlot-La6MerV_.mjs → previewAssistantSlot-Jpj_HDra.mjs} +101003 -51855
- package/dist/preview-next/client/{previewChromeRoot-BcOQqJIP.mjs → previewChromeRoot-CYTDvx4u.mjs} +1 -1
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-BkckHox4.mjs → sdk-runtime-CZHX6J_4.mjs} +2 -2
- package/dist/preview-next/client/siteStyleAccess-DmGIG9Hk.mjs +9356 -0
- package/dist/preview-next/client/{useAutosaveStatus-CPAHgGqI.mjs → useAutosaveStatus-DQCyswQ-.mjs} +2 -2
- package/dist/preview-next/client/{useOpenBlockForSetup-BDkuSZxQ.mjs → useOpenBlockForSetup-LwE5yXvL.mjs} +19 -4
- package/dist/preview-next/container-responsive.css +117 -32
- package/dist/preview-next/keepAlive.mjs +1 -1
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-CPV30ABr.mjs → route-contract-BOuNcOcN.mjs} +153 -2
- package/dist/server/{Block.shared-BaMMstO1.mjs → Block.shared-wfJfhs08.mjs} +10 -5
- package/dist/server/{ThemeScopeCore-D1NTXZdX.mjs → ThemeScopeCore-BtrJNHTB.mjs} +23 -6
- package/dist/server/{accessibleSurfaces-Dbd2__Le.mjs → accessibleSurfaces-CM3QANtw.mjs} +22 -5
- package/dist/server/{bindings-Dge4sqel.mjs → bindings-P1CF2Gm6.mjs} +6 -4
- package/dist/server/{client-VVIQjC4r.mjs → client-CGtU5fHI.mjs} +156 -4
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/customCss-BGB8gMVb.mjs +210 -0
- package/dist/server/data/resolveBlockData.mjs +1 -1
- package/dist/server/index.mjs +2 -2
- package/dist/server/{loadContent-BIJb3WAK.mjs → loadContent-ChnkJSay.mjs} +8 -9
- package/dist/server/{loadPage-DjTU19y7.mjs → loadPage-DesHhgxj.mjs} +3 -3
- package/dist/server/lookMediaFrame-BBr0mkze.mjs +2626 -0
- package/dist/server/manifest.mjs +2 -2
- package/dist/server/next.mjs +9 -8
- package/dist/server/{overrideResolution-1Ru3NMQj.mjs → overrideResolution-DHEkHcZs.mjs} +3 -4
- package/dist/server/page-converter.mjs +2 -2
- package/dist/server/{pageRenderPlan-CytPhrI9.mjs → pageRenderPlan-0jvm0RBk.mjs} +29 -331
- package/dist/server/{pageRuntimeSupport-DWspU5EZ.mjs → pageRuntimeSupport-8-f1Zr9e.mjs} +14 -6
- package/dist/server/{pageShared-Bhx8bVe1.mjs → pageShared-CuVFoV4z.mjs} +370 -291
- package/dist/server/{parseThemeForPersistence-CtgRtvo3.mjs → parseThemeForPersistence-Cwqb5pZx.mjs} +2 -2
- package/dist/server/{portal-Ce1Prfl3.mjs → portal-BjVHMAUC.mjs} +1 -1
- package/dist/server/portal.mjs +1 -1
- package/dist/server/{prebuild-BjvFb0CA.mjs → prebuild-Bms_Y7wQ.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-Db3stNpp.mjs → prefetchBlockData-5oC5kyHe.mjs} +2 -2
- package/dist/server/{registry-BMCfcev6.mjs → registry-DmqxC8th.mjs} +1258 -3166
- 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 +2 -2
- package/dist/server/rendering/server.mjs +3 -3
- package/dist/server/rendering.mjs +7 -7
- package/dist/server/{resolveBlockData--yUbI-Ll.mjs → resolveBlockData-EYogtwQc.mjs} +1 -1
- package/dist/server/{resolveButtonColourStates-CCPUY9Xh.mjs → resolveButtonColourStates--6yJp9Tq.mjs} +15 -4
- package/dist/server/{schema-D5Vfmqzw.mjs → schema-CUDHMirj.mjs} +46 -153
- package/dist/server/server.mjs +3 -3
- package/dist/server/{src-Cxucn-1P.mjs → src-DHK4JUlp.mjs} +4 -1
- package/dist/server/theme-bridge.mjs +21 -15
- package/dist/server/theme.mjs +2 -2
- package/dist/server/{three-pass-converter-Bsfdy_ZV.mjs → three-pass-converter-39SXCCnh.mjs} +1 -1
- package/dist/server/{titleSourceSchema-DwKJfMYb.mjs → titleSourceSchema-Cu-3PRvv.mjs} +0 -1
- package/dist/server/{validation-EgTtnTcY.mjs → validation-Bt_8IL1g.mjs} +4 -4
- package/dist/server/{version-LjgU0Cq1.mjs → version-DT_efohp.mjs} +1 -1
- package/dist/styles/index.css +989 -279
- package/package.json +1 -1
- package/dist/client/bookability-SargNwlO.mjs +0 -17
- package/dist/client/runtimeResponse-Wd6kwhE_.mjs +0 -3
- package/dist/preview-next/client/SiteChromeCustomizeButton-D1MGyN_Z.mjs +0 -55403
- package/dist/server/customCss-QymcmOZ-.mjs +0 -97
- package/dist/server/opaqueSurface-COEKXVwk.mjs +0 -54
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client";
|
|
3
|
-
import { fn as
|
|
4
|
-
import {
|
|
3
|
+
import { fn as parsePositiveMoneyInputToCents, mn as formatCurrencyAmount, t as logger } from "../noop-D5mFWXtN.mjs";
|
|
4
|
+
import { A as assertNever$1, M as unsafeAsAppointmentResourceId, S as formatCreditProductUnits, T as formatOrderInstalmentStatusLabel$1, c as initialBookingQuestionValues, f as unansweredRequiredBookingQuestions, i as UNANSWERED_QUESTION_MESSAGE, n as getCreditProductTypeLabel, p as assertNever, r as UNANSWERED_QUESTIONS_SUMMARY, t as deriveCreditProductLabels, x as formatCreditProductBalance } from "../creditProducts-KYMVIH3J.mjs";
|
|
5
5
|
import { t as generateUuidV4 } from "../uuid-BETKW8rS.mjs";
|
|
6
|
-
import {
|
|
6
|
+
import { n as useAvailableDates, s as clientPersonPhrases, t as useAvailableSlots } from "../useAvailableSlots-CUVRD1nx.mjs";
|
|
7
|
+
import { a as createBlockApi, i as BlockApiError, n as useBlockApi, t as BlockApiProvider } from "../context-CNlesLfF.mjs";
|
|
7
8
|
import { S as clsx, i as ThemedButtonLink, l as SpinnerNode, o as ThemedFileChooser, r as ThemedButton, t as ThemedActionsButton } from "../ThemedButton-DuaYtnvG.mjs";
|
|
8
9
|
import { t as resolveDedicatedBookingHref } from "../bookingRoute-D6DlxYx6.mjs";
|
|
9
|
-
import { a as DemoPortalSignInLink, i as useBookingNowIso, r as parseBookingSubmissionFailure, t as BookingQuestionFields } from "../BookingQuestionFields-
|
|
10
|
+
import { a as DemoPortalSignInLink, i as useBookingNowIso, r as parseBookingSubmissionFailure, t as BookingQuestionFields } from "../BookingQuestionFields-DZMrGvBh.mjs";
|
|
10
11
|
import { t as ModalShell } from "../ModalShell-B_fHWK71.mjs";
|
|
11
12
|
import { t as TabBarFragment } from "../TabBarFragment-BqfRLojo.mjs";
|
|
12
|
-
import { t as formatDate } from "../formatDate-
|
|
13
|
-
import { n as
|
|
14
|
-
import { n as
|
|
15
|
-
import { a as formatPortalSessionDay, c as isPast, i as formatPortalSession, l as portalSessionDisplay, n as formatDateTime, o as formatPortalSessionTime, r as formatEntitlementEnd, s as formatPortalSessionWithWeekday, t as formatDate$1 } from "../dateFormatting-Dmfaczzq.mjs";
|
|
13
|
+
import { t as formatDate } from "../formatDate-Dp7POa9Y.mjs";
|
|
14
|
+
import { n as buildPortalCallbackUrl, r as requestDemoPortalMagicLink } from "../demoPortalMagicLink-BVbLD4pi.mjs";
|
|
15
|
+
import { a as formatPortalSessionDay, c as isPast, i as formatPortalSession, l as portalSessionDisplay, n as formatDateTime, o as formatPortalSessionTime, r as formatEntitlementEnd, s as formatPortalSessionWithWeekday, t as formatDate$1 } from "../dateFormatting-B73Ll0s4.mjs";
|
|
16
16
|
import * as React$1 from "react";
|
|
17
17
|
import React, { createContext, forwardRef, useCallback, useContext, useEffect, useId, useMemo, useReducer, useRef, useState } from "react";
|
|
18
18
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
19
|
+
//#region ../core/src/booking-refunds.ts
|
|
20
|
+
/** A refund cut-off as a span of time: "24 hours", "2 days", "1 hour". */
|
|
21
|
+
function formatCancellationCutoffSpan(cutoffHours) {
|
|
22
|
+
if (cutoffHours > 24 && cutoffHours % 24 === 0) return `${cutoffHours / 24} days`;
|
|
23
|
+
return cutoffHours === 1 ? "1 hour" : `${cutoffHours} hours`;
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
19
26
|
//#region ../core/src/appointment-lifecycle.ts
|
|
20
27
|
const appointmentStatusLabels = {
|
|
21
28
|
requested: "Waiting for approval",
|
|
@@ -29,6 +36,23 @@ function appointmentStatusLabel(status) {
|
|
|
29
36
|
return appointmentStatusLabels[status];
|
|
30
37
|
}
|
|
31
38
|
//#endregion
|
|
39
|
+
//#region ../blocks/src/customer-portal/businessPerson.tsx
|
|
40
|
+
const PortalBusinessPersonContext = createContext(clientPersonPhrases(null));
|
|
41
|
+
/**
|
|
42
|
+
* What the business calls the people clients book with ("trainer"), for the
|
|
43
|
+
* portal's wording. Hosts pass the site's noun; without one, or where the
|
|
44
|
+
* business names nobody, the copy leaves the noun out ("Choose someone else").
|
|
45
|
+
*/
|
|
46
|
+
function PortalBusinessPersonProvider({ person, children }) {
|
|
47
|
+
return /* @__PURE__ */ jsx(PortalBusinessPersonContext.Provider, {
|
|
48
|
+
value: clientPersonPhrases(person),
|
|
49
|
+
children
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function usePortalBusinessPerson() {
|
|
53
|
+
return useContext(PortalBusinessPersonContext);
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
32
56
|
//#region ../blocks/src/customer-portal/dateDisplay.tsx
|
|
33
57
|
const PortalDateContext = createContext(null);
|
|
34
58
|
/** Hosts supply business context and one SSR snapshot; the existing clock owns reconciliation. */
|
|
@@ -510,16 +534,50 @@ async function requestPortalLogin(api, email, returnPath, callbackPath) {
|
|
|
510
534
|
}
|
|
511
535
|
//#endregion
|
|
512
536
|
//#region ../blocks/src/customer-portal/components/PortalLoginForm.tsx
|
|
537
|
+
const RESEND_WAIT_SECONDS = 60;
|
|
538
|
+
function useResendWait() {
|
|
539
|
+
const [left, setLeft] = React.useState(RESEND_WAIT_SECONDS);
|
|
540
|
+
React.useEffect(() => {
|
|
541
|
+
if (left <= 0) return;
|
|
542
|
+
const timer = setTimeout(() => setLeft((value) => value - 1), 1e3);
|
|
543
|
+
return () => clearTimeout(timer);
|
|
544
|
+
}, [left]);
|
|
545
|
+
return [left, () => setLeft(RESEND_WAIT_SECONDS)];
|
|
546
|
+
}
|
|
547
|
+
function PortalLinkSent(props) {
|
|
548
|
+
const [left, restart] = useResendWait();
|
|
549
|
+
const [sending, setSending] = React.useState(false);
|
|
550
|
+
const resend = async () => {
|
|
551
|
+
setSending(true);
|
|
552
|
+
try {
|
|
553
|
+
await props.onResend();
|
|
554
|
+
} finally {
|
|
555
|
+
setSending(false);
|
|
556
|
+
restart();
|
|
557
|
+
}
|
|
558
|
+
};
|
|
559
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
|
|
560
|
+
className: "cp-alert cp-alert--success",
|
|
561
|
+
role: "status",
|
|
562
|
+
children: [
|
|
563
|
+
"We’ve sent a sign-in link to ",
|
|
564
|
+
/* @__PURE__ */ jsx("strong", { children: props.email }),
|
|
565
|
+
". It can take a minute to arrive, so check your spam or junk folder too. The link works for an hour."
|
|
566
|
+
]
|
|
567
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
568
|
+
type: "button",
|
|
569
|
+
className: "cp-login__reset-link",
|
|
570
|
+
disabled: left > 0 || sending,
|
|
571
|
+
onClick: () => void resend(),
|
|
572
|
+
children: sending ? "Sending…" : left > 0 ? `Send it again in ${left}s` : "Send it again"
|
|
573
|
+
})] });
|
|
574
|
+
}
|
|
513
575
|
function PortalLoginSuccess(props) {
|
|
514
576
|
return /* @__PURE__ */ jsxs("div", {
|
|
515
577
|
className: "cp-login__success",
|
|
516
|
-
children: [props.demoSignInUrl ? /* @__PURE__ */ jsx(DemoPortalSignInLink, { url: props.demoSignInUrl }) : /* @__PURE__ */
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
"We have sent an email to ",
|
|
520
|
-
props.email,
|
|
521
|
-
" with a magic link - just click it to login to your account."
|
|
522
|
-
]
|
|
578
|
+
children: [props.demoSignInUrl ? /* @__PURE__ */ jsx(DemoPortalSignInLink, { url: props.demoSignInUrl }) : /* @__PURE__ */ jsx(PortalLinkSent, {
|
|
579
|
+
email: props.email,
|
|
580
|
+
onResend: props.onResend
|
|
523
581
|
}), /* @__PURE__ */ jsx("button", {
|
|
524
582
|
type: "button",
|
|
525
583
|
className: "cp-login__reset-link",
|
|
@@ -532,6 +590,7 @@ function PortalLoginFeedback(props) {
|
|
|
532
590
|
if (!props.error && !props.demoRefusalMessage) return null;
|
|
533
591
|
return /* @__PURE__ */ jsxs(Fragment, { children: [props.error ? /* @__PURE__ */ jsx("div", {
|
|
534
592
|
className: "cp-alert cp-alert--error",
|
|
593
|
+
role: "alert",
|
|
535
594
|
children: props.error
|
|
536
595
|
}) : null, props.demoRefusalMessage ? /* @__PURE__ */ jsx("div", {
|
|
537
596
|
className: "cp-alert cp-alert--error",
|
|
@@ -543,35 +602,45 @@ function getDemoRefusalMessage(status) {
|
|
|
543
602
|
return status.tag === "demo_refused" ? status.message : null;
|
|
544
603
|
}
|
|
545
604
|
function getDefaultLoginButtonText(demoEmailSuppressed) {
|
|
546
|
-
return demoEmailSuppressed ? "Get sign-in link" : "
|
|
605
|
+
return demoEmailSuppressed ? "Get sign-in link" : "Email me a sign-in link";
|
|
547
606
|
}
|
|
548
607
|
function PortalLoginEmailHint({ demoEmailSuppressed }) {
|
|
549
608
|
return demoEmailSuppressed ? null : /* @__PURE__ */ jsx("p", {
|
|
550
609
|
className: "cp-login__helper",
|
|
551
|
-
children: "
|
|
610
|
+
children: "We’ll email you a link that signs you in. There’s no password to remember."
|
|
552
611
|
});
|
|
553
612
|
}
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
613
|
+
function loginFailureMessage(error) {
|
|
614
|
+
return (typeof error === "object" && error !== null && "status" in error ? error.status : null) === 429 ? "You’ve asked for a few links in a row. Wait a minute, then try again." : "We couldn’t send the link just now. Try again in a moment.";
|
|
615
|
+
}
|
|
616
|
+
async function sendPortalLogin(props, email) {
|
|
557
617
|
props.dispatch({ type: "login-started" });
|
|
558
618
|
try {
|
|
559
|
-
props.dispatch(await requestPortalLogin(props.api,
|
|
619
|
+
props.dispatch(await requestPortalLogin(props.api, email, props.returnPath, props.callbackPath));
|
|
560
620
|
} catch (error) {
|
|
561
621
|
console.error("Login error:", error);
|
|
562
622
|
props.dispatch({
|
|
563
623
|
type: "login-failed",
|
|
564
|
-
message: error
|
|
624
|
+
message: loginFailureMessage(error)
|
|
565
625
|
});
|
|
566
626
|
}
|
|
567
627
|
}
|
|
628
|
+
async function submitPortalLogin(event, props) {
|
|
629
|
+
event.preventDefault();
|
|
630
|
+
if (!props.state.email || props.state.status.tag === "submitting") return;
|
|
631
|
+
await sendPortalLogin(props, props.state.email);
|
|
632
|
+
}
|
|
568
633
|
function PortalLoginForm(props) {
|
|
569
634
|
const status = props.state.status;
|
|
570
|
-
if (status.tag === "sent" || status.tag === "demo_link")
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
635
|
+
if (status.tag === "sent" || status.tag === "demo_link") {
|
|
636
|
+
const sentTo = status.email;
|
|
637
|
+
return /* @__PURE__ */ jsx(PortalLoginSuccess, {
|
|
638
|
+
email: sentTo,
|
|
639
|
+
demoSignInUrl: status.tag === "demo_link" ? status.url : void 0,
|
|
640
|
+
onResend: () => sendPortalLogin(props, sentTo),
|
|
641
|
+
onReset: () => props.dispatch({ type: "login-reset" })
|
|
642
|
+
});
|
|
643
|
+
}
|
|
575
644
|
const submitting = status.tag === "submitting";
|
|
576
645
|
return /* @__PURE__ */ jsxs("form", {
|
|
577
646
|
className: "cp-login__form",
|
|
@@ -588,10 +657,10 @@ function PortalLoginForm(props) {
|
|
|
588
657
|
}),
|
|
589
658
|
/* @__PURE__ */ jsx(ThemedButton, {
|
|
590
659
|
type: "submit",
|
|
591
|
-
disabled: submitting
|
|
660
|
+
disabled: submitting,
|
|
592
661
|
variant: "default",
|
|
593
662
|
size: "md",
|
|
594
|
-
label: submitting ? "Sending
|
|
663
|
+
label: submitting ? "Sending…" : props.loginButtonText ?? getDefaultLoginButtonText(props.demoEmailSuppressed)
|
|
595
664
|
})
|
|
596
665
|
]
|
|
597
666
|
});
|
|
@@ -607,6 +676,7 @@ function PortalLoginEmailField(props) {
|
|
|
607
676
|
}), /* @__PURE__ */ jsx("input", {
|
|
608
677
|
id: inputId,
|
|
609
678
|
type: "email",
|
|
679
|
+
autoComplete: "email",
|
|
610
680
|
className: "form-input",
|
|
611
681
|
placeholder: "you@example.com",
|
|
612
682
|
value: props.state.email,
|
|
@@ -690,51 +760,12 @@ function orderFilterLabel(filter) {
|
|
|
690
760
|
case "memberships": return "Memberships";
|
|
691
761
|
}
|
|
692
762
|
}
|
|
693
|
-
function
|
|
694
|
-
switch (
|
|
695
|
-
case "
|
|
696
|
-
case "
|
|
697
|
-
case "
|
|
698
|
-
case "
|
|
699
|
-
case "cancelled": return "default";
|
|
700
|
-
case "failed": return "error";
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
function getOrderPaymentStateBadgeVariant(paymentState) {
|
|
704
|
-
switch (paymentState.kind) {
|
|
705
|
-
case "unpaid":
|
|
706
|
-
case "partially_paid": return "warning";
|
|
707
|
-
case "paid": return "success";
|
|
708
|
-
case "waived": return "info";
|
|
709
|
-
case "not_required": return "info";
|
|
710
|
-
case "refunded": return "default";
|
|
711
|
-
case "collection_failed": return "error";
|
|
712
|
-
case "cancelled": return "default";
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
function formatOrderPaymentStateLabel(paymentState) {
|
|
716
|
-
switch (paymentState.kind) {
|
|
717
|
-
case "unpaid": return "Amount due";
|
|
718
|
-
case "partially_paid": return "Partially paid";
|
|
719
|
-
case "paid": switch (paymentState.settledVia) {
|
|
720
|
-
case "manual": return "Paid offline";
|
|
721
|
-
case "store_credit": return "Paid with credit";
|
|
722
|
-
case "pass_redemption": return "Covered by pass or package";
|
|
723
|
-
case "membership_access": return "Covered by membership";
|
|
724
|
-
case "free": return "No payment due";
|
|
725
|
-
case "mixed":
|
|
726
|
-
case "stripe": return "Paid";
|
|
727
|
-
}
|
|
728
|
-
case "waived": return "Payment waived";
|
|
729
|
-
case "not_required": switch (paymentState.reason) {
|
|
730
|
-
case "waived": return "Payment waived";
|
|
731
|
-
case "pass": return "Covered by pass or package";
|
|
732
|
-
case "membership": return "Covered by membership";
|
|
733
|
-
case "free": return "No payment due";
|
|
734
|
-
}
|
|
735
|
-
case "refunded": return "Refunded";
|
|
736
|
-
case "collection_failed": return "Payment failed";
|
|
737
|
-
case "cancelled": return "Cancelled";
|
|
763
|
+
function getOrderPaymentBadgeVariant(tone) {
|
|
764
|
+
switch (tone) {
|
|
765
|
+
case "success": return "success";
|
|
766
|
+
case "attention": return "warning";
|
|
767
|
+
case "problem": return "error";
|
|
768
|
+
case "neutral": return "default";
|
|
738
769
|
}
|
|
739
770
|
}
|
|
740
771
|
function formatOrderInstalmentStatusLabel(instalment) {
|
|
@@ -800,9 +831,17 @@ function isUnavailableBeforeYouComeTask(task) {
|
|
|
800
831
|
}
|
|
801
832
|
//#endregion
|
|
802
833
|
//#region ../blocks/src/customer-portal/components/badge.tsx
|
|
803
|
-
|
|
834
|
+
/** `sentence` keeps a whole line of wording readable: normal case, and free to wrap on a phone. */
|
|
835
|
+
const SENTENCE_STYLE = {
|
|
836
|
+
textTransform: "none",
|
|
837
|
+
whiteSpace: "normal",
|
|
838
|
+
borderRadius: "0.5rem",
|
|
839
|
+
letterSpacing: "normal"
|
|
840
|
+
};
|
|
841
|
+
function Badge({ variant, sentence = false, children }) {
|
|
804
842
|
return /* @__PURE__ */ jsx("span", {
|
|
805
843
|
className: `cp-badge cp-badge--${variant}`,
|
|
844
|
+
style: sentence ? SENTENCE_STYLE : void 0,
|
|
806
845
|
children
|
|
807
846
|
});
|
|
808
847
|
}
|
|
@@ -8043,7 +8082,7 @@ function getAppointmentReschedulePractitionerName(resourceId, resources) {
|
|
|
8043
8082
|
function getAppointmentRescheduleSelectionLabel(selection, resources) {
|
|
8044
8083
|
switch (selection.kind) {
|
|
8045
8084
|
case "any": return null;
|
|
8046
|
-
case "specific": return getAppointmentReschedulePractitionerName(selection.practitionerId, resources) ?? "
|
|
8085
|
+
case "specific": return getAppointmentReschedulePractitionerName(selection.practitionerId, resources) ?? "the person you chose";
|
|
8047
8086
|
}
|
|
8048
8087
|
}
|
|
8049
8088
|
function resolveAppointmentRescheduleSelectedSlot(slots, selection) {
|
|
@@ -8051,18 +8090,23 @@ function resolveAppointmentRescheduleSelectedSlot(slots, selection) {
|
|
|
8051
8090
|
if (!selectedSlot) return null;
|
|
8052
8091
|
return slots.find((slot) => slot.startAt === selectedSlot.startAt && slot.endAt === selectedSlot.endAt && slot.resourceId === selectedSlot.resourceId) ?? null;
|
|
8053
8092
|
}
|
|
8093
|
+
/** On a one-person site there's nobody else to offer. */
|
|
8094
|
+
function hasOtherPractitioner(resources, currentResourceId) {
|
|
8095
|
+
return resources.some((resource) => resource.id !== currentResourceId);
|
|
8096
|
+
}
|
|
8054
8097
|
function resolveAppointmentRescheduleViewState(input) {
|
|
8055
|
-
const
|
|
8098
|
+
const ifSomeoneElse = (sentence) => hasOtherPractitioner(input.resources, input.currentResourceId) ? sentence : "";
|
|
8099
|
+
const currentPractitionerStillOffersService = input.currentResourceId != null && input.resources.some((resource) => resource.id === input.currentResourceId);
|
|
8056
8100
|
if (input.practitionerSelection == null) {
|
|
8057
8101
|
if (!input.resourcesLoading && input.currentResourceId != null && !currentPractitionerStillOffersService) return {
|
|
8058
8102
|
kind: "original-practitioner-requires-switch",
|
|
8059
8103
|
reason: "current-practitioner-missing-service",
|
|
8060
|
-
message: `This service is no longer available with ${input.currentPractitionerLabel}
|
|
8104
|
+
message: `This service is no longer available with ${input.currentPractitionerLabel}.${ifSomeoneElse(" You can still reschedule with someone else.")}`
|
|
8061
8105
|
};
|
|
8062
8106
|
if (!input.resourcesLoading && currentPractitionerStillOffersService && !input.datesLoading && input.availableDateCount === 0) return {
|
|
8063
8107
|
kind: "original-practitioner-requires-switch",
|
|
8064
8108
|
reason: "current-practitioner-unavailable",
|
|
8065
|
-
message: `No more times are available with ${input.currentPractitionerLabel} before your reschedule deadline
|
|
8109
|
+
message: `No more times are available with ${input.currentPractitionerLabel} before your reschedule deadline.${ifSomeoneElse(" You can choose someone else for the same service.")}`
|
|
8066
8110
|
};
|
|
8067
8111
|
return { kind: "ready" };
|
|
8068
8112
|
}
|
|
@@ -8070,7 +8114,7 @@ function resolveAppointmentRescheduleViewState(input) {
|
|
|
8070
8114
|
if (input.practitionerSelection.kind === "specific") return {
|
|
8071
8115
|
kind: "switching-practitioner-no-availability",
|
|
8072
8116
|
reason: "selected-practitioner-unavailable",
|
|
8073
|
-
message: `No online times are currently available with ${getAppointmentRescheduleSelectionLabel(input.practitionerSelection, input.resources) ?? "
|
|
8117
|
+
message: `No online times are currently available with ${getAppointmentRescheduleSelectionLabel(input.practitionerSelection, input.resources) ?? "the person you chose"}. Choose someone else or contact the business.`
|
|
8074
8118
|
};
|
|
8075
8119
|
return {
|
|
8076
8120
|
kind: "switching-practitioner-no-availability",
|
|
@@ -8204,7 +8248,7 @@ function useRescheduleAvailability(input, deps) {
|
|
|
8204
8248
|
//#region ../blocks/src/system/runtime/shared/AppointmentRescheduleSlotOptions.tsx
|
|
8205
8249
|
function AppointmentRescheduleSlotOptions({ slots, resources, switchingPractitioner, selectedPractitionerIsAny, formatSlotStartAt }) {
|
|
8206
8250
|
return /* @__PURE__ */ jsx(Fragment, { children: slots.map((slot) => {
|
|
8207
|
-
const slotPractitionerName = getAppointmentReschedulePractitionerName(slot.resourceId, resources) ?? "
|
|
8251
|
+
const slotPractitionerName = getAppointmentReschedulePractitionerName(slot.resourceId, resources) ?? "someone";
|
|
8208
8252
|
const startLabel = formatSlotStartAt(slot.startAt);
|
|
8209
8253
|
return /* @__PURE__ */ jsx("option", {
|
|
8210
8254
|
value: formatAppointmentRescheduleSlotOptionValue(createAppointmentRescheduleSlotIdentity(slot.startAt, slot.resourceId, slot.endAt)),
|
|
@@ -8214,8 +8258,22 @@ function AppointmentRescheduleSlotOptions({ slots, resources, switchingPractitio
|
|
|
8214
8258
|
}
|
|
8215
8259
|
//#endregion
|
|
8216
8260
|
//#region ../blocks/src/customer-portal/components/bookings/PortalAppointmentRescheduleFlow.tsx
|
|
8261
|
+
function ChooseAnotherButton({ show, label, onClick }) {
|
|
8262
|
+
if (!show) return null;
|
|
8263
|
+
return /* @__PURE__ */ jsx("div", {
|
|
8264
|
+
className: "cp-card-actions",
|
|
8265
|
+
children: /* @__PURE__ */ jsx(ThemedButton, {
|
|
8266
|
+
type: "button",
|
|
8267
|
+
onClick,
|
|
8268
|
+
variant: "secondary",
|
|
8269
|
+
size: "sm",
|
|
8270
|
+
label
|
|
8271
|
+
})
|
|
8272
|
+
});
|
|
8273
|
+
}
|
|
8217
8274
|
function PortalAppointmentRescheduleFlow({ appointment, onClose, onSuccess }) {
|
|
8218
8275
|
const { context: site } = usePortalDateDisplay();
|
|
8276
|
+
const person = usePortalBusinessPerson();
|
|
8219
8277
|
const { context, zone } = portalSessionDisplay(appointment, site);
|
|
8220
8278
|
const api = useBlockApi();
|
|
8221
8279
|
const [resources, setResources] = React$1.useState([]);
|
|
@@ -8236,7 +8294,7 @@ function PortalAppointmentRescheduleFlow({ appointment, onClose, onSuccess }) {
|
|
|
8236
8294
|
label: option.label
|
|
8237
8295
|
})) ?? []);
|
|
8238
8296
|
} catch (error) {
|
|
8239
|
-
if (!cancelled) setResourceError(error instanceof Error ? error.message : "
|
|
8297
|
+
if (!cancelled) setResourceError(error instanceof Error ? error.message : "We couldn't load who's available. Please try again.");
|
|
8240
8298
|
} finally {
|
|
8241
8299
|
if (!cancelled) setResourcesLoading(false);
|
|
8242
8300
|
}
|
|
@@ -8250,7 +8308,7 @@ function PortalAppointmentRescheduleFlow({ appointment, onClose, onSuccess }) {
|
|
|
8250
8308
|
timeZone: context.timeZone,
|
|
8251
8309
|
serviceId: appointment.serviceId,
|
|
8252
8310
|
currentResourceId: appointment.resourceId ? unsafeAsAppointmentResourceId(appointment.resourceId) : null,
|
|
8253
|
-
currentPractitionerLabel: appointment.resourceName ?? "
|
|
8311
|
+
currentPractitionerLabel: appointment.resourceName ?? "the person you booked with",
|
|
8254
8312
|
resources,
|
|
8255
8313
|
resourcesLoading
|
|
8256
8314
|
});
|
|
@@ -8258,6 +8316,11 @@ function PortalAppointmentRescheduleFlow({ appointment, onClose, onSuccess }) {
|
|
|
8258
8316
|
startSwitchingPractitioner();
|
|
8259
8317
|
setSubmitError(null);
|
|
8260
8318
|
}, [startSwitchingPractitioner]);
|
|
8319
|
+
const chooseAnother = /* @__PURE__ */ jsx(ChooseAnotherButton, {
|
|
8320
|
+
show: hasOtherPractitioner(resources, appointment.resourceId),
|
|
8321
|
+
label: person.chooseAnother,
|
|
8322
|
+
onClick: handleSwitchPractitioner
|
|
8323
|
+
});
|
|
8261
8324
|
const handleSubmit = React$1.useCallback(async () => {
|
|
8262
8325
|
if (!selectedSlot || submitting) return;
|
|
8263
8326
|
setSubmitting(true);
|
|
@@ -8312,16 +8375,7 @@ function PortalAppointmentRescheduleFlow({ appointment, onClose, onSuccess }) {
|
|
|
8312
8375
|
viewState.kind === "original-practitioner-requires-switch" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("p", {
|
|
8313
8376
|
className: "cp-card-subtitle cp-card-subtitle--spaced",
|
|
8314
8377
|
children: viewState.message
|
|
8315
|
-
}),
|
|
8316
|
-
className: "cp-card-actions",
|
|
8317
|
-
children: /* @__PURE__ */ jsx(ThemedButton, {
|
|
8318
|
-
type: "button",
|
|
8319
|
-
onClick: handleSwitchPractitioner,
|
|
8320
|
-
variant: "secondary",
|
|
8321
|
-
size: "sm",
|
|
8322
|
-
label: "Choose another practitioner"
|
|
8323
|
-
})
|
|
8324
|
-
})] }) : null,
|
|
8378
|
+
}), chooseAnother] }) : null,
|
|
8325
8379
|
viewState.kind === "switching-practitioner-no-availability" ? /* @__PURE__ */ jsx("p", {
|
|
8326
8380
|
className: "cp-card-subtitle cp-card-subtitle--spaced",
|
|
8327
8381
|
children: viewState.message
|
|
@@ -8331,29 +8385,20 @@ function PortalAppointmentRescheduleFlow({ appointment, onClose, onSuccess }) {
|
|
|
8331
8385
|
className: "cp-card-meta",
|
|
8332
8386
|
children: [/* @__PURE__ */ jsx("label", {
|
|
8333
8387
|
htmlFor: `cp-practitioner-${appointment.id}`,
|
|
8334
|
-
children:
|
|
8388
|
+
children: person.label
|
|
8335
8389
|
}), /* @__PURE__ */ jsxs("select", {
|
|
8336
8390
|
id: `cp-practitioner-${appointment.id}`,
|
|
8337
8391
|
value: selectedPractitionerId,
|
|
8338
8392
|
onChange: (event) => selectPractitionerOptionValue(event.target.value),
|
|
8339
8393
|
children: [/* @__PURE__ */ jsx("option", {
|
|
8340
8394
|
value: ANY_PRACTITIONER_SENTINEL,
|
|
8341
|
-
children:
|
|
8395
|
+
children: person.anyone
|
|
8342
8396
|
}), resources.map((resource) => /* @__PURE__ */ jsx("option", {
|
|
8343
8397
|
value: resource.id,
|
|
8344
8398
|
children: resource.label
|
|
8345
8399
|
}, resource.id))]
|
|
8346
8400
|
})]
|
|
8347
|
-
}) :
|
|
8348
|
-
className: "cp-card-actions",
|
|
8349
|
-
children: /* @__PURE__ */ jsx(ThemedButton, {
|
|
8350
|
-
type: "button",
|
|
8351
|
-
onClick: handleSwitchPractitioner,
|
|
8352
|
-
variant: "secondary",
|
|
8353
|
-
size: "sm",
|
|
8354
|
-
label: "Choose another practitioner"
|
|
8355
|
-
})
|
|
8356
|
-
}),
|
|
8401
|
+
}) : chooseAnother,
|
|
8357
8402
|
/* @__PURE__ */ jsxs("div", {
|
|
8358
8403
|
className: "cp-card-meta",
|
|
8359
8404
|
children: [
|
|
@@ -8435,6 +8480,7 @@ function PortalAppointmentRescheduleFlow({ appointment, onClose, onSuccess }) {
|
|
|
8435
8480
|
}
|
|
8436
8481
|
function CurrentAppointment({ appointment }) {
|
|
8437
8482
|
const { context: site } = usePortalDateDisplay();
|
|
8483
|
+
usePortalBusinessPerson();
|
|
8438
8484
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
8439
8485
|
className: "cp-card-header",
|
|
8440
8486
|
children: /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", {
|
|
@@ -8451,13 +8497,56 @@ function CurrentAppointment({ appointment }) {
|
|
|
8451
8497
|
}
|
|
8452
8498
|
//#endregion
|
|
8453
8499
|
//#region ../blocks/src/customer-portal/components/bookings/appointmentRequestPresentation.ts
|
|
8454
|
-
function
|
|
8500
|
+
function keepReasonClause(reason, siteTitle) {
|
|
8501
|
+
switch (reason.kind) {
|
|
8502
|
+
case "cutoff_passed": return `your appointment starts in less than ${formatCancellationCutoffSpan(reason.cutoffHours)}`;
|
|
8503
|
+
case "never_refunded": return siteTitle !== null && siteTitle !== void 0 && siteTitle !== "" ? `${siteTitle} doesn't refund cancelled appointments` : "cancelled appointments aren't refunded";
|
|
8504
|
+
}
|
|
8505
|
+
}
|
|
8506
|
+
function packageCredits(credits) {
|
|
8507
|
+
return credits === 1 ? "package credit" : `${credits} package credits`;
|
|
8508
|
+
}
|
|
8509
|
+
function cancelBody(outcome, siteTitle) {
|
|
8510
|
+
switch (outcome.kind) {
|
|
8511
|
+
case "nothing_to_return": return "This will cancel your appointment.";
|
|
8512
|
+
case "refund": {
|
|
8513
|
+
const amount = formatCurrencyAmount(outcome.money.amountCents, outcome.money.currency);
|
|
8514
|
+
switch (outcome.to) {
|
|
8515
|
+
case "card": return `This will cancel your appointment and refund ${amount} to your card. It can take 5–10 working days to appear.`;
|
|
8516
|
+
case "site_credit": return `This will cancel your appointment and add ${amount} to your account as site credit.`;
|
|
8517
|
+
case "card_and_site_credit": return `This will cancel your appointment and refund ${amount}, partly to your card and partly as site credit on your account. The card refund can take 5–10 working days to appear.`;
|
|
8518
|
+
}
|
|
8519
|
+
break;
|
|
8520
|
+
}
|
|
8521
|
+
case "credit_back": return `This will cancel your appointment and put your ${packageCredits(outcome.credits)} back.`;
|
|
8522
|
+
case "keep_money": return `This will cancel your appointment. Your ${formatCurrencyAmount(outcome.money.amountCents, outcome.money.currency)} won't be refunded, because ${keepReasonClause(outcome.reason, siteTitle)}.`;
|
|
8523
|
+
case "keep_credit": return `This will cancel your appointment. Your ${packageCredits(outcome.credits)} won't be returned, because ${keepReasonClause(outcome.reason, siteTitle)}.`;
|
|
8524
|
+
case "contact_business": return `This will cancel your appointment. Your ${formatCurrencyAmount(outcome.money.amountCents, outcome.money.currency)} can't be refunded online, so please contact ${siteTitle ?? "the business"} about it.`;
|
|
8525
|
+
}
|
|
8526
|
+
}
|
|
8527
|
+
function appointmentCancelCopy(appointment, siteTitle) {
|
|
8528
|
+
const outcome = appointment.cancellation.moneyOnCancel;
|
|
8455
8529
|
return {
|
|
8456
8530
|
buttonLabel: "Cancel",
|
|
8457
8531
|
title: "Cancel appointment?",
|
|
8458
|
-
body:
|
|
8532
|
+
body: cancelBody(outcome, siteTitle),
|
|
8459
8533
|
keepLabel: "Keep appointment",
|
|
8460
|
-
confirmLabel: "Confirm cancel"
|
|
8534
|
+
confirmLabel: "Confirm cancel",
|
|
8535
|
+
confirmAcceptsNoRefund: outcome.kind === "keep_credit"
|
|
8536
|
+
};
|
|
8537
|
+
}
|
|
8538
|
+
/**
|
|
8539
|
+
* The portal's three appointment groups. Upcoming and Cancelled run soonest
|
|
8540
|
+
* first; Past runs latest first. Cancelled holds only dates still to come, so it
|
|
8541
|
+
* doesn't sit among real upcoming bookings; once the date passes it joins Past.
|
|
8542
|
+
*/
|
|
8543
|
+
function groupPortalAppointments(appointments, isPast) {
|
|
8544
|
+
const soonestFirst = (a, b) => a.startAt.localeCompare(b.startAt);
|
|
8545
|
+
const future = appointments.filter((appointment) => !isPast(appointment.startAt)).sort(soonestFirst);
|
|
8546
|
+
return {
|
|
8547
|
+
upcoming: future.filter((appointment) => appointment.status !== "cancelled"),
|
|
8548
|
+
cancelled: future.filter((appointment) => appointment.status === "cancelled"),
|
|
8549
|
+
past: appointments.filter((appointment) => isPast(appointment.startAt)).sort((a, b) => soonestFirst(b, a))
|
|
8461
8550
|
};
|
|
8462
8551
|
}
|
|
8463
8552
|
function requestOutcomeLabel(appointment) {
|
|
@@ -8490,7 +8579,7 @@ function presentPortalAppointment(appointment, display) {
|
|
|
8490
8579
|
badgeVariant: getAppointmentBadgeVariant(appointment.status),
|
|
8491
8580
|
hint: null,
|
|
8492
8581
|
rescheduleNote: rescheduleNote(appointment),
|
|
8493
|
-
cancel: appointmentCancelCopy(appointment)
|
|
8582
|
+
cancel: appointmentCancelCopy(appointment, display.siteTitle)
|
|
8494
8583
|
};
|
|
8495
8584
|
if (appointment.status === "requested") return {
|
|
8496
8585
|
...ordinary,
|
|
@@ -8500,7 +8589,8 @@ function presentPortalAppointment(appointment, display) {
|
|
|
8500
8589
|
title: `Cancel your request for ${appointment.serviceName} on ${slot.when}?`,
|
|
8501
8590
|
body: display.siteTitle ? `We'll let ${display.siteTitle} know.` : "We'll let them know.",
|
|
8502
8591
|
keepLabel: "Keep it",
|
|
8503
|
-
confirmLabel: "Cancel request"
|
|
8592
|
+
confirmLabel: "Cancel request",
|
|
8593
|
+
confirmAcceptsNoRefund: false
|
|
8504
8594
|
}
|
|
8505
8595
|
};
|
|
8506
8596
|
const outcome = requestOutcomeLabel(appointment);
|
|
@@ -8608,11 +8698,7 @@ function resolveEffectiveOrderFilter(preference, summary) {
|
|
|
8608
8698
|
return summary.counts[preference] > 0 ? preference : summary.visibleFilters[0] ?? "all";
|
|
8609
8699
|
}
|
|
8610
8700
|
function resolveOrderFlexibleBalanceEligibility(order) {
|
|
8611
|
-
return order.flexibleBalance
|
|
8612
|
-
status: order.flexibleBalance.status,
|
|
8613
|
-
remainingBalanceCents: order.flexibleBalance.remainingBalanceCents,
|
|
8614
|
-
stripeMinimumChargeCents: 50
|
|
8615
|
-
}) : null;
|
|
8701
|
+
return order.flexibleBalance?.paymentEligibility ?? null;
|
|
8616
8702
|
}
|
|
8617
8703
|
function formatCentsForInput(value) {
|
|
8618
8704
|
return (value / 100).toFixed(2).replace(/\.00$/, "");
|
|
@@ -8761,7 +8847,6 @@ function OrdersSection({ orders, emptyMessage, requestedOrderId = null, onReques
|
|
|
8761
8847
|
})
|
|
8762
8848
|
})
|
|
8763
8849
|
] }) }), /* @__PURE__ */ jsx("tbody", { children: filteredOrders.map((order) => {
|
|
8764
|
-
const amountSummary = summarizeOrderAmount(order);
|
|
8765
8850
|
const note = getOrderAttentionMessage(order);
|
|
8766
8851
|
const isMuted = order.status === "cancelled" || order.status === "refunded";
|
|
8767
8852
|
const openOrderDetails = () => openDetails(order.id);
|
|
@@ -8804,21 +8889,9 @@ function OrdersSection({ orders, emptyMessage, requestedOrderId = null, onReques
|
|
|
8804
8889
|
display: "grid",
|
|
8805
8890
|
gap: "0.25rem"
|
|
8806
8891
|
},
|
|
8807
|
-
children: [/* @__PURE__ */ jsx("span", { children:
|
|
8808
|
-
className: "cp-row-muted",
|
|
8809
|
-
children: formatOrderPaymentStateLabel(order.paymentState)
|
|
8810
|
-
})]
|
|
8892
|
+
children: [order.paymentLabels.booking && /* @__PURE__ */ jsx("span", { children: order.paymentLabels.booking }), /* @__PURE__ */ jsx("span", { children: order.paymentLabels.money })]
|
|
8811
8893
|
}) }),
|
|
8812
|
-
/* @__PURE__ */ jsx("td", { children:
|
|
8813
|
-
style: {
|
|
8814
|
-
display: "grid",
|
|
8815
|
-
gap: "0.25rem"
|
|
8816
|
-
},
|
|
8817
|
-
children: [/* @__PURE__ */ jsx("span", { children: amountSummary.primary }), /* @__PURE__ */ jsx("span", {
|
|
8818
|
-
className: "cp-row-muted",
|
|
8819
|
-
children: amountSummary.secondary
|
|
8820
|
-
})]
|
|
8821
|
-
}) })
|
|
8894
|
+
/* @__PURE__ */ jsx("td", { children: formatCurrencyCents(order.grandTotalCents, order.currency) })
|
|
8822
8895
|
]
|
|
8823
8896
|
}, order.id);
|
|
8824
8897
|
}) })]
|
|
@@ -8873,74 +8946,67 @@ function OrderDetailsModal({ order, balanceEligibility, payingOrderId, orderActi
|
|
|
8873
8946
|
display: "grid",
|
|
8874
8947
|
gap: "0.75rem"
|
|
8875
8948
|
},
|
|
8876
|
-
children: [
|
|
8877
|
-
|
|
8878
|
-
|
|
8879
|
-
|
|
8880
|
-
|
|
8881
|
-
|
|
8882
|
-
|
|
8883
|
-
|
|
8949
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
8950
|
+
style: {
|
|
8951
|
+
display: "flex",
|
|
8952
|
+
flexWrap: "wrap",
|
|
8953
|
+
gap: "0.5rem"
|
|
8954
|
+
},
|
|
8955
|
+
children: [/* @__PURE__ */ jsx(ThemedButton, {
|
|
8956
|
+
type: "button",
|
|
8957
|
+
disabled: isPaying,
|
|
8958
|
+
onClick: onPayNow,
|
|
8959
|
+
variant: "default",
|
|
8960
|
+
size: "sm",
|
|
8961
|
+
label: isPaying ? "Redirecting…" : getPayNowLabel(order)
|
|
8962
|
+
}), canEnterCustomAmount && /* @__PURE__ */ jsx(ThemedButton, {
|
|
8963
|
+
type: "button",
|
|
8964
|
+
disabled: isPaying,
|
|
8965
|
+
onClick: onToggleCustomAmount,
|
|
8966
|
+
variant: "secondary",
|
|
8967
|
+
size: "sm",
|
|
8968
|
+
label: isCustomAmountOpen ? "Hide custom amount" : "Enter amount"
|
|
8969
|
+
})]
|
|
8970
|
+
}), isCustomAmountOpen && balanceEligibility?.kind === "eligible" && /* @__PURE__ */ jsxs("div", {
|
|
8971
|
+
style: {
|
|
8972
|
+
display: "grid",
|
|
8973
|
+
gap: "0.5rem",
|
|
8974
|
+
maxWidth: "18rem"
|
|
8975
|
+
},
|
|
8976
|
+
children: [
|
|
8977
|
+
/* @__PURE__ */ jsx("label", {
|
|
8978
|
+
htmlFor: `cp-order-custom-amount-${order.id}`,
|
|
8979
|
+
className: "cp-card-subtitle",
|
|
8980
|
+
children: "Enter an amount"
|
|
8981
|
+
}),
|
|
8982
|
+
/* @__PURE__ */ jsx("input", {
|
|
8983
|
+
id: `cp-order-custom-amount-${order.id}`,
|
|
8984
|
+
type: "text",
|
|
8985
|
+
inputMode: "decimal",
|
|
8986
|
+
className: "form-input",
|
|
8987
|
+
value: customAmountInput,
|
|
8988
|
+
onChange: (event) => onChangeCustomAmount(event.target.value),
|
|
8989
|
+
disabled: isPaying
|
|
8990
|
+
}),
|
|
8991
|
+
/* @__PURE__ */ jsxs("div", {
|
|
8992
|
+
className: "cp-card-subtitle",
|
|
8993
|
+
children: [
|
|
8994
|
+
"Minimum payment",
|
|
8995
|
+
" ",
|
|
8996
|
+
formatCurrencyCents(balanceEligibility.minimumAmountCents, order.currency),
|
|
8997
|
+
"."
|
|
8998
|
+
]
|
|
8999
|
+
}),
|
|
9000
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(ThemedButton, {
|
|
8884
9001
|
type: "button",
|
|
8885
9002
|
disabled: isPaying,
|
|
8886
|
-
onClick:
|
|
9003
|
+
onClick: onSubmitCustomAmount,
|
|
8887
9004
|
variant: "default",
|
|
8888
9005
|
size: "sm",
|
|
8889
|
-
label: isPaying ? "Redirecting…" :
|
|
8890
|
-
})
|
|
8891
|
-
|
|
8892
|
-
|
|
8893
|
-
onClick: onToggleCustomAmount,
|
|
8894
|
-
variant: "secondary",
|
|
8895
|
-
size: "sm",
|
|
8896
|
-
label: isCustomAmountOpen ? "Hide custom amount" : "Enter amount"
|
|
8897
|
-
})]
|
|
8898
|
-
}),
|
|
8899
|
-
order.actions.payOnlineInProgress && /* @__PURE__ */ jsx("div", {
|
|
8900
|
-
className: "cp-card-subtitle",
|
|
8901
|
-
children: "Payment is already in progress for this order."
|
|
8902
|
-
}),
|
|
8903
|
-
isCustomAmountOpen && balanceEligibility?.kind === "eligible" && /* @__PURE__ */ jsxs("div", {
|
|
8904
|
-
style: {
|
|
8905
|
-
display: "grid",
|
|
8906
|
-
gap: "0.5rem",
|
|
8907
|
-
maxWidth: "18rem"
|
|
8908
|
-
},
|
|
8909
|
-
children: [
|
|
8910
|
-
/* @__PURE__ */ jsx("label", {
|
|
8911
|
-
htmlFor: `cp-order-custom-amount-${order.id}`,
|
|
8912
|
-
className: "cp-card-subtitle",
|
|
8913
|
-
children: "Enter an amount"
|
|
8914
|
-
}),
|
|
8915
|
-
/* @__PURE__ */ jsx("input", {
|
|
8916
|
-
id: `cp-order-custom-amount-${order.id}`,
|
|
8917
|
-
type: "text",
|
|
8918
|
-
inputMode: "decimal",
|
|
8919
|
-
className: "form-input",
|
|
8920
|
-
value: customAmountInput,
|
|
8921
|
-
onChange: (event) => onChangeCustomAmount(event.target.value),
|
|
8922
|
-
disabled: isPaying
|
|
8923
|
-
}),
|
|
8924
|
-
/* @__PURE__ */ jsxs("div", {
|
|
8925
|
-
className: "cp-card-subtitle",
|
|
8926
|
-
children: [
|
|
8927
|
-
"Minimum payment",
|
|
8928
|
-
" ",
|
|
8929
|
-
formatCurrencyCents(balanceEligibility.minimumAmountCents, order.currency),
|
|
8930
|
-
"."
|
|
8931
|
-
]
|
|
8932
|
-
}),
|
|
8933
|
-
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(ThemedButton, {
|
|
8934
|
-
type: "button",
|
|
8935
|
-
disabled: isPaying,
|
|
8936
|
-
onClick: onSubmitCustomAmount,
|
|
8937
|
-
variant: "default",
|
|
8938
|
-
size: "sm",
|
|
8939
|
-
label: isPaying ? "Redirecting…" : "Pay this amount"
|
|
8940
|
-
}) })
|
|
8941
|
-
]
|
|
8942
|
-
})
|
|
8943
|
-
]
|
|
9006
|
+
label: isPaying ? "Redirecting…" : "Pay this amount"
|
|
9007
|
+
}) })
|
|
9008
|
+
]
|
|
9009
|
+
})]
|
|
8944
9010
|
}),
|
|
8945
9011
|
order.instalmentPlan && /* @__PURE__ */ jsxs("section", {
|
|
8946
9012
|
className: "cp-card",
|
|
@@ -9002,7 +9068,7 @@ function OrderDetailsModal({ order, balanceEligibility, payingOrderId, orderActi
|
|
|
9002
9068
|
})
|
|
9003
9069
|
]
|
|
9004
9070
|
}),
|
|
9005
|
-
order.flexibleBalance && /* @__PURE__ */ jsxs("section", {
|
|
9071
|
+
order.flexibleBalance && order.balanceDueCents > 0 && /* @__PURE__ */ jsxs("section", {
|
|
9006
9072
|
className: "cp-card",
|
|
9007
9073
|
style: {
|
|
9008
9074
|
display: "grid",
|
|
@@ -9197,38 +9263,10 @@ function summarizeOrderQuantity(order) {
|
|
|
9197
9263
|
return `${quantity} ${quantity === 1 ? "item" : "items"}`;
|
|
9198
9264
|
}
|
|
9199
9265
|
function getOrderAttentionMessage(order) {
|
|
9200
|
-
|
|
9201
|
-
if (order.
|
|
9202
|
-
if (order.flexibleBalance?.status === "overdue") return "Overdue. You can pay the full remaining balance now.";
|
|
9266
|
+
const eligibility = resolveOrderFlexibleBalanceEligibility(order);
|
|
9267
|
+
if (order.actions.canPayOnline && eligibility?.kind === "full_balance_only" && eligibility.reason === "overdue") return "Overdue. You can pay the full remaining balance now.";
|
|
9203
9268
|
return null;
|
|
9204
9269
|
}
|
|
9205
|
-
function summarizeOrderAmount(order) {
|
|
9206
|
-
const total = `Total ${formatCurrencyCents(order.grandTotalCents, order.currency)}`;
|
|
9207
|
-
if (order.instalmentPlan || order.flexibleBalance || order.paymentState.outstandingCents > 0) return {
|
|
9208
|
-
primary: `Due ${formatCurrencyCents(order.balanceDueCents, order.currency)}`,
|
|
9209
|
-
secondary: order.refundedCents > 0 ? `${total} · Refunded ${formatCurrencyCents(order.refundedCents, order.currency)}` : total
|
|
9210
|
-
};
|
|
9211
|
-
if (order.paymentState.kind === "paid") return {
|
|
9212
|
-
primary: "Paid in full",
|
|
9213
|
-
secondary: total
|
|
9214
|
-
};
|
|
9215
|
-
if (order.paymentState.kind === "waived") return {
|
|
9216
|
-
primary: "No payment due",
|
|
9217
|
-
secondary: total
|
|
9218
|
-
};
|
|
9219
|
-
if (order.paymentState.kind === "not_required") return {
|
|
9220
|
-
primary: formatOrderPaymentStateLabel(order.paymentState),
|
|
9221
|
-
secondary: total
|
|
9222
|
-
};
|
|
9223
|
-
if (order.paymentState.kind === "refunded") return {
|
|
9224
|
-
primary: "Refunded",
|
|
9225
|
-
secondary: total
|
|
9226
|
-
};
|
|
9227
|
-
return {
|
|
9228
|
-
primary: "Cancelled",
|
|
9229
|
-
secondary: total
|
|
9230
|
-
};
|
|
9231
|
-
}
|
|
9232
9270
|
function getPayNowLabel(order) {
|
|
9233
9271
|
if (order.flexibleBalance) return "Pay full balance now";
|
|
9234
9272
|
if (order.instalmentPlan) return "Pay the rest now";
|
|
@@ -9252,12 +9290,13 @@ function OrderDetailHeader({ order }) {
|
|
|
9252
9290
|
flexWrap: "wrap",
|
|
9253
9291
|
gap: "0.5rem"
|
|
9254
9292
|
},
|
|
9255
|
-
children: [/* @__PURE__ */ jsx(Badge, {
|
|
9256
|
-
variant:
|
|
9257
|
-
children:
|
|
9293
|
+
children: [order.paymentLabels.booking && /* @__PURE__ */ jsx(Badge, {
|
|
9294
|
+
variant: "default",
|
|
9295
|
+
children: order.paymentLabels.booking
|
|
9258
9296
|
}), /* @__PURE__ */ jsx(Badge, {
|
|
9259
|
-
variant:
|
|
9260
|
-
|
|
9297
|
+
variant: getOrderPaymentBadgeVariant(order.paymentLabels.tone),
|
|
9298
|
+
sentence: true,
|
|
9299
|
+
children: order.paymentLabels.money
|
|
9261
9300
|
})]
|
|
9262
9301
|
}),
|
|
9263
9302
|
/* @__PURE__ */ jsxs("div", {
|
|
@@ -9307,21 +9346,21 @@ function paymentLine(payment) {
|
|
|
9307
9346
|
const left = payment.sessionsLeft === 0 ? "none left" : `${payment.sessionsLeft} left`;
|
|
9308
9347
|
return `from your ${payment.name ?? "package"}, ${left}`;
|
|
9309
9348
|
}
|
|
9310
|
-
case "owed": return "you pay
|
|
9349
|
+
case "owed": return "you can pay at or after the session";
|
|
9311
9350
|
case "payment_link": return "you’re emailed a payment link before each session";
|
|
9312
9351
|
}
|
|
9313
9352
|
}
|
|
9314
9353
|
function capitalise(text) {
|
|
9315
9354
|
return text.charAt(0).toUpperCase() + text.slice(1);
|
|
9316
9355
|
}
|
|
9317
|
-
/** "Sam keeps this time for you each week. To miss a week or change the time, message Sam." */
|
|
9356
|
+
/** "Sam keeps this time for you each week. To miss a week or change the time, message Sam." Without a name: "This time is kept for you each week…" */
|
|
9318
9357
|
function heldNote(session) {
|
|
9319
9358
|
if (!session.holdsTime) return null;
|
|
9320
9359
|
const cadence = session.schedule.cadence;
|
|
9321
9360
|
const period = cadence.kind === "monthly" ? "each month" : cadence.everyWeeks === 1 ? "each week" : "every other week";
|
|
9322
9361
|
const miss = cadence.kind === "weekly" && cadence.everyWeeks === 1 ? "a week" : "one";
|
|
9323
9362
|
const trainer = session.trainerName;
|
|
9324
|
-
return
|
|
9363
|
+
return trainer ? `${trainer} keeps this time for you ${period}. To miss ${miss} or change the time, message ${trainer}.` : `This time is kept for you ${period}. To miss ${miss} or change the time, get in touch.`;
|
|
9325
9364
|
}
|
|
9326
9365
|
function formatters(locale, timeZone) {
|
|
9327
9366
|
const date = new Intl.DateTimeFormat(locale, {
|
|
@@ -9370,7 +9409,7 @@ const BADGES = {
|
|
|
9370
9409
|
variant: "warning"
|
|
9371
9410
|
},
|
|
9372
9411
|
held: {
|
|
9373
|
-
text: "Held
|
|
9412
|
+
text: "Held, not booked yet",
|
|
9374
9413
|
variant: "info"
|
|
9375
9414
|
},
|
|
9376
9415
|
open: {
|
|
@@ -9411,7 +9450,7 @@ function runsOf(dates) {
|
|
|
9411
9450
|
}];
|
|
9412
9451
|
}, []);
|
|
9413
9452
|
}
|
|
9414
|
-
function runRow(run, localStart, format) {
|
|
9453
|
+
function runRow(run, localStart, format, trainerName) {
|
|
9415
9454
|
const [first] = run.dates;
|
|
9416
9455
|
if (!first) return null;
|
|
9417
9456
|
if (first.state === "away") return {
|
|
@@ -9423,13 +9462,16 @@ function runRow(run, localStart, format) {
|
|
|
9423
9462
|
return {
|
|
9424
9463
|
key: first.occurrence,
|
|
9425
9464
|
label: dateLabel(first, localStart, format),
|
|
9426
|
-
badge:
|
|
9465
|
+
badge: first.state === "trainer_away" && trainerName ? {
|
|
9466
|
+
...BADGES.trainer_away,
|
|
9467
|
+
text: `No session, ${trainerName}’s away`
|
|
9468
|
+
} : BADGES[first.state],
|
|
9427
9469
|
muted: first.state === "trainer_away"
|
|
9428
9470
|
};
|
|
9429
9471
|
}
|
|
9430
9472
|
function dateRows(session, format) {
|
|
9431
9473
|
return runsOf(session.dates).flatMap((run) => {
|
|
9432
|
-
const row = runRow(run, session.schedule.localStart, format);
|
|
9474
|
+
const row = runRow(run, session.schedule.localStart, format, session.trainerName);
|
|
9433
9475
|
return row ? [row] : [];
|
|
9434
9476
|
});
|
|
9435
9477
|
}
|
|
@@ -10420,7 +10462,7 @@ function MembershipCancelAction({ membership, cancelFlow }) {
|
|
|
10420
10462
|
function membershipDatesView(membership) {
|
|
10421
10463
|
if (membership.status === "canceled") return {
|
|
10422
10464
|
kind: "ended",
|
|
10423
|
-
endedAt: membership.
|
|
10465
|
+
endedAt: membership.endedAt ?? null
|
|
10424
10466
|
};
|
|
10425
10467
|
if (membership.renews) return {
|
|
10426
10468
|
kind: "renewing",
|
|
@@ -10444,7 +10486,7 @@ function MembershipDates({ membership }) {
|
|
|
10444
10486
|
"Billed ",
|
|
10445
10487
|
membership.billingInterval,
|
|
10446
10488
|
"ly"
|
|
10447
|
-
] }), view.kind === "ended" ? /* @__PURE__ */ jsxs("span", { children: ["Ended ",
|
|
10489
|
+
] }), view.kind === "ended" ? view.endedAt ? /* @__PURE__ */ jsxs("span", { children: ["Ended ", formatEntitlementEnd(view.endedAt)] }) : /* @__PURE__ */ jsx("span", { children: "Ended" }) : view.kind === "renewing" ? view.renewsAt ? /* @__PURE__ */ jsxs("span", { children: ["Renews ", formatDate(view.renewsAt)] }) : /* @__PURE__ */ jsx("span", { children: "Renewal date unavailable" }) : view.endsAt ? /* @__PURE__ */ jsxs("span", { children: ["Valid until ", formatEntitlementEnd(view.endsAt)] }) : null]
|
|
10448
10490
|
}), view.kind === "ending" && /* @__PURE__ */ jsxs("div", {
|
|
10449
10491
|
className: "cp-alert cp-alert--success cp-alert--mt",
|
|
10450
10492
|
children: [
|
|
@@ -10643,31 +10685,47 @@ function DigitalProductsSection({ digitalProducts, onRefresh }) {
|
|
|
10643
10685
|
}
|
|
10644
10686
|
function AppointmentsSection({ bookPath, siteTitle, appointments, regularSessions, emptyMessage, onRefresh }) {
|
|
10645
10687
|
const { isPast } = usePortalDateFormatting();
|
|
10688
|
+
const [cancelledNotices, setCancelledNotices] = useState({});
|
|
10689
|
+
const onCancelled = React.useCallback((appointmentId, message) => {
|
|
10690
|
+
setCancelledNotices((notices) => ({
|
|
10691
|
+
...notices,
|
|
10692
|
+
[appointmentId]: message
|
|
10693
|
+
}));
|
|
10694
|
+
}, []);
|
|
10646
10695
|
if (appointments.length === 0) return /* @__PURE__ */ jsx(NoAppointments, {
|
|
10647
10696
|
regularSessions,
|
|
10648
10697
|
emptyMessage
|
|
10649
10698
|
});
|
|
10650
|
-
const
|
|
10651
|
-
const
|
|
10699
|
+
const groups = groupPortalAppointments(appointments, isPast);
|
|
10700
|
+
const shared = {
|
|
10701
|
+
bookPath,
|
|
10702
|
+
siteTitle,
|
|
10703
|
+
onRefresh,
|
|
10704
|
+
cancelledNotices,
|
|
10705
|
+
onCancelled
|
|
10706
|
+
};
|
|
10652
10707
|
return /* @__PURE__ */ jsxs("div", {
|
|
10653
10708
|
className: "cp-section cp-section--appointments",
|
|
10654
10709
|
children: [
|
|
10655
10710
|
/* @__PURE__ */ jsx(RegularSessionsSection, { sessions: regularSessions }),
|
|
10656
10711
|
/* @__PURE__ */ jsx(AppointmentGroup, {
|
|
10657
|
-
appointments:
|
|
10658
|
-
|
|
10659
|
-
siteTitle,
|
|
10660
|
-
onRefresh,
|
|
10712
|
+
appointments: groups.upcoming,
|
|
10713
|
+
...shared,
|
|
10661
10714
|
title: "Upcoming Appointments"
|
|
10662
10715
|
}),
|
|
10663
10716
|
/* @__PURE__ */ jsx(AppointmentGroup, {
|
|
10664
|
-
appointments:
|
|
10665
|
-
|
|
10666
|
-
|
|
10667
|
-
|
|
10717
|
+
appointments: groups.cancelled,
|
|
10718
|
+
...shared,
|
|
10719
|
+
title: "Cancelled Appointments",
|
|
10720
|
+
isPast: true,
|
|
10721
|
+
spaced: groups.upcoming.length > 0
|
|
10722
|
+
}),
|
|
10723
|
+
/* @__PURE__ */ jsx(AppointmentGroup, {
|
|
10724
|
+
appointments: groups.past,
|
|
10725
|
+
...shared,
|
|
10668
10726
|
title: "Past Appointments",
|
|
10669
10727
|
isPast: true,
|
|
10670
|
-
spaced:
|
|
10728
|
+
spaced: groups.upcoming.length > 0 || groups.cancelled.length > 0
|
|
10671
10729
|
})
|
|
10672
10730
|
]
|
|
10673
10731
|
});
|
|
@@ -10684,7 +10742,7 @@ function NoAppointments({ regularSessions, emptyMessage }) {
|
|
|
10684
10742
|
})]
|
|
10685
10743
|
});
|
|
10686
10744
|
}
|
|
10687
|
-
function AppointmentGroup({ appointments, bookPath, siteTitle, onRefresh, title, isPast, spaced }) {
|
|
10745
|
+
function AppointmentGroup({ appointments, bookPath, siteTitle, onRefresh, cancelledNotices, onCancelled, title, isPast, spaced }) {
|
|
10688
10746
|
if (appointments.length === 0) return null;
|
|
10689
10747
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("h3", {
|
|
10690
10748
|
className: "cp-section-title",
|
|
@@ -10697,17 +10755,23 @@ function AppointmentGroup({ appointments, bookPath, siteTitle, onRefresh, title,
|
|
|
10697
10755
|
bookPath,
|
|
10698
10756
|
siteTitle,
|
|
10699
10757
|
onRefresh,
|
|
10758
|
+
cancelledNotice: cancelledNotices[appointment.id] ?? null,
|
|
10759
|
+
onCancelled,
|
|
10700
10760
|
isPast
|
|
10701
10761
|
}, appointment.id))
|
|
10702
10762
|
})] });
|
|
10703
10763
|
}
|
|
10764
|
+
/** The card's own cancel feedback, or the confirmation kept after the card moved group. */
|
|
10765
|
+
function cancelCardNote(feedback, cancelledNotice) {
|
|
10766
|
+
return feedback.tag !== "idle" ? feedback.message : cancelledNotice;
|
|
10767
|
+
}
|
|
10704
10768
|
function PortalCardNote({ text }) {
|
|
10705
10769
|
return text ? /* @__PURE__ */ jsx("p", {
|
|
10706
10770
|
className: "cp-card-subtitle cp-card-subtitle--spaced",
|
|
10707
10771
|
children: text
|
|
10708
10772
|
}) : null;
|
|
10709
10773
|
}
|
|
10710
|
-
function AppointmentCard({ appointment, bookPath, siteTitle, isPast: isApptPast = false, onRefresh }) {
|
|
10774
|
+
function AppointmentCard({ appointment, bookPath, siteTitle, isPast: isApptPast = false, onRefresh, cancelledNotice, onCancelled }) {
|
|
10711
10775
|
const { context } = usePortalDateDisplay();
|
|
10712
10776
|
const presentation = presentPortalAppointment(appointment, {
|
|
10713
10777
|
context,
|
|
@@ -10718,7 +10782,15 @@ function AppointmentCard({ appointment, bookPath, siteTitle, isPast: isApptPast
|
|
|
10718
10782
|
const [rescheduleOpen, setRescheduleOpen] = useState(false);
|
|
10719
10783
|
const [rescheduleFeedback, setRescheduleFeedback] = useState(null);
|
|
10720
10784
|
const cancelFlow = usePortalCancelFlow({
|
|
10721
|
-
cancel: React.useCallback((opts) =>
|
|
10785
|
+
cancel: React.useCallback(async (opts) => {
|
|
10786
|
+
const result = await api.cancelAppointment(appointment.id, { confirmCancelWithoutRefund: opts?.confirmCancelWithoutRefund });
|
|
10787
|
+
if (result.cancelled && !result.requiresCancelWithoutRefundConfirmation) onCancelled(appointment.id, formatPortalCancelSuccessMessage(result));
|
|
10788
|
+
return result;
|
|
10789
|
+
}, [
|
|
10790
|
+
api,
|
|
10791
|
+
appointment.id,
|
|
10792
|
+
onCancelled
|
|
10793
|
+
]),
|
|
10722
10794
|
onRefresh
|
|
10723
10795
|
});
|
|
10724
10796
|
const rebookHref = portalRebookHref(appointment, bookPath);
|
|
@@ -10739,9 +10811,10 @@ function AppointmentCard({ appointment, bookPath, siteTitle, isPast: isApptPast
|
|
|
10739
10811
|
}), /* @__PURE__ */ jsx(ThemedButton, {
|
|
10740
10812
|
type: "button",
|
|
10741
10813
|
disabled: cancelFlow.submitting,
|
|
10742
|
-
onClick: () => void cancelFlow.submitCancel(),
|
|
10814
|
+
onClick: () => void cancelFlow.submitCancel(cancelCopy.confirmAcceptsNoRefund ? { confirmCancelWithoutRefund: true } : void 0),
|
|
10743
10815
|
variant: "primary",
|
|
10744
10816
|
size: "sm",
|
|
10817
|
+
extraClassName: "cp-button--danger",
|
|
10745
10818
|
label: cancelFlow.submitting ? "Cancelling..." : cancelCopy.confirmLabel
|
|
10746
10819
|
})]
|
|
10747
10820
|
})]
|
|
@@ -10765,6 +10838,7 @@ function AppointmentCard({ appointment, bookPath, siteTitle, isPast: isApptPast
|
|
|
10765
10838
|
onClick: () => void cancelFlow.submitCancel({ confirmCancelWithoutRefund: true }),
|
|
10766
10839
|
variant: "primary",
|
|
10767
10840
|
size: "sm",
|
|
10841
|
+
extraClassName: "cp-button--danger",
|
|
10768
10842
|
label: cancelFlow.submitting ? "Cancelling..." : "Cancel without refund"
|
|
10769
10843
|
})]
|
|
10770
10844
|
})]
|
|
@@ -10804,10 +10878,7 @@ function AppointmentCard({ appointment, bookPath, siteTitle, isPast: isApptPast
|
|
|
10804
10878
|
className: "cp-card-subtitle cp-card-subtitle--spaced",
|
|
10805
10879
|
children: rescheduleFeedback
|
|
10806
10880
|
}) : null,
|
|
10807
|
-
|
|
10808
|
-
className: "cp-card-subtitle cp-card-subtitle--spaced",
|
|
10809
|
-
children: cancelFlow.feedback.message
|
|
10810
|
-
}) : null,
|
|
10881
|
+
/* @__PURE__ */ jsx(PortalCardNote, { text: cancelCardNote(cancelFlow.feedback, cancelledNotice) }),
|
|
10811
10882
|
/* @__PURE__ */ jsxs("div", {
|
|
10812
10883
|
className: "cp-card-actions",
|
|
10813
10884
|
children: [
|
|
@@ -11069,23 +11140,26 @@ function useFocusedBookingQuestionsTask(api, taskLink) {
|
|
|
11069
11140
|
//#endregion
|
|
11070
11141
|
//#region ../blocks/src/customer-portal/route-client.tsx
|
|
11071
11142
|
/** Reserved customer route, shared by managed and headless hosts. The host supplies theme scope. */
|
|
11072
|
-
function CustomerPortal({ apiBaseUrl, portalToken, siteId, dateContext, now, ...props }) {
|
|
11143
|
+
function CustomerPortal({ apiBaseUrl, portalToken, siteId, dateContext, now, businessPerson = null, ...props }) {
|
|
11073
11144
|
return /* @__PURE__ */ jsx(PortalDateDisplayProvider, {
|
|
11074
11145
|
context: dateContext,
|
|
11075
11146
|
now,
|
|
11076
|
-
children: /* @__PURE__ */ jsx(
|
|
11077
|
-
|
|
11078
|
-
|
|
11079
|
-
|
|
11080
|
-
|
|
11081
|
-
type: "
|
|
11082
|
-
|
|
11083
|
-
|
|
11084
|
-
|
|
11085
|
-
|
|
11086
|
-
|
|
11087
|
-
|
|
11088
|
-
|
|
11147
|
+
children: /* @__PURE__ */ jsx(PortalBusinessPersonProvider, {
|
|
11148
|
+
person: businessPerson,
|
|
11149
|
+
children: /* @__PURE__ */ jsx(BlockApiProvider, {
|
|
11150
|
+
config: {
|
|
11151
|
+
baseUrl: apiBaseUrl,
|
|
11152
|
+
auth: { type: "none" },
|
|
11153
|
+
authOverrides: { portal: portalToken ? {
|
|
11154
|
+
type: "bearer",
|
|
11155
|
+
token: portalToken
|
|
11156
|
+
} : { type: "none" } },
|
|
11157
|
+
siteId
|
|
11158
|
+
},
|
|
11159
|
+
children: /* @__PURE__ */ jsx(CustomerPortalClient, {
|
|
11160
|
+
hasInitialPortalToken: portalToken !== null,
|
|
11161
|
+
...props
|
|
11162
|
+
})
|
|
11089
11163
|
})
|
|
11090
11164
|
})
|
|
11091
11165
|
});
|