@riverbankcms/sdk 0.174.0 → 0.175.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_dts/{BlocksIslandsHydrator-GqVX3I8E.d.ts → BlocksIslandsHydrator-hb2IWD8K.d.ts} +1 -1
- package/dist/_dts/{Page-BhUH31M-.d.ts → Page-BlY68ZF-.d.ts} +7 -7
- package/dist/_dts/{SdkPreviewMode-DBn2x0UL.d.ts → SdkPreviewMode-CA8hU7hW.d.ts} +2 -2
- package/dist/_dts/{client-Cr-sOeSl.d.ts → client-B6tCvmG4.d.ts} +487 -11
- package/dist/_dts/{content-types-DKw1yJdN.d.ts → content-types-B9qryk4R.d.ts} +2 -2
- package/dist/_dts/{contracts-CJ2O03nB.d.ts → contracts-DWoaRxj1.d.ts} +3 -3
- package/dist/_dts/{footerPageOutline-DoGHHKr_.d.ts → footerPageOutline-Djdrhp5s.d.ts} +6 -6
- package/dist/_dts/{generatePageMetadata-CJGu4hoa.d.ts → generatePageMetadata-CFi0vxov.d.ts} +2 -2
- package/dist/_dts/{index--39uLjrr.d.ts → index-Bl5_pjmq.d.ts} +1 -1
- package/dist/_dts/{index-DQZ5L0Gb.d.ts → index-Btp5nIoz.d.ts} +2 -2
- package/dist/_dts/{index-Bq-488M7.d.ts → index-CQUzwOxO.d.ts} +1 -1
- package/dist/_dts/{index-DYlfdT1O.d.ts → index-DmhFb6R1.d.ts} +1 -1
- package/dist/_dts/{index-3GzargmS.d.ts → index-OtazQE3U.d.ts} +2 -2
- package/dist/_dts/{index-DYsP4k6S.d.ts → index-YRQulWB4.d.ts} +3 -3
- package/dist/_dts/{index-DdEi2iXd.d.ts → index-_pXaCO12.d.ts} +4 -4
- package/dist/_dts/{loadContent-BVPagYmy.d.ts → loadContent-Hcuvs4pz.d.ts} +7 -7
- package/dist/_dts/{request-Be1E-H-V.d.ts → request-BT8i_vH-.d.ts} +2070 -503
- package/dist/_dts/{resolveBlockData-D1pL25bD.d.ts → resolveBlockData-B-dJrunl.d.ts} +5 -5
- package/dist/_dts/{resolvePageContent-B4sbTf96.d.ts → resolvePageContent-CVLYWcoI.d.ts} +2 -2
- package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
- package/dist/_dts/sdk/src/client/types.d.ts +2 -2
- package/dist/_dts/sdk/src/client.d.ts +7 -7
- package/dist/_dts/sdk/src/config/index.d.ts +6 -6
- package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
- package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
- package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +2 -2
- package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
- package/dist/_dts/sdk/src/data/types.d.ts +2 -2
- package/dist/_dts/sdk/src/gifting/client.d.ts +13 -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 +3 -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 +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 +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 +2 -1
- package/dist/_dts/{types-Bm5_3VEd.d.ts → types-C0XZnjXz.d.ts} +3 -3
- package/dist/_dts/{types-5MeDI1w8.d.ts → types-CXL1QJSY.d.ts} +7 -7
- package/dist/_dts/{types-CVoCc_Ia.d.ts → types-OKzbqRBx.d.ts} +2 -2
- package/dist/_dts/{validation-lEtYD-Rh.d.ts → validation-Bxi66FtQ.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-DkflFLGQ.mjs → BlocksIslandsHydrator-2xzlERTG.mjs} +17 -16
- package/dist/client/{BookingMailingListNote-CAyoiAGD.mjs → BookingMailingListNote-qsohSEdQ.mjs} +6 -6
- package/dist/client/{BookingPanelArrangement-C7yiJrxm.mjs → BookingPanelArrangement-DrdtON0q.mjs} +1 -1
- package/dist/client/{BookingQuestionFields-DZMrGvBh.mjs → BookingQuestionFields-CUFxBaTM.mjs} +3 -3
- package/dist/client/{CalendarNavigationChevron-BPQU5Snc.mjs → CalendarNavigationChevron-Ch0w0Utn.mjs} +34 -9
- package/dist/client/DemoBookingPortalAccess-DGgsjqXK.mjs +545 -0
- package/dist/client/{EventCalendar.client-BiWQc28-.mjs → EventCalendar.client-Dg4PHFJJ.mjs} +15 -25
- package/dist/client/{EventCombined.client-B_ytWQtn.mjs → EventCombined.client-tky8JcnQ.mjs} +25 -17
- package/dist/client/{EventItem-C-mxXpX_.mjs → EventItem-BybMSKNL.mjs} +4 -3
- package/dist/client/{EventListWeekNavigation-Bm3Ap1Rd.mjs → EventListWeekNavigation-uvWRE5wi.mjs} +1 -1
- package/dist/client/{EventListing.client-Bs_8im5_.mjs → EventListing.client-DQx9dohz.mjs} +3 -3
- package/dist/client/{EventListing.view-CN7BjGgC.mjs → EventListing.view-r31k8Icz.mjs} +8 -7
- package/dist/client/{EventRegistrationPayment-DPkRcSdw.mjs → EventRegistrationPayment-BMmPDmSf.mjs} +664 -362
- package/dist/client/{LocationMapActions-BJT7MqP2.mjs → LocationMapActions-BecH-qhI.mjs} +1 -1
- package/dist/client/{MapDrawingSvg-DCIwlON6.mjs → MapDrawingSvg-BJzmFdcn.mjs} +18 -3
- package/dist/client/{Page--xJ23nA5.mjs → Page-CWN_8cLZ.mjs} +736 -1667
- package/dist/client/{DemoBookingPortalAccess-BnEgvJas.mjs → SiteTermsAgreementField-Dr5lj4oY.mjs} +4 -301
- package/dist/client/{StepIndicator-D391QRNc.mjs → StepIndicator-C7RJBOW3.mjs} +37 -249
- package/dist/client/{accordion-BQtTkDN8.mjs → accordion-uUi_N6mZ.mjs} +1 -1
- package/dist/client/{booking-form.client-D9M7TKGV.mjs → booking-form.client-CKHgxvsh.mjs} +229 -42
- package/dist/client/{bookingForm-BsOS0sl9.mjs → bookingForm-Bi74dmiS.mjs} +4 -4
- package/dist/client/bookings.mjs +22 -15
- package/dist/client/{boxStyleClassNames-CNDLpT06.mjs → boxStyleClassNames-C-gFwhnO.mjs} +3 -29
- package/dist/client/{carousel-CPsW-FPh.mjs → carousel-C0_BqMA0.mjs} +1 -1
- package/dist/client/{cart-CwElmocm.mjs → cart-BOHuppVu.mjs} +3 -3
- package/dist/client/{cart.client-RpqI56w8.mjs → cart.client-IfJE1zAp.mjs} +1 -1
- package/dist/client/{checkout-CfMgqY8H.mjs → checkout-C3Aj-aNa.mjs} +3 -3
- package/dist/client/{checkout.client-BpuPyOuJ.mjs → checkout.client-Tg9lfeYf.mjs} +1 -1
- package/dist/client/{checkoutUrls-VeHY6WYj.mjs → checkoutUrls-OLqQdAXD.mjs} +1 -1
- package/dist/client/client.mjs +113 -21
- package/dist/client/{context-CNlesLfF.mjs → context-D8TpQXjX.mjs} +76 -58
- package/dist/client/{course-q1sA4Cj-.mjs → course-DHmeQAvq.mjs} +2 -2
- package/dist/client/{creditProducts-KYMVIH3J.mjs → creditProducts-BQ1t1erI.mjs} +14 -61
- package/dist/client/{dateFormatting-B73Ll0s4.mjs → dateFormatting-ABCZWkpT.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-BVbLD4pi.mjs → demoPortalMagicLink-BdcuW_pa.mjs} +1 -1
- package/dist/client/display-DMqotaGU.mjs +11797 -0
- package/dist/client/{enhanceHeaderSection-BzjY6AiY.mjs → enhanceHeaderSection-Ciuhsk0E.mjs} +3 -3
- package/dist/client/{event-details.client-CseTWUFC.mjs → event-details.client-CJapNbTv.mjs} +1 -1
- package/dist/client/{event-registration.client-b5TLxntR.mjs → event-registration.client-CAdcpnLc.mjs} +295 -188
- package/dist/client/{eventCalendar-C-kJNIc9.mjs → eventCalendar-BlsD5R8M.mjs} +4 -4
- package/dist/client/{eventCombined-BgHJGhwE.mjs → eventCombined-B9Ly3024.mjs} +4 -4
- package/dist/client/{eventDetails-CAwbreD0.mjs → eventDetails-CbEGI4jO.mjs} +2 -2
- package/dist/client/{eventListing-_14atrj8.mjs → eventListing-ZSmvhWII.mjs} +4 -4
- package/dist/client/{eventRegistration-BOqSdstJ.mjs → eventRegistration-D-yUcIyO.mjs} +4 -4
- package/dist/client/{form-DfAB-llc.mjs → form-DG_YZSNn.mjs} +3 -3
- package/dist/client/{form.client-DN-I9_qC.mjs → form.client-BU6dM0-C.mjs} +4 -4
- package/dist/client/{form.parts-t2Q1neM6.mjs → form.parts-Db0Iq7nx.mjs} +1 -1
- package/dist/client/{formatDate-Dp7POa9Y.mjs → formatDate-DFfWHpQB.mjs} +1 -1
- package/dist/client/gifting/client.mjs +5 -3
- package/dist/client/gifting-DMrsN4B4.mjs +28 -0
- package/dist/client/gifting.client-BVa2XYJB.mjs +404 -0
- package/dist/client/gifting.parts-C2u4Y-pf.mjs +86 -0
- package/dist/client/{headerSection-Dces54pb.mjs → headerSection-D91EzlOR.mjs} +2 -2
- package/dist/client/{display-D8MW2b0e.mjs → lookSurfaces-BDZLALxj.mjs} +3084 -12938
- package/dist/client/{newsletter-form.client-D_YFUlR2.mjs → newsletter-form.client-BMGRiRpo.mjs} +7 -5
- package/dist/client/{newsletter-form.parts-URO5Mn_I.mjs → newsletter-form.parts-D5UfUaD3.mjs} +3 -3
- package/dist/client/{newsletterForm-_c9fKIzS.mjs → newsletterForm-B_67sNwa.mjs} +3 -3
- package/dist/client/{noop-D5mFWXtN.mjs → noop-DF8_EiFt.mjs} +93 -28
- package/dist/client/portal/client.mjs +313 -148
- package/dist/client/{product-detail.client-CVW1UIxJ.mjs → product-detail.client-D-XNir0m.mjs} +1 -1
- package/dist/client/{product-list.client-CF9hO23G.mjs → product-list.client-BLfYQ-qi.mjs} +1 -1
- package/dist/client/{productDetail-C_qbmUuP.mjs → productDetail-W0_0lDGe.mjs} +3 -3
- package/dist/client/{productList-Df5qDD0z.mjs → productList-ayAtPJdb.mjs} +3 -3
- package/dist/client/{propsDecoder-BiEyK2ii.mjs → propsDecoder-ChYKWjLA.mjs} +4 -3
- package/dist/client/{registry.server-ClcfWpvM.mjs → registry.server-B1EEZkcr.mjs} +311 -262
- package/dist/client/rendering/client.mjs +25 -491
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +7 -7
- package/dist/client/{richText-coerce-C32cRQ03.mjs → richText-coerce-CDAfpMQU.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-DAypPzSo.mjs → routeIslandApiConfig-CcGWvyht.mjs} +1 -1
- package/dist/client/{shop-gteEpeO5.mjs → shop-DbUUoHFJ.mjs} +3 -3
- package/dist/client/{shop-discount-apply.state-DidgH7ow.mjs → shop-add-feedback-DvC2kP1K.mjs} +1 -78
- package/dist/client/{shop-commerce-Bw4_BXQg.mjs → shop-commerce-aQqcDmyZ.mjs} +64 -32
- package/dist/client/{shop-commerce-store-Da6Ah-_4.mjs → shop-commerce-store-Cd7USpuY.mjs} +1 -1
- package/dist/client/shop-discount-apply.state-DGvPBmVP.mjs +83 -0
- package/dist/client/{shop.client-CbbdjWWd.mjs → shop.client-BNZ9M8cG.mjs} +56 -19
- package/dist/client/{shop.interactive-CKFORzux.mjs → shop.interactive-CJAINJr3.mjs} +118 -39
- package/dist/client/{shopShared-C7QjoywZ.mjs → shopShared-DwVAuGsx.mjs} +2 -2
- package/dist/client/{timetableModel-CtZiIj9q.mjs → timetableModel-DBTIFWTb.mjs} +11 -148
- package/dist/client/{useAvailableSlots-CUVRD1nx.mjs → useAvailableSlots-BomyyKeo.mjs} +3 -3
- package/dist/client/{useDiscountCodeUi-BuLgof7O.mjs → useDiscountCodeUi-CCxHMWlU.mjs} +32 -17
- package/dist/client/{useEventPagination-B4VPtSEF.mjs → useEventPagination-Bjin_qaN.mjs} +7 -6
- package/dist/client/{view-CvlTplao.mjs → view-BTk470k0.mjs} +3 -2
- package/dist/client/{view-CxUpgcM6.mjs → view-Cw4EmEPv.mjs} +100 -32
- package/dist/preview-next/client/{PageSectionToolbar-BFbSrDbi.mjs → PageSectionToolbar-bq7gbKvn.mjs} +4 -4
- package/dist/preview-next/client/{PreviewEditorSidebar-BtpzqQ-i.mjs → PreviewEditorSidebar-DVsPNcos.mjs} +32 -29
- package/dist/preview-next/client/{PreviewEditorUI-z22h-CCY.mjs → PreviewEditorUI-B-pq3aZc.mjs} +4 -4
- package/dist/preview-next/client/{PreviewShell-BW3Qpoa_.mjs → PreviewShell-ChyjB96e.mjs} +5 -5
- package/dist/preview-next/client/{SdkPreviewModeRuntime-BvVeK1hR.mjs → SdkPreviewModeRuntime-D_czeC0l.mjs} +84 -101
- package/dist/preview-next/client/{previewAssistantSlot-BUqAh1FL.mjs → previewAssistantSlot-B61mZd81.mjs} +4981 -3275
- package/dist/preview-next/client/{previewChromeRoot-NCy5zHO8.mjs → previewChromeRoot-dwOn9XtM.mjs} +1 -1
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-CxmKDVGZ.mjs → sdk-runtime-DZDfOxoW.mjs} +2 -2
- package/dist/preview-next/client/{siteStyleAccess-B_UaDyJO.mjs → siteStyleAccess-BZDIC-fA.mjs} +529 -238
- package/dist/preview-next/client/{useAutosaveStatus-BqmWvPLY.mjs → useAutosaveStatus-BbzLMf-l.mjs} +1 -1
- package/dist/preview-next/client/{useOpenBlockForSetup-LAllV0rU.mjs → useOpenBlockForSetup-BEXcWQeI.mjs} +25 -5
- package/dist/preview-next/container-responsive.css +51 -3
- package/dist/preview-next/keepAlive.mjs +1 -1
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-DV6SeCNv.mjs → route-contract-0gSlK9S0.mjs} +87 -12
- package/dist/server/{Block.shared-Ch2FKAvU.mjs → Block.shared-DeXXycg8.mjs} +4 -4
- package/dist/server/{ThemeScopeCore-DFvjDVzi.mjs → ThemeScopeCore-DFEM1a85.mjs} +16 -2
- package/dist/server/{bindings-CQg2lzZn.mjs → bindings-7L3pC5Os.mjs} +13 -34
- package/dist/server/{client-aYRTVneD.mjs → client-CgghATBm.mjs} +112 -20
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/{customCss-BGB8gMVb.mjs → customCss-BZ8YSrQg.mjs} +1 -0
- package/dist/server/data/resolveBlockData.mjs +1 -1
- package/dist/server/index.mjs +2 -2
- package/dist/server/{loadContent-Cgpfr44e.mjs → loadContent-D7M5Vcug.mjs} +5 -5
- package/dist/server/{loadPage-RDk10NMP.mjs → loadPage-CiTId05y.mjs} +2 -2
- package/dist/server/{lookMediaFrame-CQtkvlDn.mjs → lookMediaFrame-CaH018pK.mjs} +129 -12
- package/dist/server/next.mjs +35 -9
- package/dist/server/{overrideResolution-VhhN94d8.mjs → overrideResolution-CJ3MRI5Q.mjs} +1 -1
- package/dist/server/page-converter.mjs +1 -1
- package/dist/server/{pageRenderPlan-CkFTsxkd.mjs → pageRenderPlan-Cuos4Xcd.mjs} +105 -357
- package/dist/server/{pageRuntimeSupport-CpAtzNxD.mjs → pageRuntimeSupport-CuVj3bkd.mjs} +4 -3
- package/dist/server/{pageShared-B8yLPjs0.mjs → pageShared-JxlV8_Bo.mjs} +1707 -1811
- package/dist/server/{parseThemeForPersistence-Cwqb5pZx.mjs → parseThemeForPersistence-DOsfofCy.mjs} +1 -1
- package/dist/server/{prebuild-DOu6QceG.mjs → prebuild-BDhlJbAx.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-CfOXFKYG.mjs → prefetchBlockData-kERh_c0v.mjs} +2 -2
- package/dist/server/{registry-34rkAfaU.mjs → registry-cQ9N5W-n.mjs} +21091 -20209
- package/dist/server/rendering/components/pageShared.mjs +1 -1
- package/dist/server/rendering/helpers/loadPage.mjs +1 -1
- package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +1 -1
- package/dist/server/rendering/server.mjs +3 -3
- package/dist/server/rendering.mjs +7 -7
- package/dist/server/{resolveBlockData-D7VeoWgr.mjs → resolveBlockData-CN4UmmTK.mjs} +1 -1
- package/dist/server/{schema-CUDHMirj.mjs → schema-BpsqaSSU.mjs} +2 -2
- package/dist/server/server.mjs +3 -3
- package/dist/server/theme-bridge.mjs +1 -1
- package/dist/server/theme.mjs +2 -2
- package/dist/server/{validation-CLVKoJrX.mjs → validation-3puM5SM8.mjs} +3 -3
- package/dist/server/{version-HVfdvBJ0.mjs → version-B8g-Wx57.mjs} +1 -1
- package/dist/styles/index.css +361 -57
- package/package.json +1 -1
- package/dist/client/bookability-CE637yDE.mjs +0 -17
- package/dist/client/useDiscountApply-BZU5DWZQ.mjs +0 -199
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { n as assertNever, t as logger, xn as formatCurrencyAmount, yn as parsePositiveMoneyInputToCents } from "../noop-DF8_EiFt.mjs";
|
|
4
|
+
import { D as unsafeAsAppointmentResourceId, T as assertNever$1, c as initialBookingQuestionValues, f as unansweredRequiredBookingQuestions, g as formatCreditProductUnits, i as UNANSWERED_QUESTION_MESSAGE, m as formatCreditProductBalance, n as getCreditProductTypeLabel, r as UNANSWERED_QUESTIONS_SUMMARY, t as deriveCreditProductLabels, y as formatOrderInstalmentStatusLabel$1 } from "../creditProducts-BQ1t1erI.mjs";
|
|
5
5
|
import { t as generateUuidV4 } from "../uuid-BETKW8rS.mjs";
|
|
6
|
-
import { n as useAvailableDates, s as clientPersonPhrases, t as useAvailableSlots } from "../useAvailableSlots-
|
|
7
|
-
import { a as createBlockApi, i as BlockApiError, n as useBlockApi, t as BlockApiProvider } from "../context-
|
|
6
|
+
import { n as useAvailableDates, s as clientPersonPhrases, t as useAvailableSlots } from "../useAvailableSlots-BomyyKeo.mjs";
|
|
7
|
+
import { a as createBlockApi, i as BlockApiError, n as useBlockApi, t as BlockApiProvider } from "../context-D8TpQXjX.mjs";
|
|
8
8
|
import { S as clsx, i as ThemedButtonLink, l as SpinnerNode, o as ThemedFileChooser, r as ThemedButton, t as ThemedActionsButton } from "../ThemedButton-DuaYtnvG.mjs";
|
|
9
9
|
import { t as resolveDedicatedBookingHref } from "../bookingRoute-D6DlxYx6.mjs";
|
|
10
|
-
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-CUFxBaTM.mjs";
|
|
11
11
|
import { t as ModalShell } from "../ModalShell-B_fHWK71.mjs";
|
|
12
12
|
import { t as TabBarFragment } from "../TabBarFragment-BqfRLojo.mjs";
|
|
13
|
-
import { t as formatDate } from "../formatDate-
|
|
14
|
-
import { n as buildPortalCallbackUrl, r as requestDemoPortalMagicLink } from "../demoPortalMagicLink-
|
|
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-
|
|
13
|
+
import { t as formatDate } from "../formatDate-DFfWHpQB.mjs";
|
|
14
|
+
import { n as buildPortalCallbackUrl, r as requestDemoPortalMagicLink } from "../demoPortalMagicLink-BdcuW_pa.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-ABCZWkpT.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";
|
|
@@ -5628,6 +5628,87 @@ function BeforeYouComeTaskDisplay({ task, ...props }) {
|
|
|
5628
5628
|
});
|
|
5629
5629
|
}
|
|
5630
5630
|
//#endregion
|
|
5631
|
+
//#region ../blocks/src/customer-portal/components/bookings/eventCancelCopy.ts
|
|
5632
|
+
const CANCEL = "This will cancel your booking.";
|
|
5633
|
+
const CARD_TIME = "It can take 5–10 working days to appear.";
|
|
5634
|
+
function keepReason(reason, siteTitle) {
|
|
5635
|
+
switch (reason.kind) {
|
|
5636
|
+
case "cutoff_passed": return `it's less than ${formatCancellationCutoffSpan(reason.cutoffHours)} until it starts`;
|
|
5637
|
+
case "never_refunded": return siteTitle ? `${siteTitle} doesn't refund cancelled bookings` : "cancelled bookings aren't refunded";
|
|
5638
|
+
case "non_refundable_deposit": return "the deposit isn't refundable";
|
|
5639
|
+
}
|
|
5640
|
+
}
|
|
5641
|
+
function passCredits(credits) {
|
|
5642
|
+
return credits === 1 ? "pass credit" : `${credits} pass credits`;
|
|
5643
|
+
}
|
|
5644
|
+
function refundSentence(outcome) {
|
|
5645
|
+
const amount = formatCurrencyAmount(outcome.money.amountCents, outcome.money.currency);
|
|
5646
|
+
const deposit = protectedDepositCancelSentence(outcome);
|
|
5647
|
+
const suffix = deposit ? ` ${deposit}` : "";
|
|
5648
|
+
switch (outcome.to) {
|
|
5649
|
+
case "card": return `You'll get ${amount} back on your card. ${CARD_TIME}${suffix}`;
|
|
5650
|
+
case "site_credit": return `You'll get ${amount} back as credit on your account.${suffix}`;
|
|
5651
|
+
case "card_and_site_credit": return `You'll get ${amount} back, partly on your card and partly as credit on your account. The card part can take 5–10 working days to appear.${suffix}`;
|
|
5652
|
+
}
|
|
5653
|
+
}
|
|
5654
|
+
function moneySentence(outcome, siteTitle) {
|
|
5655
|
+
switch (outcome.kind) {
|
|
5656
|
+
case "nothing_to_return": return null;
|
|
5657
|
+
case "refund": return refundSentence(outcome);
|
|
5658
|
+
case "credit_back": return `You'll get your ${passCredits(outcome.credits)} back.`;
|
|
5659
|
+
case "keep_money": return `You won't get your ${formatCurrencyAmount(outcome.money.amountCents, outcome.money.currency)} back, because ${keepReason(outcome.reason, siteTitle)}.`;
|
|
5660
|
+
case "keep_credit": return `You won't get your ${passCredits(outcome.credits)} back, because ${keepReason(outcome.reason, siteTitle)}.`;
|
|
5661
|
+
case "contact_business": return `Your ${formatCurrencyAmount(outcome.money.amountCents, outcome.money.currency)} can't be refunded online, so please contact ${siteTitle ?? "the business"} about it.`;
|
|
5662
|
+
}
|
|
5663
|
+
}
|
|
5664
|
+
/** The cancel dialog's words. The server decides the outcome; this only says it. */
|
|
5665
|
+
function eventCancelBody(outcome, siteTitle) {
|
|
5666
|
+
const money = outcome ? moneySentence(outcome, siteTitle) : null;
|
|
5667
|
+
return money ? `${CANCEL} ${money}` : CANCEL;
|
|
5668
|
+
}
|
|
5669
|
+
/** The protected amount stays explicit wherever a client confirms cancellation. */
|
|
5670
|
+
function protectedDepositCancelSentence(outcome) {
|
|
5671
|
+
const deposit = outcome?.kind === "refund" ? outcome.keptDeposit : outcome?.kind === "keep_money" && outcome.reason.kind === "non_refundable_deposit" ? outcome.money : null;
|
|
5672
|
+
return deposit ? `You won't get your ${formatCurrencyAmount(deposit.amountCents, deposit.currency)} deposit back, as it isn't refundable.` : null;
|
|
5673
|
+
}
|
|
5674
|
+
//#endregion
|
|
5675
|
+
//#region ../blocks/src/customer-portal/components/bookings/PortalCancelNote.tsx
|
|
5676
|
+
const PortalCancelNoticesContext = React$1.createContext({
|
|
5677
|
+
notices: {},
|
|
5678
|
+
record: () => void 0
|
|
5679
|
+
});
|
|
5680
|
+
/** Cancelling moves a row to another group, which remounts it, so its confirmation is kept above the groups. */
|
|
5681
|
+
function PortalCancelNotices({ children }) {
|
|
5682
|
+
const [notices, setNotices] = React$1.useState({});
|
|
5683
|
+
const record = React$1.useCallback((bookingId, message) => {
|
|
5684
|
+
setNotices((current) => ({
|
|
5685
|
+
...current,
|
|
5686
|
+
[bookingId]: message
|
|
5687
|
+
}));
|
|
5688
|
+
}, []);
|
|
5689
|
+
const value = React$1.useMemo(() => ({
|
|
5690
|
+
notices,
|
|
5691
|
+
record
|
|
5692
|
+
}), [notices, record]);
|
|
5693
|
+
return /* @__PURE__ */ jsx(PortalCancelNoticesContext.Provider, {
|
|
5694
|
+
value,
|
|
5695
|
+
children
|
|
5696
|
+
});
|
|
5697
|
+
}
|
|
5698
|
+
/** A row's latest cancel or transfer message, or the confirmation kept from before it moved. */
|
|
5699
|
+
function PortalCancelNote({ feedback, bookingId }) {
|
|
5700
|
+
const kept = React$1.useContext(PortalCancelNoticesContext).notices[bookingId];
|
|
5701
|
+
if (feedback.tag === "error") return /* @__PURE__ */ jsx("div", {
|
|
5702
|
+
className: "cp-row-note cp-row-note--error",
|
|
5703
|
+
children: feedback.message
|
|
5704
|
+
});
|
|
5705
|
+
const message = feedback.tag === "success" ? feedback.message : kept;
|
|
5706
|
+
return message ? /* @__PURE__ */ jsx("div", {
|
|
5707
|
+
className: "cp-row-note cp-row-note--success",
|
|
5708
|
+
children: message
|
|
5709
|
+
}) : null;
|
|
5710
|
+
}
|
|
5711
|
+
//#endregion
|
|
5631
5712
|
//#region ../blocks/src/customer-portal/components/bookings/portalEventReschedulePresentation.ts
|
|
5632
5713
|
const studioName = (studio) => studio?.trim() || "the organiser";
|
|
5633
5714
|
function firstName(name) {
|
|
@@ -5979,10 +6060,10 @@ function EventSeriesRegistrationTableRow({ enrollment, primaryDateLabel, session
|
|
|
5979
6060
|
className: "cp-row-mobile-actions cp-only-mobile",
|
|
5980
6061
|
children: actionsButton
|
|
5981
6062
|
}) : null,
|
|
5982
|
-
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
})
|
|
6063
|
+
/* @__PURE__ */ jsx(PortalCancelNote, {
|
|
6064
|
+
feedback: cancelFlow.feedback,
|
|
6065
|
+
bookingId: enrollment.id
|
|
6066
|
+
})
|
|
5986
6067
|
] }),
|
|
5987
6068
|
/* @__PURE__ */ jsx(RegistrationTicketCells, {
|
|
5988
6069
|
enrollment,
|
|
@@ -6077,6 +6158,7 @@ function formatPortalCancelSuccessMessage(result) {
|
|
|
6077
6158
|
//#endregion
|
|
6078
6159
|
//#region ../blocks/src/customer-portal/components/bookings/usePortalCancelFlow.ts
|
|
6079
6160
|
function usePortalCancelFlow(options) {
|
|
6161
|
+
const recordNotice = React$1.useContext(PortalCancelNoticesContext).record;
|
|
6080
6162
|
const [state, dispatch] = React$1.useReducer(portalCancelReducer, initialPortalCancelState);
|
|
6081
6163
|
const startCancelFlow = React$1.useCallback(() => {
|
|
6082
6164
|
dispatch({ type: "start-cancel-flow" });
|
|
@@ -6100,10 +6182,12 @@ function usePortalCancelFlow(options) {
|
|
|
6100
6182
|
});
|
|
6101
6183
|
return;
|
|
6102
6184
|
}
|
|
6185
|
+
const message = formatPortalCancelSuccessMessage(res);
|
|
6103
6186
|
dispatch({
|
|
6104
6187
|
type: "submit-succeeded",
|
|
6105
|
-
message
|
|
6188
|
+
message
|
|
6106
6189
|
});
|
|
6190
|
+
if (options.bookingId) recordNotice(options.bookingId, message);
|
|
6107
6191
|
try {
|
|
6108
6192
|
await options.onRefresh();
|
|
6109
6193
|
} catch (refreshError) {
|
|
@@ -6116,7 +6200,11 @@ function usePortalCancelFlow(options) {
|
|
|
6116
6200
|
message: err instanceof Error ? err.message : "Failed to cancel booking."
|
|
6117
6201
|
});
|
|
6118
6202
|
}
|
|
6119
|
-
}, [
|
|
6203
|
+
}, [
|
|
6204
|
+
options,
|
|
6205
|
+
recordNotice,
|
|
6206
|
+
state.submitting
|
|
6207
|
+
]);
|
|
6120
6208
|
const dismissCancelFlow = React$1.useCallback(() => {
|
|
6121
6209
|
dispatch({ type: "dismiss-dialog" });
|
|
6122
6210
|
}, []);
|
|
@@ -6193,6 +6281,7 @@ function EventSeriesRegistrationDialogs({ enrollment, actionsOpen, setActionsOpe
|
|
|
6193
6281
|
})
|
|
6194
6282
|
}) : null, /* @__PURE__ */ jsx(EventSeriesCancellationDialog, {
|
|
6195
6283
|
enrollmentId: enrollment.id,
|
|
6284
|
+
moneyOnCancel: enrollment.actions?.moneyOnCancel,
|
|
6196
6285
|
cancelFlow
|
|
6197
6286
|
})] });
|
|
6198
6287
|
}
|
|
@@ -6227,14 +6316,18 @@ function CourseCancelTile({ tile, cancelFlow, close }) {
|
|
|
6227
6316
|
})]
|
|
6228
6317
|
});
|
|
6229
6318
|
}
|
|
6230
|
-
function
|
|
6319
|
+
function seriesCancelConfirmLabel(submitting, withoutRefund) {
|
|
6320
|
+
if (submitting) return "Cancelling…";
|
|
6321
|
+
return withoutRefund ? "Cancel without refund" : "Confirm cancel";
|
|
6322
|
+
}
|
|
6323
|
+
function EventSeriesCancellationDialog({ enrollmentId, moneyOnCancel, cancelFlow }) {
|
|
6231
6324
|
if (cancelFlow.dialog.tag === "closed") return null;
|
|
6232
6325
|
const withoutRefund = cancelFlow.dialog.tag === "confirmWithoutRefund";
|
|
6233
6326
|
return /* @__PURE__ */ jsxs(PortalModal, {
|
|
6234
6327
|
title: withoutRefund ? "Cancel without a refund?" : "Cancel booking?",
|
|
6235
6328
|
titleId: `cp-cancel-course-${withoutRefund ? "no-refund-" : ""}${enrollmentId}`,
|
|
6236
6329
|
onClose: cancelFlow.dismissCancelFlow,
|
|
6237
|
-
children: [/* @__PURE__ */ jsx("div", { children: cancelFlow.dialog.tag === "confirmWithoutRefund" ? cancelFlow.dialog.message : "This will cancel your booking for every session." }), /* @__PURE__ */ jsxs("div", {
|
|
6330
|
+
children: [/* @__PURE__ */ jsx("div", { children: cancelFlow.dialog.tag === "confirmWithoutRefund" ? cancelFlow.dialog.message : ["This will cancel your booking for every session.", protectedDepositCancelSentence(moneyOnCancel)].filter(Boolean).join(" ") }), /* @__PURE__ */ jsxs("div", {
|
|
6238
6331
|
className: "cp-modal__actions",
|
|
6239
6332
|
children: [/* @__PURE__ */ jsx(ThemedButton, {
|
|
6240
6333
|
type: "button",
|
|
@@ -6249,7 +6342,7 @@ function EventSeriesCancellationDialog({ enrollmentId, cancelFlow }) {
|
|
|
6249
6342
|
onClick: () => void cancelFlow.submitCancel(withoutRefund ? { confirmCancelWithoutRefund: true } : void 0),
|
|
6250
6343
|
variant: "primary",
|
|
6251
6344
|
size: "sm",
|
|
6252
|
-
label: cancelFlow.submitting
|
|
6345
|
+
label: seriesCancelConfirmLabel(cancelFlow.submitting, withoutRefund)
|
|
6253
6346
|
})]
|
|
6254
6347
|
})]
|
|
6255
6348
|
});
|
|
@@ -6260,7 +6353,8 @@ function EventSeriesRegistrationRow({ enrollment, siteTitle, isPast = false, sho
|
|
|
6260
6353
|
const [actionsOpen, setActionsOpen] = React$1.useState(false);
|
|
6261
6354
|
const cancelFlow = usePortalCancelFlow({
|
|
6262
6355
|
cancel: React$1.useCallback((opts) => api.cancelWholeSeriesRegistration(enrollment.id, { confirmCancelWithoutRefund: opts?.confirmCancelWithoutRefund }), [api, enrollment.id]),
|
|
6263
|
-
onRefresh
|
|
6356
|
+
onRefresh,
|
|
6357
|
+
bookingId: enrollment.id
|
|
6264
6358
|
});
|
|
6265
6359
|
const { primaryDateLabel, sessionDatesSummary, sessionCountLabel, cancelTile, canViewEventDetails, hasAnyActions, statusBadge, isMuted, additionalParticipants } = presentEventSeriesRegistration(enrollment, isPast, siteTitle, context);
|
|
6266
6360
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(EventSeriesRegistrationDialogs, {
|
|
@@ -7140,7 +7234,8 @@ function EventRow({ event, siteTitle, isPast: isEventPast = false, showActionsCo
|
|
|
7140
7234
|
const [guestError, setGuestError] = React$1.useState(null);
|
|
7141
7235
|
const cancelFlow = usePortalCancelFlow({
|
|
7142
7236
|
cancel: React$1.useCallback((opts) => api.cancelEventRegistration(event.id, opts), [api, event.id]),
|
|
7143
|
-
onRefresh
|
|
7237
|
+
onRefresh,
|
|
7238
|
+
bookingId: event.id
|
|
7144
7239
|
});
|
|
7145
7240
|
const expectedGuestCount = event.ticketsCount - 1;
|
|
7146
7241
|
const showGuestSection = expectedGuestCount > 0;
|
|
@@ -7469,7 +7564,7 @@ function EventRow({ event, siteTitle, isPast: isEventPast = false, showActionsCo
|
|
|
7469
7564
|
title: "Cancel booking?",
|
|
7470
7565
|
titleId: `cp-cancel-${event.id}`,
|
|
7471
7566
|
onClose: cancelFlow.dismissCancelFlow,
|
|
7472
|
-
children: [/* @__PURE__ */ jsx("div", { children:
|
|
7567
|
+
children: [/* @__PURE__ */ jsx("div", { children: eventCancelBody(event.actions.moneyOnCancel, siteTitle) }), /* @__PURE__ */ jsxs("div", {
|
|
7473
7568
|
className: "cp-modal__actions",
|
|
7474
7569
|
children: [/* @__PURE__ */ jsx(ThemedButton, {
|
|
7475
7570
|
type: "button",
|
|
@@ -7557,9 +7652,9 @@ function EventRow({ event, siteTitle, isPast: isEventPast = false, showActionsCo
|
|
|
7557
7652
|
disabled: anySubmitting
|
|
7558
7653
|
})
|
|
7559
7654
|
}),
|
|
7560
|
-
|
|
7561
|
-
|
|
7562
|
-
|
|
7655
|
+
/* @__PURE__ */ jsx(PortalCancelNote, {
|
|
7656
|
+
feedback: cancelFlow.feedback,
|
|
7657
|
+
bookingId: event.id
|
|
7563
7658
|
})
|
|
7564
7659
|
] }),
|
|
7565
7660
|
/* @__PURE__ */ jsx("td", {
|
|
@@ -7856,7 +7951,7 @@ function WaitlistsSection({ waitlists, focusedEntryId, onLeave, onRefresh, onFee
|
|
|
7856
7951
|
//#region ../blocks/src/customer-portal/components/bookings/BookingsSection.tsx
|
|
7857
7952
|
function BookingsSection({ siteTitle, events, wholeSeriesRegistrations, waitlists = [], focusedWaitlistEntryId = null, emptyMessage, onRefresh, onWaitlistFeedback, onUpdateGuests, onLeaveWaitlist = async () => ({ outcome: "notFound" }) }) {
|
|
7858
7953
|
const { now } = usePortalDateDisplay();
|
|
7859
|
-
const { items, upcoming, past } = React$1.useMemo(() => groupPortalBookings(events, wholeSeriesRegistrations, now), [
|
|
7954
|
+
const { items, upcoming, cancelled, past } = React$1.useMemo(() => groupPortalBookings(events, wholeSeriesRegistrations, now), [
|
|
7860
7955
|
events,
|
|
7861
7956
|
wholeSeriesRegistrations,
|
|
7862
7957
|
now
|
|
@@ -7878,34 +7973,47 @@ function BookingsSection({ siteTitle, events, wholeSeriesRegistrations, waitlist
|
|
|
7878
7973
|
});
|
|
7879
7974
|
return /* @__PURE__ */ jsxs("div", {
|
|
7880
7975
|
className: "cp-section cp-section--events",
|
|
7881
|
-
children: [
|
|
7882
|
-
|
|
7883
|
-
|
|
7884
|
-
|
|
7885
|
-
|
|
7886
|
-
|
|
7887
|
-
|
|
7888
|
-
|
|
7889
|
-
|
|
7890
|
-
className: "cp-section-title",
|
|
7891
|
-
style: { marginTop: waitlists.length > 0 ? "2rem" : 0 },
|
|
7892
|
-
children: "Upcoming bookings"
|
|
7893
|
-
}), /* @__PURE__ */ jsx(BookingsTable, {
|
|
7976
|
+
children: [/* @__PURE__ */ jsx(WaitlistsSection, {
|
|
7977
|
+
waitlists,
|
|
7978
|
+
focusedEntryId: focusedWaitlistEntryId,
|
|
7979
|
+
onLeave: onLeaveWaitlist,
|
|
7980
|
+
onFeedback: onWaitlistFeedback,
|
|
7981
|
+
onRefresh
|
|
7982
|
+
}), /* @__PURE__ */ jsxs(PortalCancelNotices, { children: [
|
|
7983
|
+
/* @__PURE__ */ jsx(BookingGroup, {
|
|
7984
|
+
title: "Upcoming bookings",
|
|
7894
7985
|
items: upcoming,
|
|
7895
|
-
|
|
7896
|
-
|
|
7897
|
-
|
|
7898
|
-
|
|
7899
|
-
|
|
7900
|
-
|
|
7901
|
-
|
|
7986
|
+
first: waitlists.length === 0,
|
|
7987
|
+
tableProps
|
|
7988
|
+
}),
|
|
7989
|
+
/* @__PURE__ */ jsx(BookingGroup, {
|
|
7990
|
+
title: "Cancelled",
|
|
7991
|
+
items: cancelled,
|
|
7992
|
+
first: waitlists.length === 0 && upcoming.length === 0,
|
|
7993
|
+
tableProps
|
|
7994
|
+
}),
|
|
7995
|
+
/* @__PURE__ */ jsx(BookingGroup, {
|
|
7996
|
+
title: "Past bookings",
|
|
7902
7997
|
items: past,
|
|
7903
7998
|
isPast: true,
|
|
7904
|
-
|
|
7905
|
-
|
|
7906
|
-
|
|
7999
|
+
first: upcoming.length + cancelled.length === 0,
|
|
8000
|
+
tableProps
|
|
8001
|
+
})
|
|
8002
|
+
] })]
|
|
7907
8003
|
});
|
|
7908
8004
|
}
|
|
8005
|
+
function BookingGroup({ title, items, isPast, first, tableProps }) {
|
|
8006
|
+
if (items.length === 0) return null;
|
|
8007
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("h3", {
|
|
8008
|
+
className: "cp-section-title",
|
|
8009
|
+
style: { marginTop: first ? 0 : "2rem" },
|
|
8010
|
+
children: title
|
|
8011
|
+
}), /* @__PURE__ */ jsx(BookingsTable, {
|
|
8012
|
+
items,
|
|
8013
|
+
isPast,
|
|
8014
|
+
...tableProps
|
|
8015
|
+
})] });
|
|
8016
|
+
}
|
|
7909
8017
|
function groupPortalBookings(events, wholeSeriesRegistrations, now) {
|
|
7910
8018
|
const items = [...events.map((event) => ({
|
|
7911
8019
|
kind: "event",
|
|
@@ -7916,12 +8024,17 @@ function groupPortalBookings(events, wholeSeriesRegistrations, now) {
|
|
|
7916
8024
|
startsAt: getEventSeriesRegistrationSortDate(enrollment),
|
|
7917
8025
|
enrollment
|
|
7918
8026
|
}))];
|
|
8027
|
+
const future = items.filter((item) => !isPast(item.startsAt, now)).sort((a, b) => a.startsAt.localeCompare(b.startsAt));
|
|
7919
8028
|
return {
|
|
7920
8029
|
items,
|
|
7921
|
-
upcoming:
|
|
8030
|
+
upcoming: future.filter((item) => !isCancelledBooking(item)),
|
|
8031
|
+
cancelled: future.filter(isCancelledBooking),
|
|
7922
8032
|
past: items.filter((item) => isPast(item.startsAt, now)).sort((a, b) => b.startsAt.localeCompare(a.startsAt))
|
|
7923
8033
|
};
|
|
7924
8034
|
}
|
|
8035
|
+
function isCancelledBooking(item) {
|
|
8036
|
+
return (item.kind === "event" ? item.event.status : item.enrollment.status) === "cancelled";
|
|
8037
|
+
}
|
|
7925
8038
|
//#endregion
|
|
7926
8039
|
//#region ../blocks/src/system/runtime/shared/useAppointmentRescheduleFlow.state.ts
|
|
7927
8040
|
const ANY_PRACTITIONER_SENTINEL = "__any__";
|
|
@@ -8501,6 +8614,7 @@ function keepReasonClause(reason, siteTitle) {
|
|
|
8501
8614
|
switch (reason.kind) {
|
|
8502
8615
|
case "cutoff_passed": return `your appointment starts in less than ${formatCancellationCutoffSpan(reason.cutoffHours)}`;
|
|
8503
8616
|
case "never_refunded": return siteTitle !== null && siteTitle !== void 0 && siteTitle !== "" ? `${siteTitle} doesn't refund cancelled appointments` : "cancelled appointments aren't refunded";
|
|
8617
|
+
case "non_refundable_deposit": return "the deposit isn't refundable";
|
|
8504
8618
|
}
|
|
8505
8619
|
}
|
|
8506
8620
|
function packageCredits(credits) {
|
|
@@ -8529,7 +8643,7 @@ function appointmentCancelCopy(appointment, siteTitle) {
|
|
|
8529
8643
|
return {
|
|
8530
8644
|
buttonLabel: "Cancel",
|
|
8531
8645
|
title: "Cancel appointment?",
|
|
8532
|
-
body: cancelBody(outcome, siteTitle),
|
|
8646
|
+
body: [cancelBody(outcome, siteTitle), outcome.kind === "refund" ? protectedDepositCancelSentence(outcome) : null].filter(Boolean).join(" "),
|
|
8533
8647
|
keepLabel: "Keep appointment",
|
|
8534
8648
|
confirmLabel: "Confirm cancel",
|
|
8535
8649
|
confirmAcceptsNoRefund: outcome.kind === "keep_credit"
|
|
@@ -9827,7 +9941,7 @@ async function loadOptionalPortalSectionWithFallback(label, load, buildFallback)
|
|
|
9827
9941
|
* Provides authenticated customers access to their passes, memberships,
|
|
9828
9942
|
* event registrations, appointments, and profile.
|
|
9829
9943
|
*/
|
|
9830
|
-
function CustomerPortalClient({ callbackPath: suppliedCallbackPath, logoutPath: suppliedLogoutPath, bookPath: suppliedBookPath, hasInitialPortalToken = false, siteTitle, demoEmailSuppressed, className, showPasses = true, showMemberships = true, showEvents = true, showWholeSeries = true, showAppointments = true, showOrders = true, showCredit = true, showProfile = true, loginTitle = "Customer Portal", loginSubtitle = "Enter your email to access your account", loginButtonText = getDefaultLoginButtonText(demoEmailSuppressed), passesTabLabel, membershipsTabLabel = "Memberships", eventsTabLabel = "Bookings", appointmentsTabLabel = "Appointments", ordersTabLabel = "Orders", creditTabLabel = "Credit", profileTabLabel = "Profile", emptyPassesMessage, emptyMembershipsMessage = "You don't have any active memberships.", emptyEventsMessage = "You're not registered for any events.", emptyAppointmentsMessage = "You don't have any appointments scheduled.", emptyOrdersMessage = "You don't have any orders yet." }) {
|
|
9944
|
+
function CustomerPortalClient({ callbackPath: suppliedCallbackPath, logoutPath: suppliedLogoutPath, bookPath: suppliedBookPath, hasInitialPortalToken = false, siteTitle, demoEmailSuppressed, privacyPolicyHref, className, showPasses = true, showMemberships = true, showEvents = true, showWholeSeries = true, showAppointments = true, showOrders = true, showCredit = true, showProfile = true, loginTitle = "Customer Portal", loginSubtitle = "Enter your email to access your account", loginButtonText = getDefaultLoginButtonText(demoEmailSuppressed), passesTabLabel, membershipsTabLabel = "Memberships", eventsTabLabel = "Bookings", appointmentsTabLabel = "Appointments", ordersTabLabel = "Orders", creditTabLabel = "Credit", profileTabLabel = "Profile", emptyPassesMessage, emptyMembershipsMessage = "You don't have any active memberships.", emptyEventsMessage = "You're not registered for any events.", emptyAppointmentsMessage = "You don't have any appointments scheduled.", emptyOrdersMessage = "You don't have any orders yet." }) {
|
|
9831
9945
|
const { callbackPath, logoutPath, bookPath } = resolvePortalHostPaths({
|
|
9832
9946
|
callbackPath: suppliedCallbackPath,
|
|
9833
9947
|
logoutPath: suppliedLogoutPath,
|
|
@@ -10208,6 +10322,7 @@ function CustomerPortalClient({ callbackPath: suppliedCallbackPath, logoutPath:
|
|
|
10208
10322
|
}),
|
|
10209
10323
|
activeTab === "credit" && showCredit && data.credit && /* @__PURE__ */ jsx(CreditSection, { credit: data.credit }),
|
|
10210
10324
|
activeTab === "profile" && showProfile && customer && /* @__PURE__ */ jsx(ProfileSection, {
|
|
10325
|
+
privacyPolicyHref,
|
|
10211
10326
|
customer,
|
|
10212
10327
|
onUpdate: (nextCustomer) => dispatch({
|
|
10213
10328
|
type: "customer-updated",
|
|
@@ -10380,7 +10495,9 @@ function PassDates({ pass }) {
|
|
|
10380
10495
|
}) : null] });
|
|
10381
10496
|
}
|
|
10382
10497
|
function formatCustomerPassCreditHistoryEntry(entry, productUseCase, context) {
|
|
10383
|
-
|
|
10498
|
+
const units = formatCreditProductUnits(productUseCase, entry.credits);
|
|
10499
|
+
const date = formatDate$1(entry.occurredAt, context, "long");
|
|
10500
|
+
return entry.kind === "restoration" ? `${units} returned on ${date}` : `Used ${units} on ${date}`;
|
|
10384
10501
|
}
|
|
10385
10502
|
function MembershipsCards({ memberships, onRefresh }) {
|
|
10386
10503
|
const api = useBlockApi();
|
|
@@ -10557,7 +10674,7 @@ function MembershipCancelConfirmation({ membership, isSubmitting, onConfirm, onC
|
|
|
10557
10674
|
/* @__PURE__ */ jsxs("div", {
|
|
10558
10675
|
className: "cp-cancel-confirm__message",
|
|
10559
10676
|
children: [
|
|
10560
|
-
"
|
|
10677
|
+
"You'll keep your membership until",
|
|
10561
10678
|
" ",
|
|
10562
10679
|
formatEntitlementEnd(membership.currentPeriodEnd, "long"),
|
|
10563
10680
|
"."
|
|
@@ -10565,7 +10682,7 @@ function MembershipCancelConfirmation({ membership, isSubmitting, onConfirm, onC
|
|
|
10565
10682
|
}),
|
|
10566
10683
|
/* @__PURE__ */ jsx("div", {
|
|
10567
10684
|
className: "cp-cancel-confirm__warning",
|
|
10568
|
-
children: "
|
|
10685
|
+
children: "Anything you've booked with it after that date will be cancelled."
|
|
10569
10686
|
}),
|
|
10570
10687
|
/* @__PURE__ */ jsxs("div", {
|
|
10571
10688
|
className: "cp-cancel-confirm__actions",
|
|
@@ -10929,7 +11046,7 @@ function AppointmentCard({ appointment, bookPath, siteTitle, isPast: isApptPast
|
|
|
10929
11046
|
})
|
|
10930
11047
|
] });
|
|
10931
11048
|
}
|
|
10932
|
-
function
|
|
11049
|
+
function useProfileEditor(customer, onUpdate) {
|
|
10933
11050
|
const api = useBlockApi();
|
|
10934
11051
|
const [isEditing, setIsEditing] = useState(false);
|
|
10935
11052
|
const [editName, setEditName] = useState(customer.name);
|
|
@@ -10952,58 +11069,90 @@ function ProfileSection({ customer, onUpdate }) {
|
|
|
10952
11069
|
setSaving(false);
|
|
10953
11070
|
}
|
|
10954
11071
|
};
|
|
10955
|
-
|
|
11072
|
+
const cancel = () => {
|
|
11073
|
+
setIsEditing(false);
|
|
11074
|
+
setEditName(customer.name);
|
|
11075
|
+
setEditPhone(customer.phone || "");
|
|
11076
|
+
setError(null);
|
|
11077
|
+
};
|
|
11078
|
+
return {
|
|
11079
|
+
isEditing,
|
|
11080
|
+
startEditing: () => setIsEditing(true),
|
|
11081
|
+
editName,
|
|
11082
|
+
setEditName,
|
|
11083
|
+
editPhone,
|
|
11084
|
+
setEditPhone,
|
|
11085
|
+
saving,
|
|
11086
|
+
error,
|
|
11087
|
+
handleSave,
|
|
11088
|
+
cancel
|
|
11089
|
+
};
|
|
11090
|
+
}
|
|
11091
|
+
function ProfileEditField({ id, label, type, value, onChange, disabled }) {
|
|
11092
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
11093
|
+
className: "cp-field",
|
|
11094
|
+
children: [/* @__PURE__ */ jsx("label", {
|
|
11095
|
+
htmlFor: id,
|
|
11096
|
+
className: "form-label",
|
|
11097
|
+
children: label
|
|
11098
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
11099
|
+
id,
|
|
11100
|
+
type,
|
|
11101
|
+
className: "form-input",
|
|
11102
|
+
value,
|
|
11103
|
+
onChange: (e) => onChange(e.target.value),
|
|
11104
|
+
disabled
|
|
11105
|
+
})]
|
|
11106
|
+
});
|
|
11107
|
+
}
|
|
11108
|
+
function ProfileEditForm({ email, editor }) {
|
|
11109
|
+
return /* @__PURE__ */ jsx("div", {
|
|
10956
11110
|
className: "cp-section cp-section--profile",
|
|
10957
11111
|
children: /* @__PURE__ */ jsxs("div", {
|
|
10958
11112
|
className: "cp-profile",
|
|
10959
11113
|
children: [
|
|
10960
11114
|
/* @__PURE__ */ jsxs("div", {
|
|
10961
11115
|
className: "cp-field",
|
|
10962
|
-
children: [
|
|
10963
|
-
|
|
10964
|
-
|
|
10965
|
-
|
|
10966
|
-
|
|
10967
|
-
|
|
10968
|
-
|
|
10969
|
-
|
|
10970
|
-
|
|
10971
|
-
|
|
10972
|
-
|
|
11116
|
+
children: [
|
|
11117
|
+
/* @__PURE__ */ jsx("label", {
|
|
11118
|
+
htmlFor: "cp-profile-email",
|
|
11119
|
+
className: "form-label",
|
|
11120
|
+
children: "Email"
|
|
11121
|
+
}),
|
|
11122
|
+
/* @__PURE__ */ jsx("input", {
|
|
11123
|
+
id: "cp-profile-email",
|
|
11124
|
+
type: "email",
|
|
11125
|
+
className: "form-input",
|
|
11126
|
+
value: email,
|
|
11127
|
+
disabled: true,
|
|
11128
|
+
"aria-describedby": "cp-profile-email-hint"
|
|
11129
|
+
}),
|
|
11130
|
+
/* @__PURE__ */ jsx("p", {
|
|
11131
|
+
id: "cp-profile-email-hint",
|
|
11132
|
+
className: "cp-profile__note",
|
|
11133
|
+
children: "You sign in with this address, so it can't be changed here."
|
|
11134
|
+
})
|
|
11135
|
+
]
|
|
10973
11136
|
}),
|
|
10974
|
-
/* @__PURE__ */
|
|
10975
|
-
|
|
10976
|
-
|
|
10977
|
-
|
|
10978
|
-
|
|
10979
|
-
|
|
10980
|
-
|
|
10981
|
-
id: "cp-profile-name",
|
|
10982
|
-
type: "text",
|
|
10983
|
-
className: "form-input",
|
|
10984
|
-
value: editName,
|
|
10985
|
-
onChange: (e) => setEditName(e.target.value),
|
|
10986
|
-
disabled: saving
|
|
10987
|
-
})]
|
|
11137
|
+
/* @__PURE__ */ jsx(ProfileEditField, {
|
|
11138
|
+
id: "cp-profile-name",
|
|
11139
|
+
label: "Name",
|
|
11140
|
+
type: "text",
|
|
11141
|
+
value: editor.editName,
|
|
11142
|
+
onChange: editor.setEditName,
|
|
11143
|
+
disabled: editor.saving
|
|
10988
11144
|
}),
|
|
10989
|
-
/* @__PURE__ */
|
|
10990
|
-
|
|
10991
|
-
|
|
10992
|
-
|
|
10993
|
-
|
|
10994
|
-
|
|
10995
|
-
|
|
10996
|
-
id: "cp-profile-phone",
|
|
10997
|
-
type: "tel",
|
|
10998
|
-
className: "form-input",
|
|
10999
|
-
value: editPhone,
|
|
11000
|
-
onChange: (e) => setEditPhone(e.target.value),
|
|
11001
|
-
disabled: saving
|
|
11002
|
-
})]
|
|
11145
|
+
/* @__PURE__ */ jsx(ProfileEditField, {
|
|
11146
|
+
id: "cp-profile-phone",
|
|
11147
|
+
label: "Phone",
|
|
11148
|
+
type: "tel",
|
|
11149
|
+
value: editor.editPhone,
|
|
11150
|
+
onChange: editor.setEditPhone,
|
|
11151
|
+
disabled: editor.saving
|
|
11003
11152
|
}),
|
|
11004
|
-
error && /* @__PURE__ */ jsx("div", {
|
|
11153
|
+
editor.error && /* @__PURE__ */ jsx("div", {
|
|
11005
11154
|
className: "cp-alert cp-alert--error",
|
|
11006
|
-
children: error
|
|
11155
|
+
children: editor.error
|
|
11007
11156
|
}),
|
|
11008
11157
|
/* @__PURE__ */ jsxs("div", {
|
|
11009
11158
|
className: "cp-profile__actions",
|
|
@@ -11011,72 +11160,88 @@ function ProfileSection({ customer, onUpdate }) {
|
|
|
11011
11160
|
type: "button",
|
|
11012
11161
|
variant: "primary",
|
|
11013
11162
|
size: "md",
|
|
11014
|
-
label: saving ? "Saving..." : "Save",
|
|
11015
|
-
onClick: handleSave,
|
|
11016
|
-
disabled: saving
|
|
11163
|
+
label: editor.saving ? "Saving..." : "Save",
|
|
11164
|
+
onClick: editor.handleSave,
|
|
11165
|
+
disabled: editor.saving
|
|
11017
11166
|
}), /* @__PURE__ */ jsx(ThemedButton, {
|
|
11018
11167
|
type: "button",
|
|
11019
11168
|
variant: "secondary",
|
|
11020
11169
|
size: "md",
|
|
11021
11170
|
label: "Cancel",
|
|
11022
|
-
onClick:
|
|
11023
|
-
|
|
11024
|
-
setEditName(customer.name);
|
|
11025
|
-
setEditPhone(customer.phone || "");
|
|
11026
|
-
setError(null);
|
|
11027
|
-
},
|
|
11028
|
-
disabled: saving
|
|
11171
|
+
onClick: editor.cancel,
|
|
11172
|
+
disabled: editor.saving
|
|
11029
11173
|
})]
|
|
11030
11174
|
})
|
|
11031
11175
|
]
|
|
11032
11176
|
})
|
|
11033
11177
|
});
|
|
11178
|
+
}
|
|
11179
|
+
function ProfileSection({ customer, onUpdate, privacyPolicyHref }) {
|
|
11180
|
+
const editor = useProfileEditor(customer, onUpdate);
|
|
11181
|
+
if (editor.isEditing) return /* @__PURE__ */ jsx(ProfileEditForm, {
|
|
11182
|
+
email: customer.email,
|
|
11183
|
+
editor
|
|
11184
|
+
});
|
|
11034
11185
|
return /* @__PURE__ */ jsx("div", {
|
|
11035
11186
|
className: "cp-section cp-section--profile",
|
|
11036
11187
|
children: /* @__PURE__ */ jsxs("div", {
|
|
11037
11188
|
className: "cp-profile",
|
|
11038
|
-
children: [
|
|
11039
|
-
|
|
11040
|
-
|
|
11041
|
-
|
|
11042
|
-
|
|
11043
|
-
|
|
11044
|
-
|
|
11045
|
-
|
|
11046
|
-
|
|
11047
|
-
|
|
11048
|
-
|
|
11049
|
-
|
|
11050
|
-
|
|
11051
|
-
|
|
11052
|
-
|
|
11053
|
-
|
|
11054
|
-
|
|
11055
|
-
|
|
11056
|
-
|
|
11057
|
-
|
|
11058
|
-
|
|
11059
|
-
|
|
11060
|
-
|
|
11061
|
-
|
|
11062
|
-
|
|
11063
|
-
|
|
11064
|
-
|
|
11065
|
-
|
|
11066
|
-
|
|
11067
|
-
|
|
11068
|
-
|
|
11069
|
-
|
|
11070
|
-
|
|
11071
|
-
|
|
11072
|
-
|
|
11073
|
-
|
|
11074
|
-
|
|
11075
|
-
|
|
11076
|
-
|
|
11077
|
-
|
|
11078
|
-
|
|
11079
|
-
|
|
11189
|
+
children: [
|
|
11190
|
+
/* @__PURE__ */ jsxs("div", {
|
|
11191
|
+
className: "cp-profile__tiles",
|
|
11192
|
+
children: [
|
|
11193
|
+
/* @__PURE__ */ jsxs("div", {
|
|
11194
|
+
className: "rb-tile cp-profile__field",
|
|
11195
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
11196
|
+
className: "rb-label cp-profile__label",
|
|
11197
|
+
children: "Email"
|
|
11198
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
11199
|
+
className: "cp-profile__value",
|
|
11200
|
+
children: customer.email
|
|
11201
|
+
})]
|
|
11202
|
+
}),
|
|
11203
|
+
/* @__PURE__ */ jsxs("div", {
|
|
11204
|
+
className: "rb-tile cp-profile__field",
|
|
11205
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
11206
|
+
className: "rb-label cp-profile__label",
|
|
11207
|
+
children: "Name"
|
|
11208
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
11209
|
+
className: "cp-profile__value",
|
|
11210
|
+
children: customer.name || "—"
|
|
11211
|
+
})]
|
|
11212
|
+
}),
|
|
11213
|
+
/* @__PURE__ */ jsxs("div", {
|
|
11214
|
+
className: "rb-tile cp-profile__field",
|
|
11215
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
11216
|
+
className: "rb-label cp-profile__label",
|
|
11217
|
+
children: "Phone"
|
|
11218
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
11219
|
+
className: "cp-profile__value",
|
|
11220
|
+
children: customer.phone || "—"
|
|
11221
|
+
})]
|
|
11222
|
+
})
|
|
11223
|
+
]
|
|
11224
|
+
}),
|
|
11225
|
+
/* @__PURE__ */ jsx(ThemedButton, {
|
|
11226
|
+
type: "button",
|
|
11227
|
+
variant: "secondary",
|
|
11228
|
+
size: "md",
|
|
11229
|
+
extraClassName: "cp-profile__edit",
|
|
11230
|
+
label: "Edit Profile",
|
|
11231
|
+
onClick: editor.startEditing
|
|
11232
|
+
}),
|
|
11233
|
+
/* @__PURE__ */ jsxs("p", {
|
|
11234
|
+
className: "cp-profile__note",
|
|
11235
|
+
children: ["To ask for a copy of your data or have it removed, please contact us.", privacyPolicyHref ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11236
|
+
" You'll find how in our ",
|
|
11237
|
+
/* @__PURE__ */ jsx("a", {
|
|
11238
|
+
href: privacyPolicyHref,
|
|
11239
|
+
children: "privacy policy"
|
|
11240
|
+
}),
|
|
11241
|
+
"."
|
|
11242
|
+
] }) : null]
|
|
11243
|
+
})
|
|
11244
|
+
]
|
|
11080
11245
|
})
|
|
11081
11246
|
});
|
|
11082
11247
|
}
|