@riverbankcms/sdk 0.177.0 → 0.179.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -8
- package/dist/_dts/{BlocksIslandsHydrator-sYraeqm9.d.ts → BlocksIslandsHydrator-DKwgs95u.d.ts} +1 -1
- package/dist/_dts/{Page-Bp7hTDTy.d.ts → Page-lWenra5i.d.ts} +7 -7
- package/dist/_dts/{SdkPreviewMode-CxkCCyKw.d.ts → SdkPreviewMode-BRxhRw4I.d.ts} +2 -2
- package/dist/_dts/{client-K6UhbL3t.d.ts → client-qWn7xAwJ.d.ts} +77 -23
- package/dist/_dts/{content-types-BLAdIMyr.d.ts → content-types-DL6GIvTm.d.ts} +2 -2
- package/dist/_dts/{contracts-BG7yTZ6t.d.ts → contracts-CzWyAiJj.d.ts} +6 -116
- package/dist/_dts/{generatePageMetadata-X_WpGzZZ.d.ts → generatePageMetadata-CBKd0cJ4.d.ts} +2 -2
- package/dist/_dts/{index--n-wV8Xd.d.ts → index-7CDBZGb-.d.ts} +1 -1
- package/dist/_dts/{index-Bygd2RCg.d.ts → index-BU9uAkHB.d.ts} +4 -4
- package/dist/_dts/{index-BMGif2r3.d.ts → index-BYnG_vF5.d.ts} +1 -1
- package/dist/_dts/{index-CBRbZJ6u.d.ts → index-CZgJrhzT.d.ts} +4 -2
- package/dist/_dts/{index-BLseXObg.d.ts → index-CaCum9mM.d.ts} +2 -2
- package/dist/_dts/{index-BpAW9AKB.d.ts → index-DCiSHd-C.d.ts} +1 -1
- package/dist/_dts/{index-CX9bp60k.d.ts → index-DVSipdrT.d.ts} +3 -3
- package/dist/_dts/{loadContent-uhUThWaq.d.ts → loadContent-CPKbFQyq.d.ts} +15 -13
- package/dist/_dts/{request-Bf9YImJw.d.ts → request-BjKBCS7t.d.ts} +1687 -373
- package/dist/_dts/{resolveBlockData-D6M5NMZB.d.ts → resolveBlockData-DupbMCup.d.ts} +8 -5
- package/dist/_dts/resolvePageContent-BqNyCHi8.d.ts +61 -0
- package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
- package/dist/_dts/sdk/src/client/types.d.ts +3 -3
- package/dist/_dts/sdk/src/client.d.ts +7 -7
- package/dist/_dts/sdk/src/config/index.d.ts +6 -6
- package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
- package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
- package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +2 -2
- package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
- package/dist/_dts/sdk/src/data/types.d.ts +7 -2
- package/dist/_dts/sdk/src/gifting/client.d.ts +1 -2
- package/dist/_dts/sdk/src/index.d.ts +8 -8
- package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
- package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
- package/dist/_dts/sdk/src/navigation/index.d.ts +3 -3
- package/dist/_dts/sdk/src/next/index.d.ts +32 -12
- package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
- package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
- package/dist/_dts/sdk/src/portal/client.d.ts +56 -4
- package/dist/_dts/sdk/src/portal/index.d.ts +95 -13
- package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
- package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +4 -4
- package/dist/_dts/sdk/src/rendering/index.d.ts +7 -7
- package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/server.d.ts +3 -3
- package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
- package/dist/_dts/sdk/src/routing/index.d.ts +19 -6
- package/dist/_dts/sdk/src/server.d.ts +5 -5
- package/dist/_dts/sdk/src/spam-protection/index.d.ts +2 -2
- package/dist/_dts/sdk/src/theme/index.d.ts +1 -1
- package/dist/_dts/serviceBookingOutline-YcsIjvn1.d.ts +582 -0
- package/dist/_dts/{types-C1l2Sm2h.d.ts → types-B7e6Lmo5.d.ts} +3 -3
- package/dist/_dts/{types-DgV8P2mz.d.ts → types-BOxSq-Bq.d.ts} +8 -7
- package/dist/_dts/{types-BdZ5pJSk.d.ts → types-CT-KOxl_.d.ts} +5 -39
- package/dist/_dts/{validation-BtbZIT5f.d.ts → validation-Dz6qccue.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-CeYQQQs7.mjs → BlocksIslandsHydrator-1XifJg6V.mjs} +17 -18
- package/dist/client/{BookingMailingListNote-CDDWrY_W.mjs → BookingMailingListNote-BsbEgagJ.mjs} +7 -7
- package/dist/client/{BookingQuestionFields-MbvIo2jS.mjs → BookingQuestionFields-C8IbeLHj.mjs} +4 -4
- package/dist/client/{CalendarNavigationChevron-C6CSVfEB.mjs → CalendarNavigationChevron-Bbqij1XQ.mjs} +43 -10
- package/dist/client/{CheckboxChoice-b-PJLEXe.mjs → CheckboxChoice-BZPLCgTU.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-C9Ggcfx3.mjs → DemoBookingPortalAccess-uA9H8LIL.mjs} +4 -4
- package/dist/client/{EventCalendar.client-BSMuSqg0.mjs → EventCalendar.client-yoSI77ov.mjs} +11 -11
- package/dist/client/{EventCombined.client-BTrmSyUB.mjs → EventCombined.client-HeCNlliq.mjs} +11 -11
- package/dist/client/{EventEmbeddedCheckoutStep-B18VbNS_.mjs → EventEmbeddedCheckoutStep-BDnicDM6.mjs} +1 -1
- package/dist/client/{EventItem-B0WjGXsH.mjs → EventItem-Duhk1vnF.mjs} +247 -7
- package/dist/client/{EventListWeekNavigation-8Ij7vuxY.mjs → EventListWeekNavigation-BiutEqPK.mjs} +1 -1
- package/dist/client/{EventListing.client-CWk2NEwd.mjs → EventListing.client-B5ln77jG.mjs} +3 -3
- package/dist/client/{EventListing.view-BEH4UbSL.mjs → EventListing.view-hUDhNtMv.mjs} +203 -9
- package/dist/client/{EventRegistrationPayment-B2EikR3f.mjs → EventRegistrationPayment-DqtX1vB2.mjs} +439 -123
- package/dist/client/{Page-C03rc6jw.mjs → Page-ChJ2TGVk.mjs} +24314 -20226
- package/dist/client/{ProtectedSubmitButton-C-ql101B.mjs → ProtectedSubmitButton-De6AzhE6.mjs} +1 -1
- package/dist/client/{SiteTermsAgreementField-BYACYP0T.mjs → SiteTermsAgreementField-CDBU31xW.mjs} +3 -3
- package/dist/client/{StepIndicator-Bb7rPtSq.mjs → StepIndicator-2Dl9zon2.mjs} +80 -33
- package/dist/client/{BookingPanelArrangement-BShQSial.mjs → StepIndicator-JQA-VuEH.mjs} +12 -12
- package/dist/client/{TabBarFragment-BqfRLojo.mjs → TabBarFragment-DlKQRhP4.mjs} +1 -1
- package/dist/client/{ThemedButton-DuaYtnvG.mjs → ThemedButton-CnSa7o-I.mjs} +66 -66
- package/dist/client/{accessibleSurfaces-DN8it_Cx.mjs → accessibleSurfaces-Wl8-_OVJ.mjs} +1 -1
- package/dist/client/{accordion-BfsOiweL.mjs → accordion-B6SqU49k.mjs} +1 -1
- package/dist/client/{booking-form.client-B8ohIj13.mjs → booking-form.client-DrEOjQ3N.mjs} +15 -15
- package/dist/client/{bookingForm-CXsck2oH.mjs → bookingForm-drZBwEZW.mjs} +4 -4
- package/dist/client/bookings.mjs +5 -5
- package/dist/client/{boxStyleClassNames-B_hcuT06.mjs → boxStyleClassNames-DEh45w16.mjs} +19 -19
- package/dist/client/{carousel-Cz5Ddbsx.mjs → carousel-C-YJliD-.mjs} +2 -2
- package/dist/client/{carousel.client-h65clfUO.mjs → carousel.client-DMtGYTTM.mjs} +1 -1
- package/dist/client/{cart-CTC2oS3p.mjs → cart-acGFWK9R.mjs} +3 -3
- package/dist/client/{cart.client-c1YkTC-Q.mjs → cart.client-BzlOGP2j.mjs} +1 -1
- package/dist/client/{checkout-BeW1ufaH.mjs → checkout-SEontwhy.mjs} +3 -3
- package/dist/client/{checkout.client-BeU32khQ.mjs → checkout.client-C0Qvh-d4.mjs} +1 -1
- package/dist/client/{checkoutUrls-DVfSUSKp.mjs → checkoutUrls-yUKeq1N9.mjs} +1 -1
- package/dist/client/client.mjs +469 -320
- package/dist/client/{context-R9p5c8IH.mjs → context-DTrwaQtg.mjs} +2 -1
- package/dist/client/{dateFormatting-CF6FWCoo.mjs → dateFormatting-Cg8E1r9l.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-tZxIm3RL.mjs → demoPortalMagicLink-D0kOJYOX.mjs} +5 -4
- package/dist/client/{enhanceHeaderSection-DEYDI54E.mjs → enhanceHeaderSection-DyrpZ7ks.mjs} +4 -4
- package/dist/client/{event-registration.client-DWvSODTI.mjs → event-registration.client-RLZQWi2V.mjs} +121 -183
- package/dist/client/{eventCalendar-C9Pn9eeZ.mjs → eventCalendar-CphYnImh.mjs} +4 -4
- package/dist/client/{eventCombined-Bdhk0fp0.mjs → eventCombined-BvqjASB_.mjs} +4 -4
- package/dist/client/{eventListing-B-bJOQUk.mjs → eventListing-BaNAoC_M.mjs} +4 -4
- package/dist/client/{eventRegistration-CbdmUiDT.mjs → eventRegistration-COMHoRl6.mjs} +4 -4
- package/dist/client/events-9LPvwbWp.mjs +28 -0
- package/dist/client/{form-BbUUt784.mjs → form-DyH2juYT.mjs} +3 -3
- package/dist/client/{form.client-BVlz-9_t.mjs → form.client-DBwzkB0M.mjs} +5 -5
- package/dist/client/{form.parts-TB4UIrML.mjs → form.parts-CY4kX3mh.mjs} +3 -3
- package/dist/client/{formatDate-TDHhFjFN.mjs → formatDate-CTEN7gxW.mjs} +1 -1
- package/dist/client/gifting/client.mjs +7 -6
- package/dist/client/{gifting-CbNSrp7C.mjs → gifting-CIx4V378.mjs} +4 -4
- package/dist/client/{gifting.client-B__bGhFc.mjs → gifting.client-BEVPpzJM.mjs} +5 -5
- package/dist/client/{gifting.parts-CTA1sDW6.mjs → gifting.parts-VnORjnZK.mjs} +2 -2
- package/dist/client/{headerSection-5Wn9nUW_.mjs → headerSection-DGcJfRS8.mjs} +2 -2
- package/dist/client/{lookSurfaces-BwiNdgMU.mjs → lookSurfaces-IqT_SVnX.mjs} +167 -85
- package/dist/client/{newsletter-form.client-B17WYHxZ.mjs → newsletter-form.client-BvEDkjiD.mjs} +6 -6
- package/dist/client/{shop.interactive-CxDJ8P2r.mjs → newsletter-form.interactive-DCO1lErD.mjs} +3970 -3997
- package/dist/client/{newsletter-form.parts-DN9wD1ZG.mjs → newsletter-form.parts-BIy4IUT3.mjs} +2 -2
- package/dist/client/{newsletterForm-DLMlxInp.mjs → newsletterForm-CoTXDNFS.mjs} +3 -3
- package/dist/client/portal/client.mjs +346 -21
- package/dist/client/{product-detail.client-Di_anRGR.mjs → product-detail.client-YHQ2aKX1.mjs} +1 -1
- package/dist/client/{product-list.client-Duhl6rtL.mjs → product-list.client-DxoZw1vF.mjs} +1 -1
- package/dist/client/{productDetail-BgKmCwA8.mjs → productDetail-DjuFvkey.mjs} +3 -3
- package/dist/client/{productList-C_wMKsYS.mjs → productList-DE9GEFoZ.mjs} +3 -3
- package/dist/client/{propsDecoder-y3LvxaiG.mjs → propsDecoder-Cyag_HOs.mjs} +2 -48
- package/dist/client/{registry.server-CIWYKz1V.mjs → registry.server-BPwV-0Pp.mjs} +10426 -9114
- package/dist/client/rendering/client.mjs +41 -27
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +23 -2836
- package/dist/client/{richText-coerce-DkPBFb_a.mjs → richText-coerce-NrRqDeOg.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-BgO0rZce.mjs → routeIslandApiConfig-BWq5gKFK.mjs} +1 -1
- package/dist/client/runtimeResponse-D2j2-mOk.mjs +3 -0
- package/dist/client/{runtimeResponse-9v8q2NBc.mjs → runtimeResponse-DtWSfWSZ.mjs} +1 -1
- package/dist/client/{shop-CFbWlv_W.mjs → shop-C3wM0Hr4.mjs} +3 -3
- package/dist/client/{shop-commerce-C-I29eaA.mjs → shop-commerce-34YvcpbX.mjs} +14 -14
- package/dist/client/{shop-commerce-store-DGcc7twO.mjs → shop-commerce-store-B7xHksOs.mjs} +1 -1
- package/dist/client/{shop-discount-apply.state-DOm7vx0X.mjs → shop-discount-apply.state-BiBnozfO.mjs} +2 -2
- package/dist/client/{shop.client-GHTWUKD6.mjs → shop.client-C0v88nLd.mjs} +14 -14
- package/dist/client/{shopShared-Be9QJJpT.mjs → shopShared-Ct-BRNez.mjs} +2 -2
- package/dist/client/spam-protection.mjs +1 -1
- package/dist/client/{noop-CaQxI-Js.mjs → src-CCtanNlD.mjs} +462 -455
- package/dist/client/src-DqMbCjI1.mjs +3 -0
- package/dist/client/{src-xrjaKaCj.mjs → src-uwCpbHXG.mjs} +2 -1
- package/dist/client/{timetableModel--R0zVzZO.mjs → timetableModel-lhE29TNT.mjs} +66 -12
- package/dist/client/{types-DjWUR_O6.mjs → types-BEaKfam_.mjs} +65 -65
- package/dist/client/{useAvailableSlots-BGu_2F50.mjs → useAvailableSlots-BelJviOT.mjs} +2 -2
- package/dist/client/useDiscountCodeUi-rQRE1-Ho.mjs +196 -0
- package/dist/client/{useEventPagination-DxIJ--JZ.mjs → useEventPagination-C4rS2Xxl.mjs} +8 -8
- package/dist/client/{view-3foOzGWR.mjs → view-LJVHVqsy.mjs} +4 -4
- package/dist/client/{display-4HYOb-AK.mjs → wizardSteps-CNDsxeJH.mjs} +9168 -8981
- package/dist/preview-next/before-render.mjs +4 -3
- package/dist/preview-next/client/{PageSectionToolbar-D6-jojqh.mjs → PageSectionToolbar-C4TtBPN-.mjs} +3 -3
- package/dist/preview-next/client/{PreviewEditorSidebar-BUVFKZ4k.mjs → PreviewEditorSidebar-D6fkE59-.mjs} +15 -13
- package/dist/preview-next/client/{PreviewEditorUI-292pOiSt.mjs → PreviewEditorUI-amcDlj0O.mjs} +4 -4
- package/dist/preview-next/client/{PreviewShell-CW0Yzj3h.mjs → PreviewShell-DeQjx4zk.mjs} +5 -5
- package/dist/preview-next/client/{SdkPreviewModeRuntime-Dba7zoZK.mjs → SdkPreviewModeRuntime-Cx0SXnoX.mjs} +5 -5
- package/dist/preview-next/client/{previewAssistantSlot-B-utyhbS.mjs → previewAssistantSlot-aqpU34WI.mjs} +1764 -1090
- package/dist/preview-next/client/{previewChromeRoot-CCoGydUD.mjs → previewChromeRoot-D3Gy_Rs0.mjs} +1 -1
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-DCpXVcA0.mjs → sdk-runtime-Dzx_RrN7.mjs} +2 -2
- package/dist/preview-next/client/{siteStyleAccess-sjOvRAHY.mjs → siteStyleAccess-LHedw83e.mjs} +1 -1
- package/dist/preview-next/client/src-EO5QoRlU.mjs +3 -0
- package/dist/preview-next/client/{src-DzXUmsyK.mjs → src-lX6heoDA.mjs} +2 -1
- package/dist/preview-next/client/{useAutosaveStatus-R1rZ9-IZ.mjs → useAutosaveStatus-DpSd9aVk.mjs} +1 -1
- package/dist/preview-next/client/{useOpenBlockForSetup-BS7CANPv.mjs → useOpenBlockForSetup-BGZn5AT1.mjs} +1 -1
- package/dist/preview-next/keepAlive.mjs +1 -1
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-BSSbtz6A.mjs → route-contract-DnL-FgSV.mjs} +83 -11
- package/dist/server/{Block.shared-Dc3DX7Cf.mjs → Block.shared-BEbq6EwO.mjs} +5 -5
- package/dist/server/{bindings-VGgS6UvF.mjs → bindings-Bly0dRs7.mjs} +36 -5
- package/dist/server/{client-BPLLL22F.mjs → client-CGJ2ztYp.mjs} +1021 -1118
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/constants-Cj7hfbrA.mjs +41 -0
- package/dist/server/contentTypeResolver-B9vy8BrF.mjs +19 -0
- package/dist/server/data/dataLoaderContext.mjs +1 -1
- package/dist/server/data/resolveBlockData.mjs +1 -1
- package/dist/server/{dataLoaderContext-B3fXA54R.mjs → dataLoaderContext-lMRTfG5Z.mjs} +1 -0
- package/dist/server/error-f4g44bKx.mjs +387 -0
- package/dist/server/index.mjs +3 -2
- package/dist/server/loadContent-BkK1w3QQ.mjs +692 -0
- package/dist/server/{loadPage-CQgde5DN.mjs → loadPage-DTLe0FEs.mjs} +22 -4
- package/dist/server/{navigation-iC_hXjJI.mjs → navigation-BcNfYYuu.mjs} +1 -1
- package/dist/server/navigation.mjs +1 -1
- package/dist/server/next.mjs +103 -100
- package/dist/server/{overrideResolution-CkpwAHvW.mjs → overrideResolution-Uy9Zp2Ks.mjs} +1 -1
- package/dist/server/page-converter.mjs +1 -1
- package/dist/server/{pageRenderPlan-CfSnAkCO.mjs → pageRenderPlan-JzxBnqfV.mjs} +19 -7
- package/dist/server/{pageRuntimeSupport-uz4gzBOo.mjs → pageRuntimeSupport-DyNSd2Yj.mjs} +50 -2
- package/dist/server/{pageShared-6z6JBU41.mjs → pageShared-DU4ETFPS.mjs} +89 -83
- package/dist/server/portal-B4JVkdjc.mjs +783 -0
- package/dist/server/portal.mjs +3 -3
- package/dist/server/{prebuild-B4_Llisx.mjs → prebuild-8jNtDXmS.mjs} +5 -4
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-CCiYV8_s.mjs → prefetchBlockData-xeMG42aw.mjs} +3 -2
- package/dist/server/{registry-CXRXsFSx.mjs → registry-DH1VrsCl.mjs} +587 -329
- package/dist/server/rendering/components/pageShared.mjs +1 -1
- package/dist/server/rendering/helpers/loadPage.mjs +1 -1
- package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +1 -1
- package/dist/server/rendering/server.mjs +5 -4
- package/dist/server/rendering.mjs +9 -8
- package/dist/server/{resolveBlockData-yfe8WLEA.mjs → resolveBlockData-BN8tweTx.mjs} +24 -5
- package/dist/server/resolvePageContent-DnM16_f9.mjs +89 -0
- package/dist/server/routing.mjs +271 -57
- package/dist/server/server.mjs +3 -3
- package/dist/server/{loadContent-CxASA3PE.mjs → servicePageContent-B-FezJmH.mjs} +709 -453
- package/dist/server/{validation-BvHio6QI.mjs → validation-3jOzYdPL.mjs} +3 -3
- package/dist/server/{version-SuFlio6n.mjs → version-8t0o6_jd.mjs} +1 -1
- package/dist/styles/index.css +19 -0
- package/package.json +1 -1
- package/dist/_dts/footerPageOutline-DwMHeYmQ.d.ts +0 -256
- package/dist/_dts/resolvePageContent-DkzWvFbG.d.ts +0 -162
- package/dist/client/LocationMapActions-myIQIvQL.mjs +0 -62
- package/dist/client/MapDrawingSvg-BfsVyPvB.mjs +0 -200
- package/dist/client/course-CUFVJEAc.mjs +0 -237
- package/dist/client/duration-Q6_QNgiv.mjs +0 -37
- package/dist/client/event-details.client-BwjBJP-f.mjs +0 -53
- package/dist/client/eventDetails-C2LfNW_o.mjs +0 -13
- package/dist/client/runtimeResponse-CVkM0dHy.mjs +0 -3
- package/dist/client/src-BozhJ43Z.mjs +0 -3
- package/dist/client/useDiscountCodeUi-I_mXI9Yd.mjs +0 -237
- package/dist/client/view-BbzH5MQb.mjs +0 -1371
- package/dist/preview-next/client/src-LUhVXBEQ.mjs +0 -3
- package/dist/server/constants-hl17xz6x.mjs +0 -22
- package/dist/server/portal-BjVHMAUC.mjs +0 -371
- package/dist/server/resolvePageContent-CAELMBEJ.mjs +0 -438
|
@@ -1,1371 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { Jt as MediaNodeServer, Ut as CardListContentPart, Yt as EventQuickFacts, an as formatCoursePrice, cn as formatEventPriceAmount, ct as formatBookingSchedulePresentation, ln as formatEventPriceDisplay, on as formatEventDepositNote, sn as formatEventPrice, ut as closedRunCopy } from "./shop.interactive-CxDJ8P2r.mjs";
|
|
3
|
-
import { $r as eventVenuePlace, Bo as nextLiveRunSessionStartMs, Ho as resolveWholeSeriesBookingPhase, Qa as resolveEventRegistrationScopedEvents, Qo as EVENT_ADDRESS_AFTER_BOOKING_LABEL, Tr as ImagePresets, Vo as orderedLiveRunSessions, Zr as eventOnlinePlace, as as publicEventPricingDisplay, cs as resolveExactOrFreePriceDisplay, ei as formatEventLocation, fo as formatEventRemainingPlaces, gi as formatTime, go as getEventAvailabilityStatus, ho as getEventAvailability, ii as eventDateOptions, is as publicEventPricingCurrency, li as formatEventCompactDateRail, lo as isBookableEvent, mi as formatEventTimeRange, mo as formatTotalCapacity, pi as formatEventRunDates, rs as isPublicEventPricingOptionDisplayable, ss as publicEventPricingType, ts as formatBookingPriceDisplay, ui as formatEventDateParts, vo as isEventFull, zo as CANCELLED_SESSION_STATUS } from "./display-4HYOb-AK.mjs";
|
|
4
|
-
import { Kt as formatDate, Yt as formatDateTimeRange, an as compareLocalScheduleDates, cn as getLocalScheduleDate, dn as resolveBookingBusinessTimeZone, hn as toUtcIsoDateTimeString, nn as toScheduledBookingDateTime, pn as toBookingTimeZone, qt as formatDateRange, sn as getBookingLocalDateKey } from "./noop-CaQxI-Js.mjs";
|
|
5
|
-
import { T as assertNever } from "./creditProducts-BQ1t1erI.mjs";
|
|
6
|
-
import { t as formatEventDuration } from "./duration-Q6_QNgiv.mjs";
|
|
7
|
-
import { t as LocationMapActions } from "./LocationMapActions-myIQIvQL.mjs";
|
|
8
|
-
import { r as listLookSlot } from "./lookSurfaces-BwiNdgMU.mjs";
|
|
9
|
-
import { a as formatMoreDates, c as resolveEventLinkProps, i as formatCourseSessions, o as resolveEventCardBooking, t as eventDisplayTitle } from "./course-CUFVJEAc.mjs";
|
|
10
|
-
import { n as MapDrawingSvg } from "./MapDrawingSvg-BfsVyPvB.mjs";
|
|
11
|
-
import { t as EVENT_REGISTRATION_ANCHOR_ID } from "./constants-4o4_hl34.mjs";
|
|
12
|
-
import "react";
|
|
13
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
-
//#region ../blocks/src/system/blocks/events/shared/detailsSelection.ts
|
|
15
|
-
function isFutureOrNow(iso, nowIso) {
|
|
16
|
-
const ts = Date.parse(iso);
|
|
17
|
-
const now = Date.parse(nowIso);
|
|
18
|
-
if (!Number.isFinite(ts) || !Number.isFinite(now)) return false;
|
|
19
|
-
return ts >= now;
|
|
20
|
-
}
|
|
21
|
-
const localDateKey = (startsAt, timeZone) => getBookingLocalDateKey(toScheduledBookingDateTime({
|
|
22
|
-
startsAt,
|
|
23
|
-
timeZone
|
|
24
|
-
}));
|
|
25
|
-
function selectRequested(events, requested) {
|
|
26
|
-
if (!requested) return null;
|
|
27
|
-
const byId = events.find((event) => event.occurrenceId === requested.id || event.id === requested.id);
|
|
28
|
-
if (byId) return byId;
|
|
29
|
-
if (!requested.startsAt || !requested.timeZone) return null;
|
|
30
|
-
const requestedDate = localDateKey(requested.startsAt, requested.timeZone);
|
|
31
|
-
return events.find((event) => localDateKey(event.startsAt, event.timeZone) === requestedDate) ?? null;
|
|
32
|
-
}
|
|
33
|
-
function selectNextUpcoming(events, nowIso) {
|
|
34
|
-
return [...events].filter((event) => isFutureOrNow(event.startsAt, nowIso)).sort((left, right) => Date.parse(left.startsAt) - Date.parse(right.startsAt))[0] ?? null;
|
|
35
|
-
}
|
|
36
|
-
function selectCompletedWholeSeries(events) {
|
|
37
|
-
if (events.length === 0 || !events.every((event) => event.bookingScope === "whole_series")) return null;
|
|
38
|
-
return [...events].sort((left, right) => Date.parse(right.startsAt) - Date.parse(left.startsAt))[0] ?? null;
|
|
39
|
-
}
|
|
40
|
-
function selectEventDetailsCandidate(events, requested, nowIso) {
|
|
41
|
-
const selected = selectRequested(events, requested);
|
|
42
|
-
if (selected) return {
|
|
43
|
-
event: selected,
|
|
44
|
-
mode: "selected"
|
|
45
|
-
};
|
|
46
|
-
const upcoming = selectNextUpcoming(events, nowIso);
|
|
47
|
-
if (upcoming) return {
|
|
48
|
-
event: upcoming,
|
|
49
|
-
mode: "next"
|
|
50
|
-
};
|
|
51
|
-
const completed = selectCompletedWholeSeries(events);
|
|
52
|
-
return completed ? {
|
|
53
|
-
event: completed,
|
|
54
|
-
mode: "completed"
|
|
55
|
-
} : null;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Select the next occurrence-targeted events for a quick-book rail.
|
|
59
|
-
*
|
|
60
|
-
* The API normally returns valid timestamps, but malformed values sort after
|
|
61
|
-
* valid events so one bad record cannot displace an otherwise useful rail.
|
|
62
|
-
* Sorting before deduplication means a duplicate occurrence keeps its earliest
|
|
63
|
-
* deterministic representation.
|
|
64
|
-
*/
|
|
65
|
-
function selectQuickDateEvents(events) {
|
|
66
|
-
return orderedUniqueEventOccurrences(events.filter((event) => event.bookingScope !== "whole_series" && isBookableEvent(event))).slice(0, 4);
|
|
67
|
-
}
|
|
68
|
-
/** Shared ordering and identity selection, independent of booking capacity. */
|
|
69
|
-
function orderedUniqueEventOccurrences(events) {
|
|
70
|
-
const sorted = [...events].sort(compareQuickDateEvents);
|
|
71
|
-
return sorted.filter((event, index) => sorted.findIndex((candidate) => candidate.occurrenceId === event.occurrenceId) === index);
|
|
72
|
-
}
|
|
73
|
-
function formatEventQuickDate(event, style = "legacy") {
|
|
74
|
-
const options = eventDateOptions(event);
|
|
75
|
-
const dateRail = formatEventCompactDateRail(event.startsAt, options, style === "site" ? "as-written" : "capitals");
|
|
76
|
-
return {
|
|
77
|
-
dateTime: event.startsAt,
|
|
78
|
-
label: `${dateRail.weekday} ${dateRail.day} ${dateRail.month}, ${formatTime(event.startsAt, options)}`
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
function compareQuickDateEvents(left, right) {
|
|
82
|
-
const startsAtOrder = compareTimestamp(left.startsAt, right.startsAt);
|
|
83
|
-
return startsAtOrder === 0 ? left.occurrenceId.localeCompare(right.occurrenceId) : startsAtOrder;
|
|
84
|
-
}
|
|
85
|
-
function compareTimestamp(left, right) {
|
|
86
|
-
const leftTime = Date.parse(left);
|
|
87
|
-
const rightTime = Date.parse(right);
|
|
88
|
-
return (Number.isNaN(leftTime) ? Number.POSITIVE_INFINITY : leftTime) - (Number.isNaN(rightTime) ? Number.POSITIVE_INFINITY : rightTime);
|
|
89
|
-
}
|
|
90
|
-
//#endregion
|
|
91
|
-
//#region ../blocks/src/system/runtime/nodes/events/shared/DateTimeTile.tsx
|
|
92
|
-
/**
|
|
93
|
-
* Shared tile content for displaying date and time range.
|
|
94
|
-
* Used by event-details "Other dates".
|
|
95
|
-
*/
|
|
96
|
-
function DateTimeTile(props) {
|
|
97
|
-
const { date, timeRange } = formatEventDateParts(props);
|
|
98
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
99
|
-
className: "rb-flex rb-flex-col rb-gap-1",
|
|
100
|
-
children: [/* @__PURE__ */ jsx("strong", {
|
|
101
|
-
className: "rb-caption",
|
|
102
|
-
children: date
|
|
103
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
104
|
-
className: "rb-caption",
|
|
105
|
-
children: timeRange
|
|
106
|
-
})]
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
//#endregion
|
|
110
|
-
//#region ../blocks/src/system/blocks/offerings-preview/scheduleSummary.ts
|
|
111
|
-
function deriveEventScheduleSummary(event) {
|
|
112
|
-
const occurrence = occurrenceFromEvent(event);
|
|
113
|
-
return compareLocalScheduleDates(getLocalScheduleDate(new Date(occurrence.endsAt), resolveBookingBusinessTimeZone(occurrence.timeZone)), getLocalScheduleDate(new Date(occurrence.startsAt), resolveBookingBusinessTimeZone(occurrence.timeZone))) > 0 ? {
|
|
114
|
-
kind: "multi-day-span",
|
|
115
|
-
occurrence
|
|
116
|
-
} : {
|
|
117
|
-
kind: "single-occurrence",
|
|
118
|
-
occurrence
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
function derivePreviewRunSchedule(event) {
|
|
122
|
-
const sessions = orderedLiveRunSessions(event.run.sessions).filter(isValidOccurrence);
|
|
123
|
-
const first = sessions[0];
|
|
124
|
-
const last = sessions[sessions.length - 1];
|
|
125
|
-
if (!first || !last) return { kind: "no-live-sessions" };
|
|
126
|
-
const authoredSummary = formatBookingSchedulePresentation("representative" in event ? event.representative : event);
|
|
127
|
-
const summary = !authoredSummary && sessions.length === 1 ? deriveEventScheduleSummary(first) : {
|
|
128
|
-
kind: "scheduled-run",
|
|
129
|
-
first,
|
|
130
|
-
last,
|
|
131
|
-
sessionCount: sessions.length,
|
|
132
|
-
sessions,
|
|
133
|
-
authoredSummary
|
|
134
|
-
};
|
|
135
|
-
return {
|
|
136
|
-
kind: "scheduled",
|
|
137
|
-
firstSession: first,
|
|
138
|
-
sessionCount: sessions.length,
|
|
139
|
-
summary
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
function occurrenceFromEvent(event) {
|
|
143
|
-
return {
|
|
144
|
-
startsAt: event.startsAt,
|
|
145
|
-
endsAt: event.endsAt,
|
|
146
|
-
timeZone: event.timeZone
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
function isValidOccurrence(value) {
|
|
150
|
-
return Number.isFinite(Date.parse(value.startsAt)) && Number.isFinite(Date.parse(value.endsAt));
|
|
151
|
-
}
|
|
152
|
-
//#endregion
|
|
153
|
-
//#region ../blocks/src/system/runtime/nodes/events/shared/offeringNextDates.ts
|
|
154
|
-
/** A bounded display sample only: capacity and booking admission belong to the booking destination. */
|
|
155
|
-
function offeringDatesBySeries(events, now, booking) {
|
|
156
|
-
const groups = events.reduce((result, event) => new Map([...result, [event.seriesId, [...result.get(event.seriesId) ?? [], event]]]), /* @__PURE__ */ new Map());
|
|
157
|
-
return new Map([...groups].map(([seriesId, occurrences]) => [seriesId, orderedUniqueEventOccurrences(occurrences.filter((event) => event.bookingScope !== "whole_series" && Date.parse(event.startsAt) >= now.getTime())).slice(0, 3).map((event) => offeringDateRow(event, event, occurrencePlaces(event), booking))]));
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* A course's dates on a card: its first upcoming session, then how many more
|
|
161
|
-
* follow ("and 5 more"). One booking covers every session, so the places left
|
|
162
|
-
* belong to the course: the card says them once, from its own booking decision,
|
|
163
|
-
* never per date.
|
|
164
|
-
*/
|
|
165
|
-
function offeringRunDates(event, now) {
|
|
166
|
-
if (event.bookingScope !== "whole_series") return {
|
|
167
|
-
dates: [],
|
|
168
|
-
datesMore: null
|
|
169
|
-
};
|
|
170
|
-
const nextStart = nextLiveRunSessionStartMs(event.run.sessions, now);
|
|
171
|
-
const upcoming = nextStart === null ? [] : orderedLiveRunSessions(event.run.sessions).filter((session) => Date.parse(session.startsAt) >= nextStart);
|
|
172
|
-
const [first] = upcoming;
|
|
173
|
-
if (!first) return {
|
|
174
|
-
dates: [],
|
|
175
|
-
datesMore: null
|
|
176
|
-
};
|
|
177
|
-
return {
|
|
178
|
-
dates: [offeringDateRow(first, event, null)],
|
|
179
|
-
datesMore: formatMoreDates(upcoming.length - 1)
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
function offeringDateRow(session, event, places, booking) {
|
|
183
|
-
const options = eventDateOptions({
|
|
184
|
-
...event,
|
|
185
|
-
timeZone: session.timeZone
|
|
186
|
-
});
|
|
187
|
-
const date = formatEventCompactDateRail(session.startsAt, options, "as-written");
|
|
188
|
-
const label = `${date.weekday} ${date.day} ${date.month}, ${formatTime(session.startsAt, options)}`;
|
|
189
|
-
const bookingLink = booking?.(event, label) ?? null;
|
|
190
|
-
return {
|
|
191
|
-
startsAt: session.startsAt,
|
|
192
|
-
label,
|
|
193
|
-
...bookingLink ? { booking: bookingLink } : {},
|
|
194
|
-
places
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
/** A single occurrence's row is its own booking, so it reports that occurrence's capacity. */
|
|
198
|
-
function occurrencePlaces(event) {
|
|
199
|
-
const capacity = getEventAvailability(event);
|
|
200
|
-
const status = getEventAvailabilityStatus(event);
|
|
201
|
-
return capacity.available === null ? null : {
|
|
202
|
-
label: capacity.isFull ? "Sold out" : `${capacity.available} place${capacity.available === 1 ? "" : "s"} left`,
|
|
203
|
-
status: capacity.isFull ? "full" : status.status === "filling" ? "low" : "available"
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
//#endregion
|
|
207
|
-
//#region ../blocks/src/system/runtime/nodes/events/shared/eventCardListContent.ts
|
|
208
|
-
/** Live offering data only; editorial cards never acquire booking fields. */
|
|
209
|
-
function eventCardListContent(event, context, buttonText) {
|
|
210
|
-
const { content, external } = cardProjectionBase(event, buttonText, context);
|
|
211
|
-
switch (context.kind) {
|
|
212
|
-
case "event-details": return {
|
|
213
|
-
...content,
|
|
214
|
-
chips: offeringTypeChips(event),
|
|
215
|
-
leadDate: null,
|
|
216
|
-
newTabHint: false,
|
|
217
|
-
...offeringSchedule(event)
|
|
218
|
-
};
|
|
219
|
-
case "catalogue":
|
|
220
|
-
case "offering": return {
|
|
221
|
-
...content,
|
|
222
|
-
chips: offeringTypeChips(event, context.typeLabel),
|
|
223
|
-
leadDate: offeringLeadDate(event, context.nextStartMs),
|
|
224
|
-
newTabHint: external,
|
|
225
|
-
...offeringSchedule(event, context.now),
|
|
226
|
-
...event.bookingScope === "whole_series" ? offeringRunDates(event, context.now) : {}
|
|
227
|
-
};
|
|
228
|
-
default: return assertNever(context);
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
function cardProjectionBase(event, buttonText, context) {
|
|
232
|
-
const offering = context.kind !== "event-details";
|
|
233
|
-
const { cta, availability: places, closed } = cardBooking(event, buttonText, context);
|
|
234
|
-
const titleLink = resolveEventLinkProps(event);
|
|
235
|
-
const { title, runName } = eventDisplayTitle(event);
|
|
236
|
-
return {
|
|
237
|
-
external: cta.external,
|
|
238
|
-
content: {
|
|
239
|
-
id: event.occurrenceId || event.id,
|
|
240
|
-
title,
|
|
241
|
-
subtitle: runName,
|
|
242
|
-
...titleLink.href ? { titleLink } : {},
|
|
243
|
-
quickFacts: event.facts,
|
|
244
|
-
text: event.presentation?.summary ?? event.description,
|
|
245
|
-
media: event.presentation?.image,
|
|
246
|
-
facts: offeringFacts(event, places?.label, offering),
|
|
247
|
-
availability: places,
|
|
248
|
-
action: cardAction(cta),
|
|
249
|
-
bookingClosed: closed ? cta.label : null
|
|
250
|
-
}
|
|
251
|
-
};
|
|
252
|
-
}
|
|
253
|
-
/** Offering cards carry the render clock; an event's own details show its projected booking state. */
|
|
254
|
-
function cardBooking(event, buttonText, context) {
|
|
255
|
-
switch (context.kind) {
|
|
256
|
-
case "event-details": return resolveEventCardBooking(event, "occurrence", buttonText, { now: null });
|
|
257
|
-
case "catalogue":
|
|
258
|
-
case "offering": return resolveEventCardBooking(event, context.kind === "catalogue" ? "series" : "occurrence", event.destination.kind === "external" ? void 0 : buttonText, {
|
|
259
|
-
now: context.now,
|
|
260
|
-
count: context.count
|
|
261
|
-
});
|
|
262
|
-
default: return assertNever(context);
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
function offeringLeadDate(event, startMs) {
|
|
266
|
-
if (startMs === null || !Number.isFinite(startMs)) return null;
|
|
267
|
-
const startsAt = new Date(startMs).toISOString();
|
|
268
|
-
const timeZone = resolveBookingBusinessTimeZone(event.bookingScope === "whole_series" ? orderedLiveRunSessions(event.run.sessions).find((session) => Date.parse(session.startsAt) === startMs)?.timeZone ?? event.timeZone : event.timeZone);
|
|
269
|
-
return {
|
|
270
|
-
startsAt,
|
|
271
|
-
...formatEventCompactDateRail(startsAt, {
|
|
272
|
-
...eventDateOptions(event),
|
|
273
|
-
timeZone
|
|
274
|
-
}, "as-written")
|
|
275
|
-
};
|
|
276
|
-
}
|
|
277
|
-
function offeringSchedule(event, now) {
|
|
278
|
-
const run = event.bookingScope === "whole_series" ? derivePreviewRunSchedule(event) : null;
|
|
279
|
-
if (run?.kind === "no-live-sessions") return {
|
|
280
|
-
numeral: null,
|
|
281
|
-
schedule: null
|
|
282
|
-
};
|
|
283
|
-
const summary = run?.kind === "scheduled" ? run.summary : deriveEventScheduleSummary(event);
|
|
284
|
-
return {
|
|
285
|
-
numeral: run?.kind === "scheduled" ? {
|
|
286
|
-
value: run.sessionCount,
|
|
287
|
-
label: run.sessionCount === 1 ? "session" : "sessions"
|
|
288
|
-
} : null,
|
|
289
|
-
schedule: scheduleLine(summary, event, now)
|
|
290
|
-
};
|
|
291
|
-
}
|
|
292
|
-
function scheduleLine(summary, event, now) {
|
|
293
|
-
const first = "occurrence" in summary ? summary.occurrence : summary.first;
|
|
294
|
-
const last = "occurrence" in summary ? summary.occurrence : summary.last;
|
|
295
|
-
const context = eventDateOptions({
|
|
296
|
-
...event,
|
|
297
|
-
timeZone: first.timeZone
|
|
298
|
-
});
|
|
299
|
-
const zone = context.zone;
|
|
300
|
-
const endpoint = (value) => ({
|
|
301
|
-
kind: "instant",
|
|
302
|
-
value: toUtcIsoDateTimeString(value)
|
|
303
|
-
});
|
|
304
|
-
const year = (value, timeZone = context.timeZone) => now && getLocalScheduleDate(new Date(value), timeZone).year === getLocalScheduleDate(now, timeZone).year ? "omit" : "numeric";
|
|
305
|
-
const date = (value) => formatDate(endpoint(value), context, {
|
|
306
|
-
date: "short",
|
|
307
|
-
year: now ? year(value) : "omit"
|
|
308
|
-
});
|
|
309
|
-
const dates = (startsAt, endsAt, order = "chronological") => formatDateRange({
|
|
310
|
-
kind: "civil",
|
|
311
|
-
value: getLocalScheduleDate(new Date(startsAt), context.timeZone)
|
|
312
|
-
}, {
|
|
313
|
-
kind: "civil",
|
|
314
|
-
value: getLocalScheduleDate(new Date(endsAt), resolveBookingBusinessTimeZone(last.timeZone))
|
|
315
|
-
}, context, {
|
|
316
|
-
date: "short",
|
|
317
|
-
order,
|
|
318
|
-
year: now && year(startsAt) === "omit" && year(endsAt, resolveBookingBusinessTimeZone(last.timeZone)) === "omit" ? "omit" : now ? "numeric" : "omit"
|
|
319
|
-
});
|
|
320
|
-
switch (summary.kind) {
|
|
321
|
-
case "single-occurrence": return now ? formatDateTimeRange({
|
|
322
|
-
start: endpoint(summary.occurrence.startsAt).value,
|
|
323
|
-
end: endpoint(summary.occurrence.endsAt).value
|
|
324
|
-
}, context, {
|
|
325
|
-
date: "short",
|
|
326
|
-
weekday: "short",
|
|
327
|
-
year: year(summary.occurrence.startsAt),
|
|
328
|
-
zone
|
|
329
|
-
}) : date(summary.occurrence.startsAt);
|
|
330
|
-
case "multi-day-span": return dates(summary.occurrence.startsAt, summary.occurrence.endsAt);
|
|
331
|
-
case "scheduled-run": {
|
|
332
|
-
const range = dates(summary.first.startsAt, summary.last.startsAt, "session");
|
|
333
|
-
if (summary.authoredSummary) return `${range} · ${summary.authoredSummary.text}`;
|
|
334
|
-
const clock = regularSessionClock(summary.sessions, event);
|
|
335
|
-
return clock ? `${summary.sessionCount} ${clock.weekday}s, ${range}, ${clock.time}` : `${range} · ${summary.sessionCount} dates · Times vary`;
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
/**
|
|
340
|
-
* A course's facts are said for the whole course ("6 weekly sessions, 1 hour
|
|
341
|
-
* each", "£72 for the course"), so one session's length never sits beside
|
|
342
|
-
* the price of all of them.
|
|
343
|
-
*/
|
|
344
|
-
function offeringFacts(event, places, offering) {
|
|
345
|
-
const course = event.bookingScope === "whole_series";
|
|
346
|
-
const sessions = formatCourseSessions(event);
|
|
347
|
-
return [
|
|
348
|
-
...sessions ? [{
|
|
349
|
-
label: "Length",
|
|
350
|
-
value: sessions
|
|
351
|
-
}] : lengthFact(event, !offering || course),
|
|
352
|
-
...offering ? placeFact(event) : [],
|
|
353
|
-
...places ? [{
|
|
354
|
-
label: "Places",
|
|
355
|
-
value: places,
|
|
356
|
-
kind: "availability"
|
|
357
|
-
}] : [],
|
|
358
|
-
...offering && event.pricing.kind === "external" ? [] : [{
|
|
359
|
-
label: "Price",
|
|
360
|
-
value: course ? formatCoursePrice(event.pricing) : formatEventPriceDisplay(event.pricing)
|
|
361
|
-
}]
|
|
362
|
-
];
|
|
363
|
-
}
|
|
364
|
-
/** An online event, or one whose address follows the booking, says so where a venue would go. */
|
|
365
|
-
function placeFact(event) {
|
|
366
|
-
return event.venue || event.addressAfterBooking || event.deliveryMode !== "in_person" ? [{
|
|
367
|
-
label: "Venue",
|
|
368
|
-
value: formatEventLocation(event)
|
|
369
|
-
}] : [];
|
|
370
|
-
}
|
|
371
|
-
function lengthFact(event, shown) {
|
|
372
|
-
const minutes = Math.round((Date.parse(event.endsAt) - Date.parse(event.startsAt)) / 6e4);
|
|
373
|
-
return shown && minutes > 0 ? [{
|
|
374
|
-
label: "Length",
|
|
375
|
-
value: formatEventDuration(event, "readable")
|
|
376
|
-
}] : [];
|
|
377
|
-
}
|
|
378
|
-
function offeringTypeChips(event, typeLabel) {
|
|
379
|
-
return event.eventCategory ? [event.eventCategory.name] : typeLabel ? [typeLabel] : [];
|
|
380
|
-
}
|
|
381
|
-
function cardAction(cta) {
|
|
382
|
-
return cta.hidden ? { label: cta.label } : {
|
|
383
|
-
label: cta.label,
|
|
384
|
-
href: cta.href,
|
|
385
|
-
external: cta.external
|
|
386
|
-
};
|
|
387
|
-
}
|
|
388
|
-
/** Compare each session in its own local zone, so regular clocks survive DST changes. Null when sessions differ. */
|
|
389
|
-
function regularSessionClock(sessions, event) {
|
|
390
|
-
const clocks = sessions.map((session) => {
|
|
391
|
-
const context = {
|
|
392
|
-
...eventDateOptions({
|
|
393
|
-
...event,
|
|
394
|
-
timeZone: session.timeZone
|
|
395
|
-
}),
|
|
396
|
-
zone: "omit"
|
|
397
|
-
};
|
|
398
|
-
return {
|
|
399
|
-
weekday: formatDate({
|
|
400
|
-
kind: "instant",
|
|
401
|
-
value: toUtcIsoDateTimeString(session.startsAt)
|
|
402
|
-
}, context, {
|
|
403
|
-
date: "omit",
|
|
404
|
-
weekday: "long",
|
|
405
|
-
year: "omit"
|
|
406
|
-
}),
|
|
407
|
-
time: formatEventTimeRange(session, context)
|
|
408
|
-
};
|
|
409
|
-
});
|
|
410
|
-
const first = clocks[0];
|
|
411
|
-
return first && clocks.every((clock) => clock.weekday === first.weekday && clock.time === first.time) ? first : null;
|
|
412
|
-
}
|
|
413
|
-
//#endregion
|
|
414
|
-
//#region ../blocks/src/system/runtime/nodes/event-details/headerContent.ts
|
|
415
|
-
/** Project selected live data; booking decisions stay with the existing event owners. */
|
|
416
|
-
function eventHeaderContent(selection, show) {
|
|
417
|
-
const event = selection.selected;
|
|
418
|
-
const item = eventCardListContent(event, { kind: "event-details" });
|
|
419
|
-
const groupSize = show.capacity ? formatTotalCapacity(event.capacity) : null;
|
|
420
|
-
const { timeRange } = formatEventDateParts({
|
|
421
|
-
startsAt: event.startsAt,
|
|
422
|
-
endsAt: event.endsAt,
|
|
423
|
-
...eventDateOptions(event)
|
|
424
|
-
});
|
|
425
|
-
return {
|
|
426
|
-
...item,
|
|
427
|
-
titleLink: void 0,
|
|
428
|
-
facts: [
|
|
429
|
-
headerDateFact(selection),
|
|
430
|
-
{
|
|
431
|
-
label: "Time",
|
|
432
|
-
value: timeRange
|
|
433
|
-
},
|
|
434
|
-
...show.cost ? (item.facts ?? []).filter(({ label }) => label === "Price").map((fact) => withDepositNote(fact, event)) : [],
|
|
435
|
-
...groupSize === null ? [] : [{
|
|
436
|
-
label: "Group size",
|
|
437
|
-
value: groupSize
|
|
438
|
-
}]
|
|
439
|
-
],
|
|
440
|
-
action: headerAction(selection, item.action)
|
|
441
|
-
};
|
|
442
|
-
}
|
|
443
|
-
/** The page states a deposit option beside the price, so it isn't first seen at checkout. */
|
|
444
|
-
function withDepositNote(fact, event) {
|
|
445
|
-
const note = formatEventDepositNote(event.pricing, event.paymentTerms, event);
|
|
446
|
-
return note ? {
|
|
447
|
-
...fact,
|
|
448
|
-
value: `${fact.value}, ${note}`
|
|
449
|
-
} : fact;
|
|
450
|
-
}
|
|
451
|
-
/** A course run is described by its whole span, not by whichever session was selected. */
|
|
452
|
-
function headerDateFact(selection) {
|
|
453
|
-
const event = selection.selected;
|
|
454
|
-
if (selection.kind === "wholeSeries") {
|
|
455
|
-
const sessions = orderedLiveRunSessions(selection.sessions);
|
|
456
|
-
const first = sessions[0];
|
|
457
|
-
const last = sessions.at(-1);
|
|
458
|
-
if (first && last && first !== last) return {
|
|
459
|
-
label: "Dates",
|
|
460
|
-
value: formatEventRunDates(first, last, eventDateOptions({
|
|
461
|
-
...event,
|
|
462
|
-
timeZone: first.timeZone
|
|
463
|
-
}))
|
|
464
|
-
};
|
|
465
|
-
}
|
|
466
|
-
const { date } = formatEventDateParts({
|
|
467
|
-
startsAt: event.startsAt,
|
|
468
|
-
endsAt: event.endsAt,
|
|
469
|
-
...eventDateOptions(event)
|
|
470
|
-
});
|
|
471
|
-
return {
|
|
472
|
-
label: selection.mode === "next" ? "Next date" : "Date",
|
|
473
|
-
value: date
|
|
474
|
-
};
|
|
475
|
-
}
|
|
476
|
-
/** A closed run says why here, at the top of the page, so the panel below doesn't repeat it. */
|
|
477
|
-
function headerAction(selection, action) {
|
|
478
|
-
if (action.external) return action;
|
|
479
|
-
if (!selection.selected.requiresRegistration) return { label: "No registration required — just show up" };
|
|
480
|
-
if (selection.kind === "wholeSeries" && selection.bookingPhase.kind === "closed") return { label: closedRunCopy(selection.bookingPhase.reason).titleText };
|
|
481
|
-
if (!action.href) return action;
|
|
482
|
-
return {
|
|
483
|
-
...action,
|
|
484
|
-
href: `${action.href.split("#")[0] ?? ""}#${EVENT_REGISTRATION_ANCHOR_ID}`
|
|
485
|
-
};
|
|
486
|
-
}
|
|
487
|
-
//#endregion
|
|
488
|
-
//#region ../blocks/src/system/runtime/nodes/event-details/EventHeader.tsx
|
|
489
|
-
function EventHeader({ selection, presentation, showCost, showCapacity }) {
|
|
490
|
-
const item = eventHeaderContent(selection, {
|
|
491
|
-
cost: showCost,
|
|
492
|
-
capacity: showCapacity
|
|
493
|
-
});
|
|
494
|
-
const part = (name) => /* @__PURE__ */ jsx(CardListContentPart, {
|
|
495
|
-
part: name,
|
|
496
|
-
item,
|
|
497
|
-
presentation
|
|
498
|
-
});
|
|
499
|
-
return /* @__PURE__ */ jsxs("header", {
|
|
500
|
-
...listLookSlot(presentation, "frame"),
|
|
501
|
-
children: [
|
|
502
|
-
item.media ? /* @__PURE__ */ jsx("figure", {
|
|
503
|
-
...listLookSlot(presentation, "item-media"),
|
|
504
|
-
children: /* @__PURE__ */ jsx(MediaNodeServer, {
|
|
505
|
-
value: item.media,
|
|
506
|
-
size: ImagePresets.full,
|
|
507
|
-
loading: "eager",
|
|
508
|
-
fetchPriority: "high",
|
|
509
|
-
...listLookSlot(presentation, "photo")
|
|
510
|
-
})
|
|
511
|
-
}) : null,
|
|
512
|
-
/* @__PURE__ */ jsxs("div", {
|
|
513
|
-
...listLookSlot(presentation, "copy"),
|
|
514
|
-
children: [
|
|
515
|
-
part("chips"),
|
|
516
|
-
/* @__PURE__ */ jsx("h1", {
|
|
517
|
-
...listLookSlot(presentation, "headline"),
|
|
518
|
-
children: item.title
|
|
519
|
-
}),
|
|
520
|
-
/* @__PURE__ */ jsx(EventQuickFacts, { facts: presentation.quickFacts }),
|
|
521
|
-
item.text ? /* @__PURE__ */ jsx("p", {
|
|
522
|
-
...listLookSlot(presentation, "lede"),
|
|
523
|
-
children: item.text
|
|
524
|
-
}) : null,
|
|
525
|
-
/* @__PURE__ */ jsx("div", {
|
|
526
|
-
"aria-label": "At a glance",
|
|
527
|
-
children: part("facts")
|
|
528
|
-
}),
|
|
529
|
-
part("availability"),
|
|
530
|
-
part("action")
|
|
531
|
-
]
|
|
532
|
-
}),
|
|
533
|
-
part("numeral")
|
|
534
|
-
]
|
|
535
|
-
});
|
|
536
|
-
}
|
|
537
|
-
const eventHeaderSlotParents = {
|
|
538
|
-
frame: null,
|
|
539
|
-
copy: "frame",
|
|
540
|
-
availability: "copy",
|
|
541
|
-
"item-media": "frame"
|
|
542
|
-
};
|
|
543
|
-
//#endregion
|
|
544
|
-
//#region ../blocks/src/system/customize/lookParts.ts
|
|
545
|
-
const lookParts = {
|
|
546
|
-
"block.hero": [{
|
|
547
|
-
part: "more photos",
|
|
548
|
-
fields: ["morePhotos"],
|
|
549
|
-
shownIn: ["photo-trio"]
|
|
550
|
-
}],
|
|
551
|
-
"block.cta-full": [{
|
|
552
|
-
part: "figure",
|
|
553
|
-
fields: ["figure", "figureNote"],
|
|
554
|
-
shownIn: ["figure"]
|
|
555
|
-
}],
|
|
556
|
-
"block.location-map": [{
|
|
557
|
-
part: "entrance photo",
|
|
558
|
-
fields: ["entrancePhoto"],
|
|
559
|
-
shownIn: ["photo-and-details"]
|
|
560
|
-
}],
|
|
561
|
-
"block.feature-cards": [{
|
|
562
|
-
part: "eyebrow",
|
|
563
|
-
fields: ["eyebrow"],
|
|
564
|
-
shownIn: [
|
|
565
|
-
"lead-support",
|
|
566
|
-
"index",
|
|
567
|
-
"sequence",
|
|
568
|
-
"slides",
|
|
569
|
-
"track"
|
|
570
|
-
]
|
|
571
|
-
}],
|
|
572
|
-
"block.event-details": [{
|
|
573
|
-
part: "title",
|
|
574
|
-
fields: ["showTitle"],
|
|
575
|
-
shownIn: ["details-panel"]
|
|
576
|
-
}, {
|
|
577
|
-
part: "description",
|
|
578
|
-
fields: ["showDescription"],
|
|
579
|
-
shownIn: ["details-panel"]
|
|
580
|
-
}]
|
|
581
|
-
};
|
|
582
|
-
/** Fields the arrangement leaves out. Nothing on an older style, where no arrangement Look shows the block. */
|
|
583
|
-
function fieldsNotShownIn(blockKind, arrangement) {
|
|
584
|
-
if (arrangement === null) return [];
|
|
585
|
-
return (lookParts[blockKind] ?? []).flatMap((part) => part.shownIn.includes(arrangement) ? [] : part.fields);
|
|
586
|
-
}
|
|
587
|
-
function lookPartShown(blockKind, field, arrangement) {
|
|
588
|
-
return !fieldsNotShownIn(blockKind, arrangement).includes(field);
|
|
589
|
-
}
|
|
590
|
-
//#endregion
|
|
591
|
-
//#region ../blocks/src/system/runtime/nodes/events/shared/eventProductEligibility.ts
|
|
592
|
-
function isCategoryEligible(eligibleCategoryIds, eventCategoryId) {
|
|
593
|
-
const categories = eligibleCategoryIds ?? [];
|
|
594
|
-
if (categories.length === 0) return true;
|
|
595
|
-
if (!eventCategoryId) return false;
|
|
596
|
-
return categories.includes(eventCategoryId);
|
|
597
|
-
}
|
|
598
|
-
function passCoversEvent(args, event) {
|
|
599
|
-
if (!event.acceptsPasses) return false;
|
|
600
|
-
return isCategoryEligible(args.eligibleCategoryIds, event.eventCategoryId);
|
|
601
|
-
}
|
|
602
|
-
function membershipCoversEvent(args, event) {
|
|
603
|
-
if (!event.acceptsMemberships) return false;
|
|
604
|
-
return isCategoryEligible(args.eligibleCategoryIds, event.eventCategoryId);
|
|
605
|
-
}
|
|
606
|
-
/**
|
|
607
|
-
* Whether a pass or membership could get someone into this event at all. Nobody
|
|
608
|
-
* books an event that takes no bookings, and a free one has nothing to pay. A
|
|
609
|
-
* tiered event whose tickets are all free isn't `free`: the dashboard treats it
|
|
610
|
-
* as priced, and the server refuses to spend anything on a free ticket.
|
|
611
|
-
*/
|
|
612
|
-
function eventCanUseProducts(event) {
|
|
613
|
-
return event.requiresRegistration !== false && event.pricing.kind !== "free";
|
|
614
|
-
}
|
|
615
|
-
/**
|
|
616
|
-
* Filter site passes to only those that cover the selected event.
|
|
617
|
-
*
|
|
618
|
-
* Public purchasable products are a pre-auth proxy for whether the pass path is
|
|
619
|
-
* worth advertising; owned pass eligibility is checked later after portal auth.
|
|
620
|
-
*/
|
|
621
|
-
function filterPassesForEvent(sitePasses, event) {
|
|
622
|
-
if (!sitePasses || !event || !eventCanUseProducts(event)) return [];
|
|
623
|
-
const eventCategoryId = event.eventCategory?.id ?? null;
|
|
624
|
-
return sitePasses.filter((pass) => pass.productUseCase === "event_pass" && passCoversEvent({ eligibleCategoryIds: pass.eligibleCategoryIds }, {
|
|
625
|
-
acceptsPasses: event.acceptsPasses,
|
|
626
|
-
eventCategoryId
|
|
627
|
-
}));
|
|
628
|
-
}
|
|
629
|
-
/**
|
|
630
|
-
* Filter site memberships to only those that cover the selected event.
|
|
631
|
-
*
|
|
632
|
-
* Public purchasable products are a pre-auth proxy for whether the membership
|
|
633
|
-
* path is worth advertising; owned membership eligibility is checked later
|
|
634
|
-
* after portal auth.
|
|
635
|
-
*/
|
|
636
|
-
function filterMembershipsForEvent(siteMemberships, event) {
|
|
637
|
-
if (!siteMemberships || !event || !eventCanUseProducts(event)) return [];
|
|
638
|
-
const eventCategoryId = event.eventCategory?.id ?? null;
|
|
639
|
-
return siteMemberships.filter((membership) => membershipCoversEvent({ eligibleCategoryIds: membership.eligibleCategoryIds }, {
|
|
640
|
-
acceptsMemberships: event.acceptsMemberships,
|
|
641
|
-
eventCategoryId
|
|
642
|
-
}));
|
|
643
|
-
}
|
|
644
|
-
//#endregion
|
|
645
|
-
//#region ../blocks/src/system/runtime/nodes/event-details/logic.ts
|
|
646
|
-
function emptySelection(timeZone) {
|
|
647
|
-
return {
|
|
648
|
-
kind: "empty",
|
|
649
|
-
mode: "next",
|
|
650
|
-
selected: null,
|
|
651
|
-
otherDates: [],
|
|
652
|
-
timeZone
|
|
653
|
-
};
|
|
654
|
-
}
|
|
655
|
-
function parseLimit(value, fallback) {
|
|
656
|
-
if (value === "all") return Number.MAX_SAFE_INTEGER;
|
|
657
|
-
const n = typeof value === "string" ? parseInt(value, 10) : typeof value === "number" ? value : NaN;
|
|
658
|
-
return Number.isFinite(n) && n > 0 ? n : fallback;
|
|
659
|
-
}
|
|
660
|
-
function uniqByOccurrenceId(events) {
|
|
661
|
-
const seen = /* @__PURE__ */ new Set();
|
|
662
|
-
const out = [];
|
|
663
|
-
for (const e of events) {
|
|
664
|
-
const key = e.occurrenceId || e.id;
|
|
665
|
-
if (!key || seen.has(key)) continue;
|
|
666
|
-
seen.add(key);
|
|
667
|
-
out.push(e);
|
|
668
|
-
}
|
|
669
|
-
return out;
|
|
670
|
-
}
|
|
671
|
-
function isWholeSeriesEvent(event) {
|
|
672
|
-
return event.bookingScope === "whole_series";
|
|
673
|
-
}
|
|
674
|
-
function isOrdinaryEvent(event) {
|
|
675
|
-
return event.bookingScope === "single_occurrence";
|
|
676
|
-
}
|
|
677
|
-
/**
|
|
678
|
-
* Where the run has got to, as the page should say it.
|
|
679
|
-
*
|
|
680
|
-
* `run.lifecycle` is the canonical answer and it is projected server-side. The
|
|
681
|
-
* one thing a cached page can outlive is the start of the first session, and
|
|
682
|
-
* the shared booking phase is what notices that, so an otherwise-upcoming run
|
|
683
|
-
* that has begun is reported as under way. Nothing else is re-derived: reading
|
|
684
|
-
* the state off the occurrence dates instead is how this block came to
|
|
685
|
-
* contradict the run it was describing.
|
|
686
|
-
*/
|
|
687
|
-
function renderedRunLifecycle(run, bookingPhase) {
|
|
688
|
-
return run.lifecycle === "upcoming" && bookingPhase.kind === "closed" && bookingPhase.reason === "in-progress" ? "in_progress" : run.lifecycle;
|
|
689
|
-
}
|
|
690
|
-
function selectRelatedDates(input) {
|
|
691
|
-
if (!input.seriesId) return [];
|
|
692
|
-
const isWholeSeries = input.selected?.bookingScope === "whole_series";
|
|
693
|
-
const selectedOccurrenceId = input.selected ? input.selected.occurrenceId || input.selected.id : null;
|
|
694
|
-
const dates = input.events.filter((event) => event.seriesId === input.seriesId).filter((event) => isWholeSeries || isFutureOrNow(event.startsAt, input.nowIso)).filter((event) => !selectedOccurrenceId || (event.occurrenceId || event.id) !== selectedOccurrenceId).sort((left, right) => Date.parse(left.startsAt) - Date.parse(right.startsAt));
|
|
695
|
-
return isWholeSeries ? dates : dates.slice(0, input.limit);
|
|
696
|
-
}
|
|
697
|
-
function selectEventDetails(args) {
|
|
698
|
-
const all = uniqByOccurrenceId(resolveEventRegistrationScopedEvents((args.events ?? []).filter(Boolean), {
|
|
699
|
-
occurrenceContext: args.occurrenceContext,
|
|
700
|
-
subject: args.subject
|
|
701
|
-
}));
|
|
702
|
-
const occurrenceContext = args.occurrenceContext ?? null;
|
|
703
|
-
const otherLimit = parseLimit(args.otherDatesLimit, 5);
|
|
704
|
-
const candidate = selectEventDetailsCandidate(all, occurrenceContext, args.nowIso);
|
|
705
|
-
const timeZone = toBookingTimeZone(candidate?.event.timeZone ?? all[0]?.timeZone ?? null);
|
|
706
|
-
if (!candidate) return emptySelection(timeZone);
|
|
707
|
-
const { event: selected, mode } = candidate;
|
|
708
|
-
const otherDates = selectRelatedDates({
|
|
709
|
-
events: all,
|
|
710
|
-
seriesId: occurrenceContext?.seriesId ?? selected?.seriesId ?? all[0]?.seriesId ?? null,
|
|
711
|
-
selected,
|
|
712
|
-
nowIso: args.nowIso,
|
|
713
|
-
limit: otherLimit
|
|
714
|
-
});
|
|
715
|
-
if (isWholeSeriesEvent(selected)) {
|
|
716
|
-
const run = selected.run;
|
|
717
|
-
const bookingPhase = resolveWholeSeriesBookingPhase(run, new Date(args.nowIso));
|
|
718
|
-
return {
|
|
719
|
-
kind: "wholeSeries",
|
|
720
|
-
lifecycle: renderedRunLifecycle(run, bookingPhase),
|
|
721
|
-
bookingPhase,
|
|
722
|
-
mode,
|
|
723
|
-
selected,
|
|
724
|
-
run,
|
|
725
|
-
sessions: run.sessions,
|
|
726
|
-
timeZone
|
|
727
|
-
};
|
|
728
|
-
}
|
|
729
|
-
if (!isOrdinaryEvent(selected)) return emptySelection(timeZone);
|
|
730
|
-
return {
|
|
731
|
-
kind: "ordinary",
|
|
732
|
-
mode: mode === "selected" ? "selected" : "next",
|
|
733
|
-
selected,
|
|
734
|
-
otherDates: otherDates.filter(isOrdinaryEvent),
|
|
735
|
-
timeZone
|
|
736
|
-
};
|
|
737
|
-
}
|
|
738
|
-
//#endregion
|
|
739
|
-
//#region ../blocks/src/system/runtime/nodes/event-details/presentation.ts
|
|
740
|
-
function resolveSelection(input) {
|
|
741
|
-
return selectEventDetails({
|
|
742
|
-
events: input.events ?? null,
|
|
743
|
-
occurrenceContext: input.occurrenceContext ?? null,
|
|
744
|
-
subject: input.subject,
|
|
745
|
-
nowIso: input.now,
|
|
746
|
-
otherDatesLimit: input.otherDatesLimit
|
|
747
|
-
});
|
|
748
|
-
}
|
|
749
|
-
function resolveDisplaySettings(input) {
|
|
750
|
-
return {
|
|
751
|
-
showVenue: input.showVenue ?? true,
|
|
752
|
-
showMap: input.showMap ?? true,
|
|
753
|
-
showOtherDates: input.showOtherDates ?? true,
|
|
754
|
-
showCost: input.showCost ?? true,
|
|
755
|
-
showTitle: input.showTitle ?? false,
|
|
756
|
-
showDescription: input.showDescription ?? false,
|
|
757
|
-
showCapacity: input.showCapacity ?? false,
|
|
758
|
-
showAcceptedPasses: input.showAcceptedPasses ?? true,
|
|
759
|
-
showAcceptedMemberships: input.showAcceptedMemberships ?? true
|
|
760
|
-
};
|
|
761
|
-
}
|
|
762
|
-
function resolveEligibility(input, selected) {
|
|
763
|
-
return {
|
|
764
|
-
applicablePasses: filterPassesForEvent(input.sitePasses?.passes ?? null, selected),
|
|
765
|
-
applicableMemberships: filterMembershipsForEvent(input.siteMemberships?.memberships ?? null, selected)
|
|
766
|
-
};
|
|
767
|
-
}
|
|
768
|
-
/** The response's one drawing belongs to the selected event only when it is for that event's venue. */
|
|
769
|
-
function resolveSelectedVenueDrawing(venueDrawing, selected) {
|
|
770
|
-
return venueDrawing && selected?.venue?.id === venueDrawing.venueId ? venueDrawing.drawing : null;
|
|
771
|
-
}
|
|
772
|
-
function resolveEventDetailsPresentation(input) {
|
|
773
|
-
const selection = resolveSelection(input);
|
|
774
|
-
const selected = selection.kind === "empty" ? null : selection.selected;
|
|
775
|
-
return {
|
|
776
|
-
selection,
|
|
777
|
-
arrangement: input.arrangement,
|
|
778
|
-
quickFacts: input.quickFacts,
|
|
779
|
-
entryTitle: input.entryTitle,
|
|
780
|
-
actionSize: input.actionSize,
|
|
781
|
-
lookSlots: input.lookSlots,
|
|
782
|
-
surfacePresentation: input.surfacePresentation,
|
|
783
|
-
panelHeading: input.panelHeading,
|
|
784
|
-
...resolveDisplaySettings(input),
|
|
785
|
-
...resolveEligibility(input, selected),
|
|
786
|
-
autoApplyDiscount: input.autoApplyDiscount ?? null,
|
|
787
|
-
selectedVenueDrawing: resolveSelectedVenueDrawing(input.venueDrawing, selected)
|
|
788
|
-
};
|
|
789
|
-
}
|
|
790
|
-
//#endregion
|
|
791
|
-
//#region ../blocks/src/system/runtime/nodes/event-details/WholeSeriesPricingDisplay.tsx
|
|
792
|
-
/** A course lists every active option, whether or not its sale window is open. */
|
|
793
|
-
function wholeSeriesPriceOptions(pricing) {
|
|
794
|
-
return pricing.kind === "tiered" ? pricing.options.filter((option) => option.isActive) : [];
|
|
795
|
-
}
|
|
796
|
-
/** The price, with any deposit option said beside it. */
|
|
797
|
-
function PriceLine({ price, depositNote }) {
|
|
798
|
-
return /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("strong", { children: price }), depositNote ? `, ${depositNote}` : null] });
|
|
799
|
-
}
|
|
800
|
-
function WholeSeriesPricingDisplay({ pricing, depositNote, acceptedItems }) {
|
|
801
|
-
const options = wholeSeriesPriceOptions(pricing);
|
|
802
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
803
|
-
className: "rb-mt-6",
|
|
804
|
-
children: [
|
|
805
|
-
/* @__PURE__ */ jsx("div", {
|
|
806
|
-
className: "rb-label rb-mb-2",
|
|
807
|
-
children: options.length > 1 ? "Pricing" : "Cost"
|
|
808
|
-
}),
|
|
809
|
-
options.length > 1 ? /* @__PURE__ */ jsx("div", {
|
|
810
|
-
className: "rb-flex rb-flex-col rb-gap-2",
|
|
811
|
-
children: options.map((option) => /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs("strong", { children: [
|
|
812
|
-
option.name,
|
|
813
|
-
":",
|
|
814
|
-
" ",
|
|
815
|
-
formatEventPriceAmount(option.priceAmount, pricing.currency)
|
|
816
|
-
] }), option.description ? /* @__PURE__ */ jsx("p", {
|
|
817
|
-
className: "rb-caption status-muted",
|
|
818
|
-
children: option.description
|
|
819
|
-
}) : null] }, option.id))
|
|
820
|
-
}) : /* @__PURE__ */ jsx(PriceLine, {
|
|
821
|
-
price: formatBookingPriceDisplay(publicEventPricingDisplay(pricing), { decimals: "auto" }),
|
|
822
|
-
depositNote
|
|
823
|
-
}),
|
|
824
|
-
depositNote && options.length > 1 ? /* @__PURE__ */ jsxs("p", {
|
|
825
|
-
className: "rb-caption rb-mt-1",
|
|
826
|
-
children: [depositNote.charAt(0).toUpperCase(), depositNote.slice(1)]
|
|
827
|
-
}) : null,
|
|
828
|
-
acceptedItems.length > 0 ? /* @__PURE__ */ jsxs("p", {
|
|
829
|
-
className: "rb-caption rb-mt-1",
|
|
830
|
-
children: ["You can also attend with: ", acceptedItems.join(", ")]
|
|
831
|
-
}) : null
|
|
832
|
-
]
|
|
833
|
-
});
|
|
834
|
-
}
|
|
835
|
-
//#endregion
|
|
836
|
-
//#region ../blocks/src/system/runtime/nodes/event-details/view.tsx
|
|
837
|
-
function formatAutoApplyDiscountLine(preview, currency) {
|
|
838
|
-
const rate = preview.discountType === "percent" ? `${preview.discountPercent}% off` : `${formatEventPriceAmount(preview.discountAmountCents, currency)} off`;
|
|
839
|
-
const label = preview.publicLabel.trim() || "Discount";
|
|
840
|
-
return preview.minTicketsRequired && preview.minTicketsRequired > 1 ? `${label} — ${rate} when buying ${preview.minTicketsRequired}+ tickets` : `${label} — ${rate} applied automatically`;
|
|
841
|
-
}
|
|
842
|
-
function TeamMemberName({ name, profilePath }) {
|
|
843
|
-
return profilePath ? /* @__PURE__ */ jsx("a", {
|
|
844
|
-
href: profilePath,
|
|
845
|
-
className: "rb-hover-opacity-80",
|
|
846
|
-
children: /* @__PURE__ */ jsx("strong", { children: name })
|
|
847
|
-
}) : /* @__PURE__ */ jsx("strong", { children: name });
|
|
848
|
-
}
|
|
849
|
-
function formatTicketTypePrice(ticketType, currency) {
|
|
850
|
-
return formatBookingPriceDisplay(resolveExactOrFreePriceDisplay(ticketType.priceAmount, currency), { decimals: "auto" });
|
|
851
|
-
}
|
|
852
|
-
function getDisplayablePricingOptions(event) {
|
|
853
|
-
return event.pricing.kind === "tiered" ? event.pricing.options.filter(isPublicEventPricingOptionDisplayable).sort((left, right) => left.sortOrder - right.sortOrder) : [];
|
|
854
|
-
}
|
|
855
|
-
function TicketTypePriceList({ ticketTypes, currency }) {
|
|
856
|
-
if (ticketTypes.length === 0) return null;
|
|
857
|
-
return /* @__PURE__ */ jsx("div", {
|
|
858
|
-
className: "rb-mt-3 rb-flex rb-flex-col rb-gap-2",
|
|
859
|
-
children: ticketTypes.map((ticketType) => /* @__PURE__ */ jsxs("div", {
|
|
860
|
-
className: "rb-flex rb-items-start rb-justify-between rb-gap-4",
|
|
861
|
-
children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", { children: ticketType.name }), ticketType.description ? /* @__PURE__ */ jsx("p", {
|
|
862
|
-
className: "rb-caption status-muted",
|
|
863
|
-
children: ticketType.description
|
|
864
|
-
}) : null] }), /* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx("strong", { children: formatTicketTypePrice(ticketType, currency) }) })]
|
|
865
|
-
}, ticketType.id))
|
|
866
|
-
});
|
|
867
|
-
}
|
|
868
|
-
function EventPricingDetails({ isDropIn, wholeSeriesPricingDisplay, acceptedItems, eventCostLabel, depositNote, eventPricingCurrency, ticketTypes, autoApplyDiscount }) {
|
|
869
|
-
if (isDropIn) return /* @__PURE__ */ jsxs("div", {
|
|
870
|
-
className: "rb-mt-6",
|
|
871
|
-
children: [/* @__PURE__ */ jsx("div", {
|
|
872
|
-
className: "rb-label rb-mb-2",
|
|
873
|
-
children: "Registration"
|
|
874
|
-
}), /* @__PURE__ */ jsx("p", {
|
|
875
|
-
className: "rb-caption status-muted",
|
|
876
|
-
children: "No registration required - just show up"
|
|
877
|
-
})]
|
|
878
|
-
});
|
|
879
|
-
if (wholeSeriesPricingDisplay) return /* @__PURE__ */ jsx(WholeSeriesPricingDisplay, {
|
|
880
|
-
pricing: wholeSeriesPricingDisplay,
|
|
881
|
-
depositNote,
|
|
882
|
-
acceptedItems: [...acceptedItems]
|
|
883
|
-
});
|
|
884
|
-
if (eventCostLabel) return /* @__PURE__ */ jsxs("div", {
|
|
885
|
-
className: "rb-mt-6",
|
|
886
|
-
children: [
|
|
887
|
-
/* @__PURE__ */ jsx("div", {
|
|
888
|
-
className: "rb-label rb-mb-2",
|
|
889
|
-
children: "Cost"
|
|
890
|
-
}),
|
|
891
|
-
/* @__PURE__ */ jsx(PriceLine, {
|
|
892
|
-
price: eventCostLabel,
|
|
893
|
-
depositNote
|
|
894
|
-
}),
|
|
895
|
-
autoApplyDiscount && eventPricingCurrency ? /* @__PURE__ */ jsx("p", {
|
|
896
|
-
className: "rb-caption rb-mt-1",
|
|
897
|
-
children: formatAutoApplyDiscountLine(autoApplyDiscount, eventPricingCurrency)
|
|
898
|
-
}) : null,
|
|
899
|
-
eventPricingCurrency && ticketTypes.length > 1 ? /* @__PURE__ */ jsx(TicketTypePriceList, {
|
|
900
|
-
ticketTypes,
|
|
901
|
-
currency: eventPricingCurrency
|
|
902
|
-
}) : null,
|
|
903
|
-
acceptedItems.length > 0 ? /* @__PURE__ */ jsxs("p", {
|
|
904
|
-
className: "rb-caption rb-mt-1",
|
|
905
|
-
children: ["You can also attend with: ", acceptedItems.join(", ")]
|
|
906
|
-
}) : null
|
|
907
|
-
]
|
|
908
|
-
});
|
|
909
|
-
return acceptedItems.length > 0 ? /* @__PURE__ */ jsx("div", {
|
|
910
|
-
className: "rb-mt-6",
|
|
911
|
-
children: /* @__PURE__ */ jsxs("p", {
|
|
912
|
-
className: "rb-caption",
|
|
913
|
-
children: ["You can also attend with: ", acceptedItems.join(", ")]
|
|
914
|
-
})
|
|
915
|
-
}) : null;
|
|
916
|
-
}
|
|
917
|
-
function EventFacts({ selection, selected, venue, online, addressAfterBooking, teamMembers, pricing, showCapacity, lookSlots }) {
|
|
918
|
-
const { date, timeRange } = formatEventDateParts({
|
|
919
|
-
startsAt: selected.startsAt,
|
|
920
|
-
endsAt: selected.endsAt,
|
|
921
|
-
...eventDateOptions(selected)
|
|
922
|
-
});
|
|
923
|
-
const dateHeading = selection.kind === "wholeSeries" ? runLifecycleLabel(selection.lifecycle) : selection.mode === "next" ? "Next date" : "Date";
|
|
924
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
925
|
-
...listLookSlot({ lookSlots }, "facts"),
|
|
926
|
-
className: "rb-flex rb-flex-col rb-gap-4",
|
|
927
|
-
children: [
|
|
928
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
929
|
-
/* @__PURE__ */ jsx("div", {
|
|
930
|
-
className: "rb-label rb-mb-2",
|
|
931
|
-
children: dateHeading
|
|
932
|
-
}),
|
|
933
|
-
/* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx("strong", { children: date }) }),
|
|
934
|
-
/* @__PURE__ */ jsx("p", {
|
|
935
|
-
className: "rb-caption",
|
|
936
|
-
children: timeRange
|
|
937
|
-
})
|
|
938
|
-
] }),
|
|
939
|
-
/* @__PURE__ */ jsx(EventVenueFact, {
|
|
940
|
-
venue,
|
|
941
|
-
online,
|
|
942
|
-
addressAfterBooking
|
|
943
|
-
}),
|
|
944
|
-
/* @__PURE__ */ jsx(EventTeacherFacts, { teamMembers }),
|
|
945
|
-
showCapacity && selected.capacity != null ? /* @__PURE__ */ jsxs("div", {
|
|
946
|
-
className: "rb-mt-6",
|
|
947
|
-
children: [/* @__PURE__ */ jsx("div", {
|
|
948
|
-
className: "rb-label rb-mb-2",
|
|
949
|
-
children: "Places"
|
|
950
|
-
}), /* @__PURE__ */ jsx("p", { children: formatEventRemainingPlaces(selected) ?? formatTotalCapacity(selected.capacity) })]
|
|
951
|
-
}) : null,
|
|
952
|
-
pricing,
|
|
953
|
-
selection.kind === "wholeSeries" ? /* @__PURE__ */ jsx(BookingState, {
|
|
954
|
-
phase: selection.bookingPhase,
|
|
955
|
-
event: selected
|
|
956
|
-
}) : null
|
|
957
|
-
]
|
|
958
|
-
});
|
|
959
|
-
}
|
|
960
|
-
const eventOnlinePlaceShown = (event, showVenue) => showVenue ? eventOnlinePlace(event) : null;
|
|
961
|
-
const hasEventPlaceFact = (event, showVenue) => showVenue && (Boolean(event.venue) || eventOnlinePlace(event) !== null || event.addressAfterBooking === true);
|
|
962
|
-
const addressAfterBookingShown = (event, showVenue) => showVenue && event.addressAfterBooking === true;
|
|
963
|
-
/** Where a venue would go: online, the owner's word that the address follows the booking, or nothing at all. */
|
|
964
|
-
function EventPlaceWithoutVenue({ online, addressAfterBooking }) {
|
|
965
|
-
if (!online && !addressAfterBooking) return null;
|
|
966
|
-
if (!online) return /* @__PURE__ */ jsxs("div", {
|
|
967
|
-
className: "rb-mt-6",
|
|
968
|
-
children: [/* @__PURE__ */ jsx("div", {
|
|
969
|
-
className: "rb-label rb-mb-2",
|
|
970
|
-
children: "Venue"
|
|
971
|
-
}), /* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx("strong", { children: EVENT_ADDRESS_AFTER_BOOKING_LABEL }) })]
|
|
972
|
-
});
|
|
973
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
974
|
-
className: "rb-mt-6",
|
|
975
|
-
children: [
|
|
976
|
-
/* @__PURE__ */ jsx("div", {
|
|
977
|
-
className: "rb-label rb-mb-2",
|
|
978
|
-
children: "Venue"
|
|
979
|
-
}),
|
|
980
|
-
/* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx("strong", { children: online.mode === "online" ? "Online" : "In person or online" }) }),
|
|
981
|
-
addressAfterBooking ? /* @__PURE__ */ jsxs("p", {
|
|
982
|
-
className: "rb-caption",
|
|
983
|
-
children: [EVENT_ADDRESS_AFTER_BOOKING_LABEL, "."]
|
|
984
|
-
}) : null,
|
|
985
|
-
online.note ? /* @__PURE__ */ jsx("p", {
|
|
986
|
-
className: "rb-caption",
|
|
987
|
-
children: online.note
|
|
988
|
-
}) : null
|
|
989
|
-
]
|
|
990
|
-
});
|
|
991
|
-
}
|
|
992
|
-
/** An online event says so where a venue would go; a hybrid one adds it under the venue. */
|
|
993
|
-
function EventVenueFact({ venue, online, addressAfterBooking }) {
|
|
994
|
-
if (!venue) return /* @__PURE__ */ jsx(EventPlaceWithoutVenue, {
|
|
995
|
-
online,
|
|
996
|
-
addressAfterBooking
|
|
997
|
-
});
|
|
998
|
-
const { place, addressWithBooking } = eventVenuePlace(venue);
|
|
999
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
1000
|
-
className: "rb-mt-6",
|
|
1001
|
-
children: [
|
|
1002
|
-
/* @__PURE__ */ jsx("div", {
|
|
1003
|
-
className: "rb-label rb-mb-2",
|
|
1004
|
-
children: "Venue"
|
|
1005
|
-
}),
|
|
1006
|
-
/* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx("strong", { children: venue.name }) }),
|
|
1007
|
-
place ? /* @__PURE__ */ jsx("p", {
|
|
1008
|
-
className: "rb-caption",
|
|
1009
|
-
children: place
|
|
1010
|
-
}) : null,
|
|
1011
|
-
addressWithBooking ? /* @__PURE__ */ jsx("p", {
|
|
1012
|
-
className: "rb-caption rb-mt-1",
|
|
1013
|
-
children: "The full address and directions come with your booking confirmation."
|
|
1014
|
-
}) : /* @__PURE__ */ jsx(LocationMapActions, {
|
|
1015
|
-
location: venue.location,
|
|
1016
|
-
addressText: venue.address
|
|
1017
|
-
}),
|
|
1018
|
-
online ? /* @__PURE__ */ jsxs("p", {
|
|
1019
|
-
className: "rb-caption rb-mt-1",
|
|
1020
|
-
children: ["You can also join online.", online.note ? ` ${online.note}` : ""]
|
|
1021
|
-
}) : null
|
|
1022
|
-
]
|
|
1023
|
-
});
|
|
1024
|
-
}
|
|
1025
|
-
function EventTeacherFacts({ teamMembers }) {
|
|
1026
|
-
return teamMembers.length ? /* @__PURE__ */ jsxs("div", {
|
|
1027
|
-
className: "rb-mt-6",
|
|
1028
|
-
children: [/* @__PURE__ */ jsx("div", {
|
|
1029
|
-
className: "rb-label rb-mb-2",
|
|
1030
|
-
children: "With"
|
|
1031
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
1032
|
-
className: "rb-flex rb-flex-col rb-gap-3",
|
|
1033
|
-
children: teamMembers.map((member) => /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx(TeamMemberName, {
|
|
1034
|
-
name: member.name,
|
|
1035
|
-
profilePath: member.profilePath
|
|
1036
|
-
}) }), member.summary ? /* @__PURE__ */ jsx("p", {
|
|
1037
|
-
className: "rb-caption status-muted",
|
|
1038
|
-
children: member.summary
|
|
1039
|
-
}) : null] }, member.id))
|
|
1040
|
-
})]
|
|
1041
|
-
}) : null;
|
|
1042
|
-
}
|
|
1043
|
-
/**
|
|
1044
|
-
* Where the run has got to, in the words a visitor would use.
|
|
1045
|
-
*
|
|
1046
|
-
* A cancelled run says so plainly rather than being described by its dates,
|
|
1047
|
-
* which is what happens when the label is inferred from the schedule alone.
|
|
1048
|
-
*/
|
|
1049
|
-
function runLifecycleLabel(lifecycle) {
|
|
1050
|
-
switch (lifecycle) {
|
|
1051
|
-
case "upcoming": return "First session";
|
|
1052
|
-
case "in_progress": return "In progress";
|
|
1053
|
-
case "completed": return "Finished";
|
|
1054
|
-
case "cancelled": return "Cancelled";
|
|
1055
|
-
}
|
|
1056
|
-
}
|
|
1057
|
-
/**
|
|
1058
|
-
* Whether these dates still take bookings, and if not, why.
|
|
1059
|
-
*
|
|
1060
|
-
* The run decides, not its enrolment flag on its own: a cancelled run can still
|
|
1061
|
-
* carry an open enrolment window and future dates, and saying "Open" here while
|
|
1062
|
-
* the booking panel beside it says cancelled is the contradiction a visitor
|
|
1063
|
-
* actually notices.
|
|
1064
|
-
*/
|
|
1065
|
-
function BookingState({ phase, event }) {
|
|
1066
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
1067
|
-
className: "rb-mt-6",
|
|
1068
|
-
children: [
|
|
1069
|
-
/* @__PURE__ */ jsx("div", {
|
|
1070
|
-
className: "rb-label rb-mb-2",
|
|
1071
|
-
children: "Booking"
|
|
1072
|
-
}),
|
|
1073
|
-
/* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx("strong", { children: phase.kind === "closed" ? "Closed" : isEventFull(event) ? formatEventRemainingPlaces(event) : "Open" }) }),
|
|
1074
|
-
phase.kind === "closed" ? /* @__PURE__ */ jsx("p", {
|
|
1075
|
-
className: "rb-caption",
|
|
1076
|
-
children: bookingClosedReason(phase.reason)
|
|
1077
|
-
}) : null
|
|
1078
|
-
]
|
|
1079
|
-
});
|
|
1080
|
-
}
|
|
1081
|
-
function bookingClosedReason(reason) {
|
|
1082
|
-
switch (reason) {
|
|
1083
|
-
case "cancelled": return "These dates have been cancelled.";
|
|
1084
|
-
case "in-progress": return "Bookings closed when the first session began.";
|
|
1085
|
-
case "completed": return "These dates have finished.";
|
|
1086
|
-
case "enrolment-closed": return "Bookings for these dates have closed.";
|
|
1087
|
-
case "no-sessions": return "No dates are currently scheduled.";
|
|
1088
|
-
}
|
|
1089
|
-
}
|
|
1090
|
-
/**
|
|
1091
|
-
* The run's own schedule, cancellations included and labelled.
|
|
1092
|
-
*
|
|
1093
|
-
* Every session belongs to the run whose page this is, so the schedule is a
|
|
1094
|
-
* list rather than a set of links to somewhere else. A cancelled week stays on
|
|
1095
|
-
* the list and says so: dropping it would leave a visitor wondering whether
|
|
1096
|
-
* they had misremembered the dates.
|
|
1097
|
-
*/
|
|
1098
|
-
function SessionSchedule({ sessions, event }) {
|
|
1099
|
-
if (sessions.length === 0) return null;
|
|
1100
|
-
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("div", {
|
|
1101
|
-
className: "rb-label",
|
|
1102
|
-
children: "Session schedule"
|
|
1103
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
1104
|
-
className: "rb-mt-2 rb-tiles-grid",
|
|
1105
|
-
children: sessions.map((session) => {
|
|
1106
|
-
const cancelled = session.status === CANCELLED_SESSION_STATUS;
|
|
1107
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
1108
|
-
className: `rb-tile${cancelled ? " rb-tile--cancelled" : ""}`,
|
|
1109
|
-
children: [/* @__PURE__ */ jsx(DateTimeTile, {
|
|
1110
|
-
startsAt: session.startsAt,
|
|
1111
|
-
endsAt: session.endsAt,
|
|
1112
|
-
...eventDateOptions({
|
|
1113
|
-
...event,
|
|
1114
|
-
timeZone: session.timeZone
|
|
1115
|
-
})
|
|
1116
|
-
}), cancelled ? /* @__PURE__ */ jsx("p", {
|
|
1117
|
-
className: "rb-caption status-muted",
|
|
1118
|
-
children: "Cancelled"
|
|
1119
|
-
}) : null]
|
|
1120
|
-
}, session.occurrenceId);
|
|
1121
|
-
})
|
|
1122
|
-
})] });
|
|
1123
|
-
}
|
|
1124
|
-
function OtherEventDates({ selection }) {
|
|
1125
|
-
if (selection.kind === "empty") return null;
|
|
1126
|
-
if (selection.kind === "wholeSeries") return /* @__PURE__ */ jsx(SessionSchedule, {
|
|
1127
|
-
sessions: selection.sessions,
|
|
1128
|
-
event: selection.selected
|
|
1129
|
-
});
|
|
1130
|
-
const dates = selection.otherDates;
|
|
1131
|
-
if (dates.length === 0) return null;
|
|
1132
|
-
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("div", {
|
|
1133
|
-
className: "rb-label",
|
|
1134
|
-
children: "Other dates"
|
|
1135
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
1136
|
-
className: "rb-mt-2 rb-tiles-grid",
|
|
1137
|
-
children: dates.map((event) => /* @__PURE__ */ jsx("a", {
|
|
1138
|
-
className: "rb-tile rb-tile--interactive",
|
|
1139
|
-
...resolveEventLinkProps(event),
|
|
1140
|
-
children: /* @__PURE__ */ jsx(DateTimeTile, {
|
|
1141
|
-
startsAt: event.startsAt,
|
|
1142
|
-
endsAt: event.endsAt,
|
|
1143
|
-
...eventDateOptions(event)
|
|
1144
|
-
})
|
|
1145
|
-
}, event.occurrenceId || event.id))
|
|
1146
|
-
})] });
|
|
1147
|
-
}
|
|
1148
|
-
function EventIdentity({ event, showTitle, showDescription }) {
|
|
1149
|
-
if (!showTitle && !showDescription) return null;
|
|
1150
|
-
const description = event.occurrenceDescription ?? event.description;
|
|
1151
|
-
return /* @__PURE__ */ jsxs("div", { children: [showTitle ? /* @__PURE__ */ jsx("h3", { children: event.occurrenceTitle ?? event.title }) : null, showDescription && description ? /* @__PURE__ */ jsx("p", {
|
|
1152
|
-
className: "rb-mt-2",
|
|
1153
|
-
style: { whiteSpace: "pre-line" },
|
|
1154
|
-
children: description
|
|
1155
|
-
}) : null] });
|
|
1156
|
-
}
|
|
1157
|
-
function acceptedProductNames(props) {
|
|
1158
|
-
const passes = props.showAcceptedPasses !== false ? (props.applicablePasses ?? []).map(({ name }) => name) : [];
|
|
1159
|
-
const memberships = props.showAcceptedMemberships !== false ? (props.applicableMemberships ?? []).map(({ name }) => name) : [];
|
|
1160
|
-
return [...passes, ...memberships];
|
|
1161
|
-
}
|
|
1162
|
-
function EventVenueMap({ venue, drawing, showMap, mapHeight, mapClassName }) {
|
|
1163
|
-
if (!showMap || !venue || !drawing) return null;
|
|
1164
|
-
return /* @__PURE__ */ jsx(MapDrawingSvg, {
|
|
1165
|
-
drawing,
|
|
1166
|
-
label: venue.name,
|
|
1167
|
-
className: mapClassName,
|
|
1168
|
-
height: mapHeight
|
|
1169
|
-
});
|
|
1170
|
-
}
|
|
1171
|
-
/** One pricing projection governs the selected panel, including drop-in and whole-series behavior. */
|
|
1172
|
-
function selectedEventPricing(event, showCost) {
|
|
1173
|
-
const isDropIn = isDropInEvent(event);
|
|
1174
|
-
const wholeSeriesPricing = wholeSeriesPricingOf(event);
|
|
1175
|
-
const showEventCost = showCost && !isDropIn && wholeSeriesPricing === null;
|
|
1176
|
-
return {
|
|
1177
|
-
isDropIn,
|
|
1178
|
-
wholeSeriesPricingDisplay: showCost ? wholeSeriesPricing : null,
|
|
1179
|
-
eventCostLabel: showEventCost ? formatEventPrice(event) : null,
|
|
1180
|
-
depositNote: showCost && !isDropIn ? paidDepositNote(event) : null,
|
|
1181
|
-
eventPricingCurrency: publicEventPricingCurrency(event.pricing),
|
|
1182
|
-
ticketTypes: showEventCost && isPaid(event) ? getDisplayablePricingOptions(event) : []
|
|
1183
|
-
};
|
|
1184
|
-
}
|
|
1185
|
-
const isDropInEvent = (event) => event.bookingScope === "single_occurrence" && event.requiresRegistration === false;
|
|
1186
|
-
const wholeSeriesPricingOf = (event) => event.bookingScope === "whole_series" && event.pricing.kind !== "external" ? event.pricing : null;
|
|
1187
|
-
const isPaid = (event) => publicEventPricingType(event.pricing) !== "free";
|
|
1188
|
-
const paidDepositNote = (event) => isPaid(event) ? formatEventDepositNote(event.pricing, event.paymentTerms, event) : null;
|
|
1189
|
-
function SelectedEventDetailsView(props) {
|
|
1190
|
-
const { selection, showVenue, showMap, showOtherDates, showTitle, showDescription, showCapacity, mapHeight, mapClassName, acceptedItems } = props;
|
|
1191
|
-
const selected = selection.selected;
|
|
1192
|
-
const venue = showVenue ? selected.venue : void 0;
|
|
1193
|
-
const online = eventOnlinePlaceShown(selected, showVenue);
|
|
1194
|
-
const addressAfterBooking = addressAfterBookingShown(selected, showVenue);
|
|
1195
|
-
const pricing = selectedEventPricing(selected, props.showCost);
|
|
1196
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
1197
|
-
className: "rb-flex rb-flex-col rb-gap-6 rb-text-left",
|
|
1198
|
-
children: [
|
|
1199
|
-
/* @__PURE__ */ jsx(EventIdentity, {
|
|
1200
|
-
event: selected,
|
|
1201
|
-
showTitle,
|
|
1202
|
-
showDescription
|
|
1203
|
-
}),
|
|
1204
|
-
/* @__PURE__ */ jsxs("div", {
|
|
1205
|
-
...listLookSlot(props, "frame"),
|
|
1206
|
-
className: "rb-grid rb-grid-cols-1 rb-gap-6 rb-items-start rb-sm-grid-cols-2",
|
|
1207
|
-
children: [/* @__PURE__ */ jsx(EventFacts, {
|
|
1208
|
-
lookSlots: props.lookSlots,
|
|
1209
|
-
selection,
|
|
1210
|
-
selected,
|
|
1211
|
-
venue,
|
|
1212
|
-
online,
|
|
1213
|
-
addressAfterBooking,
|
|
1214
|
-
showCapacity,
|
|
1215
|
-
teamMembers: selected.teamMembers ?? [],
|
|
1216
|
-
pricing: /* @__PURE__ */ jsx(EventPricingDetails, {
|
|
1217
|
-
...pricing,
|
|
1218
|
-
acceptedItems,
|
|
1219
|
-
autoApplyDiscount: props.autoApplyDiscount ?? null
|
|
1220
|
-
})
|
|
1221
|
-
}), /* @__PURE__ */ jsx(EventVenueMap, {
|
|
1222
|
-
venue,
|
|
1223
|
-
showMap,
|
|
1224
|
-
mapHeight,
|
|
1225
|
-
mapClassName,
|
|
1226
|
-
drawing: props.selectedVenueDrawing
|
|
1227
|
-
})]
|
|
1228
|
-
}),
|
|
1229
|
-
showOtherDates ? /* @__PURE__ */ jsx(OtherEventDates, { selection }) : null
|
|
1230
|
-
]
|
|
1231
|
-
});
|
|
1232
|
-
}
|
|
1233
|
-
function LegacyEventDetailsView(props) {
|
|
1234
|
-
if (props.selection.kind === "empty") return /* @__PURE__ */ jsx("p", {
|
|
1235
|
-
className: "rb-caption status-muted",
|
|
1236
|
-
children: "No upcoming dates scheduled."
|
|
1237
|
-
});
|
|
1238
|
-
return /* @__PURE__ */ jsx(SelectedEventDetailsView, {
|
|
1239
|
-
lookSlots: props.lookSlots,
|
|
1240
|
-
selection: props.selection,
|
|
1241
|
-
showVenue: props.showVenue,
|
|
1242
|
-
showMap: props.showMap,
|
|
1243
|
-
showOtherDates: props.showOtherDates,
|
|
1244
|
-
showCost: props.showCost ?? true,
|
|
1245
|
-
showTitle: props.showTitle ?? false,
|
|
1246
|
-
showDescription: props.showDescription ?? false,
|
|
1247
|
-
showCapacity: props.showCapacity ?? false,
|
|
1248
|
-
autoApplyDiscount: props.autoApplyDiscount ?? null,
|
|
1249
|
-
selectedVenueDrawing: props.selectedVenueDrawing,
|
|
1250
|
-
mapHeight: props.mapHeight ?? 200,
|
|
1251
|
-
mapClassName: props.mapClassName ?? "event-details-map",
|
|
1252
|
-
acceptedItems: acceptedProductNames(props)
|
|
1253
|
-
});
|
|
1254
|
-
}
|
|
1255
|
-
/** The absence of an arrangement preserves the original markup exactly. */
|
|
1256
|
-
function EventDetailsView(input) {
|
|
1257
|
-
if (!input.arrangement) return /* @__PURE__ */ jsx(LegacyEventDetailsView, { ...input });
|
|
1258
|
-
const props = withLookParts(input, input.arrangement);
|
|
1259
|
-
if (props.arrangement === "details-panel") return /* @__PURE__ */ jsxs("div", {
|
|
1260
|
-
...listLookSlot(props, "panel"),
|
|
1261
|
-
children: [props.panelHeading ? /* @__PURE__ */ jsx("h2", {
|
|
1262
|
-
...listLookSlot(props, "panel-heading"),
|
|
1263
|
-
children: props.panelHeading
|
|
1264
|
-
}) : null, /* @__PURE__ */ jsx(LegacyEventDetailsView, { ...props })]
|
|
1265
|
-
});
|
|
1266
|
-
if (props.selection.kind === "empty") return /* @__PURE__ */ jsxs("div", {
|
|
1267
|
-
...listLookSlot(props, "layout"),
|
|
1268
|
-
children: [props.entryTitle ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("h1", {
|
|
1269
|
-
...listLookSlot(props, "headline"),
|
|
1270
|
-
children: props.entryTitle
|
|
1271
|
-
}), /* @__PURE__ */ jsx(EventQuickFacts, { facts: props.quickFacts })] }) : null, /* @__PURE__ */ jsx(LegacyEventDetailsView, { ...props })]
|
|
1272
|
-
});
|
|
1273
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
1274
|
-
...listLookSlot(props, "layout"),
|
|
1275
|
-
children: [/* @__PURE__ */ jsx(EventHeader, {
|
|
1276
|
-
selection: props.selection,
|
|
1277
|
-
presentation: props,
|
|
1278
|
-
showCost: props.showCost ?? true,
|
|
1279
|
-
showCapacity: props.showCapacity ?? false
|
|
1280
|
-
}), /* @__PURE__ */ jsx(EventHeaderPanel, {
|
|
1281
|
-
...props,
|
|
1282
|
-
selection: props.selection
|
|
1283
|
-
})]
|
|
1284
|
-
});
|
|
1285
|
-
}
|
|
1286
|
-
function EventHeaderPanel(props) {
|
|
1287
|
-
const content = headerPanelContent(props);
|
|
1288
|
-
if (!content.hasFacts && !content.hasMap && !content.hasDates) return null;
|
|
1289
|
-
return /* @__PURE__ */ jsx("div", {
|
|
1290
|
-
...listLookSlot(props, "panel"),
|
|
1291
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
1292
|
-
className: "rb-flex rb-flex-col rb-gap-6 rb-text-left",
|
|
1293
|
-
children: [content.hasFacts || content.hasMap ? /* @__PURE__ */ jsxs("div", {
|
|
1294
|
-
className: "rb-grid rb-grid-cols-1 rb-gap-6 rb-items-start rb-sm-grid-cols-2",
|
|
1295
|
-
children: [content.hasFacts ? /* @__PURE__ */ jsx(HeaderPanelFacts, { ...content }) : null, /* @__PURE__ */ jsx(EventVenueMap, {
|
|
1296
|
-
venue: content.venue,
|
|
1297
|
-
showMap: props.showMap,
|
|
1298
|
-
drawing: props.selectedVenueDrawing,
|
|
1299
|
-
mapHeight: props.mapHeight ?? 200,
|
|
1300
|
-
mapClassName: props.mapClassName ?? "event-details-map"
|
|
1301
|
-
})]
|
|
1302
|
-
}) : null, content.hasDates ? /* @__PURE__ */ jsx(OtherEventDates, { selection: props.selection }) : null]
|
|
1303
|
-
})
|
|
1304
|
-
});
|
|
1305
|
-
}
|
|
1306
|
-
function HeaderPanelFacts({ venue, online, addressAfterBooking, teamMembers, pricing }) {
|
|
1307
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
1308
|
-
className: "rb-flex rb-flex-col rb-gap-4",
|
|
1309
|
-
children: [
|
|
1310
|
-
/* @__PURE__ */ jsx(EventVenueFact, {
|
|
1311
|
-
venue,
|
|
1312
|
-
online,
|
|
1313
|
-
addressAfterBooking
|
|
1314
|
-
}),
|
|
1315
|
-
/* @__PURE__ */ jsx(EventTeacherFacts, { teamMembers }),
|
|
1316
|
-
pricing ? /* @__PURE__ */ jsx(EventPricingDetails, { ...pricing }) : null
|
|
1317
|
-
]
|
|
1318
|
-
});
|
|
1319
|
-
}
|
|
1320
|
-
/** What the panel has to add to the header, decided once. */
|
|
1321
|
-
function headerPanelContent(props) {
|
|
1322
|
-
const { selection } = props;
|
|
1323
|
-
const venue = props.showVenue ? selection.selected.venue : void 0;
|
|
1324
|
-
const online = eventOnlinePlaceShown(selection.selected, props.showVenue);
|
|
1325
|
-
const teamMembers = selection.selected.teamMembers ?? [];
|
|
1326
|
-
const pricing = headerPanelPricing(props, selection.selected);
|
|
1327
|
-
const scheduled = selection.kind === "wholeSeries" ? selection.sessions.length : selection.otherDates.length;
|
|
1328
|
-
return {
|
|
1329
|
-
venue,
|
|
1330
|
-
online,
|
|
1331
|
-
addressAfterBooking: addressAfterBookingShown(selection.selected, props.showVenue),
|
|
1332
|
-
teamMembers,
|
|
1333
|
-
pricing,
|
|
1334
|
-
hasMap: Boolean(props.showMap && venue && props.selectedVenueDrawing),
|
|
1335
|
-
hasFacts: hasEventPlaceFact(selection.selected, props.showVenue) || teamMembers.length > 0 || pricing !== null,
|
|
1336
|
-
hasDates: props.showOtherDates && scheduled > 0
|
|
1337
|
-
};
|
|
1338
|
-
}
|
|
1339
|
-
/**
|
|
1340
|
-
* Price detail beyond the header's one Price line: several options, a
|
|
1341
|
-
* discount, or passes that also admit. Decided from the same projection
|
|
1342
|
-
* `EventPricingDetails` renders, so a panel is only drawn when it will show something.
|
|
1343
|
-
*/
|
|
1344
|
-
function headerPanelPricing(props, event) {
|
|
1345
|
-
const pricing = selectedEventPricing(event, props.showCost ?? true);
|
|
1346
|
-
if (pricing.isDropIn) return null;
|
|
1347
|
-
const detail = {
|
|
1348
|
-
...pricing,
|
|
1349
|
-
depositNote: null,
|
|
1350
|
-
acceptedItems: acceptedProductNames(props),
|
|
1351
|
-
autoApplyDiscount: props.autoApplyDiscount ?? null
|
|
1352
|
-
};
|
|
1353
|
-
return pricingAddsDetail(detail) ? detail : null;
|
|
1354
|
-
}
|
|
1355
|
-
/** True when `EventPricingDetails` would show more than the header's one price. */
|
|
1356
|
-
function pricingAddsDetail(pricing) {
|
|
1357
|
-
const priced = Boolean(pricing.eventCostLabel && pricing.eventPricingCurrency);
|
|
1358
|
-
const courseOptions = pricing.wholeSeriesPricingDisplay ? wholeSeriesPriceOptions(pricing.wholeSeriesPricingDisplay).length : 0;
|
|
1359
|
-
return pricing.acceptedItems.length > 0 || courseOptions > 1 || priced && (pricing.ticketTypes.length > 1 || pricing.autoApplyDiscount !== null);
|
|
1360
|
-
}
|
|
1361
|
-
/** Turns off the toggles the arrangement leaves out, as `lookParts` declares them. */
|
|
1362
|
-
function withLookParts(props, arrangement) {
|
|
1363
|
-
const shown = (field) => lookPartShown("block.event-details", field, arrangement);
|
|
1364
|
-
return {
|
|
1365
|
-
...props,
|
|
1366
|
-
showTitle: props.showTitle === true && shown("showTitle"),
|
|
1367
|
-
showDescription: props.showDescription === true && shown("showDescription")
|
|
1368
|
-
};
|
|
1369
|
-
}
|
|
1370
|
-
//#endregion
|
|
1371
|
-
export { eventCardListContent as a, derivePreviewRunSchedule as c, eventHeaderSlotParents as i, formatEventQuickDate as l, resolveEventDetailsPresentation as n, offeringDatesBySeries as o, lookPartShown as r, deriveEventScheduleSummary as s, EventDetailsView as t, selectQuickDateEvents as u };
|