@riverbankcms/sdk 0.145.0 → 0.146.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 (159) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/{PreviewEditorSidebar-O-V6Pl5a.mjs → PreviewEditorSidebar-kg2r2Fyi.mjs} +4 -4
  3. package/dist/{PreviewEditorUI-1UlX_9cw.mjs → PreviewEditorUI-sWMLp5dT.mjs} +3 -3
  4. package/dist/{PreviewQueryProvider-BxGwdOCV.mjs → PreviewQueryProvider-Cg51xq1w.mjs} +1 -1
  5. package/dist/{SdkPreviewModeRuntime-DYbA_4iv.mjs → SdkPreviewModeRuntime-h2ti3Hch.mjs} +280 -182
  6. package/dist/{SiteChromeCustomizeContext-CNTKQ9nx.mjs → SiteChromeCustomizeContext-DEACFH9m.mjs} +1330 -734
  7. package/dist/_dts/ai/src/contracts/proposals.d.ts +924 -0
  8. package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +84 -0
  9. package/dist/_dts/api/src/bookingConfig.d.ts +8 -1
  10. package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +8 -14
  11. package/dist/_dts/api/src/bookingManagementEventEndpointTypes.d.ts +45 -1
  12. package/dist/_dts/api/src/clientErrorReporting.d.ts +50 -0
  13. package/dist/_dts/api/src/communications.d.ts +20 -4
  14. package/dist/_dts/api/src/contentRuntime.d.ts +3 -7
  15. package/dist/_dts/api/src/endpoints.d.ts +223 -88
  16. package/dist/_dts/api/src/event-visibility.d.ts +20 -0
  17. package/dist/_dts/api/src/eventManagementContracts.d.ts +56 -3
  18. package/dist/_dts/api/src/eventManagementEndpointDefinitions.d.ts +24 -0
  19. package/dist/_dts/api/src/eventPageWords.d.ts +19 -0
  20. package/dist/_dts/api/src/eventSeriesRegistrationEndpointDefinitions.d.ts +14 -0
  21. package/dist/_dts/api/src/index.d.ts +7 -1
  22. package/dist/_dts/api/src/indexCoreTypes.d.ts +1 -1
  23. package/dist/_dts/api/src/indexExtendedTypes.d.ts +1 -1
  24. package/dist/_dts/api/src/launchReadiness.d.ts +20 -2
  25. package/dist/_dts/api/src/launchRequirementPriority.d.ts +3 -0
  26. package/dist/_dts/api/src/newsletterCampaignCommandEndpoints.d.ts +13 -0
  27. package/dist/_dts/api/src/newsletterEndpointDefinitions.d.ts +42 -0
  28. package/dist/_dts/api/src/occurrenceScheduling.d.ts +10 -0
  29. package/dist/_dts/api/src/pageSurfaceEndpoints.d.ts +44 -0
  30. package/dist/_dts/api/src/participantMessaging.d.ts +11 -1
  31. package/dist/_dts/api/src/sdk-event-upsert.d.ts +40 -1
  32. package/dist/_dts/api/src/sdkContracts.d.ts +3 -42
  33. package/dist/_dts/api/src/sdkCourseBooking.d.ts +30 -0
  34. package/dist/_dts/api/src/sdkEventEndpointDefinitions.d.ts +76 -0
  35. package/dist/_dts/api/src/sdkEventLifecycle.d.ts +37 -0
  36. package/dist/_dts/api/src/sdkManagedEventContracts.d.ts +18 -0
  37. package/dist/_dts/api/src/sdkPageDesign.d.ts +388 -0
  38. package/dist/_dts/api/src/sdkPageDesignEndpointDefinitions.d.ts +22 -0
  39. package/dist/_dts/api/src/sdkPullEventContracts.d.ts +46 -0
  40. package/dist/_dts/api/src/siteAddressEndpoints.d.ts +29 -0
  41. package/dist/_dts/api/src/siteManagementEndpointDefinitions.d.ts +49 -0
  42. package/dist/_dts/api/src/siteManagementEndpoints.d.ts +2 -32
  43. package/dist/_dts/api/src/siteOnboarding.d.ts +75 -9
  44. package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +1 -1
  45. package/dist/_dts/api/src/types.d.ts +7 -1
  46. package/dist/_dts/api/src/wholeSeriesRuns.d.ts +14 -0
  47. package/dist/_dts/blocks/src/index.d.ts +2 -0
  48. package/dist/_dts/blocks/src/pageRenderAdmission.d.ts +10 -0
  49. package/dist/_dts/blocks/src/pageRendererContracts.d.ts +3 -1
  50. package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +27 -5
  51. package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +14 -1
  52. package/dist/_dts/blocks/src/system/icons/social.d.ts +1 -1
  53. package/dist/_dts/blocks/src/system/registry.d.ts +1 -1
  54. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventSourceRecovery.d.ts +1 -0
  55. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +20 -4
  56. package/dist/_dts/blocks/src/system/runtime/nodes/form.fields.d.ts +5 -0
  57. package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.block-submission.d.ts +36 -0
  58. package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.client.d.ts +1 -1
  59. package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.interactive.d.ts +6 -1
  60. package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.parts.d.ts +46 -0
  61. package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.types.d.ts +2 -1
  62. package/dist/_dts/blocks/src/system/runtime/resolver.d.ts +2 -1
  63. package/dist/_dts/blocks/src/system/runtime/shared/components/CheckboxChoice.d.ts +18 -0
  64. package/dist/_dts/blocks/src/system/runtime/shared/components/index.d.ts +1 -0
  65. package/dist/_dts/content-editor/src/index.d.ts +1 -0
  66. package/dist/_dts/content-editor/src/primitives/previewEditableOutline.d.ts +2 -0
  67. package/dist/_dts/content-editor/src/ui/editorBlockEquality.d.ts +3 -0
  68. package/dist/_dts/content-editor/src/ui/editorSnapshot.d.ts +3 -5
  69. package/dist/_dts/core/src/block-content-identity.d.ts +5 -0
  70. package/dist/_dts/core/src/editor-state.d.ts +2 -7
  71. package/dist/_dts/core/src/index.d.ts +1 -0
  72. package/dist/_dts/core/src/mailing-list-submission.d.ts +3 -1
  73. package/dist/_dts/core/src/public-event-booking-availability.d.ts +20 -1
  74. package/dist/_dts/core/src/public-profile.d.ts +3 -1
  75. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +49 -2
  76. package/dist/_dts/editor-blocks/src/BlockEditor.d.ts +3 -0
  77. package/dist/_dts/editor-blocks/src/block-editor/EmptyState.d.ts +13 -1
  78. package/dist/_dts/editor-blocks/src/block-editor/types.d.ts +2 -8
  79. package/dist/_dts/editor-blocks/src/index.d.ts +1 -0
  80. package/dist/_dts/preview-next/src/client/blocks/composer/types.d.ts +3 -4
  81. package/dist/_dts/preview-next/src/client/preview/PreviewEntryControllerProvider.d.ts +1 -2
  82. package/dist/_dts/sdk/src/next/renderSdkContent.d.ts +0 -1
  83. package/dist/_dts/sdk/src/rendering/blocks-page-renderer.d.ts +2 -2
  84. package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +2 -2
  85. package/dist/_dts/sdk/src/rendering/helpers/loadContent.d.ts +6 -1
  86. package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +5 -2
  87. package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +6 -1
  88. package/dist/_dts/sdk/src/rendering/helpers/templateContent.d.ts +2 -0
  89. package/dist/_dts/sdk/src/rendering/hooks/useContent.d.ts +5 -1
  90. package/dist/_dts/sdk/src/rendering/hooks/usePage.d.ts +5 -1
  91. package/dist/_dts/sdk/src/version.d.ts +1 -1
  92. package/dist/_dts/surfaces/src/index.d.ts +9 -0
  93. package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
  94. package/dist/_dts/theme-core/src/inputs/checkable.d.ts +42 -0
  95. package/dist/_dts/theme-core/src/inputs/inputGroup.d.ts +19 -0
  96. package/dist/_dts/ui/src/navigation-tabs.d.ts +2 -1
  97. package/dist/client/{BookingConsentAgreement-DlVOmpW4.mjs → BookingConsentAgreement-BQKL045f.mjs} +2 -2
  98. package/dist/client/CheckboxChoice--W2n6yKs.mjs +24 -0
  99. package/dist/client/{DiscountCodeDisclosure-T9q623PQ.mjs → DiscountCodeDisclosure-CsOtjFY7.mjs} +1 -1
  100. package/dist/client/{EventCombined.client-DnsUeONl.mjs → EventCombined.client-BdRjVbhH.mjs} +6 -6
  101. package/dist/client/{EventListing.client-CNBFqJS4.mjs → EventListing.client-DBxC6xOU.mjs} +2 -2
  102. package/dist/client/{LeafletStaticMap-C7higg52.mjs → LeafletStaticMap-mHEJKrTs.mjs} +1 -1
  103. package/dist/client/{ThemedButton-LAJTNrS8.mjs → ThemedButton-CE5KYT6z.mjs} +1 -1
  104. package/dist/client/{accordion-BcNF9TjX.mjs → accordion-BEQNSptH.mjs} +1 -1
  105. package/dist/client/{bookingForm-BUaQ3S03.mjs → bookingForm-AMr-s5vw.mjs} +33 -52
  106. package/dist/client/bookings.mjs +48 -46
  107. package/dist/client/{carousel-CTdF6e0V.mjs → carousel-Bbt_QgJy.mjs} +1 -1
  108. package/dist/client/{cart-pGtyf_XU.mjs → cart-CnWi30zJ.mjs} +3 -3
  109. package/dist/client/{checkout-Da9WSn7Y.mjs → checkout-f3nkWgd4.mjs} +3 -3
  110. package/dist/client/client.mjs +1611 -815
  111. package/dist/client/{context-BFeY_Wbm.mjs → context-Bc8T6pCe.mjs} +1 -1
  112. package/dist/client/{dates-BhwVSxDg.mjs → dates-DUsCEzLb.mjs} +2 -3
  113. package/dist/client/{eventCalendar-BAtdnR4s.mjs → eventCalendar-CKwgXui5.mjs} +9 -9
  114. package/dist/client/{eventCombined-RksA3tRC.mjs → eventCombined-CBAOSTGR.mjs} +4 -4
  115. package/dist/client/{eventDetails-BB9hB4wR.mjs → eventDetails-Dh-_WiBD.mjs} +4 -4
  116. package/dist/client/{eventListing-BpJBkviM.mjs → eventListing-CA3frIH5.mjs} +4 -4
  117. package/dist/client/{eventRegistration-B18jFq_o.mjs → eventRegistration-BHtsgdcg.mjs} +21 -22
  118. package/dist/client/{form-Dodt8Y8t.mjs → form-C2h3YAcg.mjs} +135 -104
  119. package/dist/client/{headerSection-B0qj9ttg.mjs → headerSection-lwMuMTH9.mjs} +3 -3
  120. package/dist/client/hooks.mjs +489 -65
  121. package/dist/client/{locationMap-gn-iMk7a.mjs → locationMap-DJ2bLODV.mjs} +3 -3
  122. package/dist/client/{newsletterForm-oByLdFkr.mjs → newsletterForm-8Pu5K32g.mjs} +203 -101
  123. package/dist/client/{pricing-BOU0_Hai.mjs → pricing-HHx3IgBz.mjs} +1 -1
  124. package/dist/client/{productDetail-D9v1zH2j.mjs → productDetail-C_1odnAf.mjs} +3 -3
  125. package/dist/client/{productList-D-mItx1n.mjs → productList-CtCv-Nmx.mjs} +3 -3
  126. package/dist/client/{propsDecoder-C3TP_z4x.mjs → propsDecoder-Dcgsncxb.mjs} +40 -23
  127. package/dist/client/rendering/client.mjs +490 -457
  128. package/dist/client/rendering/islands.mjs +17 -17
  129. package/dist/client/rendering.mjs +1515 -628
  130. package/dist/client/{routeIslandApiConfig-DzN1W0sq.mjs → routeIslandApiConfig-CWLP7wu3.mjs} +1 -1
  131. package/dist/client/{scrollToBlock-CWs8EIdo.mjs → scrollToBlock-BNgaEUpo.mjs} +1 -1
  132. package/dist/client/{shop-Dufw7N7o.mjs → shop-DQXrQ8kJ.mjs} +7 -7
  133. package/dist/client/{shop-commerce-gklw_hLF.mjs → shop-commerce-B88zmWWo.mjs} +6 -6
  134. package/dist/client/{shop-commerce-store-Sf1eyTaZ.mjs → shop-commerce-store-DtSfkKuX.mjs} +1 -1
  135. package/dist/client/{shopShared-B5nyA41S.mjs → shopShared-cuaONpkJ.mjs} +4 -4
  136. package/dist/client/{useEventFilters-CLL829vy.mjs → useEventFilters-Bukew6Gb.mjs} +6 -6
  137. package/dist/preview-next/before-render.mjs +368 -103
  138. package/dist/preview-next/client/runtime.mjs +4 -4
  139. package/dist/preview-next/editor-base.css +11 -0
  140. package/dist/preview-next/keepAlive.mjs +328 -103
  141. package/dist/preview-next/middleware.mjs +329 -103
  142. package/dist/{previewAuthStore-BxAFlu-j.mjs → previewAuthStore-h5IgbSp4.mjs} +353 -103
  143. package/dist/{sdk-runtime-D0uZFev7.mjs → sdk-runtime-DTc1uIXn.mjs} +2 -2
  144. package/dist/{separator-EvdCAn4V.mjs → separator-BpHS1KZK.mjs} +1 -1
  145. package/dist/server/components.mjs +1376 -331
  146. package/dist/server/config-validation.mjs +405 -27
  147. package/dist/server/config.mjs +405 -27
  148. package/dist/server/data.mjs +405 -27
  149. package/dist/server/index.mjs +370 -104
  150. package/dist/server/next.mjs +1430 -463
  151. package/dist/server/page-converter.mjs +36 -25
  152. package/dist/server/prebuild.mjs +1 -1
  153. package/dist/server/rendering/server.mjs +1374 -331
  154. package/dist/server/rendering.mjs +1436 -364
  155. package/dist/server/routing.mjs +476 -43
  156. package/dist/server/server.mjs +504 -169
  157. package/dist/server/theme-bridge.mjs +467 -111
  158. package/dist/styles/index.css +186 -65
  159. package/package.json +1 -1
@@ -1626,7 +1626,8 @@ var init_business_address = __esmMin((() => {
1626
1626
  var init_try_async = __esmMin((() => {
1627
1627
  init_result$1();
1628
1628
  }));
1629
- var init_narrow_result = __esmMin((() => {})), init_editor_state = __esmMin((() => {}));
1629
+ var init_narrow_result = __esmMin((() => {}));
1630
+ var init_editor_state = __esmMin((() => {})), init_block_content_identity = __esmMin((() => {}));
1630
1631
  var init_sensitive_collection = __esmMin((() => {}));
1631
1632
  //#endregion
1632
1633
  //#region ../core/src/assertNever.ts
@@ -2149,15 +2150,6 @@ function parseMailingListContentVersionId(value) {
2149
2150
  const parsed = parseContentVersionId(value);
2150
2151
  return parsed.ok ? parsed.value : null;
2151
2152
  }
2152
- function buildMailingListSignupBlockSourceRef(blockId, contentVersionId) {
2153
- const parsedBlockId = parseMailingListBlockId(blockId);
2154
- const parsedContentVersionId = parseMailingListContentVersionId(contentVersionId);
2155
- return parsedBlockId !== null && parsedContentVersionId !== null ? {
2156
- tag: "block_ref",
2157
- blockId: parsedBlockId,
2158
- contentVersionId: parsedContentVersionId
2159
- } : null;
2160
- }
2161
2153
  var init_mailing_list_submission = __esmMin((() => {
2162
2154
  init_branded();
2163
2155
  }));
@@ -2577,6 +2569,7 @@ var init_src$2 = __esmMin((() => {
2577
2569
  init_narrow_result();
2578
2570
  init_non_empty_array();
2579
2571
  init_editor_state();
2572
+ init_block_content_identity();
2580
2573
  init_sensitive_collection();
2581
2574
  init_assertNever$1();
2582
2575
  init_participants();
@@ -9048,7 +9041,7 @@ var init_bookingConsent = __esmMin((() => {
9048
9041
  checkboxLabel: z.string().min(1)
9049
9042
  });
9050
9043
  z.union([blockBookingConsentSchema, bookingRequirementConsentFieldSchema]);
9051
- })), publicEventLoaderQuerySchemaShape, eventPresetSchema, eventScheduleScopeSchema$2, publicEventRecurrenceSchema, eventDestinationModeSchema, publicEventDestinationSchema, eventVenueSchema, eventCategorySchema, accessRestrictionSchema, publicCurrencySchema, publicCentsSchema, publicPositiveCentsSchema, publicIsoDateTimeSchema, publicEventAttendanceModeSchema, publicEventAttendanceModeAvailabilitySchema, publicEventPricingOptionAvailabilitySchema, publicEventPricingOptionSchema, publicEventPricingSchema, publicTeamMemberSummarySchema, publicEventBookingAvailabilitySchema, publicRunSessionSchema, publicWholeSeriesRunSchema, publicEventBaseSchema, publicEventSchema, publicEventsArraySchema;
9044
+ })), publicEventLoaderQuerySchemaShape, eventPresetSchema, eventScheduleScopeSchema$2, publicEventRecurrenceSchema, eventDestinationModeSchema, publicEventDestinationSchema, eventVenueSchema, eventCategorySchema, accessRestrictionSchema, publicCurrencySchema, publicCentsSchema, publicPositiveCentsSchema, publicIsoDateTimeSchema, publicEventAttendanceModeSchema, publicEventAttendanceModeAvailabilitySchema, publicEventPricingOptionAvailabilitySchema, publicEventPricingOptionSchema, publicEventPricingSchema, publicTeamMemberSummarySchema, publicEventBookingAvailabilitySchema, publicEventBookingClosedDetailSchema, publicRunSessionSchema, publicWholeSeriesRunSchema, publicEventBaseSchema, publicEventSchema, publicEventsArraySchema;
9052
9045
  var init_schemas = __esmMin((() => {
9053
9046
  init_media$1();
9054
9047
  init_richTextSchema();
@@ -9072,6 +9065,7 @@ var init_schemas = __esmMin((() => {
9072
9065
  seriesSlug: z.string().optional(),
9073
9066
  includeOccurrenceId: z.string().optional(),
9074
9067
  readIntent: z.string().optional(),
9068
+ detailAdmission: z.string().optional(),
9075
9069
  detailLevel: z.string().optional(),
9076
9070
  readProfile: z.string().optional()
9077
9071
  };
@@ -9229,11 +9223,11 @@ var init_schemas = __esmMin((() => {
9229
9223
  "series_archived",
9230
9224
  "parent_archived",
9231
9225
  "parent_inconsistent",
9232
- "not_public",
9233
9226
  "already_started",
9234
9227
  "enrollment_closed"
9235
9228
  ])
9236
9229
  })]);
9230
+ publicEventBookingClosedDetailSchema = z.discriminatedUnion("kind", [z.object({ kind: z.literal("opensSoon") }), z.object({ kind: z.literal("paused") })]);
9237
9231
  publicRunSessionSchema = z.object({
9238
9232
  occurrenceId: z.string(),
9239
9233
  startsAt: z.string(),
@@ -9275,6 +9269,7 @@ var init_schemas = __esmMin((() => {
9275
9269
  destination: publicEventDestinationSchema,
9276
9270
  requiresRegistration: z.boolean(),
9277
9271
  bookingAvailability: publicEventBookingAvailabilitySchema,
9272
+ bookingClosedDetail: publicEventBookingClosedDetailSchema.optional(),
9278
9273
  deliveryMode: z.enum([
9279
9274
  "in_person",
9280
9275
  "online",
@@ -13733,6 +13728,7 @@ var init_social = __esmMin((() => {
13733
13728
  "SocialInstagram",
13734
13729
  "SocialLinkedIn",
13735
13730
  "SocialTikTok",
13731
+ "SocialWhatsApp",
13736
13732
  "SocialX",
13737
13733
  "SocialYouTube"
13738
13734
  ];
@@ -13769,6 +13765,7 @@ var init_social = __esmMin((() => {
13769
13765
  /* @__PURE__ */ jsx("path", { d: "M10.5 9v10" })
13770
13766
  ] })),
13771
13767
  SocialTikTok: createIcon("SocialTikTokIcon", /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("path", { d: "M14 4v11.5a4.5 4.5 0 1 1-4-4.47" }), /* @__PURE__ */ jsx("path", { d: "M14 4c.7 3 2.4 4.5 5 4.5" })] })),
13768
+ SocialWhatsApp: createIcon("SocialWhatsAppIcon", /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("path", { d: "M3.5 20.5 4.8 16.4A8.5 8.5 0 1 1 8 19.3Z" }), /* @__PURE__ */ jsx("path", { d: "M9.2 8.2c.2-.5.9-.6 1.2-.1l.8 1.4c.2.3.1.7-.2 1l-.5.5c.5 1.1 1.4 2 2.5 2.5l.5-.5c.3-.3.7-.4 1-.2l1.4.8c.5.3.4 1-.1 1.2-2.9 1.1-7.7-3.7-6.6-6.6Z" })] })),
13772
13769
  SocialX: createIcon("SocialXIcon", /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("path", { d: "m5 4 14 16" }), /* @__PURE__ */ jsx("path", { d: "M19 4 5 20" })] })),
13773
13770
  SocialYouTube: createIcon("SocialYouTubeIcon", /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("path", { d: "M21 12c0 3.5-.5 5.5-1.3 6.3S16.5 19.5 12 19.5s-6.9-.4-7.7-1.2S3 15.5 3 12s.5-5.5 1.3-6.3S7.5 4.5 12 4.5s6.9.4 7.7 1.2S21 8.5 21 12Z" }), /* @__PURE__ */ jsx("path", { d: "m10 9 5 3-5 3Z" })] }))
13774
13771
  };
@@ -17565,7 +17562,6 @@ function closedEventBookingLabel(reason) {
17565
17562
  case "series_archived":
17566
17563
  case "parent_archived":
17567
17564
  case "parent_inconsistent":
17568
- case "not_public":
17569
17565
  case "already_started":
17570
17566
  case "enrollment_closed": return "Registration closed";
17571
17567
  default: return assertNever$22(reason);
@@ -37193,6 +37189,11 @@ function withOptionalPhone(fields, includePhone) {
37193
37189
  var init_newsletter_form_types = __esmMin((() => {}));
37194
37190
  //#endregion
37195
37191
  //#region ../blocks/src/system/runtime/nodes/newsletter-form.interactive.ts
37192
+ function newsletterBlockSubmissionMessage(target) {
37193
+ if (target.tag === "block-source") return target.sourceRef ? null : NEWSLETTER_SIGNUPS_PAUSED_MESSAGE;
37194
+ if (target.tag !== "unpublished-preview") return null;
37195
+ return target.reason === "unpublished-form" ? "Publish this form to test a signup here." : "This form's signup settings are unpublished. Publish it to test a signup here.";
37196
+ }
37196
37197
  function buildNewsletterDisplay(source) {
37197
37198
  const context = source.mailingList;
37198
37199
  const form = context?.tag === "configured" ? context.form : {
@@ -37218,16 +37219,21 @@ function buildNewsletterDisplay(source) {
37218
37219
  }
37219
37220
  function projectNewsletterFormHydrationTarget(source) {
37220
37221
  switch (source.source) {
37221
- case "block": {
37222
- const sourceRef = buildMailingListSignupBlockSourceRef(source.blockId, source.contentVersionId);
37223
- if (sourceRef?.tag === "block_ref") return {
37222
+ case "block": switch (source.newsletterBlockSubmission.tag) {
37223
+ case "unpublished-form":
37224
+ case "unpublished-settings": return {
37225
+ tag: "unpublished-preview",
37226
+ reason: source.newsletterBlockSubmission.tag
37227
+ };
37228
+ case "ready": return {
37224
37229
  tag: "block-source",
37225
- sourceRef
37230
+ sourceRef: source.newsletterBlockSubmission.sourceRef
37226
37231
  };
37227
- return {
37232
+ case "unavailable": return {
37228
37233
  tag: "block-source",
37229
37234
  sourceRef: null
37230
37235
  };
37236
+ default: return assertNever$22(source.newsletterBlockSubmission);
37231
37237
  }
37232
37238
  case "signed-footer": return {
37233
37239
  tag: "signed-footer-source",
@@ -37296,6 +37302,7 @@ function buildNewsletterFormInteractiveIslandProps(props) {
37296
37302
  const decoded = newsletterFormBlockRuntime.contracts.source.decode(props);
37297
37303
  const source = isDecodeSuccess(decoded) ? decoded.value : {
37298
37304
  ...props,
37305
+ ...props.source === "block" ? { newsletterBlockSubmission: { tag: "unavailable" } } : {},
37299
37306
  mailingList: void 0,
37300
37307
  targeting: { mode: "default" }
37301
37308
  };
@@ -37319,13 +37326,14 @@ function parseRequiredMailingListSignedSourceToken(value) {
37319
37326
  if (!parsed) throw new Error("Mailing-list signup signed source ref requires token");
37320
37327
  return parsed;
37321
37328
  }
37322
- var newsletterButtonVariantSchema, mailingListContextSchema, mailingListTargetingSchema, newsletterFieldSchema, mailingListSignupBlockIdSchema, mailingListContentVersionIdSchema, signedMailingListSourceTokenSchema, newsletterSourceCommonSchema, newsletterSourceSchema, newsletterDisplaySchema, newsletterHydrationSchema, newsletterRenderSchema, newsletterIslandMetaCodec, newsletterIslandMetaKeys, newsletterFormBlockRuntime, newsletterFormInteractiveIslandPropsCodec;
37329
+ var NEWSLETTER_SIGNUPS_PAUSED_MESSAGE, newsletterButtonVariantSchema, mailingListContextSchema, mailingListTargetingSchema, newsletterFieldSchema, mailingListSignupBlockIdSchema, mailingListContentVersionIdSchema, mailingListSignupBlockSourceRefSchema, signedMailingListSourceTokenSchema, newsletterSourceCommonSchema, newsletterSourceSchema, newsletterDisplaySchema, newsletterHydrationSchema, newsletterRenderSchema, newsletterIslandMetaCodec, newsletterIslandMetaKeys, newsletterFormBlockRuntime, newsletterFormInteractiveIslandPropsCodec;
37323
37330
  var init_newsletter_form_interactive = __esmMin((() => {
37324
37331
  init_src$2();
37325
37332
  init_islands();
37326
37333
  init_runtime();
37327
37334
  init_newsletter_form_types();
37328
37335
  init_buttonRoles();
37336
+ NEWSLETTER_SIGNUPS_PAUSED_MESSAGE = "We can’t accept signups right now. Please try again later.";
37329
37337
  newsletterButtonVariantSchema = blockButtonRoleSchema;
37330
37338
  mailingListContextSchema = z.unknown().transform((value, ctx) => {
37331
37339
  const parsed = parseMailingListRuntimeContext(value);
@@ -37366,6 +37374,11 @@ var init_newsletter_form_interactive = __esmMin((() => {
37366
37374
  });
37367
37375
  return z.NEVER;
37368
37376
  });
37377
+ mailingListSignupBlockSourceRefSchema = z.object({
37378
+ tag: z.literal("block_ref"),
37379
+ blockId: mailingListSignupBlockIdSchema,
37380
+ contentVersionId: mailingListContentVersionIdSchema
37381
+ });
37369
37382
  signedMailingListSourceTokenSchema = z.string().trim().min(1).transform(parseRequiredMailingListSignedSourceToken);
37370
37383
  newsletterSourceCommonSchema = z.object({
37371
37384
  siteId: z.string().optional(),
@@ -37380,7 +37393,15 @@ var init_newsletter_form_interactive = __esmMin((() => {
37380
37393
  newsletterSourceCommonSchema.extend({
37381
37394
  source: z.literal("block"),
37382
37395
  blockId: z.string().nullable().optional(),
37383
- contentVersionId: z.string().nullable().optional()
37396
+ newsletterBlockSubmission: z.discriminatedUnion("tag", [
37397
+ z.object({
37398
+ tag: z.literal("ready"),
37399
+ sourceRef: mailingListSignupBlockSourceRefSchema
37400
+ }),
37401
+ z.object({ tag: z.literal("unpublished-form") }),
37402
+ z.object({ tag: z.literal("unpublished-settings") }),
37403
+ z.object({ tag: z.literal("unavailable") })
37404
+ ])
37384
37405
  }),
37385
37406
  newsletterSourceCommonSchema.extend({
37386
37407
  source: z.literal("signed-footer"),
@@ -37409,11 +37430,7 @@ var init_newsletter_form_interactive = __esmMin((() => {
37409
37430
  target: z.discriminatedUnion("tag", [
37410
37431
  z.object({
37411
37432
  tag: z.literal("block-source"),
37412
- sourceRef: z.object({
37413
- tag: z.literal("block_ref"),
37414
- blockId: mailingListSignupBlockIdSchema,
37415
- contentVersionId: mailingListContentVersionIdSchema
37416
- }).nullable()
37433
+ sourceRef: mailingListSignupBlockSourceRefSchema.nullable()
37417
37434
  }),
37418
37435
  z.object({
37419
37436
  tag: z.literal("signed-footer-source"),
@@ -37422,7 +37439,11 @@ var init_newsletter_form_interactive = __esmMin((() => {
37422
37439
  token: signedMailingListSourceTokenSchema
37423
37440
  })
37424
37441
  }),
37425
- z.object({ tag: z.literal("preview") })
37442
+ z.object({ tag: z.literal("preview") }),
37443
+ z.object({
37444
+ tag: z.literal("unpublished-preview"),
37445
+ reason: z.enum(["unpublished-form", "unpublished-settings"])
37446
+ })
37426
37447
  ]),
37427
37448
  setupRevision: z.number().int().positive().nullable(),
37428
37449
  choiceProvider: z.enum([
@@ -39923,10 +39944,167 @@ function FeedbackMessage({ tone, treatment = "panel", children, className, id, t
39923
39944
  }
39924
39945
  var init_FeedbackMessage = __esmMin((() => {}));
39925
39946
  //#endregion
39947
+ //#region ../blocks/src/system/runtime/shared/components/CheckboxChoice.tsx
39948
+ /**
39949
+ * The customer-facing checkbox every block renders. Styling comes from the
39950
+ * theme's input CSS (`.form-check`, `.form-checkbox`), so it follows each
39951
+ * site's input colours, borders and corners.
39952
+ */
39953
+ function CheckboxChoice({ label, presentation = "row", className, ...inputProps }) {
39954
+ return /* @__PURE__ */ jsxs("label", {
39955
+ className: clsx("form-check", presentation === "tile" && "form-check--tile", className),
39956
+ children: [/* @__PURE__ */ jsx("input", {
39957
+ ...inputProps,
39958
+ type: "checkbox",
39959
+ className: "form-checkbox"
39960
+ }), /* @__PURE__ */ jsx("span", {
39961
+ className: "form-check-label",
39962
+ children: label
39963
+ })]
39964
+ });
39965
+ }
39966
+ var init_CheckboxChoice = __esmMin((() => {
39967
+ init_clsx();
39968
+ }));
39969
+ //#endregion
39970
+ //#region ../blocks/src/system/runtime/nodes/form.fields.tsx
39971
+ function fieldBasics(field) {
39972
+ return {
39973
+ inputId: `f_${field.id}`,
39974
+ label: String(field.label ?? field.id),
39975
+ required: Boolean(field.required)
39976
+ };
39977
+ }
39978
+ function textInputType(type) {
39979
+ return type === "email" || type === "url" || type === "tel" || type === "number" ? type : "text";
39980
+ }
39981
+ function textInputConstraints(field, inputType) {
39982
+ if (inputType === "number") return {
39983
+ ...typeof field.min === "number" ? { min: field.min } : {},
39984
+ ...typeof field.max === "number" ? { max: field.max } : {}
39985
+ };
39986
+ return {
39987
+ ...typeof field.minLength === "number" ? { minLength: field.minLength } : {},
39988
+ ...typeof field.maxLength === "number" ? { maxLength: field.maxLength } : {},
39989
+ ...typeof field.pattern === "string" && field.pattern ? { pattern: field.pattern } : {}
39990
+ };
39991
+ }
39992
+ function LabelledField({ basics, children }) {
39993
+ return /* @__PURE__ */ jsxs("div", {
39994
+ className: "fb-field",
39995
+ children: [/* @__PURE__ */ jsx("label", {
39996
+ htmlFor: basics.inputId,
39997
+ className: "form-label",
39998
+ children: basics.label
39999
+ }), children]
40000
+ });
40001
+ }
40002
+ function TextareaField({ field }) {
40003
+ const basics = fieldBasics(field);
40004
+ return /* @__PURE__ */ jsx(LabelledField, {
40005
+ basics,
40006
+ children: /* @__PURE__ */ jsx("textarea", {
40007
+ id: basics.inputId,
40008
+ name: field.id,
40009
+ required: basics.required,
40010
+ placeholder: field.placeholder,
40011
+ rows: field.rows,
40012
+ className: "form-textarea"
40013
+ })
40014
+ });
40015
+ }
40016
+ function SelectField({ field }) {
40017
+ const basics = fieldBasics(field);
40018
+ const options = field.options ?? [];
40019
+ const multiple = Boolean(field.multiple);
40020
+ return /* @__PURE__ */ jsx(LabelledField, {
40021
+ basics,
40022
+ children: /* @__PURE__ */ jsxs("select", {
40023
+ id: basics.inputId,
40024
+ name: field.id,
40025
+ multiple,
40026
+ required: basics.required,
40027
+ className: "form-select",
40028
+ children: [!multiple && /* @__PURE__ */ jsx("option", {
40029
+ value: "",
40030
+ children: "Select…"
40031
+ }), options.map((opt) => /* @__PURE__ */ jsx("option", {
40032
+ value: opt.value,
40033
+ children: opt.label
40034
+ }, opt.value))]
40035
+ })
40036
+ });
40037
+ }
40038
+ function RadioField({ field }) {
40039
+ const basics = fieldBasics(field);
40040
+ const options = field.options ?? [];
40041
+ return /* @__PURE__ */ jsxs("fieldset", {
40042
+ className: "fb-fieldset",
40043
+ children: [/* @__PURE__ */ jsx("legend", {
40044
+ className: "form-label",
40045
+ children: basics.label
40046
+ }), options.map((opt) => /* @__PURE__ */ jsxs("label", {
40047
+ className: "form-check",
40048
+ children: [/* @__PURE__ */ jsx("input", {
40049
+ type: "radio",
40050
+ name: field.id,
40051
+ value: opt.value,
40052
+ required: basics.required,
40053
+ className: "form-radio"
40054
+ }), /* @__PURE__ */ jsx("span", {
40055
+ className: "form-check-label",
40056
+ children: opt.label
40057
+ })]
40058
+ }, opt.value))]
40059
+ });
40060
+ }
40061
+ function TextInputField({ field, type }) {
40062
+ const basics = fieldBasics(field);
40063
+ const inputType = textInputType(type);
40064
+ return /* @__PURE__ */ jsx(LabelledField, {
40065
+ basics,
40066
+ children: /* @__PURE__ */ jsx("input", {
40067
+ id: basics.inputId,
40068
+ name: field.id,
40069
+ type: inputType,
40070
+ required: basics.required,
40071
+ placeholder: field.placeholder,
40072
+ ...textInputConstraints(field, inputType),
40073
+ className: "form-input"
40074
+ })
40075
+ });
40076
+ }
40077
+ function FormFieldControl({ field }) {
40078
+ const type = String(field.type ?? "text");
40079
+ switch (type) {
40080
+ case "textarea": return /* @__PURE__ */ jsx(TextareaField, { field });
40081
+ case "select": return /* @__PURE__ */ jsx(SelectField, { field });
40082
+ case "radio": return /* @__PURE__ */ jsx(RadioField, { field });
40083
+ case "checkbox":
40084
+ case "consent": {
40085
+ const basics = fieldBasics(field);
40086
+ return /* @__PURE__ */ jsx(CheckboxChoice, {
40087
+ name: field.id,
40088
+ required: basics.required,
40089
+ label: basics.label,
40090
+ presentation: type === "consent" ? "tile" : "row"
40091
+ });
40092
+ }
40093
+ default: return /* @__PURE__ */ jsx(TextInputField, {
40094
+ field,
40095
+ type
40096
+ });
40097
+ }
40098
+ }
40099
+ var init_form_fields = __esmMin((() => {
40100
+ init_CheckboxChoice();
40101
+ }));
40102
+ //#endregion
39926
40103
  //#region ../blocks/src/system/runtime/nodes/form.server.tsx
39927
40104
  init_clsx();
39928
40105
  init_ThemedButton();
39929
40106
  init_FeedbackMessage();
40107
+ init_form_fields();
39930
40108
  init_form_interactive();
39931
40109
  const FormNodeSSR = ({ blockId, value, submitLabel, successMessage, className, onSubmit, action = "/api/forms/submit", siteId, apiBaseUrl, spamProtectionEnabled }) => {
39932
40110
  const islandProps = buildFormInteractiveIslandProps({
@@ -39950,107 +40128,7 @@ const FormNodeSSR = ({ blockId, value, submitLabel, successMessage, className, o
39950
40128
  })]
39951
40129
  });
39952
40130
  const groups = display.groups;
39953
- const renderField = (field) => {
39954
- const inputId = `f_${field.id}`;
39955
- const label = String(field.label ?? field.id);
39956
- const required = Boolean(field.required);
39957
- const type = String(field.type ?? "text");
39958
- if (type === "textarea") return /* @__PURE__ */ jsxs("div", {
39959
- className: "fb-field",
39960
- children: [/* @__PURE__ */ jsx("label", {
39961
- htmlFor: inputId,
39962
- className: "form-label",
39963
- children: label
39964
- }), /* @__PURE__ */ jsx("textarea", {
39965
- id: inputId,
39966
- name: field.id,
39967
- required,
39968
- placeholder: field.placeholder,
39969
- rows: field.rows,
39970
- className: "form-textarea"
39971
- })]
39972
- }, field.id);
39973
- if (type === "select") {
39974
- const options = field.options ?? [];
39975
- const multiple = Boolean(field.multiple);
39976
- return /* @__PURE__ */ jsxs("div", {
39977
- className: "fb-field",
39978
- children: [/* @__PURE__ */ jsx("label", {
39979
- htmlFor: inputId,
39980
- className: "form-label",
39981
- children: label
39982
- }), /* @__PURE__ */ jsxs("select", {
39983
- id: inputId,
39984
- name: field.id,
39985
- multiple,
39986
- required,
39987
- className: "form-select",
39988
- children: [!multiple && /* @__PURE__ */ jsx("option", {
39989
- value: "",
39990
- children: "Select…"
39991
- }), options.map((opt) => /* @__PURE__ */ jsx("option", {
39992
- value: opt.value,
39993
- children: opt.label
39994
- }, opt.value))]
39995
- })]
39996
- }, field.id);
39997
- }
39998
- if (type === "radio") {
39999
- const options = field.options ?? [];
40000
- return /* @__PURE__ */ jsxs("fieldset", {
40001
- className: "fb-fieldset",
40002
- children: [/* @__PURE__ */ jsx("legend", {
40003
- className: "form-label",
40004
- children: label
40005
- }), options.map((opt) => /* @__PURE__ */ jsxs("label", {
40006
- className: "fb-inline form-label",
40007
- children: [/* @__PURE__ */ jsx("input", {
40008
- type: "radio",
40009
- name: field.id,
40010
- value: opt.value,
40011
- required,
40012
- className: "form-radio"
40013
- }), /* @__PURE__ */ jsx("span", { children: opt.label })]
40014
- }, opt.value))]
40015
- }, field.id);
40016
- }
40017
- if (type === "checkbox" || type === "consent") return /* @__PURE__ */ jsxs("label", {
40018
- className: "fb-inline form-label",
40019
- children: [/* @__PURE__ */ jsx("input", {
40020
- type: "checkbox",
40021
- name: field.id,
40022
- required,
40023
- className: "form-checkbox"
40024
- }), /* @__PURE__ */ jsx("span", { children: label })]
40025
- }, field.id);
40026
- const inputType = type === "email" || type === "url" || type === "tel" || type === "number" ? type : "text";
40027
- const extra = {};
40028
- if (inputType === "text" || inputType === "email" || inputType === "url" || inputType === "tel") {
40029
- if (typeof field.minLength === "number") extra.minLength = field.minLength;
40030
- if (typeof field.maxLength === "number") extra.maxLength = field.maxLength;
40031
- if (typeof field.pattern === "string" && field.pattern) extra.pattern = field.pattern;
40032
- }
40033
- if (inputType === "number") {
40034
- if (typeof field.min === "number") extra.min = field.min;
40035
- if (typeof field.max === "number") extra.max = field.max;
40036
- }
40037
- return /* @__PURE__ */ jsxs("div", {
40038
- className: "fb-field",
40039
- children: [/* @__PURE__ */ jsx("label", {
40040
- htmlFor: inputId,
40041
- className: "form-label",
40042
- children: label
40043
- }), /* @__PURE__ */ jsx("input", {
40044
- id: inputId,
40045
- name: field.id,
40046
- type: inputType,
40047
- required,
40048
- placeholder: field.placeholder,
40049
- ...extra,
40050
- className: "form-input"
40051
- })]
40052
- }, field.id);
40053
- };
40131
+ const renderField = (field) => /* @__PURE__ */ jsx(FormFieldControl, { field }, field.id);
40054
40132
  return /* @__PURE__ */ jsxs("div", {
40055
40133
  ...getIslandRootProps("form", blockId),
40056
40134
  children: [/* @__PURE__ */ jsx(IslandPropsScript, { value: islandProps }), /* @__PURE__ */ jsxs("form", {
@@ -40096,9 +40174,173 @@ const FormNodeSSR = ({ blockId, value, submitLabel, successMessage, className, o
40096
40174
  });
40097
40175
  };
40098
40176
  //#endregion
40177
+ //#region ../blocks/src/system/runtime/shared/components/FieldValidationMessage.tsx
40178
+ function getFieldValidationControlProps({ message, messageId, describedBy }) {
40179
+ const hasMessage = Boolean(message);
40180
+ const ariaDescribedBy = [describedBy, hasMessage ? messageId : void 0].filter((part) => typeof part === "string" && part.length > 0).join(" ");
40181
+ return {
40182
+ "aria-invalid": hasMessage ? "true" : void 0,
40183
+ "aria-describedby": ariaDescribedBy || void 0
40184
+ };
40185
+ }
40186
+ function FieldValidationMessage({ id, children, className, live = "assertive" }) {
40187
+ return /* @__PURE__ */ jsx("p", {
40188
+ id,
40189
+ className,
40190
+ "data-field-validation-message": true,
40191
+ "data-field-validation-tone": "error",
40192
+ role: "alert",
40193
+ "aria-live": live === "off" ? void 0 : live,
40194
+ children
40195
+ });
40196
+ }
40197
+ var init_FieldValidationMessage = __esmMin((() => {}));
40198
+ //#endregion
40199
+ //#region ../blocks/src/system/runtime/nodes/newsletter-form.parts.tsx
40200
+ /** Splits the preset's fields into the email (joined with the button) and the rest. */
40201
+ function partitionNewsletterFields(fields) {
40202
+ const email = fields.find((field) => field.type === "email") ?? null;
40203
+ return {
40204
+ email,
40205
+ extra: fields.filter((field) => field !== email)
40206
+ };
40207
+ }
40208
+ function NewsletterExtraField({ field, disabled, error }) {
40209
+ const inputId = inputIdFor(field);
40210
+ const errorId = `${inputId}-error`;
40211
+ return /* @__PURE__ */ jsxs("div", {
40212
+ className: "fb-field newsletter-field",
40213
+ children: [
40214
+ /* @__PURE__ */ jsx("label", {
40215
+ htmlFor: inputId,
40216
+ className: "rb-sr-only",
40217
+ children: field.label
40218
+ }),
40219
+ /* @__PURE__ */ jsx("input", {
40220
+ id: inputId,
40221
+ name: field.id,
40222
+ type: field.type,
40223
+ required: field.required,
40224
+ placeholder: field.placeholder ?? field.label,
40225
+ className: "form-input",
40226
+ disabled,
40227
+ ...getFieldValidationControlProps({
40228
+ message: error,
40229
+ messageId: errorId
40230
+ })
40231
+ }),
40232
+ error ? /* @__PURE__ */ jsx(FieldValidationMessage, {
40233
+ id: errorId,
40234
+ className: "fb-error",
40235
+ children: error
40236
+ }) : null
40237
+ ]
40238
+ });
40239
+ }
40240
+ /** The email field and submit button sharing one input-styled shell. */
40241
+ function NewsletterEmailEntry({ field, buttonVariant, buttonLabel, disabled, error }) {
40242
+ const inputId = inputIdFor(field);
40243
+ const errorId = `${inputId}-error`;
40244
+ return /* @__PURE__ */ jsxs("div", {
40245
+ className: "newsletter-entry",
40246
+ children: [/* @__PURE__ */ jsxs("div", {
40247
+ className: "form-input-group newsletter-entry-group",
40248
+ children: [
40249
+ /* @__PURE__ */ jsx("label", {
40250
+ htmlFor: inputId,
40251
+ className: "rb-sr-only",
40252
+ children: field.label
40253
+ }),
40254
+ /* @__PURE__ */ jsx("input", {
40255
+ id: inputId,
40256
+ name: field.id,
40257
+ type: "email",
40258
+ required: field.required,
40259
+ placeholder: field.placeholder ?? field.label,
40260
+ className: "form-input-group-field",
40261
+ autoComplete: "email",
40262
+ disabled,
40263
+ ...getFieldValidationControlProps({
40264
+ message: error,
40265
+ messageId: errorId
40266
+ })
40267
+ }),
40268
+ /* @__PURE__ */ jsx(ThemedButton, {
40269
+ type: "submit",
40270
+ variant: buttonVariant,
40271
+ size: "md",
40272
+ disabled,
40273
+ label: buttonLabel
40274
+ })
40275
+ ]
40276
+ }), error ? /* @__PURE__ */ jsx(FieldValidationMessage, {
40277
+ id: errorId,
40278
+ className: "fb-error",
40279
+ children: error
40280
+ }) : null]
40281
+ });
40282
+ }
40283
+ /**
40284
+ * The submit action: joined to the email field when the preset has one
40285
+ * (every current preset does), otherwise a plain themed button.
40286
+ */
40287
+ function NewsletterSubmitRow({ emailField, buttonVariant, buttonLabel, disabled, error }) {
40288
+ if (emailField) return /* @__PURE__ */ jsx(NewsletterEmailEntry, {
40289
+ field: emailField,
40290
+ buttonVariant,
40291
+ buttonLabel,
40292
+ disabled,
40293
+ error
40294
+ });
40295
+ return /* @__PURE__ */ jsx("div", {
40296
+ className: "newsletter-submit",
40297
+ children: /* @__PURE__ */ jsx(ThemedButton, {
40298
+ type: "submit",
40299
+ variant: buttonVariant,
40300
+ size: "md",
40301
+ disabled,
40302
+ label: buttonLabel
40303
+ })
40304
+ });
40305
+ }
40306
+ /** Visitor-chosen topics as toggle chips. Real checkboxes underneath. */
40307
+ function NewsletterTopicChips({ choices, disabled, error }) {
40308
+ const errorId = `newsletter_${TOPIC_CHOICE_FIELD_ID}-error`;
40309
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("fieldset", {
40310
+ className: "newsletter-topics",
40311
+ "aria-describedby": error ? errorId : void 0,
40312
+ children: [/* @__PURE__ */ jsx("legend", {
40313
+ className: "newsletter-topics-legend",
40314
+ children: "What would you like to hear about?"
40315
+ }), /* @__PURE__ */ jsx("div", {
40316
+ className: "newsletter-topic-chips",
40317
+ children: choices.map((choice) => /* @__PURE__ */ jsxs("label", {
40318
+ className: "newsletter-topic-chip",
40319
+ children: [/* @__PURE__ */ jsx("input", {
40320
+ type: "checkbox",
40321
+ name: TOPIC_CHOICE_FIELD_ID,
40322
+ value: choice.id,
40323
+ disabled
40324
+ }), /* @__PURE__ */ jsx("span", { children: choice.label })]
40325
+ }, choice.id))
40326
+ })]
40327
+ }), error ? /* @__PURE__ */ jsx(FieldValidationMessage, {
40328
+ id: errorId,
40329
+ className: "fb-error",
40330
+ children: error
40331
+ }) : null] });
40332
+ }
40333
+ var TOPIC_CHOICE_FIELD_ID, inputIdFor;
40334
+ var init_newsletter_form_parts = __esmMin((() => {
40335
+ init_ThemedButton();
40336
+ init_FieldValidationMessage();
40337
+ TOPIC_CHOICE_FIELD_ID = "mailingListChoice";
40338
+ inputIdFor = (field) => `newsletter_${field.id}`;
40339
+ }));
40340
+ //#endregion
40099
40341
  //#region ../blocks/src/system/runtime/nodes/newsletter-form.server.tsx
40100
40342
  init_clsx();
40101
- init_ThemedButton();
40343
+ init_newsletter_form_parts();
40102
40344
  init_newsletter_form_interactive();
40103
40345
  /**
40104
40346
  * Newsletter Form Server Component
@@ -40119,36 +40361,15 @@ function NewsletterFormSSR(props) {
40119
40361
  });
40120
40362
  const display = islandProps.render.display;
40121
40363
  const fields = display.fields;
40364
+ const submissionMessage = newsletterBlockSubmissionMessage(islandProps.render.hydration.target);
40122
40365
  if (display.availability === "unavailable") return /* @__PURE__ */ jsx("div", {
40123
40366
  className: clsx("newsletter-form-ssr", className),
40124
40367
  children: /* @__PURE__ */ jsx("p", {
40125
40368
  role: "status",
40126
- children: "We can’t accept signups right now. Please try again later."
40369
+ children: NEWSLETTER_SIGNUPS_PAUSED_MESSAGE
40127
40370
  })
40128
40371
  });
40129
- const renderField = (field) => {
40130
- const inputId = `newsletter_${field.id}`;
40131
- return /* @__PURE__ */ jsxs("div", {
40132
- className: "fb-field newsletter-field",
40133
- children: [/* @__PURE__ */ jsxs("label", {
40134
- htmlFor: inputId,
40135
- className: "form-label",
40136
- children: [field.label, field.required && /* @__PURE__ */ jsx("span", {
40137
- className: "newsletter-required",
40138
- "aria-hidden": "true",
40139
- children: "*"
40140
- })]
40141
- }), /* @__PURE__ */ jsx("input", {
40142
- id: inputId,
40143
- name: field.id,
40144
- type: field.type,
40145
- required: field.required,
40146
- placeholder: field.placeholder,
40147
- className: "form-input",
40148
- autoComplete: field.type === "email" ? "email" : void 0
40149
- })]
40150
- }, field.id);
40151
- };
40372
+ const { email: emailField, extra: extraFields } = partitionNewsletterFields(fields);
40152
40373
  return /* @__PURE__ */ jsxs("div", {
40153
40374
  ...getIslandRootProps("newsletter-form", blockId),
40154
40375
  className: clsx("newsletter-form-ssr", className),
@@ -40167,30 +40388,20 @@ function NewsletterFormSSR(props) {
40167
40388
  /* @__PURE__ */ jsxs("div", {
40168
40389
  className: "newsletter-form-fields",
40169
40390
  children: [
40170
- fields.map(renderField),
40171
- islandProps.render.hydration.choicePresentation === "visitor_choice" ? /* @__PURE__ */ jsxs("fieldset", {
40172
- className: "fb-fieldset newsletter-topics",
40173
- children: [/* @__PURE__ */ jsx("legend", {
40174
- className: "form-label",
40175
- children: "What would you like to hear about?"
40176
- }), display.choices.map((choice) => /* @__PURE__ */ jsxs("label", {
40177
- className: "fb-inline form-label newsletter-topic-choice",
40178
- children: [/* @__PURE__ */ jsx("input", {
40179
- type: "checkbox",
40180
- name: "mailingListChoice",
40181
- value: choice.id,
40182
- className: "form-checkbox"
40183
- }), /* @__PURE__ */ jsx("span", { children: choice.label })]
40184
- }, choice.id))]
40391
+ islandProps.render.hydration.choicePresentation === "visitor_choice" ? /* @__PURE__ */ jsx(NewsletterTopicChips, { choices: display.choices }) : null,
40392
+ extraFields.length > 0 ? /* @__PURE__ */ jsx("div", {
40393
+ className: "newsletter-extra-fields",
40394
+ children: extraFields.map((field) => /* @__PURE__ */ jsx(NewsletterExtraField, { field }, field.id))
40185
40395
  }) : null,
40186
- /* @__PURE__ */ jsx("div", {
40187
- className: "newsletter-submit",
40188
- children: /* @__PURE__ */ jsx(ThemedButton, {
40189
- type: "submit",
40190
- variant: display.buttonVariant,
40191
- size: "md",
40192
- label: display.buttonLabel
40193
- })
40396
+ /* @__PURE__ */ jsx(NewsletterSubmitRow, {
40397
+ emailField,
40398
+ buttonVariant: display.buttonVariant,
40399
+ buttonLabel: display.buttonLabel,
40400
+ disabled: submissionMessage !== null
40401
+ }),
40402
+ submissionMessage && /* @__PURE__ */ jsx("p", {
40403
+ role: "status",
40404
+ children: submissionMessage
40194
40405
  })
40195
40406
  ]
40196
40407
  }),
@@ -45977,28 +46188,6 @@ var init_DiscountCodeDisclosure = __esmMin((() => {
45977
46188
  };
45978
46189
  }));
45979
46190
  //#endregion
45980
- //#region ../blocks/src/system/runtime/shared/components/FieldValidationMessage.tsx
45981
- function getFieldValidationControlProps({ message, messageId, describedBy }) {
45982
- const hasMessage = Boolean(message);
45983
- const ariaDescribedBy = [describedBy, hasMessage ? messageId : void 0].filter((part) => typeof part === "string" && part.length > 0).join(" ");
45984
- return {
45985
- "aria-invalid": hasMessage ? "true" : void 0,
45986
- "aria-describedby": ariaDescribedBy || void 0
45987
- };
45988
- }
45989
- function FieldValidationMessage({ id, children, className, live = "assertive" }) {
45990
- return /* @__PURE__ */ jsx("p", {
45991
- id,
45992
- className,
45993
- "data-field-validation-message": true,
45994
- "data-field-validation-tone": "error",
45995
- role: "alert",
45996
- "aria-live": live === "off" ? void 0 : live,
45997
- children
45998
- });
45999
- }
46000
- var init_FieldValidationMessage = __esmMin((() => {}));
46001
- //#endregion
46002
46191
  //#region ../blocks/src/system/runtime/shared/components/BookingConsentAgreement.tsx
46003
46192
  function BookingConsentAgreement({ agreement, showTitle = true, title, titleId }) {
46004
46193
  return /* @__PURE__ */ jsxs(Fragment, { children: [showTitle ? /* @__PURE__ */ jsxs("div", {
@@ -46613,7 +46802,7 @@ function DefaultFieldInput({ describedBy, error, errorId, field, onBlur, onChang
46613
46802
  case "radio": return /* @__PURE__ */ jsx("div", {
46614
46803
  className: "rb-space-y-2",
46615
46804
  children: field.field.options?.map((option) => /* @__PURE__ */ jsxs("label", {
46616
- className: "rb-flex rb-items-center rb-gap-2 rb-cursor-pointer",
46805
+ className: "form-check",
46617
46806
  children: [/* @__PURE__ */ jsx("input", {
46618
46807
  type: "radio",
46619
46808
  name: field.id,
@@ -46625,7 +46814,7 @@ function DefaultFieldInput({ describedBy, error, errorId, field, onBlur, onChang
46625
46814
  ...validationProps,
46626
46815
  className: "form-radio"
46627
46816
  }), /* @__PURE__ */ jsx("span", {
46628
- className: "rb-caption",
46817
+ className: "form-check-label",
46629
46818
  children: option.label
46630
46819
  })]
46631
46820
  }, option.value))
@@ -46635,47 +46824,20 @@ function DefaultFieldInput({ describedBy, error, errorId, field, onBlur, onChang
46635
46824
  const checkedValues = toStringArray(value);
46636
46825
  return /* @__PURE__ */ jsx("div", {
46637
46826
  className: "rb-space-y-2",
46638
- children: field.field.options.map((option) => /* @__PURE__ */ jsxs("label", {
46639
- className: "rb-flex rb-items-center rb-gap-2 rb-cursor-pointer",
46640
- children: [/* @__PURE__ */ jsx("input", {
46641
- type: "checkbox",
46642
- name: field.id,
46643
- value: option.value,
46644
- checked: checkedValues.includes(option.value),
46645
- onChange: (event) => {
46646
- onChange(event.target.checked ? [...checkedValues, option.value] : checkedValues.filter((item) => item !== option.value));
46647
- },
46648
- onBlur,
46649
- ...validationProps,
46650
- className: "form-checkbox"
46651
- }), /* @__PURE__ */ jsx("span", {
46652
- className: "rb-caption",
46653
- children: option.label
46654
- })]
46827
+ children: field.field.options.map((option) => /* @__PURE__ */ jsx(CheckboxChoice, {
46828
+ name: field.id,
46829
+ value: option.value,
46830
+ checked: checkedValues.includes(option.value),
46831
+ onChange: (event) => {
46832
+ onChange(event.target.checked ? [...checkedValues, option.value] : checkedValues.filter((item) => item !== option.value));
46833
+ },
46834
+ onBlur,
46835
+ ...validationProps,
46836
+ label: option.label
46655
46837
  }, option.value))
46656
46838
  });
46657
46839
  }
46658
- return /* @__PURE__ */ jsxs("label", {
46659
- className: "rb-flex rb-items-center rb-gap-2 rb-cursor-pointer",
46660
- children: [/* @__PURE__ */ jsx("input", {
46661
- type: "checkbox",
46662
- id: field.inputId,
46663
- name: field.id,
46664
- checked: Boolean(value),
46665
- onChange: (event) => onChange(event.target.checked),
46666
- onBlur,
46667
- required: field.required,
46668
- ...validationProps,
46669
- className: "form-checkbox"
46670
- }), /* @__PURE__ */ jsx("span", {
46671
- className: "rb-caption",
46672
- children: field.field.placeholder || field.label
46673
- })]
46674
- });
46675
- case "booking_requirement_consent": return /* @__PURE__ */ jsxs("label", {
46676
- className: "rb-flex rb-items-start rb-gap-2 rb-cursor-pointer",
46677
- children: [/* @__PURE__ */ jsx("input", {
46678
- type: "checkbox",
46840
+ return /* @__PURE__ */ jsx(CheckboxChoice, {
46679
46841
  id: field.inputId,
46680
46842
  name: field.id,
46681
46843
  checked: Boolean(value),
@@ -46683,11 +46845,18 @@ function DefaultFieldInput({ describedBy, error, errorId, field, onBlur, onChang
46683
46845
  onBlur,
46684
46846
  required: field.required,
46685
46847
  ...validationProps,
46686
- className: "form-checkbox rb-mt-0.5"
46687
- }), /* @__PURE__ */ jsx("span", {
46688
- className: "rb-caption",
46689
- children: field.field.checkboxLabel
46690
- })]
46848
+ label: field.field.placeholder || field.label
46849
+ });
46850
+ case "booking_requirement_consent": return /* @__PURE__ */ jsx(CheckboxChoice, {
46851
+ id: field.inputId,
46852
+ name: field.id,
46853
+ checked: Boolean(value),
46854
+ onChange: (event) => onChange(event.target.checked),
46855
+ onBlur,
46856
+ required: field.required,
46857
+ ...validationProps,
46858
+ label: field.field.checkboxLabel,
46859
+ presentation: "tile"
46691
46860
  });
46692
46861
  case "number": return /* @__PURE__ */ jsx("input", {
46693
46862
  ...commonProps,
@@ -46816,6 +46985,7 @@ var init_booking_form_default_ui = __esmMin((() => {
46816
46985
  init_DiscountCodeDisclosure();
46817
46986
  init_FieldValidationMessage();
46818
46987
  init_BookingConsentAgreement();
46988
+ init_CheckboxChoice();
46819
46989
  init_booking_form_service_choices();
46820
46990
  }));
46821
46991
  //#endregion
@@ -47282,6 +47452,7 @@ var init_SelectableOptionCard = __esmMin((() => {}));
47282
47452
  //#endregion
47283
47453
  //#region ../blocks/src/system/runtime/shared/components/index.ts
47284
47454
  var init_components = __esmMin((() => {
47455
+ init_CheckboxChoice();
47285
47456
  init_CheckIcon$1();
47286
47457
  init_ClockIcon();
47287
47458
  init_CrossIcon();
@@ -52284,26 +52455,24 @@ function EventConsentField({ consent, error, formData, idBase, onChange }) {
52284
52455
  title: consent.title,
52285
52456
  titleId: `${idBase}-consent-title`
52286
52457
  }),
52287
- /* @__PURE__ */ jsxs("label", {
52288
- className: "er-label rb-flex rb-items-start rb-gap-2 rb-cursor-pointer",
52289
- children: [
52290
- /* @__PURE__ */ jsx("input", {
52291
- "aria-describedby": error ? errorId : void 0,
52292
- className: "form-checkbox rb-mt-0.5",
52293
- checked: formData.consentAccepted === true,
52294
- onChange: (event) => onChange({
52295
- ...formData,
52296
- consentAccepted: event.target.checked
52297
- }),
52298
- type: "checkbox"
52299
- }),
52458
+ /* @__PURE__ */ jsx(CheckboxChoice, {
52459
+ "aria-describedby": error ? errorId : void 0,
52460
+ "aria-invalid": error ? true : void 0,
52461
+ checked: formData.consentAccepted === true,
52462
+ onChange: (event) => onChange({
52463
+ ...formData,
52464
+ consentAccepted: event.target.checked
52465
+ }),
52466
+ label: /* @__PURE__ */ jsxs(Fragment, { children: [
52300
52467
  consent.checkboxLabel,
52301
52468
  " ",
52302
52469
  /* @__PURE__ */ jsx("span", {
52303
52470
  className: "er-required",
52304
52471
  children: "*"
52305
52472
  })
52306
- ]
52473
+ ] }),
52474
+ presentation: "tile",
52475
+ className: "er-consent-check"
52307
52476
  }),
52308
52477
  error ? /* @__PURE__ */ jsx(FieldValidationMessage, {
52309
52478
  id: errorId,
@@ -52339,6 +52508,7 @@ var init_AttendeeDetailsStep = __esmMin((() => {
52339
52508
  init_LoggedInAsUser();
52340
52509
  init_FieldValidationMessage();
52341
52510
  init_BookingConsentAgreement();
52511
+ init_CheckboxChoice();
52342
52512
  AttendeeDetailsStep = ({ formData, onChange, errors, emailLocked = false, onLogout, ticketsCount = 1, requireGuestDetails = false, guests = [], onGuestsChange, guestErrors = {}, guestSectionShake = false, onGuestShakeEnd, consent }) => {
52343
52513
  const idBase = useId();
52344
52514
  const nameId = `${idBase}-name`;
@@ -116725,6 +116895,7 @@ var init_form_client = __esmMin((() => {
116725
116895
  init_useFormSubmission();
116726
116896
  init_ThemedButton();
116727
116897
  init_FeedbackMessage();
116898
+ init_form_fields();
116728
116899
  FormNodeClient = ({ render }) => {
116729
116900
  const form = render.display.form;
116730
116901
  const { submit, state } = useFormSubmission();
@@ -116737,107 +116908,7 @@ var init_form_client = __esmMin((() => {
116737
116908
  children: "Missing or unknown form."
116738
116909
  });
116739
116910
  const groups = render.display.groups;
116740
- const renderField = (field) => {
116741
- const inputId = `f_${field.id}`;
116742
- const label = String(field.label ?? field.id);
116743
- const required = Boolean(field.required);
116744
- const type = String(field.type ?? "text");
116745
- if (type === "textarea") return /* @__PURE__ */ jsxs("div", {
116746
- className: "fb-field",
116747
- children: [/* @__PURE__ */ jsx("label", {
116748
- htmlFor: inputId,
116749
- className: "form-label",
116750
- children: label
116751
- }), /* @__PURE__ */ jsx("textarea", {
116752
- id: inputId,
116753
- name: field.id,
116754
- required,
116755
- placeholder: field.placeholder,
116756
- rows: field.rows,
116757
- className: "form-textarea"
116758
- })]
116759
- }, field.id);
116760
- if (type === "select") {
116761
- const options = field.options ?? [];
116762
- const multiple = Boolean(field.multiple);
116763
- return /* @__PURE__ */ jsxs("div", {
116764
- className: "fb-field",
116765
- children: [/* @__PURE__ */ jsx("label", {
116766
- htmlFor: inputId,
116767
- className: "form-label",
116768
- children: label
116769
- }), /* @__PURE__ */ jsxs("select", {
116770
- id: inputId,
116771
- name: field.id,
116772
- multiple,
116773
- required,
116774
- className: "form-select",
116775
- children: [!multiple && /* @__PURE__ */ jsx("option", {
116776
- value: "",
116777
- children: "Select…"
116778
- }), options.map((opt) => /* @__PURE__ */ jsx("option", {
116779
- value: opt.value,
116780
- children: opt.label
116781
- }, opt.value))]
116782
- })]
116783
- }, field.id);
116784
- }
116785
- if (type === "radio") {
116786
- const options = field.options ?? [];
116787
- return /* @__PURE__ */ jsxs("fieldset", {
116788
- className: "fb-fieldset",
116789
- children: [/* @__PURE__ */ jsx("legend", {
116790
- className: "form-label",
116791
- children: label
116792
- }), options.map((opt) => /* @__PURE__ */ jsxs("label", {
116793
- className: "fb-inline form-label",
116794
- children: [/* @__PURE__ */ jsx("input", {
116795
- type: "radio",
116796
- name: field.id,
116797
- value: opt.value,
116798
- required,
116799
- className: "form-radio"
116800
- }), /* @__PURE__ */ jsx("span", { children: opt.label })]
116801
- }, opt.value))]
116802
- }, field.id);
116803
- }
116804
- if (type === "checkbox" || type === "consent") return /* @__PURE__ */ jsxs("label", {
116805
- className: "fb-inline form-label",
116806
- children: [/* @__PURE__ */ jsx("input", {
116807
- type: "checkbox",
116808
- name: field.id,
116809
- required,
116810
- className: "form-checkbox"
116811
- }), /* @__PURE__ */ jsx("span", { children: label })]
116812
- }, field.id);
116813
- const inputType = type === "email" || type === "url" || type === "tel" || type === "number" ? type : "text";
116814
- const extra = {};
116815
- if (inputType === "text" || inputType === "email" || inputType === "url" || inputType === "tel") {
116816
- if (typeof field.minLength === "number") extra.minLength = field.minLength;
116817
- if (typeof field.maxLength === "number") extra.maxLength = field.maxLength;
116818
- if (typeof field.pattern === "string" && field.pattern) extra.pattern = field.pattern;
116819
- }
116820
- if (inputType === "number") {
116821
- if (typeof field.min === "number") extra.min = field.min;
116822
- if (typeof field.max === "number") extra.max = field.max;
116823
- }
116824
- return /* @__PURE__ */ jsxs("div", {
116825
- className: "fb-field",
116826
- children: [/* @__PURE__ */ jsx("label", {
116827
- htmlFor: inputId,
116828
- className: "form-label",
116829
- children: label
116830
- }), /* @__PURE__ */ jsx("input", {
116831
- id: inputId,
116832
- name: field.id,
116833
- type: inputType,
116834
- required,
116835
- placeholder: field.placeholder,
116836
- ...extra,
116837
- className: "form-input"
116838
- })]
116839
- }, field.id);
116840
- };
116911
+ const renderField = (field) => /* @__PURE__ */ jsx(FormFieldControl, { field }, field.id);
116841
116912
  const handleSubmit = async (e) => {
116842
116913
  e.preventDefault();
116843
116914
  const formData = new FormData(e.currentTarget);
@@ -117128,6 +117199,10 @@ function resolveNewsletterSubmitTarget(input) {
117128
117199
  tag: "unavailable",
117129
117200
  reason: "preview_only_source"
117130
117201
  };
117202
+ case "unpublished-preview": return {
117203
+ tag: "unavailable",
117204
+ reason: "preview_only_source"
117205
+ };
117131
117206
  default: return assertNever$22(input);
117132
117207
  }
117133
117208
  }
@@ -117150,6 +117225,7 @@ var init_newsletter_form_submission = __esmMin((() => {
117150
117225
  //#endregion
117151
117226
  //#region ../blocks/src/system/runtime/nodes/newsletter-form.client.tsx
117152
117227
  function NewsletterFormClient({ render }) {
117228
+ const submissionMessage = newsletterBlockSubmissionMessage(render.hydration.target);
117153
117229
  const api = useBlockApi();
117154
117230
  const [submissionState, dispatchSubmission] = useReducer(newsletterFormSubmissionReducer, initialNewsletterFormSubmissionState);
117155
117231
  const [altchaSolution, setAltchaSolution] = useState(null);
@@ -117159,7 +117235,6 @@ function NewsletterFormClient({ render }) {
117159
117235
  if (succeeded) successRef.current?.focus();
117160
117236
  }, [succeeded]);
117161
117237
  const showSpamProtection = render.hydration.spamProtectionEnabled ?? isSpamProtectionEnabled();
117162
- const fields = render.display.fields;
117163
117238
  const handleSubmit = async (e) => {
117164
117239
  e.preventDefault();
117165
117240
  const formData = new FormData(e.currentTarget);
@@ -117191,7 +117266,7 @@ function NewsletterFormClient({ render }) {
117191
117266
  reportNewsletterSignupRefusal(submitTarget.reason, { target: render.hydration.target });
117192
117267
  dispatchSubmission({
117193
117268
  type: "failed",
117194
- error: newsletterFormError(SIGNUPS_PAUSED_MESSAGE)
117269
+ error: newsletterFormError(NEWSLETTER_SIGNUPS_PAUSED_MESSAGE)
117195
117270
  });
117196
117271
  return;
117197
117272
  }
@@ -117199,7 +117274,7 @@ function NewsletterFormClient({ render }) {
117199
117274
  reportNewsletterSignupRefusal("setup_not_configured");
117200
117275
  dispatchSubmission({
117201
117276
  type: "failed",
117202
- error: newsletterFormError(SIGNUPS_PAUSED_MESSAGE)
117277
+ error: newsletterFormError(NEWSLETTER_SIGNUPS_PAUSED_MESSAGE)
117203
117278
  });
117204
117279
  return;
117205
117280
  }
@@ -117207,7 +117282,7 @@ function NewsletterFormClient({ render }) {
117207
117282
  reportNewsletterSignupRefusal("destination_unavailable", { setupRevision: render.hydration.setupRevision });
117208
117283
  dispatchSubmission({
117209
117284
  type: "failed",
117210
- error: newsletterFormError(SIGNUPS_PAUSED_MESSAGE)
117285
+ error: newsletterFormError(NEWSLETTER_SIGNUPS_PAUSED_MESSAGE)
117211
117286
  });
117212
117287
  return;
117213
117288
  }
@@ -117282,43 +117357,14 @@ function NewsletterFormClient({ render }) {
117282
117357
  autoComplete: "off",
117283
117358
  "aria-hidden": "true"
117284
117359
  }),
117285
- /* @__PURE__ */ jsxs("div", {
117286
- className: "newsletter-form-fields",
117287
- children: [
117288
- fields.map((field) => /* @__PURE__ */ jsx(NewsletterField, {
117289
- field,
117290
- submitting,
117291
- error: getNewsletterSubmissionFieldError(submissionState, field.id)
117292
- }, field.id)),
117293
- render.hydration.choicePresentation === "visitor_choice" ? /* @__PURE__ */ jsx(NewsletterTopicChoices, {
117294
- choices: render.display.choices,
117295
- submitting,
117296
- error: getNewsletterSubmissionFieldError(submissionState, TOPIC_CHOICE_FIELD_ID)
117297
- }) : null,
117298
- showSpamProtection && /* @__PURE__ */ jsx("div", {
117299
- className: "newsletter-altcha",
117300
- children: /* @__PURE__ */ jsx(AltchaWidget, {
117301
- challengeUrl: getChallengeUrl(),
117302
- onSolutionChange: setAltchaSolution
117303
- })
117304
- }),
117305
- formError && /* @__PURE__ */ jsx(FeedbackMessage, {
117306
- tone: "error",
117307
- className: "fb-error",
117308
- role: "alert",
117309
- children: formError
117310
- }),
117311
- /* @__PURE__ */ jsx("div", {
117312
- className: "newsletter-submit",
117313
- children: /* @__PURE__ */ jsx(ThemedButton, {
117314
- type: "submit",
117315
- variant: render.display.buttonVariant,
117316
- size: "md",
117317
- disabled: submitting,
117318
- label: submitting ? "Subscribing..." : render.display.buttonLabel
117319
- })
117320
- })
117321
- ]
117360
+ /* @__PURE__ */ jsx(NewsletterFormFields, {
117361
+ render,
117362
+ submissionState,
117363
+ submitting,
117364
+ submissionMessage,
117365
+ formError,
117366
+ showSpamProtection,
117367
+ onAltchaSolution: setAltchaSolution
117322
117368
  }),
117323
117369
  render.display.privacyNote && /* @__PURE__ */ jsx("p", {
117324
117370
  className: "newsletter-privacy-note",
@@ -117328,67 +117374,52 @@ function NewsletterFormClient({ render }) {
117328
117374
  })
117329
117375
  });
117330
117376
  }
117331
- function NewsletterField({ field, submitting, error }) {
117332
- const inputId = `newsletter_${field.id}`;
117333
- const errorId = `${inputId}-error`;
117377
+ function NewsletterFormFields({ render, submissionState, submitting, submissionMessage, formError, showSpamProtection, onAltchaSolution }) {
117378
+ const { email: emailField, extra: extraFields } = partitionNewsletterFields(render.display.fields);
117379
+ const fieldError = (id) => getNewsletterSubmissionFieldError(submissionState, id);
117334
117380
  return /* @__PURE__ */ jsxs("div", {
117335
- className: "fb-field newsletter-field",
117381
+ className: "newsletter-form-fields",
117336
117382
  children: [
117337
- /* @__PURE__ */ jsxs("label", {
117338
- htmlFor: inputId,
117339
- className: "form-label",
117340
- children: [field.label, field.required && /* @__PURE__ */ jsx("span", {
117341
- className: "newsletter-required",
117342
- "aria-hidden": "true",
117343
- children: "*"
117344
- })]
117345
- }),
117346
- /* @__PURE__ */ jsx("input", {
117347
- id: inputId,
117348
- name: field.id,
117349
- type: field.type,
117350
- required: field.required,
117351
- placeholder: field.placeholder,
117352
- className: "form-input",
117353
- autoComplete: field.type === "email" ? "email" : void 0,
117383
+ render.hydration.choicePresentation === "visitor_choice" ? /* @__PURE__ */ jsx(NewsletterTopicChips, {
117384
+ choices: render.display.choices,
117354
117385
  disabled: submitting,
117355
- ...getFieldValidationControlProps({
117356
- message: error,
117357
- messageId: errorId
117386
+ error: fieldError(TOPIC_CHOICE_FIELD_ID)
117387
+ }) : null,
117388
+ extraFields.length > 0 ? /* @__PURE__ */ jsx("div", {
117389
+ className: "newsletter-extra-fields",
117390
+ children: extraFields.map((field) => /* @__PURE__ */ jsx(NewsletterExtraField, {
117391
+ field,
117392
+ disabled: submitting,
117393
+ error: fieldError(field.id)
117394
+ }, field.id))
117395
+ }) : null,
117396
+ showSpamProtection && /* @__PURE__ */ jsx("div", {
117397
+ className: "newsletter-altcha",
117398
+ children: /* @__PURE__ */ jsx(AltchaWidget, {
117399
+ challengeUrl: getChallengeUrl(),
117400
+ onSolutionChange: onAltchaSolution
117358
117401
  })
117359
117402
  }),
117360
- error && /* @__PURE__ */ jsx(FieldValidationMessage, {
117361
- id: errorId,
117403
+ formError && /* @__PURE__ */ jsx(FeedbackMessage, {
117404
+ tone: "error",
117362
117405
  className: "fb-error",
117363
- children: error
117406
+ role: "alert",
117407
+ children: formError
117408
+ }),
117409
+ /* @__PURE__ */ jsx(NewsletterSubmitRow, {
117410
+ emailField,
117411
+ buttonVariant: render.display.buttonVariant,
117412
+ buttonLabel: submitting ? "Subscribing..." : render.display.buttonLabel,
117413
+ disabled: submitting || submissionMessage !== null,
117414
+ error: emailField ? fieldError(emailField.id) : null
117415
+ }),
117416
+ submissionMessage && /* @__PURE__ */ jsx("p", {
117417
+ role: "status",
117418
+ children: submissionMessage
117364
117419
  })
117365
117420
  ]
117366
117421
  });
117367
117422
  }
117368
- function NewsletterTopicChoices({ choices, submitting, error }) {
117369
- const errorId = `newsletter_${TOPIC_CHOICE_FIELD_ID}-error`;
117370
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("fieldset", {
117371
- className: "fb-fieldset newsletter-topics",
117372
- "aria-describedby": error ? errorId : void 0,
117373
- children: [/* @__PURE__ */ jsx("legend", {
117374
- className: "form-label",
117375
- children: "What would you like to hear about?"
117376
- }), choices.map((choice) => /* @__PURE__ */ jsxs("label", {
117377
- className: "fb-inline form-label newsletter-topic-choice",
117378
- children: [/* @__PURE__ */ jsx("input", {
117379
- type: "checkbox",
117380
- name: TOPIC_CHOICE_FIELD_ID,
117381
- value: choice.id,
117382
- className: "form-checkbox",
117383
- disabled: submitting
117384
- }), /* @__PURE__ */ jsx("span", { children: choice.label })]
117385
- }, choice.id))]
117386
- }), error && /* @__PURE__ */ jsx(FieldValidationMessage, {
117387
- id: errorId,
117388
- className: "fb-error",
117389
- children: error
117390
- })] });
117391
- }
117392
117423
  function UnavailableNewsletterForm({ className }) {
117393
117424
  return /* @__PURE__ */ jsx("div", {
117394
117425
  className: clsx("newsletter-form", className ?? void 0),
@@ -117396,7 +117427,7 @@ function UnavailableNewsletterForm({ className }) {
117396
117427
  tone: "error",
117397
117428
  className: "fb-error",
117398
117429
  role: "status",
117399
- children: SIGNUPS_PAUSED_MESSAGE
117430
+ children: NEWSLETTER_SIGNUPS_PAUSED_MESSAGE
117400
117431
  })
117401
117432
  });
117402
117433
  }
@@ -117416,7 +117447,7 @@ function transportFailureMessage(err) {
117416
117447
  function visitorSelectionError(selection) {
117417
117448
  switch (selection.tag) {
117418
117449
  case "nothing_chosen": return newsletterFieldError(TOPIC_CHOICE_FIELD_ID, "Choose at least one email topic.");
117419
- case "unusable": return newsletterFormError(SIGNUPS_PAUSED_MESSAGE);
117450
+ case "unusable": return newsletterFormError(NEWSLETTER_SIGNUPS_PAUSED_MESSAGE);
117420
117451
  case "not_offered":
117421
117452
  case "chosen": return null;
117422
117453
  }
@@ -117448,7 +117479,7 @@ function publicSignupError(outcome) {
117448
117479
  case "unavailable": switch (outcome.reason) {
117449
117480
  case "configuration_unavailable":
117450
117481
  case "authentication_failed":
117451
- case "target_unavailable": return SIGNUPS_PAUSED_MESSAGE;
117482
+ case "target_unavailable": return NEWSLETTER_SIGNUPS_PAUSED_MESSAGE;
117452
117483
  case "stale_configuration": return "This signup form has changed. Refresh the page, then try again.";
117453
117484
  case "rate_limited": return TOO_MANY_ATTEMPTS_MESSAGE;
117454
117485
  case "temporarily_unavailable": return RETRY_SHORTLY_MESSAGE;
@@ -117456,20 +117487,18 @@ function publicSignupError(outcome) {
117456
117487
  case "uncertain": return "We could not confirm whether your signup completed. Please wait a moment, then try again.";
117457
117488
  }
117458
117489
  }
117459
- var TOPIC_CHOICE_FIELD_ID, SIGNUPS_PAUSED_MESSAGE, RETRY_SHORTLY_MESSAGE, TOO_MANY_ATTEMPTS_MESSAGE;
117490
+ var RETRY_SHORTLY_MESSAGE, TOO_MANY_ATTEMPTS_MESSAGE;
117460
117491
  var init_newsletter_form_client = __esmMin((() => {
117461
117492
  init_clsx();
117462
117493
  init_client();
117463
117494
  init_src();
117464
117495
  init_api$1();
117465
117496
  init_src$2();
117466
- init_ThemedButton();
117467
117497
  init_FeedbackMessage();
117468
- init_FieldValidationMessage();
117498
+ init_newsletter_form_parts();
117469
117499
  init_newsletter_form_client_state();
117470
117500
  init_newsletter_form_submission();
117471
- TOPIC_CHOICE_FIELD_ID = "mailingListChoice";
117472
- SIGNUPS_PAUSED_MESSAGE = "We can’t accept signups right now. Please try again later.";
117501
+ init_newsletter_form_interactive();
117473
117502
  RETRY_SHORTLY_MESSAGE = "We couldn’t confirm your signup. Please try again in a little while.";
117474
117503
  TOO_MANY_ATTEMPTS_MESSAGE = "There have been too many signup attempts. Please wait a moment and try again.";
117475
117504
  }));
@@ -117697,6 +117726,10 @@ init_surfaces();
117697
117726
  //#region ../theme-core/src/accordions/defaults.ts
117698
117727
  init_curatedSiteStyles();
117699
117728
  //#endregion
117729
+ //#region ../theme-core/src/inputs/checkable.ts
117730
+ init_colorTokenParts();
117731
+ init_colorStyles();
117732
+ //#endregion
117700
117733
  //#region ../theme-core/src/inputs/generateInputCss.ts
117701
117734
  init_types$11();
117702
117735
  init_constants$2();