@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,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { a as mediaIdentifierSchema, d as parseUuidBrand, f as err$1, n as renderableMediaAssetSchema, p as ok$1 } from "./renderableMediaAssetAdmission-BlfqYLJW.mjs";
|
|
3
|
-
import { c as addMonths } from "./src-
|
|
3
|
+
import { c as addMonths } from "./src-uwCpbHXG.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region ../core/src/branded/customers.ts
|
|
6
6
|
const unsafeAsSiteTermsVersionId = (id) => id;
|
|
@@ -131,42 +131,6 @@ function parsePositiveMoneyInputToCents(value, options = {}) {
|
|
|
131
131
|
return ok$1(unsafeAsPositiveCents(amountCents));
|
|
132
132
|
}
|
|
133
133
|
//#endregion
|
|
134
|
-
//#region ../core/src/booking-payment-options.ts
|
|
135
|
-
/**
|
|
136
|
-
* One way a customer may pay for a booking. This is the single definition of
|
|
137
|
-
* the option type; `booking-payment-schemas.typetest.ts` keeps it equal to the
|
|
138
|
-
* schema's output in both directions.
|
|
139
|
-
*/
|
|
140
|
-
/** When a course's instalments must all be paid by: before its first or its last live session. */
|
|
141
|
-
const BOOKING_COURSE_INSTALMENT_DEADLINES = ["first_session", "last_session"];
|
|
142
|
-
/** Automatic instalments and a flexible balance cannot share one booking offer. */
|
|
143
|
-
function validateBookingPaymentOptionKinds(kinds) {
|
|
144
|
-
if (kinds.length === 0) return err$1("no_options");
|
|
145
|
-
const uniqueKinds = new Set(kinds);
|
|
146
|
-
if (uniqueKinds.size !== kinds.length) return err$1("duplicate_kind");
|
|
147
|
-
if (uniqueKinds.has("instalment_plan") && uniqueKinds.has("flexible_balance")) return err$1("incompatible_collection_options");
|
|
148
|
-
return ok$1(void 0);
|
|
149
|
-
}
|
|
150
|
-
//#endregion
|
|
151
|
-
//#region ../core/src/booking-date-time/instant.ts
|
|
152
|
-
function parseUtcIsoDateTimeString(value) {
|
|
153
|
-
const normalized = value.trim();
|
|
154
|
-
const hasUtcSuffix = normalized.endsWith("Z");
|
|
155
|
-
const hasExplicitOffset = /[+-]\d{2}:\d{2}$/u.test(normalized);
|
|
156
|
-
if (!hasUtcSuffix && !hasExplicitOffset) return err$1("missing-timezone-offset");
|
|
157
|
-
const date = new Date(normalized);
|
|
158
|
-
if (Number.isNaN(date.getTime())) return err$1("invalid-date-time");
|
|
159
|
-
return ok$1(date.toISOString());
|
|
160
|
-
}
|
|
161
|
-
function toUtcIsoDateTimeString(value) {
|
|
162
|
-
const parsed = parseUtcIsoDateTimeString(value);
|
|
163
|
-
if (!parsed.ok) {
|
|
164
|
-
const message = parsed.error === "missing-timezone-offset" ? `Expected an offset-aware ISO datetime, received "${value}"` : `Expected a valid ISO datetime, received "${value}"`;
|
|
165
|
-
throw new Error(message);
|
|
166
|
-
}
|
|
167
|
-
return parsed.value;
|
|
168
|
-
}
|
|
169
|
-
//#endregion
|
|
170
134
|
//#region ../core/src/date-time-formatter.ts
|
|
171
135
|
/** Shared Intl engine, internal to core's date presentation owners. */
|
|
172
136
|
const FORMATTER_CACHE_LIMIT = 100;
|
|
@@ -252,6 +216,25 @@ function resolveBookingBusinessTimeZone(value) {
|
|
|
252
216
|
return resolveBookingTimeZoneId(value, DEFAULT_BOOKING_BUSINESS_TIME_ZONE);
|
|
253
217
|
}
|
|
254
218
|
//#endregion
|
|
219
|
+
//#region ../core/src/booking-date-time/instant.ts
|
|
220
|
+
function parseUtcIsoDateTimeString(value) {
|
|
221
|
+
const normalized = value.trim();
|
|
222
|
+
const hasUtcSuffix = normalized.endsWith("Z");
|
|
223
|
+
const hasExplicitOffset = /[+-]\d{2}:\d{2}$/u.test(normalized);
|
|
224
|
+
if (!hasUtcSuffix && !hasExplicitOffset) return err$1("missing-timezone-offset");
|
|
225
|
+
const date = new Date(normalized);
|
|
226
|
+
if (Number.isNaN(date.getTime())) return err$1("invalid-date-time");
|
|
227
|
+
return ok$1(date.toISOString());
|
|
228
|
+
}
|
|
229
|
+
function toUtcIsoDateTimeString(value) {
|
|
230
|
+
const parsed = parseUtcIsoDateTimeString(value);
|
|
231
|
+
if (!parsed.ok) {
|
|
232
|
+
const message = parsed.error === "missing-timezone-offset" ? `Expected an offset-aware ISO datetime, received "${value}"` : `Expected a valid ISO datetime, received "${value}"`;
|
|
233
|
+
throw new Error(message);
|
|
234
|
+
}
|
|
235
|
+
return parsed.value;
|
|
236
|
+
}
|
|
237
|
+
//#endregion
|
|
255
238
|
//#region ../core/src/booking-date-time/local.ts
|
|
256
239
|
const LOCAL_DATE_PATTERN = /^(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})$/u;
|
|
257
240
|
function getZonedDateTimeParts(date, timeZone) {
|
|
@@ -340,59 +323,6 @@ function resolveLocalInstant(targetLocalMs, timeZone, guess, seen) {
|
|
|
340
323
|
return resolveLocalInstant(targetLocalMs, timeZone, nextGuess, [...seen, guess]);
|
|
341
324
|
}
|
|
342
325
|
//#endregion
|
|
343
|
-
//#region ../core/src/booking-date-time/window.ts
|
|
344
|
-
const START_OF_DAY = {
|
|
345
|
-
hour: 0,
|
|
346
|
-
minute: 0,
|
|
347
|
-
second: 0
|
|
348
|
-
};
|
|
349
|
-
function parseWindowDate(value, field) {
|
|
350
|
-
try {
|
|
351
|
-
return {
|
|
352
|
-
ok: true,
|
|
353
|
-
value: parseBookingLocalDate(value)
|
|
354
|
-
};
|
|
355
|
-
} catch {
|
|
356
|
-
return {
|
|
357
|
-
ok: false,
|
|
358
|
-
field,
|
|
359
|
-
reason: "invalid_date_format",
|
|
360
|
-
value
|
|
361
|
-
};
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
function parseBookingUtcDateWindow(input) {
|
|
365
|
-
const timeZone = resolveBookingTimeZoneId(input.timeZone);
|
|
366
|
-
const start = parseWindowDate(input.startDate, "startDate");
|
|
367
|
-
if (!start.ok) return start;
|
|
368
|
-
const end = parseWindowDate(input.endDate, "endDate");
|
|
369
|
-
if (!end.ok) return end;
|
|
370
|
-
const startLocalDate = start.value;
|
|
371
|
-
const endLocalDate = end.value;
|
|
372
|
-
if (compareLocalScheduleDates(startLocalDate, endLocalDate) > 0) return {
|
|
373
|
-
ok: false,
|
|
374
|
-
field: "endDate",
|
|
375
|
-
reason: "invalid_date_range",
|
|
376
|
-
value: input.endDate
|
|
377
|
-
};
|
|
378
|
-
return {
|
|
379
|
-
ok: true,
|
|
380
|
-
value: {
|
|
381
|
-
timeZone,
|
|
382
|
-
startLocalDate,
|
|
383
|
-
endLocalDate,
|
|
384
|
-
startAt: localScheduleDateTimeToUtcDate(startLocalDate, START_OF_DAY, timeZone),
|
|
385
|
-
endExclusive: localScheduleDateTimeToUtcDate(addLocalScheduleDays(endLocalDate, 1), START_OF_DAY, timeZone)
|
|
386
|
-
}
|
|
387
|
-
};
|
|
388
|
-
}
|
|
389
|
-
function buildBookingUtcDateWindow(input) {
|
|
390
|
-
const result = parseBookingUtcDateWindow(input);
|
|
391
|
-
if (result.ok) return result.value;
|
|
392
|
-
if (result.reason === "invalid_date_range") throw new Error(`Invalid booking date range: startDate "${input.startDate}" must be on or before endDate "${input.endDate}"`);
|
|
393
|
-
throw new Error(`Invalid booking date format: "${result.value}" (expected YYYY-MM-DD)`);
|
|
394
|
-
}
|
|
395
|
-
//#endregion
|
|
396
326
|
//#region ../core/src/booking-date-time/scheduled.ts
|
|
397
327
|
function parseStrictBookingTimeZone(timeZone) {
|
|
398
328
|
const parsed = parseBookingTimeZone(timeZone);
|
|
@@ -495,6 +425,31 @@ function resolveBookingDisplayContext(input) {
|
|
|
495
425
|
zone: input.surface !== "dashboard" && input.isOnline || input.sessionTimeZone !== input.siteTimeZone ? "always" : "omit"
|
|
496
426
|
};
|
|
497
427
|
}
|
|
428
|
+
/** Dashboard and assistant site dates read in British English, whatever the site's own language. */
|
|
429
|
+
const SITE_DISPLAY_LOCALE = "en-GB";
|
|
430
|
+
/** The site display policy: `en-GB` in the given zone, falling back to the business zone the server uses. */
|
|
431
|
+
function siteDisplayContext(timeZone) {
|
|
432
|
+
return {
|
|
433
|
+
locale: SITE_DISPLAY_LOCALE,
|
|
434
|
+
timeZone: resolveBookingBusinessTimeZone(timeZone)
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
/** A stored instant as a site date, `22 Sept 2026` by default; an unparseable value is shown as it came. */
|
|
438
|
+
function formatSiteInstantDate(iso, timeZone, options = {}) {
|
|
439
|
+
const parsed = parseUtcIsoDateTimeString(iso);
|
|
440
|
+
return parsed.ok ? formatDate({
|
|
441
|
+
kind: "instant",
|
|
442
|
+
value: parsed.value
|
|
443
|
+
}, siteDisplayContext(timeZone), {
|
|
444
|
+
date: "short",
|
|
445
|
+
...options
|
|
446
|
+
}) : iso;
|
|
447
|
+
}
|
|
448
|
+
/** A stored instant as a site time, `2:05pm` without a zone label by default; an unparseable value is shown as it came. */
|
|
449
|
+
function formatSiteInstantTime(iso, timeZone, options = { zone: "omit" }) {
|
|
450
|
+
const parsed = parseUtcIsoDateTimeString(iso);
|
|
451
|
+
return parsed.ok ? formatTime(parsed.value, siteDisplayContext(timeZone), options) : iso;
|
|
452
|
+
}
|
|
498
453
|
function formatDate(value, context, options = {}) {
|
|
499
454
|
return presentDate(value, context, displayProfile(options, "omit"));
|
|
500
455
|
}
|
|
@@ -700,6 +655,76 @@ function formatTimeZoneCityLabel(timeZone) {
|
|
|
700
655
|
return timeZone.startsWith("Etc/") ? "local time" : `${timeZone.split("/").slice(-1)[0]?.replace(/_/gu, " ") ?? timeZone} time`;
|
|
701
656
|
}
|
|
702
657
|
//#endregion
|
|
658
|
+
//#region ../core/src/booking-payment-options.ts
|
|
659
|
+
/**
|
|
660
|
+
* One way a customer may pay for a booking. This is the single definition of
|
|
661
|
+
* the option type; `booking-payment-schemas.typetest.ts` keeps it equal to the
|
|
662
|
+
* schema's output in both directions.
|
|
663
|
+
*/
|
|
664
|
+
/** When a course's instalments must all be paid by: before its first or its last live session. */
|
|
665
|
+
const BOOKING_COURSE_INSTALMENT_DEADLINES = ["first_session", "last_session"];
|
|
666
|
+
/** Automatic instalments and a flexible balance cannot share one booking offer. */
|
|
667
|
+
function validateBookingPaymentOptionKinds(kinds) {
|
|
668
|
+
if (kinds.length === 0) return err$1("no_options");
|
|
669
|
+
const uniqueKinds = new Set(kinds);
|
|
670
|
+
if (uniqueKinds.size !== kinds.length) return err$1("duplicate_kind");
|
|
671
|
+
if (uniqueKinds.has("instalment_plan") && uniqueKinds.has("flexible_balance")) return err$1("incompatible_collection_options");
|
|
672
|
+
return ok$1(void 0);
|
|
673
|
+
}
|
|
674
|
+
//#endregion
|
|
675
|
+
//#region ../core/src/booking-date-time/window.ts
|
|
676
|
+
const START_OF_DAY = {
|
|
677
|
+
hour: 0,
|
|
678
|
+
minute: 0,
|
|
679
|
+
second: 0
|
|
680
|
+
};
|
|
681
|
+
function parseWindowDate(value, field) {
|
|
682
|
+
try {
|
|
683
|
+
return {
|
|
684
|
+
ok: true,
|
|
685
|
+
value: parseBookingLocalDate(value)
|
|
686
|
+
};
|
|
687
|
+
} catch {
|
|
688
|
+
return {
|
|
689
|
+
ok: false,
|
|
690
|
+
field,
|
|
691
|
+
reason: "invalid_date_format",
|
|
692
|
+
value
|
|
693
|
+
};
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
function parseBookingUtcDateWindow(input) {
|
|
697
|
+
const timeZone = resolveBookingTimeZoneId(input.timeZone);
|
|
698
|
+
const start = parseWindowDate(input.startDate, "startDate");
|
|
699
|
+
if (!start.ok) return start;
|
|
700
|
+
const end = parseWindowDate(input.endDate, "endDate");
|
|
701
|
+
if (!end.ok) return end;
|
|
702
|
+
const startLocalDate = start.value;
|
|
703
|
+
const endLocalDate = end.value;
|
|
704
|
+
if (compareLocalScheduleDates(startLocalDate, endLocalDate) > 0) return {
|
|
705
|
+
ok: false,
|
|
706
|
+
field: "endDate",
|
|
707
|
+
reason: "invalid_date_range",
|
|
708
|
+
value: input.endDate
|
|
709
|
+
};
|
|
710
|
+
return {
|
|
711
|
+
ok: true,
|
|
712
|
+
value: {
|
|
713
|
+
timeZone,
|
|
714
|
+
startLocalDate,
|
|
715
|
+
endLocalDate,
|
|
716
|
+
startAt: localScheduleDateTimeToUtcDate(startLocalDate, START_OF_DAY, timeZone),
|
|
717
|
+
endExclusive: localScheduleDateTimeToUtcDate(addLocalScheduleDays(endLocalDate, 1), START_OF_DAY, timeZone)
|
|
718
|
+
}
|
|
719
|
+
};
|
|
720
|
+
}
|
|
721
|
+
function buildBookingUtcDateWindow(input) {
|
|
722
|
+
const result = parseBookingUtcDateWindow(input);
|
|
723
|
+
if (result.ok) return result.value;
|
|
724
|
+
if (result.reason === "invalid_date_range") throw new Error(`Invalid booking date range: startDate "${input.startDate}" must be on or before endDate "${input.endDate}"`);
|
|
725
|
+
throw new Error(`Invalid booking date format: "${result.value}" (expected YYYY-MM-DD)`);
|
|
726
|
+
}
|
|
727
|
+
//#endregion
|
|
703
728
|
//#region ../core/src/map-drawing/model.ts
|
|
704
729
|
const MAX_DRAWING_BYTES = 1024 * 1024;
|
|
705
730
|
/** Current real city extracts fit with >2x headroom; reservations precede allocation. */
|
|
@@ -1016,114 +1041,30 @@ function isRecord(value) {
|
|
|
1016
1041
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1017
1042
|
}
|
|
1018
1043
|
//#endregion
|
|
1019
|
-
//#region ../
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1044
|
+
//#region ../site-contracts/src/siteData/eventQueries.ts
|
|
1045
|
+
const eventSurfacePresetValues = SURFACE_EVENT_PRESET_VALUES;
|
|
1046
|
+
const eventSurfaceScopeValues = [
|
|
1047
|
+
"all",
|
|
1048
|
+
"regularClassSchedule",
|
|
1049
|
+
"specialDatedEvents",
|
|
1050
|
+
"custom"
|
|
1051
|
+
];
|
|
1052
|
+
const eventScheduleScopeValues = [
|
|
1053
|
+
"any",
|
|
1054
|
+
"recurring",
|
|
1055
|
+
"oneOff"
|
|
1056
|
+
];
|
|
1057
|
+
/** Runtime picker sentinels and bound loader IDs must describe the same query. */
|
|
1058
|
+
function normalizeCalendarFilterId(value) {
|
|
1059
|
+
const id = value?.trim();
|
|
1060
|
+
return !id || id === "all" ? void 0 : id;
|
|
1024
1061
|
}
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
const totalReducibleCents = sanitizedInputs.reduce((sum, input) => sum + input.maxReducibleCents, 0);
|
|
1032
|
-
const targetCents = Math.max(0, Math.min(Math.trunc(requestedCents), totalReducibleCents));
|
|
1033
|
-
const allocations = sanitizedInputs.map((input) => ({
|
|
1034
|
-
lineId: input.lineId,
|
|
1035
|
-
amountCents: toNonNegativeCents(0)
|
|
1036
|
-
}));
|
|
1037
|
-
if (targetCents === 0 || sanitizedInputs.length === 0) return {
|
|
1038
|
-
requestedCents: toNonNegativeCents(requestedCents),
|
|
1039
|
-
appliedCents: toNonNegativeCents(0),
|
|
1040
|
-
allocations
|
|
1041
|
-
};
|
|
1042
|
-
const remainingCaps = sanitizedInputs.map((input) => input.maxReducibleCents);
|
|
1043
|
-
let remainingCents = targetCents;
|
|
1044
|
-
while (remainingCents > 0) {
|
|
1045
|
-
const eligibleIndexes = sanitizedInputs.map((input, index) => ({
|
|
1046
|
-
input,
|
|
1047
|
-
index
|
|
1048
|
-
})).filter(({ input, index }) => input.basisCents > 0 && (remainingCaps[index] ?? 0) > 0);
|
|
1049
|
-
if (eligibleIndexes.length === 0) break;
|
|
1050
|
-
const eligibleBasis = eligibleIndexes.reduce((sum, { input }) => sum + input.basisCents, 0);
|
|
1051
|
-
if (eligibleBasis <= 0) break;
|
|
1052
|
-
const roundCandidates = eligibleIndexes.map(({ input, index }) => {
|
|
1053
|
-
const exactShare = input.basisCents / eligibleBasis * remainingCents;
|
|
1054
|
-
const floorShare = Math.min(Math.floor(exactShare), remainingCaps[index] ?? 0);
|
|
1055
|
-
return {
|
|
1056
|
-
index,
|
|
1057
|
-
floorShare,
|
|
1058
|
-
remainder: exactShare - floorShare
|
|
1059
|
-
};
|
|
1060
|
-
});
|
|
1061
|
-
let assignedThisRound = 0;
|
|
1062
|
-
for (const candidate of roundCandidates) {
|
|
1063
|
-
if (candidate.floorShare <= 0) continue;
|
|
1064
|
-
const allocation = allocations[candidate.index];
|
|
1065
|
-
if (!allocation) continue;
|
|
1066
|
-
allocation.amountCents = toNonNegativeCents(allocation.amountCents + candidate.floorShare);
|
|
1067
|
-
remainingCaps[candidate.index] = toNonNegativeCents((remainingCaps[candidate.index] ?? 0) - candidate.floorShare);
|
|
1068
|
-
assignedThisRound += candidate.floorShare;
|
|
1069
|
-
}
|
|
1070
|
-
remainingCents -= assignedThisRound;
|
|
1071
|
-
if (remainingCents <= 0) break;
|
|
1072
|
-
const remainderCandidates = roundCandidates.filter((candidate) => (remainingCaps[candidate.index] ?? 0) > 0).sort((a, b) => {
|
|
1073
|
-
if (b.remainder !== a.remainder) return b.remainder - a.remainder;
|
|
1074
|
-
return a.index - b.index;
|
|
1075
|
-
});
|
|
1076
|
-
if (remainderCandidates.length === 0) break;
|
|
1077
|
-
let remainderAssigned = 0;
|
|
1078
|
-
for (const candidate of remainderCandidates) {
|
|
1079
|
-
if (remainingCents <= 0) break;
|
|
1080
|
-
if ((remainingCaps[candidate.index] ?? 0) <= 0) continue;
|
|
1081
|
-
const allocation = allocations[candidate.index];
|
|
1082
|
-
if (!allocation) continue;
|
|
1083
|
-
allocation.amountCents = toNonNegativeCents(allocation.amountCents + 1);
|
|
1084
|
-
remainingCaps[candidate.index] = toNonNegativeCents((remainingCaps[candidate.index] ?? 0) - 1);
|
|
1085
|
-
remainingCents -= 1;
|
|
1086
|
-
remainderAssigned += 1;
|
|
1087
|
-
}
|
|
1088
|
-
if (assignedThisRound === 0 && remainderAssigned === 0) break;
|
|
1089
|
-
}
|
|
1090
|
-
const appliedCents = allocations.reduce((sum, allocation) => sum + allocation.amountCents, 0);
|
|
1091
|
-
return {
|
|
1092
|
-
requestedCents: toNonNegativeCents(requestedCents),
|
|
1093
|
-
appliedCents: toNonNegativeCents(appliedCents),
|
|
1094
|
-
allocations
|
|
1095
|
-
};
|
|
1096
|
-
}
|
|
1097
|
-
//#endregion
|
|
1098
|
-
//#region ../commerce/src/purchase/checkoutQuantity.ts
|
|
1099
|
-
function unsafeAsPositiveCheckoutQuantity(quantity) {
|
|
1100
|
-
return quantity;
|
|
1101
|
-
}
|
|
1102
|
-
//#endregion
|
|
1103
|
-
//#region ../site-contracts/src/siteData/eventQueries.ts
|
|
1104
|
-
const eventSurfacePresetValues = SURFACE_EVENT_PRESET_VALUES;
|
|
1105
|
-
const eventSurfaceScopeValues = [
|
|
1106
|
-
"all",
|
|
1107
|
-
"regularClassSchedule",
|
|
1108
|
-
"specialDatedEvents",
|
|
1109
|
-
"custom"
|
|
1110
|
-
];
|
|
1111
|
-
const eventScheduleScopeValues = [
|
|
1112
|
-
"any",
|
|
1113
|
-
"recurring",
|
|
1114
|
-
"oneOff"
|
|
1115
|
-
];
|
|
1116
|
-
/** Runtime picker sentinels and bound loader IDs must describe the same query. */
|
|
1117
|
-
function normalizeCalendarFilterId(value) {
|
|
1118
|
-
const id = value?.trim();
|
|
1119
|
-
return !id || id === "all" ? void 0 : id;
|
|
1120
|
-
}
|
|
1121
|
-
const calendarMonthSchema = z.string().regex(/^\d{4}-(0[1-9]|1[0-2])$/).refine((month) => Number(month.slice(0, 4)) > 0, "Invalid calendar year");
|
|
1122
|
-
function calendarMonthDate(month) {
|
|
1123
|
-
return {
|
|
1124
|
-
year: Number(month.slice(0, 4)),
|
|
1125
|
-
month: Number(month.slice(5, 7)),
|
|
1126
|
-
day: 1
|
|
1062
|
+
const calendarMonthSchema = z.string().regex(/^\d{4}-(0[1-9]|1[0-2])$/).refine((month) => Number(month.slice(0, 4)) > 0, "Invalid calendar year");
|
|
1063
|
+
function calendarMonthDate(month) {
|
|
1064
|
+
return {
|
|
1065
|
+
year: Number(month.slice(0, 4)),
|
|
1066
|
+
month: Number(month.slice(5, 7)),
|
|
1067
|
+
day: 1
|
|
1127
1068
|
};
|
|
1128
1069
|
}
|
|
1129
1070
|
const monthNumber = (month) => {
|
|
@@ -1325,6 +1266,167 @@ const eventCalendarListLayoutValues = [
|
|
|
1325
1266
|
];
|
|
1326
1267
|
const eventCalendarListLayoutCompatibleDisplayModeValues = ["combined", "list"];
|
|
1327
1268
|
//#endregion
|
|
1269
|
+
//#region ../commerce/src/purchase/settlement.ts
|
|
1270
|
+
function normalizeCurrencyCode(raw) {
|
|
1271
|
+
const normalized = raw.trim().toUpperCase();
|
|
1272
|
+
if (!/^[A-Z]{3}$/.test(normalized)) throw new Error(`Invalid currency code: ${raw}`);
|
|
1273
|
+
return normalized;
|
|
1274
|
+
}
|
|
1275
|
+
function allocateReductionCents(inputs, requestedCents) {
|
|
1276
|
+
const sanitizedInputs = inputs.map((input) => ({
|
|
1277
|
+
lineId: input.lineId,
|
|
1278
|
+
basisCents: toNonNegativeCents(input.basisCents),
|
|
1279
|
+
maxReducibleCents: toNonNegativeCents(input.maxReducibleCents)
|
|
1280
|
+
}));
|
|
1281
|
+
const totalReducibleCents = sanitizedInputs.reduce((sum, input) => sum + input.maxReducibleCents, 0);
|
|
1282
|
+
const targetCents = Math.max(0, Math.min(Math.trunc(requestedCents), totalReducibleCents));
|
|
1283
|
+
const allocations = sanitizedInputs.map((input) => ({
|
|
1284
|
+
lineId: input.lineId,
|
|
1285
|
+
amountCents: toNonNegativeCents(0)
|
|
1286
|
+
}));
|
|
1287
|
+
if (targetCents === 0 || sanitizedInputs.length === 0) return {
|
|
1288
|
+
requestedCents: toNonNegativeCents(requestedCents),
|
|
1289
|
+
appliedCents: toNonNegativeCents(0),
|
|
1290
|
+
allocations
|
|
1291
|
+
};
|
|
1292
|
+
const remainingCaps = sanitizedInputs.map((input) => input.maxReducibleCents);
|
|
1293
|
+
let remainingCents = targetCents;
|
|
1294
|
+
while (remainingCents > 0) {
|
|
1295
|
+
const eligibleIndexes = sanitizedInputs.map((input, index) => ({
|
|
1296
|
+
input,
|
|
1297
|
+
index
|
|
1298
|
+
})).filter(({ input, index }) => input.basisCents > 0 && (remainingCaps[index] ?? 0) > 0);
|
|
1299
|
+
if (eligibleIndexes.length === 0) break;
|
|
1300
|
+
const eligibleBasis = eligibleIndexes.reduce((sum, { input }) => sum + input.basisCents, 0);
|
|
1301
|
+
if (eligibleBasis <= 0) break;
|
|
1302
|
+
const roundCandidates = eligibleIndexes.map(({ input, index }) => {
|
|
1303
|
+
const exactShare = input.basisCents / eligibleBasis * remainingCents;
|
|
1304
|
+
const floorShare = Math.min(Math.floor(exactShare), remainingCaps[index] ?? 0);
|
|
1305
|
+
return {
|
|
1306
|
+
index,
|
|
1307
|
+
floorShare,
|
|
1308
|
+
remainder: exactShare - floorShare
|
|
1309
|
+
};
|
|
1310
|
+
});
|
|
1311
|
+
let assignedThisRound = 0;
|
|
1312
|
+
for (const candidate of roundCandidates) {
|
|
1313
|
+
if (candidate.floorShare <= 0) continue;
|
|
1314
|
+
const allocation = allocations[candidate.index];
|
|
1315
|
+
if (!allocation) continue;
|
|
1316
|
+
allocation.amountCents = toNonNegativeCents(allocation.amountCents + candidate.floorShare);
|
|
1317
|
+
remainingCaps[candidate.index] = toNonNegativeCents((remainingCaps[candidate.index] ?? 0) - candidate.floorShare);
|
|
1318
|
+
assignedThisRound += candidate.floorShare;
|
|
1319
|
+
}
|
|
1320
|
+
remainingCents -= assignedThisRound;
|
|
1321
|
+
if (remainingCents <= 0) break;
|
|
1322
|
+
const remainderCandidates = roundCandidates.filter((candidate) => (remainingCaps[candidate.index] ?? 0) > 0).sort((a, b) => {
|
|
1323
|
+
if (b.remainder !== a.remainder) return b.remainder - a.remainder;
|
|
1324
|
+
return a.index - b.index;
|
|
1325
|
+
});
|
|
1326
|
+
if (remainderCandidates.length === 0) break;
|
|
1327
|
+
let remainderAssigned = 0;
|
|
1328
|
+
for (const candidate of remainderCandidates) {
|
|
1329
|
+
if (remainingCents <= 0) break;
|
|
1330
|
+
if ((remainingCaps[candidate.index] ?? 0) <= 0) continue;
|
|
1331
|
+
const allocation = allocations[candidate.index];
|
|
1332
|
+
if (!allocation) continue;
|
|
1333
|
+
allocation.amountCents = toNonNegativeCents(allocation.amountCents + 1);
|
|
1334
|
+
remainingCaps[candidate.index] = toNonNegativeCents((remainingCaps[candidate.index] ?? 0) - 1);
|
|
1335
|
+
remainingCents -= 1;
|
|
1336
|
+
remainderAssigned += 1;
|
|
1337
|
+
}
|
|
1338
|
+
if (assignedThisRound === 0 && remainderAssigned === 0) break;
|
|
1339
|
+
}
|
|
1340
|
+
const appliedCents = allocations.reduce((sum, allocation) => sum + allocation.amountCents, 0);
|
|
1341
|
+
return {
|
|
1342
|
+
requestedCents: toNonNegativeCents(requestedCents),
|
|
1343
|
+
appliedCents: toNonNegativeCents(appliedCents),
|
|
1344
|
+
allocations
|
|
1345
|
+
};
|
|
1346
|
+
}
|
|
1347
|
+
//#endregion
|
|
1348
|
+
//#region ../commerce/src/purchase/checkoutQuantity.ts
|
|
1349
|
+
function unsafeAsPositiveCheckoutQuantity(quantity) {
|
|
1350
|
+
return quantity;
|
|
1351
|
+
}
|
|
1352
|
+
//#endregion
|
|
1353
|
+
//#region ../site-contracts/src/identity/presentationVocabulary.ts
|
|
1354
|
+
const arrangementModes = [
|
|
1355
|
+
"list",
|
|
1356
|
+
"calendar",
|
|
1357
|
+
"week",
|
|
1358
|
+
"combined"
|
|
1359
|
+
];
|
|
1360
|
+
function isArrangementMode(value) {
|
|
1361
|
+
return value === "list" || value === "calendar" || value === "week" || value === "combined";
|
|
1362
|
+
}
|
|
1363
|
+
/** Every transition that draws something; `none` is the absence of a join. */
|
|
1364
|
+
const decorativeTransitionIntentValues = [
|
|
1365
|
+
"soft-fade-short",
|
|
1366
|
+
"soft-fade-long",
|
|
1367
|
+
"soft-fade-expansive",
|
|
1368
|
+
"wave-edge",
|
|
1369
|
+
"wave-edge-balanced",
|
|
1370
|
+
"wave-edge-gentle",
|
|
1371
|
+
"wave-edge-bold",
|
|
1372
|
+
"wave-edge-drift",
|
|
1373
|
+
"wave-edge-echo",
|
|
1374
|
+
"arc-edge-echo",
|
|
1375
|
+
"arc-edge-bulge",
|
|
1376
|
+
"angle-edge",
|
|
1377
|
+
"angle-edge-subtle",
|
|
1378
|
+
"angle-edge-steep"
|
|
1379
|
+
];
|
|
1380
|
+
const tileTreatmentValues = [
|
|
1381
|
+
"default",
|
|
1382
|
+
"quiet",
|
|
1383
|
+
"brand-depth"
|
|
1384
|
+
];
|
|
1385
|
+
const eventListTreatmentValues = [
|
|
1386
|
+
"plain",
|
|
1387
|
+
"lined-panel",
|
|
1388
|
+
"ruled-register",
|
|
1389
|
+
"editorial-register",
|
|
1390
|
+
"dense-index"
|
|
1391
|
+
];
|
|
1392
|
+
const eyebrowTreatmentValues = [
|
|
1393
|
+
"plain",
|
|
1394
|
+
"accent",
|
|
1395
|
+
"pill",
|
|
1396
|
+
"accent-pill",
|
|
1397
|
+
"pill-bounce",
|
|
1398
|
+
"accent-pill-bounce"
|
|
1399
|
+
];
|
|
1400
|
+
const visibleHeadingDecorationFamilyValues = ["organic-squiggle", "short-center-rule"];
|
|
1401
|
+
const headingDecorationOverrideValues = ["site-default", "off"];
|
|
1402
|
+
const headingDecorationColorTokenValues = [
|
|
1403
|
+
"text",
|
|
1404
|
+
"primary",
|
|
1405
|
+
"secondary",
|
|
1406
|
+
"accent",
|
|
1407
|
+
"border",
|
|
1408
|
+
"muted"
|
|
1409
|
+
];
|
|
1410
|
+
const accordionIconSetValues = [
|
|
1411
|
+
"plus",
|
|
1412
|
+
"chevron",
|
|
1413
|
+
"caret",
|
|
1414
|
+
"minimal-cross"
|
|
1415
|
+
];
|
|
1416
|
+
const accordionIconColorTokenValues = [
|
|
1417
|
+
"text",
|
|
1418
|
+
"muted",
|
|
1419
|
+
"primary",
|
|
1420
|
+
"secondary",
|
|
1421
|
+
"accent",
|
|
1422
|
+
"current"
|
|
1423
|
+
];
|
|
1424
|
+
const accordionIconMotionValues = [
|
|
1425
|
+
"none",
|
|
1426
|
+
"rotate",
|
|
1427
|
+
"swap"
|
|
1428
|
+
];
|
|
1429
|
+
//#endregion
|
|
1328
1430
|
//#region ../media-core/src/mediaKinds.ts
|
|
1329
1431
|
const mediaTypeDiscriminants = [
|
|
1330
1432
|
"image",
|
|
@@ -1529,45 +1631,152 @@ function isRichTextDoc(value) {
|
|
|
1529
1631
|
*/
|
|
1530
1632
|
function createRichTextDoc(paragraphs) {
|
|
1531
1633
|
return {
|
|
1532
|
-
type: "doc",
|
|
1533
|
-
content: paragraphs.map((text) => text ? {
|
|
1534
|
-
type: "paragraph",
|
|
1535
|
-
content: [{
|
|
1536
|
-
type: "text",
|
|
1537
|
-
text
|
|
1538
|
-
}]
|
|
1539
|
-
} : { type: "paragraph" })
|
|
1634
|
+
type: "doc",
|
|
1635
|
+
content: paragraphs.map((text) => text ? {
|
|
1636
|
+
type: "paragraph",
|
|
1637
|
+
content: [{
|
|
1638
|
+
type: "text",
|
|
1639
|
+
text
|
|
1640
|
+
}]
|
|
1641
|
+
} : { type: "paragraph" })
|
|
1642
|
+
};
|
|
1643
|
+
}
|
|
1644
|
+
/**
|
|
1645
|
+
* Build Zod validation schema for rich text fields
|
|
1646
|
+
*
|
|
1647
|
+
* @param options - Optional configuration
|
|
1648
|
+
* @param options.required - If true, validates that content is not empty
|
|
1649
|
+
* @param options.label - Field label for error messages (defaults to 'This field')
|
|
1650
|
+
* @returns Zod schema for rich text validation
|
|
1651
|
+
*
|
|
1652
|
+
* @example
|
|
1653
|
+
* // Basic usage
|
|
1654
|
+
* const schema = buildRichTextSchema()
|
|
1655
|
+
*
|
|
1656
|
+
* @example
|
|
1657
|
+
* // Required field with custom label
|
|
1658
|
+
* const schema = buildRichTextSchema({ required: true, label: 'Description' })
|
|
1659
|
+
*/
|
|
1660
|
+
function buildRichTextSchema(options) {
|
|
1661
|
+
if (options?.required === true) {
|
|
1662
|
+
const label = options.label ?? "This field";
|
|
1663
|
+
return RichTextDocSchema.refine((val) => {
|
|
1664
|
+
const content = val.content;
|
|
1665
|
+
if (!Array.isArray(content) || content.length === 0) return false;
|
|
1666
|
+
const first = content[0];
|
|
1667
|
+
if (content.length === 1 && isRecord(first) && first.type === "paragraph" && (!("content" in first) || first.content == null)) return false;
|
|
1668
|
+
return true;
|
|
1669
|
+
}, { message: `${label} is required` });
|
|
1670
|
+
}
|
|
1671
|
+
return RichTextDocSchema;
|
|
1672
|
+
}
|
|
1673
|
+
//#endregion
|
|
1674
|
+
//#region ../blocks/src/system/constants/events.ts
|
|
1675
|
+
/**
|
|
1676
|
+
* Event-related constants
|
|
1677
|
+
*
|
|
1678
|
+
* Shared constants for event content types and booking system integration.
|
|
1679
|
+
*/
|
|
1680
|
+
const arrangementOnlyListLayouts = [
|
|
1681
|
+
"ledger",
|
|
1682
|
+
"timetable-rows",
|
|
1683
|
+
"day-groups",
|
|
1684
|
+
"week-groups",
|
|
1685
|
+
"week-columns"
|
|
1686
|
+
];
|
|
1687
|
+
const eventListArrangementValues = [...eventCalendarListLayoutValues, ...arrangementOnlyListLayouts];
|
|
1688
|
+
const eventCalendarListLayoutOptions = [
|
|
1689
|
+
{
|
|
1690
|
+
id: "stack",
|
|
1691
|
+
label: "Stack"
|
|
1692
|
+
},
|
|
1693
|
+
{
|
|
1694
|
+
id: "grid",
|
|
1695
|
+
label: "Grid"
|
|
1696
|
+
},
|
|
1697
|
+
{
|
|
1698
|
+
id: "compact",
|
|
1699
|
+
label: "Compact"
|
|
1700
|
+
}
|
|
1701
|
+
];
|
|
1702
|
+
function isEventCalendarDisplayMode(value) {
|
|
1703
|
+
return typeof value === "string" && eventCalendarDisplayModeValues.includes(value);
|
|
1704
|
+
}
|
|
1705
|
+
function normalizeEventCalendarDisplayMode(input) {
|
|
1706
|
+
if (isEventCalendarDisplayMode(input.variant)) return input.variant;
|
|
1707
|
+
return isEventCalendarDisplayMode(input.displayMode) ? input.displayMode : void 0;
|
|
1708
|
+
}
|
|
1709
|
+
/**
|
|
1710
|
+
* One closed authority for the projections each mode needs on the server. Combined always opens on
|
|
1711
|
+
* its list, so its calendar tab reads its own months in the browser when it opens.
|
|
1712
|
+
*/
|
|
1713
|
+
function resolveEventCalendarReadPlan(input) {
|
|
1714
|
+
const mode = normalizeEventCalendarDisplayMode(input) ?? "combined";
|
|
1715
|
+
switch (mode) {
|
|
1716
|
+
case "combined": return {
|
|
1717
|
+
mode,
|
|
1718
|
+
jobs: "list",
|
|
1719
|
+
readProfile: "listing-card"
|
|
1720
|
+
};
|
|
1721
|
+
case "week": return {
|
|
1722
|
+
mode,
|
|
1723
|
+
jobs: "schedule",
|
|
1724
|
+
readProfile: "listing-card"
|
|
1725
|
+
};
|
|
1726
|
+
case "list": return {
|
|
1727
|
+
mode,
|
|
1728
|
+
jobs: "list",
|
|
1729
|
+
readProfile: "listing-card"
|
|
1730
|
+
};
|
|
1731
|
+
case "calendar": return {
|
|
1732
|
+
mode,
|
|
1733
|
+
jobs: "calendar",
|
|
1734
|
+
readProfile: "listing-card"
|
|
1735
|
+
};
|
|
1736
|
+
case "timetable":
|
|
1737
|
+
case "week-board": return {
|
|
1738
|
+
mode,
|
|
1739
|
+
jobs: "calendar",
|
|
1740
|
+
readProfile: "timetable"
|
|
1741
|
+
};
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
function isEventCalendarDefaultView(value) {
|
|
1745
|
+
return typeof value === "string" && eventCalendarDefaultViewValues.includes(value);
|
|
1746
|
+
}
|
|
1747
|
+
function isEventCalendarListLayout(value) {
|
|
1748
|
+
return typeof value === "string" && eventCalendarListLayoutValues.includes(value);
|
|
1749
|
+
}
|
|
1750
|
+
/** The calendar manifest owns its secondary arrangement axis. */
|
|
1751
|
+
const eventCalendarVariantMeaning = {
|
|
1752
|
+
kind: "mode",
|
|
1753
|
+
modes: arrangementModes,
|
|
1754
|
+
defaultMode: "list",
|
|
1755
|
+
arrangementField: "listLayout",
|
|
1756
|
+
keys: eventCalendarListLayoutValues,
|
|
1757
|
+
lookOnlyKeys: [
|
|
1758
|
+
...arrangementOnlyListLayouts,
|
|
1759
|
+
"month-grid",
|
|
1760
|
+
"month-day"
|
|
1761
|
+
],
|
|
1762
|
+
defaultKey: "stack",
|
|
1763
|
+
modeLabels: {
|
|
1764
|
+
list: "List",
|
|
1765
|
+
calendar: "Month",
|
|
1766
|
+
combined: "List and month",
|
|
1767
|
+
timetable: "Timetable",
|
|
1768
|
+
"week-board": "Week board",
|
|
1769
|
+
week: "Week"
|
|
1770
|
+
}
|
|
1771
|
+
};
|
|
1772
|
+
/** Weekly lists share the arrangement-Look admission used by calendar arrangements. */
|
|
1773
|
+
function eventCalendarListGroupingDecision(input) {
|
|
1774
|
+
const available = input.arrangementLooks && resolveEventCalendarReadPlan(input).mode === "list";
|
|
1775
|
+
return {
|
|
1776
|
+
available,
|
|
1777
|
+
grouping: available && input.listBy === "week" ? "week" : "upcoming"
|
|
1540
1778
|
};
|
|
1541
1779
|
}
|
|
1542
|
-
/**
|
|
1543
|
-
* Build Zod validation schema for rich text fields
|
|
1544
|
-
*
|
|
1545
|
-
* @param options - Optional configuration
|
|
1546
|
-
* @param options.required - If true, validates that content is not empty
|
|
1547
|
-
* @param options.label - Field label for error messages (defaults to 'This field')
|
|
1548
|
-
* @returns Zod schema for rich text validation
|
|
1549
|
-
*
|
|
1550
|
-
* @example
|
|
1551
|
-
* // Basic usage
|
|
1552
|
-
* const schema = buildRichTextSchema()
|
|
1553
|
-
*
|
|
1554
|
-
* @example
|
|
1555
|
-
* // Required field with custom label
|
|
1556
|
-
* const schema = buildRichTextSchema({ required: true, label: 'Description' })
|
|
1557
|
-
*/
|
|
1558
|
-
function buildRichTextSchema(options) {
|
|
1559
|
-
if (options?.required === true) {
|
|
1560
|
-
const label = options.label ?? "This field";
|
|
1561
|
-
return RichTextDocSchema.refine((val) => {
|
|
1562
|
-
const content = val.content;
|
|
1563
|
-
if (!Array.isArray(content) || content.length === 0) return false;
|
|
1564
|
-
const first = content[0];
|
|
1565
|
-
if (content.length === 1 && isRecord(first) && first.type === "paragraph" && (!("content" in first) || first.content == null)) return false;
|
|
1566
|
-
return true;
|
|
1567
|
-
}, { message: `${label} is required` });
|
|
1568
|
-
}
|
|
1569
|
-
return RichTextDocSchema;
|
|
1570
|
-
}
|
|
1571
1780
|
//#endregion
|
|
1572
1781
|
//#region ../blocks/src/system/runtime/api/schemas/bookingQuestions.ts
|
|
1573
1782
|
const optionSchema = z.object({
|
|
@@ -2048,6 +2257,8 @@ const publicWholeSeriesRunSchema = z.object({
|
|
|
2048
2257
|
eventSeriesId: z.string(),
|
|
2049
2258
|
eventOfferingId: z.string(),
|
|
2050
2259
|
enrollmentOpen: z.boolean(),
|
|
2260
|
+
/** Present when bookings stop before the first session. Older sites ignore it. */
|
|
2261
|
+
bookingClosesAt: z.string().optional(),
|
|
2051
2262
|
visibility: z.enum(["public", "unlisted"]),
|
|
2052
2263
|
lifecycle: z.enum([
|
|
2053
2264
|
"upcoming",
|
|
@@ -2095,6 +2306,11 @@ const publicEventBaseSchema = z.object({
|
|
|
2095
2306
|
requiresRegistration: z.boolean(),
|
|
2096
2307
|
bookingAvailability: publicEventBookingAvailabilitySchema,
|
|
2097
2308
|
bookingClosedDetail: publicEventBookingClosedDetailSchema.optional(),
|
|
2309
|
+
/**
|
|
2310
|
+
* Present when bookings stop before this date starts. It's what says "closed
|
|
2311
|
+
* early": the closed reasons stay as they are, so older sites keep working.
|
|
2312
|
+
*/
|
|
2313
|
+
bookingClosesAt: z.string().optional(),
|
|
2098
2314
|
deliveryMode: z.enum([
|
|
2099
2315
|
"in_person",
|
|
2100
2316
|
"online",
|
|
@@ -2164,189 +2380,9 @@ const publicEventSchema = z.union([publicEventBaseSchema.extend({
|
|
|
2164
2380
|
*/
|
|
2165
2381
|
const publicEventsArraySchema = z.array(publicEventSchema);
|
|
2166
2382
|
//#endregion
|
|
2167
|
-
//#region ../
|
|
2168
|
-
const
|
|
2169
|
-
|
|
2170
|
-
"calendar",
|
|
2171
|
-
"week",
|
|
2172
|
-
"combined"
|
|
2173
|
-
];
|
|
2174
|
-
function isArrangementMode(value) {
|
|
2175
|
-
return value === "list" || value === "calendar" || value === "week" || value === "combined";
|
|
2176
|
-
}
|
|
2177
|
-
/** Every transition that draws something; `none` is the absence of a join. */
|
|
2178
|
-
const decorativeTransitionIntentValues = [
|
|
2179
|
-
"soft-fade-short",
|
|
2180
|
-
"soft-fade-long",
|
|
2181
|
-
"soft-fade-expansive",
|
|
2182
|
-
"wave-edge",
|
|
2183
|
-
"wave-edge-balanced",
|
|
2184
|
-
"wave-edge-gentle",
|
|
2185
|
-
"wave-edge-bold",
|
|
2186
|
-
"wave-edge-drift",
|
|
2187
|
-
"wave-edge-echo",
|
|
2188
|
-
"arc-edge-echo",
|
|
2189
|
-
"arc-edge-bulge",
|
|
2190
|
-
"angle-edge",
|
|
2191
|
-
"angle-edge-subtle",
|
|
2192
|
-
"angle-edge-steep"
|
|
2193
|
-
];
|
|
2194
|
-
const tileTreatmentValues = [
|
|
2195
|
-
"default",
|
|
2196
|
-
"quiet",
|
|
2197
|
-
"brand-depth"
|
|
2198
|
-
];
|
|
2199
|
-
const eventListTreatmentValues = [
|
|
2200
|
-
"plain",
|
|
2201
|
-
"lined-panel",
|
|
2202
|
-
"ruled-register",
|
|
2203
|
-
"editorial-register",
|
|
2204
|
-
"dense-index"
|
|
2205
|
-
];
|
|
2206
|
-
const eyebrowTreatmentValues = [
|
|
2207
|
-
"plain",
|
|
2208
|
-
"accent",
|
|
2209
|
-
"pill",
|
|
2210
|
-
"accent-pill",
|
|
2211
|
-
"pill-bounce",
|
|
2212
|
-
"accent-pill-bounce"
|
|
2213
|
-
];
|
|
2214
|
-
const visibleHeadingDecorationFamilyValues = ["organic-squiggle", "short-center-rule"];
|
|
2215
|
-
const headingDecorationOverrideValues = ["site-default", "off"];
|
|
2216
|
-
const headingDecorationColorTokenValues = [
|
|
2217
|
-
"text",
|
|
2218
|
-
"primary",
|
|
2219
|
-
"secondary",
|
|
2220
|
-
"accent",
|
|
2221
|
-
"border",
|
|
2222
|
-
"muted"
|
|
2223
|
-
];
|
|
2224
|
-
const accordionIconSetValues = [
|
|
2225
|
-
"plus",
|
|
2226
|
-
"chevron",
|
|
2227
|
-
"caret",
|
|
2228
|
-
"minimal-cross"
|
|
2229
|
-
];
|
|
2230
|
-
const accordionIconColorTokenValues = [
|
|
2231
|
-
"text",
|
|
2232
|
-
"muted",
|
|
2233
|
-
"primary",
|
|
2234
|
-
"secondary",
|
|
2235
|
-
"accent",
|
|
2236
|
-
"current"
|
|
2237
|
-
];
|
|
2238
|
-
const accordionIconMotionValues = [
|
|
2239
|
-
"none",
|
|
2240
|
-
"rotate",
|
|
2241
|
-
"swap"
|
|
2242
|
-
];
|
|
2243
|
-
//#endregion
|
|
2244
|
-
//#region ../blocks/src/system/constants/events.ts
|
|
2245
|
-
/**
|
|
2246
|
-
* Event-related constants
|
|
2247
|
-
*
|
|
2248
|
-
* Shared constants for event content types and booking system integration.
|
|
2249
|
-
*/
|
|
2250
|
-
const arrangementOnlyListLayouts = [
|
|
2251
|
-
"ledger",
|
|
2252
|
-
"timetable-rows",
|
|
2253
|
-
"day-groups",
|
|
2254
|
-
"week-groups",
|
|
2255
|
-
"week-columns"
|
|
2256
|
-
];
|
|
2257
|
-
const eventListArrangementValues = [...eventCalendarListLayoutValues, ...arrangementOnlyListLayouts];
|
|
2258
|
-
const eventCalendarListLayoutOptions = [
|
|
2259
|
-
{
|
|
2260
|
-
id: "stack",
|
|
2261
|
-
label: "Stack"
|
|
2262
|
-
},
|
|
2263
|
-
{
|
|
2264
|
-
id: "grid",
|
|
2265
|
-
label: "Grid"
|
|
2266
|
-
},
|
|
2267
|
-
{
|
|
2268
|
-
id: "compact",
|
|
2269
|
-
label: "Compact"
|
|
2270
|
-
}
|
|
2271
|
-
];
|
|
2272
|
-
function isEventCalendarDisplayMode(value) {
|
|
2273
|
-
return typeof value === "string" && eventCalendarDisplayModeValues.includes(value);
|
|
2274
|
-
}
|
|
2275
|
-
function normalizeEventCalendarDisplayMode(input) {
|
|
2276
|
-
if (isEventCalendarDisplayMode(input.variant)) return input.variant;
|
|
2277
|
-
return isEventCalendarDisplayMode(input.displayMode) ? input.displayMode : void 0;
|
|
2278
|
-
}
|
|
2279
|
-
/**
|
|
2280
|
-
* One closed authority for the projections each mode needs on the server. Combined always opens on
|
|
2281
|
-
* its list, so its calendar tab reads its own months in the browser when it opens.
|
|
2282
|
-
*/
|
|
2283
|
-
function resolveEventCalendarReadPlan(input) {
|
|
2284
|
-
const mode = normalizeEventCalendarDisplayMode(input) ?? "combined";
|
|
2285
|
-
switch (mode) {
|
|
2286
|
-
case "combined": return {
|
|
2287
|
-
mode,
|
|
2288
|
-
jobs: "list",
|
|
2289
|
-
readProfile: "listing-card"
|
|
2290
|
-
};
|
|
2291
|
-
case "week": return {
|
|
2292
|
-
mode,
|
|
2293
|
-
jobs: "schedule",
|
|
2294
|
-
readProfile: "listing-card"
|
|
2295
|
-
};
|
|
2296
|
-
case "list": return {
|
|
2297
|
-
mode,
|
|
2298
|
-
jobs: "list",
|
|
2299
|
-
readProfile: "listing-card"
|
|
2300
|
-
};
|
|
2301
|
-
case "calendar": return {
|
|
2302
|
-
mode,
|
|
2303
|
-
jobs: "calendar",
|
|
2304
|
-
readProfile: "listing-card"
|
|
2305
|
-
};
|
|
2306
|
-
case "timetable":
|
|
2307
|
-
case "week-board": return {
|
|
2308
|
-
mode,
|
|
2309
|
-
jobs: "calendar",
|
|
2310
|
-
readProfile: "timetable"
|
|
2311
|
-
};
|
|
2312
|
-
}
|
|
2313
|
-
}
|
|
2314
|
-
function isEventCalendarDefaultView(value) {
|
|
2315
|
-
return typeof value === "string" && eventCalendarDefaultViewValues.includes(value);
|
|
2316
|
-
}
|
|
2317
|
-
function isEventCalendarListLayout(value) {
|
|
2318
|
-
return typeof value === "string" && eventCalendarListLayoutValues.includes(value);
|
|
2319
|
-
}
|
|
2320
|
-
/** The calendar manifest owns its secondary arrangement axis. */
|
|
2321
|
-
const eventCalendarVariantMeaning = {
|
|
2322
|
-
kind: "mode",
|
|
2323
|
-
modes: arrangementModes,
|
|
2324
|
-
defaultMode: "list",
|
|
2325
|
-
arrangementField: "listLayout",
|
|
2326
|
-
keys: eventCalendarListLayoutValues,
|
|
2327
|
-
lookOnlyKeys: [
|
|
2328
|
-
...arrangementOnlyListLayouts,
|
|
2329
|
-
"month-grid",
|
|
2330
|
-
"month-day"
|
|
2331
|
-
],
|
|
2332
|
-
defaultKey: "stack",
|
|
2333
|
-
modeLabels: {
|
|
2334
|
-
list: "List",
|
|
2335
|
-
calendar: "Month",
|
|
2336
|
-
combined: "List and month",
|
|
2337
|
-
timetable: "Timetable",
|
|
2338
|
-
"week-board": "Week board",
|
|
2339
|
-
week: "Week"
|
|
2340
|
-
}
|
|
2341
|
-
};
|
|
2342
|
-
/** Weekly lists share the arrangement-Look admission used by calendar arrangements. */
|
|
2343
|
-
function eventCalendarListGroupingDecision(input) {
|
|
2344
|
-
const available = input.arrangementLooks && resolveEventCalendarReadPlan(input).mode === "list";
|
|
2345
|
-
return {
|
|
2346
|
-
available,
|
|
2347
|
-
grouping: available && input.listBy === "week" ? "week" : "upcoming"
|
|
2348
|
-
};
|
|
2349
|
-
}
|
|
2383
|
+
//#region ../blocks/src/system/blocks/shop.shared.ts
|
|
2384
|
+
const publicPassProductCollectionSchema = z.object({ passes: z.array(publicPassProductSchema) });
|
|
2385
|
+
const publicMembershipProductCollectionSchema = z.object({ memberships: z.array(publicMembershipProductSchema) });
|
|
2350
2386
|
//#endregion
|
|
2351
2387
|
//#region ../blocks/src/system/blocks/events/shared/calendarWindow.ts
|
|
2352
2388
|
function resolveCalendarReadProfile(content) {
|
|
@@ -2436,34 +2472,15 @@ function planCalendarMonthRanges(months) {
|
|
|
2436
2472
|
return ranges;
|
|
2437
2473
|
}
|
|
2438
2474
|
//#endregion
|
|
2439
|
-
//#region ../
|
|
2440
|
-
const
|
|
2441
|
-
const
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
const EVENT_BOOKING_DECODER_QUERY = "bookingDecoder";
|
|
2448
|
-
const EVENT_BOOKING_RESPONSE_QUERY = {
|
|
2449
|
-
[EVENT_BOOKING_ARRIVAL_QUERY]: 1,
|
|
2450
|
-
[EVENT_BOOKING_DECODER_QUERY]: "tolerant"
|
|
2475
|
+
//#region ../logger/src/noop.ts
|
|
2476
|
+
const noop = () => {};
|
|
2477
|
+
const logger = {
|
|
2478
|
+
debug: noop,
|
|
2479
|
+
info: noop,
|
|
2480
|
+
warn: noop,
|
|
2481
|
+
error: noop,
|
|
2482
|
+
withFields: (_) => logger
|
|
2451
2483
|
};
|
|
2452
|
-
const eventAutoApplyDiscountPreviewBaseSchema = z.object({
|
|
2453
|
-
id: z.string(),
|
|
2454
|
-
publicLabel: z.string(),
|
|
2455
|
-
description: z.string().nullable(),
|
|
2456
|
-
minTicketsRequired: z.number().nullable()
|
|
2457
|
-
});
|
|
2458
|
-
const eventAutoApplyDiscountPreviewSchema = z.discriminatedUnion("discountType", [eventAutoApplyDiscountPreviewBaseSchema.extend({
|
|
2459
|
-
discountType: z.literal("percent"),
|
|
2460
|
-
discountPercent: z.number(),
|
|
2461
|
-
discountAmountCents: z.null()
|
|
2462
|
-
}), eventAutoApplyDiscountPreviewBaseSchema.extend({
|
|
2463
|
-
discountType: z.literal("fixed"),
|
|
2464
|
-
discountPercent: z.null(),
|
|
2465
|
-
discountAmountCents: z.number()
|
|
2466
|
-
})]);
|
|
2467
2484
|
//#endregion
|
|
2468
2485
|
//#region ../blocks/src/system/blocks/shared/siteTerms.ts
|
|
2469
2486
|
const versionId = z.string().uuid().transform((value, ctx) => {
|
|
@@ -2545,14 +2562,4 @@ function assertNever(value, message) {
|
|
|
2545
2562
|
throw new Error(message ?? `Unexpected value: ${String(value)}`);
|
|
2546
2563
|
}
|
|
2547
2564
|
//#endregion
|
|
2548
|
-
|
|
2549
|
-
const noop = () => {};
|
|
2550
|
-
const logger = {
|
|
2551
|
-
debug: noop,
|
|
2552
|
-
info: noop,
|
|
2553
|
-
warn: noop,
|
|
2554
|
-
error: noop,
|
|
2555
|
-
withFields: (_) => logger
|
|
2556
|
-
};
|
|
2557
|
-
//#endregion
|
|
2558
|
-
export { toBookingRequirementConsentField as $, inferSiteDateLocale as $t, normalizeEventCalendarDisplayMode as A, publicEventLoaderQuerySchemaShape as At, headingDecorationOverrideValues as B, projectPublicLocation as Bt, eventCalendarListGroupingDecision as C, purchasablePublicMembershipProductSchema as Ct, isEventCalendarDefaultView as D, eventScheduleScopeValues as Dt, eventListArrangementValues as E, calendarWindowQuerySchema as Et, arrangementModes as F, EVENT_PRESET_VALUES as Ft, publicEventDestinationSchema as G, mapDrawingSchema as Gt, tileTreatmentValues as H, toLocationCoordinates as Ht, decorativeTransitionIntentValues as I, WHOLE_SERIES_EVENT_PRESET_VALUES as It, publicEventsArraySchema as J, formatDateTime as Jt, publicEventPricingSchema as K, formatDate as Kt, eventListTreatmentValues as L, locationValueSchema as Lt, accordionIconColorTokenValues as M, allocateReductionCents as Mt, accordionIconMotionValues as N, normalizeCurrencyCode as Nt, isEventCalendarDisplayMode as O, eventSurfacePresetValues as Ot, accordionIconSetValues as P, isRecord as Pt, isBookingRequirementConsentFieldId as Q, formatTimeZoneCityLabel as Qt, eyebrowTreatmentValues as R, normalizeLocationAddressText as Rt, resolveCalendarReadProfile as S, publicProductSchema as St, eventCalendarVariantMeaning as T, calendarMonthDate as Tt, visibleHeadingDecorationFamilyValues as U, capitalize as Ut, isArrangementMode as V, publicLocationSchema as Vt, eventVenueDrawingSchema as W, trimmedStringOrNull as Wt, blockBookingConsentSchema as X, formatTime as Xt, blockBookingPaymentTermsSchema as Y, formatDateTimeRange as Yt, bookingConsentCarrierSchema as Z, formatTimeRange as Zt, calendarQueryKey as _, parsePositiveCents as _n, eventCalendarDisplayModeValues as _t, okWith as a, compareLocalScheduleDates as an, isRichTextDoc as at, calendarWindowPageSchema as b, formatCurrencyAmount as bn, publicMembershipProductSchema as bt, reportWorkflowSuccess as c, getLocalScheduleDate as cn, imageMediaSchema as ct, EVENT_BOOKING_RESPONSE_QUERY as d, resolveBookingBusinessTimeZone as dn, runtimeMediaSchema as dt, resolveBookingDisplayContext as en, beforeBookingQuestionsPresentationSchema as et, eventAutoApplyDiscountPreviewSchema as f, resolveBookingTimeZoneId as fn, videoMediaSchema as ft, calendarPageResponseError as g, validateBookingPaymentOptionKinds as gn, eventCalendarDefaultViewValues as gt, calendarMonthKey as h, toUtcIsoDateTimeString as hn, mediaTypeDiscriminants as ht, ok as i, addLocalScheduleDays as in, createRichTextDoc as it, resolveEventCalendarReadPlan as j, unsafeAsPositiveCheckoutQuantity as jt, isEventCalendarListLayout as k, eventSurfaceScopeValues as kt, blockSiteTermsSchema as l, parseBookingLocalDate as ln, mediaSchema as lt, publicPassProductCollectionSchema as m, parseUtcIsoDateTimeString as mn, isDisplayMediaKind as mt, assertNever as n, toScheduledBookingDateTime as nn, RichTextDocSchema as nt, clearWorkflowFeedback as o, formatLocalScheduleDate as on, assetMediaSchema as ot, publicMembershipProductCollectionSchema as p, toBookingTimeZone as pn, PUBLIC_FILE_FIELD_KINDS as pt, publicEventSchema as q, formatDateRange as qt, err as r, buildBookingUtcDateWindow as rn, buildRichTextSchema as rt, reportWorkflowError as s, getBookingLocalDateKey as sn, externalMediaSchema as st, logger as t, formatBookingCompactEnglishTime as tn, bookingQuestionsAnswerValueSchema as tt, verifiedSiteTermsAcceptanceSchema as u, parseLocalScheduleTime as un, persistableMediaSchema as ut, calendarWindowBounds as v, parsePositiveMoneyInputToCents as vn, eventCalendarListLayoutCompatibleDisplayModeValues as vt, eventCalendarListLayoutOptions as w, purchasablePublicPassProductSchema as wt, planCalendarMonthRanges as x, formatGiftCardAmountLabel as xn, publicPassProductSchema as xt, calendarWindowMonths as y, toNonNegativeCents as yn, eventCalendarListLayoutValues as yt, headingDecorationColorTokenValues as z, parseLocationValue as zt };
|
|
2565
|
+
export { PUBLIC_FILE_FIELD_KINDS as $, formatTimeRange as $t, toBookingRequirementConsentField as A, eventSurfaceScopeValues as At, normalizeEventCalendarDisplayMode as B, toLocationCoordinates as Bt, publicEventPricingSchema as C, publicProductSchema as Ct, blockBookingConsentSchema as D, calendarWindowQuerySchema as Dt, blockBookingPaymentTermsSchema as E, calendarMonthDate as Et, eventCalendarVariantMeaning as F, locationValueSchema as Ft, isRichTextDoc as G, validateBookingPaymentOptionKinds as Gt, RichTextDocSchema as H, trimmedStringOrNull as Ht, eventListArrangementValues as I, normalizeLocationAddressText as It, imageMediaSchema as J, formatDateTime as Jt, assetMediaSchema as K, formatDate as Kt, isEventCalendarDefaultView as L, parseLocationValue as Lt, bookingQuestionsAnswerValueSchema as M, isRecord as Mt, eventCalendarListGroupingDecision as N, EVENT_PRESET_VALUES as Nt, bookingConsentCarrierSchema as O, eventScheduleScopeValues as Ot, eventCalendarListLayoutOptions as P, WHOLE_SERIES_EVENT_PRESET_VALUES as Pt, videoMediaSchema as Q, formatTime as Qt, isEventCalendarDisplayMode as R, projectPublicLocation as Rt, publicEventDestinationSchema as S, publicPassProductSchema as St, publicEventsArraySchema as T, purchasablePublicPassProductSchema as Tt, buildRichTextSchema as U, mapDrawingSchema as Ut, resolveEventCalendarReadPlan as V, capitalize as Vt, createRichTextDoc as W, buildBookingUtcDateWindow as Wt, persistableMediaSchema as X, formatSiteInstantDate as Xt, mediaSchema as Y, formatDateTimeRange as Yt, runtimeMediaSchema as Z, formatSiteInstantTime as Zt, planCalendarMonthRanges as _, parsePositiveCents as _n, eventCalendarDefaultViewValues as _t, clearWorkflowFeedback as a, addLocalScheduleDays as an, arrangementModes as at, publicPassProductCollectionSchema as b, formatCurrencyAmount as bn, eventCalendarListLayoutValues as bt, blockSiteTermsSchema as c, getBookingLocalDateKey as cn, eyebrowTreatmentValues as ct, calendarMonthKey as d, parseLocalScheduleTime as dn, isArrangementMode as dt, formatTimeZoneCityLabel as en, isDisplayMediaKind as et, calendarPageResponseError as f, parseUtcIsoDateTimeString as fn, tileTreatmentValues as ft, calendarWindowPageSchema as g, toBookingTimeZone as gn, normalizeCurrencyCode as gt, calendarWindowMonths as h, resolveBookingTimeZoneId as hn, allocateReductionCents as ht, okWith as i, toScheduledBookingDateTime as in, accordionIconSetValues as it, beforeBookingQuestionsPresentationSchema as j, publicEventLoaderQuerySchemaShape as jt, isBookingRequirementConsentFieldId as k, eventSurfacePresetValues as kt, verifiedSiteTermsAcceptanceSchema as l, getLocalScheduleDate as ln, headingDecorationColorTokenValues as lt, calendarWindowBounds as m, resolveBookingBusinessTimeZone as mn, unsafeAsPositiveCheckoutQuantity as mt, err as n, resolveBookingDisplayContext as nn, accordionIconColorTokenValues as nt, reportWorkflowError as o, compareLocalScheduleDates as on, decorativeTransitionIntentValues as ot, calendarQueryKey as p, toUtcIsoDateTimeString as pn, visibleHeadingDecorationFamilyValues as pt, externalMediaSchema as q, formatDateRange as qt, ok as r, formatBookingCompactEnglishTime as rn, accordionIconMotionValues as rt, reportWorkflowSuccess as s, formatLocalScheduleDate as sn, eventListTreatmentValues as st, assertNever as t, inferSiteDateLocale as tn, mediaTypeDiscriminants as tt, logger as u, parseBookingLocalDate as un, headingDecorationOverrideValues as ut, resolveCalendarReadProfile as v, parsePositiveMoneyInputToCents as vn, eventCalendarDisplayModeValues as vt, publicEventSchema as w, purchasablePublicMembershipProductSchema as wt, eventVenueDrawingSchema as x, formatGiftCardAmountLabel as xn, publicMembershipProductSchema as xt, publicMembershipProductCollectionSchema as y, toNonNegativeCents as yn, eventCalendarListLayoutCompatibleDisplayModeValues as yt, isEventCalendarListLayout as z, publicLocationSchema as zt };
|