@riverbankcms/sdk 0.177.0 → 0.179.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 (225) hide show
  1. package/README.md +15 -8
  2. package/dist/_dts/{BlocksIslandsHydrator-sYraeqm9.d.ts → BlocksIslandsHydrator-DKwgs95u.d.ts} +1 -1
  3. package/dist/_dts/{Page-Bp7hTDTy.d.ts → Page-lWenra5i.d.ts} +7 -7
  4. package/dist/_dts/{SdkPreviewMode-CxkCCyKw.d.ts → SdkPreviewMode-BRxhRw4I.d.ts} +2 -2
  5. package/dist/_dts/{client-K6UhbL3t.d.ts → client-qWn7xAwJ.d.ts} +77 -23
  6. package/dist/_dts/{content-types-BLAdIMyr.d.ts → content-types-DL6GIvTm.d.ts} +2 -2
  7. package/dist/_dts/{contracts-BG7yTZ6t.d.ts → contracts-CzWyAiJj.d.ts} +6 -116
  8. package/dist/_dts/{generatePageMetadata-X_WpGzZZ.d.ts → generatePageMetadata-CBKd0cJ4.d.ts} +2 -2
  9. package/dist/_dts/{index--n-wV8Xd.d.ts → index-7CDBZGb-.d.ts} +1 -1
  10. package/dist/_dts/{index-Bygd2RCg.d.ts → index-BU9uAkHB.d.ts} +4 -4
  11. package/dist/_dts/{index-BMGif2r3.d.ts → index-BYnG_vF5.d.ts} +1 -1
  12. package/dist/_dts/{index-CBRbZJ6u.d.ts → index-CZgJrhzT.d.ts} +4 -2
  13. package/dist/_dts/{index-BLseXObg.d.ts → index-CaCum9mM.d.ts} +2 -2
  14. package/dist/_dts/{index-BpAW9AKB.d.ts → index-DCiSHd-C.d.ts} +1 -1
  15. package/dist/_dts/{index-CX9bp60k.d.ts → index-DVSipdrT.d.ts} +3 -3
  16. package/dist/_dts/{loadContent-uhUThWaq.d.ts → loadContent-CPKbFQyq.d.ts} +15 -13
  17. package/dist/_dts/{request-Bf9YImJw.d.ts → request-BjKBCS7t.d.ts} +1687 -373
  18. package/dist/_dts/{resolveBlockData-D6M5NMZB.d.ts → resolveBlockData-DupbMCup.d.ts} +8 -5
  19. package/dist/_dts/resolvePageContent-BqNyCHi8.d.ts +61 -0
  20. package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
  21. package/dist/_dts/sdk/src/client/types.d.ts +3 -3
  22. package/dist/_dts/sdk/src/client.d.ts +7 -7
  23. package/dist/_dts/sdk/src/config/index.d.ts +6 -6
  24. package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
  25. package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
  26. package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +2 -2
  27. package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
  28. package/dist/_dts/sdk/src/data/types.d.ts +7 -2
  29. package/dist/_dts/sdk/src/gifting/client.d.ts +1 -2
  30. package/dist/_dts/sdk/src/index.d.ts +8 -8
  31. package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
  32. package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
  33. package/dist/_dts/sdk/src/navigation/index.d.ts +3 -3
  34. package/dist/_dts/sdk/src/next/index.d.ts +32 -12
  35. package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
  36. package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
  37. package/dist/_dts/sdk/src/portal/client.d.ts +56 -4
  38. package/dist/_dts/sdk/src/portal/index.d.ts +95 -13
  39. package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
  40. package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
  41. package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
  42. package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
  43. package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
  44. package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -1
  45. package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
  46. package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +4 -4
  47. package/dist/_dts/sdk/src/rendering/index.d.ts +7 -7
  48. package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
  49. package/dist/_dts/sdk/src/rendering/server.d.ts +3 -3
  50. package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
  51. package/dist/_dts/sdk/src/routing/index.d.ts +19 -6
  52. package/dist/_dts/sdk/src/server.d.ts +5 -5
  53. package/dist/_dts/sdk/src/spam-protection/index.d.ts +2 -2
  54. package/dist/_dts/sdk/src/theme/index.d.ts +1 -1
  55. package/dist/_dts/serviceBookingOutline-YcsIjvn1.d.ts +582 -0
  56. package/dist/_dts/{types-C1l2Sm2h.d.ts → types-B7e6Lmo5.d.ts} +3 -3
  57. package/dist/_dts/{types-DgV8P2mz.d.ts → types-BOxSq-Bq.d.ts} +8 -7
  58. package/dist/_dts/{types-BdZ5pJSk.d.ts → types-CT-KOxl_.d.ts} +5 -39
  59. package/dist/_dts/{validation-BtbZIT5f.d.ts → validation-Dz6qccue.d.ts} +4 -4
  60. package/dist/client/{BlocksIslandsHydrator-CeYQQQs7.mjs → BlocksIslandsHydrator-1XifJg6V.mjs} +17 -18
  61. package/dist/client/{BookingMailingListNote-CDDWrY_W.mjs → BookingMailingListNote-BsbEgagJ.mjs} +7 -7
  62. package/dist/client/{BookingQuestionFields-MbvIo2jS.mjs → BookingQuestionFields-C8IbeLHj.mjs} +4 -4
  63. package/dist/client/{CalendarNavigationChevron-C6CSVfEB.mjs → CalendarNavigationChevron-Bbqij1XQ.mjs} +43 -10
  64. package/dist/client/{CheckboxChoice-b-PJLEXe.mjs → CheckboxChoice-BZPLCgTU.mjs} +1 -1
  65. package/dist/client/{DemoBookingPortalAccess-C9Ggcfx3.mjs → DemoBookingPortalAccess-uA9H8LIL.mjs} +4 -4
  66. package/dist/client/{EventCalendar.client-BSMuSqg0.mjs → EventCalendar.client-yoSI77ov.mjs} +11 -11
  67. package/dist/client/{EventCombined.client-BTrmSyUB.mjs → EventCombined.client-HeCNlliq.mjs} +11 -11
  68. package/dist/client/{EventEmbeddedCheckoutStep-B18VbNS_.mjs → EventEmbeddedCheckoutStep-BDnicDM6.mjs} +1 -1
  69. package/dist/client/{EventItem-B0WjGXsH.mjs → EventItem-Duhk1vnF.mjs} +247 -7
  70. package/dist/client/{EventListWeekNavigation-8Ij7vuxY.mjs → EventListWeekNavigation-BiutEqPK.mjs} +1 -1
  71. package/dist/client/{EventListing.client-CWk2NEwd.mjs → EventListing.client-B5ln77jG.mjs} +3 -3
  72. package/dist/client/{EventListing.view-BEH4UbSL.mjs → EventListing.view-hUDhNtMv.mjs} +203 -9
  73. package/dist/client/{EventRegistrationPayment-B2EikR3f.mjs → EventRegistrationPayment-DqtX1vB2.mjs} +439 -123
  74. package/dist/client/{Page-C03rc6jw.mjs → Page-ChJ2TGVk.mjs} +24314 -20226
  75. package/dist/client/{ProtectedSubmitButton-C-ql101B.mjs → ProtectedSubmitButton-De6AzhE6.mjs} +1 -1
  76. package/dist/client/{SiteTermsAgreementField-BYACYP0T.mjs → SiteTermsAgreementField-CDBU31xW.mjs} +3 -3
  77. package/dist/client/{StepIndicator-Bb7rPtSq.mjs → StepIndicator-2Dl9zon2.mjs} +80 -33
  78. package/dist/client/{BookingPanelArrangement-BShQSial.mjs → StepIndicator-JQA-VuEH.mjs} +12 -12
  79. package/dist/client/{TabBarFragment-BqfRLojo.mjs → TabBarFragment-DlKQRhP4.mjs} +1 -1
  80. package/dist/client/{ThemedButton-DuaYtnvG.mjs → ThemedButton-CnSa7o-I.mjs} +66 -66
  81. package/dist/client/{accessibleSurfaces-DN8it_Cx.mjs → accessibleSurfaces-Wl8-_OVJ.mjs} +1 -1
  82. package/dist/client/{accordion-BfsOiweL.mjs → accordion-B6SqU49k.mjs} +1 -1
  83. package/dist/client/{booking-form.client-B8ohIj13.mjs → booking-form.client-DrEOjQ3N.mjs} +15 -15
  84. package/dist/client/{bookingForm-CXsck2oH.mjs → bookingForm-drZBwEZW.mjs} +4 -4
  85. package/dist/client/bookings.mjs +5 -5
  86. package/dist/client/{boxStyleClassNames-B_hcuT06.mjs → boxStyleClassNames-DEh45w16.mjs} +19 -19
  87. package/dist/client/{carousel-Cz5Ddbsx.mjs → carousel-C-YJliD-.mjs} +2 -2
  88. package/dist/client/{carousel.client-h65clfUO.mjs → carousel.client-DMtGYTTM.mjs} +1 -1
  89. package/dist/client/{cart-CTC2oS3p.mjs → cart-acGFWK9R.mjs} +3 -3
  90. package/dist/client/{cart.client-c1YkTC-Q.mjs → cart.client-BzlOGP2j.mjs} +1 -1
  91. package/dist/client/{checkout-BeW1ufaH.mjs → checkout-SEontwhy.mjs} +3 -3
  92. package/dist/client/{checkout.client-BeU32khQ.mjs → checkout.client-C0Qvh-d4.mjs} +1 -1
  93. package/dist/client/{checkoutUrls-DVfSUSKp.mjs → checkoutUrls-yUKeq1N9.mjs} +1 -1
  94. package/dist/client/client.mjs +469 -320
  95. package/dist/client/{context-R9p5c8IH.mjs → context-DTrwaQtg.mjs} +2 -1
  96. package/dist/client/{dateFormatting-CF6FWCoo.mjs → dateFormatting-Cg8E1r9l.mjs} +1 -1
  97. package/dist/client/{demoPortalMagicLink-tZxIm3RL.mjs → demoPortalMagicLink-D0kOJYOX.mjs} +5 -4
  98. package/dist/client/{enhanceHeaderSection-DEYDI54E.mjs → enhanceHeaderSection-DyrpZ7ks.mjs} +4 -4
  99. package/dist/client/{event-registration.client-DWvSODTI.mjs → event-registration.client-RLZQWi2V.mjs} +121 -183
  100. package/dist/client/{eventCalendar-C9Pn9eeZ.mjs → eventCalendar-CphYnImh.mjs} +4 -4
  101. package/dist/client/{eventCombined-Bdhk0fp0.mjs → eventCombined-BvqjASB_.mjs} +4 -4
  102. package/dist/client/{eventListing-B-bJOQUk.mjs → eventListing-BaNAoC_M.mjs} +4 -4
  103. package/dist/client/{eventRegistration-CbdmUiDT.mjs → eventRegistration-COMHoRl6.mjs} +4 -4
  104. package/dist/client/events-9LPvwbWp.mjs +28 -0
  105. package/dist/client/{form-BbUUt784.mjs → form-DyH2juYT.mjs} +3 -3
  106. package/dist/client/{form.client-BVlz-9_t.mjs → form.client-DBwzkB0M.mjs} +5 -5
  107. package/dist/client/{form.parts-TB4UIrML.mjs → form.parts-CY4kX3mh.mjs} +3 -3
  108. package/dist/client/{formatDate-TDHhFjFN.mjs → formatDate-CTEN7gxW.mjs} +1 -1
  109. package/dist/client/gifting/client.mjs +7 -6
  110. package/dist/client/{gifting-CbNSrp7C.mjs → gifting-CIx4V378.mjs} +4 -4
  111. package/dist/client/{gifting.client-B__bGhFc.mjs → gifting.client-BEVPpzJM.mjs} +5 -5
  112. package/dist/client/{gifting.parts-CTA1sDW6.mjs → gifting.parts-VnORjnZK.mjs} +2 -2
  113. package/dist/client/{headerSection-5Wn9nUW_.mjs → headerSection-DGcJfRS8.mjs} +2 -2
  114. package/dist/client/{lookSurfaces-BwiNdgMU.mjs → lookSurfaces-IqT_SVnX.mjs} +167 -85
  115. package/dist/client/{newsletter-form.client-B17WYHxZ.mjs → newsletter-form.client-BvEDkjiD.mjs} +6 -6
  116. package/dist/client/{shop.interactive-CxDJ8P2r.mjs → newsletter-form.interactive-DCO1lErD.mjs} +3970 -3997
  117. package/dist/client/{newsletter-form.parts-DN9wD1ZG.mjs → newsletter-form.parts-BIy4IUT3.mjs} +2 -2
  118. package/dist/client/{newsletterForm-DLMlxInp.mjs → newsletterForm-CoTXDNFS.mjs} +3 -3
  119. package/dist/client/portal/client.mjs +346 -21
  120. package/dist/client/{product-detail.client-Di_anRGR.mjs → product-detail.client-YHQ2aKX1.mjs} +1 -1
  121. package/dist/client/{product-list.client-Duhl6rtL.mjs → product-list.client-DxoZw1vF.mjs} +1 -1
  122. package/dist/client/{productDetail-BgKmCwA8.mjs → productDetail-DjuFvkey.mjs} +3 -3
  123. package/dist/client/{productList-C_wMKsYS.mjs → productList-DE9GEFoZ.mjs} +3 -3
  124. package/dist/client/{propsDecoder-y3LvxaiG.mjs → propsDecoder-Cyag_HOs.mjs} +2 -48
  125. package/dist/client/{registry.server-CIWYKz1V.mjs → registry.server-BPwV-0Pp.mjs} +10426 -9114
  126. package/dist/client/rendering/client.mjs +41 -27
  127. package/dist/client/rendering/islands.mjs +1 -1
  128. package/dist/client/rendering.mjs +23 -2836
  129. package/dist/client/{richText-coerce-DkPBFb_a.mjs → richText-coerce-NrRqDeOg.mjs} +1 -1
  130. package/dist/client/{routeIslandApiConfig-BgO0rZce.mjs → routeIslandApiConfig-BWq5gKFK.mjs} +1 -1
  131. package/dist/client/runtimeResponse-D2j2-mOk.mjs +3 -0
  132. package/dist/client/{runtimeResponse-9v8q2NBc.mjs → runtimeResponse-DtWSfWSZ.mjs} +1 -1
  133. package/dist/client/{shop-CFbWlv_W.mjs → shop-C3wM0Hr4.mjs} +3 -3
  134. package/dist/client/{shop-commerce-C-I29eaA.mjs → shop-commerce-34YvcpbX.mjs} +14 -14
  135. package/dist/client/{shop-commerce-store-DGcc7twO.mjs → shop-commerce-store-B7xHksOs.mjs} +1 -1
  136. package/dist/client/{shop-discount-apply.state-DOm7vx0X.mjs → shop-discount-apply.state-BiBnozfO.mjs} +2 -2
  137. package/dist/client/{shop.client-GHTWUKD6.mjs → shop.client-C0v88nLd.mjs} +14 -14
  138. package/dist/client/{shopShared-Be9QJJpT.mjs → shopShared-Ct-BRNez.mjs} +2 -2
  139. package/dist/client/spam-protection.mjs +1 -1
  140. package/dist/client/{noop-CaQxI-Js.mjs → src-CCtanNlD.mjs} +462 -455
  141. package/dist/client/src-DqMbCjI1.mjs +3 -0
  142. package/dist/client/{src-xrjaKaCj.mjs → src-uwCpbHXG.mjs} +2 -1
  143. package/dist/client/{timetableModel--R0zVzZO.mjs → timetableModel-lhE29TNT.mjs} +66 -12
  144. package/dist/client/{types-DjWUR_O6.mjs → types-BEaKfam_.mjs} +65 -65
  145. package/dist/client/{useAvailableSlots-BGu_2F50.mjs → useAvailableSlots-BelJviOT.mjs} +2 -2
  146. package/dist/client/useDiscountCodeUi-rQRE1-Ho.mjs +196 -0
  147. package/dist/client/{useEventPagination-DxIJ--JZ.mjs → useEventPagination-C4rS2Xxl.mjs} +8 -8
  148. package/dist/client/{view-3foOzGWR.mjs → view-LJVHVqsy.mjs} +4 -4
  149. package/dist/client/{display-4HYOb-AK.mjs → wizardSteps-CNDsxeJH.mjs} +9168 -8981
  150. package/dist/preview-next/before-render.mjs +4 -3
  151. package/dist/preview-next/client/{PageSectionToolbar-D6-jojqh.mjs → PageSectionToolbar-C4TtBPN-.mjs} +3 -3
  152. package/dist/preview-next/client/{PreviewEditorSidebar-BUVFKZ4k.mjs → PreviewEditorSidebar-D6fkE59-.mjs} +15 -13
  153. package/dist/preview-next/client/{PreviewEditorUI-292pOiSt.mjs → PreviewEditorUI-amcDlj0O.mjs} +4 -4
  154. package/dist/preview-next/client/{PreviewShell-CW0Yzj3h.mjs → PreviewShell-DeQjx4zk.mjs} +5 -5
  155. package/dist/preview-next/client/{SdkPreviewModeRuntime-Dba7zoZK.mjs → SdkPreviewModeRuntime-Cx0SXnoX.mjs} +5 -5
  156. package/dist/preview-next/client/{previewAssistantSlot-B-utyhbS.mjs → previewAssistantSlot-aqpU34WI.mjs} +1764 -1090
  157. package/dist/preview-next/client/{previewChromeRoot-CCoGydUD.mjs → previewChromeRoot-D3Gy_Rs0.mjs} +1 -1
  158. package/dist/preview-next/client/runtime.mjs +3 -3
  159. package/dist/preview-next/client/{sdk-runtime-DCpXVcA0.mjs → sdk-runtime-Dzx_RrN7.mjs} +2 -2
  160. package/dist/preview-next/client/{siteStyleAccess-sjOvRAHY.mjs → siteStyleAccess-LHedw83e.mjs} +1 -1
  161. package/dist/preview-next/client/src-EO5QoRlU.mjs +3 -0
  162. package/dist/preview-next/client/{src-DzXUmsyK.mjs → src-lX6heoDA.mjs} +2 -1
  163. package/dist/preview-next/client/{useAutosaveStatus-R1rZ9-IZ.mjs → useAutosaveStatus-DpSd9aVk.mjs} +1 -1
  164. package/dist/preview-next/client/{useOpenBlockForSetup-BS7CANPv.mjs → useOpenBlockForSetup-BGZn5AT1.mjs} +1 -1
  165. package/dist/preview-next/keepAlive.mjs +1 -1
  166. package/dist/preview-next/middleware.mjs +1 -1
  167. package/dist/preview-next/{route-contract-BSSbtz6A.mjs → route-contract-DnL-FgSV.mjs} +83 -11
  168. package/dist/server/{Block.shared-Dc3DX7Cf.mjs → Block.shared-BEbq6EwO.mjs} +5 -5
  169. package/dist/server/{bindings-VGgS6UvF.mjs → bindings-Bly0dRs7.mjs} +36 -5
  170. package/dist/server/{client-BPLLL22F.mjs → client-CGJ2ztYp.mjs} +1021 -1118
  171. package/dist/server/config-validation.mjs +1 -1
  172. package/dist/server/config.mjs +2 -2
  173. package/dist/server/constants-Cj7hfbrA.mjs +41 -0
  174. package/dist/server/contentTypeResolver-B9vy8BrF.mjs +19 -0
  175. package/dist/server/data/dataLoaderContext.mjs +1 -1
  176. package/dist/server/data/resolveBlockData.mjs +1 -1
  177. package/dist/server/{dataLoaderContext-B3fXA54R.mjs → dataLoaderContext-lMRTfG5Z.mjs} +1 -0
  178. package/dist/server/error-f4g44bKx.mjs +387 -0
  179. package/dist/server/index.mjs +3 -2
  180. package/dist/server/loadContent-BkK1w3QQ.mjs +692 -0
  181. package/dist/server/{loadPage-CQgde5DN.mjs → loadPage-DTLe0FEs.mjs} +22 -4
  182. package/dist/server/{navigation-iC_hXjJI.mjs → navigation-BcNfYYuu.mjs} +1 -1
  183. package/dist/server/navigation.mjs +1 -1
  184. package/dist/server/next.mjs +103 -100
  185. package/dist/server/{overrideResolution-CkpwAHvW.mjs → overrideResolution-Uy9Zp2Ks.mjs} +1 -1
  186. package/dist/server/page-converter.mjs +1 -1
  187. package/dist/server/{pageRenderPlan-CfSnAkCO.mjs → pageRenderPlan-JzxBnqfV.mjs} +19 -7
  188. package/dist/server/{pageRuntimeSupport-uz4gzBOo.mjs → pageRuntimeSupport-DyNSd2Yj.mjs} +50 -2
  189. package/dist/server/{pageShared-6z6JBU41.mjs → pageShared-DU4ETFPS.mjs} +89 -83
  190. package/dist/server/portal-B4JVkdjc.mjs +783 -0
  191. package/dist/server/portal.mjs +3 -3
  192. package/dist/server/{prebuild-B4_Llisx.mjs → prebuild-8jNtDXmS.mjs} +5 -4
  193. package/dist/server/prebuild.mjs +1 -1
  194. package/dist/server/{prefetchBlockData-CCiYV8_s.mjs → prefetchBlockData-xeMG42aw.mjs} +3 -2
  195. package/dist/server/{registry-CXRXsFSx.mjs → registry-DH1VrsCl.mjs} +587 -329
  196. package/dist/server/rendering/components/pageShared.mjs +1 -1
  197. package/dist/server/rendering/helpers/loadPage.mjs +1 -1
  198. package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +1 -1
  199. package/dist/server/rendering/server.mjs +5 -4
  200. package/dist/server/rendering.mjs +9 -8
  201. package/dist/server/{resolveBlockData-yfe8WLEA.mjs → resolveBlockData-BN8tweTx.mjs} +24 -5
  202. package/dist/server/resolvePageContent-DnM16_f9.mjs +89 -0
  203. package/dist/server/routing.mjs +271 -57
  204. package/dist/server/server.mjs +3 -3
  205. package/dist/server/{loadContent-CxASA3PE.mjs → servicePageContent-B-FezJmH.mjs} +709 -453
  206. package/dist/server/{validation-BvHio6QI.mjs → validation-3jOzYdPL.mjs} +3 -3
  207. package/dist/server/{version-SuFlio6n.mjs → version-8t0o6_jd.mjs} +1 -1
  208. package/dist/styles/index.css +19 -0
  209. package/package.json +1 -1
  210. package/dist/_dts/footerPageOutline-DwMHeYmQ.d.ts +0 -256
  211. package/dist/_dts/resolvePageContent-DkzWvFbG.d.ts +0 -162
  212. package/dist/client/LocationMapActions-myIQIvQL.mjs +0 -62
  213. package/dist/client/MapDrawingSvg-BfsVyPvB.mjs +0 -200
  214. package/dist/client/course-CUFVJEAc.mjs +0 -237
  215. package/dist/client/duration-Q6_QNgiv.mjs +0 -37
  216. package/dist/client/event-details.client-BwjBJP-f.mjs +0 -53
  217. package/dist/client/eventDetails-C2LfNW_o.mjs +0 -13
  218. package/dist/client/runtimeResponse-CVkM0dHy.mjs +0 -3
  219. package/dist/client/src-BozhJ43Z.mjs +0 -3
  220. package/dist/client/useDiscountCodeUi-I_mXI9Yd.mjs +0 -237
  221. package/dist/client/view-BbzH5MQb.mjs +0 -1371
  222. package/dist/preview-next/client/src-LUhVXBEQ.mjs +0 -3
  223. package/dist/server/constants-hl17xz6x.mjs +0 -22
  224. package/dist/server/portal-BjVHMAUC.mjs +0 -371
  225. package/dist/server/resolvePageContent-CAELMBEJ.mjs +0 -438
@@ -1,10 +1,10 @@
1
- import { Ar as blockDesignCapabilityMapFromDefinitions, Fo as appearancePresets, Gi as plainTextToInlineText, Ha as buildInitialPolicyPageDesignIntent, Hi as inlineTextToPlainText, Jn as siteHeaderManifest, Jo as resolveRepeaterGridSpanFieldId, Ka as componentRuntimeRulesForSiteStyle, Ko as resolveRepeaterGridColumnFieldId, Qa as surfaceResolutionContextFromTheme, Qi as isRecord, Wi as parseInlineTextFromUnknown, Ya as requireCuratedSiteStyle, ba as parseListLook, i as systemBlockDefinitions, ic as unsafeAsEventCategoryId, js as isCanonicalRichTextDoc, li as parseBackgroundContent, qa as designRuntimeRulesForSiteStyle, qi as parseFieldDefinition, qo as resolveRepeaterGridRowFieldId, qs as offeringLabelForPageSurfaceSubject, rc as unsafeAsContentEntryId, rr as resolveDateRuntimeContext, t as getBlockDefinition, uo as parsePageDesignIntent, xs as EVENT_PRESET_VALUES } from "./registry-CXRXsFSx.mjs";
1
+ import { at as arrangementContentFacts, b as describePublicRefundPolicy, c as createCustomBlockRegistry, y as PUBLIC_FREE_CANCELLATION } from "./pageRenderPlan-JzxBnqfV.mjs";
2
+ import { $a as componentRuntimeRulesForTheme, Go as appearancePresets, In as registrationDataForEventSelection, Ja as buildInitialPolicyPageDesignIntent, Ji as parseInlineTextFromUnknown, Ka as applyBlockContentVariantPolicy, Ki as inlineTextToPlainText, Nn as planWholeSeriesParentBooking, Pr as blockDesignCapabilityMapFromDefinitions, Qa as componentRuntimeRulesForSiteStyle, Qn as siteHeaderManifest, Rn as selectionRepresentativeEvent, So as pageDesignDecisionsV2Schema, Vs as isCanonicalRichTextDoc, Ya as deriveSiteStyleBlockPolicy, Yi as plainTextToInlineText, Zi as parseFieldDefinition, ao as stripCompiledRuntimeStyleFields, eo as designRuntimeRulesForSiteStyle, i as systemBlockDefinitions, is as resolveRepeaterGridSpanFieldId, js as EVENT_PRESET_VALUES, mc as unsafeAsEventCategoryId, na as isRecord, ns as resolveRepeaterGridColumnFieldId, oo as surfaceResolutionContextFromTheme, pc as unsafeAsContentEntryId, pi as parseBackgroundContent, qa as applySiteStyleBlockPoliciesToPageDesignIntent, rc as offeringLabelForPageSurfaceSubject, ro as requireCuratedSiteStyle, rs as resolveRepeaterGridRowFieldId, t as getBlockDefinition, to as designRuntimeRulesForTheme, vo as parsePageDesignIntent, wa as parseListLook, yo as rebasePageDesignIntentToSiteStyle } from "./registry-DH1VrsCl.mjs";
2
3
  import { S as asDesignBlockId, T as asLayoutVariantKey, b as asAppearancePresetId } from "./customCss-BZ8YSrQg.mjs";
3
- import { C as normalizeRepeaterGridSpan, S as flowRepeaterGridItems, a as invalidRenderableBlock$1, d as siteBlockRenderContext, h as registeredManifestContentContract, i as collectMediaAssetSidecar, j as readPublishedBlockPlacement, l as resolveSdkBlockManifest, m as compileManifestContentContract, n as buildRenderablePageOutline, o as projectRenderablePageOutline, p as admitTransportedRenderableManifestContent, r as buildSiteRenderSupport, s as readInvalidBlockAdmission, u as sanitizeSdkRuntimeBlockContent, v as deriveFieldValidationPlan, w as resolveRepeaterGridAcceptedSpans, y as fieldPlanToZod } from "./pageRuntimeSupport-uz4gzBOo.mjs";
4
+ import { i as mediaSchema } from "./media-luf7RF22.mjs";
5
+ import { D as resolveRepeaterGridAcceptedSpans, E as normalizeRepeaterGridSpan, P as readPublishedBlockPlacement, S as fieldPlanToZod, T as flowRepeaterGridItems, _ as findNonPortableManifestMediaPaths, g as deriveRenderableManifestContent, h as compileManifestContentContract, m as admitTransportedRenderableManifestContent, p as admitStoredManifestContentForRendering, v as registeredManifestContentContract, x as deriveFieldValidationPlan } from "./pageRuntimeSupport-DyNSd2Yj.mjs";
4
6
  import { i as createRichTextDoc, o as isRecord$1, r as buildRichTextSchema } from "./richTextSchema-QLaQrbII.mjs";
5
- import { a as buildPageDesignEditorReadModel, i as blockDesignInputsForDefinition, n as isEntryBoundBlockEmpty, o as applyCompiledRuntimeFieldsToContent, r as resolveRuntimeJoinFacts, s as compileEditorModelRuntime, t as applyBindingsToContent } from "./bindings-VGgS6UvF.mjs";
6
- import { r as normalizeDataLoaderSearchParams } from "./dataLoaderContext-B3fXA54R.mjs";
7
- import { n as DEFAULT_RESOLVE_BLOCK_DATA_DEPS, o as resolveBlockDataWithDeps, r as createBlockDataLoadPolicy } from "./resolveBlockData-yfe8WLEA.mjs";
7
+ import { a as buildPageDesignBlockBinding, c as compileEditorModelRuntime, i as blockDesignInputsForDefinition, n as isEntryBoundBlockEmpty, o as buildPageDesignEditorReadModel, r as resolveRuntimeJoinFacts, s as applyCompiledRuntimeFieldsToContent, t as applyBindingsToContent } from "./bindings-Bly0dRs7.mjs";
8
8
  import { z } from "zod";
9
9
  //#region ../theme-core/src/site-styles/contentTemplateDesignIntent.ts
10
10
  function asContentTemplateDesignBlockId(value) {
@@ -76,6 +76,38 @@ function compileContentTemplateRuntimeFields(input) {
76
76
  issues: editorModel.issues
77
77
  };
78
78
  }
79
+ //#endregion
80
+ //#region ../theme-core/src/site-styles/effectivePageDesign.ts
81
+ /**
82
+ * Every page with an applicable site style has an effective design, whether or
83
+ * not a design version was ever persisted. Missing persistence is ordinary
84
+ * default resolution, not a failure.
85
+ *
86
+ * Corrupt persisted state never reaches this function: callers keep their own
87
+ * invalid state untouched and only resolve `stored` values they could parse.
88
+ */
89
+ function resolveEffectivePageDesignIntent(stored, currentSiteStyleId) {
90
+ if (stored) return {
91
+ kind: "resolved",
92
+ intent: currentSiteStyleId ? rebasePageDesignIntentToSiteStyle(stored, currentSiteStyleId) : stored,
93
+ source: "stored"
94
+ };
95
+ return currentSiteStyleId ? {
96
+ kind: "resolved",
97
+ intent: buildInitialPolicyPageDesignIntent(currentSiteStyleId),
98
+ source: "default"
99
+ } : { kind: "no-site-style" };
100
+ }
101
+ //#endregion
102
+ //#region ../theme-core/src/site-styles/pageDesignVersionIntent.ts
103
+ /** Ordinary page versions contain decisions; the site owns their current style. */
104
+ const decodedPageDesignIntentSchema = z.union([z.nullish(z.never()).transform(() => ({ kind: "automatic" })), pageDesignDecisionsV2Schema.transform((decisions) => ({
105
+ kind: "decisions",
106
+ decisions
107
+ }))], { error: (issue) => {
108
+ const value = issue.input;
109
+ return typeof value === "object" && value !== null && "schemaVersion" in value && value.schemaVersion !== 2 ? "Unsupported page design decisions schemaVersion." : "Invalid page design decisions shape.";
110
+ } });
79
111
  const PAGE_SECTIONS_ANCHOR_BLOCK_KIND = "system.page-sections";
80
112
  function isSystemTemplateBlockKind(value) {
81
113
  return value === "system.entry-slot" || value === "system.page-sections";
@@ -1804,507 +1836,731 @@ function isEntryTitleBinding(binding) {
1804
1836
  if (!isRecord(binding)) return false;
1805
1837
  return binding.source === "meta" && binding.path === "title" || binding.source === "transform" && isEntryTitleBinding(binding.input);
1806
1838
  }
1807
- blockDesignCapabilityMapFromDefinitions(systemBlockDefinitions);
1808
- createManifestDefaultValues(siteHeaderManifest);
1809
- //#endregion
1810
- //#region src/rendering/helpers/templateContent.ts
1811
- function createTemplateRenderTarget(source, templateId) {
1812
- switch (source.kind) {
1813
- case "entry-template": return {
1814
- kind: source.kind,
1815
- templateId,
1816
- entryId: source.entryId,
1817
- entryType: source.entryType
1818
- };
1819
- case "page-surface-template": return {
1820
- kind: source.kind,
1821
- templateId,
1822
- pageSurfaceId: source.pageSurfaceId,
1823
- routeId: source.routeId,
1824
- subject: source.subject
1825
- };
1839
+ /**
1840
+ * The design intent a page renders with: a stored intent rebased onto the
1841
+ * current site style, or the style's defaults when nothing is stored, with the
1842
+ * look pins the style's block policies require. Null when the site has no
1843
+ * site style, so the page renders its content as authored.
1844
+ *
1845
+ * Blocks whose id is not a valid design block id get no policy pin; the
1846
+ * pipeline reports them as `invalid-block-id` diagnostics.
1847
+ */
1848
+ function resolveOrdinaryPageDesignIntent(input) {
1849
+ const resolution = resolveEffectivePageDesignIntent(input.stored !== null && input.siteStyleId !== null ? {
1850
+ ...input.stored,
1851
+ siteStyleId: input.siteStyleId
1852
+ } : null, input.siteStyleId);
1853
+ if (resolution.kind !== "resolved") return null;
1854
+ const { siteStyleId: _style, ...decisions } = applySiteStyleBlockPoliciesToPageDesignIntent(resolution.intent, input.blocks.flatMap((block) => {
1855
+ const blockId = toDesignBlockId(block.id);
1856
+ return blockId !== null ? [{
1857
+ blockId,
1858
+ blockKind: block.kind
1859
+ }] : [];
1860
+ }));
1861
+ return decisions;
1862
+ }
1863
+ /**
1864
+ * Materialize → policy → stored admission → design runtime → renderable proof.
1865
+ *
1866
+ * Admission sits ahead of the design runtime on purpose. `applyPageDesignRuntimeFields`
1867
+ * is adjacent-pair dependent throughout — per-block fields are compiled against the
1868
+ * *next* block's surface, boundaries are keyed to neighbouring block ids, and the
1869
+ * final block is treated as the page end — so it has to see the list that will
1870
+ * actually render. On a public page an `invalid` block is omitted entirely by
1871
+ * `PageRenderer`, and compiling joins to a section nobody sees produces boundaries
1872
+ * that then have to be approximated back into shape downstream.
1873
+ */
1874
+ function buildOrdinaryPageRenderBlocks(input) {
1875
+ return buildOrdinaryPageWithContext(input);
1876
+ }
1877
+ function buildOrdinaryPageWithContext(input, preparedContext) {
1878
+ const design = resolvePageDesignCompilation(input);
1879
+ const materialized = materializeOrdinaryPageBlocks(input);
1880
+ const admitted = admitOrdinaryPageBlocks({
1881
+ blocks: design.kind === "compile" ? applyBlockContentPolicies({
1882
+ blocks: materialized,
1883
+ designState: design.designState,
1884
+ siteStyleId: design.siteStyleId
1885
+ }) : materialized,
1886
+ resolveContract: input.resolveBlockContentContract ?? resolveRegisteredBlockContentContract,
1887
+ designRuntimeOwnsStyleFields: design.kind === "compile"
1888
+ });
1889
+ const compiled = design.kind === "compile" ? compileOrdinaryPageDesignRuntime({
1890
+ blocks: admitted,
1891
+ designState: design.designState,
1892
+ siteStyleId: design.siteStyleId,
1893
+ stage: input.stage,
1894
+ theme: design.theme,
1895
+ surfaceResolutionContext: preparedContext ?? surfaceResolutionContextFromTheme(design.theme)
1896
+ }) : {
1897
+ blocks: admitted,
1898
+ runtimeJoins: [],
1899
+ diagnostics: design.diagnostics
1900
+ };
1901
+ return {
1902
+ blocks: compiled.blocks.map((block) => finalizeOrdinaryPageRenderBlock(block, input.stage)),
1903
+ runtimeJoins: compiled.runtimeJoins,
1904
+ diagnostics: compiled.diagnostics
1905
+ };
1906
+ }
1907
+ function resolvePageDesignCompilation(input) {
1908
+ const parsed = decodedPageDesignIntentSchema.safeParse(input.designState);
1909
+ if (!parsed.success) return {
1910
+ kind: "skip",
1911
+ diagnostics: [{ kind: "invalid-design-state" }]
1912
+ };
1913
+ if (parsed.data.kind === "automatic") return {
1914
+ kind: "skip",
1915
+ diagnostics: []
1916
+ };
1917
+ const currentSiteStyleId = input.theme?.siteStyleId;
1918
+ if (input.theme === null || currentSiteStyleId == null) return {
1919
+ kind: "skip",
1920
+ diagnostics: [{ kind: "missing-theme-for-design-state" }]
1921
+ };
1922
+ return {
1923
+ kind: "compile",
1924
+ designState: parsed.data.decisions,
1925
+ siteStyleId: currentSiteStyleId,
1926
+ theme: input.theme
1927
+ };
1928
+ }
1929
+ function materializeOrdinaryPageBlocks(input) {
1930
+ switch (input.source) {
1931
+ case "stored": return input.blocks.map((block) => mapOrdinaryPageBlock(block, input.contentByBlockId[block.id], input.stage)).filter((block) => block !== null);
1932
+ case "inline": return input.blocks.map((block) => ({
1933
+ id: block.id,
1934
+ kind: block.kind,
1935
+ purpose: block.purpose,
1936
+ content: cloneRecord(block.content),
1937
+ versions: { kind: "inline" }
1938
+ }));
1826
1939
  }
1827
1940
  }
1828
- function processEntryTemplate(input) {
1829
- return processTemplatePage({
1941
+ function admitOrdinaryPageBlocks(input) {
1942
+ return input.blocks.map((block) => {
1943
+ const contract = input.resolveContract(block.kind);
1944
+ const nonPortable = block.versions.kind === "stored" && contract !== null ? findNonPortableManifestMediaPaths(contract, block.content) : [];
1945
+ const admission = nonPortable.length ? invalidContentAdmission({
1946
+ kind: "non_portable_media",
1947
+ paths: nonPortable
1948
+ }) : admitOrdinaryPageContent(contract, block.versions.kind, storedContentForAdmission(block.content, input.designRuntimeOwnsStyleFields));
1949
+ return {
1950
+ ...block,
1951
+ admission
1952
+ };
1953
+ });
1954
+ }
1955
+ /**
1956
+ * Where the design runtime runs it replaces every compiled style field wholesale,
1957
+ * so a stale persisted one never reaches the rendered page and must not be what
1958
+ * costs a block its admission. Dropping those fields here lets the runtime
1959
+ * projection put the compiled values back before the render shape is judged.
1960
+ * Where the runtime does not run, content is rendered as stored and is judged as
1961
+ * stored.
1962
+ *
1963
+ * The strip is not verdict-preserving on its own. `admitStoredManifestContent`
1964
+ * runs two checks: media portability over the whole content, then the strict
1965
+ * stored schema. Both stop seeing the stripped fields, and a compiled style field
1966
+ * can itself declare media (`_sectionStyles.background.image`), so portability
1967
+ * over those fields is checked before stripping, then re-checked against the decorated content in
1968
+ * `finalizeOrdinaryPageRenderBlock`. Only the schema half is deliberately
1969
+ * deferred there, to the render schema over the projection.
1970
+ */
1971
+ function storedContentForAdmission(content, designRuntimeOwnsStyleFields) {
1972
+ return designRuntimeOwnsStyleFields ? stripCompiledRuntimeStyleFields(content) : content;
1973
+ }
1974
+ function compileOrdinaryPageDesignRuntime(input) {
1975
+ const compiling = input.blocks.map((block) => participatesInDesignCompilation(block, input.stage));
1976
+ const compiled = applyPageDesignRuntimeFields({
1830
1977
  ...input,
1831
- slotContent: input.entrySlots,
1832
- pageName: "Entry Template",
1833
- pagePath: input.entry.path || "/",
1834
- pagePurpose: "entry-template",
1835
- renderTargetSource: {
1836
- kind: "entry-template",
1837
- entryId: input.entry.id,
1838
- entryType: input.entry.type
1839
- }
1978
+ blocks: input.blocks.filter((_, index) => compiling[index] === true)
1840
1979
  });
1980
+ return {
1981
+ ...compiled,
1982
+ blocks: restoreBlocksExcludedFromCompilation(input.blocks, compiling, compiled.blocks)
1983
+ };
1841
1984
  }
1842
- async function processTemplatePage(input) {
1843
- const template = input.templates?.[0];
1844
- if (!template?.blocks?.length) return {
1845
- templatePage: null,
1846
- resolvedData: {}
1847
- };
1848
- const templatePage = materializeSdkTemplate(input, template);
1849
- if (templatePage === null) return {
1850
- templatePage: null,
1851
- resolvedData: {}
1852
- };
1853
- const prefetched = await resolveBlockDataWithDeps(input.deps, {
1854
- bookingTimeZone: input.bookingTimeZone,
1855
- now: input.now,
1856
- page: projectRenderablePageOutline(templatePage),
1857
- siteId: input.siteId,
1858
- renderTarget: createTemplateRenderTarget(input.renderTargetSource, template.id),
1859
- previewStage: input.previewStage,
1860
- policy: input.blockDataPolicy,
1861
- client: input.client,
1862
- customBlocks: input.customBlocks
1985
+ /**
1986
+ * The compiled subset keeps the source order and its length — `applyPageDesignRuntimeFields`
1987
+ * returns `input.blocks.map(...)` — so walking it in step puts the excluded
1988
+ * blocks back where they were. Deliberately not keyed on block id: ids reach
1989
+ * this pipeline unvalidated (see `toDesignBlockId`) and need not be unique.
1990
+ */
1991
+ function restoreBlocksExcludedFromCompilation(blocks, compiling, compiled) {
1992
+ const remaining = compiled[Symbol.iterator]();
1993
+ return blocks.map((block, index) => {
1994
+ if (compiling[index] !== true) return block;
1995
+ const next = remaining.next();
1996
+ if (next.done === true) throw new Error("Page design compilation returned fewer blocks than it was given");
1997
+ return next.value;
1863
1998
  });
1999
+ }
2000
+ /**
2001
+ * Published pages never show an invalid block: `PageRenderer` omits it outright,
2002
+ * so a boundary or terminal surface compiled against it describes a join that is
2003
+ * not on the page. Draft pages keep them, because the authoring renderers render
2004
+ * an invalid block as a diagnostic panel that occupies its slot in the flow — the
2005
+ * authoring surface's real adjacency *is* the full block list, and skipping the
2006
+ * block here would hand the editor joins that leap over something visible.
2007
+ *
2008
+ * One draft-stage consumer is not an authoring renderer: the portal preview in
2009
+ * `apps/frontend/src/app/(site)/[[...slug]]/page.tsx` (`renderPortalPreview`)
2010
+ * feeds draft data to the public `Page`, which omits invalid blocks, so its
2011
+ * boundaries are compiled over a block it will not draw.
2012
+ */
2013
+ function participatesInDesignCompilation(block, stage) {
2014
+ return stage === "draft" || block.admission.kind === "admitted";
2015
+ }
2016
+ function mapOrdinaryPageBlock(block, contentPair, stage) {
2017
+ if (contentPair === void 0) throw new Error(`Missing selected page content: ${block.id}`);
2018
+ const selected = cloneBlockContent(contentPair.selected);
2019
+ const published = cloneBlockContent(contentPair.published);
2020
+ if (stage === "published" && selected === null) return null;
1864
2021
  return {
1865
- templatePage,
1866
- prefetchedBlockData: prefetched,
1867
- ...prefetched
1868
- };
1869
- }
1870
- /** Pure adapter: the shared renderer owns bindings, applicability, Looks and admission. */
1871
- function materializeSdkTemplate(input, template) {
1872
- return buildTemplatePageOutline({
1873
- entry: input.entry,
1874
- subject: templateCompilerSubject(input.renderTargetSource),
1875
- dateContext: resolveDateRuntimeContext(input.bookingTimeZone),
1876
- template: toContentTemplate(template),
1877
- page: {
1878
- name: template.name || input.pageName,
1879
- path: input.pagePath,
1880
- purpose: input.pagePurpose
1881
- },
1882
- theme: input.theme,
1883
- pageSections: input.pageSections,
1884
- resolveEntrySlotBlocks: ({ slotKey }) => selectBlocksForDeclaredEntrySlot({
1885
- declaredSlotKey: slotKey,
1886
- entrySlots: input.slotContent ?? []
1887
- }).map((block) => admitEntrySlotBlock(block, input.customBlocks, input.previewStage)),
1888
- resolveBlockContentContract: (kind) => {
1889
- const manifest = resolveSdkBlockManifest(kind, input.customBlocks);
1890
- return manifest === null ? null : compileManifestContentContract(manifest);
2022
+ id: block.id,
2023
+ kind: block.kind,
2024
+ purpose: block.purpose ?? "content",
2025
+ content: cloneRecord(selected?.data ?? {}),
2026
+ versions: {
2027
+ kind: "stored",
2028
+ selected,
2029
+ published
1891
2030
  }
2031
+ };
2032
+ }
2033
+ function applyPageDesignRuntimeFields(input) {
2034
+ const bindings = input.blocks.map((block) => buildPageDesignBlockBinding({
2035
+ id: block.id,
2036
+ kind: block.kind,
2037
+ currentContentId: resolveActiveContentId(block),
2038
+ content: block.content
2039
+ }));
2040
+ const diagnostics = bindings.flatMap((binding) => binding.kind === "invalid-block-id" ? [binding] : []);
2041
+ const editorBlocks = bindings.flatMap((binding) => binding.kind === "valid" ? [binding.block] : []);
2042
+ const contentById = new Map(input.blocks.map((block) => [block.id, block.content]));
2043
+ const compiledRuntime = compileEditorModelRuntime({
2044
+ editorModel: buildPageDesignEditorReadModel({
2045
+ joinResolution: {
2046
+ surfaceResolutionContext: input.surfaceResolutionContext,
2047
+ resolveFacts: resolveRuntimeJoinFacts,
2048
+ designRules: designRuntimeRulesForTheme(input.theme),
2049
+ componentRules: componentRuntimeRulesForTheme(input.theme),
2050
+ contentForBlock: (id) => {
2051
+ const content = contentById.get(id);
2052
+ if (content === void 0) throw new Error(`Missing page content for ${id}`);
2053
+ return content;
2054
+ }
2055
+ },
2056
+ siteStyleId: input.siteStyleId,
2057
+ intent: input.designState,
2058
+ blocks: editorBlocks
2059
+ }),
2060
+ surfaceResolutionContext: input.surfaceResolutionContext,
2061
+ designRules: designRuntimeRulesForTheme(input.theme),
2062
+ componentRules: componentRuntimeRulesForTheme(input.theme),
2063
+ publicationForBlock: input.stage === "published" ? (blockId) => {
2064
+ const content = contentById.get(blockId);
2065
+ if (content === void 0) throw new Error(`Published design block has no content: ${blockId}`);
2066
+ return {
2067
+ kind: "published",
2068
+ facts: arrangementContentFacts(content).facts
2069
+ };
2070
+ } : void 0
2071
+ });
2072
+ const runtimeFieldsByBlockId = new Map(compiledRuntime.blocks.map((block) => [block.blockId, block.fields]));
2073
+ return {
2074
+ diagnostics,
2075
+ blocks: input.blocks.map((block) => {
2076
+ const blockId = toDesignBlockId(block.id);
2077
+ return applyRuntimeFieldsToOrdinaryPageBlock(block, blockId !== null ? runtimeFieldsByBlockId.get(blockId) : void 0);
2078
+ }),
2079
+ runtimeJoins: compiledRuntime.joins
2080
+ };
2081
+ }
2082
+ function applyBlockContentPolicies(input) {
2083
+ return input.blocks.map((block) => {
2084
+ const content = applyBlockContentVariantPolicy({
2085
+ policy: deriveSiteStyleBlockPolicy({
2086
+ siteStyleId: input.siteStyleId,
2087
+ blockKind: block.kind
2088
+ }),
2089
+ content: block.content
2090
+ });
2091
+ return content === block.content ? block : {
2092
+ ...block,
2093
+ content: cloneRecord(content)
2094
+ };
1892
2095
  });
1893
2096
  }
1894
- function templateCompilerSubject(source) {
1895
- switch (source.kind) {
1896
- case "entry-template": return;
1897
- case "page-surface-template": return source.subject;
2097
+ function applyRuntimeFieldsToOrdinaryPageBlock(block, fields) {
2098
+ if (fields === void 0) return block;
2099
+ return {
2100
+ ...block,
2101
+ content: applyCompiledRuntimeFieldsToContent(cloneRecord(block.content), fields)
2102
+ };
2103
+ }
2104
+ function resolveActiveContentId(block) {
2105
+ return block.versions.kind === "inline" ? null : block.versions.selected?.id ?? null;
2106
+ }
2107
+ function resolvePublishedPlacement(block, stage) {
2108
+ const { versions } = block;
2109
+ return stage === "draft" && versions.kind === "stored" ? readPublishedBlockPlacement(versions.published?.id, versions.published?.data) : null;
2110
+ }
2111
+ function cloneBlockContent(content) {
2112
+ return content !== null ? {
2113
+ ...content,
2114
+ data: cloneRecord(content.data)
2115
+ } : null;
2116
+ }
2117
+ function cloneRecord(value) {
2118
+ return structuredClone(value);
2119
+ }
2120
+ function admitOrdinaryPageContent(contract, source, content) {
2121
+ if (contract === null) return {
2122
+ kind: "invalid",
2123
+ error: { kind: "manifest_unavailable" }
2124
+ };
2125
+ switch (source) {
2126
+ case "stored": {
2127
+ const stored = admitStoredManifestContentForRendering(contract, content);
2128
+ return stored.ok ? {
2129
+ kind: "admitted",
2130
+ contract,
2131
+ proof: {
2132
+ kind: "stored",
2133
+ stored: stored.value
2134
+ }
2135
+ } : invalidContentAdmission(stored.error);
2136
+ }
2137
+ case "inline": {
2138
+ const inline = admitInlineContent(contract, content);
2139
+ return inline.ok ? {
2140
+ kind: "admitted",
2141
+ contract,
2142
+ proof: { kind: "inline" }
2143
+ } : invalidContentAdmission(inline.error);
2144
+ }
1898
2145
  }
1899
2146
  }
1900
- /** Adapt the SDK transport to the shared template renderer; decisions stay there. */
1901
- function toContentTemplate(template) {
2147
+ /**
2148
+ * Inline content is composed from already-hydrated runtime facts (a cover
2149
+ * image carries its public `src`) and never reaches a writer, so it is judged
2150
+ * by the render schema alone. Stored admission's portability check is right
2151
+ * for persisted rows and wrong here — the same reasoning as
2152
+ * `admitMaterializedTemplateContent` in `templatePageOutline.ts`.
2153
+ */
2154
+ function admitInlineContent(contract, content) {
2155
+ return admitTransportedRenderableManifestContent(contract, content);
2156
+ }
2157
+ function invalidContentAdmission(error) {
1902
2158
  return {
1903
- id: template.id,
1904
- name: template.name,
1905
- templateKey: template.templateKey,
1906
- designState: template.designState,
1907
- blocks: template.blocks.map((block, orderIndex) => ({
1908
- ...block,
1909
- orderIndex,
1910
- content: sanitizeSdkRuntimeBlockContent(block.blockKind, block.content ?? {}),
1911
- bindings: block.bindings ?? null
1912
- }))
2159
+ kind: "invalid",
2160
+ error: {
2161
+ kind: "invalid_manifest_content",
2162
+ error
2163
+ }
1913
2164
  };
1914
2165
  }
1915
- function admitEntrySlotBlock(block, customBlocks, previewStage) {
2166
+ /**
2167
+ * Completes admission once the design runtime has produced the render shape.
2168
+ *
2169
+ * The runtime decoration *is* the pure projection this transition expects; it
2170
+ * simply cannot run per block, because it depends on the block's neighbours. So
2171
+ * it is applied across the list above and handed back here as the projection.
2172
+ *
2173
+ * For stored content, media portability is re-checked first, because
2174
+ * `storedContentForAdmission` hid the compiled style fields from the stored gate
2175
+ * and those fields can declare media of their own. Inline content is judged by
2176
+ * the render schema, as it was before compilation (`admitInlineContent`).
2177
+ */
2178
+ function finalizeOrdinaryPageRenderBlock(block, stage) {
1916
2179
  const base = {
1917
- id: block.id ?? block.blockId ?? null,
1918
- contentVersionId: block.contentVersionId,
1919
- ...entrySlotBlockIdentity(block, previewStage),
2180
+ id: block.id,
1920
2181
  kind: block.kind,
1921
2182
  purpose: block.purpose,
1922
- ...isRecord(block.bindings) ? { bindings: block.bindings } : {}
2183
+ contentVersionId: resolveActiveContentId(block),
2184
+ publishedPlacement: resolvePublishedPlacement(block, stage)
1923
2185
  };
1924
- const transportedAdmission = readInvalidBlockAdmission(block.admission);
1925
- if (transportedAdmission) return invalidRenderableBlock$1(base, transportedAdmission.error);
1926
- const manifest = resolveSdkBlockManifest(block.kind, customBlocks);
1927
- if (manifest === null) return invalidRenderableBlock$1(base, { kind: "manifest_unavailable" });
1928
- const renderable = admitTransportedRenderableManifestContent(compileManifestContentContract(manifest), block.content ?? {});
2186
+ if (block.admission.kind === "invalid") return invalidRenderableBlock(base, block.admission.error);
2187
+ const { contract, proof } = block.admission;
2188
+ const renderable = proof.kind === "stored" ? deriveStoredRenderableContent(contract, proof.stored, block.content) : admitInlineContent(contract, block.content);
1929
2189
  return renderable.ok ? {
1930
2190
  ...base,
1931
2191
  admission: {
1932
2192
  kind: "renderable",
1933
2193
  content: renderable.value
1934
2194
  }
1935
- } : invalidRenderableBlock$1(base, {
2195
+ } : invalidRenderableBlock(base, {
1936
2196
  kind: "invalid_manifest_content",
1937
2197
  error: renderable.error
1938
2198
  });
1939
2199
  }
1940
- function entrySlotBlockIdentity(block, previewStage) {
1941
- return {
1942
- draftContentId: block.draftContentId ?? null,
1943
- publishedPlacement: previewStage === "preview" ? readPublishedBlockPlacement(block.publishedContentId, isRecord(block.publishedContent) && isRecord(block.publishedContent.data) ? block.publishedContent.data : null) : null
2200
+ function deriveStoredRenderableContent(contract, stored, decorated) {
2201
+ const nonPortablePaths = findNonPortableManifestMediaPaths(contract, decorated);
2202
+ if (nonPortablePaths.length > 0) return {
2203
+ ok: false,
2204
+ error: {
2205
+ kind: "non_portable_media",
2206
+ paths: nonPortablePaths
2207
+ }
1944
2208
  };
2209
+ return deriveRenderableManifestContent(contract, stored, () => decorated);
2210
+ }
2211
+ function toDesignBlockId(value) {
2212
+ if (value.trim().length === 0) return null;
2213
+ try {
2214
+ return asDesignBlockId(value);
2215
+ } catch {
2216
+ return null;
2217
+ }
1945
2218
  }
2219
+ blockDesignCapabilityMapFromDefinitions(systemBlockDefinitions);
2220
+ createManifestDefaultValues(siteHeaderManifest);
1946
2221
  //#endregion
1947
- //#region src/rendering/helpers/loadContent.ts
1948
- /**
1949
- * Type guard to check if result is a page
1950
- */
1951
- function isPageContent(result) {
1952
- return result.type === "page";
2222
+ //#region src/rendering/systemPages/bookingPageContent.ts
2223
+ /** Event and service booking pages use the same title/photo treatment. */
2224
+ function bookingHero({ id, title, eyebrow, summary = "", image }) {
2225
+ return {
2226
+ id,
2227
+ kind: "block.hero",
2228
+ purpose: "booking-introduction",
2229
+ content: {
2230
+ eyebrow,
2231
+ headlineInline: plainTextToInlineText(title),
2232
+ subheadline: summary,
2233
+ variant: image ? "split" : "micro",
2234
+ ...image ? { _sectionStyles: { background: {
2235
+ type: "image",
2236
+ image
2237
+ } } } : {}
2238
+ }
2239
+ };
1953
2240
  }
1954
- /**
1955
- * Type guard to check if result is an entry
1956
- */
1957
- function isEntryContent(result) {
1958
- return result.type === "entry";
2241
+ function bookingPageDesign(heroId, hasImage, { theme }, detailsId) {
2242
+ if (!theme.siteStyleId) return null;
2243
+ return {
2244
+ ...buildInitialPolicyPageDesignIntent(theme.siteStyleId),
2245
+ blockLookPins: [{
2246
+ blockId: asDesignBlockId(heroId),
2247
+ blockKind: "block.hero",
2248
+ choice: {
2249
+ kind: "user-pinned",
2250
+ value: asAppearancePresetId(hasImage ? "hero-photo-then-text" : "hero-page-head")
2251
+ }
2252
+ }, ...detailsId ? [{
2253
+ blockId: asDesignBlockId(detailsId),
2254
+ blockKind: "block.event-details",
2255
+ choice: {
2256
+ kind: "user-pinned",
2257
+ value: asAppearancePresetId("event-details-panel")
2258
+ }
2259
+ }] : []]
2260
+ };
1959
2261
  }
1960
- function isPageSurfaceContent(result) {
1961
- return result.type === "pageSurface";
2262
+ /** Booking pages always use the site's default section Looks. */
2263
+ function bookingSectionBlocks(sections, purpose) {
2264
+ return (sections ? compilePageSections(sections, {}).blocks : []).map((block) => ({
2265
+ id: block.id,
2266
+ kind: block.blockKind,
2267
+ purpose,
2268
+ content: block.content ?? {}
2269
+ }));
1962
2270
  }
1963
- function isContentLoadNotFoundError(error) {
1964
- if (typeof error !== "object" || error === null || !("status" in error)) return false;
1965
- return Reflect.get(error, "status") === 404;
2271
+ /** The hero owns h1, including when a description was authored with its own title. */
2272
+ function bookingDescription(body) {
2273
+ return {
2274
+ ...body,
2275
+ content: body.content.map(bookingDescriptionNode)
2276
+ };
1966
2277
  }
1967
- function getRejectedReason(result) {
1968
- return result.reason;
2278
+ function bookingDescriptionNode(node) {
2279
+ return {
2280
+ ...node,
2281
+ ...node.type === "heading" && node.attrs?.level === 1 ? { attrs: {
2282
+ ...node.attrs,
2283
+ level: 2
2284
+ } } : {},
2285
+ ...node.content ? { content: node.content.map(bookingDescriptionNode) } : {}
2286
+ };
1969
2287
  }
1970
- function toTemplateContentRenderSupport(support, siteId) {
2288
+ //#endregion
2289
+ //#region src/rendering/systemPages/codeOwnedPageBlocks.ts
2290
+ /** Code-owned pages share the ordinary design compiler and inline admission boundary. */
2291
+ function buildCodeOwnedPageBlocks(blocks, design, stored = null, ownerWrittenBlocks = []) {
2292
+ const allBlocks = [...blocks, ...ownerWrittenBlocks];
2293
+ const codeWrittenIds = new Set(blocks.map((block) => block.id));
2294
+ const result = buildOrdinaryPageRenderBlocks({
2295
+ source: "inline",
2296
+ blocks: allBlocks,
2297
+ stage: "published",
2298
+ theme: design.theme,
2299
+ designState: resolveOrdinaryPageDesignIntent({
2300
+ stored,
2301
+ siteStyleId: design.theme.siteStyleId ?? null,
2302
+ blocks: allBlocks
2303
+ }),
2304
+ resolveBlockContentContract: design.resolveBlockContentContract ?? createPublicBlockContentContractResolver(design.customBlocks)
2305
+ });
2306
+ const invalid = result.blocks.find((block) => block.admission.kind === "invalid" && block.id !== null && codeWrittenIds.has(block.id));
2307
+ if (invalid?.admission.kind === "invalid") throw new Error(`Code-owned page admission failed for ${invalid.kind} (${invalid.admission.error.kind})`);
1971
2308
  return {
1972
- bookingOfferingPresets: support.bookingOfferingPresets,
1973
- openingHours: support.openingHours,
1974
- siteTerms: support.siteTerms,
1975
- mailingList: support.mailingList,
1976
- interactionContext: support.interactionContext,
1977
- bookingTimeZone: support.bookingTimeZone,
1978
- now: support.now,
1979
- ...support.customBlocks ? { customBlocks: support.customBlocks } : {},
1980
- entriesByIdentifier: support.entriesByIdentifier,
1981
- ...support.mediaAssets ? { mediaAssets: support.mediaAssets } : {},
1982
- pagesByIdentifier: support.pagesByIdentifier,
1983
- routeMap: support.routeMap,
1984
- sdkConfig: support.sdkConfig,
1985
- site: support.site,
1986
- siteId,
1987
- supabaseUrl: support.supabaseUrl,
1988
- theme: support.theme
2309
+ ...result,
2310
+ blocks: result.blocks.filter((block) => block.admission.kind !== "invalid")
2311
+ };
2312
+ }
2313
+ function createPublicBlockContentContractResolver(customBlocks) {
2314
+ const customRegistry = createCustomBlockRegistry({ customBlocks: customBlocks?.map((manifest) => ({
2315
+ manifest,
2316
+ source: { kind: "managed-database" }
2317
+ })) });
2318
+ return (blockKind) => {
2319
+ const manifest = customRegistry.findManifest(blockKind)?.manifest ?? getBlockDefinition(blockKind)?.manifest;
2320
+ return manifest ? compileManifestContentContract(manifest) : null;
1989
2321
  };
1990
2322
  }
2323
+ //#endregion
2324
+ //#region src/rendering/systemPages/bookingPageIdentity.ts
1991
2325
  /**
1992
- * Server-side helper to fetch content by path.
1993
- *
1994
- * Returns a discriminated union - either page data (ready for `<Page>` component)
1995
- * or raw entry data (for custom rendering).
1996
- *
1997
- * @example Dynamic routing with both pages and entries
1998
- * ```tsx
1999
- * import { loadContent, Page, isPageContent } from '@riverbankcms/sdk';
2000
- *
2001
- * export default async function DynamicRoute({ params }) {
2002
- * const content = await loadContent({
2003
- * client,
2004
- * siteId: 'site-123',
2005
- * path: `/${params.slug?.join('/') || ''}`,
2006
- * });
2007
- *
2008
- * if (isPageContent(content)) {
2009
- * if (!content.theme) throw new MissingSdkThemeError(content.siteId, 'cms_theme_absent');
2010
- * return <Page {...content} />;
2011
- * }
2012
- *
2013
- * // Render entry with custom UI
2014
- * return (
2015
- * <article>
2016
- * <h1>{content.entry.title}</h1>
2017
- * <div>{content.entry.content.body}</div>
2018
- * </article>
2019
- * );
2020
- * }
2021
- * ```
2022
- *
2023
- * @example Entry-specific rendering based on content type
2024
- * ```tsx
2025
- * const content = await loadContent({ client, siteId, path });
2026
- *
2027
- * if (content.type === 'entry') {
2028
- * switch (content.entry.type) {
2029
- * case 'blog-post':
2030
- * return <BlogPost entry={content.entry} theme={content.theme} />;
2031
- * case 'product':
2032
- * return <ProductPage entry={content.entry} theme={content.theme} />;
2033
- * default:
2034
- * return <GenericEntry entry={content.entry} />;
2035
- * }
2036
- * }
2037
- *
2038
- * if (!content.theme) throw new MissingSdkThemeError(content.siteId, 'cms_theme_absent');
2039
- * return <Page {...content} />;
2040
- * ```
2041
- *
2042
- * @example Preview mode for draft content
2043
- * ```tsx
2044
- * const content = await loadContent({
2045
- * client,
2046
- * siteId,
2047
- * path,
2048
- * preview: true, // Fetches draft content for both pages and entries
2049
- * });
2050
- * ```
2326
+ * How a booking page names itself. Only a page for one date speaks in that
2327
+ * date's own words: a date chooser or a course run stands for all its dates,
2328
+ * so it keeps the event's, whatever its first date is called.
2051
2329
  */
2052
- async function loadContent(params) {
2053
- return loadContentWithDeps(DEFAULT_RESOLVE_BLOCK_DATA_DEPS, params);
2054
- }
2055
- async function loadContentWithDeps(deps, params) {
2056
- const { client, siteId, path, preview = false, forceSite, dataLoaderOverrides, searchParams } = params;
2057
- const [siteResult, contentResult] = await Promise.allSettled([client.getSite({
2058
- id: siteId,
2059
- currentPath: path,
2060
- ...forceSite ? { force: true } : {}
2061
- }), client.getPage({
2062
- siteId,
2063
- path,
2064
- preview
2065
- })]);
2066
- if (siteResult.status === "rejected" || contentResult.status === "rejected") {
2067
- const failures = [siteResult, contentResult].filter((result) => result.status === "rejected").map(getRejectedReason);
2068
- throw failures.find((error) => !isContentLoadNotFoundError(error)) ?? failures[0];
2069
- }
2070
- const site = siteResult.value;
2071
- const contentResponse = contentResult.value;
2072
- return loadContentFromContentResponseWithDeps(deps, {
2073
- client,
2074
- siteId,
2075
- site,
2076
- contentResponse,
2077
- preview,
2078
- dataLoaderOverrides,
2079
- searchParams
2080
- });
2330
+ function bookingPageIdentity(selection) {
2331
+ const event = selectionRepresentativeEvent(selection);
2332
+ const ownTitle = selection.kind === "occurrence" ? event.occurrenceTitle ?? null : null;
2333
+ const ownDescription = selection.kind === "occurrence" ? event.occurrenceDescription ?? null : null;
2334
+ return {
2335
+ title: ownTitle ?? event.title,
2336
+ ownTitle,
2337
+ ownDescription
2338
+ };
2081
2339
  }
2082
- async function loadContentFromContentResponseWithDeps(deps, params) {
2083
- const { client, siteId, site, contentResponse, preview = false, dataLoaderOverrides, searchParams } = params;
2084
- const previewStage = preview ? "preview" : "published";
2085
- const blockDataPolicy = createBlockDataLoadPolicy(dataLoaderOverrides, normalizeDataLoaderSearchParams(searchParams));
2086
- const support = buildSiteRenderSupport(site, collectMediaAssetSidecar(contentResponse.mediaAssets));
2087
- const templateContentSupport = toTemplateContentRenderSupport(support, siteId);
2088
- if (isEntryResponse(contentResponse)) {
2089
- const entryData = contentResponse.entry;
2090
- const draftContent = entryData.draftContent;
2091
- const hasDraftContent = draftContent && Object.keys(draftContent).length > 0;
2092
- const entry = {
2093
- id: entryData.id,
2094
- type: entryData.type,
2095
- title: entryData.title,
2096
- slug: entryData.slug,
2097
- path: entryData.path,
2098
- status: entryData.status,
2099
- publishAt: entryData.publishAt,
2100
- lastPublishedAt: entryData.lastPublishedAt,
2101
- content: preview && hasDraftContent ? draftContent : entryData.content,
2102
- metaTitle: preview ? entryData.draftMetaTitle ?? entryData.metaTitle : entryData.metaTitle,
2103
- metaDescription: preview ? entryData.draftMetaDescription ?? entryData.metaDescription : entryData.metaDescription,
2104
- createdAt: entryData.createdAt,
2105
- updatedAt: entryData.updatedAt
2106
- };
2107
- const { templatePage, resolvedData, prefetchedBlockData, loaderSnapshot, loaderFailures } = await processEntryTemplate({
2108
- theme: support.theme,
2109
- bookingTimeZone: support.bookingTimeZone,
2110
- now: support.now,
2111
- templates: contentResponse.templates,
2112
- entrySlots: contentResponse.entrySlots,
2113
- entry,
2114
- siteId,
2115
- previewStage,
2116
- blockDataPolicy,
2117
- client,
2118
- deps,
2119
- customBlocks: support.customBlocks
2120
- });
2121
- return {
2122
- type: "entry",
2123
- entry,
2124
- templatePage,
2125
- resolvedData,
2126
- dataContext: {
2127
- ...siteBlockRenderContext(support),
2128
- previewStage,
2129
- prefetchedBlockData,
2130
- loaderSnapshot,
2131
- loaderFailures,
2132
- contentEntry: {
2133
- ...entry.content ?? {},
2134
- id: entry.id,
2135
- slug: entry.slug,
2136
- contentTypeSlug: entry.type,
2137
- _entryId: entry.id,
2138
- _entrySlug: entry.slug,
2139
- _contentTypeSlug: entry.type
2140
- }
2141
- },
2142
- ...templateContentSupport
2143
- };
2144
- }
2145
- if (isPageSurfaceResponse(contentResponse)) {
2146
- const pageSurfaceData = contentResponse.pageSurface;
2147
- const pageSurface = {
2148
- id: pageSurfaceData.id,
2149
- routeId: pageSurfaceData.routeId,
2150
- readinessState: pageSurfaceData.readinessState,
2151
- subject: pageSurfaceData.subject,
2152
- title: pageSurfaceData.title,
2153
- slug: pageSurfaceData.slug,
2154
- path: pageSurfaceData.path,
2155
- status: pageSurfaceData.status,
2156
- publishAt: pageSurfaceData.publishAt,
2157
- lastPublishedAt: pageSurfaceData.lastPublishedAt,
2158
- content: pageSurfaceData.content,
2159
- metaTitle: preview ? pageSurfaceData.draftMetaTitle ?? pageSurfaceData.metaTitle : pageSurfaceData.metaTitle,
2160
- metaDescription: preview ? pageSurfaceData.draftMetaDescription ?? pageSurfaceData.metaDescription : pageSurfaceData.metaDescription,
2161
- createdAt: pageSurfaceData.createdAt,
2162
- updatedAt: pageSurfaceData.updatedAt,
2163
- contentSource: pageSurfaceData.contentSource
2164
- };
2165
- const { templatePage, resolvedData, prefetchedBlockData, loaderSnapshot, loaderFailures } = await processTemplatePage({
2166
- entry: pageSurface,
2167
- theme: support.theme,
2168
- pageSections: contentResponse.pageSections,
2169
- bookingTimeZone: support.bookingTimeZone,
2170
- now: support.now,
2171
- templates: contentResponse.templates,
2172
- slotContent: contentResponse.surfaceSlots,
2173
- pageName: pageSurface.title || "Page Surface Template",
2174
- pagePath: pageSurface.path || "/",
2175
- pagePurpose: "page-surface-template",
2176
- siteId,
2177
- previewStage,
2178
- blockDataPolicy,
2179
- renderTargetSource: {
2180
- kind: "page-surface-template",
2181
- pageSurfaceId: pageSurface.id,
2182
- routeId: pageSurface.routeId,
2183
- subject: pageSurface.subject
2184
- },
2185
- client,
2186
- deps,
2187
- customBlocks: support.customBlocks
2188
- });
2189
- return {
2190
- type: "pageSurface",
2191
- pageSurface,
2192
- templatePage,
2193
- resolvedData,
2194
- dataContext: {
2195
- ...siteBlockRenderContext(support),
2196
- previewStage,
2197
- prefetchedBlockData,
2198
- loaderSnapshot,
2199
- loaderFailures,
2200
- pageSurface: {
2201
- ...pageSurface.content ?? {},
2202
- id: pageSurface.id,
2203
- slug: pageSurface.slug,
2204
- subject: pageSurface.subject,
2205
- _pageSurfaceId: pageSurface.id,
2206
- _pageSurfaceSlug: pageSurface.slug
2207
- },
2208
- subject: pageSurface.subject
2209
- },
2210
- ...templateContentSupport
2211
- };
2212
- }
2213
- const { page: pageData } = contentResponse;
2214
- const pageRecord = pageData;
2215
- const canonicalPagePath = pageData.path ?? pageRecord.path ?? "/";
2216
- const pageOutline = buildRenderablePageOutline({
2217
- name: pageData.name,
2218
- path: canonicalPagePath,
2219
- fallbackPath: "/",
2220
- purpose: pageData.purpose,
2221
- blocks: pageData.blocks,
2222
- previewStage,
2223
- customBlocks: support.customBlocks
2224
- });
2225
- const prefetched = await resolveBlockDataWithDeps(deps, {
2226
- bookingTimeZone: support.bookingTimeZone,
2227
- now: support.now,
2228
- page: projectRenderablePageOutline(pageOutline),
2229
- siteId,
2230
- renderTarget: {
2231
- kind: "page",
2232
- pageId: pageData.id
2233
- },
2234
- previewStage,
2235
- policy: blockDataPolicy,
2236
- client,
2237
- customBlocks: support.customBlocks
2238
- });
2340
+ /** A date's description is plain text: blank lines part paragraphs, single ones break lines. */
2341
+ function plainTextDoc(text) {
2239
2342
  return {
2240
- type: "page",
2241
- pageId: pageRecord.id,
2242
- routeId: pageRecord.routeId ?? null,
2243
- pageMetadata: projectPagePreviewMetadata(pageRecord, pageData.name, canonicalPagePath),
2244
- page: pageOutline,
2245
- runtimeJoins: pageData.runtimeJoins,
2246
- theme: support.theme,
2247
- siteId,
2248
- ...support.customBlocks ? { customBlocks: support.customBlocks } : {},
2249
- resolvedData: prefetched.resolvedData,
2250
- dataContext: {
2251
- previewStage,
2252
- ...siteBlockRenderContext(support),
2253
- prefetchedBlockData: prefetched,
2254
- loaderSnapshot: prefetched.loaderSnapshot,
2255
- loaderFailures: prefetched.loaderFailures
2256
- },
2257
- bookingOfferingPresets: support.bookingOfferingPresets,
2258
- openingHours: support.openingHours,
2259
- siteTerms: support.siteTerms,
2260
- mailingList: support.mailingList,
2261
- interactionContext: support.interactionContext,
2262
- bookingTimeZone: support.bookingTimeZone,
2263
- now: support.now,
2264
- site: support.site,
2265
- sdkConfig: support.sdkConfig,
2266
- supabaseUrl: support.supabaseUrl,
2267
- routeMap: support.routeMap,
2268
- pagesByIdentifier: support.pagesByIdentifier,
2269
- entriesByIdentifier: support.entriesByIdentifier,
2270
- ...support.mediaAssets ? { mediaAssets: support.mediaAssets } : {}
2271
- };
2272
- }
2273
- function projectPagePreviewMetadata(page, pageName, canonicalPath) {
2343
+ type: "doc",
2344
+ content: text.split(/\n\s*\n/).map((paragraph) => ({
2345
+ type: "paragraph",
2346
+ content: paragraph.split("\n").flatMap((line, index) => [...index > 0 ? [{ type: "hardBreak" }] : [], ...line ? [{
2347
+ type: "text",
2348
+ text: line
2349
+ }] : []])
2350
+ }))
2351
+ };
2352
+ }
2353
+ //#endregion
2354
+ //#region src/rendering/systemPages/bookingPageOutline.ts
2355
+ const BOOKING_PAGE_BLOCK_IDS = {
2356
+ hero: "booking-hero",
2357
+ details: "booking-details",
2358
+ description: "booking-description",
2359
+ registration: "booking-registration",
2360
+ refundPolicy: "booking-refund-policy"
2361
+ };
2362
+ /** The fixed booking outline; only its block content and style's Looks vary. */
2363
+ function buildBookingPageOutline(selection, design, sections) {
2364
+ return outlineFromFacts(bookingPageFacts(selection), design, sections);
2365
+ }
2366
+ function bookingPageFacts(selection) {
2274
2367
  return {
2275
- ...projectDraftPageMetadata(page, pageName, canonicalPath),
2276
- ...projectPublishedPageMetadata(page, pageName, canonicalPath)
2368
+ event: selectionRepresentativeEvent(selection),
2369
+ identity: bookingPageIdentity(selection),
2370
+ details: bookingDetailEvents(selection),
2371
+ registration: registrationDataForEventSelection(selection)
2277
2372
  };
2278
2373
  }
2279
- function projectDraftPageMetadata(page, pageName, canonicalPath) {
2374
+ function outlineFromFacts({ event, identity, details }, design, sections) {
2375
+ const sectionBlocks = bookingSectionBlocks(sections, "event-section");
2376
+ const main = buildCodeOwnedPageBlocks(bookingMainBlocks(event, identity, details.length > 0), design, bookingPageDesign(BOOKING_PAGE_BLOCK_IDS.hero, Boolean(event.presentation?.image), design, BOOKING_PAGE_BLOCK_IDS.details), sectionBlocks);
2377
+ const aside = buildCodeOwnedPageBlocks([{
2378
+ id: BOOKING_PAGE_BLOCK_IDS.registration,
2379
+ kind: "block.event-registration",
2380
+ purpose: "booking",
2381
+ content: {
2382
+ pageKind: "bookingPage",
2383
+ heading: "",
2384
+ buttonText: "Register",
2385
+ showCapacity: true,
2386
+ showVenue: true
2387
+ }
2388
+ }, {
2389
+ id: BOOKING_PAGE_BLOCK_IDS.refundPolicy,
2390
+ kind: "block.body-text",
2391
+ purpose: "refund-policy",
2392
+ content: { body: {
2393
+ type: "doc",
2394
+ content: [{
2395
+ type: "heading",
2396
+ attrs: { level: 2 },
2397
+ content: [{
2398
+ type: "text",
2399
+ text: "Cancelling"
2400
+ }]
2401
+ }, {
2402
+ type: "paragraph",
2403
+ content: [{
2404
+ type: "text",
2405
+ text: cancellingSentence(event)
2406
+ }]
2407
+ }]
2408
+ } }
2409
+ }], design);
2280
2410
  return {
2281
- draftTitle: page.draftTitle ?? page.name ?? pageName,
2282
- draftPath: page.draftPath ?? page.path ?? canonicalPath,
2283
- draftStatus: page.draftStatus ?? page.status ?? "draft",
2284
- draftMetaTitle: page.draftMetaTitle ?? null,
2285
- draftMetaDescription: page.draftMetaDescription ?? null
2411
+ name: identity.title,
2412
+ path: design.path,
2413
+ purpose: "event-booking",
2414
+ blocks: main.blocks,
2415
+ aside: aside.blocks,
2416
+ runtimeJoins: []
2286
2417
  };
2287
2418
  }
2288
- function projectPublishedPageMetadata(page, pageName, canonicalPath) {
2419
+ function cancellingSentence(event) {
2420
+ const { refunds } = event.cancellationPolicy;
2421
+ return event.pricing.kind === "free" ? PUBLIC_FREE_CANCELLATION : describePublicRefundPolicy(refunds);
2422
+ }
2423
+ /** A date's own description takes the place of both the event's summary and its body. */
2424
+ function heroSummary(event, identity) {
2425
+ return identity.ownDescription ? "" : event.presentation?.summary ?? event.description ?? "";
2426
+ }
2427
+ function descriptionBody(event, identity) {
2428
+ if (identity.ownDescription) return plainTextDoc(identity.ownDescription);
2429
+ return event.content?.body ? bookingDescription(event.content.body) : null;
2430
+ }
2431
+ function bookingMainBlocks(event, identity, hasDetails) {
2432
+ const image = event.presentation?.image;
2433
+ const hero = bookingHero({
2434
+ id: BOOKING_PAGE_BLOCK_IDS.hero,
2435
+ title: identity.title,
2436
+ eyebrow: "Event booking",
2437
+ summary: heroSummary(event, identity),
2438
+ image
2439
+ });
2440
+ const description = descriptionBody(event, identity);
2441
+ return [
2442
+ {
2443
+ ...hero,
2444
+ content: {
2445
+ ...hero.content,
2446
+ ...event.facts?.length ? { _pageFacts: event.facts } : {}
2447
+ }
2448
+ },
2449
+ ...hasDetails ? [{
2450
+ id: BOOKING_PAGE_BLOCK_IDS.details,
2451
+ kind: "block.event-details",
2452
+ purpose: "event-facts",
2453
+ content: {
2454
+ heading: "",
2455
+ showTitle: false,
2456
+ showDescription: false,
2457
+ showCapacity: false,
2458
+ showAcceptedPasses: true,
2459
+ showAcceptedMemberships: true,
2460
+ showCost: true,
2461
+ showMap: true,
2462
+ showOtherDates: true,
2463
+ showVenue: true
2464
+ }
2465
+ }] : [],
2466
+ ...description ? [{
2467
+ id: BOOKING_PAGE_BLOCK_IDS.description,
2468
+ kind: "block.body-text",
2469
+ purpose: "event-description",
2470
+ content: { body: description }
2471
+ }] : []
2472
+ ];
2473
+ }
2474
+ /** A multi-run parent must not imply that one run's facts describe all its dates. */
2475
+ function bookingDetailEvents(selection) {
2476
+ switch (selection.kind) {
2477
+ case "occurrence": return [selection.event];
2478
+ case "dateChoice": return selection.dates;
2479
+ case "wholeSeriesRun": return [selection.run.representative];
2480
+ case "wholeSeriesParent": {
2481
+ const panel = planWholeSeriesParentBooking(selection.eligibleRuns);
2482
+ return panel.kind === "single" ? [panel.run.representative] : [];
2483
+ }
2484
+ case "wholeSeriesParentUnavailable": return [];
2485
+ }
2486
+ }
2487
+ /** Seed the route's admitted facts, never select or fetch its Event a second time. */
2488
+ function bookingPageSeedData({ registration, details }) {
2289
2489
  return {
2290
- title: page.name ?? pageName,
2291
- path: canonicalPath,
2292
- status: page.status ?? page.draftStatus ?? "draft",
2293
- publishedAt: page.publishedAt ?? null,
2294
- lastPublishedAt: page.lastPublishedAt ?? null,
2295
- publishedMetaTitle: page.publishedMetaTitle ?? null,
2296
- publishedMetaDescription: page.publishedMetaDescription ?? null,
2297
- ogImageId: page.ogImageId ?? null
2490
+ [BOOKING_PAGE_BLOCK_IDS.registration]: { ..."events" in registration ? { events: registration.events } : { wholeSeriesRunEvents: registration.wholeSeriesRunEvents } },
2491
+ [BOOKING_PAGE_BLOCK_IDS.details]: { eventDetailsData: {
2492
+ events: details,
2493
+ sitePasses: { passes: [] },
2494
+ siteMemberships: { memberships: [] }
2495
+ } }
2298
2496
  };
2299
2497
  }
2300
- /**
2301
- * Type guard to check if API response is an entry
2302
- */
2303
- function isEntryResponse(response) {
2304
- return "entry" in response;
2498
+ //#endregion
2499
+ //#region src/rendering/systemPages/serviceBookingOutline.ts
2500
+ const SERVICE_BOOKING_BLOCK_IDS = {
2501
+ hero: "service-hero",
2502
+ details: "service-details",
2503
+ description: "service-description",
2504
+ booking: "service-booking"
2505
+ };
2506
+ function buildServiceBookingOutline(service, design, { content, sections }) {
2507
+ const ids = SERVICE_BOOKING_BLOCK_IDS;
2508
+ const image = content.image;
2509
+ const sectionBlocks = bookingSectionBlocks(sections, "service-section");
2510
+ const main = buildCodeOwnedPageBlocks([
2511
+ bookingHero({
2512
+ id: ids.hero,
2513
+ title: service.title,
2514
+ eyebrow: "One-to-one",
2515
+ summary: content.summary,
2516
+ image
2517
+ }),
2518
+ {
2519
+ id: ids.details,
2520
+ kind: "block.service-details",
2521
+ purpose: "service-facts",
2522
+ content: { heading: "Good to know" }
2523
+ },
2524
+ ...content.body ? [{
2525
+ id: ids.description,
2526
+ kind: "block.body-text",
2527
+ purpose: "service-description",
2528
+ content: { body: bookingDescription(content.body) }
2529
+ }] : []
2530
+ ], design, bookingPageDesign(ids.hero, Boolean(image), design), sectionBlocks);
2531
+ const aside = buildCodeOwnedPageBlocks([{
2532
+ id: ids.booking,
2533
+ kind: "block.appointment-booking",
2534
+ purpose: "service-booking",
2535
+ content: {
2536
+ pageKind: "bookingPage",
2537
+ formId: "booking-form",
2538
+ serviceId: service.id,
2539
+ heading: ""
2540
+ }
2541
+ }], design);
2542
+ return {
2543
+ name: service.title,
2544
+ path: design.path,
2545
+ purpose: "service-booking",
2546
+ blocks: main.blocks,
2547
+ aside: aside.blocks
2548
+ };
2305
2549
  }
2306
- function isPageSurfaceResponse(response) {
2307
- return response.type === "pageSurface";
2550
+ //#endregion
2551
+ //#region src/rendering/systemPages/servicePageContent.ts
2552
+ function parseServicePageContent(source) {
2553
+ const content = source.content;
2554
+ const image = mediaSchema.safeParse(content?.image);
2555
+ return {
2556
+ content: {
2557
+ summary: typeof content?.summary === "string" ? content.summary : "",
2558
+ image: image.success && image.data.type === "image" ? image.data : null,
2559
+ body: isCanonicalRichTextDoc(content?.body) ? content.body : null
2560
+ },
2561
+ sections: source.sections,
2562
+ mediaAssets: source.mediaAssets
2563
+ };
2308
2564
  }
2309
2565
  //#endregion
2310
- export { loadContent as i, isPageContent as n, isPageSurfaceContent as r, isEntryContent as t };
2566
+ export { buildTemplatePageOutline as _, bookingDetailEvents as a, buildBookingPageOutline as c, buildCodeOwnedPageBlocks as d, createPublicBlockContentContractResolver as f, bookingSectionBlocks as g, bookingPageDesign as h, BOOKING_PAGE_BLOCK_IDS as i, bookingPageIdentity as l, bookingHero as m, SERVICE_BOOKING_BLOCK_IDS as n, bookingPageFacts as o, bookingDescription as p, buildServiceBookingOutline as r, bookingPageSeedData as s, parseServicePageContent as t, plainTextDoc as u, readStoredSectionValues as v, selectBlocksForDeclaredEntrySlot as y };