@riverbankcms/sdk 0.183.0 → 0.185.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 +34 -1
- package/dist/_dts/{BlocksIslandsHydrator-X1_G96iN.d.ts → BlocksIslandsHydrator-Bu0O7l4p.d.ts} +1 -1
- package/dist/_dts/{Page-CEqZJZEE.d.ts → Page-DYoL0IWL.d.ts} +7 -7
- package/dist/_dts/{SdkPreviewMode-DQejfbXL.d.ts → SdkPreviewMode-DgFAiR8r.d.ts} +2 -2
- package/dist/_dts/{client-B_B_amKD.d.ts → client-BKdjJ7A0.d.ts} +35 -4
- package/dist/_dts/{content-types-Dhx5Ocvx.d.ts → content-types-6K7zlJuF.d.ts} +2 -2
- package/dist/_dts/{contracts-FeOnfoa1.d.ts → contracts-CUR8ccnX.d.ts} +3 -3
- package/dist/_dts/{generatePageMetadata-m70J6tit.d.ts → generatePageMetadata-CveWSMew.d.ts} +2 -2
- package/dist/_dts/{index-CjAkEWAp.d.ts → index-6WypKfbu.d.ts} +4 -4
- package/dist/_dts/{index-iuFrbIjt.d.ts → index-BMwrFX_K.d.ts} +1 -1
- package/dist/_dts/{index-BxCmCit0.d.ts → index-Bp5lk6I8.d.ts} +1 -1
- package/dist/_dts/{index-BOpUh8kO.d.ts → index-DTKn1H8g.d.ts} +3 -3
- package/dist/_dts/{index-Bizdaxji.d.ts → index-DX-Xe54X.d.ts} +2 -2
- package/dist/_dts/{index-liuhlOX7.d.ts → index-SD1fTP_7.d.ts} +2 -2
- package/dist/_dts/{loadContent-D4wrTIIw.d.ts → loadContent-BN8GtRsL.d.ts} +7 -7
- package/dist/_dts/{request-Gn0O1blj.d.ts → request-BwYvMqLf.d.ts} +78461 -77905
- package/dist/_dts/{resolveBlockData-D5duwuqS.d.ts → resolveBlockData-CYy0VlSK.d.ts} +5 -5
- package/dist/_dts/{resolvePageContent-xzJ3c9Na.d.ts → resolvePageContent-BwUDLi_W.d.ts} +1 -1
- 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 +1 -1
- package/dist/_dts/sdk/src/index.d.ts +7 -7
- 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 +1 -1
- package/dist/_dts/sdk/src/portal/index.d.ts +10 -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 +4 -4
- package/dist/_dts/sdk/src/rendering/index.d.ts +6 -6
- package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
- package/dist/_dts/sdk/src/routing/index.d.ts +6 -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 +36 -1
- package/dist/_dts/{serviceBookingOutline-B1gyJon_.d.ts → serviceBookingOutline-CMNev0gz.d.ts} +19 -8
- package/dist/_dts/{types-DBNuMtSk.d.ts → types-BBazdRQf.d.ts} +9 -10
- package/dist/_dts/{types-DHMcuoeQ.d.ts → types-BwngWRQ8.d.ts} +13 -15
- package/dist/_dts/{types-BoITy0rA.d.ts → types-C9_amrul.d.ts} +6 -2
- package/dist/_dts/{validation-BIPO-XlE.d.ts → validation-B58kUTuV.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-Ct8slgRk.mjs → BlocksIslandsHydrator-CooOPhs3.mjs} +17 -17
- package/dist/client/{BookingMailingListNote-qqTxGGS4.mjs → BookingMailingListNote-D_khdttF.mjs} +61 -62
- package/dist/client/{BookingQuestionFields-DCh9MUIF.mjs → BookingQuestionFields-Bia1E7Cj.mjs} +49 -36
- package/dist/client/{CalendarAction-RcdaStG7.mjs → CalendarAction-C-AbMmct.mjs} +2 -2
- package/dist/client/{CalendarNavigationChevron-D7Wt-Oaa.mjs → CalendarNavigationChevron-oaHxRbUO.mjs} +7 -7
- package/dist/client/{CheckboxChoice-BdGxZWeg.mjs → CheckboxChoice-CTMIII37.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-HFVkoOac.mjs → DemoBookingPortalAccess-M2xKYQjX.mjs} +7 -5
- package/dist/client/{EventCalendar.client-BtkJW8bA.mjs → EventCalendar.client-By7e9nyF.mjs} +11 -11
- package/dist/client/{EventCombined.client-DxaGjFFS.mjs → EventCombined.client-BdRZXB14.mjs} +10 -10
- package/dist/client/EventEmbeddedCheckoutStep-CJoxbx2Y.mjs +147 -0
- package/dist/client/{EventItem-Fr2qi2C2.mjs → EventItem-CDMa9zOX.mjs} +5 -5
- package/dist/client/{EventListWeekNavigation-BRMaq0ky.mjs → EventListWeekNavigation-B8WKaCrN.mjs} +1 -1
- package/dist/client/{EventListing.client-BhGxfbjt.mjs → EventListing.client-BEGiiFnO.mjs} +3 -3
- package/dist/client/{EventListing.view-COuEJzbO.mjs → EventListing.view-B6LOK-z4.mjs} +84 -7
- package/dist/client/{EventRegistrationPayment-BTLYhVxD.mjs → EventRegistrationPayment-CARdr15t.mjs} +140 -68
- package/dist/client/{Page-CgbQZP5g.mjs → Page-uP7AKSyp.mjs} +1762 -521
- package/dist/client/{ProtectedSubmitButton-BG7my0Qf.mjs → ProtectedSubmitButton-CY6u5sQa.mjs} +1 -1
- package/dist/client/SiteChoiceGroup-BZ5I0Vhy.mjs +96 -0
- package/dist/client/{SiteTermsAgreementField-DQNkfNLA.mjs → SiteTermsAgreementField-BDqRo2C5.mjs} +3 -3
- package/dist/client/{StepIndicator-DvPekKeM.mjs → StepIndicator-BWrXAKvs.mjs} +1 -1
- package/dist/client/{StepIndicator-DyXoI3ob.mjs → StepIndicator-Cb3NMw-Y.mjs} +30 -18
- package/dist/client/{ThemedButton-Bc9DBbVp.mjs → ThemedButton-C4rCsPCt.mjs} +11 -2
- package/dist/client/{accessibleSurfaces-wj4Rloo5.mjs → accessibleSurfaces-q-dDOwsW.mjs} +750 -560
- package/dist/client/{accordion-BVXfjnh-.mjs → accordion-BYW2YSUN.mjs} +1 -1
- package/dist/client/{booking-form.client-DycPGtke.mjs → booking-form.client-DAlWWWjV.mjs} +110 -72
- package/dist/client/{bookingCalendar--aWnqFDn.mjs → bookingCalendar-9nFa_do4.mjs} +6 -2
- package/dist/client/{bookingForm-DrWSUqL3.mjs → bookingForm-DtVk9p5l.mjs} +7 -6
- package/dist/client/bookings.mjs +5 -5
- package/dist/client/{boxStyleClassNames-CduDRcIk.mjs → boxStyleClassNames-CaSq3-r-.mjs} +2 -2
- package/dist/client/{EventEmbeddedCheckoutStep-B2c5dR49.mjs → browserStripe-Dh-LcDoW.mjs} +36 -142
- package/dist/client/{buttonParts-CJEtVOUy.mjs → buttonParts-C39GC0kz.mjs} +9 -2
- package/dist/client/{carousel-DyCLMP8s.mjs → carousel-msur7fxW.mjs} +2 -2
- package/dist/client/{carousel.client-DffP_Nv0.mjs → carousel.client-DKWqVHHh.mjs} +1 -1
- package/dist/client/{cart-BuEp_cj4.mjs → cart-Bx-JuY2n.mjs} +3 -3
- package/dist/client/{cart.client-CAO39uDG.mjs → cart.client-hB_9MimN.mjs} +1 -1
- package/dist/client/{checkout-BoxzT64s.mjs → checkout-BVWZn5Qu.mjs} +3 -3
- package/dist/client/{checkout.client-IGUy7XOx.mjs → checkout.client-Bt_GtHW9.mjs} +1 -1
- package/dist/client/{checkoutUrls-D0UsiFmm.mjs → checkoutUrls-CP-rQOZV.mjs} +1 -1
- package/dist/client/client.mjs +61 -48
- package/dist/client/{constants-C_8AxMdm.mjs → constants-yA1RJGXD.mjs} +1 -1
- package/dist/client/{context-D1L0pe__.mjs → context-CG77Keax.mjs} +43 -6
- package/dist/client/{dateFormatting-HvfmS_cH.mjs → dateFormatting-DIRIgfYr.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-BunFTnIq.mjs → demoPortalMagicLink-CgzNiOQ0.mjs} +1 -1
- package/dist/client/{enhanceHeaderSection-CtLAG651.mjs → enhanceHeaderSection-DgzZNM2M.mjs} +4 -4
- package/dist/client/{event-registration.client-DiSxkBUP.mjs → event-registration.client-Ckb4aDE9.mjs} +118 -74
- package/dist/client/{eventCalendar-DUnhwZ1o.mjs → eventCalendar-lqqQSzBQ.mjs} +4 -4
- package/dist/client/{eventCombined-BvBQo0nF.mjs → eventCombined-BIMyHrd-.mjs} +4 -4
- package/dist/client/{eventListing-aTLifOX7.mjs → eventListing-CBYxfvNf.mjs} +4 -4
- package/dist/client/{eventRegistration-DFd7pr09.mjs → eventRegistration-BhAqvkCb.mjs} +7 -6
- package/dist/client/{form-Dikmc2AO.mjs → form-CkOfk-Eb.mjs} +3 -3
- package/dist/client/{form.client-zHaQK5I9.mjs → form.client-Whi43oio.mjs} +5 -5
- package/dist/client/{form.parts-BLl9n8TH.mjs → form.parts-BgsWo2Me.mjs} +3 -3
- package/dist/client/gifting/client.mjs +8 -8
- package/dist/client/{gifting-CufPM38H.mjs → gifting-XtNpLcFI.mjs} +4 -4
- package/dist/client/{gifting.client--N1GaSY8.mjs → gifting.client-CraWj4I4.mjs} +174 -73
- package/dist/client/{gifting.interactive-D9MK4HkV.mjs → gifting.interactive-DiPDObN0.mjs} +61 -10
- package/dist/client/{gifting.parts-CRtiRzo-.mjs → gifting.parts-_mgGOcbA.mjs} +17 -43
- package/dist/client/{headerSection-BIaBpmk3.mjs → headerSection-CPIN3VSU.mjs} +2 -2
- package/dist/client/{islands-DJDLGQEm.mjs → islands-C95FyxUF.mjs} +1996 -1178
- package/dist/client/{newsletter-form.client-wg_JHTxm.mjs → newsletter-form.client-BgVJdKVe.mjs} +7 -7
- package/dist/client/{newsletter-form.interactive-hzpkW9NQ.mjs → newsletter-form.interactive-DpcfRbI_.mjs} +39 -18
- package/dist/client/{newsletter-form.parts-CgzpSv9p.mjs → newsletter-form.parts-poPgHrUh.mjs} +2 -2
- package/dist/client/{newsletterForm-CvxLiEBT.mjs → newsletterForm-Dt6wFjTe.mjs} +3 -3
- package/dist/client/portal/client.mjs +999 -81
- package/dist/client/{portalOrders-tCxS04g0.mjs → portalOrders-CAfjTyV9.mjs} +1 -1
- package/dist/client/{portalRoutes-DTHlWg_F.mjs → portalRoutes-D3Ttfv5x.mjs} +54 -12
- package/dist/client/portalSession-0XhXyTxT.mjs +41 -0
- package/dist/client/presentation-CudSUZ6Q.mjs +169 -0
- package/dist/client/{product-detail.client-22Q7zgjN.mjs → product-detail.client-BrBNT7Mq.mjs} +1 -1
- package/dist/client/{product-list.client-DFWYvK8z.mjs → product-list.client-CftTl7n6.mjs} +1 -1
- package/dist/client/{productDetail-DhZAwo60.mjs → productDetail-b1tpt585.mjs} +3 -3
- package/dist/client/{productList-BiVpbZK2.mjs → productList-DRT5sabi.mjs} +3 -3
- package/dist/client/{propsDecoder-DFYqKnLy.mjs → propsDecoder-Co1VXFaW.mjs} +4 -4
- package/dist/client/{registry.server-C3OBRg7x.mjs → registry.server-0UDNY7dO.mjs} +796 -715
- package/dist/client/rendering/client.mjs +28 -27
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +5 -5
- package/dist/client/{richText-coerce-ms477Z08.mjs → richText-coerce-BFDEPZZA.mjs} +2 -2
- package/dist/client/{routeIslandApiConfig-B6nQeqvH.mjs → routeIslandApiConfig-DtqRutuX.mjs} +1 -1
- package/dist/client/{runtimeResponse-BYqsV1Kb.mjs → runtimeResponse-DBVXbcuz.mjs} +1 -1
- package/dist/client/runtimeResponse-LQnQdtNI.mjs +3 -0
- package/dist/client/{shop-xt4dQ3HH.mjs → shop-DL3CYR7i.mjs} +3 -3
- package/dist/client/{shop-commerce-DVsIcPaI.mjs → shop-commerce-CDth2_qq.mjs} +45 -27
- package/dist/client/{shop-commerce-store-7mO6KY7_.mjs → shop-commerce-store-CE0aaSHJ.mjs} +1 -1
- package/dist/client/{shop-discount-apply.state-L1Vge8tG.mjs → shop-discount-apply.state-p4aXtVsF.mjs} +2 -2
- package/dist/client/{shop.client-DNJfD3VQ.mjs → shop.client-BI2iw6Z3.mjs} +83 -29
- package/dist/client/{shopShared-DS8t6749.mjs → shopShared-BNWzgWAC.mjs} +2 -2
- package/dist/client/spam-protection.mjs +1 -1
- package/dist/client/{src-Do_s2lqH.mjs → src-CJf3u16T.mjs} +1 -1
- package/dist/{preview-next/client/src-lX6heoDA.mjs → client/src-CMuv8vSO.mjs} +5 -1
- package/dist/client/src-CXOxpNtj.mjs +3 -0
- package/dist/client/{timetableModel-Dy3nNfTG.mjs → timetableModel-DZzGD6rS.mjs} +9 -9
- package/dist/client/{urlParams-C2QHo1Pa.mjs → useAutomaticDiscountPreview-CJDylOUe.mjs} +44 -1
- package/dist/client/{useAvailableSlots-DcjtDpUu.mjs → useAvailableSlots-nD6nuvSW.mjs} +2 -2
- package/dist/client/{useDiscountCodeUi-DvdFFWOT.mjs → useDiscountCodeUi-DMtTHqex.mjs} +6 -2
- package/dist/client/{useEventPagination-Cq-7sU5_.mjs → useEventPagination-CM-DCokc.mjs} +14 -16
- package/dist/client/{view-4gnPcpWJ.mjs → view-CHOhliHv.mjs} +4 -4
- package/dist/client/{wizardSteps-DDvL3iza.mjs → wizardSteps-BbroaNkT.mjs} +277 -87
- package/dist/preview-next/client/{EventEmbeddedCheckoutStep-CLqSRUpt.mjs → EventEmbeddedCheckoutStep-CVy9oapv.mjs} +1 -1
- package/dist/preview-next/client/{LocationPickerEnvironment-CIdAg-Tm.mjs → LocationPickerEnvironment-DuRUwUrK.mjs} +1 -1
- package/dist/preview-next/client/{MapLibreEditMap-Bm85jX35.mjs → MapLibreEditMap-CdSDYBq9.mjs} +2 -2
- package/dist/preview-next/client/{PageSectionToolbar-D8srnz9R.mjs → PageSectionToolbar-CR99z8BL.mjs} +582 -195
- package/dist/preview-next/client/{PreviewEditorSidebar-DVpk5cqp.mjs → PreviewEditorSidebar-BaKS6H8F.mjs} +1096 -283
- package/dist/preview-next/client/{PreviewEditorUI-XoTtHSFH.mjs → PreviewEditorUI-D6IG119o.mjs} +65 -16
- package/dist/preview-next/client/{PreviewShell-VQHsRg2u.mjs → PreviewShell-CKjkFOZS.mjs} +39 -12
- package/dist/preview-next/client/{SdkPreviewModeRuntime-CLdF9f6o.mjs → SdkPreviewModeRuntime-BexDQWGj.mjs} +128 -27
- package/dist/preview-next/client/{ThemedButton-ORNN4x-3.mjs → ThemedButton-CRgbU75r.mjs} +18 -2
- package/dist/preview-next/client/{lucide-react-eAi3tDAr.mjs → lucide-react-B4c6U3ZU.mjs} +1 -1
- package/dist/preview-next/client/{previewAssistantSlot-CqH91EwA.mjs → previewAssistantSlot-DcEwU9l_.mjs} +7192 -3039
- package/dist/preview-next/client/{previewChromeRoot-B3ySEu6p.mjs → previewChromeRoot-VqseF0yf.mjs} +1 -1
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-CdpSupcr.mjs → sdk-runtime-DcoVpKUf.mjs} +2 -2
- package/dist/preview-next/client/{siteStyleAccess-C6eOP6QW.mjs → siteStyleAccess-BL1fZnUD.mjs} +16 -10
- package/dist/{client/src-uwCpbHXG.mjs → preview-next/client/src-B5x3r4cg.mjs} +5 -1
- package/dist/preview-next/client/src-CrT7h--V.mjs +3 -0
- package/dist/preview-next/client/{useAutosaveStatus-BhPg4e-r.mjs → useAutosaveStatus-CdFnzKac.mjs} +3 -3
- package/dist/preview-next/client/{useOpenBlockForSetup-BaWUF9D7.mjs → useOpenBlockForSetup-B62h7dhR.mjs} +4 -3
- package/dist/preview-next/container-responsive.css +158 -3
- package/dist/preview-next/keepAlive.mjs +1 -1
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-Ch0X99vE.mjs → route-contract-CQfEvfbg.mjs} +54 -41
- package/dist/server/{Block.shared-B2FmczLO.mjs → Block.shared-CbGnxkWX.mjs} +5 -5
- package/dist/server/{ThemeScopeCore-DtAyv9qA.mjs → ThemeScopeCore-BjxlpVaV.mjs} +34 -8
- package/dist/server/{accessibleSurfaces-BtPqb76u.mjs → accessibleSurfaces-CZ7pLuJ7.mjs} +317 -148
- package/dist/server/{accordions-vzdZ2Wt1.mjs → accordions-C_C52VkS.mjs} +1 -1
- package/dist/server/{bindings-B_9JuU66.mjs → bindings-D-n66Oqc.mjs} +68 -247
- package/dist/server/{client-DC7cjiSw.mjs → client-BGGlrkft.mjs} +64 -47
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/{constants-d6nPNJpe.mjs → constants-TkO9Uxma.mjs} +51 -9
- package/dist/server/data/resolveBlockData.mjs +1 -1
- package/dist/server/index.mjs +3 -3
- package/dist/server/{loadContent-hb27HYic.mjs → loadContent-8H1hHdXo.mjs} +4 -4
- package/dist/server/{loadPage-JToD8wDD.mjs → loadPage-BZyqF_g3.mjs} +3 -3
- package/dist/server/lookMediaFrame-Dw6R9B0L.mjs +31837 -0
- package/dist/server/manifest.mjs +2 -2
- package/dist/server/{navigation-B2WhGofA.mjs → navigation-9TOyY5Zf.mjs} +1 -1
- package/dist/server/navigation.mjs +1 -1
- package/dist/server/next.mjs +9 -9
- package/dist/server/{overrideResolution-vD5KTClL.mjs → overrideResolution-CuduOS6V.mjs} +1 -1
- package/dist/server/page-converter.mjs +17 -4
- package/dist/server/{pageRenderPlan-CdqJ1NQZ.mjs → pageRenderPlan-DmP0HVMu.mjs} +618 -209
- package/dist/server/{pageRuntimeSupport-CAhr4oOf.mjs → pageRuntimeSupport-BQ1dWs1V.mjs} +12 -5
- package/dist/server/{pageShared-m80Xu2pd.mjs → pageShared-ALu7y5Dq.mjs} +836 -516
- package/dist/server/{parseThemeForPersistence-CRwOZfpa.mjs → parseThemeForPersistence-D_8I28BB.mjs} +3 -3
- package/dist/server/{portal-B2wCQno_.mjs → portal-P4oHSRho.mjs} +23 -2
- package/dist/server/portal.mjs +3 -3
- package/dist/server/{prebuild-BWIkFaXq.mjs → prebuild-BLL6RhjS.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-D1PHU-K9.mjs → prefetchBlockData-aR5W1dVF.mjs} +3 -3
- package/dist/server/{registry-KtsOsAzY.mjs → registry-DD_s7l3Y.mjs} +1575 -28658
- 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 +9 -9
- package/dist/server/{resolveBlockData-sjIDJYl7.mjs → resolveBlockData-DnQ2N0lI.mjs} +2 -2
- package/dist/server/{expandPalette-DxPrNOAB.mjs → resolveButtonColourStates-ChlP4NJ9.mjs} +1662 -1430
- package/dist/server/{responseMedia-IfH65QAH.mjs → responseMedia-D6F1tvIm.mjs} +1 -1
- package/dist/server/{schema-BBEqquBM.mjs → schema-ClDfFtz2.mjs} +261 -6
- package/dist/server/server.mjs +3 -3
- package/dist/server/{servicePageContent-ChEZDRwU.mjs → servicePageContent-CsUerbJ1.mjs} +15 -12
- package/dist/server/theme-bridge.mjs +5 -4
- package/dist/server/theme.mjs +2 -2
- package/dist/server/{three-pass-converter-DKCIBeb1.mjs → three-pass-converter-CLJrZb7s.mjs} +1 -1
- package/dist/server/{titleSourceSchema-DybHErxH.mjs → titleSourceSchema-DA_iErtG.mjs} +2 -3
- package/dist/server/{types-vyz09w64.mjs → types-CcKy8_tj.mjs} +14 -5
- package/dist/server/{validation-Cvi-1TZZ.mjs → validation-BbImAsVs.mjs} +5 -5
- package/dist/server/{version-B-icAIV1.mjs → version-BY48jPoe.mjs} +1 -1
- package/dist/styles/index.css +684 -181
- package/package.json +1 -1
- package/dist/client/appointment-service-categories-Cl2pqw-z.mjs +0 -70
- package/dist/client/runtimeResponse-CUX_lldL.mjs +0 -3
- package/dist/client/src-DqMbCjI1.mjs +0 -3
- package/dist/preview-next/client/src-EO5QoRlU.mjs +0 -3
- package/dist/server/customCss-rtIfEYwQ.mjs +0 -230
- package/dist/server/lookMediaFrame-CTsycLLK.mjs +0 -2756
- package/dist/server/media-gvfIw3z8.mjs +0 -216
|
@@ -1,14 +1,50 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as assertNever } from "./src-
|
|
3
|
-
import { i as useSiteTermsAgreement, n as SiteTermsChangedNotice, t as SiteTermsAgreementField } from "./SiteTermsAgreementField-
|
|
4
|
-
import { n as useBlockApi } from "./context-
|
|
5
|
-
import { n as ThemedButton } from "./ThemedButton-
|
|
6
|
-
import { t as buildGiftingDisplay } from "./gifting.interactive-
|
|
2
|
+
import { An as formatCurrencyAmount, t as assertNever } from "./src-CJf3u16T.mjs";
|
|
3
|
+
import { i as useSiteTermsAgreement, n as SiteTermsChangedNotice, t as SiteTermsAgreementField } from "./SiteTermsAgreementField-BDqRo2C5.mjs";
|
|
4
|
+
import { n as useBlockApi } from "./context-CG77Keax.mjs";
|
|
5
|
+
import { n as ThemedButton } from "./ThemedButton-C4rCsPCt.mjs";
|
|
6
|
+
import { t as buildGiftingDisplay } from "./gifting.interactive-DiPDObN0.mjs";
|
|
7
7
|
import { t as FeedbackMessage } from "./FeedbackMessage-CSJrAuXH.mjs";
|
|
8
|
-
import { a as
|
|
8
|
+
import { a as GiftingExpiry, c as formatGiftAmount, i as GiftGroup, l as giftingSlot, n as GIFTING_NOTHING_TO_SHOW, o as GiftingPanelHead, r as GiftCardAmounts, s as firstGiftAmountChoice } from "./gifting.parts-_mgGOcbA.mjs";
|
|
9
9
|
import React, { startTransition, useEffect, useReducer, useRef, useState } from "react";
|
|
10
10
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
//#region ../blocks/src/system/runtime/nodes/gifting.client.state.ts
|
|
12
|
+
/** Whether a stored value is a receipt this module wrote. */
|
|
13
|
+
function isGiftingReceipt(value) {
|
|
14
|
+
if (typeof value !== "object" || value === null) return false;
|
|
15
|
+
const record = value;
|
|
16
|
+
return typeof record.amountCents === "number" && typeof record.currency === "string" && typeof record.offerTitle === "string" && typeof record.recipient === "string";
|
|
17
|
+
}
|
|
18
|
+
/** "£20.00 Gift card for Sam Taylor": the amount, the offer's own name, and who it's for. */
|
|
19
|
+
function giftingReceiptLine(receipt) {
|
|
20
|
+
return `${formatCurrencyAmount(receipt.amountCents, receipt.currency, { decimals: "auto" })} ${receipt.offerTitle} for ${receipt.recipient}`;
|
|
21
|
+
}
|
|
22
|
+
/** The offer's own name, and the price a voucher fixes (a gift card's comes from the form). */
|
|
23
|
+
function giftingOfferBought(offers, offerId) {
|
|
24
|
+
const voucher = offers.vouchers.find((offer) => offer.id === offerId);
|
|
25
|
+
if (voucher) return {
|
|
26
|
+
title: voucher.title.trim(),
|
|
27
|
+
fixedCents: voucher.voucher.purchaseAmountCents
|
|
28
|
+
};
|
|
29
|
+
return {
|
|
30
|
+
title: offers.giftCards.find((offer) => offer.id === offerId)?.title.trim(),
|
|
31
|
+
fixedCents: null
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/** The receipt for an offer about to be paid for, or null when the form doesn't say enough. */
|
|
35
|
+
function giftingReceiptFor(input) {
|
|
36
|
+
const { offers, checkout } = input;
|
|
37
|
+
if (!offers) return null;
|
|
38
|
+
const { title: offerTitle, fixedCents } = giftingOfferBought(offers, checkout.offerId);
|
|
39
|
+
const amountCents = fixedCents ?? checkout.amountCents;
|
|
40
|
+
const recipient = checkout.recipientName?.trim() || checkout.recipientEmail.trim();
|
|
41
|
+
return offerTitle && recipient && amountCents && amountCents > 0 ? {
|
|
42
|
+
amountCents,
|
|
43
|
+
currency: offers.currency,
|
|
44
|
+
offerTitle,
|
|
45
|
+
recipient
|
|
46
|
+
} : null;
|
|
47
|
+
}
|
|
12
48
|
function createInitialGiftingClientState(initialOffers) {
|
|
13
49
|
return {
|
|
14
50
|
offers: initialOffers,
|
|
@@ -51,15 +87,20 @@ function giftingClientReducer(state, action) {
|
|
|
51
87
|
default: return assertNever(action);
|
|
52
88
|
}
|
|
53
89
|
}
|
|
54
|
-
function resolveGiftingPurchaseNotice(search, defaultSuccessMessage, today = /* @__PURE__ */ new Date()) {
|
|
90
|
+
function resolveGiftingPurchaseNotice(search, defaultSuccessMessage, today = /* @__PURE__ */ new Date(), receipt = null) {
|
|
55
91
|
const params = new URLSearchParams(search);
|
|
56
92
|
switch (params.get("gifting")) {
|
|
57
93
|
case null: return null;
|
|
58
94
|
case "success": {
|
|
59
95
|
const day = formatSendOnDay(params.get("gift_send_on"), today);
|
|
60
|
-
|
|
96
|
+
const message = day ? `Thanks, that's all paid for. We'll email the gift to them on ${day}.` : defaultSuccessMessage;
|
|
97
|
+
return receipt ? {
|
|
61
98
|
kind: "success",
|
|
62
|
-
message
|
|
99
|
+
message,
|
|
100
|
+
receipt: giftingReceiptLine(receipt)
|
|
101
|
+
} : {
|
|
102
|
+
kind: "success",
|
|
103
|
+
message
|
|
63
104
|
};
|
|
64
105
|
}
|
|
65
106
|
case "cancelled": return {
|
|
@@ -74,18 +115,30 @@ function toGiftingControllerProps(props) {
|
|
|
74
115
|
className: props.render.display.className,
|
|
75
116
|
heading: props.render.display.heading,
|
|
76
117
|
intro: props.render.display.intro,
|
|
77
|
-
emptyStateText: props.render.display.emptyStateText,
|
|
78
118
|
checkoutButtonText: props.render.hydration.checkoutButtonText,
|
|
79
119
|
successMessage: props.render.hydration.successMessage
|
|
80
120
|
};
|
|
81
121
|
}
|
|
82
|
-
|
|
122
|
+
const RECEIPT_PARAM = "gift_receipt";
|
|
123
|
+
/**
|
|
124
|
+
* Where checkout comes back to. A successful return names its own receipt, so
|
|
125
|
+
* the thank-you repeats what this checkout bought and not one started later
|
|
126
|
+
* in the same tab.
|
|
127
|
+
*/
|
|
128
|
+
function buildGiftingCheckoutReturnUrl(currentHref, kind, options = {}) {
|
|
83
129
|
const url = new URL(currentHref);
|
|
84
130
|
url.searchParams.set("gifting", kind);
|
|
85
|
-
if (kind === "success" && sendOnDate) url.searchParams.set("gift_send_on", sendOnDate);
|
|
131
|
+
if (kind === "success" && options.sendOnDate) url.searchParams.set("gift_send_on", options.sendOnDate);
|
|
86
132
|
else url.searchParams.delete("gift_send_on");
|
|
133
|
+
if (kind === "success" && options.receiptId) url.searchParams.set(RECEIPT_PARAM, options.receiptId);
|
|
134
|
+
else url.searchParams.delete(RECEIPT_PARAM);
|
|
87
135
|
return url.toString();
|
|
88
136
|
}
|
|
137
|
+
/** The receipt a successful return names, if any. */
|
|
138
|
+
function giftingReturnReceiptId(search) {
|
|
139
|
+
const params = new URLSearchParams(search);
|
|
140
|
+
return params.get("gifting") === "success" ? params.get(RECEIPT_PARAM) || null : null;
|
|
141
|
+
}
|
|
89
142
|
function hasPublicGiftingOffers(offers) {
|
|
90
143
|
return Boolean((offers?.giftCards.length ?? 0) > 0 || (offers?.vouchers.length ?? 0) > 0);
|
|
91
144
|
}
|
|
@@ -134,10 +187,36 @@ function giftingReturnUrlWithoutNotice(currentHref) {
|
|
|
134
187
|
const url = new URL(currentHref);
|
|
135
188
|
url.searchParams.delete("gifting");
|
|
136
189
|
url.searchParams.delete("gift_send_on");
|
|
190
|
+
url.searchParams.delete(RECEIPT_PARAM);
|
|
137
191
|
return url.toString();
|
|
138
192
|
}
|
|
139
193
|
//#endregion
|
|
194
|
+
//#region ../blocks/src/system/runtime/nodes/gifting.receipt-storage.ts
|
|
195
|
+
/** Each checkout keeps its own receipt, so returning from one never shows another's. */
|
|
196
|
+
const receiptKey = (receiptId) => `rb-gifting-receipt:${receiptId}`;
|
|
197
|
+
function rememberGiftingReceipt(receiptId, receipt) {
|
|
198
|
+
try {
|
|
199
|
+
window.sessionStorage.setItem(receiptKey(receiptId), JSON.stringify(receipt));
|
|
200
|
+
} catch {}
|
|
201
|
+
}
|
|
202
|
+
/** Read once: a reload after the thank-you shouldn't repeat it. */
|
|
203
|
+
function takeGiftingReceipt(receiptId) {
|
|
204
|
+
try {
|
|
205
|
+
const stored = window.sessionStorage.getItem(receiptKey(receiptId));
|
|
206
|
+
window.sessionStorage.removeItem(receiptKey(receiptId));
|
|
207
|
+
const parsed = stored ? JSON.parse(stored) : null;
|
|
208
|
+
return isGiftingReceipt(parsed) ? parsed : null;
|
|
209
|
+
} catch {
|
|
210
|
+
return null;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
//#endregion
|
|
140
214
|
//#region ../blocks/src/system/runtime/nodes/gifting.client.tsx
|
|
215
|
+
/** The receipt this return names, and only that one. */
|
|
216
|
+
function receiptFromReturn(search) {
|
|
217
|
+
const receiptId = giftingReturnReceiptId(search);
|
|
218
|
+
return receiptId ? takeGiftingReceipt(receiptId) : null;
|
|
219
|
+
}
|
|
141
220
|
function GiftingClient(props) {
|
|
142
221
|
const api = useBlockApi();
|
|
143
222
|
const noticeRef = useRef(null);
|
|
@@ -148,7 +227,7 @@ function GiftingClient(props) {
|
|
|
148
227
|
const controller = toGiftingControllerProps(props);
|
|
149
228
|
const [state, dispatch] = useReducer(giftingClientReducer, props.render.hydration.offers, createInitialGiftingClientState);
|
|
150
229
|
useEffect(() => {
|
|
151
|
-
const notice = resolveGiftingPurchaseNotice(window.location.search, props.render.hydration.successMessage);
|
|
230
|
+
const notice = resolveGiftingPurchaseNotice(window.location.search, props.render.hydration.successMessage, /* @__PURE__ */ new Date(), receiptFromReturn(window.location.search));
|
|
152
231
|
dispatch({
|
|
153
232
|
type: "purchaseNoticeResolved",
|
|
154
233
|
notice
|
|
@@ -200,14 +279,24 @@ function GiftingClient(props) {
|
|
|
200
279
|
offerId,
|
|
201
280
|
submission
|
|
202
281
|
});
|
|
282
|
+
const receiptId = crypto.randomUUID();
|
|
203
283
|
try {
|
|
204
|
-
const
|
|
284
|
+
const checkoutInput = buildGiftingCheckoutInput(formData, {
|
|
205
285
|
offerId,
|
|
206
286
|
purchaseToken: submission.token,
|
|
207
287
|
kind,
|
|
208
|
-
successUrl: buildGiftingCheckoutReturnUrl(window.location.href, "success",
|
|
288
|
+
successUrl: buildGiftingCheckoutReturnUrl(window.location.href, "success", {
|
|
289
|
+
sendOnDate: typeof sendOnDate === "string" ? sendOnDate : null,
|
|
290
|
+
receiptId
|
|
291
|
+
}),
|
|
209
292
|
cancelUrl: buildGiftingCheckoutReturnUrl(window.location.href, "cancelled")
|
|
210
|
-
})
|
|
293
|
+
});
|
|
294
|
+
const checkout = await siteTerms.api.createGiftingCheckout(checkoutInput);
|
|
295
|
+
const receipt = giftingReceiptFor({
|
|
296
|
+
offers: state.offers,
|
|
297
|
+
checkout: checkoutInput
|
|
298
|
+
});
|
|
299
|
+
if (receipt) rememberGiftingReceipt(receiptId, receipt);
|
|
211
300
|
window.location.assign(checkout.checkoutUrl);
|
|
212
301
|
} catch (error) {
|
|
213
302
|
dispatch({
|
|
@@ -236,65 +325,77 @@ function GiftingClient(props) {
|
|
|
236
325
|
children: /* @__PURE__ */ jsxs("div", {
|
|
237
326
|
className: "gifting",
|
|
238
327
|
...look.lookSlots ? { "data-slot": "layout" } : {},
|
|
239
|
-
children: [
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
328
|
+
children: [
|
|
329
|
+
/* @__PURE__ */ jsx(GiftingPanelHead, {
|
|
330
|
+
heading: look.heading,
|
|
331
|
+
intro: look.intro,
|
|
332
|
+
look
|
|
333
|
+
}),
|
|
334
|
+
/* @__PURE__ */ jsx(GiftingExpiry, { days: offers?.expiryDays }),
|
|
335
|
+
/* @__PURE__ */ jsxs("div", {
|
|
336
|
+
className: "gifting-main",
|
|
337
|
+
children: [
|
|
338
|
+
/* @__PURE__ */ jsx(GiftingPurchaseNoticeView, {
|
|
339
|
+
notice: state.purchaseNotice,
|
|
340
|
+
noticeRef
|
|
341
|
+
}),
|
|
342
|
+
state.errorMessage ? /* @__PURE__ */ jsx(FeedbackMessage, {
|
|
343
|
+
tone: "error",
|
|
252
344
|
className: "gifting-feedback",
|
|
253
|
-
role: "
|
|
254
|
-
children: state.
|
|
255
|
-
})
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
}) : null,
|
|
263
|
-
/* @__PURE__ */ jsx(SiteTermsChangedNotice, { message: siteTerms.notice }),
|
|
264
|
-
hasOffers ? /* @__PURE__ */ jsx("div", {
|
|
265
|
-
className: "gifting-groups",
|
|
266
|
-
"data-group-count": look.groups.length,
|
|
267
|
-
children: look.groups.map((group) => /* @__PURE__ */ jsx(GiftGroup, {
|
|
268
|
-
group,
|
|
269
|
-
look,
|
|
270
|
-
children: group.kind === "gift_card" ? giftCards.map((offer) => /* @__PURE__ */ jsx(GiftCardOfferForm, {
|
|
271
|
-
offer,
|
|
272
|
-
currency,
|
|
273
|
-
showTitle: giftCards.length > 1,
|
|
274
|
-
initialAmount: props.chosenAmounts?.[offer.id],
|
|
345
|
+
role: "alert",
|
|
346
|
+
children: state.errorMessage
|
|
347
|
+
}) : null,
|
|
348
|
+
/* @__PURE__ */ jsx(SiteTermsChangedNotice, { message: siteTerms.notice }),
|
|
349
|
+
hasOffers ? /* @__PURE__ */ jsx("div", {
|
|
350
|
+
className: "gifting-groups",
|
|
351
|
+
"data-group-count": look.groups.length,
|
|
352
|
+
children: look.groups.map((group) => /* @__PURE__ */ jsx(GiftGroup, {
|
|
353
|
+
group,
|
|
275
354
|
look,
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
355
|
+
children: group.kind === "gift_card" ? giftCards.map((offer) => /* @__PURE__ */ jsx(GiftCardOfferForm, {
|
|
356
|
+
offer,
|
|
357
|
+
currency,
|
|
358
|
+
showTitle: giftCards.length > 1,
|
|
359
|
+
initialAmount: props.chosenAmounts?.[offer.id],
|
|
360
|
+
look,
|
|
361
|
+
onSubmit: (event) => void handleSubmit(event, offer.id, "gift_card"),
|
|
362
|
+
fields: purchaseFields(offer.id)
|
|
363
|
+
}, offer.id)) : /* @__PURE__ */ jsx("ul", {
|
|
364
|
+
className: "gifting-voucher-list",
|
|
365
|
+
children: vouchers.map((offer) => /* @__PURE__ */ jsx("li", {
|
|
366
|
+
className: "gifting-voucher",
|
|
367
|
+
children: /* @__PURE__ */ jsx(VoucherOfferForm, {
|
|
368
|
+
offer,
|
|
369
|
+
currency,
|
|
370
|
+
look,
|
|
371
|
+
onSubmit: (event) => void handleSubmit(event, offer.id, "voucher"),
|
|
372
|
+
fields: purchaseFields(offer.id)
|
|
373
|
+
})
|
|
374
|
+
}, offer.id))
|
|
375
|
+
})
|
|
376
|
+
}, group.kind))
|
|
377
|
+
}) : /* @__PURE__ */ jsx("p", {
|
|
378
|
+
className: "gifting-empty",
|
|
379
|
+
children: GIFTING_NOTHING_TO_SHOW
|
|
380
|
+
})
|
|
381
|
+
]
|
|
382
|
+
})
|
|
383
|
+
]
|
|
384
|
+
})
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
/** How the return from checkout went, with what was bought when this tab remembers it. */
|
|
388
|
+
function GiftingPurchaseNoticeView({ notice, noticeRef }) {
|
|
389
|
+
if (!notice) return null;
|
|
390
|
+
return /* @__PURE__ */ jsx("div", {
|
|
391
|
+
ref: noticeRef,
|
|
392
|
+
tabIndex: -1,
|
|
393
|
+
className: "gifting-notice",
|
|
394
|
+
children: /* @__PURE__ */ jsxs(FeedbackMessage, {
|
|
395
|
+
tone: notice.kind === "success" ? "success" : "warning",
|
|
396
|
+
className: "gifting-feedback",
|
|
397
|
+
role: "status",
|
|
398
|
+
children: [notice.receipt ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("strong", { children: notice.receipt }), /* @__PURE__ */ jsx("br", {})] }) : null, notice.message]
|
|
298
399
|
})
|
|
299
400
|
});
|
|
300
401
|
}
|
|
@@ -1,7 +1,54 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { c as blockSiteTermsSchema } from "./src-
|
|
3
|
-
import { a as defineClientOwnedBlockRuntime, f as lookListPresentationSchemaShape, i as createZodCodec, n as createInteractiveIslandCodec, r as defineInteractiveIslandMetaKeys, t as buildInteractiveIslandProps } from "./islands-
|
|
2
|
+
import { c as blockSiteTermsSchema } from "./src-CJf3u16T.mjs";
|
|
3
|
+
import { a as defineClientOwnedBlockRuntime, f as lookListPresentationSchemaShape, i as createZodCodec, n as createInteractiveIslandCodec, r as defineInteractiveIslandMetaKeys, t as buildInteractiveIslandProps } from "./islands-C95FyxUF.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
+
//#region ../blocks/src/system/blocks/giftingOffer.ts
|
|
6
|
+
function decideGiftingOffer(onOffer) {
|
|
7
|
+
if (onOffer.giftCards === 0 && onOffer.vouchers === 0) return { kind: "nothing-on-offer" };
|
|
8
|
+
return {
|
|
9
|
+
kind: "shows",
|
|
10
|
+
giftCards: onOffer.giftCards > 0,
|
|
11
|
+
vouchers: onOffer.vouchers > 0
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function giftingShowsKind(decision, kind) {
|
|
15
|
+
return decision.kind === "shows" && decision[kind];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The form's condition for one kind's group heading, written out from the
|
|
19
|
+
* decision: it holds for each mix of offers where that kind's group shows.
|
|
20
|
+
* Offers that couldn't be read leave the facts unknown, so the field stays.
|
|
21
|
+
*/
|
|
22
|
+
const formOffers = [
|
|
23
|
+
{
|
|
24
|
+
giftCards: 0,
|
|
25
|
+
vouchers: 0
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
giftCards: 1,
|
|
29
|
+
vouchers: 0
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
giftCards: 0,
|
|
33
|
+
vouchers: 1
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
giftCards: 1,
|
|
37
|
+
vouchers: 1
|
|
38
|
+
}
|
|
39
|
+
];
|
|
40
|
+
function giftingKindCondition(kind) {
|
|
41
|
+
return { anyOf: formOffers.filter((offers) => giftingShowsKind(decideGiftingOffer(offers), kind)).map((offers) => ({ allOf: [{
|
|
42
|
+
fact: "gifting.giftCards",
|
|
43
|
+
is: offers.giftCards > 0 ? "some" : "none"
|
|
44
|
+
}, {
|
|
45
|
+
fact: "gifting.vouchers",
|
|
46
|
+
is: offers.vouchers > 0 ? "some" : "none"
|
|
47
|
+
}] })) };
|
|
48
|
+
}
|
|
49
|
+
const giftCardsShownCondition = giftingKindCondition("giftCards");
|
|
50
|
+
const vouchersShownCondition = giftingKindCondition("vouchers");
|
|
51
|
+
//#endregion
|
|
5
52
|
//#region ../blocks/src/system/runtime/nodes/gifting.interactive.ts
|
|
6
53
|
const publicGiftCardOfferSchema = z.object({
|
|
7
54
|
id: z.string(),
|
|
@@ -28,6 +75,7 @@ const publicVoucherOfferSchema = z.object({
|
|
|
28
75
|
});
|
|
29
76
|
const publicGiftingOffersResponseSchema = z.object({
|
|
30
77
|
currency: z.string(),
|
|
78
|
+
expiryDays: z.number().int().positive(),
|
|
31
79
|
giftCards: z.array(publicGiftCardOfferSchema),
|
|
32
80
|
vouchers: z.array(publicVoucherOfferSchema)
|
|
33
81
|
});
|
|
@@ -43,7 +91,6 @@ const giftingSourceSchema = z.object({
|
|
|
43
91
|
intro: z.string().nullable().optional(),
|
|
44
92
|
giftCardsHeading: z.string().nullable().optional(),
|
|
45
93
|
vouchersHeading: z.string().nullable().optional(),
|
|
46
|
-
emptyStateText: z.string().nullable().optional(),
|
|
47
94
|
checkoutButtonText: z.string().nullable().optional(),
|
|
48
95
|
successMessage: z.string().nullable().optional()
|
|
49
96
|
});
|
|
@@ -59,8 +106,7 @@ const giftingDisplaySchema = z.object({
|
|
|
59
106
|
kind: z.enum(["gift_card", "voucher"]),
|
|
60
107
|
heading: z.string(),
|
|
61
108
|
line: z.string()
|
|
62
|
-
}))
|
|
63
|
-
emptyStateText: z.string()
|
|
109
|
+
}))
|
|
64
110
|
});
|
|
65
111
|
const giftingHydrationSchema = z.object({
|
|
66
112
|
groupHeadings: z.object({
|
|
@@ -88,11 +134,17 @@ function giftingLookPresentation({ lookSlots, surfacePresentation }) {
|
|
|
88
134
|
...surfacePresentation ? { surfacePresentation } : {}
|
|
89
135
|
};
|
|
90
136
|
}
|
|
137
|
+
/** A group for each kind the decision shows; none while the offers couldn't be read. */
|
|
91
138
|
function giftingGroups(source) {
|
|
92
|
-
|
|
139
|
+
const offers = source.offers;
|
|
140
|
+
if (!offers) return [];
|
|
141
|
+
const decision = decideGiftingOffer({
|
|
142
|
+
giftCards: offers.giftCards.length,
|
|
143
|
+
vouchers: offers.vouchers.length
|
|
144
|
+
});
|
|
145
|
+
return [...giftingShowsKind(decision, "giftCards") ? [giftingGroup("gift_card", offers.giftCards.length, source.giftCardsHeading)] : [], ...giftingShowsKind(decision, "vouchers") ? [giftingGroup("voucher", offers.vouchers.length, source.vouchersHeading)] : []];
|
|
93
146
|
}
|
|
94
147
|
function giftingGroup(kind, count, heading) {
|
|
95
|
-
if (count === 0) return null;
|
|
96
148
|
const singular = kind === "gift_card" ? "Gift card" : "Voucher";
|
|
97
149
|
return {
|
|
98
150
|
kind,
|
|
@@ -108,8 +160,7 @@ function buildGiftingDisplay(source) {
|
|
|
108
160
|
className: source.className ?? null,
|
|
109
161
|
heading: source.heading?.trim() || "Gift cards & vouchers",
|
|
110
162
|
intro: source.intro?.trim() || null,
|
|
111
|
-
groups: giftingGroups(source)
|
|
112
|
-
emptyStateText: source.emptyStateText?.trim() || "Nothing is available right now."
|
|
163
|
+
groups: giftingGroups(source)
|
|
113
164
|
};
|
|
114
165
|
}
|
|
115
166
|
const giftingBlockRuntime = defineClientOwnedBlockRuntime({
|
|
@@ -154,4 +205,4 @@ function buildGiftingInteractiveIslandProps(props) {
|
|
|
154
205
|
});
|
|
155
206
|
}
|
|
156
207
|
//#endregion
|
|
157
|
-
export { publicGiftingOffersResponseSchema as a, giftingInteractiveIslandPropsCodec as i, buildGiftingInteractiveIslandProps as n, giftingBlockRuntime as r, buildGiftingDisplay as t };
|
|
208
|
+
export { publicGiftingOffersResponseSchema as a, vouchersShownCondition as c, giftingInteractiveIslandPropsCodec as i, buildGiftingInteractiveIslandProps as n, decideGiftingOffer as o, giftingBlockRuntime as r, giftCardsShownCondition as s, buildGiftingDisplay as t };
|
|
@@ -1,49 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { An as formatCurrencyAmount } from "./src-
|
|
3
|
-
import { d as listLookSlot } from "./islands-
|
|
2
|
+
import { An as formatCurrencyAmount } from "./src-CJf3u16T.mjs";
|
|
3
|
+
import { d as listLookSlot } from "./islands-C95FyxUF.mjs";
|
|
4
|
+
import { t as SiteChoiceGroup } from "./SiteChoiceGroup-BZ5I0Vhy.mjs";
|
|
4
5
|
import "react";
|
|
5
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
//#region ../blocks/src/system/runtime/shared/components/ChoiceGroup.tsx
|
|
7
|
-
function ChoiceGroup(props) {
|
|
8
|
-
const size = props.size ?? "pill";
|
|
9
|
-
return /* @__PURE__ */ jsxs("fieldset", {
|
|
10
|
-
className: ["rb-choice-group", props.className].filter(Boolean).join(" "),
|
|
11
|
-
"data-choice-size": size,
|
|
12
|
-
disabled: props.disabled,
|
|
13
|
-
children: [/* @__PURE__ */ jsx("legend", {
|
|
14
|
-
className: props.legendHidden ? "rb-choice-legend rb-choice-legend--hidden" : "rb-choice-legend",
|
|
15
|
-
children: props.legend
|
|
16
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
17
|
-
className: "rb-choice-options",
|
|
18
|
-
children: props.options.map((option) => /* @__PURE__ */ jsxs("label", {
|
|
19
|
-
className: "rb-choice",
|
|
20
|
-
"data-choice-size": size,
|
|
21
|
-
children: [/* @__PURE__ */ jsx("input", {
|
|
22
|
-
type: "radio",
|
|
23
|
-
className: "rb-choice-input",
|
|
24
|
-
name: props.name,
|
|
25
|
-
value: option.value,
|
|
26
|
-
required: props.required,
|
|
27
|
-
disabled: option.disabled,
|
|
28
|
-
...props.value === void 0 ? { defaultChecked: option.value === props.defaultValue } : { checked: option.value === props.value },
|
|
29
|
-
onChange: props.onChange ? () => props.onChange?.(option.value) : void 0
|
|
30
|
-
}), /* @__PURE__ */ jsxs("span", {
|
|
31
|
-
className: "rb-choice-face",
|
|
32
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
33
|
-
className: "rb-choice-label",
|
|
34
|
-
children: option.label
|
|
35
|
-
}), option.detail ? /* @__PURE__ */ jsx("span", {
|
|
36
|
-
className: "rb-choice-detail",
|
|
37
|
-
children: option.detail
|
|
38
|
-
}) : null]
|
|
39
|
-
})]
|
|
40
|
-
}, option.value))
|
|
41
|
-
})]
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
//#endregion
|
|
45
7
|
//#region ../blocks/src/system/runtime/nodes/gifting.parts.tsx
|
|
46
8
|
const CUSTOM_GIFT_AMOUNT = "custom";
|
|
9
|
+
/**
|
|
10
|
+
* What the panel says with no offers to show. Visitors only see it if the
|
|
11
|
+
* offers couldn't be read: with nothing on offer the block stays hidden.
|
|
12
|
+
*/
|
|
13
|
+
const GIFTING_NOTHING_TO_SHOW = "Nothing is available right now.";
|
|
47
14
|
/** A Look's hook (and, for the panel, its surface) on one part of the gifting panel; nothing outside a Look. */
|
|
48
15
|
function giftingSlot(look, slot) {
|
|
49
16
|
return listLookSlot(look ?? {}, slot);
|
|
@@ -74,7 +41,7 @@ function GiftCardAmounts(props) {
|
|
|
74
41
|
value: CUSTOM_GIFT_AMOUNT,
|
|
75
42
|
label: "Another amount"
|
|
76
43
|
}] : []];
|
|
77
|
-
return /* @__PURE__ */ jsx(
|
|
44
|
+
return /* @__PURE__ */ jsx(SiteChoiceGroup, {
|
|
78
45
|
className: "gifting-amounts",
|
|
79
46
|
name: props.groupName ?? "amountChoice",
|
|
80
47
|
legend: "Amount",
|
|
@@ -115,5 +82,12 @@ function GiftGroup(props) {
|
|
|
115
82
|
}), props.children]
|
|
116
83
|
});
|
|
117
84
|
}
|
|
85
|
+
/** The same validity before hydration and while filling in the purchase form. */
|
|
86
|
+
function GiftingExpiry({ days }) {
|
|
87
|
+
return days === void 0 ? null : /* @__PURE__ */ jsx("p", {
|
|
88
|
+
className: "gifting-offer-description",
|
|
89
|
+
children: `Valid for ${days} ${days === 1 ? "day" : "days"} from the date the gift is sent.`
|
|
90
|
+
});
|
|
91
|
+
}
|
|
118
92
|
//#endregion
|
|
119
|
-
export {
|
|
93
|
+
export { GiftingExpiry as a, formatGiftAmount as c, GiftGroup as i, giftingSlot as l, GIFTING_NOTHING_TO_SHOW as n, GiftingPanelHead as o, GiftCardAmounts as r, firstGiftAmountChoice as s, CUSTOM_GIFT_AMOUNT as t, readChosenGiftAmounts as u };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as defineIslandPropsDecoder } from "./propsDecoder-
|
|
3
|
-
import { t as mountHeaderChromeRuntime } from "./enhanceHeaderSection-
|
|
2
|
+
import { t as defineIslandPropsDecoder } from "./propsDecoder-Co1VXFaW.mjs";
|
|
3
|
+
import { t as mountHeaderChromeRuntime } from "./enhanceHeaderSection-DgzZNM2M.mjs";
|
|
4
4
|
//#region src/rendering/islands/enhancers/headerSection.ts
|
|
5
5
|
const decode = defineIslandPropsDecoder("headerSection");
|
|
6
6
|
const enhance = (root, props) => {
|