@riverbankcms/sdk 0.125.0 → 0.126.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.
Files changed (121) hide show
  1. package/README.md +3 -1
  2. package/dist/{PreviewEditorSidebar-BezDOtQ7.mjs → PreviewEditorSidebar-DcYJxTgc.mjs} +67 -266
  3. package/dist/{PreviewEditorUI-CgSqmfo2.mjs → PreviewEditorUI-Ctt1yTJr.mjs} +3 -3
  4. package/dist/{PreviewQueryProvider-BH-3-jSj.mjs → PreviewQueryProvider-DgFDIwvK.mjs} +1 -1
  5. package/dist/{SdkPreviewModeRuntime-Co3AHfj0.mjs → SdkPreviewModeRuntime-CvW1vdQ4.mjs} +27 -27
  6. package/dist/{SiteChromeCustomizeContext-BHF-KANn.mjs → SiteChromeCustomizeContext-C87qlKWw.mjs} +412 -1301
  7. package/dist/_dts/ai/src/contracts/proposals.d.ts +1354 -202
  8. package/dist/_dts/api/src/common/envelope.d.ts +1 -1
  9. package/dist/_dts/api/src/contentRuntime.d.ts +0 -2
  10. package/dist/_dts/api/src/endpoints.d.ts +0 -7
  11. package/dist/_dts/api/src/sdk-event-upsert.d.ts +42 -0
  12. package/dist/_dts/api/src/sdkContracts.d.ts +11 -9
  13. package/dist/_dts/api/src/siteOperations.d.ts +18 -1
  14. package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +1 -14
  15. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationStripeReturn.d.ts +15 -2
  16. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +182 -19
  17. package/dist/_dts/preview-next/src/client/preview/PreviewEditorSidebar.d.ts +1 -2
  18. package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +2 -3
  19. package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +1 -2
  20. package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeContext.d.ts +3 -12
  21. package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.d.ts +3 -13
  22. package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.state.d.ts +8 -100
  23. package/dist/_dts/preview-next/src/client/preview/siteStylePreviewPlanner.d.ts +1 -4
  24. package/dist/_dts/preview-next/src/client/preview/styleConfiguratorApplyPayload.d.ts +1 -15
  25. package/dist/_dts/preview-next/src/client/preview/styleConfiguratorSnapshot.d.ts +11 -21
  26. package/dist/_dts/sdk/src/cli/commands/event.d.ts +2 -2
  27. package/dist/_dts/sdk/src/cli/commands/eventOccurrenceSchedule.d.ts +12 -0
  28. package/dist/_dts/sdk/src/cli/commands/push/pushAllExtras.d.ts +6 -0
  29. package/dist/_dts/sdk/src/cli/commands/style.d.ts +1 -1
  30. package/dist/_dts/sdk/src/cli/content/legacyEventScheduleShapeError.d.ts +5 -0
  31. package/dist/_dts/sdk/src/cli/content/localEventSchedule.d.ts +17 -0
  32. package/dist/_dts/sdk/src/cli/content/reader.d.ts +5 -10
  33. package/dist/_dts/sdk/src/cli/migrations/events.d.ts +1 -1
  34. package/dist/_dts/sdk/src/cli/site-commands/eventScheduleCompiler.d.ts +24 -0
  35. package/dist/_dts/sdk/src/client/management/http.d.ts +1 -1
  36. package/dist/_dts/sdk/src/client/management/types.d.ts +3 -28
  37. package/dist/_dts/sdk/src/config/index.d.ts +1 -1
  38. package/dist/_dts/sdk/src/public-api/contracts.d.ts +5 -20
  39. package/dist/_dts/sdk/src/rendering/index.d.ts +1 -1
  40. package/dist/_dts/sdk/src/version.d.ts +1 -1
  41. package/dist/_dts/site-commands/src/commandContract.d.ts +33 -5
  42. package/dist/_dts/site-commands/src/commandDomain.d.ts +2 -2
  43. package/dist/_dts/site-commands/src/commands.d.ts +38 -9
  44. package/dist/_dts/site-commands/src/siteStyleCommandSchema.d.ts +28 -1
  45. package/dist/_dts/site-commands/src/siteStyleSelectionSchemaBuilder.d.ts +4 -4
  46. package/dist/_dts/theme-core/src/palette/concretePalette.d.ts +20 -0
  47. package/dist/_dts/theme-core/src/palette/curated/index.d.ts +2 -17
  48. package/dist/_dts/theme-core/src/palette/index.d.ts +1 -6
  49. package/dist/_dts/theme-core/src/palette/schema.d.ts +39 -0
  50. package/dist/_dts/theme-core/src/schema.d.ts +38 -26
  51. package/dist/_dts/theme-core/src/site-styles/previewCompiler.d.ts +4 -6
  52. package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +5 -6
  53. package/dist/cli/index.mjs +612 -522
  54. package/dist/cli/init-docs/content/cli-reference.md +6 -3
  55. package/dist/cli/init-docs/content/content-management.md +24 -13
  56. package/dist/client/{DiscountCodeDisclosure-CyPpekBp.mjs → DiscountCodeDisclosure-DS0AuFWW.mjs} +1 -1
  57. package/dist/client/{EventCombined.client-zywit-60.mjs → EventCombined.client-DtMxLr7q.mjs} +2 -2
  58. package/dist/client/{EventListing.client-J2nLhkKT.mjs → EventListing.client-BdLSRNg1.mjs} +2 -2
  59. package/dist/client/{LeafletStaticMap-CSubXWt6.mjs → LeafletStaticMap-BrpC6vsT.mjs} +1 -1
  60. package/dist/client/{MagicLinkForm-DDLIfiq9.mjs → MagicLinkForm-Bt3IuLMy.mjs} +1 -1
  61. package/dist/client/{StepIndicator-DE8EvHIp.mjs → StepIndicator-CBYPFVoy.mjs} +2 -2
  62. package/dist/client/{accordion-Ct5T5NiA.mjs → accordion-BqqwPJWM.mjs} +1 -1
  63. package/dist/client/{bookingForm-DMxtLPxw.mjs → bookingForm-SneP3yxC.mjs} +5 -6
  64. package/dist/client/bookings.mjs +190 -24
  65. package/dist/client/{carousel--FMqgvob.mjs → carousel-BTIR9L3I.mjs} +1 -1
  66. package/dist/client/{cart-BKX1bWiU.mjs → cart-bqiqd8SX.mjs} +3 -3
  67. package/dist/client/{checkout-B_jxi4WW.mjs → checkout-WbTFV5v4.mjs} +3 -3
  68. package/dist/client/client.mjs +156 -220
  69. package/dist/client/{courseRegistration-DH4MlkRD.mjs → courseRegistration-BcemLAdN.mjs} +6 -7
  70. package/dist/client/{eventCalendar-BQILwAcL.mjs → eventCalendar-CsxIw0V_.mjs} +4 -4
  71. package/dist/client/{eventCombined-DFFW_Vmo.mjs → eventCombined-B6XMoHfa.mjs} +2 -2
  72. package/dist/client/{eventDetails-B045CTSJ.mjs → eventDetails-BJaoPPfo.mjs} +3 -3
  73. package/dist/client/{eventListing-BDMYNVzS.mjs → eventListing-DgwdYHRT.mjs} +2 -2
  74. package/dist/client/{eventRegistration-CQ2-BSnB.mjs → eventRegistration-C0O3folu.mjs} +30 -22
  75. package/dist/client/{form-DJKuyZgN.mjs → form-Bk9txGFt.mjs} +1 -1
  76. package/dist/client/{headerSection-DeTjfiDo.mjs → headerSection-yIBt0yTv.mjs} +2 -2
  77. package/dist/client/hooks.mjs +50 -102
  78. package/dist/client/{locationMap-i2wDA8gB.mjs → locationMap-C-3KIpv-.mjs} +2 -2
  79. package/dist/client/{newsletterForm-DKiueauk.mjs → newsletterForm-CzB8g8h2.mjs} +1 -1
  80. package/dist/client/{pricing-C01J3Epx.mjs → pricing-C1QeDes_.mjs} +1 -1
  81. package/dist/client/{productDetail-Dfc1sZaX.mjs → productDetail-w7SBp5uc.mjs} +3 -3
  82. package/dist/client/{productList-BXbvXWTF.mjs → productList-D0tGKHGf.mjs} +3 -3
  83. package/dist/client/{propsDecoder-CIR5DQ1l.mjs → propsDecoder-Bcin2DB3.mjs} +167 -11
  84. package/dist/client/rendering/client.mjs +219 -276
  85. package/dist/client/rendering/islands.mjs +18 -18
  86. package/dist/client/rendering.mjs +128 -185
  87. package/dist/client/{useDiscountCodeUi-Bcyh4508.mjs → scrollToBlock-h-o_STf_.mjs} +18 -2
  88. package/dist/client/{shop-BbNwPKM-.mjs → shop-BGzmL8O_.mjs} +5 -6
  89. package/dist/client/{shop-commerce-XO-XMFEt.mjs → shop-commerce-lX8QxjX-.mjs} +4 -4
  90. package/dist/client/{shop-commerce-store-Byh6OUGK.mjs → shop-commerce-store-CEurARtu.mjs} +1 -1
  91. package/dist/client/{shopShared-Bbq39mwr.mjs → shopShared-DXxH8xxw.mjs} +2 -2
  92. package/dist/client/{useEventFilters-C8OOJ3el.mjs → useEventFilters-B591g9vd.mjs} +2 -2
  93. package/dist/client/{usePolling-CyJVo9kF.mjs → usePolling-BvnChV4m.mjs} +2 -2
  94. package/dist/preview-next/before-render.mjs +0 -7
  95. package/dist/preview-next/client/runtime.mjs +4 -4
  96. package/dist/preview-next/middleware.mjs +0 -7
  97. package/dist/{previewAuthStore-CJX21dGi.mjs → previewAuthStore-Dev9CdG9.mjs} +0 -7
  98. package/dist/{sdk-runtime-BGhyuE-E.mjs → sdk-runtime-M__i3Jce.mjs} +2 -2
  99. package/dist/{separator-BFs-Kmv5.mjs → separator-VSlnI9bc.mjs} +1 -1
  100. package/dist/server/components.mjs +87 -139
  101. package/dist/server/config-validation.mjs +50 -102
  102. package/dist/server/config.mjs +50 -102
  103. package/dist/server/data.mjs +50 -102
  104. package/dist/server/index.mjs +1 -8
  105. package/dist/server/next.mjs +91 -150
  106. package/dist/server/page-converter.mjs +50 -102
  107. package/dist/server/prebuild.mjs +1 -1
  108. package/dist/server/rendering/server.mjs +50 -102
  109. package/dist/server/rendering.mjs +88 -140
  110. package/dist/server/routing.mjs +71 -147
  111. package/dist/server/server.mjs +51 -110
  112. package/dist/server/theme-bridge.mjs +172 -162
  113. package/dist/server/theme.mjs +167 -11
  114. package/package.json +1 -1
  115. package/dist/_dts/theme-core/src/palette/editorState.d.ts +0 -75
  116. package/dist/_dts/theme-core/src/palette/libraryModel.d.ts +0 -64
  117. package/dist/_dts/theme-core/src/palette/persistenceReadSource.d.ts +0 -81
  118. package/dist/_dts/theme-core/src/palette/resolveSelection.d.ts +0 -75
  119. package/dist/_dts/theme-core/src/palette/selection.d.ts +0 -74
  120. package/dist/_dts/theme-core/src/palette/sitePalettePersistence.d.ts +0 -34
  121. package/dist/client/scrollToBlock-C86BYkyV.mjs +0 -17
@@ -953,9 +953,12 @@ calendar date is never accepted as an identity.
953
953
  Cancellation preserves registrations and is idempotent. Deletion requires
954
954
  zero registrations and confirmation (`--yes` for remote or JSON use).
955
955
 
956
- Occurrence collections are deliberately imperative. `pull events` and
957
- `push events` only manage the event-series schedule and never reconcile,
958
- create, or delete individual occurrence rows.
956
+ `pull events` writes the complete non-cancelled occurrence schedule into each
957
+ portable event file. `push events` creates those rows for a new series and
958
+ accepts an exact replay for an existing series. It deliberately rejects
959
+ existing-series additions, removals, or retiming; use the imperative occurrence
960
+ commands for those operational changes. Cancelled occurrence tombstones remain
961
+ in the CMS and are omitted from portable authored content.
959
962
 
960
963
  ### verify
961
964
 
@@ -630,15 +630,23 @@ Footer links are managed via the site's footer navigation menu (see `content/nav
630
630
  "path": "/events/yoga-class",
631
631
  "status": "active",
632
632
  "visibility": "public",
633
+ "preset": "class",
634
+ "bookingScope": "single_occurrence",
635
+ "occurrences": [
636
+ {
637
+ "startsAt": "2026-01-05T15:00:00.000Z",
638
+ "endsAt": "2026-01-05T16:00:00.000Z",
639
+ "timeZone": "America/Los_Angeles"
640
+ },
641
+ {
642
+ "startsAt": "2026-01-12T15:00:00.000Z",
643
+ "endsAt": "2026-01-12T16:00:00.000Z",
644
+ "timeZone": "America/Los_Angeles"
645
+ }
646
+ ],
633
647
  "venueRef": "main-hall",
634
648
  "categoryRef": "workshop",
635
649
  "capacity": 30,
636
- "schedule": {
637
- "recurrenceRule": "FREQ=WEEKLY;BYDAY=MO",
638
- "startDate": "2026-01-05",
639
- "defaultStartTime": "07:00:00",
640
- "durationMinutes": 60
641
- },
642
650
  "pricing": {
643
651
  "requiresPayment": true,
644
652
  "priceAmount": 2500,
@@ -674,8 +682,10 @@ Footer links are managed via the site's footer navigation menu (see `content/nav
674
682
  **Event field notes:**
675
683
 
676
684
  - `priceAmount` is in cents (2500 = $25.00)
677
- - `recurrenceRule` uses iCal RRULE format
678
- - `startDate` is `YYYY-MM-DD`; for one-off events use `recurrenceRule: null` plus `startDate`
685
+ - `preset` controls the event's presentation defaults; `bookingScope` controls
686
+ whether a registration selects one occurrence or the complete series.
687
+ - `occurrences` is the complete authored schedule. Instants use canonical UTC
688
+ ISO datetimes and every item carries the event's IANA timezone.
679
689
  - `venueRef` and `categoryRef` reference slugs/identifiers from venues and event-categories
680
690
  - `status`: "draft", "active", "completed", "cancelled", or "archived"
681
691
  - `visibility`: "private", "public", or "unlisted"
@@ -688,11 +698,12 @@ Footer links are managed via the site's footer navigation menu (see `content/nav
688
698
 
689
699
  See `cli-reference.md` for event-related CLI commands: `riverbankcms push/pull venues|event-categories|events`.
690
700
 
691
- Individual bookable dates are managed separately with
692
- `riverbankcms event occurrence list|add|update|cancel|delete`. They are not
693
- written to `content/events/*.json`, and event pull/push never reconciles the
694
- occurrence collection. See the `event` section in `cli-reference.md` for
695
- timezone, DST, recurrence, cancellation, and deletion rules.
701
+ `riverbankcms pull events` writes every non-cancelled occurrence to the event
702
+ file. Pushing a new event creates that explicit schedule, and pushing an
703
+ unchanged existing schedule is safe. Existing-series additions, removals, or
704
+ retiming remain an explicit capability gap; use `riverbankcms event occurrence
705
+ list|add|update|cancel|delete` for those operational changes. Cancelled rows are
706
+ operational tombstones and are not recreated from portable content.
696
707
 
697
708
  ---
698
709
 
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { X as themeButtonClassName } from "./propsDecoder-CIR5DQ1l.mjs";
2
+ import { X as themeButtonClassName } from "./propsDecoder-Bcin2DB3.mjs";
3
3
  import { useId } from "react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  //#region ../blocks/src/system/runtime/api/types/discounts.ts
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { t as clsx } from "./clsx-DgIEfj3H.mjs";
3
- import { A as formatDate, E as getEventRuntimeFiltersKey, F as formatEventTeacherLine, I as formatTime, L as getCardOrientation, N as formatEventPrice, R as getContainerClass, T as buildEventRuntimeFilters, U as getEventAvailability, V as resolveEventLinkProps, X as themeButtonClassName, yt as assertNever, z as groupEventsByDate } from "./propsDecoder-CIR5DQ1l.mjs";
4
- import { a as EventCardClient, i as EventPaginatedListView, n as useEventPagination, o as EventFilters, r as toError, t as useEventFilters } from "./useEventFilters-C8OOJ3el.mjs";
3
+ import { A as formatDate, E as getEventRuntimeFiltersKey, F as formatEventTeacherLine, I as formatTime, L as getCardOrientation, N as formatEventPrice, R as getContainerClass, T as buildEventRuntimeFilters, U as getEventAvailability, V as resolveEventLinkProps, X as themeButtonClassName, yt as assertNever, z as groupEventsByDate } from "./propsDecoder-Bcin2DB3.mjs";
4
+ import { a as EventCardClient, i as EventPaginatedListView, n as useEventPagination, o as EventFilters, r as toError, t as useEventFilters } from "./useEventFilters-B591g9vd.mjs";
5
5
  import { n as useBlockApi } from "./context-CJz1Vlsz.mjs";
6
6
  import { t as createBodyThemePortalRoot } from "./themePortalRoot-AGs4cE7t.mjs";
7
7
  import { t as ModalShell } from "./ModalShell-CqkBvBIC.mjs";
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { T as buildEventRuntimeFilters } from "./propsDecoder-CIR5DQ1l.mjs";
3
- import { i as EventPaginatedListView, n as useEventPagination, o as EventFilters, t as useEventFilters } from "./useEventFilters-C8OOJ3el.mjs";
2
+ import { T as buildEventRuntimeFilters } from "./propsDecoder-Bcin2DB3.mjs";
3
+ import { i as EventPaginatedListView, n as useEventPagination, o as EventFilters, t as useEventFilters } from "./useEventFilters-B591g9vd.mjs";
4
4
  import { useId, useMemo } from "react";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  //#region ../blocks/src/system/runtime/nodes/events/EventListing.client.tsx
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { J as isRecord } from "./propsDecoder-CIR5DQ1l.mjs";
2
+ import { J as isRecord } from "./propsDecoder-Bcin2DB3.mjs";
3
3
  import { useEffect, useRef, useState } from "react";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  //#region ../blocks/src/system/runtime/nodes/shared/LeafletStaticMap.tsx
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { X as themeButtonClassName, yt as assertNever } from "./propsDecoder-CIR5DQ1l.mjs";
2
+ import { X as themeButtonClassName, yt as assertNever } from "./propsDecoder-Bcin2DB3.mjs";
3
3
  import { n as useBlockApi } from "./context-CJz1Vlsz.mjs";
4
4
  import { useEffect, useReducer, useState, useSyncExternalStore } from "react";
5
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -1,6 +1,6 @@
1
1
  import { t as clsx } from "./clsx-DgIEfj3H.mjs";
2
- import { Wt as formatCurrencyAmount } from "./propsDecoder-CIR5DQ1l.mjs";
3
- import { i as CheckIcon } from "./useDiscountCodeUi-Bcyh4508.mjs";
2
+ import { Wt as formatCurrencyAmount } from "./propsDecoder-Bcin2DB3.mjs";
3
+ import { a as CheckIcon } from "./scrollToBlock-h-o_STf_.mjs";
4
4
  import "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  //#region ../blocks/src/system/runtime/shared/utils/formatting.ts
@@ -1,4 +1,4 @@
1
- import { t as defineIslandPropsDecoder } from "./propsDecoder-CIR5DQ1l.mjs";
1
+ import { t as defineIslandPropsDecoder } from "./propsDecoder-Bcin2DB3.mjs";
2
2
  //#region src/rendering/islands/enhancers/accordion.ts
3
3
  const decode = defineIslandPropsDecoder("accordion");
4
4
  function parseDefaultValues(value) {
@@ -1,16 +1,15 @@
1
1
  "use client";
2
2
  import { d as unsafeAsAppointmentResourceId, f as unsafeAsAppointmentServiceId, g as unsafeAsPassId, m as unsafeAsFormId, p as unsafeAsCustomerPassId } from "./colorStyles-BWpj_h4C.mjs";
3
- import { n as buildBookingPaymentSelectionViewModel, t as usePolling } from "./usePolling-CyJVo9kF.mjs";
4
- import { Ct as okWith, Et as addLocalScheduleDays, Nt as parseBookingLocalDate, Pt as resolveBookingTimeZoneId, Tt as reportWorkflowSuccess, Wt as formatCurrencyAmount, X as themeButtonClassName, _t as toSelectedCollectionOptionKind, at as formatBookingCentsAsCurrencyInput, bt as clearWorkflowFeedback, ct as getBookingServiceSlidingScale, dt as parseBookingCurrencyInputToCents, ft as prepareBookingSubmission, gt as resolveDefaultBookingServiceId, ht as resolveBookingSiteId, it as deriveBookingFormViewState, jt as formatLocalScheduleDate, kt as formatBookingInstant, lt as getBookingSuccessMessage, mt as resolveBookingPaymentStep, ot as formatBookingSubmissionPreparationError, pt as resolveAppointmentCheckoutVerificationState, rt as logger, st as getBookingRedirectStateFromLocation, t as defineIslandPropsDecoder, ut as isBookingServiceSlidingAmountInRange, vt as BOOKING_FORM_DATA_RESERVED_KEYS, wt as reportWorkflowError, xt as err, yt as assertNever } from "./propsDecoder-CIR5DQ1l.mjs";
3
+ import { n as buildBookingPaymentSelectionViewModel, t as usePolling } from "./usePolling-BvnChV4m.mjs";
4
+ import { Ct as okWith, Et as addLocalScheduleDays, Nt as parseBookingLocalDate, Pt as resolveBookingTimeZoneId, Tt as reportWorkflowSuccess, Wt as formatCurrencyAmount, X as themeButtonClassName, _t as toSelectedCollectionOptionKind, at as formatBookingCentsAsCurrencyInput, bt as clearWorkflowFeedback, ct as getBookingServiceSlidingScale, dt as parseBookingCurrencyInputToCents, ft as prepareBookingSubmission, gt as resolveDefaultBookingServiceId, ht as resolveBookingSiteId, it as deriveBookingFormViewState, jt as formatLocalScheduleDate, kt as formatBookingInstant, lt as getBookingSuccessMessage, mt as resolveBookingPaymentStep, ot as formatBookingSubmissionPreparationError, pt as resolveAppointmentCheckoutVerificationState, rt as logger, st as getBookingRedirectStateFromLocation, t as defineIslandPropsDecoder, ut as isBookingServiceSlidingAmountInRange, vt as BOOKING_FORM_DATA_RESERVED_KEYS, wt as reportWorkflowError, xt as err, yt as assertNever } from "./propsDecoder-Bcin2DB3.mjs";
5
5
  import { n as useBlockApi, t as BlockApiProvider } from "./context-CJz1Vlsz.mjs";
6
6
  import { n as isSpamProtectionEnabled, r as AltchaWidget, t as getChallengeUrl } from "./src-B833rYRr.mjs";
7
- import { i as CheckIcon, n as TerminalPanel, r as StateIcon, t as useDiscountCodeUi } from "./useDiscountCodeUi-Bcyh4508.mjs";
8
- import { t as DiscountCodeDisclosure } from "./DiscountCodeDisclosure-CyPpekBp.mjs";
9
- import { n as SpinnerNode, t as StepIndicator } from "./StepIndicator-DE8EvHIp.mjs";
7
+ import { a as CheckIcon, i as StateIcon, n as useDiscountCodeUi, r as TerminalPanel, t as scrollToBlock } from "./scrollToBlock-h-o_STf_.mjs";
8
+ import { t as DiscountCodeDisclosure } from "./DiscountCodeDisclosure-DS0AuFWW.mjs";
9
+ import { n as SpinnerNode, t as StepIndicator } from "./StepIndicator-CBYPFVoy.mjs";
10
10
  import { t as FeedbackMessage } from "./FeedbackMessage-ByMrs3cr.mjs";
11
11
  import { n as getFieldValidationControlProps, t as FieldValidationMessage } from "./FieldValidationMessage-AYanWFb-.mjs";
12
12
  import { t as buildCheckoutReturnUrls } from "./checkoutUrls-Ct8Mxna3.mjs";
13
- import { t as scrollToBlock } from "./scrollToBlock-C86BYkyV.mjs";
14
13
  import { t as mountReactIsland } from "./reactMount-SY8AVRof.mjs";
15
14
  import { t as buildRouteIslandApiConfig } from "./routeIslandApiConfig-UNsfPcYq.mjs";
16
15
  import React, { useCallback, useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
@@ -7416,7 +7416,7 @@ const PALETTE_TOKEN_NAMES = [
7416
7416
  "text",
7417
7417
  "border"
7418
7418
  ];
7419
- z$1.enum(PALETTE_TOKEN_NAMES);
7419
+ const paletteTokenNameSchema = z$1.enum(PALETTE_TOKEN_NAMES);
7420
7420
  const themeColorBaseTokenNames = [
7421
7421
  ...PALETTE_TOKEN_NAMES,
7422
7422
  ...blockColorTokenNames,
@@ -7897,6 +7897,172 @@ const mediaSchema$1 = z.object({
7897
7897
  transform: transformSchema$1.optional()
7898
7898
  });
7899
7899
  //#endregion
7900
+ //#region ../theme-core/src/palette/colors.ts
7901
+ const HEX_COLOR_REGEX = /^#[0-9a-f]{6}$/;
7902
+ const NORMALIZABLE_HEX_REGEX = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
7903
+ const THEME_PALETTE_COLOR_ORDER = [
7904
+ "primary",
7905
+ "secondary",
7906
+ "accent",
7907
+ "success",
7908
+ "warning",
7909
+ "destructive",
7910
+ "background",
7911
+ "surface",
7912
+ "surfaceAlt",
7913
+ "muted",
7914
+ "text",
7915
+ "primaryForeground",
7916
+ "border"
7917
+ ];
7918
+ const hexColorSchema = z$1.string().regex(HEX_COLOR_REGEX, "Hex must be #RRGGBB (lowercase)").transform((value) => value);
7919
+ const paletteModeSchema = z$1.enum(["light", "dark"]);
7920
+ const PALETTE_VALUE_KEY_PREFIX = "palette-value:v1|";
7921
+ z$1.string().regex(/^[0-9a-f]{64}$/, "Palette hash must be a lowercase SHA-256 value").transform((value) => value);
7922
+ const paletteColorsSchema = z$1.object({
7923
+ primary: hexColorSchema,
7924
+ primaryForeground: hexColorSchema,
7925
+ secondary: hexColorSchema,
7926
+ accent: hexColorSchema,
7927
+ success: hexColorSchema,
7928
+ warning: hexColorSchema,
7929
+ destructive: hexColorSchema,
7930
+ background: hexColorSchema,
7931
+ surface: hexColorSchema,
7932
+ surfaceAlt: hexColorSchema,
7933
+ muted: hexColorSchema,
7934
+ text: hexColorSchema,
7935
+ border: hexColorSchema
7936
+ }).strict().transform((value) => value);
7937
+ function normalizePaletteHex(value) {
7938
+ if (!NORMALIZABLE_HEX_REGEX.test(value)) return null;
7939
+ const normalized = value.toLowerCase();
7940
+ if (normalized.length === 7) return normalized;
7941
+ const triplet = normalized.slice(1);
7942
+ const red = triplet.charAt(0);
7943
+ const green = triplet.charAt(1);
7944
+ const blue = triplet.charAt(2);
7945
+ return `#${red}${red}${green}${green}${blue}${blue}`;
7946
+ }
7947
+ function paletteColorsFromEntries(entries) {
7948
+ const values = {};
7949
+ for (const entry of entries) {
7950
+ const parsedRole = paletteTokenNameSchema.safeParse(entry.name);
7951
+ if (!parsedRole.success) return {
7952
+ ok: false,
7953
+ error: {
7954
+ kind: "unknown-role",
7955
+ role: entry.name
7956
+ }
7957
+ };
7958
+ const role = parsedRole.data;
7959
+ if (values[role] !== void 0) return {
7960
+ ok: false,
7961
+ error: {
7962
+ kind: "duplicate-role",
7963
+ role
7964
+ }
7965
+ };
7966
+ const hex = normalizePaletteHex(entry.hex);
7967
+ if (!hex) return {
7968
+ ok: false,
7969
+ error: {
7970
+ kind: "invalid-color",
7971
+ role,
7972
+ value: entry.hex
7973
+ }
7974
+ };
7975
+ values[role] = hex;
7976
+ }
7977
+ const missing = PALETTE_TOKEN_NAMES.filter((role) => values[role] === void 0);
7978
+ if (missing.length > 0) return {
7979
+ ok: false,
7980
+ error: {
7981
+ kind: "missing-roles",
7982
+ roles: missing
7983
+ }
7984
+ };
7985
+ return {
7986
+ ok: true,
7987
+ colors: paletteColorsSchema.parse(values)
7988
+ };
7989
+ }
7990
+ function paletteColorEntries(colors) {
7991
+ return THEME_PALETTE_COLOR_ORDER.map((name) => ({
7992
+ name,
7993
+ hex: colors[name]
7994
+ }));
7995
+ }
7996
+ function paletteColorFingerprint(colors) {
7997
+ return PALETTE_TOKEN_NAMES.map((name) => `${name}:${colors[name]}`).join("|");
7998
+ }
7999
+ function canonicalPaletteHashInput(colors, mode) {
8000
+ return `${mode}|${paletteColorFingerprint(colors)}`;
8001
+ }
8002
+ /**
8003
+ * The shared TypeScript/SQL protocol. Do not reorder roles: the order comes
8004
+ * from PALETTE_TOKEN_NAMES through canonicalPaletteHashInput.
8005
+ */
8006
+ function paletteValueKey(colors, mode) {
8007
+ return `${PALETTE_VALUE_KEY_PREFIX}${canonicalPaletteHashInput(colors, mode)}`;
8008
+ }
8009
+ /** Parses only the exact v1 canonical form emitted by paletteValueKey. */
8010
+ function parsePaletteValueKey(value) {
8011
+ if (typeof value !== "string" || !value.startsWith(PALETTE_VALUE_KEY_PREFIX)) return null;
8012
+ const [rawMode, ...rawRoles] = value.slice(17).split("|");
8013
+ const mode = paletteModeSchema.safeParse(rawMode);
8014
+ if (!mode.success || rawRoles.length !== PALETTE_TOKEN_NAMES.length) return null;
8015
+ const colors = paletteColorsFromEntries(rawRoles.map((roleValue) => {
8016
+ const separator = roleValue.indexOf(":");
8017
+ return separator === -1 ? {
8018
+ name: "",
8019
+ hex: ""
8020
+ } : {
8021
+ name: roleValue.slice(0, separator),
8022
+ hex: roleValue.slice(separator + 1)
8023
+ };
8024
+ }));
8025
+ if (!colors.ok || paletteValueKey(colors.colors, mode.data) !== value) return null;
8026
+ return value;
8027
+ }
8028
+ z$1.string().transform((value, ctx) => {
8029
+ const parsed = parsePaletteValueKey(value);
8030
+ if (parsed) return parsed;
8031
+ ctx.addIssue({
8032
+ code: "custom",
8033
+ message: "Invalid canonical palette value key"
8034
+ });
8035
+ return z$1.NEVER;
8036
+ });
8037
+ //#endregion
8038
+ //#region ../theme-core/src/palette/schema.ts
8039
+ const colourHexString = z$1.string().regex(/^#([0-9A-Fa-f]{3}){1,2}$/);
8040
+ const paletteColorSchema = z$1.object({
8041
+ name: z$1.string().min(1),
8042
+ hex: colourHexString
8043
+ });
8044
+ const paletteMetaSchema = z$1.object({ mode: z$1.enum(["light", "dark"]) });
8045
+ const paletteSchema = z$1.object({
8046
+ colors: z$1.array(paletteColorSchema),
8047
+ meta: paletteMetaSchema
8048
+ }).transform((palette, ctx) => {
8049
+ const colors = paletteColorsFromEntries(palette.colors);
8050
+ if (!colors.ok) {
8051
+ ctx.addIssue({
8052
+ code: "custom",
8053
+ message: `Invalid complete palette: ${colors.error.kind}`
8054
+ });
8055
+ return z$1.NEVER;
8056
+ }
8057
+ return {
8058
+ colors: paletteColorEntries(colors.colors).map(({ name, hex }) => ({
8059
+ name: String(name),
8060
+ hex: String(hex)
8061
+ })),
8062
+ meta: palette.meta
8063
+ };
8064
+ });
8065
+ //#endregion
7900
8066
  //#region ../theme-core/src/cards/types.ts
7901
8067
  const cardVariantRoleValues = ["default", "alternative"];
7902
8068
  const boxlessCardVariantValue = "none";
@@ -8857,16 +9023,6 @@ const axesSchema = z$1.object({
8857
9023
  "expressive"
8858
9024
  ])
8859
9025
  });
8860
- const colourHexString = z$1.string().regex(/^#([0-9A-Fa-f]{3}){1,2}$/);
8861
- const paletteColorSchema = z$1.object({
8862
- name: z$1.string().min(1),
8863
- hex: colourHexString
8864
- });
8865
- const paletteMetaSchema = z$1.object({ mode: z$1.enum(["light", "dark"]) });
8866
- const paletteSchema = z$1.object({
8867
- colors: z$1.array(paletteColorSchema),
8868
- meta: paletteMetaSchema
8869
- });
8870
9026
  const typographyStyleSchema = z$1.object({
8871
9027
  family: z$1.string().min(1),
8872
9028
  weight: z$1.enum([
@@ -13634,6 +13790,9 @@ function usePaymentVerificationWithDeps(config, deps) {
13634
13790
  };
13635
13791
  }
13636
13792
  //#endregion
13793
+ //#region ../blocks/src/system/runtime/nodes/event-registration/constants.ts
13794
+ const EVENT_REGISTRATION_ANCHOR_ID = "event-registration";
13795
+ //#endregion
13637
13796
  //#region ../blocks/src/system/runtime/nodes/event-registration/sessionStorage.ts
13638
13797
  const STORAGE_PREFIX = "riverbank:event-registration:";
13639
13798
  const STALE_THRESHOLD_MS = 1440 * 60 * 1e3;
@@ -13810,16 +13969,29 @@ function cleanupStaleRegistrations() {
13810
13969
  }
13811
13970
  //#endregion
13812
13971
  //#region ../blocks/src/system/runtime/nodes/event-registration/useEventRegistrationStripeReturn.ts
13972
+ const eventRegistrationStripeReturnDeps = {
13973
+ usePaymentVerification,
13974
+ consumeSearchParam,
13975
+ scrollToBlock,
13976
+ cleanupStaleRegistrations,
13977
+ clearPendingRegistration,
13978
+ getPendingRegistration
13979
+ };
13813
13980
  function useEventRegistrationStripeReturn(options) {
13981
+ return useEventRegistrationStripeReturnWithDeps(options, eventRegistrationStripeReturnDeps);
13982
+ }
13983
+ function useEventRegistrationStripeReturnWithDeps(options, deps) {
13814
13984
  const { api, events, occurrenceId, pendingAttendeeId, setErrorMessage, setFormData, setPaymentSelection, setPendingAttendeeId, setRegistrationResult, setSelectedEvent, setSelectedAttendanceMode, setTicketSelections, setStep, setTicketsCount, step } = options;
13815
- const verification = usePaymentVerification(useMemo(() => step === "verifying-payment" && pendingAttendeeId ? { transactionId: pendingAttendeeId } : null, [step, pendingAttendeeId]));
13985
+ const verificationConfig = useMemo(() => step === "verifying-payment" && pendingAttendeeId ? { transactionId: pendingAttendeeId } : null, [step, pendingAttendeeId]);
13986
+ const verification = deps.usePaymentVerification(verificationConfig);
13816
13987
  useEffect(() => {
13817
- cleanupStaleRegistrations();
13818
- const registrationStatus = consumeSearchParam("registration");
13819
- if (!registrationStatus) return;
13988
+ deps.cleanupStaleRegistrations();
13989
+ const registrationStatus = deps.consumeSearchParam("registration");
13990
+ if (registrationStatus !== "cancelled" && registrationStatus !== "success") return;
13991
+ deps.scrollToBlock(EVENT_REGISTRATION_ANCHOR_ID);
13820
13992
  const siteId = api.config.siteId;
13821
13993
  if (!siteId) return;
13822
- const pending = getPendingRegistration(siteId, occurrenceId || void 0);
13994
+ const pending = deps.getPendingRegistration(siteId, occurrenceId || void 0);
13823
13995
  if (!pending) return;
13824
13996
  setFormData(pending.formData);
13825
13997
  setTicketSelections(pending.ticketSelections);
@@ -13839,7 +14011,7 @@ function useEventRegistrationStripeReturn(options) {
13839
14011
  useEffect(() => {
13840
14012
  if (verification.status === "completed") {
13841
14013
  const siteId = api.config.siteId;
13842
- if (siteId && occurrenceId) clearPendingRegistration(siteId, occurrenceId);
14014
+ if (siteId && occurrenceId) deps.clearPendingRegistration(siteId, occurrenceId);
13843
14015
  setRegistrationResult({ status: "confirmed" });
13844
14016
  setStep("success");
13845
14017
  } else if (verification.status === "failed") {
@@ -13950,13 +14122,7 @@ function useEventRegistrationSubmitWithDeps(options, deps) {
13950
14122
  if (!result.alreadyRegistered && result.status === "confirmed" && result.pendingPayment && (method === "stripe" || method === "pass_bundle" || method === "membership_bundle")) {
13951
14123
  options.setPendingAttendeeId(result.attendeeId);
13952
14124
  options.setStep("redirecting");
13953
- const currentUrl = new URL(window.location.href);
13954
- const successParams = new URLSearchParams(currentUrl.search);
13955
- successParams.set("registration", "success");
13956
- const successUrl = `${currentUrl.origin}${currentUrl.pathname}?${successParams.toString()}${currentUrl.hash}`;
13957
- const cancelParams = new URLSearchParams(currentUrl.search);
13958
- cancelParams.set("registration", "cancelled");
13959
- const cancelUrl = `${currentUrl.origin}${currentUrl.pathname}?${cancelParams.toString()}${currentUrl.hash}`;
14125
+ const { successUrl, cancelUrl } = buildCheckoutReturnUrls("registration", EVENT_REGISTRATION_ANCHOR_ID);
13960
14126
  const checkoutType = method === "pass_bundle" ? "pass_bundle" : method === "membership_bundle" ? "membership_bundle" : "event";
13961
14127
  const checkoutResult = await options.api.createEventCheckout({
13962
14128
  attendeeId: result.attendeeId,
@@ -1,4 +1,4 @@
1
- import { t as defineIslandPropsDecoder } from "./propsDecoder-CIR5DQ1l.mjs";
1
+ import { t as defineIslandPropsDecoder } from "./propsDecoder-Bcin2DB3.mjs";
2
2
  import { t as mountReactIsland } from "./reactMount-SY8AVRof.mjs";
3
3
  import { n as normalizeCarouselProps, t as CarouselNodeClient } from "./carousel.client-CpwTUhIo.mjs";
4
4
  import "react";
@@ -1,6 +1,6 @@
1
- import { t as defineIslandPropsDecoder } from "./propsDecoder-CIR5DQ1l.mjs";
2
- import { t as CartController } from "./shop-commerce-XO-XMFEt.mjs";
3
- import { t as mountShopBlockIsland } from "./shopShared-Bbq39mwr.mjs";
1
+ import { t as defineIslandPropsDecoder } from "./propsDecoder-Bcin2DB3.mjs";
2
+ import { t as CartController } from "./shop-commerce-lX8QxjX-.mjs";
3
+ import { t as mountShopBlockIsland } from "./shopShared-DXxH8xxw.mjs";
4
4
  import "react";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  //#region ../blocks/src/system/runtime/nodes/cart.client.tsx
@@ -1,6 +1,6 @@
1
- import { t as defineIslandPropsDecoder } from "./propsDecoder-CIR5DQ1l.mjs";
2
- import { n as CheckoutController } from "./shop-commerce-XO-XMFEt.mjs";
3
- import { t as mountShopBlockIsland } from "./shopShared-Bbq39mwr.mjs";
1
+ import { t as defineIslandPropsDecoder } from "./propsDecoder-Bcin2DB3.mjs";
2
+ import { n as CheckoutController } from "./shop-commerce-lX8QxjX-.mjs";
3
+ import { t as mountShopBlockIsland } from "./shopShared-DXxH8xxw.mjs";
4
4
  import "react";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  //#region ../blocks/src/system/runtime/nodes/checkout.client.tsx