@riverbankcms/sdk 0.151.0 → 0.152.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -0
- package/dist/{EventEmbeddedCheckoutStep-BBHbM22D.mjs → EventEmbeddedCheckoutStep-DVQXWFm6.mjs} +10 -9
- package/dist/{PreviewEditorSidebar-BHplI9HE.mjs → PreviewEditorSidebar-Dr4NJi3Q.mjs} +4 -3
- package/dist/{PreviewEditorUI-DuyN8nsD.mjs → PreviewEditorUI-DSZXQbyh.mjs} +5 -4
- package/dist/{SdkPreviewModeRuntime-CR5ypwxJ.mjs → SdkPreviewModeRuntime-Dl4GyMc3.mjs} +124 -53
- package/dist/{SiteChromeCustomizeContext-D5t6joF_.mjs → SiteChromeCustomizeContext-DgBe-FlM.mjs} +20418 -32298
- package/dist/ThemedButton-B8ViBnLK.mjs +16350 -0
- package/dist/_dts/api/src/bookingOperations.d.ts +5 -3
- package/dist/_dts/api/src/commercePortalEndpoints.d.ts +4 -0
- package/dist/_dts/api/src/endpoints.d.ts +7 -0
- package/dist/_dts/api/src/index.d.ts +1 -1
- package/dist/_dts/api/src/navigation/types.d.ts +7 -0
- package/dist/_dts/api/src/navigation.d.ts +1 -1
- package/dist/_dts/api/src/publicAppointmentBookingContracts.d.ts +10 -1
- package/dist/_dts/api/src/siteAssets.d.ts +1 -0
- package/dist/_dts/blocks/src/definitions.d.ts +1 -1
- package/dist/_dts/blocks/src/index.d.ts +1 -0
- package/dist/_dts/blocks/src/pageRenderPreparation.d.ts +1 -0
- package/dist/_dts/blocks/src/pageRendererContracts.d.ts +1 -1
- package/dist/_dts/blocks/src/primitives/content/utils/sanitizeHref.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/event-registration.d.ts +4 -4
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +16 -0
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +5 -0
- package/dist/_dts/blocks/src/system/blocks/offerings-preview/model.d.ts +2 -0
- package/dist/_dts/blocks/src/system/helpers/normalizeMailingListBlockContent.d.ts +2 -0
- package/dist/_dts/blocks/src/system/registry.d.ts +14 -2
- package/dist/_dts/blocks/src/system/runtime/api/client.d.ts +0 -5
- package/dist/_dts/blocks/src/system/runtime/api/index.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/api/schemas/events.d.ts +971 -0
- package/dist/_dts/blocks/src/system/runtime/api/schemas/waitlist-claims.d.ts +42 -0
- package/dist/_dts/blocks/src/system/runtime/api/types/appointments.d.ts +10 -2
- package/dist/_dts/blocks/src/system/runtime/api/types/events.d.ts +10 -136
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +48 -6
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +24 -3
- package/dist/_dts/blocks/src/system/runtime/hooks/useBookingSubmission.state.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessBookingFlow.d.ts +3 -1
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessBookingFlow.state.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.headless.state.d.ts +23 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.state.d.ts +6 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/carousel.client.hooks.d.ts +6 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/carousel.client.state.d.ts +7 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/BookingEntryViews.d.ts +42 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventEmbeddedCheckoutStep.d.ts +4 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationBookingLayer.d.ts +19 -9
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationPayment.d.ts +4 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationSurface.d.ts +24 -9
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationWizardContent.d.ts +4 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventSelectionStep.d.ts +5 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/GuestDetailsSection.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/PaymentStatusStep.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/SingleTicketEntitlementNote.d.ts +11 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/SuccessStep.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/TicketSelectionStep.d.ts +5 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/VerifyingTimeoutStep.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/bookingCardDisplay.d.ts +31 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/bookingEntry.d.ts +154 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/bookingFocus.d.ts +12 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.contract.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.planning.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventSourceRecovery.d.ts +9 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/finishedBooking.d.ts +77 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/index.d.ts +0 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/offeringNoun.d.ts +12 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/paymentResponse.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationCompletion.d.ts +33 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationDerivations.d.ts +11 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationDisplay.d.ts +31 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationDraft.state.d.ts +60 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationErrorRecovery.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationEventAdapter.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationStateMachine.d.ts +58 -10
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationSurface.d.ts +17 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/types.d.ts +23 -7
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useBookingBarFacts.d.ts +12 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationRecoveryRequest.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationStripeReturn.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationSubmit.d.ts +4 -11
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +1563 -31
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventSourceRecovery.d.ts +2 -12
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/usePaymentStatusRecovery.d.ts +147 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/utils.d.ts +50 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/waitlistClaimRestoration.d.ts +6 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/wizardSteps.d.ts +85 -15
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.interactive.d.ts +53 -8
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/MonthLookView.d.ts +10 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +16 -0
- package/dist/_dts/blocks/src/system/runtime/shared/bookingPaymentOptionCopy.d.ts +5 -1
- package/dist/_dts/blocks/src/system/runtime/shared/bookingPaymentOptions.d.ts +37 -1
- package/dist/_dts/blocks/src/system/runtime/shared/components/ModalShell.d.ts +9 -2
- package/dist/_dts/blocks/src/system/runtime/shared/components/PaymentChoiceRows.d.ts +28 -0
- package/dist/_dts/blocks/src/system/runtime/shared/components/StepIndicator.d.ts +6 -8
- package/dist/_dts/blocks/src/system/runtime/shared/components/index.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/shared/index.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/shared/useWaitlistClaim.d.ts +9 -12
- package/dist/_dts/blocks/src/system/runtime/shared/useWaitlistClaim.state.d.ts +15 -0
- package/dist/_dts/blocks/src/system/runtime/shared/utils/themePortalRoot.d.ts +10 -15
- package/dist/_dts/blocks/src/system/transforms/registry/index.d.ts +1 -0
- package/dist/_dts/blocks/src/system/transforms/registry/links.d.ts +3 -1
- package/dist/_dts/commerce/src/purchase/bookingInstalmentSchedule.d.ts +2 -0
- package/dist/_dts/commerce/src/purchase/bookingPaymentSelection.d.ts +6 -0
- package/dist/_dts/commerce/src/purchase/confirmationEmailPayment.d.ts +14 -14
- package/dist/_dts/commerce/src/purchase/confirmationPayment.d.ts +65 -0
- package/dist/_dts/commerce/src/purchase/confirmationPaymentSchema.d.ts +66 -0
- package/dist/_dts/commerce/src/purchase/index.d.ts +2 -0
- package/dist/_dts/commerce/src/purchase/orderPaymentState.d.ts +8 -0
- package/dist/_dts/content-model/src/templates/defaults.d.ts +2 -2
- package/dist/_dts/core/src/appointment-booking-terms.d.ts +20 -0
- package/dist/_dts/core/src/booking-payment-schemas.d.ts +70 -0
- package/dist/_dts/core/src/branded.d.ts +0 -2
- package/dist/_dts/core/src/demo-claim-access.d.ts +1 -1
- package/dist/_dts/core/src/demo-claim-readiness.d.ts +18 -0
- package/dist/_dts/core/src/demo-lifecycle-status.d.ts +1 -1
- package/dist/_dts/core/src/demo-warm-pool-target.d.ts +1 -1
- package/dist/_dts/core/src/index.d.ts +4 -0
- package/dist/_dts/core/src/mailing-list-targeting-availability.d.ts +68 -0
- package/dist/_dts/core/src/mailing-list-targeting.d.ts +2 -0
- package/dist/_dts/core/src/ticket-quantity.d.ts +13 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +51 -32
- package/dist/_dts/editor/src/chrome/chromeLayers.d.ts +7 -0
- package/dist/_dts/editor/src/index.d.ts +1 -0
- package/dist/_dts/editor-blocks/src/widgets/link/LinkAddressInput.d.ts +8 -0
- package/dist/_dts/editor-blocks/src/widgets/link/LinkContentList.d.ts +12 -0
- package/dist/_dts/editor-blocks/src/widgets/link/LinkPicker.d.ts +5 -1
- package/dist/_dts/editor-blocks/src/widgets/link/LinkPickerDialog.d.ts +3 -3
- package/dist/_dts/editor-blocks/src/widgets/link/LinkSummary.d.ts +8 -2
- package/dist/_dts/editor-blocks/src/widgets/link/LinkWidget.d.ts +4 -3
- package/dist/_dts/editor-blocks/src/widgets/link/LinkWidgetContext.d.ts +2 -1
- package/dist/_dts/editor-blocks/src/widgets/link/draft.d.ts +44 -0
- package/dist/_dts/editor-blocks/src/widgets/link/presentation.d.ts +13 -0
- package/dist/_dts/editor-blocks/src/widgets/link/types.d.ts +14 -0
- package/dist/_dts/editor-blocks/src/widgets/link/useRoutableContent.d.ts +2 -0
- package/dist/_dts/editor-blocks/src/widgets/link/utils.d.ts +5 -4
- package/dist/_dts/editor-blocks/src/widgets/mailing-list-targeting/MailingListTargetingField.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/mailing-list-targeting/targetingState.d.ts +13 -8
- package/dist/_dts/media-core/src/fileStorage.d.ts +4 -3
- package/dist/_dts/media-core/src/index.d.ts +1 -0
- package/dist/_dts/media-core/src/storageObjectKey.d.ts +12 -0
- package/dist/_dts/media-react/src/hooks/useSupabaseMediaUploader.d.ts +1 -1
- package/dist/_dts/media-react/src/internal/supabaseResumableUpload.d.ts +13 -0
- package/dist/_dts/preview-next/src/client/preview/previewModeRootAttribute.d.ts +11 -0
- package/dist/_dts/sdk/src/rendering/blocks-page-renderer.d.ts +0 -1
- package/dist/_dts/sdk/src/rendering/image.d.ts +10 -0
- package/dist/_dts/sdk/src/rendering/index.d.ts +3 -1
- package/dist/_dts/sdk/src/rendering/link.d.ts +9 -0
- package/dist/_dts/sdk/src/rendering/overrides.d.ts +1 -0
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/blocks/opaquePanels.d.ts +3 -3
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/client/BookingMailingListNote-CBuMKN0w.mjs +386 -0
- package/dist/client/{CardListItem-ZDLYh6dL.mjs → CardListItem-Dc9XTXhB.mjs} +3 -4
- package/dist/client/CheckIcon-CpyXr-Kg.mjs +35 -0
- package/dist/client/{CheckboxChoice-M-3HycLw.mjs → CheckboxChoice-CIqx_o0E.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-BMtvPTWE.mjs → DemoBookingPortalAccess-D3VQ_kLj.mjs} +85 -85
- package/dist/client/{EventCombined.client-DUm_DOxW.mjs → EventCombined.client-BHGEKise.mjs} +8 -9
- package/dist/client/{EventEmbeddedCheckoutStep-DsNNzgRm.mjs → EventEmbeddedCheckoutStep-Bo1Cm23R.mjs} +11 -10
- package/dist/client/{EventListing.client-DjNYGUVm.mjs → EventListing.client-D5OQgVPr.mjs} +2 -2
- package/dist/client/{LeafletStaticMap-DuFiOHq_.mjs → LeafletStaticMap-CLL5cWrr.mjs} +1 -1
- package/dist/client/{ModalShell-CqkBvBIC.mjs → ModalShell-BXzucfR6.mjs} +83 -12
- package/dist/client/{RichText-LjPCUGGi.mjs → RichText-BoDmnopf.mjs} +6 -3
- package/dist/client/{ThemedButton-DZKjtaDD.mjs → ThemedButton-Ciltp0IK.mjs} +2 -2
- package/dist/client/{accordion-Qe--SILD.mjs → accordion-DOkRS64-.mjs} +1 -1
- package/dist/client/aspectTransforms-D-TnDdq4.mjs +93 -0
- package/dist/client/{bookingForm-3BCl4g_f.mjs → bookingForm-wlMVwo9h.mjs} +289 -149
- package/dist/client/bookings.mjs +12212 -10832
- package/dist/client/{carousel-h2YjKOS2.mjs → carousel-CGWk-Z0u.mjs} +2 -2
- package/dist/client/{carousel.client-BLrd4hmY.mjs → carousel.client-kX5mN1Eg.mjs} +46 -41
- package/dist/client/{cart-5NeiigVd.mjs → cart-OBBPlaH4.mjs} +3 -3
- package/dist/client/{checkout-G4UWjOEw.mjs → checkout-Bmw2WjQX.mjs} +3 -3
- package/dist/client/client.mjs +9541 -6039
- package/dist/client/{colorStyles-DTunOThj.mjs → colorStyles-ECDNPE_P.mjs} +23 -86
- package/dist/client/{context-GK4-AVAh.mjs → context-BI77UFAn.mjs} +275 -10
- package/dist/client/{eventCalendar-Prw3Yo_L.mjs → eventCalendar-qkej2Edn.mjs} +19 -17
- package/dist/client/{eventCombined-BUugi6__.mjs → eventCombined-DApKHvat.mjs} +4 -4
- package/dist/client/{eventDetails-CBHUda-R.mjs → eventDetails-BQyUDPH0.mjs} +3 -4
- package/dist/client/{eventListing-CQeG45Dg.mjs → eventListing-CeAnshlZ.mjs} +4 -4
- package/dist/client/{eventRegistration-Dif3p3oJ.mjs → eventRegistration-C3A3NyBO.mjs} +2209 -2144
- package/dist/client/{form-Cf0WMtfG.mjs → form-DW8rU7jO.mjs} +6 -6
- package/dist/client/{headerSection-Bqdr3JWp.mjs → headerSection-CkIhsoNm.mjs} +9 -9
- package/dist/client/hooks.mjs +1289 -380
- package/dist/client/{locationMap-BVvPou4O.mjs → locationMap-D4O8wbli.mjs} +4 -4
- package/dist/client/{media-47fcnhzD.mjs → media-C5K_0xPd.mjs} +2 -2
- package/dist/client/{newsletterForm-Cx-1dnic.mjs → newsletterForm-B7IxSPuz.mjs} +5 -5
- package/dist/client/{productDetail-DaUMaJYk.mjs → productDetail-Bqxpwy5N.mjs} +3 -3
- package/dist/client/{productList-BKQlWEKE.mjs → productList-u9Lz8V15.mjs} +3 -3
- package/dist/client/{propsDecoder-DO5iXphQ.mjs → propsDecoder-Bf1jucUp.mjs} +17333 -14489
- package/dist/client/rendering/client.mjs +58216 -55133
- package/dist/client/rendering/islands.mjs +19 -19
- package/dist/client/rendering.mjs +9099 -5636
- package/dist/client/{routeIslandApiConfig-BNm0Z3-g.mjs → routeIslandApiConfig-BgP-aPMl.mjs} +1 -1
- package/dist/client/{shop-D7ytcFBC.mjs → shop-B_eykR-_.mjs} +16 -14
- package/dist/client/{shop-commerce-D68-hHy2.mjs → shop-commerce-CT0APkFV.mjs} +9 -9
- package/dist/client/{shop-commerce-store-Cu7X2lyu.mjs → shop-commerce-store-DcvZxdEK.mjs} +1 -1
- package/dist/client/{shopShared-D12rxE69.mjs → shopShared-BVJOiUiJ.mjs} +5 -5
- package/dist/client/themePortalRoot-DS92SRVZ.mjs +47 -0
- package/dist/client/{TerminalPanel-DOTSUCO0.mjs → useDiscountCodeUi-DPmYDunz.mjs} +60 -77
- package/dist/client/{useEventPagination-jgKa67KV.mjs → useEventPagination-8-U55vH5.mjs} +7 -8
- package/dist/preview-next/before-render.mjs +7 -0
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/keepAlive.mjs +7 -0
- package/dist/preview-next/middleware.mjs +7 -0
- package/dist/{sdk-runtime-4cCWO_3i.mjs → sdk-runtime-C5jPdSrk.mjs} +1 -1
- package/dist/server/components.mjs +3138 -1373
- package/dist/server/config-validation.mjs +1395 -486
- package/dist/server/config.mjs +1395 -486
- package/dist/server/data.mjs +1289 -380
- package/dist/server/index.mjs +8 -1
- package/dist/server/next.mjs +3362 -1538
- package/dist/server/page-converter.mjs +1357 -453
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +2335 -1044
- package/dist/server/rendering.mjs +3152 -1370
- package/dist/server/routing.mjs +1437 -490
- package/dist/server/server.mjs +1297 -381
- package/dist/server/theme-bridge.mjs +1135 -795
- package/dist/{spinner-tSdG9YvG.mjs → spinner-B-ab2rJp.mjs} +1 -1
- package/dist/styles/index.css +1088 -721
- package/package.json +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/OrderSummary.d.ts +0 -15
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useWaitlistClaimRestoration.d.ts +0 -22
- package/dist/_dts/blocks/src/system/runtime/shared/components/SelectableOptionCard.d.ts +0 -30
- package/dist/client/BookingMailingListNote-DlDSs5Vm.mjs +0 -567
- package/dist/client/pricing-CMD0kADd.mjs +0 -314
- package/dist/client/result-DRW7JWXz.mjs +0 -30
- package/dist/client/scrollToBlock-C86BYkyV.mjs +0 -17
- package/dist/client/themePortalRoot-AGs4cE7t.mjs +0 -30
- package/dist/spinner-BL3kW9Uh.mjs +0 -803
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Lr as assertNever } from "./propsDecoder-Bf1jucUp.mjs";
|
|
3
|
+
import { n as getBookingMailingListNoteCopy } from "./mailingListSignupCopy-DZSHZrm6.mjs";
|
|
4
|
+
import { t as RichText } from "./RichText-BoDmnopf.mjs";
|
|
5
|
+
import { useCallback, useEffect, useId, useReducer, useRef, useState } from "react";
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
//#region ../blocks/src/system/runtime/shared/components/StepIndicator.tsx
|
|
8
|
+
function slotClasses(slot, classPrefix, emitSharedClasses) {
|
|
9
|
+
return [emitSharedClasses ? `rb-${slot}` : null, classPrefix ? `${classPrefix}-${slot}` : null].filter((name) => name !== null).join(" ");
|
|
10
|
+
}
|
|
11
|
+
function StepIndicator({ currentStep, totalSteps, stepLabels, classPrefix, emitSharedClasses }) {
|
|
12
|
+
const slot = (name) => slotClasses(name, classPrefix, emitSharedClasses);
|
|
13
|
+
const current = Math.min(Math.max(currentStep, 1), Math.max(totalSteps, 1));
|
|
14
|
+
const label = stepLabels?.[current - 1];
|
|
15
|
+
const percent = Math.round(current / Math.max(totalSteps, 1) * 100);
|
|
16
|
+
return /* @__PURE__ */ jsxs("nav", {
|
|
17
|
+
"aria-label": "Booking progress",
|
|
18
|
+
className: slot("progress"),
|
|
19
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
20
|
+
className: slot("progress__head"),
|
|
21
|
+
children: [label ? /* @__PURE__ */ jsx("span", {
|
|
22
|
+
className: slot("progress__label"),
|
|
23
|
+
"aria-current": "step",
|
|
24
|
+
children: label
|
|
25
|
+
}) : null, /* @__PURE__ */ jsxs("span", {
|
|
26
|
+
className: slot("progress__count"),
|
|
27
|
+
children: [
|
|
28
|
+
"Step ",
|
|
29
|
+
current,
|
|
30
|
+
" of ",
|
|
31
|
+
totalSteps
|
|
32
|
+
]
|
|
33
|
+
})]
|
|
34
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
35
|
+
className: slot("progress__track"),
|
|
36
|
+
role: "progressbar",
|
|
37
|
+
"aria-valuemin": 1,
|
|
38
|
+
"aria-valuemax": totalSteps,
|
|
39
|
+
"aria-valuenow": current,
|
|
40
|
+
"aria-label": label ? `${label}, step ${current} of ${totalSteps}` : `Step ${current} of ${totalSteps}`,
|
|
41
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
42
|
+
className: slot("progress__fill"),
|
|
43
|
+
style: { width: `${percent}%` }
|
|
44
|
+
})
|
|
45
|
+
})]
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region ../blocks/src/system/runtime/hooks/useBookingNowIso.ts
|
|
50
|
+
/**
|
|
51
|
+
* The moment a booking or registration flow opened, as an ISO timestamp.
|
|
52
|
+
*
|
|
53
|
+
* Payment previews take this as their "now" so the pure view-model builders
|
|
54
|
+
* never read the clock themselves. It's captured once per mount, which keeps
|
|
55
|
+
* memoised previews stable across renders.
|
|
56
|
+
*/
|
|
57
|
+
function useBookingNowIso() {
|
|
58
|
+
const [nowIso] = useState(() => (/* @__PURE__ */ new Date()).toISOString());
|
|
59
|
+
return nowIso;
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region ../blocks/src/system/runtime/hooks/usePolling.state.ts
|
|
63
|
+
function createInitialPollingState() {
|
|
64
|
+
return {
|
|
65
|
+
tag: "idle",
|
|
66
|
+
result: null,
|
|
67
|
+
error: null
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function pollingReducer(state, action) {
|
|
71
|
+
switch (action.type) {
|
|
72
|
+
case "polling-went-idle": return createInitialPollingState();
|
|
73
|
+
case "polling-reset": return {
|
|
74
|
+
tag: "polling",
|
|
75
|
+
result: null,
|
|
76
|
+
error: null
|
|
77
|
+
};
|
|
78
|
+
case "polling-progressed": return {
|
|
79
|
+
tag: "polling",
|
|
80
|
+
result: action.result,
|
|
81
|
+
error: null
|
|
82
|
+
};
|
|
83
|
+
case "polling-completed": return {
|
|
84
|
+
tag: "completed",
|
|
85
|
+
result: action.result,
|
|
86
|
+
error: null
|
|
87
|
+
};
|
|
88
|
+
case "polling-failed": return {
|
|
89
|
+
tag: "failed",
|
|
90
|
+
result: action.result,
|
|
91
|
+
error: null
|
|
92
|
+
};
|
|
93
|
+
case "polling-request-failed": switch (state.tag) {
|
|
94
|
+
case "idle": return {
|
|
95
|
+
tag: "polling",
|
|
96
|
+
result: null,
|
|
97
|
+
error: action.error
|
|
98
|
+
};
|
|
99
|
+
case "polling": return {
|
|
100
|
+
tag: "polling",
|
|
101
|
+
result: state.result,
|
|
102
|
+
error: action.error
|
|
103
|
+
};
|
|
104
|
+
case "completed":
|
|
105
|
+
case "failed":
|
|
106
|
+
case "timeout": return state;
|
|
107
|
+
default: return assertNever(state);
|
|
108
|
+
}
|
|
109
|
+
case "polling-timed-out": return {
|
|
110
|
+
tag: "timeout",
|
|
111
|
+
result: state.result,
|
|
112
|
+
error: /* @__PURE__ */ new Error("Polling timed out")
|
|
113
|
+
};
|
|
114
|
+
default: return assertNever(action);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region ../blocks/src/system/runtime/hooks/usePolling.ts
|
|
119
|
+
/**
|
|
120
|
+
* Generic polling hook for async operations.
|
|
121
|
+
*
|
|
122
|
+
* Provides a reusable polling mechanism with configurable intervals,
|
|
123
|
+
* max attempts, and completion detection. Used by usePaymentVerification
|
|
124
|
+
* and other hooks that need to poll for status changes.
|
|
125
|
+
*/
|
|
126
|
+
const DEFAULT_MAX_ATTEMPTS = 10;
|
|
127
|
+
const DEFAULT_POLL_INTERVAL = 1e3;
|
|
128
|
+
function usePollingRuntime(config) {
|
|
129
|
+
const runtime = {
|
|
130
|
+
configRef: useRef(config),
|
|
131
|
+
attemptsRef: useRef(0),
|
|
132
|
+
timeoutRef: useRef(null),
|
|
133
|
+
isPollingRef: useRef(false),
|
|
134
|
+
isActiveRef: useRef(false),
|
|
135
|
+
generationRef: useRef(0)
|
|
136
|
+
};
|
|
137
|
+
runtime.configRef.current = config;
|
|
138
|
+
return runtime;
|
|
139
|
+
}
|
|
140
|
+
function usePollingCleanup(runtime) {
|
|
141
|
+
const { isActiveRef, generationRef, timeoutRef, isPollingRef } = runtime;
|
|
142
|
+
return useCallback(() => {
|
|
143
|
+
isActiveRef.current = false;
|
|
144
|
+
generationRef.current += 1;
|
|
145
|
+
if (timeoutRef.current) {
|
|
146
|
+
clearTimeout(timeoutRef.current);
|
|
147
|
+
timeoutRef.current = null;
|
|
148
|
+
}
|
|
149
|
+
isPollingRef.current = false;
|
|
150
|
+
}, [
|
|
151
|
+
generationRef,
|
|
152
|
+
isActiveRef,
|
|
153
|
+
isPollingRef,
|
|
154
|
+
timeoutRef
|
|
155
|
+
]);
|
|
156
|
+
}
|
|
157
|
+
function usePollingReset(runtime, dispatch) {
|
|
158
|
+
const { attemptsRef } = runtime;
|
|
159
|
+
return useCallback(() => {
|
|
160
|
+
dispatch({ type: "polling-reset" });
|
|
161
|
+
attemptsRef.current = 0;
|
|
162
|
+
}, [attemptsRef, dispatch]);
|
|
163
|
+
}
|
|
164
|
+
function usePollingRequest(runtime, dispatch, cleanup) {
|
|
165
|
+
const { configRef, attemptsRef, isPollingRef, isActiveRef, generationRef } = runtime;
|
|
166
|
+
return useCallback(async () => {
|
|
167
|
+
const config = configRef.current;
|
|
168
|
+
if (!config) return true;
|
|
169
|
+
if (isPollingRef.current) return false;
|
|
170
|
+
const maxAttempts = config.maxAttempts ?? DEFAULT_MAX_ATTEMPTS;
|
|
171
|
+
if (attemptsRef.current >= maxAttempts) {
|
|
172
|
+
dispatch({ type: "polling-timed-out" });
|
|
173
|
+
cleanup();
|
|
174
|
+
return true;
|
|
175
|
+
}
|
|
176
|
+
isPollingRef.current = true;
|
|
177
|
+
attemptsRef.current += 1;
|
|
178
|
+
const generation = generationRef.current;
|
|
179
|
+
try {
|
|
180
|
+
const result = await config.pollFn();
|
|
181
|
+
if (generation !== generationRef.current || !isActiveRef.current) return true;
|
|
182
|
+
if (config.isFailed?.(result)) {
|
|
183
|
+
dispatch({
|
|
184
|
+
type: "polling-failed",
|
|
185
|
+
result
|
|
186
|
+
});
|
|
187
|
+
cleanup();
|
|
188
|
+
return true;
|
|
189
|
+
}
|
|
190
|
+
if (config.isComplete(result)) {
|
|
191
|
+
dispatch({
|
|
192
|
+
type: "polling-completed",
|
|
193
|
+
result
|
|
194
|
+
});
|
|
195
|
+
cleanup();
|
|
196
|
+
return true;
|
|
197
|
+
}
|
|
198
|
+
dispatch({
|
|
199
|
+
type: "polling-progressed",
|
|
200
|
+
result
|
|
201
|
+
});
|
|
202
|
+
isPollingRef.current = false;
|
|
203
|
+
return false;
|
|
204
|
+
} catch (error) {
|
|
205
|
+
if (generation !== generationRef.current || !isActiveRef.current) return true;
|
|
206
|
+
if (error instanceof Error) dispatch({
|
|
207
|
+
type: "polling-request-failed",
|
|
208
|
+
error
|
|
209
|
+
});
|
|
210
|
+
isPollingRef.current = false;
|
|
211
|
+
return false;
|
|
212
|
+
}
|
|
213
|
+
}, [
|
|
214
|
+
attemptsRef,
|
|
215
|
+
cleanup,
|
|
216
|
+
configRef,
|
|
217
|
+
dispatch,
|
|
218
|
+
generationRef,
|
|
219
|
+
isActiveRef,
|
|
220
|
+
isPollingRef
|
|
221
|
+
]);
|
|
222
|
+
}
|
|
223
|
+
function usePollingScheduler(runtime, poll) {
|
|
224
|
+
const { attemptsRef, configRef, isActiveRef, timeoutRef } = runtime;
|
|
225
|
+
return useCallback(() => {
|
|
226
|
+
if (!isActiveRef.current) return;
|
|
227
|
+
const doPoll = async () => {
|
|
228
|
+
if (!await poll() && isActiveRef.current) {
|
|
229
|
+
const configuredInterval = configRef.current?.interval;
|
|
230
|
+
const interval = typeof configuredInterval === "function" ? configuredInterval(attemptsRef.current) : configuredInterval ?? DEFAULT_POLL_INTERVAL;
|
|
231
|
+
timeoutRef.current = setTimeout(doPoll, interval);
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
doPoll();
|
|
235
|
+
}, [
|
|
236
|
+
attemptsRef,
|
|
237
|
+
configRef,
|
|
238
|
+
isActiveRef,
|
|
239
|
+
poll,
|
|
240
|
+
timeoutRef
|
|
241
|
+
]);
|
|
242
|
+
}
|
|
243
|
+
function usePollingCycle(config, runtime, dispatch) {
|
|
244
|
+
const cleanup = usePollingCleanup(runtime);
|
|
245
|
+
const resetState = usePollingReset(runtime, dispatch);
|
|
246
|
+
const schedulePoll = usePollingScheduler(runtime, usePollingRequest(runtime, dispatch, cleanup));
|
|
247
|
+
const pollingEnabled = config !== null;
|
|
248
|
+
useEffect(() => {
|
|
249
|
+
if (!pollingEnabled) {
|
|
250
|
+
cleanup();
|
|
251
|
+
dispatch({ type: "polling-went-idle" });
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
resetState();
|
|
255
|
+
runtime.isActiveRef.current = true;
|
|
256
|
+
schedulePoll();
|
|
257
|
+
return cleanup;
|
|
258
|
+
}, [
|
|
259
|
+
cleanup,
|
|
260
|
+
dispatch,
|
|
261
|
+
pollingEnabled,
|
|
262
|
+
resetState,
|
|
263
|
+
config?.restartKey ?? null,
|
|
264
|
+
runtime.isActiveRef,
|
|
265
|
+
schedulePoll
|
|
266
|
+
]);
|
|
267
|
+
return useCallback(() => {
|
|
268
|
+
if (!runtime.configRef.current) return;
|
|
269
|
+
cleanup();
|
|
270
|
+
resetState();
|
|
271
|
+
runtime.isActiveRef.current = true;
|
|
272
|
+
schedulePoll();
|
|
273
|
+
}, [
|
|
274
|
+
cleanup,
|
|
275
|
+
resetState,
|
|
276
|
+
runtime.configRef,
|
|
277
|
+
runtime.isActiveRef,
|
|
278
|
+
schedulePoll
|
|
279
|
+
]);
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Polls until the operation completes, fails, times out, or becomes disabled.
|
|
283
|
+
* Config objects may be rebuilt across renders; change restartKey to begin a
|
|
284
|
+
* new operation and reset its attempt budget.
|
|
285
|
+
*/
|
|
286
|
+
function usePolling(config) {
|
|
287
|
+
const [state, dispatch] = useReducer(pollingReducer, void 0, createInitialPollingState);
|
|
288
|
+
const retry = usePollingCycle(config, usePollingRuntime(config), dispatch);
|
|
289
|
+
return {
|
|
290
|
+
status: config ? state.tag : "idle",
|
|
291
|
+
result: config ? state.result : null,
|
|
292
|
+
error: config ? state.error : null,
|
|
293
|
+
retry
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
//#endregion
|
|
297
|
+
//#region ../blocks/src/system/runtime/shared/components/PaymentChoiceRows.tsx
|
|
298
|
+
/**
|
|
299
|
+
* Payment choices as a radio group. Native radios give the whole row as the
|
|
300
|
+
* hit area and arrow-key movement between choices; the selected row takes the
|
|
301
|
+
* primary accent and disabled rows stay readable with their reason.
|
|
302
|
+
*/
|
|
303
|
+
function PaymentChoiceRows(props) {
|
|
304
|
+
const name = useId();
|
|
305
|
+
return /* @__PURE__ */ jsx("div", {
|
|
306
|
+
className: "rb-pay-choices",
|
|
307
|
+
role: "radiogroup",
|
|
308
|
+
"aria-label": props.label,
|
|
309
|
+
children: props.rows.map((row) => {
|
|
310
|
+
const selected = row.selected && !row.disabled;
|
|
311
|
+
return /* @__PURE__ */ jsxs("label", {
|
|
312
|
+
className: [
|
|
313
|
+
"rb-pay-choice",
|
|
314
|
+
selected && "rb-pay-choice--selected",
|
|
315
|
+
row.disabled && "rb-pay-choice--disabled"
|
|
316
|
+
].filter(Boolean).join(" "),
|
|
317
|
+
children: [
|
|
318
|
+
/* @__PURE__ */ jsx("input", {
|
|
319
|
+
type: "radio",
|
|
320
|
+
className: "rb-pay-choice__radio",
|
|
321
|
+
name,
|
|
322
|
+
value: row.id,
|
|
323
|
+
checked: selected,
|
|
324
|
+
disabled: row.disabled,
|
|
325
|
+
onChange: row.onSelect,
|
|
326
|
+
onClick: selected ? row.onSelect : void 0
|
|
327
|
+
}),
|
|
328
|
+
/* @__PURE__ */ jsxs("span", {
|
|
329
|
+
className: "rb-pay-choice__body",
|
|
330
|
+
children: [
|
|
331
|
+
/* @__PURE__ */ jsx("span", {
|
|
332
|
+
className: "rb-pay-choice__label",
|
|
333
|
+
children: row.label
|
|
334
|
+
}),
|
|
335
|
+
(row.details ?? []).map((detail) => /* @__PURE__ */ jsx("span", {
|
|
336
|
+
className: "rb-pay-choice__detail",
|
|
337
|
+
children: detail
|
|
338
|
+
}, detail)),
|
|
339
|
+
row.disabled && row.disabledReason ? /* @__PURE__ */ jsx("span", {
|
|
340
|
+
className: "rb-pay-choice__reason",
|
|
341
|
+
children: row.disabledReason
|
|
342
|
+
}) : null
|
|
343
|
+
]
|
|
344
|
+
}),
|
|
345
|
+
row.price ? /* @__PURE__ */ jsx("span", {
|
|
346
|
+
className: "rb-pay-choice__price",
|
|
347
|
+
children: row.price
|
|
348
|
+
}) : null
|
|
349
|
+
]
|
|
350
|
+
}, row.id);
|
|
351
|
+
})
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
//#endregion
|
|
355
|
+
//#region ../blocks/src/system/runtime/shared/components/BookingConsentAgreement.tsx
|
|
356
|
+
function BookingConsentAgreement({ agreement, showTitle = true, title, titleId }) {
|
|
357
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [showTitle ? /* @__PURE__ */ jsxs("div", {
|
|
358
|
+
id: titleId,
|
|
359
|
+
className: "form-label",
|
|
360
|
+
children: [title, /* @__PURE__ */ jsx("span", {
|
|
361
|
+
className: "required-marker",
|
|
362
|
+
children: "*"
|
|
363
|
+
})]
|
|
364
|
+
}) : null, /* @__PURE__ */ jsx("div", {
|
|
365
|
+
role: "group",
|
|
366
|
+
"aria-label": showTitle ? void 0 : title,
|
|
367
|
+
"aria-labelledby": showTitle ? titleId : void 0,
|
|
368
|
+
children: /* @__PURE__ */ jsx(RichText, {
|
|
369
|
+
doc: agreement,
|
|
370
|
+
linkTarget: "new-tab",
|
|
371
|
+
className: "rb-prose rb-max-w-none"
|
|
372
|
+
})
|
|
373
|
+
})] });
|
|
374
|
+
}
|
|
375
|
+
//#endregion
|
|
376
|
+
//#region ../blocks/src/system/runtime/shared/components/BookingMailingListNote.tsx
|
|
377
|
+
function BookingMailingListNote(props) {
|
|
378
|
+
const copy = getBookingMailingListNoteCopy(props.note, props.context);
|
|
379
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
380
|
+
role: "status",
|
|
381
|
+
className: props.className,
|
|
382
|
+
children: [/* @__PURE__ */ jsx("p", { children: copy.title }), copy.detail ? /* @__PURE__ */ jsx("p", { children: copy.detail }) : null]
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
//#endregion
|
|
386
|
+
export { useBookingNowIso as a, usePolling as i, BookingConsentAgreement as n, StepIndicator as o, PaymentChoiceRows as r, BookingMailingListNote as t };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as getCurrentResolveImageUrlContext, c as renderVideo, i as computeMediaTransformStyle, n as MediaPlaceholder, o as mediaImageHostProps, s as renderAudio, t as ImagePresets, u as resolveMediaNodeResponsiveImage } from "./media-
|
|
3
|
-
import { n as ThemedButtonLink } from "./ThemedButton-
|
|
4
|
-
import { a as canJoinEventWaitlistOnAnyMode, p as isEventFull } from "./pricing-CMD0kADd.mjs";
|
|
1
|
+
import { $n as resolveRuntimeEventDestination, fr as listLookSlot, sr as isEventFull, tr as canJoinEventWaitlistOnAnyMode, yi as assertNever } from "./propsDecoder-Bf1jucUp.mjs";
|
|
2
|
+
import { a as getCurrentResolveImageUrlContext, c as renderVideo, i as computeMediaTransformStyle, n as MediaPlaceholder, o as mediaImageHostProps, s as renderAudio, t as ImagePresets, u as resolveMediaNodeResponsiveImage } from "./media-C5K_0xPd.mjs";
|
|
3
|
+
import { n as ThemedButtonLink } from "./ThemedButton-Ciltp0IK.mjs";
|
|
5
4
|
import "react";
|
|
6
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
6
|
//#region ../blocks/src/system/runtime/nodes/events/domain/cta.ts
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
//#region ../blocks/src/system/runtime/shared/utils/scrollToBlock.ts
|
|
3
|
+
/**
|
|
4
|
+
* Scroll to a block element by its anchor ID.
|
|
5
|
+
*
|
|
6
|
+
* Uses requestAnimationFrame to defer scrolling until after
|
|
7
|
+
* layout shifts (lazy images, fonts, etc.) have settled.
|
|
8
|
+
*/
|
|
9
|
+
function scrollToBlock(anchorId) {
|
|
10
|
+
requestAnimationFrame(() => {
|
|
11
|
+
document.getElementById(anchorId)?.scrollIntoView({
|
|
12
|
+
behavior: "smooth",
|
|
13
|
+
block: "start"
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region ../blocks/src/system/runtime/shared/components/CheckIcon.tsx
|
|
19
|
+
function CheckIcon({ className, strokeWidth = 2 }) {
|
|
20
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
21
|
+
fill: "none",
|
|
22
|
+
strokeLinecap: "round",
|
|
23
|
+
strokeLinejoin: "round",
|
|
24
|
+
strokeWidth,
|
|
25
|
+
viewBox: "0 0 24 24",
|
|
26
|
+
stroke: "currentColor",
|
|
27
|
+
className,
|
|
28
|
+
width: "1em",
|
|
29
|
+
height: "1em",
|
|
30
|
+
"aria-hidden": "true",
|
|
31
|
+
children: /* @__PURE__ */ jsx("path", { d: "M5 13l4 4L19 7" })
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { scrollToBlock as n, CheckIcon as t };
|
package/dist/client/{DemoBookingPortalAccess-BMtvPTWE.mjs → DemoBookingPortalAccess-D3VQ_kLj.mjs}
RENAMED
|
@@ -1,90 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as ThemedButton } from "./ThemedButton-
|
|
3
|
-
import { n as useBlockApi, r as BlockApiError } from "./context-
|
|
2
|
+
import { t as ThemedButton } from "./ThemedButton-Ciltp0IK.mjs";
|
|
3
|
+
import { n as useBlockApi, r as BlockApiError } from "./context-BI77UFAn.mjs";
|
|
4
4
|
import React, { useId } from "react";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
//#region ../blocks/src/system/runtime/shared/utils/demoBookingPassStorage.ts
|
|
7
|
-
const STORAGE_KEY = "riverbank:demo-booking-passes:v1";
|
|
8
|
-
const CHECKOUT_RETURN_EMAIL_KEY = "riverbank:demo-booking-checkout-email:v1";
|
|
9
|
-
const MAX_STORED_PASSES = 10;
|
|
10
|
-
function normalizeDemoBookingEmail(email) {
|
|
11
|
-
return email.trim().toLowerCase();
|
|
12
|
-
}
|
|
13
|
-
function storeDemoBookingPass(email, pass) {
|
|
14
|
-
try {
|
|
15
|
-
const normalizedEmail = normalizeDemoBookingEmail(email);
|
|
16
|
-
if (!normalizedEmail || !pass) return;
|
|
17
|
-
const current = readStoredDemoBookingPasses();
|
|
18
|
-
const updated = [{
|
|
19
|
-
email: normalizedEmail,
|
|
20
|
-
pass
|
|
21
|
-
}, ...current.filter((entry) => entry.email !== normalizedEmail)].slice(0, MAX_STORED_PASSES);
|
|
22
|
-
window.localStorage.setItem(STORAGE_KEY, JSON.stringify(updated));
|
|
23
|
-
} catch {}
|
|
24
|
-
}
|
|
25
|
-
function storeDemoBookingPassIfAvailable(email, pass) {
|
|
26
|
-
if (email && pass) storeDemoBookingPass(email, pass);
|
|
27
|
-
}
|
|
28
|
-
function getDemoBookingPass(email) {
|
|
29
|
-
try {
|
|
30
|
-
const normalizedEmail = normalizeDemoBookingEmail(email);
|
|
31
|
-
return readStoredDemoBookingPasses().find((entry) => entry.email === normalizedEmail)?.pass ?? null;
|
|
32
|
-
} catch {
|
|
33
|
-
return null;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
function storeDemoBookingCheckoutReturn(email, pass) {
|
|
37
|
-
const normalizedEmail = normalizeDemoBookingEmail(email);
|
|
38
|
-
if (!normalizedEmail) return;
|
|
39
|
-
storeDemoBookingPassIfAvailable(normalizedEmail, pass);
|
|
40
|
-
try {
|
|
41
|
-
window.sessionStorage.setItem(CHECKOUT_RETURN_EMAIL_KEY, normalizedEmail);
|
|
42
|
-
} catch {}
|
|
43
|
-
}
|
|
44
|
-
function readDemoBookingCheckoutReturnEmail() {
|
|
45
|
-
try {
|
|
46
|
-
const email = window.sessionStorage.getItem(CHECKOUT_RETURN_EMAIL_KEY);
|
|
47
|
-
window.sessionStorage.removeItem(CHECKOUT_RETURN_EMAIL_KEY);
|
|
48
|
-
return email ? normalizeDemoBookingEmail(email) : null;
|
|
49
|
-
} catch {
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
function readStoredDemoBookingPasses() {
|
|
54
|
-
try {
|
|
55
|
-
const raw = window.localStorage.getItem(STORAGE_KEY);
|
|
56
|
-
if (!raw) return [];
|
|
57
|
-
const parsed = JSON.parse(raw);
|
|
58
|
-
return Array.isArray(parsed) ? parsed.filter(isStoredDemoBookingPass) : [];
|
|
59
|
-
} catch {
|
|
60
|
-
return [];
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
function isStoredDemoBookingPass(value) {
|
|
64
|
-
if (!isRecord(value)) return false;
|
|
65
|
-
const record = value;
|
|
66
|
-
return typeof record.email === "string" && record.email.length > 0 && typeof record.pass === "string" && record.pass.length > 0;
|
|
67
|
-
}
|
|
68
|
-
function isRecord(value) {
|
|
69
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
70
|
-
}
|
|
71
|
-
//#endregion
|
|
72
|
-
//#region ../blocks/src/system/runtime/api/types/discounts.ts
|
|
73
|
-
function discountAvailabilityHasDiscounts(availability) {
|
|
74
|
-
return availability.type !== "none";
|
|
75
|
-
}
|
|
76
|
-
function discountAvailabilityAllowsManualEntry(availability) {
|
|
77
|
-
return "manualCodeEntryAllowed" in availability && availability.manualCodeEntryAllowed;
|
|
78
|
-
}
|
|
79
|
-
function getAutoAppliedDiscountPreview(availability) {
|
|
80
|
-
switch (availability.type) {
|
|
81
|
-
case "none":
|
|
82
|
-
case "manual": return null;
|
|
83
|
-
case "auto":
|
|
84
|
-
case "auto_and_manual": return availability.autoAppliedDiscount;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
//#endregion
|
|
88
6
|
//#region ../blocks/src/system/runtime/shared/components/DiscountCodeDisclosure.tsx
|
|
89
7
|
const BLOCK_DISCOUNT_CODE_DISCLOSURE_CLASSES = { "event-registration": {
|
|
90
8
|
root: "er-discount",
|
|
@@ -201,6 +119,88 @@ function DiscountCodeDisclosure({ surface, isOpen, code, onOpen, onChange, onRem
|
|
|
201
119
|
});
|
|
202
120
|
}
|
|
203
121
|
//#endregion
|
|
122
|
+
//#region ../blocks/src/system/runtime/shared/utils/demoBookingPassStorage.ts
|
|
123
|
+
const STORAGE_KEY = "riverbank:demo-booking-passes:v1";
|
|
124
|
+
const CHECKOUT_RETURN_EMAIL_KEY = "riverbank:demo-booking-checkout-email:v1";
|
|
125
|
+
const MAX_STORED_PASSES = 10;
|
|
126
|
+
function normalizeDemoBookingEmail(email) {
|
|
127
|
+
return email.trim().toLowerCase();
|
|
128
|
+
}
|
|
129
|
+
function storeDemoBookingPass(email, pass) {
|
|
130
|
+
try {
|
|
131
|
+
const normalizedEmail = normalizeDemoBookingEmail(email);
|
|
132
|
+
if (!normalizedEmail || !pass) return;
|
|
133
|
+
const current = readStoredDemoBookingPasses();
|
|
134
|
+
const updated = [{
|
|
135
|
+
email: normalizedEmail,
|
|
136
|
+
pass
|
|
137
|
+
}, ...current.filter((entry) => entry.email !== normalizedEmail)].slice(0, MAX_STORED_PASSES);
|
|
138
|
+
window.localStorage.setItem(STORAGE_KEY, JSON.stringify(updated));
|
|
139
|
+
} catch {}
|
|
140
|
+
}
|
|
141
|
+
function storeDemoBookingPassIfAvailable(email, pass) {
|
|
142
|
+
if (email && pass) storeDemoBookingPass(email, pass);
|
|
143
|
+
}
|
|
144
|
+
function getDemoBookingPass(email) {
|
|
145
|
+
try {
|
|
146
|
+
const normalizedEmail = normalizeDemoBookingEmail(email);
|
|
147
|
+
return readStoredDemoBookingPasses().find((entry) => entry.email === normalizedEmail)?.pass ?? null;
|
|
148
|
+
} catch {
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
function storeDemoBookingCheckoutReturn(email, pass) {
|
|
153
|
+
const normalizedEmail = normalizeDemoBookingEmail(email);
|
|
154
|
+
if (!normalizedEmail) return;
|
|
155
|
+
storeDemoBookingPassIfAvailable(normalizedEmail, pass);
|
|
156
|
+
try {
|
|
157
|
+
window.sessionStorage.setItem(CHECKOUT_RETURN_EMAIL_KEY, normalizedEmail);
|
|
158
|
+
} catch {}
|
|
159
|
+
}
|
|
160
|
+
function readDemoBookingCheckoutReturnEmail() {
|
|
161
|
+
try {
|
|
162
|
+
const email = window.sessionStorage.getItem(CHECKOUT_RETURN_EMAIL_KEY);
|
|
163
|
+
window.sessionStorage.removeItem(CHECKOUT_RETURN_EMAIL_KEY);
|
|
164
|
+
return email ? normalizeDemoBookingEmail(email) : null;
|
|
165
|
+
} catch {
|
|
166
|
+
return null;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
function readStoredDemoBookingPasses() {
|
|
170
|
+
try {
|
|
171
|
+
const raw = window.localStorage.getItem(STORAGE_KEY);
|
|
172
|
+
if (!raw) return [];
|
|
173
|
+
const parsed = JSON.parse(raw);
|
|
174
|
+
return Array.isArray(parsed) ? parsed.filter(isStoredDemoBookingPass) : [];
|
|
175
|
+
} catch {
|
|
176
|
+
return [];
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
function isStoredDemoBookingPass(value) {
|
|
180
|
+
if (!isRecord(value)) return false;
|
|
181
|
+
const record = value;
|
|
182
|
+
return typeof record.email === "string" && record.email.length > 0 && typeof record.pass === "string" && record.pass.length > 0;
|
|
183
|
+
}
|
|
184
|
+
function isRecord(value) {
|
|
185
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
186
|
+
}
|
|
187
|
+
//#endregion
|
|
188
|
+
//#region ../blocks/src/system/runtime/api/types/discounts.ts
|
|
189
|
+
function discountAvailabilityHasDiscounts(availability) {
|
|
190
|
+
return availability.type !== "none";
|
|
191
|
+
}
|
|
192
|
+
function discountAvailabilityAllowsManualEntry(availability) {
|
|
193
|
+
return "manualCodeEntryAllowed" in availability && availability.manualCodeEntryAllowed;
|
|
194
|
+
}
|
|
195
|
+
function getAutoAppliedDiscountPreview(availability) {
|
|
196
|
+
switch (availability.type) {
|
|
197
|
+
case "none":
|
|
198
|
+
case "manual": return null;
|
|
199
|
+
case "auto":
|
|
200
|
+
case "auto_and_manual": return availability.autoAppliedDiscount;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
//#endregion
|
|
204
204
|
//#region ../blocks/src/system/runtime/shared/utils/demoPortalMagicLink.ts
|
|
205
205
|
const CUSTOMER_PORTAL_PATH = "/portal";
|
|
206
206
|
function buildPortalCallbackUrl(origin, redirectTo) {
|
|
@@ -341,4 +341,4 @@ function handlePortalAccessError(error) {
|
|
|
341
341
|
};
|
|
342
342
|
}
|
|
343
343
|
//#endregion
|
|
344
|
-
export { requestDemoPortalMagicLink as a,
|
|
344
|
+
export { requestDemoPortalMagicLink as a, getAutoAppliedDiscountPreview as c, storeDemoBookingPass as d, storeDemoBookingPassIfAvailable as f, buildPortalCallbackUrl as i, readDemoBookingCheckoutReturnEmail as l, DemoBookingPortalAccess as n, discountAvailabilityAllowsManualEntry as o, DiscountCodeDisclosure as p, CUSTOMER_PORTAL_PATH as r, discountAvailabilityHasDiscounts as s, BookingConfirmation as t, storeDemoBookingCheckoutReturn as u };
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { F as clsx } from "./colorStyles-ECDNPE_P.mjs";
|
|
3
|
+
import { En as formatEventPrice, Gn as buildCalendarViewport, Hn as MONTH_NAMES, Jn as getOrderedDayNames, Kn as formatDateKey, Ln as formatTime, Mn as formatDate, Qn as shiftCalendarAnchorDate, Rn as groupEventsByDate, Wn as addMonths, Xn as isSameCalendarDay, Zn as isToday, ai as formatLocalScheduleDate, bn as buildEventRuntimeFilters, cn as eventListingBlockRuntime, dn as calendarPageResponseError, fn as calendarQueryKey, gn as planCalendarMonthRanges, ln as calendarMonthDate, mn as calendarWindowMonths$1, nr as formatEventRemainingPlaces, pn as calendarWindowBounds, qn as getDayOfWeek, si as getLocalScheduleDate, sr as isEventFull, un as calendarMonthKey, xn as getEventRuntimeFiltersKey, yn as getBlockApiReadStage, zn as resolveEventTimeZone } from "./propsDecoder-Bf1jucUp.mjs";
|
|
4
4
|
import { t as formatEventDuration } from "./duration-btE0-px8.mjs";
|
|
5
|
-
import { a as toError, i as useEventCollectionFilters, n as EventPaginatedListView, r as EventCardClient, s as formatEventTeacherLine, t as useEventPagination } from "./useEventPagination-
|
|
6
|
-
import { n as ThemedButtonLink, t as ThemedButton } from "./ThemedButton-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { n as useBlockApi } from "./context-
|
|
10
|
-
import { t as
|
|
11
|
-
import { t as ModalShell } from "./ModalShell-CqkBvBIC.mjs";
|
|
5
|
+
import { a as toError, i as useEventCollectionFilters, n as EventPaginatedListView, r as EventCardClient, s as formatEventTeacherLine, t as useEventPagination } from "./useEventPagination-8-U55vH5.mjs";
|
|
6
|
+
import { n as ThemedButtonLink, t as ThemedButton } from "./ThemedButton-Ciltp0IK.mjs";
|
|
7
|
+
import { a as resolveEventLinkProps, i as resolveEventCta } from "./CardListItem-Dc9XTXhB.mjs";
|
|
8
|
+
import { t as createBodyThemePortalRoot } from "./themePortalRoot-DS92SRVZ.mjs";
|
|
9
|
+
import { n as useBlockApi } from "./context-BI77UFAn.mjs";
|
|
10
|
+
import { t as ModalShell } from "./ModalShell-BXzucfR6.mjs";
|
|
12
11
|
import React, { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
13
12
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
13
|
//#region ../blocks/src/system/runtime/nodes/events/domain/location.ts
|