@riverbankcms/sdk 0.148.0 → 0.149.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 (154) hide show
  1. package/README.md +1 -1
  2. package/dist/{PreviewEditorSidebar-DvEPG3Z2.mjs → PreviewEditorSidebar-DBKln68M.mjs} +103 -66
  3. package/dist/{PreviewEditorUI-D6eb6fkx.mjs → PreviewEditorUI-DpRX4Mum.mjs} +3 -6
  4. package/dist/{PreviewQueryProvider-5znTyJuz.mjs → PreviewQueryProvider-C0mndwHB.mjs} +3 -3
  5. package/dist/{SdkPreviewModeRuntime-DJ6utQ_R.mjs → SdkPreviewModeRuntime-DJPmPY-r.mjs} +95 -67
  6. package/dist/{SiteChromeCustomizeContext-CFJYh6vo.mjs → SiteChromeCustomizeContext-JYA0cJ_Z.mjs} +982 -734
  7. package/dist/_dts/api/src/bookingConfig.d.ts +33 -48
  8. package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +2 -6
  9. package/dist/_dts/api/src/bookingOperations.d.ts +5 -7
  10. package/dist/_dts/api/src/bookingRecords.d.ts +15 -11
  11. package/dist/_dts/api/src/bookingRefundOutcomes.d.ts +5 -5
  12. package/dist/_dts/api/src/clientErrorReporting.d.ts +11 -0
  13. package/dist/_dts/api/src/commercePortalEndpoints.d.ts +0 -2
  14. package/dist/_dts/api/src/common/cancellation.d.ts +23 -0
  15. package/dist/_dts/api/src/customerMembershipOutcomes.d.ts +1 -1
  16. package/dist/_dts/api/src/endpoints.d.ts +2 -10
  17. package/dist/_dts/api/src/eventManagementContracts.d.ts +4 -7
  18. package/dist/_dts/api/src/index.d.ts +3 -3
  19. package/dist/_dts/api/src/publicAppointmentBookingContracts.d.ts +2 -2
  20. package/dist/_dts/api/src/publicExperience/commerceEndpoints.d.ts +2 -29
  21. package/dist/_dts/api/src/request.d.ts +1 -1
  22. package/dist/_dts/api/src/sdk-event-upsert.d.ts +1 -1
  23. package/dist/_dts/api/src/sdkPullEventContracts.d.ts +1 -1
  24. package/dist/_dts/api/src/siteOperations.d.ts +6 -2
  25. package/dist/_dts/blocks/src/contracts/index.d.ts +1 -1
  26. package/dist/_dts/blocks/src/contracts/non-block-islands.d.ts +2 -2
  27. package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +38 -10
  28. package/dist/_dts/blocks/src/portal/types.d.ts +9 -6
  29. package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +24 -24
  30. package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +1 -1
  31. package/dist/_dts/blocks/src/system/blocks/shared/bookingPaymentTerms.d.ts +84 -160
  32. package/dist/_dts/blocks/src/system/blocks/shop.d.ts +2 -2
  33. package/dist/_dts/blocks/src/system/blocks/shop.shared.d.ts +31 -4
  34. package/dist/_dts/blocks/src/system/runtime/api/types/appointments.d.ts +2 -2
  35. package/dist/_dts/blocks/src/system/runtime/api/types/core.d.ts +3 -1
  36. package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +48 -6
  37. package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +24 -3
  38. package/dist/_dts/blocks/src/system/runtime/hooks/useBookingNowIso.d.ts +8 -0
  39. package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.state.d.ts +2 -1
  40. package/dist/_dts/blocks/src/system/runtime/nodes/commerce/shared/display.d.ts +9 -2
  41. package/dist/_dts/blocks/src/system/runtime/nodes/event-details/presentation.d.ts +14 -2
  42. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/PaymentSelectionStep.d.ts +2 -0
  43. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventPaymentOptions.d.ts +3 -3
  44. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +4 -0
  45. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +24 -24
  46. package/dist/_dts/blocks/src/system/runtime/nodes/shop.interactive.d.ts +41 -6
  47. package/dist/_dts/blocks/src/system/runtime/shared/bookingPaymentOptions.d.ts +7 -2
  48. package/dist/_dts/commerce/src/purchase/bookingPaymentSelection.d.ts +54 -0
  49. package/dist/_dts/commerce/src/purchase/checkoutCommitPlan.d.ts +58 -13
  50. package/dist/_dts/commerce/src/purchase/checkoutErrorCodes.d.ts +1 -1
  51. package/dist/_dts/commerce/src/purchase/checkoutPaymentPlanPlanning.d.ts +16 -21
  52. package/dist/_dts/commerce/src/purchase/checkoutPaymentTerms.d.ts +23 -40
  53. package/dist/_dts/commerce/src/purchase/checkoutSessionMetadata.d.ts +2 -2
  54. package/dist/_dts/commerce/src/purchase/checkoutStripeSessionPlanning.d.ts +5 -4
  55. package/dist/_dts/commerce/src/purchase/index.d.ts +1 -3
  56. package/dist/_dts/commerce/src/purchase/membershipOrderItemMetadata.d.ts +4 -0
  57. package/dist/_dts/commerce/src/purchase/oneTimeCheckoutPlanning.d.ts +9 -4
  58. package/dist/_dts/commerce/src/purchase/orderInstalmentClosure.d.ts +13 -1
  59. package/dist/_dts/commerce/src/purchase/orderInstalmentLifecycle.d.ts +5 -0
  60. package/dist/_dts/commerce/src/purchase/orderItemMetadata.d.ts +3 -1
  61. package/dist/_dts/commerce/src/purchase/orderTypes.d.ts +7 -1
  62. package/dist/_dts/commerce/src/purchase/refundRailSplit.d.ts +1 -1
  63. package/dist/_dts/commerce/src/purchase/stateTransitions.d.ts +2 -2
  64. package/dist/_dts/commerce/src/purchase/stripeMinimumCharge.d.ts +6 -0
  65. package/dist/_dts/commerce/src/purchase/types.d.ts +2 -1
  66. package/dist/_dts/content-editor/src/controller/editLeaseHandover.d.ts +30 -0
  67. package/dist/_dts/content-editor/src/lib/browserStorage.d.ts +5 -0
  68. package/dist/_dts/core/src/booking-flexible-balance.d.ts +2 -2
  69. package/dist/_dts/core/src/booking-instalment-deposit.d.ts +20 -0
  70. package/dist/_dts/core/src/booking-live-payment-terms.d.ts +72 -0
  71. package/dist/_dts/core/src/booking-payment-options.d.ts +24 -0
  72. package/dist/_dts/core/src/booking-payment-schemas.d.ts +522 -0
  73. package/dist/_dts/core/src/branded.d.ts +3 -0
  74. package/dist/_dts/core/src/edit-lease.d.ts +5 -0
  75. package/dist/_dts/core/src/index.d.ts +3 -0
  76. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +297 -36
  77. package/dist/_dts/media-editor/src/MediaPickerDialog.d.ts +3 -1
  78. package/dist/_dts/media-editor/src/MediaPickerMiniDialog.d.ts +10 -0
  79. package/dist/_dts/media-editor/src/index.d.ts +2 -0
  80. package/dist/_dts/preview-next/src/client/preview/PreviewEntryControllerProvider.d.ts +0 -1
  81. package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +1 -1
  82. package/dist/_dts/preview-next/src/client/previewAuthStore.d.ts +7 -0
  83. package/dist/_dts/preview-next/src/constants.d.ts +4 -0
  84. package/dist/_dts/preview-next/src/keepAlive.d.ts +1 -0
  85. package/dist/_dts/sdk/src/rendering/islands/types.d.ts +2 -12
  86. package/dist/_dts/sdk/src/version.d.ts +1 -1
  87. package/dist/_dts/theme-core/src/site-styles/pageDesignIntent.d.ts +0 -5
  88. package/dist/_dts/ui/src/color-picker.d.ts +1 -1
  89. package/dist/_dts/ui/src/palette/useHexDraft.d.ts +7 -0
  90. package/dist/client/{BookingMailingListNote-CzRt2dF_.mjs → BookingMailingListNote-Cr3EeTP5.mjs} +408 -69
  91. package/dist/client/{DemoBookingPortalAccess-mxqwap3f.mjs → DemoBookingPortalAccess-BFGB1Fay.mjs} +2 -2
  92. package/dist/client/{EventCombined.client-CDb11igO.mjs → EventCombined.client-DKYV0_ft.mjs} +6 -6
  93. package/dist/client/{EventListing.client-EgYhzKPa.mjs → EventListing.client-B9UIcEYc.mjs} +2 -2
  94. package/dist/client/{LeafletStaticMap-gtmtaA2b.mjs → LeafletStaticMap-CFLPkP0K.mjs} +1 -1
  95. package/dist/client/{TerminalPanel-DvNUP5ot.mjs → TerminalPanel-JjmgxEsR.mjs} +1 -1
  96. package/dist/client/{ThemedButton-C7CeUJjW.mjs → ThemedButton-CKV1Jh2m.mjs} +1 -1
  97. package/dist/client/{accordion-kjvt49rA.mjs → accordion-DXWIfT3T.mjs} +1 -1
  98. package/dist/client/{bookingForm-pbRZordh.mjs → bookingForm-CjZgHNvv.mjs} +11 -8
  99. package/dist/client/bookings.mjs +424 -320
  100. package/dist/client/{carousel-f4Zbmicv.mjs → carousel-DSLikmvZ.mjs} +1 -1
  101. package/dist/client/{cart-DO20An50.mjs → cart-HDjWReFt.mjs} +3 -3
  102. package/dist/client/{checkout-Du5amDR_.mjs → checkout-CUvRZA3W.mjs} +3 -3
  103. package/dist/client/client.mjs +963 -866
  104. package/dist/client/{context-eW97E945.mjs → context-DFmaZa-Q.mjs} +1 -1
  105. package/dist/client/{dates-jPCirRea.mjs → dates-BBep1JnF.mjs} +2 -2
  106. package/dist/client/{eventCalendar-C2M-iE4j.mjs → eventCalendar-zEobhxo4.mjs} +9 -9
  107. package/dist/client/{eventCombined-W6ns3LHg.mjs → eventCombined-Dp7bz5k-.mjs} +4 -4
  108. package/dist/client/{eventDetails-CR-GT0f0.mjs → eventDetails-FE-zqTt7.mjs} +4 -4
  109. package/dist/client/{eventListing-BK8AfYZz.mjs → eventListing-BMt5snal.mjs} +4 -4
  110. package/dist/client/{eventRegistration-BJSd4KUu.mjs → eventRegistration-O6ZxHfOb.mjs} +67 -342
  111. package/dist/client/{form-BvpfbQaT.mjs → form-DFa1D8vt.mjs} +3 -3
  112. package/dist/client/{headerSection-I5sUQ8x-.mjs → headerSection-CmjHLR-N.mjs} +3 -3
  113. package/dist/client/hooks.mjs +160 -129
  114. package/dist/client/{locationMap-BLvwf9_f.mjs → locationMap-BXKP_lGh.mjs} +3 -3
  115. package/dist/client/{newsletterForm-DrQ2weE8.mjs → newsletterForm-CU-HmxGx.mjs} +3 -3
  116. package/dist/client/{pricing-BES87mrR.mjs → pricing-KEAEsibq.mjs} +1 -1
  117. package/dist/client/{productDetail-Url9jcc5.mjs → productDetail-Ckp7MGnt.mjs} +3 -3
  118. package/dist/client/{productList-DE7ngEZJ.mjs → productList-D91V0sYa.mjs} +3 -3
  119. package/dist/client/{propsDecoder-D1OtGXDV.mjs → propsDecoder-DZd6RJeA.mjs} +155 -77
  120. package/dist/client/rendering/client.mjs +3356 -3192
  121. package/dist/client/rendering/islands.mjs +17 -17
  122. package/dist/client/rendering.mjs +956 -841
  123. package/dist/client/{routeIslandApiConfig-BG9Y-SHg.mjs → routeIslandApiConfig-E1EkhhYY.mjs} +1 -1
  124. package/dist/client/{shop-CJkuySJ3.mjs → shop-4F2jLQPI.mjs} +12 -13
  125. package/dist/client/{shop-commerce-4rKj5n9h.mjs → shop-commerce-BbfCJjB3.mjs} +6 -6
  126. package/dist/client/{shop-commerce-store-Bxm75Pg6.mjs → shop-commerce-store-vicweP2K.mjs} +1 -1
  127. package/dist/client/{shopShared-DpoQDWfz.mjs → shopShared-DlONJt0T.mjs} +4 -4
  128. package/dist/client/{useEventFilters-D8HliSqR.mjs → useEventFilters-COYyL3m7.mjs} +6 -6
  129. package/dist/preview-next/before-render.mjs +15 -22
  130. package/dist/preview-next/client/runtime.mjs +4 -4
  131. package/dist/preview-next/constants.mjs +5 -1
  132. package/dist/preview-next/index.mjs +5 -1
  133. package/dist/preview-next/keepAlive.mjs +149 -82
  134. package/dist/preview-next/middleware.mjs +15 -22
  135. package/dist/{previewAuthStore-BXXF3hhW.mjs → previewAuthStore-BBmV7UsW.mjs} +49 -29
  136. package/dist/{sdk-runtime-C2a05WjL.mjs → sdk-runtime-CwvFFjB-.mjs} +2 -2
  137. package/dist/{separator-CuNhBAhS.mjs → separator-ByL72zUT.mjs} +1 -1
  138. package/dist/server/components.mjs +167 -131
  139. package/dist/server/config-validation.mjs +160 -129
  140. package/dist/server/config.mjs +160 -129
  141. package/dist/server/data.mjs +160 -129
  142. package/dist/server/index.mjs +20 -27
  143. package/dist/server/next.mjs +174 -156
  144. package/dist/server/page-converter.mjs +145 -65
  145. package/dist/server/prebuild.mjs +1 -1
  146. package/dist/server/rendering/server.mjs +169 -131
  147. package/dist/server/rendering.mjs +167 -131
  148. package/dist/server/routing.mjs +165 -118
  149. package/dist/server/server.mjs +167 -154
  150. package/package.json +1 -1
  151. package/dist/_dts/api/src/bookingPaymentTermSchemas.d.ts +0 -123
  152. package/dist/_dts/commerce/src/purchase/checkoutPaymentTermPlanning.d.ts +0 -10
  153. package/dist/_dts/commerce/src/purchase/checkoutValidatedItemPlanning.d.ts +0 -55
  154. package/dist/_dts/commerce/src/purchase/orderInstalmentPayoff.d.ts +0 -24
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { _ as API_ENDPOINTS, d as unwrapResponse, l as ApiEnvelopeError, s as ApiRequestError, u as extractApiEnvelopeErrorDetails } from "./previewAuthStore-BXXF3hhW.mjs";
2
+ import { d as ApiEnvelopeError, f as extractApiEnvelopeErrorDetails, p as unwrapResponse, u as ApiRequestError, y as API_ENDPOINTS } from "./previewAuthStore-BBmV7UsW.mjs";
3
3
  import * as React$1 from "react";
4
4
  import React, { Component, Fragment, cloneElement, createContext, createElement, createRef, forwardRef, isValidElement, memo, startTransition, useCallback, useContext, useDebugValue, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
5
5
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -72,6 +72,7 @@ const unsafeAsSiteId = (id) => id;
72
72
  const unsafeAsApiKeyId = (id) => id;
73
73
  const unsafeAsPageId = (id) => id;
74
74
  const unsafeAsPageSurfaceId = (id) => id;
75
+ const unsafeAsEditorClientId = (id) => id;
75
76
  const unsafeAsEventOfferingId = (id) => id;
76
77
  const unsafeAsEventSeriesId = (id) => id;
77
78
  const unsafeAsMediaAssetId = (id) => id;
@@ -90,6 +91,7 @@ const parseSiteId = (value) => parseUuidBrand(value, unsafeAsSiteId);
90
91
  const parseApiKeyId = (value) => parseUuidBrand(value, unsafeAsApiKeyId);
91
92
  const parsePageId = (value) => parseUuidBrand(value, unsafeAsPageId);
92
93
  const parsePageSurfaceId = (value) => parseUuidBrand(value, unsafeAsPageSurfaceId);
94
+ const parseEditorClientId = (value) => parseUuidBrand(value, unsafeAsEditorClientId);
93
95
  const parseEventOfferingId = (value) => parseUuidBrand(value, unsafeAsEventOfferingId);
94
96
  const parseUserId = (value) => parseUuidBrand(value, unsafeAsUserId);
95
97
  const parseMediaAssetId = (value) => parseUuidBrand(value, unsafeAsMediaAssetId);
@@ -114,7 +116,7 @@ function subtractDaysFromIso(isoString, dayCount) {
114
116
  }
115
117
  //#endregion
116
118
  //#region ../core/src/assert-never.ts
117
- function assertNever$10(value, message = "Unexpected variant") {
119
+ function assertNever$11(value, message = "Unexpected variant") {
118
120
  throw new Error(`${message}: ${String(value)}`);
119
121
  }
120
122
  //#endregion
@@ -207,7 +209,7 @@ function isPublicEventPricingOptionDisplayable(option) {
207
209
  case "not_on_sale_yet":
208
210
  case "sale_ended":
209
211
  case "attendance_mode_unavailable": return false;
210
- default: return assertNever$10(reason);
212
+ default: return assertNever$11(reason);
211
213
  }
212
214
  }
213
215
  function publicEventPricingDisplay(pricing) {
@@ -348,7 +350,7 @@ function canonicalEventPricingDisplay(pricing) {
348
350
  currency: pricing.currency,
349
351
  purpose: "configured"
350
352
  });
351
- default: return assertNever$10(pricing);
353
+ default: return assertNever$11(pricing);
352
354
  }
353
355
  }
354
356
  /**
@@ -367,7 +369,7 @@ function formatBookingPriceDisplay(display, options = {}) {
367
369
  case "mixed": return display.paidToAmount > display.paidFromAmount ? `Free / ${formatCurrencyAmount(display.paidFromAmount, display.currency, options)} - ${formatCurrencyAmount(display.paidToAmount, display.currency, options)}` : `Free / ${formatCurrencyAmount(display.paidFromAmount, display.currency, options)}`;
368
370
  case "unavailable": return "Pricing unavailable";
369
371
  case "external": return display.label;
370
- default: return assertNever$10(display);
372
+ default: return assertNever$11(display);
371
373
  }
372
374
  }
373
375
  /** Render an event's price directly from its pricing value. */
@@ -502,10 +504,10 @@ function resolveFlexibleBalanceDueAt(input) {
502
504
  switch (input.dueDateRule.kind) {
503
505
  case "relative_to_start_date": return subtractDaysFromIso(input.bookingStartAt, input.dueDateRule.daysBeforeStart);
504
506
  case "fixed_calendar_date": return input.dueDateRule.dueAt;
505
- default: return assertNever$9(input.dueDateRule);
507
+ default: return assertNever$10(input.dueDateRule);
506
508
  }
507
509
  }
508
- function assertNever$9(value) {
510
+ function assertNever$10(value) {
509
511
  throw new Error(`Unexpected value: ${String(value)}`);
510
512
  }
511
513
  //#endregion
@@ -515,7 +517,7 @@ function isDepositBearingBookingInstalmentPlan(plan) {
515
517
  case "deposit_plus_one_remainder":
516
518
  case "deposit_plus_scheduled_instalments": return true;
517
519
  case "equal_scheduled_instalments": return false;
518
- default: return assertNever$8(plan);
520
+ default: return assertNever$9(plan);
519
521
  }
520
522
  }
521
523
  function getBookingInstalmentDepositRefundability(plan) {
@@ -541,7 +543,7 @@ function addIntervalPreservingMonthAnchor(isoString, intervalCount, intervalUnit
541
543
  date.setUTCDate(date.getUTCDate() + intervalCount * 7);
542
544
  return date.toISOString();
543
545
  case "month": return addMonthsPreservingAnchorDay(date, intervalCount).toISOString();
544
- default: return assertNever$8(intervalUnit);
546
+ default: return assertNever$9(intervalUnit);
545
547
  }
546
548
  }
547
549
  function getBookingInstalmentPlanIntervalCount(plan) {
@@ -549,7 +551,7 @@ function getBookingInstalmentPlanIntervalCount(plan) {
549
551
  case "deposit_plus_one_remainder": return plan.remainderDueCount;
550
552
  case "deposit_plus_scheduled_instalments":
551
553
  case "equal_scheduled_instalments": return plan.intervalCount;
552
- default: return assertNever$8(plan);
554
+ default: return assertNever$9(plan);
553
555
  }
554
556
  }
555
557
  function omitZeroAmountFutureRows(rows) {
@@ -565,10 +567,20 @@ function addMonthsPreservingAnchorDay(date, intervalCount) {
565
567
  nextMonth.setUTCDate(Math.min(anchorDay, lastDayOfTargetMonth));
566
568
  return nextMonth;
567
569
  }
568
- function assertNever$8(value) {
570
+ function assertNever$9(value) {
569
571
  throw new Error(`Unexpected value: ${String(value)}`);
570
572
  }
571
573
  //#endregion
574
+ //#region ../core/src/booking-payment-options.ts
575
+ /** Automatic instalments and a flexible balance cannot share one booking offer. */
576
+ function validateBookingPaymentOptionKinds(kinds) {
577
+ if (kinds.length === 0) return err$1("no_options");
578
+ const uniqueKinds = new Set(kinds);
579
+ if (uniqueKinds.size !== kinds.length) return err$1("duplicate_kind");
580
+ if (uniqueKinds.has("instalment_plan") && uniqueKinds.has("flexible_balance")) return err$1("incompatible_collection_options");
581
+ return ok$2(void 0);
582
+ }
583
+ //#endregion
572
584
  //#region ../core/src/booking-time-zone.ts
573
585
  const TIME_ZONE_VALIDITY_CACHE_LIMIT = 100;
574
586
  const timeZoneValidityCache = /* @__PURE__ */ new Map();
@@ -1072,7 +1084,7 @@ function valueStatus(sync) {
1072
1084
  case "abandoned": return "unsaved";
1073
1085
  case "in-flight": return "saving";
1074
1086
  case "failed": return "failed";
1075
- default: return assertNever$10(sync.local.request);
1087
+ default: return assertNever$11(sync.local.request);
1076
1088
  }
1077
1089
  }
1078
1090
  /** Projects the model onto the presentation sync state: unsaved and saving are both `pending`. */
@@ -1084,6 +1096,33 @@ function syncStateOf(sync) {
1084
1096
  return valueStatus(sync) === "saved" ? { kind: "baseline" } : { kind: "pending" };
1085
1097
  }
1086
1098
  //#endregion
1099
+ //#region ../core/src/edit-lease.ts
1100
+ function parseEditLeaseScope(input) {
1101
+ switch (input.nodeType) {
1102
+ case "page": {
1103
+ const id = parsePageId(input.nodeId);
1104
+ return id.ok ? {
1105
+ nodeType: "page",
1106
+ nodeId: id.value
1107
+ } : null;
1108
+ }
1109
+ case "content_entry": {
1110
+ const id = parseContentEntryId(input.nodeId);
1111
+ return id.ok ? {
1112
+ nodeType: "content_entry",
1113
+ nodeId: id.value
1114
+ } : null;
1115
+ }
1116
+ case "page_surface": {
1117
+ const id = parsePageSurfaceId(input.nodeId);
1118
+ return id.ok ? {
1119
+ nodeType: "page_surface",
1120
+ nodeId: id.value
1121
+ } : null;
1122
+ }
1123
+ }
1124
+ }
1125
+ //#endregion
1087
1126
  //#region ../core/src/block-content-identity.ts
1088
1127
  function readContentVersionId(value) {
1089
1128
  const parsed = parseContentVersionId(value);
@@ -3310,7 +3349,7 @@ function isUnknownArray$7(value) {
3310
3349
  }
3311
3350
  //#endregion
3312
3351
  //#region ../content-editor/src/utils/assertNever.ts
3313
- function assertNever$7(value, message) {
3352
+ function assertNever$8(value, message) {
3314
3353
  throw new Error(message ?? `Unexpected value: ${String(value)}`);
3315
3354
  }
3316
3355
  //#endregion
@@ -3341,7 +3380,7 @@ function applyValueSyncEvent(sync, event) {
3341
3380
  sync: rebaseOnOwnWrite(sync, event.baseline, event.since),
3342
3381
  outcome: NO_OUTCOME$1
3343
3382
  };
3344
- default: return assertNever$7(event);
3383
+ default: return assertNever$8(event);
3345
3384
  }
3346
3385
  }
3347
3386
  /** Send ids are unique per store; the store's closure owns the only allocator. */
@@ -3378,7 +3417,7 @@ function canSend(sync, mode) {
3378
3417
  case "failed": return mode === "explicit" || !recordsEqual(sync.local.values, request.sent);
3379
3418
  case "in-flight":
3380
3419
  case "abandoned": return false;
3381
- default: return assertNever$7(request);
3420
+ default: return assertNever$8(request);
3382
3421
  }
3383
3422
  }
3384
3423
  /**
@@ -3516,7 +3555,7 @@ function requestAfterFailure(request, failure) {
3516
3555
  reason: failure.kind
3517
3556
  };
3518
3557
  case "lease-lost": return IDLE$2;
3519
- default: return assertNever$7(failure);
3558
+ default: return assertNever$8(failure);
3520
3559
  }
3521
3560
  }
3522
3561
  function discardLocal(sync) {
@@ -3536,7 +3575,7 @@ function pristineRequest(request) {
3536
3575
  case "failed": return IDLE$2;
3537
3576
  case "in-flight": return abandon(request);
3538
3577
  case "abandoned": return request;
3539
- default: return assertNever$7(request);
3578
+ default: return assertNever$8(request);
3540
3579
  }
3541
3580
  }
3542
3581
  function abandon(request) {
@@ -79461,7 +79500,7 @@ function requireNonEmptyReadonlyArray(values, message = "Expected a non-empty ar
79461
79500
  function makeBoundaryId(previousBlockId, nextBlockId) {
79462
79501
  return asDesignBoundaryId(`boundary:${encodeURIComponent(previousBlockId)}:${encodeURIComponent(nextBlockId)}`);
79463
79502
  }
79464
- function assertNever$6(value, message = "Unhandled Theme V2 variant") {
79503
+ function assertNever$7(value, message = "Unhandled Theme V2 variant") {
79465
79504
  throw new Error(`${message}: ${String(value)}`);
79466
79505
  }
79467
79506
  function brandNonEmptyString(value, label) {
@@ -83145,7 +83184,7 @@ function boundaryEndpointForSectionContent(content) {
83145
83184
  kind: "unpainted",
83146
83185
  reason: "media"
83147
83186
  };
83148
- default: return assertNever$6(effective, "Unhandled section background type");
83187
+ default: return assertNever$7(effective, "Unhandled section background type");
83149
83188
  }
83150
83189
  }
83151
83190
  /**
@@ -83246,7 +83285,7 @@ function boundaryLayout(intent, composition) {
83246
83285
  shape: composition.from
83247
83286
  }
83248
83287
  };
83249
- default: return assertNever$6(composition, "Unhandled boundary composition");
83288
+ default: return assertNever$7(composition, "Unhandled boundary composition");
83250
83289
  }
83251
83290
  }
83252
83291
  function requireThemeColorToken$1(value) {
@@ -87845,7 +87884,7 @@ function resolveBrandDisplay(mode, logoFacts) {
87845
87884
  case "logo-plus-title": return "logo-plus-title";
87846
87885
  case "title-only": return "title-only";
87847
87886
  case "auto": return resolveAutoBrandDisplay(logoFacts);
87848
- default: return assertNever$6(mode, "Unhandled brand display mode");
87887
+ default: return assertNever$7(mode, "Unhandled brand display mode");
87849
87888
  }
87850
87889
  }
87851
87890
  function resolveAutoBrandDisplay(logoFacts) {
@@ -88056,7 +88095,7 @@ function logoFactsForHeaderContext(logo) {
88056
88095
  case "horizontal":
88057
88096
  case "square":
88058
88097
  case "tall": return deterministicLogoFactsForShape(logo.shape);
88059
- default: return assertNever$6(logo.shape, "Unhandled header logo shape");
88098
+ default: return assertNever$7(logo.shape, "Unhandled header logo shape");
88060
88099
  }
88061
88100
  }
88062
88101
  function resolveHeaderBrandPresentation(input) {
@@ -88998,7 +89037,7 @@ function applyNavTypography(style, typography) {
88998
89037
  textSize: "sm",
88999
89038
  letterSpacing: "wider"
89000
89039
  };
89001
- default: return assertNever$6(typography, "Unhandled header nav typography");
89040
+ default: return assertNever$7(typography, "Unhandled header nav typography");
89002
89041
  }
89003
89042
  }
89004
89043
  function minimalNavLinkStyle(colorToken, hoverColorToken = "primary", typography = "plain") {
@@ -89112,7 +89151,7 @@ function toneColorToken(tone) {
89112
89151
  switch (tone) {
89113
89152
  case "neutral": return "text";
89114
89153
  case "brand": return "primaryForeground";
89115
- default: return assertNever$6(tone, "Unhandled header tone recipe");
89154
+ default: return assertNever$7(tone, "Unhandled header tone recipe");
89116
89155
  }
89117
89156
  }
89118
89157
  function toneDropdownStyle(tone) {
@@ -89139,7 +89178,7 @@ function toneDropdownStyle(tone) {
89139
89178
  fontWeight: "bold",
89140
89179
  textSize: "sm"
89141
89180
  };
89142
- default: return assertNever$6(tone, "Unhandled header tone recipe");
89181
+ default: return assertNever$7(tone, "Unhandled header tone recipe");
89143
89182
  }
89144
89183
  }
89145
89184
  function recipeBackground(background) {
@@ -89152,7 +89191,7 @@ function recipeBackground(background) {
89152
89191
  type: "color",
89153
89192
  color: "transparent"
89154
89193
  };
89155
- default: return assertNever$6(background, "Unhandled header background recipe");
89194
+ default: return assertNever$7(background, "Unhandled header background recipe");
89156
89195
  }
89157
89196
  }
89158
89197
  function recipeBorder(border) {
@@ -89168,7 +89207,7 @@ function recipeBorder(border) {
89168
89207
  position: "bottom",
89169
89208
  colorToken: "border"
89170
89209
  };
89171
- default: return assertNever$6(border, "Unhandled header border recipe");
89210
+ default: return assertNever$7(border, "Unhandled header border recipe");
89172
89211
  }
89173
89212
  }
89174
89213
  function recipeNavStyle(nav) {
@@ -89177,7 +89216,7 @@ function recipeNavStyle(nav) {
89177
89216
  case "underline": return "underline-grow";
89178
89217
  case "pill": return nav.backing;
89179
89218
  case "flat-tab": return "solid";
89180
- default: return assertNever$6(nav, "Unhandled header nav recipe");
89219
+ default: return assertNever$7(nav, "Unhandled header nav recipe");
89181
89220
  }
89182
89221
  }
89183
89222
  function underlineHoverEffects(nav) {
@@ -89198,7 +89237,7 @@ function underlineHoverEffects(nav) {
89198
89237
  effectId: "text-color-change",
89199
89238
  options: { hoverColorToken: nav.hoverColorToken }
89200
89239
  }, underline];
89201
- default: return assertNever$6(nav, "Unhandled underline nav hover affordance");
89240
+ default: return assertNever$7(nav, "Unhandled underline nav hover affordance");
89202
89241
  }
89203
89242
  }
89204
89243
  function underlineNavLink(nav, colorToken, typography) {
@@ -89220,7 +89259,7 @@ function recipeNavLinkStyle(recipe) {
89220
89259
  case "underline": return underlineNavLink(nav, colorToken, recipe.navTypography);
89221
89260
  case "pill": return pillNavLinkStyle(colorToken, nav.hoverColorToken, nav.hoverAlpha, recipe.navTypography);
89222
89261
  case "flat-tab": return flatTabNavLinkStyle(colorToken, recipe.navTypography);
89223
- default: return assertNever$6(nav, "Unhandled header nav recipe");
89262
+ default: return assertNever$7(nav, "Unhandled header nav recipe");
89224
89263
  }
89225
89264
  }
89226
89265
  function themedShadow(theme) {
@@ -89229,7 +89268,7 @@ function themedShadow(theme) {
89229
89268
  case "low": return { elevation: "sm" };
89230
89269
  case "medium": return { elevation: "md" };
89231
89270
  case "high": return { elevation: "lg" };
89232
- default: return assertNever$6(theme.shadow.elevation, "Unhandled theme shadow elevation");
89271
+ default: return assertNever$7(theme.shadow.elevation, "Unhandled theme shadow elevation");
89233
89272
  }
89234
89273
  }
89235
89274
  function recipeShadow(shadow, theme) {
@@ -89241,7 +89280,7 @@ function recipeShadow(shadow, theme) {
89241
89280
  const resolved = themedShadow(theme);
89242
89281
  return resolved ? { shadow: resolved } : {};
89243
89282
  }
89244
- default: return assertNever$6(shadow, "Unhandled header shadow recipe");
89283
+ default: return assertNever$7(shadow, "Unhandled header shadow recipe");
89245
89284
  }
89246
89285
  }
89247
89286
  /**
@@ -89265,7 +89304,7 @@ function recipeFrame(frame) {
89265
89304
  tint: frame.tint,
89266
89305
  opacity: frame.opacity
89267
89306
  } };
89268
- default: return assertNever$6(frame, "Unhandled header frame recipe");
89307
+ default: return assertNever$7(frame, "Unhandled header frame recipe");
89269
89308
  }
89270
89309
  }
89271
89310
  /**
@@ -95247,7 +95286,7 @@ function selectCandidate(candidates) {
95247
95286
  outcome
95248
95287
  };
95249
95288
  case "unsupported": continue;
95250
- default: return assertNever$6(outcome, "Unhandled join candidate outcome");
95289
+ default: return assertNever$7(outcome, "Unhandled join candidate outcome");
95251
95290
  }
95252
95291
  }
95253
95292
  return { kind: "exhausted" };
@@ -95271,7 +95310,7 @@ function fallbackOptionId(outcome) {
95271
95310
  switch (outcome.kind) {
95272
95311
  case "decorative": return boundaryOptionForTransitionIntent(outcome.treatment).id;
95273
95312
  case "none": return noneBoundaryOption.id;
95274
- default: return assertNever$6(outcome, "Unhandled join fallback outcome");
95313
+ default: return assertNever$7(outcome, "Unhandled join fallback outcome");
95275
95314
  }
95276
95315
  }
95277
95316
  /**
@@ -95328,7 +95367,7 @@ function compileImageSurfaceTreatmentBackground(background, treatment, foregroun
95328
95367
  ...foreground
95329
95368
  };
95330
95369
  case "solid-panel": return withColorOverlay(background, "surface", treatment, "text", foreground);
95331
- default: return assertNever$6(treatment);
95370
+ default: return assertNever$7(treatment);
95332
95371
  }
95333
95372
  }
95334
95373
  function withColorOverlay(background, color, treatment, foregroundToken, foreground) {
@@ -95633,7 +95672,7 @@ function compileContainerStyles(contentFrame, rules) {
95633
95672
  rounded: "none"
95634
95673
  })
95635
95674
  };
95636
- default: return assertNever$6(contentFrame);
95675
+ default: return assertNever$7(contentFrame);
95637
95676
  }
95638
95677
  }
95639
95678
  function shouldMoveFrameToHeroContentCard(block) {
@@ -95652,7 +95691,7 @@ function compileHeroCompositionFields(composition) {
95652
95691
  verticalAlignment: "bottom",
95653
95692
  contentMaxWidth: "medium"
95654
95693
  };
95655
- default: return assertNever$6(composition);
95694
+ default: return assertNever$7(composition);
95656
95695
  }
95657
95696
  }
95658
95697
  function compileHeroRuntimeFields(input) {
@@ -97879,7 +97918,7 @@ function pinnedBreakChoice(resolution) {
97879
97918
  },
97880
97919
  issues: resolution.issues
97881
97920
  };
97882
- default: return assertNever$6(resolution.pin, "Unhandled join pin status");
97921
+ default: return assertNever$7(resolution.pin, "Unhandled join pin status");
97883
97922
  }
97884
97923
  }
97885
97924
  /** The effective break as the option the editor shows; null when nothing was usable. */
@@ -98084,7 +98123,7 @@ function supportsBlockComposition(capability, composition) {
98084
98123
  case "feature-cards": return supported.kind === "feature-cards" && supported.treatments.includes(composition.treatment);
98085
98124
  case "testimonials": return supported.kind === "testimonials" && supported.treatments.includes(composition.treatment);
98086
98125
  case "offerings-preview": return supported.kind === "offerings-preview" && supported.treatments.includes(composition.treatment);
98087
- default: return assertNever$6(composition);
98126
+ default: return assertNever$7(composition);
98088
98127
  }
98089
98128
  }
98090
98129
  const blockDesignFallback = {
@@ -99290,7 +99329,7 @@ function compositionCapabilityFor(composition) {
99290
99329
  kind: "offerings-preview",
99291
99330
  treatments: [composition.treatment]
99292
99331
  };
99293
- default: return assertNever$6(composition);
99332
+ default: return assertNever$7(composition);
99294
99333
  }
99295
99334
  }
99296
99335
  //#endregion
@@ -99672,7 +99711,7 @@ function writePlanForFooterLookCustomization(command) {
99672
99711
  lookId: command.lookId
99673
99712
  };
99674
99713
  case "clear": return { kind: "clear-selection" };
99675
- default: return assertNever$6(command, "Unhandled footer Look customization command");
99714
+ default: return assertNever$7(command, "Unhandled footer Look customization command");
99676
99715
  }
99677
99716
  }
99678
99717
  //#endregion
@@ -104162,7 +104201,7 @@ function resolveLinkedContentEditSupport(contentType) {
104162
104201
  kind: "unsupported-domain-backed",
104163
104202
  reason: metadata.reason
104164
104203
  };
104165
- default: return assertNever$10(metadata);
104204
+ default: return assertNever$11(metadata);
104166
104205
  }
104167
104206
  }
104168
104207
  function contentTypeKeyToLabel(key) {
@@ -104662,7 +104701,7 @@ function planSiteChromePlacement(positioning) {
104662
104701
  headerRootClassName: "rb-fixed rb-top-0 rb-left-0 rb-right-0",
104663
104702
  standaloneShellClassName: "fixed left-0 right-0 top-0 z-40 w-full"
104664
104703
  };
104665
- default: return assertNever$6(positioning);
104704
+ default: return assertNever$7(positioning);
104666
104705
  }
104667
104706
  }
104668
104707
  function splitSiteChromePlacementClasses(className) {
@@ -108130,68 +108169,115 @@ function buildRichTextSchema(options) {
108130
108169
  return schema;
108131
108170
  }
108132
108171
  //#endregion
108172
+ //#region ../core/src/booking-payment-schemas.ts
108173
+ const stripObject = (shape) => z.object(shape);
108174
+ const strictObject = (shape) => z.strictObject(shape);
108175
+ const depositRefundPolicySchema = z.enum(["refundable", "non_refundable"]);
108176
+ const intervalUnitSchema = z.enum([
108177
+ "day",
108178
+ "week",
108179
+ "month"
108180
+ ]);
108181
+ const nonNegativeIntegerSchema = z.number().int().nonnegative();
108182
+ const positiveIntegerSchema = z.number().int().positive();
108183
+ function createInstalmentPlanSchema(object) {
108184
+ return z.discriminatedUnion("kind", [
108185
+ object({
108186
+ kind: z.literal("deposit_plus_one_remainder"),
108187
+ depositAmountCents: nonNegativeIntegerSchema,
108188
+ depositRefundability: depositRefundPolicySchema,
108189
+ remainderDueCount: positiveIntegerSchema,
108190
+ intervalUnit: intervalUnitSchema
108191
+ }),
108192
+ object({
108193
+ kind: z.literal("deposit_plus_scheduled_instalments"),
108194
+ depositAmountCents: nonNegativeIntegerSchema,
108195
+ depositRefundability: depositRefundPolicySchema,
108196
+ instalmentCount: positiveIntegerSchema,
108197
+ intervalCount: positiveIntegerSchema,
108198
+ intervalUnit: intervalUnitSchema
108199
+ }),
108200
+ object({
108201
+ kind: z.literal("equal_scheduled_instalments"),
108202
+ instalmentCount: positiveIntegerSchema,
108203
+ intervalCount: positiveIntegerSchema,
108204
+ intervalUnit: intervalUnitSchema
108205
+ })
108206
+ ]);
108207
+ }
108208
+ function createFlexibleBalanceSchemas(object) {
108209
+ const dueDateRule = z.discriminatedUnion("kind", [object({
108210
+ kind: z.literal("relative_to_start_date"),
108211
+ daysBeforeStart: positiveIntegerSchema
108212
+ }), object({
108213
+ kind: z.literal("fixed_calendar_date"),
108214
+ dueAt: z.string().datetime()
108215
+ })]);
108216
+ return {
108217
+ dueDateRule,
108218
+ config: object({
108219
+ upfrontAmountCents: nonNegativeIntegerSchema,
108220
+ dueDateRule,
108221
+ depositRefundability: depositRefundPolicySchema
108222
+ })
108223
+ };
108224
+ }
108225
+ const paymentOptionKindsMessages = {
108226
+ no_options: "Choose at least one way for customers to pay.",
108227
+ duplicate_kind: "Choose each payment option only once.",
108228
+ incompatible_collection_options: "Offer instalments or a deposit with the rest paid later, but not both."
108229
+ };
108230
+ function buildBookingPaymentOptionSchemas(object) {
108231
+ const instalmentPlan = createInstalmentPlanSchema(object);
108232
+ const flexibleBalance = createFlexibleBalanceSchemas(object);
108233
+ const paymentCollectionOption = z.discriminatedUnion("kind", [
108234
+ object({ kind: z.literal("upfront") }),
108235
+ object({ kind: z.literal("deferred_manual") }),
108236
+ object({
108237
+ kind: z.literal("instalment_plan"),
108238
+ plan: instalmentPlan
108239
+ }),
108240
+ object({
108241
+ kind: z.literal("flexible_balance"),
108242
+ config: flexibleBalance.config
108243
+ })
108244
+ ]);
108245
+ const paymentTerms = object({ allowedOptions: z.array(paymentCollectionOption) }).superRefine(({ allowedOptions }, ctx) => {
108246
+ const result = validateBookingPaymentOptionKinds(allowedOptions.map(({ kind }) => kind));
108247
+ if (!result.ok) ctx.addIssue({
108248
+ code: "custom",
108249
+ path: ["allowedOptions"],
108250
+ message: paymentOptionKindsMessages[result.error]
108251
+ });
108252
+ });
108253
+ const paymentOptionsChoice = z.discriminatedUnion("source", [z.strictObject({ source: z.literal("default") }), z.strictObject({
108254
+ source: z.literal("custom"),
108255
+ paymentTerms
108256
+ })]);
108257
+ return {
108258
+ depositRefundPolicy: depositRefundPolicySchema,
108259
+ instalmentPlan,
108260
+ flexibleBalanceDueDateRule: flexibleBalance.dueDateRule,
108261
+ flexibleBalanceConfig: flexibleBalance.config,
108262
+ paymentCollectionOption,
108263
+ paymentTerms,
108264
+ paymentOptionsChoice
108265
+ };
108266
+ }
108267
+ function createBookingPaymentOptionSchemas(mode) {
108268
+ return mode === "strict" ? buildBookingPaymentOptionSchemas(strictObject) : buildBookingPaymentOptionSchemas(stripObject);
108269
+ }
108270
+ const bookingPaymentOptionSchemas = createBookingPaymentOptionSchemas("strip");
108271
+ bookingPaymentOptionSchemas.depositRefundPolicy;
108272
+ bookingPaymentOptionSchemas.instalmentPlan;
108273
+ bookingPaymentOptionSchemas.flexibleBalanceDueDateRule;
108274
+ bookingPaymentOptionSchemas.flexibleBalanceConfig;
108275
+ bookingPaymentOptionSchemas.paymentCollectionOption;
108276
+ const bookingPaymentTermsSchema = bookingPaymentOptionSchemas.paymentTerms;
108277
+ bookingPaymentOptionSchemas.paymentOptionsChoice;
108278
+ //#endregion
108133
108279
  //#region ../blocks/src/system/blocks/shared/bookingPaymentTerms.ts
108134
- const bookingDepositRefundPolicySchema$1 = z.enum(["refundable", "non_refundable"]);
108135
- const bookingInstalmentPlanSchema$1 = z.union([
108136
- z.object({
108137
- kind: z.literal("deposit_plus_one_remainder"),
108138
- depositAmountCents: z.number().int().min(0),
108139
- depositRefundability: bookingDepositRefundPolicySchema$1,
108140
- remainderDueCount: z.number().int().positive(),
108141
- intervalUnit: z.enum([
108142
- "day",
108143
- "week",
108144
- "month"
108145
- ])
108146
- }),
108147
- z.object({
108148
- kind: z.literal("deposit_plus_scheduled_instalments"),
108149
- depositAmountCents: z.number().int().min(0),
108150
- depositRefundability: bookingDepositRefundPolicySchema$1,
108151
- instalmentCount: z.number().int().positive(),
108152
- intervalCount: z.number().int().positive(),
108153
- intervalUnit: z.enum([
108154
- "day",
108155
- "week",
108156
- "month"
108157
- ])
108158
- }),
108159
- z.object({
108160
- kind: z.literal("equal_scheduled_instalments"),
108161
- instalmentCount: z.number().int().positive(),
108162
- intervalCount: z.number().int().positive(),
108163
- intervalUnit: z.enum([
108164
- "day",
108165
- "week",
108166
- "month"
108167
- ])
108168
- })
108169
- ]);
108170
- const bookingFlexibleBalanceDueDateRuleSchema$1 = z.union([z.object({
108171
- kind: z.literal("relative_to_start_date"),
108172
- daysBeforeStart: z.number().int().positive()
108173
- }), z.object({
108174
- kind: z.literal("fixed_calendar_date"),
108175
- dueAt: z.string().datetime()
108176
- })]);
108177
- const bookingFlexibleBalanceConfigSchema$1 = z.object({
108178
- upfrontAmountCents: z.number().int().min(0),
108179
- dueDateRule: bookingFlexibleBalanceDueDateRuleSchema$1,
108180
- depositRefundability: bookingDepositRefundPolicySchema$1
108181
- });
108182
- const blockBookingPaymentCollectionOptionSchema = z.union([
108183
- z.object({ kind: z.literal("upfront") }),
108184
- z.object({ kind: z.literal("deferred_manual") }),
108185
- z.object({
108186
- kind: z.literal("instalment_plan"),
108187
- plan: bookingInstalmentPlanSchema$1
108188
- }),
108189
- z.object({
108190
- kind: z.literal("flexible_balance"),
108191
- config: bookingFlexibleBalanceConfigSchema$1
108192
- })
108193
- ]);
108194
- const blockBookingPaymentTermsSchema = z.object({ allowedOptions: z.array(blockBookingPaymentCollectionOptionSchema).min(1) });
108280
+ const blockBookingPaymentTermsSchema = bookingPaymentTermsSchema;
108195
108281
  //#endregion
108196
108282
  //#region ../blocks/src/system/blocks/shared/bookingConsent.ts
108197
108283
  const BOOKING_REQUIREMENT_CONSENT_FIELD_PREFIX = "booking_requirement_consent_";
@@ -111523,7 +111609,7 @@ function resolveAccordionIconStyle(iconStyle, iconTreatment) {
111523
111609
  case "chevron": return "chevron";
111524
111610
  case "caret": return "caret";
111525
111611
  case "minimal-cross": return "plus-minus";
111526
- default: return assertNever$5(iconTreatment.iconSet);
111612
+ default: return assertNever$6(iconTreatment.iconSet);
111527
111613
  }
111528
111614
  return iconStyle && iconStyle in ICON_CONFIG ? iconStyle : "chevron";
111529
111615
  }
@@ -111538,7 +111624,7 @@ function accordionIconColorStyle(iconTreatment) {
111538
111624
  function resolveIconColorToken(token) {
111539
111625
  return token === "muted" ? "mutedText" : token;
111540
111626
  }
111541
- function assertNever$5(value) {
111627
+ function assertNever$6(value) {
111542
111628
  throw new Error(`Unhandled accordion icon set: ${String(value)}`);
111543
111629
  }
111544
111630
  //#endregion
@@ -111994,7 +112080,7 @@ function formatAppointmentLocation(location) {
111994
112080
  const venue = formatVenue(location.venue);
111995
112081
  return venue ? `${venue} or online` : "In person or online";
111996
112082
  }
111997
- default: return assertNever$10(location);
112083
+ default: return assertNever$11(location);
111998
112084
  }
111999
112085
  }
112000
112086
  function formatVenue(venue) {
@@ -112025,7 +112111,7 @@ function formatAppointmentPrice(service) {
112025
112111
  maxAmount: pricing.slidingMaxAmount,
112026
112112
  currency: pricing.currency
112027
112113
  };
112028
- default: return assertNever$10(pricing.pricingStrategy);
112114
+ default: return assertNever$11(pricing.pricingStrategy);
112029
112115
  }
112030
112116
  })();
112031
112117
  return display.kind === "unavailable" ? null : formatBookingPriceDisplay(display, { decimals: "auto" });
@@ -112088,7 +112174,7 @@ function viewFromLayout(layout, toRows) {
112088
112174
  groups: allGroups
112089
112175
  };
112090
112176
  }
112091
- default: return assertNever$10(layout);
112177
+ default: return assertNever$11(layout);
112092
112178
  }
112093
112179
  }
112094
112180
  function buildAppointmentServicesView(input) {
@@ -112111,7 +112197,7 @@ function buildAppointmentServicesView(input) {
112111
112197
  };
112112
112198
  case "all":
112113
112199
  case "fallback-all": return viewFromLayout(view.layout, toRows);
112114
- default: return assertNever$10(view);
112200
+ default: return assertNever$11(view);
112115
112201
  }
112116
112202
  }
112117
112203
  function AppointmentServiceRows({ rows, RowTitle }) {
@@ -112222,7 +112308,7 @@ function AppointmentServicesNode({ sectionHeading, categoryId, services, pathnam
112222
112308
  idPrefix: `appointment-services-${blockId ?? "block"}`
112223
112309
  })
112224
112310
  });
112225
- default: return assertNever$10(view);
112311
+ default: return assertNever$11(view);
112226
112312
  }
112227
112313
  }
112228
112314
  //#endregion
@@ -112326,7 +112412,7 @@ function err(error) {
112326
112412
  error
112327
112413
  };
112328
112414
  }
112329
- function assertNever$4(value, message) {
112415
+ function assertNever$5(value, message) {
112330
112416
  throw new Error(message ?? `Unexpected value: ${String(value)}`);
112331
112417
  }
112332
112418
  const BOOKING_FORM_DATA_RESERVED_KEYS = /* @__PURE__ */ new Set([
@@ -112472,7 +112558,7 @@ function deriveBookingFormViewState(input) {
112472
112558
  kind: "success",
112473
112559
  resourceName: input.verificationState.resourceName
112474
112560
  };
112475
- default: return assertNever$4(input.verificationState);
112561
+ default: return assertNever$5(input.verificationState);
112476
112562
  }
112477
112563
  }
112478
112564
  function resolveBookingSiteId(siteId, form) {
@@ -112636,19 +112722,17 @@ function getBookingServicePaymentSelectionMode(service) {
112636
112722
  if (service?.paymentTermsAvailability?.kind === "pending_stripe_setup") return "pending_stripe_setup";
112637
112723
  const allowedKinds = service?.paymentTerms?.allowedOptions.map((option) => option.kind) ?? [];
112638
112724
  if (allowedKinds.length === 0) return "implicit_upfront";
112639
- if (allowedKinds.length === 1) {
112640
- const onlyKind = allowedKinds[0];
112641
- if (!onlyKind) return "unsupported";
112642
- switch (onlyKind) {
112643
- case "upfront": return "implicit_upfront";
112644
- case "deferred_manual": return "implicit_deferred_manual";
112645
- case "instalment_plan": return "implicit_instalment_plan";
112646
- case "flexible_balance": return "implicit_flexible_balance";
112647
- default: return assertNever$4(onlyKind);
112648
- }
112725
+ if (!validateBookingPaymentOptionKinds(allowedKinds).ok) return "unsupported";
112726
+ if (allowedKinds.length > 1) return "choice_required";
112727
+ const onlyKind = allowedKinds[0];
112728
+ switch (onlyKind) {
112729
+ case "upfront": return "implicit_upfront";
112730
+ case "deferred_manual": return "implicit_deferred_manual";
112731
+ case "instalment_plan": return "implicit_instalment_plan";
112732
+ case "flexible_balance": return "implicit_flexible_balance";
112733
+ case void 0: return "unsupported";
112734
+ default: return assertNever$5(onlyKind);
112649
112735
  }
112650
- if (allowedKinds.length === 2 && allowedKinds.includes("upfront") && (allowedKinds.includes("deferred_manual") || allowedKinds.includes("instalment_plan") || allowedKinds.includes("flexible_balance"))) return "choice_required";
112651
- return "unsupported";
112652
112736
  }
112653
112737
  function resolveDefaultBookingServiceId(formConfig, services) {
112654
112738
  const configuredServiceId = toTrimmedString(formConfig?.settings?.serviceId);
@@ -112820,7 +112904,7 @@ function formatBookingSubmissionPreparationError(error) {
112820
112904
  case "sliding-amount-out-of-range": return `Please choose an amount within the sliding scale for "${error.serviceTitle}".`;
112821
112905
  case "payment-option-unsupported": return `Service "${error.serviceTitle}" has a payment option that is not supported yet.`;
112822
112906
  case "service-missing-duration": return `Service "${error.serviceTitle}" is missing duration. Please update the service in the dashboard to include a duration (e.g., 30 minutes).`;
112823
- default: return assertNever$4(error);
112907
+ default: return assertNever$5(error);
112824
112908
  }
112825
112909
  }
112826
112910
  const DEFAULT_BOOKING_SUCCESS_COPY = {
@@ -113864,7 +113948,7 @@ function closedEventBookingLabel(reason) {
113864
113948
  case "parent_inconsistent":
113865
113949
  case "already_started":
113866
113950
  case "enrollment_closed": return "Registration closed";
113867
- default: return assertNever$10(reason);
113951
+ default: return assertNever$11(reason);
113868
113952
  }
113869
113953
  }
113870
113954
  function resolveEventHref(event) {
@@ -116965,10 +117049,10 @@ function preferredPathsForSource(source) {
116965
117049
  case "workshop": return ["/workshops", "/workshop"];
116966
117050
  case "retreat": return ["/retreats", "/retreat"];
116967
117051
  case "performance": return ["/performances", "/performance"];
116968
- default: return assertNever$10(source.preset, "Unhandled offerings preview event preset");
117052
+ default: return assertNever$11(source.preset, "Unhandled offerings preview event preset");
116969
117053
  }
116970
117054
  case "wholeSeries": return ["/courses", "/course"];
116971
- default: return assertNever$10(source, "Unhandled offerings preview source");
117055
+ default: return assertNever$11(source, "Unhandled offerings preview source");
116972
117056
  }
116973
117057
  }
116974
117058
  function normalizeRoutePath(value) {
@@ -117005,7 +117089,7 @@ function matchesGroup(group, event) {
117005
117089
  switch (source.kind) {
117006
117090
  case "eventPreset": return event.bookingScope === "single_occurrence" && event.eventPreset === source.preset;
117007
117091
  case "wholeSeries": return event.bookingScope === "whole_series";
117008
- default: return assertNever$10(source);
117092
+ default: return assertNever$11(source);
117009
117093
  }
117010
117094
  }
117011
117095
  //#endregion
@@ -117305,7 +117389,7 @@ function renderOfferingGroupItems(presentation, items, options) {
117305
117389
  children: items.map((item) => renderOfferingCompactItem(item, options))
117306
117390
  })
117307
117391
  });
117308
- default: return assertNever$10(presentation, "Unhandled offerings preview presentation");
117392
+ default: return assertNever$11(presentation, "Unhandled offerings preview presentation");
117309
117393
  }
117310
117394
  }
117311
117395
  function FeaturedOfferingSummary({ item }) {
@@ -117349,7 +117433,7 @@ function featuredSummaryDetails(item) {
117349
117433
  siteTimeZone: item.run.representative.siteTimeZone
117350
117434
  }) : null;
117351
117435
  }
117352
- default: return assertNever$10(item, "Unhandled offerings preview item");
117436
+ default: return assertNever$11(item, "Unhandled offerings preview item");
117353
117437
  }
117354
117438
  }
117355
117439
  function formatFeaturedSummary(summary, place) {
@@ -117377,7 +117461,7 @@ function formatFeaturedSummary(summary, place) {
117377
117461
  place,
117378
117462
  sessionCount: `${summary.sessionCount} dates`
117379
117463
  });
117380
- default: return assertNever$10(summary, "Unhandled offerings preview schedule summary");
117464
+ default: return assertNever$11(summary, "Unhandled offerings preview schedule summary");
117381
117465
  }
117382
117466
  }
117383
117467
  function detailsFromOccurrences(input) {
@@ -117776,7 +117860,7 @@ function bookingActionContent(input) {
117776
117860
  children: input.buttonText
117777
117861
  });
117778
117862
  case "unavailable": return null;
117779
- default: return assertNever$10(input.booking);
117863
+ default: return assertNever$11(input.booking);
117780
117864
  }
117781
117865
  }
117782
117866
  function RecurringSchedule({ schedule, buttonText = "Book", buttonVariant = "primary", showVenue = true, emptyMessage = "Regular schedule details will be added shortly." }) {
@@ -118094,7 +118178,7 @@ const publicPassProductCollectionSchema = z.object({ passes: z.array(publicPassP
118094
118178
  /**
118095
118179
  * Public membership product for shop display
118096
118180
  */
118097
- const publicMembershipProductSchema = z.object({
118181
+ const publicMembershipProductFields = {
118098
118182
  id: z.string(),
118099
118183
  name: z.string(),
118100
118184
  description: z.string().nullable(),
@@ -118103,7 +118187,16 @@ const publicMembershipProductSchema = z.object({
118103
118187
  billingInterval: z.enum(["month", "year"]),
118104
118188
  eligibleCategoryIds: z.array(z.string()),
118105
118189
  eligibleCategoryNames: z.array(z.string())
118190
+ };
118191
+ const purchasablePublicMembershipProductSchema = z.object({
118192
+ ...publicMembershipProductFields,
118193
+ purchaseAvailability: z.literal("purchasable")
118106
118194
  });
118195
+ const publicMembershipProductSchema = z.discriminatedUnion("purchaseAvailability", [purchasablePublicMembershipProductSchema, z.object({
118196
+ ...publicMembershipProductFields,
118197
+ purchaseAvailability: z.literal("display_only"),
118198
+ unavailabilityReason: z.literal("online_payments_unavailable")
118199
+ })]);
118107
118200
  const publicMembershipProductCollectionSchema = z.object({ memberships: z.array(publicMembershipProductSchema) });
118108
118201
  //#endregion
118109
118202
  //#region ../blocks/src/system/blocks/products/shared.ts
@@ -118145,7 +118238,7 @@ const publicProductSchema = z.object({
118145
118238
  const publicProductsResponseSchema = z.object({ products: z.array(publicProductSchema) });
118146
118239
  //#endregion
118147
118240
  //#region ../blocks/src/system/runtime/api/creditProducts.ts
118148
- function assertNever$3(value) {
118241
+ function assertNever$4(value) {
118149
118242
  throw new Error(`Unhandled credit product case: ${String(value)}`);
118150
118243
  }
118151
118244
  function useCasesFromModules(modules) {
@@ -118168,7 +118261,7 @@ function getCreditProductCreditUnit(useCase) {
118168
118261
  plural: "credits",
118169
118262
  perCreditSuffix: "credit"
118170
118263
  };
118171
- default: return assertNever$3(useCase);
118264
+ default: return assertNever$4(useCase);
118172
118265
  }
118173
118266
  }
118174
118267
  function deriveCreditProductLabels(products, options = {}) {
@@ -118450,7 +118543,7 @@ function buildPassesMembershipsDisplay(options) {
118450
118543
  product: pass
118451
118544
  } : {
118452
118545
  kind: "unavailable",
118453
- label: "Online purchasing coming soon."
118546
+ label: "Online purchasing is unavailable."
118454
118547
  }
118455
118548
  };
118456
118549
  });
@@ -118460,7 +118553,14 @@ function buildPassesMembershipsDisplay(options) {
118460
118553
  description: options.showDescriptions ? membership.description : null,
118461
118554
  priceLabel: formatCommercePrice(membership.price, membership.currency),
118462
118555
  intervalLabel: formatInterval(membership.billingInterval),
118463
- actionLabel: options.membershipActionLabel
118556
+ action: membership.purchaseAvailability === "purchasable" ? {
118557
+ kind: "purchase",
118558
+ label: options.membershipActionLabel,
118559
+ product: membership
118560
+ } : {
118561
+ kind: "unavailable",
118562
+ label: "Online purchasing is unavailable."
118563
+ }
118464
118564
  }));
118465
118565
  return {
118466
118566
  kind: "passes-memberships",
@@ -118680,7 +118780,14 @@ const membershipCardDisplaySchema = z.object({
118680
118780
  description: z.string().nullable(),
118681
118781
  priceLabel: z.string(),
118682
118782
  intervalLabel: z.string(),
118683
- actionLabel: z.string()
118783
+ action: z.discriminatedUnion("kind", [z.object({
118784
+ kind: z.literal("purchase"),
118785
+ label: z.string(),
118786
+ product: purchasablePublicMembershipProductSchema
118787
+ }), z.object({
118788
+ kind: z.literal("unavailable"),
118789
+ label: z.string()
118790
+ })])
118684
118791
  });
118685
118792
  const passesMembershipsDisplaySchema = z.object({
118686
118793
  kind: z.literal("passes-memberships"),
@@ -122351,14 +122458,14 @@ function projectNewsletterFormHydrationTarget(source) {
122351
122458
  tag: "block-source",
122352
122459
  sourceRef: null
122353
122460
  };
122354
- default: return assertNever$10(source.newsletterBlockSubmission);
122461
+ default: return assertNever$11(source.newsletterBlockSubmission);
122355
122462
  }
122356
122463
  case "signed-footer": return {
122357
122464
  tag: "signed-footer-source",
122358
122465
  sourceRef: source.sourceRef
122359
122466
  };
122360
122467
  case "preview": return { tag: "preview" };
122361
- default: return assertNever$10(source);
122468
+ default: return assertNever$11(source);
122362
122469
  }
122363
122470
  }
122364
122471
  function resolveRuntimeChoices(context, targeting) {
@@ -125377,11 +125484,11 @@ function ShopSSR({ blockId, siteId, apiBaseUrl, stage, children, checkoutEndpoin
125377
125484
  }, pass.id)),
125378
125485
  membershipCards: render.display.memberships.map((membership) => /* @__PURE__ */ jsx(MembershipCardView, {
125379
125486
  display: membership,
125380
- action: /* @__PURE__ */ jsx(ThemedButton, {
125487
+ action: membership.action.kind === "unavailable" ? /* @__PURE__ */ jsx(PassPurchaseUnavailable, { label: membership.action.label }) : /* @__PURE__ */ jsx(ThemedButton, {
125381
125488
  type: "button",
125382
125489
  variant: render.hydration.buttonVariant,
125383
125490
  size: "md",
125384
- label: membership.actionLabel,
125491
+ label: membership.action.label,
125385
125492
  disabled: true,
125386
125493
  "aria-disabled": "true"
125387
125494
  })
@@ -125605,7 +125712,7 @@ function previewEditableTargetToPath(target) {
125605
125712
  case "current-entry-field":
125606
125713
  case "current-entry-metadata": return target.path;
125607
125714
  case "read-only": return;
125608
- default: return assertNever$10(target);
125715
+ default: return assertNever$11(target);
125609
125716
  }
125610
125717
  }
125611
125718
  function previewEditableTargetToFieldKey(target) {
@@ -129774,7 +129881,7 @@ const ALLOWED_URL_PROTOCOLS = ["http:", "https:"];
129774
129881
  const DATE_PATTERN = /^(?<year>[1-9]\d{3})-(?<month>\d{2})-(?<day>\d{2})$/;
129775
129882
  const TIME_PATTERN = /^(?<hours>[01]\d|2[0-3]):(?<minutes>[0-5]\d)$/;
129776
129883
  const DATETIME_PATTERN = /^(?<date>[1-9]\d{3}-\d{2}-\d{2})T(?<time>(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d)(?:\.\d+)?(?<offset>Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;
129777
- function assertNever$2(value) {
129884
+ function assertNever$3(value) {
129778
129885
  throw new Error(`Unhandled field validation variant: ${JSON.stringify(value)}`);
129779
129886
  }
129780
129887
  function validationContext(options = {}) {
@@ -129828,7 +129935,7 @@ function fieldIssueToMessage(issue) {
129828
129935
  case "invalidBoxBackground": return `${issue.label} must use a valid background type and matching fields`;
129829
129936
  case "invalidLink": return `${issue.label} must be a valid link`;
129830
129937
  case "invalidReference": return `${issue.label} must reference a valid item`;
129831
- default: return assertNever$2(issue);
129938
+ default: return assertNever$3(issue);
129832
129939
  }
129833
129940
  }
129834
129941
  function pluralize(label, count) {
@@ -129955,7 +130062,7 @@ function deriveFieldValidationPlan(field, path = [field.id]) {
129955
130062
  case "presetOrCustom":
129956
130063
  case "contentTypeSelect":
129957
130064
  case "entryPicker": return makePlan("passthrough", "unknown", field, path, false, []);
129958
- default: return assertNever$2(field);
130065
+ default: return assertNever$3(field);
129959
130066
  }
129960
130067
  }
129961
130068
  function deriveFieldValidationPlans(fields, parentPath = []) {
@@ -130030,7 +130137,7 @@ function resolveSelectConstraintSource(field) {
130030
130137
  kind: "runtime",
130031
130138
  source: source.kind
130032
130139
  };
130033
- default: return assertNever$2(source);
130140
+ default: return assertNever$3(source);
130034
130141
  }
130035
130142
  }
130036
130143
  function normalizeStoredContentValues(plans, content, options = {}) {
@@ -130068,7 +130175,7 @@ function normalizeStoredFieldValueWithContext(plan, value, ctx) {
130068
130175
  case "link":
130069
130176
  case "select":
130070
130177
  case "passthrough": return normalizeFieldValue(plan, value, ctx);
130071
- default: return assertNever$2(plan);
130178
+ default: return assertNever$3(plan);
130072
130179
  }
130073
130180
  }
130074
130181
  function normalizeStoredObjectChildren(children, value, ctx) {
@@ -130101,7 +130208,7 @@ function normalizeFieldValue(plan, value, ctx) {
130101
130208
  case "select":
130102
130209
  case "passthrough": return value;
130103
130210
  case "media": return value;
130104
- default: return assertNever$2(plan);
130211
+ default: return assertNever$3(plan);
130105
130212
  }
130106
130213
  }
130107
130214
  function normalizeObjectChildren(children, value, ctx) {
@@ -130160,7 +130267,7 @@ function validateNormalizedFieldValue(plan, value, ctx) {
130160
130267
  case "repeater": return validateRepeaterPlan(plan, value, ctx);
130161
130268
  case "group": return validateGroupPlan(plan, value, ctx);
130162
130269
  case "passthrough": return [];
130163
- default: return assertNever$2(plan);
130270
+ default: return assertNever$3(plan);
130164
130271
  }
130165
130272
  }
130166
130273
  function shouldRequireValue(plan, value, ctx) {
@@ -130202,7 +130309,7 @@ function validateStringConstraint(plan, constraint, value) {
130202
130309
  case "timeFormat": return typeof value === "string" && isValidTimeString(value) ? [] : [issue(plan, "invalidTime")];
130203
130310
  case "datetimeFormat": return typeof value === "string" && isValidDateTimeInstantString(value) ? [] : [issue(plan, "invalidDateTime")];
130204
130311
  case "slugFormat": return typeof value === "string" && SLUG_PATTERN.test(value) ? [] : [issue(plan, "invalidSlug")];
130205
- default: return assertNever$2(constraint);
130312
+ default: return assertNever$3(constraint);
130206
130313
  }
130207
130314
  }
130208
130315
  function isValidIconPickerValue(value) {
@@ -130221,7 +130328,7 @@ function validateNumberConstraint(plan, constraint, value) {
130221
130328
  case "numberType": return [];
130222
130329
  case "numberMin": return value < constraint.minimum ? [issue(plan, "tooSmall", { minimum: constraint.minimum })] : [];
130223
130330
  case "numberMax": return value > constraint.maximum ? [issue(plan, "tooLarge", { maximum: constraint.maximum })] : [];
130224
- default: return assertNever$2(constraint);
130331
+ default: return assertNever$3(constraint);
130225
130332
  }
130226
130333
  }
130227
130334
  function validateSelectPlan(plan, value) {
@@ -130243,7 +130350,7 @@ function validateRepeaterPlan(plan, value, ctx) {
130243
130350
  maximum: constraint.maximum,
130244
130351
  itemLabel: "item"
130245
130352
  })] : [];
130246
- default: return assertNever$2(constraint);
130353
+ default: return assertNever$3(constraint);
130247
130354
  }
130248
130355
  }), ...value.flatMap((item, index) => validateRepeaterItem(plan, item, index, ctx))];
130249
130356
  }
@@ -130337,7 +130444,7 @@ function rebaseFieldPlanPath(plan, fromPrefix, toPrefix) {
130337
130444
  ...plan,
130338
130445
  path
130339
130446
  };
130340
- default: return assertNever$2(plan);
130447
+ default: return assertNever$3(plan);
130341
130448
  }
130342
130449
  }
130343
130450
  function validateInlineTextPlan(plan, value) {
@@ -130384,7 +130491,7 @@ function fieldPlanToObjectPropertyZod(plan, options = {}) {
130384
130491
  switch (presence.kind) {
130385
130492
  case "required": return schema;
130386
130493
  case "optional": return schema.optional();
130387
- default: return assertNever$2(presence);
130494
+ default: return assertNever$3(presence);
130388
130495
  }
130389
130496
  }
130390
130497
  /** Validate stored field values without applying editor/write normalization. */
@@ -130463,7 +130570,7 @@ function addFieldIssueToZodContext(zodCtx, validationIssue, rootPath) {
130463
130570
  message
130464
130571
  });
130465
130572
  return;
130466
- default: assertNever$2(validationIssue);
130573
+ default: assertNever$3(validationIssue);
130467
130574
  }
130468
130575
  }
130469
130576
  function relativeZodIssuePath(path, rootPath) {
@@ -130498,7 +130605,7 @@ function findNestedFieldValidationPlan(plan, path) {
130498
130605
  case "link":
130499
130606
  case "select":
130500
130607
  case "passthrough": return null;
130501
- default: return assertNever$2(plan);
130608
+ default: return assertNever$3(plan);
130502
130609
  }
130503
130610
  }
130504
130611
  function fieldValidationDescriptor(plan) {
@@ -138825,7 +138932,7 @@ function collectNestedPreviewFieldConstraintEntries(field, path) {
138825
138932
  case "text":
138826
138933
  case "time":
138827
138934
  case "url": return [];
138828
- default: return assertNever$10(field);
138935
+ default: return assertNever$11(field);
138829
138936
  }
138830
138937
  }
138831
138938
  function prepareDefaultBlockRender(manifest, props) {
@@ -139122,7 +139229,7 @@ function sourceLabel(source) {
139122
139229
  case "managed-database": return "DB";
139123
139230
  case "sdk-synced": return "SDK-synced DB";
139124
139231
  case "sdk-config": return "SDK config";
139125
- default: return assertNever$10(source);
139232
+ default: return assertNever$11(source);
139126
139233
  }
139127
139234
  }
139128
139235
  function mergeBlockDescriptorsWithRegistry(systemBlocks, registry, onConflict) {
@@ -154307,7 +154414,7 @@ function applyEditorCommand(snapshot, command) {
154307
154414
  case "remove-block": return removeBlock(snapshot, command.blockId);
154308
154415
  case "reorder-blocks": return reorderBlocks$1(snapshot, command.blockIds);
154309
154416
  case "batch": return command.changes.reduce((next, change) => applyEditorCommand(next, change), snapshot);
154310
- default: return assertNever$7(command);
154417
+ default: return assertNever$8(command);
154311
154418
  }
154312
154419
  }
154313
154420
  function valueCommandKey(command) {
@@ -154326,7 +154433,7 @@ function valueCommandKey(command) {
154326
154433
  kind: "linked-entry",
154327
154434
  entryId: command.entryId
154328
154435
  };
154329
- default: return assertNever$7(command);
154436
+ default: return assertNever$8(command);
154330
154437
  }
154331
154438
  }
154332
154439
  function withValueAtPath(source, path, value) {
@@ -154378,7 +154485,7 @@ function applyDraftOperation(snapshot, operation) {
154378
154485
  switch (operation.type) {
154379
154486
  case "init-new-draft-block": return initNewDraftBlock(snapshot, operation.blockId, operation.baseline, operation.meta);
154380
154487
  case "remove-draft-block": return removeDraftBlock(snapshot, operation.blockId);
154381
- default: return assertNever$7(operation);
154488
+ default: return assertNever$8(operation);
154382
154489
  }
154383
154490
  }
154384
154491
  function applySystemOperation(snapshot, operation) {
@@ -154394,7 +154501,7 @@ function applySystemOperation(snapshot, operation) {
154394
154501
  }).snapshot;
154395
154502
  case "discard-local-edits": return discardLocalEditsSnapshot(snapshot, operation.contentOwnerEntryId);
154396
154503
  case "replace-block-list": return replaceEditorBlockList(snapshot, operation.next);
154397
- default: return assertNever$7(operation);
154504
+ default: return assertNever$8(operation);
154398
154505
  }
154399
154506
  }
154400
154507
  const METADATA_KEY = { kind: "metadata" };
@@ -154408,7 +154515,7 @@ function valueSyncAt(snapshot, key) {
154408
154515
  case "content": return snapshot.content.sync;
154409
154516
  case "block": return snapshot.drafts[key.blockId]?.sync;
154410
154517
  case "linked-entry": return snapshot.linkedEntries[key.entryId]?.sync;
154411
- default: return assertNever$7(key);
154518
+ default: return assertNever$8(key);
154412
154519
  }
154413
154520
  }
154414
154521
  /** Applies one sync event to one value; the single path every family's transitions take. */
@@ -154436,7 +154543,7 @@ function applyValueEvent(snapshot, key, event) {
154436
154543
  }
154437
154544
  case "block": return transitionDraft(snapshot, key.blockId, event);
154438
154545
  case "linked-entry": return transitionLinkedEntry(snapshot, key.entryId, event);
154439
- default: return assertNever$7(key);
154546
+ default: return assertNever$8(key);
154440
154547
  }
154441
154548
  }
154442
154549
  function brandEvent(event, brand) {
@@ -154477,7 +154584,7 @@ function brandEvent(event, brand) {
154477
154584
  };
154478
154585
  case "send-failed":
154479
154586
  case "discarded": return event;
154480
- default: return assertNever$7(event);
154587
+ default: return assertNever$8(event);
154481
154588
  }
154482
154589
  }
154483
154590
  function transitionValue(value, event, brand) {
@@ -154905,7 +155012,7 @@ function unpublishedDraftChange(draft, publicationState) {
154905
155012
  currentContent: publicationState.current,
154906
155013
  publishedContent: publicationState.published
154907
155014
  };
154908
- default: return assertNever$7(publicationState);
155015
+ default: return assertNever$8(publicationState);
154909
155016
  }
154910
155017
  }
154911
155018
  function getFirstUnpublishedDraftChange(snapshot, versionsFor) {
@@ -157469,7 +157576,7 @@ function previewEditorOpenDestination(current, intent, requestId) {
157469
157576
  },
157470
157577
  previewDesignOpenRequest: null
157471
157578
  };
157472
- default: return assertNever$7(intent, "Unhandled preview editor open intent");
157579
+ default: return assertNever$8(intent, "Unhandled preview editor open intent");
157473
157580
  }
157474
157581
  }
157475
157582
  const EditorUiStoreContext = createContext(null);
@@ -161580,7 +161687,7 @@ function discoverBlocks(allBlocks, options = {}) {
161580
161687
  }
161581
161688
  //#endregion
161582
161689
  //#region ../editor-blocks/src/block-editor/recentBlocksTracker.ts
161583
- const STORAGE_KEY$1 = "builder:recentBlocks";
161690
+ const STORAGE_KEY$2 = "builder:recentBlocks";
161584
161691
  const MAX_RECENT = 6;
161585
161692
  /**
161586
161693
  * Safely reads from localStorage with error handling
@@ -161588,7 +161695,7 @@ const MAX_RECENT = 6;
161588
161695
  function readStorage() {
161589
161696
  if (typeof window === "undefined") return {};
161590
161697
  try {
161591
- const stored = window.localStorage.getItem(STORAGE_KEY$1);
161698
+ const stored = window.localStorage.getItem(STORAGE_KEY$2);
161592
161699
  if (!stored) return {};
161593
161700
  return JSON.parse(stored);
161594
161701
  } catch (error) {
@@ -161602,7 +161709,7 @@ function readStorage() {
161602
161709
  function writeStorage(data) {
161603
161710
  if (typeof window === "undefined") return;
161604
161711
  try {
161605
- window.localStorage.setItem(STORAGE_KEY$1, JSON.stringify(data));
161712
+ window.localStorage.setItem(STORAGE_KEY$2, JSON.stringify(data));
161606
161713
  } catch (error) {
161607
161714
  console.warn("[recentBlocks] Failed to write to localStorage:", error);
161608
161715
  }
@@ -162290,7 +162397,7 @@ async function createEditableBlockForOwner(apiClient, siteId, owner, input) {
162290
162397
  purpose: input.purpose,
162291
162398
  expectedCompositionHash: owner.compositionHash
162292
162399
  });
162293
- default: return assertNever$10(owner);
162400
+ default: return assertNever$11(owner);
162294
162401
  }
162295
162402
  }
162296
162403
  async function reorderEditableBlocksForOwner(apiClient, siteId, owner, blockIds) {
@@ -162314,7 +162421,7 @@ async function reorderEditableBlocksForOwner(apiClient, siteId, owner, blockIds)
162314
162421
  blockIds,
162315
162422
  expectedCompositionHash: owner.compositionHash
162316
162423
  });
162317
- default: return assertNever$10(owner);
162424
+ default: return assertNever$11(owner);
162318
162425
  }
162319
162426
  }
162320
162427
  async function deleteEditableBlockForOwner(apiClient, siteId, owner, blockId) {
@@ -162338,7 +162445,7 @@ async function deleteEditableBlockForOwner(apiClient, siteId, owner, blockId) {
162338
162445
  blockId,
162339
162446
  expectedCompositionHash: owner.compositionHash
162340
162447
  });
162341
- default: return assertNever$10(owner);
162448
+ default: return assertNever$11(owner);
162342
162449
  }
162343
162450
  }
162344
162451
  function surfaceCompositionHashFromResponse(response) {
@@ -162739,7 +162846,7 @@ function readSliderFieldUiConfig(ui) {
162739
162846
  }
162740
162847
  //#endregion
162741
162848
  //#region ../block-form/src/manifest/utils.ts
162742
- function assertNever$1(value) {
162849
+ function assertNever$2(value) {
162743
162850
  throw new Error(`Unhandled manifest variant: ${JSON.stringify(value)}`);
162744
162851
  }
162745
162852
  function getGroupChildFields$1(field) {
@@ -162788,7 +162895,7 @@ function toManifestFieldInput(field) {
162788
162895
  case "contentTypeSelect":
162789
162896
  case "entryPicker": return field;
162790
162897
  }
162791
- return assertNever$1(field);
162898
+ return assertNever$2(field);
162792
162899
  }
162793
162900
  function numberFieldToManifestInput(field) {
162794
162901
  const ui = readNumberFieldUiConfig(field.ui);
@@ -163482,7 +163589,7 @@ function shouldUseCanonicalSchema(field) {
163482
163589
  case "entryPicker":
163483
163590
  case "button": return false;
163484
163591
  }
163485
- return assertNever$1(field);
163592
+ return assertNever$2(field);
163486
163593
  }
163487
163594
  /**
163488
163595
  * Create validation schema from a block manifest
@@ -169101,7 +169208,7 @@ function availableDatesReducer(state, action) {
169101
169208
  data: state.data,
169102
169209
  message: action.message
169103
169210
  };
169104
- default: return assertNever$4(action);
169211
+ default: return assertNever$5(action);
169105
169212
  }
169106
169213
  }
169107
169214
  //#endregion
@@ -169238,7 +169345,7 @@ function getAvailableSlots(state) {
169238
169345
  case "loaded":
169239
169346
  case "refreshing":
169240
169347
  case "error": return state.slots;
169241
- default: return assertNever$4(state);
169348
+ default: return assertNever$5(state);
169242
169349
  }
169243
169350
  }
169244
169351
  function hasLoadedAvailableSlots(state) {
@@ -169248,7 +169355,7 @@ function hasLoadedAvailableSlots(state) {
169248
169355
  case "refreshing":
169249
169356
  case "error": return state.hasLoaded;
169250
169357
  case "loaded": return true;
169251
- default: return assertNever$4(state);
169358
+ default: return assertNever$5(state);
169252
169359
  }
169253
169360
  }
169254
169361
  function isLoadingAvailableSlots(state) {
@@ -169282,7 +169389,7 @@ function availableSlotsReducer(state, action) {
169282
169389
  hasLoaded: hasLoadedAvailableSlots(state),
169283
169390
  message: action.message
169284
169391
  };
169285
- default: return assertNever$4(action);
169392
+ default: return assertNever$5(action);
169286
169393
  }
169287
169394
  }
169288
169395
  //#endregion
@@ -169377,6 +169484,19 @@ function useAvailableSlots({ siteId: _siteId, serviceId, resourceId, selectedDat
169377
169484
  };
169378
169485
  }
169379
169486
  //#endregion
169487
+ //#region ../blocks/src/system/runtime/hooks/useBookingNowIso.ts
169488
+ /**
169489
+ * The moment a booking or registration flow opened, as an ISO timestamp.
169490
+ *
169491
+ * Payment previews take this as their "now" so the pure view-model builders
169492
+ * never read the clock themselves. It's captured once per mount, which keeps
169493
+ * memoised previews stable across renders.
169494
+ */
169495
+ function useBookingNowIso() {
169496
+ const [nowIso] = useState(() => (/* @__PURE__ */ new Date()).toISOString());
169497
+ return nowIso;
169498
+ }
169499
+ //#endregion
169380
169500
  //#region ../blocks/src/system/runtime/hooks/useBookingSubmission.state.ts
169381
169501
  const initialBookingSubmissionState = {
169382
169502
  status: { tag: "idle" },
@@ -169398,7 +169518,7 @@ function bookingSubmissionReducer(state, action) {
169398
169518
  feedback: reportWorkflowError(state, action.message).feedback
169399
169519
  };
169400
169520
  case "feedback-cleared": return clearWorkflowFeedback(state);
169401
- default: return assertNever$4(action);
169521
+ default: return assertNever$5(action);
169402
169522
  }
169403
169523
  }
169404
169524
  function selectIsSubmitting(state) {
@@ -169406,7 +169526,7 @@ function selectIsSubmitting(state) {
169406
169526
  }
169407
169527
  //#endregion
169408
169528
  //#region ../blocks/src/system/runtime/shared/utils/demoBookingPassStorage.ts
169409
- const STORAGE_KEY = "riverbank:demo-booking-passes:v1";
169529
+ const STORAGE_KEY$1 = "riverbank:demo-booking-passes:v1";
169410
169530
  const CHECKOUT_RETURN_EMAIL_KEY = "riverbank:demo-booking-checkout-email:v1";
169411
169531
  const MAX_STORED_PASSES = 10;
169412
169532
  function normalizeDemoBookingEmail(email) {
@@ -169421,7 +169541,7 @@ function storeDemoBookingPass(email, pass) {
169421
169541
  email: normalizedEmail,
169422
169542
  pass
169423
169543
  }, ...current.filter((entry) => entry.email !== normalizedEmail)].slice(0, MAX_STORED_PASSES);
169424
- window.localStorage.setItem(STORAGE_KEY, JSON.stringify(updated));
169544
+ window.localStorage.setItem(STORAGE_KEY$1, JSON.stringify(updated));
169425
169545
  } catch {}
169426
169546
  }
169427
169547
  function storeDemoBookingPassIfAvailable(email, pass) {
@@ -169454,7 +169574,7 @@ function readDemoBookingCheckoutReturnEmail() {
169454
169574
  }
169455
169575
  function readStoredDemoBookingPasses() {
169456
169576
  try {
169457
- const raw = window.localStorage.getItem(STORAGE_KEY);
169577
+ const raw = window.localStorage.getItem(STORAGE_KEY$1);
169458
169578
  if (!raw) return [];
169459
169579
  const parsed = JSON.parse(raw);
169460
169580
  return Array.isArray(parsed) ? parsed.filter(isStoredDemoBookingPass) : [];
@@ -169778,6 +169898,363 @@ function useDiscountCodeUi(options) {
169778
169898
  };
169779
169899
  }
169780
169900
  //#endregion
169901
+ //#region ../commerce/src/utils/assertNever.ts
169902
+ function assertNever$1(value, message) {
169903
+ if (message) throw new Error(message);
169904
+ throw new Error(`Unexpected value: ${String(value)}`);
169905
+ }
169906
+ //#endregion
169907
+ //#region ../commerce/src/purchase/bookingInstalmentSchedule.ts
169908
+ function resolveBookingInitialInstalmentAmountCents(input) {
169909
+ const totalAmountCents = Math.max(0, input.totalAmountCents);
169910
+ switch (input.plan.kind) {
169911
+ case "deposit_plus_one_remainder":
169912
+ case "deposit_plus_scheduled_instalments": return clampConfiguredAmount(input.plan.depositAmountCents, totalAmountCents);
169913
+ case "equal_scheduled_instalments": return splitAmountWithRemainderInFirst(totalAmountCents, input.plan.instalmentCount)[0] ?? 0;
169914
+ default: return assertNever$1(input.plan);
169915
+ }
169916
+ }
169917
+ function buildBookingInstalmentSchedule(input) {
169918
+ const totalAmountCents = Math.max(0, input.totalAmountCents);
169919
+ switch (input.plan.kind) {
169920
+ case "deposit_plus_one_remainder": {
169921
+ const depositAmountCents = resolveBookingInitialInstalmentAmountCents(input);
169922
+ const remainderAmountCents = Math.max(0, totalAmountCents - depositAmountCents);
169923
+ return omitZeroAmountFutureRows([createScheduleRow({
169924
+ sequence: 1,
169925
+ stateAtBooking: "paid_today",
169926
+ dueAt: input.anchorAt,
169927
+ amountCents: depositAmountCents
169928
+ }), createScheduleRow({
169929
+ sequence: 2,
169930
+ stateAtBooking: "scheduled",
169931
+ dueAt: addIntervalPreservingMonthAnchor(input.anchorAt, input.plan.remainderDueCount, input.plan.intervalUnit),
169932
+ amountCents: remainderAmountCents
169933
+ })]);
169934
+ }
169935
+ case "deposit_plus_scheduled_instalments": {
169936
+ const plan = input.plan;
169937
+ const depositAmountCents = resolveBookingInitialInstalmentAmountCents(input);
169938
+ const instalmentAmounts = splitAmountWithRemainderInFirst(Math.max(0, totalAmountCents - depositAmountCents), plan.instalmentCount);
169939
+ return omitZeroAmountFutureRows([createScheduleRow({
169940
+ sequence: 1,
169941
+ stateAtBooking: "paid_today",
169942
+ dueAt: input.anchorAt,
169943
+ amountCents: depositAmountCents
169944
+ }), ...instalmentAmounts.map((amountCents, index) => createScheduleRow({
169945
+ sequence: index + 2,
169946
+ stateAtBooking: "scheduled",
169947
+ dueAt: addIntervalPreservingMonthAnchor(input.anchorAt, plan.intervalCount * (index + 1), plan.intervalUnit),
169948
+ amountCents
169949
+ }))]);
169950
+ }
169951
+ case "equal_scheduled_instalments": {
169952
+ const plan = input.plan;
169953
+ return omitZeroAmountFutureRows(splitAmountWithRemainderInFirst(totalAmountCents, plan.instalmentCount).map((amountCents, index) => createScheduleRow({
169954
+ sequence: index + 1,
169955
+ stateAtBooking: index === 0 ? "paid_today" : "scheduled",
169956
+ dueAt: index === 0 ? input.anchorAt : addIntervalPreservingMonthAnchor(input.anchorAt, plan.intervalCount * index, plan.intervalUnit),
169957
+ amountCents
169958
+ })));
169959
+ }
169960
+ default: return assertNever$1(input.plan);
169961
+ }
169962
+ }
169963
+ function createScheduleRow(input) {
169964
+ return {
169965
+ id: `payment-${input.sequence}`,
169966
+ sequence: input.sequence,
169967
+ stateAtBooking: input.stateAtBooking,
169968
+ dueAt: input.dueAt,
169969
+ amountCents: input.amountCents
169970
+ };
169971
+ }
169972
+ //#endregion
169973
+ //#region ../commerce/src/purchase/checkoutPaymentFlow.ts
169974
+ function planCheckoutPaymentFlow(options) {
169975
+ const amountDueCents = toNonNegativeCents(options.amountDueCents);
169976
+ const discountCents = toNonNegativeCents(options.discountCents);
169977
+ const availableCreditCents = toNonNegativeCents(options.availableCreditCents);
169978
+ const minimumStripeChargeCents = toNonNegativeCents(options.minimumStripeChargeCents ?? 0);
169979
+ if (amountDueCents <= 0) return {
169980
+ kind: "bypass",
169981
+ bypassReason: discountCents > 0 ? "discount_free" : "free",
169982
+ reserveCreditCents: 0
169983
+ };
169984
+ if (!options.creditCurrencyMatches || availableCreditCents <= 0) return {
169985
+ kind: "stripe",
169986
+ reserveCreditCents: toNonNegativeCents(0)
169987
+ };
169988
+ if (availableCreditCents >= amountDueCents) return {
169989
+ kind: "store_credit_only",
169990
+ reserveCreditCents: amountDueCents
169991
+ };
169992
+ return {
169993
+ kind: "stripe",
169994
+ reserveCreditCents: planMixedPaymentCreditReservation({
169995
+ amountDueCents,
169996
+ availableCreditCents,
169997
+ minimumStripeChargeCents
169998
+ })
169999
+ };
170000
+ }
170001
+ function planMixedPaymentCreditReservation(input) {
170002
+ const chargeAfterFullCredit = input.amountDueCents - input.availableCreditCents;
170003
+ if (input.minimumStripeChargeCents <= 0 || chargeAfterFullCredit <= 0 || chargeAfterFullCredit >= input.minimumStripeChargeCents) return input.availableCreditCents;
170004
+ if (input.amountDueCents < input.minimumStripeChargeCents) return toNonNegativeCents(0);
170005
+ return toNonNegativeCents(input.amountDueCents - input.minimumStripeChargeCents);
170006
+ }
170007
+ /**
170008
+ * Apply site credit to a flexible-balance booking before card payment.
170009
+ *
170010
+ * Credit first reduces the configured payment due now. Once that payment is
170011
+ * covered, any remaining credit reduces the later balance. If a partial credit
170012
+ * application would leave a positive card charge below Stripe's minimum, less
170013
+ * credit is used so the configured payment can still be collected.
170014
+ */
170015
+ function planFlexibleBalanceCreditFirst(input) {
170016
+ const totalCents = toNonNegativeCents(input.totalAfterDiscountCents);
170017
+ const configuredDueNowCents = toNonNegativeCents(Math.min(input.configuredPaymentDueNowCents, totalCents));
170018
+ const availableCreditCents = toNonNegativeCents(input.creditCurrencyMatches ? input.availableCreditCents : 0);
170019
+ const minimumStripeChargeCents = toNonNegativeCents(input.minimumStripeChargeCents ?? 0);
170020
+ if (availableCreditCents >= totalCents && totalCents > 0) return {
170021
+ kind: "credit_only",
170022
+ reserveCreditCents: totalCents,
170023
+ cardDueNowCents: toNonNegativeCents(0),
170024
+ laterBalanceCents: toNonNegativeCents(0)
170025
+ };
170026
+ let reserveCreditCents = toNonNegativeCents(Math.min(availableCreditCents, totalCents));
170027
+ if (reserveCreditCents >= configuredDueNowCents) return {
170028
+ kind: "flexible_balance",
170029
+ reserveCreditCents,
170030
+ cardDueNowCents: toNonNegativeCents(0),
170031
+ laterBalanceCents: toNonNegativeCents(totalCents - reserveCreditCents)
170032
+ };
170033
+ const plannedCardDueNowCents = toNonNegativeCents(configuredDueNowCents - reserveCreditCents);
170034
+ if (plannedCardDueNowCents > 0 && plannedCardDueNowCents < minimumStripeChargeCents) {
170035
+ if (configuredDueNowCents < minimumStripeChargeCents) return {
170036
+ kind: "card_below_minimum",
170037
+ reserveCreditCents: toNonNegativeCents(0),
170038
+ cardDueNowCents: configuredDueNowCents,
170039
+ laterBalanceCents: toNonNegativeCents(totalCents - configuredDueNowCents)
170040
+ };
170041
+ reserveCreditCents = toNonNegativeCents(configuredDueNowCents - minimumStripeChargeCents);
170042
+ }
170043
+ const cardDueNowCents = toNonNegativeCents(configuredDueNowCents - reserveCreditCents);
170044
+ return {
170045
+ kind: "flexible_balance",
170046
+ reserveCreditCents,
170047
+ cardDueNowCents,
170048
+ laterBalanceCents: toNonNegativeCents(totalCents - reserveCreditCents - cardDueNowCents)
170049
+ };
170050
+ }
170051
+ //#endregion
170052
+ //#region ../commerce/src/purchase/settlement.ts
170053
+ function normalizeCurrencyCode(raw) {
170054
+ const normalized = raw.trim().toUpperCase();
170055
+ if (!/^[A-Z]{3}$/.test(normalized)) throw new Error(`Invalid currency code: ${raw}`);
170056
+ return normalized;
170057
+ }
170058
+ //#endregion
170059
+ //#region ../commerce/src/purchase/checkoutSessionMetadata.ts
170060
+ const datedOfferingSharedEngineMetadataShape = {
170061
+ datedOfferingEngineContractVersion: z.literal("shared_v1"),
170062
+ datedOfferingEngineRouteKind: z.literal("shared_whole_series_registration"),
170063
+ datedOfferingCapacityHoldId: z.string().uuid(),
170064
+ datedOfferingCapacityHoldAuditRef: z.string().uuid(),
170065
+ customerId: z.string().uuid(),
170066
+ eventSeriesId: z.string().uuid()
170067
+ };
170068
+ z.object(datedOfferingSharedEngineMetadataShape);
170069
+ const orderCheckoutSessionMetadataBaseShape = {
170070
+ type: z.literal("order"),
170071
+ site_id: z.string().uuid(),
170072
+ order_id: z.string().uuid().optional(),
170073
+ customer_email: z.string().email().optional(),
170074
+ customer_name: z.string().optional(),
170075
+ product_id: z.string().uuid().optional(),
170076
+ attendee_id: z.string().uuid().optional(),
170077
+ occurrence_id: z.string().uuid().optional(),
170078
+ tickets_count: z.string().optional(),
170079
+ notes: z.string().optional(),
170080
+ discount_redemption_id: z.string().uuid().optional(),
170081
+ discount_code_id: z.string().uuid().optional(),
170082
+ discount_code: z.string().optional(),
170083
+ discount_public_label: z.string().optional(),
170084
+ credit_reservation_id: z.string().uuid().optional(),
170085
+ credit_reserved_cents: z.string().optional(),
170086
+ discount_code_amount_cents: z.string().optional(),
170087
+ order_payment_reason: z.enum([
170088
+ "instalment_payoff",
170089
+ "flexible_balance_initial",
170090
+ "flexible_balance_paydown"
170091
+ ]).optional(),
170092
+ order_payment_plan_id: z.string().uuid().optional(),
170093
+ order_flexible_balance_contract_id: z.string().uuid().optional()
170094
+ };
170095
+ const absentDatedOfferingSharedEngineMetadataShape = {
170096
+ datedOfferingEngineContractVersion: z.never().optional(),
170097
+ datedOfferingEngineRouteKind: z.never().optional(),
170098
+ datedOfferingCapacityHoldId: z.never().optional(),
170099
+ datedOfferingCapacityHoldAuditRef: z.never().optional(),
170100
+ customerId: z.never().optional(),
170101
+ eventSeriesId: z.never().optional()
170102
+ };
170103
+ const LegacyOrderCheckoutSessionMetadataSchema = z.object({
170104
+ ...orderCheckoutSessionMetadataBaseShape,
170105
+ ...absentDatedOfferingSharedEngineMetadataShape
170106
+ });
170107
+ const SharedDatedOfferingOrderCheckoutSessionMetadataSchema = z.object({
170108
+ ...orderCheckoutSessionMetadataBaseShape,
170109
+ ...datedOfferingSharedEngineMetadataShape
170110
+ });
170111
+ z.union([SharedDatedOfferingOrderCheckoutSessionMetadataSchema, LegacyOrderCheckoutSessionMetadataSchema]);
170112
+ //#endregion
170113
+ //#region ../commerce/src/purchase/stripeCommissionMetadata.ts
170114
+ /** Reasons are payment evidence, not an independent pricing policy. */
170115
+ const STRIPE_COMMISSION_FREE_REASONS = [
170116
+ "managed_billing",
170117
+ "no_commission_plan",
170118
+ "billing_evidence_invalid",
170119
+ "fee_rounds_to_zero",
170120
+ "payment_not_stripe"
170121
+ ];
170122
+ const historicalContext = {
170123
+ currency: z.string().refine((value) => parseCurrencyCode(value) !== null).optional(),
170124
+ sourcePlanId: z.string().trim().min(1).optional()
170125
+ };
170126
+ const percentSchema = z.number().finite().min(0).max(100);
170127
+ z.discriminatedUnion("kind", [
170128
+ z.object({
170129
+ kind: z.literal("commission_free"),
170130
+ reason: z.enum(STRIPE_COMMISSION_FREE_REASONS),
170131
+ ...historicalContext
170132
+ }),
170133
+ z.object({
170134
+ kind: z.literal("application_fee_amount"),
170135
+ amountCents: z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
170136
+ percent: percentSchema,
170137
+ ...historicalContext
170138
+ }),
170139
+ z.object({
170140
+ kind: z.literal("application_fee_percent"),
170141
+ percent: percentSchema,
170142
+ ...historicalContext
170143
+ })
170144
+ ]);
170145
+ toNonNegativeCents(0);
170146
+ //#endregion
170147
+ //#region ../commerce/src/purchase/stripeMinimumCharge.ts
170148
+ const STRIPE_MINIMUM_CHARGE_CENTS_BY_CURRENCY = {
170149
+ GBP: 30,
170150
+ USD: 50,
170151
+ EUR: 50,
170152
+ AED: 200,
170153
+ AUD: 50,
170154
+ BGN: 100,
170155
+ BRL: 50,
170156
+ CAD: 50,
170157
+ CHF: 50,
170158
+ CZK: 1500,
170159
+ DKK: 250,
170160
+ HKD: 400,
170161
+ HUF: 17500,
170162
+ JPY: 50,
170163
+ MXN: 1e3,
170164
+ MYR: 200,
170165
+ NOK: 300,
170166
+ NZD: 50,
170167
+ PLN: 200,
170168
+ RON: 200,
170169
+ SEK: 300,
170170
+ SGD: 50,
170171
+ THB: 1e3
170172
+ };
170173
+ function isStripeMinimumChargeCurrency(currency) {
170174
+ return currency in STRIPE_MINIMUM_CHARGE_CENTS_BY_CURRENCY;
170175
+ }
170176
+ function getStripeMinimumChargeRequirement(rawCurrency) {
170177
+ let currency;
170178
+ try {
170179
+ currency = normalizeCurrencyCode(rawCurrency);
170180
+ } catch {
170181
+ return null;
170182
+ }
170183
+ const currencyKey = currency;
170184
+ if (!isStripeMinimumChargeCurrency(currencyKey)) return null;
170185
+ return {
170186
+ currency,
170187
+ minimumAmountCents: STRIPE_MINIMUM_CHARGE_CENTS_BY_CURRENCY[currencyKey]
170188
+ };
170189
+ }
170190
+ //#endregion
170191
+ //#region ../commerce/src/purchase/event-registration-errors.ts
170192
+ const eventRegistrationErrors = {
170193
+ registrationClosed: {
170194
+ message: "Booking is currently closed for this event. Please contact the organiser if you’d like to find out more.",
170195
+ action: "none"
170196
+ },
170197
+ paymentInvestigationRequired: {
170198
+ message: "We still can’t confirm your payment. Please don’t make another payment. Contact the organiser so they can check your booking.",
170199
+ action: "none"
170200
+ },
170201
+ paymentProviderUnavailable: {
170202
+ message: "We couldn’t reach the payment provider. Please try again in a minute.",
170203
+ action: "retry"
170204
+ },
170205
+ paymentPageUnavailable: {
170206
+ message: "We couldn’t open the payment page. Please refresh this page and try again. If this keeps happening, contact the organiser for help.",
170207
+ action: "retry"
170208
+ },
170209
+ paymentUnavailable: {
170210
+ message: "Online payment is not available for this event right now. Please contact the organiser for help with booking.",
170211
+ action: "none"
170212
+ },
170213
+ capacityChanged: {
170214
+ message: "Sorry, there aren’t enough places left for your selection. Please check the available places and choose again.",
170215
+ action: "places"
170216
+ },
170217
+ selectionChanged: {
170218
+ message: "The booking options for this event have changed. Please check the latest options and choose your places again.",
170219
+ action: "places"
170220
+ },
170221
+ registrationPreparationChanged: {
170222
+ message: "The booking options for this event have changed. Please check the latest options and choose your places again.",
170223
+ action: "places"
170224
+ },
170225
+ registrationAlreadyExists: {
170226
+ message: "You already have a booking for this event. Please check your bookings to see its status. If you need help, contact the organiser.",
170227
+ action: "portal"
170228
+ },
170229
+ holdExpired: {
170230
+ message: "Your reservation has timed out. Please check availability and choose your places again.",
170231
+ action: "start"
170232
+ },
170233
+ waitlistUnavailable: {
170234
+ message: "Sorry, the waiting list place offered in this invitation is no longer available. Please check the event for available places or contact the organiser for help.",
170235
+ action: "event"
170236
+ },
170237
+ paymentContextMismatch: {
170238
+ message: "The payment options for this event have changed. Please check the latest options before continuing.",
170239
+ action: "payment-options"
170240
+ },
170241
+ verificationFailed: {
170242
+ message: "We couldn’t confirm this request came from a person. Please refresh the page and try again.",
170243
+ action: "none"
170244
+ },
170245
+ idempotencyConflict: {
170246
+ message: "You’ve already started booking this event. Please finish in the other tab if it’s still open, or check your booking status before starting again.",
170247
+ action: "portal"
170248
+ },
170249
+ invalidCommitInput: {
170250
+ message: "We couldn’t accept your booking details. Please check the information you entered and try again. If this keeps happening, contact the organiser for help.",
170251
+ action: "details"
170252
+ }
170253
+ };
170254
+ function parseEventRegistrationErrorReason(value) {
170255
+ return typeof value === "string" && Object.prototype.hasOwnProperty.call(eventRegistrationErrors, value) ? value : null;
170256
+ }
170257
+ //#endregion
169781
170258
  //#region ../blocks/src/system/runtime/shared/bookingPaymentOptionCopy.ts
169782
170259
  function buildUpfrontBookingPaymentOptionCopy(formattedTotal) {
169783
170260
  return {
@@ -169844,16 +170321,15 @@ function resolveBookingPaymentDueNowCents(input) {
169844
170321
  switch (input.option.kind) {
169845
170322
  case "upfront": return input.totalCents;
169846
170323
  case "deferred_manual": return 0;
169847
- case "instalment_plan": return buildInstalmentSchedulePreview({
169848
- totalCents: input.totalCents,
169849
- option: input.option,
169850
- bookingStartAt: input.bookingStartAt
169851
- })[0]?.amountCents ?? input.totalCents;
170324
+ case "instalment_plan": return resolveBookingInitialInstalmentAmountCents({
170325
+ totalAmountCents: input.totalCents,
170326
+ plan: input.option.plan
170327
+ });
169852
170328
  case "flexible_balance": return resolveFlexibleBalanceInitialPaymentCents({
169853
170329
  totalAmountCents: input.totalCents,
169854
170330
  config: input.option.config
169855
170331
  });
169856
- default: return assertNever$4(input.option);
170332
+ default: return assertNever$5(input.option);
169857
170333
  }
169858
170334
  }
169859
170335
  function buildBookingPaymentSelectionViewModel(input) {
@@ -169870,6 +170346,7 @@ function buildBookingPaymentSelectionViewModel(input) {
169870
170346
  totalCents,
169871
170347
  currency,
169872
170348
  bookingStartAt: input.bookingStartAt,
170349
+ nowIso: input.nowIso,
169873
170350
  locale: input.locale
169874
170351
  }))
169875
170352
  };
@@ -169912,17 +170389,12 @@ function buildBookingPaymentOptionViewModel(input) {
169912
170389
  };
169913
170390
  }
169914
170391
  case "instalment_plan": {
169915
- const schedulePreview = buildInstalmentSchedulePreview({
169916
- totalCents: input.totalCents,
169917
- option: input.option,
169918
- bookingStartAt: input.bookingStartAt
169919
- });
169920
- const dueToday = resolveBookingPaymentDueNowCents({
169921
- option: input.option,
169922
- totalCents: input.totalCents,
169923
- bookingStartAt: input.bookingStartAt
170392
+ const [firstRow, ...futureRows] = buildBookingInstalmentSchedule({
170393
+ anchorAt: input.nowIso,
170394
+ totalAmountCents: input.totalCents,
170395
+ plan: input.option.plan
169924
170396
  });
169925
- const futureRows = schedulePreview.slice(1);
170397
+ const dueToday = firstRow?.amountCents ?? 0;
169926
170398
  const formattedTotal = formatPrice(input.totalCents, input.currency, input.locale);
169927
170399
  const formattedDueToday = formatPrice(dueToday, input.currency, input.locale);
169928
170400
  const depositRefundability = getBookingInstalmentDepositRefundability(input.option.plan);
@@ -169969,7 +170441,7 @@ function buildBookingPaymentOptionViewModel(input) {
169969
170441
  const formattedDueToday = formatPrice(dueToday, input.currency, input.locale);
169970
170442
  const formattedRemainingBalance = formatPrice(remainingBalance, input.currency, input.locale);
169971
170443
  const dueAt = resolveFlexibleBalanceDueAt({
169972
- bookingStartAt: input.bookingStartAt ?? (/* @__PURE__ */ new Date()).toISOString(),
170444
+ bookingStartAt: input.bookingStartAt ?? input.nowIso,
169973
170445
  dueDateRule: input.option.config.dueDateRule
169974
170446
  });
169975
170447
  const copy = buildFlexibleBalanceBookingPaymentOptionCopy({
@@ -170007,43 +170479,7 @@ function buildBookingPaymentOptionViewModel(input) {
170007
170479
  ctaLabel: copy.ctaLabel
170008
170480
  };
170009
170481
  }
170010
- default: return assertNever$4(input.option);
170011
- }
170012
- }
170013
- function buildInstalmentSchedulePreview(input) {
170014
- const startAt = input.bookingStartAt ?? (/* @__PURE__ */ new Date()).toISOString();
170015
- switch (input.option.plan.kind) {
170016
- case "deposit_plus_one_remainder": {
170017
- const deposit = clampConfiguredAmount(input.option.plan.depositAmountCents, input.totalCents);
170018
- const remainder = Math.max(0, input.totalCents - deposit);
170019
- return compactSchedulePreview([{
170020
- dueAt: startAt,
170021
- amountCents: deposit
170022
- }, {
170023
- dueAt: addIntervalPreservingMonthAnchor(startAt, input.option.plan.remainderDueCount, input.option.plan.intervalUnit),
170024
- amountCents: remainder
170025
- }]);
170026
- }
170027
- case "deposit_plus_scheduled_instalments": {
170028
- const plan = input.option.plan;
170029
- const deposit = clampConfiguredAmount(plan.depositAmountCents, input.totalCents);
170030
- const instalments = splitAmountWithRemainderInFirst(Math.max(0, input.totalCents - deposit), plan.instalmentCount);
170031
- return compactSchedulePreview([{
170032
- dueAt: startAt,
170033
- amountCents: deposit
170034
- }, ...instalments.map((amountCents, index) => ({
170035
- dueAt: addIntervalPreservingMonthAnchor(startAt, plan.intervalCount * (index + 1), plan.intervalUnit),
170036
- amountCents
170037
- }))]);
170038
- }
170039
- case "equal_scheduled_instalments": {
170040
- const plan = input.option.plan;
170041
- return compactSchedulePreview(splitAmountWithRemainderInFirst(input.totalCents, plan.instalmentCount).map((amountCents, index) => ({
170042
- dueAt: index === 0 ? startAt : addIntervalPreservingMonthAnchor(startAt, plan.intervalCount * index, plan.intervalUnit),
170043
- amountCents
170044
- })));
170045
- }
170046
- default: return assertNever$4(input.option.plan);
170482
+ default: return assertNever$5(input.option);
170047
170483
  }
170048
170484
  }
170049
170485
  function getPaymentCadenceLabel(plan) {
@@ -170051,9 +170487,6 @@ function getPaymentCadenceLabel(plan) {
170051
170487
  const unitLabel = intervalCount === 1 ? plan.intervalUnit : `${plan.intervalUnit}s`;
170052
170488
  return intervalCount === 1 ? unitLabel : `every ${intervalCount} ${unitLabel}`;
170053
170489
  }
170054
- function compactSchedulePreview(schedule) {
170055
- return omitZeroAmountFutureRows(schedule);
170056
- }
170057
170490
  function formatScheduleDate(isoString, locale) {
170058
170491
  const date = new Date(isoString);
170059
170492
  if (!Number.isFinite(date.getTime())) return isoString;
@@ -170301,7 +170734,7 @@ function bookingFlowReducer(state, event) {
170301
170734
  phase: "editing"
170302
170735
  } : state;
170303
170736
  case "reset": return event.initial;
170304
- default: return assertNever$4(event);
170737
+ default: return assertNever$5(event);
170305
170738
  }
170306
170739
  }
170307
170740
  function applyBookingServiceSelection(state, serviceId) {
@@ -170471,7 +170904,7 @@ function validateBookingStep(input) {
170471
170904
  errors: createFieldBookingValidationErrors(errors)
170472
170905
  } : { ok: true };
170473
170906
  }
170474
- default: return assertNever$4(input.stepId);
170907
+ default: return assertNever$5(input.stepId);
170475
170908
  }
170476
170909
  }
170477
170910
  function validateBookingFields(input) {
@@ -170727,7 +171160,7 @@ function resolveAppointmentPackagesModel(input) {
170727
171160
  selected
170728
171161
  };
170729
171162
  }
170730
- default: return assertNever$4(input.state);
171163
+ default: return assertNever$5(input.state);
170731
171164
  }
170732
171165
  }
170733
171166
  function toHeadlessEligibleAppointmentPackage(appointmentPackage) {
@@ -171257,13 +171690,16 @@ function useHeadlessBookingFlow(options) {
171257
171690
  defaultServiceId,
171258
171691
  options.services
171259
171692
  ]);
171693
+ const bookingNowIso = useBookingNowIso();
171260
171694
  const paymentSelection = useMemo(() => selectedService && paymentResolution.mode !== "unsupported" ? buildBookingPaymentSelectionViewModel({
171261
171695
  serviceTitle: selectedService.title,
171262
171696
  paymentTerms: selectedService.paymentTerms,
171263
171697
  priceAmount: selectedAppointmentPriceAmount,
171264
171698
  priceCurrency: selectedService.priceCurrency,
171265
- bookingStartAt: state.selectedSlot?.startAt
171699
+ bookingStartAt: state.selectedSlot?.startAt,
171700
+ nowIso: bookingNowIso
171266
171701
  }) : null, [
171702
+ bookingNowIso,
171267
171703
  paymentResolution.mode,
171268
171704
  selectedAppointmentPriceAmount,
171269
171705
  selectedService,
@@ -171456,14 +171892,14 @@ function pollingReducer(state, action) {
171456
171892
  case "completed":
171457
171893
  case "failed":
171458
171894
  case "timeout": return state;
171459
- default: return assertNever$4(state);
171895
+ default: return assertNever$5(state);
171460
171896
  }
171461
171897
  case "polling-timed-out": return {
171462
171898
  tag: "timeout",
171463
171899
  result: state.result,
171464
171900
  error: /* @__PURE__ */ new Error("Polling timed out")
171465
171901
  };
171466
- default: return assertNever$4(action);
171902
+ default: return assertNever$5(action);
171467
171903
  }
171468
171904
  }
171469
171905
  //#endregion
@@ -172157,7 +172593,7 @@ function DefaultServiceChoices({ booking }) {
172157
172593
  })]
172158
172594
  }, group.key))
172159
172595
  });
172160
- default: return assertNever$4(layout);
172596
+ default: return assertNever$5(layout);
172161
172597
  }
172162
172598
  }
172163
172599
  function ServiceChoiceGrid({ booking, choices }) {
@@ -172318,7 +172754,7 @@ function DefaultBookingStepContent({ booking, errorSummaryId }) {
172318
172754
  fields: booking.fields.items,
172319
172755
  booking
172320
172756
  });
172321
- default: return assertNever$4(stepId);
172757
+ default: return assertNever$5(stepId);
172322
172758
  }
172323
172759
  }
172324
172760
  function DefaultServiceSelectionStep({ booking }) {
@@ -173674,6 +174110,7 @@ function buildEventRegistrationPaymentOptionsViewModel(input) {
173674
174110
  priceAmount: input.totalPriceCents,
173675
174111
  priceCurrency: input.currency,
173676
174112
  bookingStartAt: input.startsAt,
174113
+ nowIso: input.nowIso,
173677
174114
  locale: input.locale
173678
174115
  });
173679
174116
  return {
@@ -173681,7 +174118,7 @@ function buildEventRegistrationPaymentOptionsViewModel(input) {
173681
174118
  sectionTitle: selection.sectionTitle,
173682
174119
  options: selection.options.flatMap((option, index) => {
173683
174120
  const sourceOption = approvedOptions[index];
173684
- return sourceOption ? [toEventDirectPaymentOption(option, sourceOption, selection.mode, input.totalPriceCents, input.startsAt)] : [];
174121
+ return sourceOption ? [toEventDirectPaymentOption(option, sourceOption, selection.mode, input.totalPriceCents)] : [];
173685
174122
  })
173686
174123
  };
173687
174124
  }
@@ -173689,11 +174126,10 @@ function selectApprovedEventDirectPaymentOptions(approvedPaymentOptions, payment
173689
174126
  const approvedKinds = new Set(getApprovedDirectPaymentCollectionOptionKinds(approvedPaymentOptions));
173690
174127
  return paymentTerms.allowedOptions.filter((option) => approvedKinds.has(option.kind));
173691
174128
  }
173692
- function toEventDirectPaymentOption(option, sourceOption, mode, totalCents, startsAt) {
174129
+ function toEventDirectPaymentOption(option, sourceOption, mode, totalCents) {
173693
174130
  const configuredPaymentDueNowCents = resolveBookingPaymentDueNowCents({
173694
174131
  option: sourceOption,
173695
- totalCents,
173696
- bookingStartAt: startsAt
174132
+ totalCents
173697
174133
  });
173698
174134
  switch (option.kind) {
173699
174135
  case "upfront": return {
@@ -174346,7 +174782,7 @@ function eligibilityLookupReducer(state, action) {
174346
174782
  settledRequestKey: null,
174347
174783
  error: action.message
174348
174784
  };
174349
- default: return assertNever$4(action);
174785
+ default: return assertNever$5(action);
174350
174786
  }
174351
174787
  }
174352
174788
  const initialExistingRegistrationLookupState = {
@@ -174364,7 +174800,7 @@ function existingRegistrationLookupReducer(state, action) {
174364
174800
  tag: "resolved",
174365
174801
  registration: action.registration
174366
174802
  };
174367
- default: return assertNever$4(action);
174803
+ default: return assertNever$5(action);
174368
174804
  }
174369
174805
  }
174370
174806
  //#endregion
@@ -174618,291 +175054,6 @@ function logoutPortal(anchorId) {
174618
175054
  form.submit();
174619
175055
  }
174620
175056
  //#endregion
174621
- //#region ../commerce/src/purchase/checkoutPaymentFlow.ts
174622
- function planCheckoutPaymentFlow(options) {
174623
- const amountDueCents = toNonNegativeCents(options.amountDueCents);
174624
- const discountCents = toNonNegativeCents(options.discountCents);
174625
- const availableCreditCents = toNonNegativeCents(options.availableCreditCents);
174626
- const minimumStripeChargeCents = toNonNegativeCents(options.minimumStripeChargeCents ?? 0);
174627
- if (amountDueCents <= 0) return {
174628
- kind: "bypass",
174629
- bypassReason: discountCents > 0 ? "discount_free" : "free",
174630
- reserveCreditCents: 0
174631
- };
174632
- if (!options.creditCurrencyMatches || availableCreditCents <= 0) return {
174633
- kind: "stripe",
174634
- reserveCreditCents: toNonNegativeCents(0)
174635
- };
174636
- if (availableCreditCents >= amountDueCents) return {
174637
- kind: "store_credit_only",
174638
- reserveCreditCents: amountDueCents
174639
- };
174640
- return {
174641
- kind: "stripe",
174642
- reserveCreditCents: planMixedPaymentCreditReservation({
174643
- amountDueCents,
174644
- availableCreditCents,
174645
- minimumStripeChargeCents
174646
- })
174647
- };
174648
- }
174649
- function planMixedPaymentCreditReservation(input) {
174650
- const chargeAfterFullCredit = input.amountDueCents - input.availableCreditCents;
174651
- if (input.minimumStripeChargeCents <= 0 || chargeAfterFullCredit <= 0 || chargeAfterFullCredit >= input.minimumStripeChargeCents) return input.availableCreditCents;
174652
- if (input.amountDueCents < input.minimumStripeChargeCents) return toNonNegativeCents(0);
174653
- return toNonNegativeCents(input.amountDueCents - input.minimumStripeChargeCents);
174654
- }
174655
- /**
174656
- * Apply site credit to a flexible-balance booking before card payment.
174657
- *
174658
- * Credit first reduces the configured payment due now. Once that payment is
174659
- * covered, any remaining credit reduces the later balance. If a partial credit
174660
- * application would leave a positive card charge below Stripe's minimum, less
174661
- * credit is used so the configured payment can still be collected.
174662
- */
174663
- function planFlexibleBalanceCreditFirst(input) {
174664
- const totalCents = toNonNegativeCents(input.totalAfterDiscountCents);
174665
- const configuredDueNowCents = toNonNegativeCents(Math.min(input.configuredPaymentDueNowCents, totalCents));
174666
- const availableCreditCents = toNonNegativeCents(input.creditCurrencyMatches ? input.availableCreditCents : 0);
174667
- const minimumStripeChargeCents = toNonNegativeCents(input.minimumStripeChargeCents ?? 0);
174668
- if (availableCreditCents >= totalCents && totalCents > 0) return {
174669
- kind: "credit_only",
174670
- reserveCreditCents: totalCents,
174671
- cardDueNowCents: toNonNegativeCents(0),
174672
- laterBalanceCents: toNonNegativeCents(0)
174673
- };
174674
- let reserveCreditCents = toNonNegativeCents(Math.min(availableCreditCents, totalCents));
174675
- if (reserveCreditCents >= configuredDueNowCents) return {
174676
- kind: "flexible_balance",
174677
- reserveCreditCents,
174678
- cardDueNowCents: toNonNegativeCents(0),
174679
- laterBalanceCents: toNonNegativeCents(totalCents - reserveCreditCents)
174680
- };
174681
- const plannedCardDueNowCents = toNonNegativeCents(configuredDueNowCents - reserveCreditCents);
174682
- if (plannedCardDueNowCents > 0 && plannedCardDueNowCents < minimumStripeChargeCents) {
174683
- if (configuredDueNowCents < minimumStripeChargeCents) return {
174684
- kind: "card_below_minimum",
174685
- reserveCreditCents: toNonNegativeCents(0),
174686
- cardDueNowCents: configuredDueNowCents,
174687
- laterBalanceCents: toNonNegativeCents(totalCents - configuredDueNowCents)
174688
- };
174689
- reserveCreditCents = toNonNegativeCents(configuredDueNowCents - minimumStripeChargeCents);
174690
- }
174691
- const cardDueNowCents = toNonNegativeCents(configuredDueNowCents - reserveCreditCents);
174692
- return {
174693
- kind: "flexible_balance",
174694
- reserveCreditCents,
174695
- cardDueNowCents,
174696
- laterBalanceCents: toNonNegativeCents(totalCents - reserveCreditCents - cardDueNowCents)
174697
- };
174698
- }
174699
- //#endregion
174700
- //#region ../commerce/src/purchase/settlement.ts
174701
- function normalizeCurrencyCode(raw) {
174702
- const normalized = raw.trim().toUpperCase();
174703
- if (!/^[A-Z]{3}$/.test(normalized)) throw new Error(`Invalid currency code: ${raw}`);
174704
- return normalized;
174705
- }
174706
- //#endregion
174707
- //#region ../commerce/src/purchase/checkoutSessionMetadata.ts
174708
- const datedOfferingSharedEngineMetadataShape = {
174709
- datedOfferingEngineContractVersion: z.literal("shared_v1"),
174710
- datedOfferingEngineRouteKind: z.literal("shared_whole_series_registration"),
174711
- datedOfferingCapacityHoldId: z.string().uuid(),
174712
- datedOfferingCapacityHoldAuditRef: z.string().uuid(),
174713
- customerId: z.string().uuid(),
174714
- eventSeriesId: z.string().uuid()
174715
- };
174716
- z.object(datedOfferingSharedEngineMetadataShape);
174717
- const orderCheckoutSessionMetadataBaseShape = {
174718
- type: z.literal("order"),
174719
- site_id: z.string().uuid(),
174720
- order_id: z.string().uuid().optional(),
174721
- customer_email: z.string().email(),
174722
- customer_name: z.string().optional(),
174723
- product_id: z.string().uuid().optional(),
174724
- attendee_id: z.string().uuid().optional(),
174725
- occurrence_id: z.string().uuid().optional(),
174726
- tickets_count: z.string().optional(),
174727
- notes: z.string().optional(),
174728
- discount_redemption_id: z.string().uuid().optional(),
174729
- discount_code_id: z.string().uuid().optional(),
174730
- discount_code: z.string().optional(),
174731
- discount_public_label: z.string().optional(),
174732
- credit_reservation_id: z.string().uuid().optional(),
174733
- credit_reserved_cents: z.string().optional(),
174734
- discount_code_amount_cents: z.string().optional(),
174735
- order_payment_reason: z.enum([
174736
- "instalment_payoff",
174737
- "flexible_balance_initial",
174738
- "flexible_balance_paydown"
174739
- ]).optional(),
174740
- order_payment_plan_id: z.string().uuid().optional(),
174741
- order_flexible_balance_contract_id: z.string().uuid().optional()
174742
- };
174743
- const absentDatedOfferingSharedEngineMetadataShape = {
174744
- datedOfferingEngineContractVersion: z.never().optional(),
174745
- datedOfferingEngineRouteKind: z.never().optional(),
174746
- datedOfferingCapacityHoldId: z.never().optional(),
174747
- datedOfferingCapacityHoldAuditRef: z.never().optional(),
174748
- customerId: z.never().optional(),
174749
- eventSeriesId: z.never().optional()
174750
- };
174751
- const LegacyOrderCheckoutSessionMetadataSchema = z.object({
174752
- ...orderCheckoutSessionMetadataBaseShape,
174753
- ...absentDatedOfferingSharedEngineMetadataShape
174754
- });
174755
- const SharedDatedOfferingOrderCheckoutSessionMetadataSchema = z.object({
174756
- ...orderCheckoutSessionMetadataBaseShape,
174757
- ...datedOfferingSharedEngineMetadataShape
174758
- });
174759
- z.union([SharedDatedOfferingOrderCheckoutSessionMetadataSchema, LegacyOrderCheckoutSessionMetadataSchema]);
174760
- //#endregion
174761
- //#region ../commerce/src/purchase/stripeCommissionMetadata.ts
174762
- /** Reasons are payment evidence, not an independent pricing policy. */
174763
- const STRIPE_COMMISSION_FREE_REASONS = [
174764
- "managed_billing",
174765
- "no_commission_plan",
174766
- "billing_evidence_invalid",
174767
- "fee_rounds_to_zero",
174768
- "payment_not_stripe"
174769
- ];
174770
- const historicalContext = {
174771
- currency: z.string().refine((value) => parseCurrencyCode(value) !== null).optional(),
174772
- sourcePlanId: z.string().trim().min(1).optional()
174773
- };
174774
- const percentSchema = z.number().finite().min(0).max(100);
174775
- z.discriminatedUnion("kind", [
174776
- z.object({
174777
- kind: z.literal("commission_free"),
174778
- reason: z.enum(STRIPE_COMMISSION_FREE_REASONS),
174779
- ...historicalContext
174780
- }),
174781
- z.object({
174782
- kind: z.literal("application_fee_amount"),
174783
- amountCents: z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
174784
- percent: percentSchema,
174785
- ...historicalContext
174786
- }),
174787
- z.object({
174788
- kind: z.literal("application_fee_percent"),
174789
- percent: percentSchema,
174790
- ...historicalContext
174791
- })
174792
- ]);
174793
- toNonNegativeCents(0);
174794
- //#endregion
174795
- //#region ../commerce/src/purchase/stripeMinimumCharge.ts
174796
- const STRIPE_MINIMUM_CHARGE_CENTS_BY_CURRENCY = {
174797
- GBP: 30,
174798
- USD: 50,
174799
- EUR: 50,
174800
- AED: 200,
174801
- AUD: 50,
174802
- BGN: 100,
174803
- BRL: 50,
174804
- CAD: 50,
174805
- CHF: 50,
174806
- CZK: 1500,
174807
- DKK: 250,
174808
- HKD: 400,
174809
- HUF: 17500,
174810
- JPY: 50,
174811
- MXN: 1e3,
174812
- MYR: 200,
174813
- NOK: 300,
174814
- NZD: 50,
174815
- PLN: 200,
174816
- RON: 200,
174817
- SEK: 300,
174818
- SGD: 50,
174819
- THB: 1e3
174820
- };
174821
- function isStripeMinimumChargeCurrency(currency) {
174822
- return currency in STRIPE_MINIMUM_CHARGE_CENTS_BY_CURRENCY;
174823
- }
174824
- function getStripeMinimumChargeRequirement(rawCurrency) {
174825
- let currency;
174826
- try {
174827
- currency = normalizeCurrencyCode(rawCurrency);
174828
- } catch {
174829
- return null;
174830
- }
174831
- const currencyKey = currency;
174832
- if (!isStripeMinimumChargeCurrency(currencyKey)) return null;
174833
- return {
174834
- currency,
174835
- minimumAmountCents: STRIPE_MINIMUM_CHARGE_CENTS_BY_CURRENCY[currencyKey]
174836
- };
174837
- }
174838
- //#endregion
174839
- //#region ../commerce/src/purchase/event-registration-errors.ts
174840
- const eventRegistrationErrors = {
174841
- registrationClosed: {
174842
- message: "Booking is currently closed for this event. Please contact the organiser if you’d like to find out more.",
174843
- action: "none"
174844
- },
174845
- paymentInvestigationRequired: {
174846
- message: "We still can’t confirm your payment. Please don’t make another payment. Contact the organiser so they can check your booking.",
174847
- action: "none"
174848
- },
174849
- paymentProviderUnavailable: {
174850
- message: "We couldn’t reach the payment provider. Please try again in a minute.",
174851
- action: "retry"
174852
- },
174853
- paymentPageUnavailable: {
174854
- message: "We couldn’t open the payment page. Please refresh this page and try again. If this keeps happening, contact the organiser for help.",
174855
- action: "retry"
174856
- },
174857
- paymentUnavailable: {
174858
- message: "Online payment is not available for this event right now. Please contact the organiser for help with booking.",
174859
- action: "none"
174860
- },
174861
- capacityChanged: {
174862
- message: "Sorry, there aren’t enough places left for your selection. Please check the available places and choose again.",
174863
- action: "places"
174864
- },
174865
- selectionChanged: {
174866
- message: "The booking options for this event have changed. Please check the latest options and choose your places again.",
174867
- action: "places"
174868
- },
174869
- registrationPreparationChanged: {
174870
- message: "The booking options for this event have changed. Please check the latest options and choose your places again.",
174871
- action: "places"
174872
- },
174873
- registrationAlreadyExists: {
174874
- message: "You already have a booking for this event. Please check your bookings to see its status. If you need help, contact the organiser.",
174875
- action: "portal"
174876
- },
174877
- holdExpired: {
174878
- message: "Your reservation has timed out. Please check availability and choose your places again.",
174879
- action: "start"
174880
- },
174881
- waitlistUnavailable: {
174882
- message: "Sorry, the waiting list place offered in this invitation is no longer available. Please check the event for available places or contact the organiser for help.",
174883
- action: "event"
174884
- },
174885
- paymentContextMismatch: {
174886
- message: "The payment options for this event have changed. Please check the latest options before continuing.",
174887
- action: "payment-options"
174888
- },
174889
- verificationFailed: {
174890
- message: "We couldn’t confirm this request came from a person. Please refresh the page and try again.",
174891
- action: "none"
174892
- },
174893
- idempotencyConflict: {
174894
- message: "You’ve already started booking this event. Please finish in the other tab if it’s still open, or check your booking status before starting again.",
174895
- action: "portal"
174896
- },
174897
- invalidCommitInput: {
174898
- message: "We couldn’t accept your booking details. Please check the information you entered and try again. If this keeps happening, contact the organiser for help.",
174899
- action: "details"
174900
- }
174901
- };
174902
- function parseEventRegistrationErrorReason(value) {
174903
- return typeof value === "string" && Object.prototype.hasOwnProperty.call(eventRegistrationErrors, value) ? value : null;
174904
- }
174905
- //#endregion
174906
175057
  //#region ../blocks/src/system/runtime/shared/useWaitlistClaim.state.ts
174907
175058
  const DEFAULT_WAITLIST_CLAIM_ERROR = "Online booking is unavailable right now. Please contact the organiser for help with booking.";
174908
175059
  function createInitialWaitlistClaimState(hasToken) {
@@ -176066,13 +176217,15 @@ const eventRegistrationWizardDeps = {
176066
176217
  useWaitlistClaim,
176067
176218
  useEventRegistrationStripeReturn,
176068
176219
  useEventRegistrationSubmit,
176069
- useDiscountCodeUi
176220
+ useDiscountCodeUi,
176221
+ useBookingNowIso
176070
176222
  };
176071
176223
  function useEventRegistrationWizard(options) {
176072
176224
  return useEventRegistrationWizardWithDeps(options, eventRegistrationWizardDeps);
176073
176225
  }
176074
176226
  function useEventRegistrationWizardWithDeps(options, deps) {
176075
176227
  const api = useBlockApi();
176228
+ const nowIso = deps.useBookingNowIso();
176076
176229
  const registrationEvents = useMemo(() => [...toRegistrationEvents(options.events ?? []), ...toWholeSeriesRegistrationEvents(options.events ?? [])], [options.events]);
176077
176230
  const scopedEvents = useMemo(() => {
176078
176231
  return resolveEventRegistrationScopedEvents(registrationEvents, {
@@ -176603,6 +176756,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
176603
176756
  });
176604
176757
  return {
176605
176758
  api,
176759
+ nowIso,
176606
176760
  anchorId: options.anchorId,
176607
176761
  occurrenceContext: options.occurrenceContext,
176608
176762
  registrationTarget,
@@ -176967,7 +177121,7 @@ function magicLinkSubmissionReducer(state, action) {
176967
177121
  message: action.message
176968
177122
  };
176969
177123
  case "reset": return initialMagicLinkSubmissionState;
176970
- default: return assertNever$4(action);
177124
+ default: return assertNever$5(action);
176971
177125
  }
176972
177126
  }
176973
177127
  function isMagicLinkSubmitting(state) {
@@ -177252,6 +177406,16 @@ function resolveEntitlementSummaryCopy(method, passCreditsRemaining) {
177252
177406
  function getSummaryRow(option, label) {
177253
177407
  return option.summaryRows.find((row) => row.label === label)?.value ?? null;
177254
177408
  }
177409
+ function getFlexibleBalanceSummary(option) {
177410
+ if (option?.kind !== "flexible_balance") return null;
177411
+ return {
177412
+ total: getSummaryRow(option, "Total"),
177413
+ dueToday: getSummaryRow(option, "Due today"),
177414
+ remainingBalance: getSummaryRow(option, "Remaining balance"),
177415
+ balanceDueBy: getSummaryRow(option, "Balance due by"),
177416
+ depositPolicy: getSummaryRow(option, "Deposit policy")
177417
+ };
177418
+ }
177255
177419
  function getSelectedDirectPaymentOption(input) {
177256
177420
  const summaryEvent = input.wizard.selectedEvent ?? input.wizard.preSelectedEvent;
177257
177421
  const eligibility = input.wizard.eligibility;
@@ -177262,7 +177426,8 @@ function getSelectedDirectPaymentOption(input) {
177262
177426
  paymentTerms: eligibility.paymentTerms,
177263
177427
  totalPriceCents: input.totalCents,
177264
177428
  currency: input.currency,
177265
- startsAt: getRegistrationStartAt(summaryEvent, input.wizard.occurrenceContext)
177429
+ startsAt: getRegistrationStartAt(summaryEvent, input.wizard.occurrenceContext),
177430
+ nowIso: input.wizard.nowIso
177266
177431
  }).options;
177267
177432
  const requestedKind = input.wizard.paymentSelection.collectionOptionKind;
177268
177433
  return options.find((option) => option.kind === requestedKind) ?? options.find((option) => option.kind === "upfront") ?? options[0] ?? null;
@@ -177312,18 +177477,11 @@ function EventRegistrationSummaryBar(props) {
177312
177477
  const autoAppliedDiscount = wizard.discountCode.trim().length > 0 ? null : wizard.autoAppliedDiscount;
177313
177478
  const autoAppliedDiscountCents = Math.max(0, autoAppliedDiscount?.computedAmountCents ?? 0);
177314
177479
  const discountedTotalCents = Math.max(0, subtotalCents - autoAppliedDiscountCents);
177315
- const selectedDirectPaymentOption = getSelectedDirectPaymentOption({
177480
+ const flexibleBalanceSummary = getFlexibleBalanceSummary(getSelectedDirectPaymentOption({
177316
177481
  wizard,
177317
177482
  totalCents: discountedTotalCents,
177318
177483
  currency: summaryCurrency
177319
- });
177320
- const flexibleBalanceSummary = selectedDirectPaymentOption?.kind === "flexible_balance" ? {
177321
- total: getSummaryRow(selectedDirectPaymentOption, "Total"),
177322
- dueToday: getSummaryRow(selectedDirectPaymentOption, "Due today"),
177323
- remainingBalance: getSummaryRow(selectedDirectPaymentOption, "Remaining balance"),
177324
- balanceDueBy: getSummaryRow(selectedDirectPaymentOption, "Balance due by"),
177325
- depositPolicy: getSummaryRow(selectedDirectPaymentOption, "Deposit policy")
177326
- } : null;
177484
+ }));
177327
177485
  const scheduleSummary = summaryEvent ? getScheduleSummary(wizard, summaryEvent) : null;
177328
177486
  const bookingUnit = summaryEvent?.registrationSubject.kind === "wholeSeries" ? "place" : "ticket";
177329
177487
  const productMethod = isProductMethod(wizard.paymentSelection.method);
@@ -178769,6 +178927,17 @@ function canContinueWithPaymentSelection(selection, directPaymentSelection) {
178769
178927
  case null: return false;
178770
178928
  }
178771
178929
  }
178930
+ function buildEventDirectPaymentOptions(input) {
178931
+ return buildEventRegistrationPaymentOptionsViewModel({
178932
+ eventTitle: input.event?.title ?? "Event",
178933
+ approvedPaymentOptions: input.eligibility.paymentOptions,
178934
+ paymentTerms: input.eligibility.paymentTerms,
178935
+ totalPriceCents: input.totalPriceCents,
178936
+ currency: input.eligibility.currency,
178937
+ startsAt: getRegistrationStartAt(input.event, input.occurrenceContext),
178938
+ nowIso: input.nowIso
178939
+ }).options;
178940
+ }
178772
178941
  /**
178773
178942
  * Payment Selection Step
178774
178943
  *
@@ -178776,19 +178945,18 @@ function canContinueWithPaymentSelection(selection, directPaymentSelection) {
178776
178945
  * Fetches eligible passes/memberships using the user's email.
178777
178946
  * Also shows available passes/memberships for purchase (upsell).
178778
178947
  */
178779
- const PaymentSelectionStep = ({ event, occurrenceContext, ticketsCount, email, isAuthenticated = false, creditState = { kind: "not_authenticated" }, directPaymentTotalCents, manualDiscountPending = false, selectedSelection, onSelectionChange, eligibility, eligibilityLoading, eligibilityError = null, onRequestLogin, onStateChange }) => {
178948
+ const PaymentSelectionStep = ({ event, occurrenceContext, ticketsCount, email, isAuthenticated = false, creditState = { kind: "not_authenticated" }, directPaymentTotalCents, manualDiscountPending = false, selectedSelection, onSelectionChange, eligibility, eligibilityLoading, eligibilityError = null, onRequestLogin, onStateChange, nowIso }) => {
178780
178949
  const occurrenceId = occurrenceContext?.id ?? (event?.registrationSubject.kind === "occurrence" ? event.registrationSubject.occurrenceId : "");
178781
178950
  const selectedMethod = selectedSelection.method;
178782
178951
  const totalPrice = directPaymentTotalCents;
178783
178952
  const canShowDirectPaymentOptions = Boolean(eligibility?.requiresPayment && eligibility.price);
178784
- const directPaymentOptions = eligibility && canShowDirectPaymentOptions ? buildEventRegistrationPaymentOptionsViewModel({
178785
- eventTitle: event?.title ?? "Event",
178786
- approvedPaymentOptions: eligibility.paymentOptions,
178787
- paymentTerms: eligibility.paymentTerms,
178953
+ const directPaymentOptions = eligibility && canShowDirectPaymentOptions ? buildEventDirectPaymentOptions({
178954
+ event,
178955
+ occurrenceContext,
178956
+ eligibility,
178788
178957
  totalPriceCents: totalPrice,
178789
- currency: eligibility.currency,
178790
- startsAt: getRegistrationStartAt(event, occurrenceContext)
178791
- }).options : [];
178958
+ nowIso
178959
+ }) : [];
178792
178960
  const directPaymentSelectionState = resolveEventRegistrationDirectPaymentSelection({
178793
178961
  options: directPaymentOptions,
178794
178962
  selection: selectedSelection
@@ -179021,6 +179189,22 @@ function AttendeeDetailsContent(props) {
179021
179189
  })
179022
179190
  ] });
179023
179191
  }
179192
+ function EventDiscountCodeDisclosure(props) {
179193
+ const { wizard } = props;
179194
+ if (wizard.discountsAvailableLoading || !wizard.shouldShowDiscountToggle) return null;
179195
+ return /* @__PURE__ */ jsx(DiscountCodeDisclosure, {
179196
+ surface: "event-registration",
179197
+ isOpen: wizard.discountUiOpen,
179198
+ code: wizard.discountCode,
179199
+ onOpen: () => wizard.setDiscountUiOpen(true),
179200
+ onChange: wizard.setDiscountCode,
179201
+ onRemove: () => {
179202
+ wizard.setDiscountCode("");
179203
+ wizard.setDiscountUiOpen(false);
179204
+ },
179205
+ id: "er-discount-code"
179206
+ });
179207
+ }
179024
179208
  function PaymentSelectionContent(props) {
179025
179209
  const { wizard } = props;
179026
179210
  const subtotalCents = wizard.ticketSelectionSubtotalCents;
@@ -179054,19 +179238,9 @@ function PaymentSelectionContent(props) {
179054
179238
  eligibilityLoading: wizard.eligibilityLoading,
179055
179239
  eligibilityError: wizard.eligibilityError,
179056
179240
  onRequestLogin: () => wizard.setShowMagicLinkModal(true),
179057
- onStateChange: wizard.handlePaymentStepStateChange
179058
- }), wizard.discountsAvailableLoading ? null : wizard.shouldShowDiscountToggle ? /* @__PURE__ */ jsx(DiscountCodeDisclosure, {
179059
- surface: "event-registration",
179060
- isOpen: wizard.discountUiOpen,
179061
- code: wizard.discountCode,
179062
- onOpen: () => wizard.setDiscountUiOpen(true),
179063
- onChange: wizard.setDiscountCode,
179064
- onRemove: () => {
179065
- wizard.setDiscountCode("");
179066
- wizard.setDiscountUiOpen(false);
179067
- },
179068
- id: "er-discount-code"
179069
- }) : null] });
179241
+ onStateChange: wizard.handlePaymentStepStateChange,
179242
+ nowIso: wizard.nowIso
179243
+ }), /* @__PURE__ */ jsx(EventDiscountCodeDisclosure, { wizard })] });
179070
179244
  }
179071
179245
  function EventRegistrationWizardContent(props) {
179072
179246
  const { wizard } = props;
@@ -180451,7 +180625,7 @@ function shopPassesMembershipsReducer(state, action) {
180451
180625
  ...state,
180452
180626
  returnNotice: null
180453
180627
  };
180454
- default: return assertNever$4(action);
180628
+ default: return assertNever$5(action);
180455
180629
  }
180456
180630
  }
180457
180631
  function getOpenCheckout(state) {
@@ -180631,7 +180805,7 @@ function discountApplyReducer(state, action) {
180631
180805
  ...state,
180632
180806
  status: { type: "idle" }
180633
180807
  };
180634
- default: return assertNever$4(action);
180808
+ default: return assertNever$5(action);
180635
180809
  }
180636
180810
  }
180637
180811
  function getAppliedDiscountCode(state) {
@@ -180656,7 +180830,7 @@ function getDiscountApplyFeedback(status, formatPrice) {
180656
180830
  tone: "error",
180657
180831
  message: status.message
180658
180832
  };
180659
- default: return assertNever$4(status);
180833
+ default: return assertNever$5(status);
180660
180834
  }
180661
180835
  }
180662
180836
  //#endregion
@@ -180773,7 +180947,7 @@ function handleShopCheckoutResult(input) {
180773
180947
  if (input.result.demoBookingPass) storeDemoBookingCheckoutReturn(input.checkout.form.email, input.result.demoBookingPass);
180774
180948
  window.location.href = input.result.checkoutUrl;
180775
180949
  return;
180776
- default: return assertNever$10(input.result);
180950
+ default: return assertNever$11(input.result);
180777
180951
  }
180778
180952
  }
180779
180953
  function buildDirectShopCheckoutPlan(input) {
@@ -181035,19 +181209,18 @@ function PassesMembershipsController({ render }) {
181035
181209
  }, passDisplay.id);
181036
181210
  }),
181037
181211
  membershipCards: display.memberships.map((membershipDisplay) => {
181038
- const membership = hydration.memberships.find((candidate) => candidate.id === membershipDisplay.id);
181039
- if (!membership) return null;
181212
+ const { action } = membershipDisplay;
181040
181213
  return /* @__PURE__ */ jsx(MembershipCardView, {
181041
181214
  display: membershipDisplay,
181042
- action: /* @__PURE__ */ jsx(ThemedButton, {
181215
+ action: action.kind === "unavailable" ? /* @__PURE__ */ jsx(PassPurchaseUnavailable, { label: action.label }) : /* @__PURE__ */ jsx(ThemedButton, {
181043
181216
  type: "button",
181044
181217
  variant: hydration.buttonVariant,
181045
181218
  size: "md",
181046
181219
  extraClassName: "shop__cta",
181047
- label: membershipDisplay.actionLabel,
181048
- onClick: () => handleSubscribe(membership)
181220
+ label: action.label,
181221
+ onClick: () => handleSubscribe(action.product)
181049
181222
  })
181050
- }, membership.id);
181223
+ }, membershipDisplay.id);
181051
181224
  })
181052
181225
  })
181053
181226
  }), checkout ? /* @__PURE__ */ jsx(ModalShell, {
@@ -183108,7 +183281,7 @@ function shopCheckoutReducer(state, action) {
183108
183281
  ...state,
183109
183282
  notice: action.notice
183110
183283
  };
183111
- default: return assertNever$4(action);
183284
+ default: return assertNever$5(action);
183112
183285
  }
183113
183286
  }
183114
183287
  //#endregion
@@ -183542,7 +183715,7 @@ function giftingClientReducer(state, action) {
183542
183715
  ...state,
183543
183716
  purchaseNotice: action.notice
183544
183717
  };
183545
- default: return assertNever$4(action);
183718
+ default: return assertNever$5(action);
183546
183719
  }
183547
183720
  }
183548
183721
  function resolveGiftingPurchaseNotice(search, defaultSuccessMessage) {
@@ -185323,7 +185496,7 @@ function eventPaginationLoadReducer(state, action) {
185323
185496
  error: action.error
185324
185497
  };
185325
185498
  case "synced": return createInitialEventPaginationLoadState(action.events, action.pageSize);
185326
- default: return assertNever$4(action);
185499
+ default: return assertNever$5(action);
185327
185500
  }
185328
185501
  }
185329
185502
  function getEventIdentity(event) {
@@ -185589,7 +185762,7 @@ function eventFiltersLoadReducer(state, action) {
185589
185762
  filters: state.filters,
185590
185763
  error: action.error
185591
185764
  };
185592
- default: return assertNever$4(action);
185765
+ default: return assertNever$5(action);
185593
185766
  }
185594
185767
  }
185595
185768
  function toEventFiltersLoadError(error) {
@@ -187406,7 +187579,7 @@ function formSubmissionReducer(_state, action) {
187406
187579
  tag: "failed",
187407
187580
  message: action.message
187408
187581
  };
187409
- default: return assertNever$4(action);
187582
+ default: return assertNever$5(action);
187410
187583
  }
187411
187584
  }
187412
187585
  //#endregion
@@ -187703,7 +187876,7 @@ function newsletterFormSubmissionReducer(state, action) {
187703
187876
  tag: "success",
187704
187877
  outcome: action.outcome
187705
187878
  };
187706
- default: return assertNever$4(action);
187879
+ default: return assertNever$5(action);
187707
187880
  }
187708
187881
  }
187709
187882
  function newsletterFieldError(fieldId, message) {
@@ -187778,7 +187951,7 @@ function resolveNewsletterSubmitTarget(input) {
187778
187951
  tag: "unavailable",
187779
187952
  reason: "preview_only_source"
187780
187953
  };
187781
- default: return assertNever$10(input);
187954
+ default: return assertNever$11(input);
187782
187955
  }
187783
187956
  }
187784
187957
  function publishedSourceTarget(sourceRef) {
@@ -196369,7 +196542,27 @@ function logMediaEditorDebug(event, payload) {
196369
196542
  }
196370
196543
  //#endregion
196371
196544
  //#region ../media-editor/src/MediaPickerDialog.tsx
196372
- const MediaPickerDialog = ({ allowedKinds, open, onOpenChange, assets, loading, hasMore, selectAsset, loadMore, enqueueUploads, uploads, closeOnSelect = true, disableSelection = false, statusMessage = null, statusTone = "info", title = "Select media", dialogMaxWidth, uploadButtonLabel = "Upload a file", uploadAccept, showCameraInput = true, policy }) => {
196545
+ function MediaPickerLibraryStatus({ loading, error, visibleCount, hasMore, retryLoad }) {
196546
+ if (loading && visibleCount === 0) return /* @__PURE__ */ jsxs("div", {
196547
+ className: "col-span-full flex min-h-32 items-center justify-center gap-2 rounded border border-dashed p-4 text-sm text-muted-foreground",
196548
+ children: [/* @__PURE__ */ jsx(LoaderCircle, { className: "h-4 w-4 animate-spin" }), "Loading media library..."]
196549
+ });
196550
+ if (!loading && error) return /* @__PURE__ */ jsxs("div", {
196551
+ className: "col-span-full flex min-h-32 flex-col items-center justify-center gap-3 rounded border border-destructive/30 p-4 text-center text-sm",
196552
+ role: "alert",
196553
+ children: [/* @__PURE__ */ jsx("p", { children: "We couldn’t load your media. Try again." }), retryLoad ? /* @__PURE__ */ jsx(Button$1, {
196554
+ type: "button",
196555
+ variant: "outline",
196556
+ onClick: retryLoad,
196557
+ children: "Try again"
196558
+ }) : null]
196559
+ });
196560
+ return !loading && visibleCount === 0 && !hasMore ? /* @__PURE__ */ jsx("div", {
196561
+ className: "col-span-full flex min-h-32 items-center justify-center rounded border border-dashed p-4 text-sm text-muted-foreground",
196562
+ children: "No media found"
196563
+ }) : null;
196564
+ }
196565
+ const MediaPickerDialog = ({ allowedKinds, open, onOpenChange, assets, loading, error, retryLoad, hasMore, selectAsset, loadMore, enqueueUploads, uploads, closeOnSelect = true, disableSelection = false, statusMessage = null, statusTone = "info", title = "Select media", dialogMaxWidth, uploadButtonLabel = "Upload a file", uploadAccept, showCameraInput = true, policy }) => {
196373
196566
  const fileInputRef = useRef(null);
196374
196567
  const cameraInputRef = useRef(null);
196375
196568
  const allowsAsset = policy?.allowsAsset;
@@ -196435,10 +196628,13 @@ const MediaPickerDialog = ({ allowedKinds, open, onOpenChange, assets, loading,
196435
196628
  }) : null,
196436
196629
  /* @__PURE__ */ jsxs("div", {
196437
196630
  className: "grid grid-cols-2 gap-3 md:grid-cols-3",
196438
- children: [isInitialLoading ? /* @__PURE__ */ jsxs("div", {
196439
- className: "col-span-full flex min-h-32 items-center justify-center gap-2 rounded border border-dashed p-4 text-sm text-muted-foreground",
196440
- children: [/* @__PURE__ */ jsx(LoaderCircle, { className: "h-4 w-4 animate-spin" }), "Loading media library..."]
196441
- }) : null, visible.map((item) => {
196631
+ children: [/* @__PURE__ */ jsx(MediaPickerLibraryStatus, {
196632
+ loading,
196633
+ error,
196634
+ visibleCount: visible.length,
196635
+ hasMore,
196636
+ retryLoad
196637
+ }), visible.map((item) => {
196442
196638
  const selection = assetSelection?.(item) ?? { tag: "selectable" };
196443
196639
  const isPolicyDisabled = selection.tag === "disabled";
196444
196640
  const reasonId = isPolicyDisabled ? `media-picker-disabled-${item.id}` : void 0;
@@ -196580,6 +196776,24 @@ const MediaPickerDialog = ({ allowedKinds, open, onOpenChange, assets, loading,
196580
196776
  });
196581
196777
  };
196582
196778
  //#endregion
196779
+ //#region ../media-editor/src/MediaPickerMiniDialog.tsx
196780
+ function MediaPickerMiniDialog({ picker, component: DialogComponent = MediaPickerDialog, ...props }) {
196781
+ return /* @__PURE__ */ jsx(DialogComponent, {
196782
+ ...props,
196783
+ open: picker.open,
196784
+ onOpenChange: picker.setOpen,
196785
+ assets: picker.assets,
196786
+ loading: picker.loading,
196787
+ error: picker.error,
196788
+ retryLoad: picker.refresh,
196789
+ hasMore: picker.hasMore,
196790
+ selectAsset: picker.selectAsset,
196791
+ loadMore: picker.loadMore,
196792
+ enqueueUploads: picker.enqueueUploads,
196793
+ uploads: picker.uploads
196794
+ });
196795
+ }
196796
+ //#endregion
196583
196797
  //#region ../media-editor/src/MediaPreview.tsx
196584
196798
  const previewMaxWidthClassName = {
196585
196799
  xs: "max-w-xs",
@@ -197946,6 +198160,7 @@ const CANONICAL_REFUND_PLANNER_ERROR_CODES = [
197946
198160
  "refund_failed"
197947
198161
  ];
197948
198162
  const CANONICAL_ADMIN_REFUND_FAILURE_CODES = [
198163
+ "refund_blocked_by_live_payment_terms",
197949
198164
  ...CANONICAL_REFUND_PLANNER_ERROR_CODES,
197950
198165
  "payment_intent_not_found",
197951
198166
  "stripe_error",
@@ -197961,6 +198176,7 @@ const CANONICAL_ADMIN_REFUND_FAILURE_CODES = [
197961
198176
  //#endregion
197962
198177
  //#region ../api/src/bookingRefundOutcomes.ts
197963
198178
  const STANDARD_LINE_ITEM_REFUND_INVALID_CODES = [
198179
+ "refund_blocked_by_live_payment_terms",
197964
198180
  "missing_amount",
197965
198181
  "invalid_amount",
197966
198182
  "amount_exceeds_remaining",
@@ -197999,7 +198215,7 @@ function describeSiteVerticalConfigIssue(issue) {
197999
198215
  case "duplicate_preset_id":
198000
198216
  case "duplicate_canonical_behaviour":
198001
198217
  case "future_preset_selected": return issue.code;
198002
- default: return assertNever$10(issue);
198218
+ default: return assertNever$11(issue);
198003
198219
  }
198004
198220
  }
198005
198221
  const VerticalIdSchema = z.string().trim().transform((value, ctx) => {
@@ -198451,68 +198667,6 @@ async function updateRouteMetadata(apiClient, { siteId, routeId, body, options }
198451
198667
  }
198452
198668
  z.enum(["public", "unlisted"], { error: "visibility must be 'public' or 'unlisted'" });
198453
198669
  //#endregion
198454
- //#region ../api/src/bookingPaymentTermSchemas.ts
198455
- const bookingDepositRefundPolicySchema = z.enum(["refundable", "non_refundable"]);
198456
- const bookingInstalmentPlanSchema = z.discriminatedUnion("kind", [
198457
- z.object({
198458
- kind: z.literal("deposit_plus_one_remainder"),
198459
- depositAmountCents: z.number().int().nonnegative(),
198460
- depositRefundability: bookingDepositRefundPolicySchema,
198461
- remainderDueCount: z.number().int().positive(),
198462
- intervalUnit: z.enum([
198463
- "day",
198464
- "week",
198465
- "month"
198466
- ])
198467
- }),
198468
- z.object({
198469
- kind: z.literal("deposit_plus_scheduled_instalments"),
198470
- depositAmountCents: z.number().int().nonnegative(),
198471
- depositRefundability: bookingDepositRefundPolicySchema,
198472
- instalmentCount: z.number().int().positive(),
198473
- intervalCount: z.number().int().positive(),
198474
- intervalUnit: z.enum([
198475
- "day",
198476
- "week",
198477
- "month"
198478
- ])
198479
- }),
198480
- z.object({
198481
- kind: z.literal("equal_scheduled_instalments"),
198482
- instalmentCount: z.number().int().positive(),
198483
- intervalCount: z.number().int().positive(),
198484
- intervalUnit: z.enum([
198485
- "day",
198486
- "week",
198487
- "month"
198488
- ])
198489
- })
198490
- ]);
198491
- const bookingFlexibleBalanceDueDateRuleSchema = z.discriminatedUnion("kind", [z.object({
198492
- kind: z.literal("relative_to_start_date"),
198493
- daysBeforeStart: z.number().int().positive()
198494
- }), z.object({
198495
- kind: z.literal("fixed_calendar_date"),
198496
- dueAt: z.string().datetime()
198497
- })]);
198498
- const bookingFlexibleBalanceConfigSchema = z.object({
198499
- upfrontAmountCents: z.number().int().nonnegative(),
198500
- dueDateRule: bookingFlexibleBalanceDueDateRuleSchema,
198501
- depositRefundability: bookingDepositRefundPolicySchema
198502
- });
198503
- z.discriminatedUnion("kind", [
198504
- z.object({ kind: z.literal("upfront") }),
198505
- z.object({ kind: z.literal("deferred_manual") }),
198506
- z.object({
198507
- kind: z.literal("instalment_plan"),
198508
- plan: bookingInstalmentPlanSchema
198509
- }),
198510
- z.object({
198511
- kind: z.literal("flexible_balance"),
198512
- config: bookingFlexibleBalanceConfigSchema
198513
- })
198514
- ]);
198515
- //#endregion
198516
198670
  //#region ../api/src/navigation/routableLink.ts
198517
198671
  /**
198518
198672
  * Prefer identifier-based links when available so links survive route/path updates.
@@ -198534,7 +198688,7 @@ function toRoutableLinkPayload(item) {
198534
198688
  };
198535
198689
  return toResolvedInternalPayload(item);
198536
198690
  case "pageSurface": return toResolvedInternalPayload(item);
198537
- default: return assertNever$10(item);
198691
+ default: return assertNever$11(item);
198538
198692
  }
198539
198693
  }
198540
198694
  function toResolvedInternalPayload(item) {
@@ -198958,17 +199112,10 @@ const MediaEditor = ({ value, onChange, allowedKinds, previewAspectRatio, minSou
198958
199112
  getListOptions: listOptions,
198959
199113
  open: pickerOpen,
198960
199114
  onOpenChange: handlePickerOpenChange,
198961
- children: ({ assets, selectAsset, open, setOpen, enqueueUploads, uploads, hasMore, loadMore, loading }) => /* @__PURE__ */ jsx(PickerDialogComponent, {
199115
+ children: (picker) => /* @__PURE__ */ jsx(MediaPickerMiniDialog, {
199116
+ picker,
199117
+ component: PickerDialogComponent,
198962
199118
  allowedKinds: resolvedAllowedKinds,
198963
- open,
198964
- onOpenChange: setOpen,
198965
- assets,
198966
- loading,
198967
- hasMore,
198968
- selectAsset: (asset) => selectAsset(asset),
198969
- loadMore,
198970
- enqueueUploads,
198971
- uploads,
198972
199119
  closeOnSelect: false,
198973
199120
  dialogMaxWidth: mediaPickerDialogMaxWidth,
198974
199121
  policy: {
@@ -202407,7 +202554,7 @@ function getFeatureCardGeneratedIconStyleSummary(content, currentStyleGuideVersi
202407
202554
  case "invalid_generated":
202408
202555
  invalidGeneratedCount += 1;
202409
202556
  break;
202410
- default: assertNever$10(state);
202557
+ default: assertNever$11(state);
202411
202558
  }
202412
202559
  }
202413
202560
  return {
@@ -202469,7 +202616,7 @@ function applyGeneratedFeatureCardIconSet({ blockId, content, drafts, assets })
202469
202616
  reason: plan.kind,
202470
202617
  cardKey: plan.cardKey
202471
202618
  };
202472
- default: assertNever$10(plan);
202619
+ default: assertNever$11(plan);
202473
202620
  }
202474
202621
  for (const appliedIcon of plan.appliedIcons) drafts.setAtPath(blockId, `cards.${appliedIcon.cardIndex}.icon`, appliedIcon.iconValue);
202475
202622
  return {
@@ -203511,7 +203658,7 @@ function deriveCustomizeAction({ actionPresentation, blockId, settingsAvailable
203511
203658
  presentation: "external",
203512
203659
  blockId
203513
203660
  } : null;
203514
- default: return assertNever$10(actionPresentation.customize);
203661
+ default: return assertNever$11(actionPresentation.customize);
203515
203662
  }
203516
203663
  }
203517
203664
  function deriveIconActions({ featureCardIconActionsAvailable, generatedIconSetActionsAvailable, hasStaleGeneratedIcons, featureCardIconDialogCardsCount }) {
@@ -203756,7 +203903,7 @@ function menuActionIcon(action) {
203756
203903
  case "generated-icon-set": return action.stale ? /* @__PURE__ */ jsx(RotateCcw, { className: "mr-2 h-4 w-4" }) : /* @__PURE__ */ jsx(ImagePlus, { className: "mr-2 h-4 w-4" });
203757
203904
  case "duplicate": return /* @__PURE__ */ jsx(Copy, { className: "mr-2 h-4 w-4" });
203758
203905
  case "delete": return /* @__PURE__ */ jsx(Trash2, { className: "mr-2 h-4 w-4" });
203759
- default: return assertNever$10(action);
203906
+ default: return assertNever$11(action);
203760
203907
  }
203761
203908
  }
203762
203909
  function menuActionLabel(action) {
@@ -203765,7 +203912,7 @@ function menuActionLabel(action) {
203765
203912
  case "generated-icon-set": return "Manage icons";
203766
203913
  case "duplicate": return "Duplicate";
203767
203914
  case "delete": return "Delete";
203768
- default: return assertNever$10(action);
203915
+ default: return assertNever$11(action);
203769
203916
  }
203770
203917
  }
203771
203918
  //#endregion
@@ -226842,19 +226989,11 @@ function buildRichTextImageInsertAttrs({ asset, supabaseUrl, fallbackSrc }) {
226842
226989
  //#endregion
226843
226990
  //#region ../editor-blocks/src/widgets/rich-text/useImagePicker.tsx
226844
226991
  function RichTextImagePickerDialog({ picker, isPreparingImage, pickerError }) {
226845
- return /* @__PURE__ */ jsx(MediaPickerDialog, {
226992
+ return /* @__PURE__ */ jsx(MediaPickerMiniDialog, {
226993
+ picker,
226846
226994
  allowedKinds: ["image"],
226847
- open: picker.open,
226848
- onOpenChange: picker.setOpen,
226849
- assets: picker.assets,
226850
- loading: picker.loading,
226851
- hasMore: picker.hasMore,
226852
- selectAsset: picker.selectAsset,
226853
226995
  closeOnSelect: false,
226854
226996
  disableSelection: isPreparingImage,
226855
- loadMore: picker.loadMore,
226856
- enqueueUploads: picker.enqueueUploads,
226857
- uploads: picker.uploads,
226858
226997
  statusMessage: pickerError ?? (isPreparingImage ? "Preparing image for insertion..." : null),
226859
226998
  statusTone: pickerError ? "error" : "info"
226860
226999
  });
@@ -228491,7 +228630,7 @@ function formatOrderMode(state) {
228491
228630
  case "custom": return "Custom order";
228492
228631
  case "legacyInferred": return "Using saved order";
228493
228632
  case "default": return "Following site offering order";
228494
- default: assertNever$10(state);
228633
+ default: assertNever$11(state);
228495
228634
  }
228496
228635
  }
228497
228636
  function siblingPath(path, siblingId) {
@@ -228850,7 +228989,7 @@ async function loadSiteOptionItemsFromApi({ apiClient, siteId, source }) {
228850
228989
  endpoint: "listAppointmentServiceCategories",
228851
228990
  params: { siteId }
228852
228991
  })));
228853
- default: return assertNever$10(source);
228992
+ default: return assertNever$11(source);
228854
228993
  }
228855
228994
  }
228856
228995
  function createSiteOptionApiLoader(apiClient) {
@@ -229081,6 +229220,124 @@ async function refreshDocumentLeaseBaseline(input, policy, isCurrent) {
229081
229220
  if (state.refreshValues(planDocumentBaselineRefresh(fresh.baselines), policy)) state.setLeaseDiscardedChanges(true);
229082
229221
  }
229083
229222
  //#endregion
229223
+ //#region ../content-editor/src/lib/browserStorage.ts
229224
+ /**
229225
+ * The browser's storage, or null during server rendering or when the browser blocks
229226
+ * access (privacy settings, sandboxed frames).
229227
+ */
229228
+ function browserStorage(kind) {
229229
+ if (typeof window === "undefined") return null;
229230
+ try {
229231
+ return kind === "local" ? window.localStorage : window.sessionStorage;
229232
+ } catch {
229233
+ return null;
229234
+ }
229235
+ }
229236
+ //#endregion
229237
+ //#region ../content-editor/src/controller/editorClientId.ts
229238
+ const editorClientId = typeof window === "undefined" ? null : generateUuidV4();
229239
+ /** One id per document, including when a browser duplicates a tab. */
229240
+ function getEditorClientId() {
229241
+ if (!editorClientId) throw new Error("Editor client id is browser-only");
229242
+ return editorClientId;
229243
+ }
229244
+ //#endregion
229245
+ //#region ../content-editor/src/controller/editLeaseHandover.ts
229246
+ /**
229247
+ * Reload handover for edit leases (issue 1570). A reloaded document gets a new client
229248
+ * id, and its acquire can reach the server before the departed document's keepalive
229249
+ * release, or after that document left with its own grant still in flight. The departed
229250
+ * document leaves its client id in the tab's session storage; the next document takes it
229251
+ * once and names it on acquire, and the server grants when that document is still the
229252
+ * same user's current holder.
229253
+ *
229254
+ * Session storage is per tab and per origin. The entry exists only between one document
229255
+ * leaving and the next taking it, so a tab duplicated while an editor is open copies
229256
+ * nothing.
229257
+ */
229258
+ const STORAGE_KEY = "riverbank:edit-lease-handover";
229259
+ /** After the lease TTL, the departed document's lease has expired anyway. */
229260
+ const EDIT_LEASE_HANDOVER_TTL_MS = 60 * 1e3;
229261
+ const storedHandoverSchema = z.object({
229262
+ clientId: z.string(),
229263
+ savedAt: z.number().finite()
229264
+ });
229265
+ function parseEditLeaseHandover(raw) {
229266
+ if (!raw) return null;
229267
+ try {
229268
+ const stored = storedHandoverSchema.safeParse(JSON.parse(raw));
229269
+ if (!stored.success) return null;
229270
+ const clientId = parseEditorClientId(stored.data.clientId);
229271
+ return clientId.ok ? {
229272
+ clientId: clientId.value,
229273
+ savedAt: stored.data.savedAt
229274
+ } : null;
229275
+ } catch {
229276
+ return null;
229277
+ }
229278
+ }
229279
+ /** Checked when each acquire is sent, not only when the entry is read. */
229280
+ function freshHandover(handover, now) {
229281
+ if (!handover) return null;
229282
+ const age = now - handover.savedAt;
229283
+ return age >= 0 && age < EDIT_LEASE_HANDOVER_TTL_MS ? handover : null;
229284
+ }
229285
+ function takeHandover(storage) {
229286
+ if (!storage) return null;
229287
+ try {
229288
+ const raw = storage.getItem(STORAGE_KEY);
229289
+ storage.removeItem(STORAGE_KEY);
229290
+ return parseEditLeaseHandover(raw);
229291
+ } catch {
229292
+ return null;
229293
+ }
229294
+ }
229295
+ function saveHandover(storage, handover) {
229296
+ if (!handover) return;
229297
+ try {
229298
+ storage?.setItem(STORAGE_KEY, JSON.stringify(handover));
229299
+ } catch {}
229300
+ }
229301
+ /**
229302
+ * One handover per document: it's taken once so lease sessions in the document can't
229303
+ * race for it, and it's written from a document listener so it survives the editor
229304
+ * unmounting before the page is left. A document that never edited passes on the
229305
+ * handover it took, unchanged, so editor → other page → editor still hands over.
229306
+ */
229307
+ function createDocumentEditLeaseHandover(port) {
229308
+ const current = {
229309
+ previous: takeHandover(port.storage()),
229310
+ participant: false
229311
+ };
229312
+ port.onPageTransition("pagehide", () => {
229313
+ saveHandover(port.storage(), current.participant ? {
229314
+ clientId: port.clientId(),
229315
+ savedAt: port.now()
229316
+ } : freshHandover(current.previous, port.now()));
229317
+ });
229318
+ port.onPageTransition("pageshow", (event) => {
229319
+ if (event.persisted) current.previous = takeHandover(port.storage()) ?? current.previous;
229320
+ });
229321
+ return {
229322
+ markParticipant: () => {
229323
+ current.participant = true;
229324
+ },
229325
+ previousClientIdForAcquire: () => freshHandover(current.previous, port.now())?.clientId ?? null
229326
+ };
229327
+ }
229328
+ const documentHandover = typeof window === "undefined" ? null : createDocumentEditLeaseHandover({
229329
+ storage: () => browserStorage("session"),
229330
+ clientId: getEditorClientId,
229331
+ now: () => Date.now(),
229332
+ onPageTransition: (type, listener) => window.addEventListener(type, listener)
229333
+ });
229334
+ function markEditLeaseParticipant() {
229335
+ documentHandover?.markParticipant();
229336
+ }
229337
+ function previousEditorClientIdForAcquire() {
229338
+ return documentHandover?.previousClientIdForAcquire() ?? null;
229339
+ }
229340
+ //#endregion
229084
229341
  //#region ../content-editor/src/hooks/editLeaseMachine.ts
229085
229342
  function initialLeaseMachine() {
229086
229343
  return {
@@ -229411,6 +229668,11 @@ function classifyFailure(error) {
229411
229668
  if (error.tag === "EDIT_LEASE_NOT_FOUND" || error.code === "resource:not_found") return "not-found";
229412
229669
  return "unavailable";
229413
229670
  }
229671
+ /** Only a plain acquire names the tab's departed document; takeover is unconditional. */
229672
+ function previousDocumentOptions() {
229673
+ const previous = previousEditorClientIdForAcquire();
229674
+ return previous ? { options: { headers: { "X-Riverbank-Editor-Previous-Client": previous } } } : {};
229675
+ }
229414
229676
  async function requestGrant(runtime, takeover) {
229415
229677
  try {
229416
229678
  const result = takeover ? await runtime.apiClient.current({
@@ -229418,7 +229680,8 @@ async function requestGrant(runtime, takeover) {
229418
229680
  params: runtime.scope
229419
229681
  }) : await runtime.apiClient.current({
229420
229682
  endpoint: "acquireEditLease",
229421
- params: runtime.scope
229683
+ params: runtime.scope,
229684
+ ...previousDocumentOptions()
229422
229685
  });
229423
229686
  return result.success ? result.data.lease : classifyFailure(result.error);
229424
229687
  } catch {
@@ -229565,6 +229828,7 @@ function useEditLease({ scope, apiClient, uiStore, subscribeToLeaseChanges, onGr
229565
229828
  setFault
229566
229829
  }, initialLeaseMachine()), [stableScope, uiStore]);
229567
229830
  useEffect(() => {
229831
+ markEditLeaseParticipant();
229568
229832
  actor.dispatch({
229569
229833
  kind: "acquire",
229570
229834
  takeover: false
@@ -229824,14 +230088,6 @@ function LinkedEntryLeaseBanner({ entryId }) {
229824
230088
  });
229825
230089
  }
229826
230090
  //#endregion
229827
- //#region ../content-editor/src/controller/editorClientId.ts
229828
- const editorClientId = typeof window === "undefined" ? null : generateUuidV4();
229829
- /** One id per document, including when a browser duplicates a tab. */
229830
- function getEditorClientId() {
229831
- if (!editorClientId) throw new Error("Editor client id is browser-only");
229832
- return editorClientId;
229833
- }
229834
- //#endregion
229835
230091
  //#region ../content-editor/src/controller/editorLeaseParticipation.ts
229836
230092
  const VIEWING_PARTICIPATION = { kind: "viewing" };
229837
230093
  function classifyLeaseParticipation(participation) {
@@ -232455,7 +232711,7 @@ function toDrainFailure(effect, error) {
232455
232711
  kind: effect.type,
232456
232712
  message
232457
232713
  };
232458
- default: return assertNever$7(effect);
232714
+ default: return assertNever$8(effect);
232459
232715
  }
232460
232716
  }
232461
232717
  async function drainEditorEffect(effect, context) {
@@ -232463,7 +232719,7 @@ async function drainEditorEffect(effect, context) {
232463
232719
  case "persist-reorder": return drainPersistReorderEffect(effect, context);
232464
232720
  case "persist-insert": return drainPersistInsertEffect(effect, context);
232465
232721
  case "persist-remove": return drainPersistRemoveEffect(effect, context);
232466
- default: return assertNever$7(effect);
232722
+ default: return assertNever$8(effect);
232467
232723
  }
232468
232724
  }
232469
232725
  async function drainEditorEffects(effects, context) {
@@ -232531,19 +232787,11 @@ const invalidBlockRecoveryPayloadSchema = z.object({
232531
232787
  schemaVersion: z.number(),
232532
232788
  entry: invalidBlockRecoveryEntrySchema
232533
232789
  });
232534
- function getStorage() {
232535
- if (typeof window === "undefined") return null;
232536
- try {
232537
- return window.localStorage;
232538
- } catch {
232539
- return null;
232540
- }
232541
- }
232542
232790
  function getKey(scope, blockId) {
232543
232791
  return `${STORAGE_PREFIX}:${scope.siteId}:${scope.entryId}:${blockId}`;
232544
232792
  }
232545
232793
  function readInvalidBlockRecovery(scope, blockId) {
232546
- const storage = getStorage();
232794
+ const storage = browserStorage("local");
232547
232795
  if (!storage) return null;
232548
232796
  try {
232549
232797
  const raw = storage.getItem(getKey(scope, blockId));
@@ -232562,7 +232810,7 @@ function readInvalidBlockRecovery(scope, blockId) {
232562
232810
  }
232563
232811
  }
232564
232812
  function writeInvalidBlockRecovery(scope, blockId, values, baseline) {
232565
- const storage = getStorage();
232813
+ const storage = browserStorage("local");
232566
232814
  if (!storage) return false;
232567
232815
  try {
232568
232816
  const payload = {
@@ -232579,7 +232827,7 @@ function writeInvalidBlockRecovery(scope, blockId, values, baseline) {
232579
232827
  }
232580
232828
  }
232581
232829
  function clearInvalidBlockRecovery(scope, blockId) {
232582
- const storage = getStorage();
232830
+ const storage = browserStorage("local");
232583
232831
  if (!storage) return;
232584
232832
  try {
232585
232833
  storage.removeItem(getKey(scope, blockId));
@@ -233973,7 +234221,7 @@ function footerModuleLabel(section) {
233973
234221
  case "supporting-text": return "Supporting text";
233974
234222
  case "legal": return "Legal text";
233975
234223
  case "engagement": return section.source.kind === "standard-contact" ? "Contact form" : "Mailing list signup";
233976
- default: return assertNever$10(section);
234224
+ default: return assertNever$11(section);
233977
234225
  }
233978
234226
  }
233979
234227
  function sourceFor(section) {
@@ -234020,7 +234268,7 @@ function sourceFor(section) {
234020
234268
  kind: "footer-local",
234021
234269
  description: section.source.kind === "standard-contact" ? "Standard contact form" : "Mailing list destination"
234022
234270
  };
234023
- default: return assertNever$10(section);
234271
+ default: return assertNever$11(section);
234024
234272
  }
234025
234273
  }
234026
234274
  function sourceAvailability(input) {
@@ -234098,7 +234346,7 @@ function reduceFooterEngagementDraft(draft, event) {
234098
234346
  ...draft,
234099
234347
  targeting: event.targeting
234100
234348
  } : draft;
234101
- default: return assertNever$10(event);
234349
+ default: return assertNever$11(event);
234102
234350
  }
234103
234351
  }
234104
234352
  function createFooterEngagementDraft(section) {
@@ -234580,7 +234828,7 @@ function previewModuleLabel(module) {
234580
234828
  case "supporting-text": return "Supporting text";
234581
234829
  case "legal": return "Legal text";
234582
234830
  case "engagement": return engagementLabel(module.engagement);
234583
- default: return assertNever$10(module);
234831
+ default: return assertNever$11(module);
234584
234832
  }
234585
234833
  }
234586
234834
  function engagementLabel(engagement) {
@@ -234908,7 +235156,7 @@ function contactLinks(contact) {
234908
235156
  case "phone": return [phone(contact.phone)];
234909
235157
  case "email": return [email(contact.email)];
234910
235158
  case "phone-and-email": return [phone(contact.phone), email(contact.email)];
234911
- default: return assertNever$10(contact);
235159
+ default: return assertNever$11(contact);
234912
235160
  }
234913
235161
  }
234914
235162
  const socialPlatformIcons = {
@@ -235022,7 +235270,7 @@ function projectFooterRuntimeSection(input) {
235022
235270
  sectionKind: section.kind
235023
235271
  });
235024
235272
  }
235025
- default: return assertNever$10(section);
235273
+ default: return assertNever$11(section);
235026
235274
  }
235027
235275
  }
235028
235276
  function buildFooterRuntimeViewModel(input) {
@@ -237004,7 +237252,7 @@ function transitionPreviewDesignState(state, command) {
237004
237252
  ...state,
237005
237253
  apply: "idle"
237006
237254
  }, { kind: "none" });
237007
- default: return assertNever$6(command, "Unhandled preview design command");
237255
+ default: return assertNever$7(command, "Unhandled preview design command");
237008
237256
  }
237009
237257
  }
237010
237258
  function acceptPreview(current, next, effect) {
@@ -237246,7 +237494,7 @@ function PreviewDesignCoordinatorProvider({ children }) {
237246
237494
  case "set-theme":
237247
237495
  setOverrideTheme(transition.effect.theme, { source: transition.effect.source });
237248
237496
  break;
237249
- default: assertNever$6(transition.effect, "Unhandled preview design overlay effect");
237497
+ default: assertNever$7(transition.effect, "Unhandled preview design overlay effect");
237250
237498
  }
237251
237499
  }
237252
237500
  return transition;
@@ -237762,7 +238010,7 @@ function confirmSiteStyleHistoryMutation(state, persisted) {
237762
238010
  case "idle":
237763
238011
  case "failed":
237764
238012
  case "stale": return state;
237765
- default: return assertNever$6(state.mutation, "Unhandled site style history mutation");
238013
+ default: return assertNever$7(state.mutation, "Unhandled site style history mutation");
237766
238014
  }
237767
238015
  }
237768
238016
  function rejectSiteStyleHistoryMutation(state, failure) {
@@ -237798,7 +238046,7 @@ function siteStyleHistoryFailureMessage(state) {
237798
238046
  case "idle":
237799
238047
  case "undoing":
237800
238048
  case "redoing": return null;
237801
- default: return assertNever$6(state.mutation, "Unhandled site style history mutation");
238049
+ default: return assertNever$7(state.mutation, "Unhandled site style history mutation");
237802
238050
  }
237803
238051
  }
237804
238052
  function skipReasonForHistoryMutation$1(state, command) {
@@ -237855,14 +238103,14 @@ function selectPreviewDesignHistoryDomain(state, command, capabilities) {
237855
238103
  switch (command) {
237856
238104
  case "undo": return domain.canUndo ? domainId : null;
237857
238105
  case "redo": return domain.canRedo ? domainId : null;
237858
- default: return assertNever$6(command, "Unhandled preview design history command");
238106
+ default: return assertNever$7(command, "Unhandled preview design history command");
237859
238107
  }
237860
238108
  }
237861
238109
  function previewDesignHistoryDomainForCommand(state, command) {
237862
238110
  switch (command) {
237863
238111
  case "undo": return state.past[state.past.length - 1] ?? null;
237864
238112
  case "redo": return state.future[0] ?? null;
237865
- default: return assertNever$6(command, "Unhandled preview design history command");
238113
+ default: return assertNever$7(command, "Unhandled preview design history command");
237866
238114
  }
237867
238115
  }
237868
238116
  //#endregion
@@ -237954,7 +238202,7 @@ function quickControlHistoryEntryFromSelectionChange(previous, next, target) {
237954
238202
  previous: previous.footerLookId,
237955
238203
  next: next.footerLookId
237956
238204
  };
237957
- default: return assertNever$6(target, "Unhandled site chrome quick-control target");
238205
+ default: return assertNever$7(target, "Unhandled site chrome quick-control target");
237958
238206
  }
237959
238207
  }
237960
238208
  function quickControlHistoryEntryFromBrandPreferenceChange(previous, next, target) {
@@ -237969,7 +238217,7 @@ function quickControlHistoryEntryFromBrandPreferenceChange(previous, next, targe
237969
238217
  previous: previous.logoSize,
237970
238218
  next: next.logoSize
237971
238219
  };
237972
- default: return assertNever$6(target, "Unhandled site chrome brand quick-control target");
238220
+ default: return assertNever$7(target, "Unhandled site chrome brand quick-control target");
237973
238221
  }
237974
238222
  }
237975
238223
  function quickControlHistoryEntryFromBackgroundPreferenceChange(previous, next, target) {
@@ -237984,7 +238232,7 @@ function quickControlHistoryEntryFromBackgroundPreferenceChange(previous, next,
237984
238232
  previous: previous.footer,
237985
238233
  next: next.footer
237986
238234
  };
237987
- default: return assertNever$6(target, "Unhandled site chrome background quick-control target");
238235
+ default: return assertNever$7(target, "Unhandled site chrome background quick-control target");
237988
238236
  }
237989
238237
  }
237990
238238
  function beginSiteChromeQuickControlHistoryUndo(state) {
@@ -238036,7 +238284,7 @@ function confirmSiteChromeQuickControlHistoryMutation(state, persisted) {
238036
238284
  case "idle":
238037
238285
  case "failed":
238038
238286
  case "stale": return state;
238039
- default: return assertNever$6(state.mutation, "Unhandled site chrome quick-control history mutation");
238287
+ default: return assertNever$7(state.mutation, "Unhandled site chrome quick-control history mutation");
238040
238288
  }
238041
238289
  }
238042
238290
  function rejectSiteChromeQuickControlHistoryMutation(state, failure) {
@@ -238079,7 +238327,7 @@ function siteChromeQuickControlHistoryFailureMessage(state) {
238079
238327
  case "idle":
238080
238328
  case "undoing":
238081
238329
  case "redoing": return null;
238082
- default: return assertNever$6(state.mutation, "Unhandled site chrome quick-control history mutation");
238330
+ default: return assertNever$7(state.mutation, "Unhandled site chrome quick-control history mutation");
238083
238331
  }
238084
238332
  }
238085
238333
  function beginSiteChromeQuickControlHistoryMutation(state, mutationKind, entry) {
@@ -238185,7 +238433,7 @@ function quickControlReplayPlanForEntry(current, entry, command) {
238185
238433
  }
238186
238434
  };
238187
238435
  }
238188
- default: return assertNever$6(entry, "Unhandled site chrome quick-control history entry");
238436
+ default: return assertNever$7(entry, "Unhandled site chrome quick-control history entry");
238189
238437
  }
238190
238438
  }
238191
238439
  function skipReasonForHistoryMutation(state, command) {
@@ -238234,7 +238482,7 @@ function siteChromeQuickControlHistoryEntryEquals(left, right) {
238234
238482
  case "header-interaction-palette": return right.kind === left.kind && left.previous === right.previous && left.next === right.next;
238235
238483
  case "header-background":
238236
238484
  case "footer-background": return right.kind === left.kind && siteChromeBackgroundOverrideEquals(left.previous, right.previous) && siteChromeBackgroundOverrideEquals(left.next, right.next);
238237
- default: return assertNever$6(left, "Unhandled site chrome quick-control history entry");
238485
+ default: return assertNever$7(left, "Unhandled site chrome quick-control history entry");
238238
238486
  }
238239
238487
  }
238240
238488
  function headerBrandPreferencesEqual(left, right) {
@@ -238268,7 +238516,7 @@ function quickControlHistoryEntryFromNavPreferenceChange(previous, next, target)
238268
238516
  previous: previous.interactionPalette,
238269
238517
  next: next.interactionPalette
238270
238518
  };
238271
- default: return assertNever$6(target, "Unhandled site chrome nav quick-control target");
238519
+ default: return assertNever$7(target, "Unhandled site chrome nav quick-control target");
238272
238520
  }
238273
238521
  }
238274
238522
  //#endregion
@@ -238952,7 +239200,7 @@ function headerBrandSizeControlLabel(state) {
238952
239200
  case "title-only": return "Site title size";
238953
239201
  case "auto":
238954
239202
  case "logo-plus-title": return "Brand size";
238955
- default: return assertNever$6(state.preferences.brandDisplay, "Unhandled header brand display mode");
239203
+ default: return assertNever$7(state.preferences.brandDisplay, "Unhandled header brand display mode");
238956
239204
  }
238957
239205
  }
238958
239206
  function classifySiteStyleHistoryApplyError(error) {
@@ -238981,4 +239229,4 @@ function useSiteChromeCustomizeOptional() {
238981
239229
  return useContext(SiteChromeCustomizeContext);
238982
239230
  }
238983
239231
  //#endregion
238984
- export { FooterComposerPanel as $, DialogFooter as $a, VARIANT_ROLES as $i, canUndoHistory as $n, valueStatus as $o, SECTION_BACKGROUND_MIN_SOURCE_WIDTH as $r, createStoreBackend as $t, markApplySaving as A, attachRenderableMediaAssetFields as Aa, curatedSiteStyles as Ai, listPageSurfaceContentSlots as An, GripVertical as Ao, parseGeneratedIconSetId as Ar, MailingListTargetingProvider as At, setPaletteColors as B, CalloutDescription as Ba, gradientToCss as Bi, resolvePageRouteSlug as Bn, baselineRevisionOf as Bo, bookingConsentCarrierSchema as Br, ReferenceWidgetProvider as Bt, cancelPreview as C, makeBoundaryId as Ca, parseBackgroundContent as Ci, stripTopLevelRoutingUi as Cn, Pencil as Co, escapeStyleContent as Cr, createSiteOptionWidgetAdapters as Ct, isPreviewingChange as D, bodyCopyFragment as Da, planPageDesignLayoutLookCompatibility as Di, createManifestFormAdapter as Dn, Maximize2 as Do, EDITABLE_SURFACE_FORWARDING_PROP as Dr, OfferingsPreviewWidgetProvider as Dt, dismissWarnings as E, ctaButton as Ea, formatSiteChromeBackgroundTokenLabel as Ei, isHeaderField as En, Monitor as Eo, getDefaultComponentRegistry as Er, OfferingsPreviewGroupOrderField as Et, previewFooterLook as F, SelectContent as Fa, parseThemeForPersistence as Fi, routeLifecycleContext as Fn, ChevronDown as Fo, RichText as Fr, ButtonVariantField as Ft, confirmAutosaveBatch as G, Input as Ga, curatedPalettes as Gi, canDiscardDraft as Gn, buildMailingListSignupBlockSourceRef as Go, resolvePageRouteTarget as Gr, useEditor$1 as Gt, syncStyleConfiguratorState as H, Popover as Ha, GRADIENT_PRESET_IDS as Hi, useEditorUiStore as Hn, recordsEqual as Ho, eventCalendarListLayoutCompatibleDisplayModeValues as Hr, RichTextField as Ht, previewHeaderLayout as I, SelectItem as Ia, resolveSdkFooterMode as Ii, BUILT_IN_REFERENCE_KINDS as In, Check as Io, getAtPath as Ir, ButtonWidgetProvider as It, idleEditorTransactionQueueState as J, TabsList as Ja, findButtonStyleRecipe as Ji, remoteDraftValues as Jn, parseMailingListPlacementTargeting as Jo, isRecord$21 as Jr, BlockEditor as Jt, deriveTransactionCapabilities as K, Tabs as Ka, buttonStyleHoverPreferenceValue as Ki, activeLinkedSaveHandover as Kn, sameMailingListPlacementTargeting as Ko, resolveRouteTarget as Kr, LinkField as Kt, previewHeaderStyle as L, SelectTrigger as La, findFooterLook as Li, isAdapterReferenceKind as Ln, Button$1 as Lo, siblingPath$1 as Lr, FileField as Lt, palettePreviewProjection as M, TooltipContent as Ma, getCuratedSiteStyle as Mi, getBlockManifestFromSdkConfig as Mn, EllipsisVertical as Mo, renderInlineText as Mr, IconPickerField as Mt, previewButtonStyle as N, TooltipTrigger as Na, surfaceResolutionContextFromTheme as Ni, createRoutingHelpers as Nn, ChevronRight as No, logger$1 as Nr, EntryPickerField as Nt, markApplyFailed as O, defineFragment as Oa, resolvePageDesignEditorBoundaryForChoice as Oi, createManifestValidation as On, LoaderCircle as Oo, parseBlockIconValue as Or, MailingListTargetingField as Ot, previewCuratedPalette as P, Select$1 as Pa, corners as Pi, createSnapshotFromPageRecord as Pn, ChevronLeft as Po, Text$2 as Pr, EntryPickerWidgetProvider as Pt, resolvePreviewSidebarTab as Q, DialogDescription as Qa, buttonStyleSelectionKey as Qi, canRedoHistory as Qn, syncStateOf as Qo, setContextResolveImageUrlContext as Qr, FormRenderer as Qt, previewSiteStyle as R, SelectValue as Ra, getHeaderLayout as Ri, parseReferenceKind as Rn, cva as Ro, defaultTransforms as Rr, MediaField as Rt, applyTypographyDraftPatch as S, assertNever$6 as Sa, heroCopyFragment as Si, prepareBlockEditorManifest as Sn, Redo2 as So, getResponsiveScopeSpec as Sr, createSiteOptionApiLoader as St, deriveStyleConfiguratorCapabilities as T, runTransforms as Ta, compileEditorModelRuntime as Ti, getFieldIntent as Tn, Palette as To, readBlockComposition as Tr, SiteOptionWidgetProvider as Tt, toggleRow as U, PopoverContent as Ua, getGradientPreset as Ui, useEditorUiStoreInstance as Un, canWriteLinkedEntry as Uo, eventCalendarListLayoutOptions as Ur, RichTextWidgetProvider as Ut, styleConfiguratorHistoryEntryForPersistedSelection as V, SearchInput as Va, GRADIENT_PRESETS as Vi, resolveContentTitle as Vn, isEdited as Vo, isRichTextDoc as Vr, useRichTextImagePicker as Vt, beginAutosaveBatch as W, PopoverTrigger as Wa, parseGradientPresetId as Wi, useOptionalEditorUiStoreInstance as Wn, canEditorWrite as Wo, resolveEntryRouteTarget as Wr, EditorProvider as Wt, resolveStyleConfiguratorInitialSnapshot as X, Dialog as Xa, updateButtonStyleHoverPreference as Xi, renderedFieldChanges as Xn, selectedContentVersionId as Xo, getCurrentResolveImageUrlContext as Xr, usePalette as Xt, rejectAutosaveBatch as Y, TabsTrigger as Ya, resolveButtonStyleSelection as Yi, renderSourceFor as Yn, NO_BLOCK_VERSIONS as Yo, buildResolveImageUrlContext as Yr, PaletteProvider as Yt, createOptimisticActionRunner as Z, DialogContent as Za, updateButtonStyleSelectionChoice as Zi, resolveRenderedValues as Zn, displayedValues as Zo, resolveImageUrlWithContext as Zr, ManifestForm as Zt, reportPreviewDesignError as _, paletteColorEntries as _a, testimonialsCarouselFragment as _i, mapOptionValueForSelect as _n, Tablet as _o, resolveVariantKey as _r, VIEWING_PARTICIPATION as _t, previewDesignHistoryDomainForCommand as a, boundaryTreatmentForBoundaryOptionId as aa, LINKED_CONTENT_ENTRY_META_KEY as ai, deriveLaunchReadiness as an, Surface as ao, unsafeAsLinkedContentEntryId as ar, parsePageId as as, ContentFieldsForm as at, planSiteChromeSelection as b, defaultThemeTokens as ba, heroCtaRowFragment as bi, useField as bn, SlidersHorizontal as bo, buildThemeRuntime as br, EditLeaseModal as bt, selectionSnapshotFromApplySiteStyleSelectionResponse as c, sectionTransitionFamilyForBoundaryOptionId as ca, richTextFragment as ci, useMediaEditorOptional as cn, DropdownMenuItem as co, containerResponsiveThemeCss as cr, __exportAll as cs, EntryControllerProvider as ct, PreviewDesignCoordinatorProvider as d, pageDesignEditorBackgroundOverrideOwner as da, faqAccordionFragment as di, ImageResolveContextProvider as dn, DropdownMenuTrigger as do, getBlockDefinition as dr, classifyHistoryShortcut as dt, autoDesignChoice as ea, planSiteChromePlacement as ei, MediaEditor as en, DialogHeader as eo, createHistoryState as er, unsafeAsEditorBlockId as es, renderSiteChromeBlock as et, usePreviewDesignCoordinator as f, stripStaleTransitionStyleGroup as fa, faqHeadingFragment as fi, BlockApiProvider as fn, Primitive as fo, projectRecurringSchedule as fr, useAutosaveStatus as ft, PREVIEW_DESIGN_SAVE_ERROR_MESSAGE as g, textColorStyle as ga, formCopyFragment as gi, mapCurrentValueForSelect as gn, TriangleAlert as go, visibleHeaderClearancePx as gr, useRetentionTicks as gt, PREVIEW_DESIGN_LOAD_ERROR_MESSAGE as h, parseBackgroundAppearanceColorToken as ha, formEmbedFragment as hi, hasEmptyOption as hn, Undo2 as ho, planSiteOverlayHeaderClearance as hr, createPageSurfaceEditorServices as ht, usePreviewDesignHistoryOrder as i, sectionFactsForContent as ia, plainTextToInlineText as ii, DEFAULT_LAUNCH_READINESS_INPUT as in, CollapsibleTrigger as io, toEditorBlockItem as ir, parseMediaAssetId as is, PREVIEW_EDITABLE_OUTLINE as it, openRow as j, Tooltip as ja, designRuntimeRulesForTheme as ji, blocksKeys as jn, Eye as jo, ThemedButtonSpecimen as jr, InlineTextField as jt, markApplySaved as k, bindingSchema as ka, componentRuntimeRulesForTheme as ki, listEntryPageContentSlots as kn, Image as ko, parseGeneratedIconAssetId as kr, loadMailingListAuthoringContext as kt, deriveSiteStylePreviewUpdate as l, sectionTransitionVariantForBoundaryOptionId as la, headingFragment as li, useApiMediaUploader as ln, DropdownMenuLabel as lo, createCustomBlockRegistry as lr, useEntryController as lt, usePreviewThemeOverlay as m, backgroundAppearanceQuickColorTokenNames as ma, singleButtonFragment as mi, useSdkConfig as mn, Upload as mo, SITE_OVERLAY_HEADER_CLEARANCE_CSS_VAR as mr, createEditorApiClientFactory as mt, useSiteChromeCustomizeOptional as n, boundaryLayout as na, inlineTextToPlainText as ni, getPageDesignEditorState as nn, Collapsible as no, redoHistory as nr, expectParsedBrandedId as ns, PreviewInlineTextEditor as nt, selectPreviewDesignHistoryDomain as o, defaultSectionTransitionVariantForFamily as oa, coerceLinkedContentEntriesPayload as oi, AMBIENT_BACKGROUND_ROLES as on, DropdownMenu as oo, isSupportedLoaderEndpoint as or, parsePageSurfaceId as os, useUISelector as ot, PreviewThemeOverlayProvider as p, backgroundAppearanceColorTokenNames as pa, blogFeaturedPostFragment as pi, SdkConfigProvider as pn, X as po, SITE_CHROME_VISIBLE_HEADER_SELECTOR as pr, useDebouncedLatestSave as pt, enqueueTransaction as q, TabsContent as qa, buttonStyleSelectionParameterValue as qi, planLinkedSaveHandoverRetention as qn, parseFooterModuleId as qo, isObjectRecord$2 as qr, LinkWidgetProvider as qt, PreviewDesignHistoryOrderProvider as r, composeBoundary as ra, isInlineTextEmpty as ri, decodePublicProductCategorySelectorQuery as rn, CollapsibleContent as ro, undoHistory as rr, parseContentEntryId as rs, PreviewTextEditor as rt, buildApplySiteStyleSelectionBody as s, sectionTransitionFamilies as sa, getLinkedContentEntryMeta as si, MediaEditorContextProvider as sn, DropdownMenuContent as so, ThemeScope as sr, parseSiteId as ss, EditableBlockProvider as st, SiteChromeCustomizeProvider as t, userPinnedDesignChoice as ta, coerceInlineTextWithFallback as ti, applyPageDesignEditorAction as tn, DialogTitle as to, pushHistoryEntry as tr, assertNever$10 as ts, PreviewRichTextEditor as tt, planConfiguratorPreview as u, isThemeV2NormalEditorRawStyleFieldName as ua, cardFragment as ui, clientComponentRegistry as un, DropdownMenuSeparator as uo, makeDefaultBlockComponent as ur, useEntryEditorController as ut, buildSiteChromeSelectionModels as v, paletteColorsSchema as va, testimonialsHeadingFragment as vi, unmapValueFromSelect as vn, Sparkles as vo, compileManifestContentContract as vr, LinkedEntryLeaseBanner as vt, createStyleConfiguratorState as w, ORDINARY_TEXT_MIN_CONTRAST_RATIO as wa, applyCompiledRuntimeFieldsToContent as wi, evaluateVisibility as wn, PenLine as wo, mergeContentWithBlockStyleOverrides as wr, SiteOptionPickerField as wt, applyResolvedSelections as x, asDesignBlockId as xa, ctaRowFragment as xi, hideThemeV2RawStyleFields as xn, RotateCcw as xo, DEFAULT_THEME_RESPONSIVE_MODE as xr, EditorWriteSurface as xt, cycleSiteChromeSelectionId as y, paletteModeSchema as ya, ctaCopyFragment as yi, FieldFrame as yn, Smartphone as yo, validateManifestDraft as yr, EditLeaseDiscardedNotice as yt, resetTypographyToSaved as z, Callout as za, getHeaderStyle as zi, deriveRouteMetadataPresentation as zn, cn$2 as zo, calendarWindowQuerySchema as zr, ReferenceField as zt };
239232
+ export { FooterComposerPanel as $, DialogFooter as $a, VARIANT_ROLES as $i, canUndoHistory as $n, syncStateOf as $o, SECTION_BACKGROUND_MIN_SOURCE_WIDTH as $r, createStoreBackend as $t, markApplySaving as A, attachRenderableMediaAssetFields as Aa, curatedSiteStyles as Ai, listPageSurfaceContentSlots as An, GripVertical as Ao, parseGeneratedIconSetId as Ar, MailingListTargetingProvider as At, setPaletteColors as B, CalloutDescription as Ba, gradientToCss as Bi, resolvePageRouteSlug as Bn, baselineRevisionOf as Bo, bookingConsentCarrierSchema as Br, ReferenceWidgetProvider as Bt, cancelPreview as C, makeBoundaryId as Ca, parseBackgroundContent as Ci, stripTopLevelRoutingUi as Cn, Pencil as Co, escapeStyleContent as Cr, createSiteOptionWidgetAdapters as Ct, isPreviewingChange as D, bodyCopyFragment as Da, planPageDesignLayoutLookCompatibility as Di, createManifestFormAdapter as Dn, Maximize2 as Do, EDITABLE_SURFACE_FORWARDING_PROP as Dr, OfferingsPreviewWidgetProvider as Dt, dismissWarnings as E, ctaButton as Ea, formatSiteChromeBackgroundTokenLabel as Ei, isHeaderField as En, Monitor as Eo, getDefaultComponentRegistry as Er, OfferingsPreviewGroupOrderField as Et, previewFooterLook as F, SelectContent as Fa, parseThemeForPersistence as Fi, routeLifecycleContext as Fn, ChevronDown as Fo, RichText as Fr, ButtonVariantField as Ft, confirmAutosaveBatch as G, Input as Ga, curatedPalettes as Gi, canDiscardDraft as Gn, buildMailingListSignupBlockSourceRef as Go, resolvePageRouteTarget as Gr, useEditor$1 as Gt, syncStyleConfiguratorState as H, Popover as Ha, GRADIENT_PRESET_IDS as Hi, useEditorUiStore as Hn, recordsEqual as Ho, eventCalendarListLayoutCompatibleDisplayModeValues as Hr, RichTextField as Ht, previewHeaderLayout as I, SelectItem as Ia, resolveSdkFooterMode as Ii, BUILT_IN_REFERENCE_KINDS as In, Check as Io, getAtPath as Ir, ButtonWidgetProvider as It, idleEditorTransactionQueueState as J, TabsList as Ja, findButtonStyleRecipe as Ji, remoteDraftValues as Jn, parseMailingListPlacementTargeting as Jo, isRecord$21 as Jr, BlockEditor as Jt, deriveTransactionCapabilities as K, Tabs as Ka, buttonStyleHoverPreferenceValue as Ki, activeLinkedSaveHandover as Kn, sameMailingListPlacementTargeting as Ko, resolveRouteTarget as Kr, LinkField as Kt, previewHeaderStyle as L, SelectTrigger as La, findFooterLook as Li, isAdapterReferenceKind as Ln, Button$1 as Lo, siblingPath$1 as Lr, FileField as Lt, palettePreviewProjection as M, TooltipContent as Ma, getCuratedSiteStyle as Mi, getBlockManifestFromSdkConfig as Mn, EllipsisVertical as Mo, renderInlineText as Mr, IconPickerField as Mt, previewButtonStyle as N, TooltipTrigger as Na, surfaceResolutionContextFromTheme as Ni, createRoutingHelpers as Nn, ChevronRight as No, logger$1 as Nr, EntryPickerField as Nt, markApplyFailed as O, defineFragment as Oa, resolvePageDesignEditorBoundaryForChoice as Oi, createManifestValidation as On, LoaderCircle as Oo, parseBlockIconValue as Or, MailingListTargetingField as Ot, previewCuratedPalette as P, Select$1 as Pa, corners as Pi, createSnapshotFromPageRecord as Pn, ChevronLeft as Po, Text$2 as Pr, EntryPickerWidgetProvider as Pt, resolvePreviewSidebarTab as Q, DialogDescription as Qa, buttonStyleSelectionKey as Qi, canRedoHistory as Qn, displayedValues as Qo, setContextResolveImageUrlContext as Qr, FormRenderer as Qt, previewSiteStyle as R, SelectValue as Ra, getHeaderLayout as Ri, parseReferenceKind as Rn, cva as Ro, defaultTransforms as Rr, MediaField as Rt, applyTypographyDraftPatch as S, assertNever$7 as Sa, heroCopyFragment as Si, prepareBlockEditorManifest as Sn, Redo2 as So, getResponsiveScopeSpec as Sr, createSiteOptionApiLoader as St, deriveStyleConfiguratorCapabilities as T, runTransforms as Ta, compileEditorModelRuntime as Ti, getFieldIntent as Tn, Palette as To, readBlockComposition as Tr, SiteOptionWidgetProvider as Tt, toggleRow as U, PopoverContent as Ua, getGradientPreset as Ui, useEditorUiStoreInstance as Un, canWriteLinkedEntry as Uo, eventCalendarListLayoutOptions as Ur, RichTextWidgetProvider as Ut, styleConfiguratorHistoryEntryForPersistedSelection as V, SearchInput as Va, GRADIENT_PRESETS as Vi, resolveContentTitle as Vn, isEdited as Vo, isRichTextDoc as Vr, useRichTextImagePicker as Vt, beginAutosaveBatch as W, PopoverTrigger as Wa, parseGradientPresetId as Wi, useOptionalEditorUiStoreInstance as Wn, canEditorWrite as Wo, resolveEntryRouteTarget as Wr, EditorProvider as Wt, resolveStyleConfiguratorInitialSnapshot as X, Dialog as Xa, updateButtonStyleHoverPreference as Xi, renderedFieldChanges as Xn, selectedContentVersionId as Xo, getCurrentResolveImageUrlContext as Xr, usePalette as Xt, rejectAutosaveBatch as Y, TabsTrigger as Ya, resolveButtonStyleSelection as Yi, renderSourceFor as Yn, NO_BLOCK_VERSIONS as Yo, buildResolveImageUrlContext as Yr, PaletteProvider as Yt, createOptimisticActionRunner as Z, DialogContent as Za, updateButtonStyleSelectionChoice as Zi, resolveRenderedValues as Zn, parseEditLeaseScope as Zo, resolveImageUrlWithContext as Zr, ManifestForm as Zt, reportPreviewDesignError as _, paletteColorEntries as _a, testimonialsCarouselFragment as _i, mapOptionValueForSelect as _n, Tablet as _o, resolveVariantKey as _r, VIEWING_PARTICIPATION as _t, previewDesignHistoryDomainForCommand as a, boundaryTreatmentForBoundaryOptionId as aa, LINKED_CONTENT_ENTRY_META_KEY as ai, deriveLaunchReadiness as an, Surface as ao, unsafeAsLinkedContentEntryId as ar, parseSiteId as as, ContentFieldsForm as at, planSiteChromeSelection as b, defaultThemeTokens as ba, heroCtaRowFragment as bi, useField as bn, SlidersHorizontal as bo, buildThemeRuntime as br, EditLeaseModal as bt, selectionSnapshotFromApplySiteStyleSelectionResponse as c, sectionTransitionFamilyForBoundaryOptionId as ca, richTextFragment as ci, useMediaEditorOptional as cn, DropdownMenuItem as co, containerResponsiveThemeCss as cr, EntryControllerProvider as ct, PreviewDesignCoordinatorProvider as d, pageDesignEditorBackgroundOverrideOwner as da, faqAccordionFragment as di, ImageResolveContextProvider as dn, DropdownMenuTrigger as do, getBlockDefinition as dr, classifyHistoryShortcut as dt, autoDesignChoice as ea, planSiteChromePlacement as ei, MediaEditor as en, DialogHeader as eo, createHistoryState as er, valueStatus as es, renderSiteChromeBlock as et, usePreviewDesignCoordinator as f, stripStaleTransitionStyleGroup as fa, faqHeadingFragment as fi, BlockApiProvider as fn, Primitive as fo, projectRecurringSchedule as fr, useAutosaveStatus as ft, PREVIEW_DESIGN_SAVE_ERROR_MESSAGE as g, textColorStyle as ga, formCopyFragment as gi, mapCurrentValueForSelect as gn, TriangleAlert as go, visibleHeaderClearancePx as gr, useRetentionTicks as gt, PREVIEW_DESIGN_LOAD_ERROR_MESSAGE as h, parseBackgroundAppearanceColorToken as ha, formEmbedFragment as hi, hasEmptyOption as hn, Undo2 as ho, planSiteOverlayHeaderClearance as hr, createPageSurfaceEditorServices as ht, usePreviewDesignHistoryOrder as i, sectionFactsForContent as ia, plainTextToInlineText as ii, DEFAULT_LAUNCH_READINESS_INPUT as in, CollapsibleTrigger as io, toEditorBlockItem as ir, parseMediaAssetId as is, PREVIEW_EDITABLE_OUTLINE as it, openRow as j, Tooltip as ja, designRuntimeRulesForTheme as ji, blocksKeys as jn, Eye as jo, ThemedButtonSpecimen as jr, InlineTextField as jt, markApplySaved as k, bindingSchema as ka, componentRuntimeRulesForTheme as ki, listEntryPageContentSlots as kn, Image as ko, parseGeneratedIconAssetId as kr, loadMailingListAuthoringContext as kt, deriveSiteStylePreviewUpdate as l, sectionTransitionVariantForBoundaryOptionId as la, headingFragment as li, useApiMediaUploader as ln, DropdownMenuLabel as lo, createCustomBlockRegistry as lr, useEntryController as lt, usePreviewThemeOverlay as m, backgroundAppearanceQuickColorTokenNames as ma, singleButtonFragment as mi, useSdkConfig as mn, Upload as mo, SITE_OVERLAY_HEADER_CLEARANCE_CSS_VAR as mr, createEditorApiClientFactory as mt, useSiteChromeCustomizeOptional as n, boundaryLayout as na, inlineTextToPlainText as ni, getPageDesignEditorState as nn, Collapsible as no, redoHistory as nr, assertNever$11 as ns, PreviewInlineTextEditor as nt, selectPreviewDesignHistoryDomain as o, defaultSectionTransitionVariantForFamily as oa, coerceLinkedContentEntriesPayload as oi, AMBIENT_BACKGROUND_ROLES as on, DropdownMenu as oo, isSupportedLoaderEndpoint as or, __exportAll as os, useUISelector as ot, PreviewThemeOverlayProvider as p, backgroundAppearanceColorTokenNames as pa, blogFeaturedPostFragment as pi, SdkConfigProvider as pn, X as po, SITE_CHROME_VISIBLE_HEADER_SELECTOR as pr, useDebouncedLatestSave as pt, enqueueTransaction as q, TabsContent as qa, buttonStyleSelectionParameterValue as qi, planLinkedSaveHandoverRetention as qn, parseFooterModuleId as qo, isObjectRecord$2 as qr, LinkWidgetProvider as qt, PreviewDesignHistoryOrderProvider as r, composeBoundary as ra, isInlineTextEmpty as ri, decodePublicProductCategorySelectorQuery as rn, CollapsibleContent as ro, undoHistory as rr, expectParsedBrandedId as rs, PreviewTextEditor as rt, buildApplySiteStyleSelectionBody as s, sectionTransitionFamilies as sa, getLinkedContentEntryMeta as si, MediaEditorContextProvider as sn, DropdownMenuContent as so, ThemeScope as sr, EditableBlockProvider as st, SiteChromeCustomizeProvider as t, userPinnedDesignChoice as ta, coerceInlineTextWithFallback as ti, applyPageDesignEditorAction as tn, DialogTitle as to, pushHistoryEntry as tr, unsafeAsEditorBlockId as ts, PreviewRichTextEditor as tt, planConfiguratorPreview as u, isThemeV2NormalEditorRawStyleFieldName as ua, cardFragment as ui, clientComponentRegistry as un, DropdownMenuSeparator as uo, makeDefaultBlockComponent as ur, useEntryEditorController as ut, buildSiteChromeSelectionModels as v, paletteColorsSchema as va, testimonialsHeadingFragment as vi, unmapValueFromSelect as vn, Sparkles as vo, compileManifestContentContract as vr, LinkedEntryLeaseBanner as vt, createStyleConfiguratorState as w, ORDINARY_TEXT_MIN_CONTRAST_RATIO as wa, applyCompiledRuntimeFieldsToContent as wi, evaluateVisibility as wn, PenLine as wo, mergeContentWithBlockStyleOverrides as wr, SiteOptionPickerField as wt, applyResolvedSelections as x, asDesignBlockId as xa, ctaRowFragment as xi, hideThemeV2RawStyleFields as xn, RotateCcw as xo, DEFAULT_THEME_RESPONSIVE_MODE as xr, EditorWriteSurface as xt, cycleSiteChromeSelectionId as y, paletteModeSchema as ya, ctaCopyFragment as yi, FieldFrame as yn, Smartphone as yo, validateManifestDraft as yr, EditLeaseDiscardedNotice as yt, resetTypographyToSaved as z, Callout as za, getHeaderStyle as zi, deriveRouteMetadataPresentation as zn, cn$2 as zo, calendarWindowQuerySchema as zr, ReferenceField as zt };