@riverbankcms/sdk 0.165.0 → 0.167.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 (246) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +5 -0
  3. package/dist/_dts/{BlocksIslandsHydrator-CdsSMQEv.d.ts → BlocksIslandsHydrator-Dgb-ptph.d.ts} +1 -1
  4. package/dist/_dts/{Page-D6gp2Ipb.d.ts → Page-Bs3WxFgr.d.ts} +20 -258
  5. package/dist/_dts/{SdkPreviewMode-DNXAvnet.d.ts → SdkPreviewMode-DtUCsaHY.d.ts} +26 -3
  6. package/dist/_dts/{client-BkkExozE.d.ts → client-CwsI23pj.d.ts} +13 -1
  7. package/dist/_dts/{content-types-CXNAD7ef.d.ts → content-types-CAeP_-cV.d.ts} +3 -3
  8. package/dist/_dts/{contracts-XRXhbLWP.d.ts → contracts-BXHCiF-b.d.ts} +8 -5
  9. package/dist/_dts/{footerPageOutline-BP2bJYdY.d.ts → footerPageOutline-Bb2gbppW.d.ts} +6 -6
  10. package/dist/_dts/{generatePageMetadata-DcMtbztV.d.ts → generatePageMetadata-DaBBDx7M.d.ts} +2 -2
  11. package/dist/_dts/{index-DKNEgSOS.d.ts → index-5_jf52sZ.d.ts} +2 -2
  12. package/dist/_dts/{index-CQfJhOEA.d.ts → index-C20yUyob.d.ts} +1 -1
  13. package/dist/_dts/{index-CRRiddNp.d.ts → index-CS6b1B-c.d.ts} +4 -4
  14. package/dist/_dts/{index-B4ozSzFP.d.ts → index-ChpjHK0U.d.ts} +9737 -8316
  15. package/dist/_dts/{index-BdkHhyf8.d.ts → index-D7EbliE3.d.ts} +1 -1
  16. package/dist/_dts/{index-RXkE3a7M.d.ts → index-DeHDwMfu.d.ts} +4 -3
  17. package/dist/_dts/{index-DAPTSmBM.d.ts → index-RugyUnqR.d.ts} +2499 -2218
  18. package/dist/_dts/{index-C_3kdrUb.d.ts → index-bDln38Hm.d.ts} +2 -2
  19. package/dist/_dts/{loadContent-B9vJMq3s.d.ts → loadContent-CTqcL7CS.d.ts} +9 -6
  20. package/dist/_dts/resolveBlockData-C3s9WMPs.d.ts +136 -0
  21. package/dist/_dts/{resolvePageContent-DIQyYUi-.d.ts → resolvePageContent-JPwgRxwh.d.ts} +3 -2
  22. package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
  23. package/dist/_dts/sdk/src/client/types.d.ts +2 -2
  24. package/dist/_dts/sdk/src/client.d.ts +9 -6
  25. package/dist/_dts/sdk/src/config/index.d.ts +6 -6
  26. package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
  27. package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
  28. package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +20 -0
  29. package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +2 -0
  30. package/dist/_dts/sdk/src/data/types.d.ts +54 -0
  31. package/dist/_dts/sdk/src/index.d.ts +8 -8
  32. package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
  33. package/dist/_dts/sdk/src/metadata/index.d.ts +6 -1
  34. package/dist/_dts/sdk/src/navigation/index.d.ts +2 -2
  35. package/dist/_dts/sdk/src/next/index.d.ts +9 -8
  36. package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
  37. package/dist/_dts/sdk/src/page-converter/index.d.ts +36 -48
  38. package/dist/_dts/sdk/src/portal/client.d.ts +1 -1
  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 +2 -0
  45. package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +3 -0
  46. package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +260 -0
  47. package/dist/_dts/sdk/src/rendering/index.d.ts +8 -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/{themeAdmission-D_qtGYAT.d.ts → sdk/src/rendering/themeAdmission.d.ts} +3 -1
  51. package/dist/_dts/sdk/src/routing/index.d.ts +5 -5
  52. package/dist/_dts/sdk/src/server.d.ts +7 -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/{types-BDF73NzM.d.ts → types-BlaCuPLr.d.ts} +2 -2
  56. package/dist/_dts/{types-Cl0nP6al.d.ts → types-CwtTcaQP.d.ts} +3 -3
  57. package/dist/_dts/{types-mstFvhK4.d.ts → types-D-WElMCy.d.ts} +8 -7
  58. package/dist/_dts/{validation-DVWqSvjK.d.ts → validation-Y5wD9fGK.d.ts} +4 -4
  59. package/dist/client/{BlocksIslandsHydrator-CzKpH9Pm.mjs → BlocksIslandsHydrator-DFqkx158.mjs} +31 -24
  60. package/dist/client/{BookingMailingListNote-rUqsBN7L.mjs → BookingMailingListNote-CCVXX1LN.mjs} +2 -2
  61. package/dist/client/{CalendarNavigationChevron-YGzw2IPB.mjs → CalendarNavigationChevron-DQwJ7BPx.mjs} +167 -18
  62. package/dist/client/{CheckboxChoice-DlTC4J2a.mjs → CheckboxChoice-CZ-anOqV.mjs} +1 -1
  63. package/dist/client/{DemoBookingPortalAccess-D2LyS_Bi.mjs → DemoBookingPortalAccess-DdkY86qI.mjs} +6 -6
  64. package/dist/client/{DemoPortalSignInLink-BaFg2Uit.mjs → DemoPortalSignInLink-B9YrzZt2.mjs} +1 -1
  65. package/dist/client/{EventCalendar.client-tRrhPscX.mjs → EventCalendar.client-DAeQPV76.mjs} +11 -30
  66. package/dist/client/{EventCombined.client-6cfAVtnZ.mjs → EventCombined.client-Bus9R0bj.mjs} +137 -61
  67. package/dist/client/{EventEmbeddedCheckoutStep-CDNUpI0S.mjs → EventEmbeddedCheckoutStep-D_14yqAU.mjs} +27 -2
  68. package/dist/client/{EventItem-dILw2PN_.mjs → EventItem-DPBLjGwj.mjs} +75 -13
  69. package/dist/client/{EventListWeekNavigation-ClgLtjNY.mjs → EventListWeekNavigation-D6cwU82_.mjs} +1 -1
  70. package/dist/client/{EventListing.client-BNueAHmU.mjs → EventListing.client-Bogi_SnJ.mjs} +3 -3
  71. package/dist/client/{EventListing.view-DtVbKVkt.mjs → EventListing.view-CEumpN7i.mjs} +35 -51
  72. package/dist/client/{EventRegistrationPayment-CzkG0NSJ.mjs → EventRegistrationPayment-CIQw6vNy.mjs} +113 -11
  73. package/dist/client/{LocationMapActions-zWQsJhE5.mjs → LocationMapActions-BVO-qx4q.mjs} +2 -2
  74. package/dist/client/{MapDrawingSvg-D1AO_o4h.mjs → MapDrawingSvg-CcGaFawl.mjs} +22 -2
  75. package/dist/client/{Page-DUr2YhFR.mjs → Page-D4_H_u9V.mjs} +23892 -32266
  76. package/dist/client/{ProtectedSubmitButton-2fJqT_NR.mjs → ProtectedSubmitButton-8DuDw2ag.mjs} +1 -1
  77. package/dist/client/{StepIndicator-udNHcpOT.mjs → StepIndicator-Dptantmg.mjs} +3 -3
  78. package/dist/client/{TabBarFragment-C_kt-PXh.mjs → TabBarFragment-BxEGsKUx.mjs} +19 -19
  79. package/dist/client/{ThemedButton-Cfbo1bfh.mjs → ThemedButton-8jUc02mZ.mjs} +64 -2
  80. package/dist/client/{accordion-3CYNWzTS.mjs → accordion--EUHmEGa.mjs} +1 -1
  81. package/dist/client/{booking-form.client-BSbWgLyx.mjs → booking-form.client-BCXwOnhc.mjs} +19 -14
  82. package/dist/client/{bookingForm-2MoFBWSt.mjs → bookingForm-sHHcdism.mjs} +4 -4
  83. package/dist/client/bookings.mjs +6 -6
  84. package/dist/client/{carousel-Cu5mcpO-.mjs → carousel-Cp9xPBFZ.mjs} +2 -2
  85. package/dist/client/{carousel.client-CQLV8_Al.mjs → carousel.client-BO7sCEpH.mjs} +1 -1
  86. package/dist/client/{cart-CDc6x9cR.mjs → cart-CCZZC-Lq.mjs} +3 -3
  87. package/dist/client/{cart.client-BWS2r5Ef.mjs → cart.client-B7JfA19I.mjs} +1 -1
  88. package/dist/client/{checkout-CkxPqSwD.mjs → checkout-CipmYL4A.mjs} +3 -3
  89. package/dist/client/{checkout.client-DJfomKQc.mjs → checkout.client-DraalWdH.mjs} +1 -1
  90. package/dist/client/client.mjs +9550 -17
  91. package/dist/client/{context-CBV21-9L.mjs → context-Cv3QHjAF.mjs} +11 -6
  92. package/dist/client/{cta-Bw-al3cs.mjs → cta-P2vJVTEn.mjs} +45 -28
  93. package/dist/client/{dateFormatting-CFIUJ4Uf.mjs → dateFormatting-D8D47VT4.mjs} +1 -1
  94. package/dist/client/{demoPortalMagicLink-D0veHJyi.mjs → demoPortalMagicLink-CXWZoV-d.mjs} +1 -1
  95. package/dist/client/{enhanceHeaderSection-CEqqq92r.mjs → enhanceHeaderSection-BkAro1DJ.mjs} +4 -4
  96. package/dist/client/{event-details.client-Bk2kQ7ax.mjs → event-details.client-dLmyuPap.mjs} +2 -2
  97. package/dist/client/{event-registration.client-QMqtIywj.mjs → event-registration.client-BEhC2_-Y.mjs} +34 -20
  98. package/dist/client/{eventCalendar-BTDTMosr.mjs → eventCalendar-FBMS2Cpb.mjs} +4 -4
  99. package/dist/client/{eventCombined-BC7a709c.mjs → eventCombined-BrBhUvGe.mjs} +4 -4
  100. package/dist/client/{eventDetails-DL08GpUc.mjs → eventDetails-C7WUrbZ2.mjs} +2 -2
  101. package/dist/client/{eventListing-BfzuEQp_.mjs → eventListing-Bih-BgQM.mjs} +4 -4
  102. package/dist/client/{eventRegistration-Lfyzh1Ab.mjs → eventRegistration-DfTlqGbl.mjs} +4 -4
  103. package/dist/client/{form-L-xZOBUS.mjs → form-Bw1uuiUs.mjs} +3 -3
  104. package/dist/client/{form.client-BtpK3TZW.mjs → form.client-pZ-9gN33.mjs} +5 -5
  105. package/dist/client/{form.parts-Djos5Un4.mjs → form.parts-PXlu6XQO.mjs} +3 -3
  106. package/dist/client/{formatDate-DGmrm7YB.mjs → formatDate-DI3DP48e.mjs} +1 -1
  107. package/dist/client/gifting/client.mjs +3 -4
  108. package/dist/client/{headerSection-f16OGkz-.mjs → headerSection-BpJYUMd6.mjs} +2 -2
  109. package/dist/client/{mediaAssets-DHAmrVIi.mjs → mediaAssets-DpPauppt.mjs} +1 -1
  110. package/dist/client/{mediaContext-CwT6ZOm7.mjs → mediaContext-BLo4NtjP.mjs} +25 -19
  111. package/dist/client/{newsletter-form.client-DpHNZc7k.mjs → newsletter-form.client-CSoP0cGR.mjs} +6 -6
  112. package/dist/client/{newsletter-form.parts-CLGH20PL.mjs → newsletter-form.parts-DDbX_Sj0.mjs} +2 -2
  113. package/dist/client/{newsletterForm-BEU0Ocu9.mjs → newsletterForm-vCxYRar_.mjs} +3 -3
  114. package/dist/client/{noop-CQU7tiMg.mjs → noop-ByVtIWf4.mjs} +420 -170
  115. package/dist/client/portal/client.mjs +13 -14
  116. package/dist/client/{product-detail.client-Be-om1BT.mjs → product-detail.client-7Pi6avM-.mjs} +1 -1
  117. package/dist/client/{product-list.client-DR7hD5Vs.mjs → product-list.client-DEad-Pma.mjs} +1 -1
  118. package/dist/client/{productDetail-BD42UOmG.mjs → productDetail-G1SMXG13.mjs} +3 -3
  119. package/dist/client/{productList-CSk8sXCl.mjs → productList-B21TGdpT.mjs} +3 -3
  120. package/dist/client/{propsDecoder-C_Y6VYnF.mjs → propsDecoder-B3vIBkex.mjs} +4 -5
  121. package/dist/client/{registry.server-CIKtTsCl.mjs → registry.server-B8aQhJpO.mjs} +399 -473
  122. package/dist/client/rendering/client.mjs +29 -28
  123. package/dist/client/rendering/islands.mjs +1 -1
  124. package/dist/client/rendering.mjs +70 -8
  125. package/dist/client/{richText-coerce-spWtx86G.mjs → richText-coerce-DHkBtO0G.mjs} +1 -1
  126. package/dist/client/{routeIslandApiConfig-CROHPlYS.mjs → routeIslandApiConfig-DbHX4JOS.mjs} +1 -1
  127. package/dist/client/{shop-commerce-CDUohm_2.mjs → shop-commerce-B2UmrQg_.mjs} +12 -12
  128. package/dist/client/{shop-commerce-store-B9nw4lRP.mjs → shop-commerce-store-B7n-Z7nY.mjs} +1 -1
  129. package/dist/client/{shop-DscvMz86.mjs → shop-mqyoOvOK.mjs} +3 -3
  130. package/dist/client/{shop.client-M3kNsVPi.mjs → shop.client-BH-BBnA9.mjs} +13 -13
  131. package/dist/client/{shop.interactive-BGmkdIAZ.mjs → shop.interactive-mdM3UMWG.mjs} +74 -36
  132. package/dist/client/{shopShared-BdWp6LHa.mjs → shopShared-CXF5wxdg.mjs} +2 -2
  133. package/dist/client/site-styles-CMCUxsIM.mjs +3 -0
  134. package/dist/{preview-next/client/ThemedButton-Dc6aJ34Z.mjs → client/site-styles-D56hT2u1.mjs} +26000 -16565
  135. package/dist/client/spam-protection.mjs +1 -1
  136. package/dist/client/src-DjnxOjXG.mjs +217 -0
  137. package/dist/client/surfaceTransportMarker-BXepAVF6.mjs +152 -0
  138. package/dist/client/{timetableModel-Dynh5-j4.mjs → timetableModel-CrC80EOG.mjs} +13 -140
  139. package/dist/client/types-sF-IrGQr.mjs +633 -0
  140. package/dist/client/{useAvailableSlots-Cw9paRPY.mjs → useAvailableSlots-C4LOaI_Z.mjs} +8 -5
  141. package/dist/client/{useBookingNowIso-C9SF2rC6.mjs → useBookingNowIso-BDmWkYUW.mjs} +1 -1
  142. package/dist/client/{useDiscountApply-B-QJfBg0.mjs → useDiscountApply-6Q0nToVA.mjs} +3 -3
  143. package/dist/client/{useDiscountCodeUi-Uvum8q9d.mjs → useDiscountCodeUi-CM-DTX5X.mjs} +1 -1
  144. package/dist/client/{useEventPagination-BfM3xk6j.mjs → useEventPagination-Bcs89BR5.mjs} +9 -9
  145. package/dist/client/{view-DlkCDfuN.mjs → view-BN-fxyfq.mjs} +287 -232
  146. package/dist/client/{view-DXOuduIr.mjs → view-Dh2tGoS0.mjs} +4 -4
  147. package/dist/client/{wizardSteps-DManVJpc.mjs → wizardSteps-DtkhwKXK.mjs} +468 -149
  148. package/dist/preview-next/before-render.mjs +3 -140
  149. package/dist/preview-next/client/ArrangementLookControls-D4VjPs-r.mjs +31197 -0
  150. package/dist/preview-next/client/{EventEmbeddedCheckoutStep-Die6Y25O.mjs → EventEmbeddedCheckoutStep-C_h1cMYm.mjs} +33 -4
  151. package/dist/preview-next/client/{LocationPickerEnvironment-Bp4BHLCL.mjs → LocationPickerEnvironment-D56RD3e_.mjs} +1 -1
  152. package/dist/preview-next/client/{MapLibreEditMap-Cb0JhM9p.mjs → MapLibreEditMap-DFnyCckr.mjs} +2 -2
  153. package/dist/preview-next/client/PreviewEditorSidebar-Ckr2zk_L.mjs +37247 -0
  154. package/dist/preview-next/client/{PreviewEditorUI-CxwlLBGw.mjs → PreviewEditorUI-KOZgw_gS.mjs} +45 -17
  155. package/dist/preview-next/client/PreviewShell-CyO2V4kB.mjs +4757 -0
  156. package/dist/preview-next/client/SdkPreviewModeRuntime-DW3uKvNF.mjs +4258 -0
  157. package/dist/preview-next/client/SiteChromeCustomizeButton-CU9VD-7O.mjs +72202 -0
  158. package/dist/preview-next/client/ThemedButton-C0dgGJ5k.mjs +2006 -0
  159. package/dist/preview-next/client/{lucide-react-CqxuVAyz.mjs → lucide-react-CPBCf6QT.mjs} +15 -2
  160. package/dist/preview-next/client/previewAssistantSlot-DBi-WybM.mjs +112193 -0
  161. package/dist/preview-next/client/{previewChromeSurface-yuwnDP3B.mjs → previewChromeSurface-BhkUJst9.mjs} +90 -28
  162. package/dist/preview-next/client/runtime.mjs +3 -3
  163. package/dist/preview-next/client/sdk-runtime-BjCb6lOn.mjs +5 -0
  164. package/dist/preview-next/client/{editorStatusDecision-DR4BBKhy.mjs → useAutosaveStatus-CKxTaC3j.mjs} +40 -3
  165. package/dist/preview-next/client/useBlockCustomizeControls-B7MLTjBX.mjs +2633 -0
  166. package/dist/preview-next/client/useOpenBlockForSetup-BTUc0g9X.mjs +28 -0
  167. package/dist/preview-next/keepAlive.mjs +25 -2
  168. package/dist/preview-next/middleware.mjs +1 -1
  169. package/dist/preview-next/{route-contract-BBAJjFIz.mjs → route-contract-Bv3nkdpV.mjs} +215 -118
  170. package/dist/server/{Block.shared-ClFI3qpX.mjs → Block.shared-4fMqzltx.mjs} +7 -4
  171. package/dist/server/{src-DsYPhTbs.mjs → ThemeScopeCore-C72VC_lR.mjs} +894 -2556
  172. package/dist/server/accessibleSurfaces-B_Y_dA20.mjs +2305 -0
  173. package/dist/server/{bindings-Bi8EoRZD.mjs → bindings-ConMYJ2U.mjs} +2 -3
  174. package/dist/server/{publicProducts-Bz8loTRn.mjs → client-Cot-H5fQ.mjs} +2558 -343
  175. package/dist/server/config-validation.mjs +1 -1
  176. package/dist/server/config.mjs +33 -2
  177. package/dist/server/data/dataLoaderContext.mjs +2 -0
  178. package/dist/server/data/resolveBlockData.mjs +2 -0
  179. package/dist/server/data/types.mjs +1 -0
  180. package/dist/server/dataLoaderContext-B3fXA54R.mjs +47 -0
  181. package/dist/server/identity-Bn9OQiT1.mjs +6 -0
  182. package/dist/server/index.mjs +3 -3
  183. package/dist/server/{loadContent-dEEhQxL7.mjs → loadContent-BkaWYEwt.mjs} +6 -5
  184. package/dist/server/{loadPage-DBFBad8A.mjs → loadPage-kviUdH8c.mjs} +4 -2
  185. package/dist/server/manifest.mjs +1 -1
  186. package/dist/server/media-DnlczCMA.mjs +231 -0
  187. package/dist/server/metadata.mjs +5 -1
  188. package/dist/server/mode-Cv_TG9gP.mjs +63 -0
  189. package/dist/server/next/revalidate.mjs +9 -4
  190. package/dist/server/next.mjs +11 -11
  191. package/dist/server/opaqueSurface-BTnS09GS.mjs +54 -0
  192. package/dist/server/{overrideResolution-BIJbiXYc.mjs → overrideResolution-itXZCXs7.mjs} +2 -1
  193. package/dist/server/overrides-CD4d-1w7.mjs +177 -0
  194. package/dist/server/page-converter.mjs +243 -91
  195. package/dist/server/pageRenderPlan-CDyn7iLy.mjs +4162 -0
  196. package/dist/server/{themeAdmission-CSknYpxk.mjs → pageRuntimeSupport-DZ6cLxrM.mjs} +13 -28
  197. package/dist/server/{overrides-DhF87Vsd.mjs → pageShared-Q_Vij87H.mjs} +3808 -1928
  198. package/dist/server/parseThemeForPersistence-CDrF51tJ.mjs +52 -0
  199. package/dist/server/{prebuild-DaemmWQL.mjs → prebuild-DOG4MkOy.mjs} +1 -1
  200. package/dist/server/prebuild.mjs +1 -1
  201. package/dist/server/prefetchBlockData-DlprLLsc.mjs +756 -0
  202. package/dist/server/{registry-Cdvz1OtL.mjs → registry-BPFcpn6k.mjs} +21838 -709
  203. package/dist/server/rendering/components/pageShared.mjs +2 -0
  204. package/dist/server/rendering/helpers/loadPage.mjs +2 -0
  205. package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +2 -0
  206. package/dist/server/rendering/server.mjs +5 -4
  207. package/dist/server/rendering/themeAdmission.mjs +2 -0
  208. package/dist/server/rendering.mjs +11 -10
  209. package/dist/server/repeaterFields-MIz7r1ez.mjs +9 -0
  210. package/dist/server/{resolveBlockData-CLpAJWWf.mjs → resolveBlockData-BHvfGD4y.mjs} +6 -48
  211. package/dist/server/resolveButtonColourStates-OXFRGn5M.mjs +2682 -0
  212. package/dist/server/responseMedia-D8J3VAFs.mjs +115 -0
  213. package/dist/server/{richTextSchema-YYc85FX4.mjs → richTextSchema-Euhuj-7V.mjs} +26 -1
  214. package/dist/server/routing.mjs +1 -1
  215. package/dist/server/schema-DEizlyi4.mjs +2524 -0
  216. package/dist/server/server.mjs +3 -3
  217. package/dist/server/theme-bridge.mjs +1031 -1
  218. package/dist/server/theme.mjs +2 -1
  219. package/dist/server/themeAdmission-DGSAlFUK.mjs +18 -0
  220. package/dist/server/{three-pass-converter-Chnb1XD-.mjs → three-pass-converter-_j2UE2tR.mjs} +1 -1
  221. package/dist/server/validation-CDd6m8Ry.mjs +140 -0
  222. package/dist/server/{validation-DYxhLzqQ.mjs → validation-bl6WcAi_.mjs} +419 -3
  223. package/dist/server/{version-Beu4q-Gv.mjs → version-BLXZ31S-.mjs} +1 -1
  224. package/dist/styles/index.css +710 -29
  225. package/package.json +39 -1
  226. package/dist/client/events-BmqPeeQm.mjs +0 -20
  227. package/dist/client/purchase-BV5xfaZH.mjs +0 -894
  228. package/dist/client/schema-BdSglH2X.mjs +0 -16084
  229. package/dist/client/site-styles-CWHmlVT5.mjs +0 -14503
  230. package/dist/client/src-VIsPY-kw.mjs +0 -62
  231. package/dist/preview-next/client/PreviewEditorSidebar-DEP3xD9K.mjs +0 -5810
  232. package/dist/preview-next/client/SdkPreviewModeRuntime-Cpe-XP8e.mjs +0 -3
  233. package/dist/preview-next/client/SdkPreviewModeRuntime-QDkMPASV.mjs +0 -8059
  234. package/dist/preview-next/client/SiteChromeCustomizeButton-1JaoGOKX.mjs +0 -9367
  235. package/dist/preview-next/client/previewSidebarNavigation-AXUj9-qQ.mjs +0 -224683
  236. package/dist/preview-next/client/result-BjJUoxUF.mjs +0 -16
  237. package/dist/preview-next/client/sdk-runtime-O-eA9-rV.mjs +0 -4
  238. package/dist/preview-next/refresh-contract-uQ6BXgLJ.mjs +0 -25
  239. package/dist/server/bindings-Dgt_0goJ.mjs +0 -17
  240. package/dist/server/client-DfMDbZ41.mjs +0 -2330
  241. package/dist/server/effectiveNavLinkStyle-BHIYPVG1.mjs +0 -13713
  242. package/dist/server/loadPage-CnVB-aeL.mjs +0 -2
  243. package/dist/server/prefetchBlockData-FwcsT5H2.mjs +0 -4359
  244. package/dist/server/schema-uSA_x1Zh.mjs +0 -16311
  245. package/dist/server/site-styles-CntHn2KI.mjs +0 -793
  246. package/dist/server/siteChromeOverlayClearance-DqP40Ka0.mjs +0 -802
@@ -0,0 +1,4162 @@
1
+ import { Mt as parseThemeColorToken, Q as contrastRatio, at as hexToRgb, c as resolveOnColorForThemeToken, ct as oklchToHexGamut, dt as srgbToOklab, o as isCssColorLiteral, ot as oklabToOklch, st as oklabToSrgb, u as resolveTokenOrCssColorValue, ut as rgbToHex, z as getTextColorForBackground } from "./resolveButtonColourStates-OXFRGn5M.mjs";
2
+ import { $ as MediaNodeServer, $n as formattingTransforms, $r as lookQuoteLimitTransform, $t as formatEventCompactDateRail, Bn as contentTransforms, Bt as buildEventListWeek, Da as sectionShapeHook, Ea as sectionShapeFromContent, F as combinedLookSchema, Fa as sectionSurfaceBase, Gr as resolveSurfaceForegroundStyles, Gt as formatEventPriceDisplay, Hr as parseBackgroundOverlay, Ht as weekColumnDays, It as ThemedButtonLink, Jn as chromeLogoTransforms, Jr as standardImageShapeOptions, Jt as eventDateOptions, K as resolveCalendarReadProfile, Kn as mediaTransforms, Kr as resolveBackgroundColorValue, La as resolveEffectiveKnobs, Lr as boxStylesTransforms, Ma as deriveSectionGround, Na as parseCanonicalRuntimeBackground, Oa as boundaryRuntimeMetricsForDecorativeTransition, Pa as resolveSectionBackground, Q as selectCardListPresentation, Qi as resolveLookSurfacePresentation, Qn as uiTransforms, Qr as lookLeadSlotTransform, Ra as cardListFamilyBlocks, Sn as formatTotalCapacity, Ta as sectionShapeForGround, Tn as isEventFull, Ur as parseRuntimeBackgroundContent, Ut as formatEventPrice, Vr as parseBackgroundContent, Wn as readRuntimeNow, Wr as resolveSectionSurfaceForeground, X as CardListLeadDate, Xi as augmentManifest, Xr as getAnchorClasses, Y as CardListContentPart, Yn as layoutTransforms, Yr as BACKGROUND_POSITION_PRESET_VALUES, Yt as eventLocalDateKey, Z as resolveCardListSchedule, Zi as lookPresentationOnPalette, Zn as resolveHeroTitleLength, Zr as lookCarouselRegionTransform, _n as resolveRuntimeEventDestination, _o as resolveBookingBusinessTimeZone, aa as arrangementSlotNames, bn as canJoinEventWaitlistOnAnyMode, bt as eventCalendarListLayoutOptions, ca as resolveEffectiveArrangement, co as formatDateTimeRange, da as deriveSiteStyleBlockPolicy, dr as listLookSlot, ea as heroPhotoPaintsGround, ei as lookSkinSlotTransform, en as formatEventDateParts, fo as compareLocalScheduleDates, gn as isToday, ho as parseBookingLocalDate, hr as standardAspectRatioOptions, in as formatTime, ja as applyLookPhotoTreatment, la as resolveModeArrangement, lr as listItemPresentation, mi as ClockIcon, mo as getLocalScheduleDate, ni as createTransformRegistry, oa as arrangementManifestFromVariants, on as resolveEventTimeZone, oo as formatDate, pt as resolveEventSelection, qa as orderedLiveRunSessions, qn as headerRuntimeTransforms, qt as eventCalendarWeekStart, ra as arrangementAppearancePresets, rn as formatEventTimeRange, rt as computeMediaTransformStyle, sa as readStoredMode, so as formatDateRange, t as getBlockDefinition, ti as asPartialObject, tt as ImagePresets, ua as resolvePublishedLook, un as formatDateKey, vn as formatBookingSchedulePresentation, vr as heroTitleSizeOptions, vt as eventCalendarListGroupingDecision, wn as getEventAvailabilityStatus, xn as formatEventRemainingPlaces, xt as resolveEventCalendarReadPlan, yo as toUtcIsoDateTimeString, yt as eventCalendarListLayoutCompatibleDisplayModeValues, za as cardListKnobBlocks } from "./registry-BPFcpn6k.mjs";
3
+ import { N as resolveConcreteColorHex, n as parseSurfaceTree } from "./accessibleSurfaces-B_Y_dA20.mjs";
4
+ import { o as runtimeMediaSchema } from "./media-DnlczCMA.mjs";
5
+ import { t as assertNever } from "./assert-never-ku-PUn9U.mjs";
6
+ import { $ as asSiteStyleId, G as themeV2CompilerOwnedFieldNames, W as stripStaleTransitionStyleGroup, Y as asDesignBlockId, Z as asLayoutVariantKey, dt as makeBoundaryId, et as assertNever$1 } from "./schema-DEizlyi4.mjs";
7
+ import { a as isObjectRecord } from "./richTextSchema-Euhuj-7V.mjs";
8
+ import { i as resolveRouteTargetForStage$1 } from "./dist-Xevqwf1U.mjs";
9
+ import { z } from "zod";
10
+ import React from "react";
11
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
12
+ //#region ../theme-core/src/tokens/tokens.ts
13
+ const defaultThemeTokens = {
14
+ color: {
15
+ "background/base": "#ffffff",
16
+ "background/elevated": "#f5f5f5",
17
+ "surface/base": "#ffffff",
18
+ "surface/subtle": "#f9f9fb",
19
+ "surface/inverted": "#111111",
20
+ "content/primary": "#111111",
21
+ "content/secondary": "#3f3f46",
22
+ "accent/primary": "#2563eb",
23
+ "accent/secondary": "#1d4ed8",
24
+ "border/base": "#e5e7eb"
25
+ },
26
+ typography: {
27
+ "display/hero": {
28
+ fontSize: "clamp(48px, 8vw, 96px)",
29
+ lineHeight: "1.05",
30
+ fontWeight: "700"
31
+ },
32
+ "display/section": {
33
+ fontSize: "clamp(40px, 6vw, 72px)",
34
+ lineHeight: "1.1",
35
+ fontWeight: "700"
36
+ },
37
+ "heading/large": {
38
+ fontSize: "clamp(32px, 4vw, 48px)",
39
+ lineHeight: "1.2",
40
+ fontWeight: "600"
41
+ },
42
+ "heading/medium": {
43
+ fontSize: "clamp(24px, 3vw, 32px)",
44
+ lineHeight: "1.25",
45
+ fontWeight: "600"
46
+ },
47
+ "heading/small": {
48
+ fontSize: "20px",
49
+ lineHeight: "1.3",
50
+ fontWeight: "600"
51
+ },
52
+ "body/normal": {
53
+ fontSize: "16px",
54
+ lineHeight: "1.6",
55
+ fontWeight: "400"
56
+ },
57
+ "body/small": {
58
+ fontSize: "14px",
59
+ lineHeight: "1.5",
60
+ fontWeight: "400"
61
+ },
62
+ caption: {
63
+ fontSize: "12px",
64
+ lineHeight: "1.4",
65
+ fontWeight: "500"
66
+ }
67
+ },
68
+ spacing: {
69
+ none: "0px",
70
+ "3xs": "4px",
71
+ "2xs": "8px",
72
+ xs: "12px",
73
+ sm: "16px",
74
+ md: "24px",
75
+ lg: "32px",
76
+ xl: "40px",
77
+ "2xl": "56px",
78
+ "3xl": "72px"
79
+ },
80
+ radius: {
81
+ none: "0px",
82
+ xs: "2px",
83
+ sm: "4px",
84
+ md: "8px",
85
+ lg: "12px",
86
+ pill: "999px",
87
+ full: "9999px"
88
+ },
89
+ shadow: {
90
+ none: "none",
91
+ soft: "0px 2px 8px rgba(15, 23, 42, 0.08)",
92
+ medium: "0px 6px 18px rgba(15, 23, 42, 0.12)",
93
+ strong: "0px 12px 36px rgba(15, 23, 42, 0.16)"
94
+ },
95
+ palette: {
96
+ surface: "#ffffff",
97
+ "neutral-50": "#f9fafb",
98
+ "neutral-900": "#111827",
99
+ primary: "#2563eb",
100
+ "primary-50": "#eff6ff",
101
+ "primary-500": "#2563eb",
102
+ "primary-900": "#1d4ed8",
103
+ secondary: "#9333ea",
104
+ "secondary-50": "#f3e8ff",
105
+ "secondary-500": "#9333ea",
106
+ "secondary-900": "#4c1d95",
107
+ accent: "#f97316",
108
+ "accent-50": "#fff7ed",
109
+ "accent-500": "#f97316",
110
+ "accent-900": "#7c2d12"
111
+ }
112
+ };
113
+ /**
114
+ * Project the expanded semantic palette into the token buckets consumed by
115
+ * runtime transforms. Keep this mapping shared by full themes and the
116
+ * tokens-only hosted-booking runtime so the two paths cannot drift.
117
+ */
118
+ function buildThemeTokens(palette) {
119
+ const tokens = cloneThemeTokens(defaultThemeTokens);
120
+ const paletteStrings = {};
121
+ for (const [key, value] of Object.entries(palette)) if (typeof value === "string" && value.trim().length > 0) paletteStrings[key] = value;
122
+ tokens.palette = paletteStrings;
123
+ const resolveColor = (...keys) => {
124
+ for (const key of keys) {
125
+ const value = paletteStrings[key];
126
+ if (value) return value;
127
+ }
128
+ };
129
+ const assignColor = (token, ...keys) => {
130
+ const value = resolveColor(...keys);
131
+ if (value) tokens.color[token] = value;
132
+ };
133
+ assignColor("background/base", "background", "surface", "primary-50");
134
+ assignColor("background/elevated", "surface", "background");
135
+ assignColor("surface/base", "surface", "background");
136
+ assignColor("surface/subtle", "neutral-100", "surface", "background");
137
+ assignColor("surface/inverted", "neutral-900", "text", "primary-900");
138
+ assignColor("content/primary", "text", "body", "neutral-900");
139
+ assignColor("content/secondary", "mutedText", "secondary", "neutral-600");
140
+ assignColor("accent/primary", "primary", "accent");
141
+ assignColor("accent/secondary", "accent", "secondary", "primary-400");
142
+ assignColor("border/base", "border", "neutral-300");
143
+ return tokens;
144
+ }
145
+ function cloneThemeTokens(source) {
146
+ return JSON.parse(JSON.stringify(source));
147
+ }
148
+ //#endregion
149
+ //#region ../theme-core/src/surfaces/mapDrawingTokens.ts
150
+ /**
151
+ * The one map token contract (issue 1611). Drawings carry semantic classes only;
152
+ * these variables are the only colours a map receives. Each value is resolved
153
+ * from the section ground the map sits on, so the same geometry reads on light,
154
+ * brand and dark grounds without regeneration.
155
+ */
156
+ const MAP_DRAWING_COLOUR_VARS = {
157
+ land: "--map-land",
158
+ water: "--map-water",
159
+ park: "--map-park",
160
+ building: "--map-building",
161
+ buildingEdge: "--map-building-edge",
162
+ road: "--map-road",
163
+ roadCasing: "--map-road-casing",
164
+ roadMajor: "--map-road-major",
165
+ roadMajorCasing: "--map-road-major-casing",
166
+ path: "--map-path",
167
+ label: "--map-label",
168
+ labelHalo: "--map-label-halo",
169
+ pin: "--map-pin",
170
+ pinEdge: "--map-pin-edge",
171
+ frame: "--map-frame-color"
172
+ };
173
+ const MAP_DRAWING_SHAPE_VARS = {
174
+ frameRadius: "--map-frame-radius",
175
+ frameWidth: "--map-frame-width",
176
+ frameShadow: "--map-frame-shadow",
177
+ labelFont: "--map-label-font",
178
+ labelWeight: "--map-label-weight",
179
+ casingScale: "--map-casing-scale"
180
+ };
181
+ const defaultMapDrawingTreatment = {
182
+ land: .035,
183
+ water: {
184
+ roles: [
185
+ "primary",
186
+ "accent",
187
+ "secondary"
188
+ ],
189
+ amount: .2
190
+ },
191
+ park: {
192
+ roles: [
193
+ "success",
194
+ "secondary",
195
+ "primary"
196
+ ],
197
+ amount: .16
198
+ },
199
+ building: .09,
200
+ buildingEdge: .17,
201
+ roadLift: .7,
202
+ casingSink: .2,
203
+ majorRoad: {
204
+ roles: ["accent", "primary"],
205
+ amount: .16
206
+ },
207
+ path: .42,
208
+ labelContrast: 6,
209
+ pin: [
210
+ "primary",
211
+ "accent",
212
+ "secondary"
213
+ ],
214
+ frame: {
215
+ radius: "var(--rb-block-radius, 8px)",
216
+ width: "1px",
217
+ shadow: "none",
218
+ colour: .16
219
+ },
220
+ labelWeight: 500,
221
+ casingScale: 1
222
+ };
223
+ /** Per arrangement style (keyed by its skin). Legacy themes without a skin use the default. */
224
+ const mapDrawingTreatments = {
225
+ fulcrum: {
226
+ ...defaultMapDrawingTreatment,
227
+ land: .025,
228
+ water: {
229
+ roles: ["primary", "secondary"],
230
+ amount: .2
231
+ },
232
+ park: {
233
+ roles: ["success", "primary"],
234
+ amount: .12
235
+ },
236
+ building: .07,
237
+ buildingEdge: .14,
238
+ casingSink: .16,
239
+ majorRoad: {
240
+ roles: ["accent"],
241
+ amount: .12
242
+ },
243
+ pin: ["accent", "primary"],
244
+ frame: {
245
+ radius: "var(--rb-skin-radius, 3px)",
246
+ width: "var(--rb-skin-rule, 1px)",
247
+ shadow: "none",
248
+ colour: .16
249
+ }
250
+ },
251
+ poster: {
252
+ ...defaultMapDrawingTreatment,
253
+ land: 0,
254
+ water: {
255
+ roles: ["primary", "secondary"],
256
+ amount: .32
257
+ },
258
+ park: {
259
+ roles: ["success", "accent"],
260
+ amount: .26
261
+ },
262
+ building: .12,
263
+ buildingEdge: .3,
264
+ roadLift: 1,
265
+ casingSink: .55,
266
+ majorRoad: {
267
+ roles: ["accent", "primary"],
268
+ amount: .55
269
+ },
270
+ path: .7,
271
+ labelContrast: 9,
272
+ pin: ["primary", "accent"],
273
+ frame: {
274
+ radius: "var(--rb-skin-radius, 0px)",
275
+ width: "var(--rb-skin-rule, 3px)",
276
+ shadow: "offset",
277
+ colour: 1
278
+ },
279
+ labelWeight: 600,
280
+ casingScale: 1.15
281
+ },
282
+ lantern: {
283
+ ...defaultMapDrawingTreatment,
284
+ land: .04,
285
+ water: {
286
+ roles: ["secondary", "primary"],
287
+ amount: .22
288
+ },
289
+ park: {
290
+ roles: ["success", "secondary"],
291
+ amount: .14
292
+ },
293
+ building: .08,
294
+ buildingEdge: .14,
295
+ casingSink: .35,
296
+ majorRoad: {
297
+ roles: ["accent", "primary"],
298
+ amount: .24
299
+ },
300
+ path: .4,
301
+ pin: ["accent", "primary"],
302
+ frame: {
303
+ radius: "var(--rb-skin-radius, 10px)",
304
+ width: "var(--rb-skin-rule, 1px)",
305
+ shadow: "none",
306
+ colour: .18
307
+ }
308
+ },
309
+ measure: {
310
+ ...defaultMapDrawingTreatment,
311
+ land: .03,
312
+ water: {
313
+ roles: ["accent", "primary"],
314
+ amount: .16
315
+ },
316
+ park: {
317
+ roles: ["success"],
318
+ amount: .12
319
+ },
320
+ building: .1,
321
+ buildingEdge: .2,
322
+ casingSink: .26,
323
+ majorRoad: {
324
+ roles: ["accent"],
325
+ amount: 0
326
+ },
327
+ path: .5,
328
+ pin: ["accent", "primary"],
329
+ frame: {
330
+ radius: "var(--rb-skin-radius, 0px)",
331
+ width: "var(--rb-skin-rule, 2px)",
332
+ shadow: "none",
333
+ colour: .6
334
+ },
335
+ labelWeight: 600
336
+ },
337
+ folio: {
338
+ ...defaultMapDrawingTreatment,
339
+ land: .03,
340
+ water: {
341
+ roles: ["secondary", "primary"],
342
+ amount: .18
343
+ },
344
+ park: {
345
+ roles: ["success", "primary"],
346
+ amount: .18
347
+ },
348
+ building: .08,
349
+ buildingEdge: .15,
350
+ casingSink: .18,
351
+ majorRoad: {
352
+ roles: ["accent"],
353
+ amount: .14
354
+ },
355
+ pin: ["primary", "accent"],
356
+ frame: {
357
+ radius: "var(--rb-skin-radius, 10px)",
358
+ width: "var(--rb-skin-rule, 1px)",
359
+ shadow: "none",
360
+ colour: .18
361
+ }
362
+ }
363
+ };
364
+ function mapDrawingTreatmentFor(skin) {
365
+ return (skin === void 0 ? void 0 : mapDrawingTreatments[skin]) ?? defaultMapDrawingTreatment;
366
+ }
367
+ const toLab = (hex) => {
368
+ const { r, g, b } = hexToRgb(hex);
369
+ return srgbToOklab(r, g, b);
370
+ };
371
+ const toHex = ({ L, a, b }) => {
372
+ const rgb = oklabToSrgb(L, a, b);
373
+ return rgbToHex(rgb.r, rgb.g, rgb.b);
374
+ };
375
+ const blend = (from, to, t) => ({
376
+ L: from.L + (to.L - from.L) * t,
377
+ a: from.a + (to.a - from.a) * t,
378
+ b: from.b + (to.b - from.b) * t
379
+ });
380
+ const distance = (x, y) => Math.hypot(x.L - y.L, x.a - y.a, x.b - y.b);
381
+ /** A nearly neutral pole in the ground's hue, so lifts and sinks stay in the site's temperature. */
382
+ function pole(ground, L) {
383
+ const { C, h } = oklabToOklch(ground.L, ground.a, ground.b);
384
+ return toLab(oklchToHexGamut(L, Math.min(C, .012), h));
385
+ }
386
+ /** The first blend from `from` toward `to` that reaches the contrast floor against every backdrop. */
387
+ function firstContrastBlend(from, to, backdrops, floor) {
388
+ return Array.from({ length: 41 }, (_, index) => toHex(blend(from, to, index / 40))).find((hex) => backdrops.every((backdrop) => contrastRatio(hex, backdrop) >= floor)) ?? toHex(to);
389
+ }
390
+ /** A tint must stand apart from what it is drawn on (a brand river on a brand band would vanish); else a step toward the ink. */
391
+ function tint(base, spec, palette, ink) {
392
+ return spec.roles.flatMap((role) => {
393
+ const hex = resolveConcreteColorHex(role, palette);
394
+ return hex ? [blend(base, toLab(hex), spec.amount)] : [];
395
+ }).find((candidate) => distance(candidate, base) >= .025) ?? blend(base, ink, Math.max(spec.amount * .6, .06));
396
+ }
397
+ /** Pure: one ground, one ink, one palette and one treatment decide every map colour. */
398
+ function resolveMapDrawingColours(input) {
399
+ const { treatment: t, palette } = input;
400
+ const ground = toLab(input.ground);
401
+ const ink = toLab(input.ink);
402
+ const darkGround = ink.L > ground.L;
403
+ const light = darkGround ? blend(ground, ink, .22) : pole(ground, Math.max(ground.L, .995));
404
+ const dark = darkGround ? pole(ground, Math.max(ground.L - .22, .04)) : ink;
405
+ const tinted = blend(ground, ink, t.land);
406
+ const land = contrastRatio(toHex(tinted), input.ink) >= 4.5 ? tinted : ground;
407
+ const landHex = toHex(land);
408
+ const road = blend(land, light, t.roadLift);
409
+ const casing = blend(land, dark, t.casingSink);
410
+ const building = blend(land, ink, t.building);
411
+ const majorTint = t.majorRoad.amount === 0 ? road : tint(road, t.majorRoad, palette, ink);
412
+ const pinBackdrops = [
413
+ landHex,
414
+ toHex(road),
415
+ toHex(building)
416
+ ];
417
+ const pinRoles = t.pin.flatMap((role) => {
418
+ const hex = resolveConcreteColorHex(role, palette);
419
+ return hex ? [hex] : [];
420
+ });
421
+ const pin = [...pinRoles, input.ink].find((hex) => pinBackdrops.every((backdrop) => contrastRatio(hex, backdrop) >= 3)) ?? firstContrastBlend(toLab(pinRoles[0] ?? input.ink), ink, pinBackdrops, 3);
422
+ const pinEdge = [
423
+ toHex(light),
424
+ toHex(dark),
425
+ landHex
426
+ ].reduce((best, hex) => contrastRatio(hex, pin) > contrastRatio(best, pin) ? hex : best);
427
+ return {
428
+ land: landHex,
429
+ water: toHex(tint(land, t.water, palette, ink)),
430
+ park: toHex(tint(land, t.park, palette, ink)),
431
+ building: toHex(building),
432
+ buildingEdge: toHex(blend(land, ink, t.buildingEdge)),
433
+ road: toHex(road),
434
+ roadCasing: toHex(casing),
435
+ roadMajor: toHex(majorTint),
436
+ roadMajorCasing: toHex(blend(casing, dark, .15)),
437
+ path: toHex(blend(land, ink, t.path)),
438
+ label: firstContrastBlend(land, ink, [landHex], Math.max(4.5, t.labelContrast)),
439
+ labelHalo: landHex,
440
+ pin,
441
+ pinEdge,
442
+ frame: toHex(blend(ground, ink, t.frame.colour))
443
+ };
444
+ }
445
+ function mapDrawingShapeStyle(treatment) {
446
+ return {
447
+ [MAP_DRAWING_SHAPE_VARS.frameRadius]: treatment.frame.radius,
448
+ [MAP_DRAWING_SHAPE_VARS.frameWidth]: treatment.frame.width,
449
+ [MAP_DRAWING_SHAPE_VARS.frameShadow]: treatment.frame.shadow === "offset" ? `var(--rb-skin-shadow-offset, 6px) var(--rb-skin-shadow-offset, 6px) 0 var(${MAP_DRAWING_COLOUR_VARS.frame})` : "none",
450
+ [MAP_DRAWING_SHAPE_VARS.labelFont]: "var(--font-body, system-ui, sans-serif)",
451
+ [MAP_DRAWING_SHAPE_VARS.labelWeight]: String(treatment.labelWeight),
452
+ [MAP_DRAWING_SHAPE_VARS.casingScale]: String(treatment.casingScale)
453
+ };
454
+ }
455
+ /**
456
+ * Everything a map needs from the section it sits on. Unmeasured grounds
457
+ * (photos, gradients) keep the structural fallbacks for colour; the style's
458
+ * shape still applies.
459
+ */
460
+ function mapDrawingStyle(input) {
461
+ const treatment = mapDrawingTreatmentFor(input.skin);
462
+ const shape = mapDrawingShapeStyle(treatment);
463
+ if (input.foreground.kind !== "known" || input.foreground.provenance.kind !== "measured") return shape;
464
+ const ink = resolveConcreteColorHex(input.foreground.roles.text, input.palette);
465
+ if (ink === null) return shape;
466
+ const colours = resolveMapDrawingColours({
467
+ ground: input.foreground.provenance.backdropHex,
468
+ ink,
469
+ palette: input.palette,
470
+ treatment
471
+ });
472
+ return {
473
+ ...shape,
474
+ ...Object.fromEntries(Object.entries(colours).map(([role, value]) => [MAP_DRAWING_COLOUR_VARS[role], value]))
475
+ };
476
+ }
477
+ //#endregion
478
+ //#region ../core/src/duration.ts
479
+ const UNIT_LABELS_SINGULAR = {
480
+ minutes: "minute",
481
+ hours: "hour",
482
+ days: "day",
483
+ weeks: "week"
484
+ };
485
+ const UNIT_LABELS_PLURAL = {
486
+ minutes: "minutes",
487
+ hours: "hours",
488
+ days: "days",
489
+ weeks: "weeks"
490
+ };
491
+ function formatDurationUnitLabel(unit, count) {
492
+ return count === 1 ? UNIT_LABELS_SINGULAR[unit] : UNIT_LABELS_PLURAL[unit];
493
+ }
494
+ //#endregion
495
+ //#region ../theme-core/src/site-styles/sectionBoundaryComposition.ts
496
+ const backgroundToken = requireThemeColorToken("background");
497
+ /**
498
+ * Classifies a section from its final render content. `_sectionStyles`
499
+ * already holds the effective background (Look default, page-design override
500
+ * and block-authored media merged by `resolveSectionBackground`), so this only
501
+ * reads it and never re-decides precedence. A missing or unparseable
502
+ * background is the page background, as it is for the renderer.
503
+ */
504
+ function boundaryEndpointForSectionContent(content) {
505
+ const background = parseCanonicalRuntimeBackground(content);
506
+ if (background.kind === "none") return {
507
+ kind: "paint",
508
+ token: backgroundToken
509
+ };
510
+ const effective = background.background;
511
+ switch (effective.type) {
512
+ case "color": {
513
+ if (effective.color === null || effective.color === void 0) return {
514
+ kind: "paint",
515
+ token: backgroundToken
516
+ };
517
+ const token = parseThemeColorToken(effective.color);
518
+ return token ? {
519
+ kind: "paint",
520
+ token
521
+ } : {
522
+ kind: "unpainted",
523
+ reason: "literal-color"
524
+ };
525
+ }
526
+ case "gradient": return {
527
+ kind: "unpainted",
528
+ reason: "gradient"
529
+ };
530
+ case "image":
531
+ case "video": return {
532
+ kind: "unpainted",
533
+ reason: "media"
534
+ };
535
+ default: return assertNever$1(effective, "Unhandled section background type");
536
+ }
537
+ }
538
+ /**
539
+ * Reads every fact from final render content in one place. `_frameStyles` is
540
+ * the compiled frame; content without one (no page design, an SDK block)
541
+ * draws a plain frame.
542
+ */
543
+ function sectionFactsForContent(content) {
544
+ return {
545
+ endpoint: boundaryEndpointForSectionContent(content),
546
+ frame: frameKindForContent(content),
547
+ shape: sectionShapeFromContent(content)
548
+ };
549
+ }
550
+ function frameKindForContent(content) {
551
+ const frameStyles = content._frameStyles;
552
+ const kind = typeof frameStyles === "object" && frameStyles !== null && "kind" in frameStyles ? frameStyles.kind : null;
553
+ return kind === "panel" || kind === "flush-panel" ? kind : "plain";
554
+ }
555
+ /**
556
+ * The frame rule: a flush panel owns the edge it runs to, so no break is
557
+ * drawn next to one. The single home for this rule; the generated
558
+ * pipeline's budget and the site-style lab ask it with their plan frames.
559
+ */
560
+ function frameNotShownReason(previous, next) {
561
+ return previous === "flush-panel" || next === "flush-panel" ? "flush-panel" : null;
562
+ }
563
+ /**
564
+ * A field sits in from the page edge with page ground around it, so a break
565
+ * drawn across its edge would have nothing to join (issue 1659).
566
+ */
567
+ function shapeNotShownReason(previous, next) {
568
+ return previous === "field" || next === "field" ? "field" : null;
569
+ }
570
+ /**
571
+ * Decides whether and how a join draws. The frame and shape rules win before
572
+ * paint is considered; two unpainted sides show nothing.
573
+ */
574
+ function composeBoundary(previous, next) {
575
+ const frameReason = frameNotShownReason(previous.frame, next.frame) ?? shapeNotShownReason(previous.shape, next.shape);
576
+ if (frameReason) return {
577
+ kind: "not-shown",
578
+ reason: frameReason
579
+ };
580
+ const from = previous.endpoint;
581
+ const to = next.endpoint;
582
+ if (from.kind === "paint") return {
583
+ kind: "shown",
584
+ composition: to.kind === "paint" ? {
585
+ kind: "paint-to-paint",
586
+ from: from.token,
587
+ to: to.token
588
+ } : {
589
+ kind: "paint-to-unpainted",
590
+ from: from.token
591
+ }
592
+ };
593
+ return to.kind === "paint" ? {
594
+ kind: "shown",
595
+ composition: {
596
+ kind: "unpainted-to-paint",
597
+ to: to.token
598
+ }
599
+ } : {
600
+ kind: "not-shown",
601
+ reason: "both-unpainted"
602
+ };
603
+ }
604
+ /**
605
+ * Placement, reserves and paint for a shown boundary, derived from the
606
+ * composition and the catalogue's metrics for the treatment.
607
+ */
608
+ function boundaryLayout(intent, composition) {
609
+ const metrics = boundaryRuntimeMetricsForDecorativeTransition(intent);
610
+ switch (composition.kind) {
611
+ case "paint-to-paint": return {
612
+ placement: "centred",
613
+ reserves: {
614
+ before: metrics.reserveCss,
615
+ after: metrics.reserveCss
616
+ },
617
+ paint: {
618
+ band: composition.from,
619
+ shape: composition.to
620
+ }
621
+ };
622
+ case "unpainted-to-paint": return {
623
+ placement: "previous",
624
+ reserves: {
625
+ before: metrics.heightCss,
626
+ after: null
627
+ },
628
+ paint: {
629
+ band: null,
630
+ shape: composition.to
631
+ }
632
+ };
633
+ case "paint-to-unpainted": return {
634
+ placement: "next",
635
+ reserves: {
636
+ before: null,
637
+ after: metrics.heightCss
638
+ },
639
+ paint: {
640
+ band: null,
641
+ shape: composition.from
642
+ }
643
+ };
644
+ default: return assertNever$1(composition, "Unhandled boundary composition");
645
+ }
646
+ }
647
+ function requireThemeColorToken(value) {
648
+ const token = parseThemeColorToken(value);
649
+ if (!token) throw new Error(`Expected a theme color token. Received: ${value}`);
650
+ return token;
651
+ }
652
+ /**
653
+ * Curated library of gradient presets.
654
+ * All gradients use theme color tokens, so they adapt to the site's palette.
655
+ */
656
+ const GRADIENT_PRESETS = [
657
+ {
658
+ id: "primary-secondary",
659
+ name: "Primary to Secondary",
660
+ description: "Blend your primary and secondary brand colors",
661
+ type: "linear",
662
+ angle: 135,
663
+ stops: [{
664
+ color: "primary-500",
665
+ position: 0
666
+ }, {
667
+ color: "secondary-500",
668
+ position: 100
669
+ }]
670
+ },
671
+ {
672
+ id: "primary-accent",
673
+ name: "Primary to Accent",
674
+ description: "Energetic gradient from primary to accent",
675
+ type: "linear",
676
+ angle: 135,
677
+ stops: [{
678
+ color: "primary-500",
679
+ position: 0
680
+ }, {
681
+ color: "accent-500",
682
+ position: 100
683
+ }]
684
+ },
685
+ {
686
+ id: "secondary-accent",
687
+ name: "Secondary to Accent",
688
+ description: "Vibrant secondary to accent blend",
689
+ type: "linear",
690
+ angle: 135,
691
+ stops: [{
692
+ color: "secondary-500",
693
+ position: 0
694
+ }, {
695
+ color: "accent-500",
696
+ position: 100
697
+ }]
698
+ },
699
+ {
700
+ id: "primary-light-dark",
701
+ name: "Primary Light to Dark",
702
+ description: "Subtle primary color fade",
703
+ type: "linear",
704
+ angle: 180,
705
+ stops: [{
706
+ color: "primary-500",
707
+ position: 0
708
+ }, {
709
+ color: "primary-900",
710
+ position: 100
711
+ }]
712
+ },
713
+ {
714
+ id: "primary-dark-light",
715
+ name: "Primary Dark to Light",
716
+ description: "Reverse primary fade",
717
+ type: "linear",
718
+ angle: 180,
719
+ stops: [{
720
+ color: "primary-900",
721
+ position: 0
722
+ }, {
723
+ color: "primary-50",
724
+ position: 100
725
+ }]
726
+ },
727
+ {
728
+ id: "secondary-light-dark",
729
+ name: "Secondary Light to Dark",
730
+ description: "Subtle secondary color fade",
731
+ type: "linear",
732
+ angle: 180,
733
+ stops: [{
734
+ color: "secondary-500",
735
+ position: 0
736
+ }, {
737
+ color: "secondary-900",
738
+ position: 100
739
+ }]
740
+ },
741
+ {
742
+ id: "accent-light-dark",
743
+ name: "Accent Light to Dark",
744
+ description: "Accent color depth fade",
745
+ type: "linear",
746
+ angle: 180,
747
+ stops: [{
748
+ color: "accent-500",
749
+ position: 0
750
+ }, {
751
+ color: "accent-900",
752
+ position: 100
753
+ }]
754
+ },
755
+ {
756
+ id: "background-surface",
757
+ name: "Background to Surface",
758
+ description: "Subtle depth using base colors",
759
+ type: "linear",
760
+ angle: 180,
761
+ stops: [{
762
+ color: "background",
763
+ position: 0
764
+ }, {
765
+ color: "surface",
766
+ position: 100
767
+ }]
768
+ },
769
+ {
770
+ id: "neutral-fade",
771
+ name: "Neutral Gradient",
772
+ description: "Elegant neutral color fade",
773
+ type: "linear",
774
+ angle: 180,
775
+ stops: [{
776
+ color: "neutral-900",
777
+ position: 0
778
+ }, {
779
+ color: "neutral-50",
780
+ position: 100
781
+ }]
782
+ },
783
+ {
784
+ id: "primary-glow",
785
+ name: "Primary glow",
786
+ description: "A soft top-centred glow using your primary palette",
787
+ type: "radial",
788
+ shape: "ellipse",
789
+ position: "top center",
790
+ stops: [{
791
+ color: "primary-900",
792
+ position: 0
793
+ }, {
794
+ color: "primary-950",
795
+ position: 100
796
+ }],
797
+ foreground: {
798
+ textColor: "onPrimary900",
799
+ headingColor: "onPrimary900",
800
+ linkColor: "onPrimary900",
801
+ supportingColor: "onPrimary900"
802
+ }
803
+ },
804
+ {
805
+ id: "accent-glow",
806
+ name: "Accent glow",
807
+ description: "A soft top-centred glow using your accent palette",
808
+ type: "radial",
809
+ shape: "ellipse",
810
+ position: "top center",
811
+ stops: [{
812
+ color: "accent-900",
813
+ position: 0
814
+ }, {
815
+ color: "accent-950",
816
+ position: 100
817
+ }],
818
+ foreground: {
819
+ textColor: "onAccent900",
820
+ headingColor: "onAccent900",
821
+ linkColor: "onAccent900",
822
+ supportingColor: "onAccent900"
823
+ }
824
+ },
825
+ {
826
+ id: "primary-secondary-accent",
827
+ name: "Brand Trio",
828
+ description: "All three brand colors in harmony",
829
+ type: "linear",
830
+ angle: 135,
831
+ stops: [
832
+ {
833
+ color: "primary-500",
834
+ position: 0
835
+ },
836
+ {
837
+ color: "secondary-500",
838
+ position: 50
839
+ },
840
+ {
841
+ color: "accent-500",
842
+ position: 100
843
+ }
844
+ ]
845
+ }
846
+ ].map((preset) => ({
847
+ ...preset,
848
+ id: preset.id,
849
+ stops: preset.stops
850
+ }));
851
+ const GRADIENT_PRESET_IDS = GRADIENT_PRESETS.map((preset) => preset.id);
852
+ const gradientPresetIdSet = new Set(GRADIENT_PRESET_IDS);
853
+ const gradientPresetById = Object.fromEntries(GRADIENT_PRESETS.map((preset) => [preset.id, preset]));
854
+ function parseGradientPresetId(value) {
855
+ if (typeof value !== "string") return null;
856
+ const normalized = value.trim();
857
+ if (!gradientPresetIdSet.has(normalized)) return null;
858
+ return normalized;
859
+ }
860
+ function getGradientPreset(id) {
861
+ return gradientPresetById[id];
862
+ }
863
+ //#endregion
864
+ //#region ../theme-core/src/gradients/utils.ts
865
+ /**
866
+ * Convert a GradientConfig to a CSS gradient string
867
+ *
868
+ * @param config - The gradient configuration using theme tokens
869
+ * @param tokens - Map of theme color tokens to hex values
870
+ * @returns CSS gradient string (e.g., "linear-gradient(180deg, #3b82f6 0%, #f59e0b 100%)")
871
+ */
872
+ function gradientToCss(config, tokens) {
873
+ const stops = config.stops.map((stop) => {
874
+ return `${tokens[stop.color] ?? "#000000"} ${stop.position}%`;
875
+ }).join(", ");
876
+ const type = config.type ?? "linear";
877
+ if (type === "radial") {
878
+ const position = config.position ?? "center";
879
+ return `radial-gradient(${config.shape ?? "circle"} at ${position}, ${stops})`;
880
+ }
881
+ if (type === "conic") {
882
+ const position = config.position ?? "center";
883
+ return `conic-gradient(from ${config.angle ?? 0}deg at ${position}, ${stops})`;
884
+ }
885
+ return `linear-gradient(${config.angle ?? 180}deg, ${stops})`;
886
+ }
887
+ //#endregion
888
+ //#region ../theme-core/src/site-styles/sectionPhoto.ts
889
+ /** The photo a section keeps, wherever its background `type` points. */
890
+ function storedSectionPhoto(content) {
891
+ return readRecord(readRecord(readRecord(content._sectionStyles)?.background)?.image);
892
+ }
893
+ function readRecord(value) {
894
+ return typeof value === "object" && value !== null && !Array.isArray(value) ? value : null;
895
+ }
896
+ //#endregion
897
+ //#region ../blocks/src/system/data/selectBlockContent.ts
898
+ /** Canonical admitted content: legacy publishedContent never selects a version. */
899
+ function selectBlockContent(block, stage = "published") {
900
+ const source = stage === "preview" && block.draftContent ? block.draftContent : block.content;
901
+ return isObjectRecord(source) ? stripStaleTransitionStyleGroup(source) : {};
902
+ }
903
+ //#endregion
904
+ //#region ../blocks/src/system/manifest/variantKey.ts
905
+ /** Parse stored content only; defaults belong to resolveEffectiveArrangement. */
906
+ function parseStoredVariant(manifest, content) {
907
+ const variants = manifest.variants;
908
+ const key = [content.variant, content.layout].find((value) => typeof value === "string" && Boolean(variants && Object.prototype.hasOwnProperty.call(variants, value)));
909
+ return key ? {
910
+ kind: "explicit",
911
+ key: asLayoutVariantKey(key)
912
+ } : { kind: "absent" };
913
+ }
914
+ //#endregion
915
+ //#region ../blocks/src/system/runtime/nodes/events/domain/cta.ts
916
+ /**
917
+ * Booking call-to-action resolution for events: where an event links to and
918
+ * what the button says. Sold-out and waitlist decisions come from capacity.ts
919
+ * so cards, rows and the wizard never disagree.
920
+ */
921
+ function closedEventBookingLabel(reason) {
922
+ switch (reason) {
923
+ case "occurrence_cancelled":
924
+ case "series_cancelled": return "Cancelled";
925
+ case "occurrence_completed":
926
+ case "series_completed": return "Completed";
927
+ case "series_draft":
928
+ case "series_archived":
929
+ case "parent_archived":
930
+ case "parent_inconsistent":
931
+ case "already_started":
932
+ case "enrollment_closed": return "Registration closed";
933
+ default: return assertNever(reason);
934
+ }
935
+ }
936
+ function resolveEventHref(event) {
937
+ const destination = resolveRuntimeEventDestination(event);
938
+ return destination.kind === "external" ? destination.url : destination.path;
939
+ }
940
+ function resolveEventLinkProps(event) {
941
+ const href = resolveEventHref(event);
942
+ return resolveRuntimeEventDestination(event).kind === "external" ? {
943
+ href,
944
+ target: "_blank",
945
+ rel: "noopener noreferrer"
946
+ } : { href };
947
+ }
948
+ /**
949
+ * Resolve the CTA state for an event.
950
+ * Shared by EventCard and EventCompactRow to keep sold-out, registration-closed,
951
+ * and course-specific defaults consistent.
952
+ */
953
+ function resolveEventCta(event, buttonText) {
954
+ const isSoldOut = isEventFull(event);
955
+ const isExternal = resolveRuntimeEventDestination(event).kind === "external";
956
+ const href = resolveEventHref(event);
957
+ if (event.bookingAvailability.kind === "closed") {
958
+ const linksToClosedWholeSeriesDetails = event.bookingAvailability.reason === "enrollment_closed" && !isExternal;
959
+ return {
960
+ label: closedEventBookingLabel(event.bookingAvailability.reason),
961
+ href,
962
+ external: isExternal,
963
+ hidden: !linksToClosedWholeSeriesDetails
964
+ };
965
+ }
966
+ if (!isExternal && isSoldOut) {
967
+ if (canJoinEventWaitlistOnAnyMode(event)) return {
968
+ label: "Join waitlist",
969
+ href,
970
+ external: false,
971
+ hidden: false
972
+ };
973
+ return {
974
+ label: "Sold out",
975
+ href,
976
+ external: false,
977
+ hidden: true
978
+ };
979
+ }
980
+ return destinationCta(event, buttonText);
981
+ }
982
+ function destinationCta(event, buttonText) {
983
+ const destination = resolveRuntimeEventDestination(event);
984
+ return {
985
+ label: buttonText ?? (destination.kind === "external" ? destination.label : "Book"),
986
+ href: resolveEventHref(event),
987
+ external: destination.kind === "external",
988
+ hidden: false
989
+ };
990
+ }
991
+ /**
992
+ * A bounded date strip cannot prove a series sold out. Its destination owns date selection,
993
+ * so the card offers that destination and leaves capacity with the individual date rows.
994
+ * Whole-series bookings still have one shared capacity, as do ordinary occurrence cards.
995
+ */
996
+ function resolveEventCardBooking(event, scope, buttonText) {
997
+ if (scope === "series" && event.bookingScope === "single_occurrence") return {
998
+ cta: seriesBookingClosed(event) ? resolveEventCta(event, buttonText) : destinationCta(event, buttonText),
999
+ availability: null
1000
+ };
1001
+ return {
1002
+ cta: resolveEventCta(event, buttonText),
1003
+ availability: occurrenceCardAvailability(event)
1004
+ };
1005
+ }
1006
+ /** Only a series-wide closure closes its card; a cancelled or started date says nothing about later dates. */
1007
+ function seriesBookingClosed(event) {
1008
+ if (event.bookingAvailability.kind !== "closed") return false;
1009
+ switch (event.bookingAvailability.reason) {
1010
+ case "occurrence_cancelled":
1011
+ case "occurrence_completed":
1012
+ case "already_started": return false;
1013
+ case "series_cancelled":
1014
+ case "series_completed":
1015
+ case "series_draft":
1016
+ case "series_archived":
1017
+ case "parent_archived":
1018
+ case "parent_inconsistent":
1019
+ case "enrollment_closed": return true;
1020
+ default: return assertNever(event.bookingAvailability.reason);
1021
+ }
1022
+ }
1023
+ function occurrenceCardAvailability(event) {
1024
+ const label = formatEventRemainingPlaces(event, { full: "Sold out" });
1025
+ const availability = getEventAvailabilityStatus(event);
1026
+ return label ? {
1027
+ label,
1028
+ status: availability.isFull ? "full" : availability.status === "filling" ? "low" : "available"
1029
+ } : null;
1030
+ }
1031
+ //#endregion
1032
+ //#region ../blocks/src/system/runtime/nodes/events/domain/duration.ts
1033
+ function formatEventDuration(event, style = "legacy") {
1034
+ const durationMinutes = Math.max(0, Math.round((Date.parse(event.endsAt) - Date.parse(event.startsAt)) / 6e4));
1035
+ if (style === "readable" && durationMinutes >= 120) return readableDuration(durationMinutes);
1036
+ if (durationMinutes < 120 || durationMinutes % 60 !== 0) return `${durationMinutes} min`;
1037
+ return `${durationMinutes / 60} hrs`;
1038
+ }
1039
+ function readableDuration(minutes) {
1040
+ const days = Math.floor(minutes / 1440);
1041
+ const hours = Math.floor(minutes % 1440 / 60);
1042
+ const remainder = minutes % 60;
1043
+ return [
1044
+ days ? `${days} ${formatDurationUnitLabel("days", days)}` : null,
1045
+ hours ? `${hours} ${formatDurationUnitLabel("hours", hours)}` : null,
1046
+ remainder ? `${remainder} min` : null
1047
+ ].filter(Boolean).join(" ");
1048
+ }
1049
+ //#endregion
1050
+ //#region ../blocks/src/system/runtime/nodes/events/domain/people.ts
1051
+ function formatTeamMemberNames(names) {
1052
+ const normalized = names.map((name) => name.trim()).filter(Boolean);
1053
+ if (normalized.length === 0) return null;
1054
+ const [firstName, secondName] = normalized;
1055
+ if (!firstName) return null;
1056
+ if (normalized.length === 1) return firstName;
1057
+ if (normalized.length === 2 && secondName) return `${firstName} and ${secondName}`;
1058
+ const finalName = normalized[normalized.length - 1] ?? "";
1059
+ return `${normalized.slice(0, -1).join(", ")}, and ${finalName}`;
1060
+ }
1061
+ function formatEventTeacherLine(event) {
1062
+ const names = formatTeamMemberNames((event.teamMembers ?? []).map((teamMember) => teamMember.name));
1063
+ return names ? `with ${names}` : null;
1064
+ }
1065
+ //#endregion
1066
+ //#region ../blocks/src/system/runtime/nodes/events/domain/monthDay.ts
1067
+ /** Day facts are shared by the legacy grid and arrangement month Looks. */
1068
+ function buildMonthDay(input) {
1069
+ const entries = input.events.map((event) => ({
1070
+ event,
1071
+ timeZone: resolveEventTimeZone(event, input.calendarTimeZone)
1072
+ }));
1073
+ return {
1074
+ date: input.date,
1075
+ dateKey: formatDateKey(input.date),
1076
+ isCurrentMonth: input.date.month === input.viewDate.month,
1077
+ isToday: isToday(input.date, input.today),
1078
+ entries,
1079
+ visibleEntries: entries.slice(0, 3),
1080
+ moreCount: Math.max(0, entries.length - 3)
1081
+ };
1082
+ }
1083
+ /** Select today when it has sessions, otherwise the next occupied visible day. */
1084
+ function resolveMonthSelectedDay(input) {
1085
+ const todayKey = formatDateKey(input.today);
1086
+ const occupied = input.days.map(formatDateKey).filter((key) => (input.eventsByDate.get(key)?.length ?? 0) > 0);
1087
+ return occupied.find((key) => key >= todayKey) ?? occupied[0] ?? formatDateKey(input.viewDate);
1088
+ }
1089
+ //#endregion
1090
+ //#region ../blocks/src/system/runtime/nodes/events/shared/EventCardIcons.tsx
1091
+ function MapPinIcon({ className, size = 16, strokeWidth = 2 }) {
1092
+ return /* @__PURE__ */ jsxs("svg", {
1093
+ className,
1094
+ width: size,
1095
+ height: size,
1096
+ viewBox: "0 0 24 24",
1097
+ fill: "none",
1098
+ stroke: "currentColor",
1099
+ strokeWidth,
1100
+ strokeLinecap: "round",
1101
+ strokeLinejoin: "round",
1102
+ "aria-hidden": "true",
1103
+ focusable: "false",
1104
+ children: [/* @__PURE__ */ jsx("path", { d: "M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z" }), /* @__PURE__ */ jsx("circle", {
1105
+ cx: "12",
1106
+ cy: "10",
1107
+ r: "3"
1108
+ })]
1109
+ });
1110
+ }
1111
+ function CalendarIcon({ className, size = 16, strokeWidth = 2 }) {
1112
+ return /* @__PURE__ */ jsxs("svg", {
1113
+ className,
1114
+ width: size,
1115
+ height: size,
1116
+ viewBox: "0 0 24 24",
1117
+ fill: "none",
1118
+ stroke: "currentColor",
1119
+ strokeWidth,
1120
+ strokeLinecap: "round",
1121
+ strokeLinejoin: "round",
1122
+ "aria-hidden": "true",
1123
+ focusable: "false",
1124
+ children: [
1125
+ /* @__PURE__ */ jsx("rect", {
1126
+ x: "3",
1127
+ y: "4",
1128
+ width: "18",
1129
+ height: "18",
1130
+ rx: "2"
1131
+ }),
1132
+ /* @__PURE__ */ jsx("path", { d: "M16 2v4" }),
1133
+ /* @__PURE__ */ jsx("path", { d: "M8 2v4" }),
1134
+ /* @__PURE__ */ jsx("path", { d: "M3 10h18" })
1135
+ ]
1136
+ });
1137
+ }
1138
+ //#endregion
1139
+ //#region ../blocks/src/system/runtime/nodes/events/shared/eventCategoryBadge.ts
1140
+ /** The category's badge, when the event has a category: its name in its own colour, with readable text. */
1141
+ function eventCategoryBadge(category) {
1142
+ return category ? {
1143
+ label: category.name,
1144
+ style: categoryBadgeStyle(category.color ?? null)
1145
+ } : null;
1146
+ }
1147
+ function categoryBadgeStyle(background) {
1148
+ const normalized = background?.trim() ?? "";
1149
+ if (!normalized) return {
1150
+ backgroundColor: "rgb(var(--tb-accent, 0 0 0))",
1151
+ color: "rgb(var(--tb-onAccent, 255 255 255))"
1152
+ };
1153
+ if (isCssColorLiteral(normalized)) return {
1154
+ backgroundColor: normalized,
1155
+ color: readableTextColor(normalized)
1156
+ };
1157
+ return {
1158
+ backgroundColor: resolveTokenOrCssColorValue(normalized),
1159
+ color: resolveOnColorForThemeToken(normalized) ?? "rgb(var(--tb-onAccent, 255 255 255))"
1160
+ };
1161
+ }
1162
+ function readableTextColor(background) {
1163
+ try {
1164
+ return getTextColorForBackground(background);
1165
+ } catch {
1166
+ return "rgb(var(--tb-onAccent, 255 255 255))";
1167
+ }
1168
+ }
1169
+ //#endregion
1170
+ //#region ../blocks/src/system/runtime/nodes/events/shared/EventItem.tsx
1171
+ /** Arrangement content choices are data, ready for other live offering lists to reuse. */
1172
+ const eventItemParts = {
1173
+ ledger: [
1174
+ "date",
1175
+ "title",
1176
+ "meta",
1177
+ "time",
1178
+ "places",
1179
+ "description",
1180
+ "action"
1181
+ ],
1182
+ "day-groups": [
1183
+ "title",
1184
+ "meta",
1185
+ "time",
1186
+ "places",
1187
+ "description",
1188
+ "action"
1189
+ ],
1190
+ "week-columns": [
1191
+ "time",
1192
+ "title",
1193
+ "meta",
1194
+ "places"
1195
+ ],
1196
+ grid: [
1197
+ "image",
1198
+ "chips",
1199
+ "date",
1200
+ "title",
1201
+ "meta",
1202
+ "description",
1203
+ "action"
1204
+ ],
1205
+ compact: [
1206
+ "date",
1207
+ "title",
1208
+ "meta",
1209
+ "time",
1210
+ "places",
1211
+ "action"
1212
+ ],
1213
+ "month-day": [
1214
+ "title",
1215
+ "meta",
1216
+ "description",
1217
+ "action"
1218
+ ]
1219
+ };
1220
+ function eventItemFacts(props) {
1221
+ const options = eventDateOptions(props.event);
1222
+ const availability = getEventAvailabilityStatus(props.event);
1223
+ const time = formatEventTimeRange(props.event, options);
1224
+ const price = formatEventPrice(props.event);
1225
+ return {
1226
+ date: formatEventCompactDateRail(props.event.startsAt, options, "as-written"),
1227
+ time,
1228
+ price,
1229
+ link: resolveEventLinkProps(props.event),
1230
+ meta: eventItemMeta(props, {
1231
+ time,
1232
+ price
1233
+ }),
1234
+ venueIcon: props.arrangement === "compact" && props.showVenue !== false && Boolean(props.event.venue),
1235
+ places: props.showCapacity ? formatEventRemainingPlaces(props.event, { full: "Sold out" }) : null,
1236
+ availability: availability.isFull ? "full" : availability.status === "filling" ? "low" : "available",
1237
+ description: props.event.presentation?.summary ?? props.event.description
1238
+ };
1239
+ }
1240
+ /** Compact rows keep pricing in the details rail and time in the action rail. */
1241
+ function eventItemMeta(props, formatted) {
1242
+ const parts = props.parts ?? eventItemParts[props.arrangement];
1243
+ const venue = props.showVenue !== false ? props.event.venue?.name : null;
1244
+ const teacher = formatEventTeacherLine(props.event);
1245
+ const time = parts.includes("time") ? null : formatted.time;
1246
+ const price = props.arrangement === "compact" && !parts.includes("price") ? formatted.price : null;
1247
+ return (props.arrangement === "compact" ? [
1248
+ venue,
1249
+ teacher,
1250
+ price,
1251
+ time
1252
+ ] : [
1253
+ time,
1254
+ teacher,
1255
+ venue
1256
+ ]).filter(Boolean).join(" · ");
1257
+ }
1258
+ /**
1259
+ * Keep one RSC component boundary per item. Re-forwarding shared presentation
1260
+ * props through layout/part components multiplies React's development debug
1261
+ * provenance during Flight decoding (a Lotus ledger exhausted Next's heap).
1262
+ * The internal renderers are pure, hook-free functions.
1263
+ */
1264
+ function EventItem(props) {
1265
+ return "item" in props ? renderCardItem(props) : renderCalendarItem(props);
1266
+ }
1267
+ function renderCalendarItem(props) {
1268
+ const parts = (props.parts ?? eventItemParts[props.arrangement]).filter((part) => part !== "image" || props.showPhotos !== false);
1269
+ const facts = eventItemFacts(props);
1270
+ const Tag = props.as ?? eventItemTag(props.arrangement);
1271
+ const root = props.arrangement === "grid" ? "item" : props.continued ? "row-continued" : "row";
1272
+ const chipsOnPhoto = parts.includes("image") && Boolean(props.event.presentation?.image);
1273
+ const body = (part) => [
1274
+ "title",
1275
+ "meta",
1276
+ "description"
1277
+ ].includes(part) || part === "chips" && !chipsOnPhoto || part === "action" && props.arrangement === "grid";
1278
+ const renderPart = (part) => /* @__PURE__ */ jsx(React.Fragment, { children: renderEventItemContentPart({
1279
+ part,
1280
+ props,
1281
+ facts
1282
+ }) }, part);
1283
+ return /* @__PURE__ */ jsxs(Tag, {
1284
+ ...listLookSlot(props, root),
1285
+ "data-availability": facts.availability,
1286
+ children: [
1287
+ parts.filter((part) => part === "image" || part === "chips" && chipsOnPhoto || part === "date").map(renderPart),
1288
+ /* @__PURE__ */ jsx("div", {
1289
+ ...listLookSlot(props, props.arrangement === "grid" ? "item-body" : "what"),
1290
+ children: parts.filter(body).map(renderPart)
1291
+ }),
1292
+ renderCalendarTrailingParts(props, parts.filter((part) => [
1293
+ "time",
1294
+ "places",
1295
+ "price",
1296
+ "action"
1297
+ ].includes(part) && !body(part)), renderPart)
1298
+ ]
1299
+ });
1300
+ }
1301
+ function renderCalendarTrailingParts(props, parts, renderPart) {
1302
+ const content = parts.map(renderPart);
1303
+ return props.arrangement === "compact" && parts.length > 0 ? /* @__PURE__ */ jsx("div", {
1304
+ ...listLookSlot(props, "item-actions"),
1305
+ children: content
1306
+ }) : content;
1307
+ }
1308
+ function eventItemTag(arrangement) {
1309
+ return arrangement === "ledger" || arrangement === "day-groups" || arrangement === "week-columns" ? "li" : "article";
1310
+ }
1311
+ function renderEventItemContentPart({ part, props, facts }) {
1312
+ switch (part) {
1313
+ case "image": return renderEventItemImage(props, facts.link);
1314
+ case "chips": return renderEventItemCategory(props);
1315
+ case "date": return /* @__PURE__ */ jsxs("time", {
1316
+ ...listLookSlot(props, "date"),
1317
+ dateTime: props.event.startsAt,
1318
+ "aria-label": facts.date.label,
1319
+ children: [
1320
+ /* @__PURE__ */ jsx("span", {
1321
+ ...listLookSlot(props, "weekday"),
1322
+ children: facts.date.weekday
1323
+ }),
1324
+ /* @__PURE__ */ jsx("span", {
1325
+ ...listLookSlot(props, "day"),
1326
+ children: facts.date.day
1327
+ }),
1328
+ /* @__PURE__ */ jsx("span", {
1329
+ ...listLookSlot(props, "month"),
1330
+ children: facts.date.month
1331
+ })
1332
+ ]
1333
+ });
1334
+ case "title": return /* @__PURE__ */ jsx("h3", {
1335
+ ...listLookSlot(props, "item-title"),
1336
+ children: /* @__PURE__ */ jsx("a", {
1337
+ ...facts.link,
1338
+ children: props.event.title
1339
+ })
1340
+ });
1341
+ case "time": return /* @__PURE__ */ jsxs("p", {
1342
+ ...listLookSlot(props, "time"),
1343
+ children: [props.arrangement === "compact" ? /* @__PURE__ */ jsx(ClockIcon, { "aria-hidden": "true" }) : null, facts.time]
1344
+ });
1345
+ case "places": return facts.places ? /* @__PURE__ */ jsx("p", {
1346
+ ...listLookSlot(props, "places"),
1347
+ children: /* @__PURE__ */ jsx("span", {
1348
+ "data-event-places": true,
1349
+ children: facts.places
1350
+ })
1351
+ }) : null;
1352
+ case "price": return /* @__PURE__ */ jsx("p", {
1353
+ ...listLookSlot(props, "price"),
1354
+ children: facts.price
1355
+ });
1356
+ case "meta": return renderEventItemMeta({
1357
+ props,
1358
+ facts
1359
+ });
1360
+ case "description": return /* @__PURE__ */ jsx(CardListContentPart, {
1361
+ part: "text",
1362
+ item: {
1363
+ id: props.event.id,
1364
+ title: props.event.title,
1365
+ text: facts.description
1366
+ },
1367
+ presentation: props
1368
+ });
1369
+ case "action": return renderEventItemAction(props);
1370
+ }
1371
+ }
1372
+ function renderEventItemMeta({ props, facts }) {
1373
+ const places = (props.parts ?? eventItemParts[props.arrangement]).includes("places") ? null : facts.places;
1374
+ return facts.meta || places ? /* @__PURE__ */ jsxs("p", {
1375
+ ...listLookSlot(props, "item-meta"),
1376
+ children: [
1377
+ facts.venueIcon ? /* @__PURE__ */ jsx(MapPinIcon, {}) : null,
1378
+ facts.meta,
1379
+ facts.meta && places ? " · " : null,
1380
+ places ? /* @__PURE__ */ jsx("span", {
1381
+ "data-event-places": true,
1382
+ children: places
1383
+ }) : null
1384
+ ]
1385
+ }) : null;
1386
+ }
1387
+ function renderEventItemImage(props, link) {
1388
+ return /* @__PURE__ */ jsx(CardListContentPart, {
1389
+ part: "media",
1390
+ item: {
1391
+ id: props.event.id,
1392
+ title: props.event.title,
1393
+ media: props.event.presentation?.image,
1394
+ titleLink: link,
1395
+ newTabHint: link.target === "_blank"
1396
+ },
1397
+ presentation: props
1398
+ });
1399
+ }
1400
+ /** The same badge the older event cards show: the category's name in its own colour. */
1401
+ function renderEventItemCategory(props) {
1402
+ const badge = eventCategoryBadge(props.event.eventCategory);
1403
+ return badge ? /* @__PURE__ */ jsx("div", {
1404
+ ...listLookSlot(props, "chips"),
1405
+ children: /* @__PURE__ */ jsx("span", {
1406
+ ...listLookSlot(props, "chip"),
1407
+ style: badge.style,
1408
+ children: badge.label
1409
+ })
1410
+ }) : null;
1411
+ }
1412
+ function renderEventItemAction(props) {
1413
+ const cta = resolveEventCta(props.event, props.buttonText);
1414
+ const slot = props.arrangement === "grid" ? "item-actions" : "action";
1415
+ const link = {
1416
+ href: cta.href,
1417
+ target: cta.external ? "_blank" : void 0,
1418
+ rel: cta.external ? "noopener noreferrer" : void 0
1419
+ };
1420
+ return /* @__PURE__ */ jsx("div", {
1421
+ ...listLookSlot(props, slot),
1422
+ children: cta.hidden ? /* @__PURE__ */ jsx("span", { children: cta.label }) : props.itemActionStyle === "link" ? /* @__PURE__ */ jsx("a", {
1423
+ ...link,
1424
+ className: "rb-item-text-link",
1425
+ children: cta.label
1426
+ }) : /* @__PURE__ */ jsx(ThemedButtonLink, {
1427
+ ...link,
1428
+ variant: props.buttonVariant ?? "primary",
1429
+ size: props.actionSize ?? "sm",
1430
+ label: cta.label
1431
+ })
1432
+ });
1433
+ }
1434
+ const carouselBodyParts = [
1435
+ "chips",
1436
+ "numeral",
1437
+ "title",
1438
+ "price",
1439
+ "schedule",
1440
+ "dates",
1441
+ "text",
1442
+ "facts",
1443
+ "availability",
1444
+ "action"
1445
+ ];
1446
+ const bodyParts = [
1447
+ "chips",
1448
+ "numeral",
1449
+ "title",
1450
+ "price",
1451
+ "text",
1452
+ "facts",
1453
+ "schedule",
1454
+ "dates",
1455
+ "availability",
1456
+ "action"
1457
+ ];
1458
+ function renderCardItem({ item, presentation, index, Title, actionNode, feedback }) {
1459
+ const layout = cardItemLayout(presentation, index);
1460
+ const body = cardItemBody(item, presentation);
1461
+ const Tag = layout.tag;
1462
+ const parts = body.parts.map((part) => /* @__PURE__ */ jsx(React.Fragment, { children: CardListContentPart({
1463
+ part,
1464
+ item: body.item,
1465
+ presentation,
1466
+ Title,
1467
+ actionNode
1468
+ }) }, part));
1469
+ const marker = /* @__PURE__ */ jsx("div", {
1470
+ ...listLookSlot(presentation, "numeral"),
1471
+ "aria-hidden": "true"
1472
+ });
1473
+ return /* @__PURE__ */ jsx(Tag, {
1474
+ ...listLookSlot(presentation, layout.slot),
1475
+ "data-card-list-item": true,
1476
+ "data-has-featured": item.featured ? true : void 0,
1477
+ children: layout.kind === "row" ? /* @__PURE__ */ jsxs(Fragment, { children: [
1478
+ marker,
1479
+ parts,
1480
+ feedback
1481
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [renderCardItemMedia({
1482
+ item,
1483
+ presentation
1484
+ }), /* @__PURE__ */ jsxs("div", {
1485
+ ...listLookSlot(presentation, "item-body"),
1486
+ children: [
1487
+ marker,
1488
+ parts,
1489
+ feedback
1490
+ ]
1491
+ })] })
1492
+ });
1493
+ }
1494
+ function cardItemLayout(presentation, index) {
1495
+ const arrangement = presentation.cardArrangement ?? "cards";
1496
+ if (arrangement === "index" || arrangement === "sequence") return {
1497
+ kind: "row",
1498
+ tag: "li",
1499
+ slot: "item"
1500
+ };
1501
+ return {
1502
+ kind: "card",
1503
+ tag: "article",
1504
+ slot: arrangement === "lead-support" && index === 0 ? "lead" : "item"
1505
+ };
1506
+ }
1507
+ function cardItemBody(item, presentation) {
1508
+ const schedule = resolveCardListSchedule(item, presentation.datesMode);
1509
+ const arrangement = presentation.cardArrangement ?? "cards";
1510
+ const parts = (presentation.bodyParts ?? (arrangement === "slides" || arrangement === "track" ? carouselBodyParts : bodyParts)).filter((part) => part !== "schedule" && part !== "dates" || part === schedule.part);
1511
+ return {
1512
+ item: schedule.item,
1513
+ parts
1514
+ };
1515
+ }
1516
+ function renderCardItemMedia({ item, presentation }) {
1517
+ const carousel = presentation.cardArrangement === "slides" || presentation.cardArrangement === "track";
1518
+ if (presentation.showPhotos === false) return null;
1519
+ if (!item.media) return carousel && item.leadDate ? /* @__PURE__ */ jsx("div", {
1520
+ ...listLookSlot(presentation, "item-media"),
1521
+ "data-has-date-plate": true,
1522
+ children: /* @__PURE__ */ jsx(CardListLeadDate, {
1523
+ item,
1524
+ presentation
1525
+ })
1526
+ }) : null;
1527
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(CardListContentPart, {
1528
+ part: "media",
1529
+ item,
1530
+ presentation
1531
+ }), carousel && item.leadDate ? /* @__PURE__ */ jsx("div", {
1532
+ "data-has-date-stamp": true,
1533
+ children: /* @__PURE__ */ jsx(CardListLeadDate, {
1534
+ item,
1535
+ presentation
1536
+ })
1537
+ }) : null] });
1538
+ }
1539
+ /** Pure and hook-free: select presentation before creating per-card RSC elements. */
1540
+ function CardListItems({ Carousel, items, presentation, carouselLabels, Title = "h3" }) {
1541
+ const selectedPresentation = selectCardListPresentation(presentation);
1542
+ return /* @__PURE__ */ jsx(CardListCollection, {
1543
+ Carousel,
1544
+ presentation: selectedPresentation,
1545
+ slides: cardListSlides(items, selectedPresentation, Title),
1546
+ photoCount: presentation.showPhotos === false ? 0 : items.filter((item) => item.media).length,
1547
+ labels: carouselLabels
1548
+ });
1549
+ }
1550
+ function CardListCollection({ Carousel, presentation, slides, photoCount = 0, labels }) {
1551
+ if (Carousel && (presentation.cardArrangement === "slides" || presentation.cardArrangement === "track")) return /* @__PURE__ */ jsx(Carousel, {
1552
+ mode: "arrangement",
1553
+ arrangement: presentation.cardArrangement,
1554
+ cardList: true,
1555
+ labels: labels ?? {
1556
+ item: "card",
1557
+ region: "Cards"
1558
+ },
1559
+ indicator: presentation.cardArrangement === "slides" ? "dots" : "none",
1560
+ slides
1561
+ });
1562
+ return /* @__PURE__ */ jsx(presentation.cardArrangement === "index" || presentation.cardArrangement === "sequence" ? "ol" : "div", {
1563
+ ...listLookSlot(presentation, "items"),
1564
+ "data-card-list": true,
1565
+ "data-has-photo": String(photoCount > 0),
1566
+ "data-photo-count": String(photoCount),
1567
+ children: slides.map(({ content }) => content)
1568
+ });
1569
+ }
1570
+ /** A card remains one element; the carousel owns track and slide wrappers. */
1571
+ function cardListSlides(items, presentation, Title = "h3") {
1572
+ return items.map((item, index) => ({
1573
+ title: item.title,
1574
+ content: /* @__PURE__ */ jsx(EventItem, {
1575
+ item,
1576
+ index,
1577
+ Title,
1578
+ presentation: leadItemPresentation(presentation, index, items.length)
1579
+ }, item.id)
1580
+ }));
1581
+ }
1582
+ function leadItemPresentation(presentation, index, count) {
1583
+ return listItemPresentation(presentation, index, count);
1584
+ }
1585
+ /** These parents describe the JSX above, independently of any Look or style. */
1586
+ function eventItemSlotParents(arrangement) {
1587
+ const root = arrangement === "grid" ? "item" : "row";
1588
+ return {
1589
+ date: root,
1590
+ availability: arrangement === "grid" ? "item-body" : "what",
1591
+ "item-body": root,
1592
+ what: root
1593
+ };
1594
+ }
1595
+ function cardItemSlotParents(arrangement) {
1596
+ const body = arrangement === "index" || arrangement === "sequence" ? "item" : "item-body";
1597
+ return {
1598
+ item: "items",
1599
+ lead: "items",
1600
+ "item-body": "item",
1601
+ "item-media": "item",
1602
+ dates: body,
1603
+ date: arrangement === "slides" || arrangement === "track" ? "item-media" : "dates",
1604
+ availability: body
1605
+ };
1606
+ }
1607
+ //#endregion
1608
+ //#region ../blocks/src/system/runtime/nodes/events/shared/EmptyState.tsx
1609
+ /**
1610
+ * EmptyState Component
1611
+ * Displays when no events are available.
1612
+ * Optionally shows a "Reset filters" button when filters are applied.
1613
+ */
1614
+ const EmptyState = ({ message = "No upcoming events scheduled.", className, hasActiveFilters = false, onResetFilters, resetFiltersText = "Reset filters" }) => {
1615
+ return /* @__PURE__ */ jsxs("div", {
1616
+ className: `event-list-empty ${className || ""}`,
1617
+ children: [/* @__PURE__ */ jsx("p", {
1618
+ className: "rb-caption status-muted",
1619
+ children: message
1620
+ }), hasActiveFilters && onResetFilters && /* @__PURE__ */ jsx("button", {
1621
+ type: "button",
1622
+ onClick: onResetFilters,
1623
+ className: "event-reset-filters-btn",
1624
+ children: resetFiltersText
1625
+ })]
1626
+ });
1627
+ };
1628
+ //#endregion
1629
+ //#region ../blocks/src/pageRenderAdmission.ts
1630
+ function presentPublicBlock(block) {
1631
+ const metadata = {
1632
+ id: block.id,
1633
+ kind: block.kind,
1634
+ purpose: block.purpose,
1635
+ ...block.contentVersionId ? { contentVersionId: block.contentVersionId } : {},
1636
+ ...block.draftContentId !== void 0 ? { draftContentId: block.draftContentId } : {},
1637
+ publishedPlacement: block.publishedPlacement,
1638
+ ...block.bindings ? { bindings: block.bindings } : {}
1639
+ };
1640
+ return block.admission.kind === "renderable" ? {
1641
+ ...metadata,
1642
+ content: block.admission.content,
1643
+ presentationAdmission: { kind: "renderable" }
1644
+ } : {
1645
+ ...metadata,
1646
+ presentationAdmission: {
1647
+ kind: "invalid",
1648
+ error: block.admission.error
1649
+ }
1650
+ };
1651
+ }
1652
+ function presentEditorBlock(block) {
1653
+ return {
1654
+ ...block,
1655
+ presentationAdmission: { kind: "editor" }
1656
+ };
1657
+ }
1658
+ function createPresentationPageReader() {
1659
+ const readBlock = memoizePresentationBlock(presentPublicBlock);
1660
+ return (page) => page ? {
1661
+ ...page,
1662
+ blocks: page.blocks.map(readBlock)
1663
+ } : null;
1664
+ }
1665
+ function createEditorPresentationPageReader() {
1666
+ const readBlock = memoizePresentationBlock(presentEditorBlock);
1667
+ return (page) => page ? {
1668
+ ...page,
1669
+ blocks: page.blocks.map(readBlock)
1670
+ } : null;
1671
+ }
1672
+ function memoizePresentationBlock(present) {
1673
+ const blocks = /* @__PURE__ */ new WeakMap();
1674
+ return (block) => {
1675
+ const cached = blocks.get(block);
1676
+ if (cached) return cached;
1677
+ const presentation = present(block);
1678
+ blocks.set(block, presentation);
1679
+ return presentation;
1680
+ };
1681
+ }
1682
+ //#endregion
1683
+ //#region ../blocks/src/system/runtime/nodes/events/EventListing.view.tsx
1684
+ function EventListingFrameView(props) {
1685
+ const { display, filters, emptyState, renderEventCard } = props;
1686
+ const footer = /* @__PURE__ */ jsxs(Fragment, { children: [props.footer, display.sectionAction ? /* @__PURE__ */ jsx("div", {
1687
+ ...listLookSlot(display, "more"),
1688
+ children: /* @__PURE__ */ jsx("a", {
1689
+ href: display.sectionAction.href,
1690
+ className: "rb-item-text-link",
1691
+ children: display.sectionAction.label
1692
+ })
1693
+ }) : null] });
1694
+ return /* @__PURE__ */ jsxs("div", {
1695
+ className: `event-listing ${display.className ?? ""}`,
1696
+ "data-block": "event-listing",
1697
+ children: [
1698
+ filters,
1699
+ display.state === "loading" ? /* @__PURE__ */ jsx(EmptyState, { message: display.loadingMessage }) : display.state === "empty" ? emptyState ?? /* @__PURE__ */ jsx(EmptyState, { message: display.emptyMessage }) : /* @__PURE__ */ jsx(EventListBody, {
1700
+ display,
1701
+ renderEventCard,
1702
+ footer
1703
+ }),
1704
+ hasArrangementPanel(display) ? null : footer
1705
+ ]
1706
+ });
1707
+ }
1708
+ function EventListBody({ display, renderEventCard, footer }) {
1709
+ if (display.lookSlots === void 0) return /* @__PURE__ */ jsx("div", {
1710
+ className: display.containerClass,
1711
+ children: display.events.map(renderEventCard)
1712
+ });
1713
+ if (display.listLayout === "week-columns" && display.week !== void 0) return /* @__PURE__ */ jsx(WeekColumns, {
1714
+ display,
1715
+ week: display.week
1716
+ });
1717
+ if (display.listLayout === "day-groups" || display.listLayout === "week-columns") return /* @__PURE__ */ jsx("ol", {
1718
+ ...listLookSlot(display, "list"),
1719
+ children: display.events.filter((event, index, events) => events.findIndex((candidate) => eventLocalDateKey(candidate) === eventLocalDateKey(event)) === index).map((first) => {
1720
+ const date = formatEventCompactDateRail(first.startsAt, eventDateOptions(first), "as-written");
1721
+ return /* @__PURE__ */ jsxs("li", {
1722
+ ...listLookSlot(display, "group"),
1723
+ children: [/* @__PURE__ */ jsxs("h3", {
1724
+ ...listLookSlot(display, "group-label"),
1725
+ children: [/* @__PURE__ */ jsx("span", {
1726
+ ...listLookSlot(display, "group-day"),
1727
+ children: date.weekday
1728
+ }), /* @__PURE__ */ jsxs("span", {
1729
+ ...listLookSlot(display, "group-date"),
1730
+ children: [
1731
+ date.day,
1732
+ " ",
1733
+ date.month
1734
+ ]
1735
+ })]
1736
+ }), /* @__PURE__ */ jsx("ol", { children: display.events.filter((event) => eventLocalDateKey(event) === eventLocalDateKey(first)).map((event) => /* @__PURE__ */ jsx(EventItem, {
1737
+ ...listItemPresentation(display, display.events.indexOf(event), display.events.length),
1738
+ event,
1739
+ arrangement: "day-groups"
1740
+ }, event.occurrenceId || event.id)) })]
1741
+ }, eventLocalDateKey(first));
1742
+ })
1743
+ });
1744
+ if (display.listLayout === "ledger") return /* @__PURE__ */ jsx("ol", {
1745
+ ...listLookSlot(display, "list"),
1746
+ children: display.events.map((event, index, events) => /* @__PURE__ */ jsx(EventItem, {
1747
+ ...listItemPresentation(display, index, events.length),
1748
+ event,
1749
+ arrangement: "ledger",
1750
+ continued: index > 0 && eventLocalDateKey(event) === eventLocalDateKey(events[index - 1] ?? event)
1751
+ }, event.occurrenceId || event.id))
1752
+ });
1753
+ if (display.listLayout === "compact") return /* @__PURE__ */ jsxs("aside", {
1754
+ ...listLookSlot(display, "panel"),
1755
+ className: display.containerClass,
1756
+ children: [
1757
+ display.panelHeading !== void 0 ? /* @__PURE__ */ jsx("h3", {
1758
+ ...listLookSlot(display, "panel-heading"),
1759
+ children: display.panelHeading
1760
+ }) : null,
1761
+ /* @__PURE__ */ jsx("div", {
1762
+ ...listLookSlot(display, "list"),
1763
+ children: display.events.map(renderEventCard)
1764
+ }),
1765
+ footer
1766
+ ]
1767
+ });
1768
+ return /* @__PURE__ */ jsx("div", {
1769
+ ...listLookSlot(display, "list"),
1770
+ className: display.containerClass,
1771
+ children: display.events.map(renderEventCard)
1772
+ });
1773
+ }
1774
+ /** All seven days of the shown week; a day known to be empty says so, and a wholly empty week never reaches here. */
1775
+ function WeekColumns({ display, week }) {
1776
+ return /* @__PURE__ */ jsx("ol", {
1777
+ ...listLookSlot(display, "list"),
1778
+ children: weekColumnDays(week, display.events, display.allLoaded === true).map((day) => /* @__PURE__ */ jsxs("li", {
1779
+ ...listLookSlot(display, "group"),
1780
+ ...day.isToday ? { "data-today": "true" } : {},
1781
+ children: [/* @__PURE__ */ jsxs("h3", {
1782
+ ...listLookSlot(display, "group-label"),
1783
+ children: [
1784
+ /* @__PURE__ */ jsxs("span", {
1785
+ ...listLookSlot(display, "group-day"),
1786
+ children: [/* @__PURE__ */ jsx("span", {
1787
+ "aria-hidden": "true",
1788
+ children: day.label.weekday
1789
+ }), /* @__PURE__ */ jsx("span", {
1790
+ className: "rb-sr-only",
1791
+ children: day.label.fullWeekday
1792
+ })]
1793
+ }),
1794
+ " ",
1795
+ /* @__PURE__ */ jsx("span", {
1796
+ ...listLookSlot(display, "group-date", day.isToday ? "today" : void 0),
1797
+ children: day.label.day
1798
+ })
1799
+ ]
1800
+ }), day.sessions.kind === "some" ? /* @__PURE__ */ jsx("ol", { children: day.sessions.events.map((event) => /* @__PURE__ */ jsx(EventItem, {
1801
+ ...listItemPresentation(display, display.events.indexOf(event), display.events.length),
1802
+ event,
1803
+ arrangement: "week-columns"
1804
+ }, event.occurrenceId || event.id)) }) : day.sessions.kind === "none" ? /* @__PURE__ */ jsx("p", {
1805
+ ...listLookSlot(display, "group-empty"),
1806
+ children: "Nothing on"
1807
+ }) : null]
1808
+ }, day.dateKey))
1809
+ });
1810
+ }
1811
+ function hasArrangementPanel(display) {
1812
+ return display.state === "ready" && display.lookSlots !== void 0 && display.listLayout === "compact";
1813
+ }
1814
+ /** Nearest slot parents in EventListBody and WeekColumns. */
1815
+ /** `root` is the declared slot the listing renders inside (a Look may paint the block's layout), or null. */
1816
+ function eventListSlotParents(arrangement, root = null) {
1817
+ return {
1818
+ list: arrangement === "compact" ? "panel" : root,
1819
+ panel: root,
1820
+ group: "list",
1821
+ "group-label": "group",
1822
+ "group-date": "group-label",
1823
+ item: "list",
1824
+ row: arrangement === "week-columns" || arrangement === "day-groups" ? "group" : "list",
1825
+ "row-continued": "list"
1826
+ };
1827
+ }
1828
+ //#endregion
1829
+ //#region ../blocks/src/system/runtime/nodes/events/shared/MonthLookView.tsx
1830
+ function MonthEvent({ event, timeZone, locale, presentation }) {
1831
+ return /* @__PURE__ */ jsxs("a", {
1832
+ ...resolveEventLinkProps(event),
1833
+ ...listLookSlot(presentation, "item"),
1834
+ children: [
1835
+ /* @__PURE__ */ jsx("span", {
1836
+ ...listLookSlot(presentation, "time"),
1837
+ children: formatTime(event.startsAt, {
1838
+ ...eventDateOptions({
1839
+ ...event,
1840
+ timeZone
1841
+ }),
1842
+ locale
1843
+ })
1844
+ }),
1845
+ " ",
1846
+ /* @__PURE__ */ jsx("span", {
1847
+ ...listLookSlot(presentation, "what"),
1848
+ children: event.title
1849
+ })
1850
+ ]
1851
+ });
1852
+ }
1853
+ function dateLabel(key, timeZone, date = "short") {
1854
+ return formatDate({
1855
+ kind: "civil",
1856
+ value: parseBookingLocalDate(key)
1857
+ }, eventDateOptions({
1858
+ siteTimeZone: timeZone,
1859
+ timeZone
1860
+ }), {
1861
+ date,
1862
+ weekday: "long"
1863
+ });
1864
+ }
1865
+ function MonthDay(props) {
1866
+ const { day, selection } = props;
1867
+ const { controls } = selection;
1868
+ const selected = day.dateKey === selection.selectedDay;
1869
+ return /* @__PURE__ */ jsxs("div", {
1870
+ ...listLookSlot(selection, "date"),
1871
+ "data-current": String(selected),
1872
+ "data-today": String(day.isToday),
1873
+ "data-other-month": String(!day.isCurrentMonth),
1874
+ children: [selection.arrangement === "month-day" ? /* @__PURE__ */ jsx("button", {
1875
+ type: "button",
1876
+ ...listLookSlot(selection, "control"),
1877
+ "aria-label": `Show events on ${dateLabel(day.dateKey, selection.timeZone, "long")}`,
1878
+ "aria-pressed": selected,
1879
+ onClick: controls ? () => controls.selectDay(day.dateKey) : void 0,
1880
+ children: day.date.day
1881
+ }) : /* @__PURE__ */ jsx("span", {
1882
+ ...listLookSlot(selection, "date-label"),
1883
+ children: day.date.day
1884
+ }), selection.arrangement === "month-grid" ? /* @__PURE__ */ jsxs(Fragment, { children: [day.visibleEntries.map(({ event, timeZone }, index, entries) => /* @__PURE__ */ jsx(MonthEvent, {
1885
+ presentation: listItemPresentation(selection, index, entries.length),
1886
+ event,
1887
+ timeZone,
1888
+ locale: eventDateOptions({ siteTimeZone: selection.timeZone }).locale
1889
+ }, event.occurrenceId ?? event.id)), day.moreCount > 0 ? /* @__PURE__ */ jsxs("button", {
1890
+ type: "button",
1891
+ className: "event-calendar-more",
1892
+ ...listLookSlot(selection, "more"),
1893
+ onClick: controls ? () => controls.openDay(day.date, day.entries.map(({ event }) => event)) : void 0,
1894
+ children: [
1895
+ "+",
1896
+ day.moreCount,
1897
+ " more"
1898
+ ]
1899
+ }) : null] }) : /* @__PURE__ */ jsx(MonthDayMarks, {
1900
+ count: day.entries.length,
1901
+ presentation: selection
1902
+ })]
1903
+ });
1904
+ }
1905
+ /** Both Looks and the legacy month grid consume the same per-day model. */
1906
+ function MonthLookView(props) {
1907
+ const days = props.days.map((date) => buildMonthDay({
1908
+ date,
1909
+ events: props.eventsByDate.get(formatDateKey(date)) ?? [],
1910
+ viewDate: props.viewDate,
1911
+ today: props.today,
1912
+ calendarTimeZone: props.timeZone
1913
+ }));
1914
+ const selected = days.find((day) => day.dateKey === props.selectedDay);
1915
+ return /* @__PURE__ */ jsxs("div", {
1916
+ ...listLookSlot(props, "frame"),
1917
+ "data-arrangement": props.arrangement,
1918
+ children: [/* @__PURE__ */ jsxs("div", {
1919
+ ...listLookSlot(props, "grid"),
1920
+ children: [props.dayNames.map((name) => /* @__PURE__ */ jsx("span", {
1921
+ ...listLookSlot(props, "group-label"),
1922
+ children: name
1923
+ }, name)), days.map((day) => /* @__PURE__ */ jsx(MonthDay, {
1924
+ day,
1925
+ selection: props
1926
+ }, day.dateKey))]
1927
+ }), props.arrangement === "month-day" ? /* @__PURE__ */ jsxs("section", {
1928
+ ...listLookSlot(props, "panel"),
1929
+ "aria-live": "polite",
1930
+ children: [/* @__PURE__ */ jsx("h3", {
1931
+ ...listLookSlot(props, "panel-heading"),
1932
+ children: dateLabel(props.selectedDay, props.timeZone)
1933
+ }), /* @__PURE__ */ jsx("div", {
1934
+ ...listLookSlot(props, "list"),
1935
+ children: selected?.entries.length ? selected.entries.map(({ event }, index, entries) => /* @__PURE__ */ jsx(EventItem, {
1936
+ ...listItemPresentation(props, index, entries.length),
1937
+ event,
1938
+ arrangement: "month-day"
1939
+ }, event.occurrenceId ?? event.id)) : /* @__PURE__ */ jsx("p", {
1940
+ ...listLookSlot(props, "intro"),
1941
+ children: props.emptyMessage
1942
+ })
1943
+ })]
1944
+ }) : null]
1945
+ });
1946
+ }
1947
+ function MonthDayMarks({ count, presentation }) {
1948
+ if (count === 0) return null;
1949
+ return /* @__PURE__ */ jsx("span", {
1950
+ ...listLookSlot(presentation, "item-meta"),
1951
+ role: "img",
1952
+ "aria-label": `${count} ${count === 1 ? "event" : "events"}`,
1953
+ children: Array.from({ length: Math.min(count, 3) }, (_, index) => /* @__PURE__ */ jsx("span", {
1954
+ ...listLookSlot(presentation, "mark"),
1955
+ "aria-hidden": "true"
1956
+ }, index))
1957
+ });
1958
+ }
1959
+ function monthSlotParents(arrangement) {
1960
+ return {
1961
+ frame: null,
1962
+ grid: "frame",
1963
+ date: "grid",
1964
+ panel: "frame",
1965
+ list: "panel",
1966
+ item: arrangement === "month-grid" ? "date" : "list",
1967
+ row: "list",
1968
+ "group-label": "grid",
1969
+ "item-meta": "date",
1970
+ mark: "item-meta"
1971
+ };
1972
+ }
1973
+ //#endregion
1974
+ //#region ../blocks/src/system/blocks/offerings-preview/scheduleSummary.ts
1975
+ function deriveEventScheduleSummary(event) {
1976
+ const occurrence = occurrenceFromEvent(event);
1977
+ return compareLocalScheduleDates(getLocalScheduleDate(new Date(occurrence.endsAt), resolveBookingBusinessTimeZone(occurrence.timeZone)), getLocalScheduleDate(new Date(occurrence.startsAt), resolveBookingBusinessTimeZone(occurrence.timeZone))) > 0 ? {
1978
+ kind: "multi-day-span",
1979
+ occurrence
1980
+ } : {
1981
+ kind: "single-occurrence",
1982
+ occurrence
1983
+ };
1984
+ }
1985
+ function derivePreviewRunSchedule(event) {
1986
+ const sessions = orderedLiveRunSessions(event.run.sessions).filter(isValidOccurrence);
1987
+ const first = sessions[0];
1988
+ const last = sessions[sessions.length - 1];
1989
+ if (!first || !last) return { kind: "no-live-sessions" };
1990
+ const authoredSummary = formatBookingSchedulePresentation("representative" in event ? event.representative : event);
1991
+ const summary = !authoredSummary && sessions.length === 1 ? deriveEventScheduleSummary(first) : {
1992
+ kind: "scheduled-run",
1993
+ first,
1994
+ last,
1995
+ sessionCount: sessions.length,
1996
+ authoredSummary
1997
+ };
1998
+ return {
1999
+ kind: "scheduled",
2000
+ firstSession: first,
2001
+ sessionCount: sessions.length,
2002
+ summary
2003
+ };
2004
+ }
2005
+ function occurrenceFromEvent(event) {
2006
+ return {
2007
+ startsAt: event.startsAt,
2008
+ endsAt: event.endsAt,
2009
+ timeZone: event.timeZone
2010
+ };
2011
+ }
2012
+ function isValidOccurrence(value) {
2013
+ return Number.isFinite(Date.parse(value.startsAt)) && Number.isFinite(Date.parse(value.endsAt));
2014
+ }
2015
+ //#endregion
2016
+ //#region ../blocks/src/system/runtime/nodes/events/shared/eventCardListContent.ts
2017
+ /** Live offering data only; editorial cards never acquire booking fields. */
2018
+ function eventCardListContent(event, context, buttonText) {
2019
+ const { content, external } = cardProjectionBase(event, buttonText, context.kind);
2020
+ switch (context.kind) {
2021
+ case "event-details": return {
2022
+ ...content,
2023
+ chips: offeringTypeChips(event),
2024
+ leadDate: null,
2025
+ newTabHint: false,
2026
+ ...offeringSchedule(event)
2027
+ };
2028
+ case "catalogue":
2029
+ case "offering": return {
2030
+ ...content,
2031
+ chips: offeringTypeChips(event, context.typeLabel),
2032
+ leadDate: offeringLeadDate(event, context.nextStartMs),
2033
+ newTabHint: external,
2034
+ ...offeringSchedule(event, context.now)
2035
+ };
2036
+ default: return assertNever(context);
2037
+ }
2038
+ }
2039
+ function cardProjectionBase(event, buttonText, context) {
2040
+ const offering = context !== "event-details";
2041
+ const { cta, availability: places } = resolveEventCardBooking(event, context === "catalogue" ? "series" : "occurrence", offering && event.destination.kind === "external" ? void 0 : buttonText);
2042
+ return {
2043
+ external: cta.external,
2044
+ content: {
2045
+ id: event.occurrenceId || event.id,
2046
+ title: event.title,
2047
+ titleLink: resolveEventLinkProps(event),
2048
+ text: event.presentation?.summary ?? event.description,
2049
+ media: event.presentation?.image,
2050
+ facts: offeringFacts(event, places?.label, offering),
2051
+ availability: places,
2052
+ action: cardAction(cta)
2053
+ }
2054
+ };
2055
+ }
2056
+ function offeringLeadDate(event, startMs) {
2057
+ if (startMs === null || !Number.isFinite(startMs)) return null;
2058
+ const startsAt = new Date(startMs).toISOString();
2059
+ const timeZone = resolveBookingBusinessTimeZone(event.bookingScope === "whole_series" ? orderedLiveRunSessions(event.run.sessions).find((session) => Date.parse(session.startsAt) === startMs)?.timeZone ?? event.timeZone : event.timeZone);
2060
+ return {
2061
+ startsAt,
2062
+ ...formatEventCompactDateRail(startsAt, {
2063
+ ...eventDateOptions(event),
2064
+ timeZone
2065
+ }, "as-written")
2066
+ };
2067
+ }
2068
+ function offeringSchedule(event, now) {
2069
+ const run = event.bookingScope === "whole_series" ? derivePreviewRunSchedule(event) : null;
2070
+ if (run?.kind === "no-live-sessions") return {
2071
+ numeral: null,
2072
+ schedule: null
2073
+ };
2074
+ const summary = run?.kind === "scheduled" ? run.summary : deriveEventScheduleSummary(event);
2075
+ return {
2076
+ numeral: run?.kind === "scheduled" ? {
2077
+ value: run.sessionCount,
2078
+ label: "sessions"
2079
+ } : null,
2080
+ schedule: scheduleLine(summary, event, now)
2081
+ };
2082
+ }
2083
+ function scheduleLine(summary, event, now) {
2084
+ const first = "occurrence" in summary ? summary.occurrence : summary.first;
2085
+ const last = "occurrence" in summary ? summary.occurrence : summary.last;
2086
+ const context = eventDateOptions({
2087
+ ...event,
2088
+ timeZone: first.timeZone
2089
+ });
2090
+ const zone = context.zone;
2091
+ const endpoint = (value) => ({
2092
+ kind: "instant",
2093
+ value: toUtcIsoDateTimeString(value)
2094
+ });
2095
+ const year = (value, timeZone = context.timeZone) => now && getLocalScheduleDate(new Date(value), timeZone).year === getLocalScheduleDate(now, timeZone).year ? "omit" : "numeric";
2096
+ const date = (value) => formatDate(endpoint(value), context, {
2097
+ date: "short",
2098
+ year: now ? year(value) : "omit"
2099
+ });
2100
+ const dates = (startsAt, endsAt, order = "chronological") => formatDateRange({
2101
+ kind: "civil",
2102
+ value: getLocalScheduleDate(new Date(startsAt), context.timeZone)
2103
+ }, {
2104
+ kind: "civil",
2105
+ value: getLocalScheduleDate(new Date(endsAt), resolveBookingBusinessTimeZone(last.timeZone))
2106
+ }, context, {
2107
+ date: "short",
2108
+ order,
2109
+ year: now && year(startsAt) === "omit" && year(endsAt, resolveBookingBusinessTimeZone(last.timeZone)) === "omit" ? "omit" : now ? "numeric" : "omit"
2110
+ });
2111
+ switch (summary.kind) {
2112
+ case "single-occurrence": return now ? formatDateTimeRange({
2113
+ start: endpoint(summary.occurrence.startsAt).value,
2114
+ end: endpoint(summary.occurrence.endsAt).value
2115
+ }, context, {
2116
+ date: "short",
2117
+ weekday: "short",
2118
+ year: year(summary.occurrence.startsAt),
2119
+ zone
2120
+ }) : date(summary.occurrence.startsAt);
2121
+ case "multi-day-span": return dates(summary.occurrence.startsAt, summary.occurrence.endsAt);
2122
+ case "scheduled-run": return `${dates(summary.first.startsAt, summary.last.startsAt, "session")} · ${summary.authoredSummary?.text ?? `${summary.sessionCount} dates`}`;
2123
+ }
2124
+ }
2125
+ function offeringFacts(event, places, offering) {
2126
+ return [
2127
+ ...Math.round((Date.parse(event.endsAt) - Date.parse(event.startsAt)) / 6e4) > 0 && (!offering || event.bookingScope === "whole_series") ? [{
2128
+ label: "Length",
2129
+ value: formatEventDuration(event, "readable")
2130
+ }] : [],
2131
+ ...places ? [{
2132
+ label: "Places",
2133
+ value: places,
2134
+ kind: "availability"
2135
+ }] : [],
2136
+ ...offering && event.pricing.kind === "external" ? [] : [{
2137
+ label: "Price",
2138
+ value: formatEventPriceDisplay(event.pricing)
2139
+ }]
2140
+ ];
2141
+ }
2142
+ function offeringTypeChips(event, typeLabel) {
2143
+ return event.eventCategory ? [event.eventCategory.name] : typeLabel ? [typeLabel] : [];
2144
+ }
2145
+ function cardAction(cta) {
2146
+ return cta.hidden ? { label: cta.label } : {
2147
+ label: cta.label,
2148
+ href: cta.href,
2149
+ external: cta.external
2150
+ };
2151
+ }
2152
+ //#endregion
2153
+ //#region ../blocks/src/system/runtime/nodes/event-registration/constants.ts
2154
+ const EVENT_REGISTRATION_ANCHOR_ID = "event-registration";
2155
+ //#endregion
2156
+ //#region ../blocks/src/system/runtime/nodes/event-details/headerContent.ts
2157
+ /** Project selected live data; booking decisions stay with the existing event owners. */
2158
+ function eventHeaderContent(selection, show) {
2159
+ const event = selection.selected;
2160
+ const item = eventCardListContent(event, { kind: "event-details" });
2161
+ const groupSize = show.capacity ? formatTotalCapacity(event.capacity) : null;
2162
+ const { date, timeRange } = formatEventDateParts({
2163
+ startsAt: event.startsAt,
2164
+ endsAt: event.endsAt,
2165
+ ...eventDateOptions(event)
2166
+ });
2167
+ return {
2168
+ ...item,
2169
+ titleLink: void 0,
2170
+ facts: [
2171
+ {
2172
+ label: selection.mode === "next" ? "Next date" : "Date",
2173
+ value: date
2174
+ },
2175
+ {
2176
+ label: "Time",
2177
+ value: timeRange
2178
+ },
2179
+ ...show.cost ? (item.facts ?? []).filter(({ label }) => label === "Price") : [],
2180
+ ...groupSize === null ? [] : [{
2181
+ label: "Group size",
2182
+ value: groupSize
2183
+ }]
2184
+ ],
2185
+ action: headerAction(selection, item.action)
2186
+ };
2187
+ }
2188
+ function headerAction(selection, action) {
2189
+ if (action.external) return action;
2190
+ if (!selection.selected.requiresRegistration) return { label: "No registration required — just show up" };
2191
+ if (selection.kind === "wholeSeries" && selection.bookingPhase.kind === "closed") return { label: "Registration closed" };
2192
+ if (!action.href) return action;
2193
+ return {
2194
+ ...action,
2195
+ href: `${action.href.split("#")[0] ?? ""}#${EVENT_REGISTRATION_ANCHOR_ID}`
2196
+ };
2197
+ }
2198
+ //#endregion
2199
+ //#region ../blocks/src/system/runtime/nodes/event-details/EventHeader.tsx
2200
+ function EventHeader({ selection, presentation, showCost, showCapacity }) {
2201
+ const item = eventHeaderContent(selection, {
2202
+ cost: showCost,
2203
+ capacity: showCapacity
2204
+ });
2205
+ const part = (name) => /* @__PURE__ */ jsx(CardListContentPart, {
2206
+ part: name,
2207
+ item,
2208
+ presentation
2209
+ });
2210
+ return /* @__PURE__ */ jsxs("header", {
2211
+ ...listLookSlot(presentation, "frame"),
2212
+ children: [
2213
+ item.media ? /* @__PURE__ */ jsx("figure", {
2214
+ ...listLookSlot(presentation, "item-media"),
2215
+ children: /* @__PURE__ */ jsx(MediaNodeServer, {
2216
+ value: item.media,
2217
+ size: ImagePresets.full,
2218
+ loading: "eager",
2219
+ fetchPriority: "high",
2220
+ ...listLookSlot(presentation, "photo")
2221
+ })
2222
+ }) : null,
2223
+ /* @__PURE__ */ jsxs("div", {
2224
+ ...listLookSlot(presentation, "copy"),
2225
+ children: [
2226
+ part("chips"),
2227
+ /* @__PURE__ */ jsx("h1", {
2228
+ ...listLookSlot(presentation, "headline"),
2229
+ children: item.title
2230
+ }),
2231
+ item.text ? /* @__PURE__ */ jsx("p", {
2232
+ ...listLookSlot(presentation, "lede"),
2233
+ children: item.text
2234
+ }) : null,
2235
+ /* @__PURE__ */ jsx("div", {
2236
+ "aria-label": "At a glance",
2237
+ children: part("facts")
2238
+ }),
2239
+ part("availability"),
2240
+ part("action")
2241
+ ]
2242
+ }),
2243
+ part("numeral")
2244
+ ]
2245
+ });
2246
+ }
2247
+ const eventHeaderSlotParents = {
2248
+ frame: null,
2249
+ copy: "frame",
2250
+ availability: "copy",
2251
+ "item-media": "frame"
2252
+ };
2253
+ //#endregion
2254
+ //#region ../blocks/src/system/arrangementSlotParents.ts
2255
+ /** The declaration follows the tree's nearest slot, including transparent wrappers. */
2256
+ function declarativeSlotParents(tree, parent = null) {
2257
+ if (isNodeArray(tree)) return tree.reduce((parents, node) => ({
2258
+ ...parents,
2259
+ ...declarativeSlotParents(node, parent)
2260
+ }), {});
2261
+ const node = tree;
2262
+ const slot = declaredSlot(node);
2263
+ return {
2264
+ ...slot ? { [slot]: parent } : {},
2265
+ ...declarativeSlotParents(node.children ?? [], slot ?? parent)
2266
+ };
2267
+ }
2268
+ function isNodeArray(tree) {
2269
+ return Array.isArray(tree);
2270
+ }
2271
+ function declaredSlot(node) {
2272
+ const value = node.props?.["data-slot"] ?? node["data-slot"];
2273
+ if (typeof value === "string") return value;
2274
+ if (!isObjectRecord(value) || !isObjectRecord(value.$bind)) return void 0;
2275
+ const transforms = value.$bind.transforms;
2276
+ if (Array.isArray(transforms) && transforms.some((step) => isObjectRecord(step) && step.id === "look.leadSlot")) return "item";
2277
+ const from = value.$bind.from;
2278
+ return typeof from === "string" && from.startsWith("content._lookSlots.") ? from.slice(19) : void 0;
2279
+ }
2280
+ /** React declarations extend only the subtree the component actually renders. */
2281
+ function arrangementSlotParents(input) {
2282
+ const derived = input.tree ? declarativeSlotParents(input.tree) : {};
2283
+ const { target, arrangement } = input;
2284
+ if (target === "events") return {
2285
+ ...derived,
2286
+ ...eventListSlotParents(arrangement, "layout" in derived ? "layout" : null),
2287
+ ...eventItemSlotParents(arrangement),
2288
+ ...arrangement === "month-grid" || arrangement === "month-day" ? monthSlotParents(arrangement) : {}
2289
+ };
2290
+ if (arrangement === "event-header") return {
2291
+ ...derived,
2292
+ ...eventHeaderSlotParents
2293
+ };
2294
+ if (target === "feature-cards") return {
2295
+ ...derived,
2296
+ ...cardItemSlotParents(arrangement)
2297
+ };
2298
+ return derived;
2299
+ }
2300
+ /** The selected layout is shared by the planner and its diagnostic consumers. */
2301
+ function arrangementSlotParentsForManifest(manifest, target, arrangement) {
2302
+ return arrangementSlotParents({
2303
+ tree: manifest?.variants?.[arrangement] ?? manifest?.layout,
2304
+ target,
2305
+ arrangement
2306
+ });
2307
+ }
2308
+ //#endregion
2309
+ //#region ../blocks/src/system/customize/arrangementKnobs.ts
2310
+ /**
2311
+ * Content stage for knobs, shared by the renderer and the editor so what the
2312
+ * options show and what renders can't disagree. Knob buffets are the block's
2313
+ * customise facets; the Look exposes, forces or narrows them and the style's
2314
+ * offer can only remove or narrow further.
2315
+ */
2316
+ function resolveArrangementKnobs(input) {
2317
+ const length = input.blockKind === "block.hero" ? resolveHeroTitleLength({ ...input.content }, "look") : null;
2318
+ const exposure = arrangementKnobExposure(input.blockKind, input.look, length, storedSplitPhotoSide(input.blockKind, input.content));
2319
+ return {
2320
+ length,
2321
+ exposure,
2322
+ knobs: resolveEffectiveKnobs({
2323
+ exposure,
2324
+ content: normalizedHeadlinePreference(input.content)
2325
+ })
2326
+ };
2327
+ }
2328
+ function arrangementKnobExposure(blockKind, look, length, splitPhotoSide) {
2329
+ return systemCustomizeFacetDefinitionsForBlock(blockKind).flatMap((facet) => {
2330
+ if (facet.knob === void 0 || facet.target.kind !== "content-field") return [];
2331
+ const id = facet.target.field;
2332
+ const defaults = look.look.structure.knobDefaults ?? {};
2333
+ const storedDefault = id === "imagePosition" ? splitPhotoSide : null;
2334
+ return [{
2335
+ definition: {
2336
+ id,
2337
+ defaultValue: defaults[id] ?? storedDefault ?? facet.defaultValue,
2338
+ values: facet.values.map((value) => value.value),
2339
+ ...knobKindMetadata(facet.knob)
2340
+ },
2341
+ exposed: exposedKnobIds(look).includes(id),
2342
+ forced: look.look.structure.forcedKnobs?.[id],
2343
+ lookValues: look.look.structure.knobValues?.[id],
2344
+ styleValues: look.knobValues[id],
2345
+ lengthValues: id === "titleSize" ? headlineAllowedValues(length) : void 0
2346
+ }];
2347
+ });
2348
+ }
2349
+ /**
2350
+ * A hero stored as "Split, photo on the left" or "Split, photo on the right"
2351
+ * already says which side its photo is on. Under a Look that side is the Photo
2352
+ * side default, so the photo stays where it was until the owner picks a side.
2353
+ */
2354
+ function storedSplitPhotoSide(blockKind, content) {
2355
+ if (blockKind !== "block.hero") return null;
2356
+ switch (content.variant) {
2357
+ case "split": return "left";
2358
+ case "splitReverse": return "right";
2359
+ default: return null;
2360
+ }
2361
+ }
2362
+ function knobKindMetadata(knob) {
2363
+ return knob.kind === "fixed" ? { ordered: knob.ordered } : {
2364
+ ordered: false,
2365
+ textMaxLength: knob.maxLength
2366
+ };
2367
+ }
2368
+ function headlineAllowedValues(length) {
2369
+ switch (length) {
2370
+ case "long": return ["quiet"];
2371
+ case "medium": return ["quiet", "auto"];
2372
+ case "short": return [
2373
+ "quiet",
2374
+ "auto",
2375
+ "display"
2376
+ ];
2377
+ case null: return;
2378
+ }
2379
+ }
2380
+ /** `titleSize` keeps its five stored values; under a Look they read as three steps. */
2381
+ function normalizedHeadlinePreference(content) {
2382
+ switch (content.titleSize) {
2383
+ case "editorial": return {
2384
+ ...content,
2385
+ titleSize: "auto"
2386
+ };
2387
+ case "poster": return {
2388
+ ...content,
2389
+ titleSize: "display"
2390
+ };
2391
+ default: return content;
2392
+ }
2393
+ }
2394
+ function exposedKnobIds(look) {
2395
+ return [...look.look.structure.knobs, ...look.addKnobs ?? []].filter((id) => !look.removeKnobs.some((removed) => removed === id));
2396
+ }
2397
+ //#endregion
2398
+ //#region ../blocks/src/system/customize/facets.ts
2399
+ function defineCustomizeFacet(definition) {
2400
+ return definition;
2401
+ }
2402
+ const eventCalendarListLayoutFacet = defineCustomizeFacet({
2403
+ blockKind: "block.event-calendar",
2404
+ id: "eventCalendar.listLayout",
2405
+ label: "List style",
2406
+ legacyOnly: true,
2407
+ values: eventCalendarListLayoutOptions.map((option) => ({
2408
+ value: option.id,
2409
+ label: option.label
2410
+ })),
2411
+ defaultValue: "stack",
2412
+ target: { kind: "event-calendar-list-layout-content" },
2413
+ appliesToLayoutVariants: eventCalendarListLayoutCompatibleDisplayModeValues
2414
+ });
2415
+ const fixedKnob = (blockKind, id, label, values, defaultValue, ordered = false, boolean = false) => ({
2416
+ blockKind,
2417
+ id,
2418
+ label,
2419
+ values,
2420
+ defaultValue,
2421
+ knob: {
2422
+ kind: "fixed",
2423
+ ordered
2424
+ },
2425
+ target: {
2426
+ kind: "content-field",
2427
+ field: id,
2428
+ ...boolean ? { boolean: true } : {}
2429
+ }
2430
+ });
2431
+ const textKnob = (id, label, maxLength) => ({
2432
+ blockKind: "block.hero",
2433
+ id,
2434
+ label,
2435
+ values: [],
2436
+ defaultValue: "",
2437
+ knob: {
2438
+ kind: "text",
2439
+ maxLength
2440
+ },
2441
+ target: {
2442
+ kind: "content-field",
2443
+ field: id
2444
+ }
2445
+ });
2446
+ const onOff = [{
2447
+ value: "true",
2448
+ label: "On"
2449
+ }, {
2450
+ value: "false",
2451
+ label: "Off"
2452
+ }];
2453
+ const columnCounts = [
2454
+ {
2455
+ value: "2",
2456
+ label: "2"
2457
+ },
2458
+ {
2459
+ value: "3",
2460
+ label: "3"
2461
+ },
2462
+ {
2463
+ value: "4",
2464
+ label: "4"
2465
+ }
2466
+ ];
2467
+ const systemCustomizeFacetDefinitions = [
2468
+ eventCalendarListLayoutFacet,
2469
+ fixedKnob("block.offerings-preview", "dates", "Dates", [{
2470
+ value: "summary",
2471
+ label: "Summary"
2472
+ }, {
2473
+ value: "next-dates",
2474
+ label: "Next dates"
2475
+ }], "summary"),
2476
+ {
2477
+ ...fixedKnob("block.feature-cards", "actionStyle", "Item actions", [{
2478
+ value: "button",
2479
+ label: "Button"
2480
+ }, {
2481
+ value: "link",
2482
+ label: "Link"
2483
+ }], "button"),
2484
+ blockKinds: cardListKnobBlocks
2485
+ },
2486
+ fixedKnob("block.testimonials", "quoteCount", "How many quotes", [
2487
+ {
2488
+ value: "1",
2489
+ label: "1"
2490
+ },
2491
+ {
2492
+ value: "2",
2493
+ label: "2"
2494
+ },
2495
+ {
2496
+ value: "3",
2497
+ label: "3"
2498
+ },
2499
+ {
2500
+ value: "all",
2501
+ label: "All"
2502
+ }
2503
+ ], "3", true),
2504
+ fixedKnob("block.testimonials", "tilt", "Tilt the small cards", onOff, "true", false, true),
2505
+ {
2506
+ ...fixedKnob("block.testimonials", "archFrame", "Arch frame", onOff, "true", false, true),
2507
+ blockKinds: [
2508
+ "block.testimonials",
2509
+ "block.newsletter-signup",
2510
+ "block.form"
2511
+ ]
2512
+ },
2513
+ fixedKnob("block.hero", "photoTint", "Photo tint", [{
2514
+ value: "dark",
2515
+ label: "Dark"
2516
+ }, {
2517
+ value: "brand",
2518
+ label: "Brand colour"
2519
+ }], "dark"),
2520
+ fixedKnob("block.hero", "candleGlow", "Candle glow", onOff, "true", false, true),
2521
+ fixedKnob("block.hero", "columnGuides", "Column guides", onOff, "true", false, true),
2522
+ fixedKnob("block.hero", "titleSize", "Headline size", heroTitleSizeOptions, "auto", true),
2523
+ fixedKnob("block.hero", "imagePosition", "Photo side", [{
2524
+ value: "left",
2525
+ label: "Left"
2526
+ }, {
2527
+ value: "right",
2528
+ label: "Right"
2529
+ }], "right"),
2530
+ fixedKnob("block.intro", "imageShape", "Media shape", standardImageShapeOptions, "default"),
2531
+ fixedKnob("block.intro", "imagePosition", "Photo side", [{
2532
+ value: "left",
2533
+ label: "Left"
2534
+ }, {
2535
+ value: "right",
2536
+ label: "Right"
2537
+ }], "left"),
2538
+ fixedKnob("block.media-text", "imagePosition", "Photo side", [{
2539
+ value: "left",
2540
+ label: "Left"
2541
+ }, {
2542
+ value: "right",
2543
+ label: "Right"
2544
+ }], "left"),
2545
+ fixedKnob("block.media-text", "imageShape", "Media shape", standardImageShapeOptions, "default"),
2546
+ fixedKnob("block.media-text", "aspectRatio", "Media aspect ratio", standardAspectRatioOptions, "auto"),
2547
+ textKnob("stickerLine", "Sticker line", 32),
2548
+ textKnob("smallCaption", "Small caption", 24),
2549
+ {
2550
+ ...fixedKnob("block.feature-cards", "showPhotos", "Show photos", onOff, "true", false, true),
2551
+ blockKinds: cardListFamilyBlocks
2552
+ },
2553
+ fixedKnob("block.feature-cards", "columns", "Columns", columnCounts, "3", true),
2554
+ fixedKnob("block.image-gallery", "blackAndWhite", "Black and white", onOff, "false", false, true),
2555
+ fixedKnob("block.event-calendar", "listColumns", "Columns", columnCounts, "3", true),
2556
+ fixedKnob("block.event-calendar", "showPhotos", "Photos", [{
2557
+ value: "true",
2558
+ label: "Show"
2559
+ }, {
2560
+ value: "false",
2561
+ label: "Hide"
2562
+ }], "true", false, true),
2563
+ {
2564
+ ...fixedKnob("block.feature-cards", "cardMarker", "Item markers", [
2565
+ {
2566
+ value: "icons",
2567
+ label: "Icons"
2568
+ },
2569
+ {
2570
+ value: "numbers",
2571
+ label: "Numbers"
2572
+ },
2573
+ {
2574
+ value: "none",
2575
+ label: "None"
2576
+ }
2577
+ ], "icons"),
2578
+ blockKinds: cardListFamilyBlocks
2579
+ },
2580
+ {
2581
+ ...fixedKnob("block.event-calendar", "showCapacity", "Places left", onOff, "true", false, true),
2582
+ description: "Show how many places are left on each event"
2583
+ }
2584
+ ];
2585
+ systemCustomizeFacetDefinitions.map((definition) => definition.id);
2586
+ Array.from(new Set(systemCustomizeFacetDefinitions.flatMap((definition) => definition.values.map((option) => option.value))));
2587
+ function systemCustomizeFacetDefinitionsForBlock(blockKind) {
2588
+ return systemCustomizeFacetDefinitions.filter((definition) => definition.blockKind === blockKind || "blockKinds" in definition && definition.blockKinds?.some((kind) => kind === blockKind));
2589
+ }
2590
+ //#endregion
2591
+ //#region ../blocks/src/system/customize/fieldOwnership.ts
2592
+ /**
2593
+ * Values with their own owner, whatever their fields are tagged: the Background
2594
+ * row and Photo control edit `_sectionStyles`, and the style compiler writes the
2595
+ * other style groups (card, container and text-card styles), which the editor
2596
+ * already hides on styles with a page design.
2597
+ */
2598
+ const dedicatedPaths = ["_sectionStyles", ...themeV2CompilerOwnedFieldNames];
2599
+ /**
2600
+ * One owner for "does this setting belong to the Look?". The editor form, the
2601
+ * renderer's bindings, publish validation and the catalogue all ask here.
2602
+ * With no arrangement Look resolved (older styles, recipes, blocks without
2603
+ * Looks on a newer style), every field stays with the owner.
2604
+ */
2605
+ function resolveFieldOwnership(input) {
2606
+ if (!input.arrangementLook) return { kind: "no-look" };
2607
+ const knobFields = new Set(systemCustomizeFacetDefinitionsForBlock(input.blockKind).flatMap((facet) => facet.knob && facet.target.kind === "content-field" ? [facet.target.field] : []));
2608
+ const meaning = input.manifest.variantMeaning;
2609
+ const arrangementField = meaning?.kind === "mode" ? meaning.arrangementField : meaning ? "variant" : null;
2610
+ const modeField = meaning?.kind === "mode" ? "variant" : null;
2611
+ const paths = /* @__PURE__ */ new Map();
2612
+ const dataPaths = /* @__PURE__ */ new Map();
2613
+ const visit = (fields, parent, inherited, inRepeaterItem = false) => {
2614
+ fields.forEach((field) => {
2615
+ const path = parent.schema ? `${parent.schema}.${field.id}` : field.id;
2616
+ const flattened = inRepeaterItem && field.type === "group" && field.ui?.flattenInRepeater === true;
2617
+ const dataPath = flattened ? parent.data : parent.data ? `${parent.data}.${field.id}` : field.id;
2618
+ const owner = ownerOf(field, path, inherited, {
2619
+ knobFields,
2620
+ arrangementField,
2621
+ modeField
2622
+ });
2623
+ paths.set(path, owner);
2624
+ if (!flattened) dataPaths.set(dataPath, owner);
2625
+ childFields(field).forEach((children) => visit(children, {
2626
+ schema: path,
2627
+ data: dataPath
2628
+ }, owner, field.type === "repeater"));
2629
+ });
2630
+ };
2631
+ visit(input.manifest.fields ?? [], {
2632
+ schema: "",
2633
+ data: ""
2634
+ }, "owner");
2635
+ knobFields.forEach((field) => {
2636
+ if (!paths.has(field)) paths.set(field, "knob");
2637
+ if (!dataPaths.has(field)) dataPaths.set(field, "knob");
2638
+ });
2639
+ return {
2640
+ kind: "look",
2641
+ paths,
2642
+ dataPaths
2643
+ };
2644
+ }
2645
+ new Set(arrangementAppearancePresets.flatMap((preset) => preset.blockKinds));
2646
+ /** Content paths with a given owner, for the renderer, outermost first. */
2647
+ function contentPathsOwnedBy(ownership, owners) {
2648
+ return ownership.kind === "no-look" ? [] : outermost(ownership.dataPaths, owners);
2649
+ }
2650
+ function outermost(paths, owners) {
2651
+ const matching = [...paths].filter(([, owner]) => owners.includes(owner)).map(([path]) => path);
2652
+ return matching.filter((path) => !matching.some((other) => path.startsWith(`${other}.`)));
2653
+ }
2654
+ /**
2655
+ * Content with the owner's values for Look-owned paths taken out, so nothing
2656
+ * that renders the block (bindings, views, media delivery) can read them.
2657
+ */
2658
+ function withoutLookOwnedContent(content, paths) {
2659
+ return paths.reduce((current, path) => withoutPath(current, path.split(".")), { ...content });
2660
+ }
2661
+ function withoutPath(value, [key, ...rest]) {
2662
+ if (key === void 0 || !(key in value)) return { ...value };
2663
+ if (rest.length === 0) return Object.fromEntries(Object.entries(value).filter(([entry]) => entry !== key));
2664
+ const child = value[key];
2665
+ const stripped = Array.isArray(child) ? child.map((item) => isContentRecord(item) ? withoutPath(item, rest) : item) : isContentRecord(child) ? withoutPath(child, rest) : child;
2666
+ return {
2667
+ ...value,
2668
+ [key]: stripped
2669
+ };
2670
+ }
2671
+ function isContentRecord(value) {
2672
+ return typeof value === "object" && value !== null && !Array.isArray(value);
2673
+ }
2674
+ function ownerOf(field, path, inherited, facts) {
2675
+ return inheritedOwner(path, inherited) ?? lookSectionOwner(field, path, facts) ?? keptByOwner(field, path, facts) ?? intentOwner(field, inherited);
2676
+ }
2677
+ /** Below a dedicated or Look-owned container, everything goes with it. */
2678
+ function inheritedOwner(path, inherited) {
2679
+ if (inherited === "dedicated" || dedicatedPaths.includes(path)) return "dedicated";
2680
+ return inherited === "look" ? "look" : null;
2681
+ }
2682
+ function lookSectionOwner(field, path, facts) {
2683
+ if (!path.includes(".") && facts.knobFields.has(path)) return "knob";
2684
+ if (field.ui?.hidden === true || field.ui?.renderInHeader === true) return "dedicated";
2685
+ return path === facts.arrangementField ? "arrangement" : null;
2686
+ }
2687
+ function keptByOwner(field, path, facts) {
2688
+ return path === facts.modeField || field.ui?.underLooks === "owner" ? "owner" : null;
2689
+ }
2690
+ function intentOwner(field, inherited) {
2691
+ switch (field.ui?.intent) {
2692
+ case "display":
2693
+ case "style": return "look";
2694
+ case "content":
2695
+ case "behavior": return "owner";
2696
+ case void 0: return inherited;
2697
+ }
2698
+ }
2699
+ function childFields(field) {
2700
+ if (field.type === "group" || field.type === "modal") return [field.schema.fields];
2701
+ if (field.type === "repeater") return [field.schema?.fields ?? [], ...Object.values(field.itemTypes ?? {}).map((item) => item.fields)];
2702
+ if (field.type === "tabGroup") return field.tabs.map((tab) => tab.fields);
2703
+ return [];
2704
+ }
2705
+ //#endregion
2706
+ //#region ../blocks/src/system/transforms/registry/offeringsPreview.ts
2707
+ /** Reuse the existing occurrence read for the date strip and card date rows. */
2708
+ const offeringsPreviewDatesReadEnabled = {
2709
+ id: "events.offeringsPreviewDatesReadEnabled",
2710
+ kind: "formatter",
2711
+ summary: "Load one occurrence batch for catalogue dates or next-date cards",
2712
+ run(value) {
2713
+ const content = asPartialObject(value);
2714
+ const dates = asPartialObject(asPartialObject(content?._effectiveKnobs)?.dates);
2715
+ return content?.displayMode === "catalogue" || dates?.value === "next-dates";
2716
+ }
2717
+ };
2718
+ //#endregion
2719
+ //#region ../blocks/src/system/helpers/backgroundMedia.ts
2720
+ function resolveBackgroundMedia(input) {
2721
+ const parsedMedia = runtimeMediaSchema.safeParse(input.image);
2722
+ if (!parsedMedia.success) return null;
2723
+ switch (parsedMedia.data.type) {
2724
+ case "image":
2725
+ case "video": return {
2726
+ ...parsedMedia.data,
2727
+ type: parsedMedia.data.type
2728
+ };
2729
+ case "audio":
2730
+ case "document":
2731
+ case "spreadsheet":
2732
+ case "archive": return null;
2733
+ }
2734
+ }
2735
+ function backgroundVideoMobileClassNames(input) {
2736
+ if (resolveBackgroundMedia(input)?.type !== "video") return "";
2737
+ return input.showVideoOnMobile === true ? "" : "rb-hidden rb-md-block";
2738
+ }
2739
+ //#endregion
2740
+ //#region ../blocks/src/system/transforms/registry/background.ts
2741
+ const isString = (value) => typeof value === "string" && value.trim().length > 0;
2742
+ const isNumber = (value) => typeof value === "number" && !isNaN(value);
2743
+ function backgroundMotionClassNames(input) {
2744
+ return input.motion === "fixed-frame" ? "rb-bg-motion-fixed-frame" : "";
2745
+ }
2746
+ function appendBackgroundMediaClasses(baseClassName, input) {
2747
+ return [
2748
+ baseClassName,
2749
+ backgroundMotionClassNames(input),
2750
+ backgroundVideoMobileClassNames(input)
2751
+ ].filter(Boolean).join(" ");
2752
+ }
2753
+ function gradientPresetCss(value) {
2754
+ const presetId = parseGradientPresetId(value);
2755
+ if (!presetId) return null;
2756
+ const preset = getGradientPreset(presetId);
2757
+ return gradientToCss(preset, Object.fromEntries(preset.stops.map((stop) => [stop.color, `rgb(var(--tb-${stop.color}))`])));
2758
+ }
2759
+ const backgroundTransforms = [
2760
+ {
2761
+ id: "background.resolveMedia",
2762
+ kind: "formatter",
2763
+ summary: "Resolve media only from a canonical image or video background",
2764
+ run: (value) => parseMediaBackground(value)?.image ?? null
2765
+ },
2766
+ {
2767
+ id: "background.resolveStyle",
2768
+ kind: "formatter",
2769
+ summary: "Resolve inline styles for background color/gradient layers",
2770
+ run: (value, options, context) => {
2771
+ const fallbackToken = options?.fallbackToken;
2772
+ return resolveBackgroundLayerStyle(value, fallbackToken, context);
2773
+ }
2774
+ },
2775
+ {
2776
+ id: "background.resolveColorsStyle",
2777
+ kind: "formatter",
2778
+ summary: "Resolve surface foreground colors from a background object into scoped CSS vars",
2779
+ run: (value, options, context) => asPartialObject(options)?.arrangementInherits === true && context.data?._lookSlots !== void 0 ? {} : resolveSurfaceForegroundStyles(value, context)
2780
+ },
2781
+ {
2782
+ id: "background.resolveFrameClassName",
2783
+ kind: "formatter",
2784
+ summary: "Resolve clipping on a decorative background frame without clipping foreground content",
2785
+ run: (value, options) => {
2786
+ const baseClass = options?.baseClass?.trim() ?? "";
2787
+ const input = parseMediaBackground(value);
2788
+ if (!input) return `${baseClass} rb-overflow-hidden`.trim();
2789
+ if (input.overflow === true) return `${baseClass} rb-overflow-visible`.trim();
2790
+ const objectFit = input.objectFit ?? null;
2791
+ const scale = isString(input.scale) ? input.scale.trim() : isNumber(input.scale) ? String(input.scale) : null;
2792
+ return `${baseClass} ${Boolean((objectFit === "custom" || objectFit === "original") && scale && scale.trim().length > 0) ? "rb-overflow-visible" : "rb-overflow-hidden"}`.trim();
2793
+ }
2794
+ },
2795
+ {
2796
+ id: "background.resolveImageStyle",
2797
+ kind: "formatter",
2798
+ summary: "Resolve inline styles for background image elements",
2799
+ run: (value, _options, _context) => {
2800
+ const input = parseMediaBackground(value);
2801
+ if (!input) return {};
2802
+ const objectFit = input.objectFit ?? null;
2803
+ const opacity = input.opacity ?? null;
2804
+ const position = isString(input.position) ? input.position.trim() : null;
2805
+ let scaleValue = null;
2806
+ if (objectFit === "custom" || objectFit === "original") {
2807
+ if (isString(input.scale)) {
2808
+ const scaleStr = input.scale.trim();
2809
+ if (scaleStr) if (/\d+(%|px|vh|vw|rem|em)$/.test(scaleStr)) scaleValue = scaleStr;
2810
+ else {
2811
+ const num = parseFloat(scaleStr);
2812
+ if (!isNaN(num)) scaleValue = `${num}%`;
2813
+ }
2814
+ }
2815
+ }
2816
+ const style = {};
2817
+ switch (objectFit) {
2818
+ case "fill":
2819
+ case null:
2820
+ style.objectFit = "cover";
2821
+ break;
2822
+ case "fit":
2823
+ style.objectFit = "contain";
2824
+ break;
2825
+ case "original":
2826
+ case "custom":
2827
+ style.objectFit = "none";
2828
+ break;
2829
+ }
2830
+ if (opacity !== null) style.opacity = String(opacity);
2831
+ if (scaleValue) {
2832
+ style.width = scaleValue;
2833
+ style.height = scaleValue;
2834
+ }
2835
+ if (position && !BACKGROUND_POSITION_PRESET_VALUES.includes(position)) style.objectPosition = position;
2836
+ const backgroundMedia = resolveBackgroundMedia(input);
2837
+ if (backgroundMedia) {
2838
+ const mergedStyle = computeMediaTransformStyle(backgroundMedia, style);
2839
+ if (mergedStyle) Object.assign(style, mergedStyle);
2840
+ }
2841
+ return style;
2842
+ }
2843
+ },
2844
+ {
2845
+ id: "background.resolveImageClassName",
2846
+ kind: "string",
2847
+ summary: "Resolve className for background image based on objectFit, scale and position",
2848
+ run: (value, options, _context) => {
2849
+ const baseClass = options?.baseClass ?? "rb-absolute rb-z-neg-10";
2850
+ const input = parseMediaBackground(value);
2851
+ if (!input) return `${baseClass} rb-inset-0 rb-h-full rb-w-full`;
2852
+ const objectFit = input.objectFit ?? null;
2853
+ const position = isString(input.position) ? input.position.trim() : null;
2854
+ if (objectFit === "fill" || objectFit === "fit" || objectFit === null) return appendBackgroundMediaClasses(`${baseClass} rb-inset-0 rb-h-full rb-w-full rb-object-${objectFit === "fit" ? "contain" : "cover"}`, input);
2855
+ let needsAnchoring = false;
2856
+ if (objectFit === "custom" || objectFit === "original") {
2857
+ if (isString(input.scale)) {
2858
+ if (input.scale.trim()) needsAnchoring = true;
2859
+ }
2860
+ }
2861
+ if (!needsAnchoring) return appendBackgroundMediaClasses(`${baseClass} rb-inset-0 rb-h-full rb-w-full`, input);
2862
+ const isPreset = position && BACKGROUND_POSITION_PRESET_VALUES.includes(position);
2863
+ if (position && !isPreset) return appendBackgroundMediaClasses(baseClass, input);
2864
+ return appendBackgroundMediaClasses(`${baseClass} ${getAnchorClasses(position)}`, input);
2865
+ }
2866
+ },
2867
+ {
2868
+ id: "background.resolveOverlayStyle",
2869
+ kind: "formatter",
2870
+ summary: "Resolve inline styles for background overlay",
2871
+ run: (value, _options, context) => {
2872
+ const input = parseBackgroundOverlay(value);
2873
+ if (!input || input.type === "none") return {};
2874
+ const color = input.type === "color" && isString(input.color) ? input.color.trim() : null;
2875
+ const gradient = input.type === "gradient" && isString(input.gradient) ? input.gradient.trim() : null;
2876
+ const opacity = input.opacity ?? null;
2877
+ const style = {};
2878
+ if (input.type === "color" && color) style.backgroundColor = context?.theme?.palette?.[color] ?? color;
2879
+ if (input.type === "gradient" && gradient) style.backgroundImage = gradient;
2880
+ if (opacity !== null) style.opacity = String(opacity);
2881
+ return style;
2882
+ }
2883
+ }
2884
+ ];
2885
+ function parseMediaBackground(value) {
2886
+ const background = parseRuntimeBackgroundContent(value);
2887
+ return background?.type === "image" || background?.type === "video" ? background : null;
2888
+ }
2889
+ function resolveBackgroundLayerStyle(value, fallbackToken, context) {
2890
+ const background = parseRuntimeBackgroundContent(value);
2891
+ const style = {};
2892
+ const gradient = background?.type === "gradient" ? isString(background.gradient) ? background.gradient.trim() : gradientPresetCss(background.gradientPresetId) : null;
2893
+ const color = background?.type === "color" && isString(background.color) ? background.color.trim() : null;
2894
+ const resolvedColor = color ? resolveBackgroundColorValue(color, context) : !gradient && isString(fallbackToken) ? resolveBackgroundColorValue(fallbackToken.trim(), context) : null;
2895
+ if (resolvedColor) style.backgroundColor = resolvedColor;
2896
+ if (gradient) style.backgroundImage = gradient;
2897
+ const opacity = backgroundMediaOpacity(background);
2898
+ if (opacity !== null) style.opacity = String(opacity);
2899
+ return style;
2900
+ }
2901
+ function backgroundMediaOpacity(background) {
2902
+ return background?.type === "image" || background?.type === "video" ? background.opacity ?? null : null;
2903
+ }
2904
+ //#endregion
2905
+ //#region ../blocks/src/system/links/resolve.ts
2906
+ function resolveRouteTarget(routeIdValue, routes) {
2907
+ return resolveRouteTargetForStage(routeIdValue, routes, "published");
2908
+ }
2909
+ function resolveRouteTargetForStage(routeIdValue, routes, stageInput) {
2910
+ return resolveRouteTargetForStage$1(routeIdValue, routes, stageInput);
2911
+ }
2912
+ function resolvePageRouteTarget(link, context) {
2913
+ if (typeof link.routeId === "string" && link.routeId.trim().length > 0) {
2914
+ const existing = resolveRouteTargetForStage(link.routeId, context.routes, context.stage);
2915
+ if (existing) return existing;
2916
+ }
2917
+ const identifier = typeof link.identifier === "string" ? link.identifier : null;
2918
+ if (!identifier || !context.pagesByIdentifier) return null;
2919
+ const routeId = context.pagesByIdentifier[identifier];
2920
+ if (!routeId) return null;
2921
+ return resolveRouteTargetForStage(routeId, context.routes, context.stage);
2922
+ }
2923
+ function resolveEntryRouteTarget(link, context) {
2924
+ if (typeof link.routeId === "string" && link.routeId.trim().length > 0) {
2925
+ const existing = resolveRouteTargetForStage(link.routeId, context.routes, context.stage);
2926
+ if (existing) return existing;
2927
+ }
2928
+ const contentType = typeof link.contentType === "string" ? link.contentType : null;
2929
+ const identifier = typeof link.identifier === "string" ? link.identifier : null;
2930
+ if (!contentType || !identifier || !context.entriesByIdentifier) return null;
2931
+ const entryMap = context.entriesByIdentifier[contentType];
2932
+ if (!entryMap) return null;
2933
+ const routeId = entryMap[identifier];
2934
+ if (!routeId) return null;
2935
+ return resolveRouteTargetForStage(routeId, context.routes, context.stage);
2936
+ }
2937
+ function resolveFallbackHref(link) {
2938
+ if (typeof link.href !== "string") return null;
2939
+ const href = link.href.trim();
2940
+ return href.length > 0 ? href : null;
2941
+ }
2942
+ //#endregion
2943
+ //#region ../blocks/src/system/transforms/registry/links.ts
2944
+ /** Resolve internal link via routeId lookup, falling back to href */
2945
+ function resolveInternalLink(link, context) {
2946
+ const resolved = resolveRouteFromMap(link.routeId, context);
2947
+ if (resolved) return resolved;
2948
+ return resolveFallbackHref(link);
2949
+ }
2950
+ function resolveRouteFromMap(routeIdValue, context) {
2951
+ return resolveRouteTargetForStage(routeIdValue, context.routes, context.stage)?.href ?? null;
2952
+ }
2953
+ /** Resolve page identifier link via pagesByIdentifier lookup */
2954
+ function resolvePageLink(link, context) {
2955
+ const resolved = resolvePageRouteTarget(link, context);
2956
+ if (resolved) return resolved.href;
2957
+ return resolveFallbackHref(link);
2958
+ }
2959
+ /** Resolve entry identifier link via entriesByIdentifier lookup */
2960
+ function resolveEntryLink(link, context) {
2961
+ const resolved = resolveEntryRouteTarget(link, context);
2962
+ if (resolved) return resolved.href;
2963
+ return resolveFallbackHref(link);
2964
+ }
2965
+ /** Resolve external or url link by returning trimmed href */
2966
+ function resolveExternalLink(link) {
2967
+ return resolveFallbackHref(link);
2968
+ }
2969
+ const linksTransforms = [{
2970
+ id: "links.resolve",
2971
+ kind: "formatter",
2972
+ summary: "Resolve LinkValue objects to href strings using the route map",
2973
+ run: (value, _options, context) => resolveAuthoredLinkHref(value, context)
2974
+ }, {
2975
+ id: "links.label",
2976
+ kind: "formatter",
2977
+ summary: "Extract a human-readable label from link objects",
2978
+ run: (value) => {
2979
+ if (!value || typeof value !== "object") return null;
2980
+ const link = value;
2981
+ if (typeof link.label === "string") {
2982
+ const label = link.label.trim();
2983
+ if (label.length > 0) return label;
2984
+ }
2985
+ if (typeof link.title === "string") {
2986
+ const title = link.title.trim();
2987
+ if (title.length > 0) return title;
2988
+ }
2989
+ if (typeof link.identifier === "string") {
2990
+ const identifier = link.identifier.trim();
2991
+ if (identifier.length > 0) return identifier;
2992
+ }
2993
+ if (typeof link.href === "string") {
2994
+ const href = link.href.trim();
2995
+ if (href.length > 0) return href;
2996
+ }
2997
+ return null;
2998
+ }
2999
+ }];
3000
+ function resolveAuthoredLinkHref(value, context = {}) {
3001
+ if (!value || typeof value !== "object") return null;
3002
+ const link = value;
3003
+ switch (link.kind) {
3004
+ case "internal": return resolveInternalLink(link, context);
3005
+ case "page": return resolvePageLink(link, context);
3006
+ case "entry": return resolveEntryLink(link, context);
3007
+ case "external":
3008
+ case "url": return resolveExternalLink(link);
3009
+ default: return resolvePreResolvedLink(link);
3010
+ }
3011
+ }
3012
+ function resolvePreResolvedLink(link) {
3013
+ return !(typeof link.kind === "string" ? link.kind : null) && typeof link.href === "string" ? resolveExternalLink(link) : null;
3014
+ }
3015
+ //#endregion
3016
+ //#region ../blocks/src/system/transforms/registry/mapDrawing.ts
3017
+ /**
3018
+ * Map tokens for the section ground a drawing sits on. The value is the
3019
+ * section's `_sectionStyles.background`, resolved by the same owner as the
3020
+ * section's own foreground; theme-core decides every map colour from it.
3021
+ */
3022
+ const mapDrawingStyleTransform = {
3023
+ id: "mapDrawing.resolveStyle",
3024
+ kind: "formatter",
3025
+ summary: "Resolve map drawing tokens from the section ground and site style",
3026
+ run: (value, options, context) => mapDrawingStyle({
3027
+ foreground: resolveSectionSurfaceForeground(value ?? sectionFallbackBackground(options?.fallbackToken), context, { fallbackToken: options?.fallbackToken }),
3028
+ palette: context.theme.palette,
3029
+ skin: context.theme.skin
3030
+ })
3031
+ };
3032
+ function sectionFallbackBackground(token) {
3033
+ return token === void 0 ? void 0 : {
3034
+ type: "color",
3035
+ color: token
3036
+ };
3037
+ }
3038
+ const eventCalendarSelectionParam = {
3039
+ id: "events.calendarSelectionParam",
3040
+ kind: "formatter",
3041
+ summary: "Resolve selected events instead of discovery filters",
3042
+ schema: z.object({ key: z.enum([
3043
+ "seriesIds",
3044
+ "eventSurface",
3045
+ "filterEventPresets",
3046
+ "scheduleScope",
3047
+ "filterCategoryIds",
3048
+ "filterStaffMemberId",
3049
+ "filterVenueId"
3050
+ ]) }),
3051
+ run(value, { key }) {
3052
+ const content = asPartialObject(value) ?? {};
3053
+ const selection = resolveEventSelection(content.eventSelection, content.selectedEventSeriesIds);
3054
+ if (selection.kind === "selected") return key === "seriesIds" ? selection.seriesIds : void 0;
3055
+ return key === "seriesIds" ? void 0 : content[key];
3056
+ }
3057
+ };
3058
+ const readJobSchema = z.object({ job: z.enum([
3059
+ "list",
3060
+ "calendar",
3061
+ "schedule"
3062
+ ]) });
3063
+ const eventCalendarReadProfile = {
3064
+ id: "events.calendarReadProfile",
3065
+ kind: "formatter",
3066
+ summary: "Select media enrichment for the calendar display mode",
3067
+ run(value) {
3068
+ return resolveCalendarReadProfile(asPartialObject(value) ?? {});
3069
+ }
3070
+ };
3071
+ const eventCalendarReadEnabled = {
3072
+ id: "events.calendarReadEnabled",
3073
+ kind: "formatter",
3074
+ summary: "Choose the read projection required by the calendar display mode",
3075
+ schema: readJobSchema,
3076
+ run(value, options) {
3077
+ const plan = resolveEventCalendarReadPlan(asPartialObject(value) ?? {});
3078
+ return plan.jobs === options.job || plan.jobs === "both" && options.job !== "schedule";
3079
+ }
3080
+ };
3081
+ //#endregion
3082
+ //#region ../blocks/src/system/transforms/registry/index.ts
3083
+ const builtinTransformDefinitions = [
3084
+ offeringsPreviewDatesReadEnabled,
3085
+ lookLeadSlotTransform,
3086
+ lookQuoteLimitTransform,
3087
+ lookCarouselRegionTransform,
3088
+ lookSkinSlotTransform,
3089
+ {
3090
+ id: "events.calendarListWindow",
3091
+ kind: "formatter",
3092
+ schema: z.object({ key: z.enum(["from", "to"]) }),
3093
+ run(_value, { key }, context) {
3094
+ const content = context.data ?? {};
3095
+ if (eventCalendarListGroupingDecision({
3096
+ ...content,
3097
+ arrangementLooks: content._lookSlots !== void 0
3098
+ }).grouping !== "week") return void 0;
3099
+ const timeZone = context.dateContext.timeZone;
3100
+ const startOfWeek = eventCalendarWeekStart(timeZone, content.startOfWeek === "sunday" || content.startOfWeek === "monday" ? content.startOfWeek : void 0);
3101
+ return buildEventListWeek(getLocalScheduleDate(new Date(readRuntimeNow(context.now)), timeZone), startOfWeek, timeZone)[key];
3102
+ }
3103
+ },
3104
+ eventCalendarSelectionParam,
3105
+ eventCalendarReadEnabled,
3106
+ eventCalendarReadProfile,
3107
+ {
3108
+ id: "events.calendarBanded",
3109
+ kind: "formatter",
3110
+ summary: "Paint the week-board band only on a section with no background of its own",
3111
+ run(value) {
3112
+ const content = asPartialObject(value) ?? {};
3113
+ const sectionStyles = asPartialObject(content._sectionStyles);
3114
+ return content.banded === true && parseBackgroundContent(sectionStyles?.background) === null;
3115
+ }
3116
+ },
3117
+ ...formattingTransforms,
3118
+ ...layoutTransforms,
3119
+ ...chromeLogoTransforms,
3120
+ ...uiTransforms,
3121
+ ...mediaTransforms,
3122
+ ...backgroundTransforms,
3123
+ ...linksTransforms,
3124
+ ...boxStylesTransforms,
3125
+ ...contentTransforms,
3126
+ ...headerRuntimeTransforms,
3127
+ mapDrawingStyleTransform
3128
+ ];
3129
+ const defaultTransforms = createTransformRegistry(builtinTransformDefinitions);
3130
+ //#endregion
3131
+ //#region ../blocks/src/system/data/linkedContentEntries.ts
3132
+ const LINKED_CONTENT_ENTRY_META_KEY = "__rbLinkedContentEntry";
3133
+ function coerceLinkedContentEntriesPayload(payload) {
3134
+ if (!isRecord(payload)) return payload;
3135
+ const response = payload;
3136
+ if (!Array.isArray(response.entries)) return payload;
3137
+ const contentType = parsePublicContentTypeMeta(response.contentType);
3138
+ if (!contentType) return response.entries;
3139
+ return response.entries.map((entry) => enrichLinkedContentEntry(entry, contentType));
3140
+ }
3141
+ function getLinkedContentEntryMeta(value) {
3142
+ if (!isRecord(value)) return null;
3143
+ const candidate = value[LINKED_CONTENT_ENTRY_META_KEY];
3144
+ return isLinkedContentEntryMeta(candidate) ? {
3145
+ ...candidate,
3146
+ editRevision: candidate.editRevision ?? null
3147
+ } : null;
3148
+ }
3149
+ function buildLinkedContentEditTarget(input) {
3150
+ const { entry, sourceBlockId, sourceBlockKind, itemIndex } = input;
3151
+ if (!isRecord(entry)) return null;
3152
+ const meta = getLinkedContentEntryMeta(entry);
3153
+ if (!meta || meta.support.kind !== "supported") return null;
3154
+ const content = isRecord(entry.content) ? entry.content : {};
3155
+ return {
3156
+ kind: "linked-content-entry",
3157
+ entryId: meta.entryId,
3158
+ contentTypeKey: meta.contentTypeKey,
3159
+ contentTypeLabel: meta.contentTypeLabel,
3160
+ title: meta.title,
3161
+ optimisticHash: meta.optimisticHash,
3162
+ editRevision: meta.editRevision,
3163
+ sourceBlockId: sourceBlockId ?? null,
3164
+ sourceBlockKind: sourceBlockKind ?? null,
3165
+ itemIndex,
3166
+ content: { ...content },
3167
+ contentType: meta.contentType
3168
+ };
3169
+ }
3170
+ function resolveLinkedEntryInlineFieldEligibility(input) {
3171
+ const meta = getLinkedContentEntryMeta(input.entry);
3172
+ if (!meta) return {
3173
+ kind: "read-only",
3174
+ reason: "missing-entry-meta"
3175
+ };
3176
+ if (meta.support.kind !== "supported") return {
3177
+ kind: "read-only",
3178
+ reason: "unsupported-content-type"
3179
+ };
3180
+ const source = resolveLinkedEntryFieldSource(meta, input.displayPath);
3181
+ if (!source) return {
3182
+ kind: "read-only",
3183
+ reason: "unmapped-display-path"
3184
+ };
3185
+ if (source.kind === "read-only") return {
3186
+ kind: "read-only",
3187
+ reason: source.reason
3188
+ };
3189
+ const field = meta.contentType.fields.find((candidate) => candidate.id === source.fieldPath);
3190
+ if (!field) return {
3191
+ kind: "read-only",
3192
+ reason: "missing-field-schema"
3193
+ };
3194
+ const fieldType = resolvePreviewLinkedEntryInlineFieldType(field.type);
3195
+ if (!fieldType || fieldType !== source.fieldType) return {
3196
+ kind: "read-only",
3197
+ reason: "unsupported-field-type"
3198
+ };
3199
+ if (input.renderedNodeType === "richText" && fieldType !== "richText") return {
3200
+ kind: "read-only",
3201
+ reason: "unsupported-field-type"
3202
+ };
3203
+ if (input.renderedNodeType === "text" && fieldType !== "text") return {
3204
+ kind: "read-only",
3205
+ reason: "unsupported-field-type"
3206
+ };
3207
+ return {
3208
+ kind: "editable",
3209
+ displayPath: input.displayPath,
3210
+ write: {
3211
+ kind: "linked-entry-write-field",
3212
+ entryId: meta.entryId,
3213
+ fieldPath: source.fieldPath,
3214
+ fieldType
3215
+ }
3216
+ };
3217
+ }
3218
+ function enrichLinkedContentEntry(entry, contentType) {
3219
+ if (!isRecord(entry)) return entry;
3220
+ const entryId = typeof entry.id === "string" ? entry.id : null;
3221
+ if (!entryId) return entry;
3222
+ const title = typeof entry.title === "string" && entry.title.trim().length > 0 ? entry.title : entryId;
3223
+ const optimisticHash = typeof entry.optimisticHash === "string" && entry.optimisticHash.length > 0 ? entry.optimisticHash : null;
3224
+ const content = isRecord(entry.content) ? entry.content : {};
3225
+ const editRevision = typeof entry.editRevision === "number" ? entry.editRevision : null;
3226
+ const meta = {
3227
+ kind: "linked-content-entry",
3228
+ entryId,
3229
+ contentTypeKey: contentType.key,
3230
+ contentTypeLabel: contentTypeKeyToLabel(contentType.key),
3231
+ title,
3232
+ optimisticHash,
3233
+ editRevision,
3234
+ support: resolveLinkedContentEditSupport(contentType),
3235
+ contentType,
3236
+ fieldSources: deriveLinkedEntryFieldSources(entry, contentType, content)
3237
+ };
3238
+ return {
3239
+ ...entry,
3240
+ [LINKED_CONTENT_ENTRY_META_KEY]: meta
3241
+ };
3242
+ }
3243
+ function deriveLinkedEntryFieldSources(entry, contentType, content) {
3244
+ const sources = [];
3245
+ for (const field of contentType.fields) {
3246
+ const fieldType = resolvePreviewLinkedEntryInlineFieldType(field.type);
3247
+ if (!fieldType) {
3248
+ sources.push({
3249
+ kind: "read-only",
3250
+ displayPath: `content.${field.id}`,
3251
+ reason: "unsupported-field-type"
3252
+ });
3253
+ continue;
3254
+ }
3255
+ sources.push({
3256
+ kind: "content-field",
3257
+ displayPath: `content.${field.id}`,
3258
+ fieldPath: field.id,
3259
+ fieldType
3260
+ });
3261
+ if (field.id === "excerpt" && fieldType === "text" && typeof entry.excerpt === "string" && typeof content.excerpt === "string" && entry.excerpt === content.excerpt) sources.push({
3262
+ kind: "content-field",
3263
+ displayPath: "excerpt",
3264
+ fieldPath: "excerpt",
3265
+ fieldType
3266
+ });
3267
+ if (field.id === contentType.titleField && fieldType === "text" && typeof entry.title === "string" && typeof content[field.id] === "string" && entry.title === content[field.id]) sources.push({
3268
+ kind: "content-field",
3269
+ displayPath: "title",
3270
+ fieldPath: field.id,
3271
+ fieldType
3272
+ });
3273
+ }
3274
+ for (const displayPath of [
3275
+ "title",
3276
+ "slug",
3277
+ "path",
3278
+ "publishedAt",
3279
+ "status",
3280
+ "image"
3281
+ ]) if (displayPath in entry && !sources.some((source) => source.displayPath === displayPath)) sources.push({
3282
+ kind: "read-only",
3283
+ displayPath,
3284
+ reason: displayPath === "image" ? "derived-field" : "route-field"
3285
+ });
3286
+ return sources;
3287
+ }
3288
+ function resolveLinkedEntryFieldSource(meta, displayPath) {
3289
+ return meta.fieldSources.find((candidate) => candidate.displayPath === displayPath) ?? null;
3290
+ }
3291
+ function resolvePreviewLinkedEntryInlineFieldType(fieldType) {
3292
+ if (fieldType === "richText") return "richText";
3293
+ if (fieldType === "text" || fieldType === "textarea") return "text";
3294
+ return null;
3295
+ }
3296
+ function resolveLinkedContentEditSupport(contentType) {
3297
+ if (contentType.fields.length === 0) return {
3298
+ kind: "unsupported-missing-schema",
3299
+ reason: "Content type has no public field metadata."
3300
+ };
3301
+ const metadata = contentType.previewLinkedEntryEditing;
3302
+ if (!metadata) return {
3303
+ kind: "unsupported-content-type",
3304
+ reason: "Content type has not enabled linked-entry preview editing."
3305
+ };
3306
+ switch (metadata.kind) {
3307
+ case "generic": return { kind: "supported" };
3308
+ case "unsupported-domain-backed": return {
3309
+ kind: "unsupported-domain-backed",
3310
+ reason: metadata.reason
3311
+ };
3312
+ default: return assertNever(metadata);
3313
+ }
3314
+ }
3315
+ function contentTypeKeyToLabel(key) {
3316
+ return (key.endsWith("ies") ? `${key.slice(0, -3)}y` : key.endsWith("s") ? key.slice(0, -1) : key).split(/[-_\s]+/).filter((part) => part.length > 0).map((part, index) => index === 0 ? capitalize(part) : part.toLowerCase()).join(" ");
3317
+ }
3318
+ function capitalize(value) {
3319
+ return value.charAt(0).toUpperCase() + value.slice(1).toLowerCase();
3320
+ }
3321
+ function parsePublicContentTypeMeta(value) {
3322
+ if (!isRecord(value)) return null;
3323
+ if (typeof value.key !== "string" || value.key.trim().length === 0) return null;
3324
+ return {
3325
+ key: value.key,
3326
+ titleField: typeof value.titleField === "string" ? value.titleField : null,
3327
+ fields: Array.isArray(value.fields) ? value.fields.flatMap(parsePublicContentTypeFieldMeta) : [],
3328
+ previewLinkedEntryEditing: parsePublicContentTypeLinkedEntryEditing(value.previewLinkedEntryEditing)
3329
+ };
3330
+ }
3331
+ function parsePublicContentTypeLinkedEntryEditing(value) {
3332
+ if (!isRecord(value) || typeof value.kind !== "string") return null;
3333
+ switch (value.kind) {
3334
+ case "generic": return { kind: "generic" };
3335
+ case "unsupported-domain-backed": return {
3336
+ kind: "unsupported-domain-backed",
3337
+ reason: typeof value.reason === "string" ? value.reason : "Domain-backed entries need a dedicated editor workflow."
3338
+ };
3339
+ default: return null;
3340
+ }
3341
+ }
3342
+ function parsePublicContentTypeFieldMeta(value) {
3343
+ if (!isRecord(value)) return [];
3344
+ if (typeof value.id !== "string" || typeof value.type !== "string") return [];
3345
+ return [{
3346
+ id: value.id,
3347
+ type: value.type,
3348
+ mediaKinds: parseStringArray(value.mediaKinds),
3349
+ fileKinds: parseStringArray(value.fileKinds)
3350
+ }];
3351
+ }
3352
+ function parseStringArray(value) {
3353
+ if (value === null || typeof value === "undefined") return null;
3354
+ if (!Array.isArray(value)) return null;
3355
+ return value.filter((item) => typeof item === "string");
3356
+ }
3357
+ function isLinkedContentEntryMeta(value) {
3358
+ if (!isRecord(value) || value.kind !== "linked-content-entry") return false;
3359
+ return [
3360
+ [
3361
+ "entryId",
3362
+ "contentTypeKey",
3363
+ "contentTypeLabel",
3364
+ "title"
3365
+ ].every((key) => typeof value[key] === "string"),
3366
+ isNullOrOfType(value.optimisticHash, "string"),
3367
+ value.editRevision === void 0 || isNullOrOfType(value.editRevision, "number"),
3368
+ isRecord(value.contentType),
3369
+ isLinkedEntryFieldSourceArray(value.fieldSources),
3370
+ isLinkedContentEditSupport(value.support)
3371
+ ].every(Boolean);
3372
+ }
3373
+ function isNullOrOfType(value, type) {
3374
+ return value === null || typeof value === type;
3375
+ }
3376
+ function isLinkedEntryFieldSourceArray(value) {
3377
+ return Array.isArray(value) && value.every(isLinkedEntryFieldSource);
3378
+ }
3379
+ function isLinkedEntryFieldSource(value) {
3380
+ if (!isRecord(value)) return false;
3381
+ if (typeof value.displayPath !== "string") return false;
3382
+ switch (value.kind) {
3383
+ case "content-field": return typeof value.fieldPath === "string" && (value.fieldType === "text" || value.fieldType === "richText");
3384
+ case "read-only": return isLinkedEntryInlineFieldReadOnlyReason(value.reason);
3385
+ default: return false;
3386
+ }
3387
+ }
3388
+ function isLinkedEntryInlineFieldReadOnlyReason(value) {
3389
+ switch (value) {
3390
+ case "missing-entry-meta":
3391
+ case "unsupported-content-type":
3392
+ case "missing-field-schema":
3393
+ case "unsupported-field-type":
3394
+ case "unmapped-display-path":
3395
+ case "route-field":
3396
+ case "derived-field": return true;
3397
+ default: return false;
3398
+ }
3399
+ }
3400
+ function isLinkedContentEditSupport(value) {
3401
+ if (!isRecord(value) || typeof value.kind !== "string") return false;
3402
+ switch (value.kind) {
3403
+ case "supported": return true;
3404
+ case "unsupported-domain-backed":
3405
+ case "unsupported-content-type":
3406
+ case "unsupported-missing-schema": return typeof value.reason === "string";
3407
+ default: return false;
3408
+ }
3409
+ }
3410
+ function isRecord(value) {
3411
+ return typeof value === "object" && value !== null && !Array.isArray(value);
3412
+ }
3413
+ //#endregion
3414
+ //#region ../blocks/src/sdkBlockTransform.ts
3415
+ /**
3416
+ * Transforms an SDK custom block into a BlockManifest.
3417
+ *
3418
+ * If the block has a `layout`, it can be rendered declaratively without React code.
3419
+ * If no layout, the block MUST use blockOverrides for rendering.
3420
+ */
3421
+ function transformSdkBlockToManifest(sdkBlock) {
3422
+ const hasLayout = Boolean(sdkBlock.layout) || Boolean(sdkBlock.variants && Object.keys(sdkBlock.variants).length > 0);
3423
+ return augmentManifest({
3424
+ variantMeaning: { kind: "arrangement" },
3425
+ name: sdkBlock.id,
3426
+ version: "1.0.0",
3427
+ title: sdkBlock.title,
3428
+ titleSource: sdkBlock.titleSource,
3429
+ description: sdkBlock.description,
3430
+ component: sdkBlock.id,
3431
+ fields: sdkBlock.fields,
3432
+ slots: [],
3433
+ category: sdkBlock.category,
3434
+ tags: sdkBlock.tags,
3435
+ icon: sdkBlock.icon,
3436
+ layout: sdkBlock.layout,
3437
+ variants: sdkBlock.variants,
3438
+ defaultVariant: sdkBlock.defaultVariant,
3439
+ variantOptions: sdkBlock.variantOptions,
3440
+ promotedFields: sdkBlock.promotedFields,
3441
+ lookField: sdkBlock.lookField,
3442
+ behaviours: {
3443
+ supportsThemeSwitching: true,
3444
+ inlineEditing: hasLayout,
3445
+ animation: hasLayout,
3446
+ paletteHidden: false
3447
+ }
3448
+ });
3449
+ }
3450
+ /**
3451
+ * Transforms an SDK custom block into a SystemBlockDefinition.
3452
+ *
3453
+ * This creates a minimal definition with just the manifest - no data loaders
3454
+ * or content normalizers since SDK blocks handle their own rendering.
3455
+ */
3456
+ function transformSdkBlockToDefinition(sdkBlock) {
3457
+ return {
3458
+ manifest: transformSdkBlockToManifest(sdkBlock),
3459
+ dataLoaders: sdkBlock.dataLoaders
3460
+ };
3461
+ }
3462
+ //#endregion
3463
+ //#region ../blocks/src/customBlockRegistry.ts
3464
+ const defaultCustomBlockSourcePolicy = { kind: "canonical-db-fallback-sdk" };
3465
+ function isCustomBlockKind(blockKind) {
3466
+ return blockKind.startsWith("custom.");
3467
+ }
3468
+ function transformToBlockDescriptor(sdkBlock, source = "sdk") {
3469
+ return {
3470
+ name: sdkBlock.id,
3471
+ title: sdkBlock.title,
3472
+ description: sdkBlock.description,
3473
+ category: sdkBlock.category,
3474
+ tags: sdkBlock.tags,
3475
+ icon: sdkBlock.icon,
3476
+ definition: transformSdkBlockToDefinition(sdkBlock),
3477
+ source
3478
+ };
3479
+ }
3480
+ function toResolvedCustomBlock(manifest, source) {
3481
+ return {
3482
+ blockKind: manifest.id,
3483
+ manifest: transformSdkBlockToManifest(manifest),
3484
+ source,
3485
+ descriptor: transformToBlockDescriptor(manifest, source.kind === "managed-database" ? "database" : "sdk")
3486
+ };
3487
+ }
3488
+ function planCustomBlockRegistryResolution({ sdkConfig, customBlocks = [], policy = defaultCustomBlockSourcePolicy }) {
3489
+ switch (policy.kind) {
3490
+ case "canonical-db-fallback-sdk": {
3491
+ const entriesByKind = /* @__PURE__ */ new Map();
3492
+ const conflicts = [];
3493
+ for (const customBlock of customBlocks) entriesByKind.set(customBlock.manifest.id, toResolvedCustomBlock(customBlock.manifest, customBlock.source));
3494
+ for (const sdkBlock of sdkConfig?.customBlocks ?? []) {
3495
+ const existing = entriesByKind.get(sdkBlock.id);
3496
+ if (existing) {
3497
+ conflicts.push({
3498
+ kind: "conflict",
3499
+ blockKind: existing.blockKind,
3500
+ winner: existing.source,
3501
+ loser: { kind: "sdk-config" },
3502
+ reason: "db-canonical-sdk-fallback"
3503
+ });
3504
+ continue;
3505
+ }
3506
+ entriesByKind.set(sdkBlock.id, toResolvedCustomBlock(sdkBlock, { kind: "sdk-config" }));
3507
+ }
3508
+ return {
3509
+ policy,
3510
+ entries: Array.from(entriesByKind.values()),
3511
+ conflicts
3512
+ };
3513
+ }
3514
+ }
3515
+ }
3516
+ function createCustomBlockRegistry({ sdkConfig, customBlocks = [], policy = defaultCustomBlockSourcePolicy, onConflict }) {
3517
+ const plan = planCustomBlockRegistryResolution({
3518
+ sdkConfig,
3519
+ customBlocks,
3520
+ policy
3521
+ });
3522
+ const entriesByKind = new Map(plan.entries.map((entry) => [entry.blockKind, entry]));
3523
+ for (const conflict of plan.conflicts) onConflict?.(`Using ${sourceLabel(conflict.winner)} custom block "${conflict.blockKind}" - ${sourceLabel(conflict.loser)} block is fallback only`);
3524
+ return {
3525
+ entries: plan.entries,
3526
+ conflicts: plan.conflicts,
3527
+ findManifest: (blockKind) => {
3528
+ if (!isCustomBlockKind(blockKind)) return void 0;
3529
+ return entriesByKind.get(blockKind);
3530
+ }
3531
+ };
3532
+ }
3533
+ function sourceLabel(source) {
3534
+ switch (source.kind) {
3535
+ case "managed-database": return "DB";
3536
+ case "sdk-synced": return "SDK-synced DB";
3537
+ case "sdk-config": return "SDK config";
3538
+ default: return assertNever(source);
3539
+ }
3540
+ }
3541
+ //#endregion
3542
+ //#region ../blocks/src/pageRenderJoins.ts
3543
+ /**
3544
+ * Re-points joins across omitted blocks. Pure over joins.
3545
+ *
3546
+ * Joins are keyed by adjacent block-id pairs, so dropping B from [A, B, C]
3547
+ * removes the A→C join as well as B's own, because no A→C join was ever
3548
+ * resolved. For each surviving pair the original join is kept when the pair
3549
+ * was already adjacent. Across a gap, the treatment comes from the join
3550
+ * entering the omitted run (A→first omitted), falling back to the one leaving
3551
+ * it (last omitted→C). Nothing visual is carried: the survivors are composed
3552
+ * from their own content afterwards.
3553
+ *
3554
+ * `survivors` are compared by identity against `originalBlocks`.
3555
+ */
3556
+ function retargetJoinsAcrossOmissions(input) {
3557
+ const { joins, originalBlocks, survivingBlocks } = input;
3558
+ if (joins.length === 0) return joins;
3559
+ if (originalBlocks.every((block) => survivingBlocks.has(block))) return joins;
3560
+ const byPair = joinsByPair(joins);
3561
+ const retargeted = [];
3562
+ let previousSurvivor = null;
3563
+ let run = [];
3564
+ for (const block of originalBlocks) {
3565
+ if (!survivingBlocks.has(block)) {
3566
+ run.push(block);
3567
+ continue;
3568
+ }
3569
+ if (previousSurvivor?.id && block.id) {
3570
+ const join = run.length === 0 ? byPair.get(pairKey(previousSurvivor.id, block.id)) : joinAcrossRun(byPair, previousSurvivor.id, block.id, run);
3571
+ if (join) retargeted.push(join);
3572
+ }
3573
+ previousSurvivor = block;
3574
+ run = [];
3575
+ }
3576
+ return retargeted;
3577
+ }
3578
+ function joinAcrossRun(byPair, previousBlockId, nextBlockId, run) {
3579
+ const firstOmittedId = run[0]?.id;
3580
+ const lastOmittedId = run[run.length - 1]?.id;
3581
+ const entering = firstOmittedId ? byPair.get(pairKey(previousBlockId, firstOmittedId)) : void 0;
3582
+ const exiting = lastOmittedId ? byPair.get(pairKey(lastOmittedId, nextBlockId)) : void 0;
3583
+ const donor = entering ?? exiting;
3584
+ return donor ? {
3585
+ previousBlockId,
3586
+ nextBlockId,
3587
+ treatment: donor.treatment
3588
+ } : void 0;
3589
+ }
3590
+ /**
3591
+ * The single composition site. For every adjacent pair of survivors with ids,
3592
+ * finds its join and composes it from both survivors' final content: what
3593
+ * each paints with and the frame each draws.
3594
+ */
3595
+ function composePageJoins(input) {
3596
+ const byPair = joinsByPair(input.joins);
3597
+ return input.survivors.flatMap((previous, index) => {
3598
+ const next = input.survivors[index + 1];
3599
+ if (!next || !previous.id || !next.id) return [];
3600
+ const join = byPair.get(pairKey(previous.id, next.id));
3601
+ return [{
3602
+ previousBlockId: previous.id,
3603
+ nextBlockId: next.id,
3604
+ join: join ? composeJoin(join, previous, next) : null,
3605
+ fieldsMeet: sectionShapeFromContent(previous.content) === "field" && sectionShapeFromContent(next.content) === "field"
3606
+ }];
3607
+ });
3608
+ }
3609
+ function composeJoin(join, previous, next) {
3610
+ return {
3611
+ boundaryId: pairKey(join.previousBlockId, join.nextBlockId),
3612
+ previousBlockId: join.previousBlockId,
3613
+ nextBlockId: join.nextBlockId,
3614
+ treatment: join.treatment,
3615
+ outcome: composeBoundary(sectionFactsForContent(previous.content), sectionFactsForContent(next.content))
3616
+ };
3617
+ }
3618
+ /** Placement, reserves and paint for a join that draws; null otherwise. */
3619
+ function renderedJoinLayout(join) {
3620
+ if (!join || join.outcome.kind !== "shown") return null;
3621
+ return boundaryLayout(join.treatment, join.outcome.composition);
3622
+ }
3623
+ /** Joins with a missing id on either side cannot sit between two blocks. */
3624
+ function joinsByPair(joins) {
3625
+ return new Map(joins.flatMap((join) => join.previousBlockId && join.nextBlockId ? [[pairKey(join.previousBlockId, join.nextBlockId), join]] : []));
3626
+ }
3627
+ /** Slot lookup key for an adjacent pair, in the one boundary-id scheme. */
3628
+ function joinSlotKey(previousBlockId, nextBlockId) {
3629
+ return pairKey(previousBlockId, nextBlockId);
3630
+ }
3631
+ function pairKey(previousBlockId, nextBlockId) {
3632
+ return makeBoundaryId(asDesignBlockId(previousBlockId), asDesignBlockId(nextBlockId));
3633
+ }
3634
+ //#endregion
3635
+ //#region ../blocks/src/pageRenderPlan.ts
3636
+ /** Owner-local derived reuse; shared settings and admitted rhythm position remain inputs. */
3637
+ function createPageRenderPlanReader() {
3638
+ const memo = { current: null };
3639
+ return (input) => {
3640
+ memo.current = planPageRender(input, memo.current);
3641
+ return memo.current.plan;
3642
+ };
3643
+ }
3644
+ function planPageRender(input, previous = null) {
3645
+ const resolveTarget = createRenderTargetResolver(input);
3646
+ const reusable = previous && samePlanSettings(previous.input, input) ? previous : null;
3647
+ const planned = input.page.blocks.map((block) => [block, reusable?.outcomes.get(block) ?? planPageBlock(block, input, resolveTarget)]);
3648
+ const outcomes = planned.map(([, outcome]) => outcome);
3649
+ const entries = outcomes.flatMap((outcome) => outcome.kind === "admitted" ? [outcome.entry] : []);
3650
+ const rhythmic = entries.map((entry, position) => {
3651
+ const cached = reusable?.rhythm.get(entry);
3652
+ return [entry, {
3653
+ position,
3654
+ entry: cached?.position === position ? cached.entry : applyArrangementRhythm(entry, position)
3655
+ }];
3656
+ });
3657
+ const plan = {
3658
+ entries: rhythmic.map(([, value]) => value.entry),
3659
+ omitted: outcomes.flatMap((outcome) => outcome.kind === "omitted" ? [outcome.omission] : []),
3660
+ runtimeJoins: retargetJoinsAcrossOmissions({
3661
+ joins: input.runtimeJoins ?? [],
3662
+ originalBlocks: input.page.blocks,
3663
+ survivingBlocks: new Set(entries.map((entry) => entry.block))
3664
+ })
3665
+ };
3666
+ return {
3667
+ input,
3668
+ outcomes: new Map(planned),
3669
+ rhythm: new Map(rhythmic),
3670
+ plan
3671
+ };
3672
+ }
3673
+ function samePlanSettings(previous, current) {
3674
+ return previous.siteStyleId === current.siteStyleId && previous.audience === current.audience && previous.previewStage === current.previewStage && previous.sdkConfig === current.sdkConfig && previous.customBlocks === current.customBlocks && previous.blockOverrides === current.blockOverrides;
3675
+ }
3676
+ /**
3677
+ * Mirrors the order of the checks `MemoBlockSection` used to make inline, so no
3678
+ * case changes meaning: admission first, then definition/override resolution,
3679
+ * then the layout requirement.
3680
+ */
3681
+ function planBlock(block, renderableContent, resolveTarget, audience, siteStyleId) {
3682
+ const common = {
3683
+ block,
3684
+ renderableContent
3685
+ };
3686
+ if (block.presentationAdmission.kind === "invalid") return {
3687
+ ...common,
3688
+ kind: "diagnostic",
3689
+ reason: {
3690
+ kind: "invalid-admission",
3691
+ blockKind: block.kind,
3692
+ error: block.presentationAdmission.error
3693
+ }
3694
+ };
3695
+ const { definition, systemDefinition, override } = resolveTarget(block.kind);
3696
+ const isCustom = block.kind.startsWith("custom.");
3697
+ if (!definition) return override ? {
3698
+ ...common,
3699
+ kind: "override-only",
3700
+ override
3701
+ } : {
3702
+ ...common,
3703
+ kind: "diagnostic",
3704
+ reason: {
3705
+ kind: "missing-definition",
3706
+ blockKind: block.kind,
3707
+ isCustom
3708
+ }
3709
+ };
3710
+ const manifestHasLayout = Boolean(definition.manifest.layout) || Object.keys(definition.manifest.variants ?? {}).length > 0;
3711
+ if (!override && !manifestHasLayout) return {
3712
+ ...common,
3713
+ kind: "diagnostic",
3714
+ reason: {
3715
+ kind: "missing-layout",
3716
+ blockKind: block.kind,
3717
+ isCustom
3718
+ }
3719
+ };
3720
+ return renderableBlockPlan(common, {
3721
+ definition,
3722
+ systemDefinition,
3723
+ override
3724
+ }, audience, siteStyleId);
3725
+ }
3726
+ function renderableBlockPlan(common, target, audience, siteStyleId) {
3727
+ const { definition, systemDefinition, override } = target;
3728
+ const renderableContent = planArrangementContent(common.block.kind, definition.manifest, common.renderableContent, audience);
3729
+ const effectiveArrangementKey = resolveEffectiveArrangement({
3730
+ manifest: arrangementManifestFromVariants(definition.manifest),
3731
+ ...definition.manifest.variantMeaning.kind !== "mode" ? { look: effectiveLookFromContent(renderableContent)?.look } : {},
3732
+ storedVariant: parseStoredVariant(definition.manifest, renderableContent),
3733
+ policy: siteStyleId === null ? void 0 : deriveSiteStyleBlockPolicy({
3734
+ siteStyleId: asSiteStyleId(siteStyleId),
3735
+ blockKind: common.block.kind
3736
+ })
3737
+ }).key;
3738
+ return {
3739
+ ...common,
3740
+ renderableContent,
3741
+ kind: "renderable",
3742
+ definition,
3743
+ override,
3744
+ effectiveArrangementKey,
3745
+ effectiveListArrangementKey: definition.manifest.variantMeaning.kind === "mode" && renderableContent._lookMonthArrangement === void 0 ? resolveModeArrangement({
3746
+ declaration: definition.manifest.variantMeaning,
3747
+ content: renderableContent,
3748
+ look: effectiveLookFromContent(renderableContent)?.look,
3749
+ mode: readStoredMode({
3750
+ ...arrangementManifestFromVariants(definition.manifest),
3751
+ variantMeaning: definition.manifest.variantMeaning
3752
+ }, renderableContent)
3753
+ }).key : null,
3754
+ variantKey: systemDefinition ? effectiveArrangementKey : null,
3755
+ managesOwnWrapper: Boolean(systemDefinition?.manifest.behaviours?.managesOwnWrapper)
3756
+ };
3757
+ }
3758
+ /**
3759
+ * Resolves definition + override once per block kind, and builds the
3760
+ * custom-block registry at most once per plan rather than once per custom
3761
+ * block, which is what the previous inline path did.
3762
+ */
3763
+ function createRenderTargetResolver(input) {
3764
+ const cache = /* @__PURE__ */ new Map();
3765
+ let customRegistry = null;
3766
+ const customRegistryOnce = () => {
3767
+ customRegistry ?? (customRegistry = createCustomBlockRegistry({
3768
+ sdkConfig: input.sdkConfig,
3769
+ customBlocks: (input.customBlocks ?? []).map((manifest) => ({
3770
+ manifest,
3771
+ source: { kind: "managed-database" }
3772
+ }))
3773
+ }));
3774
+ return customRegistry;
3775
+ };
3776
+ return (blockKind) => {
3777
+ const cached = cache.get(blockKind);
3778
+ if (cached) return cached;
3779
+ const systemDefinition = getBlockDefinition(blockKind);
3780
+ const resolved = {
3781
+ definition: systemDefinition ?? (blockKind.startsWith("custom.") ? customRegistryOnce().findManifest(blockKind)?.descriptor.definition : void 0),
3782
+ systemDefinition,
3783
+ override: getBlockOverride(blockKind, input.blockOverrides)
3784
+ };
3785
+ cache.set(blockKind, resolved);
3786
+ return resolved;
3787
+ };
3788
+ }
3789
+ /**
3790
+ * Look up a block override component by block kind.
3791
+ * Supports both full ("block.hero") and short ("hero") keys.
3792
+ */
3793
+ function getBlockOverride(blockKind, overrides) {
3794
+ if (!overrides) return void 0;
3795
+ if (overrides[blockKind]) return overrides[blockKind];
3796
+ return overrides[blockKind.replace(/^block\./, "")];
3797
+ }
3798
+ /**
3799
+ * Resolves block content based on stage priority.
3800
+ * For draft/preview: draftContent takes priority over content.
3801
+ * For published: content is the source of truth.
3802
+ */
3803
+ /**
3804
+ * The content a block renders with. Every render path (public, preview,
3805
+ * templates, SDK) chooses content here, so this is also where a stale
3806
+ * `site-style-transition-*` styleGroup is dropped; authored values survive.
3807
+ */
3808
+ function getRenderableContent(block, previewStage = "published") {
3809
+ return selectBlockContent(block, previewStage);
3810
+ }
3811
+ function arrangementRuntime(content) {
3812
+ const value = parseSurfaceTree(content._arrangementLooks);
3813
+ return isObjectRecord(value) && isObjectRecord(value.byMode) && Array.isArray(value.available) && Array.isArray(value.rhythm) ? restoreArrangementRuntime(value) : null;
3814
+ }
3815
+ /** Keep only the compiled inputs; the planner decides every presentation from them. */
3816
+ function restoreCompiledLook(look) {
3817
+ const { surfacePresentation: _presentation, ...inputs } = look;
3818
+ return {
3819
+ ...inputs,
3820
+ slotRoles: look.slotRoles ?? look.look.structure.slotRoles ?? {}
3821
+ };
3822
+ }
3823
+ function restoreArrangementRuntime(runtime) {
3824
+ const transported = runtime;
3825
+ const fieldGrounds = Array.isArray(transported.fieldGrounds) ? transported.fieldGrounds.filter((token) => typeof token === "string") : [];
3826
+ return {
3827
+ ...runtime,
3828
+ fieldGrounds,
3829
+ available: runtime.available.map(restoreCompiledLook),
3830
+ byMode: Object.fromEntries(Object.entries(runtime.byMode).map(([mode, look]) => [mode, restoreCompiledLook(look)]))
3831
+ };
3832
+ }
3833
+ /** The planner grounds the effective Look itself, so only its compiled inputs are read back. */
3834
+ function effectiveLookFromContent(content) {
3835
+ const value = content._effectiveLook;
3836
+ return isObjectRecord(value) && isObjectRecord(value.look) ? restoreCompiledLook(value) : null;
3837
+ }
3838
+ function planArrangementContent(blockKind, manifest, content, audience) {
3839
+ const runtime = arrangementRuntime(content);
3840
+ if (!runtime) return content;
3841
+ const mode = readStoredMode({
3842
+ ...arrangementManifestFromVariants(manifest),
3843
+ variantMeaning: manifest.variantMeaning
3844
+ }, content);
3845
+ const selected = runtime.byMode[mode ?? "default"];
3846
+ if (!selected) return content;
3847
+ const { facts } = arrangementContentFacts(content);
3848
+ const published = resolvePublishedLook({
3849
+ look: selected.look,
3850
+ facts,
3851
+ audience,
3852
+ catalogue: runtime.available.map((entry) => entry.look)
3853
+ });
3854
+ const effective = runtime.available.find((entry) => entry.look.id === published.id) ?? selected;
3855
+ const { length, knobs } = resolveArrangementKnobs({
3856
+ blockKind,
3857
+ look: effective,
3858
+ content
3859
+ });
3860
+ const values = Object.fromEntries(Object.entries(knobs).flatMap(([key, knob]) => knob.kind === "kept" ? [] : [[key, knob.value]]));
3861
+ const effectiveContent = Object.fromEntries(Object.entries(values).map(([key, value]) => [key, effectiveContentKnobValue(blockKind, key, value)]));
3862
+ const lookOwnedPaths = contentPathsOwnedBy(resolveFieldOwnership({
3863
+ blockKind,
3864
+ manifest,
3865
+ arrangementLook: true
3866
+ }), ["look"]);
3867
+ const activeContent = withoutLookOwnedContent(Object.fromEntries(Object.entries(content).filter(([key]) => knobs[key]?.kind !== "kept")), lookOwnedPaths);
3868
+ const photoContent = arrangementPhotoContent(activeContent, effectiveContent);
3869
+ const visiblePhotos = arrangementContentFacts({
3870
+ ...activeContent,
3871
+ ...effectiveContent,
3872
+ ...photoContent
3873
+ });
3874
+ return {
3875
+ ...activeContent,
3876
+ ...arrangementPhotoTreatmentContent(activeContent, effective.look, runtime.surfaceContext.palette, values.photoTint === "brand" ? "brand" : "dark"),
3877
+ ...mode !== null ? { variant: mode } : {},
3878
+ ...effectiveContent,
3879
+ ...photoContent,
3880
+ ...arrangementShapeContent(knobs),
3881
+ ...arrangementPanelContent(activeContent, effective, mode),
3882
+ ...arrangementQuoteContent(blockKind, effective, values),
3883
+ _arrangementLooks: runtime,
3884
+ _effectiveLook: effective,
3885
+ _lookHooks: arrangementContentHooks(effective, mode, length, {
3886
+ ...facts.content,
3887
+ photo: visiblePhotos.facts.content.photo
3888
+ }, values, visiblePhotos.photoCount),
3889
+ _effectiveKnobs: knobs,
3890
+ _lookOwnedPaths: lookOwnedPaths,
3891
+ _lookAudience: audience,
3892
+ _lookSlots: arrangementContentSlots(blockKind),
3893
+ blockLook: effective.look.id
3894
+ };
3895
+ }
3896
+ /** Typed Look composition owns contrast treatment; parsing preserves authored paint. */
3897
+ function arrangementPhotoTreatmentContent(content, look, palette, tint) {
3898
+ if (!look.structure.photoTreatment) return {};
3899
+ const authored = parseCanonicalRuntimeBackground(content);
3900
+ if (authored.kind === "none") return {};
3901
+ return { _sectionStyles: {
3902
+ ...isObjectRecord(content._sectionStyles) ? content._sectionStyles : {},
3903
+ background: applyLookPhotoTreatment(authored.background, look.structure.photoTreatment, palette, tint)
3904
+ } };
3905
+ }
3906
+ /** Widget section hooks use the theme; hero background geometry never travels to list islands. */
3907
+ function arrangementContentSlots(blockKind) {
3908
+ return Object.fromEntries(arrangementSlotNames.filter((slot) => (!slot.startsWith("price-") || blockKind === "block.shop") && slot !== "schedule-section" && slot !== "shop-section" && (slot !== "background" || blockKind === "block.hero")).map((slot) => [slot, slot]));
3909
+ }
3910
+ /** Where a Look offers the photo shape, the shape sets the crop, without rewriting authored preferences. */
3911
+ function arrangementShapeContent(knobs) {
3912
+ const shape = knobs.imageShape;
3913
+ if (!shape || shape.kind === "kept") return {};
3914
+ return shape.value === "circle" ? { aspectRatio: "1/1" } : shape.value === "arch" ? { aspectRatio: "4/5" } : {};
3915
+ }
3916
+ function arrangementQuoteContent(blockKind, effective, values) {
3917
+ if (blockKind !== "block.testimonials") return {};
3918
+ const single = effective.look.structure.byMode.default === "single";
3919
+ return {
3920
+ _quoteCount: single ? 1 : values.quoteCount === "all" ? null : Number(values.quoteCount),
3921
+ _quoteLoaderLimit: values.quoteCount === "all" && !single ? "all" : "50"
3922
+ };
3923
+ }
3924
+ function arrangementPanelContent(content, effective, mode) {
3925
+ if (mode === "calendar") return {
3926
+ _lookMonthArrangement: effective.look.structure.byMode.calendar,
3927
+ defaultCalendarView: "month"
3928
+ };
3929
+ const arrangement = effective.look.structure.byMode[mode ?? "default"];
3930
+ if (arrangement === "event-header") return { heading: void 0 };
3931
+ if (arrangement !== "compact" && arrangement !== "details-panel") return {};
3932
+ return {
3933
+ heading: void 0,
3934
+ _lookPanelHeading: content.heading
3935
+ };
3936
+ }
3937
+ function arrangementPhotoContent(content, knobs) {
3938
+ if (knobs.showPhotos !== false || !Array.isArray(content.cards)) return {};
3939
+ return { cards: content.cards.map((card) => {
3940
+ if (!isObjectRecord(card)) return card;
3941
+ const { media: _hiddenMedia, ...copy } = card;
3942
+ return copy;
3943
+ }) };
3944
+ }
3945
+ /**
3946
+ * The one owner of the facts `whenMissing` rules read from block content.
3947
+ * Content facts also become `data-has-*` hooks; setting facts never do.
3948
+ */
3949
+ function arrangementContentFacts(content) {
3950
+ const photoCount = arrangementPhotoCount(content);
3951
+ const featured = typeof content.featured === "string" ? content.featured.trim().length > 0 : content.featured !== void 0 && content.featured !== null;
3952
+ return {
3953
+ photoCount,
3954
+ facts: {
3955
+ content: {
3956
+ photo: photoCount > 0,
3957
+ facts: Array.isArray(content.facts) && content.facts.length > 0,
3958
+ featured,
3959
+ outcome: typeof content.outcome === "string" && content.outcome.length > 0,
3960
+ figure: typeof content.figure === "string" && content.figure.trim().length > 0,
3961
+ entrance: isObjectRecord(content.entrancePhoto)
3962
+ },
3963
+ settings: { "listed-by-week": content.listBy === "week" }
3964
+ }
3965
+ };
3966
+ }
3967
+ /** The content stage owns media presence for every arrangement consumer. */
3968
+ function arrangementPhotoCount(content) {
3969
+ if (Array.isArray(content.cards)) return content.cards.filter((card) => isObjectRecord(card) && isObjectRecord(card.media)).length;
3970
+ if (Array.isArray(content.members)) return content.members.filter((member) => isObjectRecord(member) && isObjectRecord(member.photo)).length;
3971
+ if (Array.isArray(content.images)) return content.images.filter((item) => isObjectRecord(item) && isObjectRecord(item.image)).length;
3972
+ if (isObjectRecord(content.media) || isObjectRecord(content.entrancePhoto)) return 1;
3973
+ return storedSectionPhoto(content) === null ? 0 : 1;
3974
+ }
3975
+ function effectiveContentKnobValue(blockKind, key, value) {
3976
+ const facet = systemCustomizeFacetDefinitionsForBlock(blockKind).find((entry) => entry.target.kind === "content-field" && entry.target.field === key);
3977
+ return facet?.target.kind === "content-field" && facet.target.boolean ? value === "true" : value;
3978
+ }
3979
+ function arrangementContentHooks(effective, mode, length, facts, values, photoCount) {
3980
+ return {
3981
+ "data-look": effective.look.id,
3982
+ ...mode === "combined" ? { "data-arrangement": "combined" } : {
3983
+ "data-treat": effective.treatment,
3984
+ "data-arrangement": effective.look.structure.byMode[mode ?? "default"]
3985
+ },
3986
+ ...mode !== null ? { "data-mode": mode } : {},
3987
+ ...length !== null ? { "data-length": length } : {},
3988
+ ...Object.fromEntries(Object.entries(facts).map(([key, value]) => [`data-has-${key}`, String(value)])),
3989
+ "data-photo-count": String(photoCount),
3990
+ ...Object.fromEntries(Object.entries(values).map(([key, value]) => [`data-knob-${key === "titleSize" ? "headline" : key.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)}`, value]))
3991
+ };
3992
+ }
3993
+ function applyArrangementRhythm(entry, position) {
3994
+ const runtime = arrangementRuntime(entry.renderableContent);
3995
+ const look = effectiveLookFromContent(entry.renderableContent);
3996
+ if (!runtime || !look) return entry;
3997
+ const rhythm = runtime.rhythm.length === 0 ? null : runtime.rhythm[position % runtime.rhythm.length];
3998
+ const content = entry.renderableContent;
3999
+ const resolved = resolveSectionBackground(parseCanonicalRuntimeBackground(content), null, rhythm, heroPhotoGround(entry.block.kind, entry.kind === "renderable" ? entry.effectiveArrangementKey ?? void 0 : void 0));
4000
+ const updated = applyResolvedArrangementBackground(content, resolved);
4001
+ const surface = arrangementGroundToken(resolved);
4002
+ const grounded = resolveArrangementSurfaces(entry, look, runtime, resolved, updated);
4003
+ const shape = sectionShapeHook(sectionShapeForGround(runtime.fieldGrounds, surface));
4004
+ const combined = resolveCombinedLook(entry, grounded, runtime, resolved, updated);
4005
+ return {
4006
+ ...entry,
4007
+ styleBackground: arrangementGroundToken(resolveSectionBackground({ kind: "none" }, null, rhythm)),
4008
+ renderableContent: {
4009
+ ...updated,
4010
+ ...combined ? { _combinedLook: combined } : {},
4011
+ _effectiveLook: grounded,
4012
+ _lookHooks: {
4013
+ ...isObjectRecord(updated._lookHooks) ? updated._lookHooks : {},
4014
+ "data-surface": surface,
4015
+ ...shape
4016
+ }
4017
+ }
4018
+ };
4019
+ }
4020
+ /** The section's name for hooks such as `data-surface`. Surfaces take sectionSurfaceBase, where media and gradients are never colours. */
4021
+ function arrangementGroundToken(resolved) {
4022
+ if (resolved.kind === "base") return "background";
4023
+ switch (resolved.background.type) {
4024
+ case "image":
4025
+ case "video": return "media";
4026
+ case "color": return resolved.background.color ?? "background";
4027
+ case "gradient": return "gradient";
4028
+ }
4029
+ }
4030
+ function applyResolvedArrangementBackground(content, resolved) {
4031
+ const section = isObjectRecord(content._sectionStyles) ? content._sectionStyles : {};
4032
+ const photo = isObjectRecord(section.background) ? section.background.image : void 0;
4033
+ const ground = resolved.kind === "base" ? void 0 : resolved.background;
4034
+ const background = photo !== void 0 ? {
4035
+ ...ground ?? {
4036
+ type: "color",
4037
+ color: "background"
4038
+ },
4039
+ image: photo
4040
+ } : ground;
4041
+ return {
4042
+ ...content,
4043
+ _sectionStyles: {
4044
+ ...section,
4045
+ background
4046
+ }
4047
+ };
4048
+ }
4049
+ function planPageBlock(block, input, resolveTarget) {
4050
+ const outcome = planBlock(block, getRenderableContent(block, input.previewStage), resolveTarget, input.audience, input.siteStyleId ?? null);
4051
+ if (outcome.kind !== "diagnostic") return {
4052
+ kind: "admitted",
4053
+ entry: outcome
4054
+ };
4055
+ const resolved = resolveTarget(block.kind);
4056
+ const debug = blockDiagnosticContext(resolved, input);
4057
+ return input.audience === "public" ? {
4058
+ kind: "omitted",
4059
+ omission: {
4060
+ blockId: block.id ?? null,
4061
+ blockKind: block.kind,
4062
+ reason: outcome.reason,
4063
+ override: resolved.override,
4064
+ debug
4065
+ }
4066
+ } : {
4067
+ kind: "admitted",
4068
+ entry: {
4069
+ ...outcome,
4070
+ debug
4071
+ }
4072
+ };
4073
+ }
4074
+ function blockDiagnosticContext(resolved, input) {
4075
+ return {
4076
+ hasOverride: Boolean(resolved.override),
4077
+ sdkCustomBlocksCount: input.sdkConfig?.customBlocks?.length ?? 0,
4078
+ dbCustomBlocksCount: input.customBlocks?.length ?? 0,
4079
+ manifestKeys: resolved.definition ? Object.keys(resolved.definition.manifest).sort() : null
4080
+ };
4081
+ }
4082
+ function resolveArrangementSurfaces(entry, look, runtime, background, content) {
4083
+ const ground = deriveSectionGround(background, runtime.surfaceContext.palette);
4084
+ const style = {
4085
+ roleMap: look.roleMap,
4086
+ surfaces: runtime.surfaces,
4087
+ context: runtime.surfaceContext
4088
+ };
4089
+ const surfacePresentation = resolveLookSurfacePresentation({
4090
+ look,
4091
+ parents: plannedSlotParents(entry, look),
4092
+ ground,
4093
+ base: sectionSurfaceBase(background, runtime.surfaceContext.palette),
4094
+ style,
4095
+ content
4096
+ });
4097
+ if (!lookPresentationOnPalette(surfacePresentation, runtime.surfaceContext.palette)) throw new Error(`Look ${look.look.id} resolved its surfaces against a different palette from this page's theme`);
4098
+ return {
4099
+ ...look,
4100
+ ground,
4101
+ surfacePresentation
4102
+ };
4103
+ }
4104
+ /** The combined mode owns its resolved list and month, including independent paint. */
4105
+ function resolveCombinedLook(entry, list, runtime, background, content) {
4106
+ if (entry.block.kind !== "block.event-calendar" || content.variant !== "combined") return null;
4107
+ const month = runtime.byMode.calendar;
4108
+ if (!month) throw new Error("Combined calendar needs a month Look");
4109
+ const arrangement = month.look.structure.byMode.calendar;
4110
+ if (arrangement !== "month-grid" && arrangement !== "month-day") throw new Error("Invalid combined month arrangement");
4111
+ const ground = deriveSectionGround(background, runtime.surfaceContext.palette);
4112
+ const surfacePresentation = resolveLookSurfacePresentation({
4113
+ look: month,
4114
+ parents: arrangementSlotParentsForManifest(entry.kind === "renderable" ? entry.definition.manifest : void 0, month.look.target, arrangement),
4115
+ ground,
4116
+ base: sectionSurfaceBase(background, runtime.surfaceContext.palette),
4117
+ content,
4118
+ style: {
4119
+ roleMap: month.roleMap,
4120
+ surfaces: runtime.surfaces,
4121
+ context: runtime.surfaceContext
4122
+ }
4123
+ });
4124
+ const presentation = (look, mode, arrangement) => ({
4125
+ lookSlots: arrangementContentSlots(entry.block.kind),
4126
+ itemRoles: look.itemRoles,
4127
+ surfacePresentation: look.surfacePresentation,
4128
+ hooks: {
4129
+ "data-look": look.look.id,
4130
+ "data-treat": look.treatment,
4131
+ "data-mode": mode,
4132
+ "data-arrangement": arrangement
4133
+ }
4134
+ });
4135
+ return combinedLookSchema.parse({
4136
+ list: {
4137
+ ...presentation(list, "list", list.look.structure.byMode.combined),
4138
+ arrangement: list.look.structure.byMode.combined,
4139
+ panelHeading: content._lookPanelHeading,
4140
+ itemActionStyle: content.actionStyle
4141
+ },
4142
+ month: {
4143
+ ...presentation({
4144
+ ...month,
4145
+ surfacePresentation
4146
+ }, "calendar", arrangement),
4147
+ arrangement
4148
+ }
4149
+ });
4150
+ }
4151
+ function plannedSlotParents(entry, look) {
4152
+ const fallback = Object.values(look.look.structure.byMode)[0] ?? "";
4153
+ if (entry.kind !== "renderable") return arrangementSlotParentsForManifest(void 0, look.look.target, fallback);
4154
+ const month = entry.renderableContent._lookMonthArrangement;
4155
+ const arrangement = entry.effectiveListArrangementKey ?? (typeof month === "string" ? month : entry.effectiveArrangementKey) ?? fallback;
4156
+ return arrangementSlotParentsForManifest(entry.definition.manifest, look.look.target, arrangement);
4157
+ }
4158
+ function heroPhotoGround(blockKind, arrangementKey) {
4159
+ return blockKind === "block.hero" ? { paintsGround: heroPhotoPaintsGround(arrangementKey) } : void 0;
4160
+ }
4161
+ //#endregion
4162
+ export { CalendarIcon as A, selectBlockContent as B, createEditorPresentationPageReader as C, CardListItems as D, CardListCollection as E, formatEventDuration as F, defaultThemeTokens as H, resolveEventCardBooking as I, resolveEventCta as L, buildMonthDay as M, resolveMonthSelectedDay as N, EventItem as O, formatEventTeacherLine as P, resolveEventLinkProps as R, EventListingFrameView as S, EmptyState as T, buildThemeTokens as V, EVENT_REGISTRATION_ANCHOR_ID as _, renderedJoinLayout as a, derivePreviewRunSchedule as b, coerceLinkedContentEntriesPayload as c, defaultTransforms as d, resolveAuthoredLinkHref as f, EventHeader as g, resolveRouteTarget as h, joinSlotKey as i, MapPinIcon as j, eventCategoryBadge as k, resolveLinkedEntryInlineFieldEligibility as l, resolvePageRouteTarget as m, planArrangementContent as n, retargetJoinsAcrossOmissions as o, resolveEntryRouteTarget as p, composePageJoins as r, buildLinkedContentEditTarget as s, createPageRenderPlanReader as t, builtinTransformDefinitions as u, eventCardListContent as v, createPresentationPageReader as w, MonthLookView as x, deriveEventScheduleSummary as y, parseStoredVariant as z };