@riverbankcms/sdk 0.174.1 → 0.176.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/dist/_dts/{BlocksIslandsHydrator-YRmc-Yxz.d.ts → BlocksIslandsHydrator-DvoTk7Py.d.ts} +1 -1
- package/dist/_dts/{Page-Du0zX1B-.d.ts → Page-D-l374tU.d.ts} +8 -16
- package/dist/_dts/{SdkPreviewMode-4L8v3FkY.d.ts → SdkPreviewMode-22DdQAj5.d.ts} +2 -2
- package/dist/_dts/{client-B1J6Akyf.d.ts → client-D4p0J1lK.d.ts} +487 -11
- package/dist/_dts/{content-types-CGGYI0u_.d.ts → content-types-0WWR6dC4.d.ts} +2 -2
- package/dist/_dts/{contracts-CHMlw9hT.d.ts → contracts-f_ZG_SwY.d.ts} +8 -8
- package/dist/_dts/{footerPageOutline-DIHSU1Vr.d.ts → footerPageOutline-DSeZvOaj.d.ts} +85 -8
- package/dist/_dts/{generatePageMetadata-JITXD6BU.d.ts → generatePageMetadata-BlitPA2D.d.ts} +2 -2
- package/dist/_dts/{index-BLEKFHt1.d.ts → index-CKkkCgb6.d.ts} +1 -1
- package/dist/_dts/{index-yWDbUojb.d.ts → index-CoLcwjqJ.d.ts} +1 -1
- package/dist/_dts/{index-DpJm0NpL.d.ts → index-D-ai8IQd.d.ts} +4 -4
- package/dist/_dts/{index-CXZSy_9M.d.ts → index-DDsfmM4d.d.ts} +2 -2
- package/dist/_dts/{index-CF62FntA.d.ts → index-EJMo-KSo.d.ts} +2 -2
- package/dist/_dts/{index-D9ZYmGAJ.d.ts → index-ZKEDvLuN.d.ts} +1 -1
- package/dist/_dts/{index-BgOr1Xyz.d.ts → index-tcPtGdag.d.ts} +3 -3
- package/dist/_dts/{loadContent-M-s0p0rq.d.ts → loadContent-Ci932ORy.d.ts} +7 -7
- package/dist/_dts/{request-BK-pHf0P.d.ts → request-B8jVdvgI.d.ts} +1993 -407
- package/dist/_dts/{resolveBlockData-DZAlnhwt.d.ts → resolveBlockData-DrSMuD76.d.ts} +5 -5
- package/dist/_dts/{resolvePageContent-DXUCWJ3y.d.ts → resolvePageContent-Be4iL6-F.d.ts} +2 -2
- package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
- package/dist/_dts/sdk/src/client/types.d.ts +2 -2
- 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 +2 -2
- package/dist/_dts/sdk/src/gifting/client.d.ts +13 -1
- 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 +7 -7
- 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 +3 -2
- 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 +5 -177
- 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 +5 -5
- 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 +2 -1
- package/dist/_dts/{types-CwmB2NHU.d.ts → types-BXMX4z2j.d.ts} +7 -7
- package/dist/_dts/{types-DjVNADXR.d.ts → types-DXY64Xh4.d.ts} +4 -4
- package/dist/_dts/{types-Dmow_FI6.d.ts → types-lwSgCWZ4.d.ts} +11 -2
- package/dist/_dts/{validation-h8t1HLlL.d.ts → validation-C5xp--Fu.d.ts} +7 -4
- package/dist/client/{BlocksIslandsHydrator-DRVx_XLi.mjs → BlocksIslandsHydrator-CeYQQQs7.mjs} +17 -16
- package/dist/client/{BookingMailingListNote-CwrMzj-k.mjs → BookingMailingListNote-CDDWrY_W.mjs} +6 -6
- package/dist/client/{BookingPanelArrangement-C2_hFT6K.mjs → BookingPanelArrangement-BShQSial.mjs} +1 -1
- package/dist/client/{BookingQuestionFields-DZMrGvBh.mjs → BookingQuestionFields-MbvIo2jS.mjs} +3 -3
- package/dist/client/{CalendarNavigationChevron-Az1-TIEI.mjs → CalendarNavigationChevron-C6CSVfEB.mjs} +36 -11
- package/dist/client/DemoBookingPortalAccess-C9Ggcfx3.mjs +545 -0
- package/dist/client/{EventCalendar.client-CDkkP-Lv.mjs → EventCalendar.client-BSMuSqg0.mjs} +15 -25
- package/dist/client/{EventCombined.client-DK3aaz62.mjs → EventCombined.client-BTrmSyUB.mjs} +25 -17
- package/dist/client/{EventItem-WeUipfIP.mjs → EventItem-B0WjGXsH.mjs} +4 -3
- package/dist/client/{EventListWeekNavigation-D3sbAeDo.mjs → EventListWeekNavigation-8Ij7vuxY.mjs} +1 -1
- package/dist/client/{EventListing.client-DL3gGGmF.mjs → EventListing.client-CWk2NEwd.mjs} +3 -3
- package/dist/client/{EventListing.view-DKFImKOx.mjs → EventListing.view-BEH4UbSL.mjs} +18 -8
- package/dist/client/{EventRegistrationPayment-Dn9TpWyL.mjs → EventRegistrationPayment-B2EikR3f.mjs} +635 -359
- package/dist/client/{LocationMapActions-BJT7MqP2.mjs → LocationMapActions-myIQIvQL.mjs} +1 -1
- package/dist/client/{MapDrawingSvg-DCIwlON6.mjs → MapDrawingSvg-BfsVyPvB.mjs} +2 -22
- package/dist/client/{Page-BpeP9xdt.mjs → Page-F3lhDvw1.mjs} +1036 -953
- package/dist/client/{DemoBookingPortalAccess-1p-pJ1lg.mjs → SiteTermsAgreementField-BYACYP0T.mjs} +4 -301
- package/dist/client/{StepIndicator-CP6zrwkl.mjs → StepIndicator-Bb7rPtSq.mjs} +37 -12
- package/dist/client/{accordion-nR7D4m1a.mjs → accordion-BfsOiweL.mjs} +1 -1
- package/dist/client/{booking-form.client-Ce-mQZ7W.mjs → booking-form.client-B8ohIj13.mjs} +229 -42
- package/dist/client/{bookingForm-B-qT_AQB.mjs → bookingForm-CXsck2oH.mjs} +4 -4
- package/dist/client/bookings.mjs +22 -15
- package/dist/client/{boxStyleClassNames-CrE3TDpW.mjs → boxStyleClassNames-B_hcuT06.mjs} +2 -1
- package/dist/client/{carousel-CVUOatsY.mjs → carousel-Cz5Ddbsx.mjs} +1 -1
- package/dist/client/{cart-DE0K6E0R.mjs → cart-CTC2oS3p.mjs} +3 -3
- package/dist/client/{cart.client-C23E6WQ5.mjs → cart.client-c1YkTC-Q.mjs} +1 -1
- package/dist/client/{checkout-76cdHyPL.mjs → checkout-BeW1ufaH.mjs} +3 -3
- package/dist/client/{checkout.client-DJOzqb26.mjs → checkout.client-BeU32khQ.mjs} +1 -1
- package/dist/client/{checkoutUrls-CvIP5DCO.mjs → checkoutUrls-DVfSUSKp.mjs} +1 -1
- package/dist/client/client.mjs +145 -21
- package/dist/client/{context-CNlesLfF.mjs → context-R9p5c8IH.mjs} +76 -58
- package/dist/client/{course-DHIrXqNT.mjs → course-CUFVJEAc.mjs} +2 -2
- package/dist/client/{creditProducts-KYMVIH3J.mjs → creditProducts-BQ1t1erI.mjs} +14 -61
- package/dist/client/{dateFormatting-B73Ll0s4.mjs → dateFormatting-CF6FWCoo.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-BVbLD4pi.mjs → demoPortalMagicLink-tZxIm3RL.mjs} +1 -1
- package/dist/client/display-4HYOb-AK.mjs +11844 -0
- package/dist/client/{enhanceHeaderSection-5GD5o4Mt.mjs → enhanceHeaderSection-DEYDI54E.mjs} +3 -3
- package/dist/client/{event-details.client-D7Oz1q2L.mjs → event-details.client-BwjBJP-f.mjs} +1 -1
- package/dist/client/{event-registration.client-zbuX36aA.mjs → event-registration.client-DWvSODTI.mjs} +176 -75
- package/dist/client/{eventCalendar-uZrksODt.mjs → eventCalendar-C9Pn9eeZ.mjs} +4 -4
- package/dist/client/{eventCombined-DxhvNAx8.mjs → eventCombined-Bdhk0fp0.mjs} +4 -4
- package/dist/client/{eventDetails-DCIH4BYG.mjs → eventDetails-C2LfNW_o.mjs} +2 -2
- package/dist/client/{eventListing-B9KrnPvc.mjs → eventListing-B-bJOQUk.mjs} +4 -4
- package/dist/client/{eventRegistration-TjnURMKl.mjs → eventRegistration-CbdmUiDT.mjs} +4 -4
- package/dist/client/{form-CfqIAhfN.mjs → form-BbUUt784.mjs} +3 -3
- package/dist/client/{form.client-CL6fF0cW.mjs → form.client-BVlz-9_t.mjs} +4 -4
- package/dist/client/{form.parts-Bf-L66Gg.mjs → form.parts-TB4UIrML.mjs} +1 -1
- package/dist/client/{formatDate-Dp7POa9Y.mjs → formatDate-TDHhFjFN.mjs} +1 -1
- package/dist/client/gifting/client.mjs +5 -3
- package/dist/client/gifting-CbNSrp7C.mjs +28 -0
- package/dist/client/gifting.client-B__bGhFc.mjs +404 -0
- package/dist/client/gifting.parts-CTA1sDW6.mjs +86 -0
- package/dist/client/{headerSection-WVXtOcuW.mjs → headerSection-5Wn9nUW_.mjs} +2 -2
- package/dist/client/{display-Cf_j5stk.mjs → lookSurfaces-BwiNdgMU.mjs} +2951 -14395
- package/dist/client/{newsletter-form.client-Bb7GAZpO.mjs → newsletter-form.client-B17WYHxZ.mjs} +7 -5
- package/dist/client/{newsletter-form.parts-BqOVRdIc.mjs → newsletter-form.parts-DN9wD1ZG.mjs} +3 -3
- package/dist/client/{newsletterForm-DOVe-qY3.mjs → newsletterForm-DLMlxInp.mjs} +3 -3
- package/dist/client/{noop-D5mFWXtN.mjs → noop-CaQxI-Js.mjs} +94 -36
- package/dist/client/portal/client.mjs +313 -148
- package/dist/client/{product-detail.client-CNzeFnFf.mjs → product-detail.client-Di_anRGR.mjs} +1 -1
- package/dist/client/{product-list.client-LKpzC7pj.mjs → product-list.client-Duhl6rtL.mjs} +1 -1
- package/dist/client/{productDetail-D2JNeEgx.mjs → productDetail-BgKmCwA8.mjs} +3 -3
- package/dist/client/{productList-DTgZXOEq.mjs → productList-C_wMKsYS.mjs} +3 -3
- package/dist/client/{propsDecoder-mpBQt2AT.mjs → propsDecoder-y3LvxaiG.mjs} +4 -3
- package/dist/client/{registry.server-DdTJyar2.mjs → registry.server-CIWYKz1V.mjs} +369 -246
- package/dist/client/rendering/client.mjs +25 -491
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +87 -21
- package/dist/client/{richText-coerce-C32cRQ03.mjs → richText-coerce-DkPBFb_a.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-8cfSgT0E.mjs → routeIslandApiConfig-BgO0rZce.mjs} +1 -1
- package/dist/client/{shop-5LBhftWx.mjs → shop-CFbWlv_W.mjs} +3 -3
- package/dist/client/{shop-discount-apply.state-D0ifS6KX.mjs → shop-add-feedback-DvC2kP1K.mjs} +1 -78
- package/dist/client/{shop-commerce-DkValjZj.mjs → shop-commerce-C-I29eaA.mjs} +64 -32
- package/dist/client/{shop-commerce-store-BOmXFmk_.mjs → shop-commerce-store-DGcc7twO.mjs} +1 -1
- package/dist/client/shop-discount-apply.state-DOm7vx0X.mjs +83 -0
- package/dist/client/{shop.client-BTtZqNmv.mjs → shop.client-GHTWUKD6.mjs} +56 -19
- package/dist/client/{shop.interactive-DNRqG4aX.mjs → shop.interactive-CxDJ8P2r.mjs} +113 -35
- package/dist/client/{shopShared-Nky6kPYr.mjs → shopShared-Be9QJJpT.mjs} +2 -2
- package/dist/client/{timetableModel-DZArznD_.mjs → timetableModel--R0zVzZO.mjs} +10 -10
- package/dist/client/{useAvailableSlots-CUVRD1nx.mjs → useAvailableSlots-BGu_2F50.mjs} +3 -3
- package/dist/client/{useDiscountCodeUi-d7viY_mu.mjs → useDiscountCodeUi-I_mXI9Yd.mjs} +32 -17
- package/dist/client/{useEventPagination-Da2JqxGC.mjs → useEventPagination-DxIJ--JZ.mjs} +7 -6
- package/dist/client/{view-BvuYmQJ5.mjs → view-3foOzGWR.mjs} +3 -2
- package/dist/client/{view-D9ObkFtz.mjs → view-BbzH5MQb.mjs} +128 -32
- package/dist/preview-next/client/{PageSectionToolbar-DwxHT-2k.mjs → PageSectionToolbar-0xyUPWUB.mjs} +4 -4
- package/dist/preview-next/client/{PreviewEditorSidebar-D4SBxGU6.mjs → PreviewEditorSidebar-D8vUzXtI.mjs} +61 -55
- package/dist/preview-next/client/{PreviewEditorUI-D8mUct32.mjs → PreviewEditorUI-CRjS4gAu.mjs} +4 -4
- package/dist/preview-next/client/{PreviewShell-L2AEdNUQ.mjs → PreviewShell-BvdBdeH_.mjs} +5 -5
- package/dist/preview-next/client/{SdkPreviewModeRuntime-bhVAU2D2.mjs → SdkPreviewModeRuntime-DWTyKbFj.mjs} +156 -143
- package/dist/preview-next/client/{previewAssistantSlot-Jpj_HDra.mjs → previewAssistantSlot-BqY2TTcZ.mjs} +4535 -2913
- package/dist/preview-next/client/{previewChromeRoot-CYTDvx4u.mjs → previewChromeRoot-BuRYe2iL.mjs} +1 -1
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-CZHX6J_4.mjs → sdk-runtime-BnK5kH9f.mjs} +2 -2
- package/dist/preview-next/client/{siteStyleAccess-DmGIG9Hk.mjs → siteStyleAccess-DbKozRSn.mjs} +527 -236
- package/dist/preview-next/client/{useAutosaveStatus-DQCyswQ-.mjs → useAutosaveStatus-D9s6dyMW.mjs} +1 -1
- package/dist/preview-next/client/{useOpenBlockForSetup-LwE5yXvL.mjs → useOpenBlockForSetup-Ce4WCxpT.mjs} +28 -5
- package/dist/preview-next/container-responsive.css +51 -3
- package/dist/preview-next/keepAlive.mjs +1 -1
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-BOuNcOcN.mjs → route-contract-BYezcMx5.mjs} +94 -12
- package/dist/server/{Block.shared-wfJfhs08.mjs → Block.shared-Cn7gg13_.mjs} +84 -16
- package/dist/server/{ThemeScopeCore-BtrJNHTB.mjs → ThemeScopeCore-DFEM1a85.mjs} +16 -2
- package/dist/server/{bindings-P1CF2Gm6.mjs → bindings-VGgS6UvF.mjs} +13 -34
- package/dist/server/{client-CGtU5fHI.mjs → client-Bvag5OtW.mjs} +145 -22
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/{customCss-BGB8gMVb.mjs → customCss-BZ8YSrQg.mjs} +1 -0
- package/dist/server/data/resolveBlockData.mjs +1 -1
- package/dist/server/index.mjs +2 -2
- package/dist/server/{loadContent-ChnkJSay.mjs → loadContent-CxASA3PE.mjs} +6 -9
- package/dist/server/{loadPage-DesHhgxj.mjs → loadPage-CQgde5DN.mjs} +2 -2
- package/dist/server/{lookMediaFrame-BBr0mkze.mjs → lookMediaFrame-CaH018pK.mjs} +24 -5
- package/dist/server/mapLocation-BM5WX7FY.mjs +315 -0
- package/dist/server/next.mjs +35 -9
- package/dist/server/{overrideResolution-DHEkHcZs.mjs → overrideResolution-BqVLO4gX.mjs} +1 -1
- package/dist/server/page-converter.mjs +1 -1
- package/dist/server/{pageRenderPlan-0jvm0RBk.mjs → pageRenderPlan-CfSnAkCO.mjs} +67 -40
- package/dist/server/{pageRuntimeSupport-8-f1Zr9e.mjs → pageRuntimeSupport-uz4gzBOo.mjs} +7 -15
- package/dist/server/{pageShared-CuVFoV4z.mjs → pageShared-D23o5QgC.mjs} +1068 -891
- package/dist/server/{parseThemeForPersistence-Cwqb5pZx.mjs → parseThemeForPersistence-DOsfofCy.mjs} +1 -1
- package/dist/server/{prebuild-Bms_Y7wQ.mjs → prebuild-BuoXWT9y.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-5oC5kyHe.mjs → prefetchBlockData-CCiYV8_s.mjs} +21 -6
- package/dist/server/{registry-DmqxC8th.mjs → registry-CXRXsFSx.mjs} +19721 -19621
- 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 +4 -4
- package/dist/server/rendering.mjs +7 -7
- package/dist/server/{resolveBlockData-EYogtwQc.mjs → resolveBlockData-yfe8WLEA.mjs} +1 -1
- package/dist/server/{responseMedia-DpBC1hTM.mjs → responseMedia-F-ElH2Rd.mjs} +1 -0
- package/dist/server/{schema-CUDHMirj.mjs → schema-BpsqaSSU.mjs} +2 -2
- package/dist/server/server.mjs +3 -3
- package/dist/server/theme-bridge.mjs +1 -1
- package/dist/server/theme.mjs +2 -2
- package/dist/server/{validation-Bt_8IL1g.mjs → validation-CozQ7wE0.mjs} +4 -4
- package/dist/server/{version-DT_efohp.mjs → version-CgCWRFEY.mjs} +1 -1
- package/dist/styles/index.css +295 -37
- package/package.json +1 -1
- package/dist/client/useDiscountApply-BBnStWXU.mjs +0 -199
- package/dist/server/identity-DQD_8lNO.mjs +0 -6
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { Mn as unsafeAsContentEntryId } from "./shop.interactive-CxDJ8P2r.mjs";
|
|
3
3
|
import { a as mediaIdentifierSchema, i as resolveManagedMediaReference, n as renderableMediaAssetSchema, o as parseCanonicalMediaIdentifier, s as parseMediaIdentifier, t as buildRenderableMediaAssetIndex } from "./renderableMediaAssetAdmission-BlfqYLJW.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { $ as
|
|
7
|
-
import { Bn as
|
|
8
|
-
import {
|
|
4
|
+
import { $o as offeringLabelForPageSurfaceSubject, Dr as computeMediaTransformStyle, Fa as readRuntimeNow, Ia as resolveDateRuntimeContext, Mr as resolveImageUrl$1, Nr as resolveImageUrlWithContext$1, Xr as plainTextToInlineText, Yr as parseInlineTextFromUnknown, jr as resolveImageSourceSetWithContext$1, ko as sanitizeHref, ps as unsafeAsEventCategoryId, qr as inlineTextToPlainText, wr as RichText$2 } from "./display-4HYOb-AK.mjs";
|
|
5
|
+
import { Ft as EVENT_PRESET_VALUES, Pt as isRecord, dt as runtimeMediaSchema, hn as toUtcIsoDateTimeString, it as createRichTextDoc, lt as mediaSchema, rt as buildRichTextSchema, ut as persistableMediaSchema } from "./noop-CaQxI-Js.mjs";
|
|
6
|
+
import { $ as projectRepeaterGridLayout$1, A as SUPPORTED_LOADER_ENDPOINTS, B as resolveRouteHrefForStage, C as resolveSdkBlockManifest, D as MISSING_SDK_THEME_ERROR_CODE, E as resolveSiteCustomBlocks, F as renderBlock, G as siteHeaderManifest, H as getBlockDefinition, I as getDefaultComponentRegistry, J as compileManifestContentContract, K as blockDesignCapabilityMapFromDefinitions, L as resolveAuthoredLinkHref, N as planBlockDataRequests, O as MissingSdkThemeError, P as makeDefaultBlockComponent, Q as fieldPlanToZod, R as isRouteVisibleInStage, S as readInvalidBlockAdmission, T as siteBlockRenderContext, U as systemBlockDefinitions, V as allOutlineBlocks, W as siteFooterManifest, X as admitLayoutGridForPlan, Y as registeredManifestContentContract, Z as deriveFieldValidationPlan, _ as buildRenderablePageOutline, a as solvedInksForThemeRuntime, b as invalidRenderableBlock$1, c as MissingBlockOverrideError, ct as applyCompiledRuntimeFieldsToContent, d as buildThemeRuntime, dt as readPublishedBlockPlacement, et as projectRepeaterGridLayoutForRendering$1, f as parseBlocksTheme, g as blockDesignInputsForDefinition, h as resolveRuntimeJoinFacts, i as renderWithSdkThemeRuntime, it as isRecord$1, j as prefetchBlockDataWithFailures, k as requireSdkTheme, l as PageRenderer, lt as compileEditorModelRuntime, m as isEntryBoundBlockEmpty, n as planLayoutThemeRuntime, nt as normalizeRepeaterGridSpan, o as ThemeScope, ot as parseListLook, p as applyBindingsToContent, q as admitTransportedRenderableManifestContent, r as renderWithOverrideOnlyRuntime, rt as resolveRepeaterGridAcceptedSpans, s as EditorPageRenderer, st as buildPageDesignEditorReadModel, t as Page, tt as flowRepeaterGridItems, u as toBlocksPageRendererDataContext, v as buildSiteRenderSupport, w as sanitizeSdkRuntimeBlockContent, x as projectRenderablePageOutline, y as collectMediaAssetSidecar, z as normalizeRenderStage } from "./Page-F3lhDvw1.mjs";
|
|
7
|
+
import { Bn as resolveRepeaterGridRowFieldId, Kn as isCanonicalRichTextDoc, Vn as resolveRepeaterGridSpanFieldId, zn as resolveRepeaterGridColumnFieldId, zt as parseFieldDefinition } from "./registry.server-CIWYKz1V.mjs";
|
|
8
|
+
import { F as surfaceResolutionContextFromTheme, O as componentRuntimeRulesForSiteStyle, Q as parsePageDesignIntent, hn as asLayoutVariantKey, j as requireCuratedSiteStyle, k as designRuntimeRulesForSiteStyle, mn as asDesignBlockId, pn as asAppearancePresetId, w as buildInitialPolicyPageDesignIntent, wt as appearancePresets } from "./lookSurfaces-BwiNdgMU.mjs";
|
|
9
|
+
import { l as parseBackgroundContent } from "./boxStyleClassNames-B_hcuT06.mjs";
|
|
9
10
|
import { o as setContextResolveImageUrlContext, t as buildResolveImageUrlContext } from "./mediaContext-Fusweriw.mjs";
|
|
10
11
|
import { n as toBlocksImageResolveContextInput, r as toBlocksMediaAssets } from "./mediaAssets-B99AP7ai.mjs";
|
|
11
12
|
import "react";
|
|
@@ -670,6 +671,36 @@ function buildFooterRenderablePageOutline(siteData, blocks) {
|
|
|
670
671
|
customBlocks: resolveSiteCustomBlocks(siteData)
|
|
671
672
|
});
|
|
672
673
|
}
|
|
674
|
+
function footerLoaderInputs(siteData, options) {
|
|
675
|
+
return {
|
|
676
|
+
page: projectRenderablePageOutline(buildFooterRenderablePageOutline(siteData, siteData.footerBlocks ?? [])),
|
|
677
|
+
context: {
|
|
678
|
+
siteId: siteData.site.id,
|
|
679
|
+
previewStage: options.previewStage ?? "published",
|
|
680
|
+
root: {
|
|
681
|
+
now: toUtcIsoDateTimeString((/* @__PURE__ */ new Date()).toISOString()),
|
|
682
|
+
bookingTimeZone: siteData.bookingTimeZone
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
};
|
|
686
|
+
}
|
|
687
|
+
/**
|
|
688
|
+
* Run the loaders of a site's footer blocks, for a footer `PageRenderer`.
|
|
689
|
+
*
|
|
690
|
+
* A custom footer callback calls this itself and passes the result in its data
|
|
691
|
+
* context, or hands it to `Layout` as `footerBlockData`. Without it, a map in the
|
|
692
|
+
* footer that needs a venue or the business address is left out for visitors.
|
|
693
|
+
*/
|
|
694
|
+
async function prefetchFooterBlockData(client, siteData, options = {}) {
|
|
695
|
+
const { page, context } = footerLoaderInputs(siteData, options);
|
|
696
|
+
return prefetchBlockDataWithFailures(page, context, client, { customBlocks: resolveSiteCustomBlocks(siteData) });
|
|
697
|
+
}
|
|
698
|
+
/** Whether a footer needs `prefetchFooterBlockData`, for the warning `Layout` gives when it can't run it. */
|
|
699
|
+
function footerBlocksNeedLoaders(siteData, options = {}) {
|
|
700
|
+
const { page, context } = footerLoaderInputs(siteData, options);
|
|
701
|
+
const supported = SUPPORTED_LOADER_ENDPOINTS;
|
|
702
|
+
return planBlockDataRequests(page, context, { isValidEndpoint: (endpoint) => supported.includes(endpoint) }).blocks.some((block) => block.requests.length > 0);
|
|
703
|
+
}
|
|
673
704
|
//#endregion
|
|
674
705
|
//#region src/rendering/components/Layout.tsx
|
|
675
706
|
/**
|
|
@@ -760,7 +791,7 @@ async function Layout(props) {
|
|
|
760
791
|
const header = props.header ?? true;
|
|
761
792
|
const footer = props.footer ?? true;
|
|
762
793
|
const siteData = await resolveLayoutSiteData(props);
|
|
763
|
-
const { site, navigation, layout, routes
|
|
794
|
+
const { site, navigation, layout, routes } = siteData;
|
|
764
795
|
const navigationOptions = {
|
|
765
796
|
hasPortalSession,
|
|
766
797
|
previewStage,
|
|
@@ -786,7 +817,8 @@ async function Layout(props) {
|
|
|
786
817
|
legalFooterMenu: legalFooterMenuViewModel,
|
|
787
818
|
...chromeLogoContent,
|
|
788
819
|
site,
|
|
789
|
-
routes
|
|
820
|
+
routes,
|
|
821
|
+
footerBlocks: await prepareFooterBlocks(props, siteData, previewStage)
|
|
790
822
|
};
|
|
791
823
|
if (isOverrideOnlyLayout(props)) return renderOverrideOnlyLayout(props, {
|
|
792
824
|
header: props.header ?? true,
|
|
@@ -822,10 +854,9 @@ async function Layout(props) {
|
|
|
822
854
|
} : theme;
|
|
823
855
|
const blocksThemeWithVariant = themeWithVariant;
|
|
824
856
|
const blocksTheme = theme;
|
|
825
|
-
const apiBaseUrl = resolveLayoutApiBaseUrl();
|
|
826
857
|
const sharedViewModelOverrides = {
|
|
827
858
|
$root: buildLayoutRootContext(siteData, {
|
|
828
|
-
apiBaseUrl,
|
|
859
|
+
apiBaseUrl: resolveLayoutApiBaseUrl(),
|
|
829
860
|
previewStage,
|
|
830
861
|
theme: themeWithVariant
|
|
831
862
|
}),
|
|
@@ -860,17 +891,16 @@ async function Layout(props) {
|
|
|
860
891
|
isSdkSite: Boolean(site.is_sdk_site),
|
|
861
892
|
mode: resolveSdkFooterMode(siteData.sdkConfig)
|
|
862
893
|
});
|
|
863
|
-
const
|
|
894
|
+
const footerBlocks = customFooterData.footerBlocks;
|
|
895
|
+
const footerBlocksElement = footerBlocks ? /* @__PURE__ */ jsx(PageRenderer, {
|
|
864
896
|
theme,
|
|
865
897
|
themeTokens: builtThemeRuntime.tokens,
|
|
866
898
|
headingScope: "region",
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
apiBaseUrl,
|
|
871
|
-
previewStage,
|
|
899
|
+
...footerBlocks,
|
|
900
|
+
dataContext: {
|
|
901
|
+
...footerBlocks.dataContext,
|
|
872
902
|
theme: themeWithVariant
|
|
873
|
-
}
|
|
903
|
+
},
|
|
874
904
|
sdkConfig: siteData.sdkConfig ?? null
|
|
875
905
|
}) : null;
|
|
876
906
|
if (footerPlan.renderFooterBlocks && !footerBlocksElement && true) console.debug("[sdk] Footer mode renders blocks, but footerBlocks is empty/missing", {
|
|
@@ -900,6 +930,44 @@ async function Layout(props) {
|
|
|
900
930
|
] })
|
|
901
931
|
});
|
|
902
932
|
}
|
|
933
|
+
/** Footer data is loaded once here, for the built-in footer and a custom callback alike. */
|
|
934
|
+
async function prepareFooterBlocks(props, siteData, previewStage) {
|
|
935
|
+
const footer = props.footer ?? true;
|
|
936
|
+
const blocks = siteData.footerBlocks ?? [];
|
|
937
|
+
if (footer === false || blocks.length === 0) return null;
|
|
938
|
+
if (footer === true && !siteRendersFooterBlocks(siteData)) return null;
|
|
939
|
+
return {
|
|
940
|
+
page: buildFooterRenderablePageOutline(siteData, blocks),
|
|
941
|
+
routeMap: siteData.routes,
|
|
942
|
+
dataContext: {
|
|
943
|
+
...buildLayoutRootContext(siteData, {
|
|
944
|
+
apiBaseUrl: resolveLayoutApiBaseUrl(),
|
|
945
|
+
previewStage
|
|
946
|
+
}),
|
|
947
|
+
...footerLoaderContext(await resolveFooterBlockData(props, siteData, previewStage))
|
|
948
|
+
}
|
|
949
|
+
};
|
|
950
|
+
}
|
|
951
|
+
function siteRendersFooterBlocks(siteData) {
|
|
952
|
+
return resolveFooterRenderPlan({
|
|
953
|
+
isSdkSite: Boolean(siteData.site.is_sdk_site),
|
|
954
|
+
mode: resolveSdkFooterMode(siteData.sdkConfig)
|
|
955
|
+
}).renderFooterBlocks;
|
|
956
|
+
}
|
|
957
|
+
function footerLoaderContext(data) {
|
|
958
|
+
return data ? {
|
|
959
|
+
resolvedData: data.resolvedData,
|
|
960
|
+
loaderFailures: data.loaderFailures,
|
|
961
|
+
loaderSnapshot: data.loaderSnapshot,
|
|
962
|
+
prefetchedBlockData: data
|
|
963
|
+
} : {};
|
|
964
|
+
}
|
|
965
|
+
/** Requiring a client would break every `siteData` caller, so an unloaded footer block is left out instead. */
|
|
966
|
+
async function resolveFooterBlockData(props, siteData, previewStage) {
|
|
967
|
+
if (props.footerBlockData) return props.footerBlockData;
|
|
968
|
+
if (props.client) return prefetchFooterBlockData(props.client, siteData, { previewStage });
|
|
969
|
+
if (footerBlocksNeedLoaders(siteData, { previewStage })) console.warn("[sdk] Layout has footer blocks that load data, but no client or footerBlockData, so they will not show. Pass client, or footerBlockData from prefetchFooterBlockData.");
|
|
970
|
+
}
|
|
903
971
|
/** Shared public facts for SDK chrome; no customer acceptance is present. */
|
|
904
972
|
function buildLayoutRootContext(siteData, input) {
|
|
905
973
|
return {
|
|
@@ -915,6 +983,7 @@ function buildLayoutRootContext(siteData, input) {
|
|
|
915
983
|
siteTerms: siteData.siteTerms,
|
|
916
984
|
mailingList: siteData.mailingList,
|
|
917
985
|
interactionContext: siteData.interactionContext,
|
|
986
|
+
siteCountry: siteData.site.siteCountry ?? null,
|
|
918
987
|
theme: input.theme
|
|
919
988
|
};
|
|
920
989
|
}
|
|
@@ -3762,7 +3831,7 @@ async function loadContentFromContentResponseWithDeps(deps, params) {
|
|
|
3762
3831
|
const { client, siteId, site, contentResponse, preview = false, dataLoaderOverrides, searchParams } = params;
|
|
3763
3832
|
const previewStage = preview ? "preview" : "published";
|
|
3764
3833
|
const blockDataPolicy = createBlockDataLoadPolicy(dataLoaderOverrides, normalizeDataLoaderSearchParams(searchParams));
|
|
3765
|
-
const support = buildSiteRenderSupport(site, collectMediaAssetSidecar(contentResponse.mediaAssets)
|
|
3834
|
+
const support = buildSiteRenderSupport(site, collectMediaAssetSidecar(contentResponse.mediaAssets));
|
|
3766
3835
|
const templateContentSupport = toTemplateContentRenderSupport(support, siteId);
|
|
3767
3836
|
if (isEntryResponse(contentResponse)) {
|
|
3768
3837
|
const entryData = contentResponse.entry;
|
|
@@ -3985,9 +4054,6 @@ function isEntryResponse(response) {
|
|
|
3985
4054
|
function isPageSurfaceResponse(response) {
|
|
3986
4055
|
return response.type === "pageSurface";
|
|
3987
4056
|
}
|
|
3988
|
-
function contentLocationSupport(response) {
|
|
3989
|
-
return "page" in response ? response.locationMapSupport : void 0;
|
|
3990
|
-
}
|
|
3991
4057
|
//#endregion
|
|
3992
4058
|
//#region src/contracts/rendering.ts
|
|
3993
4059
|
const ImagePresets = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { nt as RichTextDocSchema, t as logger } from "./noop-CaQxI-Js.mjs";
|
|
3
3
|
//#region ../blocks/src/system/runtime/nodes/richText-coerce.ts
|
|
4
4
|
function parseRichTextDoc(value) {
|
|
5
5
|
const parsed = RichTextDocSchema.safeParse(value);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { Ra as createHostedBlockApiConfig } from "./display-4HYOb-AK.mjs";
|
|
3
3
|
//#region src/rendering/islands/enhancers/routeIslandApiConfig.ts
|
|
4
4
|
function buildRouteIslandApiConfig({ apiBaseUrl, portalToken, previewToken, siteId, stage, readAuthority }) {
|
|
5
5
|
if (readAuthority) return createHostedBlockApiConfig({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as defineIslandPropsDecoder } from "./propsDecoder-
|
|
3
|
-
import { t as ShopClient } from "./shop.client-
|
|
4
|
-
import { t as mountShopBlockIsland } from "./shopShared-
|
|
2
|
+
import { t as defineIslandPropsDecoder } from "./propsDecoder-y3LvxaiG.mjs";
|
|
3
|
+
import { t as ShopClient } from "./shop.client-GHTWUKD6.mjs";
|
|
4
|
+
import { t as mountShopBlockIsland } from "./shopShared-Be9QJJpT.mjs";
|
|
5
5
|
//#region src/rendering/islands/enhancers/shop.tsx
|
|
6
6
|
const decode = defineIslandPropsDecoder("shop");
|
|
7
7
|
const enhance = (root, props) => {
|
package/dist/client/{shop-discount-apply.state-D0ifS6KX.mjs → shop-add-feedback-DvC2kP1K.mjs}
RENAMED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { p as assertNever } from "./creditProducts-KYMVIH3J.mjs";
|
|
3
2
|
import { t as FeedbackMessage } from "./FeedbackMessage-CSJrAuXH.mjs";
|
|
4
|
-
import { a as normalizeManualDiscountCode } from "./useDiscountApply-BBnStWXU.mjs";
|
|
5
3
|
import * as React$1 from "react";
|
|
6
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
5
|
//#region ../blocks/src/system/runtime/shared/utils/urlParams.ts
|
|
@@ -88,79 +86,4 @@ function ShopAddFeedback(props) {
|
|
|
88
86
|
});
|
|
89
87
|
}
|
|
90
88
|
//#endregion
|
|
91
|
-
|
|
92
|
-
const initialDiscountApplyState = {
|
|
93
|
-
isOpen: false,
|
|
94
|
-
draftCode: "",
|
|
95
|
-
status: { type: "idle" }
|
|
96
|
-
};
|
|
97
|
-
function discountApplyReducer(state, action) {
|
|
98
|
-
switch (action.type) {
|
|
99
|
-
case "open": return {
|
|
100
|
-
...state,
|
|
101
|
-
isOpen: true
|
|
102
|
-
};
|
|
103
|
-
case "draftChanged": return {
|
|
104
|
-
...state,
|
|
105
|
-
draftCode: action.draftCode,
|
|
106
|
-
status: { type: "idle" }
|
|
107
|
-
};
|
|
108
|
-
case "remove": return initialDiscountApplyState;
|
|
109
|
-
case "applyStarted": return {
|
|
110
|
-
...state,
|
|
111
|
-
status: { type: "applying" }
|
|
112
|
-
};
|
|
113
|
-
case "applySucceeded": return {
|
|
114
|
-
...state,
|
|
115
|
-
isOpen: true,
|
|
116
|
-
draftCode: action.discount.code,
|
|
117
|
-
status: {
|
|
118
|
-
type: "applied",
|
|
119
|
-
discount: action.discount
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
case "applyRejected": return {
|
|
123
|
-
...state,
|
|
124
|
-
isOpen: true,
|
|
125
|
-
status: {
|
|
126
|
-
type: "rejected",
|
|
127
|
-
reason: action.reason,
|
|
128
|
-
message: action.message
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
case "resetApplied":
|
|
132
|
-
if (state.status.type !== "applied") return state;
|
|
133
|
-
return {
|
|
134
|
-
...state,
|
|
135
|
-
status: { type: "idle" }
|
|
136
|
-
};
|
|
137
|
-
default: return assertNever(action);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
function getAppliedDiscountCode(state) {
|
|
141
|
-
if (state.status.type !== "applied") return null;
|
|
142
|
-
return normalizeManualDiscountCode(state.status.discount.code);
|
|
143
|
-
}
|
|
144
|
-
function isDiscountApplyInFlight(state) {
|
|
145
|
-
return state.status.type === "applying";
|
|
146
|
-
}
|
|
147
|
-
function getDiscountApplyFeedback(status, formatPrice) {
|
|
148
|
-
switch (status.type) {
|
|
149
|
-
case "idle":
|
|
150
|
-
case "applying": return null;
|
|
151
|
-
case "applied": {
|
|
152
|
-
const savings = formatPrice(status.discount.discountCents, status.discount.currency);
|
|
153
|
-
return {
|
|
154
|
-
tone: "success",
|
|
155
|
-
message: `${status.discount.publicLabel} applied. You save ${savings}.`
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
case "rejected": return {
|
|
159
|
-
tone: "error",
|
|
160
|
-
message: status.message
|
|
161
|
-
};
|
|
162
|
-
default: return assertNever(status);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
//#endregion
|
|
166
|
-
export { isDiscountApplyInFlight as a, consumeSearchParam as c, initialDiscountApplyState as i, consumeSearchParams as l, getAppliedDiscountCode as n, ShopAddFeedback as o, getDiscountApplyFeedback as r, useTransientShopAddFeedback as s, discountApplyReducer as t };
|
|
89
|
+
export { consumeSearchParams as i, useTransientShopAddFeedback as n, consumeSearchParam as r, ShopAddFeedback as t };
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { u as getShopDisplayForItems } from "./shop.interactive-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { i as
|
|
6
|
-
import { n as useBlockApi } from "./context-
|
|
2
|
+
import { u as getShopDisplayForItems } from "./shop.interactive-CxDJ8P2r.mjs";
|
|
3
|
+
import { _ as deriveCommerceCheckoutState, a as buildProductCardDisplay, c as formatCommercePrice, g as buildProductCartItem, o as buildProductDetailDisplay, wr as RichText, y as productItemKey } from "./display-4HYOb-AK.mjs";
|
|
4
|
+
import { n as assertNever, o as clearWorkflowFeedback, s as reportWorkflowError } from "./noop-CaQxI-Js.mjs";
|
|
5
|
+
import { i as useSiteTermsAgreement, n as SiteTermsChangedNotice, t as SiteTermsAgreementField } from "./SiteTermsAgreementField-BYACYP0T.mjs";
|
|
6
|
+
import { n as useBlockApi } from "./context-R9p5c8IH.mjs";
|
|
7
7
|
import { i as ThemedButtonLink, r as ThemedButton } from "./ThemedButton-DuaYtnvG.mjs";
|
|
8
|
-
import {
|
|
8
|
+
import { a as useDiscountApply, d as planUnifiedCheckoutRequest, i as isDiscountCodeRefusal, l as planCartDiscountAvailabilityRequests, n as DemoBookingPortalAccess, o as aggregateCartDiscountUiState, p as DiscountCodeDisclosure, s as checkoutFormForDiscountUiState } from "./DemoBookingPortalAccess-C9Ggcfx3.mjs";
|
|
9
|
+
import { t as buildCheckoutReturnUrls } from "./checkoutUrls-DVfSUSKp.mjs";
|
|
9
10
|
import { t as resolveDedicatedCheckoutPath } from "./checkoutRoute-DKlZRNZD.mjs";
|
|
10
|
-
import {
|
|
11
|
+
import { n as useTransientShopAddFeedback, r as consumeSearchParam, t as ShopAddFeedback } from "./shop-add-feedback-DvC2kP1K.mjs";
|
|
11
12
|
import { t as FeedbackMessage } from "./FeedbackMessage-CSJrAuXH.mjs";
|
|
12
|
-
import { t as coerceRichTextDoc } from "./richText-coerce-
|
|
13
|
-
import { c as ProductDetailView, f as VariantSelectView, l as ProductGalleryFrameView, n as CheckoutShellView, s as ProductCardView, t as CartShellView, u as ProductListSectionView } from "./view-
|
|
14
|
-
import { a as storeDemoBookingCheckoutReturn, i as readDemoBookingCheckoutReturnEmail } from "./demoPortalMagicLink-
|
|
15
|
-
import {
|
|
13
|
+
import { t as coerceRichTextDoc } from "./richText-coerce-DkPBFb_a.mjs";
|
|
14
|
+
import { c as ProductDetailView, f as VariantSelectView, l as ProductGalleryFrameView, n as CheckoutShellView, s as ProductCardView, t as CartShellView, u as ProductListSectionView } from "./view-3foOzGWR.mjs";
|
|
15
|
+
import { a as storeDemoBookingCheckoutReturn, i as readDemoBookingCheckoutReturnEmail } from "./demoPortalMagicLink-tZxIm3RL.mjs";
|
|
16
|
+
import { a as initialDiscountApplyState, i as getDiscountApplyFeedback, n as discountDraftAwaitingApply, o as isDiscountApplyInFlight, r as getAppliedDiscountCode, t as discountApplyReducer } from "./shop-discount-apply.state-DOm7vx0X.mjs";
|
|
16
17
|
import { t as CarouselNodeClient } from "./carousel.client-h65clfUO.mjs";
|
|
17
|
-
import { n as useCommerceCart } from "./shop-commerce-store-
|
|
18
|
+
import { n as useCommerceCart } from "./shop-commerce-store-DGcc7twO.mjs";
|
|
18
19
|
import * as React$1 from "react";
|
|
19
20
|
import { useEffect, useState } from "react";
|
|
20
21
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -258,6 +259,37 @@ function ShopCheckoutNoticeView(props) {
|
|
|
258
259
|
children: succeeded ? "Payment successful." : "Checkout cancelled."
|
|
259
260
|
}), succeeded && props.demoEmailSuppressed ? /* @__PURE__ */ jsx(DemoBookingPortalAccess, { email: props.email }) : null] });
|
|
260
261
|
}
|
|
262
|
+
function cartCheckoutForm(form, discountApply, uiState) {
|
|
263
|
+
return checkoutFormForDiscountUiState({
|
|
264
|
+
...form,
|
|
265
|
+
discountCode: getAppliedDiscountCode(discountApply) ?? ""
|
|
266
|
+
}, uiState);
|
|
267
|
+
}
|
|
268
|
+
function checkoutFailureMessage(error) {
|
|
269
|
+
return error instanceof Error ? error.message : "Checkout failed";
|
|
270
|
+
}
|
|
271
|
+
function cartDiscountHint(status) {
|
|
272
|
+
return status.type === "applied" && status.discount.totalAfterDiscountCents === 0 ? "There's nothing to pay. You won't need to enter card details." : void 0;
|
|
273
|
+
}
|
|
274
|
+
function cartSubmitLabel(status, fallback) {
|
|
275
|
+
if (status.type !== "applied") return fallback;
|
|
276
|
+
return status.discount.totalAfterDiscountCents === 0 ? "Complete purchase" : `Pay ${formatCommercePrice(status.discount.totalAfterDiscountCents, status.discount.currency)}`;
|
|
277
|
+
}
|
|
278
|
+
function CartDiscountNotice({ uiState }) {
|
|
279
|
+
if (uiState.type === "loading") return /* @__PURE__ */ jsx(FeedbackMessage, {
|
|
280
|
+
tone: "info",
|
|
281
|
+
className: "rb-caption status-muted",
|
|
282
|
+
role: "status",
|
|
283
|
+
children: "Checking available discounts."
|
|
284
|
+
});
|
|
285
|
+
if (uiState.type !== "auto-only") return null;
|
|
286
|
+
return /* @__PURE__ */ jsx(FeedbackMessage, {
|
|
287
|
+
tone: "info",
|
|
288
|
+
className: "rb-caption status-muted",
|
|
289
|
+
role: "status",
|
|
290
|
+
children: uiState.autoAppliedDiscount ? `${uiState.autoAppliedDiscount.publicLabel} will be applied at checkout.` : "Eligible discounts will be applied at checkout."
|
|
291
|
+
});
|
|
292
|
+
}
|
|
261
293
|
function CheckoutController(props) {
|
|
262
294
|
const api = useBlockApi();
|
|
263
295
|
const siteTerms = useSiteTermsAgreement({
|
|
@@ -311,16 +343,21 @@ function CheckoutController(props) {
|
|
|
311
343
|
const handleSubmit = async (event) => {
|
|
312
344
|
event.preventDefault();
|
|
313
345
|
if (display.state !== "ready" || state.submission === "submitting") return;
|
|
346
|
+
if (discountDraftAwaitingApply(discountApply)) {
|
|
347
|
+
dispatchDiscountApply({
|
|
348
|
+
type: "applyRejected",
|
|
349
|
+
reason: "invalid_or_not_applicable",
|
|
350
|
+
message: "Apply your code before paying."
|
|
351
|
+
});
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
314
354
|
if (!siteTerms.requireAgreement("commerce")) return;
|
|
315
355
|
dispatch({ type: "submitStarted" });
|
|
316
356
|
try {
|
|
317
357
|
const { successUrl, cancelUrl } = buildCheckoutReturnUrls("checkout", CHECKOUT_ANCHOR_ID);
|
|
318
358
|
const command = planUnifiedCheckoutRequest({
|
|
319
359
|
checkout: checkoutState,
|
|
320
|
-
form:
|
|
321
|
-
...state.form,
|
|
322
|
-
discountCode: getAppliedDiscountCode(discountApply) ?? ""
|
|
323
|
-
}, discountUiState),
|
|
360
|
+
form: cartCheckoutForm(state.form, discountApply, discountUiState),
|
|
324
361
|
successUrl,
|
|
325
362
|
cancelUrl
|
|
326
363
|
});
|
|
@@ -340,9 +377,14 @@ function CheckoutController(props) {
|
|
|
340
377
|
cart.clear();
|
|
341
378
|
window.location.href = successUrl;
|
|
342
379
|
} catch (submitError) {
|
|
380
|
+
if (isDiscountCodeRefusal(submitError)) dispatchDiscountApply({
|
|
381
|
+
type: "applyRejected",
|
|
382
|
+
reason: "invalid_or_not_applicable",
|
|
383
|
+
message: submitError.message
|
|
384
|
+
});
|
|
343
385
|
dispatch({
|
|
344
386
|
type: "submitFailed",
|
|
345
|
-
message: submitError
|
|
387
|
+
message: checkoutFailureMessage(submitError)
|
|
346
388
|
});
|
|
347
389
|
return;
|
|
348
390
|
} finally {
|
|
@@ -406,23 +448,13 @@ function CheckoutController(props) {
|
|
|
406
448
|
onRemove: () => dispatchDiscountApply({ type: "remove" }),
|
|
407
449
|
onApply: applyDiscountCode,
|
|
408
450
|
id: "shop-checkout-discount-code",
|
|
409
|
-
|
|
451
|
+
applied: discountApply.status.type === "applied",
|
|
452
|
+
hint: cartDiscountHint(discountApply.status),
|
|
410
453
|
feedback: discountApplyFeedback,
|
|
411
454
|
isApplying: isDiscountApplyInFlight(discountApply),
|
|
412
455
|
disabled: state.submission === "submitting"
|
|
413
456
|
}) : null,
|
|
414
|
-
|
|
415
|
-
tone: "info",
|
|
416
|
-
className: "rb-caption status-muted",
|
|
417
|
-
role: "status",
|
|
418
|
-
children: "Checking available discounts."
|
|
419
|
-
}) : null,
|
|
420
|
-
discountUiState.type === "auto-only" ? /* @__PURE__ */ jsx(FeedbackMessage, {
|
|
421
|
-
tone: "info",
|
|
422
|
-
className: "rb-caption status-muted",
|
|
423
|
-
role: "status",
|
|
424
|
-
children: discountUiState.autoAppliedDiscount ? `${discountUiState.autoAppliedDiscount.publicLabel} will be applied at checkout.` : "Eligible discounts will be applied at checkout."
|
|
425
|
-
}) : null,
|
|
457
|
+
/* @__PURE__ */ jsx(CartDiscountNotice, { uiState: discountUiState }),
|
|
426
458
|
state.feedback.tag === "error" ? /* @__PURE__ */ jsx(FeedbackMessage, {
|
|
427
459
|
tone: "error",
|
|
428
460
|
className: "rb-caption status-muted",
|
|
@@ -439,8 +471,8 @@ function CheckoutController(props) {
|
|
|
439
471
|
type: "submit",
|
|
440
472
|
variant: "default",
|
|
441
473
|
size: "md",
|
|
442
|
-
label: state.submission === "submitting" ? "Loading…" : display.submitButtonText,
|
|
443
|
-
disabled: state.submission === "submitting"
|
|
474
|
+
label: state.submission === "submitting" ? "Loading…" : cartSubmitLabel(discountApply.status, display.submitButtonText),
|
|
475
|
+
disabled: state.submission === "submitting" || discountDraftAwaitingApply(discountApply)
|
|
444
476
|
})
|
|
445
477
|
]
|
|
446
478
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { b as reduceCommerceCart, h as buildPassCartItem, m as EMPTY_COMMERCE_CART_STATE, v as parseStoredCommerceCartState } from "./display-4HYOb-AK.mjs";
|
|
3
3
|
import * as React$1 from "react";
|
|
4
4
|
//#region ../blocks/src/system/runtime/nodes/shop-commerce-store.ts
|
|
5
5
|
const EMPTY_STATE = EMPTY_COMMERCE_CART_STATE;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { n as assertNever } from "./noop-CaQxI-Js.mjs";
|
|
3
|
+
import { c as normalizeManualDiscountCode } from "./DemoBookingPortalAccess-C9Ggcfx3.mjs";
|
|
4
|
+
//#region ../blocks/src/system/runtime/nodes/shop-discount-apply.state.ts
|
|
5
|
+
const initialDiscountApplyState = {
|
|
6
|
+
isOpen: false,
|
|
7
|
+
draftCode: "",
|
|
8
|
+
status: { type: "idle" }
|
|
9
|
+
};
|
|
10
|
+
function discountApplyReducer(state, action) {
|
|
11
|
+
switch (action.type) {
|
|
12
|
+
case "open": return {
|
|
13
|
+
...state,
|
|
14
|
+
isOpen: true
|
|
15
|
+
};
|
|
16
|
+
case "draftChanged": return {
|
|
17
|
+
...state,
|
|
18
|
+
draftCode: action.draftCode,
|
|
19
|
+
status: { type: "idle" }
|
|
20
|
+
};
|
|
21
|
+
case "remove": return initialDiscountApplyState;
|
|
22
|
+
case "applyStarted": return {
|
|
23
|
+
...state,
|
|
24
|
+
status: { type: "applying" }
|
|
25
|
+
};
|
|
26
|
+
case "applySucceeded": return {
|
|
27
|
+
...state,
|
|
28
|
+
isOpen: true,
|
|
29
|
+
draftCode: action.discount.code,
|
|
30
|
+
status: {
|
|
31
|
+
type: "applied",
|
|
32
|
+
discount: action.discount
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
case "applyRejected": return {
|
|
36
|
+
...state,
|
|
37
|
+
isOpen: true,
|
|
38
|
+
status: {
|
|
39
|
+
type: "rejected",
|
|
40
|
+
reason: action.reason,
|
|
41
|
+
message: action.message
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
case "resetApplied":
|
|
45
|
+
if (state.status.type === "idle" || state.status.type === "rejected") return state;
|
|
46
|
+
return {
|
|
47
|
+
...state,
|
|
48
|
+
status: { type: "idle" }
|
|
49
|
+
};
|
|
50
|
+
default: return assertNever(action);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function getAppliedDiscountCode(state) {
|
|
54
|
+
if (state.status.type !== "applied") return null;
|
|
55
|
+
return normalizeManualDiscountCode(state.status.discount.code);
|
|
56
|
+
}
|
|
57
|
+
/** A typed code that hasn't been applied holds back paying, so nobody pays without the discount they expected. */
|
|
58
|
+
function discountDraftAwaitingApply(state) {
|
|
59
|
+
return Boolean(state.draftCode.trim()) && state.status.type !== "applied";
|
|
60
|
+
}
|
|
61
|
+
function isDiscountApplyInFlight(state) {
|
|
62
|
+
return state.status.type === "applying";
|
|
63
|
+
}
|
|
64
|
+
function getDiscountApplyFeedback(status, formatPrice) {
|
|
65
|
+
switch (status.type) {
|
|
66
|
+
case "idle":
|
|
67
|
+
case "applying": return null;
|
|
68
|
+
case "applied": {
|
|
69
|
+
const total = formatPrice(status.discount.totalAfterDiscountCents, status.discount.currency);
|
|
70
|
+
return {
|
|
71
|
+
tone: "success",
|
|
72
|
+
message: `${status.discount.publicLabel} applied. You'll pay ${total}.`
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
case "rejected": return {
|
|
76
|
+
tone: "error",
|
|
77
|
+
message: status.message
|
|
78
|
+
};
|
|
79
|
+
default: return assertNever(status);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
//#endregion
|
|
83
|
+
export { initialDiscountApplyState as a, getDiscountApplyFeedback as i, discountDraftAwaitingApply as n, isDiscountApplyInFlight as o, getAppliedDiscountCode as r, discountApplyReducer as t };
|