@riverbankcms/sdk 0.148.0 → 0.150.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/README.md +1 -1
- package/dist/EventEmbeddedCheckoutStep-D00Kc8Zj.mjs +285 -0
- package/dist/{PreviewEditorSidebar-DvEPG3Z2.mjs → PreviewEditorSidebar-7ZhmmnBB.mjs} +103 -66
- package/dist/{PreviewEditorUI-D6eb6fkx.mjs → PreviewEditorUI-BIJucTRd.mjs} +3 -6
- package/dist/{PreviewQueryProvider-5znTyJuz.mjs → PreviewQueryProvider-C0mndwHB.mjs} +3 -3
- package/dist/{SdkPreviewModeRuntime-DJ6utQ_R.mjs → SdkPreviewModeRuntime-tj45gmCX.mjs} +96 -67
- package/dist/{SiteChromeCustomizeContext-CFJYh6vo.mjs → SiteChromeCustomizeContext-BFOt0ss-.mjs} +4804 -4161
- package/dist/_dts/ai/src/contracts/proposals.d.ts +660 -0
- package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +510 -0
- package/dist/_dts/api/src/billing.d.ts +2 -2
- package/dist/_dts/api/src/bookingConfig.d.ts +33 -48
- package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +2 -6
- package/dist/_dts/api/src/bookingOperations.d.ts +5 -7
- package/dist/_dts/api/src/bookingRecords.d.ts +15 -11
- package/dist/_dts/api/src/bookingRefundOutcomes.d.ts +5 -5
- package/dist/_dts/api/src/clientErrorReporting.d.ts +11 -0
- package/dist/_dts/api/src/commercePortalEndpoints.d.ts +0 -2
- package/dist/_dts/api/src/common/cancellation.d.ts +23 -0
- package/dist/_dts/api/src/contentRuntime.d.ts +5 -1
- package/dist/_dts/api/src/customerMembershipOutcomes.d.ts +1 -1
- package/dist/_dts/api/src/endpoints.d.ts +2 -10
- package/dist/_dts/api/src/eventManagementContracts.d.ts +4 -7
- package/dist/_dts/api/src/footerCompositionContracts.d.ts +9 -0
- package/dist/_dts/api/src/footerSettings.d.ts +3 -3
- package/dist/_dts/api/src/index.d.ts +4 -4
- package/dist/_dts/api/src/navigation/bookingPortalLink.d.ts +13 -0
- package/dist/_dts/api/src/navigation.d.ts +1 -0
- package/dist/_dts/api/src/publicAppointmentBookingContracts.d.ts +2 -2
- package/dist/_dts/api/src/publicExperience/commerceEndpoints.d.ts +2 -29
- package/dist/_dts/api/src/publicExperience/eventEndpoints.d.ts +9 -173
- package/dist/_dts/api/src/request.d.ts +1 -1
- package/dist/_dts/api/src/sdk-event-upsert.d.ts +1 -1
- package/dist/_dts/api/src/sdkPullEventContracts.d.ts +1 -1
- package/dist/_dts/api/src/sdkThemeWire.d.ts +12 -0
- package/dist/_dts/api/src/siteManagementEndpoints.d.ts +3 -3
- package/dist/_dts/api/src/siteOperations.d.ts +6 -2
- package/dist/_dts/api/src/siteSettings.d.ts +2 -0
- package/dist/_dts/blocks/src/client/site-chrome.d.ts +1 -1
- package/dist/_dts/blocks/src/client.d.ts +2 -1
- package/dist/_dts/blocks/src/contracts/index.d.ts +1 -1
- package/dist/_dts/blocks/src/contracts/non-block-islands.d.ts +2 -2
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +38 -10
- package/dist/_dts/blocks/src/portal/types.d.ts +9 -6
- package/dist/_dts/blocks/src/rendering/server.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +24 -24
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/shared/bookingPaymentTerms.d.ts +84 -160
- package/dist/_dts/blocks/src/system/blocks/shop.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/shop.shared.d.ts +31 -4
- package/dist/_dts/blocks/src/system/blocks/site-footer-runtime.d.ts +30 -3
- package/dist/_dts/blocks/src/system/designCapabilities.d.ts +10 -1
- package/dist/_dts/blocks/src/system/runtime/api/index.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/api/types/appointments.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/api/types/core.d.ts +3 -1
- package/dist/_dts/blocks/src/system/runtime/api/types/events.d.ts +38 -18
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +48 -6
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +24 -3
- package/dist/_dts/blocks/src/system/runtime/hooks/useBookingNowIso.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessEventRegistrationFlow.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.server.d.ts +6 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.state.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/commerce/shared/display.d.ts +9 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details/presentation.d.ts +14 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventEmbeddedCheckoutStep.d.ts +13 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationPayment.d.ts +15 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationWizardActions.d.ts +0 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/FullyBookedStep.d.ts +6 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/PaymentBlockingPanel.d.ts +3 -0
- 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/event-registration.headless.contract.d.ts +15 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.planning.d.ts +4 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventPaymentOptions.d.ts +3 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/paymentLocation.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/paymentResponse.d.ts +72 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationCompletion.d.ts +66 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationErrorRecovery.d.ts +1 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationStateMachine.d.ts +13 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/sessionStorage.d.ts +11 -52
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/types.d.ts +19 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationStripeReturn.d.ts +7 -42
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationSubmit.d.ts +7 -8
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +94 -24
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useGuestRegistrationRecovery.d.ts +30 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/usePaymentStatusRecovery.d.ts +24 -12
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useRegistrationAdmission.d.ts +18 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/wizardSteps.d.ts +6 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.interactive.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +24 -24
- package/dist/_dts/blocks/src/system/runtime/nodes/shop.interactive.d.ts +41 -6
- package/dist/_dts/blocks/src/system/runtime/shared/bookingPaymentOptions.d.ts +7 -2
- package/dist/_dts/blocks/src/system/runtime/shared/stripe/browserStripe.d.ts +8 -0
- package/dist/_dts/blocks/src/system/transforms/registry/eventCalendar.d.ts +8 -0
- package/dist/_dts/commerce/src/purchase/bookingPaymentSelection.d.ts +54 -0
- package/dist/_dts/commerce/src/purchase/checkoutCommitPlan.d.ts +58 -13
- package/dist/_dts/commerce/src/purchase/checkoutCopy.d.ts +10 -0
- package/dist/_dts/commerce/src/purchase/checkoutErrorCodes.d.ts +1 -1
- package/dist/_dts/commerce/src/purchase/checkoutPaymentPlanPlanning.d.ts +16 -21
- package/dist/_dts/commerce/src/purchase/checkoutPaymentTerms.d.ts +23 -40
- package/dist/_dts/commerce/src/purchase/checkoutPresentation.d.ts +49 -0
- package/dist/_dts/commerce/src/purchase/checkoutSessionMetadata.d.ts +6 -6
- package/dist/_dts/commerce/src/purchase/checkoutStripeFinalizationPlanning.d.ts +5 -1
- package/dist/_dts/commerce/src/purchase/checkoutStripeSessionPlanning.d.ts +5 -4
- package/dist/_dts/commerce/src/purchase/event-registration-errors.d.ts +9 -0
- package/dist/_dts/commerce/src/purchase/index.d.ts +3 -3
- package/dist/_dts/commerce/src/purchase/membershipOrderItemMetadata.d.ts +4 -0
- package/dist/_dts/commerce/src/purchase/oneTimeCheckoutPlanning.d.ts +9 -4
- package/dist/_dts/commerce/src/purchase/orderInstalmentClosure.d.ts +13 -1
- package/dist/_dts/commerce/src/purchase/orderInstalmentLifecycle.d.ts +5 -0
- package/dist/_dts/commerce/src/purchase/orderItemMetadata.d.ts +4 -1
- package/dist/_dts/commerce/src/purchase/orderTypes.d.ts +7 -1
- package/dist/_dts/commerce/src/purchase/refundRailSplit.d.ts +1 -1
- package/dist/_dts/commerce/src/purchase/stateTransitions.d.ts +2 -2
- package/dist/_dts/commerce/src/purchase/stripeCheckoutReturnUrl.d.ts +9 -2
- package/dist/_dts/commerce/src/purchase/stripeMinimumCharge.d.ts +6 -0
- package/dist/_dts/commerce/src/purchase/types.d.ts +7 -7
- package/dist/_dts/content-editor/src/FooterComposerOverview.d.ts +3 -2
- package/dist/_dts/content-editor/src/controller/editLeaseHandover.d.ts +30 -0
- package/dist/_dts/content-editor/src/footerPreviewRuntime.d.ts +6 -1
- package/dist/_dts/content-editor/src/lib/browserStorage.d.ts +5 -0
- package/dist/_dts/content-editor/src/useFooterComposerState.d.ts +7 -0
- package/dist/_dts/core/src/booking-flexible-balance.d.ts +2 -2
- package/dist/_dts/core/src/booking-instalment-deposit.d.ts +20 -0
- package/dist/_dts/core/src/booking-live-payment-terms.d.ts +72 -0
- package/dist/_dts/core/src/booking-payment-options.d.ts +24 -0
- package/dist/_dts/core/src/booking-payment-schemas.d.ts +522 -0
- package/dist/_dts/core/src/branded.d.ts +3 -0
- package/dist/_dts/core/src/edit-lease.d.ts +5 -0
- package/dist/_dts/core/src/index.d.ts +4 -0
- package/dist/_dts/core/src/patch/index.d.ts +30 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +326 -36
- package/dist/_dts/media-editor/src/MediaPickerDialog.d.ts +3 -1
- package/dist/_dts/media-editor/src/MediaPickerMiniDialog.d.ts +10 -0
- package/dist/_dts/media-editor/src/index.d.ts +2 -0
- package/dist/_dts/preview-next/src/client/preview/PreviewEntryControllerProvider.d.ts +0 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/previewAuthStore.d.ts +7 -0
- package/dist/_dts/preview-next/src/constants.d.ts +4 -0
- package/dist/_dts/preview-next/src/keepAlive.d.ts +1 -0
- package/dist/_dts/sdk/src/bookings/index.d.ts +2 -1
- package/dist/_dts/sdk/src/bookings/types.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/islands/types.d.ts +2 -12
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/blocks/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/blocks/opaquePanels.d.ts +147 -0
- package/dist/_dts/theme-core/src/boxBackgroundSchema.d.ts +22 -0
- package/dist/_dts/theme-core/src/buttons/buttonSurfaceContext.d.ts +22 -0
- package/dist/_dts/theme-core/src/cards/roles.d.ts +12 -0
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +198 -0
- package/dist/_dts/theme-core/src/palette/utils/index.d.ts +2 -0
- package/dist/_dts/theme-core/src/palette/utils/scrimContrast.d.ts +22 -0
- package/dist/_dts/theme-core/src/runtime/bridgeColourTokens.d.ts +10 -0
- package/dist/_dts/theme-core/src/schema.d.ts +330 -0
- package/dist/_dts/theme-core/src/site-styles/appearancePresetCatalog.d.ts +0 -51
- package/dist/_dts/theme-core/src/site-styles/blockAppearancePresets.d.ts +0 -51
- package/dist/_dts/theme-core/src/site-styles/lookResolution.d.ts +11 -0
- package/dist/_dts/theme-core/src/site-styles/pageDesignEditorCapabilities.d.ts +7 -1
- package/dist/_dts/theme-core/src/site-styles/pageDesignEditorModel.d.ts +7 -1
- package/dist/_dts/theme-core/src/site-styles/pageDesignIntent.d.ts +0 -5
- package/dist/_dts/theme-core/src/site-styles/previewRuntimeCapabilities.d.ts +12 -6
- package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +7 -4
- package/dist/_dts/theme-core/src/site-styles/sectionSurfaceBackgrounds.d.ts +65 -0
- package/dist/_dts/theme-core/src/site-styles/types.d.ts +17 -0
- package/dist/_dts/theme-core/src/surfaces/opaqueSurface.d.ts +43 -0
- package/dist/_dts/ui/src/color-picker.d.ts +1 -1
- package/dist/_dts/ui/src/palette/useHexDraft.d.ts +7 -0
- package/dist/client/{BookingMailingListNote-CzRt2dF_.mjs → BookingMailingListNote-CYHOufsI.mjs} +33 -124
- package/dist/client/{CheckboxChoice-B33MqoUo.mjs → CheckboxChoice-M-3HycLw.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-mxqwap3f.mjs → DemoBookingPortalAccess-Cvr9O_ca.mjs} +2 -2
- package/dist/client/{EventCombined.client-CDb11igO.mjs → EventCombined.client-m5UZIobP.mjs} +7 -7
- package/dist/client/EventEmbeddedCheckoutStep-DL6zFAkA.mjs +289 -0
- package/dist/client/{EventListing.client-EgYhzKPa.mjs → EventListing.client-DeMfCM04.mjs} +2 -2
- package/dist/client/{LeafletStaticMap-gtmtaA2b.mjs → LeafletStaticMap-CvZ3gOdD.mjs} +1 -1
- package/dist/client/{checkoutUrls-CXhko2Rv.mjs → RichText-BtfNvQV6.mjs} +2 -29
- package/dist/client/{TerminalPanel-DvNUP5ot.mjs → TerminalPanel-CUCNEwlH.mjs} +2 -18
- package/dist/client/{ThemedButton-C7CeUJjW.mjs → ThemedButton-C7WhXuRl.mjs} +2 -2
- package/dist/client/{accordion-kjvt49rA.mjs → accordion-cQm5mjqs.mjs} +1 -1
- package/dist/client/{bookingForm-pbRZordh.mjs → bookingForm-BVPJE5RQ.mjs} +15 -11
- package/dist/client/bookings.mjs +2860 -1222
- package/dist/client/{carousel-f4Zbmicv.mjs → carousel-3vgnY7LC.mjs} +2 -2
- package/dist/client/{carousel.client-A2lG-9od.mjs → carousel.client-CISsdZvg.mjs} +1 -1
- package/dist/client/{cart-DO20An50.mjs → cart-BGK4oOjm.mjs} +3 -3
- package/dist/client/{checkout-Du5amDR_.mjs → checkout-GsBLUNJD.mjs} +3 -3
- package/dist/client/checkoutUrls-ChxwaNtO.mjs +28 -0
- package/dist/client/client.mjs +3324 -2053
- package/dist/client/{colorStyles-j5U9v5JA.mjs → colorStyles-D-32xHZh.mjs} +2 -30
- package/dist/client/{context-eW97E945.mjs → context-D_8s12Fp.mjs} +1 -1
- package/dist/client/{dates-jPCirRea.mjs → dates-DeJQbQ9T.mjs} +2 -2
- package/dist/client/{eventCalendar-C2M-iE4j.mjs → eventCalendar-cmucD4NR.mjs} +10 -10
- package/dist/client/{eventCombined-W6ns3LHg.mjs → eventCombined-ku3E9FTl.mjs} +4 -4
- package/dist/client/{eventDetails-CR-GT0f0.mjs → eventDetails-CyKZ61sF.mjs} +5 -5
- package/dist/client/{eventListing-BK8AfYZz.mjs → eventListing-B7yxGIhX.mjs} +4 -4
- package/dist/client/{eventRegistration-BJSd4KUu.mjs → eventRegistration-BoXfSFgZ.mjs} +1455 -1184
- package/dist/client/{form-BvpfbQaT.mjs → form-CNQOWhJo.mjs} +5 -5
- package/dist/client/{headerSection-I5sUQ8x-.mjs → headerSection-DahaBJGQ.mjs} +3 -3
- package/dist/client/hooks.mjs +283 -193
- package/dist/client/{locationMap-BLvwf9_f.mjs → locationMap-BoDjqYlW.mjs} +4 -4
- package/dist/client/{media-Cl38iOMI.mjs → media-BFY0y2rb.mjs} +2 -1
- package/dist/client/{newsletterForm-DrQ2weE8.mjs → newsletterForm-DtzXDklw.mjs} +4 -4
- package/dist/client/{pricing-BES87mrR.mjs → pricing-DXEh2Lhh.mjs} +1 -1
- package/dist/client/{productDetail-Url9jcc5.mjs → productDetail-D7cPa-00.mjs} +3 -3
- package/dist/client/{productList-DE7ngEZJ.mjs → productList-D1XMap66.mjs} +3 -3
- package/dist/client/{propsDecoder-D1OtGXDV.mjs → propsDecoder-DiIeBopB.mjs} +913 -322
- package/dist/client/rendering/client.mjs +3913 -2260
- package/dist/client/rendering/islands.mjs +19 -19
- package/dist/client/rendering.mjs +3302 -2013
- package/dist/client/result-DRW7JWXz.mjs +30 -0
- package/dist/client/{routeIslandApiConfig-BG9Y-SHg.mjs → routeIslandApiConfig-wzR4lKAY.mjs} +1 -1
- package/dist/client/scrollToBlock-C86BYkyV.mjs +17 -0
- package/dist/client/{shop-CJkuySJ3.mjs → shop-CYT5P-S5.mjs} +13 -14
- package/dist/client/{shop-commerce-store-Bxm75Pg6.mjs → shop-commerce-store-wKhsJQxI.mjs} +1 -1
- package/dist/client/{shop-commerce-4rKj5n9h.mjs → shop-commerce-ypBu_dx4.mjs} +9 -9
- package/dist/client/{shopShared-DpoQDWfz.mjs → shopShared-DFGhYrf2.mjs} +52 -6
- package/dist/client/{useEventFilters-D8HliSqR.mjs → useEventFilters-blSbN5o7.mjs} +8 -8
- package/dist/preview-next/before-render.mjs +15 -22
- package/dist/preview-next/client/runtime.mjs +4 -4
- package/dist/preview-next/constants.mjs +5 -1
- package/dist/preview-next/index.mjs +5 -1
- package/dist/preview-next/keepAlive.mjs +149 -82
- package/dist/preview-next/middleware.mjs +15 -22
- package/dist/{previewAuthStore-BXXF3hhW.mjs → previewAuthStore-BBmV7UsW.mjs} +49 -29
- package/dist/{sdk-runtime-C2a05WjL.mjs → sdk-runtime-2p8uQk1V.mjs} +2 -2
- package/dist/{separator-CuNhBAhS.mjs → separator-Cvvzk0Oo.mjs} +1 -1
- package/dist/server/components.mjs +4041 -3704
- package/dist/server/config-validation.mjs +345 -255
- package/dist/server/config.mjs +345 -255
- package/dist/server/data.mjs +283 -193
- package/dist/server/index.mjs +20 -27
- package/dist/server/next.mjs +788 -469
- package/dist/server/page-converter.mjs +245 -121
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +4018 -3690
- package/dist/server/rendering.mjs +4044 -3707
- package/dist/server/routing.mjs +314 -190
- package/dist/server/server.mjs +290 -218
- package/dist/server/theme-bridge.mjs +1122 -310
- package/dist/server/theme.mjs +126 -116
- package/dist/spinner-CDo6AkDz.mjs +658 -0
- package/dist/styles/index.css +75 -212
- package/package.json +1 -1
- package/dist/_dts/api/src/bookingPaymentTermSchemas.d.ts +0 -123
- package/dist/_dts/billing/src/checkout/platform.d.ts +0 -77
- package/dist/_dts/billing/src/config/env.d.ts +0 -29
- package/dist/_dts/billing/src/stripe/client.d.ts +0 -29
- package/dist/_dts/blocks/src/system/runtime/hooks/usePaymentVerification.d.ts +0 -63
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventCheckoutHandoffRestore.d.ts +0 -9
- package/dist/_dts/commerce/src/purchase/checkoutPaymentTermPlanning.d.ts +0 -10
- package/dist/_dts/commerce/src/purchase/checkoutValidatedItemPlanning.d.ts +0 -55
- package/dist/_dts/commerce/src/purchase/orderInstalmentPayoff.d.ts +0 -24
- package/dist/client/urlParams-D71VXFGx.mjs +0 -47
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as ok$1, t as err$1 } from "./result-DRW7JWXz.mjs";
|
|
2
|
+
import { _ as parseEventSeriesId, a as paletteColorEntries, c as themeColorTokenSchema, g as parseEventOfferingId, h as parseContentVersionId, l as parseColorTokenParts, o as paletteColorsFromEntries, p as parseAspectRatioValue, r as rgbColorValue, s as parseThemeColorToken } from "./colorStyles-D-32xHZh.mjs";
|
|
2
3
|
import "react";
|
|
3
4
|
import { z } from "zod";
|
|
4
5
|
import "react/jsx-runtime";
|
|
5
6
|
//#region ../core/src/assert-never.ts
|
|
6
|
-
function assertNever$
|
|
7
|
+
function assertNever$4(value, message = "Unexpected variant") {
|
|
7
8
|
throw new Error(`${message}: ${String(value)}`);
|
|
8
9
|
}
|
|
9
10
|
//#endregion
|
|
@@ -96,7 +97,7 @@ function isPublicEventPricingOptionDisplayable(option) {
|
|
|
96
97
|
case "not_on_sale_yet":
|
|
97
98
|
case "sale_ended":
|
|
98
99
|
case "attendance_mode_unavailable": return false;
|
|
99
|
-
default: return assertNever$
|
|
100
|
+
default: return assertNever$4(reason);
|
|
100
101
|
}
|
|
101
102
|
}
|
|
102
103
|
function publicEventPricingDisplay(pricing) {
|
|
@@ -226,7 +227,7 @@ function canonicalEventPricingDisplay(pricing) {
|
|
|
226
227
|
currency: pricing.currency,
|
|
227
228
|
purpose: "configured"
|
|
228
229
|
});
|
|
229
|
-
default: return assertNever$
|
|
230
|
+
default: return assertNever$4(pricing);
|
|
230
231
|
}
|
|
231
232
|
}
|
|
232
233
|
/**
|
|
@@ -245,7 +246,7 @@ function formatBookingPriceDisplay(display, options = {}) {
|
|
|
245
246
|
case "mixed": return display.paidToAmount > display.paidFromAmount ? `Free / ${formatCurrencyAmount(display.paidFromAmount, display.currency, options)} - ${formatCurrencyAmount(display.paidToAmount, display.currency, options)}` : `Free / ${formatCurrencyAmount(display.paidFromAmount, display.currency, options)}`;
|
|
246
247
|
case "unavailable": return "Pricing unavailable";
|
|
247
248
|
case "external": return display.label;
|
|
248
|
-
default: return assertNever$
|
|
249
|
+
default: return assertNever$4(display);
|
|
249
250
|
}
|
|
250
251
|
}
|
|
251
252
|
/** Render an event's price directly from its pricing value. */
|
|
@@ -357,6 +358,88 @@ function isRecord$9(value) {
|
|
|
357
358
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
358
359
|
}
|
|
359
360
|
//#endregion
|
|
361
|
+
//#region ../core/src/money-input.ts
|
|
362
|
+
function unsafeAsNonNegativeCents(value) {
|
|
363
|
+
return value;
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Normalizes a derived amount to non-negative whole cents. This intentionally
|
|
367
|
+
* clamps negatives to zero; use parseNonNegativeCents for validation.
|
|
368
|
+
*/
|
|
369
|
+
function toNonNegativeCents(value) {
|
|
370
|
+
return unsafeAsNonNegativeCents(Math.max(0, Math.trunc(value)));
|
|
371
|
+
}
|
|
372
|
+
//#endregion
|
|
373
|
+
//#region ../core/src/booking-instalments.ts
|
|
374
|
+
function isDepositBearingBookingInstalmentPlan(plan) {
|
|
375
|
+
switch (plan.kind) {
|
|
376
|
+
case "deposit_plus_one_remainder":
|
|
377
|
+
case "deposit_plus_scheduled_instalments": return true;
|
|
378
|
+
case "equal_scheduled_instalments": return false;
|
|
379
|
+
default: return assertNever$3(plan);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
function getBookingInstalmentDepositRefundability(plan) {
|
|
383
|
+
return isDepositBearingBookingInstalmentPlan(plan) ? plan.depositRefundability : null;
|
|
384
|
+
}
|
|
385
|
+
function clampConfiguredAmount(amountCents, totalAmountCents) {
|
|
386
|
+
return Math.max(0, Math.min(amountCents, totalAmountCents));
|
|
387
|
+
}
|
|
388
|
+
function splitAmountWithRemainderInFirst(totalAmountCents, partCount) {
|
|
389
|
+
if (partCount <= 0) return [];
|
|
390
|
+
const baseAmountCents = Math.floor(totalAmountCents / partCount);
|
|
391
|
+
const remainderCents = totalAmountCents - baseAmountCents * partCount;
|
|
392
|
+
return Array.from({ length: partCount }, (_, index) => index === 0 ? baseAmountCents + remainderCents : baseAmountCents);
|
|
393
|
+
}
|
|
394
|
+
function addIntervalPreservingMonthAnchor(isoString, intervalCount, intervalUnit) {
|
|
395
|
+
const date = new Date(isoString);
|
|
396
|
+
if (!Number.isFinite(date.getTime())) return isoString;
|
|
397
|
+
switch (intervalUnit) {
|
|
398
|
+
case "day":
|
|
399
|
+
date.setUTCDate(date.getUTCDate() + intervalCount);
|
|
400
|
+
return date.toISOString();
|
|
401
|
+
case "week":
|
|
402
|
+
date.setUTCDate(date.getUTCDate() + intervalCount * 7);
|
|
403
|
+
return date.toISOString();
|
|
404
|
+
case "month": return addMonthsPreservingAnchorDay(date, intervalCount).toISOString();
|
|
405
|
+
default: return assertNever$3(intervalUnit);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
function getBookingInstalmentPlanIntervalCount(plan) {
|
|
409
|
+
switch (plan.kind) {
|
|
410
|
+
case "deposit_plus_one_remainder": return plan.remainderDueCount;
|
|
411
|
+
case "deposit_plus_scheduled_instalments":
|
|
412
|
+
case "equal_scheduled_instalments": return plan.intervalCount;
|
|
413
|
+
default: return assertNever$3(plan);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
function omitZeroAmountFutureRows(rows) {
|
|
417
|
+
if (rows.length <= 1) return rows;
|
|
418
|
+
const firstRow = rows[0];
|
|
419
|
+
if (firstRow === void 0) return [];
|
|
420
|
+
return [firstRow, ...rows.slice(1).filter((row) => row.amountCents > 0)];
|
|
421
|
+
}
|
|
422
|
+
function addMonthsPreservingAnchorDay(date, intervalCount) {
|
|
423
|
+
const anchorDay = date.getUTCDate();
|
|
424
|
+
const nextMonth = new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth() + intervalCount, 1, date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds()));
|
|
425
|
+
const lastDayOfTargetMonth = new Date(Date.UTC(nextMonth.getUTCFullYear(), nextMonth.getUTCMonth() + 1, 0)).getUTCDate();
|
|
426
|
+
nextMonth.setUTCDate(Math.min(anchorDay, lastDayOfTargetMonth));
|
|
427
|
+
return nextMonth;
|
|
428
|
+
}
|
|
429
|
+
function assertNever$3(value) {
|
|
430
|
+
throw new Error(`Unexpected value: ${String(value)}`);
|
|
431
|
+
}
|
|
432
|
+
//#endregion
|
|
433
|
+
//#region ../core/src/booking-payment-options.ts
|
|
434
|
+
/** Automatic instalments and a flexible balance cannot share one booking offer. */
|
|
435
|
+
function validateBookingPaymentOptionKinds(kinds) {
|
|
436
|
+
if (kinds.length === 0) return err$1("no_options");
|
|
437
|
+
const uniqueKinds = new Set(kinds);
|
|
438
|
+
if (uniqueKinds.size !== kinds.length) return err$1("duplicate_kind");
|
|
439
|
+
if (uniqueKinds.has("instalment_plan") && uniqueKinds.has("flexible_balance")) return err$1("incompatible_collection_options");
|
|
440
|
+
return ok$1(void 0);
|
|
441
|
+
}
|
|
442
|
+
//#endregion
|
|
360
443
|
//#region ../core/src/booking-time-zone.ts
|
|
361
444
|
const TIME_ZONE_VALIDITY_CACHE_LIMIT = 100;
|
|
362
445
|
const timeZoneValidityCache = /* @__PURE__ */ new Map();
|
|
@@ -1230,6 +1313,409 @@ const SURFACE_EVENT_PRESET_VALUES = [
|
|
|
1230
1313
|
"performance"
|
|
1231
1314
|
];
|
|
1232
1315
|
//#endregion
|
|
1316
|
+
//#region ../commerce/src/utils/assertNever.ts
|
|
1317
|
+
function assertNever$2(value, message) {
|
|
1318
|
+
if (message) throw new Error(message);
|
|
1319
|
+
throw new Error(`Unexpected value: ${String(value)}`);
|
|
1320
|
+
}
|
|
1321
|
+
//#endregion
|
|
1322
|
+
//#region ../commerce/src/purchase/bookingInstalmentSchedule.ts
|
|
1323
|
+
function resolveBookingInitialInstalmentAmountCents(input) {
|
|
1324
|
+
const totalAmountCents = Math.max(0, input.totalAmountCents);
|
|
1325
|
+
switch (input.plan.kind) {
|
|
1326
|
+
case "deposit_plus_one_remainder":
|
|
1327
|
+
case "deposit_plus_scheduled_instalments": return clampConfiguredAmount(input.plan.depositAmountCents, totalAmountCents);
|
|
1328
|
+
case "equal_scheduled_instalments": return splitAmountWithRemainderInFirst(totalAmountCents, input.plan.instalmentCount)[0] ?? 0;
|
|
1329
|
+
default: return assertNever$2(input.plan);
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
function buildBookingInstalmentSchedule(input) {
|
|
1333
|
+
const totalAmountCents = Math.max(0, input.totalAmountCents);
|
|
1334
|
+
switch (input.plan.kind) {
|
|
1335
|
+
case "deposit_plus_one_remainder": {
|
|
1336
|
+
const depositAmountCents = resolveBookingInitialInstalmentAmountCents(input);
|
|
1337
|
+
const remainderAmountCents = Math.max(0, totalAmountCents - depositAmountCents);
|
|
1338
|
+
return omitZeroAmountFutureRows([createScheduleRow({
|
|
1339
|
+
sequence: 1,
|
|
1340
|
+
stateAtBooking: "paid_today",
|
|
1341
|
+
dueAt: input.anchorAt,
|
|
1342
|
+
amountCents: depositAmountCents
|
|
1343
|
+
}), createScheduleRow({
|
|
1344
|
+
sequence: 2,
|
|
1345
|
+
stateAtBooking: "scheduled",
|
|
1346
|
+
dueAt: addIntervalPreservingMonthAnchor(input.anchorAt, input.plan.remainderDueCount, input.plan.intervalUnit),
|
|
1347
|
+
amountCents: remainderAmountCents
|
|
1348
|
+
})]);
|
|
1349
|
+
}
|
|
1350
|
+
case "deposit_plus_scheduled_instalments": {
|
|
1351
|
+
const plan = input.plan;
|
|
1352
|
+
const depositAmountCents = resolveBookingInitialInstalmentAmountCents(input);
|
|
1353
|
+
const instalmentAmounts = splitAmountWithRemainderInFirst(Math.max(0, totalAmountCents - depositAmountCents), plan.instalmentCount);
|
|
1354
|
+
return omitZeroAmountFutureRows([createScheduleRow({
|
|
1355
|
+
sequence: 1,
|
|
1356
|
+
stateAtBooking: "paid_today",
|
|
1357
|
+
dueAt: input.anchorAt,
|
|
1358
|
+
amountCents: depositAmountCents
|
|
1359
|
+
}), ...instalmentAmounts.map((amountCents, index) => createScheduleRow({
|
|
1360
|
+
sequence: index + 2,
|
|
1361
|
+
stateAtBooking: "scheduled",
|
|
1362
|
+
dueAt: addIntervalPreservingMonthAnchor(input.anchorAt, plan.intervalCount * (index + 1), plan.intervalUnit),
|
|
1363
|
+
amountCents
|
|
1364
|
+
}))]);
|
|
1365
|
+
}
|
|
1366
|
+
case "equal_scheduled_instalments": {
|
|
1367
|
+
const plan = input.plan;
|
|
1368
|
+
return omitZeroAmountFutureRows(splitAmountWithRemainderInFirst(totalAmountCents, plan.instalmentCount).map((amountCents, index) => createScheduleRow({
|
|
1369
|
+
sequence: index + 1,
|
|
1370
|
+
stateAtBooking: index === 0 ? "paid_today" : "scheduled",
|
|
1371
|
+
dueAt: index === 0 ? input.anchorAt : addIntervalPreservingMonthAnchor(input.anchorAt, plan.intervalCount * index, plan.intervalUnit),
|
|
1372
|
+
amountCents
|
|
1373
|
+
})));
|
|
1374
|
+
}
|
|
1375
|
+
default: return assertNever$2(input.plan);
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
function createScheduleRow(input) {
|
|
1379
|
+
return {
|
|
1380
|
+
id: `payment-${input.sequence}`,
|
|
1381
|
+
sequence: input.sequence,
|
|
1382
|
+
stateAtBooking: input.stateAtBooking,
|
|
1383
|
+
dueAt: input.dueAt,
|
|
1384
|
+
amountCents: input.amountCents
|
|
1385
|
+
};
|
|
1386
|
+
}
|
|
1387
|
+
//#endregion
|
|
1388
|
+
//#region ../commerce/src/purchase/checkoutPaymentFlow.ts
|
|
1389
|
+
function planCheckoutPaymentFlow(options) {
|
|
1390
|
+
const amountDueCents = toNonNegativeCents(options.amountDueCents);
|
|
1391
|
+
const discountCents = toNonNegativeCents(options.discountCents);
|
|
1392
|
+
const availableCreditCents = toNonNegativeCents(options.availableCreditCents);
|
|
1393
|
+
const minimumStripeChargeCents = toNonNegativeCents(options.minimumStripeChargeCents ?? 0);
|
|
1394
|
+
if (amountDueCents <= 0) return {
|
|
1395
|
+
kind: "bypass",
|
|
1396
|
+
bypassReason: discountCents > 0 ? "discount_free" : "free",
|
|
1397
|
+
reserveCreditCents: 0
|
|
1398
|
+
};
|
|
1399
|
+
if (!options.creditCurrencyMatches || availableCreditCents <= 0) return {
|
|
1400
|
+
kind: "stripe",
|
|
1401
|
+
reserveCreditCents: toNonNegativeCents(0)
|
|
1402
|
+
};
|
|
1403
|
+
if (availableCreditCents >= amountDueCents) return {
|
|
1404
|
+
kind: "store_credit_only",
|
|
1405
|
+
reserveCreditCents: amountDueCents
|
|
1406
|
+
};
|
|
1407
|
+
return {
|
|
1408
|
+
kind: "stripe",
|
|
1409
|
+
reserveCreditCents: planMixedPaymentCreditReservation({
|
|
1410
|
+
amountDueCents,
|
|
1411
|
+
availableCreditCents,
|
|
1412
|
+
minimumStripeChargeCents
|
|
1413
|
+
})
|
|
1414
|
+
};
|
|
1415
|
+
}
|
|
1416
|
+
function planMixedPaymentCreditReservation(input) {
|
|
1417
|
+
const chargeAfterFullCredit = input.amountDueCents - input.availableCreditCents;
|
|
1418
|
+
if (input.minimumStripeChargeCents <= 0 || chargeAfterFullCredit <= 0 || chargeAfterFullCredit >= input.minimumStripeChargeCents) return input.availableCreditCents;
|
|
1419
|
+
if (input.amountDueCents < input.minimumStripeChargeCents) return toNonNegativeCents(0);
|
|
1420
|
+
return toNonNegativeCents(input.amountDueCents - input.minimumStripeChargeCents);
|
|
1421
|
+
}
|
|
1422
|
+
/**
|
|
1423
|
+
* Apply site credit to a flexible-balance booking before card payment.
|
|
1424
|
+
*
|
|
1425
|
+
* Credit first reduces the configured payment due now. Once that payment is
|
|
1426
|
+
* covered, any remaining credit reduces the later balance. If a partial credit
|
|
1427
|
+
* application would leave a positive card charge below Stripe's minimum, less
|
|
1428
|
+
* credit is used so the configured payment can still be collected.
|
|
1429
|
+
*/
|
|
1430
|
+
function planFlexibleBalanceCreditFirst(input) {
|
|
1431
|
+
const totalCents = toNonNegativeCents(input.totalAfterDiscountCents);
|
|
1432
|
+
const configuredDueNowCents = toNonNegativeCents(Math.min(input.configuredPaymentDueNowCents, totalCents));
|
|
1433
|
+
const availableCreditCents = toNonNegativeCents(input.creditCurrencyMatches ? input.availableCreditCents : 0);
|
|
1434
|
+
const minimumStripeChargeCents = toNonNegativeCents(input.minimumStripeChargeCents ?? 0);
|
|
1435
|
+
if (availableCreditCents >= totalCents && totalCents > 0) return {
|
|
1436
|
+
kind: "credit_only",
|
|
1437
|
+
reserveCreditCents: totalCents,
|
|
1438
|
+
cardDueNowCents: toNonNegativeCents(0),
|
|
1439
|
+
laterBalanceCents: toNonNegativeCents(0)
|
|
1440
|
+
};
|
|
1441
|
+
let reserveCreditCents = toNonNegativeCents(Math.min(availableCreditCents, totalCents));
|
|
1442
|
+
if (reserveCreditCents >= configuredDueNowCents) return {
|
|
1443
|
+
kind: "flexible_balance",
|
|
1444
|
+
reserveCreditCents,
|
|
1445
|
+
cardDueNowCents: toNonNegativeCents(0),
|
|
1446
|
+
laterBalanceCents: toNonNegativeCents(totalCents - reserveCreditCents)
|
|
1447
|
+
};
|
|
1448
|
+
const plannedCardDueNowCents = toNonNegativeCents(configuredDueNowCents - reserveCreditCents);
|
|
1449
|
+
if (plannedCardDueNowCents > 0 && plannedCardDueNowCents < minimumStripeChargeCents) {
|
|
1450
|
+
if (configuredDueNowCents < minimumStripeChargeCents) return {
|
|
1451
|
+
kind: "card_below_minimum",
|
|
1452
|
+
reserveCreditCents: toNonNegativeCents(0),
|
|
1453
|
+
cardDueNowCents: configuredDueNowCents,
|
|
1454
|
+
laterBalanceCents: toNonNegativeCents(totalCents - configuredDueNowCents)
|
|
1455
|
+
};
|
|
1456
|
+
reserveCreditCents = toNonNegativeCents(configuredDueNowCents - minimumStripeChargeCents);
|
|
1457
|
+
}
|
|
1458
|
+
const cardDueNowCents = toNonNegativeCents(configuredDueNowCents - reserveCreditCents);
|
|
1459
|
+
return {
|
|
1460
|
+
kind: "flexible_balance",
|
|
1461
|
+
reserveCreditCents,
|
|
1462
|
+
cardDueNowCents,
|
|
1463
|
+
laterBalanceCents: toNonNegativeCents(totalCents - reserveCreditCents - cardDueNowCents)
|
|
1464
|
+
};
|
|
1465
|
+
}
|
|
1466
|
+
//#endregion
|
|
1467
|
+
//#region ../commerce/src/purchase/settlement.ts
|
|
1468
|
+
function normalizeCurrencyCode(raw) {
|
|
1469
|
+
const normalized = raw.trim().toUpperCase();
|
|
1470
|
+
if (!/^[A-Z]{3}$/.test(normalized)) throw new Error(`Invalid currency code: ${raw}`);
|
|
1471
|
+
return normalized;
|
|
1472
|
+
}
|
|
1473
|
+
//#endregion
|
|
1474
|
+
//#region ../commerce/src/purchase/checkoutSessionMetadata.ts
|
|
1475
|
+
const datedOfferingSharedEngineMetadataShape = {
|
|
1476
|
+
datedOfferingEngineContractVersion: z.literal("shared_v1"),
|
|
1477
|
+
datedOfferingEngineRouteKind: z.literal("shared_whole_series_registration"),
|
|
1478
|
+
datedOfferingCapacityHoldId: z.string().uuid(),
|
|
1479
|
+
datedOfferingCapacityHoldAuditRef: z.string().uuid(),
|
|
1480
|
+
customerId: z.string().uuid(),
|
|
1481
|
+
eventSeriesId: z.string().uuid()
|
|
1482
|
+
};
|
|
1483
|
+
z.object(datedOfferingSharedEngineMetadataShape);
|
|
1484
|
+
const orderCheckoutSessionMetadataBaseShape = {
|
|
1485
|
+
type: z.literal("order"),
|
|
1486
|
+
site_id: z.string().uuid(),
|
|
1487
|
+
order_id: z.string().uuid().optional(),
|
|
1488
|
+
customer_email: z.string().email().optional(),
|
|
1489
|
+
customer_name: z.string().optional(),
|
|
1490
|
+
product_id: z.string().uuid().optional(),
|
|
1491
|
+
attendee_id: z.string().uuid().optional(),
|
|
1492
|
+
occurrence_id: z.string().uuid().optional(),
|
|
1493
|
+
tickets_count: z.string().optional(),
|
|
1494
|
+
notes: z.string().optional(),
|
|
1495
|
+
discount_redemption_id: z.string().uuid().optional(),
|
|
1496
|
+
discount_code_id: z.string().uuid().optional(),
|
|
1497
|
+
discount_code: z.string().optional(),
|
|
1498
|
+
discount_public_label: z.string().optional(),
|
|
1499
|
+
credit_reservation_id: z.string().uuid().optional(),
|
|
1500
|
+
credit_reserved_cents: z.string().optional(),
|
|
1501
|
+
discount_code_amount_cents: z.string().optional(),
|
|
1502
|
+
order_payment_reason: z.enum([
|
|
1503
|
+
"instalment_payoff",
|
|
1504
|
+
"flexible_balance_initial",
|
|
1505
|
+
"flexible_balance_paydown"
|
|
1506
|
+
]).optional(),
|
|
1507
|
+
order_payment_plan_id: z.string().uuid().optional(),
|
|
1508
|
+
order_flexible_balance_contract_id: z.string().uuid().optional()
|
|
1509
|
+
};
|
|
1510
|
+
const absentDatedOfferingSharedEngineMetadataShape = {
|
|
1511
|
+
datedOfferingEngineContractVersion: z.never().optional(),
|
|
1512
|
+
datedOfferingEngineRouteKind: z.never().optional(),
|
|
1513
|
+
datedOfferingCapacityHoldId: z.never().optional(),
|
|
1514
|
+
datedOfferingCapacityHoldAuditRef: z.never().optional(),
|
|
1515
|
+
customerId: z.never().optional(),
|
|
1516
|
+
eventSeriesId: z.never().optional()
|
|
1517
|
+
};
|
|
1518
|
+
const LegacyOrderCheckoutSessionMetadataSchema = z.object({
|
|
1519
|
+
...orderCheckoutSessionMetadataBaseShape,
|
|
1520
|
+
...absentDatedOfferingSharedEngineMetadataShape
|
|
1521
|
+
});
|
|
1522
|
+
const SharedDatedOfferingOrderCheckoutSessionMetadataSchema = z.object({
|
|
1523
|
+
...orderCheckoutSessionMetadataBaseShape,
|
|
1524
|
+
...datedOfferingSharedEngineMetadataShape
|
|
1525
|
+
});
|
|
1526
|
+
z.union([SharedDatedOfferingOrderCheckoutSessionMetadataSchema, LegacyOrderCheckoutSessionMetadataSchema]);
|
|
1527
|
+
//#endregion
|
|
1528
|
+
//#region ../commerce/src/purchase/stripeCommissionMetadata.ts
|
|
1529
|
+
/** Reasons are payment evidence, not an independent pricing policy. */
|
|
1530
|
+
const STRIPE_COMMISSION_FREE_REASONS = [
|
|
1531
|
+
"managed_billing",
|
|
1532
|
+
"no_commission_plan",
|
|
1533
|
+
"billing_evidence_invalid",
|
|
1534
|
+
"fee_rounds_to_zero",
|
|
1535
|
+
"payment_not_stripe"
|
|
1536
|
+
];
|
|
1537
|
+
const historicalContext = {
|
|
1538
|
+
currency: z.string().refine((value) => parseCurrencyCode(value) !== null).optional(),
|
|
1539
|
+
sourcePlanId: z.string().trim().min(1).optional()
|
|
1540
|
+
};
|
|
1541
|
+
const percentSchema = z.number().finite().min(0).max(100);
|
|
1542
|
+
z.discriminatedUnion("kind", [
|
|
1543
|
+
z.object({
|
|
1544
|
+
kind: z.literal("commission_free"),
|
|
1545
|
+
reason: z.enum(STRIPE_COMMISSION_FREE_REASONS),
|
|
1546
|
+
...historicalContext
|
|
1547
|
+
}),
|
|
1548
|
+
z.object({
|
|
1549
|
+
kind: z.literal("application_fee_amount"),
|
|
1550
|
+
amountCents: z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
|
|
1551
|
+
percent: percentSchema,
|
|
1552
|
+
...historicalContext
|
|
1553
|
+
}),
|
|
1554
|
+
z.object({
|
|
1555
|
+
kind: z.literal("application_fee_percent"),
|
|
1556
|
+
percent: percentSchema,
|
|
1557
|
+
...historicalContext
|
|
1558
|
+
})
|
|
1559
|
+
]);
|
|
1560
|
+
toNonNegativeCents(0);
|
|
1561
|
+
//#endregion
|
|
1562
|
+
//#region ../commerce/src/purchase/stripeMinimumCharge.ts
|
|
1563
|
+
const STRIPE_MINIMUM_CHARGE_CENTS_BY_CURRENCY = {
|
|
1564
|
+
GBP: 30,
|
|
1565
|
+
USD: 50,
|
|
1566
|
+
EUR: 50,
|
|
1567
|
+
AED: 200,
|
|
1568
|
+
AUD: 50,
|
|
1569
|
+
BGN: 100,
|
|
1570
|
+
BRL: 50,
|
|
1571
|
+
CAD: 50,
|
|
1572
|
+
CHF: 50,
|
|
1573
|
+
CZK: 1500,
|
|
1574
|
+
DKK: 250,
|
|
1575
|
+
HKD: 400,
|
|
1576
|
+
HUF: 17500,
|
|
1577
|
+
JPY: 50,
|
|
1578
|
+
MXN: 1e3,
|
|
1579
|
+
MYR: 200,
|
|
1580
|
+
NOK: 300,
|
|
1581
|
+
NZD: 50,
|
|
1582
|
+
PLN: 200,
|
|
1583
|
+
RON: 200,
|
|
1584
|
+
SEK: 300,
|
|
1585
|
+
SGD: 50,
|
|
1586
|
+
THB: 1e3
|
|
1587
|
+
};
|
|
1588
|
+
function isStripeMinimumChargeCurrency(currency) {
|
|
1589
|
+
return currency in STRIPE_MINIMUM_CHARGE_CENTS_BY_CURRENCY;
|
|
1590
|
+
}
|
|
1591
|
+
function getStripeMinimumChargeRequirement(rawCurrency) {
|
|
1592
|
+
let currency;
|
|
1593
|
+
try {
|
|
1594
|
+
currency = normalizeCurrencyCode(rawCurrency);
|
|
1595
|
+
} catch {
|
|
1596
|
+
return null;
|
|
1597
|
+
}
|
|
1598
|
+
const currencyKey = currency;
|
|
1599
|
+
if (!isStripeMinimumChargeCurrency(currencyKey)) return null;
|
|
1600
|
+
return {
|
|
1601
|
+
currency,
|
|
1602
|
+
minimumAmountCents: STRIPE_MINIMUM_CHARGE_CENTS_BY_CURRENCY[currencyKey]
|
|
1603
|
+
};
|
|
1604
|
+
}
|
|
1605
|
+
//#endregion
|
|
1606
|
+
//#region ../commerce/src/purchase/checkoutCopy.ts
|
|
1607
|
+
/**
|
|
1608
|
+
* Customer copy shared by checkout surfaces, so one approved wording reaches
|
|
1609
|
+
* every place that shows it.
|
|
1610
|
+
*/
|
|
1611
|
+
const checkoutCopy = {
|
|
1612
|
+
/** A payment is still being confirmed; checking again is safe. */
|
|
1613
|
+
checkoutStillConfirming: "We’re still confirming your payment. This can take a minute – you can check again, and you won’t be charged twice.",
|
|
1614
|
+
/** A previous attempt can't be confirmed automatically; the business needs to check it. */
|
|
1615
|
+
checkoutAssistanceRequired: "We can’t confirm your last payment attempt yet. Please don’t pay again – contact the business so they can check it."
|
|
1616
|
+
};
|
|
1617
|
+
//#endregion
|
|
1618
|
+
//#region ../commerce/src/purchase/event-registration-errors.ts
|
|
1619
|
+
const eventRegistrationErrors = {
|
|
1620
|
+
registrationClosed: {
|
|
1621
|
+
message: "Booking is currently closed for this event. Please contact the organiser if you’d like to find out more.",
|
|
1622
|
+
action: "none"
|
|
1623
|
+
},
|
|
1624
|
+
paymentInvestigationRequired: {
|
|
1625
|
+
message: "We still can’t confirm your payment. Please don’t make another payment. Contact the organiser so they can check your booking.",
|
|
1626
|
+
action: "none"
|
|
1627
|
+
},
|
|
1628
|
+
paymentProviderUnavailable: {
|
|
1629
|
+
message: "We couldn’t reach the payment provider. Please try again in a minute.",
|
|
1630
|
+
action: "retry"
|
|
1631
|
+
},
|
|
1632
|
+
paymentHostUnavailable: {
|
|
1633
|
+
message: "Card payments aren’t available on this web address yet. Please contact the organiser to book.",
|
|
1634
|
+
action: "none"
|
|
1635
|
+
},
|
|
1636
|
+
checkoutTemporarilyUnavailable: {
|
|
1637
|
+
message: "Event payments are temporarily unavailable while we make an update. Please try again later.",
|
|
1638
|
+
action: "retry"
|
|
1639
|
+
},
|
|
1640
|
+
paymentPageUnavailable: {
|
|
1641
|
+
message: "We couldn’t open the payment page. Please refresh this page and try again. If this keeps happening, contact the organiser for help.",
|
|
1642
|
+
action: "retry"
|
|
1643
|
+
},
|
|
1644
|
+
paymentUnavailable: {
|
|
1645
|
+
message: "Online payment is not available for this event right now. Please contact the organiser for help with booking.",
|
|
1646
|
+
action: "none"
|
|
1647
|
+
},
|
|
1648
|
+
capacityChanged: {
|
|
1649
|
+
message: "Sorry, there aren’t enough places left for your selection. Please check the available places and choose again.",
|
|
1650
|
+
action: "places"
|
|
1651
|
+
},
|
|
1652
|
+
selectionChanged: {
|
|
1653
|
+
message: "The booking options for this event have changed. Please check the latest options and choose your places again.",
|
|
1654
|
+
action: "places"
|
|
1655
|
+
},
|
|
1656
|
+
registrationPreparationChanged: {
|
|
1657
|
+
message: "The booking options for this event have changed. Please check the latest options and choose your places again.",
|
|
1658
|
+
action: "places"
|
|
1659
|
+
},
|
|
1660
|
+
registrationAlreadyExists: {
|
|
1661
|
+
message: "You already have a booking for this event. Please check your bookings to see its status. If you need help, contact the organiser.",
|
|
1662
|
+
action: "portal"
|
|
1663
|
+
},
|
|
1664
|
+
holdExpired: {
|
|
1665
|
+
message: "Your reservation has timed out. Please check availability and choose your places again.",
|
|
1666
|
+
action: "start"
|
|
1667
|
+
},
|
|
1668
|
+
waitlistUnavailable: {
|
|
1669
|
+
message: "Sorry, the waiting list place offered in this invitation is no longer available. Please check the event for available places or contact the organiser for help.",
|
|
1670
|
+
action: "event"
|
|
1671
|
+
},
|
|
1672
|
+
paymentContextMismatch: {
|
|
1673
|
+
message: "The payment options for this event have changed. Please check the latest options before continuing.",
|
|
1674
|
+
action: "payment-options"
|
|
1675
|
+
},
|
|
1676
|
+
verificationFailed: {
|
|
1677
|
+
message: "We couldn’t confirm this request came from a person. Please refresh the page and try again.",
|
|
1678
|
+
action: "none"
|
|
1679
|
+
},
|
|
1680
|
+
idempotencyConflict: {
|
|
1681
|
+
message: "You’ve already started booking this event. Please finish in the other tab if it’s still open, or check your booking status before starting again.",
|
|
1682
|
+
action: "portal"
|
|
1683
|
+
},
|
|
1684
|
+
invalidCommitInput: {
|
|
1685
|
+
message: "We couldn’t accept your booking details. Please check the information you entered and try again. If this keeps happening, contact the organiser for help.",
|
|
1686
|
+
action: "details"
|
|
1687
|
+
}
|
|
1688
|
+
};
|
|
1689
|
+
function parseEventRegistrationErrorReason(value) {
|
|
1690
|
+
return typeof value === "string" && Object.prototype.hasOwnProperty.call(eventRegistrationErrors, value) ? value : null;
|
|
1691
|
+
}
|
|
1692
|
+
//#endregion
|
|
1693
|
+
//#region ../commerce/src/purchase/checkoutPresentation.ts
|
|
1694
|
+
function publishableKeyMode(publishableKey) {
|
|
1695
|
+
if (publishableKey.startsWith("pk_live_")) return "live";
|
|
1696
|
+
if (publishableKey.startsWith("pk_test_")) return "test";
|
|
1697
|
+
return null;
|
|
1698
|
+
}
|
|
1699
|
+
function checkBrowserStripeKey(publishableKey, livemode) {
|
|
1700
|
+
const key = publishableKey?.trim();
|
|
1701
|
+
if (!key) return {
|
|
1702
|
+
tag: "unavailable",
|
|
1703
|
+
reason: "missing_key"
|
|
1704
|
+
};
|
|
1705
|
+
const mode = publishableKeyMode(key);
|
|
1706
|
+
if (mode === null) return {
|
|
1707
|
+
tag: "unavailable",
|
|
1708
|
+
reason: "invalid_key"
|
|
1709
|
+
};
|
|
1710
|
+
return mode === (livemode ? "live" : "test") ? {
|
|
1711
|
+
tag: "ready",
|
|
1712
|
+
publishableKey: key
|
|
1713
|
+
} : {
|
|
1714
|
+
tag: "unavailable",
|
|
1715
|
+
reason: "mode_mismatch"
|
|
1716
|
+
};
|
|
1717
|
+
}
|
|
1718
|
+
//#endregion
|
|
1233
1719
|
//#region ../blocks/src/contracts/runtime.ts
|
|
1234
1720
|
function decodeSuccess(value) {
|
|
1235
1721
|
return {
|
|
@@ -1582,7 +2068,7 @@ function resolveAppointmentCheckoutVerificationState(input) {
|
|
|
1582
2068
|
tag: "timeout",
|
|
1583
2069
|
sessionId: input.config.sessionId,
|
|
1584
2070
|
appointmentId,
|
|
1585
|
-
message:
|
|
2071
|
+
message: checkoutCopy.checkoutStillConfirming
|
|
1586
2072
|
};
|
|
1587
2073
|
if (input.pollingStatus === "failed") {
|
|
1588
2074
|
if (paymentStatus === "refunded") return {
|
|
@@ -1817,19 +2303,17 @@ function getBookingServicePaymentSelectionMode(service) {
|
|
|
1817
2303
|
if (service?.paymentTermsAvailability?.kind === "pending_stripe_setup") return "pending_stripe_setup";
|
|
1818
2304
|
const allowedKinds = service?.paymentTerms?.allowedOptions.map((option) => option.kind) ?? [];
|
|
1819
2305
|
if (allowedKinds.length === 0) return "implicit_upfront";
|
|
1820
|
-
if (allowedKinds.
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
2306
|
+
if (!validateBookingPaymentOptionKinds(allowedKinds).ok) return "unsupported";
|
|
2307
|
+
if (allowedKinds.length > 1) return "choice_required";
|
|
2308
|
+
const onlyKind = allowedKinds[0];
|
|
2309
|
+
switch (onlyKind) {
|
|
2310
|
+
case "upfront": return "implicit_upfront";
|
|
2311
|
+
case "deferred_manual": return "implicit_deferred_manual";
|
|
2312
|
+
case "instalment_plan": return "implicit_instalment_plan";
|
|
2313
|
+
case "flexible_balance": return "implicit_flexible_balance";
|
|
2314
|
+
case void 0: return "unsupported";
|
|
2315
|
+
default: return assertNever$1(onlyKind);
|
|
1830
2316
|
}
|
|
1831
|
-
if (allowedKinds.length === 2 && allowedKinds.includes("upfront") && (allowedKinds.includes("deferred_manual") || allowedKinds.includes("instalment_plan") || allowedKinds.includes("flexible_balance"))) return "choice_required";
|
|
1832
|
-
return "unsupported";
|
|
1833
2317
|
}
|
|
1834
2318
|
function resolveDefaultBookingServiceId(formConfig, services) {
|
|
1835
2319
|
const configuredServiceId = toTrimmedString(formConfig?.settings?.serviceId);
|
|
@@ -2146,68 +2630,115 @@ const bookingSourceFormSchema = z.object({
|
|
|
2146
2630
|
updatedAt: z.string()
|
|
2147
2631
|
});
|
|
2148
2632
|
//#endregion
|
|
2149
|
-
//#region ../
|
|
2150
|
-
const
|
|
2151
|
-
const
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
intervalUnit: z.enum([
|
|
2158
|
-
"day",
|
|
2159
|
-
"week",
|
|
2160
|
-
"month"
|
|
2161
|
-
])
|
|
2162
|
-
}),
|
|
2163
|
-
z.object({
|
|
2164
|
-
kind: z.literal("deposit_plus_scheduled_instalments"),
|
|
2165
|
-
depositAmountCents: z.number().int().min(0),
|
|
2166
|
-
depositRefundability: bookingDepositRefundPolicySchema,
|
|
2167
|
-
instalmentCount: z.number().int().positive(),
|
|
2168
|
-
intervalCount: z.number().int().positive(),
|
|
2169
|
-
intervalUnit: z.enum([
|
|
2170
|
-
"day",
|
|
2171
|
-
"week",
|
|
2172
|
-
"month"
|
|
2173
|
-
])
|
|
2174
|
-
}),
|
|
2175
|
-
z.object({
|
|
2176
|
-
kind: z.literal("equal_scheduled_instalments"),
|
|
2177
|
-
instalmentCount: z.number().int().positive(),
|
|
2178
|
-
intervalCount: z.number().int().positive(),
|
|
2179
|
-
intervalUnit: z.enum([
|
|
2180
|
-
"day",
|
|
2181
|
-
"week",
|
|
2182
|
-
"month"
|
|
2183
|
-
])
|
|
2184
|
-
})
|
|
2633
|
+
//#region ../core/src/booking-payment-schemas.ts
|
|
2634
|
+
const stripObject = (shape) => z.object(shape);
|
|
2635
|
+
const strictObject = (shape) => z.strictObject(shape);
|
|
2636
|
+
const depositRefundPolicySchema = z.enum(["refundable", "non_refundable"]);
|
|
2637
|
+
const intervalUnitSchema = z.enum([
|
|
2638
|
+
"day",
|
|
2639
|
+
"week",
|
|
2640
|
+
"month"
|
|
2185
2641
|
]);
|
|
2186
|
-
const
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2642
|
+
const nonNegativeIntegerSchema = z.number().int().nonnegative();
|
|
2643
|
+
const positiveIntegerSchema = z.number().int().positive();
|
|
2644
|
+
function createInstalmentPlanSchema(object) {
|
|
2645
|
+
return z.discriminatedUnion("kind", [
|
|
2646
|
+
object({
|
|
2647
|
+
kind: z.literal("deposit_plus_one_remainder"),
|
|
2648
|
+
depositAmountCents: nonNegativeIntegerSchema,
|
|
2649
|
+
depositRefundability: depositRefundPolicySchema,
|
|
2650
|
+
remainderDueCount: positiveIntegerSchema,
|
|
2651
|
+
intervalUnit: intervalUnitSchema
|
|
2652
|
+
}),
|
|
2653
|
+
object({
|
|
2654
|
+
kind: z.literal("deposit_plus_scheduled_instalments"),
|
|
2655
|
+
depositAmountCents: nonNegativeIntegerSchema,
|
|
2656
|
+
depositRefundability: depositRefundPolicySchema,
|
|
2657
|
+
instalmentCount: positiveIntegerSchema,
|
|
2658
|
+
intervalCount: positiveIntegerSchema,
|
|
2659
|
+
intervalUnit: intervalUnitSchema
|
|
2660
|
+
}),
|
|
2661
|
+
object({
|
|
2662
|
+
kind: z.literal("equal_scheduled_instalments"),
|
|
2663
|
+
instalmentCount: positiveIntegerSchema,
|
|
2664
|
+
intervalCount: positiveIntegerSchema,
|
|
2665
|
+
intervalUnit: intervalUnitSchema
|
|
2666
|
+
})
|
|
2667
|
+
]);
|
|
2668
|
+
}
|
|
2669
|
+
function createFlexibleBalanceSchemas(object) {
|
|
2670
|
+
const dueDateRule = z.discriminatedUnion("kind", [object({
|
|
2671
|
+
kind: z.literal("relative_to_start_date"),
|
|
2672
|
+
daysBeforeStart: positiveIntegerSchema
|
|
2673
|
+
}), object({
|
|
2674
|
+
kind: z.literal("fixed_calendar_date"),
|
|
2675
|
+
dueAt: z.string().datetime()
|
|
2676
|
+
})]);
|
|
2677
|
+
return {
|
|
2678
|
+
dueDateRule,
|
|
2679
|
+
config: object({
|
|
2680
|
+
upfrontAmountCents: nonNegativeIntegerSchema,
|
|
2681
|
+
dueDateRule,
|
|
2682
|
+
depositRefundability: depositRefundPolicySchema
|
|
2683
|
+
})
|
|
2684
|
+
};
|
|
2685
|
+
}
|
|
2686
|
+
const paymentOptionKindsMessages = {
|
|
2687
|
+
no_options: "Choose at least one way for customers to pay.",
|
|
2688
|
+
duplicate_kind: "Choose each payment option only once.",
|
|
2689
|
+
incompatible_collection_options: "Offer instalments or a deposit with the rest paid later, but not both."
|
|
2690
|
+
};
|
|
2691
|
+
function buildBookingPaymentOptionSchemas(object) {
|
|
2692
|
+
const instalmentPlan = createInstalmentPlanSchema(object);
|
|
2693
|
+
const flexibleBalance = createFlexibleBalanceSchemas(object);
|
|
2694
|
+
const paymentCollectionOption = z.discriminatedUnion("kind", [
|
|
2695
|
+
object({ kind: z.literal("upfront") }),
|
|
2696
|
+
object({ kind: z.literal("deferred_manual") }),
|
|
2697
|
+
object({
|
|
2698
|
+
kind: z.literal("instalment_plan"),
|
|
2699
|
+
plan: instalmentPlan
|
|
2700
|
+
}),
|
|
2701
|
+
object({
|
|
2702
|
+
kind: z.literal("flexible_balance"),
|
|
2703
|
+
config: flexibleBalance.config
|
|
2704
|
+
})
|
|
2705
|
+
]);
|
|
2706
|
+
const paymentTerms = object({ allowedOptions: z.array(paymentCollectionOption) }).superRefine(({ allowedOptions }, ctx) => {
|
|
2707
|
+
const result = validateBookingPaymentOptionKinds(allowedOptions.map(({ kind }) => kind));
|
|
2708
|
+
if (!result.ok) ctx.addIssue({
|
|
2709
|
+
code: "custom",
|
|
2710
|
+
path: ["allowedOptions"],
|
|
2711
|
+
message: paymentOptionKindsMessages[result.error]
|
|
2712
|
+
});
|
|
2713
|
+
});
|
|
2714
|
+
const paymentOptionsChoice = z.discriminatedUnion("source", [z.strictObject({ source: z.literal("default") }), z.strictObject({
|
|
2715
|
+
source: z.literal("custom"),
|
|
2716
|
+
paymentTerms
|
|
2717
|
+
})]);
|
|
2718
|
+
return {
|
|
2719
|
+
depositRefundPolicy: depositRefundPolicySchema,
|
|
2720
|
+
instalmentPlan,
|
|
2721
|
+
flexibleBalanceDueDateRule: flexibleBalance.dueDateRule,
|
|
2722
|
+
flexibleBalanceConfig: flexibleBalance.config,
|
|
2723
|
+
paymentCollectionOption,
|
|
2724
|
+
paymentTerms,
|
|
2725
|
+
paymentOptionsChoice
|
|
2726
|
+
};
|
|
2727
|
+
}
|
|
2728
|
+
function createBookingPaymentOptionSchemas(mode) {
|
|
2729
|
+
return mode === "strict" ? buildBookingPaymentOptionSchemas(strictObject) : buildBookingPaymentOptionSchemas(stripObject);
|
|
2730
|
+
}
|
|
2731
|
+
const bookingPaymentOptionSchemas = createBookingPaymentOptionSchemas("strip");
|
|
2732
|
+
bookingPaymentOptionSchemas.depositRefundPolicy;
|
|
2733
|
+
bookingPaymentOptionSchemas.instalmentPlan;
|
|
2734
|
+
bookingPaymentOptionSchemas.flexibleBalanceDueDateRule;
|
|
2735
|
+
bookingPaymentOptionSchemas.flexibleBalanceConfig;
|
|
2736
|
+
bookingPaymentOptionSchemas.paymentCollectionOption;
|
|
2737
|
+
const bookingPaymentTermsSchema = bookingPaymentOptionSchemas.paymentTerms;
|
|
2738
|
+
bookingPaymentOptionSchemas.paymentOptionsChoice;
|
|
2739
|
+
//#endregion
|
|
2740
|
+
//#region ../blocks/src/system/blocks/shared/bookingPaymentTerms.ts
|
|
2741
|
+
const blockBookingPaymentTermsSchema = bookingPaymentTermsSchema;
|
|
2211
2742
|
//#endregion
|
|
2212
2743
|
//#region ../blocks/src/system/runtime/nodes/booking-form.interactive.ts
|
|
2213
2744
|
const blockBookingPaymentTermsAvailabilitySchema = z.union([z.object({
|
|
@@ -2663,125 +3194,110 @@ function validateUniqueDeclaredCardVariantRoles(system, ctx) {
|
|
|
2663
3194
|
}
|
|
2664
3195
|
const cardSystemSchema = z.object({ variants: z.array(cardVariantSchema).min(1).max(3) }).superRefine(validateUniqueDeclaredCardVariantRoles).transform((system) => ({ variants: withInferredRoles(system.variants) }));
|
|
2665
3196
|
//#endregion
|
|
2666
|
-
//#region ../theme-core/src/
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
const
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
z.literal(180),
|
|
2684
|
-
z.literal(270)
|
|
2685
|
-
]);
|
|
2686
|
-
const rectSchema = z.tuple([
|
|
2687
|
-
z.number(),
|
|
2688
|
-
z.number(),
|
|
2689
|
-
z.number(),
|
|
2690
|
-
z.number()
|
|
2691
|
-
]);
|
|
2692
|
-
const aspectCropSchema = z.object({
|
|
2693
|
-
aspect: z.preprocess((value) => value == null ? void 0 : value, z.string().optional()),
|
|
2694
|
-
rect: z.preprocess((value) => value == null ? void 0 : value, rectSchema.optional()),
|
|
2695
|
-
hotspot: z.preprocess((value) => value == null ? void 0 : value, hotspotSchema.optional()),
|
|
2696
|
-
rotation: z.preprocess((value) => value == null ? void 0 : value, rotationSchema.optional())
|
|
2697
|
-
});
|
|
2698
|
-
const transformSchema = z.object({
|
|
2699
|
-
aspectCrops: z.preprocess((value) => {
|
|
2700
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) return;
|
|
2701
|
-
return value;
|
|
2702
|
-
}, z.record(z.string(), aspectCropSchema.catch({}))).optional(),
|
|
2703
|
-
rect: rectSchema.optional(),
|
|
2704
|
-
hotspot: hotspotSchema.optional(),
|
|
2705
|
-
rotation: rotationSchema.optional()
|
|
2706
|
-
});
|
|
2707
|
-
const mediaPosterSchema = z.discriminatedUnion("tag", [z.object({
|
|
2708
|
-
tag: z.literal("storage"),
|
|
2709
|
-
assetId: z.string().optional(),
|
|
2710
|
-
storageBucket: z.string().min(1),
|
|
2711
|
-
storagePath: z.string().min(1)
|
|
2712
|
-
}), z.object({
|
|
2713
|
-
tag: z.literal("external-src"),
|
|
2714
|
-
assetId: z.string().optional(),
|
|
2715
|
-
src: z.string().url()
|
|
2716
|
-
})]);
|
|
2717
|
-
const mediaBaseSchema = z.object({
|
|
2718
|
-
purpose: z.string().optional(),
|
|
2719
|
-
placeholder: z.boolean().default(true).optional(),
|
|
2720
|
-
assetId: z.string().optional(),
|
|
2721
|
-
identifier: z.string().optional(),
|
|
2722
|
-
src: z.string().optional(),
|
|
2723
|
-
alt: z.string().optional(),
|
|
2724
|
-
filename: z.string().optional(),
|
|
2725
|
-
mimeType: z.string().optional(),
|
|
2726
|
-
width: z.number().optional(),
|
|
2727
|
-
height: z.number().optional(),
|
|
2728
|
-
storageBucket: z.string().optional(),
|
|
2729
|
-
storagePath: z.string().optional(),
|
|
2730
|
-
poster: mediaPosterSchema.optional(),
|
|
2731
|
-
transform: transformSchema.optional()
|
|
2732
|
-
});
|
|
2733
|
-
const mediaIdentifierSchema = z.string().trim().min(1).brand();
|
|
2734
|
-
const imageMediaSchema = mediaBaseSchema.extend({ type: z.literal("image") });
|
|
2735
|
-
const videoMediaSchema = mediaBaseSchema.extend({ type: z.literal("video") });
|
|
2736
|
-
const audioMediaSchema = mediaBaseSchema.extend({ type: z.literal("audio") });
|
|
2737
|
-
const documentMediaSchema = mediaBaseSchema.extend({ type: z.literal("document") });
|
|
2738
|
-
const spreadsheetMediaSchema = mediaBaseSchema.extend({ type: z.literal("spreadsheet") });
|
|
2739
|
-
const archiveMediaSchema = mediaBaseSchema.extend({ type: z.literal("archive") });
|
|
2740
|
-
const mediaSchema = z.discriminatedUnion("type", [
|
|
2741
|
-
imageMediaSchema,
|
|
2742
|
-
videoMediaSchema,
|
|
2743
|
-
audioMediaSchema,
|
|
2744
|
-
documentMediaSchema,
|
|
2745
|
-
spreadsheetMediaSchema,
|
|
2746
|
-
archiveMediaSchema
|
|
3197
|
+
//#region ../theme-core/src/utils/tokenOrColor.ts
|
|
3198
|
+
/**
|
|
3199
|
+
* Runtime color-reference fields intentionally accept any string, including
|
|
3200
|
+
* the legacy empty-string "no color" sentinel. Semantic validation needs
|
|
3201
|
+
* palette context and happens in `parseThemeColorReference`.
|
|
3202
|
+
*/
|
|
3203
|
+
const tokenOrCssColorValueSchema = z.string();
|
|
3204
|
+
const CSS_COLOR_FUNCTION_PATTERN = /^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix|light-dark)\(/i;
|
|
3205
|
+
const CSS_HEX_COLOR_PATTERN = /^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;
|
|
3206
|
+
const CSS_COLOR_KEYWORDS = /* @__PURE__ */ new Set([
|
|
3207
|
+
"transparent",
|
|
3208
|
+
"currentcolor",
|
|
3209
|
+
"inherit",
|
|
3210
|
+
"initial",
|
|
3211
|
+
"revert",
|
|
3212
|
+
"revert-layer",
|
|
3213
|
+
"unset"
|
|
2747
3214
|
]);
|
|
2748
|
-
const
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
3215
|
+
const COMMON_CSS_NAMED_COLORS = /* @__PURE__ */ new Set([
|
|
3216
|
+
"black",
|
|
3217
|
+
"blue",
|
|
3218
|
+
"gray",
|
|
3219
|
+
"green",
|
|
3220
|
+
"grey",
|
|
3221
|
+
"orange",
|
|
3222
|
+
"pink",
|
|
3223
|
+
"purple",
|
|
3224
|
+
"red",
|
|
3225
|
+
"white",
|
|
3226
|
+
"yellow"
|
|
2756
3227
|
]);
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
const
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
}
|
|
2769
|
-
const
|
|
2770
|
-
|
|
2771
|
-
ctx.addIssue({
|
|
2772
|
-
code: "custom",
|
|
2773
|
-
message: `Invalid complete palette: ${colors.error.kind}`
|
|
2774
|
-
});
|
|
2775
|
-
return z.NEVER;
|
|
2776
|
-
}
|
|
3228
|
+
function isCssColorLiteral(value) {
|
|
3229
|
+
const trimmed = value.trim();
|
|
3230
|
+
if (!trimmed) return false;
|
|
3231
|
+
return CSS_HEX_COLOR_PATTERN.test(trimmed) || CSS_COLOR_FUNCTION_PATTERN.test(trimmed) || /^var\(/i.test(trimmed) || CSS_COLOR_KEYWORDS.has(trimmed.toLowerCase());
|
|
3232
|
+
}
|
|
3233
|
+
function parseThemeToken(token) {
|
|
3234
|
+
const trimmed = token.trim();
|
|
3235
|
+
const match = trimmed.match(/^(.*?)-(\d{2,3})$/);
|
|
3236
|
+
if (!match) return {
|
|
3237
|
+
role: trimmed,
|
|
3238
|
+
shade: null
|
|
3239
|
+
};
|
|
3240
|
+
const role = match[1] ?? trimmed;
|
|
3241
|
+
const shade = match[2] ? Number(match[2]) : null;
|
|
2777
3242
|
return {
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
hex: String(hex)
|
|
2781
|
-
})),
|
|
2782
|
-
meta: palette.meta
|
|
3243
|
+
role,
|
|
3244
|
+
shade: Number.isFinite(shade) ? shade : null
|
|
2783
3245
|
};
|
|
2784
|
-
}
|
|
3246
|
+
}
|
|
3247
|
+
function parseContextThemeColorToken(value, context) {
|
|
3248
|
+
const parts = parseColorTokenParts(value);
|
|
3249
|
+
if (parts.kind !== "token") return null;
|
|
3250
|
+
if (!(Boolean(context?.palette?.[value.trim()]) || parts.opacityPercent !== null && Boolean(context?.palette?.[parts.token]))) return null;
|
|
3251
|
+
return value.trim();
|
|
3252
|
+
}
|
|
3253
|
+
function isTokenShapedTypo(value) {
|
|
3254
|
+
if (COMMON_CSS_NAMED_COLORS.has(value.toLowerCase())) return false;
|
|
3255
|
+
if (!/^[a-zA-Z][a-zA-Z0-9]*(?:-[a-zA-Z0-9]+)*(?:\/[^/]+)?$/.test(value)) return false;
|
|
3256
|
+
return !isCssColorLiteral(value);
|
|
3257
|
+
}
|
|
3258
|
+
function warnUnknownThemeColorReference(value) {
|
|
3259
|
+
if (!isTokenShapedTypo(value)) return;
|
|
3260
|
+
console.warn(`[theme-core] Unknown Theme V2 color token "${value}" treated as literal CSS. Use raw:* for deliberate custom CSS values.`);
|
|
3261
|
+
}
|
|
3262
|
+
function parseThemeColorReference(input, context) {
|
|
3263
|
+
const trimmed = input.trim();
|
|
3264
|
+
if (trimmed.startsWith("raw:")) return {
|
|
3265
|
+
kind: "literal-css",
|
|
3266
|
+
value: trimmed.slice(4)
|
|
3267
|
+
};
|
|
3268
|
+
const contextToken = parseContextThemeColorToken(trimmed, context);
|
|
3269
|
+
if (contextToken) return {
|
|
3270
|
+
kind: "palette-context-token",
|
|
3271
|
+
token: contextToken
|
|
3272
|
+
};
|
|
3273
|
+
const knownToken = parseThemeColorToken(trimmed);
|
|
3274
|
+
if (knownToken) return {
|
|
3275
|
+
kind: "theme-token",
|
|
3276
|
+
token: knownToken
|
|
3277
|
+
};
|
|
3278
|
+
warnUnknownThemeColorReference(trimmed);
|
|
3279
|
+
return {
|
|
3280
|
+
kind: "literal-css",
|
|
3281
|
+
value: trimmed
|
|
3282
|
+
};
|
|
3283
|
+
}
|
|
3284
|
+
function resolveThemeColorReferenceValue(input, context) {
|
|
3285
|
+
const reference = parseThemeColorReference(input, context);
|
|
3286
|
+
return reference.kind === "literal-css" ? reference.value : rgbColorValue(reference.token);
|
|
3287
|
+
}
|
|
3288
|
+
function resolveTokenOrCssColorValue(input, context) {
|
|
3289
|
+
return resolveThemeColorReferenceValue(input, context);
|
|
3290
|
+
}
|
|
3291
|
+
function resolveOnColorForThemeToken(token) {
|
|
3292
|
+
if (!parseThemeColorToken(token)) return null;
|
|
3293
|
+
const parts = parseColorTokenParts(token);
|
|
3294
|
+
if (parts.kind !== "token") return null;
|
|
3295
|
+
const { role, shade } = parseThemeToken(parts.token);
|
|
3296
|
+
const normalizedRole = role.trim();
|
|
3297
|
+
if (!normalizedRole) return null;
|
|
3298
|
+
if (!shade) return rgbColorValue(`on${normalizedRole.charAt(0).toUpperCase() + normalizedRole.slice(1)}`);
|
|
3299
|
+
return shade <= 400 ? "#000000" : "#FFFFFF";
|
|
3300
|
+
}
|
|
2785
3301
|
//#endregion
|
|
2786
3302
|
//#region ../theme-core/src/buttons/types.ts
|
|
2787
3303
|
/**
|
|
@@ -3189,6 +3705,126 @@ const buttonSystemSchema = z.strictObject({
|
|
|
3189
3705
|
});
|
|
3190
3706
|
});
|
|
3191
3707
|
//#endregion
|
|
3708
|
+
//#region ../theme-core/src/footer/mode.ts
|
|
3709
|
+
const footerModeSchema = z.enum([
|
|
3710
|
+
"default",
|
|
3711
|
+
"blocks",
|
|
3712
|
+
"default+blocks",
|
|
3713
|
+
"none"
|
|
3714
|
+
]);
|
|
3715
|
+
//#endregion
|
|
3716
|
+
//#region ../theme-core/src/lib/media.ts
|
|
3717
|
+
const hotspotSchema = z.object({
|
|
3718
|
+
x: z.number().min(0).max(1),
|
|
3719
|
+
y: z.number().min(0).max(1),
|
|
3720
|
+
radius: z.number().optional()
|
|
3721
|
+
});
|
|
3722
|
+
const rotationSchema = z.union([
|
|
3723
|
+
z.literal(0),
|
|
3724
|
+
z.literal(90),
|
|
3725
|
+
z.literal(180),
|
|
3726
|
+
z.literal(270)
|
|
3727
|
+
]);
|
|
3728
|
+
const rectSchema = z.tuple([
|
|
3729
|
+
z.number(),
|
|
3730
|
+
z.number(),
|
|
3731
|
+
z.number(),
|
|
3732
|
+
z.number()
|
|
3733
|
+
]);
|
|
3734
|
+
const aspectCropSchema = z.object({
|
|
3735
|
+
aspect: z.preprocess((value) => value == null ? void 0 : value, z.string().optional()),
|
|
3736
|
+
rect: z.preprocess((value) => value == null ? void 0 : value, rectSchema.optional()),
|
|
3737
|
+
hotspot: z.preprocess((value) => value == null ? void 0 : value, hotspotSchema.optional()),
|
|
3738
|
+
rotation: z.preprocess((value) => value == null ? void 0 : value, rotationSchema.optional())
|
|
3739
|
+
});
|
|
3740
|
+
const transformSchema = z.object({
|
|
3741
|
+
aspectCrops: z.preprocess((value) => {
|
|
3742
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return;
|
|
3743
|
+
return value;
|
|
3744
|
+
}, z.record(z.string(), aspectCropSchema.catch({}))).optional(),
|
|
3745
|
+
rect: rectSchema.optional(),
|
|
3746
|
+
hotspot: hotspotSchema.optional(),
|
|
3747
|
+
rotation: rotationSchema.optional()
|
|
3748
|
+
});
|
|
3749
|
+
const mediaPosterSchema = z.discriminatedUnion("tag", [z.object({
|
|
3750
|
+
tag: z.literal("storage"),
|
|
3751
|
+
assetId: z.string().optional(),
|
|
3752
|
+
storageBucket: z.string().min(1),
|
|
3753
|
+
storagePath: z.string().min(1)
|
|
3754
|
+
}), z.object({
|
|
3755
|
+
tag: z.literal("external-src"),
|
|
3756
|
+
assetId: z.string().optional(),
|
|
3757
|
+
src: z.string().url()
|
|
3758
|
+
})]);
|
|
3759
|
+
const mediaBaseSchema = z.object({
|
|
3760
|
+
purpose: z.string().optional(),
|
|
3761
|
+
placeholder: z.boolean().default(true).optional(),
|
|
3762
|
+
assetId: z.string().optional(),
|
|
3763
|
+
identifier: z.string().optional(),
|
|
3764
|
+
src: z.string().optional(),
|
|
3765
|
+
alt: z.string().optional(),
|
|
3766
|
+
filename: z.string().optional(),
|
|
3767
|
+
mimeType: z.string().optional(),
|
|
3768
|
+
width: z.number().optional(),
|
|
3769
|
+
height: z.number().optional(),
|
|
3770
|
+
storageBucket: z.string().optional(),
|
|
3771
|
+
storagePath: z.string().optional(),
|
|
3772
|
+
poster: mediaPosterSchema.optional(),
|
|
3773
|
+
transform: transformSchema.optional()
|
|
3774
|
+
});
|
|
3775
|
+
const mediaIdentifierSchema = z.string().trim().min(1).brand();
|
|
3776
|
+
const imageMediaSchema = mediaBaseSchema.extend({ type: z.literal("image") });
|
|
3777
|
+
const videoMediaSchema = mediaBaseSchema.extend({ type: z.literal("video") });
|
|
3778
|
+
const audioMediaSchema = mediaBaseSchema.extend({ type: z.literal("audio") });
|
|
3779
|
+
const documentMediaSchema = mediaBaseSchema.extend({ type: z.literal("document") });
|
|
3780
|
+
const spreadsheetMediaSchema = mediaBaseSchema.extend({ type: z.literal("spreadsheet") });
|
|
3781
|
+
const archiveMediaSchema = mediaBaseSchema.extend({ type: z.literal("archive") });
|
|
3782
|
+
const mediaSchema = z.discriminatedUnion("type", [
|
|
3783
|
+
imageMediaSchema,
|
|
3784
|
+
videoMediaSchema,
|
|
3785
|
+
audioMediaSchema,
|
|
3786
|
+
documentMediaSchema,
|
|
3787
|
+
spreadsheetMediaSchema,
|
|
3788
|
+
archiveMediaSchema
|
|
3789
|
+
]);
|
|
3790
|
+
const persistableMediaBaseSchema = mediaBaseSchema.extend({ identifier: mediaIdentifierSchema });
|
|
3791
|
+
z.discriminatedUnion("type", [
|
|
3792
|
+
persistableMediaBaseSchema.extend({ type: z.literal("image") }),
|
|
3793
|
+
persistableMediaBaseSchema.extend({ type: z.literal("video") }),
|
|
3794
|
+
persistableMediaBaseSchema.extend({ type: z.literal("audio") }),
|
|
3795
|
+
persistableMediaBaseSchema.extend({ type: z.literal("document") }),
|
|
3796
|
+
persistableMediaBaseSchema.extend({ type: z.literal("spreadsheet") }),
|
|
3797
|
+
persistableMediaBaseSchema.extend({ type: z.literal("archive") })
|
|
3798
|
+
]);
|
|
3799
|
+
//#endregion
|
|
3800
|
+
//#region ../theme-core/src/palette/schema.ts
|
|
3801
|
+
const colourHexString = z.string().regex(/^#([0-9A-Fa-f]{3}){1,2}$/);
|
|
3802
|
+
const paletteColorSchema = z.object({
|
|
3803
|
+
name: z.string().min(1),
|
|
3804
|
+
hex: colourHexString
|
|
3805
|
+
});
|
|
3806
|
+
const paletteMetaSchema = z.object({ mode: z.enum(["light", "dark"]) });
|
|
3807
|
+
const paletteSchema = z.object({
|
|
3808
|
+
colors: z.array(paletteColorSchema),
|
|
3809
|
+
meta: paletteMetaSchema
|
|
3810
|
+
}).transform((palette, ctx) => {
|
|
3811
|
+
const colors = paletteColorsFromEntries(palette.colors);
|
|
3812
|
+
if (!colors.ok) {
|
|
3813
|
+
ctx.addIssue({
|
|
3814
|
+
code: "custom",
|
|
3815
|
+
message: `Invalid complete palette: ${colors.error.kind}`
|
|
3816
|
+
});
|
|
3817
|
+
return z.NEVER;
|
|
3818
|
+
}
|
|
3819
|
+
return {
|
|
3820
|
+
colors: paletteColorEntries(colors.colors).map(({ name, hex }) => ({
|
|
3821
|
+
name: String(name),
|
|
3822
|
+
hex: String(hex)
|
|
3823
|
+
})),
|
|
3824
|
+
meta: palette.meta
|
|
3825
|
+
};
|
|
3826
|
+
});
|
|
3827
|
+
//#endregion
|
|
3192
3828
|
//#region ../theme-core/src/buttons/classNames.ts
|
|
3193
3829
|
function themeButtonVariantClassNames(variant) {
|
|
3194
3830
|
if (variant === "default") return [variant];
|
|
@@ -3250,111 +3886,6 @@ function shadeBackgroundEffect(config) {
|
|
|
3250
3886
|
}
|
|
3251
3887
|
};
|
|
3252
3888
|
}
|
|
3253
|
-
//#endregion
|
|
3254
|
-
//#region ../theme-core/src/utils/tokenOrColor.ts
|
|
3255
|
-
/**
|
|
3256
|
-
* Runtime color-reference fields intentionally accept any string, including
|
|
3257
|
-
* the legacy empty-string "no color" sentinel. Semantic validation needs
|
|
3258
|
-
* palette context and happens in `parseThemeColorReference`.
|
|
3259
|
-
*/
|
|
3260
|
-
const tokenOrCssColorValueSchema = z.string();
|
|
3261
|
-
const CSS_COLOR_FUNCTION_PATTERN = /^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix|light-dark)\(/i;
|
|
3262
|
-
const CSS_HEX_COLOR_PATTERN = /^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;
|
|
3263
|
-
const CSS_COLOR_KEYWORDS = /* @__PURE__ */ new Set([
|
|
3264
|
-
"transparent",
|
|
3265
|
-
"currentcolor",
|
|
3266
|
-
"inherit",
|
|
3267
|
-
"initial",
|
|
3268
|
-
"revert",
|
|
3269
|
-
"revert-layer",
|
|
3270
|
-
"unset"
|
|
3271
|
-
]);
|
|
3272
|
-
const COMMON_CSS_NAMED_COLORS = /* @__PURE__ */ new Set([
|
|
3273
|
-
"black",
|
|
3274
|
-
"blue",
|
|
3275
|
-
"gray",
|
|
3276
|
-
"green",
|
|
3277
|
-
"grey",
|
|
3278
|
-
"orange",
|
|
3279
|
-
"pink",
|
|
3280
|
-
"purple",
|
|
3281
|
-
"red",
|
|
3282
|
-
"white",
|
|
3283
|
-
"yellow"
|
|
3284
|
-
]);
|
|
3285
|
-
function isCssColorLiteral(value) {
|
|
3286
|
-
const trimmed = value.trim();
|
|
3287
|
-
if (!trimmed) return false;
|
|
3288
|
-
return CSS_HEX_COLOR_PATTERN.test(trimmed) || CSS_COLOR_FUNCTION_PATTERN.test(trimmed) || /^var\(/i.test(trimmed) || CSS_COLOR_KEYWORDS.has(trimmed.toLowerCase());
|
|
3289
|
-
}
|
|
3290
|
-
function parseThemeToken(token) {
|
|
3291
|
-
const trimmed = token.trim();
|
|
3292
|
-
const match = trimmed.match(/^(.*?)-(\d{2,3})$/);
|
|
3293
|
-
if (!match) return {
|
|
3294
|
-
role: trimmed,
|
|
3295
|
-
shade: null
|
|
3296
|
-
};
|
|
3297
|
-
const role = match[1] ?? trimmed;
|
|
3298
|
-
const shade = match[2] ? Number(match[2]) : null;
|
|
3299
|
-
return {
|
|
3300
|
-
role,
|
|
3301
|
-
shade: Number.isFinite(shade) ? shade : null
|
|
3302
|
-
};
|
|
3303
|
-
}
|
|
3304
|
-
function parseContextThemeColorToken(value, context) {
|
|
3305
|
-
const parts = parseColorTokenParts(value);
|
|
3306
|
-
if (parts.kind !== "token") return null;
|
|
3307
|
-
if (!(Boolean(context?.palette?.[value.trim()]) || parts.opacityPercent !== null && Boolean(context?.palette?.[parts.token]))) return null;
|
|
3308
|
-
return value.trim();
|
|
3309
|
-
}
|
|
3310
|
-
function isTokenShapedTypo(value) {
|
|
3311
|
-
if (COMMON_CSS_NAMED_COLORS.has(value.toLowerCase())) return false;
|
|
3312
|
-
if (!/^[a-zA-Z][a-zA-Z0-9]*(?:-[a-zA-Z0-9]+)*(?:\/[^/]+)?$/.test(value)) return false;
|
|
3313
|
-
return !isCssColorLiteral(value);
|
|
3314
|
-
}
|
|
3315
|
-
function warnUnknownThemeColorReference(value) {
|
|
3316
|
-
if (!isTokenShapedTypo(value)) return;
|
|
3317
|
-
console.warn(`[theme-core] Unknown Theme V2 color token "${value}" treated as literal CSS. Use raw:* for deliberate custom CSS values.`);
|
|
3318
|
-
}
|
|
3319
|
-
function parseThemeColorReference(input, context) {
|
|
3320
|
-
const trimmed = input.trim();
|
|
3321
|
-
if (trimmed.startsWith("raw:")) return {
|
|
3322
|
-
kind: "literal-css",
|
|
3323
|
-
value: trimmed.slice(4)
|
|
3324
|
-
};
|
|
3325
|
-
const contextToken = parseContextThemeColorToken(trimmed, context);
|
|
3326
|
-
if (contextToken) return {
|
|
3327
|
-
kind: "palette-context-token",
|
|
3328
|
-
token: contextToken
|
|
3329
|
-
};
|
|
3330
|
-
const knownToken = parseThemeColorToken(trimmed);
|
|
3331
|
-
if (knownToken) return {
|
|
3332
|
-
kind: "theme-token",
|
|
3333
|
-
token: knownToken
|
|
3334
|
-
};
|
|
3335
|
-
warnUnknownThemeColorReference(trimmed);
|
|
3336
|
-
return {
|
|
3337
|
-
kind: "literal-css",
|
|
3338
|
-
value: trimmed
|
|
3339
|
-
};
|
|
3340
|
-
}
|
|
3341
|
-
function resolveThemeColorReferenceValue(input, context) {
|
|
3342
|
-
const reference = parseThemeColorReference(input, context);
|
|
3343
|
-
return reference.kind === "literal-css" ? reference.value : rgbColorValue(reference.token);
|
|
3344
|
-
}
|
|
3345
|
-
function resolveTokenOrCssColorValue(input, context) {
|
|
3346
|
-
return resolveThemeColorReferenceValue(input, context);
|
|
3347
|
-
}
|
|
3348
|
-
function resolveOnColorForThemeToken(token) {
|
|
3349
|
-
if (!parseThemeColorToken(token)) return null;
|
|
3350
|
-
const parts = parseColorTokenParts(token);
|
|
3351
|
-
if (parts.kind !== "token") return null;
|
|
3352
|
-
const { role, shade } = parseThemeToken(parts.token);
|
|
3353
|
-
const normalizedRole = role.trim();
|
|
3354
|
-
if (!normalizedRole) return null;
|
|
3355
|
-
if (!shade) return rgbColorValue(`on${normalizedRole.charAt(0).toUpperCase() + normalizedRole.slice(1)}`);
|
|
3356
|
-
return shade <= 400 ? "#000000" : "#FFFFFF";
|
|
3357
|
-
}
|
|
3358
3889
|
buttonSizeNameSchema.options;
|
|
3359
3890
|
//#endregion
|
|
3360
3891
|
//#region ../theme-core/src/buttons/styles/domain.ts
|
|
@@ -6037,12 +6568,22 @@ const mediaPresentationSchema = commonSchema.extend({
|
|
|
6037
6568
|
const boxBackgroundSchema = z.discriminatedUnion("type", [
|
|
6038
6569
|
commonSchema.extend({
|
|
6039
6570
|
type: z.literal("color"),
|
|
6040
|
-
color: tokenOrCssColorValueSchema.nullable().optional()
|
|
6571
|
+
color: tokenOrCssColorValueSchema.nullable().optional(),
|
|
6572
|
+
/**
|
|
6573
|
+
* Compiler-owned. The scrim a site-style colour surface lays over media
|
|
6574
|
+
* that replaces it (a Look's band meeting an authored photo), sized so the
|
|
6575
|
+
* surface's foreground stays legible over any pixel. A colour background
|
|
6576
|
+
* never draws it itself; `resolveSectionBackground` moves it onto the
|
|
6577
|
+
* merged media background as its overlay.
|
|
6578
|
+
*/
|
|
6579
|
+
mediaScrim: boxBackgroundOverlaySchema.nullable().optional()
|
|
6041
6580
|
}),
|
|
6042
6581
|
commonSchema.extend({
|
|
6043
6582
|
type: z.literal("gradient"),
|
|
6044
6583
|
gradient: z.string().nullable().optional(),
|
|
6045
|
-
gradientPresetId: z.string().min(1).nullable().optional()
|
|
6584
|
+
gradientPresetId: z.string().min(1).nullable().optional(),
|
|
6585
|
+
/** Compiler-owned; see the colour branch. */
|
|
6586
|
+
mediaScrim: boxBackgroundOverlaySchema.nullable().optional()
|
|
6046
6587
|
}),
|
|
6047
6588
|
mediaPresentationSchema.extend({
|
|
6048
6589
|
type: z.literal("image"),
|
|
@@ -8127,7 +8668,7 @@ const publicPassProductCollectionSchema = z.object({ passes: z.array(publicPassP
|
|
|
8127
8668
|
/**
|
|
8128
8669
|
* Public membership product for shop display
|
|
8129
8670
|
*/
|
|
8130
|
-
const
|
|
8671
|
+
const publicMembershipProductFields = {
|
|
8131
8672
|
id: z.string(),
|
|
8132
8673
|
name: z.string(),
|
|
8133
8674
|
description: z.string().nullable(),
|
|
@@ -8136,7 +8677,16 @@ const publicMembershipProductSchema = z.object({
|
|
|
8136
8677
|
billingInterval: z.enum(["month", "year"]),
|
|
8137
8678
|
eligibleCategoryIds: z.array(z.string()),
|
|
8138
8679
|
eligibleCategoryNames: z.array(z.string())
|
|
8680
|
+
};
|
|
8681
|
+
const purchasablePublicMembershipProductSchema = z.object({
|
|
8682
|
+
...publicMembershipProductFields,
|
|
8683
|
+
purchaseAvailability: z.literal("purchasable")
|
|
8139
8684
|
});
|
|
8685
|
+
const publicMembershipProductSchema = z.discriminatedUnion("purchaseAvailability", [purchasablePublicMembershipProductSchema, z.object({
|
|
8686
|
+
...publicMembershipProductFields,
|
|
8687
|
+
purchaseAvailability: z.literal("display_only"),
|
|
8688
|
+
unavailabilityReason: z.literal("online_payments_unavailable")
|
|
8689
|
+
})]);
|
|
8140
8690
|
const publicMembershipProductCollectionSchema = z.object({ memberships: z.array(publicMembershipProductSchema) });
|
|
8141
8691
|
//#endregion
|
|
8142
8692
|
//#region ../blocks/src/system/node/schema.ts
|
|
@@ -10961,15 +11511,36 @@ const eventCombinedInteractiveIslandPropsCodec = createInteractiveIslandCodec({
|
|
|
10961
11511
|
});
|
|
10962
11512
|
//#endregion
|
|
10963
11513
|
//#region ../blocks/src/system/runtime/nodes/event-registration/wizardSteps.ts
|
|
10964
|
-
/**
|
|
10965
|
-
|
|
10966
|
-
|
|
10967
|
-
|
|
10968
|
-
|
|
10969
|
-
|
|
10970
|
-
|
|
10971
|
-
|
|
10972
|
-
|
|
11514
|
+
/** Recovery uses the form surface without adding a progress step. */
|
|
11515
|
+
function getRegistrationStepPresentation(step, progressSteps) {
|
|
11516
|
+
switch (step) {
|
|
11517
|
+
case "select-event":
|
|
11518
|
+
case "select-tickets":
|
|
11519
|
+
case "enter-details":
|
|
11520
|
+
case "select-payment": return {
|
|
11521
|
+
isWizardStep: true,
|
|
11522
|
+
totalSteps: progressSteps.length
|
|
11523
|
+
};
|
|
11524
|
+
case "fully-booked": return {
|
|
11525
|
+
isWizardStep: true,
|
|
11526
|
+
totalSteps: 0
|
|
11527
|
+
};
|
|
11528
|
+
case "error":
|
|
11529
|
+
case "success":
|
|
11530
|
+
case "submitting":
|
|
11531
|
+
case "payment": return {
|
|
11532
|
+
isWizardStep: true,
|
|
11533
|
+
totalSteps: progressSteps.length
|
|
11534
|
+
};
|
|
11535
|
+
case "verifying-payment":
|
|
11536
|
+
case "verifying-timeout":
|
|
11537
|
+
case "payment-status":
|
|
11538
|
+
case "payment-failed": return {
|
|
11539
|
+
isWizardStep: false,
|
|
11540
|
+
totalSteps: 0
|
|
11541
|
+
};
|
|
11542
|
+
}
|
|
11543
|
+
}
|
|
10973
11544
|
/**
|
|
10974
11545
|
* Determine which wizard steps to show based on context and payment requirements.
|
|
10975
11546
|
*
|
|
@@ -10977,14 +11548,18 @@ const WIZARD_STEPS = [
|
|
|
10977
11548
|
* @param needsPaymentStep - Whether user must complete payment method selection
|
|
10978
11549
|
* @returns Array of wizard steps to display
|
|
10979
11550
|
*/
|
|
10980
|
-
function getWizardStepsForContext(hasPreSelectedContext, needsPaymentStep) {
|
|
11551
|
+
function getWizardStepsForContext(hasPreSelectedContext, needsPaymentStep, paymentActive = false) {
|
|
10981
11552
|
const baseSteps = hasPreSelectedContext ? ["select-tickets", "enter-details"] : [
|
|
10982
11553
|
"select-event",
|
|
10983
11554
|
"select-tickets",
|
|
10984
11555
|
"enter-details"
|
|
10985
11556
|
];
|
|
10986
11557
|
if (!needsPaymentStep) return baseSteps;
|
|
10987
|
-
return [
|
|
11558
|
+
return paymentActive ? [
|
|
11559
|
+
...baseSteps,
|
|
11560
|
+
"select-payment",
|
|
11561
|
+
"payment"
|
|
11562
|
+
] : [...baseSteps, "select-payment"];
|
|
10988
11563
|
}
|
|
10989
11564
|
/**
|
|
10990
11565
|
* Map wizard step to step number based on the active wizard steps
|
|
@@ -11161,6 +11736,7 @@ const EVENT_REGISTRATION_SHELL_STEP_LABELS = [
|
|
|
11161
11736
|
"Date",
|
|
11162
11737
|
"Tickets",
|
|
11163
11738
|
"Details",
|
|
11739
|
+
"Payment options",
|
|
11164
11740
|
"Payment"
|
|
11165
11741
|
];
|
|
11166
11742
|
const eventRegistrationPublicEventSchema = z.preprocess(normalizeEventRegistrationEventInput, publicEventSchema);
|
|
@@ -11304,12 +11880,13 @@ function shellLabelForRegistrationStep(step, events) {
|
|
|
11304
11880
|
switch (step) {
|
|
11305
11881
|
case "select-event": return isDateSelection(events) ? "Date" : "Event";
|
|
11306
11882
|
case "select-tickets": return "Tickets";
|
|
11883
|
+
case "fully-booked":
|
|
11307
11884
|
case "enter-details": return "Details";
|
|
11308
|
-
case "select-payment": return "Payment";
|
|
11885
|
+
case "select-payment": return "Payment options";
|
|
11886
|
+
case "payment": return "Payment";
|
|
11309
11887
|
case "error":
|
|
11310
11888
|
case "success":
|
|
11311
11889
|
case "submitting":
|
|
11312
|
-
case "redirecting":
|
|
11313
11890
|
case "verifying-payment":
|
|
11314
11891
|
case "verifying-timeout":
|
|
11315
11892
|
case "payment-status":
|
|
@@ -11321,7 +11898,7 @@ function isDateSelection(events) {
|
|
|
11321
11898
|
return Boolean(events.length > 1 && firstSeriesId && events.every((event) => event.seriesId === firstSeriesId));
|
|
11322
11899
|
}
|
|
11323
11900
|
function buildEventRegistrationShellBodyText(stepLabels) {
|
|
11324
|
-
if (stepLabels.includes("Payment")) return "Preparing tickets, details, and payment options.";
|
|
11901
|
+
if (stepLabels.includes("Payment options")) return "Preparing tickets, details, and payment options.";
|
|
11325
11902
|
if (stepLabels[0] === "Tickets") return "Preparing tickets and booking details.";
|
|
11326
11903
|
return "Preparing dates, tickets, and booking details.";
|
|
11327
11904
|
}
|
|
@@ -11910,14 +12487,14 @@ function projectNewsletterFormHydrationTarget(source) {
|
|
|
11910
12487
|
tag: "block-source",
|
|
11911
12488
|
sourceRef: null
|
|
11912
12489
|
};
|
|
11913
|
-
default: return assertNever$
|
|
12490
|
+
default: return assertNever$4(source.newsletterBlockSubmission);
|
|
11914
12491
|
}
|
|
11915
12492
|
case "signed-footer": return {
|
|
11916
12493
|
tag: "signed-footer-source",
|
|
11917
12494
|
sourceRef: source.sourceRef
|
|
11918
12495
|
};
|
|
11919
12496
|
case "preview": return { tag: "preview" };
|
|
11920
|
-
default: return assertNever$
|
|
12497
|
+
default: return assertNever$4(source);
|
|
11921
12498
|
}
|
|
11922
12499
|
}
|
|
11923
12500
|
function resolveRuntimeChoices(context, targeting) {
|
|
@@ -12340,7 +12917,7 @@ function buildPassesMembershipsDisplay(options) {
|
|
|
12340
12917
|
product: pass
|
|
12341
12918
|
} : {
|
|
12342
12919
|
kind: "unavailable",
|
|
12343
|
-
label: "Online purchasing
|
|
12920
|
+
label: "Online purchasing is unavailable."
|
|
12344
12921
|
}
|
|
12345
12922
|
};
|
|
12346
12923
|
});
|
|
@@ -12350,7 +12927,14 @@ function buildPassesMembershipsDisplay(options) {
|
|
|
12350
12927
|
description: options.showDescriptions ? membership.description : null,
|
|
12351
12928
|
priceLabel: formatCommercePrice(membership.price, membership.currency),
|
|
12352
12929
|
intervalLabel: formatInterval(membership.billingInterval),
|
|
12353
|
-
|
|
12930
|
+
action: membership.purchaseAvailability === "purchasable" ? {
|
|
12931
|
+
kind: "purchase",
|
|
12932
|
+
label: options.membershipActionLabel,
|
|
12933
|
+
product: membership
|
|
12934
|
+
} : {
|
|
12935
|
+
kind: "unavailable",
|
|
12936
|
+
label: "Online purchasing is unavailable."
|
|
12937
|
+
}
|
|
12354
12938
|
}));
|
|
12355
12939
|
return {
|
|
12356
12940
|
kind: "passes-memberships",
|
|
@@ -12570,7 +13154,14 @@ const membershipCardDisplaySchema = z.object({
|
|
|
12570
13154
|
description: z.string().nullable(),
|
|
12571
13155
|
priceLabel: z.string(),
|
|
12572
13156
|
intervalLabel: z.string(),
|
|
12573
|
-
|
|
13157
|
+
action: z.discriminatedUnion("kind", [z.object({
|
|
13158
|
+
kind: z.literal("purchase"),
|
|
13159
|
+
label: z.string(),
|
|
13160
|
+
product: purchasablePublicMembershipProductSchema
|
|
13161
|
+
}), z.object({
|
|
13162
|
+
kind: z.literal("unavailable"),
|
|
13163
|
+
label: z.string()
|
|
13164
|
+
})])
|
|
12574
13165
|
});
|
|
12575
13166
|
const passesMembershipsDisplaySchema = z.object({
|
|
12576
13167
|
kind: z.literal("passes-memberships"),
|
|
@@ -12907,4 +13498,4 @@ function defineIslandPropsDecoder(kind) {
|
|
|
12907
13498
|
};
|
|
12908
13499
|
}
|
|
12909
13500
|
//#endregion
|
|
12910
|
-
export { getContainerClass as $,
|
|
13501
|
+
export { getContainerClass as $, parseEventRegistrationErrorReason as $t, buildEventCalendarListingRender as A, publicEventPricingOptions as An, isBookingServiceSlidingAmountInRange as At, calendarWindowBounds as B, BOOKING_FORM_DATA_RESERVED_KEYS as Bt, resolveDiscountContext as C, getBookingInstalmentDepositRefundability as Cn, formatBookingSubmissionPreparationError as Ct, getRegistrationStepPresentation as D, isPublicEventPricingOptionDisplayable as Dn, getBookingSuccessCopy as Dt, toRegistrationRequestSubject as E, formatEventPricing as En, getBookingServiceSlidingScale as Et, resolveSpacing as F, resolveBookingSiteId as Ft, createHostedBlockApiConfig as G, clearWorkflowFeedback as Gt, calendarWindowPageSchema as H, RichTextDocSchema as Ht, calendarMonthDate as I, resolveDefaultBookingServiceId as It, getEventRuntimeFiltersKey as J, okWith as Jt, getBlockApiReadStage as K, err as Kt, calendarMonthKey as L, toSelectedCollectionOptionKind as Lt, resolveEventRegistrationScopedEvents as M, publicEventPricingType as Mn, prepareBookingSubmission as Mt, SEMANTIC_SPACING_VALUES as N, formatCurrencyAmount as Nn, resolveAppointmentCheckoutVerificationState as Nt, getStepNumber as O, publicEventPricingCurrency as On, getRegistrationSuccessCopy as Ot, isSemanticSpacing as P, assertNever$4 as Pn, resolveBookingPaymentStep as Pt, getCardOrientation as Q, eventRegistrationErrors as Qt, calendarPageResponseError as R, projectSelectedAppointmentConsentIntoForm as Rt, findPreSelectedEvent as S, toScheduledBookingDateTime as Sn, formatBookingCentsAsCurrencyInput as St, resolveRegistrationTarget as T, formatBookingPriceDisplay as Tn, getBookingServicePaymentSelectionMode as Tt, planCalendarMonthRanges as U, isRecord$5 as Ut, calendarWindowMonths as V, isBookingRequirementConsentFieldId as Vt, resolveCalendarReadProfile as W, assertNever$1 as Wt, normalizeCsvString as X, reportWorkflowSuccess as Xt, normalizeCsvIds as Y, reportWorkflowError as Yt, normalizeOptionalId as Z, checkBrowserStripeKey as Zt, buildEventRegistrationDisplayFromScopedEvents as _, getLocalScheduleDate as _n, resolveOnColorForThemeToken as _t, buildProductDetailDisplay as a, CANCELLED_SESSION_STATUS as an, getDayOfWeek as at, toWholeSeriesRegistrationEvents as b, toBookingTimeZone as bn, logger as bt, EMPTY_COMMERCE_CART_STATE as c, resolveBookingSignupOffer as cn, isSameCalendarDay as ct, deriveCommerceCheckoutState as d, formatBookingDateParts as dn, resolveRuntimeEventDestination as dt, getStripeMinimumChargeRequirement as en, MONTH_NAMES as et, parseStoredCommerceCartState as f, formatBookingDateTime as fn, groupPublicEventsByRun as ft, newsletterBlockSubmissionMessage as g, getBookingLocalDateKey as gn, isCssColorLiteral as gt, NEWSLETTER_SIGNUPS_PAUSED_MESSAGE as h, formatLocalScheduleDate as hn, themeButtonVariantClassNames as ht, buildProductCardDisplay as i, resolveBookingInitialInstalmentAmountCents as in, formatDateKey as it, staticHeaderChromeRuntime as j, publicEventPricingStrategy as jn, parseBookingCurrencyInputToCents as jt, getWizardStepsForContext as k, publicEventPricingDisplay as kn, getShopSuccessCopy as kt, buildPassCartItem as l, addLocalScheduleDays as ln, isToday as lt, reduceCommerceCart as m, formatBookingTime as mn, themeButtonSizeClassName as mt, getShopDisplayForItems as n, planFlexibleBalanceCreditFirst as nn, addMonths as nt, formatCommercePrice as o, resolveWholeSeriesBookingPhase as on, getOrderedDayNames as ot, productItemKey as p, formatBookingInstant as pn, boxBackgroundSchema as pt, buildEventRuntimeFilters as q, ok as qt, buildCartDisplay as r, buildBookingInstalmentSchedule as rn, buildCalendarViewport as rt, formatInterval as s, parseMailingListVisitorSelection as sn, getWeekCalendarDays as st, defineIslandPropsDecoder as t, planCheckoutPaymentFlow as tn, addDays as tt, buildProductCartItem as u, formatBookingDate as un, shiftCalendarAnchorDate as ut, getRegistrationStartAt as v, parseBookingLocalDate as vn, resolveTokenOrCssColorValue as vt, resolveEventRequiresPayment as w, getBookingInstalmentPlanIntervalCount as wn, getBookingRedirectStateFromLocation as wt, findEventByOccurrenceId as x, toScheduledBookingDateRange as xn, deriveBookingFormViewState as xt, toRegistrationEvents as y, resolveBookingTimeZoneId as yn, normalizeCardRole as yt, calendarQueryKey as z, resolveSelectedAppointmentConsent as zt };
|