@riverbankcms/sdk 0.138.0 → 0.140.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 (293) hide show
  1. package/README.md +12 -16
  2. package/dist/{PreviewEditorSidebar-BVPur_CU.mjs → PreviewEditorSidebar-CUyTzd5z.mjs} +4 -4
  3. package/dist/{PreviewEditorUI-DLhWX8oh.mjs → PreviewEditorUI-Agkw4v5i.mjs} +3 -3
  4. package/dist/{PreviewQueryProvider-BguJY1SW.mjs → PreviewQueryProvider-CN0ewic5.mjs} +1 -1
  5. package/dist/{SdkPreviewModeRuntime-Tda6qw4z.mjs → SdkPreviewModeRuntime-DdbeAdS8.mjs} +62 -28
  6. package/dist/{SiteChromeCustomizeContext-BHFgMjde.mjs → SiteChromeCustomizeContext-CqGOz-Kv.mjs} +8467 -5616
  7. package/dist/_dts/ai/src/contracts/proposals.d.ts +264 -495
  8. package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +221 -242
  9. package/dist/_dts/api/src/accessAdmin.d.ts +74 -104
  10. package/dist/_dts/api/src/aiEndpoints.d.ts +5 -1
  11. package/dist/_dts/api/src/authSubmission.d.ts +46 -0
  12. package/dist/_dts/api/src/billing.d.ts +18 -7
  13. package/dist/_dts/api/src/billingEndpointDefinitions.d.ts +23 -0
  14. package/dist/_dts/api/src/billingEndpointTypes.d.ts +26 -0
  15. package/dist/_dts/api/src/blocks.d.ts +2 -0
  16. package/dist/_dts/api/src/bookingRecords.d.ts +1 -2
  17. package/dist/_dts/api/src/commercePortalEndpoints.d.ts +8 -1
  18. package/dist/_dts/api/src/communications.d.ts +0 -1
  19. package/dist/_dts/api/src/contentRuntime.d.ts +16 -4
  20. package/dist/_dts/api/src/endpoints.d.ts +275 -167
  21. package/dist/_dts/api/src/event-destination-policy.d.ts +2 -1
  22. package/dist/_dts/api/src/footerSettings.d.ts +10 -10
  23. package/dist/_dts/api/src/index.d.ts +11 -10
  24. package/dist/_dts/api/src/indexCoreTypes.d.ts +1 -1
  25. package/dist/_dts/api/src/indexExtendedTypes.d.ts +1 -1
  26. package/dist/_dts/api/src/mailchimpIntegration.d.ts +2 -59
  27. package/dist/_dts/api/src/mailingListIntegration.d.ts +123 -0
  28. package/dist/_dts/api/src/navigation/dashboardSettingsNav.d.ts +1 -1
  29. package/dist/_dts/api/src/navigation/locations.d.ts +1 -0
  30. package/dist/_dts/api/src/navigation/types.d.ts +1 -1
  31. package/dist/_dts/api/src/navigation.d.ts +1 -26
  32. package/dist/_dts/api/src/newsletterEndpointDefinitions.d.ts +109 -2
  33. package/dist/_dts/api/src/onboarding/confirmationResend.d.ts +25 -0
  34. package/dist/_dts/api/src/onboarding/surfaceData.d.ts +185 -0
  35. package/dist/_dts/api/src/privacyPolicy.d.ts +74 -2
  36. package/dist/_dts/api/src/publicBookingAvailabilityEndpointDefinitions.d.ts +14 -6
  37. package/dist/_dts/api/src/publicEventEndpointDefinitions.d.ts +1 -1
  38. package/dist/_dts/api/src/publicExperience/commerceEndpoints.d.ts +1 -0
  39. package/dist/_dts/api/src/publicExperience/eventEndpoints.d.ts +11 -3
  40. package/dist/_dts/api/src/publicExperience/newsletterEndpoints.d.ts +2 -4
  41. package/dist/_dts/api/src/publicExperience/sharedTypes.d.ts +9 -49
  42. package/dist/_dts/api/src/publicOnboardingAttemptEndpointDefinitions.d.ts +65 -0
  43. package/dist/_dts/api/src/publicReadEndpointDefinitions.d.ts +73 -0
  44. package/dist/_dts/api/src/saveOutcome.d.ts +20 -0
  45. package/dist/_dts/api/src/schemas/site-api-keys.d.ts +1 -1
  46. package/dist/_dts/api/src/sdkContracts.d.ts +5 -32
  47. package/dist/_dts/api/src/sdkPushContracts.d.ts +18 -0
  48. package/dist/_dts/api/src/sdkThemeWire.d.ts +46 -46
  49. package/dist/_dts/api/src/settings/permissions.d.ts +12 -0
  50. package/dist/_dts/api/src/siteManagementEndpoints.d.ts +9 -34
  51. package/dist/_dts/api/src/siteOnboarding.d.ts +84 -228
  52. package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +3 -13
  53. package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +3 -1
  54. package/dist/_dts/api/src/siteSettings.d.ts +38 -6
  55. package/dist/_dts/api/src/types.d.ts +78 -77
  56. package/dist/_dts/api/src/wholeSeriesRuns.d.ts +2 -37
  57. package/dist/_dts/billing/src/membership/index.d.ts +17 -7
  58. package/dist/_dts/billing/src/plans/display.d.ts +15 -0
  59. package/dist/_dts/billing/src/plans/registry.d.ts +2 -0
  60. package/dist/_dts/billing/src/plans/standing.d.ts +19 -0
  61. package/dist/_dts/billing/src/plans/types.d.ts +4 -7
  62. package/dist/_dts/billing/src/site-arrangements.d.ts +14 -3
  63. package/dist/_dts/billing/src/subscriptions/evidence.d.ts +12 -0
  64. package/dist/_dts/billing/src/subscriptions/standingEvidence.d.ts +31 -0
  65. package/dist/_dts/billing/src/subscriptions/store.d.ts +23 -5
  66. package/dist/_dts/blocks/src/PageRenderer.d.ts +6 -15
  67. package/dist/_dts/blocks/src/client.d.ts +1 -1
  68. package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +48 -20
  69. package/dist/_dts/blocks/src/pageRenderAdmission.d.ts +2 -0
  70. package/dist/_dts/blocks/src/pageRendererContracts.d.ts +9 -0
  71. package/dist/_dts/blocks/src/pageRenderingMode.d.ts +12 -6
  72. package/dist/_dts/blocks/src/portal/types.d.ts +2 -4
  73. package/dist/_dts/blocks/src/portal/waitlist-types.d.ts +35 -0
  74. package/dist/_dts/blocks/src/system/blocks/appointment-services.d.ts +11 -0
  75. package/dist/_dts/blocks/src/system/blocks/contact-newsletter.d.ts +39 -66
  76. package/dist/_dts/blocks/src/system/blocks/event-registration.d.ts +2 -0
  77. package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +42 -0
  78. package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +4 -0
  79. package/dist/_dts/blocks/src/system/blocks/newsletter-signup.d.ts +39 -114
  80. package/dist/_dts/blocks/src/system/blocks/offerings-preview/catalogue.d.ts +18 -0
  81. package/dist/_dts/blocks/src/system/blocks/offerings-preview/fields.d.ts +2 -0
  82. package/dist/_dts/blocks/src/system/blocks/offerings-preview/index.d.ts +4 -0
  83. package/dist/_dts/blocks/src/system/blocks/site-footer-runtime.d.ts +7 -13
  84. package/dist/_dts/blocks/src/system/constants/blockKinds.d.ts +1 -1
  85. package/dist/_dts/blocks/src/system/data/index.d.ts +4 -4
  86. package/dist/_dts/blocks/src/system/data/loaderEndpoints.d.ts +1 -1
  87. package/dist/_dts/blocks/src/system/data/prefetchBlockData.d.ts +2 -1
  88. package/dist/_dts/blocks/src/system/data/publicLoaderCachePolicy.d.ts +2 -74
  89. package/dist/_dts/blocks/src/system/data/types.d.ts +9 -0
  90. package/dist/_dts/blocks/src/system/fragments/library/newsletterForm.d.ts +33 -100
  91. package/dist/_dts/blocks/src/system/registry.d.ts +1 -0
  92. package/dist/_dts/blocks/src/system/runtime/api/client.d.ts +0 -28
  93. package/dist/_dts/blocks/src/system/runtime/api/index.d.ts +1 -1
  94. package/dist/_dts/blocks/src/system/runtime/api/types/events.d.ts +7 -3
  95. package/dist/_dts/blocks/src/system/runtime/api/types/newsletter.d.ts +5 -15
  96. package/dist/_dts/blocks/src/system/runtime/api/types/portal.d.ts +1 -1
  97. package/dist/_dts/blocks/src/system/runtime/api/types/waitlist-claims.d.ts +7 -2
  98. package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +78 -30
  99. package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +39 -15
  100. package/dist/_dts/blocks/src/system/runtime/hooks/useCalendarEvents.d.ts +3 -0
  101. package/dist/_dts/blocks/src/system/runtime/hooks/useCalendarEvents.state.d.ts +1 -1
  102. package/dist/_dts/blocks/src/system/runtime/hooks/useCalendarToday.d.ts +22 -0
  103. package/dist/_dts/blocks/src/system/runtime/nodes/appointment-services.d.ts +94 -0
  104. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationSurface.d.ts +1 -2
  105. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/TicketSelectionStep.d.ts +2 -0
  106. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/checkoutRecovery.d.ts +14 -0
  107. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventSourceRecovery.d.ts +56 -0
  108. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/types.d.ts +6 -8
  109. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useCheckoutRecovery.d.ts +8 -0
  110. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationSubmit.d.ts +8 -7
  111. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +12 -2
  112. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventSourceRecovery.d.ts +18 -0
  113. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.client.d.ts +1 -1
  114. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.interactive.d.ts +24 -7
  115. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.server.d.ts +4 -2
  116. package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCombined.client.d.ts +28 -0
  117. package/dist/_dts/blocks/src/system/runtime/nodes/events/domain/bookability.d.ts +9 -0
  118. package/dist/_dts/blocks/src/system/runtime/nodes/events/domain/dates.d.ts +14 -0
  119. package/dist/_dts/blocks/src/system/runtime/nodes/events/domain/duration.d.ts +2 -0
  120. package/dist/_dts/blocks/src/system/runtime/nodes/events/domain/index.d.ts +4 -0
  121. package/dist/_dts/blocks/src/system/runtime/nodes/events/domain/location.d.ts +2 -0
  122. package/dist/_dts/blocks/src/system/runtime/nodes/events/domain/quickDates.d.ts +16 -0
  123. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/AgendaEventCard.d.ts +9 -1
  124. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/CalendarDayCell.d.ts +2 -0
  125. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/CalendarDayHeaders.d.ts +4 -0
  126. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/DayEventsModal.d.ts +2 -1
  127. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventCard.d.ts +5 -0
  128. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventModals.d.ts +2 -1
  129. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventQuickDates.d.ts +15 -0
  130. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/WeekAgendaView.d.ts +7 -3
  131. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/WeekTimetableView.d.ts +1 -0
  132. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/index.d.ts +2 -0
  133. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/timetableModel.d.ts +1 -0
  134. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/useHydrationReady.d.ts +6 -0
  135. package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.client.state.d.ts +3 -0
  136. package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.interactive.d.ts +62 -33
  137. package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.submission.d.ts +3 -3
  138. package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.types.d.ts +14 -31
  139. package/dist/_dts/blocks/src/system/runtime/nodes/offerings-preview-catalogue.d.ts +14 -0
  140. package/dist/_dts/blocks/src/system/runtime/nodes/offerings-preview-content.d.ts +23 -0
  141. package/dist/_dts/blocks/src/system/runtime/nodes/offerings-preview.d.ts +4 -2
  142. package/dist/_dts/blocks/src/system/runtime/resolver.d.ts +1 -0
  143. package/dist/_dts/blocks/src/system/runtime/shared/components/index.d.ts +2 -6
  144. package/dist/_dts/blocks/src/system/runtime/shared/index.d.ts +2 -2
  145. package/dist/_dts/blocks/src/system/runtime/shared/useWaitlistClaim.d.ts +2 -0
  146. package/dist/_dts/blocks/src/system/transforms/registry/formatting.d.ts +5 -0
  147. package/dist/_dts/commerce/src/purchase/event-registration-errors.d.ts +4 -0
  148. package/dist/_dts/commerce/src/purchase/index.d.ts +1 -0
  149. package/dist/_dts/commerce/src/purchase/orderItemMetadata.d.ts +32 -16
  150. package/dist/_dts/commerce/src/purchase/stripeCommissionMetadata.d.ts +34 -0
  151. package/dist/_dts/content-editor/src/controller/EntryControllerProvider.d.ts +2 -1
  152. package/dist/_dts/content-editor/src/footerEngagementDraft.d.ts +6 -24
  153. package/dist/_dts/content-editor/src/hooks/useBlockAutosave.d.ts +3 -1
  154. package/dist/_dts/content-editor/src/useFooterComposerState.d.ts +4 -2
  155. package/dist/_dts/core/src/branded.d.ts +0 -8
  156. package/dist/_dts/core/src/footer-engagement.d.ts +2 -6
  157. package/dist/_dts/core/src/index.d.ts +10 -1
  158. package/dist/_dts/core/src/mailing-list-identifiers.d.ts +21 -0
  159. package/dist/_dts/core/src/mailing-list-runtime.d.ts +42 -0
  160. package/dist/_dts/core/src/mailing-list-setup-parser.d.ts +14 -0
  161. package/dist/_dts/core/src/mailing-list-setup.d.ts +142 -0
  162. package/dist/_dts/core/src/mailing-list-submission.d.ts +224 -0
  163. package/dist/_dts/core/src/mailing-list-targeting-parser.d.ts +12 -0
  164. package/dist/_dts/core/src/mailing-list-targeting.d.ts +93 -0
  165. package/dist/_dts/core/src/navigation-locations.d.ts +28 -0
  166. package/dist/_dts/core/src/participants.d.ts +2 -29
  167. package/dist/_dts/core/src/public-experience.d.ts +4 -0
  168. package/dist/_dts/core/src/public-profile.d.ts +35 -1
  169. package/dist/_dts/core/src/public-read-cache-contract.d.ts +45 -0
  170. package/dist/_dts/core/src/site-route-target.d.ts +9 -2
  171. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +797 -954
  172. package/dist/_dts/editor-blocks/src/widgets/index.d.ts +1 -0
  173. package/dist/_dts/editor-blocks/src/widgets/mailing-list-targeting/MailingListGlobalSettingsSummary.d.ts +10 -0
  174. package/dist/_dts/editor-blocks/src/widgets/mailing-list-targeting/MailingListTargetingField.d.ts +12 -0
  175. package/dist/_dts/editor-blocks/src/widgets/mailing-list-targeting/context.d.ts +14 -0
  176. package/dist/_dts/editor-blocks/src/widgets/mailing-list-targeting/index.d.ts +3 -0
  177. package/dist/_dts/editor-blocks/src/widgets/mailing-list-targeting/loaders.d.ts +7 -0
  178. package/dist/_dts/editor-blocks/src/widgets/mailing-list-targeting/targetingState.d.ts +19 -0
  179. package/dist/_dts/preview-next/src/client/widgets/widgetOverrides.d.ts +1 -0
  180. package/dist/_dts/sdk/src/client/publicAppointmentReadOperations.d.ts +12 -0
  181. package/dist/_dts/sdk/src/client/publicEventReadOperations.d.ts +2 -1
  182. package/dist/_dts/sdk/src/client/publicLoaderCacheAccess.d.ts +11 -4
  183. package/dist/_dts/sdk/src/config/content-types.d.ts +3 -13
  184. package/dist/_dts/sdk/src/config/content-validation.d.ts +5 -8
  185. package/dist/_dts/sdk/src/constants.d.ts +3 -3
  186. package/dist/_dts/sdk/src/contracts/index.d.ts +1 -1
  187. package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +12 -31
  188. package/dist/_dts/sdk/src/navigation/index.d.ts +11 -29
  189. package/dist/_dts/sdk/src/next/index.d.ts +4 -4
  190. package/dist/_dts/sdk/src/prebuild/types.d.ts +1 -5
  191. package/dist/_dts/sdk/src/public-api/contracts.d.ts +44 -33
  192. package/dist/_dts/sdk/src/rendering/blocks-page-renderer.d.ts +5 -0
  193. package/dist/_dts/sdk/src/rendering/client.d.ts +3 -20
  194. package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +5 -0
  195. package/dist/_dts/sdk/src/rendering/helpers/loadContent.d.ts +4 -0
  196. package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +8 -1
  197. package/dist/_dts/sdk/src/rendering/helpers/templateContent.d.ts +1 -0
  198. package/dist/_dts/sdk/src/rendering/index.d.ts +1 -1
  199. package/dist/_dts/sdk/src/types/block-kinds.d.ts +1 -1
  200. package/dist/_dts/sdk/src/version.d.ts +1 -1
  201. package/dist/_dts/theme-core/src/accordions/types.d.ts +3 -3
  202. package/dist/_dts/theme-core/src/cards/types.d.ts +21 -21
  203. package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
  204. package/dist/_dts/theme-core/src/header/interactionPalette.d.ts +8 -2
  205. package/dist/_dts/theme-core/src/header/legacyHeaderVariant.d.ts +2 -2
  206. package/dist/_dts/theme-core/src/hosted-booking-appearance.d.ts +41 -0
  207. package/dist/_dts/theme-core/src/index.d.ts +1 -0
  208. package/dist/_dts/theme-core/src/inputs/types.d.ts +2 -2
  209. package/dist/_dts/theme-core/src/mock-themes/all.d.ts +54 -54
  210. package/dist/_dts/theme-core/src/runtime/buildThemeRuntime.d.ts +0 -1
  211. package/dist/_dts/theme-core/src/runtime/buildThemeRuntimeFromBridge.d.ts +1 -4
  212. package/dist/_dts/theme-core/src/schema.d.ts +84 -84
  213. package/dist/_dts/theme-core/src/shared/componentStyles.d.ts +1 -1
  214. package/dist/_dts/theme-core/src/site-styles/backgroundAppearance.d.ts +2 -2
  215. package/dist/_dts/theme-core/src/surfaces/foregroundInteraction.d.ts +77 -0
  216. package/dist/_dts/theme-core/src/surfaces/index.d.ts +1 -0
  217. package/dist/_dts/theme-core/src/tokens/tokens.d.ts +7 -0
  218. package/dist/_dts/theme-core/src/typography/generateTypographyCss.d.ts +2 -2
  219. package/dist/_dts/ui/src/badge.d.ts +1 -1
  220. package/dist/_dts/ui/src/callout.d.ts +1 -1
  221. package/dist/_dts/ui/src/lib/use-delayed-flag.d.ts +9 -0
  222. package/dist/_dts/ui/src/pending-button.d.ts +10 -0
  223. package/dist/client/{BookingConsentAgreement-DQUik1Mx.mjs → BookingConsentAgreement-CuKa82V4.mjs} +4 -4
  224. package/dist/client/{DiscountCodeDisclosure-CU67Q4vH.mjs → DiscountCodeDisclosure-BbYieKWB.mjs} +1 -1
  225. package/dist/client/{EventCombined.client-a02TXUgg.mjs → EventCombined.client-LTfR1Aby.mjs} +444 -200
  226. package/dist/client/{EventListing.client-99qx7jFl.mjs → EventListing.client-DUHpYSuo.mjs} +2 -2
  227. package/dist/client/{LeafletStaticMap-CWzcq73L.mjs → LeafletStaticMap-CHRupL6m.mjs} +1 -1
  228. package/dist/client/{accordion-D1nb3-Oj.mjs → accordion-6HiIFxNL.mjs} +1 -1
  229. package/dist/client/{bookingForm-BGrmLhaO.mjs → bookingForm-Dlmid43H.mjs} +7 -7
  230. package/dist/client/bookings.mjs +368 -142
  231. package/dist/client/{carousel-DSmOx3ad.mjs → carousel-DmkZRRq_.mjs} +2 -2
  232. package/dist/client/{carousel.client-59G_WMr4.mjs → carousel.client-DQTjCVQT.mjs} +1 -1
  233. package/dist/client/{cart-COWeOIUk.mjs → cart-CIC24330.mjs} +3 -3
  234. package/dist/client/{checkout-CeysaIJK.mjs → checkout-D1Zw9imo.mjs} +3 -3
  235. package/dist/client/{checkoutUrls-BuseL0dw.mjs → checkoutUrls-FL6lRkrt.mjs} +1 -1
  236. package/dist/client/client.mjs +5017 -2258
  237. package/dist/client/{colorStyles-CrxJrPjJ.mjs → colorStyles-3013aRAY.mjs} +3 -1
  238. package/dist/client/{context-DBzX85Xc.mjs → context-Cy1OayHx.mjs} +9 -21
  239. package/dist/client/{dates-DCYhZBlW.mjs → dates-aDcfoLHr.mjs} +21 -3
  240. package/dist/client/{eventCalendar-BgsN73Ul.mjs → eventCalendar-FQxMPAjf.mjs} +81 -79
  241. package/dist/client/{eventCombined-DcZQAMQP.mjs → eventCombined-Dr3ac6Hb.mjs} +3 -3
  242. package/dist/client/{eventDetails-BWwGJ54l.mjs → eventDetails-D-AzUHFQ.mjs} +4 -4
  243. package/dist/client/{eventListing-DqYqV8vp.mjs → eventListing-B3XxBf3i.mjs} +3 -3
  244. package/dist/client/{eventRegistration-DQGDgu_e.mjs → eventRegistration-I6EaokFD.mjs} +543 -155
  245. package/dist/client/{form-ClfpasVT.mjs → form-BbWckVWY.mjs} +3 -3
  246. package/dist/client/{headerSection-BuOMe98N.mjs → headerSection-C9qU4Y7x.mjs} +2 -2
  247. package/dist/client/hooks.mjs +1685 -716
  248. package/dist/client/{locationMap-CEqu_sfa.mjs → locationMap-CLCShvlG.mjs} +3 -3
  249. package/dist/client/{media-BOHuueS5.mjs → media-DHpfFwd3.mjs} +1 -1
  250. package/dist/client/newsletterForm-Briukxzi.mjs +444 -0
  251. package/dist/client/{pricing-xj7MPZlK.mjs → pricing-Copadu-2.mjs} +1 -1
  252. package/dist/client/{productDetail-vxqTt5Xj.mjs → productDetail-oujlRd-r.mjs} +3 -3
  253. package/dist/client/{productList-OTdZu8sb.mjs → productList-BRiIRUcd.mjs} +3 -3
  254. package/dist/client/{propsDecoder-CY9gGEF7.mjs → propsDecoder-CB2KS_ko.mjs} +706 -160
  255. package/dist/client/rendering/client.mjs +3161 -1226
  256. package/dist/client/rendering/islands.mjs +19 -19
  257. package/dist/client/rendering.mjs +4864 -1914
  258. package/dist/client/{scrollToBlock--BFV6kl-.mjs → scrollToBlock-B1IS1_ua.mjs} +1 -1
  259. package/dist/client/{shop-CP4YbDL9.mjs → shop-Vn6yNFED.mjs} +6 -6
  260. package/dist/client/{shop-commerce-APs4XBXE.mjs → shop-commerce-BVTqipYp.mjs} +7 -7
  261. package/dist/client/{shop-commerce-store-CAVLxLFr.mjs → shop-commerce-store-BVnJVy7v.mjs} +1 -1
  262. package/dist/client/{shopShared-BnSRrwXI.mjs → shopShared-COIeK77T.mjs} +4 -4
  263. package/dist/client/{useEventFilters-1a1by4c8.mjs → useEventFilters-DzIUcS9n.mjs} +58 -11
  264. package/dist/preview-next/before-render.mjs +357 -175
  265. package/dist/preview-next/client/runtime.mjs +4 -4
  266. package/dist/preview-next/keepAlive.mjs +357 -175
  267. package/dist/preview-next/middleware.mjs +357 -175
  268. package/dist/{previewAuthStore-BkEgnYPP.mjs → previewAuthStore-Gjb6r6vz.mjs} +357 -175
  269. package/dist/{sdk-runtime-DwGfsT0S.mjs → sdk-runtime-CnCLvZRv.mjs} +2 -2
  270. package/dist/{separator-BeqDLneQ.mjs → separator-DKDRJ1oH.mjs} +1 -1
  271. package/dist/server/components.mjs +3389 -1251
  272. package/dist/server/config-validation.mjs +2737 -1784
  273. package/dist/server/config.mjs +2742 -1788
  274. package/dist/server/data.mjs +1586 -615
  275. package/dist/server/index.mjs +496 -352
  276. package/dist/server/navigation.mjs +16 -47
  277. package/dist/server/next.mjs +3978 -2007
  278. package/dist/server/page-converter.mjs +1109 -553
  279. package/dist/server/prebuild.mjs +2 -3
  280. package/dist/server/rendering/server.mjs +4101 -1951
  281. package/dist/server/rendering.mjs +3416 -1259
  282. package/dist/server/routing.mjs +1869 -786
  283. package/dist/server/server.mjs +3260 -2482
  284. package/dist/server/theme-bridge.mjs +725 -124
  285. package/dist/server/theme.mjs +8 -2
  286. package/dist/styles/index.css +526 -68
  287. package/package.json +1 -1
  288. package/dist/_dts/api/src/navigation/identity.d.ts +0 -59
  289. package/dist/_dts/blocks/src/system/blocks/newsletter-signup-destination.d.ts +0 -291
  290. package/dist/_dts/blocks/src/system/runtime/shared/components/BookingOptionCompactRow.d.ts +0 -29
  291. package/dist/_dts/blocks/src/system/runtime/shared/components/BookingOptionList.d.ts +0 -13
  292. package/dist/_dts/core/src/newsletter-signup-destination.d.ts +0 -38
  293. package/dist/client/newsletterForm-IbrHjMxy.mjs +0 -322
@@ -1,4 +1,4 @@
1
- import { E as ok$1, T as err$1, a as paletteColorEntries, c as themeColorTokenSchema, g as parseEventSeriesId, h as parseEventOfferingId, l as parseColorTokenParts, o as paletteColorsFromEntries, p as parseAspectRatioValue, r as rgbColorValue, s as parseThemeColorToken } from "./colorStyles-CrxJrPjJ.mjs";
1
+ import { D as ok$1, E as err$1, _ 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-3013aRAY.mjs";
2
2
  import "react";
3
3
  import { z } from "zod";
4
4
  import "react/jsx-runtime";
@@ -8,6 +8,11 @@ function assertNever$2(value, message = "Unexpected variant") {
8
8
  }
9
9
  //#endregion
10
10
  //#region ../core/src/currency-format.ts
11
+ const CURRENCY_CODE_INPUT_PATTERN = /^[A-Za-z]{3}$/;
12
+ /** Parse + normalize a currency code, or return null if it isn't a 3-letter code. */
13
+ function parseCurrencyCode(value) {
14
+ return CURRENCY_CODE_INPUT_PATTERN.test(value) ? value.toUpperCase() : null;
15
+ }
11
16
  const CURRENCY_LOCALE_BY_CODE = {
12
17
  USD: "en-US",
13
18
  GBP: "en-GB",
@@ -277,7 +282,7 @@ function parseEventPageSurfaceDestinationMode(value) {
277
282
  return value === "cms-managed" || value === "system-managed" ? value : void 0;
278
283
  }
279
284
  function parseEventPageSurfaceSubject(value) {
280
- if (!isRecord$5(value)) return err$1({ kind: "notObject" });
285
+ if (!isRecord$8(value)) return err$1({ kind: "notObject" });
281
286
  switch (value.kind) {
282
287
  case "eventSeries": {
283
288
  const eventSeriesId = parseEventSeriesId(value.eventSeriesId);
@@ -332,7 +337,7 @@ function parseEventSeriesIdList(values) {
332
337
  }
333
338
  return ok$1(parsed);
334
339
  }
335
- function isRecord$5(value) {
340
+ function isRecord$8(value) {
336
341
  return typeof value === "object" && value !== null && !Array.isArray(value);
337
342
  }
338
343
  //#endregion
@@ -681,9 +686,435 @@ function localScheduleDateTimeToUtcDate(localDate, localTime, timeZone) {
681
686
  return new Date(guess);
682
687
  }
683
688
  //#endregion
684
- //#region ../core/src/newsletter-signup-destination.ts
685
- function parseNewsletterSignupDestinationProvider(value) {
686
- return value === "riverbank" || value === "mailchimp" ? value : null;
689
+ //#region ../core/src/mailing-list-identifiers.ts
690
+ const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu;
691
+ const OPAQUE_ID_PATTERN = /^[A-Za-z0-9_-]{1,100}$/u;
692
+ function parseTrimmedMatchingString(value, pattern) {
693
+ if (typeof value !== "string") return null;
694
+ const trimmed = value.trim();
695
+ return pattern.test(trimmed) ? trimmed : null;
696
+ }
697
+ function parsePositiveInteger(value) {
698
+ return typeof value === "number" && Number.isSafeInteger(value) && value > 0 ? value : null;
699
+ }
700
+ function parseNewsletterListId(value) {
701
+ return parseTrimmedMatchingString(value, UUID_PATTERN);
702
+ }
703
+ function parseMailchimpAudienceId(value) {
704
+ return parseTrimmedMatchingString(value, OPAQUE_ID_PATTERN);
705
+ }
706
+ function parseMailchimpInterestId(value) {
707
+ return parseTrimmedMatchingString(value, OPAQUE_ID_PATTERN);
708
+ }
709
+ function parseBrevoListId(value) {
710
+ return parsePositiveInteger(value);
711
+ }
712
+ //#endregion
713
+ //#region ../core/src/mailing-list-setup.ts
714
+ const DEFAULT_MAILING_LIST_SUCCESS_MESSAGE = "Thanks — you're on the list.";
715
+ //#endregion
716
+ //#region ../core/src/mailing-list-setup-parser.ts
717
+ function parseMailingListGlobalForm(value) {
718
+ if (!isRecord$7(value)) return formError("shape");
719
+ const fields = parseGlobalFields(value.fields);
720
+ if (fields === null) return formError("fields");
721
+ if (typeof value.includeOptionalPhone !== "boolean") return formError("includeOptionalPhone");
722
+ const buttonLabel = parseRequiredString(value.buttonLabel);
723
+ if (buttonLabel === null) return formError("buttonLabel");
724
+ const successMessage = parseRequiredString(value.successMessage);
725
+ if (successMessage === null) return formError("successMessage");
726
+ const privacyNote = parseOptionalString(value.privacyNote);
727
+ if (privacyNote === void 0) return formError("privacyNote");
728
+ return ok$1({
729
+ fields,
730
+ includeOptionalPhone: value.includeOptionalPhone,
731
+ buttonLabel,
732
+ successMessage,
733
+ privacyNote
734
+ });
735
+ }
736
+ function parseGlobalFields(value) {
737
+ if (!isRecord$7(value) || typeof value.preset !== "string") return null;
738
+ switch (value.preset) {
739
+ case "emailOnly": return { preset: "emailOnly" };
740
+ case "emailName": return isRequirement(value.name) ? {
741
+ preset: "emailName",
742
+ name: value.name
743
+ } : null;
744
+ case "emailFirstLast": return isRequirement(value.firstName) && isRequirement(value.lastName) ? {
745
+ preset: "emailFirstLast",
746
+ firstName: value.firstName,
747
+ lastName: value.lastName
748
+ } : null;
749
+ case "emailNameCompany": return isRequirement(value.name) && isRequirement(value.company) ? {
750
+ preset: "emailNameCompany",
751
+ name: value.name,
752
+ company: value.company
753
+ } : null;
754
+ default: return null;
755
+ }
756
+ }
757
+ function parseMailingListSetupRevision(value) {
758
+ return typeof value === "number" && Number.isSafeInteger(value) && value > 0 ? value : null;
759
+ }
760
+ function parseRequiredString(value) {
761
+ if (typeof value !== "string") return null;
762
+ const trimmed = value.trim();
763
+ return trimmed.length > 0 ? trimmed : null;
764
+ }
765
+ function parseOptionalString(value) {
766
+ if (value === null || value === void 0) return null;
767
+ if (typeof value !== "string") return void 0;
768
+ const trimmed = value.trim();
769
+ return trimmed.length > 0 ? trimmed : null;
770
+ }
771
+ function isRequirement(value) {
772
+ return value === "required" || value === "optional";
773
+ }
774
+ function isRecord$7(value) {
775
+ return typeof value === "object" && value !== null && !Array.isArray(value);
776
+ }
777
+ function formError(field) {
778
+ return err$1({
779
+ tag: "invalid_mailing_list_global_form",
780
+ field
781
+ });
782
+ }
783
+ //#endregion
784
+ //#region ../core/src/mailing-list-targeting.ts
785
+ function planMailingListChoicePresentation(targeting) {
786
+ if (targeting.mode === "default" || targeting.selection.tag === "fixed") return { tag: "hidden" };
787
+ switch (targeting.provider) {
788
+ case "native": return targeting.selection.offeredTopicIds.length === 1 ? {
789
+ tag: "automatic",
790
+ selection: {
791
+ provider: "native",
792
+ topicIds: targeting.selection.offeredTopicIds
793
+ }
794
+ } : {
795
+ tag: "visitor_choice",
796
+ provider: "native",
797
+ optionCount: targeting.selection.offeredTopicIds.length
798
+ };
799
+ case "brevo": return targeting.selection.offeredListIds.length === 1 ? {
800
+ tag: "automatic",
801
+ selection: {
802
+ provider: "brevo",
803
+ listIds: targeting.selection.offeredListIds
804
+ }
805
+ } : {
806
+ tag: "visitor_choice",
807
+ provider: "brevo",
808
+ optionCount: targeting.selection.offeredListIds.length
809
+ };
810
+ case "mailchimp": return targeting.selection.offeredInterestIds.length === 1 ? {
811
+ tag: "automatic",
812
+ selection: {
813
+ provider: "mailchimp",
814
+ interestIds: targeting.selection.offeredInterestIds
815
+ }
816
+ } : {
817
+ tag: "visitor_choice",
818
+ provider: "mailchimp",
819
+ optionCount: targeting.selection.offeredInterestIds.length
820
+ };
821
+ }
822
+ }
823
+ //#endregion
824
+ //#region ../core/src/mailing-list-runtime.ts
825
+ function parseMailingListRuntimeContext(value) {
826
+ if (!isRecord$6(value)) return invalidRuntimeContext();
827
+ if (value.tag === "not_configured") return ok$1({ tag: "not_configured" });
828
+ if (value.tag !== "configured") return invalidRuntimeContext();
829
+ const revision = parseMailingListSetupRevision(value.revision);
830
+ const form = parseMailingListGlobalForm(value.form);
831
+ const provider = parseRuntimeProvider(value.provider);
832
+ if (revision === null || !form.ok || provider === null) return invalidRuntimeContext();
833
+ return ok$1({
834
+ tag: "configured",
835
+ revision,
836
+ form: form.value,
837
+ provider
838
+ });
839
+ }
840
+ function parseRuntimeProvider(value) {
841
+ if (!isRecord$6(value)) return null;
842
+ switch (value.provider) {
843
+ case "native": return parseNativeRuntimeProvider(value);
844
+ case "brevo": return parseBrevoRuntimeProvider(value);
845
+ case "mailchimp": return parseMailchimpRuntimeProvider(value);
846
+ default: return null;
847
+ }
848
+ }
849
+ function parseNativeRuntimeProvider(value) {
850
+ const defaultTopicId = parseNewsletterListId(value.defaultTopicId);
851
+ const topics = parseNamedItems(value.topics, parseNewsletterListId);
852
+ return defaultTopicId !== null && topics !== null ? {
853
+ provider: "native",
854
+ defaultTopicId,
855
+ topics
856
+ } : null;
857
+ }
858
+ function parseBrevoRuntimeProvider(value) {
859
+ const defaultListId = parseBrevoListId(value.defaultListId);
860
+ const lists = parseNamedItems(value.lists, parseBrevoListId);
861
+ return defaultListId !== null && lists !== null ? {
862
+ provider: "brevo",
863
+ defaultListId,
864
+ lists
865
+ } : null;
866
+ }
867
+ function parseMailchimpRuntimeProvider(value) {
868
+ if (!Array.isArray(value.audiences)) return null;
869
+ const defaultAudienceId = parseMailchimpAudienceId(value.defaultAudienceId);
870
+ if (defaultAudienceId === null) return null;
871
+ const audiences = [];
872
+ for (const audience of value.audiences) {
873
+ if (!isRecord$6(audience)) return null;
874
+ const id = parseMailchimpAudienceId(audience.id);
875
+ const name = parseName(audience.name);
876
+ if (id === null || name === null || !Array.isArray(audience.interests)) return null;
877
+ const interests = parseMailchimpInterests(audience.interests);
878
+ if (interests === null) return null;
879
+ audiences.push({
880
+ id,
881
+ name,
882
+ interests
883
+ });
884
+ }
885
+ return {
886
+ provider: "mailchimp",
887
+ defaultAudienceId,
888
+ audiences
889
+ };
890
+ }
891
+ function parseMailchimpInterests(value) {
892
+ const interests = [];
893
+ for (const interest of value) {
894
+ if (!isRecord$6(interest)) return null;
895
+ const id = parseMailchimpInterestId(interest.id);
896
+ const name = parseName(interest.name);
897
+ const categoryName = parseName(interest.categoryName);
898
+ if (id === null || name === null || categoryName === null) return null;
899
+ interests.push({
900
+ id,
901
+ name,
902
+ categoryName
903
+ });
904
+ }
905
+ return interests;
906
+ }
907
+ function parseNamedItems(value, parseId) {
908
+ if (!Array.isArray(value)) return null;
909
+ const items = [];
910
+ for (const item of value) {
911
+ if (!isRecord$6(item)) return null;
912
+ const id = parseId(item.id);
913
+ const name = parseName(item.name);
914
+ if (id === null || name === null) return null;
915
+ items.push({
916
+ id,
917
+ name
918
+ });
919
+ }
920
+ return items;
921
+ }
922
+ function parseName(value) {
923
+ if (typeof value !== "string") return null;
924
+ const name = value.trim();
925
+ return name.length > 0 ? name : null;
926
+ }
927
+ function isRecord$6(value) {
928
+ return typeof value === "object" && value !== null && !Array.isArray(value);
929
+ }
930
+ function invalidRuntimeContext() {
931
+ return err$1({ tag: "invalid_mailing_list_runtime_context" });
932
+ }
933
+ //#endregion
934
+ //#region ../core/src/mailing-list-targeting-parser.ts
935
+ function parseMailingListPlacementTargeting(value) {
936
+ if (!isRecord$5(value)) return targetingError("shape");
937
+ if (value.mode === "default") return ok$1({ mode: "default" });
938
+ if (value.mode !== "custom") return targetingError("mode");
939
+ if (!isRecord$5(value.selection)) return targetingError("selection");
940
+ switch (value.provider) {
941
+ case "native": return parseNativeTargeting(value.selection);
942
+ case "brevo": return parseBrevoTargeting(value.selection);
943
+ case "mailchimp": return parseMailchimpTargeting(value, value.selection);
944
+ default: return targetingError("provider");
945
+ }
946
+ }
947
+ function parseMailingListVisitorSelection(value) {
948
+ if (!isRecord$5(value)) return visitorSelectionError("shape");
949
+ switch (value.provider) {
950
+ case "native": {
951
+ const topicIds = parseVisitorIds(value.topicIds, parseNewsletterListId);
952
+ return topicIds === null ? visitorSelectionError("targets") : ok$1({
953
+ provider: "native",
954
+ topicIds
955
+ });
956
+ }
957
+ case "brevo": {
958
+ const listIds = parseVisitorIds(value.listIds, parseBrevoListId);
959
+ return listIds === null ? visitorSelectionError("targets") : ok$1({
960
+ provider: "brevo",
961
+ listIds
962
+ });
963
+ }
964
+ case "mailchimp": {
965
+ const interestIds = parseVisitorIds(value.interestIds, parseMailchimpInterestId);
966
+ return interestIds === null ? visitorSelectionError("targets") : ok$1({
967
+ provider: "mailchimp",
968
+ interestIds
969
+ });
970
+ }
971
+ default: return visitorSelectionError("provider");
972
+ }
973
+ }
974
+ function parseNativeTargeting(selection) {
975
+ if (selection.tag === "fixed") {
976
+ const topicIds = parseNonEmptyUniqueIds(selection.topicIds, parseNewsletterListId);
977
+ return topicIds.ok ? ok$1({
978
+ mode: "custom",
979
+ provider: "native",
980
+ selection: {
981
+ tag: "fixed",
982
+ topicIds: topicIds.value
983
+ }
984
+ }) : topicIds;
985
+ }
986
+ if (selection.tag === "visitor_choice") {
987
+ const offeredTopicIds = parseNonEmptyUniqueIds(selection.offeredTopicIds, parseNewsletterListId);
988
+ return offeredTopicIds.ok ? ok$1({
989
+ mode: "custom",
990
+ provider: "native",
991
+ selection: {
992
+ tag: "visitor_choice",
993
+ offeredTopicIds: offeredTopicIds.value
994
+ }
995
+ }) : offeredTopicIds;
996
+ }
997
+ return targetingError("selection");
998
+ }
999
+ function parseBrevoTargeting(selection) {
1000
+ if (selection.tag === "fixed") {
1001
+ const listIds = parseNonEmptyUniqueIds(selection.listIds, parseBrevoListId);
1002
+ return listIds.ok ? ok$1({
1003
+ mode: "custom",
1004
+ provider: "brevo",
1005
+ selection: {
1006
+ tag: "fixed",
1007
+ listIds: listIds.value
1008
+ }
1009
+ }) : listIds;
1010
+ }
1011
+ if (selection.tag === "visitor_choice") {
1012
+ const offeredListIds = parseNonEmptyUniqueIds(selection.offeredListIds, parseBrevoListId);
1013
+ return offeredListIds.ok ? ok$1({
1014
+ mode: "custom",
1015
+ provider: "brevo",
1016
+ selection: {
1017
+ tag: "visitor_choice",
1018
+ offeredListIds: offeredListIds.value
1019
+ }
1020
+ }) : offeredListIds;
1021
+ }
1022
+ return targetingError("selection");
1023
+ }
1024
+ function parseMailchimpTargeting(value, selection) {
1025
+ const audienceId = parseMailchimpAudienceId(value.audienceId);
1026
+ if (audienceId === null) return targetingError("audienceId");
1027
+ if (selection.tag === "fixed") {
1028
+ const interestIds = parseUniqueIds(selection.interestIds, parseMailchimpInterestId);
1029
+ return interestIds.ok ? ok$1({
1030
+ mode: "custom",
1031
+ provider: "mailchimp",
1032
+ audienceId,
1033
+ selection: {
1034
+ tag: "fixed",
1035
+ interestIds: interestIds.value
1036
+ }
1037
+ }) : interestIds;
1038
+ }
1039
+ if (selection.tag === "visitor_choice") {
1040
+ const offeredInterestIds = parseNonEmptyUniqueIds(selection.offeredInterestIds, parseMailchimpInterestId);
1041
+ return offeredInterestIds.ok ? ok$1({
1042
+ mode: "custom",
1043
+ provider: "mailchimp",
1044
+ audienceId,
1045
+ selection: {
1046
+ tag: "visitor_choice",
1047
+ offeredInterestIds: offeredInterestIds.value
1048
+ }
1049
+ }) : offeredInterestIds;
1050
+ }
1051
+ return targetingError("selection");
1052
+ }
1053
+ function parseNonEmptyUniqueIds(value, parseId) {
1054
+ const parsed = parseUniqueIds(value, parseId);
1055
+ if (!parsed.ok) return parsed;
1056
+ const [first, ...rest] = parsed.value;
1057
+ return first === void 0 ? targetingError("targets") : ok$1([first, ...rest]);
1058
+ }
1059
+ function parseUniqueIds(value, parseId) {
1060
+ if (!Array.isArray(value)) return targetingError("targets");
1061
+ const parsed = [];
1062
+ for (const item of value) {
1063
+ const id = parseId(item);
1064
+ if (id === null) return targetingError("targets");
1065
+ if (parsed.includes(id)) return targetingError("duplicate_target");
1066
+ parsed.push(id);
1067
+ }
1068
+ return ok$1(parsed);
1069
+ }
1070
+ function parseVisitorIds(value, parseId) {
1071
+ if (!Array.isArray(value) || value.length === 0) return null;
1072
+ const parsed = [];
1073
+ for (const item of value) {
1074
+ const id = parseId(item);
1075
+ if (id === null) return null;
1076
+ if (parsed.includes(id)) return null;
1077
+ parsed.push(id);
1078
+ }
1079
+ return parsed;
1080
+ }
1081
+ function isRecord$5(value) {
1082
+ return typeof value === "object" && value !== null && !Array.isArray(value);
1083
+ }
1084
+ function targetingError(field) {
1085
+ return err$1({
1086
+ tag: "invalid_mailing_list_targeting",
1087
+ field
1088
+ });
1089
+ }
1090
+ function visitorSelectionError(field) {
1091
+ return err$1({
1092
+ tag: "invalid_mailing_list_visitor_selection",
1093
+ field
1094
+ });
1095
+ }
1096
+ //#endregion
1097
+ //#region ../core/src/mailing-list-submission.ts
1098
+ function parseMailingListBlockId(value) {
1099
+ const parsed = typeof value === "string" ? value.trim() : "";
1100
+ return /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu.test(parsed) ? parsed : null;
1101
+ }
1102
+ function parseMailingListSignedSourceToken(value) {
1103
+ const parsed = typeof value === "string" ? value.trim() : "";
1104
+ return /^[A-Za-z0-9._~-]{16,1000}$/u.test(parsed) ? parsed : null;
1105
+ }
1106
+ function parseMailingListContentVersionId(value) {
1107
+ const parsed = parseContentVersionId(value);
1108
+ return parsed.ok ? parsed.value : null;
1109
+ }
1110
+ function buildMailingListSignupBlockSourceRef(blockId, contentVersionId) {
1111
+ const parsedBlockId = parseMailingListBlockId(blockId);
1112
+ const parsedContentVersionId = parseMailingListContentVersionId(contentVersionId);
1113
+ return parsedBlockId !== null && parsedContentVersionId !== null ? {
1114
+ tag: "block_ref",
1115
+ blockId: parsedBlockId,
1116
+ contentVersionId: parsedContentVersionId
1117
+ } : null;
687
1118
  }
688
1119
  //#endregion
689
1120
  //#region ../core/src/whole-series-run-schedule.ts
@@ -5409,8 +5840,14 @@ const headerInteractionPillPaletteValues = [
5409
5840
  "accent"
5410
5841
  ];
5411
5842
  /**
5412
- * "No pill": the nav link keeps whatever hover treatment its recipe compiled,
5413
- * and the palette step writes nothing at all (#1318 Phase 4c decision 2).
5843
+ * "No pill": a colour change on hover rather than a filled background.
5844
+ *
5845
+ * The palette step writes nothing (#1318 Phase 4c decision 2), but on a
5846
+ * foreground-adaptive style that is not the end of the story: the hover colour
5847
+ * is derived from the resolved opening foreground at render time, paired with
5848
+ * the resting colour, so `quiet` resolves to a definite colour rather than to
5849
+ * whatever brand token the recipe happened to name. See
5850
+ * `applyOpeningForeground`.
5414
5851
  *
5415
5852
  * It exists because "a colour change on hover, no filled background" was not
5416
5853
  * expressible in the vocabulary, and it is what
@@ -6226,6 +6663,28 @@ z.object({
6226
6663
  });
6227
6664
  //#endregion
6228
6665
  //#region ../blocks/src/system/blocks/events/shared/schemas.ts
6666
+ const publicEventLoaderQuerySchemaShape = {
6667
+ limit: z.string().optional(),
6668
+ from: z.string().optional(),
6669
+ to: z.string().optional(),
6670
+ afterStartsAt: z.string().optional(),
6671
+ afterId: z.string().optional(),
6672
+ categoryIds: z.string().optional(),
6673
+ venueId: z.string().optional(),
6674
+ staffMemberId: z.string().optional(),
6675
+ eventSurface: z.string().optional(),
6676
+ eventPresets: z.string().optional(),
6677
+ scheduleScope: z.string().optional(),
6678
+ seriesId: z.string().optional(),
6679
+ seriesIds: z.string().optional(),
6680
+ runSeriesId: z.string().optional(),
6681
+ seriesSlug: z.string().optional(),
6682
+ includeOccurrenceId: z.string().optional(),
6683
+ readIntent: z.string().optional(),
6684
+ detailLevel: z.string().optional(),
6685
+ readProfile: z.string().optional()
6686
+ };
6687
+ z.object(publicEventLoaderQuerySchemaShape);
6229
6688
  const eventPresetSchema = z.enum([
6230
6689
  "event",
6231
6690
  "class",
@@ -7106,7 +7565,7 @@ function planCalendarMonthRanges(months) {
7106
7565
  const sorted = [...new Set(months)].sort();
7107
7566
  const ranges = [];
7108
7567
  for (const month of sorted) {
7109
- const previous = ranges.at(-1);
7568
+ const previous = ranges[ranges.length - 1];
7110
7569
  const end = calendarMonthKey(addMonths(calendarMonthDate(month), 1));
7111
7570
  if (previous?.endMonthExclusive === month && monthNumber(end) - monthNumber(previous.startMonth) <= 3) previous.endMonthExclusive = end;
7112
7571
  else ranges.push({
@@ -10413,6 +10872,44 @@ function getRegistrationStartAt(event, occurrenceContext) {
10413
10872
  return event?.registrationSubject.kind === "wholeSeries" ? event.startsAt : occurrenceContext?.startsAt ?? event?.startsAt;
10414
10873
  }
10415
10874
  //#endregion
10875
+ //#region ../blocks/src/system/runtime/nodes/event-registration/eventSourceRecovery.ts
10876
+ const { limit: _rawLimit, eventSurface: _rawEventSurface, scheduleScope: _rawScheduleScope, detailLevel: _rawDetailLevel, ...stringEventQueryShape } = publicEventLoaderQuerySchemaShape;
10877
+ const eventRecoveryRequestSchema = z.object({
10878
+ ...stringEventQueryShape,
10879
+ limit: z.coerce.number().int().positive().optional(),
10880
+ eventSurface: z.enum(eventSurfaceScopeValues).optional(),
10881
+ scheduleScope: z.enum(eventScheduleScopeValues).optional(),
10882
+ detailLevel: z.enum(["full", "listing"]).optional(),
10883
+ stage: z.enum(["preview", "published"]).optional()
10884
+ });
10885
+ function resolveEventRegistrationEventSource(input) {
10886
+ if (input.wholeSeriesRunEvents != null) return {
10887
+ kind: "loaded",
10888
+ events: input.wholeSeriesRunEvents
10889
+ };
10890
+ if (input.events != null) return {
10891
+ kind: "loaded",
10892
+ events: input.events
10893
+ };
10894
+ return {
10895
+ kind: "unresolved",
10896
+ request: parseEventLoaderRecoveryRequest(input.failures?.wholeSeriesRunEvents ?? input.failures?.events)
10897
+ };
10898
+ }
10899
+ const eventLoaderFailureSchema = z.object({
10900
+ endpoint: z.literal("listPublicEvents"),
10901
+ params: eventRecoveryRequestSchema.extend({ siteId: z.string().optional() })
10902
+ });
10903
+ function parseEventLoaderRecoveryRequest(value) {
10904
+ const parsed = eventLoaderFailureSchema.safeParse(value);
10905
+ if (!parsed.success) return null;
10906
+ const { siteId: _siteId, stage, ...params } = parsed.data.params;
10907
+ return {
10908
+ ...params,
10909
+ stage: stage ?? "published"
10910
+ };
10911
+ }
10912
+ //#endregion
10416
10913
  //#region ../blocks/src/system/runtime/nodes/event-registration.interactive.ts
10417
10914
  const EVENT_REGISTRATION_GENERIC_SHELL_STEP_LABELS = [
10418
10915
  "Date",
@@ -10430,8 +10927,6 @@ const eventRegistrationPublicEventSchema = z.preprocess(normalizeEventRegistrati
10430
10927
  const eventRegistrationHydrationSchemaShape = {
10431
10928
  occurrenceContext: occurrenceContextSchema.optional(),
10432
10929
  subject: eventRegistrationPageSurfaceSubjectSchema.nullable().optional(),
10433
- events: z.array(eventRegistrationPublicEventSchema).nullable().optional(),
10434
- wholeSeriesRunEvents: z.array(eventRegistrationPublicEventSchema).nullable().optional(),
10435
10930
  maxTickets: z.string().optional(),
10436
10931
  showVenue: z.boolean().optional(),
10437
10932
  showCapacity: z.boolean().optional(),
@@ -10443,12 +10938,22 @@ const eventRegistrationHydrationSchemaShape = {
10443
10938
  sitePasses: publicPassProductCollectionSchema.nullable().optional(),
10444
10939
  siteMemberships: publicMembershipProductCollectionSchema.nullable().optional()
10445
10940
  };
10941
+ const eventRegistrationEventSourceSchema = z.discriminatedUnion("kind", [z.object({
10942
+ kind: z.literal("loaded"),
10943
+ events: z.array(eventRegistrationPublicEventSchema)
10944
+ }), z.object({
10945
+ kind: z.literal("unresolved"),
10946
+ request: eventRecoveryRequestSchema.nullable()
10947
+ })]);
10446
10948
  const eventRegistrationSourceSchema = z.object({
10447
10949
  siteId: z.string().optional(),
10448
10950
  apiBaseUrl: z.string().optional(),
10449
10951
  portalToken: z.string().nullable().optional(),
10450
10952
  previewToken: z.string().nullable().optional(),
10451
10953
  ...eventRegistrationHydrationSchemaShape,
10954
+ events: z.array(eventRegistrationPublicEventSchema).nullable().optional(),
10955
+ wholeSeriesRunEvents: z.array(eventRegistrationPublicEventSchema).nullable().optional(),
10956
+ eventLoaderFailures: z.record(z.string(), z.unknown()).nullable().optional(),
10452
10957
  className: z.string().nullable().optional(),
10453
10958
  buttonText: z.string().nullable().optional(),
10454
10959
  maxTickets: z.string().nullable().optional(),
@@ -10469,7 +10974,10 @@ const eventRegistrationDisplaySchema = z.discriminatedUnion("state", [z.object({
10469
10974
  titleText: z.string(),
10470
10975
  bodyText: z.string()
10471
10976
  })]);
10472
- const eventRegistrationHydrationSchema = z.object(eventRegistrationHydrationSchemaShape);
10977
+ const eventRegistrationHydrationSchema = z.object({
10978
+ ...eventRegistrationHydrationSchemaShape,
10979
+ eventSource: eventRegistrationEventSourceSchema
10980
+ });
10473
10981
  const eventRegistrationRenderSchema = z.object({
10474
10982
  display: eventRegistrationDisplaySchema,
10475
10983
  hydration: eventRegistrationHydrationSchema
@@ -10482,8 +10990,8 @@ const eventRegistrationIslandMetaCodec = createZodCodec(z.object({
10482
10990
  stage: previewStageSchema.optional()
10483
10991
  }));
10484
10992
  const eventRegistrationIslandMetaKeys = defineInteractiveIslandMetaKeys("siteId", "apiBaseUrl", "portalToken", "previewToken", "stage");
10485
- function buildEventRegistrationDisplay(source) {
10486
- const selectedRun = resolveSelectedWholeSeriesRun(source);
10993
+ function buildEventRegistrationDisplayFromScopedEvents(source, scopedSourceEvents) {
10994
+ const selectedRun = resolveSelectedWholeSeriesRun(scopedSourceEvents);
10487
10995
  if (selectedRun && (!selectedRun.run.enrollmentOpen || toWholeSeriesRegistrationEvent(selectedRun) === null)) return {
10488
10996
  kind: "event-registration",
10489
10997
  state: "registration-closed",
@@ -10491,7 +10999,7 @@ function buildEventRegistrationDisplay(source) {
10491
10999
  titleText: "Registration closed",
10492
11000
  bodyText: "This run is no longer open for bookings."
10493
11001
  };
10494
- const stepLabels = buildEventRegistrationShellStepLabels(source);
11002
+ const stepLabels = buildEventRegistrationShellStepLabels(source, scopedSourceEvents);
10495
11003
  return {
10496
11004
  kind: "event-registration",
10497
11005
  state: "generic-shell",
@@ -10502,8 +11010,8 @@ function buildEventRegistrationDisplay(source) {
10502
11010
  summaryButtonText: source.buttonText?.trim() || "Register"
10503
11011
  };
10504
11012
  }
10505
- function buildEventRegistrationShellStepLabels(source) {
10506
- const selectedRun = resolveSelectedWholeSeriesRun(source);
11013
+ function buildEventRegistrationShellStepLabels(source, scopedSourceEvents) {
11014
+ const selectedRun = resolveSelectedWholeSeriesRun(scopedSourceEvents);
10507
11015
  if (selectedRun) {
10508
11016
  const selectedEvent = toWholeSeriesRegistrationEvent(selectedRun);
10509
11017
  if (!selectedEvent) return EVENT_REGISTRATION_GENERIC_SHELL_STEP_LABELS;
@@ -10513,7 +11021,7 @@ function buildEventRegistrationShellStepLabels(source) {
10513
11021
  event: selectedEvent
10514
11022
  })).map((step) => shellLabelForRegistrationStep(step, [selectedEvent]));
10515
11023
  }
10516
- const scopedEvents = scopeEventRegistrationEvents(source);
11024
+ const scopedEvents = toScopedEventRegistrationEvents(scopedSourceEvents);
10517
11025
  if (scopedEvents.length === 0) return EVENT_REGISTRATION_GENERIC_SHELL_STEP_LABELS;
10518
11026
  const preSelectedEvent = findPreSelectedEvent({
10519
11027
  scopedEvents,
@@ -10526,21 +11034,11 @@ function buildEventRegistrationShellStepLabels(source) {
10526
11034
  event: preSelectedEvent
10527
11035
  }) : false).map((step) => shellLabelForRegistrationStep(step, scopedEvents));
10528
11036
  }
10529
- function scopeEventRegistrationEvents(source) {
10530
- const scoped = scopeEventRegistrationSourceEvents(source);
10531
- return [...toRegistrationEvents(scoped), ...toWholeSeriesRegistrationEvents(scoped)];
11037
+ function toScopedEventRegistrationEvents(scopedSourceEvents) {
11038
+ return [...toRegistrationEvents(scopedSourceEvents), ...toWholeSeriesRegistrationEvents(scopedSourceEvents)];
10532
11039
  }
10533
- /**
10534
- * Every event this surface may register for, from both of its loads.
10535
- *
10536
- * The date page and the run read answer different questions and can name the
10537
- * same occurrence, so the two lists are joined and any occurrence that arrives
10538
- * twice is kept once, in the order the date page gave it.
10539
- */
10540
- function scopeEventRegistrationSourceEvents(source) {
10541
- const byOccurrenceId = /* @__PURE__ */ new Map();
10542
- for (const event of [...source.events ?? [], ...source.wholeSeriesRunEvents ?? []]) if (!byOccurrenceId.has(event.occurrenceId)) byOccurrenceId.set(event.occurrenceId, event);
10543
- return resolveEventRegistrationScopedEvents([...byOccurrenceId.values()], {
11040
+ function scopeEventRegistrationSourceEvents(source, eventSource) {
11041
+ return resolveEventRegistrationScopedEvents(eventSource.kind === "loaded" ? eventSource.events : [], {
10544
11042
  occurrenceContext: source.occurrenceContext,
10545
11043
  subject: source.subject
10546
11044
  });
@@ -10549,8 +11047,8 @@ function scopeEventRegistrationSourceEvents(source) {
10549
11047
  * The one run this surface is registering for, when the scoped events describe
10550
11048
  * exactly one. More than one run means the visitor still has to choose.
10551
11049
  */
10552
- function resolveSelectedWholeSeriesRun(source) {
10553
- const runs = groupPublicEventsByRun(scopeEventRegistrationSourceEvents(source));
11050
+ function resolveSelectedWholeSeriesRun(scopedSourceEvents) {
11051
+ const runs = groupPublicEventsByRun(scopedSourceEvents);
10554
11052
  return runs.length === 1 ? runs[0] : null;
10555
11053
  }
10556
11054
  function shellLabelForRegistrationStep(step, events) {
@@ -10584,13 +11082,21 @@ const eventRegistrationBlockRuntime = defineClientOwnedBlockRuntime({
10584
11082
  render: createZodCodec(eventRegistrationRenderSchema)
10585
11083
  },
10586
11084
  buildRender: (source) => {
10587
- const events = source.events == null ? null : scopeEventRegistrationSourceEvents(source);
11085
+ const eventSource = resolveEventRegistrationEventSource({
11086
+ events: source.events,
11087
+ wholeSeriesRunEvents: source.wholeSeriesRunEvents,
11088
+ failures: source.eventLoaderFailures
11089
+ });
11090
+ const scopedSourceEvents = scopeEventRegistrationSourceEvents(source, eventSource);
10588
11091
  return {
10589
- display: buildEventRegistrationDisplay(source),
11092
+ display: buildEventRegistrationDisplayFromScopedEvents(source, scopedSourceEvents),
10590
11093
  hydration: {
10591
11094
  occurrenceContext: source.occurrenceContext ?? null,
10592
11095
  subject: source.subject ?? null,
10593
- events,
11096
+ eventSource: eventSource.kind === "loaded" ? {
11097
+ ...eventSource,
11098
+ events: [...scopedSourceEvents]
11099
+ } : eventSource,
10594
11100
  maxTickets: source.maxTickets ?? void 0,
10595
11101
  showVenue: source.showVenue,
10596
11102
  showCapacity: source.showCapacity,
@@ -10863,63 +11369,13 @@ const giftingInteractiveIslandPropsCodec = createInteractiveIslandCodec({
10863
11369
  })
10864
11370
  });
10865
11371
  //#endregion
10866
- //#region ../blocks/src/system/blocks/newsletter-signup-destination.ts
10867
- function parseNewsletterSignupBlockId(value) {
10868
- const trimmed = parseTrimmedString(value);
10869
- return trimmed && BLOCK_ID_PATTERN.test(trimmed) ? trimmed : null;
10870
- }
10871
- function parseSignedNewsletterDestinationRef(value) {
10872
- const trimmed = parseTrimmedString(value);
10873
- return trimmed && SIGNED_DESTINATION_REF_PATTERN.test(trimmed) ? trimmed : null;
10874
- }
10875
- function buildNewsletterSignupBlockRef(blockId) {
10876
- const parsed = parseNewsletterSignupBlockId(blockId);
10877
- return parsed ? {
10878
- tag: "block_ref",
10879
- blockId: parsed
10880
- } : null;
10881
- }
10882
- function normalizeNewsletterSignupEditorValuesForDestination(values) {
10883
- const destinationProvider = parseNewsletterSignupDestinationProvider(values.destinationProvider) ?? "riverbank";
10884
- if (destinationProvider === "mailchimp") return {
10885
- destinationProvider,
10886
- mailchimpAudienceId: values.mailchimpAudienceId,
10887
- mailchimpTags: values.mailchimpTags
10888
- };
10889
- return {
10890
- destinationProvider,
10891
- listId: values.listId,
10892
- tags: values.tags
10893
- };
10894
- }
10895
- function deriveNewsletterSignupRuntimeSource(values) {
10896
- const normalized = normalizeNewsletterSignupEditorValuesForDestination(values);
10897
- if (normalized.destinationProvider === "mailchimp") return {
10898
- destinationProvider: "mailchimp",
10899
- listId: null,
10900
- tags: null
10901
- };
10902
- return {
10903
- destinationProvider: "riverbank",
10904
- listId: parseTrimmedString(normalized.listId),
10905
- tags: parseTrimmedString(normalized.tags)
10906
- };
10907
- }
10908
- const BLOCK_ID_PATTERN = /^[A-Za-z0-9._:-]{1,200}$/;
10909
- const SIGNED_DESTINATION_REF_PATTERN = /^[A-Za-z0-9._~-]{16,1000}$/;
10910
- function parseTrimmedString(value) {
10911
- if (typeof value !== "string") return null;
10912
- const trimmed = value.trim();
10913
- return trimmed.length > 0 ? trimmed : null;
10914
- }
10915
- //#endregion
10916
11372
  //#region ../blocks/src/system/runtime/nodes/newsletter-form.types.ts
10917
11373
  /**
10918
11374
  * Get form fields based on preset configuration.
10919
11375
  */
10920
- function getPresetFields(preset, options) {
10921
- const includePhone = Boolean(options?.includePhone);
10922
- switch (preset) {
11376
+ function getGlobalFormFields(form) {
11377
+ const includePhone = form.includeOptionalPhone;
11378
+ switch (form.fields.preset) {
10923
11379
  case "emailOnly": return withOptionalPhone([{
10924
11380
  id: "email",
10925
11381
  type: "email",
@@ -10937,7 +11393,7 @@ function getPresetFields(preset, options) {
10937
11393
  id: "name",
10938
11394
  type: "text",
10939
11395
  label: "Name",
10940
- required: false,
11396
+ required: form.fields.name === "required",
10941
11397
  placeholder: "Your name"
10942
11398
  }], includePhone);
10943
11399
  case "emailFirstLast": return withOptionalPhone([
@@ -10952,14 +11408,14 @@ function getPresetFields(preset, options) {
10952
11408
  id: "firstName",
10953
11409
  type: "text",
10954
11410
  label: "First Name",
10955
- required: false,
11411
+ required: form.fields.firstName === "required",
10956
11412
  placeholder: "First name"
10957
11413
  },
10958
11414
  {
10959
11415
  id: "lastName",
10960
11416
  type: "text",
10961
11417
  label: "Last Name",
10962
- required: false,
11418
+ required: form.fields.lastName === "required",
10963
11419
  placeholder: "Last name"
10964
11420
  }
10965
11421
  ], includePhone);
@@ -10975,14 +11431,14 @@ function getPresetFields(preset, options) {
10975
11431
  id: "name",
10976
11432
  type: "text",
10977
11433
  label: "Name",
10978
- required: false,
11434
+ required: form.fields.name === "required",
10979
11435
  placeholder: "Your name"
10980
11436
  },
10981
11437
  {
10982
11438
  id: "company",
10983
11439
  type: "text",
10984
11440
  label: "Company",
10985
- required: false,
11441
+ required: form.fields.company === "required",
10986
11442
  placeholder: "Company name"
10987
11443
  }
10988
11444
  ], includePhone);
@@ -11001,14 +11457,29 @@ function withOptionalPhone(fields, includePhone) {
11001
11457
  }
11002
11458
  //#endregion
11003
11459
  //#region ../blocks/src/system/runtime/nodes/newsletter-form.interactive.ts
11004
- const newsletterPresetSchema = z.enum([
11005
- "emailOnly",
11006
- "emailName",
11007
- "emailFirstLast",
11008
- "emailNameCompany"
11009
- ]);
11010
- const newsletterDestinationProviderSchema = z.enum(["riverbank", "mailchimp"]);
11011
11460
  const newsletterButtonVariantSchema = blockButtonRoleSchema;
11461
+ const mailingListContextSchema = z.unknown().transform((value, ctx) => {
11462
+ const parsed = parseMailingListRuntimeContext(value);
11463
+ if (!parsed.ok) {
11464
+ ctx.addIssue({
11465
+ code: z.ZodIssueCode.custom,
11466
+ message: "Invalid mailing-list runtime context"
11467
+ });
11468
+ return z.NEVER;
11469
+ }
11470
+ return parsed.value;
11471
+ });
11472
+ const mailingListTargetingSchema = z.unknown().transform((value, ctx) => {
11473
+ const parsed = parseMailingListPlacementTargeting(value);
11474
+ if (!parsed.ok) {
11475
+ ctx.addIssue({
11476
+ code: z.ZodIssueCode.custom,
11477
+ message: "Invalid mailing-list targeting"
11478
+ });
11479
+ return z.NEVER;
11480
+ }
11481
+ return parsed.value;
11482
+ });
11012
11483
  const newsletterFieldSchema = z.object({
11013
11484
  id: z.string(),
11014
11485
  type: z.enum(["email", "text"]),
@@ -11016,18 +11487,23 @@ const newsletterFieldSchema = z.object({
11016
11487
  required: z.boolean(),
11017
11488
  placeholder: z.string().optional()
11018
11489
  });
11019
- const newsletterSignupBlockIdSchema = z.string().trim().min(1).transform(parseRequiredNewsletterSignupBlockId);
11020
- const signedNewsletterDestinationRefSchema = z.string().trim().min(1).transform(parseRequiredSignedNewsletterDestinationRef);
11490
+ const mailingListSignupBlockIdSchema = z.string().trim().min(1).transform(parseRequiredMailingListSignupBlockId);
11491
+ const mailingListContentVersionIdSchema = z.string().transform((value, ctx) => {
11492
+ const parsed = parseMailingListContentVersionId(value);
11493
+ if (parsed) return parsed;
11494
+ ctx.addIssue({
11495
+ code: z.ZodIssueCode.custom,
11496
+ message: "Invalid mailing-list content version ID"
11497
+ });
11498
+ return z.NEVER;
11499
+ });
11500
+ const signedMailingListSourceTokenSchema = z.string().trim().min(1).transform(parseRequiredMailingListSignedSourceToken);
11021
11501
  const newsletterSourceCommonSchema = z.object({
11022
11502
  siteId: z.string().optional(),
11023
11503
  apiBaseUrl: z.string().optional(),
11024
- preset: newsletterPresetSchema.optional(),
11025
- includePhone: z.boolean().optional(),
11026
- buttonLabel: z.string().nullable().optional(),
11504
+ mailingList: mailingListContextSchema.optional(),
11505
+ targeting: mailingListTargetingSchema.optional(),
11027
11506
  buttonVariant: newsletterButtonVariantSchema.nullable().optional(),
11028
- successMessage: z.string().nullable().optional(),
11029
- privacyNote: z.string().nullable().optional(),
11030
- tags: z.string().nullable().optional(),
11031
11507
  spamProtectionEnabled: z.boolean().optional(),
11032
11508
  className: z.string().nullable().optional()
11033
11509
  });
@@ -11035,54 +11511,61 @@ const newsletterSourceSchema = z.discriminatedUnion("source", [
11035
11511
  newsletterSourceCommonSchema.extend({
11036
11512
  source: z.literal("block"),
11037
11513
  blockId: z.string().nullable().optional(),
11038
- listId: z.string().nullable().optional(),
11039
- destinationProvider: newsletterDestinationProviderSchema.nullable().optional()
11514
+ contentVersionId: z.string().nullable().optional()
11040
11515
  }),
11041
11516
  newsletterSourceCommonSchema.extend({
11042
11517
  source: z.literal("signed-footer"),
11043
- destinationRef: z.object({
11044
- tag: z.literal("signed_destination_ref"),
11045
- token: signedNewsletterDestinationRefSchema
11518
+ sourceRef: z.object({
11519
+ tag: z.literal("signed_source_ref"),
11520
+ token: signedMailingListSourceTokenSchema
11046
11521
  })
11047
11522
  }),
11048
- newsletterSourceCommonSchema.extend({
11049
- source: z.literal("legacy-direct-list"),
11050
- listId: z.string().nullable()
11051
- })
11523
+ newsletterSourceCommonSchema.extend({ source: z.literal("preview") })
11052
11524
  ]);
11053
11525
  const newsletterDisplaySchema = z.object({
11054
11526
  kind: z.literal("newsletter-form"),
11527
+ availability: z.enum(["ready", "unavailable"]),
11055
11528
  className: z.string().nullable(),
11056
11529
  buttonLabel: z.string(),
11530
+ successMessage: z.string(),
11057
11531
  buttonVariant: newsletterButtonVariantSchema,
11058
- successMessage: z.string().nullable(),
11059
11532
  privacyNote: z.string().nullable(),
11060
- fields: z.array(newsletterFieldSchema)
11533
+ fields: z.array(newsletterFieldSchema),
11534
+ choices: z.array(z.object({
11535
+ id: z.string(),
11536
+ label: z.string()
11537
+ }))
11061
11538
  });
11062
11539
  const newsletterHydrationSchema = z.object({
11063
11540
  target: z.discriminatedUnion("tag", [
11064
11541
  z.object({
11065
11542
  tag: z.literal("block-source"),
11066
- destinationRef: z.object({
11543
+ sourceRef: z.object({
11067
11544
  tag: z.literal("block_ref"),
11068
- blockId: newsletterSignupBlockIdSchema
11545
+ blockId: mailingListSignupBlockIdSchema,
11546
+ contentVersionId: mailingListContentVersionIdSchema
11069
11547
  }).nullable()
11070
11548
  }),
11071
11549
  z.object({
11072
11550
  tag: z.literal("signed-footer-source"),
11073
- destinationRef: z.object({
11074
- tag: z.literal("signed_destination_ref"),
11075
- token: signedNewsletterDestinationRefSchema
11551
+ sourceRef: z.object({
11552
+ tag: z.literal("signed_source_ref"),
11553
+ token: signedMailingListSourceTokenSchema
11076
11554
  })
11077
11555
  }),
11078
- z.object({
11079
- tag: z.literal("legacy-direct-list"),
11080
- listId: z.string().nullable()
11081
- })
11556
+ z.object({ tag: z.literal("preview") })
11557
+ ]),
11558
+ setupRevision: z.number().int().positive().nullable(),
11559
+ choiceProvider: z.enum([
11560
+ "native",
11561
+ "brevo",
11562
+ "mailchimp"
11563
+ ]).nullable(),
11564
+ choicePresentation: z.enum([
11565
+ "hidden",
11566
+ "automatic",
11567
+ "visitor_choice"
11082
11568
  ]),
11083
- preset: newsletterPresetSchema,
11084
- includePhone: z.boolean(),
11085
- tags: z.string().nullable().optional(),
11086
11569
  spamProtectionEnabled: z.boolean().optional()
11087
11570
  });
11088
11571
  const newsletterRenderSchema = z.object({
@@ -11095,16 +11578,26 @@ const newsletterIslandMetaCodec = createZodCodec(z.object({
11095
11578
  }));
11096
11579
  const newsletterIslandMetaKeys = defineInteractiveIslandMetaKeys("siteId", "apiBaseUrl");
11097
11580
  function buildNewsletterDisplay(source) {
11098
- const preset = source.preset ?? "emailOnly";
11099
- const includePhone = source.includePhone ?? false;
11581
+ const context = source.mailingList;
11582
+ const form = context?.tag === "configured" ? context.form : {
11583
+ fields: { preset: "emailOnly" },
11584
+ includeOptionalPhone: false,
11585
+ buttonLabel: "Subscribe",
11586
+ successMessage: DEFAULT_MAILING_LIST_SUCCESS_MESSAGE,
11587
+ privacyNote: null
11588
+ };
11589
+ const targeting = source.targeting ?? { mode: "default" };
11590
+ const choices = resolveRuntimeChoices(context, targeting);
11100
11591
  return {
11101
11592
  kind: "newsletter-form",
11593
+ availability: runtimeTargetingIsAvailable(context, targeting, choices) ? "ready" : "unavailable",
11102
11594
  className: source.className ?? null,
11103
- buttonLabel: source.buttonLabel?.trim() || "Subscribe",
11595
+ buttonLabel: form.buttonLabel,
11596
+ successMessage: form.successMessage,
11104
11597
  buttonVariant: source.buttonVariant ?? "primary",
11105
- successMessage: source.successMessage ?? "Thanks for subscribing!",
11106
- privacyNote: source.privacyNote ?? null,
11107
- fields: getPresetFields(preset, { includePhone })
11598
+ privacyNote: form.privacyNote,
11599
+ fields: getGlobalFormFields(form),
11600
+ choices
11108
11601
  };
11109
11602
  }
11110
11603
  const newsletterFormBlockRuntime = defineProgressiveBlockRuntime({
@@ -11114,14 +11607,15 @@ const newsletterFormBlockRuntime = defineProgressiveBlockRuntime({
11114
11607
  render: createZodCodec(newsletterRenderSchema)
11115
11608
  },
11116
11609
  buildRender: (source) => {
11117
- const runtimeSource = source.source === "block" ? deriveNewsletterSignupRuntimeSource(source) : null;
11610
+ const targeting = source.targeting ?? { mode: "default" };
11611
+ const presentation = planMailingListChoicePresentation(targeting);
11118
11612
  return {
11119
11613
  display: buildNewsletterDisplay(source),
11120
11614
  hydration: {
11121
11615
  target: projectNewsletterFormHydrationTarget(source),
11122
- preset: source.preset ?? "emailOnly",
11123
- includePhone: source.includePhone ?? false,
11124
- tags: runtimeSource ? runtimeSource.tags : source.tags,
11616
+ setupRevision: source.mailingList?.tag === "configured" ? source.mailingList.revision : null,
11617
+ choiceProvider: targeting.mode === "custom" ? targeting.provider : null,
11618
+ choicePresentation: presentation.tag,
11125
11619
  spamProtectionEnabled: source.spamProtectionEnabled
11126
11620
  }
11127
11621
  };
@@ -11130,27 +11624,79 @@ const newsletterFormBlockRuntime = defineProgressiveBlockRuntime({
11130
11624
  function projectNewsletterFormHydrationTarget(source) {
11131
11625
  switch (source.source) {
11132
11626
  case "block": {
11133
- const destinationRef = buildNewsletterSignupBlockRef(source.blockId);
11134
- if (destinationRef?.tag === "block_ref") return {
11627
+ const sourceRef = buildMailingListSignupBlockSourceRef(source.blockId, source.contentVersionId);
11628
+ if (sourceRef?.tag === "block_ref") return {
11135
11629
  tag: "block-source",
11136
- destinationRef
11630
+ sourceRef
11137
11631
  };
11138
11632
  return {
11139
- tag: "legacy-direct-list",
11140
- listId: source.listId ?? null
11633
+ tag: "block-source",
11634
+ sourceRef: null
11141
11635
  };
11142
11636
  }
11143
11637
  case "signed-footer": return {
11144
11638
  tag: "signed-footer-source",
11145
- destinationRef: source.destinationRef
11146
- };
11147
- case "legacy-direct-list": return {
11148
- tag: "legacy-direct-list",
11149
- listId: source.listId
11639
+ sourceRef: source.sourceRef
11150
11640
  };
11641
+ case "preview": return { tag: "preview" };
11151
11642
  default: return assertNever$2(source);
11152
11643
  }
11153
11644
  }
11645
+ function resolveRuntimeChoices(context, targeting) {
11646
+ if (context?.tag !== "configured" || targeting.mode !== "custom" || targeting.selection.tag !== "visitor_choice" || context.provider.provider !== targeting.provider) return [];
11647
+ switch (targeting.provider) {
11648
+ case "native": {
11649
+ const offered = new Set(targeting.selection.offeredTopicIds);
11650
+ return context.provider.provider === "native" ? context.provider.topics.filter((item) => offered.has(item.id)).map((item) => ({
11651
+ id: item.id,
11652
+ label: item.name
11653
+ })) : [];
11654
+ }
11655
+ case "brevo": {
11656
+ const offered = new Set(targeting.selection.offeredListIds);
11657
+ return context.provider.provider === "brevo" ? context.provider.lists.filter((item) => offered.has(item.id)).map((item) => ({
11658
+ id: String(item.id),
11659
+ label: item.name
11660
+ })) : [];
11661
+ }
11662
+ case "mailchimp": {
11663
+ const offered = new Set(targeting.selection.offeredInterestIds);
11664
+ return (context.provider.provider === "mailchimp" ? context.provider.audiences.find((item) => item.id === targeting.audienceId) : void 0)?.interests.filter((item) => offered.has(item.id)).map((item) => ({
11665
+ id: item.id,
11666
+ label: item.name
11667
+ })) ?? [];
11668
+ }
11669
+ }
11670
+ }
11671
+ function runtimeTargetingIsAvailable(context, targeting, choices) {
11672
+ if (context?.tag !== "configured") return false;
11673
+ const provider = context.provider;
11674
+ if (targeting.mode === "default") switch (provider.provider) {
11675
+ case "native": return provider.topics.some((item) => item.id === provider.defaultTopicId);
11676
+ case "brevo": return provider.lists.some((item) => item.id === provider.defaultListId);
11677
+ case "mailchimp": return provider.audiences.some((item) => item.id === provider.defaultAudienceId);
11678
+ }
11679
+ if (targeting.provider !== provider.provider) return false;
11680
+ switch (targeting.provider) {
11681
+ case "native": return provider.provider === "native" && nativeTargetIsAvailable(provider, targeting, choices);
11682
+ case "brevo": return provider.provider === "brevo" && brevoTargetIsAvailable(provider, targeting, choices);
11683
+ case "mailchimp": return provider.provider === "mailchimp" && mailchimpTargetIsAvailable(provider, targeting, choices);
11684
+ }
11685
+ }
11686
+ function nativeTargetIsAvailable(provider, targeting, choices) {
11687
+ const ids = targeting.selection.tag === "fixed" ? targeting.selection.topicIds : targeting.selection.offeredTopicIds;
11688
+ return ids.every((id) => provider.topics.some((item) => item.id === id)) && (targeting.selection.tag !== "visitor_choice" || choices.length === ids.length);
11689
+ }
11690
+ function brevoTargetIsAvailable(provider, targeting, choices) {
11691
+ const ids = targeting.selection.tag === "fixed" ? targeting.selection.listIds : targeting.selection.offeredListIds;
11692
+ return ids.every((id) => provider.lists.some((item) => item.id === id)) && (targeting.selection.tag !== "visitor_choice" || choices.length === ids.length);
11693
+ }
11694
+ function mailchimpTargetIsAvailable(provider, targeting, choices) {
11695
+ const audience = provider.audiences.find((item) => item.id === targeting.audienceId);
11696
+ if (!audience) return false;
11697
+ const ids = targeting.selection.tag === "fixed" ? targeting.selection.interestIds : targeting.selection.offeredInterestIds;
11698
+ return ids.every((id) => audience.interests.some((item) => item.id === id)) && (targeting.selection.tag !== "visitor_choice" || choices.length === ids.length);
11699
+ }
11154
11700
  const newsletterFormInteractiveIslandPropsCodec = createInteractiveIslandCodec({
11155
11701
  runtime: newsletterFormBlockRuntime,
11156
11702
  mode: "newsletter-form",
@@ -11161,14 +11707,14 @@ const newsletterFormInteractiveIslandPropsCodec = createInteractiveIslandCodec({
11161
11707
  apiBaseUrl: value.apiBaseUrl
11162
11708
  })
11163
11709
  });
11164
- function parseRequiredNewsletterSignupBlockId(value) {
11165
- const parsed = parseNewsletterSignupBlockId(value);
11166
- if (!parsed) throw new Error("Newsletter signup block destination ref requires blockId");
11710
+ function parseRequiredMailingListSignupBlockId(value) {
11711
+ const parsed = parseMailingListBlockId(value);
11712
+ if (!parsed) throw new Error("Mailing-list signup block source ref requires blockId");
11167
11713
  return parsed;
11168
11714
  }
11169
- function parseRequiredSignedNewsletterDestinationRef(value) {
11170
- const parsed = parseSignedNewsletterDestinationRef(value);
11171
- if (!parsed) throw new Error("Newsletter signup signed destination ref requires token");
11715
+ function parseRequiredMailingListSignedSourceToken(value) {
11716
+ const parsed = parseMailingListSignedSourceToken(value);
11717
+ if (!parsed) throw new Error("Mailing-list signup signed source ref requires token");
11172
11718
  return parsed;
11173
11719
  }
11174
11720
  //#endregion
@@ -12075,4 +12621,4 @@ function defineIslandPropsDecoder(kind) {
12075
12621
  };
12076
12622
  }
12077
12623
  //#endregion
12078
- export { getOrderedDayNames as $, toBookingTimeZone as $t, isSemanticSpacing as A, isBookingRequirementConsentFieldId as At, buildEventRuntimeFilters as B, CANCELLED_SESSION_STATUS as Bt, WIZARD_STEPS as C, resolveBookingPaymentStep as Ct, staticHeaderChromeRuntime as D, projectSelectedAppointmentConsentIntoForm as Dt, buildEventCalendarListingRender as E, toSelectedCollectionOptionKind as Et, calendarWindowBounds as F, err as Ft, getCardOrientation as G, formatBookingDateTime as Gt, normalizeCsvIds as H, addLocalScheduleDays as Ht, calendarWindowMonths as I, ok as It, addDays as J, formatLocalScheduleDate as Jt, getContainerClass as K, formatBookingInstant as Kt, calendarWindowPageSchema as L, okWith as Lt, calendarMonthDate as M, isRecord$4 as Mt, calendarPageResponseError as N, assertNever$1 as Nt, resolveEventRegistrationScopedEvents as O, resolveSelectedAppointmentConsent as Ot, calendarQueryKey as P, clearWorkflowFeedback as Pt, getDayOfWeek as Q, resolveBookingTimeZoneId as Qt, planCalendarMonthRanges as R, reportWorkflowError as Rt, resolveRegistrationTarget as S, resolveAppointmentCheckoutVerificationState as St, getWizardStepsForContext as T, resolveDefaultBookingServiceId as Tt, normalizeCsvString as U, formatBookingDate as Ut, getEventRuntimeFiltersKey as V, resolveWholeSeriesBookingPhase as Vt, normalizeOptionalId as W, formatBookingDateParts as Wt, buildCalendarViewport as X, getLocalScheduleDate as Xt, addMonths as Y, getBookingLocalDateKey as Yt, formatDateKey as Z, parseBookingLocalDate as Zt, toWholeSeriesRegistrationEvents as _, getBookingServiceSlidingScale as _t, buildProductDetailDisplay as a, publicEventPricingCurrency as an, groupPublicEventsByRun as at, resolveDiscountContext as b, parseBookingCurrencyInputToCents as bt, EMPTY_COMMERCE_CART_STATE as c, publicEventPricingStrategy as cn, resolveOnColorForThemeToken as ct, deriveCommerceCheckoutState as d, assertNever$2 as dn, normalizeCardRole as dt, toScheduledBookingDateRange as en, getWeekCalendarDays as et, parseStoredCommerceCartState as f, logger as ft, toRegistrationEvents as g, getBookingRedirectStateFromLocation as gt, getRegistrationStartAt as h, formatBookingSubmissionPreparationError as ht, buildProductCardDisplay as i, isPublicEventPricingOptionDisplayable as in, resolveRuntimeEventDestination as it, resolveSpacing as j, RichTextDocSchema as jt, SEMANTIC_SPACING_VALUES as k, BOOKING_FORM_DATA_RESERVED_KEYS as kt, buildPassCartItem as l, publicEventPricingType as ln, resolveTokenOrCssColorValue as lt, reduceCommerceCart as m, formatBookingCentsAsCurrencyInput as mt, getShopDisplayForItems as n, formatBookingPriceDisplay as nn, isToday as nt, formatCommercePrice as o, publicEventPricingDisplay as on, boxBackgroundSchema as ot, productItemKey as p, deriveBookingFormViewState as pt, MONTH_NAMES as q, formatBookingTime as qt, buildCartDisplay as r, formatEventPricing as rn, shiftCalendarAnchorDate as rt, formatInterval as s, publicEventPricingOptions as sn, isCssColorLiteral as st, defineIslandPropsDecoder as t, toScheduledBookingDateTime as tn, isSameCalendarDay as tt, buildProductCartItem as u, formatCurrencyAmount as un, themeButtonClassName as ut, findEventByOccurrenceId as v, getBookingSuccessMessage as vt, getStepNumber as w, resolveBookingSiteId as wt, resolveEventRequiresPayment as x, prepareBookingSubmission as xt, findPreSelectedEvent as y, isBookingServiceSlidingAmountInRange as yt, resolveCalendarReadProfile as z, reportWorkflowSuccess as zt };
12624
+ export { getDayOfWeek as $, parseBookingLocalDate as $t, SEMANTIC_SPACING_VALUES as A, BOOKING_FORM_DATA_RESERVED_KEYS as At, resolveCalendarReadProfile as B, reportWorkflowSuccess as Bt, resolveRegistrationTarget as C, resolveAppointmentCheckoutVerificationState as Ct, buildEventCalendarListingRender as D, toSelectedCollectionOptionKind as Dt, getWizardStepsForContext as E, resolveDefaultBookingServiceId as Et, calendarQueryKey as F, clearWorkflowFeedback as Ft, normalizeOptionalId as G, formatBookingDate as Gt, getEventRuntimeFiltersKey as H, resolveWholeSeriesBookingPhase as Ht, calendarWindowBounds as I, err as It, MONTH_NAMES as J, formatBookingInstant as Jt, getCardOrientation as K, formatBookingDateParts as Kt, calendarWindowMonths as L, ok as Lt, resolveSpacing as M, RichTextDocSchema as Mt, calendarMonthDate as N, isRecord$4 as Nt, staticHeaderChromeRuntime as O, projectSelectedAppointmentConsentIntoForm as Ot, calendarPageResponseError as P, assertNever$1 as Pt, formatDateKey as Q, getLocalScheduleDate as Qt, calendarWindowPageSchema as R, okWith as Rt, resolveEventRequiresPayment as S, prepareBookingSubmission as St, getStepNumber as T, resolveBookingSiteId as Tt, normalizeCsvIds as U, parseMailingListVisitorSelection as Ut, buildEventRuntimeFilters as V, CANCELLED_SESSION_STATUS as Vt, normalizeCsvString as W, addLocalScheduleDays as Wt, addMonths as X, formatLocalScheduleDate as Xt, addDays as Y, formatBookingTime as Yt, buildCalendarViewport as Z, getBookingLocalDateKey as Zt, toRegistrationEvents as _, getBookingRedirectStateFromLocation as _t, buildProductDetailDisplay as a, formatEventPricing as an, resolveRuntimeEventDestination as at, findPreSelectedEvent as b, isBookingServiceSlidingAmountInRange as bt, EMPTY_COMMERCE_CART_STATE as c, publicEventPricingDisplay as cn, isCssColorLiteral as ct, deriveCommerceCheckoutState as d, publicEventPricingType as dn, themeButtonClassName as dt, resolveBookingTimeZoneId as en, getOrderedDayNames as et, parseStoredCommerceCartState as f, formatCurrencyAmount as fn, normalizeCardRole as ft, getRegistrationStartAt as g, formatBookingSubmissionPreparationError as gt, buildEventRegistrationDisplayFromScopedEvents as h, formatBookingCentsAsCurrencyInput as ht, buildProductCardDisplay as i, formatBookingPriceDisplay as in, shiftCalendarAnchorDate as it, isSemanticSpacing as j, isBookingRequirementConsentFieldId as jt, resolveEventRegistrationScopedEvents as k, resolveSelectedAppointmentConsent as kt, buildPassCartItem as l, publicEventPricingOptions as ln, resolveOnColorForThemeToken as lt, reduceCommerceCart as m, assertNever$2 as mn, deriveBookingFormViewState as mt, getShopDisplayForItems as n, toScheduledBookingDateRange as nn, isSameCalendarDay as nt, formatCommercePrice as o, isPublicEventPricingOptionDisplayable as on, groupPublicEventsByRun as ot, productItemKey as p, parseCurrencyCode as pn, logger as pt, getContainerClass as q, formatBookingDateTime as qt, buildCartDisplay as r, toScheduledBookingDateTime as rn, isToday as rt, formatInterval as s, publicEventPricingCurrency as sn, boxBackgroundSchema as st, defineIslandPropsDecoder as t, toBookingTimeZone as tn, getWeekCalendarDays as tt, buildProductCartItem as u, publicEventPricingStrategy as un, resolveTokenOrCssColorValue as ut, toWholeSeriesRegistrationEvents as v, getBookingServiceSlidingScale as vt, WIZARD_STEPS as w, resolveBookingPaymentStep as wt, resolveDiscountContext as x, parseBookingCurrencyInputToCents as xt, findEventByOccurrenceId as y, getBookingSuccessMessage as yt, planCalendarMonthRanges as z, reportWorkflowError as zt };