@riverbankcms/sdk 0.89.1 → 0.90.1

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 (178) hide show
  1. package/README.md +27 -4
  2. package/dist/{PreviewEditorSidebar-JDR64FEC.mjs → PreviewEditorSidebar-FNFRVSIM.mjs} +3 -3
  3. package/dist/{PreviewEditorUI-67TMJMAF.mjs → PreviewEditorUI-3WXJFQXG.mjs} +3 -3
  4. package/dist/SdkPreviewModeRuntime-2UCIMKUB.mjs +8 -0
  5. package/dist/_dts/ai/src/contracts/proposals.d.ts +216 -0
  6. package/dist/_dts/altcha/src/AltchaWidget.d.ts +1 -1
  7. package/dist/_dts/api/src/bookingConfig.d.ts +3 -0
  8. package/dist/_dts/api/src/bookingOperations.d.ts +2 -0
  9. package/dist/_dts/api/src/bookingRecords.d.ts +4 -2
  10. package/dist/_dts/api/src/bookings.d.ts +3 -1
  11. package/dist/_dts/api/src/event-listing-destination.d.ts +59 -0
  12. package/dist/_dts/api/src/index.d.ts +10 -5
  13. package/dist/_dts/api/src/navigation/dashboardSettingsNav.d.ts +0 -1
  14. package/dist/_dts/api/src/navigation.d.ts +2 -0
  15. package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +18 -6
  16. package/dist/_dts/api/src/request.d.ts +21 -0
  17. package/dist/_dts/api/src/sdk-event-upsert.d.ts +3 -1
  18. package/dist/_dts/api/src/sdkContracts.d.ts +2 -0
  19. package/dist/_dts/api/src/settings/permissions.d.ts +273 -0
  20. package/dist/_dts/api/src/types.d.ts +4 -1
  21. package/dist/_dts/api/src/url.d.ts +6 -3
  22. package/dist/_dts/block-form/src/utils/visibleWhen.d.ts +1 -0
  23. package/dist/_dts/block-form/src/widgets/RepeaterField/components/RepeaterThumbnailCard.d.ts +5 -1
  24. package/dist/_dts/block-form/src/widgets/RepeaterField/components/RepeaterThumbnailGrid.d.ts +9 -1
  25. package/dist/_dts/block-form/src/widgets/RepeaterField/components/index.d.ts +1 -0
  26. package/dist/_dts/blocks/src/contracts/non-block-islands.d.ts +7 -11
  27. package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +6 -0
  28. package/dist/_dts/blocks/src/index.d.ts +2 -1
  29. package/dist/_dts/blocks/src/system/blocks/events/event-calendar.d.ts +14 -6
  30. package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +60 -2
  31. package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +16 -5
  32. package/dist/_dts/blocks/src/system/blocks/hero.d.ts +0 -2
  33. package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +9 -9
  34. package/dist/_dts/blocks/src/system/blocks/shop.d.ts +3 -3
  35. package/dist/_dts/blocks/src/system/blocks/shop.shared.d.ts +8 -0
  36. package/dist/_dts/blocks/src/system/blocks/team-members.d.ts +1 -1
  37. package/dist/_dts/blocks/src/system/constants/events.d.ts +4 -1
  38. package/dist/_dts/blocks/src/system/manifest/schema.d.ts +3 -1
  39. package/dist/_dts/blocks/src/system/runtime/api/index.d.ts +1 -0
  40. package/dist/_dts/blocks/src/system/runtime/api/types.d.ts +17 -5
  41. package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +51 -6
  42. package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +24 -0
  43. package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/useCourseRegistrationWizard.d.ts +2 -2
  44. package/dist/_dts/blocks/src/system/runtime/nodes/event-details/logic.d.ts +1 -17
  45. package/dist/_dts/blocks/src/system/runtime/nodes/event-details.client.d.ts +5 -9
  46. package/dist/_dts/blocks/src/system/runtime/nodes/event-details.server.d.ts +5 -9
  47. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.contract.d.ts +7 -1
  48. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventPaymentOptions.d.ts +48 -0
  49. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/types.d.ts +5 -0
  50. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useDiscountCodeUi.d.ts +4 -4
  51. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useDiscountCodeUi.state.d.ts +50 -0
  52. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +2 -2
  53. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.interactive.d.ts +21 -0
  54. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.server.d.ts +1 -1
  55. package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCalendar.interactive.d.ts +11 -1
  56. package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCombined.client.d.ts +2 -1
  57. package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCombined.interactive.d.ts +11 -1
  58. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/calendarViewOptions.d.ts +10 -0
  59. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/destination.d.ts +8 -0
  60. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventProductEligibility.d.ts +24 -0
  61. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/pricing.d.ts +3 -0
  62. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/utils.d.ts +7 -0
  63. package/dist/_dts/blocks/src/system/runtime/nodes/shared/contract-schemas.d.ts +5 -2
  64. package/dist/_dts/blocks/src/system/runtime/nodes/shop-checkout-form.d.ts +2 -2
  65. package/dist/_dts/content-model/src/entry-slots/index.d.ts +1 -0
  66. package/dist/_dts/content-model/src/entry-slots/sdkBlocks.d.ts +21 -0
  67. package/dist/_dts/content-model/src/entry-slots/types.d.ts +7 -0
  68. package/dist/_dts/core/src/event-pricing.d.ts +12 -2
  69. package/dist/_dts/core/src/money-input.d.ts +18 -0
  70. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +50 -0
  71. package/dist/_dts/media-editor/src/MediaEditor.d.ts +2 -1
  72. package/dist/_dts/media-editor/src/fieldUi.d.ts +6 -0
  73. package/dist/_dts/media-editor/src/index.d.ts +1 -1
  74. package/dist/_dts/preview-next/src/client/index.d.ts +1 -0
  75. package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +3 -2
  76. package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +3 -2
  77. package/dist/_dts/preview-next/src/client/preview/PreviewThemedSiteDocument.d.ts +3 -2
  78. package/dist/_dts/preview-next/src/client/preview/SiteChromeEditableSurface.d.ts +2 -2
  79. package/dist/_dts/preview-next/src/client/preview/themeRuntime.d.ts +6 -0
  80. package/dist/_dts/preview-next/src/client/sdk/SdkPreviewMode.d.ts +2 -1
  81. package/dist/_dts/sdk/src/cli/commands/pull-dated-offering-scope.d.ts +10 -0
  82. package/dist/_dts/sdk/src/cli/content/reader.d.ts +12 -5
  83. package/dist/_dts/sdk/src/client/management/types.d.ts +6 -55
  84. package/dist/_dts/sdk/src/components.d.ts +1 -0
  85. package/dist/_dts/sdk/src/config/field-definitions.d.ts +3 -1
  86. package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +3 -1
  87. package/dist/_dts/sdk/src/next/types.d.ts +8 -11
  88. package/dist/_dts/sdk/src/preview-next/client/index.d.ts +1 -1
  89. package/dist/_dts/sdk/src/public-api/contracts.d.ts +11 -1
  90. package/dist/_dts/sdk/src/rendering/blocks-theme-scope.d.ts +2 -1
  91. package/dist/_dts/sdk/src/rendering/components/Layout.d.ts +8 -7
  92. package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +5 -6
  93. package/dist/_dts/sdk/src/rendering/index.d.ts +1 -0
  94. package/dist/_dts/sdk/src/rendering/islands/types.d.ts +11 -1
  95. package/dist/_dts/sdk/src/rendering/server.d.ts +1 -0
  96. package/dist/_dts/sdk/src/rendering/themeRuntime.d.ts +26 -0
  97. package/dist/_dts/sdk/src/version.d.ts +1 -1
  98. package/dist/_dts/site-commands/src/commands.d.ts +18 -0
  99. package/dist/_dts/theme-core/src/ResponsiveScope.d.ts +12 -0
  100. package/dist/_dts/theme-core/src/accordions/types.d.ts +1 -1
  101. package/dist/_dts/theme-core/src/buttons/personalities/types.d.ts +2 -2
  102. package/dist/_dts/theme-core/src/buttons/types.d.ts +5 -5
  103. package/dist/_dts/theme-core/src/cards/types.d.ts +2 -2
  104. package/dist/_dts/theme-core/src/index.d.ts +2 -0
  105. package/dist/_dts/theme-core/src/mock-themes/all.d.ts +21 -21
  106. package/dist/_dts/theme-core/src/schema.d.ts +18 -18
  107. package/dist/_dts/theme-core/src/site-styles/designState.d.ts +2 -2
  108. package/dist/_dts/theme-core/src/site-styles/generatedSchemas.d.ts +2 -2
  109. package/dist/_dts/theme-core/src/site-styles/logoBranding.d.ts +4 -4
  110. package/dist/_dts/theme-core/src/themeRuntime.d.ts +11 -0
  111. package/dist/{chunk-F645A5UV.mjs → chunk-BOQXMCSP.mjs} +129 -101
  112. package/dist/{chunk-7YUAXONX.mjs → chunk-CR2VX432.mjs} +1563 -877
  113. package/dist/{chunk-HKJQERFR.mjs → chunk-FA6LVZ7C.mjs} +91 -55
  114. package/dist/{chunk-TGBJWKMP.mjs → chunk-H6TT5ZXI.mjs} +9 -1
  115. package/dist/{chunk-ZQRBLCW5.mjs → chunk-SYYJZPKU.mjs} +2 -2
  116. package/dist/{chunk-7N46MZHI.mjs → chunk-UG7I7S7W.mjs} +1 -1
  117. package/dist/cli/index.mjs +1057 -632
  118. package/dist/cli/init-docs/content/cli-reference.md +6 -1
  119. package/dist/cli/init-docs/content/content-management.md +27 -0
  120. package/dist/client/{accordion-MUCVNGQ7.mjs → accordion-4K7VGZ3I.mjs} +2 -2
  121. package/dist/client/{bookingForm-PKD6EFIE.mjs → bookingForm-3QXA3CIS.mjs} +26 -271
  122. package/dist/client/bookings.mjs +1586 -825
  123. package/dist/client/{carousel-3TKQSNJC.mjs → carousel-BEJKNGQ7.mjs} +3 -3
  124. package/dist/client/{cart-6XHSZK23.mjs → cart-44BBM6XG.mjs} +7 -8
  125. package/dist/client/{checkout-FVSPM6FI.mjs → checkout-THMHEYKF.mjs} +7 -8
  126. package/dist/client/{chunk-25W2EQUN.mjs → chunk-3H5CLFKT.mjs} +8 -0
  127. package/dist/client/{chunk-ZJZZA5EP.mjs → chunk-4COPESPO.mjs} +13 -16
  128. package/dist/client/chunk-5AJIMWKS.mjs +436 -0
  129. package/dist/client/{chunk-UQFY4AHX.mjs → chunk-B4H6QMPY.mjs} +157 -49
  130. package/dist/client/{chunk-VGLXACVK.mjs → chunk-DQIRKNZE.mjs} +1 -1
  131. package/dist/client/{chunk-7DH35FGA.mjs → chunk-EJBHK74Y.mjs} +1 -1
  132. package/dist/client/{chunk-SDIYSQAY.mjs → chunk-HIHOQGIP.mjs} +2 -3
  133. package/dist/client/{chunk-CQKKFEQD.mjs → chunk-JV7ZNAOU.mjs} +378 -111
  134. package/dist/client/{chunk-FHU6PFPM.mjs → chunk-KNTLBQ3N.mjs} +1 -1
  135. package/dist/client/{chunk-RSQWWUAD.mjs → chunk-PEDNDLPB.mjs} +4 -4
  136. package/dist/client/{chunk-EY42X22F.mjs → chunk-SLY6UDAS.mjs} +157 -5
  137. package/dist/client/{chunk-STJ2NCQM.mjs → chunk-WHZQDPBZ.mjs} +19 -1
  138. package/dist/client/{chunk-ZT5XE7FK.mjs → chunk-ZIAF2DA4.mjs} +1 -1
  139. package/dist/client/client.mjs +3552 -2898
  140. package/dist/client/{courseRegistration-ATZSYDHM.mjs → courseRegistration-URX7RCCK.mjs} +20 -58
  141. package/dist/client/{eventCalendar-6T2UGKKP.mjs → eventCalendar-GTENOQCE.mjs} +10 -11
  142. package/dist/client/{eventCombined-Q4VANXVF.mjs → eventCombined-EZVB72MF.mjs} +10 -11
  143. package/dist/client/{eventDetails-DW37E7VW.mjs → eventDetails-CH4BJR5Z.mjs} +10 -11
  144. package/dist/client/{eventListing-XURTSAUW.mjs → eventListing-4BVOI5HS.mjs} +10 -11
  145. package/dist/client/{eventRegistration-MRKEVAXW.mjs → eventRegistration-37LPIKIE.mjs} +10 -11
  146. package/dist/client/{form-WZZFFGMU.mjs → form-FX3Y54YK.mjs} +7 -7
  147. package/dist/client/{headerSection-EQYVQBLM.mjs → headerSection-UOZZGVYL.mjs} +3 -3
  148. package/dist/client/hooks.mjs +1169 -1063
  149. package/dist/client/{locationMap-MFF5VAZR.mjs → locationMap-VSIPKV35.mjs} +3 -3
  150. package/dist/client/{newsletterForm-JQ77UYIE.mjs → newsletterForm-6FRJKNAF.mjs} +5 -5
  151. package/dist/client/{productDetail-25LMT3IZ.mjs → productDetail-6AHMLXCO.mjs} +7 -8
  152. package/dist/client/{productList-5ABEMKUG.mjs → productList-M2CYIZVH.mjs} +7 -8
  153. package/dist/client/rendering/client.mjs +2912 -2316
  154. package/dist/client/rendering/islands.mjs +19 -19
  155. package/dist/client/rendering.mjs +2874 -2230
  156. package/dist/client/{shop-OMMQZ6YO.mjs → shop-AUOT6GEX.mjs} +7 -8
  157. package/dist/client/spam-protection.mjs +4 -5
  158. package/dist/preview-next/before-render.mjs +2 -2
  159. package/dist/preview-next/client/runtime.mjs +5 -5
  160. package/dist/{sdk-runtime-WNLBZ3ZH.mjs → sdk-runtime-6GPJNLU6.mjs} +6 -6
  161. package/dist/server/components.mjs +1856 -1509
  162. package/dist/server/config-validation.mjs +1394 -1288
  163. package/dist/server/config.mjs +1394 -1288
  164. package/dist/server/data.mjs +1169 -1063
  165. package/dist/server/index.mjs +135 -100
  166. package/dist/server/navigation.mjs +20 -30
  167. package/dist/server/next.mjs +1936 -1576
  168. package/dist/server/page-converter.mjs +1081 -967
  169. package/dist/server/prebuild.mjs +1 -1
  170. package/dist/server/rendering/server.mjs +1868 -1521
  171. package/dist/server/rendering.mjs +1878 -1531
  172. package/dist/server/routing.mjs +1248 -1089
  173. package/dist/server/server.mjs +1312 -1171
  174. package/dist/server/theme-bridge.mjs +8 -5
  175. package/package.json +3 -3
  176. package/dist/SdkPreviewModeRuntime-ZBEMRV7N.mjs +0 -8
  177. package/dist/client/chunk-LQFDYWPJ.mjs +0 -184
  178. package/dist/client/chunk-ZFHRN6W2.mjs +0 -66
@@ -1,17 +1,16 @@
1
1
  "use client";
2
- import { LeafletStaticMap } from './chunk-ZT5XE7FK.mjs';
3
- import { resolveCoursePricingState, useWaitlistClaim, MagicLinkForm, formatCoursePriceAmount, formatCoursePriceDisplay } from './chunk-RSQWWUAD.mjs';
2
+ import { LeafletStaticMap } from './chunk-ZIAF2DA4.mjs';
3
+ import { resolveCoursePricingState, useWaitlistClaim, MagicLinkForm, formatCoursePriceAmount, formatCoursePriceDisplay } from './chunk-PEDNDLPB.mjs';
4
4
  import { CreditCard, Ticket, Star, Sparkles } from './chunk-6N7YRNYU.mjs';
5
- import { usePolling } from './chunk-LQFDYWPJ.mjs';
6
- import { SpinnerNode } from './chunk-FHU6PFPM.mjs';
7
- import { useDiscountCodeUi } from './chunk-ZFHRN6W2.mjs';
8
- import { createBodyThemePortalRoot, TabBarFragment, logoutPortal, consumeSearchParam, StepIndicator, DiscountCodeDisclosure, TerminalPanel, StateIcon, formatPrice, CrossIcon, ClockIcon, LoggedInAsUser, CheckIcon } from './chunk-EY42X22F.mjs';
5
+ import { usePolling, buildBookingPaymentSelectionViewModel } from './chunk-5AJIMWKS.mjs';
6
+ import { SpinnerNode } from './chunk-KNTLBQ3N.mjs';
7
+ import { createBodyThemePortalRoot, TabBarFragment, useDiscountCodeUi, logoutPortal, consumeSearchParam, StepIndicator, DiscountCodeDisclosure, TerminalPanel, StateIcon, formatPrice, CrossIcon, ClockIcon, LoggedInAsUser, CheckIcon } from './chunk-SLY6UDAS.mjs';
9
8
  import { getFieldValidationControlProps, FieldValidationMessage } from './chunk-3DCJ45Z2.mjs';
10
9
  import { ModalShell } from './chunk-WBQG7VJA.mjs';
11
- import { isSpamProtectionEnabled, AltchaWidget, getChallengeUrl } from './chunk-SDIYSQAY.mjs';
12
- import { useBlockApi, FeedbackMessage } from './chunk-STJ2NCQM.mjs';
13
- import { buildEventRuntimeFilters, buildEventCalendarListingRender, groupEventsByDate, getOrderedDayNames, formatDateKey, getEventRuntimeFiltersKey, themeButtonClassName, normalizeCsvIds, normalizeOptionalId, normalizeEventBlockKind, normalizeCsvString, EventCompactRow, EmptyState, getContainerClass, getCardOrientation, isToday, MAX_EVENTS_PER_DAY, formatTime, WIZARD_STEPS, getWizardStepsForContext, getStepNumber, formatEventPriceDisplay, resolveRuntimeEventPricing, formatEventPrice, formatEventDateParts, DateTimeTile, assertNever11, EventCard, buildCalendarViewport, shiftCalendarAnchorDate, addMonths, getThreeMonthRange, buildTimetableModel, formatDate, toRegistrationEvents, isEventContentType, findPreSelectedEvent, resolveRegistrationTarget, findEventByOccurrenceId, resolveEventRequiresPayment, resolveDiscountContext, MONTH_NAMES, getEventAvailability, formatEventTeacherLine } from './chunk-UQFY4AHX.mjs';
14
- import { publicEventPricingType, getBookingLocalDateKey, toScheduledBookingDateTime, toBookingTimeZone, publicEventPricingCurrency, formatBookingDateTime, publicEventPricingMode, publicEventScalarPrice, publicEventTicketTypes, formatCurrencyAmount, formatBookingDate, formatBookingTime } from './chunk-25W2EQUN.mjs';
10
+ import { isSpamProtectionEnabled, AltchaWidget, getChallengeUrl } from './chunk-HIHOQGIP.mjs';
11
+ import { useBlockApi, FeedbackMessage } from './chunk-WHZQDPBZ.mjs';
12
+ import { buildEventRuntimeFilters, buildEventCalendarListingRender, groupEventsByDate, getOrderedDayNames, formatDateKey, getEventRuntimeFiltersKey, themeButtonClassName, normalizeCsvIds, normalizeOptionalId, normalizeEventBlockKind, normalizeCsvString, EventCompactRow, EmptyState, getContainerClass, getCardOrientation, isToday, MAX_EVENTS_PER_DAY, formatTime, WIZARD_STEPS, getWizardStepsForContext, getStepNumber, formatEventPriceDisplay, resolveRuntimeEventPricing, formatEventPrice, formatEventDateParts, resolveEventLinkProps, DateTimeTile, assertNever, EventCard, buildCalendarViewport, shiftCalendarAnchorDate, addMonths, getThreeMonthRange, buildTimetableModel, formatDate, MONTH_NAMES, getEventAvailability, formatEventTeacherLine, toRegistrationEvents, isEventContentType, findPreSelectedEvent, resolveRegistrationTarget, findEventByOccurrenceId, resolveEventRequiresPayment, resolveDiscountContext } from './chunk-B4H6QMPY.mjs';
13
+ import { publicEventPricingType, getBookingLocalDateKey, toScheduledBookingDateTime, toBookingTimeZone, publicEventPricingCurrency, formatBookingDateTime, publicEventPricingMode, publicEventScalarPrice, publicEventTicketTypes, formatCurrencyAmount, formatBookingDate, formatBookingTime } from './chunk-3H5CLFKT.mjs';
15
14
  import React9, { createContext, useId, useMemo, useReducer, useState, useRef, useEffect, useCallback, useContext } from 'react';
16
15
  import { createPortal } from 'react-dom';
17
16
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -33,12 +32,18 @@ function createInitialRegistrationFlowState(hasPreSelectedContext) {
33
32
  };
34
33
  }
35
34
  function selectionEquals(a, b) {
36
- return a.method === b.method && a.passId === b.passId && a.membershipId === b.membershipId && a.bundlePassId === b.bundlePassId && a.bundleMembershipId === b.bundleMembershipId && a.productName === b.productName && a.productDescription === b.productDescription && a.productPrice === b.productPrice && a.productCurrency === b.productCurrency && a.productInterval === b.productInterval;
35
+ return a.method === b.method && a.passId === b.passId && a.membershipId === b.membershipId && a.bundlePassId === b.bundlePassId && a.bundleMembershipId === b.bundleMembershipId && a.productName === b.productName && a.productDescription === b.productDescription && a.productPrice === b.productPrice && a.productCurrency === b.productCurrency && a.productInterval === b.productInterval && a.collectionOptionKind === b.collectionOptionKind;
37
36
  }
38
37
  function withDefaultSelection(selection) {
39
38
  if (!selection || !selection.method) {
40
39
  return { method: null };
41
40
  }
41
+ if (selection.method === "stripe") {
42
+ return {
43
+ ...selection,
44
+ collectionOptionKind: selection.collectionOptionKind ?? "upfront"
45
+ };
46
+ }
42
47
  return selection;
43
48
  }
44
49
  function computeAutoSelection(input) {
@@ -64,7 +69,7 @@ function computeAutoSelection(input) {
64
69
  }
65
70
  }
66
71
  if (eligibility.canPayDirectly && eligibility.price) {
67
- return { method: "stripe" };
72
+ return { method: "stripe", collectionOptionKind: "upfront" };
68
73
  }
69
74
  return { method: null };
70
75
  }
@@ -82,11 +87,17 @@ function isSelectionValid(input) {
82
87
  case "pass":
83
88
  return isAuthenticated && ticketsCount === 1 && !!selection.passId && eligibility.eligiblePasses.some((pass) => pass.id === selection.passId);
84
89
  case "membership":
85
- return isAuthenticated && ticketsCount === 1 && !!selection.membershipId && eligibility.eligibleMemberships.some((membership) => membership.id === selection.membershipId);
90
+ return isAuthenticated && ticketsCount === 1 && !!selection.membershipId && eligibility.eligibleMemberships.some(
91
+ (membership) => membership.id === selection.membershipId
92
+ );
86
93
  case "pass_bundle":
87
- return ticketsCount === 1 && !!selection.bundlePassId && eligibility.availablePasses.some((pass) => pass.id === selection.bundlePassId);
94
+ return ticketsCount === 1 && !!selection.bundlePassId && eligibility.availablePasses.some(
95
+ (pass) => pass.id === selection.bundlePassId
96
+ );
88
97
  case "membership_bundle":
89
- return ticketsCount === 1 && !!selection.bundleMembershipId && eligibility.availableMemberships.some((membership) => membership.id === selection.bundleMembershipId);
98
+ return ticketsCount === 1 && !!selection.bundleMembershipId && eligibility.availableMemberships.some(
99
+ (membership) => membership.id === selection.bundleMembershipId
100
+ );
90
101
  default:
91
102
  return false;
92
103
  }
@@ -133,9 +144,15 @@ function registrationFlowReducer(state, action) {
133
144
  ticketsCount: Math.max(1, action.ticketsCount)
134
145
  });
135
146
  case "set-authenticated":
136
- return normalizeRegistrationFlowState({ ...state, isAuthenticated: action.isAuthenticated });
147
+ return normalizeRegistrationFlowState({
148
+ ...state,
149
+ isAuthenticated: action.isAuthenticated
150
+ });
137
151
  case "eligibility-updated":
138
- return normalizeRegistrationFlowState({ ...state, eligibility: action.eligibility });
152
+ return normalizeRegistrationFlowState({
153
+ ...state,
154
+ eligibility: action.eligibility
155
+ });
139
156
  case "set-manual-payment-selection":
140
157
  return normalizeRegistrationFlowState({
141
158
  ...state,
@@ -147,7 +164,7 @@ function registrationFlowReducer(state, action) {
147
164
  return normalizeRegistrationFlowState({
148
165
  ...state,
149
166
  passOptOut: true,
150
- paymentSelection: { method: "stripe" },
167
+ paymentSelection: { method: "stripe", collectionOptionKind: "upfront" },
151
168
  selectionSource: "manual"
152
169
  });
153
170
  case "event-changed":
@@ -193,7 +210,10 @@ function normalizeEventRegistrationMaxTickets(value) {
193
210
  function resolveEventRegistrationSubmitPlan(input) {
194
211
  const selection = input.paymentSelection.method ? input.paymentSelection : void 0;
195
212
  if (input.canJoinWaitlist) {
196
- return { ok: true, args: withOptionalSelection({ method: "free" }, selection) };
213
+ return {
214
+ ok: true,
215
+ args: withOptionalSelection({ method: "free" }, selection)
216
+ };
197
217
  }
198
218
  switch (input.paymentSelection.method) {
199
219
  case "pass":
@@ -208,19 +228,28 @@ function resolveEventRegistrationSubmitPlan(input) {
208
228
  return input.paymentSelection.membershipId ? {
209
229
  ok: true,
210
230
  args: withOptionalSelection(
211
- { method: "membership", membershipId: input.paymentSelection.membershipId },
231
+ {
232
+ method: "membership",
233
+ membershipId: input.paymentSelection.membershipId
234
+ },
212
235
  selection
213
236
  )
214
237
  } : missingPaymentSelection();
215
238
  case "free":
216
- return { ok: true, args: withOptionalSelection({ method: "free" }, selection) };
239
+ return {
240
+ ok: true,
241
+ args: withOptionalSelection({ method: "free" }, selection)
242
+ };
217
243
  case null:
218
244
  return input.eventRequiresPayment ? missingPaymentSelection() : { ok: true, args: { method: "free" } };
219
245
  case "pass_bundle":
220
246
  return input.paymentSelection.bundlePassId ? {
221
247
  ok: true,
222
248
  args: withOptionalSelection(
223
- { method: "pass_bundle", passId: input.paymentSelection.bundlePassId },
249
+ {
250
+ method: "pass_bundle",
251
+ passId: input.paymentSelection.bundlePassId
252
+ },
224
253
  selection
225
254
  )
226
255
  } : missingPaymentSelection();
@@ -236,7 +265,10 @@ function resolveEventRegistrationSubmitPlan(input) {
236
265
  )
237
266
  } : missingPaymentSelection();
238
267
  case "stripe":
239
- return { ok: true, args: withOptionalSelection({ method: "stripe" }, selection) };
268
+ return {
269
+ ok: true,
270
+ args: withOptionalSelection({ method: "stripe" }, selection)
271
+ };
240
272
  }
241
273
  }
242
274
  function withOptionalSelection(args, selection) {
@@ -390,7 +422,7 @@ function eligibilityLookupReducer(state, action) {
390
422
  error: action.message
391
423
  };
392
424
  default:
393
- return assertNever11(action);
425
+ return assertNever(action);
394
426
  }
395
427
  }
396
428
  var initialExistingRegistrationLookupState = {
@@ -412,7 +444,7 @@ function existingRegistrationLookupReducer(state, action) {
412
444
  registration: action.registration
413
445
  };
414
446
  default:
415
- return assertNever11(action);
447
+ return assertNever(action);
416
448
  }
417
449
  }
418
450
 
@@ -1320,10 +1352,99 @@ function SelectableOptionCard(props) {
1320
1352
  }
1321
1353
  );
1322
1354
  }
1355
+
1356
+ // ../blocks/src/system/runtime/nodes/event-registration/eventPaymentOptions.ts
1357
+ var DEFAULT_EVENT_DIRECT_PAYMENT_OPTION = {
1358
+ kind: "upfront"
1359
+ };
1360
+ function buildEventRegistrationPaymentOptionsViewModel(input) {
1361
+ const supportedOptions = selectSupportedEventDirectPaymentOptions(
1362
+ input.paymentTerms
1363
+ );
1364
+ const selection = buildBookingPaymentSelectionViewModel({
1365
+ serviceTitle: input.eventTitle,
1366
+ paymentTerms: { allowedOptions: [...supportedOptions] },
1367
+ priceAmount: input.totalPriceCents,
1368
+ priceCurrency: input.currency,
1369
+ bookingStartAt: input.startsAt,
1370
+ locale: input.locale
1371
+ });
1372
+ return {
1373
+ mode: selection.mode,
1374
+ sectionTitle: selection.sectionTitle,
1375
+ options: selection.options.map(
1376
+ (option) => toEventDirectPaymentOption(option, selection.mode)
1377
+ )
1378
+ };
1379
+ }
1380
+ function selectSupportedEventDirectPaymentOptions(paymentTerms) {
1381
+ const supported = paymentTerms?.allowedOptions.filter(isSupportedEventDirectPaymentOption) ?? [];
1382
+ return supported.length > 0 ? supported : [DEFAULT_EVENT_DIRECT_PAYMENT_OPTION];
1383
+ }
1384
+ function isSupportedEventDirectPaymentOption(option) {
1385
+ return option.kind === "upfront" || option.kind === "flexible_balance";
1386
+ }
1387
+ function toEventDirectPaymentOption(option, mode) {
1388
+ switch (option.kind) {
1389
+ case "upfront":
1390
+ return {
1391
+ ...option,
1392
+ kind: "upfront",
1393
+ label: mode === "choice_required" ? "Pay in full now" : "Pay by card"
1394
+ };
1395
+ case "flexible_balance":
1396
+ return {
1397
+ ...option,
1398
+ kind: "flexible_balance",
1399
+ label: "Pay deposit now"
1400
+ };
1401
+ case "deferred_manual":
1402
+ case "instalment_plan":
1403
+ throw new Error(
1404
+ `Unsupported event registration payment option: ${option.kind}`
1405
+ );
1406
+ }
1407
+ }
1408
+ function resolveEventRegistrationDirectPaymentSelection(input) {
1409
+ if (input.selection.method !== "stripe") {
1410
+ return { kind: "not-stripe" };
1411
+ }
1412
+ const fallbackOption = input.options[0];
1413
+ if (!fallbackOption) {
1414
+ return { kind: "unavailable" };
1415
+ }
1416
+ const requestedKind = input.selection.collectionOptionKind;
1417
+ const selectedOption = requestedKind == null ? input.options.find((option) => option.kind === "upfront") : input.options.find((option) => option.kind === requestedKind);
1418
+ if (selectedOption) {
1419
+ return {
1420
+ kind: "valid",
1421
+ selection: {
1422
+ method: "stripe",
1423
+ collectionOptionKind: selectedOption.kind
1424
+ }
1425
+ };
1426
+ }
1427
+ return {
1428
+ kind: "invalid",
1429
+ fallbackSelection: {
1430
+ method: "stripe",
1431
+ collectionOptionKind: fallbackOption.kind
1432
+ }
1433
+ };
1434
+ }
1323
1435
  function PaymentCheckIcon() {
1324
1436
  return /* @__PURE__ */ jsx("div", { className: "er-check", children: /* @__PURE__ */ jsx(CheckIcon, {}) });
1325
1437
  }
1326
- function PaymentTile({ icon, label, detail, selected, disabled, tooltip, upsell, onClick }) {
1438
+ function PaymentTile({
1439
+ icon,
1440
+ label,
1441
+ detail,
1442
+ selected,
1443
+ disabled,
1444
+ tooltip,
1445
+ upsell,
1446
+ onClick
1447
+ }) {
1327
1448
  return /* @__PURE__ */ jsx(
1328
1449
  SelectableOptionCard,
1329
1450
  {
@@ -1346,6 +1467,19 @@ function PaymentTile({ icon, label, detail, selected, disabled, tooltip, upsell,
1346
1467
  }
1347
1468
  );
1348
1469
  }
1470
+ function formatDirectPaymentOptionDetail(option) {
1471
+ const dueToday = option.summaryRows.find((row) => row.label === "Due today");
1472
+ const balanceDueBy = option.summaryRows.find(
1473
+ (row) => row.label === "Balance due by"
1474
+ );
1475
+ return [
1476
+ dueToday ? `Due today: ${dueToday.value}` : option.description,
1477
+ balanceDueBy ? `Balance due by: ${balanceDueBy.value}` : null
1478
+ ].filter((part) => Boolean(part)).join(" \xB7 ");
1479
+ }
1480
+ function isDirectPaymentOptionSelected(option, selectionState) {
1481
+ return selectionState.kind === "valid" && selectionState.selection.collectionOptionKind === option.kind;
1482
+ }
1349
1483
  var PaymentSelectionStep = ({
1350
1484
  event,
1351
1485
  occurrenceContext,
@@ -1362,14 +1496,44 @@ var PaymentSelectionStep = ({
1362
1496
  }) => {
1363
1497
  const occurrenceId = occurrenceContext?.id ?? event?.registrationOccurrenceId;
1364
1498
  const selectedMethod = selectedSelection.method;
1499
+ const totalPrice = eligibility?.price ? eligibility.price * ticketsCount : 0;
1500
+ const canShowDirectPaymentOptions = Boolean(
1501
+ eligibility?.eligible && eligibility.canPayDirectly && eligibility.price
1502
+ );
1503
+ const directPaymentOptions = eligibility && canShowDirectPaymentOptions ? buildEventRegistrationPaymentOptionsViewModel({
1504
+ eventTitle: event?.title ?? "Event",
1505
+ paymentTerms: event?.paymentTerms,
1506
+ totalPriceCents: totalPrice,
1507
+ currency: eligibility.currency,
1508
+ startsAt: occurrenceContext?.startsAt ?? event?.startsAt
1509
+ }).options : [];
1510
+ const directPaymentSelectionState = resolveEventRegistrationDirectPaymentSelection({
1511
+ options: directPaymentOptions,
1512
+ selection: selectedSelection
1513
+ });
1514
+ const directPaymentFallbackSelection = directPaymentSelectionState.kind === "invalid" ? directPaymentSelectionState.fallbackSelection : null;
1515
+ const directPaymentFallbackKind = directPaymentFallbackSelection?.collectionOptionKind;
1365
1516
  const canContinue = (() => {
1366
1517
  if (!selectedMethod) return false;
1518
+ if (selectedMethod === "stripe") {
1519
+ return directPaymentSelectionState.kind === "valid";
1520
+ }
1367
1521
  if (selectedMethod === "pass") return Boolean(selectedSelection.passId);
1368
- if (selectedMethod === "membership") return Boolean(selectedSelection.membershipId);
1369
- if (selectedMethod === "pass_bundle") return Boolean(selectedSelection.bundlePassId);
1370
- if (selectedMethod === "membership_bundle") return Boolean(selectedSelection.bundleMembershipId);
1522
+ if (selectedMethod === "membership")
1523
+ return Boolean(selectedSelection.membershipId);
1524
+ if (selectedMethod === "pass_bundle")
1525
+ return Boolean(selectedSelection.bundlePassId);
1526
+ if (selectedMethod === "membership_bundle")
1527
+ return Boolean(selectedSelection.bundleMembershipId);
1371
1528
  return true;
1372
1529
  })();
1530
+ useEffect(() => {
1531
+ if (!directPaymentFallbackKind) return;
1532
+ onSelectionChange({
1533
+ method: "stripe",
1534
+ collectionOptionKind: directPaymentFallbackKind
1535
+ });
1536
+ }, [directPaymentFallbackKind, onSelectionChange]);
1373
1537
  const getButtonText = useCallback(() => {
1374
1538
  if (selectedMethod === "stripe") return "Continue to Payment";
1375
1539
  if (selectedMethod === "pass_bundle" || selectedMethod === "membership_bundle") {
@@ -1396,7 +1560,15 @@ var PaymentSelectionStep = ({
1396
1560
  buttonText: getButtonText(),
1397
1561
  showLoginPrompt
1398
1562
  });
1399
- }, [onStateChange, eligibilityLoading, eligibilityError, eligibility, isAuthenticated, canContinue, getButtonText]);
1563
+ }, [
1564
+ onStateChange,
1565
+ eligibilityLoading,
1566
+ eligibilityError,
1567
+ eligibility,
1568
+ isAuthenticated,
1569
+ canContinue,
1570
+ getButtonText
1571
+ ]);
1400
1572
  if (eligibilityLoading) {
1401
1573
  return /* @__PURE__ */ jsx("div", { className: "er-stack", children: /* @__PURE__ */ jsxs("div", { className: "er-center", children: [
1402
1574
  /* @__PURE__ */ jsx(SpinnerNode, { size: "lg", srLabel: "Checking payment options" }),
@@ -1444,7 +1616,10 @@ var PaymentSelectionStep = ({
1444
1616
  "button",
1445
1617
  {
1446
1618
  type: "button",
1447
- className: themeButtonClassName({ variant: "primary", size: "md" }),
1619
+ className: themeButtonClassName({
1620
+ variant: "primary",
1621
+ size: "md"
1622
+ }),
1448
1623
  disabled: !email.trim(),
1449
1624
  onClick: onRequestLogin,
1450
1625
  children: "Email me a login link"
@@ -1458,21 +1633,27 @@ var PaymentSelectionStep = ({
1458
1633
  ] }) })
1459
1634
  ] });
1460
1635
  }
1461
- const totalPrice = eligibility.price ? eligibility.price * ticketsCount : 0;
1462
1636
  const isMultiTicket = areEntitlementsDisabledForTicketCount(ticketsCount);
1463
1637
  return /* @__PURE__ */ jsxs("div", { className: "er-stack", children: [
1464
1638
  /* @__PURE__ */ jsx("h3", { className: "er-title", children: "Payment Options" }),
1465
1639
  /* @__PURE__ */ jsxs("div", { className: "er-payment-tiles", children: [
1466
- eligibility.canPayDirectly && eligibility.price && /* @__PURE__ */ jsx(
1640
+ canShowDirectPaymentOptions && /* @__PURE__ */ jsx(Fragment, { children: directPaymentOptions.map((option) => /* @__PURE__ */ jsx(
1467
1641
  PaymentTile,
1468
1642
  {
1469
1643
  icon: /* @__PURE__ */ jsx(CreditCard, { size: 24, "aria-hidden": "true" }),
1470
- label: "Pay by Card",
1471
- detail: formatPrice(totalPrice, eligibility.currency),
1472
- selected: selectedMethod === "stripe",
1473
- onClick: () => onSelectionChange({ method: "stripe", collectionOptionKind: "upfront" })
1474
- }
1475
- ),
1644
+ label: option.label,
1645
+ detail: formatDirectPaymentOptionDetail(option),
1646
+ selected: isDirectPaymentOptionSelected(
1647
+ option,
1648
+ directPaymentSelectionState
1649
+ ),
1650
+ onClick: () => onSelectionChange({
1651
+ method: "stripe",
1652
+ collectionOptionKind: option.kind
1653
+ })
1654
+ },
1655
+ option.kind
1656
+ )) }),
1476
1657
  isAuthenticated && eligibility.eligiblePasses.map((pass) => /* @__PURE__ */ jsx(
1477
1658
  PaymentTile,
1478
1659
  {
@@ -1482,7 +1663,11 @@ var PaymentSelectionStep = ({
1482
1663
  selected: selectedMethod === "pass" && selectedSelection.passId === pass.id,
1483
1664
  disabled: isMultiTicket,
1484
1665
  tooltip: isMultiTicket ? ENTITLEMENT_SINGLE_TICKET_TOOLTIP : void 0,
1485
- onClick: () => onSelectionChange({ method: "pass", passId: pass.id, productName: pass.passName })
1666
+ onClick: () => onSelectionChange({
1667
+ method: "pass",
1668
+ passId: pass.id,
1669
+ productName: pass.passName
1670
+ })
1486
1671
  },
1487
1672
  pass.id
1488
1673
  )),
@@ -1881,6 +2066,24 @@ function EventRegistrationWizardActions(props) {
1881
2066
  function isProductMethod(method) {
1882
2067
  return method !== null && ["pass", "membership", "pass_bundle", "membership_bundle"].includes(method);
1883
2068
  }
2069
+ function getSummaryRow(option, label) {
2070
+ return option.summaryRows.find((row) => row.label === label)?.value ?? null;
2071
+ }
2072
+ function getSelectedDirectPaymentOption(input) {
2073
+ const summaryEvent = input.wizard.selectedEvent ?? input.wizard.preSelectedEvent;
2074
+ if (!summaryEvent || input.wizard.paymentSelection.method !== "stripe") {
2075
+ return null;
2076
+ }
2077
+ const options = buildEventRegistrationPaymentOptionsViewModel({
2078
+ eventTitle: summaryEvent.title,
2079
+ paymentTerms: summaryEvent.paymentTerms,
2080
+ totalPriceCents: input.totalCents,
2081
+ currency: input.currency,
2082
+ startsAt: input.wizard.occurrenceContext?.startsAt ?? summaryEvent.startsAt
2083
+ }).options;
2084
+ const requestedKind = input.wizard.paymentSelection.collectionOptionKind ?? "upfront";
2085
+ return options.find((option) => option.kind === requestedKind) ?? options.find((option) => option.kind === "upfront") ?? options[0] ?? null;
2086
+ }
1884
2087
  function EventRegistrationSummaryBar(props) {
1885
2088
  const { wizard } = props;
1886
2089
  const summaryEvent = wizard.selectedEvent ?? wizard.preSelectedEvent;
@@ -1895,6 +2098,18 @@ function EventRegistrationSummaryBar(props) {
1895
2098
  const autoAppliedDiscount = wizard.discountCode.trim().length > 0 ? null : wizard.autoAppliedDiscount;
1896
2099
  const autoAppliedDiscountCents = Math.max(0, autoAppliedDiscount?.computedAmountCents ?? 0);
1897
2100
  const discountedTotalCents = Math.max(0, subtotalCents - autoAppliedDiscountCents);
2101
+ const selectedDirectPaymentOption = getSelectedDirectPaymentOption({
2102
+ wizard,
2103
+ totalCents: discountedTotalCents,
2104
+ currency: summaryCurrency
2105
+ });
2106
+ const flexibleBalanceSummary = selectedDirectPaymentOption?.kind === "flexible_balance" ? {
2107
+ total: getSummaryRow(selectedDirectPaymentOption, "Total"),
2108
+ dueToday: getSummaryRow(selectedDirectPaymentOption, "Due today"),
2109
+ remainingBalance: getSummaryRow(selectedDirectPaymentOption, "Remaining balance"),
2110
+ balanceDueBy: getSummaryRow(selectedDirectPaymentOption, "Balance due by"),
2111
+ depositPolicy: getSummaryRow(selectedDirectPaymentOption, "Deposit policy")
2112
+ } : null;
1898
2113
  if (!summaryTitle) return null;
1899
2114
  const productMethod = isProductMethod(wizard.paymentSelection.method);
1900
2115
  return /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -1938,6 +2153,22 @@ function EventRegistrationSummaryBar(props) {
1938
2153
  summaryPrice > 0 && /* @__PURE__ */ jsx("div", { className: "er-summary-bar-pricing", children: productMethod ? /* @__PURE__ */ jsxs(Fragment, { children: [
1939
2154
  /* @__PURE__ */ jsx("span", { className: "er-summary-bar-price er-summary-bar-price--struck", children: formatPrice(summaryPrice * wizard.ticketsCount, summaryCurrency) }),
1940
2155
  /* @__PURE__ */ jsx("div", { className: "er-summary-bar-included", children: wizard.paymentSelection.method === "pass" || wizard.paymentSelection.method === "pass_bundle" ? "1 pass credit" : "Included in membership" })
2156
+ ] }) : flexibleBalanceSummary ? /* @__PURE__ */ jsxs(Fragment, { children: [
2157
+ flexibleBalanceSummary.total ? /* @__PURE__ */ jsxs("div", { className: "er-summary-bar-product-detail", children: [
2158
+ "Total: ",
2159
+ flexibleBalanceSummary.total
2160
+ ] }) : null,
2161
+ /* @__PURE__ */ jsx("div", { className: "er-summary-bar-price", children: flexibleBalanceSummary.dueToday ?? formatPrice(discountedTotalCents, summaryCurrency) }),
2162
+ /* @__PURE__ */ jsx("div", { className: "er-summary-bar-included", children: "Payable now" }),
2163
+ flexibleBalanceSummary.remainingBalance ? /* @__PURE__ */ jsxs("div", { className: "er-summary-bar-product-detail", children: [
2164
+ "Remaining balance: ",
2165
+ flexibleBalanceSummary.remainingBalance,
2166
+ flexibleBalanceSummary.balanceDueBy ? ` due by ${flexibleBalanceSummary.balanceDueBy}` : ""
2167
+ ] }) : null,
2168
+ flexibleBalanceSummary.depositPolicy ? /* @__PURE__ */ jsxs("div", { className: "er-summary-bar-product-detail", children: [
2169
+ "Deposit: ",
2170
+ flexibleBalanceSummary.depositPolicy
2171
+ ] }) : null
1941
2172
  ] }) : autoAppliedDiscount && autoAppliedDiscountCents > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
1942
2173
  /* @__PURE__ */ jsx("span", { className: "er-summary-bar-price er-summary-bar-price--struck", children: formatPrice(subtotalCents, summaryCurrency) }),
1943
2174
  /* @__PURE__ */ jsx("div", { className: "er-summary-bar-price", children: formatPrice(discountedTotalCents, summaryCurrency) }),
@@ -2726,6 +2957,46 @@ function useEventRegistrationWizard(options) {
2726
2957
  };
2727
2958
  }
2728
2959
 
2960
+ // ../blocks/src/system/runtime/nodes/events/shared/eventProductEligibility.ts
2961
+ function isCategoryEligible(eligibleCategoryIds, eventCategoryId) {
2962
+ const categories = eligibleCategoryIds ?? [];
2963
+ if (categories.length === 0) return true;
2964
+ if (!eventCategoryId) return false;
2965
+ return categories.includes(eventCategoryId);
2966
+ }
2967
+ function passCoversEvent(args, event) {
2968
+ if (!event.acceptsPasses) return false;
2969
+ return isCategoryEligible(args.eligibleCategoryIds, event.eventCategoryId);
2970
+ }
2971
+ function membershipCoversEvent(args, event) {
2972
+ if (!event.acceptsMemberships) return false;
2973
+ return isCategoryEligible(args.eligibleCategoryIds, event.eventCategoryId);
2974
+ }
2975
+ function filterPassesForEvent(sitePasses, event) {
2976
+ if (!sitePasses || !event) return [];
2977
+ if (event.requiresRegistration === false) return [];
2978
+ const acceptsPasses = event.acceptsPasses ?? true;
2979
+ const eventCategoryId = event.eventCategory?.id ?? null;
2980
+ return sitePasses.filter(
2981
+ (pass) => pass.productUseCase === "event_pass" && passCoversEvent(
2982
+ { eligibleCategoryIds: pass.eligibleCategoryIds },
2983
+ { acceptsPasses, eventCategoryId }
2984
+ )
2985
+ );
2986
+ }
2987
+ function filterMembershipsForEvent(siteMemberships, event) {
2988
+ if (!siteMemberships || !event) return [];
2989
+ if (event.requiresRegistration === false) return [];
2990
+ const acceptsMemberships = event.acceptsMemberships ?? true;
2991
+ const eventCategoryId = event.eventCategory?.id ?? null;
2992
+ return siteMemberships.filter(
2993
+ (membership) => membershipCoversEvent(
2994
+ { eligibleCategoryIds: membership.eligibleCategoryIds },
2995
+ { acceptsMemberships, eventCategoryId }
2996
+ )
2997
+ );
2998
+ }
2999
+
2729
3000
  // ../blocks/src/system/runtime/nodes/event-registration/constants.ts
2730
3001
  var EVENT_REGISTRATION_ANCHOR_ID = "event-registration";
2731
3002
  var EVENT_PORTAL_AUTH_COPY = {
@@ -2766,7 +3037,9 @@ function EventRegistrationWizard(props) {
2766
3037
  buttonVariant = "primary",
2767
3038
  className,
2768
3039
  spamProtectionEnabled,
2769
- supportEmail
3040
+ supportEmail,
3041
+ sitePasses,
3042
+ siteMemberships
2770
3043
  } = props;
2771
3044
  const maxTicketsNum = normalizeEventRegistrationMaxTickets(maxTickets);
2772
3045
  const showSpamProtection = spamProtectionEnabled ?? isSpamProtectionEnabled();
@@ -2862,11 +3135,13 @@ function EventRegistrationWizard(props) {
2862
3135
  const summaryPriceLabel = summaryEvent ? formatEventPriceDisplay(summaryEvent.pricing) : null;
2863
3136
  const summaryAvailabilityLabel = summaryEvent?.availableSpots === null || summaryEvent?.availableSpots === void 0 ? null : summaryEvent.availableSpots > 0 ? `${summaryEvent.availableSpots} spots left` : summaryEvent.waitlistEnabled ? "Waitlist available" : "Fully booked";
2864
3137
  const waitlistClaimRequiresPortalLogin = wizard.waitlistClaim.requiresPortalLogin && wizard.portalAuthState !== "authenticated" && wizard.portalAuthState !== "checking";
3138
+ const selectedProductEvent = wizard.selectedEvent ?? wizard.preSelectedEvent;
3139
+ const hasPassOrMembershipProducts = filterPassesForEvent(sitePasses?.passes, selectedProductEvent).length > 0 || filterMembershipsForEvent(siteMemberships?.memberships, selectedProductEvent).length > 0;
2865
3140
  const portalAuthCopy = waitlistClaimRequiresPortalLogin ? {
2866
3141
  ...EVENT_PORTAL_AUTH_COPY["waitlist-claim"],
2867
3142
  description: wizard.waitlistClaim.loginMessage ?? "Log in to continue with your waitlist claim."
2868
3143
  } : EVENT_PORTAL_AUTH_COPY.membership;
2869
- const showPortalAuthPrompt = waitlistClaimRequiresPortalLogin || wizard.step === "select-tickets" && wizard.portalAuthState !== "authenticated" && wizard.portalAuthState !== "checking" && summaryEventPricingType !== "free";
3144
+ const showPortalAuthPrompt = waitlistClaimRequiresPortalLogin || wizard.step === "select-tickets" && wizard.portalAuthState !== "authenticated" && wizard.portalAuthState !== "checking" && hasPassOrMembershipProducts && summaryEventPricingType !== "free";
2870
3145
  const renderRegistrationSurface = (variant) => /* @__PURE__ */ jsxs("div", { className: `er-container${variant === "overlay" ? " er-container--overlay" : ""}`, children: [
2871
3146
  isWizardStep && /* @__PURE__ */ jsxs("div", { className: "er-payment-layout er-payment-layout--no-sidebar", children: [
2872
3147
  /* @__PURE__ */ jsxs("div", { className: "er-payment-layout-main", children: [
@@ -3090,20 +3365,6 @@ var EventRegistrationIslandClient = (props) => {
3090
3365
  };
3091
3366
 
3092
3367
  // ../blocks/src/system/runtime/nodes/event-details/logic.ts
3093
- function isCategoryEligible(eligibleCategoryIds, eventCategoryId) {
3094
- const categories = eligibleCategoryIds ?? [];
3095
- if (categories.length === 0) return true;
3096
- if (!eventCategoryId) return false;
3097
- return categories.includes(eventCategoryId);
3098
- }
3099
- function passCoversEvent(args, event) {
3100
- if (!event.acceptsPasses) return false;
3101
- return isCategoryEligible(args.eligibleCategoryIds, event.eventCategoryId);
3102
- }
3103
- function membershipCoversEvent(args, event) {
3104
- if (!event.acceptsMemberships) return false;
3105
- return isCategoryEligible(args.eligibleCategoryIds, event.eventCategoryId);
3106
- }
3107
3368
  function parseLimit(value, fallback) {
3108
3369
  const n = typeof value === "string" ? parseInt(value, 10) : typeof value === "number" ? value : NaN;
3109
3370
  return Number.isFinite(n) && n > 0 ? n : fallback;
@@ -3162,30 +3423,6 @@ function selectEventDetails(args) {
3162
3423
  }).slice(0, otherLimit) : [];
3163
3424
  return { mode, selected, otherDates, timeZone };
3164
3425
  }
3165
- function filterPassesForEvent(sitePasses, event) {
3166
- if (!sitePasses || !event) return [];
3167
- if (event.requiresRegistration === false) return [];
3168
- const acceptsPasses = event.acceptsPasses ?? true;
3169
- const eventCategoryId = event.eventCategory?.id ?? null;
3170
- return sitePasses.filter(
3171
- (pass) => pass.productUseCase === "event_pass" && passCoversEvent(
3172
- { eligibleCategoryIds: pass.eligibleCategoryIds },
3173
- { acceptsPasses, eventCategoryId }
3174
- )
3175
- );
3176
- }
3177
- function filterMembershipsForEvent(siteMemberships, event) {
3178
- if (!siteMemberships || !event) return [];
3179
- if (event.requiresRegistration === false) return [];
3180
- const acceptsMemberships = event.acceptsMemberships ?? true;
3181
- const eventCategoryId = event.eventCategory?.id ?? null;
3182
- return siteMemberships.filter(
3183
- (membership) => membershipCoversEvent(
3184
- { eligibleCategoryIds: membership.eligibleCategoryIds },
3185
- { acceptsMemberships, eventCategoryId }
3186
- )
3187
- );
3188
- }
3189
3426
  function CoursePricingDisplay({
3190
3427
  pricing,
3191
3428
  acceptedItems
@@ -3352,7 +3589,7 @@ function EventDetailsView({
3352
3589
  "a",
3353
3590
  {
3354
3591
  className: "rb-tile rb-tile--interactive",
3355
- href: e.path,
3592
+ ...resolveEventLinkProps(e),
3356
3593
  children: /* @__PURE__ */ jsx(
3357
3594
  DateTimeTile,
3358
3595
  {
@@ -3736,7 +3973,7 @@ function eventPaginationLoadReducer(state, action) {
3736
3973
  case "synced":
3737
3974
  return createInitialEventPaginationLoadState(action.events, action.pageSize);
3738
3975
  default:
3739
- return assertNever11(action);
3976
+ return assertNever(action);
3740
3977
  }
3741
3978
  }
3742
3979
  function getEventIdentity(event) {
@@ -3957,7 +4194,7 @@ function eventFiltersLoadReducer(state, action) {
3957
4194
  case "failed":
3958
4195
  return { kind: "error", filters: state.filters, error: action.error };
3959
4196
  default:
3960
- return assertNever11(action);
4197
+ return assertNever(action);
3961
4198
  }
3962
4199
  }
3963
4200
  function toEventFiltersLoadError(error) {
@@ -4387,7 +4624,7 @@ function calendarEventCacheLoadReducer(_state, action) {
4387
4624
  case "failed":
4388
4625
  return { kind: "error", error: action.error };
4389
4626
  default:
4390
- return assertNever11(action);
4627
+ return assertNever(action);
4391
4628
  }
4392
4629
  }
4393
4630
  function toCalendarEventCacheLoadError(error) {
@@ -4709,7 +4946,7 @@ var AgendaEventCard = ({
4709
4946
  showCapacity,
4710
4947
  onClick
4711
4948
  }) => {
4712
- const eventUrl = event.path;
4949
+ const eventLinkProps = resolveEventLinkProps(event);
4713
4950
  const categoryColor = event.eventCategory?.color || "rgb(var(--tb-accent))";
4714
4951
  const price = formatEventPrice(event);
4715
4952
  const { available, isFull } = getEventAvailability(event);
@@ -4770,7 +5007,7 @@ var AgendaEventCard = ({
4770
5007
  }
4771
5008
  );
4772
5009
  }
4773
- return /* @__PURE__ */ jsx("a", { href: eventUrl, className: "event-agenda-card", children: cardContent });
5010
+ return /* @__PURE__ */ jsx("a", { ...eventLinkProps, className: "event-agenda-card", children: cardContent });
4774
5011
  };
4775
5012
  var FULL_DAY_NAMES = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
4776
5013
  function formatAgendaDayHeader(date) {
@@ -4980,6 +5217,23 @@ function EventModals({
4980
5217
  }
4981
5218
  return marker;
4982
5219
  }
5220
+
5221
+ // ../blocks/src/system/runtime/nodes/events/shared/calendarViewOptions.ts
5222
+ var monthOption = { id: "month", label: "Month" };
5223
+ var weekOption = { id: "week", label: "Week" };
5224
+ function resolveInitialCalendarView(input) {
5225
+ switch (input.calendarTabViews) {
5226
+ case "month":
5227
+ return "month";
5228
+ case "week":
5229
+ return "week";
5230
+ case "both":
5231
+ return input.defaultCalendarView ?? "month";
5232
+ }
5233
+ }
5234
+ function orderCalendarViewToggleOptions(defaultCalendarView) {
5235
+ return defaultCalendarView === "week" ? [weekOption, monthOption] : [monthOption, weekOption];
5236
+ }
4983
5237
  function toEventCombinedControllerProps(props) {
4984
5238
  return {
4985
5239
  events: props.render.hydration.prefetchedEvents ? [...props.render.display.events] : void 0,
@@ -4991,6 +5245,7 @@ function toEventCombinedControllerProps(props) {
4991
5245
  paginationAction: props.render.display.paginationAction,
4992
5246
  startOfWeek: props.render.display.startOfWeek,
4993
5247
  calendarTabViews: props.render.display.calendarTabViews,
5248
+ defaultCalendarView: props.render.display.defaultCalendarView,
4994
5249
  showFilters: props.render.display.showFilters,
4995
5250
  showCategoryFilter: props.render.display.showCategoryFilter,
4996
5251
  showVenueFilter: props.render.display.showVenueFilter,
@@ -5023,6 +5278,7 @@ var EventCombinedClient = ({
5023
5278
  // Calendar options
5024
5279
  startOfWeek = "monday",
5025
5280
  calendarTabViews = "both",
5281
+ defaultCalendarView,
5026
5282
  // Filtering options
5027
5283
  showFilters,
5028
5284
  showCategoryFilter = "auto",
@@ -5055,9 +5311,21 @@ var EventCombinedClient = ({
5055
5311
  const resolvedEventSurface = eventSurface ?? "all";
5056
5312
  const resolvedScheduleScope = scheduleScope ?? "any";
5057
5313
  const [activeTab, setActiveTab] = useState("list");
5058
- const [calendarView, setCalendarView] = useState(
5059
- calendarTabViews === "week" ? "week" : "month"
5314
+ const initialCalendarView = useMemo(
5315
+ () => resolveInitialCalendarView({
5316
+ calendarTabViews,
5317
+ defaultCalendarView
5318
+ }),
5319
+ [calendarTabViews, defaultCalendarView]
5320
+ );
5321
+ const [calendarView, setCalendarView] = useState(initialCalendarView);
5322
+ const calendarViewOptions = useMemo(
5323
+ () => orderCalendarViewToggleOptions(initialCalendarView),
5324
+ [initialCalendarView]
5060
5325
  );
5326
+ useEffect(() => {
5327
+ setCalendarView(initialCalendarView);
5328
+ }, [initialCalendarView]);
5061
5329
  const filtersIdBase = useId();
5062
5330
  const {
5063
5331
  categories,
@@ -5239,26 +5507,16 @@ var EventCombinedClient = ({
5239
5507
  ),
5240
5508
  activeTab === "calendar" && /* @__PURE__ */ jsxs(EventModalProvider, { children: [
5241
5509
  /* @__PURE__ */ jsxs("div", { className: "event-combined-content event-calendar", children: [
5242
- calendarTabViews === "both" && /* @__PURE__ */ jsxs("div", { className: "event-calendar-view-toggle", children: [
5243
- /* @__PURE__ */ jsx(
5244
- "button",
5245
- {
5246
- type: "button",
5247
- className: `event-calendar-view-btn ${calendarView === "month" ? "event-calendar-view-btn--active" : ""}`,
5248
- onClick: () => setCalendarView("month"),
5249
- children: "Month"
5250
- }
5251
- ),
5252
- /* @__PURE__ */ jsx(
5253
- "button",
5254
- {
5255
- type: "button",
5256
- className: `event-calendar-view-btn ${calendarView === "week" ? "event-calendar-view-btn--active" : ""}`,
5257
- onClick: () => setCalendarView("week"),
5258
- children: "Week"
5259
- }
5260
- )
5261
- ] }),
5510
+ calendarTabViews === "both" && /* @__PURE__ */ jsx("div", { className: "event-calendar-view-toggle", children: calendarViewOptions.map((option) => /* @__PURE__ */ jsx(
5511
+ "button",
5512
+ {
5513
+ type: "button",
5514
+ className: `event-calendar-view-btn ${calendarView === option.id ? "event-calendar-view-btn--active" : ""}`,
5515
+ onClick: () => setCalendarView(option.id),
5516
+ children: option.label
5517
+ },
5518
+ option.id
5519
+ )) }),
5262
5520
  /* @__PURE__ */ jsxs("div", { className: "event-calendar-header", children: [
5263
5521
  /* @__PURE__ */ jsxs("div", { className: "event-calendar-nav", children: [
5264
5522
  /* @__PURE__ */ jsx(
@@ -5598,6 +5856,7 @@ var EventCalendarClient = ({
5598
5856
  paginationAction: display.paginationAction,
5599
5857
  startOfWeek: display.startOfWeek,
5600
5858
  calendarTabViews: display.calendarTabViews,
5859
+ defaultCalendarView: display.defaultCalendarView,
5601
5860
  showFilters: display.showFilters,
5602
5861
  showCategoryFilter: display.showCategoryFilter,
5603
5862
  showVenueFilter: display.showVenueFilter,
@@ -5692,7 +5951,7 @@ var EventCalendarTimetableClient = ({ render }) => {
5692
5951
  };
5693
5952
  var EventCalendarGridClient = ({ render }) => {
5694
5953
  const { display, hydration } = render;
5695
- const calendarView = display.displayMode === "week" ? "week" : "month";
5954
+ const calendarView = display.defaultCalendarView;
5696
5955
  const { filtersNode, listFilters } = useEventCalendarFilterState(display);
5697
5956
  const calendarInitialEvents = usePrefetchedCalendarEvents(display, listFilters);
5698
5957
  const {
@@ -5732,7 +5991,15 @@ var EventCalendarGridClient = ({ render }) => {
5732
5991
  onPrevious: goToPrevious,
5733
5992
  onToday: goToToday,
5734
5993
  children: [
5735
- /* @__PURE__ */ jsxs("div", { className: "event-calendar-container", children: [
5994
+ viewport.kind === "week" ? /* @__PURE__ */ jsx(
5995
+ WeekAgendaView,
5996
+ {
5997
+ days: viewport.days,
5998
+ events,
5999
+ emptyMessage: display.emptyMessage,
6000
+ showCapacity: display.showCapacity
6001
+ }
6002
+ ) : /* @__PURE__ */ jsxs("div", { className: "event-calendar-container", children: [
5736
6003
  /* @__PURE__ */ jsx("div", { className: "event-calendar-day-headers", children: dayNames.map((day) => /* @__PURE__ */ jsx("div", { className: "event-calendar-day-header", children: day }, day)) }),
5737
6004
  /* @__PURE__ */ jsx("div", { className: "event-calendar-grid", children: viewport.days.map((date) => {
5738
6005
  const dateKey = formatDateKey(date);
@@ -5748,7 +6015,7 @@ var EventCalendarGridClient = ({ render }) => {
5748
6015
  );
5749
6016
  }) })
5750
6017
  ] }),
5751
- events.length === 0 && !loading && !error ? /* @__PURE__ */ jsx("p", { className: "event-calendar-empty", children: display.emptyMessage }) : null
6018
+ viewport.kind === "month" && events.length === 0 && !loading && !error ? /* @__PURE__ */ jsx("p", { className: "event-calendar-empty", children: display.emptyMessage }) : null
5752
6019
  ]
5753
6020
  }
5754
6021
  ),