@riverbankcms/sdk 0.130.2 → 0.132.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 +3 -3
- package/dist/{PreviewEditorSidebar-BY-1QdE2.mjs → PreviewEditorSidebar-DKQ5eFK9.mjs} +351 -95
- package/dist/{PreviewEditorUI-BS34jI9_.mjs → PreviewEditorUI-CNTcOjCC.mjs} +3 -3
- package/dist/{PreviewQueryProvider-BD0kOjtI.mjs → PreviewQueryProvider-D51gQaG3.mjs} +1 -1
- package/dist/{SdkPreviewModeRuntime-B1pWnhu-.mjs → SdkPreviewModeRuntime-DJu3qu33.mjs} +48 -9
- package/dist/{SiteChromeCustomizeContext-BhUG_72i.mjs → SiteChromeCustomizeContext-2TzT3vbj.mjs} +6417 -4184
- package/dist/_dts/ai/src/contracts/proposals.d.ts +723 -151
- package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +151 -64
- package/dist/_dts/api/src/bookingConfig.d.ts +13 -9
- package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +8 -19
- package/dist/_dts/api/src/bookingManagementEventEndpointTypes.d.ts +31 -2
- package/dist/_dts/api/src/bookingVerticals.d.ts +1 -140
- package/dist/_dts/api/src/commercePortalEndpoints.d.ts +45 -12
- package/dist/_dts/api/src/contentRuntime.d.ts +2 -1
- package/dist/_dts/api/src/courses.d.ts +1 -19
- package/dist/_dts/api/src/endpoints.d.ts +466 -346
- package/dist/_dts/api/src/event-destination-policy.d.ts +1 -1
- package/dist/_dts/api/src/eventManagementContracts.d.ts +91 -1
- package/dist/_dts/api/src/eventManagementEndpointDefinitions.d.ts +32 -0
- package/dist/_dts/api/src/giftingDashboard.d.ts +117 -0
- package/dist/_dts/api/src/giftingEndpointDefinitions.d.ts +124 -0
- package/dist/_dts/api/src/index.d.ts +4 -4
- package/dist/_dts/api/src/indexCoreTypes.d.ts +1 -1
- package/dist/_dts/api/src/indexExtendedTypes.d.ts +1 -1
- package/dist/_dts/api/src/media.d.ts +1 -0
- package/dist/_dts/api/src/navigation/dashboardBookingsNav.d.ts +3 -4
- package/dist/_dts/api/src/publicEventEndpointDefinitions.d.ts +11 -0
- package/dist/_dts/api/src/publicExperience/eventEndpoints.d.ts +25 -12
- package/dist/_dts/api/src/publicExperience/sharedTypes.d.ts +2 -0
- package/dist/_dts/api/src/publicExperience/wholeSeriesEndpoints.d.ts +1 -0
- package/dist/_dts/api/src/sdk-event-upsert.d.ts +2 -2
- package/dist/_dts/api/src/sdkBookingVerticalContracts.d.ts +29 -0
- package/dist/_dts/api/src/sdkContracts.d.ts +9 -32
- package/dist/_dts/api/src/sdkEndpointDefinitions.d.ts +23 -0
- package/dist/_dts/api/src/sdkSettingsContracts.d.ts +25 -0
- package/dist/_dts/api/src/sdkThemeCatalogContracts.d.ts +20 -0
- package/dist/_dts/api/src/sdkThemeWire.d.ts +16 -6
- package/dist/_dts/api/src/siteOnboarding.d.ts +3 -3
- package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +4 -10
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +0 -3
- package/dist/_dts/api/src/types.d.ts +1 -2
- package/dist/_dts/blocks/src/PageRenderer.d.ts +2 -13
- package/dist/_dts/blocks/src/contracts/non-block-islands.d.ts +9 -0
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +26 -44
- package/dist/_dts/blocks/src/index.d.ts +1 -1
- package/dist/_dts/blocks/src/subroutes/fold.d.ts +2 -1
- package/dist/_dts/blocks/src/system/blocks/courses/shared/index.d.ts +0 -3
- package/dist/_dts/blocks/src/system/blocks/courses/shared/pricing.d.ts +2 -50
- package/dist/_dts/blocks/src/system/blocks/courses/shared/schemas.d.ts +1 -929
- package/dist/_dts/blocks/src/system/blocks/courses/shared/types.d.ts +1 -97
- package/dist/_dts/blocks/src/system/blocks/event-details.d.ts +39 -6
- package/dist/_dts/blocks/src/system/blocks/events/event-calendar.d.ts +2 -1
- package/dist/_dts/blocks/src/system/blocks/events/event-listing.d.ts +3 -3
- package/dist/_dts/blocks/src/system/blocks/events/event-spotlight.d.ts +2 -3
- package/dist/_dts/blocks/src/system/blocks/events/shared/filtering.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +6 -6
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +2 -9
- package/dist/_dts/blocks/src/system/blocks/events/whole-series/index.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/events/whole-series/pricing.d.ts +50 -0
- package/dist/_dts/blocks/src/system/blocks/events/whole-series/schemas.d.ts +135 -0
- package/dist/_dts/blocks/src/system/blocks/events/whole-series/types.d.ts +81 -0
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +9 -9
- package/dist/_dts/blocks/src/system/blocks/offerings-preview/model.d.ts +1 -1
- package/dist/_dts/blocks/src/system/fields/boxStyles.d.ts +7 -8
- package/dist/_dts/blocks/src/system/node/validation-constants.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/blockComposition.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +45 -72
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +21 -36
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessWholeSeriesRegistrationFlow.d.ts +6 -6
- package/dist/_dts/blocks/src/system/runtime/nodes/course-page-surface-scope.d.ts +2 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration.client.d.ts +4 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration.interactive.d.ts +19 -7
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details/logic.d.ts +25 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details/presentation.d.ts +75 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details/view.d.ts +4 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details.client.d.ts +5 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details.server.d.ts +5 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/PaymentSelectionStep.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/RegistrationClosedState.d.ts +5 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/SiteCreditPreviewPanel.d.ts +6 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventPaymentOptions.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/hooks.d.ts +17 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationSurface.d.ts +3 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/siteCreditPreview.d.ts +51 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/types.d.ts +3 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration → event-registration/whole-series}/BookingModeStep.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration → event-registration/whole-series}/CheckIcon.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration → event-registration/whole-series}/ErrorStep.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration → event-registration/whole-series}/MembershipHero.d.ts +3 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration → event-registration/whole-series}/PaymentFailedStep.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/whole-series/StepIndicator.d.ts +6 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration → event-registration/whole-series}/VerifyingTimeoutStep.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/whole-series/WholeSeriesRegistrationActiveSteps.d.ts +9 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration/CourseRegistrationErrorBoundary.d.ts → event-registration/whole-series/WholeSeriesRegistrationErrorBoundary.d.ts} +5 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/whole-series/WholeSeriesRegistrationTerminalContent.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/whole-series/WholeSeriesRegistrationWizard.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/whole-series/components.d.ts +45 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration → event-registration/whole-series}/index.d.ts +4 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/whole-series/presentation.d.ts +7 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/whole-series/pricing.d.ts +14 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration → event-registration/whole-series}/types.d.ts +18 -16
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration/useCourseEligibility.d.ts → event-registration/whole-series/useWholeSeriesEligibility.d.ts} +6 -6
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/whole-series/useWholeSeriesPaymentVerification.d.ts +10 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/whole-series/useWholeSeriesRegistrationActions.d.ts +35 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration/useCourseRegistrationPortal.d.ts → event-registration/whole-series/useWholeSeriesRegistrationPortal.d.ts} +2 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/whole-series/useWholeSeriesRegistrationSelection.d.ts +35 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/whole-series/useWholeSeriesRegistrationWizard.d.ts +185 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration/useCourseWaitlistSelection.d.ts → event-registration/whole-series/useWholeSeriesWaitlistSelection.d.ts} +5 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration → event-registration/whole-series}/utils.d.ts +4 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration → event-registration/whole-series}/whole-series-registration.headless.contract.d.ts +5 -7
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration → event-registration/whole-series}/whole-series-registration.headless.planning.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/whole-series/wholeSeriesPageSurfaceScope.d.ts +17 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration/courseRegistrationViewState.d.ts → event-registration/whole-series/wholeSeriesRegistrationViewState.d.ts} +7 -7
- package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration → event-registration/whole-series}/wizardSteps.d.ts +4 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.interactive.d.ts +24 -54
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCombined.client.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCombined.interactive.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventListing.interactive.d.ts +12 -11
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventListing.server.d.ts +3 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventSpotlight.d.ts +3 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventCard.d.ts +3 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventDetailModal.d.ts +4 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventModalCloseButton.d.ts +7 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventModals.d.ts +4 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/WeekBoardView.d.ts +14 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +19 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/shared/MagicLinkForm.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/shared/components/DiscountCodeDisclosure.d.ts +12 -12
- package/dist/_dts/blocks/src/system/runtime/shared/useWaitlistClaim.d.ts +1 -0
- package/dist/_dts/blocks/src/system/transforms/registry/_utils/boxStyleClassNames.d.ts +30 -11
- package/dist/_dts/blocks/src/system/transforms/registry/boxStyles.d.ts +15 -4
- package/dist/_dts/blocks/src/system/transforms/registry/index.d.ts +1 -0
- package/dist/_dts/blocks/src/system/transforms/typed.d.ts +1 -4
- package/dist/_dts/commerce/src/purchase/bookingInstalmentSchedule.d.ts +13 -0
- package/dist/_dts/commerce/src/purchase/cancellationPolicy.d.ts +7 -0
- package/dist/_dts/commerce/src/purchase/canonicalRefundPlanner.d.ts +48 -0
- package/dist/_dts/commerce/src/purchase/checkoutCollectionPlan.d.ts +39 -0
- package/dist/_dts/commerce/src/purchase/checkoutCommitPlan.d.ts +40 -0
- package/dist/_dts/commerce/src/purchase/checkoutDiscountContextPlanning.d.ts +80 -0
- package/dist/_dts/commerce/src/purchase/checkoutErrorCodes.d.ts +1 -0
- package/dist/_dts/commerce/src/purchase/checkoutOrderItemProjection.d.ts +22 -0
- package/dist/_dts/commerce/src/purchase/checkoutPaymentFlow.d.ts +50 -0
- package/dist/_dts/commerce/src/purchase/checkoutPaymentPlanPlanning.d.ts +30 -0
- package/dist/_dts/commerce/src/purchase/checkoutPaymentTermPlanning.d.ts +10 -0
- package/dist/_dts/commerce/src/purchase/checkoutPaymentTerms.d.ts +53 -0
- package/dist/_dts/commerce/src/purchase/checkoutQuantity.d.ts +8 -0
- package/dist/_dts/commerce/src/purchase/checkoutSessionMetadata.d.ts +76 -0
- package/dist/_dts/commerce/src/purchase/checkoutSettlement.d.ts +46 -0
- package/dist/_dts/commerce/src/purchase/checkoutStripeFinalizationPlanning.d.ts +12 -0
- package/dist/_dts/commerce/src/purchase/checkoutStripeSessionPlanning.d.ts +125 -0
- package/dist/_dts/commerce/src/purchase/checkoutValidatedItemPlanning.d.ts +55 -0
- package/dist/_dts/commerce/src/purchase/confirmationEmailPayment.d.ts +91 -0
- package/dist/_dts/commerce/src/purchase/discountApplication.d.ts +74 -0
- package/dist/_dts/commerce/src/purchase/index.d.ts +55 -0
- package/dist/_dts/commerce/src/purchase/oneTimeCheckoutPlanning.d.ts +86 -0
- package/dist/_dts/commerce/src/purchase/order-number.d.ts +33 -0
- package/dist/_dts/commerce/src/purchase/orderCancellationPlan.d.ts +19 -0
- package/dist/_dts/commerce/src/purchase/orderCompletionEmailPlan.d.ts +71 -0
- package/dist/_dts/commerce/src/purchase/orderConfirmationPlanning.d.ts +120 -0
- package/dist/_dts/commerce/src/purchase/orderFulfillmentPlan.d.ts +81 -0
- package/dist/_dts/commerce/src/purchase/orderFulfillmentResult.d.ts +8 -0
- package/dist/_dts/commerce/src/purchase/orderHistoryLedgerFilters.d.ts +1 -0
- package/dist/_dts/commerce/src/purchase/orderHistorySource.d.ts +11 -0
- package/dist/_dts/commerce/src/purchase/orderInstalmentAdminSettlement.d.ts +43 -0
- package/dist/_dts/commerce/src/purchase/orderInstalmentClosure.d.ts +29 -0
- package/dist/_dts/commerce/src/purchase/orderInstalmentLifecycle.d.ts +44 -0
- package/dist/_dts/commerce/src/purchase/orderInstalmentPayoff.d.ts +24 -0
- package/dist/_dts/commerce/src/purchase/orderInstalmentPlan.d.ts +40 -0
- package/dist/_dts/commerce/src/purchase/orderItemMetadata.d.ts +151 -0
- package/dist/_dts/commerce/src/purchase/orderItemSupport.d.ts +14 -0
- package/dist/_dts/commerce/src/purchase/orderListFilters.d.ts +3 -0
- package/dist/_dts/commerce/src/purchase/orderPaymentLinkPlanning.d.ts +60 -0
- package/dist/_dts/commerce/src/purchase/orderPaymentReceipt.d.ts +184 -0
- package/dist/_dts/commerce/src/purchase/orderPaymentState.d.ts +135 -0
- package/dist/_dts/commerce/src/purchase/orderPlanningTypes.d.ts +102 -0
- package/dist/_dts/commerce/src/purchase/orderRefundPlanning.d.ts +50 -0
- package/dist/_dts/commerce/src/purchase/orderRefundPolicy.d.ts +36 -0
- package/dist/_dts/commerce/src/purchase/orderTotals.d.ts +23 -0
- package/dist/_dts/commerce/src/purchase/orderTypes.d.ts +39 -0
- package/dist/_dts/commerce/src/purchase/pendingCheckoutSessionClaim.d.ts +1 -0
- package/dist/_dts/commerce/src/purchase/persistedCheckoutLines.d.ts +27 -0
- package/dist/_dts/commerce/src/purchase/protectedDepositRefundPolicy.d.ts +86 -0
- package/dist/_dts/commerce/src/purchase/refundPolicy.d.ts +8 -0
- package/dist/_dts/commerce/src/purchase/refundRailSplit.d.ts +40 -0
- package/dist/_dts/commerce/src/purchase/result.d.ts +2 -0
- package/dist/_dts/commerce/src/purchase/settlement.d.ts +97 -0
- package/dist/_dts/commerce/src/purchase/shopRefundPlanning.d.ts +43 -0
- package/dist/_dts/commerce/src/purchase/stateTransitions.d.ts +31 -0
- package/dist/_dts/commerce/src/purchase/stripeMinimumCharge.d.ts +10 -0
- package/dist/_dts/commerce/src/purchase/types.d.ts +168 -0
- package/dist/_dts/commerce/src/shop/shipmentEligibility.d.ts +14 -0
- package/dist/_dts/commerce/src/utils/assertNever.d.ts +1 -0
- package/dist/_dts/content-model/src/content-types/builtin-schemas.d.ts +4 -0
- package/dist/_dts/content-model/src/content-types/builtins.d.ts +4 -0
- package/dist/_dts/core/src/booking-vertical-catalog.d.ts +741 -0
- package/dist/_dts/core/src/booking-vertical-config.d.ts +66 -0
- package/dist/_dts/core/src/booking-vertical-definitions.d.ts +68 -0
- package/dist/_dts/{api/src/bookingVerticalPreset.d.ts → core/src/booking-vertical-preset.d.ts} +1 -1
- package/dist/_dts/core/src/booking-verticals.d.ts +98 -0
- package/dist/_dts/core/src/event-page-selection.d.ts +22 -0
- package/dist/_dts/core/src/event-pricing.d.ts +5 -0
- package/dist/_dts/core/src/event-series-behaviour.d.ts +16 -0
- package/dist/_dts/core/src/index.d.ts +3 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +72 -0
- package/dist/_dts/db/src/schemas/forms.d.ts +4 -4
- package/dist/_dts/media-core/src/fileUploadCompletion.d.ts +3 -0
- package/dist/_dts/media-core/src/fileUploadDurableFinalization.d.ts +2 -0
- package/dist/_dts/media-core/src/identifiers.d.ts +10 -0
- package/dist/_dts/media-core/src/mediaWriteNormalizer.d.ts +2 -6
- package/dist/_dts/media-core/src/types.d.ts +2 -1
- package/dist/_dts/media-editor/src/index.d.ts +2 -2
- package/dist/_dts/media-editor/src/mediaSelection.d.ts +1 -22
- package/dist/_dts/media-editor/src/useMediaSelection.d.ts +0 -9
- package/dist/_dts/preview-next/src/client/preview/ButtonHoverRoleControls.d.ts +10 -0
- package/dist/_dts/preview-next/src/client/preview/ButtonStylePicker.d.ts +3 -2
- package/dist/_dts/preview-next/src/client/preview/PreviewEditorSidebar.d.ts +3 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.d.ts +3 -1
- package/dist/_dts/preview-next/src/client/preview/StyleConfiguratorWarningNotice.d.ts +7 -0
- package/dist/_dts/preview-next/src/client/preview/siteStylePreviewPlanner.d.ts +1 -1
- package/dist/_dts/sdk/src/client/eventSubrouteReadOperations.d.ts +11 -0
- package/dist/_dts/sdk/src/client/types.d.ts +12 -5
- package/dist/_dts/sdk/src/components.d.ts +1 -1
- package/dist/_dts/sdk/src/contracts/index.d.ts +1 -1
- package/dist/_dts/sdk/src/contracts/page.d.ts +2 -13
- package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +4 -16
- package/dist/_dts/sdk/src/next/pageMetadataProjection.d.ts +7 -0
- package/dist/_dts/sdk/src/next/resolveEventPageSubroute.d.ts +12 -0
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +5 -19
- package/dist/_dts/sdk/src/public-api/eventSubrouteContracts.d.ts +12 -0
- package/dist/_dts/sdk/src/public-api/runtime.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/client.d.ts +44 -0
- package/dist/_dts/sdk/src/rendering/index.d.ts +1 -1
- package/dist/_dts/sdk/src/routing/entrySubroutes.d.ts +1 -1
- package/dist/_dts/sdk/src/routing/resolveOccurrence.d.ts +4 -3
- package/dist/_dts/sdk/src/routing/resolvePageContent.d.ts +7 -3
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/buttons/buttonSurfaceContext.d.ts +1 -1
- package/dist/_dts/theme-core/src/buttons/contextualHover.d.ts +41 -0
- package/dist/_dts/theme-core/src/buttons/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/buttons/resolveButtonColourStates.d.ts +3 -0
- package/dist/_dts/theme-core/src/buttons/resolveButtonHoverTreatment.d.ts +14 -0
- package/dist/_dts/theme-core/src/buttons/styles/domain.d.ts +21 -4
- package/dist/_dts/theme-core/src/buttons/styles/recipes/flatInk.d.ts +92 -0
- package/dist/_dts/theme-core/src/buttons/styles/recipes/staticRecipes.d.ts +10 -150
- package/dist/_dts/theme-core/src/buttons/styles/registry.d.ts +57 -102
- package/dist/_dts/theme-core/src/buttons/styles/selection.d.ts +50 -2
- package/dist/_dts/theme-core/src/buttons/types.d.ts +29 -0
- package/dist/_dts/theme-core/src/cards/types.d.ts +3 -25
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +21 -6
- package/dist/_dts/theme-core/src/schema.d.ts +21 -33
- package/dist/_dts/theme-core/src/site-styles/appearancePresetCatalog.d.ts +27 -0
- package/dist/_dts/theme-core/src/site-styles/blockAppearancePresets.d.ts +27 -0
- package/dist/_dts/theme-core/src/site-styles/buttonSelectionCompiler.d.ts +18 -0
- package/dist/_dts/theme-core/src/site-styles/compilationPlan.d.ts +21 -0
- package/dist/_dts/theme-core/src/site-styles/previewCompiler.d.ts +2 -11
- package/dist/_dts/theme-core/src/site-styles/selectionFallbackWarning.d.ts +15 -0
- package/dist/_dts/theme-core/src/site-styles/types.d.ts +13 -1
- package/dist/_dts/ui/src/navigation-tabs.d.ts +2 -0
- package/dist/client/{DiscountCodeDisclosure-BPZ-yfGI.mjs → DiscountCodeDisclosure-DO7llLxm.mjs} +12 -12
- package/dist/client/{EventCombined.client-Cjt3kKYR.mjs → EventCombined.client-xID7zN__.mjs} +36 -48
- package/dist/client/{EventListing.client-DY9dn6Fh.mjs → EventListing.client-CriBslp0.mjs} +2 -2
- package/dist/client/{LeafletStaticMap--2c61XYn.mjs → LeafletStaticMap-DYmHnM8g.mjs} +1 -1
- package/dist/client/{StepIndicator-CLjQhkDb.mjs → StepIndicator-CGixP_LW.mjs} +2 -2
- package/dist/client/{CourseRegistrationWizard-DGW9F0SQ.mjs → WholeSeriesRegistrationWizard-BEjzSiOA.mjs} +1408 -1245
- package/dist/client/{accordion-_boYwHHi.mjs → accordion-CgFbnnnQ.mjs} +1 -1
- package/dist/client/{bookingForm--AqEfyBX.mjs → bookingForm-dUyGpbxc.mjs} +5 -5
- package/dist/client/bookings.mjs +635 -471
- package/dist/client/{carousel-CVI2dqZr.mjs → carousel-BvBwkUzx.mjs} +1 -1
- package/dist/client/{cart-DR6IiPz9.mjs → cart-DiZENT2E.mjs} +3 -3
- package/dist/client/{checkout-CsrGAfQt.mjs → checkout-Dq13KIgR.mjs} +3 -3
- package/dist/client/client.mjs +6291 -3452
- package/dist/client/{courseRegistration-aNJVaLa3.mjs → courseRegistration-CKC5NmyH.mjs} +10 -4
- package/dist/client/{eventCalendar-OZ7h59VN.mjs → eventCalendar-BF0Jatfw.mjs} +40 -43
- package/dist/client/{eventCombined-BbJ6bFKz.mjs → eventCombined-BuoCF8je.mjs} +2 -2
- package/dist/client/{eventDetails-BLyUBiCT.mjs → eventDetails-CKwh0S9s.mjs} +276 -94
- package/dist/client/{eventListing-DuP1yhBS.mjs → eventListing-eUxaWFaB.mjs} +2 -2
- package/dist/client/{eventRegistration-BXyECPa-.mjs → eventRegistration-CfkNOkPb.mjs} +625 -132
- package/dist/client/{form-BA4t3kKU.mjs → form-C17H1c_H.mjs} +1 -1
- package/dist/client/{headerSection-CpNaJxhW.mjs → headerSection-DEwUmrtt.mjs} +2 -2
- package/dist/client/hooks.mjs +1312 -481
- package/dist/client/{locationMap-3HGMCL7_.mjs → locationMap-Pf2QwuvW.mjs} +2 -2
- package/dist/client/{newsletterForm-C2s6Mw67.mjs → newsletterForm-BWQAH5Sv.mjs} +1 -1
- package/dist/client/pricing-CVdvbopJ.mjs +195 -0
- package/dist/client/{productDetail-C9joWhdE.mjs → productDetail-BZi1Fa_G.mjs} +3 -3
- package/dist/client/{productList-CjzdU3pB.mjs → productList-qq-55DNk.mjs} +3 -3
- package/dist/client/{propsDecoder-CBPGXEYX.mjs → propsDecoder-BxmqPKdP.mjs} +412 -196
- package/dist/client/rendering/client.mjs +5685 -4037
- package/dist/client/rendering/islands.mjs +18 -18
- package/dist/client/rendering.mjs +7006 -4124
- package/dist/client/{scrollToBlock-DZ73aEX6.mjs → scrollToBlock-B3CcKdtG.mjs} +1 -1
- package/dist/client/{shop-CQRai7hj.mjs → shop-DNWJPut5.mjs} +5 -5
- package/dist/client/{shop-commerce-hP9UboOx.mjs → shop-commerce-BhvQCosS.mjs} +4 -4
- package/dist/client/{shop-commerce-store-DiD5a32e.mjs → shop-commerce-store-B04sCNnW.mjs} +1 -1
- package/dist/client/{shopShared-DP8DXTkF.mjs → shopShared-DNNgZlmW.mjs} +2 -2
- package/dist/client/{useEventFilters-pF_OJNQP.mjs → useEventFilters-CUmhE24_.mjs} +195 -6
- package/dist/client/{usePolling-Cls91SD2.mjs → usePolling-M5jG675x.mjs} +3 -3
- package/dist/preview-next/before-render.mjs +247 -60
- package/dist/preview-next/client/runtime.mjs +4 -4
- package/dist/preview-next/keepAlive.mjs +247 -60
- package/dist/preview-next/middleware.mjs +247 -60
- package/dist/{previewAuthStore-CX1C_KJ4.mjs → previewAuthStore-BFKd4LrN.mjs} +247 -60
- package/dist/{sdk-runtime-5CcPAI14.mjs → sdk-runtime-BEXb1wqo.mjs} +2 -2
- package/dist/{separator-BXlYN_gr.mjs → separator-DGMuip1D.mjs} +1 -1
- package/dist/server/components.mjs +3461 -1577
- package/dist/server/config-validation.mjs +1312 -482
- package/dist/server/config.mjs +1312 -482
- package/dist/server/data.mjs +1312 -481
- package/dist/server/index.mjs +289 -81
- package/dist/server/manifest.mjs +0 -1
- package/dist/server/next.mjs +3576 -1689
- package/dist/server/page-converter.mjs +797 -250
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +3461 -1576
- package/dist/server/rendering.mjs +3461 -1577
- package/dist/server/routing.mjs +1555 -616
- package/dist/server/server.mjs +1352 -560
- package/dist/server/theme-bridge.mjs +1992 -931
- package/dist/server/theme.mjs +346 -133
- package/dist/styles/index.css +1602 -796
- package/package.json +1 -1
- package/dist/_dts/api/src/bookingVerticalCatalog.d.ts +0 -746
- package/dist/_dts/api/src/eventSeriesPresentationPreset.d.ts +0 -12
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/CourseRegistrationWizard.d.ts +0 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/StepIndicator.d.ts +0 -6
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/components.d.ts +0 -45
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/pricing.d.ts +0 -14
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/useCoursePaymentVerification.d.ts +0 -9
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/useCourseRegistrationActions.d.ts +0 -35
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/useCourseRegistrationSelection.d.ts +0 -31
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/useCourseRegistrationWizard.d.ts +0 -102
- package/dist/client/eventProductEligibility-AVxyCB1u.mjs +0 -50
- package/dist/client/pricing-BiqIMgZk.mjs +0 -174
- /package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration → event-registration/whole-series}/PortalAuthSidebar.d.ts +0 -0
- /package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration → event-registration/whole-series}/SuccessStep.d.ts +0 -0
- /package/dist/_dts/blocks/src/system/runtime/nodes/{course-registration → event-registration/whole-series}/WaitlistStep.d.ts +0 -0
package/dist/client/bookings.mjs
CHANGED
|
@@ -7530,6 +7530,12 @@ const opaqueButtonColourTokenSchema = themeColorTokenSchema.refine((value) => pa
|
|
|
7530
7530
|
if (token === null) throw new Error("Invariant: opaque button token passed its schema");
|
|
7531
7531
|
return token;
|
|
7532
7532
|
});
|
|
7533
|
+
const contextualButtonHoverSchema = z.strictObject({
|
|
7534
|
+
kind: z.literal("shade-shift"),
|
|
7535
|
+
seedToken: opaqueButtonColourTokenSchema,
|
|
7536
|
+
fallbackDirection: z.enum(["lighter", "darker"]),
|
|
7537
|
+
preferredToken: opaqueButtonColourTokenSchema.optional()
|
|
7538
|
+
});
|
|
7533
7539
|
const buttonShadeAmountSchema = z.number().finite().min(0).max(900).multipleOf(100);
|
|
7534
7540
|
const buttonShadowIntensitySchema = z.enum([
|
|
7535
7541
|
"subtle",
|
|
@@ -7869,6 +7875,7 @@ const buttonVariantSchema = z.strictObject({
|
|
|
7869
7875
|
shadow: variantShadowSchema.optional(),
|
|
7870
7876
|
border: buttonBorderSchema.optional(),
|
|
7871
7877
|
hoverBackgroundToken: opaqueButtonColourTokenSchema.optional(),
|
|
7878
|
+
contextualHover: contextualButtonHoverSchema.optional(),
|
|
7872
7879
|
effects: variantEffectsSchema.optional(),
|
|
7873
7880
|
sizes: variantSizeOverridesSchema.optional(),
|
|
7874
7881
|
affordance: buttonVariantAffordanceSchema.optional()
|
|
@@ -8154,8 +8161,8 @@ const openCardRoleValue = "open";
|
|
|
8154
8161
|
*/
|
|
8155
8162
|
const surfaceCardRoleValues = [...cardVariantRoleValues, openCardRoleValue];
|
|
8156
8163
|
/**
|
|
8157
|
-
* The closed
|
|
8158
|
-
*
|
|
8164
|
+
* The closed role vocabulary Looks and blocks use for surfaced and boxless
|
|
8165
|
+
* card choices.
|
|
8159
8166
|
*
|
|
8160
8167
|
* - `none` — no site-style card surface; the block's own composition and
|
|
8161
8168
|
* the author's own card fields govern the item. This is *not*
|
|
@@ -8199,11 +8206,6 @@ const gradientDirectionSchema = z.enum([
|
|
|
8199
8206
|
z.enum(cardVariantRoleValues);
|
|
8200
8207
|
const surfaceCardRoleSchema = z.enum(surfaceCardRoleValues);
|
|
8201
8208
|
const cardRoleSchema = z.enum(cardRoleValues);
|
|
8202
|
-
/**
|
|
8203
|
-
* Historical name for the role vocabulary as it reaches box styles. Widened to
|
|
8204
|
-
* the full `CardRole` set — old values keep parsing, `open` now parses too.
|
|
8205
|
-
*/
|
|
8206
|
-
const boxStylesCardVariantSchema = cardRoleSchema;
|
|
8207
8209
|
const PRIORITY_ROLE_INFERENCE = {
|
|
8208
8210
|
1: "default",
|
|
8209
8211
|
2: "alternative"
|
|
@@ -9608,8 +9610,7 @@ const cardStylesOverrideSchema = z.object({
|
|
|
9608
9610
|
spacing: semanticSpacingSchema.nullable().optional(),
|
|
9609
9611
|
raised: z.boolean().nullable().optional(),
|
|
9610
9612
|
rounded: boxRoundedSchema.nullable().optional(),
|
|
9611
|
-
role: cardRoleSchema.nullable().optional()
|
|
9612
|
-
cardVariant: boxStylesCardVariantSchema.nullable().optional()
|
|
9613
|
+
role: cardRoleSchema.nullable().optional()
|
|
9613
9614
|
});
|
|
9614
9615
|
const blockStyleOverridesSchema = z.object({
|
|
9615
9616
|
sectionStyles: sectionStylesOverrideSchema.nullable().optional(),
|
|
@@ -10238,13 +10239,7 @@ function shadeBackgroundEffect(config) {
|
|
|
10238
10239
|
buttonSizeNameSchema.options;
|
|
10239
10240
|
//#endregion
|
|
10240
10241
|
//#region ../theme-core/src/buttons/styles/domain.ts
|
|
10241
|
-
const PUBLIC_BUTTON_ROLES =
|
|
10242
|
-
"primary",
|
|
10243
|
-
"secondary",
|
|
10244
|
-
"outline",
|
|
10245
|
-
"ghost",
|
|
10246
|
-
"accent"
|
|
10247
|
-
];
|
|
10242
|
+
const PUBLIC_BUTTON_ROLES = VARIANT_ROLES;
|
|
10248
10243
|
function defineButtonStyleRecipe(recipe) {
|
|
10249
10244
|
return recipe;
|
|
10250
10245
|
}
|
|
@@ -10340,6 +10335,14 @@ const BUTTON_STYLE_IDS = [
|
|
|
10340
10335
|
"quiet-arrow"
|
|
10341
10336
|
];
|
|
10342
10337
|
const quietArrowParametersSchema = z.object({ secondaryTreatment: z.enum(["outlined", "solid-accent"]) }).strict();
|
|
10338
|
+
const flatInkHoverTreatmentSchema = z.enum([
|
|
10339
|
+
"contextual",
|
|
10340
|
+
"secondary",
|
|
10341
|
+
"accent"
|
|
10342
|
+
]);
|
|
10343
|
+
const flatInkHoverPreferencesShape = Object.fromEntries(VARIANT_ROLES.map((role) => [role, flatInkHoverTreatmentSchema.optional()]));
|
|
10344
|
+
const flatInkHoverPreferencesSchema = z.strictObject(flatInkHoverPreferencesShape);
|
|
10345
|
+
const flatInkParametersSchema = z.strictObject({ hoverPreferences: flatInkHoverPreferencesSchema.optional() });
|
|
10343
10346
|
const emptyParametersSchema$1 = z.object({}).strict();
|
|
10344
10347
|
function selectionBranch(styleId, parameters) {
|
|
10345
10348
|
return z.object({
|
|
@@ -10354,7 +10357,7 @@ z.discriminatedUnion("styleId", [
|
|
|
10354
10357
|
selectionBranch("editorial-link", emptyParametersSchema$1),
|
|
10355
10358
|
selectionBranch("pebble", emptyParametersSchema$1),
|
|
10356
10359
|
selectionBranch("ink-stamp", emptyParametersSchema$1),
|
|
10357
|
-
selectionBranch("flat-ink",
|
|
10360
|
+
selectionBranch("flat-ink", flatInkParametersSchema),
|
|
10358
10361
|
selectionBranch("brushed-wash", emptyParametersSchema$1),
|
|
10359
10362
|
selectionBranch("showtime-pill", emptyParametersSchema$1),
|
|
10360
10363
|
selectionBranch("joy-stamp", emptyParametersSchema$1),
|
|
@@ -10491,6 +10494,189 @@ const quietArrowRecipe = defineButtonStyleRecipe({
|
|
|
10491
10494
|
})
|
|
10492
10495
|
});
|
|
10493
10496
|
//#endregion
|
|
10497
|
+
//#region ../theme-core/src/buttons/styles/recipes/flatInk.ts
|
|
10498
|
+
const contextualRoleConfig = {
|
|
10499
|
+
primary: {
|
|
10500
|
+
contextualSeedToken: unsafeAsOpaqueButtonColourToken("primary"),
|
|
10501
|
+
fallbackDirection: "darker"
|
|
10502
|
+
},
|
|
10503
|
+
secondary: {
|
|
10504
|
+
contextualSeedToken: unsafeAsOpaqueButtonColourToken("surfaceAlt"),
|
|
10505
|
+
fallbackDirection: "darker"
|
|
10506
|
+
},
|
|
10507
|
+
outline: {
|
|
10508
|
+
contextualSeedToken: unsafeAsOpaqueButtonColourToken("surfaceAlt"),
|
|
10509
|
+
fallbackDirection: "darker"
|
|
10510
|
+
},
|
|
10511
|
+
ghost: {
|
|
10512
|
+
contextualSeedToken: unsafeAsOpaqueButtonColourToken("surfaceAlt"),
|
|
10513
|
+
fallbackDirection: "darker"
|
|
10514
|
+
},
|
|
10515
|
+
accent: {
|
|
10516
|
+
contextualSeedToken: unsafeAsOpaqueButtonColourToken("accent"),
|
|
10517
|
+
fallbackDirection: "darker"
|
|
10518
|
+
}
|
|
10519
|
+
};
|
|
10520
|
+
const hoverControl = {
|
|
10521
|
+
kind: "button-hover-by-role",
|
|
10522
|
+
parameter: "hoverPreferences",
|
|
10523
|
+
label: "Button hover",
|
|
10524
|
+
roles: contextualRoleConfig,
|
|
10525
|
+
options: [
|
|
10526
|
+
{
|
|
10527
|
+
value: "contextual",
|
|
10528
|
+
label: "Contextual shade shift"
|
|
10529
|
+
},
|
|
10530
|
+
{
|
|
10531
|
+
value: "secondary",
|
|
10532
|
+
label: "Secondary button colour"
|
|
10533
|
+
},
|
|
10534
|
+
{
|
|
10535
|
+
value: "accent",
|
|
10536
|
+
label: "Accent button colour"
|
|
10537
|
+
}
|
|
10538
|
+
]
|
|
10539
|
+
};
|
|
10540
|
+
const lift = { effectId: "lift" };
|
|
10541
|
+
const flatInkRecipe = defineButtonStyleRecipe({
|
|
10542
|
+
id: "flat-ink",
|
|
10543
|
+
accessibilityLabel: "Flat rounded buttons with arrow affordances",
|
|
10544
|
+
tags: {
|
|
10545
|
+
tone: "classic",
|
|
10546
|
+
energy: "calm",
|
|
10547
|
+
motion: "subtle",
|
|
10548
|
+
era: "editorial"
|
|
10549
|
+
},
|
|
10550
|
+
parameterSchema: flatInkParametersSchema,
|
|
10551
|
+
defaultParameters: {},
|
|
10552
|
+
controls: [hoverControl],
|
|
10553
|
+
defineSystem: (parameters) => ({
|
|
10554
|
+
global: {
|
|
10555
|
+
cornerStyle: "rounded",
|
|
10556
|
+
textTransform: "none",
|
|
10557
|
+
fontWeight: 600,
|
|
10558
|
+
typography: "body",
|
|
10559
|
+
letterSpacing: "tight",
|
|
10560
|
+
paddingPreset: "default",
|
|
10561
|
+
hoverTransform: "lift",
|
|
10562
|
+
hoverColor: "none"
|
|
10563
|
+
},
|
|
10564
|
+
sizes: {
|
|
10565
|
+
sm: {
|
|
10566
|
+
padding: "0.625rem 1.125rem",
|
|
10567
|
+
fontSize: "text-sm"
|
|
10568
|
+
},
|
|
10569
|
+
md: { padding: "0.8125rem 1.375rem" },
|
|
10570
|
+
lg: {
|
|
10571
|
+
padding: "0.9375rem 1.625rem",
|
|
10572
|
+
fontSize: "text-lg"
|
|
10573
|
+
},
|
|
10574
|
+
xl: {
|
|
10575
|
+
padding: "1.0625rem 2rem",
|
|
10576
|
+
fontSize: "text-xl"
|
|
10577
|
+
}
|
|
10578
|
+
},
|
|
10579
|
+
roles: {
|
|
10580
|
+
primary: {
|
|
10581
|
+
kind: "complete",
|
|
10582
|
+
appearance: {
|
|
10583
|
+
background: {
|
|
10584
|
+
type: "solid",
|
|
10585
|
+
colorToken: unsafeAsOpaqueButtonColourToken("primary")
|
|
10586
|
+
},
|
|
10587
|
+
borderRadius: "rounded-lg",
|
|
10588
|
+
affordance: { iconId: "ArrowRight" },
|
|
10589
|
+
...hoverAppearance("primary", parameters, [lift, {
|
|
10590
|
+
effectId: "background-on-hover",
|
|
10591
|
+
options: { colorToken: unsafeAsOpaqueButtonColourToken("secondary") }
|
|
10592
|
+
}])
|
|
10593
|
+
}
|
|
10594
|
+
},
|
|
10595
|
+
secondary: {
|
|
10596
|
+
kind: "complete",
|
|
10597
|
+
appearance: {
|
|
10598
|
+
background: {
|
|
10599
|
+
type: "surface",
|
|
10600
|
+
role: "link"
|
|
10601
|
+
},
|
|
10602
|
+
borderRadius: "rounded-lg",
|
|
10603
|
+
border: { widthClass: "border" },
|
|
10604
|
+
...hoverAppearance("secondary", parameters, [lift, {
|
|
10605
|
+
effectId: "background-on-hover",
|
|
10606
|
+
options: { colorToken: unsafeAsOpaqueButtonColourToken("surfaceAlt") }
|
|
10607
|
+
}])
|
|
10608
|
+
}
|
|
10609
|
+
},
|
|
10610
|
+
outline: {
|
|
10611
|
+
kind: "complete",
|
|
10612
|
+
appearance: {
|
|
10613
|
+
background: {
|
|
10614
|
+
type: "surface",
|
|
10615
|
+
role: "link"
|
|
10616
|
+
},
|
|
10617
|
+
borderRadius: "rounded-lg",
|
|
10618
|
+
border: { widthClass: "border" },
|
|
10619
|
+
...hoverAppearance("outline", parameters, [lift, {
|
|
10620
|
+
effectId: "background-on-hover",
|
|
10621
|
+
options: { colorToken: unsafeAsOpaqueButtonColourToken("surfaceAlt") }
|
|
10622
|
+
}])
|
|
10623
|
+
}
|
|
10624
|
+
},
|
|
10625
|
+
ghost: {
|
|
10626
|
+
kind: "complete",
|
|
10627
|
+
appearance: {
|
|
10628
|
+
background: {
|
|
10629
|
+
type: "surface",
|
|
10630
|
+
role: "link"
|
|
10631
|
+
},
|
|
10632
|
+
borderRadius: "rounded-lg",
|
|
10633
|
+
...hoverAppearance("ghost", parameters, [lift])
|
|
10634
|
+
}
|
|
10635
|
+
},
|
|
10636
|
+
accent: {
|
|
10637
|
+
kind: "complete",
|
|
10638
|
+
appearance: {
|
|
10639
|
+
background: {
|
|
10640
|
+
type: "solid",
|
|
10641
|
+
colorToken: unsafeAsOpaqueButtonColourToken("accent")
|
|
10642
|
+
},
|
|
10643
|
+
borderRadius: "rounded-lg",
|
|
10644
|
+
affordance: { iconId: "ArrowRight" },
|
|
10645
|
+
...hoverAppearance("accent", parameters, [lift])
|
|
10646
|
+
}
|
|
10647
|
+
}
|
|
10648
|
+
}
|
|
10649
|
+
})
|
|
10650
|
+
});
|
|
10651
|
+
function hoverAppearance(role, parameters, recommended) {
|
|
10652
|
+
const preference = parameters.hoverPreferences?.[role];
|
|
10653
|
+
if (preference === void 0) return { effects: { hover: [...recommended] } };
|
|
10654
|
+
if (preference === "contextual") {
|
|
10655
|
+
const config = contextualRoleConfig[role];
|
|
10656
|
+
return {
|
|
10657
|
+
effects: { hover: [lift] },
|
|
10658
|
+
contextualHover: {
|
|
10659
|
+
kind: "shade-shift",
|
|
10660
|
+
seedToken: config.contextualSeedToken,
|
|
10661
|
+
fallbackDirection: config.fallbackDirection
|
|
10662
|
+
}
|
|
10663
|
+
};
|
|
10664
|
+
}
|
|
10665
|
+
const config = contextualRoleConfig[role];
|
|
10666
|
+
return {
|
|
10667
|
+
effects: { hover: [lift] },
|
|
10668
|
+
contextualHover: {
|
|
10669
|
+
kind: "shade-shift",
|
|
10670
|
+
seedToken: config.contextualSeedToken,
|
|
10671
|
+
fallbackDirection: config.fallbackDirection,
|
|
10672
|
+
preferredToken: unsafeAsOpaqueButtonColourToken(paletteRole(preference))
|
|
10673
|
+
}
|
|
10674
|
+
};
|
|
10675
|
+
}
|
|
10676
|
+
function paletteRole(preference) {
|
|
10677
|
+
return preference;
|
|
10678
|
+
}
|
|
10679
|
+
//#endregion
|
|
10494
10680
|
//#region ../theme-core/src/buttons/styles/recipes/defineStaticButtonStyleRecipe.ts
|
|
10495
10681
|
const emptyParametersSchema = z.object({}).strict();
|
|
10496
10682
|
function defineStaticButtonStyleRecipe(input) {
|
|
@@ -11337,113 +11523,6 @@ const inkStampRecipe = defineStaticButtonStyleRecipe({
|
|
|
11337
11523
|
}
|
|
11338
11524
|
}
|
|
11339
11525
|
});
|
|
11340
|
-
const flatInkRecipe = defineStaticButtonStyleRecipe({
|
|
11341
|
-
id: "flat-ink",
|
|
11342
|
-
accessibilityLabel: "Flat rounded buttons with arrow affordances",
|
|
11343
|
-
tags: {
|
|
11344
|
-
tone: "classic",
|
|
11345
|
-
energy: "calm",
|
|
11346
|
-
motion: "subtle",
|
|
11347
|
-
era: "editorial"
|
|
11348
|
-
},
|
|
11349
|
-
system: {
|
|
11350
|
-
global: {
|
|
11351
|
-
cornerStyle: "rounded",
|
|
11352
|
-
textTransform: "none",
|
|
11353
|
-
fontWeight: 600,
|
|
11354
|
-
typography: "body",
|
|
11355
|
-
letterSpacing: "tight",
|
|
11356
|
-
paddingPreset: "default",
|
|
11357
|
-
hoverTransform: "lift",
|
|
11358
|
-
hoverColor: "none"
|
|
11359
|
-
},
|
|
11360
|
-
sizes: {
|
|
11361
|
-
sm: {
|
|
11362
|
-
padding: "0.625rem 1.125rem",
|
|
11363
|
-
fontSize: "text-sm"
|
|
11364
|
-
},
|
|
11365
|
-
md: { padding: "0.8125rem 1.375rem" },
|
|
11366
|
-
lg: {
|
|
11367
|
-
padding: "0.9375rem 1.625rem",
|
|
11368
|
-
fontSize: "text-lg"
|
|
11369
|
-
},
|
|
11370
|
-
xl: {
|
|
11371
|
-
padding: "1.0625rem 2rem",
|
|
11372
|
-
fontSize: "text-xl"
|
|
11373
|
-
}
|
|
11374
|
-
},
|
|
11375
|
-
roles: {
|
|
11376
|
-
primary: {
|
|
11377
|
-
kind: "complete",
|
|
11378
|
-
appearance: {
|
|
11379
|
-
background: {
|
|
11380
|
-
type: "solid",
|
|
11381
|
-
colorToken: "primary"
|
|
11382
|
-
},
|
|
11383
|
-
borderRadius: "rounded-lg",
|
|
11384
|
-
affordance: { iconId: "ArrowRight" },
|
|
11385
|
-
effects: { hover: [{ effectId: "lift" }, {
|
|
11386
|
-
effectId: "background-on-hover",
|
|
11387
|
-
options: { colorToken: unsafeAsOpaqueButtonColourToken("secondary") }
|
|
11388
|
-
}] }
|
|
11389
|
-
}
|
|
11390
|
-
},
|
|
11391
|
-
secondary: {
|
|
11392
|
-
kind: "complete",
|
|
11393
|
-
appearance: {
|
|
11394
|
-
background: {
|
|
11395
|
-
type: "surface",
|
|
11396
|
-
role: "link"
|
|
11397
|
-
},
|
|
11398
|
-
borderRadius: "rounded-lg",
|
|
11399
|
-
border: { widthClass: "border" },
|
|
11400
|
-
effects: { hover: [{ effectId: "lift" }, {
|
|
11401
|
-
effectId: "background-on-hover",
|
|
11402
|
-
options: { colorToken: unsafeAsOpaqueButtonColourToken("surfaceAlt") }
|
|
11403
|
-
}] }
|
|
11404
|
-
}
|
|
11405
|
-
},
|
|
11406
|
-
outline: {
|
|
11407
|
-
kind: "complete",
|
|
11408
|
-
appearance: {
|
|
11409
|
-
background: {
|
|
11410
|
-
type: "surface",
|
|
11411
|
-
role: "link"
|
|
11412
|
-
},
|
|
11413
|
-
borderRadius: "rounded-lg",
|
|
11414
|
-
border: { widthClass: "border" },
|
|
11415
|
-
effects: { hover: [{ effectId: "lift" }, {
|
|
11416
|
-
effectId: "background-on-hover",
|
|
11417
|
-
options: { colorToken: unsafeAsOpaqueButtonColourToken("surfaceAlt") }
|
|
11418
|
-
}] }
|
|
11419
|
-
}
|
|
11420
|
-
},
|
|
11421
|
-
ghost: {
|
|
11422
|
-
kind: "complete",
|
|
11423
|
-
appearance: {
|
|
11424
|
-
background: {
|
|
11425
|
-
type: "surface",
|
|
11426
|
-
role: "link"
|
|
11427
|
-
},
|
|
11428
|
-
borderRadius: "rounded-lg",
|
|
11429
|
-
effects: { hover: [{ effectId: "lift" }] }
|
|
11430
|
-
}
|
|
11431
|
-
},
|
|
11432
|
-
accent: {
|
|
11433
|
-
kind: "complete",
|
|
11434
|
-
appearance: {
|
|
11435
|
-
background: {
|
|
11436
|
-
type: "solid",
|
|
11437
|
-
colorToken: "accent"
|
|
11438
|
-
},
|
|
11439
|
-
borderRadius: "rounded-lg",
|
|
11440
|
-
affordance: { iconId: "ArrowRight" },
|
|
11441
|
-
effects: { hover: [{ effectId: "lift" }] }
|
|
11442
|
-
}
|
|
11443
|
-
}
|
|
11444
|
-
}
|
|
11445
|
-
}
|
|
11446
|
-
});
|
|
11447
11526
|
const showtimePillRecipe = defineStaticButtonStyleRecipe({
|
|
11448
11527
|
id: "showtime-pill",
|
|
11449
11528
|
accessibilityLabel: "Bold uppercase pill buttons with playful movement",
|
|
@@ -12198,17 +12277,17 @@ function StepIndicator({ currentStep, totalSteps, stepLabels, classPrefix, emitS
|
|
|
12198
12277
|
//#endregion
|
|
12199
12278
|
//#region ../blocks/src/system/runtime/shared/components/DiscountCodeDisclosure.tsx
|
|
12200
12279
|
const BLOCK_DISCOUNT_CODE_DISCLOSURE_CLASSES = {
|
|
12201
|
-
"
|
|
12202
|
-
root: "
|
|
12203
|
-
toggle: "
|
|
12204
|
-
form: "
|
|
12205
|
-
label: "
|
|
12206
|
-
row: "
|
|
12207
|
-
input: "
|
|
12208
|
-
apply: "
|
|
12209
|
-
remove: "
|
|
12210
|
-
hint: "
|
|
12211
|
-
feedback: "
|
|
12280
|
+
"whole-series-registration": {
|
|
12281
|
+
root: "er-whole-series-discount",
|
|
12282
|
+
toggle: "er-whole-series-discount__toggle",
|
|
12283
|
+
form: "er-whole-series-discount__form",
|
|
12284
|
+
label: "er-whole-series-discount__label",
|
|
12285
|
+
row: "er-whole-series-discount__row",
|
|
12286
|
+
input: "er-whole-series-discount__input",
|
|
12287
|
+
apply: "er-whole-series-discount__apply",
|
|
12288
|
+
remove: "er-whole-series-discount__remove",
|
|
12289
|
+
hint: "er-whole-series-discount__hint",
|
|
12290
|
+
feedback: "er-whole-series-discount__feedback"
|
|
12212
12291
|
},
|
|
12213
12292
|
"event-registration": {
|
|
12214
12293
|
root: "er-discount",
|
|
@@ -13764,6 +13843,15 @@ function existingRegistrationLookupReducer(state, action) {
|
|
|
13764
13843
|
* Custom hooks for portal authentication and eligibility checking.
|
|
13765
13844
|
* Extracted from the main EventRegistrationClient for better separation of concerns.
|
|
13766
13845
|
*/
|
|
13846
|
+
function scopePortalCreditStateToSubject(state, subjectEmail) {
|
|
13847
|
+
if (!subjectEmail) return { kind: "not_authenticated" };
|
|
13848
|
+
if (state.kind === "not_authenticated") return state;
|
|
13849
|
+
const normalizedSubject = subjectEmail.trim().toLowerCase();
|
|
13850
|
+
return state.subjectEmail === normalizedSubject ? state : {
|
|
13851
|
+
kind: "loading",
|
|
13852
|
+
subjectEmail: normalizedSubject
|
|
13853
|
+
};
|
|
13854
|
+
}
|
|
13767
13855
|
const eventRegistrationHooksDeps = { useBlockApi };
|
|
13768
13856
|
/**
|
|
13769
13857
|
* Hook for managing portal authentication state.
|
|
@@ -13778,27 +13866,54 @@ function usePortalAuthWithDeps(deps) {
|
|
|
13778
13866
|
const api = deps.useBlockApi();
|
|
13779
13867
|
const [authState, setAuthState] = useState("checking");
|
|
13780
13868
|
const [profile, setProfile] = useState(null);
|
|
13869
|
+
const [creditState, setCreditState] = useState({ kind: "not_authenticated" });
|
|
13781
13870
|
useEffect(() => {
|
|
13782
13871
|
let cancelled = false;
|
|
13783
13872
|
async function checkPortalAuth() {
|
|
13784
13873
|
if ((api.config.authOverrides?.portal ?? api.config.auth).type !== "bearer") {
|
|
13785
13874
|
setAuthState("unauthenticated");
|
|
13875
|
+
setProfile(null);
|
|
13876
|
+
setCreditState({ kind: "not_authenticated" });
|
|
13786
13877
|
return;
|
|
13787
13878
|
}
|
|
13788
13879
|
setAuthState("checking");
|
|
13880
|
+
setProfile(null);
|
|
13881
|
+
setCreditState({ kind: "not_authenticated" });
|
|
13789
13882
|
try {
|
|
13790
13883
|
const me = await api.getPortalProfile();
|
|
13791
13884
|
if (cancelled) return;
|
|
13792
|
-
|
|
13793
|
-
setProfile({
|
|
13885
|
+
const nextProfile = {
|
|
13794
13886
|
email: me.profile.email,
|
|
13795
13887
|
name: me.profile.name,
|
|
13796
13888
|
phone: me.profile.phone || ""
|
|
13889
|
+
};
|
|
13890
|
+
const subjectEmail = nextProfile.email.trim().toLowerCase();
|
|
13891
|
+
setProfile(nextProfile);
|
|
13892
|
+
setCreditState({
|
|
13893
|
+
kind: "loading",
|
|
13894
|
+
subjectEmail
|
|
13797
13895
|
});
|
|
13896
|
+
setAuthState("authenticated");
|
|
13897
|
+
try {
|
|
13898
|
+
const credit = await api.getPortalCredit();
|
|
13899
|
+
if (cancelled) return;
|
|
13900
|
+
setCreditState({
|
|
13901
|
+
kind: "loaded",
|
|
13902
|
+
subjectEmail,
|
|
13903
|
+
credit
|
|
13904
|
+
});
|
|
13905
|
+
} catch {
|
|
13906
|
+
if (cancelled) return;
|
|
13907
|
+
setCreditState({
|
|
13908
|
+
kind: "unavailable",
|
|
13909
|
+
subjectEmail
|
|
13910
|
+
});
|
|
13911
|
+
}
|
|
13798
13912
|
} catch {
|
|
13799
13913
|
if (cancelled) return;
|
|
13800
13914
|
setAuthState("unauthenticated");
|
|
13801
13915
|
setProfile(null);
|
|
13916
|
+
setCreditState({ kind: "not_authenticated" });
|
|
13802
13917
|
}
|
|
13803
13918
|
}
|
|
13804
13919
|
checkPortalAuth();
|
|
@@ -13818,6 +13933,7 @@ function usePortalAuthWithDeps(deps) {
|
|
|
13818
13933
|
isAuthenticated: authState === "authenticated",
|
|
13819
13934
|
isChecking: authState === "checking",
|
|
13820
13935
|
profile,
|
|
13936
|
+
creditState: scopePortalCreditStateToSubject(creditState, authState === "authenticated" ? profile?.email ?? null : null),
|
|
13821
13937
|
logout
|
|
13822
13938
|
};
|
|
13823
13939
|
}
|
|
@@ -14058,9 +14174,14 @@ function getWaitlistClaimTokenSnapshot() {
|
|
|
14058
14174
|
function useWaitlistClaim() {
|
|
14059
14175
|
return useWaitlistClaimWithDeps(useWaitlistClaimDeps);
|
|
14060
14176
|
}
|
|
14177
|
+
function useWaitlistClaimForToken(token) {
|
|
14178
|
+
return useResolvedWaitlistClaim(useWaitlistClaimDeps, token);
|
|
14179
|
+
}
|
|
14061
14180
|
function useWaitlistClaimWithDeps(deps) {
|
|
14181
|
+
return useResolvedWaitlistClaim(deps, useSyncExternalStore(subscribeToWaitlistClaimToken, getWaitlistClaimTokenSnapshot, () => null));
|
|
14182
|
+
}
|
|
14183
|
+
function useResolvedWaitlistClaim(deps, token) {
|
|
14062
14184
|
const api = deps.useBlockApi();
|
|
14063
|
-
const token = useSyncExternalStore(subscribeToWaitlistClaimToken, getWaitlistClaimTokenSnapshot, () => null);
|
|
14064
14185
|
const [state, dispatch] = useReducer(waitlistClaimReducer, Boolean(token), createInitialWaitlistClaimState);
|
|
14065
14186
|
useEffect(() => {
|
|
14066
14187
|
let cancelled = false;
|
|
@@ -14773,19 +14894,171 @@ const RichTextDocSchema = z.object({
|
|
|
14773
14894
|
content: z.array(TipTapNodeSchema)
|
|
14774
14895
|
}).strict();
|
|
14775
14896
|
//#endregion
|
|
14776
|
-
//#region ../blocks/src/system/blocks/
|
|
14777
|
-
|
|
14778
|
-
|
|
14779
|
-
|
|
14780
|
-
|
|
14897
|
+
//#region ../blocks/src/system/blocks/events/whole-series/pricing.ts
|
|
14898
|
+
function isSaleWindowOpen(option, now) {
|
|
14899
|
+
if (!option.isActive) return false;
|
|
14900
|
+
if (option.saleStartsAt && new Date(option.saleStartsAt) > now) return false;
|
|
14901
|
+
if (option.saleEndsAt && new Date(option.saleEndsAt) < now) return false;
|
|
14902
|
+
return true;
|
|
14903
|
+
}
|
|
14904
|
+
function toExactOrFreeDisplay(amount, currency) {
|
|
14905
|
+
if (amount <= 0) return {
|
|
14906
|
+
kind: "free",
|
|
14907
|
+
currency
|
|
14908
|
+
};
|
|
14909
|
+
return {
|
|
14910
|
+
kind: "exact",
|
|
14911
|
+
amount,
|
|
14912
|
+
currency
|
|
14913
|
+
};
|
|
14914
|
+
}
|
|
14915
|
+
function getSelectableWholeSeriesPricingOptionsForNow(offering, now) {
|
|
14916
|
+
if (offering.pricing.pricingStrategy !== "tiered") return [];
|
|
14917
|
+
return [...offering.pricing.options].filter((option) => isSaleWindowOpen(option, now)).sort((left, right) => {
|
|
14918
|
+
if (left.sortOrder !== right.sortOrder) return left.sortOrder - right.sortOrder;
|
|
14919
|
+
if (left.priceAmount !== right.priceAmount) return left.priceAmount - right.priceAmount;
|
|
14920
|
+
return left.name.localeCompare(right.name);
|
|
14921
|
+
});
|
|
14922
|
+
}
|
|
14923
|
+
function resolveWholeSeriesPricingState(offering, selectedPricingOptionId, selectedSlidingAmountOrNowInput, nowInput = {}) {
|
|
14924
|
+
const selection = normalizePricingSelectionInput(selectedSlidingAmountOrNowInput, nowInput);
|
|
14925
|
+
const currency = offering.pricing.currency;
|
|
14926
|
+
switch (offering.pricing.pricingStrategy) {
|
|
14927
|
+
case "free": return resolveFreePricing(currency);
|
|
14928
|
+
case "single": return resolveSinglePricing(offering.pricing.singlePriceAmount ?? 0, currency);
|
|
14929
|
+
case "tiered": return resolveTieredPricing(offering, selectedPricingOptionId, selection.nowInput);
|
|
14930
|
+
case "sliding_scale": return resolveSlidingScalePricing(offering, selection.selectedSlidingAmount);
|
|
14931
|
+
}
|
|
14932
|
+
}
|
|
14933
|
+
function normalizePricingSelectionInput(selectedSlidingAmountOrNowInput, nowInput) {
|
|
14934
|
+
return typeof selectedSlidingAmountOrNowInput === "object" && selectedSlidingAmountOrNowInput !== null ? {
|
|
14935
|
+
selectedSlidingAmount: null,
|
|
14936
|
+
nowInput: selectedSlidingAmountOrNowInput
|
|
14937
|
+
} : {
|
|
14938
|
+
selectedSlidingAmount: typeof selectedSlidingAmountOrNowInput === "number" || selectedSlidingAmountOrNowInput === null ? selectedSlidingAmountOrNowInput : null,
|
|
14939
|
+
nowInput
|
|
14940
|
+
};
|
|
14941
|
+
}
|
|
14942
|
+
function resolveFreePricing(currency) {
|
|
14943
|
+
return {
|
|
14944
|
+
currency,
|
|
14945
|
+
display: {
|
|
14946
|
+
kind: "free",
|
|
14947
|
+
currency
|
|
14948
|
+
},
|
|
14949
|
+
selectableOptions: [],
|
|
14950
|
+
requiresSelection: false,
|
|
14951
|
+
selectedOption: null,
|
|
14952
|
+
slidingScale: null,
|
|
14953
|
+
selectedSlidingAmount: null,
|
|
14954
|
+
selectedPriceAmount: 0,
|
|
14955
|
+
selectedRequiresPayment: false,
|
|
14956
|
+
hasPaidSelection: false,
|
|
14957
|
+
hasFreeSelection: true
|
|
14958
|
+
};
|
|
14959
|
+
}
|
|
14960
|
+
function resolveSinglePricing(amount, currency) {
|
|
14961
|
+
return {
|
|
14962
|
+
currency,
|
|
14963
|
+
display: toExactOrFreeDisplay(amount, currency),
|
|
14964
|
+
selectableOptions: [],
|
|
14965
|
+
requiresSelection: false,
|
|
14966
|
+
selectedOption: null,
|
|
14967
|
+
slidingScale: null,
|
|
14968
|
+
selectedSlidingAmount: null,
|
|
14969
|
+
selectedPriceAmount: amount,
|
|
14970
|
+
selectedRequiresPayment: amount > 0,
|
|
14971
|
+
hasPaidSelection: amount > 0,
|
|
14972
|
+
hasFreeSelection: amount <= 0
|
|
14973
|
+
};
|
|
14974
|
+
}
|
|
14975
|
+
function resolveTieredPricing(offering, selectedPricingOptionId, nowInput) {
|
|
14976
|
+
const currency = offering.pricing.currency;
|
|
14977
|
+
const selectableOptions = getSelectableWholeSeriesPricingOptionsForNow(offering, resolvePlanningDateInput(nowInput));
|
|
14978
|
+
const selectedOption = resolveSelectedTier(selectableOptions, selectedPricingOptionId);
|
|
14979
|
+
return {
|
|
14980
|
+
currency,
|
|
14981
|
+
display: resolveTieredDisplay(selectableOptions.reduce((lowest, option) => lowest === null || option.priceAmount < lowest ? option.priceAmount : lowest, null), selectableOptions.length, currency),
|
|
14982
|
+
selectableOptions,
|
|
14983
|
+
requiresSelection: selectableOptions.length > 1,
|
|
14984
|
+
selectedOption,
|
|
14985
|
+
slidingScale: null,
|
|
14986
|
+
selectedSlidingAmount: null,
|
|
14987
|
+
selectedPriceAmount: selectedOption?.priceAmount ?? null,
|
|
14988
|
+
selectedRequiresPayment: (selectedOption?.priceAmount ?? 0) > 0,
|
|
14989
|
+
hasPaidSelection: selectableOptions.some((option) => option.priceAmount > 0),
|
|
14990
|
+
hasFreeSelection: selectableOptions.some((option) => option.priceAmount === 0)
|
|
14991
|
+
};
|
|
14992
|
+
}
|
|
14993
|
+
function resolveSelectedTier(options, selectedId) {
|
|
14994
|
+
return (selectedId ? options.find((option) => option.id === selectedId) : null) ?? (options.length === 1 ? options[0] ?? null : null);
|
|
14995
|
+
}
|
|
14996
|
+
function resolveTieredDisplay(lowestAmount, optionCount, currency) {
|
|
14997
|
+
if (lowestAmount === null) return {
|
|
14998
|
+
kind: "unavailable",
|
|
14999
|
+
currency
|
|
15000
|
+
};
|
|
15001
|
+
return optionCount > 1 && lowestAmount > 0 ? {
|
|
15002
|
+
kind: "from",
|
|
15003
|
+
amount: lowestAmount,
|
|
15004
|
+
currency
|
|
15005
|
+
} : toExactOrFreeDisplay(lowestAmount, currency);
|
|
15006
|
+
}
|
|
15007
|
+
function resolveSlidingScalePricing(offering, selectedSlidingAmount) {
|
|
15008
|
+
const currency = offering.pricing.currency;
|
|
15009
|
+
const minAmount = offering.pricing.slidingMinAmount ?? null;
|
|
15010
|
+
const maxAmount = offering.pricing.slidingMaxAmount ?? null;
|
|
15011
|
+
if (minAmount === null || maxAmount === null || minAmount < 0 || maxAmount < minAmount) return unavailableSlidingScale(currency);
|
|
15012
|
+
const selectedAmount = Number.isFinite(selectedSlidingAmount) ? selectedSlidingAmount : null;
|
|
15013
|
+
return {
|
|
15014
|
+
currency,
|
|
15015
|
+
display: {
|
|
15016
|
+
kind: "range",
|
|
15017
|
+
minAmount,
|
|
15018
|
+
maxAmount,
|
|
15019
|
+
currency
|
|
15020
|
+
},
|
|
15021
|
+
selectableOptions: [],
|
|
15022
|
+
requiresSelection: selectedAmount === null,
|
|
15023
|
+
selectedOption: null,
|
|
15024
|
+
slidingScale: {
|
|
15025
|
+
minAmount,
|
|
15026
|
+
maxAmount,
|
|
15027
|
+
suggestedAmount: offering.pricing.slidingSuggestedAmount ?? null
|
|
15028
|
+
},
|
|
15029
|
+
selectedSlidingAmount: selectedAmount,
|
|
15030
|
+
selectedPriceAmount: selectedAmount,
|
|
15031
|
+
selectedRequiresPayment: (selectedAmount ?? 0) > 0,
|
|
15032
|
+
hasPaidSelection: maxAmount > 0,
|
|
15033
|
+
hasFreeSelection: minAmount === 0
|
|
15034
|
+
};
|
|
15035
|
+
}
|
|
15036
|
+
function unavailableSlidingScale(currency) {
|
|
15037
|
+
return {
|
|
15038
|
+
currency,
|
|
15039
|
+
display: {
|
|
15040
|
+
kind: "unavailable",
|
|
15041
|
+
currency
|
|
15042
|
+
},
|
|
15043
|
+
selectableOptions: [],
|
|
15044
|
+
requiresSelection: true,
|
|
15045
|
+
selectedOption: null,
|
|
15046
|
+
slidingScale: null,
|
|
15047
|
+
selectedSlidingAmount: null,
|
|
15048
|
+
selectedPriceAmount: null,
|
|
15049
|
+
selectedRequiresPayment: false,
|
|
15050
|
+
hasPaidSelection: false,
|
|
15051
|
+
hasFreeSelection: false
|
|
15052
|
+
};
|
|
15053
|
+
}
|
|
15054
|
+
//#endregion
|
|
15055
|
+
//#region ../blocks/src/system/blocks/events/whole-series/schemas.ts
|
|
15056
|
+
const wholeSeriesVenueSchema = z.object({
|
|
14781
15057
|
id: z.string(),
|
|
14782
15058
|
name: z.string(),
|
|
14783
15059
|
address: z.string().nullable()
|
|
14784
15060
|
});
|
|
14785
|
-
|
|
14786
|
-
* Zod schema for course session (occurrence) data
|
|
14787
|
-
*/
|
|
14788
|
-
const courseSessionSchema = z.object({
|
|
15061
|
+
const wholeSeriesSessionSchema = z.object({
|
|
14789
15062
|
id: z.string(),
|
|
14790
15063
|
startsAt: z.string(),
|
|
14791
15064
|
endsAt: z.string(),
|
|
@@ -14793,14 +15066,14 @@ const courseSessionSchema = z.object({
|
|
|
14793
15066
|
capacityOverride: z.number().nullable().optional(),
|
|
14794
15067
|
overrides: z.record(z.string(), z.unknown()).nullable().optional()
|
|
14795
15068
|
});
|
|
14796
|
-
const
|
|
15069
|
+
const wholeSeriesTeamMemberSummarySchema = z.object({
|
|
14797
15070
|
id: z.string(),
|
|
14798
15071
|
name: z.string(),
|
|
14799
15072
|
roleLabel: z.string().nullable(),
|
|
14800
15073
|
summary: z.string().nullable(),
|
|
14801
15074
|
profilePath: z.string().nullable()
|
|
14802
15075
|
});
|
|
14803
|
-
const
|
|
15076
|
+
const wholeSeriesPricingOptionSchema = z.object({
|
|
14804
15077
|
id: z.string(),
|
|
14805
15078
|
name: z.string(),
|
|
14806
15079
|
description: z.string().nullable(),
|
|
@@ -14816,7 +15089,7 @@ const coursePricingOptionSchema = z.object({
|
|
|
14816
15089
|
"both"
|
|
14817
15090
|
]).nullable().optional()
|
|
14818
15091
|
});
|
|
14819
|
-
const
|
|
15092
|
+
const wholeSeriesPricingSchema = z.object({
|
|
14820
15093
|
bookingRequirement: z.enum(["none", "required"]),
|
|
14821
15094
|
pricingStrategy: z.enum([
|
|
14822
15095
|
"free",
|
|
@@ -14830,20 +15103,17 @@ const coursePricingSchema = z.object({
|
|
|
14830
15103
|
slidingMaxAmount: z.number().nullable().optional(),
|
|
14831
15104
|
slidingSuggestedAmount: z.number().nullable().optional(),
|
|
14832
15105
|
paymentTerms: blockBookingPaymentTermsSchema,
|
|
14833
|
-
options: z.array(
|
|
15106
|
+
options: z.array(wholeSeriesPricingOptionSchema)
|
|
14834
15107
|
});
|
|
14835
|
-
/**
|
|
14836
|
-
* Zod schema for public course data
|
|
14837
|
-
*/
|
|
14838
15108
|
const publicWholeSeriesOfferingSchema = z.object({
|
|
14839
15109
|
eventSeriesId: z.string(),
|
|
14840
15110
|
eventOfferingId: z.string(),
|
|
14841
15111
|
title: z.string(),
|
|
14842
15112
|
slug: z.string(),
|
|
14843
15113
|
description: z.unknown().nullable(),
|
|
14844
|
-
teamMembers: z.array(
|
|
15114
|
+
teamMembers: z.array(wholeSeriesTeamMemberSummarySchema).optional(),
|
|
14845
15115
|
enrollmentOpen: z.boolean(),
|
|
14846
|
-
pricing:
|
|
15116
|
+
pricing: wholeSeriesPricingSchema,
|
|
14847
15117
|
currency: z.string(),
|
|
14848
15118
|
paymentTerms: blockBookingPaymentTermsSchema,
|
|
14849
15119
|
enrollmentCapacity: z.number().nullable(),
|
|
@@ -14856,8 +15126,8 @@ const publicWholeSeriesOfferingSchema = z.object({
|
|
|
14856
15126
|
sessionsCount: z.number(),
|
|
14857
15127
|
enrolledCount: z.number(),
|
|
14858
15128
|
availableSpots: z.number().nullable(),
|
|
14859
|
-
sessions: z.array(
|
|
14860
|
-
venue:
|
|
15129
|
+
sessions: z.array(wholeSeriesSessionSchema),
|
|
15130
|
+
venue: wholeSeriesVenueSchema.nullable()
|
|
14861
15131
|
});
|
|
14862
15132
|
z.array(publicWholeSeriesOfferingSchema);
|
|
14863
15133
|
//#endregion
|
|
@@ -15170,7 +15440,7 @@ const publicEventSchema = z.object({
|
|
|
15170
15440
|
acceptsMemberships: z.boolean().optional(),
|
|
15171
15441
|
wholeSeries: z.object({
|
|
15172
15442
|
eventSeriesId: z.string(),
|
|
15173
|
-
pricing:
|
|
15443
|
+
pricing: wholeSeriesPricingSchema,
|
|
15174
15444
|
currency: z.string(),
|
|
15175
15445
|
enrollmentOpen: z.boolean()
|
|
15176
15446
|
}).nullable().optional()
|
|
@@ -15700,7 +15970,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
15700
15970
|
const [registrationResult, setRegistrationResult] = useState(null);
|
|
15701
15971
|
const [errorMessage, setErrorMessage] = useState("");
|
|
15702
15972
|
const [altchaSolution, setAltchaSolution] = useState(null);
|
|
15703
|
-
const { authState: portalAuthState, profile: portalProfile } = deps.usePortalAuth();
|
|
15973
|
+
const { authState: portalAuthState, profile: portalProfile, creditState: portalCreditState } = deps.usePortalAuth();
|
|
15704
15974
|
const waitlistClaim = deps.useWaitlistClaim();
|
|
15705
15975
|
const [showMagicLinkModal, setShowMagicLinkModal] = useState(false);
|
|
15706
15976
|
const [pendingAttendeeId, setPendingAttendeeId] = useState(null);
|
|
@@ -16253,6 +16523,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
16253
16523
|
setAltchaSolution,
|
|
16254
16524
|
portalAuthState,
|
|
16255
16525
|
portalProfile,
|
|
16526
|
+
portalCreditState,
|
|
16256
16527
|
showMagicLinkModal,
|
|
16257
16528
|
setShowMagicLinkModal,
|
|
16258
16529
|
handleLogout,
|
|
@@ -16307,7 +16578,7 @@ function buildEventRegistrationPaymentOptionsViewModel(input) {
|
|
|
16307
16578
|
return {
|
|
16308
16579
|
mode: selection.mode,
|
|
16309
16580
|
sectionTitle: selection.sectionTitle,
|
|
16310
|
-
options: selection.options.map((option) => toEventDirectPaymentOption(option, selection.mode))
|
|
16581
|
+
options: selection.options.map((option, index) => toEventDirectPaymentOption(option, supportedOptions[index] ?? DEFAULT_EVENT_DIRECT_PAYMENT_OPTION, selection.mode, input.totalPriceCents))
|
|
16311
16582
|
};
|
|
16312
16583
|
}
|
|
16313
16584
|
function selectSupportedEventDirectPaymentOptions(paymentTerms) {
|
|
@@ -16317,17 +16588,24 @@ function selectSupportedEventDirectPaymentOptions(paymentTerms) {
|
|
|
16317
16588
|
function isSupportedEventDirectPaymentOption(option) {
|
|
16318
16589
|
return option.kind === "upfront" || option.kind === "flexible_balance";
|
|
16319
16590
|
}
|
|
16320
|
-
function toEventDirectPaymentOption(option, mode) {
|
|
16591
|
+
function toEventDirectPaymentOption(option, sourceOption, mode, totalCents) {
|
|
16321
16592
|
switch (option.kind) {
|
|
16322
16593
|
case "upfront": return {
|
|
16323
16594
|
...option,
|
|
16324
16595
|
kind: "upfront",
|
|
16325
|
-
label: mode === "choice_required" ? "Pay in full now" : "Pay by card"
|
|
16596
|
+
label: mode === "choice_required" ? "Pay in full now" : "Pay by card",
|
|
16597
|
+
totalCents,
|
|
16598
|
+
configuredPaymentDueNowCents: totalCents
|
|
16326
16599
|
};
|
|
16327
16600
|
case "flexible_balance": return {
|
|
16328
16601
|
...option,
|
|
16329
16602
|
kind: "flexible_balance",
|
|
16330
|
-
label: "Pay deposit now"
|
|
16603
|
+
label: "Pay deposit now",
|
|
16604
|
+
totalCents,
|
|
16605
|
+
configuredPaymentDueNowCents: sourceOption.kind === "flexible_balance" ? resolveFlexibleBalanceInitialPaymentCents({
|
|
16606
|
+
totalAmountCents: totalCents,
|
|
16607
|
+
config: sourceOption.config
|
|
16608
|
+
}) : totalCents
|
|
16331
16609
|
};
|
|
16332
16610
|
case "deferred_manual":
|
|
16333
16611
|
case "instalment_plan": throw new Error(`Unsupported event registration payment option: ${option.kind}`);
|
|
@@ -16660,13 +16938,13 @@ function resolveHeadlessDirectPaymentOptions(wizard) {
|
|
|
16660
16938
|
}).options;
|
|
16661
16939
|
}
|
|
16662
16940
|
//#endregion
|
|
16663
|
-
//#region ../blocks/src/system/runtime/nodes/
|
|
16941
|
+
//#region ../blocks/src/system/runtime/nodes/event-registration/whole-series/utils.ts
|
|
16664
16942
|
/**
|
|
16665
16943
|
* Anchor ID for the registration block, used for scroll targeting.
|
|
16666
16944
|
*/
|
|
16667
|
-
const
|
|
16945
|
+
const WHOLE_SERIES_REGISTRATION_ANCHOR_ID = "event-registration";
|
|
16668
16946
|
//#endregion
|
|
16669
|
-
//#region ../blocks/src/system/runtime/nodes/
|
|
16947
|
+
//#region ../blocks/src/system/runtime/nodes/event-registration/whole-series/pricing.ts
|
|
16670
16948
|
function parseCurrencyInputToCents(value) {
|
|
16671
16949
|
const trimmed = value.trim();
|
|
16672
16950
|
if (!trimmed) return null;
|
|
@@ -16678,31 +16956,31 @@ function formatCentsAsCurrencyInput(amount) {
|
|
|
16678
16956
|
const major = amount / 100;
|
|
16679
16957
|
return Number.isInteger(major) ? String(major) : major.toFixed(2);
|
|
16680
16958
|
}
|
|
16681
|
-
function
|
|
16959
|
+
function getMissingWholeSeriesPricingSelectionMessage(pricing) {
|
|
16682
16960
|
if (pricing?.requiresSelection && !pricing.selectedOption) return pricing.slidingScale ? "Choose an amount to continue." : "Choose a pricing option to continue.";
|
|
16683
16961
|
const selectedAmount = pricing?.selectedSlidingAmount;
|
|
16684
16962
|
const scale = pricing?.slidingScale;
|
|
16685
16963
|
if (scale && selectedAmount !== null && selectedAmount !== void 0 && (selectedAmount < scale.minAmount || selectedAmount > scale.maxAmount)) return "Choose an amount within the sliding scale.";
|
|
16686
16964
|
return null;
|
|
16687
16965
|
}
|
|
16688
|
-
function
|
|
16966
|
+
function buildWholeSeriesPricingOptionPayload(pricing) {
|
|
16689
16967
|
if (pricing?.selectedOption) return { pricingOptionId: pricing.selectedOption.id };
|
|
16690
16968
|
if (pricing?.slidingScale && pricing.selectedSlidingAmount !== null) return { selectedSlidingAmount: pricing.selectedSlidingAmount };
|
|
16691
16969
|
return {};
|
|
16692
16970
|
}
|
|
16693
|
-
function
|
|
16971
|
+
function defaultWholeSeriesPricingSelection(pricing, previousOptionId) {
|
|
16694
16972
|
return {
|
|
16695
16973
|
pricingOptionId: previousOptionId && pricing.selectableOptions.some((option) => option.id === previousOptionId) ? previousOptionId : pricing.selectedOption?.id ?? null,
|
|
16696
16974
|
slidingAmountInput: pricing.slidingScale?.suggestedAmount !== null && pricing.slidingScale?.suggestedAmount !== void 0 ? formatCentsAsCurrencyInput(pricing.slidingScale.suggestedAmount) : ""
|
|
16697
16975
|
};
|
|
16698
16976
|
}
|
|
16699
16977
|
//#endregion
|
|
16700
|
-
//#region ../blocks/src/system/runtime/nodes/
|
|
16978
|
+
//#region ../blocks/src/system/runtime/nodes/event-registration/whole-series/wizardSteps.ts
|
|
16701
16979
|
/**
|
|
16702
16980
|
* Step labels for the wizard indicator
|
|
16703
16981
|
*/
|
|
16704
16982
|
const STEP_LABELS = {
|
|
16705
|
-
"select-
|
|
16983
|
+
"select-run": "Run",
|
|
16706
16984
|
"enter-details": "Details",
|
|
16707
16985
|
"booking-mode": "Method",
|
|
16708
16986
|
"select-payment": "Payment",
|
|
@@ -16718,36 +16996,36 @@ const STEP_LABELS = {
|
|
|
16718
16996
|
/**
|
|
16719
16997
|
* Determine which wizard steps to show based on context and eligibility.
|
|
16720
16998
|
*
|
|
16721
|
-
* @param
|
|
16722
|
-
* @param requiresPayment - Whether the
|
|
16999
|
+
* @param hasPreSelectedRun - Whether run is pre-selected (skips run selection)
|
|
17000
|
+
* @param requiresPayment - Whether the run requires payment
|
|
16723
17001
|
* @param hasEligibleMemberships - Whether user has eligible memberships
|
|
16724
17002
|
* @param bookingMode - Current booking mode selection
|
|
16725
17003
|
* @param isMembershipFastTrack - Whether user qualifies for single-step membership flow
|
|
16726
17004
|
* @returns Array of wizard steps to display
|
|
16727
17005
|
*/
|
|
16728
|
-
function getWizardStepsForContext(
|
|
16729
|
-
if (isMembershipFastTrack) return
|
|
16730
|
-
if (!requiresPayment) return
|
|
17006
|
+
function getWizardStepsForContext(hasPreSelectedRun, requiresPayment, hasEligibleMemberships, bookingMode, isMembershipFastTrack) {
|
|
17007
|
+
if (isMembershipFastTrack) return hasPreSelectedRun ? ["enter-details"] : ["select-run", "enter-details"];
|
|
17008
|
+
if (!requiresPayment) return hasPreSelectedRun ? ["enter-details"] : ["select-run", "enter-details"];
|
|
16731
17009
|
if (hasEligibleMemberships) {
|
|
16732
17010
|
const skipPayment = bookingMode === "membership";
|
|
16733
|
-
if (
|
|
17011
|
+
if (hasPreSelectedRun) return skipPayment ? ["enter-details", "booking-mode"] : [
|
|
16734
17012
|
"enter-details",
|
|
16735
17013
|
"booking-mode",
|
|
16736
17014
|
"select-payment"
|
|
16737
17015
|
];
|
|
16738
17016
|
return skipPayment ? [
|
|
16739
|
-
"select-
|
|
17017
|
+
"select-run",
|
|
16740
17018
|
"enter-details",
|
|
16741
17019
|
"booking-mode"
|
|
16742
17020
|
] : [
|
|
16743
|
-
"select-
|
|
17021
|
+
"select-run",
|
|
16744
17022
|
"enter-details",
|
|
16745
17023
|
"booking-mode",
|
|
16746
17024
|
"select-payment"
|
|
16747
17025
|
];
|
|
16748
17026
|
}
|
|
16749
|
-
return
|
|
16750
|
-
"select-
|
|
17027
|
+
return hasPreSelectedRun ? ["enter-details", "select-payment"] : [
|
|
17028
|
+
"select-run",
|
|
16751
17029
|
"enter-details",
|
|
16752
17030
|
"select-payment"
|
|
16753
17031
|
];
|
|
@@ -16759,21 +17037,21 @@ function getStepLabels(steps) {
|
|
|
16759
17037
|
return steps.map((step) => STEP_LABELS[step] ?? step);
|
|
16760
17038
|
}
|
|
16761
17039
|
//#endregion
|
|
16762
|
-
//#region ../blocks/src/system/runtime/nodes/
|
|
16763
|
-
function
|
|
16764
|
-
const
|
|
16765
|
-
const canUseMembership =
|
|
16766
|
-
const
|
|
17040
|
+
//#region ../blocks/src/system/runtime/nodes/event-registration/whole-series/wholeSeriesRegistrationViewState.ts
|
|
17041
|
+
function deriveWholeSeriesRegistrationViewState(input) {
|
|
17042
|
+
const hasRunPayment = resolveWholeSeriesPaymentRequirement(input.pricing);
|
|
17043
|
+
const canUseMembership = hasRunPayment && input.selectedRun?.acceptsMemberships === true && input.portalAuthState === "authenticated" && input.eligibleMembershipCount > 0;
|
|
17044
|
+
const hasPreSelectedRun = input.scopedRuns.length === 1;
|
|
16767
17045
|
const fastTrack = canUseMembership && input.eligibleMembershipCount === 1 && input.bookingMode === "membership";
|
|
16768
|
-
const wizardSteps = getWizardStepsForContext(
|
|
17046
|
+
const wizardSteps = getWizardStepsForContext(hasPreSelectedRun, hasRunPayment, canUseMembership, input.bookingMode, fastTrack);
|
|
16769
17047
|
const showPortalAuthSidebar = shouldShowPortalAuthSidebar({
|
|
16770
17048
|
...input,
|
|
16771
|
-
|
|
17049
|
+
hasRunPayment
|
|
16772
17050
|
});
|
|
16773
17051
|
return {
|
|
16774
|
-
|
|
17052
|
+
hasRunPayment,
|
|
16775
17053
|
canUseMembership,
|
|
16776
|
-
|
|
17054
|
+
hasPreSelectedRun,
|
|
16777
17055
|
wizardSteps,
|
|
16778
17056
|
currentStepNumber: getStepNumber(input.step, wizardSteps),
|
|
16779
17057
|
totalSteps: wizardSteps.length,
|
|
@@ -16781,24 +17059,24 @@ function deriveCourseRegistrationViewState(input) {
|
|
|
16781
17059
|
showPortalAuthSidebar
|
|
16782
17060
|
};
|
|
16783
17061
|
}
|
|
16784
|
-
function
|
|
17062
|
+
function resolveWholeSeriesPaymentRequirement(pricing) {
|
|
16785
17063
|
if (!pricing) return false;
|
|
16786
17064
|
return pricing.selectedOption ? pricing.selectedRequiresPayment : pricing.hasPaidSelection;
|
|
16787
17065
|
}
|
|
16788
17066
|
function shouldShowPortalAuthSidebar(input) {
|
|
16789
17067
|
if (input.portalAuthState !== "unauthenticated") return false;
|
|
16790
17068
|
if (input.step === "success" || input.step === "waitlist" || input.step === "error") return false;
|
|
16791
|
-
return input.waitlistRequiresPortalLogin || input.
|
|
17069
|
+
return input.waitlistRequiresPortalLogin || input.hasRunPayment && input.selectedRun?.acceptsMemberships === true && input.step !== "select-run";
|
|
16792
17070
|
}
|
|
16793
17071
|
//#endregion
|
|
16794
|
-
//#region ../blocks/src/system/runtime/nodes/
|
|
17072
|
+
//#region ../blocks/src/system/runtime/nodes/event-registration/whole-series/useWholeSeriesEligibility.ts
|
|
16795
17073
|
function shouldFetchEligibility(input) {
|
|
16796
|
-
if (!input.
|
|
16797
|
-
const membershipCheck = input.portalAuthState === "authenticated" && input.hasPaidSelection && input.
|
|
16798
|
-
const capacityCheck = input.
|
|
17074
|
+
if (!input.run || input.portalAuthState === "checking" || input.hasWaitlistClaimToken) return false;
|
|
17075
|
+
const membershipCheck = input.portalAuthState === "authenticated" && input.hasPaidSelection && input.run.acceptsMemberships;
|
|
17076
|
+
const capacityCheck = input.run.availableSpots !== null && input.run.availableSpots <= 0;
|
|
16799
17077
|
return membershipCheck || capacityCheck;
|
|
16800
17078
|
}
|
|
16801
|
-
function
|
|
17079
|
+
function useWholeSeriesEligibility(input) {
|
|
16802
17080
|
const [loading, setLoading] = useState(false);
|
|
16803
17081
|
const [error, setError] = useState(null);
|
|
16804
17082
|
const [eligibility, setEligibility] = useState(null);
|
|
@@ -16819,15 +17097,15 @@ function useCourseEligibility(input) {
|
|
|
16819
17097
|
setError(null);
|
|
16820
17098
|
setPaymentChoice("checkout");
|
|
16821
17099
|
const eligibilityInput = {
|
|
16822
|
-
|
|
17100
|
+
run: input.selectedRun,
|
|
16823
17101
|
hasPaidSelection: input.hasPaidSelection,
|
|
16824
17102
|
portalAuthState: input.portalAuthState,
|
|
16825
17103
|
hasWaitlistClaimToken: input.waitlistClaimToken !== null
|
|
16826
17104
|
};
|
|
16827
17105
|
if (!shouldFetchEligibility(eligibilityInput)) return;
|
|
16828
|
-
const
|
|
17106
|
+
const run = eligibilityInput.run;
|
|
16829
17107
|
setLoading(true);
|
|
16830
|
-
input.api.checkWholeSeriesEligibility({ eventSeriesId:
|
|
17108
|
+
input.api.checkWholeSeriesEligibility({ eventSeriesId: run.eventSeriesId }).then((result) => {
|
|
16831
17109
|
if (cancelled) return;
|
|
16832
17110
|
const eligibleMemberships = result.eligibleMemberships ?? [];
|
|
16833
17111
|
setEligibility(result);
|
|
@@ -16848,13 +17126,13 @@ function useCourseEligibility(input) {
|
|
|
16848
17126
|
input.api,
|
|
16849
17127
|
input.hasPaidSelection,
|
|
16850
17128
|
input.portalAuthState,
|
|
16851
|
-
input.
|
|
17129
|
+
input.selectedRun,
|
|
16852
17130
|
input.waitlistClaimToken
|
|
16853
17131
|
]);
|
|
16854
17132
|
return {
|
|
16855
17133
|
eligibilityLoading: loading,
|
|
16856
17134
|
eligibilityError: error,
|
|
16857
|
-
|
|
17135
|
+
runEligibility: eligibility,
|
|
16858
17136
|
eligibleMemberships: memberships,
|
|
16859
17137
|
paymentChoice,
|
|
16860
17138
|
choosePaymentChoice,
|
|
@@ -16863,149 +17141,12 @@ function useCourseEligibility(input) {
|
|
|
16863
17141
|
};
|
|
16864
17142
|
}
|
|
16865
17143
|
//#endregion
|
|
16866
|
-
//#region ../blocks/src/system/
|
|
16867
|
-
function isSaleWindowOpen(option, now) {
|
|
16868
|
-
if (!option.isActive) return false;
|
|
16869
|
-
if (option.saleStartsAt && new Date(option.saleStartsAt) > now) return false;
|
|
16870
|
-
if (option.saleEndsAt && new Date(option.saleEndsAt) < now) return false;
|
|
16871
|
-
return true;
|
|
16872
|
-
}
|
|
16873
|
-
function toExactOrFreeDisplay(amount, currency) {
|
|
16874
|
-
if (amount <= 0) return {
|
|
16875
|
-
kind: "free",
|
|
16876
|
-
currency
|
|
16877
|
-
};
|
|
16878
|
-
return {
|
|
16879
|
-
kind: "exact",
|
|
16880
|
-
amount,
|
|
16881
|
-
currency
|
|
16882
|
-
};
|
|
16883
|
-
}
|
|
16884
|
-
function getSelectableCoursePricingOptionsForNow(course, now) {
|
|
16885
|
-
if (course.pricing.pricingStrategy !== "tiered") return [];
|
|
16886
|
-
return [...course.pricing.options].filter((option) => isSaleWindowOpen(option, now)).sort((left, right) => {
|
|
16887
|
-
if (left.sortOrder !== right.sortOrder) return left.sortOrder - right.sortOrder;
|
|
16888
|
-
if (left.priceAmount !== right.priceAmount) return left.priceAmount - right.priceAmount;
|
|
16889
|
-
return left.name.localeCompare(right.name);
|
|
16890
|
-
});
|
|
16891
|
-
}
|
|
16892
|
-
function resolveCoursePricingState(course, selectedPricingOptionId, selectedSlidingAmountOrNowInput, nowInput = {}) {
|
|
16893
|
-
const selectedSlidingAmount = typeof selectedSlidingAmountOrNowInput === "number" || selectedSlidingAmountOrNowInput === null ? selectedSlidingAmountOrNowInput : null;
|
|
16894
|
-
const effectiveNowInput = typeof selectedSlidingAmountOrNowInput === "object" && selectedSlidingAmountOrNowInput !== null ? selectedSlidingAmountOrNowInput : nowInput;
|
|
16895
|
-
const currency = course.pricing.currency;
|
|
16896
|
-
switch (course.pricing.pricingStrategy) {
|
|
16897
|
-
case "free": return {
|
|
16898
|
-
currency,
|
|
16899
|
-
display: {
|
|
16900
|
-
kind: "free",
|
|
16901
|
-
currency
|
|
16902
|
-
},
|
|
16903
|
-
selectableOptions: [],
|
|
16904
|
-
requiresSelection: false,
|
|
16905
|
-
selectedOption: null,
|
|
16906
|
-
slidingScale: null,
|
|
16907
|
-
selectedSlidingAmount: null,
|
|
16908
|
-
selectedPriceAmount: 0,
|
|
16909
|
-
selectedRequiresPayment: false,
|
|
16910
|
-
hasPaidSelection: false,
|
|
16911
|
-
hasFreeSelection: true
|
|
16912
|
-
};
|
|
16913
|
-
case "single": {
|
|
16914
|
-
const amount = course.pricing.singlePriceAmount ?? 0;
|
|
16915
|
-
return {
|
|
16916
|
-
currency,
|
|
16917
|
-
display: toExactOrFreeDisplay(amount, currency),
|
|
16918
|
-
selectableOptions: [],
|
|
16919
|
-
requiresSelection: false,
|
|
16920
|
-
selectedOption: null,
|
|
16921
|
-
slidingScale: null,
|
|
16922
|
-
selectedSlidingAmount: null,
|
|
16923
|
-
selectedPriceAmount: amount,
|
|
16924
|
-
selectedRequiresPayment: amount > 0,
|
|
16925
|
-
hasPaidSelection: amount > 0,
|
|
16926
|
-
hasFreeSelection: amount <= 0
|
|
16927
|
-
};
|
|
16928
|
-
}
|
|
16929
|
-
case "tiered": {
|
|
16930
|
-
const selectableOptions = getSelectableCoursePricingOptionsForNow(course, resolvePlanningDateInput(effectiveNowInput));
|
|
16931
|
-
const selectedOption = (selectedPricingOptionId ? selectableOptions.find((option) => option.id === selectedPricingOptionId) : null) ?? (selectableOptions.length === 1 ? selectableOptions[0] ?? null : null);
|
|
16932
|
-
const lowestAmount = selectableOptions.reduce((lowest, option) => {
|
|
16933
|
-
if (lowest === null || option.priceAmount < lowest) return option.priceAmount;
|
|
16934
|
-
return lowest;
|
|
16935
|
-
}, null);
|
|
16936
|
-
return {
|
|
16937
|
-
currency,
|
|
16938
|
-
display: lowestAmount === null ? {
|
|
16939
|
-
kind: "unavailable",
|
|
16940
|
-
currency
|
|
16941
|
-
} : selectableOptions.length > 1 && lowestAmount > 0 ? {
|
|
16942
|
-
kind: "from",
|
|
16943
|
-
amount: lowestAmount,
|
|
16944
|
-
currency
|
|
16945
|
-
} : toExactOrFreeDisplay(lowestAmount, currency),
|
|
16946
|
-
selectableOptions,
|
|
16947
|
-
requiresSelection: selectableOptions.length > 1,
|
|
16948
|
-
selectedOption,
|
|
16949
|
-
slidingScale: null,
|
|
16950
|
-
selectedSlidingAmount: null,
|
|
16951
|
-
selectedPriceAmount: selectedOption?.priceAmount ?? null,
|
|
16952
|
-
selectedRequiresPayment: (selectedOption?.priceAmount ?? 0) > 0,
|
|
16953
|
-
hasPaidSelection: selectableOptions.some((option) => option.priceAmount > 0),
|
|
16954
|
-
hasFreeSelection: selectableOptions.some((option) => option.priceAmount === 0)
|
|
16955
|
-
};
|
|
16956
|
-
}
|
|
16957
|
-
case "sliding_scale": {
|
|
16958
|
-
const minAmount = course.pricing.slidingMinAmount ?? null;
|
|
16959
|
-
const maxAmount = course.pricing.slidingMaxAmount ?? null;
|
|
16960
|
-
if (minAmount === null || maxAmount === null || minAmount < 0 || maxAmount < minAmount) return {
|
|
16961
|
-
currency,
|
|
16962
|
-
display: {
|
|
16963
|
-
kind: "unavailable",
|
|
16964
|
-
currency
|
|
16965
|
-
},
|
|
16966
|
-
selectableOptions: [],
|
|
16967
|
-
requiresSelection: true,
|
|
16968
|
-
selectedOption: null,
|
|
16969
|
-
slidingScale: null,
|
|
16970
|
-
selectedSlidingAmount: null,
|
|
16971
|
-
selectedPriceAmount: null,
|
|
16972
|
-
selectedRequiresPayment: false,
|
|
16973
|
-
hasPaidSelection: false,
|
|
16974
|
-
hasFreeSelection: false
|
|
16975
|
-
};
|
|
16976
|
-
const normalizedSelectedAmount = typeof selectedSlidingAmount === "number" && Number.isFinite(selectedSlidingAmount) ? selectedSlidingAmount : null;
|
|
16977
|
-
return {
|
|
16978
|
-
currency,
|
|
16979
|
-
display: {
|
|
16980
|
-
kind: "range",
|
|
16981
|
-
minAmount,
|
|
16982
|
-
maxAmount,
|
|
16983
|
-
currency
|
|
16984
|
-
},
|
|
16985
|
-
selectableOptions: [],
|
|
16986
|
-
requiresSelection: normalizedSelectedAmount === null,
|
|
16987
|
-
selectedOption: null,
|
|
16988
|
-
slidingScale: {
|
|
16989
|
-
minAmount,
|
|
16990
|
-
maxAmount,
|
|
16991
|
-
suggestedAmount: course.pricing.slidingSuggestedAmount ?? null
|
|
16992
|
-
},
|
|
16993
|
-
selectedSlidingAmount: normalizedSelectedAmount,
|
|
16994
|
-
selectedPriceAmount: normalizedSelectedAmount,
|
|
16995
|
-
selectedRequiresPayment: (normalizedSelectedAmount ?? 0) > 0,
|
|
16996
|
-
hasPaidSelection: maxAmount > 0,
|
|
16997
|
-
hasFreeSelection: minAmount === 0
|
|
16998
|
-
};
|
|
16999
|
-
}
|
|
17000
|
-
}
|
|
17001
|
-
}
|
|
17002
|
-
//#endregion
|
|
17003
|
-
//#region ../blocks/src/system/runtime/nodes/course-page-surface-scope.ts
|
|
17144
|
+
//#region ../blocks/src/system/runtime/nodes/event-registration/whole-series/wholeSeriesPageSurfaceScope.ts
|
|
17004
17145
|
/**
|
|
17005
|
-
* Resolves native
|
|
17146
|
+
* Resolves native run-page ownership without falling back to entry or slug
|
|
17006
17147
|
* coincidence when a page-surface subject is present but invalid.
|
|
17007
17148
|
*/
|
|
17008
|
-
function
|
|
17149
|
+
function resolveWholeSeriesPageSurfaceScope(runs, subjectValue) {
|
|
17009
17150
|
if (subjectValue === null || subjectValue === void 0) return { kind: "absent" };
|
|
17010
17151
|
const parsed = parseEventPageSurfaceSubject(subjectValue);
|
|
17011
17152
|
if (!parsed.ok) return {
|
|
@@ -17017,7 +17158,7 @@ function resolveCoursePageSurfaceScope(courses, subjectValue) {
|
|
|
17017
17158
|
return {
|
|
17018
17159
|
kind: "scoped",
|
|
17019
17160
|
subject: parsed.value,
|
|
17020
|
-
|
|
17161
|
+
runs: runs.filter((run) => allowedSeriesIds.has(run.eventSeriesId))
|
|
17021
17162
|
};
|
|
17022
17163
|
}
|
|
17023
17164
|
function eventSeriesIdsForSubject(subject) {
|
|
@@ -17028,33 +17169,43 @@ function eventSeriesIdsForSubject(subject) {
|
|
|
17028
17169
|
}
|
|
17029
17170
|
}
|
|
17030
17171
|
//#endregion
|
|
17031
|
-
//#region ../blocks/src/system/runtime/nodes/
|
|
17032
|
-
function
|
|
17033
|
-
const surfaceScope =
|
|
17172
|
+
//#region ../blocks/src/system/runtime/nodes/event-registration/whole-series/useWholeSeriesRegistrationSelection.ts
|
|
17173
|
+
function selectScopedRuns(props) {
|
|
17174
|
+
const surfaceScope = resolveWholeSeriesPageSurfaceScope(props.runs ?? [], props.subject);
|
|
17034
17175
|
if (surfaceScope.kind === "unsupported") return [];
|
|
17035
|
-
if (surfaceScope.kind === "scoped") return surfaceScope.
|
|
17176
|
+
if (surfaceScope.kind === "scoped") return surfaceScope.runs;
|
|
17036
17177
|
return [];
|
|
17037
17178
|
}
|
|
17038
|
-
function
|
|
17039
|
-
const fromSearch = new URLSearchParams(
|
|
17179
|
+
function getWholeSeriesCheckoutSessionId(location = window.location) {
|
|
17180
|
+
const fromSearch = new URLSearchParams(location.search).get("session_id");
|
|
17040
17181
|
if (fromSearch) return fromSearch;
|
|
17041
|
-
return
|
|
17182
|
+
return location.hash.match(/[?&]session_id=([^&]+)/)?.[1] ?? null;
|
|
17042
17183
|
}
|
|
17043
|
-
function initialStep(
|
|
17044
|
-
if (new URLSearchParams(
|
|
17045
|
-
return
|
|
17184
|
+
function initialStep(runs, location) {
|
|
17185
|
+
if (new URLSearchParams(location.search).get("enrollment") === "success" && getWholeSeriesCheckoutSessionId(location)) return "verifying-payment";
|
|
17186
|
+
return runs.length === 1 ? "enter-details" : "select-run";
|
|
17046
17187
|
}
|
|
17047
|
-
function
|
|
17048
|
-
const
|
|
17049
|
-
|
|
17050
|
-
|
|
17188
|
+
function useWholeSeriesRegistrationSelection(props, location = window.location) {
|
|
17189
|
+
const scopeSnapshot = JSON.stringify({
|
|
17190
|
+
runs: props.runs ?? [],
|
|
17191
|
+
subject: props.subject ?? null
|
|
17192
|
+
});
|
|
17193
|
+
const stableScope = useRef(null);
|
|
17194
|
+
if (stableScope.current?.snapshot !== scopeSnapshot) stableScope.current = {
|
|
17195
|
+
snapshot: scopeSnapshot,
|
|
17196
|
+
runs: selectScopedRuns(props)
|
|
17197
|
+
};
|
|
17198
|
+
const scopedRuns = stableScope.current.runs;
|
|
17199
|
+
const [step, setStep] = useState(() => initialStep(scopedRuns, location));
|
|
17200
|
+
const [selectedRunId, setSelectedRunId] = useState(scopedRuns.length === 1 ? scopedRuns[0]?.eventSeriesId ?? null : null);
|
|
17201
|
+
const selectedRun = useMemo(() => scopedRuns.find((run) => run.eventSeriesId === selectedRunId) ?? (scopedRuns.length === 1 ? scopedRuns[0] ?? null : null), [scopedRuns, selectedRunId]);
|
|
17051
17202
|
const [selectedPricingOptionId, setSelectedPricingOptionId] = useState(null);
|
|
17052
17203
|
const [selectedSlidingAmountInput, setSelectedSlidingAmountInput] = useState("");
|
|
17053
17204
|
const goToStep = useCallback((nextStep) => {
|
|
17054
17205
|
setStep(nextStep);
|
|
17055
17206
|
}, []);
|
|
17056
|
-
const
|
|
17057
|
-
|
|
17207
|
+
const chooseRun = useCallback((run) => {
|
|
17208
|
+
setSelectedRunId(run.eventSeriesId);
|
|
17058
17209
|
}, []);
|
|
17059
17210
|
const choosePricingOption = useCallback((pricingOptionId) => {
|
|
17060
17211
|
setSelectedPricingOptionId(pricingOptionId);
|
|
@@ -17062,36 +17213,36 @@ function useCourseRegistrationSelection(props) {
|
|
|
17062
17213
|
const changeSlidingAmount = useCallback((amount) => {
|
|
17063
17214
|
setSelectedSlidingAmountInput(amount);
|
|
17064
17215
|
}, []);
|
|
17065
|
-
const
|
|
17066
|
-
|
|
17216
|
+
const selectedRunPricing = useMemo(() => selectedRun ? resolveWholeSeriesPricingState(selectedRun, selectedPricingOptionId, parseCurrencyInputToCents(selectedSlidingAmountInput)) : null, [
|
|
17217
|
+
selectedRun,
|
|
17067
17218
|
selectedPricingOptionId,
|
|
17068
17219
|
selectedSlidingAmountInput
|
|
17069
17220
|
]);
|
|
17070
17221
|
useEffect(() => {
|
|
17071
|
-
if (!
|
|
17222
|
+
if (!selectedRun) {
|
|
17072
17223
|
setSelectedPricingOptionId(null);
|
|
17073
17224
|
setSelectedSlidingAmountInput("");
|
|
17074
17225
|
return;
|
|
17075
17226
|
}
|
|
17076
|
-
const selection =
|
|
17227
|
+
const selection = defaultWholeSeriesPricingSelection(resolveWholeSeriesPricingState(selectedRun, null), selectedPricingOptionId);
|
|
17077
17228
|
setSelectedPricingOptionId(selection.pricingOptionId);
|
|
17078
17229
|
setSelectedSlidingAmountInput(selection.slidingAmountInput);
|
|
17079
|
-
}, [
|
|
17230
|
+
}, [selectedRun?.eventSeriesId]);
|
|
17080
17231
|
return {
|
|
17081
|
-
|
|
17232
|
+
scopedRuns,
|
|
17082
17233
|
step,
|
|
17083
17234
|
goToStep,
|
|
17084
|
-
|
|
17085
|
-
|
|
17235
|
+
selectedRun,
|
|
17236
|
+
chooseRun,
|
|
17086
17237
|
selectedPricingOptionId,
|
|
17087
17238
|
choosePricingOption,
|
|
17088
17239
|
selectedSlidingAmountInput,
|
|
17089
17240
|
changeSlidingAmount,
|
|
17090
|
-
|
|
17241
|
+
selectedRunPricing
|
|
17091
17242
|
};
|
|
17092
17243
|
}
|
|
17093
17244
|
//#endregion
|
|
17094
|
-
//#region ../blocks/src/system/runtime/nodes/
|
|
17245
|
+
//#region ../blocks/src/system/runtime/nodes/event-registration/whole-series/useWholeSeriesPaymentVerification.ts
|
|
17095
17246
|
function applyTerminalStatus(status, setters) {
|
|
17096
17247
|
if (status === "enrolled" || status === "completed") {
|
|
17097
17248
|
setters.setEnrollmentResult({
|
|
@@ -17113,7 +17264,7 @@ function applyTerminalStatus(status, setters) {
|
|
|
17113
17264
|
setters.setStep("error");
|
|
17114
17265
|
return true;
|
|
17115
17266
|
}
|
|
17116
|
-
async function
|
|
17267
|
+
async function pollWholeSeriesRegistrationStatus(api, sessionId, setters, isCancelled) {
|
|
17117
17268
|
const startedAt = Date.now();
|
|
17118
17269
|
while (!isCancelled()) {
|
|
17119
17270
|
try {
|
|
@@ -17134,21 +17285,21 @@ async function pollCourseRegistrationStatus(api, sessionId, setters, isCancelled
|
|
|
17134
17285
|
await new Promise((resolve) => setTimeout(resolve, 1500));
|
|
17135
17286
|
}
|
|
17136
17287
|
}
|
|
17137
|
-
function
|
|
17288
|
+
function useWholeSeriesPaymentVerification(api, setters, anchorId = WHOLE_SERIES_REGISTRATION_ANCHOR_ID, location = window.location) {
|
|
17138
17289
|
useEffect(() => {
|
|
17139
17290
|
let cancelled = false;
|
|
17140
|
-
const enrollment = new URLSearchParams(
|
|
17141
|
-
const sessionId =
|
|
17291
|
+
const enrollment = new URLSearchParams(location.search).get("enrollment");
|
|
17292
|
+
const sessionId = getWholeSeriesCheckoutSessionId(location);
|
|
17142
17293
|
if (enrollment === "cancelled") {
|
|
17143
|
-
scrollToBlock(
|
|
17294
|
+
scrollToBlock(anchorId);
|
|
17144
17295
|
setters.setErrorMessage("Payment was cancelled. You can try again.");
|
|
17145
17296
|
setters.setStep("error");
|
|
17146
17297
|
return;
|
|
17147
17298
|
}
|
|
17148
17299
|
if (enrollment !== "success" || !sessionId) return;
|
|
17149
|
-
scrollToBlock(
|
|
17300
|
+
scrollToBlock(anchorId);
|
|
17150
17301
|
setters.setStep("verifying-payment");
|
|
17151
|
-
|
|
17302
|
+
pollWholeSeriesRegistrationStatus(api, sessionId, setters, () => cancelled);
|
|
17152
17303
|
return () => {
|
|
17153
17304
|
cancelled = true;
|
|
17154
17305
|
};
|
|
@@ -17156,11 +17307,13 @@ function useCoursePaymentVerification(api, setters) {
|
|
|
17156
17307
|
api,
|
|
17157
17308
|
setters.setEnrollmentResult,
|
|
17158
17309
|
setters.setErrorMessage,
|
|
17159
|
-
setters.setStep
|
|
17310
|
+
setters.setStep,
|
|
17311
|
+
anchorId,
|
|
17312
|
+
location
|
|
17160
17313
|
]);
|
|
17161
17314
|
}
|
|
17162
17315
|
//#endregion
|
|
17163
|
-
//#region ../blocks/src/system/runtime/nodes/
|
|
17316
|
+
//#region ../blocks/src/system/runtime/nodes/event-registration/whole-series/useWholeSeriesRegistrationActions.ts
|
|
17164
17317
|
function blocked(message, setters) {
|
|
17165
17318
|
setters.setErrorMessage(message);
|
|
17166
17319
|
setters.setStep("error");
|
|
@@ -17170,16 +17323,16 @@ function blocked(message, setters) {
|
|
|
17170
17323
|
};
|
|
17171
17324
|
}
|
|
17172
17325
|
function validateSubmission(state, setters) {
|
|
17173
|
-
if (!state.
|
|
17326
|
+
if (!state.selectedRun) return {
|
|
17174
17327
|
kind: "blocked",
|
|
17175
17328
|
message: "Choose an available set of dates to continue."
|
|
17176
17329
|
};
|
|
17177
17330
|
const errors = validateFormData$1(state.formData);
|
|
17178
17331
|
setters.setErrors(errors);
|
|
17179
17332
|
if (Object.keys(errors).length > 0) return { kind: "validation-failed" };
|
|
17180
|
-
const pricingMessage =
|
|
17333
|
+
const pricingMessage = getMissingWholeSeriesPricingSelectionMessage(state.pricing);
|
|
17181
17334
|
if (pricingMessage) return blocked(pricingMessage, setters);
|
|
17182
|
-
if (!state.hasClaim && state.eligibility?.isFull && !state.eligibility.canJoinWaitlist) return blocked(state.eligibility.reason ?? "This
|
|
17335
|
+
if (!state.hasClaim && state.eligibility?.isFull && !state.eligibility.canJoinWaitlist) return blocked(state.eligibility.reason ?? "This run is fully booked.", setters);
|
|
17183
17336
|
if (isSpamProtectionEnabled() && !state.altchaSolution) return blocked("Please complete the verification check.", setters);
|
|
17184
17337
|
return null;
|
|
17185
17338
|
}
|
|
@@ -17192,8 +17345,8 @@ function enrollmentPayload(state, payment) {
|
|
|
17192
17345
|
}
|
|
17193
17346
|
function registrantPayload(state) {
|
|
17194
17347
|
return {
|
|
17195
|
-
eventSeriesId: state.
|
|
17196
|
-
...
|
|
17348
|
+
eventSeriesId: state.selectedRun.eventSeriesId,
|
|
17349
|
+
...buildWholeSeriesPricingOptionPayload(state.pricing),
|
|
17197
17350
|
email: state.formData.email.trim().toLowerCase(),
|
|
17198
17351
|
name: state.formData.name.trim(),
|
|
17199
17352
|
phone: state.formData.phone.trim() || void 0,
|
|
@@ -17226,7 +17379,7 @@ async function enroll(state, setters, payment) {
|
|
|
17226
17379
|
async function checkout(state, setters) {
|
|
17227
17380
|
setters.setStep("submitting");
|
|
17228
17381
|
try {
|
|
17229
|
-
const urls = buildCheckoutReturnUrls("enrollment",
|
|
17382
|
+
const urls = buildCheckoutReturnUrls("enrollment", state.options.anchorId ?? "event-registration");
|
|
17230
17383
|
const result = await state.api.createWholeSeriesCheckout({
|
|
17231
17384
|
...registrantPayload(state),
|
|
17232
17385
|
discountCode: state.discountCode.trim() || void 0,
|
|
@@ -17261,10 +17414,10 @@ async function checkout(state, setters) {
|
|
|
17261
17414
|
}
|
|
17262
17415
|
async function submitDetails(state, setters) {
|
|
17263
17416
|
const invalid = validateSubmission(state, setters);
|
|
17264
|
-
if (invalid || !state.
|
|
17417
|
+
if (invalid || !state.selectedRun) return invalid ?? { kind: "validation-failed" };
|
|
17265
17418
|
if (state.eligibility?.canJoinWaitlist) return enroll(state, setters, { method: "free" });
|
|
17266
17419
|
const requiresPayment = state.pricing?.selectedRequiresPayment ?? false;
|
|
17267
|
-
const canUseMembership = requiresPayment && state.
|
|
17420
|
+
const canUseMembership = requiresPayment && state.selectedRun.acceptsMemberships && state.portalAuthState === "authenticated" && state.eligibleMemberships.length > 0;
|
|
17268
17421
|
if (requiresPayment && canUseMembership) {
|
|
17269
17422
|
setters.setStep("select-payment");
|
|
17270
17423
|
return { kind: "state-updated" };
|
|
@@ -17274,7 +17427,7 @@ async function submitDetails(state, setters) {
|
|
|
17274
17427
|
}
|
|
17275
17428
|
async function continuePayment(state, setters) {
|
|
17276
17429
|
const invalid = validateSubmission(state, setters);
|
|
17277
|
-
if (invalid || !state.
|
|
17430
|
+
if (invalid || !state.selectedRun) return invalid ?? { kind: "validation-failed" };
|
|
17278
17431
|
if (!state.pricing?.selectedRequiresPayment) {
|
|
17279
17432
|
setters.setStep("enter-details");
|
|
17280
17433
|
return { kind: "state-updated" };
|
|
@@ -17289,7 +17442,7 @@ async function continuePayment(state, setters) {
|
|
|
17289
17442
|
}
|
|
17290
17443
|
return checkout(selectedState, setters);
|
|
17291
17444
|
}
|
|
17292
|
-
function
|
|
17445
|
+
function useWholeSeriesRegistrationActions(state, setStep) {
|
|
17293
17446
|
const [errors, setErrors] = useState({});
|
|
17294
17447
|
const [enrollmentResult, setEnrollmentResult] = useState(null);
|
|
17295
17448
|
const [errorMessage, setErrorMessage] = useState("");
|
|
@@ -17316,14 +17469,14 @@ function useCourseRegistrationActions(state, setStep) {
|
|
|
17316
17469
|
};
|
|
17317
17470
|
}
|
|
17318
17471
|
//#endregion
|
|
17319
|
-
//#region ../blocks/src/system/runtime/nodes/
|
|
17472
|
+
//#region ../blocks/src/system/runtime/nodes/event-registration/whole-series/useWholeSeriesRegistrationPortal.ts
|
|
17320
17473
|
const EMPTY_FORM = {
|
|
17321
17474
|
name: "",
|
|
17322
17475
|
email: "",
|
|
17323
17476
|
phone: "",
|
|
17324
17477
|
notes: ""
|
|
17325
17478
|
};
|
|
17326
|
-
function
|
|
17479
|
+
function useWholeSeriesRegistrationPortal(api) {
|
|
17327
17480
|
const [formData, setFormData] = useState(EMPTY_FORM);
|
|
17328
17481
|
const [portalAuthState, setPortalAuthState] = useState("checking");
|
|
17329
17482
|
const updateFormData = useCallback((updater) => {
|
|
@@ -17359,19 +17512,19 @@ function useCourseRegistrationPortal(api) {
|
|
|
17359
17512
|
};
|
|
17360
17513
|
}
|
|
17361
17514
|
//#endregion
|
|
17362
|
-
//#region ../blocks/src/system/runtime/nodes/
|
|
17363
|
-
function
|
|
17515
|
+
//#region ../blocks/src/system/runtime/nodes/event-registration/whole-series/useWholeSeriesWaitlistSelection.ts
|
|
17516
|
+
function useWholeSeriesWaitlistSelection(input) {
|
|
17364
17517
|
useEffect(() => {
|
|
17365
17518
|
const claim = input.waitlistClaim.claim;
|
|
17366
17519
|
if (!claim || claim.subject.kind !== "whole_series") return;
|
|
17367
17520
|
const eventSeriesId = claim.subject.eventSeriesId;
|
|
17368
|
-
const
|
|
17369
|
-
if (!
|
|
17370
|
-
input.reportError("This waitlist claim is for a different
|
|
17521
|
+
const run = input.scopedRuns.find((candidate) => candidate.eventSeriesId === eventSeriesId);
|
|
17522
|
+
if (!run) {
|
|
17523
|
+
input.reportError("This waitlist claim is for a different run.");
|
|
17371
17524
|
input.goToStep("error");
|
|
17372
17525
|
return;
|
|
17373
17526
|
}
|
|
17374
|
-
input.
|
|
17527
|
+
input.chooseRun(run);
|
|
17375
17528
|
input.updateFormData((current) => ({
|
|
17376
17529
|
...current,
|
|
17377
17530
|
email: claim.prefill.email,
|
|
@@ -17379,12 +17532,12 @@ function useCourseWaitlistSelection(input) {
|
|
|
17379
17532
|
phone: claim.prefill.phone ?? "",
|
|
17380
17533
|
notes: claim.prefill.notes ?? ""
|
|
17381
17534
|
}));
|
|
17382
|
-
if (input.step === "select-
|
|
17535
|
+
if (input.step === "select-run") input.goToStep("enter-details");
|
|
17383
17536
|
}, [
|
|
17384
|
-
input.
|
|
17537
|
+
input.chooseRun,
|
|
17385
17538
|
input.goToStep,
|
|
17386
17539
|
input.reportError,
|
|
17387
|
-
input.
|
|
17540
|
+
input.scopedRuns,
|
|
17388
17541
|
input.step,
|
|
17389
17542
|
input.updateFormData,
|
|
17390
17543
|
input.waitlistClaim.claim
|
|
@@ -17401,40 +17554,48 @@ function useCourseWaitlistSelection(input) {
|
|
|
17401
17554
|
]);
|
|
17402
17555
|
}
|
|
17403
17556
|
//#endregion
|
|
17404
|
-
//#region ../blocks/src/system/runtime/nodes/
|
|
17405
|
-
function
|
|
17557
|
+
//#region ../blocks/src/system/runtime/nodes/event-registration/whole-series/useWholeSeriesRegistrationWizard.ts
|
|
17558
|
+
function useWholeSeriesRegistrationWizard(props, options = {}) {
|
|
17559
|
+
return useWholeSeriesRegistrationWizardWithDeps(wholeSeriesRegistrationWizardDeps, props, options);
|
|
17560
|
+
}
|
|
17561
|
+
const wholeSeriesRegistrationWizardDeps = { readLocation: () => ({
|
|
17562
|
+
search: window.location.search,
|
|
17563
|
+
hash: window.location.hash
|
|
17564
|
+
}) };
|
|
17565
|
+
function useWholeSeriesRegistrationWizardWithDeps(deps, props, options = {}) {
|
|
17406
17566
|
const api = useBlockApi();
|
|
17407
|
-
const
|
|
17408
|
-
const
|
|
17409
|
-
const
|
|
17567
|
+
const [location] = useState(deps.readLocation);
|
|
17568
|
+
const selection = useWholeSeriesRegistrationSelection(props, location);
|
|
17569
|
+
const portal = useWholeSeriesRegistrationPortal(api);
|
|
17570
|
+
const waitlistClaim = useWaitlistClaimForToken(new URLSearchParams(location.search).get("waitlist_claim")?.trim() || null);
|
|
17410
17571
|
const [bookingMode, setBookingMode] = useState(null);
|
|
17411
17572
|
const [altchaSolution, setAltchaSolution] = useState(null);
|
|
17412
|
-
const eligibility =
|
|
17573
|
+
const eligibility = useWholeSeriesEligibility({
|
|
17413
17574
|
api,
|
|
17414
|
-
|
|
17415
|
-
hasPaidSelection: selection.
|
|
17575
|
+
selectedRun: selection.selectedRun,
|
|
17576
|
+
hasPaidSelection: selection.selectedRunPricing?.hasPaidSelection ?? false,
|
|
17416
17577
|
portalAuthState: portal.portalAuthState,
|
|
17417
17578
|
waitlistClaimToken: waitlistClaim.token
|
|
17418
17579
|
});
|
|
17419
17580
|
const discountUi = useDiscountCodeUi({
|
|
17420
17581
|
api,
|
|
17421
|
-
discountContext: useMemo(() => selection.
|
|
17582
|
+
discountContext: useMemo(() => selection.selectedRun && selection.selectedRunPricing?.selectedRequiresPayment && eligibility.paymentChoice === "checkout" ? {
|
|
17422
17583
|
type: "whole_series",
|
|
17423
|
-
eventSeriesId: selection.
|
|
17584
|
+
eventSeriesId: selection.selectedRun.eventSeriesId
|
|
17424
17585
|
} : null, [
|
|
17425
17586
|
eligibility.paymentChoice,
|
|
17426
|
-
selection.
|
|
17427
|
-
selection.
|
|
17587
|
+
selection.selectedRun,
|
|
17588
|
+
selection.selectedRunPricing?.selectedRequiresPayment
|
|
17428
17589
|
]),
|
|
17429
|
-
subtotalCents: selection.
|
|
17590
|
+
subtotalCents: selection.selectedRunPricing?.selectedPriceAmount ?? void 0
|
|
17430
17591
|
});
|
|
17431
|
-
const actions =
|
|
17592
|
+
const actions = useWholeSeriesRegistrationActions({
|
|
17432
17593
|
api,
|
|
17433
|
-
|
|
17434
|
-
pricing: selection.
|
|
17594
|
+
selectedRun: selection.selectedRun,
|
|
17595
|
+
pricing: selection.selectedRunPricing,
|
|
17435
17596
|
formData: portal.formData,
|
|
17436
17597
|
portalAuthState: portal.portalAuthState,
|
|
17437
|
-
eligibility: eligibility.
|
|
17598
|
+
eligibility: eligibility.runEligibility,
|
|
17438
17599
|
eligibleMemberships: eligibility.eligibleMemberships,
|
|
17439
17600
|
paymentChoice: eligibility.paymentChoice,
|
|
17440
17601
|
selectedMembershipId: eligibility.selectedMembershipId,
|
|
@@ -17444,14 +17605,16 @@ function useCourseRegistrationWizard(props, options = {}) {
|
|
|
17444
17605
|
discountCode: discountUi.discountCode,
|
|
17445
17606
|
options
|
|
17446
17607
|
}, selection.goToStep);
|
|
17447
|
-
|
|
17608
|
+
useWholeSeriesRegistrationEffects({
|
|
17448
17609
|
api,
|
|
17449
17610
|
actions,
|
|
17450
17611
|
portal,
|
|
17451
17612
|
selection,
|
|
17452
|
-
waitlistClaim
|
|
17613
|
+
waitlistClaim,
|
|
17614
|
+
anchorId: options.anchorId ?? "event-registration",
|
|
17615
|
+
location
|
|
17453
17616
|
});
|
|
17454
|
-
return
|
|
17617
|
+
return buildWholeSeriesRegistrationWizardResult({
|
|
17455
17618
|
api,
|
|
17456
17619
|
selection,
|
|
17457
17620
|
portal,
|
|
@@ -17459,10 +17622,10 @@ function useCourseRegistrationWizard(props, options = {}) {
|
|
|
17459
17622
|
actions,
|
|
17460
17623
|
discountUi,
|
|
17461
17624
|
waitlistClaim,
|
|
17462
|
-
view:
|
|
17463
|
-
|
|
17464
|
-
|
|
17465
|
-
pricing: selection.
|
|
17625
|
+
view: deriveWholeSeriesRegistrationViewState({
|
|
17626
|
+
scopedRuns: selection.scopedRuns,
|
|
17627
|
+
selectedRun: selection.selectedRun,
|
|
17628
|
+
pricing: selection.selectedRunPricing,
|
|
17466
17629
|
portalAuthState: portal.portalAuthState,
|
|
17467
17630
|
eligibleMembershipCount: eligibility.eligibleMemberships.length,
|
|
17468
17631
|
bookingMode,
|
|
@@ -17472,26 +17635,27 @@ function useCourseRegistrationWizard(props, options = {}) {
|
|
|
17472
17635
|
bookingMode,
|
|
17473
17636
|
setBookingMode,
|
|
17474
17637
|
altchaSolution,
|
|
17475
|
-
setAltchaSolution
|
|
17638
|
+
setAltchaSolution,
|
|
17639
|
+
anchorId: options.anchorId ?? "event-registration"
|
|
17476
17640
|
});
|
|
17477
17641
|
}
|
|
17478
|
-
function
|
|
17479
|
-
|
|
17642
|
+
function useWholeSeriesRegistrationEffects(input) {
|
|
17643
|
+
useWholeSeriesPaymentVerification(input.api, {
|
|
17480
17644
|
setStep: input.selection.goToStep,
|
|
17481
17645
|
setErrorMessage: input.actions.reportError,
|
|
17482
17646
|
setEnrollmentResult: input.actions.recordEnrollmentResult
|
|
17483
|
-
});
|
|
17484
|
-
|
|
17647
|
+
}, input.anchorId, input.location);
|
|
17648
|
+
useWholeSeriesWaitlistSelection({
|
|
17485
17649
|
waitlistClaim: input.waitlistClaim,
|
|
17486
|
-
|
|
17650
|
+
scopedRuns: input.selection.scopedRuns,
|
|
17487
17651
|
step: input.selection.step,
|
|
17488
17652
|
goToStep: input.selection.goToStep,
|
|
17489
|
-
|
|
17653
|
+
chooseRun: input.selection.chooseRun,
|
|
17490
17654
|
updateFormData: input.portal.updateFormData,
|
|
17491
17655
|
reportError: input.actions.reportError
|
|
17492
17656
|
});
|
|
17493
17657
|
}
|
|
17494
|
-
function
|
|
17658
|
+
function buildWholeSeriesRegistrationWizardResult(parts) {
|
|
17495
17659
|
const handleBookingModeChange = (mode) => {
|
|
17496
17660
|
parts.setBookingMode(mode);
|
|
17497
17661
|
parts.eligibility.choosePaymentChoice(mode === "membership" ? "membership" : "checkout");
|
|
@@ -17515,30 +17679,30 @@ function buildCourseRegistrationWizardResult(parts) {
|
|
|
17515
17679
|
manualCodeEntryAllowed: parts.discountUi.manualCodeEntryAllowed,
|
|
17516
17680
|
discountsAvailableLoading: parts.discountUi.discountsAvailableLoading,
|
|
17517
17681
|
...parts.view,
|
|
17518
|
-
|
|
17519
|
-
parts.selection.
|
|
17682
|
+
handleRunSelect: (run) => {
|
|
17683
|
+
parts.selection.chooseRun(run);
|
|
17520
17684
|
parts.selection.goToStep("enter-details");
|
|
17521
17685
|
},
|
|
17522
17686
|
handleRetry: () => {
|
|
17523
|
-
parts.selection.goToStep(parts.selection.
|
|
17687
|
+
parts.selection.goToStep(parts.selection.scopedRuns.length === 1 ? "enter-details" : "select-run");
|
|
17524
17688
|
parts.actions.reportError("");
|
|
17525
17689
|
},
|
|
17526
17690
|
handleBookingModeChange,
|
|
17527
|
-
handleLogout: parts.portal.portalAuthState === "authenticated" ? () => logoutPortal(
|
|
17528
|
-
|
|
17691
|
+
handleLogout: parts.portal.portalAuthState === "authenticated" ? () => logoutPortal(parts.anchorId) : void 0,
|
|
17692
|
+
selectedRunPricingPayload: buildWholeSeriesPricingOptionPayload(parts.selection.selectedRunPricing)
|
|
17529
17693
|
};
|
|
17530
17694
|
}
|
|
17531
17695
|
//#endregion
|
|
17532
|
-
//#region ../blocks/src/system/runtime/nodes/
|
|
17696
|
+
//#region ../blocks/src/system/runtime/nodes/event-registration/whole-series/whole-series-registration.headless.planning.ts
|
|
17533
17697
|
const STEP_IDS = {
|
|
17534
|
-
"select-
|
|
17698
|
+
"select-run": "select-run",
|
|
17535
17699
|
"enter-details": "enter-details",
|
|
17536
17700
|
"booking-mode": "select-booking-method",
|
|
17537
17701
|
"select-payment": "select-payment"
|
|
17538
17702
|
};
|
|
17539
17703
|
function toPublicStepId(step) {
|
|
17540
17704
|
switch (step) {
|
|
17541
|
-
case "select-
|
|
17705
|
+
case "select-run":
|
|
17542
17706
|
case "enter-details":
|
|
17543
17707
|
case "booking-mode":
|
|
17544
17708
|
case "select-payment": return STEP_IDS[step];
|
|
@@ -17598,7 +17762,7 @@ function resolveWholeSeriesRegistrationStatus(wizard) {
|
|
|
17598
17762
|
tag: "error",
|
|
17599
17763
|
message: wizard.errorMessage
|
|
17600
17764
|
};
|
|
17601
|
-
case "select-
|
|
17765
|
+
case "select-run":
|
|
17602
17766
|
case "enter-details":
|
|
17603
17767
|
case "booking-mode":
|
|
17604
17768
|
case "select-payment": return { tag: "ready" };
|
|
@@ -17632,7 +17796,7 @@ function resolveWholeSeriesRegistrationView(wizard) {
|
|
|
17632
17796
|
kind: "error",
|
|
17633
17797
|
message: "Waitlist registration completed without a result."
|
|
17634
17798
|
};
|
|
17635
|
-
case "select-
|
|
17799
|
+
case "select-run":
|
|
17636
17800
|
case "enter-details":
|
|
17637
17801
|
case "booking-mode":
|
|
17638
17802
|
case "select-payment":
|
|
@@ -17669,7 +17833,7 @@ function resolveWholeSeriesPaymentSelection(input) {
|
|
|
17669
17833
|
}
|
|
17670
17834
|
//#endregion
|
|
17671
17835
|
//#region ../blocks/src/system/runtime/hooks/useHeadlessWholeSeriesRegistrationFlow.ts
|
|
17672
|
-
const wholeSeriesRegistrationControllerDeps = {
|
|
17836
|
+
const wholeSeriesRegistrationControllerDeps = { useWholeSeriesRegistrationWizard };
|
|
17673
17837
|
function createWholeSeriesRegistrationBlockApiConfig(input) {
|
|
17674
17838
|
return {
|
|
17675
17839
|
baseUrl: input.apiBaseUrl,
|
|
@@ -17695,8 +17859,8 @@ function useHeadlessWholeSeriesRegistrationFlow(options) {
|
|
|
17695
17859
|
return useWholeSeriesRegistrationControllerWithDeps(options, wholeSeriesRegistrationControllerDeps);
|
|
17696
17860
|
}
|
|
17697
17861
|
function useWholeSeriesRegistrationControllerWithDeps(options, deps) {
|
|
17698
|
-
const wizard = deps.
|
|
17699
|
-
|
|
17862
|
+
const wizard = deps.useWholeSeriesRegistrationWizard({
|
|
17863
|
+
runs: (options.runs ?? []).map(toPublicWholeSeriesOffering),
|
|
17700
17864
|
subject: options.subject ?? null
|
|
17701
17865
|
}, { onCheckoutRedirect: () => {} });
|
|
17702
17866
|
const steps = useMemo(() => deriveWholeSeriesRegistrationSteps({
|
|
@@ -17704,11 +17868,11 @@ function useWholeSeriesRegistrationControllerWithDeps(options, deps) {
|
|
|
17704
17868
|
step: wizard.step
|
|
17705
17869
|
}), [wizard.step, wizard.wizardSteps]);
|
|
17706
17870
|
const currentStep = steps.find((step) => step.state === "active") ?? null;
|
|
17707
|
-
const pricingSelection = resolveWholeSeriesPricingSelection(wizard.
|
|
17871
|
+
const pricingSelection = resolveWholeSeriesPricingSelection(wizard.selectedRunPricing);
|
|
17708
17872
|
const paymentSelection = resolveWholeSeriesPaymentSelection({
|
|
17709
17873
|
paymentChoice: wizard.paymentChoice,
|
|
17710
17874
|
selectedMembershipId: wizard.selectedMembershipId,
|
|
17711
|
-
required: wizard.
|
|
17875
|
+
required: wizard.selectedRunPricing?.selectedRequiresPayment ?? false
|
|
17712
17876
|
});
|
|
17713
17877
|
const updateRegistrant = useCallback((values) => wizard.updateFormData(values), [wizard]);
|
|
17714
17878
|
const setSlidingAmountCents = useCallback((amount) => {
|
|
@@ -17734,8 +17898,8 @@ function useWholeSeriesRegistrationControllerWithDeps(options, deps) {
|
|
|
17734
17898
|
const blocked = resolveActionBlocker(wizard);
|
|
17735
17899
|
if (blocked) return blocked;
|
|
17736
17900
|
switch (wizard.step) {
|
|
17737
|
-
case "select-
|
|
17738
|
-
if (!wizard.
|
|
17901
|
+
case "select-run":
|
|
17902
|
+
if (!wizard.selectedRun) return {
|
|
17739
17903
|
ok: false,
|
|
17740
17904
|
reason: "blocked",
|
|
17741
17905
|
message: "Choose an available set of dates to continue."
|
|
@@ -17765,7 +17929,7 @@ function useWholeSeriesRegistrationControllerWithDeps(options, deps) {
|
|
|
17765
17929
|
const back = useCallback(() => {
|
|
17766
17930
|
switch (wizard.step) {
|
|
17767
17931
|
case "enter-details":
|
|
17768
|
-
if (!wizard.
|
|
17932
|
+
if (!wizard.hasPreSelectedRun) wizard.goToStep("select-run");
|
|
17769
17933
|
return;
|
|
17770
17934
|
case "booking-mode":
|
|
17771
17935
|
wizard.goToStep("enter-details");
|
|
@@ -17773,7 +17937,7 @@ function useWholeSeriesRegistrationControllerWithDeps(options, deps) {
|
|
|
17773
17937
|
case "select-payment":
|
|
17774
17938
|
wizard.goToStep(wizard.canUseMembership ? "booking-mode" : "enter-details");
|
|
17775
17939
|
return;
|
|
17776
|
-
case "select-
|
|
17940
|
+
case "select-run":
|
|
17777
17941
|
case "submitting":
|
|
17778
17942
|
case "redirecting":
|
|
17779
17943
|
case "verifying-payment":
|
|
@@ -17785,7 +17949,7 @@ function useWholeSeriesRegistrationControllerWithDeps(options, deps) {
|
|
|
17785
17949
|
}
|
|
17786
17950
|
}, [wizard]);
|
|
17787
17951
|
const payment = {
|
|
17788
|
-
required: wizard.
|
|
17952
|
+
required: wizard.selectedRunPricing?.selectedRequiresPayment ?? false,
|
|
17789
17953
|
selection: paymentSelection,
|
|
17790
17954
|
canUseMembership: wizard.canUseMembership,
|
|
17791
17955
|
eligibleMemberships: wizard.eligibleMemberships.map((membership) => ({
|
|
@@ -17795,7 +17959,7 @@ function useWholeSeriesRegistrationControllerWithDeps(options, deps) {
|
|
|
17795
17959
|
eligibility: wizard.eligibilityLoading ? { tag: "loading" } : wizard.eligibilityError ? {
|
|
17796
17960
|
tag: "error",
|
|
17797
17961
|
message: wizard.eligibilityError
|
|
17798
|
-
} : wizard.
|
|
17962
|
+
} : wizard.runEligibility || wizard.portalAuthState !== "checking" ? { tag: "loaded" } : { tag: "idle" }
|
|
17799
17963
|
};
|
|
17800
17964
|
const spamProtection = wizard.showSpamProtection ? {
|
|
17801
17965
|
enabled: true,
|
|
@@ -17806,13 +17970,13 @@ function useWholeSeriesRegistrationControllerWithDeps(options, deps) {
|
|
|
17806
17970
|
},
|
|
17807
17971
|
solution: wizard.altchaSolution
|
|
17808
17972
|
} : { enabled: false };
|
|
17809
|
-
const selectedRun = wizard.
|
|
17810
|
-
const isFull = wizard.
|
|
17973
|
+
const selectedRun = wizard.selectedRun;
|
|
17974
|
+
const isFull = wizard.runEligibility?.isFull ?? (selectedRun?.availableSpots !== null && selectedRun?.availableSpots !== void 0 ? selectedRun.availableSpots <= 0 : false);
|
|
17811
17975
|
return {
|
|
17812
17976
|
status: resolveWholeSeriesRegistrationStatus(wizard),
|
|
17813
17977
|
view: resolveWholeSeriesRegistrationView({
|
|
17814
17978
|
step: wizard.step,
|
|
17815
|
-
scopedRunsCount: wizard.
|
|
17979
|
+
scopedRunsCount: wizard.scopedRuns.length,
|
|
17816
17980
|
selectedRun,
|
|
17817
17981
|
enrollmentResult: wizard.enrollmentResult,
|
|
17818
17982
|
errorMessage: wizard.errorMessage
|
|
@@ -17820,10 +17984,10 @@ function useWholeSeriesRegistrationControllerWithDeps(options, deps) {
|
|
|
17820
17984
|
steps,
|
|
17821
17985
|
currentStep,
|
|
17822
17986
|
runs: {
|
|
17823
|
-
items: (options.runs ?? []).map((run) => toWholeSeriesRegistrationRun(
|
|
17824
|
-
scoped: wizard.
|
|
17987
|
+
items: (options.runs ?? []).map((run) => toWholeSeriesRegistrationRun(toPublicWholeSeriesOffering(run))),
|
|
17988
|
+
scoped: wizard.scopedRuns.map(toWholeSeriesRegistrationRun),
|
|
17825
17989
|
selected: selectedRun ? toWholeSeriesRegistrationRun(selectedRun) : null,
|
|
17826
|
-
hasPreSelectedRun: wizard.
|
|
17990
|
+
hasPreSelectedRun: wizard.hasPreSelectedRun,
|
|
17827
17991
|
subject: options.subject ?? null
|
|
17828
17992
|
},
|
|
17829
17993
|
registrant: {
|
|
@@ -17831,7 +17995,7 @@ function useWholeSeriesRegistrationControllerWithDeps(options, deps) {
|
|
|
17831
17995
|
errors: wizard.errors
|
|
17832
17996
|
},
|
|
17833
17997
|
pricing: {
|
|
17834
|
-
...toWholeSeriesRegistrationPricing(wizard.
|
|
17998
|
+
...toWholeSeriesRegistrationPricing(wizard.selectedRunPricing),
|
|
17835
17999
|
selectedOptionId: wizard.selectedPricingOptionId,
|
|
17836
18000
|
selection: pricingSelection
|
|
17837
18001
|
},
|
|
@@ -17847,8 +18011,8 @@ function useWholeSeriesRegistrationControllerWithDeps(options, deps) {
|
|
|
17847
18011
|
enrollmentOpen: selectedRun?.enrollmentOpen ?? false,
|
|
17848
18012
|
availableSpots: selectedRun?.availableSpots ?? null,
|
|
17849
18013
|
isFull,
|
|
17850
|
-
canJoinWaitlist: wizard.
|
|
17851
|
-
message: wizard.
|
|
18014
|
+
canJoinWaitlist: wizard.runEligibility?.canJoinWaitlist ?? false,
|
|
18015
|
+
message: wizard.runEligibility?.reason ?? null
|
|
17852
18016
|
},
|
|
17853
18017
|
portalAuth: {
|
|
17854
18018
|
state: wizard.portalAuthState,
|
|
@@ -17862,8 +18026,8 @@ function useWholeSeriesRegistrationControllerWithDeps(options, deps) {
|
|
|
17862
18026
|
},
|
|
17863
18027
|
actions: {
|
|
17864
18028
|
selectRun: (runId) => {
|
|
17865
|
-
const run = wizard.
|
|
17866
|
-
if (run) wizard.
|
|
18029
|
+
const run = wizard.scopedRuns.find((candidate) => candidate.eventSeriesId === runId) ?? null;
|
|
18030
|
+
if (run) wizard.handleRunSelect(run);
|
|
17867
18031
|
},
|
|
17868
18032
|
updateRegistrant,
|
|
17869
18033
|
selectPricingOption: wizard.choosePricingOption,
|
|
@@ -17907,8 +18071,8 @@ function toHeadlessActionResult(result) {
|
|
|
17907
18071
|
};
|
|
17908
18072
|
}
|
|
17909
18073
|
}
|
|
17910
|
-
function
|
|
17911
|
-
const pricing =
|
|
18074
|
+
function toPublicWholeSeriesOffering(run) {
|
|
18075
|
+
const pricing = toWholeSeriesPricing(run.pricing);
|
|
17912
18076
|
return {
|
|
17913
18077
|
eventSeriesId: run.registrationTarget.eventSeriesId,
|
|
17914
18078
|
eventOfferingId: run.eventOfferingId,
|
|
@@ -17933,7 +18097,7 @@ function toPublicCourse(run) {
|
|
|
17933
18097
|
venue: run.venue
|
|
17934
18098
|
};
|
|
17935
18099
|
}
|
|
17936
|
-
function
|
|
18100
|
+
function toWholeSeriesPricing(pricing) {
|
|
17937
18101
|
const common = {
|
|
17938
18102
|
bookingRequirement: pricing.bookingRequirement,
|
|
17939
18103
|
pricingStrategy: pricing.pricingStrategy,
|
|
@@ -18060,8 +18224,8 @@ function resolveWaitlistClaim(wizard) {
|
|
|
18060
18224
|
return { tag: "none" };
|
|
18061
18225
|
}
|
|
18062
18226
|
function resolveActionBlocker(wizard) {
|
|
18063
|
-
if (!wizard.
|
|
18064
|
-
if (!wizard.
|
|
18227
|
+
if (!wizard.selectedRun) return null;
|
|
18228
|
+
if (!wizard.selectedRun.enrollmentOpen) return {
|
|
18065
18229
|
ok: false,
|
|
18066
18230
|
reason: "blocked",
|
|
18067
18231
|
message: "Sign-up is closed."
|
|
@@ -18071,10 +18235,10 @@ function resolveActionBlocker(wizard) {
|
|
|
18071
18235
|
reason: "blocked",
|
|
18072
18236
|
message: "Availability is still being checked."
|
|
18073
18237
|
};
|
|
18074
|
-
if (wizard.
|
|
18238
|
+
if (wizard.runEligibility?.isFull && !wizard.runEligibility.canJoinWaitlist) return {
|
|
18075
18239
|
ok: false,
|
|
18076
18240
|
reason: "blocked",
|
|
18077
|
-
message: wizard.
|
|
18241
|
+
message: wizard.runEligibility.reason ?? "There are no places available."
|
|
18078
18242
|
};
|
|
18079
18243
|
return null;
|
|
18080
18244
|
}
|