@riverbankcms/sdk 0.155.0 → 0.156.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/{PreviewEditorSidebar-CbSbqmz3.mjs → PreviewEditorSidebar-B4ESNPzL.mjs} +3 -3
- package/dist/{PreviewEditorUI-CKKnAw11.mjs → PreviewEditorUI-BdUVaGOh.mjs} +3 -3
- package/dist/{SdkPreviewModeRuntime-wLkXrWy9.mjs → SdkPreviewModeRuntime-C4V3BvxK.mjs} +1122 -1079
- package/dist/{SiteChromeCustomizeContext-BQ8vvKb-.mjs → SiteChromeCustomizeContext-3gmd26Mn.mjs} +1019 -517
- package/dist/_dts/ai/src/contracts/proposals.d.ts +624 -624
- package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +856 -856
- package/dist/_dts/api/src/accountApi.d.ts +5 -5
- package/dist/_dts/api/src/aiPlayground.d.ts +2 -2
- package/dist/_dts/api/src/bookingRecords.d.ts +2 -22
- package/dist/_dts/api/src/commercePortalEndpoints.d.ts +1 -1
- package/dist/_dts/api/src/contentRuntime.d.ts +5 -2
- package/dist/_dts/api/src/footerCompositionContracts.d.ts +1 -1
- package/dist/_dts/api/src/navigation/linkValue.d.ts +1 -1
- package/dist/_dts/api/src/navigation/types.d.ts +1 -1
- package/dist/_dts/api/src/public/types.d.ts +2 -1
- package/dist/_dts/api/src/publicExperience/commerceEndpoints.d.ts +1 -1
- package/dist/_dts/api/src/publicExperience/eventEndpoints.d.ts +3 -3
- package/dist/_dts/api/src/publicExperience/siteEndpoints.d.ts +1 -1
- package/dist/_dts/api/src/sdkBlockContentAdmission.d.ts +1 -1
- package/dist/_dts/api/src/sdkConfig/contracts.d.ts +2 -1
- package/dist/_dts/api/src/sdkContracts.d.ts +2 -1
- package/dist/_dts/api/src/sdkPageDesign.d.ts +9 -9
- package/dist/_dts/api/src/sdkThemeWire.d.ts +182 -182
- package/dist/_dts/api/src/siteOnboarding.d.ts +1 -1
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +3 -1
- package/dist/_dts/api/src/siteSettings.d.ts +2 -2
- package/dist/_dts/api/src/teamMembers.d.ts +1 -1
- package/dist/_dts/block-form/src/widgets/RepeaterField/hooks/useLayoutGridMoveAnimation.d.ts +13 -0
- package/dist/_dts/blocks/src/client/portal.d.ts +5 -0
- package/dist/_dts/blocks/src/contracts/event-registration.d.ts +141 -0
- package/dist/_dts/blocks/src/contracts/events.d.ts +21 -0
- package/dist/_dts/blocks/src/contracts/footer.d.ts +130 -0
- package/dist/_dts/blocks/src/contracts/non-block-islands.d.ts +1 -1
- package/dist/_dts/blocks/src/contracts/site-chrome.d.ts +10 -0
- package/dist/_dts/blocks/src/customer-portal/client.d.ts +62 -0
- package/dist/_dts/blocks/src/customer-portal/components/PortalLoginForm.d.ts +16 -0
- package/dist/_dts/blocks/src/customer-portal/components/badge.d.ts +6 -0
- package/dist/_dts/blocks/src/customer-portal/components/bookings/AppointmentBeforeYouComeTask.d.ts +29 -0
- package/dist/_dts/blocks/src/customer-portal/components/bookings/BookingsSection.d.ts +22 -0
- package/dist/_dts/blocks/src/customer-portal/components/bookings/BookingsTable.d.ts +9 -0
- package/dist/_dts/blocks/src/customer-portal/components/bookings/EventRow.d.ts +9 -0
- package/dist/_dts/blocks/src/customer-portal/components/bookings/EventSeriesRegistrationRow.d.ts +8 -0
- package/dist/_dts/blocks/src/customer-portal/components/bookings/EventSeriesRegistrationTableRow.d.ts +22 -0
- package/dist/_dts/blocks/src/customer-portal/components/bookings/PortalAppointmentRescheduleFlow.d.ts +7 -0
- package/dist/_dts/blocks/src/customer-portal/components/bookings/ScalarQuestionInput.d.ts +11 -0
- package/dist/_dts/blocks/src/customer-portal/components/bookings/WaitlistCard.d.ts +8 -0
- package/dist/_dts/blocks/src/customer-portal/components/bookings/WaitlistsSection.d.ts +19 -0
- package/dist/_dts/blocks/src/customer-portal/components/bookings/bookingsTypes.d.ts +11 -0
- package/dist/_dts/blocks/src/customer-portal/components/bookings/eventGuestDrafts.d.ts +6 -0
- package/dist/_dts/blocks/src/customer-portal/components/bookings/eventSeriesRegistrationPresentation.d.ts +8 -0
- package/dist/_dts/blocks/src/customer-portal/components/bookings/usePortalCancelFlow.d.ts +36 -0
- package/dist/_dts/blocks/src/customer-portal/components/bookings/usePortalCancelFlow.state.d.ts +43 -0
- package/dist/_dts/blocks/src/customer-portal/components/orders/OrdersSection.d.ts +8 -0
- package/dist/_dts/blocks/src/customer-portal/components/orders/orderInteraction.d.ts +63 -0
- package/dist/_dts/blocks/src/customer-portal/components/portal-modal.d.ts +8 -0
- package/dist/_dts/blocks/src/customer-portal/components/portalDeepLink.d.ts +19 -0
- package/dist/_dts/blocks/src/customer-portal/components/useMembershipCancelFlow.d.ts +13 -0
- package/dist/_dts/blocks/src/customer-portal/components/useMembershipCancelFlow.state.d.ts +32 -0
- package/dist/_dts/blocks/src/customer-portal/pages/AccessState.d.ts +11 -0
- package/dist/_dts/blocks/src/customer-portal/pages/DigitalProductView.d.ts +4 -0
- package/dist/_dts/blocks/src/customer-portal/pages/PageChrome.d.ts +9 -0
- package/dist/_dts/blocks/src/customer-portal/pages/PrintButton.d.ts +1 -0
- package/dist/_dts/blocks/src/customer-portal/pages/TicketCode.d.ts +3 -0
- package/dist/_dts/blocks/src/customer-portal/pages/TicketView.d.ts +4 -0
- package/dist/_dts/blocks/src/customer-portal/route-client.d.ts +9 -0
- package/dist/_dts/blocks/src/customer-portal/shared/bookingRoute.d.ts +9 -0
- package/dist/_dts/blocks/src/customer-portal/shared/checkoutUrls.d.ts +4 -0
- package/dist/_dts/blocks/src/customer-portal/shared/signedUrlUpload.d.ts +1 -0
- package/dist/_dts/blocks/src/customer-portal/shared/urlParams.d.ts +30 -0
- package/dist/_dts/blocks/src/customer-portal/state.d.ts +196 -0
- package/dist/_dts/blocks/src/customer-portal/tabs.d.ts +17 -0
- package/dist/_dts/blocks/src/portal/dateFormatting.d.ts +13 -0
- package/dist/_dts/blocks/src/portal/types.d.ts +7 -14
- package/dist/_dts/blocks/src/system/blocks/event-details.d.ts +1 -25
- package/dist/_dts/blocks/src/system/blocks/event-registration.d.ts +1 -141
- package/dist/_dts/blocks/src/system/blocks/events/eventSelectionFields.d.ts +3 -3
- package/dist/_dts/blocks/src/system/blocks/location-map.d.ts +3 -3
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +135 -135
- package/dist/_dts/blocks/src/system/blocks/site-footer-runtime.d.ts +3 -129
- package/dist/_dts/blocks/src/system/blocks/site-footer.d.ts +2 -5
- package/dist/_dts/blocks/src/system/blocks/site-header.d.ts +2 -5
- package/dist/_dts/blocks/src/system/constants/events.d.ts +1 -1
- package/dist/_dts/blocks/src/system/customize/facets.d.ts +2 -2
- package/dist/_dts/blocks/src/system/manifest/schema.d.ts +82 -82
- package/dist/_dts/blocks/src/system/node/fragments/lookSlot.d.ts +2 -2
- package/dist/_dts/blocks/src/system/node/schema.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/api/client.d.ts +21 -2
- package/dist/_dts/blocks/src/system/runtime/api/endpoints.d.ts +87 -3
- package/dist/_dts/blocks/src/system/runtime/api/index.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/api/schemas/events.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/api/types/events.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/api/types/portal.d.ts +16 -27
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +6 -6
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +4 -4
- package/dist/_dts/blocks/src/system/runtime/hooks/useAvailableDates.d.ts +2 -5
- package/dist/_dts/blocks/src/system/runtime/hooks/useAvailableSlots.d.ts +2 -5
- package/dist/_dts/blocks/src/system/runtime/lookSurfaces.d.ts +9 -9
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details/lookPresentation.d.ts +9 -9
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details/presentation.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +18 -18
- package/dist/_dts/blocks/src/system/runtime/nodes/form.interactive.d.ts +2 -10
- package/dist/_dts/blocks/src/system/runtime/nodes/form.types.d.ts +10 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/shared/contract-schemas.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/shared/AppointmentRescheduleSlotOptions.d.ts +11 -0
- package/dist/_dts/blocks/src/system/runtime/shared/useAppointmentRescheduleFlow.d.ts +73 -0
- package/dist/_dts/blocks/src/system/runtime/shared/useAppointmentRescheduleFlow.state.d.ts +62 -0
- package/dist/_dts/blocks/src/system/runtime/shared/utils/demoPortalMagicLink.d.ts +1 -4
- package/dist/_dts/commerce/src/moneyDateUtils.d.ts +7 -0
- package/dist/_dts/core/src/booking-date-time.d.ts +5 -1
- package/dist/_dts/core/src/date-display.d.ts +4 -0
- package/dist/_dts/core/src/navigation-portal-labels.d.ts +1 -1
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +13 -0
- package/dist/_dts/db/src/schemas/forms.d.ts +4 -4
- package/dist/_dts/preview-next/src/client/preview/PreviewEditingModeProvider.d.ts +7 -0
- package/dist/_dts/sdk/src/bookings/types.d.ts +0 -1
- package/dist/_dts/sdk/src/next/index.d.ts +1 -0
- package/dist/_dts/sdk/src/next/portal.d.ts +41 -0
- package/dist/_dts/sdk/src/next/resolveTheme.d.ts +4 -9
- package/dist/_dts/sdk/src/next/types.d.ts +8 -3
- package/dist/_dts/sdk/src/portal/client.d.ts +1 -0
- package/dist/_dts/sdk/src/portal/index.d.ts +4 -36
- package/dist/_dts/sdk/src/portal/token.d.ts +4 -20
- package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +4 -1
- package/dist/_dts/sdk/src/rendering/islands/types.d.ts +1 -28
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/accordions/types.d.ts +4 -4
- package/dist/_dts/theme-core/src/buttons/types.d.ts +41 -41
- package/dist/_dts/theme-core/src/buttons/typography.d.ts +2 -2
- package/dist/_dts/theme-core/src/cards/types.d.ts +34 -34
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/header/containerSchema.d.ts +2 -2
- package/dist/_dts/theme-core/src/hosted-booking-appearance.d.ts +1 -1
- package/dist/_dts/theme-core/src/inputs/types.d.ts +4 -4
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +255 -255
- package/dist/_dts/theme-core/src/navigation/types.d.ts +6 -6
- package/dist/_dts/theme-core/src/palette/colors.d.ts +1 -1
- package/dist/_dts/theme-core/src/palette/curated/types.d.ts +2 -2
- package/dist/_dts/theme-core/src/schema.d.ts +294 -294
- package/dist/_dts/theme-core/src/shared/componentStyles.d.ts +1 -1
- package/dist/_dts/theme-core/src/site-styles/backgroundAppearance.d.ts +2 -2
- package/dist/_dts/theme-core/src/site-styles/compileFooterAgainstRow.d.ts +7 -7
- package/dist/_dts/theme-core/src/site-styles/headerPreferencesPersistence.d.ts +1 -1
- package/dist/_dts/theme-core/src/site-styles/pageDesignIntent.d.ts +12 -12
- package/dist/_dts/theme-core/src/tokens/themeColorTokens.d.ts +2 -2
- package/dist/_dts/theme-core/src/typography/schema.d.ts +27 -27
- package/dist/_dts/ui/src/button.d.ts +1 -1
- package/dist/_dts/ui/src/surface.d.ts +2 -2
- package/dist/_dts/ui/src/toggle.d.ts +2 -2
- package/dist/client/{BookingMailingListNote-CiW1dsz7.mjs → BookingMailingListNote-B9mP3Io9.mjs} +2 -2
- package/dist/client/{CardListItem-DVYTlYpS.mjs → CardListItem-D5rL2wPv.mjs} +3 -3
- package/dist/client/{CheckboxChoice-CUnPrBlC.mjs → CheckboxChoice-Bz6wLaBl.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-DEsn5F2C.mjs → DemoBookingPortalAccess-7BPVzfLU.mjs} +6 -10
- package/dist/client/{EventCombined.client-BdctbwnV.mjs → EventCombined.client-DZH5qHJl.mjs} +5 -5
- package/dist/client/{EventEmbeddedCheckoutStep-DAhQs6Jb.mjs → EventEmbeddedCheckoutStep-CV31Qvn2.mjs} +2 -2
- package/dist/client/{EventListing.client-BviZXfAE.mjs → EventListing.client-C19sjRGF.mjs} +2 -2
- package/dist/client/{LeafletStaticMap-BLTECfjU.mjs → LeafletStaticMap-DjUjYdzQ.mjs} +1 -1
- package/dist/client/{RichText-D3oE1_pw.mjs → RichText-DkKcVZwr.mjs} +2 -2
- package/dist/client/{ThemedButton-Ckj0Rfr_.mjs → ThemedButton-CTgpAXfL.mjs} +1 -1
- package/dist/client/{accordion-yBx6d4O2.mjs → accordion-R2-q5wo-.mjs} +1 -1
- package/dist/client/{bookingForm-CPDEsQci.mjs → bookingForm-VSU8nIdO.mjs} +12 -16
- package/dist/client/bookings.mjs +352 -64
- package/dist/client/{carousel-DCqjwd2s.mjs → carousel-BjPlY4ee.mjs} +2 -2
- package/dist/client/{carousel.client-Bx7XMF8-.mjs → carousel.client-Tnwvm0l1.mjs} +1 -1
- package/dist/client/{cart-DWJXrQxs.mjs → cart-DAPYTOP7.mjs} +3 -3
- package/dist/client/{checkout-CH4ypSLS.mjs → checkout-DGJTx4vB.mjs} +3 -3
- package/dist/client/client.mjs +61275 -61217
- package/dist/client/{context-BOs0m_iw.mjs → context-ByZBoKdq.mjs} +92 -209
- package/dist/client/{eventCalendar-CRylMllc.mjs → eventCalendar-CP5Z7iME.mjs} +8 -8
- package/dist/client/{eventCombined-DohTS3kp.mjs → eventCombined-D8nbUyxu.mjs} +4 -4
- package/dist/client/{eventDetails-qf-u9zcF.mjs → eventDetails-Bknq8k7E.mjs} +46 -44
- package/dist/client/{eventListing-Cg__X2vy.mjs → eventListing-BwMnPteX.mjs} +4 -4
- package/dist/client/{eventRegistration-CybWxswy.mjs → eventRegistration-COFk1mjw.mjs} +11 -11
- package/dist/client/{form-C-SGk6nq.mjs → form-BiWLd_me.mjs} +5 -5
- package/dist/client/{headerSection-BdzPaHqo.mjs → headerSection-BptDP4xF.mjs} +3 -3
- package/dist/client/hooks.mjs +22850 -22861
- package/dist/client/{locationMap-CEwIKmMb.mjs → locationMap-B-kPoqcK.mjs} +3 -3
- package/dist/client/{media-V_ShXXru.mjs → media-FjqQK4qS.mjs} +68 -1
- package/dist/client/{newsletterForm-CmwTltoS.mjs → newsletterForm-s_B8fCtT.mjs} +4 -4
- package/dist/client/portal/client.mjs +17419 -0
- package/dist/client/{productDetail-DjIzUwg3.mjs → productDetail-CS3GZMPi.mjs} +3 -3
- package/dist/client/{productList-D6JGFnMF.mjs → productList-Csc3WJDs.mjs} +3 -3
- package/dist/client/{propsDecoder-BRKz13eg.mjs → propsDecoder-Dn68GoQZ.mjs} +502 -2705
- package/dist/client/rendering/client.mjs +3303 -3612
- package/dist/client/rendering/islands.mjs +17 -17
- package/dist/client/rendering.mjs +46273 -46220
- package/dist/client/{routeIslandApiConfig-slAAILQ5.mjs → routeIslandApiConfig-DeBuevOO.mjs} +1 -1
- package/dist/client/{shop-C45K96_0.mjs → shop-B5EQbeUX.mjs} +7 -7
- package/dist/client/{shop-commerce-oGBiKT5d.mjs → shop-commerce-DYs7PdNL.mjs} +8 -8
- package/dist/client/{shop-commerce-store-H_HFPFZ8.mjs → shop-commerce-store-B2-DIPbg.mjs} +1 -1
- package/dist/client/{shopShared-D54T_LAV.mjs → shopShared-CE302Pfy.mjs} +4 -4
- package/dist/client/{useDiscountCodeUi-Dm2EUa03.mjs → useDiscountCodeUi-BZ02FBrV.mjs} +1 -1
- package/dist/client/{useEventPagination-0l_A8CxG.mjs → useEventPagination-VudQWKtG.mjs} +116 -6
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/{sdk-runtime-CjTM32Ah.mjs → sdk-runtime-C8Qh6r51.mjs} +1 -1
- package/dist/server/components.mjs +927 -262
- package/dist/server/config-template-validation.mjs +5 -3
- package/dist/server/config-validation.mjs +35200 -35211
- package/dist/server/config.mjs +35200 -35211
- package/dist/server/data.mjs +32783 -32794
- package/dist/server/date-time.mjs +14 -7
- package/dist/server/index.mjs +1 -1
- package/dist/server/navigation.mjs +1 -1
- package/dist/server/next.mjs +71470 -70677
- package/dist/server/page-converter.mjs +202 -213
- package/dist/server/portal.mjs +5 -51
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +1180 -722
- package/dist/server/rendering.mjs +922 -262
- package/dist/server/routing.mjs +39382 -41704
- package/dist/server/server.mjs +203 -214
- package/dist/server/theme-bridge.mjs +262 -2
- package/dist/{spinner-KVVZh8jd.mjs → spinner-Bi68Z_0o.mjs} +1 -1
- package/dist/styles/index.css +258 -2
- package/package.json +9 -1
- package/dist/_dts/sdk/src/portal/config.d.ts +0 -67
|
@@ -6991,6 +6991,13 @@ function getDateTimeFormatter(locale, timeZone, format) {
|
|
|
6991
6991
|
dateTimeFormatterCache.set(key, formatter);
|
|
6992
6992
|
return formatter;
|
|
6993
6993
|
}
|
|
6994
|
+
function formatIntlRange(formatter, start, end) {
|
|
6995
|
+
const nativeFormatRange = Reflect.get(formatter, "formatRange");
|
|
6996
|
+
if (typeof nativeFormatRange !== "function") throw new Error("Intl.DateTimeFormat.formatRange is required");
|
|
6997
|
+
const output = Reflect.apply(nativeFormatRange, formatter, [start, end]);
|
|
6998
|
+
if (typeof output !== "string") throw new Error("Intl.DateTimeFormat.formatRange returned a non-string value");
|
|
6999
|
+
return output;
|
|
7000
|
+
}
|
|
6994
7001
|
//#endregion
|
|
6995
7002
|
//#region ../core/src/booking-time-zone.ts
|
|
6996
7003
|
const TIME_ZONE_VALIDITY_CACHE_LIMIT = 100;
|
|
@@ -7079,6 +7086,11 @@ function resolveBookingTimeZoneId(...candidates) {
|
|
|
7079
7086
|
}
|
|
7080
7087
|
return FALLBACK_TIMEZONE;
|
|
7081
7088
|
}
|
|
7089
|
+
/** Canonical business-zone admission, shared by server and public wire boundaries. */
|
|
7090
|
+
const DEFAULT_BOOKING_BUSINESS_TIME_ZONE = "Europe/London";
|
|
7091
|
+
function resolveBookingBusinessTimeZone(value) {
|
|
7092
|
+
return resolveBookingTimeZoneId(value, DEFAULT_BOOKING_BUSINESS_TIME_ZONE);
|
|
7093
|
+
}
|
|
7082
7094
|
function parseUtcIsoDateTimeString(value) {
|
|
7083
7095
|
const normalized = value.trim();
|
|
7084
7096
|
const hasUtcSuffix = normalized.endsWith("Z");
|
|
@@ -7186,6 +7198,34 @@ function formatBookingTime(input, format = {
|
|
|
7186
7198
|
format
|
|
7187
7199
|
});
|
|
7188
7200
|
}
|
|
7201
|
+
/**
|
|
7202
|
+
* Formats the compact English event-time presentation used by public surfaces.
|
|
7203
|
+
*
|
|
7204
|
+
* This intentionally owns the lowercase day-period token and zero-minute
|
|
7205
|
+
* omission instead of depending on locale-specific spacing or punctuation.
|
|
7206
|
+
* Callers must only use it for an English presentation contract.
|
|
7207
|
+
*/
|
|
7208
|
+
function formatBookingCompactEnglishTime(input, options = {}) {
|
|
7209
|
+
const date = new Date(input.startsAt);
|
|
7210
|
+
if (Number.isNaN(date.getTime())) return input.startsAt;
|
|
7211
|
+
return compactEnglishClock(formatToPartsLookup(date, input.locale ?? "en-GB", input.timeZone, {
|
|
7212
|
+
hour: "numeric",
|
|
7213
|
+
minute: "2-digit",
|
|
7214
|
+
hourCycle: "h12",
|
|
7215
|
+
...options.seconds === "include" ? { second: "2-digit" } : {}
|
|
7216
|
+
}), options.seconds) ?? input.startsAt;
|
|
7217
|
+
}
|
|
7218
|
+
/** Precision and zero-minute omission are one decision for all compact clocks. */
|
|
7219
|
+
function compactEnglishClock(parts, seconds) {
|
|
7220
|
+
const hour = parts.get("hour");
|
|
7221
|
+
const minute = parts.get("minute");
|
|
7222
|
+
const dayPeriod = parts.get("dayPeriod");
|
|
7223
|
+
const second = parts.get("second");
|
|
7224
|
+
if (hour === void 0 || minute === void 0 || dayPeriod === void 0) return null;
|
|
7225
|
+
const token = dayPeriod.toLowerCase();
|
|
7226
|
+
if (seconds === "include") return second === void 0 ? null : `${hour}:${minute}:${second}${token}`;
|
|
7227
|
+
return `${minute === "00" ? hour : `${hour}:${minute}`}${token}`;
|
|
7228
|
+
}
|
|
7189
7229
|
function formatBookingDateParts(input, options) {
|
|
7190
7230
|
return {
|
|
7191
7231
|
date: formatBookingDate(input, options?.dateFormat ?? {
|
|
@@ -7311,6 +7351,173 @@ function inferSiteDateLocale(siteTimeZone) {
|
|
|
7311
7351
|
if (siteTimeZone === "Pacific/Auckland" || siteTimeZone === "Pacific/Chatham") return "en-NZ";
|
|
7312
7352
|
return "en-US";
|
|
7313
7353
|
}
|
|
7354
|
+
function formatDate$1(value, context, options = {}) {
|
|
7355
|
+
return presentDate(value, context, displayProfile(options, "omit"));
|
|
7356
|
+
}
|
|
7357
|
+
function formatDateRange(start, endInclusive, context, options = {}) {
|
|
7358
|
+
const first = {
|
|
7359
|
+
kind: "civil",
|
|
7360
|
+
value: projectDate(start, context)
|
|
7361
|
+
};
|
|
7362
|
+
const last = {
|
|
7363
|
+
kind: "civil",
|
|
7364
|
+
value: projectDate(endInclusive, context)
|
|
7365
|
+
};
|
|
7366
|
+
const preserveOrder = options.order === "session" && compareLocalScheduleDates(first.value, last.value) > 0;
|
|
7367
|
+
const profile = displayProfile(preserveOrder ? {
|
|
7368
|
+
...options,
|
|
7369
|
+
year: "numeric"
|
|
7370
|
+
} : options, "omit");
|
|
7371
|
+
return preserveOrder ? `${presentDate(first, context, profile)} – ${presentDate(last, context, profile)}` : presentDateRange(first, last, context, profile);
|
|
7372
|
+
}
|
|
7373
|
+
function formatDateTimeRange(span, context, options) {
|
|
7374
|
+
return presentDateTimeRange(span, context, displayProfile(options, options.zone, options.seconds));
|
|
7375
|
+
}
|
|
7376
|
+
/** Sole date projection/typography owner, used by display and scheduled adapters. */
|
|
7377
|
+
function presentDate(value, context, profile) {
|
|
7378
|
+
const date = dateCarrier(value);
|
|
7379
|
+
const zone = value.kind === "civil" ? "UTC" : context.timeZone;
|
|
7380
|
+
const output = getDateTimeFormatter(context.locale, zone, profile.dateFormat).format(date);
|
|
7381
|
+
if (profile.kind === "sdk") return output;
|
|
7382
|
+
const normalized = normalizeDisplay(output);
|
|
7383
|
+
return profile.dateFormat.weekday && new Intl.Locale(context.locale).language === "en" ? normalized.replace(/^([^,]+), /u, "$1 ") : normalized;
|
|
7384
|
+
}
|
|
7385
|
+
function presentDateRange(start, end, context, profile) {
|
|
7386
|
+
if (dateCarrier(end).getTime() < dateCarrier(start).getTime()) throw new RangeError("Date range end must be on or after its start");
|
|
7387
|
+
if (profile.kind === "display" && compareLocalScheduleDates(projectDate(start, context), projectDate(end, context)) === 0) return presentDate(start, context, profile);
|
|
7388
|
+
const output = formatIntlRange(getDateTimeFormatter(context.locale, start.kind === "civil" ? "UTC" : context.timeZone, profile.dateFormat), dateCarrier(start), dateCarrier(end));
|
|
7389
|
+
if (profile.kind === "sdk") return output;
|
|
7390
|
+
const startDate = projectDate(start, context);
|
|
7391
|
+
const endDate = projectDate(end, context);
|
|
7392
|
+
const separator = startDate.month === endDate.month && startDate.year === endDate.year ? "–" : " – ";
|
|
7393
|
+
return normalizeDisplay(output).replace(/\s*–\s*/gu, separator);
|
|
7394
|
+
}
|
|
7395
|
+
function presentTime(value, context, profile) {
|
|
7396
|
+
const clock = presentClock(value, context, profile.clock);
|
|
7397
|
+
return profile.zone === "always" ? `${clock} ${zoneLabel(value, context)}` : clock;
|
|
7398
|
+
}
|
|
7399
|
+
function presentTimeRange(span, context, profile) {
|
|
7400
|
+
assertOrdered(span.start, span.end);
|
|
7401
|
+
if (profile.clock.kind === "intl") return presentNativeRange(span, context, profile.clock.format);
|
|
7402
|
+
const startClock = presentClock(span.start, context, profile.clock);
|
|
7403
|
+
const endClock = presentClock(span.end, context, profile.clock);
|
|
7404
|
+
const clocks = (profile.kind === "sdk" ? startClock === endClock : span.start === span.end) ? startClock : `${startClock}–${endClock}`;
|
|
7405
|
+
const labels = decideRangeLabels(span, context, profile);
|
|
7406
|
+
switch (labels.kind) {
|
|
7407
|
+
case "omit": return clocks;
|
|
7408
|
+
case "shared": return `${clocks} ${labels.label}`;
|
|
7409
|
+
case "endpoints": return `${startClock} ${labels.start} – ${endClock} ${labels.end}`;
|
|
7410
|
+
}
|
|
7411
|
+
}
|
|
7412
|
+
function presentDateTimeRange(span, context, profile) {
|
|
7413
|
+
assertOrdered(span.start, span.end);
|
|
7414
|
+
if (profile.clock.kind === "intl") return presentNativeRange(span, context, combinedFormat(profile.dateFormat, profile.clock));
|
|
7415
|
+
const startDate = getLocalScheduleDate(new Date(span.start), context.timeZone);
|
|
7416
|
+
const endDate = getLocalScheduleDate(new Date(span.end), context.timeZone);
|
|
7417
|
+
if (compareLocalScheduleDates(startDate, endDate) === 0) return `${presentDate({
|
|
7418
|
+
kind: "instant",
|
|
7419
|
+
value: span.start
|
|
7420
|
+
}, context, profile)}, ${presentTimeRange(span, context, profile)}`;
|
|
7421
|
+
const labels = decideRangeLabels(span, context, profile);
|
|
7422
|
+
const startProfile = profile.kind === "display" && startDate.year === endDate.year ? {
|
|
7423
|
+
...profile,
|
|
7424
|
+
dateFormat: {
|
|
7425
|
+
...profile.dateFormat,
|
|
7426
|
+
year: void 0
|
|
7427
|
+
}
|
|
7428
|
+
} : profile;
|
|
7429
|
+
const start = presentRangeEndpoint(span.start, context, startProfile, labels.kind === "endpoints" ? labels.start : void 0);
|
|
7430
|
+
const end = presentRangeEndpoint(span.end, context, profile, labels.kind === "endpoints" ? labels.end : void 0);
|
|
7431
|
+
const separator = profile.kind === "sdk" ? "–" : " – ";
|
|
7432
|
+
return profile.kind === "sdk" && start === end ? start : `${start}${separator}${end}`;
|
|
7433
|
+
}
|
|
7434
|
+
/** Offset changes override ordinary venue omission for the approved display profile. */
|
|
7435
|
+
function decideRangeLabels(span, context, profile) {
|
|
7436
|
+
if (profile.kind === "sdk") return { kind: "omit" };
|
|
7437
|
+
const offsetsDiffer = offsetToken(span.start, context) !== offsetToken(span.end, context);
|
|
7438
|
+
if (!offsetsDiffer && profile.zone === "omit") return { kind: "omit" };
|
|
7439
|
+
const start = zoneLabel(span.start, context);
|
|
7440
|
+
const end = zoneLabel(span.end, context);
|
|
7441
|
+
return offsetsDiffer || start !== end ? {
|
|
7442
|
+
kind: "endpoints",
|
|
7443
|
+
start,
|
|
7444
|
+
end
|
|
7445
|
+
} : {
|
|
7446
|
+
kind: "shared",
|
|
7447
|
+
label: start
|
|
7448
|
+
};
|
|
7449
|
+
}
|
|
7450
|
+
function presentRangeEndpoint(value, context, profile, label) {
|
|
7451
|
+
return `${presentDate({
|
|
7452
|
+
kind: "instant",
|
|
7453
|
+
value
|
|
7454
|
+
}, context, profile)}, ${label === void 0 ? presentTime(value, context, profile) : `${presentClock(value, context, profile.clock)} ${label}`}`;
|
|
7455
|
+
}
|
|
7456
|
+
function presentNativeRange(span, context, format) {
|
|
7457
|
+
return formatIntlRange(getDateTimeFormatter(context.locale, context.timeZone, format), new Date(span.start), new Date(span.end));
|
|
7458
|
+
}
|
|
7459
|
+
function combinedFormat(date, clock) {
|
|
7460
|
+
return {
|
|
7461
|
+
...date,
|
|
7462
|
+
...clock.format
|
|
7463
|
+
};
|
|
7464
|
+
}
|
|
7465
|
+
function displayProfile(options, zone, seconds) {
|
|
7466
|
+
return {
|
|
7467
|
+
kind: "display",
|
|
7468
|
+
dateFormat: dateFormat(options),
|
|
7469
|
+
clock: {
|
|
7470
|
+
kind: "compact",
|
|
7471
|
+
localeSource: "product",
|
|
7472
|
+
seconds
|
|
7473
|
+
},
|
|
7474
|
+
zone
|
|
7475
|
+
};
|
|
7476
|
+
}
|
|
7477
|
+
function dateCarrier(value) {
|
|
7478
|
+
return value.kind === "civil" ? civilCarrier(value.value) : new Date(value.value);
|
|
7479
|
+
}
|
|
7480
|
+
function presentClock(value, context, clock) {
|
|
7481
|
+
return clock.kind === "compact" ? formatBookingCompactEnglishTime({
|
|
7482
|
+
startsAt: value,
|
|
7483
|
+
timeZone: context.timeZone,
|
|
7484
|
+
locale: clock.localeSource === "product" ? "en-GB" : context.locale
|
|
7485
|
+
}, { seconds: clock.seconds }) : getDateTimeFormatter(context.locale, context.timeZone, clock.format).format(new Date(value));
|
|
7486
|
+
}
|
|
7487
|
+
function offsetToken(value, context) {
|
|
7488
|
+
return getDateTimeFormatter("en-GB", context.timeZone, { timeZoneName: "longOffset" }).formatToParts(new Date(value)).find((part) => part.type === "timeZoneName")?.value ?? "";
|
|
7489
|
+
}
|
|
7490
|
+
function dateFormat(options) {
|
|
7491
|
+
const style = options.date ?? "long";
|
|
7492
|
+
return {
|
|
7493
|
+
day: style === "omit" || options.day === "omit" ? void 0 : style === "numeric" ? "2-digit" : "numeric",
|
|
7494
|
+
month: style === "omit" ? void 0 : style === "numeric" ? "2-digit" : style,
|
|
7495
|
+
...options.year === "omit" ? {} : { year: "numeric" },
|
|
7496
|
+
...options.weekday ? { weekday: options.weekday } : {}
|
|
7497
|
+
};
|
|
7498
|
+
}
|
|
7499
|
+
function civilCarrier(value) {
|
|
7500
|
+
return new Date(Date.UTC(value.year, value.month - 1, value.day, 12));
|
|
7501
|
+
}
|
|
7502
|
+
function projectDate(value, context) {
|
|
7503
|
+
return value.kind === "civil" ? value.value : getLocalScheduleDate(new Date(value.value), context.timeZone);
|
|
7504
|
+
}
|
|
7505
|
+
function normalizeDisplay(value) {
|
|
7506
|
+
return value.replace(/[\u00a0\u202f]/gu, " ");
|
|
7507
|
+
}
|
|
7508
|
+
function zoneToken(value, context, locale) {
|
|
7509
|
+
return getDateTimeFormatter(locale, context.timeZone, { timeZoneName: "short" }).formatToParts(new Date(value)).find((part) => part.type === "timeZoneName")?.value ?? "";
|
|
7510
|
+
}
|
|
7511
|
+
function zoneLabel(value, context) {
|
|
7512
|
+
return [zoneToken(value, context, "en-GB"), zoneToken(value, context, "en-US")].find((token) => /^[A-Z]{2,6}$/u.test(token)) ?? formatTimeZoneCityLabel(context.timeZone);
|
|
7513
|
+
}
|
|
7514
|
+
function assertOrdered(start, end) {
|
|
7515
|
+
if (new Date(end).getTime() < new Date(start).getTime()) throw new RangeError("Date/time range end must be on or after its start");
|
|
7516
|
+
}
|
|
7517
|
+
/** Same city vocabulary as clock-label fallback, for explanatory timezone copy. */
|
|
7518
|
+
function formatTimeZoneCityLabel(timeZone) {
|
|
7519
|
+
return timeZone.startsWith("Etc/") ? "local time" : `${timeZone.split("/").slice(-1)[0]?.replace(/_/gu, " ") ?? timeZone} time`;
|
|
7520
|
+
}
|
|
7314
7521
|
//#endregion
|
|
7315
7522
|
//#region ../core/src/appointment-service-categories.ts
|
|
7316
7523
|
/**
|
|
@@ -8508,7 +8715,7 @@ function resolveSiteVerticalBookingConfig(rawConfig) {
|
|
|
8508
8715
|
*/
|
|
8509
8716
|
const PORTAL_NAV_DEFAULT_LABELS = {
|
|
8510
8717
|
loggedOut: "Login",
|
|
8511
|
-
loggedIn: "My
|
|
8718
|
+
loggedIn: "My account"
|
|
8512
8719
|
};
|
|
8513
8720
|
//#endregion
|
|
8514
8721
|
//#region ../core/src/event-preset-vocabulary.ts
|
|
@@ -44147,9 +44354,13 @@ function cardProjectionBase(event, buttonText, offering) {
|
|
|
44147
44354
|
function offeringLeadDate(event, startMs) {
|
|
44148
44355
|
if (startMs === null || !Number.isFinite(startMs)) return null;
|
|
44149
44356
|
const startsAt = new Date(startMs).toISOString();
|
|
44357
|
+
const timeZone = resolveBookingBusinessTimeZone(event.bookingScope === "whole_series" ? orderedLiveRunSessions(event.run.sessions).find((session) => Date.parse(session.startsAt) === startMs)?.timeZone ?? event.timeZone : event.timeZone);
|
|
44150
44358
|
return {
|
|
44151
44359
|
startsAt,
|
|
44152
|
-
...formatEventCompactDateRail(startsAt,
|
|
44360
|
+
...formatEventCompactDateRail(startsAt, {
|
|
44361
|
+
...eventDateOptions(event),
|
|
44362
|
+
timeZone
|
|
44363
|
+
}, "as-written")
|
|
44153
44364
|
};
|
|
44154
44365
|
}
|
|
44155
44366
|
function offeringSchedule(event, now) {
|
|
@@ -44169,49 +44380,47 @@ function offeringSchedule(event, now) {
|
|
|
44169
44380
|
}
|
|
44170
44381
|
function scheduleLine(summary, event, now) {
|
|
44171
44382
|
const options = eventDateOptions(event);
|
|
44172
|
-
const
|
|
44173
|
-
const
|
|
44174
|
-
|
|
44175
|
-
|
|
44176
|
-
|
|
44177
|
-
|
|
44178
|
-
|
|
44179
|
-
|
|
44180
|
-
|
|
44181
|
-
|
|
44182
|
-
|
|
44183
|
-
|
|
44383
|
+
const first = "occurrence" in summary ? summary.occurrence : summary.first;
|
|
44384
|
+
const last = "occurrence" in summary ? summary.occurrence : summary.last;
|
|
44385
|
+
const context = {
|
|
44386
|
+
locale: options.locale,
|
|
44387
|
+
timeZone: resolveBookingBusinessTimeZone(first.timeZone)
|
|
44388
|
+
};
|
|
44389
|
+
const zone = event.deliveryMode === "online" || context.timeZone !== resolveBookingBusinessTimeZone(event.siteTimeZone ?? event.timeZone) ? "always" : "omit";
|
|
44390
|
+
const endpoint = (value) => ({
|
|
44391
|
+
kind: "instant",
|
|
44392
|
+
value: toUtcIsoDateTimeString(value)
|
|
44393
|
+
});
|
|
44394
|
+
const year = (value, timeZone = context.timeZone) => now && getLocalScheduleDate(new Date(value), timeZone).year === getLocalScheduleDate(now, timeZone).year ? "omit" : "numeric";
|
|
44395
|
+
const date = (value) => formatDate$1(endpoint(value), context, {
|
|
44396
|
+
date: "short",
|
|
44397
|
+
year: now ? year(value) : "omit"
|
|
44398
|
+
});
|
|
44399
|
+
const dates = (startsAt, endsAt) => formatDateRange({
|
|
44400
|
+
kind: "civil",
|
|
44401
|
+
value: getLocalScheduleDate(new Date(startsAt), context.timeZone)
|
|
44402
|
+
}, {
|
|
44403
|
+
kind: "civil",
|
|
44404
|
+
value: getLocalScheduleDate(new Date(endsAt), resolveBookingBusinessTimeZone(last.timeZone))
|
|
44405
|
+
}, context, {
|
|
44406
|
+
date: "short",
|
|
44407
|
+
year: now && year(startsAt) === "omit" && year(endsAt, resolveBookingBusinessTimeZone(last.timeZone)) === "omit" ? "omit" : now ? "numeric" : "omit"
|
|
44408
|
+
});
|
|
44184
44409
|
switch (summary.kind) {
|
|
44185
|
-
case "single-occurrence": return now ?
|
|
44186
|
-
|
|
44187
|
-
|
|
44188
|
-
|
|
44410
|
+
case "single-occurrence": return now ? formatDateTimeRange({
|
|
44411
|
+
start: endpoint(summary.occurrence.startsAt).value,
|
|
44412
|
+
end: endpoint(summary.occurrence.endsAt).value
|
|
44413
|
+
}, context, {
|
|
44414
|
+
date: "short",
|
|
44415
|
+
weekday: "short",
|
|
44416
|
+
year: year(summary.occurrence.startsAt),
|
|
44417
|
+
zone
|
|
44418
|
+
}) : date(summary.occurrence.startsAt);
|
|
44419
|
+
case "multi-day-span": return dates(summary.occurrence.startsAt, summary.occurrence.endsAt);
|
|
44420
|
+
case "fixed-recurring-run": return `${dates(summary.first.startsAt, summary.last.startsAt)} · ${summary.recurrenceLabel}`;
|
|
44421
|
+
case "irregular-multi-session-run": return `${dates(summary.first.startsAt, summary.last.startsAt)} · ${summary.sessionCount} dates`;
|
|
44189
44422
|
}
|
|
44190
44423
|
}
|
|
44191
|
-
function compactTimeRange(startsAt, endsAt, timeZone) {
|
|
44192
|
-
const time = (value) => formatTime(value, {
|
|
44193
|
-
timeZone,
|
|
44194
|
-
locale: "en-US"
|
|
44195
|
-
}).replace(/:00/, "").replace(/\s/g, "").toLowerCase();
|
|
44196
|
-
const start = time(startsAt);
|
|
44197
|
-
const end = time(endsAt);
|
|
44198
|
-
return `${start.endsWith("am") === end.endsWith("am") ? start.replace(/(am|pm)$/, "") : start}–${end}`;
|
|
44199
|
-
}
|
|
44200
|
-
function compactDateSpan(startsAt, endsAt, locale, timeZone, now) {
|
|
44201
|
-
const start = new Date(startsAt);
|
|
44202
|
-
const end = new Date(endsAt);
|
|
44203
|
-
const parts = (value) => new Intl.DateTimeFormat(locale, {
|
|
44204
|
-
timeZone,
|
|
44205
|
-
day: "numeric",
|
|
44206
|
-
month: "short",
|
|
44207
|
-
year: "numeric"
|
|
44208
|
-
}).formatToParts(value);
|
|
44209
|
-
const part = (value, type) => parts(value).find((entry) => entry.type === type)?.value.replace(/^Sept$/, "Sep") ?? "";
|
|
44210
|
-
const sameMonth = part(start, "month") === part(end, "month") && part(start, "year") === part(end, "year");
|
|
44211
|
-
const year = (value) => part(value, "year") === part(now, "year") ? "" : ` ${part(value, "year")}`;
|
|
44212
|
-
const date = (value) => `${part(value, "day")} ${part(value, "month")}${year(value)}`;
|
|
44213
|
-
return sameMonth ? `${part(start, "day")}–${date(end)}` : `${date(start)} – ${date(end)}`;
|
|
44214
|
-
}
|
|
44215
44424
|
function offeringAvailability(event) {
|
|
44216
44425
|
const label = formatEventRemainingPlaces(event, { full: "Sold out" });
|
|
44217
44426
|
const availability = getEventAvailabilityStatus(event);
|
|
@@ -56385,7 +56594,7 @@ const FormNodeSSR = ({ blockId, lookSlots, value, submitLabel, successMessage, c
|
|
|
56385
56594
|
/* @__PURE__ */ jsx("input", {
|
|
56386
56595
|
type: "text",
|
|
56387
56596
|
name: "company",
|
|
56388
|
-
className: "hidden",
|
|
56597
|
+
className: "rb-hidden",
|
|
56389
56598
|
tabIndex: -1,
|
|
56390
56599
|
autoComplete: "off"
|
|
56391
56600
|
}),
|
|
@@ -56627,7 +56836,7 @@ function NewsletterFormSSR(props) {
|
|
|
56627
56836
|
/* @__PURE__ */ jsx("input", {
|
|
56628
56837
|
type: "text",
|
|
56629
56838
|
name: "website",
|
|
56630
|
-
className: "hidden",
|
|
56839
|
+
className: "rb-hidden",
|
|
56631
56840
|
tabIndex: -1,
|
|
56632
56841
|
autoComplete: "off",
|
|
56633
56842
|
"aria-hidden": "true"
|
|
@@ -67146,218 +67355,7 @@ const weeklySlotAvailabilityBlockDefinition = {
|
|
|
67146
67355
|
} }
|
|
67147
67356
|
};
|
|
67148
67357
|
//#endregion
|
|
67149
|
-
//#region ../blocks/src/
|
|
67150
|
-
/**
|
|
67151
|
-
* Event Details Block
|
|
67152
|
-
*
|
|
67153
|
-
* Displays logistics for an event:
|
|
67154
|
-
* - Selected occurrence (from `$root.occurrenceContext`) or next upcoming occurrence
|
|
67155
|
-
* - Venue + embedded map
|
|
67156
|
-
* - Other upcoming dates in the same series (excluding selected/next)
|
|
67157
|
-
*
|
|
67158
|
-
* Intended for use on event templates, but can also be placed on standalone pages.
|
|
67159
|
-
*/
|
|
67160
|
-
const eventDetailsManifest = createBlockManifest({
|
|
67161
|
-
variantMeaning: {
|
|
67162
|
-
kind: "arrangement",
|
|
67163
|
-
lookOnlyKeys: ["event-header", "details-panel"]
|
|
67164
|
-
},
|
|
67165
|
-
id: "block.event-details",
|
|
67166
|
-
version: "1.0.0",
|
|
67167
|
-
title: "Event Details",
|
|
67168
|
-
titleSource: "heading",
|
|
67169
|
-
description: "Date/time, venue, map, and other dates for an event",
|
|
67170
|
-
category: "content",
|
|
67171
|
-
contentSource: { kind: "entries" },
|
|
67172
|
-
tags: [
|
|
67173
|
-
"events",
|
|
67174
|
-
"venue",
|
|
67175
|
-
"map",
|
|
67176
|
-
"schedule",
|
|
67177
|
-
"dates"
|
|
67178
|
-
],
|
|
67179
|
-
icon: "MapPin",
|
|
67180
|
-
styleTokens: {
|
|
67181
|
-
background: "surface",
|
|
67182
|
-
typography: "body",
|
|
67183
|
-
spacing: "md"
|
|
67184
|
-
},
|
|
67185
|
-
behaviours: {
|
|
67186
|
-
supportsThemeSwitching: true,
|
|
67187
|
-
inlineEditing: false,
|
|
67188
|
-
animation: false,
|
|
67189
|
-
paletteHidden: false
|
|
67190
|
-
},
|
|
67191
|
-
additionalFields: [
|
|
67192
|
-
{
|
|
67193
|
-
id: "heading",
|
|
67194
|
-
type: "text",
|
|
67195
|
-
label: "Heading",
|
|
67196
|
-
description: "Optional heading shown above event details",
|
|
67197
|
-
required: false,
|
|
67198
|
-
multiline: false,
|
|
67199
|
-
defaultValue: "Event details"
|
|
67200
|
-
},
|
|
67201
|
-
{
|
|
67202
|
-
id: "showVenue",
|
|
67203
|
-
type: "boolean",
|
|
67204
|
-
label: "Show venue",
|
|
67205
|
-
required: false,
|
|
67206
|
-
defaultValue: true,
|
|
67207
|
-
ui: { intent: "display" }
|
|
67208
|
-
},
|
|
67209
|
-
{
|
|
67210
|
-
id: "showTitle",
|
|
67211
|
-
type: "boolean",
|
|
67212
|
-
label: "Show event title",
|
|
67213
|
-
required: false,
|
|
67214
|
-
defaultValue: false,
|
|
67215
|
-
ui: { intent: "display" }
|
|
67216
|
-
},
|
|
67217
|
-
{
|
|
67218
|
-
id: "showDescription",
|
|
67219
|
-
type: "boolean",
|
|
67220
|
-
label: "Show event description",
|
|
67221
|
-
required: false,
|
|
67222
|
-
defaultValue: false,
|
|
67223
|
-
ui: { intent: "display" }
|
|
67224
|
-
},
|
|
67225
|
-
{
|
|
67226
|
-
id: "showMap",
|
|
67227
|
-
type: "boolean",
|
|
67228
|
-
label: "Show map",
|
|
67229
|
-
description: "Embed a map when the venue has coordinates",
|
|
67230
|
-
required: false,
|
|
67231
|
-
defaultValue: true,
|
|
67232
|
-
ui: { intent: "display" }
|
|
67233
|
-
},
|
|
67234
|
-
{
|
|
67235
|
-
id: "showOtherDates",
|
|
67236
|
-
type: "boolean",
|
|
67237
|
-
label: "Show other dates",
|
|
67238
|
-
required: false,
|
|
67239
|
-
defaultValue: true,
|
|
67240
|
-
ui: { intent: "display" }
|
|
67241
|
-
},
|
|
67242
|
-
{
|
|
67243
|
-
id: "otherDatesLimit",
|
|
67244
|
-
type: "select",
|
|
67245
|
-
label: "Other dates limit",
|
|
67246
|
-
required: false,
|
|
67247
|
-
multiple: false,
|
|
67248
|
-
defaultValue: "5",
|
|
67249
|
-
options: [
|
|
67250
|
-
{
|
|
67251
|
-
value: "3",
|
|
67252
|
-
label: "3 dates"
|
|
67253
|
-
},
|
|
67254
|
-
{
|
|
67255
|
-
value: "5",
|
|
67256
|
-
label: "5 dates"
|
|
67257
|
-
},
|
|
67258
|
-
{
|
|
67259
|
-
value: "10",
|
|
67260
|
-
label: "10 dates"
|
|
67261
|
-
},
|
|
67262
|
-
{
|
|
67263
|
-
value: "all",
|
|
67264
|
-
label: "All dates"
|
|
67265
|
-
}
|
|
67266
|
-
],
|
|
67267
|
-
ui: { intent: "display" }
|
|
67268
|
-
},
|
|
67269
|
-
{
|
|
67270
|
-
id: "showCapacity",
|
|
67271
|
-
type: "boolean",
|
|
67272
|
-
label: "Show capacity",
|
|
67273
|
-
required: false,
|
|
67274
|
-
defaultValue: false,
|
|
67275
|
-
ui: { intent: "display" }
|
|
67276
|
-
},
|
|
67277
|
-
{
|
|
67278
|
-
id: "showCost",
|
|
67279
|
-
type: "boolean",
|
|
67280
|
-
label: "Show cost",
|
|
67281
|
-
description: "Display ticket price for paid events",
|
|
67282
|
-
required: false,
|
|
67283
|
-
defaultValue: true,
|
|
67284
|
-
ui: { intent: "display" }
|
|
67285
|
-
},
|
|
67286
|
-
{
|
|
67287
|
-
id: "showAcceptedPasses",
|
|
67288
|
-
type: "boolean",
|
|
67289
|
-
label: "Show accepted passes",
|
|
67290
|
-
description: "Display passes that can be used for this event",
|
|
67291
|
-
required: false,
|
|
67292
|
-
defaultValue: true,
|
|
67293
|
-
ui: { intent: "display" }
|
|
67294
|
-
},
|
|
67295
|
-
{
|
|
67296
|
-
id: "showAcceptedMemberships",
|
|
67297
|
-
type: "boolean",
|
|
67298
|
-
label: "Show accepted memberships",
|
|
67299
|
-
description: "Display memberships that grant access to this event",
|
|
67300
|
-
required: false,
|
|
67301
|
-
defaultValue: true,
|
|
67302
|
-
ui: { intent: "display" }
|
|
67303
|
-
}
|
|
67304
|
-
],
|
|
67305
|
-
layout: [styledSection({
|
|
67306
|
-
baseClass: "",
|
|
67307
|
-
spacing: "spacious",
|
|
67308
|
-
children: sectionContainer([text({ as: "h2" }, bind("content.heading"), when("content.heading")), el("event-details", {
|
|
67309
|
-
entryTitle: { $bind: {
|
|
67310
|
-
from: "$root.contentEntry.title",
|
|
67311
|
-
fallback: null
|
|
67312
|
-
} },
|
|
67313
|
-
arrangement: { $bind: { from: "content._effectiveLook.look.structure.byMode.default" } },
|
|
67314
|
-
actionSize: { $bind: { from: "content._effectiveLook.look.structure.actionSize" } },
|
|
67315
|
-
lookSlots: { $bind: { from: "content._lookSlots" } },
|
|
67316
|
-
itemSurfaces: { $bind: { from: "content._effectiveLook.itemSurfaces" } },
|
|
67317
|
-
panelHeading: { $bind: { from: "content._lookPanelHeading" } },
|
|
67318
|
-
occurrenceContext: { $bind: {
|
|
67319
|
-
from: "$root.occurrenceContext",
|
|
67320
|
-
fallback: null
|
|
67321
|
-
} },
|
|
67322
|
-
subject: { $bind: {
|
|
67323
|
-
from: "$root.subject",
|
|
67324
|
-
fallback: null
|
|
67325
|
-
} },
|
|
67326
|
-
events: { $bind: { from: "data.eventDetailsData.events" } },
|
|
67327
|
-
showVenue: { $bind: { from: "content.showVenue" } },
|
|
67328
|
-
showTitle: { $bind: { from: "content.showTitle" } },
|
|
67329
|
-
showDescription: { $bind: { from: "content.showDescription" } },
|
|
67330
|
-
showMap: { $bind: { from: "content.showMap" } },
|
|
67331
|
-
showOtherDates: { $bind: { from: "content.showOtherDates" } },
|
|
67332
|
-
otherDatesLimit: { $bind: {
|
|
67333
|
-
from: "content.otherDatesLimit",
|
|
67334
|
-
fallback: "5"
|
|
67335
|
-
} },
|
|
67336
|
-
showCost: { $bind: {
|
|
67337
|
-
from: "content.showCost",
|
|
67338
|
-
fallback: true
|
|
67339
|
-
} },
|
|
67340
|
-
showCapacity: { $bind: {
|
|
67341
|
-
from: "content.showCapacity",
|
|
67342
|
-
fallback: false
|
|
67343
|
-
} },
|
|
67344
|
-
showAcceptedPasses: { $bind: {
|
|
67345
|
-
from: "content.showAcceptedPasses",
|
|
67346
|
-
fallback: true
|
|
67347
|
-
} },
|
|
67348
|
-
showAcceptedMemberships: { $bind: {
|
|
67349
|
-
from: "content.showAcceptedMemberships",
|
|
67350
|
-
fallback: true
|
|
67351
|
-
} },
|
|
67352
|
-
sitePasses: { $bind: { from: "data.eventDetailsData.sitePasses" } },
|
|
67353
|
-
siteMemberships: { $bind: { from: "data.eventDetailsData.siteMemberships" } },
|
|
67354
|
-
autoApplyDiscount: { $bind: {
|
|
67355
|
-
from: "data.eventDetailsData.autoApplyDiscount",
|
|
67356
|
-
fallback: null
|
|
67357
|
-
} }
|
|
67358
|
-
})], { gap: "lg" })
|
|
67359
|
-
})]
|
|
67360
|
-
});
|
|
67358
|
+
//#region ../blocks/src/contracts/events.ts
|
|
67361
67359
|
const eventAutoApplyDiscountPreviewBaseSchema = z.object({
|
|
67362
67360
|
id: z.string(),
|
|
67363
67361
|
publicLabel: z.string(),
|
|
@@ -67374,7 +67372,207 @@ const eventAutoApplyDiscountPreviewSchema = z.discriminatedUnion("discountType",
|
|
|
67374
67372
|
discountAmountCents: z.number()
|
|
67375
67373
|
})]);
|
|
67376
67374
|
const eventDetailsBlockDefinition = {
|
|
67377
|
-
manifest:
|
|
67375
|
+
manifest: createBlockManifest({
|
|
67376
|
+
variantMeaning: {
|
|
67377
|
+
kind: "arrangement",
|
|
67378
|
+
lookOnlyKeys: ["event-header", "details-panel"]
|
|
67379
|
+
},
|
|
67380
|
+
id: "block.event-details",
|
|
67381
|
+
version: "1.0.0",
|
|
67382
|
+
title: "Event Details",
|
|
67383
|
+
titleSource: "heading",
|
|
67384
|
+
description: "Date/time, venue, map, and other dates for an event",
|
|
67385
|
+
category: "content",
|
|
67386
|
+
contentSource: { kind: "entries" },
|
|
67387
|
+
tags: [
|
|
67388
|
+
"events",
|
|
67389
|
+
"venue",
|
|
67390
|
+
"map",
|
|
67391
|
+
"schedule",
|
|
67392
|
+
"dates"
|
|
67393
|
+
],
|
|
67394
|
+
icon: "MapPin",
|
|
67395
|
+
styleTokens: {
|
|
67396
|
+
background: "surface",
|
|
67397
|
+
typography: "body",
|
|
67398
|
+
spacing: "md"
|
|
67399
|
+
},
|
|
67400
|
+
behaviours: {
|
|
67401
|
+
supportsThemeSwitching: true,
|
|
67402
|
+
inlineEditing: false,
|
|
67403
|
+
animation: false,
|
|
67404
|
+
paletteHidden: false
|
|
67405
|
+
},
|
|
67406
|
+
additionalFields: [
|
|
67407
|
+
{
|
|
67408
|
+
id: "heading",
|
|
67409
|
+
type: "text",
|
|
67410
|
+
label: "Heading",
|
|
67411
|
+
description: "Optional heading shown above event details",
|
|
67412
|
+
required: false,
|
|
67413
|
+
multiline: false,
|
|
67414
|
+
defaultValue: "Event details"
|
|
67415
|
+
},
|
|
67416
|
+
{
|
|
67417
|
+
id: "showVenue",
|
|
67418
|
+
type: "boolean",
|
|
67419
|
+
label: "Show venue",
|
|
67420
|
+
required: false,
|
|
67421
|
+
defaultValue: true,
|
|
67422
|
+
ui: { intent: "display" }
|
|
67423
|
+
},
|
|
67424
|
+
{
|
|
67425
|
+
id: "showTitle",
|
|
67426
|
+
type: "boolean",
|
|
67427
|
+
label: "Show event title",
|
|
67428
|
+
required: false,
|
|
67429
|
+
defaultValue: false,
|
|
67430
|
+
ui: { intent: "display" }
|
|
67431
|
+
},
|
|
67432
|
+
{
|
|
67433
|
+
id: "showDescription",
|
|
67434
|
+
type: "boolean",
|
|
67435
|
+
label: "Show event description",
|
|
67436
|
+
required: false,
|
|
67437
|
+
defaultValue: false,
|
|
67438
|
+
ui: { intent: "display" }
|
|
67439
|
+
},
|
|
67440
|
+
{
|
|
67441
|
+
id: "showMap",
|
|
67442
|
+
type: "boolean",
|
|
67443
|
+
label: "Show map",
|
|
67444
|
+
description: "Embed a map when the venue has coordinates",
|
|
67445
|
+
required: false,
|
|
67446
|
+
defaultValue: true,
|
|
67447
|
+
ui: { intent: "display" }
|
|
67448
|
+
},
|
|
67449
|
+
{
|
|
67450
|
+
id: "showOtherDates",
|
|
67451
|
+
type: "boolean",
|
|
67452
|
+
label: "Show other dates",
|
|
67453
|
+
required: false,
|
|
67454
|
+
defaultValue: true,
|
|
67455
|
+
ui: { intent: "display" }
|
|
67456
|
+
},
|
|
67457
|
+
{
|
|
67458
|
+
id: "otherDatesLimit",
|
|
67459
|
+
type: "select",
|
|
67460
|
+
label: "Other dates limit",
|
|
67461
|
+
required: false,
|
|
67462
|
+
multiple: false,
|
|
67463
|
+
defaultValue: "5",
|
|
67464
|
+
options: [
|
|
67465
|
+
{
|
|
67466
|
+
value: "3",
|
|
67467
|
+
label: "3 dates"
|
|
67468
|
+
},
|
|
67469
|
+
{
|
|
67470
|
+
value: "5",
|
|
67471
|
+
label: "5 dates"
|
|
67472
|
+
},
|
|
67473
|
+
{
|
|
67474
|
+
value: "10",
|
|
67475
|
+
label: "10 dates"
|
|
67476
|
+
},
|
|
67477
|
+
{
|
|
67478
|
+
value: "all",
|
|
67479
|
+
label: "All dates"
|
|
67480
|
+
}
|
|
67481
|
+
],
|
|
67482
|
+
ui: { intent: "display" }
|
|
67483
|
+
},
|
|
67484
|
+
{
|
|
67485
|
+
id: "showCapacity",
|
|
67486
|
+
type: "boolean",
|
|
67487
|
+
label: "Show capacity",
|
|
67488
|
+
required: false,
|
|
67489
|
+
defaultValue: false,
|
|
67490
|
+
ui: { intent: "display" }
|
|
67491
|
+
},
|
|
67492
|
+
{
|
|
67493
|
+
id: "showCost",
|
|
67494
|
+
type: "boolean",
|
|
67495
|
+
label: "Show cost",
|
|
67496
|
+
description: "Display ticket price for paid events",
|
|
67497
|
+
required: false,
|
|
67498
|
+
defaultValue: true,
|
|
67499
|
+
ui: { intent: "display" }
|
|
67500
|
+
},
|
|
67501
|
+
{
|
|
67502
|
+
id: "showAcceptedPasses",
|
|
67503
|
+
type: "boolean",
|
|
67504
|
+
label: "Show accepted passes",
|
|
67505
|
+
description: "Display passes that can be used for this event",
|
|
67506
|
+
required: false,
|
|
67507
|
+
defaultValue: true,
|
|
67508
|
+
ui: { intent: "display" }
|
|
67509
|
+
},
|
|
67510
|
+
{
|
|
67511
|
+
id: "showAcceptedMemberships",
|
|
67512
|
+
type: "boolean",
|
|
67513
|
+
label: "Show accepted memberships",
|
|
67514
|
+
description: "Display memberships that grant access to this event",
|
|
67515
|
+
required: false,
|
|
67516
|
+
defaultValue: true,
|
|
67517
|
+
ui: { intent: "display" }
|
|
67518
|
+
}
|
|
67519
|
+
],
|
|
67520
|
+
layout: [styledSection({
|
|
67521
|
+
baseClass: "",
|
|
67522
|
+
spacing: "spacious",
|
|
67523
|
+
children: sectionContainer([text({ as: "h2" }, bind("content.heading"), when("content.heading")), el("event-details", {
|
|
67524
|
+
entryTitle: { $bind: {
|
|
67525
|
+
from: "$root.contentEntry.title",
|
|
67526
|
+
fallback: null
|
|
67527
|
+
} },
|
|
67528
|
+
arrangement: { $bind: { from: "content._effectiveLook.look.structure.byMode.default" } },
|
|
67529
|
+
actionSize: { $bind: { from: "content._effectiveLook.look.structure.actionSize" } },
|
|
67530
|
+
lookSlots: { $bind: { from: "content._lookSlots" } },
|
|
67531
|
+
itemSurfaces: { $bind: { from: "content._effectiveLook.itemSurfaces" } },
|
|
67532
|
+
panelHeading: { $bind: { from: "content._lookPanelHeading" } },
|
|
67533
|
+
occurrenceContext: { $bind: {
|
|
67534
|
+
from: "$root.occurrenceContext",
|
|
67535
|
+
fallback: null
|
|
67536
|
+
} },
|
|
67537
|
+
subject: { $bind: {
|
|
67538
|
+
from: "$root.subject",
|
|
67539
|
+
fallback: null
|
|
67540
|
+
} },
|
|
67541
|
+
events: { $bind: { from: "data.eventDetailsData.events" } },
|
|
67542
|
+
showVenue: { $bind: { from: "content.showVenue" } },
|
|
67543
|
+
showTitle: { $bind: { from: "content.showTitle" } },
|
|
67544
|
+
showDescription: { $bind: { from: "content.showDescription" } },
|
|
67545
|
+
showMap: { $bind: { from: "content.showMap" } },
|
|
67546
|
+
showOtherDates: { $bind: { from: "content.showOtherDates" } },
|
|
67547
|
+
otherDatesLimit: { $bind: {
|
|
67548
|
+
from: "content.otherDatesLimit",
|
|
67549
|
+
fallback: "5"
|
|
67550
|
+
} },
|
|
67551
|
+
showCost: { $bind: {
|
|
67552
|
+
from: "content.showCost",
|
|
67553
|
+
fallback: true
|
|
67554
|
+
} },
|
|
67555
|
+
showCapacity: { $bind: {
|
|
67556
|
+
from: "content.showCapacity",
|
|
67557
|
+
fallback: false
|
|
67558
|
+
} },
|
|
67559
|
+
showAcceptedPasses: { $bind: {
|
|
67560
|
+
from: "content.showAcceptedPasses",
|
|
67561
|
+
fallback: true
|
|
67562
|
+
} },
|
|
67563
|
+
showAcceptedMemberships: { $bind: {
|
|
67564
|
+
from: "content.showAcceptedMemberships",
|
|
67565
|
+
fallback: true
|
|
67566
|
+
} },
|
|
67567
|
+
sitePasses: { $bind: { from: "data.eventDetailsData.sitePasses" } },
|
|
67568
|
+
siteMemberships: { $bind: { from: "data.eventDetailsData.siteMemberships" } },
|
|
67569
|
+
autoApplyDiscount: { $bind: {
|
|
67570
|
+
from: "data.eventDetailsData.autoApplyDiscount",
|
|
67571
|
+
fallback: null
|
|
67572
|
+
} }
|
|
67573
|
+
})], { gap: "lg" })
|
|
67574
|
+
})]
|
|
67575
|
+
}),
|
|
67378
67576
|
dataSchemas: {
|
|
67379
67577
|
eventDetailsData: z.object({
|
|
67380
67578
|
events: publicEventsArraySchema,
|
|
@@ -84340,6 +84538,256 @@ const containerResponsiveThemeCss = `/*
|
|
|
84340
84538
|
/* Styles for SSR placeholder */
|
|
84341
84539
|
}
|
|
84342
84540
|
|
|
84541
|
+
/* Reserved portal ticket and digital-product pages.
|
|
84542
|
+
* These render without site chrome, so the page itself sits on the site
|
|
84543
|
+
* background (from the surrounding theme scope) and the card mirrors .cp-login. */
|
|
84544
|
+
:where(.theme-scope) :where([data-block="customer-portal"]).cp-page {
|
|
84545
|
+
box-sizing: border-box;
|
|
84546
|
+
min-height: 100vh;
|
|
84547
|
+
padding: 2.5rem 1rem;
|
|
84548
|
+
color: var(--cp-text);
|
|
84549
|
+
font-family: var(--font-body);
|
|
84550
|
+
font-size: var(--fs-body);
|
|
84551
|
+
}
|
|
84552
|
+
|
|
84553
|
+
:where(.theme-scope) :where([data-block="customer-portal"]) .cp-page-card {
|
|
84554
|
+
box-sizing: border-box;
|
|
84555
|
+
width: 100%;
|
|
84556
|
+
max-width: 42rem;
|
|
84557
|
+
margin-inline: auto;
|
|
84558
|
+
padding: 2rem;
|
|
84559
|
+
border: 1px solid var(--cp-card-border);
|
|
84560
|
+
border-radius: var(--cp-card-radius);
|
|
84561
|
+
background: var(--cp-card-bg);
|
|
84562
|
+
color: var(--cp-text);
|
|
84563
|
+
--rb-surface-text-color: var(--cp-text);
|
|
84564
|
+
--rb-surface-heading-color: var(--cp-text);
|
|
84565
|
+
--rb-surface-link-color: var(--cp-primary);
|
|
84566
|
+
--rb-surface-link-hover-color: var(--rb-prose-link-hover-color, var(--cp-primary));
|
|
84567
|
+
--rb-surface-supporting-color: var(--cp-muted);
|
|
84568
|
+
}
|
|
84569
|
+
|
|
84570
|
+
:where(.theme-scope)
|
|
84571
|
+
:where([data-block="customer-portal"])
|
|
84572
|
+
.cp-page-card--compact {
|
|
84573
|
+
max-width: 480px;
|
|
84574
|
+
}
|
|
84575
|
+
|
|
84576
|
+
:where(.theme-scope) :where([data-block="customer-portal"]) .cp-ticket {
|
|
84577
|
+
max-width: 40rem;
|
|
84578
|
+
}
|
|
84579
|
+
|
|
84580
|
+
:where(.theme-scope) :where([data-block="customer-portal"]) .cp-page-title {
|
|
84581
|
+
margin: 0;
|
|
84582
|
+
font-size: var(--fs-h3, 1.5rem);
|
|
84583
|
+
line-height: 1.2;
|
|
84584
|
+
}
|
|
84585
|
+
|
|
84586
|
+
/* The sign-in card's title is the page heading here, so it is an h1 sized like
|
|
84587
|
+
* the main portal's sign-in heading. */
|
|
84588
|
+
:where(.theme-scope)
|
|
84589
|
+
:where([data-block="customer-portal"]).cp-page
|
|
84590
|
+
.cp-login__title {
|
|
84591
|
+
font-size: var(--fs-h2, 2rem);
|
|
84592
|
+
line-height: 1.15;
|
|
84593
|
+
}
|
|
84594
|
+
|
|
84595
|
+
:where(.theme-scope) :where([data-block="customer-portal"]) .cp-page-subtitle {
|
|
84596
|
+
margin: 0;
|
|
84597
|
+
font-size: 1.25rem;
|
|
84598
|
+
line-height: 1.3;
|
|
84599
|
+
}
|
|
84600
|
+
|
|
84601
|
+
:where(.theme-scope) :where([data-block="customer-portal"]) .cp-page-copy {
|
|
84602
|
+
margin-top: 0.75rem;
|
|
84603
|
+
}
|
|
84604
|
+
|
|
84605
|
+
:where(.theme-scope) :where([data-block="customer-portal"]) .cp-page-copy p {
|
|
84606
|
+
margin: 0;
|
|
84607
|
+
}
|
|
84608
|
+
|
|
84609
|
+
:where(.theme-scope) :where([data-block="customer-portal"]) .cp-page-hint {
|
|
84610
|
+
margin: 0.25rem 0 0;
|
|
84611
|
+
color: var(--cp-muted);
|
|
84612
|
+
font-size: 0.875rem;
|
|
84613
|
+
}
|
|
84614
|
+
|
|
84615
|
+
:where(.theme-scope) :where([data-block="customer-portal"]) .cp-page-stack,
|
|
84616
|
+
:where(.theme-scope) :where([data-block="customer-portal"]) .cp-page-files,
|
|
84617
|
+
:where(.theme-scope) :where([data-block="customer-portal"]) .cp-page-details {
|
|
84618
|
+
display: grid;
|
|
84619
|
+
gap: 0.75rem;
|
|
84620
|
+
}
|
|
84621
|
+
|
|
84622
|
+
:where(.theme-scope) :where([data-block="customer-portal"]) .cp-page-details {
|
|
84623
|
+
gap: 0.25rem;
|
|
84624
|
+
font-size: 0.9375rem;
|
|
84625
|
+
}
|
|
84626
|
+
|
|
84627
|
+
:where(.theme-scope) :where([data-block="customer-portal"]) .cp-page-emphasis {
|
|
84628
|
+
margin: 0;
|
|
84629
|
+
font-family: inherit;
|
|
84630
|
+
font-size: inherit;
|
|
84631
|
+
font-style: normal;
|
|
84632
|
+
font-weight: 600;
|
|
84633
|
+
letter-spacing: normal;
|
|
84634
|
+
text-transform: none;
|
|
84635
|
+
}
|
|
84636
|
+
|
|
84637
|
+
:where(.theme-scope) :where([data-block="customer-portal"]) .cp-ticket__heading,
|
|
84638
|
+
:where(.theme-scope) :where([data-block="customer-portal"]) .cp-page-file {
|
|
84639
|
+
display: flex;
|
|
84640
|
+
align-items: flex-start;
|
|
84641
|
+
justify-content: space-between;
|
|
84642
|
+
gap: 1rem;
|
|
84643
|
+
}
|
|
84644
|
+
|
|
84645
|
+
:where(.theme-scope) :where([data-block="customer-portal"]) .cp-ticket__body {
|
|
84646
|
+
display: grid;
|
|
84647
|
+
gap: 1.5rem;
|
|
84648
|
+
margin-top: 1.5rem;
|
|
84649
|
+
}
|
|
84650
|
+
|
|
84651
|
+
:where(.theme-scope) :where([data-block="customer-portal"]) .cp-ticket__qr {
|
|
84652
|
+
align-self: start;
|
|
84653
|
+
padding: 1rem;
|
|
84654
|
+
border: 1px solid var(--cp-card-border);
|
|
84655
|
+
border-radius: var(--cp-control-radius);
|
|
84656
|
+
background: var(--cp-card-bg);
|
|
84657
|
+
}
|
|
84658
|
+
|
|
84659
|
+
:where(.theme-scope)
|
|
84660
|
+
:where([data-block="customer-portal"])
|
|
84661
|
+
.cp-ticket__qr-image {
|
|
84662
|
+
display: block;
|
|
84663
|
+
width: 176px;
|
|
84664
|
+
height: 176px;
|
|
84665
|
+
max-width: 100%;
|
|
84666
|
+
}
|
|
84667
|
+
|
|
84668
|
+
:where(.theme-scope) :where([data-block="customer-portal"]) .cp-ticket__code-row {
|
|
84669
|
+
display: flex;
|
|
84670
|
+
flex-wrap: wrap;
|
|
84671
|
+
align-items: center;
|
|
84672
|
+
gap: 0.5rem;
|
|
84673
|
+
}
|
|
84674
|
+
|
|
84675
|
+
:where(.theme-scope) :where([data-block="customer-portal"]) .cp-ticket__code {
|
|
84676
|
+
flex: 1 1 12rem;
|
|
84677
|
+
min-width: 0;
|
|
84678
|
+
padding: 0.5rem 0.75rem;
|
|
84679
|
+
border: 1px solid var(--cp-card-border);
|
|
84680
|
+
border-radius: var(--cp-control-radius);
|
|
84681
|
+
background: rgb(var(--tb-background));
|
|
84682
|
+
overflow-wrap: anywhere;
|
|
84683
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
84684
|
+
font-size: 0.75rem;
|
|
84685
|
+
}
|
|
84686
|
+
|
|
84687
|
+
/* Copy sits beside the code rather than under it: some site styles draw the
|
|
84688
|
+
* secondary button as text with inline padding, which would otherwise leave
|
|
84689
|
+
* its label visibly indented from the code box's left edge. */
|
|
84690
|
+
:where(.theme-scope) :where([data-block="customer-portal"]) .cp-ticket__copy {
|
|
84691
|
+
flex: none;
|
|
84692
|
+
}
|
|
84693
|
+
|
|
84694
|
+
:where(.theme-scope) :where([data-block="customer-portal"]) .cp-page-code {
|
|
84695
|
+
margin-top: 0.5rem;
|
|
84696
|
+
}
|
|
84697
|
+
|
|
84698
|
+
:where(.theme-scope) :where([data-block="customer-portal"]) .cp-page-file {
|
|
84699
|
+
align-items: center;
|
|
84700
|
+
padding: 0.75rem 1rem;
|
|
84701
|
+
border: 1px solid var(--cp-card-border);
|
|
84702
|
+
border-radius: var(--cp-control-radius);
|
|
84703
|
+
color: var(--cp-text);
|
|
84704
|
+
text-decoration: none;
|
|
84705
|
+
transition: border-color 0.15s ease;
|
|
84706
|
+
}
|
|
84707
|
+
|
|
84708
|
+
:where(.theme-scope)
|
|
84709
|
+
:where([data-block="customer-portal"])
|
|
84710
|
+
.cp-page-file:hover {
|
|
84711
|
+
border-color: var(--cp-primary);
|
|
84712
|
+
}
|
|
84713
|
+
|
|
84714
|
+
:where(.theme-scope)
|
|
84715
|
+
:where([data-block="customer-portal"])
|
|
84716
|
+
.cp-page-file:focus-visible {
|
|
84717
|
+
outline: 2px solid var(--cp-primary);
|
|
84718
|
+
outline-offset: 2px;
|
|
84719
|
+
}
|
|
84720
|
+
|
|
84721
|
+
:where(.theme-scope) :where([data-block="customer-portal"]) .cp-page-file .cp-page-hint {
|
|
84722
|
+
margin: 0;
|
|
84723
|
+
overflow-wrap: anywhere;
|
|
84724
|
+
text-align: right;
|
|
84725
|
+
}
|
|
84726
|
+
|
|
84727
|
+
:where(.theme-scope) :where([data-block="customer-portal"]) .cp-page-link {
|
|
84728
|
+
color: var(--cp-primary);
|
|
84729
|
+
text-decoration: underline;
|
|
84730
|
+
text-underline-offset: 0.15em;
|
|
84731
|
+
}
|
|
84732
|
+
|
|
84733
|
+
@container rb-site (max-width: 640px) {
|
|
84734
|
+
@scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
|
|
84735
|
+
:where(.theme-scope:is(*, :scope)) :where([data-block="customer-portal"]).cp-page {
|
|
84736
|
+
padding: 1.5rem 1rem;
|
|
84737
|
+
}
|
|
84738
|
+
|
|
84739
|
+
:where(.theme-scope:is(*, :scope)) :where([data-block="customer-portal"]) .cp-page-card {
|
|
84740
|
+
padding: 1.5rem;
|
|
84741
|
+
}
|
|
84742
|
+
|
|
84743
|
+
:where(.theme-scope:is(*, :scope)) :where([data-block="customer-portal"]) .cp-page-file {
|
|
84744
|
+
flex-direction: column;
|
|
84745
|
+
align-items: flex-start;
|
|
84746
|
+
gap: 0.25rem;
|
|
84747
|
+
}
|
|
84748
|
+
|
|
84749
|
+
:where(.theme-scope:is(*, :scope))
|
|
84750
|
+
:where([data-block="customer-portal"])
|
|
84751
|
+
.cp-page-file
|
|
84752
|
+
.cp-page-hint {
|
|
84753
|
+
text-align: left;
|
|
84754
|
+
}
|
|
84755
|
+
}
|
|
84756
|
+
}
|
|
84757
|
+
|
|
84758
|
+
@container rb-site (min-width: 48rem) {
|
|
84759
|
+
@scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
|
|
84760
|
+
:where(.theme-scope:is(*, :scope)) :where([data-block="customer-portal"]) .cp-ticket__body {
|
|
84761
|
+
grid-template-columns: 210px 1fr;
|
|
84762
|
+
}
|
|
84763
|
+
}
|
|
84764
|
+
}
|
|
84765
|
+
|
|
84766
|
+
@media print {
|
|
84767
|
+
:where(.theme-scope) :where([data-block="customer-portal"]) .cp-print-hidden {
|
|
84768
|
+
display: none;
|
|
84769
|
+
}
|
|
84770
|
+
|
|
84771
|
+
:where(.theme-scope) :where([data-block="customer-portal"]).cp-page {
|
|
84772
|
+
min-height: 0;
|
|
84773
|
+
padding: 0;
|
|
84774
|
+
}
|
|
84775
|
+
|
|
84776
|
+
:where(.theme-scope) :where([data-block="customer-portal"]) .cp-ticket,
|
|
84777
|
+
:where(.theme-scope) :where([data-block="customer-portal"]) .cp-ticket__qr {
|
|
84778
|
+
max-width: none;
|
|
84779
|
+
padding: 0;
|
|
84780
|
+
border: 0;
|
|
84781
|
+
border-radius: 0;
|
|
84782
|
+
box-shadow: none;
|
|
84783
|
+
}
|
|
84784
|
+
}
|
|
84785
|
+
|
|
84786
|
+
/* Preserve line breaks in the before-you-come instructions. */
|
|
84787
|
+
:where(.theme-scope) :where([data-block="customer-portal"]) .cp-before-you-come__body {
|
|
84788
|
+
white-space: pre-wrap;
|
|
84789
|
+
}
|
|
84790
|
+
|
|
84343
84791
|
/* =============================================================================
|
|
84344
84792
|
* Runtime: Header Navigation Dropdown (Tailwind-free)
|
|
84345
84793
|
*
|
|
@@ -86030,9 +86478,18 @@ const containerResponsiveThemeCss = `/*
|
|
|
86030
86478
|
border-radius: 9999px;
|
|
86031
86479
|
}
|
|
86032
86480
|
|
|
86481
|
+
/*
|
|
86482
|
+
* Statement, copy and media: at tablet widths the statement takes the whole
|
|
86483
|
+
* first row and copy sits beside the media underneath; at desktop all three
|
|
86484
|
+
* share one row. The grid item is the title itself, or the heading-decoration
|
|
86485
|
+
* wrapper around it when the site style decorates headings, so both are
|
|
86486
|
+
* targeted. Without the wrapper case the title took a column of its own and
|
|
86487
|
+
* the media dropped to a lonely third row.
|
|
86488
|
+
*/
|
|
86033
86489
|
@container rb-site (min-width: 768px) {
|
|
86034
86490
|
@scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
|
|
86035
|
-
:where(.theme-scope:is(*, :scope)) [data-block="intro"][data-block-variant="statement-media"] .rb-intro-statement-media-title
|
|
86491
|
+
:where(.theme-scope:is(*, :scope)) [data-block="intro"][data-block-variant="statement-media"] .rb-intro-statement-media > .rb-intro-statement-media-title,
|
|
86492
|
+
:where(.theme-scope:is(*, :scope)) [data-block="intro"][data-block-variant="statement-media"] .rb-intro-statement-media > :has(> .rb-intro-statement-media-title) {
|
|
86036
86493
|
grid-column: 1 / -1;
|
|
86037
86494
|
}
|
|
86038
86495
|
}
|
|
@@ -86040,7 +86497,8 @@ const containerResponsiveThemeCss = `/*
|
|
|
86040
86497
|
|
|
86041
86498
|
@container rb-site (min-width: 1024px) {
|
|
86042
86499
|
@scope ([data-rb-responsive-mode="container"]) to (:scope [data-rb-responsive-mode]) {
|
|
86043
|
-
:where(.theme-scope:is(*, :scope)) [data-block="intro"][data-block-variant="statement-media"] .rb-intro-statement-media-title
|
|
86500
|
+
:where(.theme-scope:is(*, :scope)) [data-block="intro"][data-block-variant="statement-media"] .rb-intro-statement-media > .rb-intro-statement-media-title,
|
|
86501
|
+
:where(.theme-scope:is(*, :scope)) [data-block="intro"][data-block-variant="statement-media"] .rb-intro-statement-media > :has(> .rb-intro-statement-media-title) {
|
|
86044
86502
|
grid-column: auto;
|
|
86045
86503
|
}
|
|
86046
86504
|
}
|
|
@@ -91190,469 +91648,6 @@ function toBlocksImageResolveContextInput(context) {
|
|
|
91190
91648
|
};
|
|
91191
91649
|
}
|
|
91192
91650
|
//#endregion
|
|
91193
|
-
//#region ../blocks/src/system/data/utils.ts
|
|
91194
|
-
/**
|
|
91195
|
-
* Normalize data loaders from block definition
|
|
91196
|
-
*/
|
|
91197
|
-
function normalizeDataLoaders(def) {
|
|
91198
|
-
if (!def?.dataLoaders) return [];
|
|
91199
|
-
return Object.entries(def.dataLoaders).map(([key, loader]) => ({
|
|
91200
|
-
key,
|
|
91201
|
-
loader
|
|
91202
|
-
}));
|
|
91203
|
-
}
|
|
91204
|
-
/**
|
|
91205
|
-
* Normalize block content for data loading.
|
|
91206
|
-
* Priority: draftContent > content > publishedContent
|
|
91207
|
-
*/
|
|
91208
|
-
function normalizeContent(block) {
|
|
91209
|
-
const source = block.draftContent ?? block.content ?? block.publishedContent ?? {};
|
|
91210
|
-
if (!isObjectRecord$1(source)) return {};
|
|
91211
|
-
if ("data" in source) {
|
|
91212
|
-
const data = source.data;
|
|
91213
|
-
if (isObjectRecord$1(data)) return data;
|
|
91214
|
-
if (data === null || data === void 0) return {};
|
|
91215
|
-
}
|
|
91216
|
-
return source;
|
|
91217
|
-
}
|
|
91218
|
-
/**
|
|
91219
|
-
* Normalize params for API calls.
|
|
91220
|
-
* Converts supplied values to strings, preserving absent versus explicitly empty params.
|
|
91221
|
-
*/
|
|
91222
|
-
function normalizeParams(input) {
|
|
91223
|
-
if (!input || typeof input !== "object") return {};
|
|
91224
|
-
const output = {};
|
|
91225
|
-
for (const [key, value] of Object.entries(input)) if (value !== void 0 && value !== null) output[key] = coerceToString(value);
|
|
91226
|
-
return output;
|
|
91227
|
-
}
|
|
91228
|
-
function isNonArrayObject(value) {
|
|
91229
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
91230
|
-
}
|
|
91231
|
-
function safeJsonStringify(value) {
|
|
91232
|
-
try {
|
|
91233
|
-
return JSON.stringify(value);
|
|
91234
|
-
} catch {
|
|
91235
|
-
return;
|
|
91236
|
-
}
|
|
91237
|
-
}
|
|
91238
|
-
/**
|
|
91239
|
-
* Coerce value to string for API params
|
|
91240
|
-
*/
|
|
91241
|
-
function coerceToString(value) {
|
|
91242
|
-
if (value === null || value === void 0) return "";
|
|
91243
|
-
if (Array.isArray(value)) {
|
|
91244
|
-
if (value.some(isNonArrayObject)) {
|
|
91245
|
-
const json = safeJsonStringify(value);
|
|
91246
|
-
if (typeof json === "string") return json;
|
|
91247
|
-
}
|
|
91248
|
-
return value.map(coerceToString).join(",");
|
|
91249
|
-
}
|
|
91250
|
-
if (isNonArrayObject(value)) {
|
|
91251
|
-
const json = safeJsonStringify(value);
|
|
91252
|
-
if (typeof json === "string") return json;
|
|
91253
|
-
}
|
|
91254
|
-
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") return String(value);
|
|
91255
|
-
return "";
|
|
91256
|
-
}
|
|
91257
|
-
/**
|
|
91258
|
-
* The appointment-services catalogue (issue 1403) pairs the services with the
|
|
91259
|
-
* site's ordered categories. Both are needed to group them, so that response
|
|
91260
|
-
* is passed through whole; any other `{ services }` wrapper is unwrapped.
|
|
91261
|
-
*/
|
|
91262
|
-
function coerceServicesPayload(record) {
|
|
91263
|
-
return Array.isArray(record.services) && Array.isArray(record.categories) ? {
|
|
91264
|
-
services: record.services,
|
|
91265
|
-
categories: record.categories
|
|
91266
|
-
} : record.services;
|
|
91267
|
-
}
|
|
91268
|
-
/**
|
|
91269
|
-
* Extract data from API response.
|
|
91270
|
-
* Unwraps common response wrappers: { data }, { form }, { entries }, { services }, { teamMembers }
|
|
91271
|
-
*
|
|
91272
|
-
* Note: We check that properties are NOT functions to avoid returning
|
|
91273
|
-
* built-in methods like Array.prototype.entries
|
|
91274
|
-
*/
|
|
91275
|
-
function coercePayload(payload) {
|
|
91276
|
-
const linkedContentEntries = coerceLinkedContentEntriesPayload(payload);
|
|
91277
|
-
if (linkedContentEntries !== payload) return linkedContentEntries;
|
|
91278
|
-
if (payload && typeof payload === "object" && !Array.isArray(payload)) {
|
|
91279
|
-
const record = payload;
|
|
91280
|
-
if ("data" in record && typeof record.data !== "function") return record.data;
|
|
91281
|
-
if ("form" in record && typeof record.form !== "function") return record.form;
|
|
91282
|
-
if ("entries" in record && typeof record.entries !== "function") return record.entries;
|
|
91283
|
-
if ("services" in record && typeof record.services !== "function") return coerceServicesPayload(record);
|
|
91284
|
-
if ("teamMembers" in record && typeof record.teamMembers !== "function") return record.teamMembers;
|
|
91285
|
-
}
|
|
91286
|
-
return payload;
|
|
91287
|
-
}
|
|
91288
|
-
//#endregion
|
|
91289
|
-
//#region ../blocks/src/system/data/fetchLoaderData.ts
|
|
91290
|
-
const ALL_PAGE_SIZE = 50;
|
|
91291
|
-
/** The shared loader owns All pagination and rejects adapters that repeat a page. */
|
|
91292
|
-
async function fetchLoaderData(apiClient, endpoint, params) {
|
|
91293
|
-
if (params.limit === "all") return fetchAllPages(apiClient, endpoint, params, 0, /* @__PURE__ */ new Set());
|
|
91294
|
-
return coercePayload(await apiClient({
|
|
91295
|
-
endpoint,
|
|
91296
|
-
params
|
|
91297
|
-
}));
|
|
91298
|
-
}
|
|
91299
|
-
function planLoaderPage(data, offset, seenPages) {
|
|
91300
|
-
if (!isUnknownArray(data)) return {
|
|
91301
|
-
kind: "invalid",
|
|
91302
|
-
message: "Expected paged loader entries"
|
|
91303
|
-
};
|
|
91304
|
-
if (data.length < ALL_PAGE_SIZE) return {
|
|
91305
|
-
kind: "complete",
|
|
91306
|
-
entries: data
|
|
91307
|
-
};
|
|
91308
|
-
const ids = data.map((entry) => isObjectRecord$1(entry) && typeof entry.id === "string" ? entry.id : null);
|
|
91309
|
-
const key = JSON.stringify(ids.every((id) => id !== null) ? [...ids].sort() : data);
|
|
91310
|
-
if (seenPages.has(key)) return {
|
|
91311
|
-
kind: "invalid",
|
|
91312
|
-
message: "Paged loader made no progress"
|
|
91313
|
-
};
|
|
91314
|
-
return {
|
|
91315
|
-
kind: "continue",
|
|
91316
|
-
entries: data,
|
|
91317
|
-
offset: offset + data.length,
|
|
91318
|
-
seenPages: /* @__PURE__ */ new Set([...seenPages, key])
|
|
91319
|
-
};
|
|
91320
|
-
}
|
|
91321
|
-
async function fetchAllPages(apiClient, endpoint, params, offset, seenPages) {
|
|
91322
|
-
const page = planLoaderPage(coercePayload(await apiClient({
|
|
91323
|
-
endpoint,
|
|
91324
|
-
params: {
|
|
91325
|
-
...params,
|
|
91326
|
-
limit: String(ALL_PAGE_SIZE),
|
|
91327
|
-
offset: String(offset)
|
|
91328
|
-
}
|
|
91329
|
-
})), offset, seenPages);
|
|
91330
|
-
switch (page.kind) {
|
|
91331
|
-
case "invalid": throw new Error(page.message);
|
|
91332
|
-
case "complete": return page.entries;
|
|
91333
|
-
case "continue": return [...page.entries, ...await fetchAllPages(apiClient, endpoint, params, page.offset, page.seenPages)];
|
|
91334
|
-
default: return assertNever$3(page);
|
|
91335
|
-
}
|
|
91336
|
-
}
|
|
91337
|
-
function isUnknownArray(value) {
|
|
91338
|
-
return Array.isArray(value);
|
|
91339
|
-
}
|
|
91340
|
-
//#endregion
|
|
91341
|
-
//#region ../blocks/src/system/runtime/bindings.ts
|
|
91342
|
-
const shouldLogWarnings = isNonProductionEnv();
|
|
91343
|
-
function isPlainObject(value) {
|
|
91344
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
91345
|
-
}
|
|
91346
|
-
function isRouteMapEntry(value) {
|
|
91347
|
-
if (typeof value === "string") return true;
|
|
91348
|
-
return isPlainObject(value);
|
|
91349
|
-
}
|
|
91350
|
-
function isRouteMap(value) {
|
|
91351
|
-
if (!isPlainObject(value)) return false;
|
|
91352
|
-
return Object.values(value).every(isRouteMapEntry);
|
|
91353
|
-
}
|
|
91354
|
-
function isPageIdentifierMap(value) {
|
|
91355
|
-
if (!isPlainObject(value)) return false;
|
|
91356
|
-
return Object.values(value).every((v) => typeof v === "string");
|
|
91357
|
-
}
|
|
91358
|
-
function isEntryIdentifierMap(value) {
|
|
91359
|
-
if (!isPlainObject(value)) return false;
|
|
91360
|
-
for (const v of Object.values(value)) {
|
|
91361
|
-
if (!isPlainObject(v)) return false;
|
|
91362
|
-
if (!Object.values(v).every((inner) => typeof inner === "string")) return false;
|
|
91363
|
-
}
|
|
91364
|
-
return true;
|
|
91365
|
-
}
|
|
91366
|
-
function buildTransformContext(vm) {
|
|
91367
|
-
const root = vm.$root;
|
|
91368
|
-
const stage = root && isPlainObject(root) && root.previewStage === "preview" ? "preview" : "published";
|
|
91369
|
-
const routes = root && isPlainObject(root) && isRouteMap(root.routes) ? root.routes : void 0;
|
|
91370
|
-
const pagesByIdentifier = root && isPlainObject(root) && isPageIdentifierMap(root.pagesByIdentifier) ? root.pagesByIdentifier : void 0;
|
|
91371
|
-
const entriesByIdentifier = root && isPlainObject(root) && isEntryIdentifierMap(root.entriesByIdentifier) ? root.entriesByIdentifier : void 0;
|
|
91372
|
-
return {
|
|
91373
|
-
theme: defaultThemeTokens,
|
|
91374
|
-
stage,
|
|
91375
|
-
data: vm.content,
|
|
91376
|
-
routes,
|
|
91377
|
-
pagesByIdentifier,
|
|
91378
|
-
entriesByIdentifier
|
|
91379
|
-
};
|
|
91380
|
-
}
|
|
91381
|
-
function resolveParamsBindings(input, vm, meta) {
|
|
91382
|
-
if (input === null || typeof input !== "object") return input;
|
|
91383
|
-
if (Array.isArray(input)) return input.map((v) => resolveParamsBindings(v, vm, meta));
|
|
91384
|
-
const maybeBind = input.$bind;
|
|
91385
|
-
if (maybeBind && typeof maybeBind === "object") try {
|
|
91386
|
-
const binding = bindingSchema.parse(maybeBind);
|
|
91387
|
-
const value = resolveBinding(binding.from, vm);
|
|
91388
|
-
const resolved = value === void 0 || value === null ? binding.fallback : runTransforms(value, binding.transforms, buildTransformContext(vm), defaultTransforms);
|
|
91389
|
-
if (resolved === void 0 || resolved === null || resolved === "") return binding.fallback;
|
|
91390
|
-
return resolved;
|
|
91391
|
-
} catch (err) {
|
|
91392
|
-
if (shouldLogWarnings) console.warn(`bindings: failed to parse loader param binding for block "${meta?.blockKind ?? "unknown"}"`, err);
|
|
91393
|
-
return;
|
|
91394
|
-
}
|
|
91395
|
-
const out = {};
|
|
91396
|
-
for (const [k, v] of Object.entries(input)) out[k] = resolveParamsBindings(v, vm, meta);
|
|
91397
|
-
return out;
|
|
91398
|
-
}
|
|
91399
|
-
function resolveBinding(path, vm) {
|
|
91400
|
-
const segments = splitPath(path);
|
|
91401
|
-
if (!segments.length) return void 0;
|
|
91402
|
-
const [first, ...rest] = segments;
|
|
91403
|
-
let source = vm;
|
|
91404
|
-
if (first === "$root") {
|
|
91405
|
-
source = vm;
|
|
91406
|
-
return readFromSource(source, [first, ...rest]);
|
|
91407
|
-
}
|
|
91408
|
-
if (first === "content") {
|
|
91409
|
-
source = vm.content;
|
|
91410
|
-
return readFromSource(source, rest);
|
|
91411
|
-
}
|
|
91412
|
-
const contentResult = readFromSource(vm.content, segments);
|
|
91413
|
-
if (contentResult !== void 0) return contentResult;
|
|
91414
|
-
return readFromSource(vm, segments);
|
|
91415
|
-
}
|
|
91416
|
-
function splitPath(path) {
|
|
91417
|
-
const PATH_SEPARATOR_REGEX = /\./g;
|
|
91418
|
-
const BRACKET_ACCESS_REGEX = /\[(?<token>[^\]]+)\]/g;
|
|
91419
|
-
const segments = [];
|
|
91420
|
-
const parts = path.split(PATH_SEPARATOR_REGEX);
|
|
91421
|
-
for (const raw of parts) {
|
|
91422
|
-
if (!raw) continue;
|
|
91423
|
-
const baseMatch = raw.match(/^([^\[]+)/);
|
|
91424
|
-
if (baseMatch && baseMatch[1]) segments.push(baseMatch[1]);
|
|
91425
|
-
const bracketMatches = raw.matchAll(BRACKET_ACCESS_REGEX);
|
|
91426
|
-
for (const match of bracketMatches) {
|
|
91427
|
-
const token = match.groups?.token ?? "";
|
|
91428
|
-
if (token.startsWith("\"") || token.startsWith("'")) segments.push(token.slice(1, -1));
|
|
91429
|
-
else if (/^\d+$/.test(token)) segments.push(Number(token));
|
|
91430
|
-
else segments.push(token);
|
|
91431
|
-
}
|
|
91432
|
-
if (!baseMatch && !raw.includes("[")) segments.push(raw);
|
|
91433
|
-
}
|
|
91434
|
-
return segments;
|
|
91435
|
-
}
|
|
91436
|
-
function readFromSource(source, segments) {
|
|
91437
|
-
return segments.reduce((current, segment) => {
|
|
91438
|
-
if (current === void 0 || current === null) return void 0;
|
|
91439
|
-
if (typeof segment === "number") {
|
|
91440
|
-
if (Array.isArray(current)) return current[segment];
|
|
91441
|
-
return;
|
|
91442
|
-
}
|
|
91443
|
-
if (typeof current === "object" && current !== null && segment in current) return current[segment];
|
|
91444
|
-
}, source);
|
|
91445
|
-
}
|
|
91446
|
-
function isNonProductionEnv() {
|
|
91447
|
-
if (typeof globalThis === "undefined") return true;
|
|
91448
|
-
return globalThis.process?.env?.NODE_ENV !== "production";
|
|
91449
|
-
}
|
|
91450
|
-
//#endregion
|
|
91451
|
-
//#region ../blocks/src/system/data/prefetchBlockData.ts
|
|
91452
|
-
/**
|
|
91453
|
-
* Core block data prefetching logic (framework-agnostic).
|
|
91454
|
-
*
|
|
91455
|
-
* This module provides the shared implementation for prefetching block data loaders.
|
|
91456
|
-
* It works with any API client by accepting it as a parameter (dependency injection).
|
|
91457
|
-
*
|
|
91458
|
-
* Usage:
|
|
91459
|
-
* - Frontend: provide internal API client
|
|
91460
|
-
* - SDK: provide SDK client with endpoint mapping
|
|
91461
|
-
*/
|
|
91462
|
-
function projectDataLoaders(loaders, shouldLoad, blockId, blockKind) {
|
|
91463
|
-
if (!shouldLoad) return [...loaders];
|
|
91464
|
-
return loaders.filter(({ key }) => shouldLoad({
|
|
91465
|
-
blockId,
|
|
91466
|
-
blockKind,
|
|
91467
|
-
loaderKey: key
|
|
91468
|
-
}));
|
|
91469
|
-
}
|
|
91470
|
-
function shouldSkipResolvedLoader(input) {
|
|
91471
|
-
if (input.loader.requiredParams?.some((param) => !input.params[param]?.trim())) return true;
|
|
91472
|
-
return Boolean(input.isValidEndpoint && !input.isValidEndpoint(input.endpoint));
|
|
91473
|
-
}
|
|
91474
|
-
/**
|
|
91475
|
-
* Core data prefetching logic (framework-agnostic).
|
|
91476
|
-
*
|
|
91477
|
-
* This function is shared between frontend and SDK implementations.
|
|
91478
|
-
* It handles:
|
|
91479
|
-
* - Extracting data loaders from block definitions
|
|
91480
|
-
* - Resolving loader params with block content
|
|
91481
|
-
* - Executing server-mode loaders in parallel
|
|
91482
|
-
* - Organizing results by block ID and loader key
|
|
91483
|
-
*
|
|
91484
|
-
* @example
|
|
91485
|
-
* ```typescript
|
|
91486
|
-
* const resolved = await prefetchBlockData(page, context, {
|
|
91487
|
-
* apiClient: async ({ endpoint, params }) => {
|
|
91488
|
-
* return await myApiClient({ endpoint, params });
|
|
91489
|
-
* },
|
|
91490
|
-
* isValidEndpoint: (endpoint) => endpoint in API_ENDPOINTS,
|
|
91491
|
-
* });
|
|
91492
|
-
* ```
|
|
91493
|
-
*/
|
|
91494
|
-
async function prefetchBlockData$1(page, context, options) {
|
|
91495
|
-
return (await prefetchBlockDataWithFailures(page, context, options)).resolvedData;
|
|
91496
|
-
}
|
|
91497
|
-
async function prefetchBlockDataWithFailures(page, context, options) {
|
|
91498
|
-
const { apiClient, isValidEndpoint, onError, getCustomBlockLoaders, getBlockDefinition: getBlockDefinition$1 = getBlockDefinition, resolveParamsBindings: resolveParamsBindings$1 = resolveParamsBindings, shouldLoad } = options;
|
|
91499
|
-
const results = {};
|
|
91500
|
-
const loaderFailures = {};
|
|
91501
|
-
const tasks = [];
|
|
91502
|
-
for (const block of page.blocks) {
|
|
91503
|
-
const blockId = block.id;
|
|
91504
|
-
if (!blockId) continue;
|
|
91505
|
-
let loaders;
|
|
91506
|
-
const def = getBlockDefinition$1(block.kind);
|
|
91507
|
-
if (def) loaders = normalizeDataLoaders(def);
|
|
91508
|
-
else if (getCustomBlockLoaders) {
|
|
91509
|
-
const customLoaders = getCustomBlockLoaders(block.kind);
|
|
91510
|
-
loaders = customLoaders ? Object.entries(customLoaders).map(([key, loader]) => ({
|
|
91511
|
-
key,
|
|
91512
|
-
loader
|
|
91513
|
-
})) : [];
|
|
91514
|
-
} else loaders = [];
|
|
91515
|
-
loaders = projectDataLoaders(loaders, shouldLoad, blockId, block.kind);
|
|
91516
|
-
if (loaders.length === 0) continue;
|
|
91517
|
-
const root = {
|
|
91518
|
-
...context.root ?? {},
|
|
91519
|
-
siteId: context.siteId,
|
|
91520
|
-
pageId: context.pageId,
|
|
91521
|
-
previewStage: context.previewStage
|
|
91522
|
-
};
|
|
91523
|
-
const vm = {
|
|
91524
|
-
content: plannedLoaderContent(block, def, context),
|
|
91525
|
-
$root: root
|
|
91526
|
-
};
|
|
91527
|
-
for (const { key, loader } of loaders) {
|
|
91528
|
-
if (loader.mode === "client") continue;
|
|
91529
|
-
if (typeof loader.when !== "undefined") {
|
|
91530
|
-
if (resolveParamsBindings$1(loader.when, vm, { blockKind: block.kind }) !== true) continue;
|
|
91531
|
-
}
|
|
91532
|
-
const params = normalizeParams(resolveParamsBindings$1(loader.params, vm, { blockKind: block.kind }));
|
|
91533
|
-
const endpoint = loader.endpoint;
|
|
91534
|
-
if (shouldSkipResolvedLoader({
|
|
91535
|
-
loader,
|
|
91536
|
-
endpoint,
|
|
91537
|
-
params,
|
|
91538
|
-
isValidEndpoint
|
|
91539
|
-
})) continue;
|
|
91540
|
-
tasks.push((async () => {
|
|
91541
|
-
try {
|
|
91542
|
-
const data = await fetchLoaderData(apiClient, endpoint, params);
|
|
91543
|
-
const blockResults = results[blockId] ?? (results[blockId] = {});
|
|
91544
|
-
blockResults[key] = data;
|
|
91545
|
-
} catch (error) {
|
|
91546
|
-
const blockFailures = loaderFailures[blockId] ?? (loaderFailures[blockId] = {});
|
|
91547
|
-
blockFailures[key] = {
|
|
91548
|
-
endpoint,
|
|
91549
|
-
params
|
|
91550
|
-
};
|
|
91551
|
-
if (onError) onError(error, {
|
|
91552
|
-
block: block.kind,
|
|
91553
|
-
loader: key
|
|
91554
|
-
});
|
|
91555
|
-
}
|
|
91556
|
-
})());
|
|
91557
|
-
}
|
|
91558
|
-
}
|
|
91559
|
-
if (tasks.length > 0) await Promise.all(tasks);
|
|
91560
|
-
return {
|
|
91561
|
-
resolvedData: results,
|
|
91562
|
-
loaderFailures
|
|
91563
|
-
};
|
|
91564
|
-
}
|
|
91565
|
-
/** Prefetch executes the render-plan content stage before resolving loader bindings. */
|
|
91566
|
-
function plannedLoaderContent(block, definition, context) {
|
|
91567
|
-
const content = normalizeContent(block);
|
|
91568
|
-
if (!definition || content._arrangementLooks === void 0) return content;
|
|
91569
|
-
return planArrangementContent(block.kind, definition.manifest, content, context.previewStage === "preview" ? "authoring" : "public");
|
|
91570
|
-
}
|
|
91571
|
-
//#endregion
|
|
91572
|
-
//#region ../blocks/src/system/data/loaderEndpoints.ts
|
|
91573
|
-
const SUPPORTED_LOADER_ENDPOINTS$1 = [
|
|
91574
|
-
"listPublishedEntries",
|
|
91575
|
-
"getPublishedEntryPreview",
|
|
91576
|
-
"listPublicEvents",
|
|
91577
|
-
"listPublicEventCalendarWindow",
|
|
91578
|
-
"listPublicRecurringSchedule",
|
|
91579
|
-
"getPublicEventDetails",
|
|
91580
|
-
"listPublicRouteCandidates",
|
|
91581
|
-
"listPublicTeamMembers",
|
|
91582
|
-
"listPublicProducts",
|
|
91583
|
-
"listPublicPasses",
|
|
91584
|
-
"listPublicMemberships",
|
|
91585
|
-
"getPublicFormById",
|
|
91586
|
-
"getPublicBookingServices",
|
|
91587
|
-
"getPublicWeeklySlotAvailability"
|
|
91588
|
-
];
|
|
91589
|
-
//#endregion
|
|
91590
|
-
//#region ../blocks/src/system/data/normalizeLoaderParams.ts
|
|
91591
|
-
function toStringParams(value) {
|
|
91592
|
-
if (!isObjectRecord$1(value)) return {};
|
|
91593
|
-
const out = {};
|
|
91594
|
-
for (const [k, v] of Object.entries(value)) if (typeof v === "string") out[k] = v;
|
|
91595
|
-
return out;
|
|
91596
|
-
}
|
|
91597
|
-
function stripEmptyStringValues(params, endpoint) {
|
|
91598
|
-
for (const [key, value] of Object.entries(params)) if (value === "" && !(key === "seriesIds" && (endpoint === "listPublicEvents" || endpoint === "listPublicEventCalendarWindow"))) delete params[key];
|
|
91599
|
-
}
|
|
91600
|
-
function ensureSiteId(params, context) {
|
|
91601
|
-
if (!params.siteId && typeof context.siteId === "string" && context.siteId) params.siteId = context.siteId;
|
|
91602
|
-
}
|
|
91603
|
-
/**
|
|
91604
|
-
* Normalize loader params emitted by the block runtime into a consistent shape
|
|
91605
|
-
* (canonical keys + required context-derived fields).
|
|
91606
|
-
*
|
|
91607
|
-
* Note: params are already stringified by the core prefetch implementation.
|
|
91608
|
-
*/
|
|
91609
|
-
function normalizeLoaderParams(endpoint, params, context) {
|
|
91610
|
-
const out = toStringParams(params);
|
|
91611
|
-
stripEmptyStringValues(out, endpoint);
|
|
91612
|
-
if (endpoint === "getPublicFormById") {
|
|
91613
|
-
ensureSiteId(out, context);
|
|
91614
|
-
if (!out.formId && out.formSlug) {
|
|
91615
|
-
out.formId = out.formSlug;
|
|
91616
|
-
delete out.formSlug;
|
|
91617
|
-
}
|
|
91618
|
-
return out;
|
|
91619
|
-
}
|
|
91620
|
-
if (endpoint === "getPublicBookingServices") {
|
|
91621
|
-
ensureSiteId(out, context);
|
|
91622
|
-
return out;
|
|
91623
|
-
}
|
|
91624
|
-
if (endpoint === "getPublicWeeklySlotAvailability") {
|
|
91625
|
-
ensureSiteId(out, context);
|
|
91626
|
-
return out;
|
|
91627
|
-
}
|
|
91628
|
-
if (endpoint === "listPublicEvents" || endpoint === "listPublicRecurringSchedule" || endpoint === "listPublicEventCalendarWindow") {
|
|
91629
|
-
ensureSiteId(out, context);
|
|
91630
|
-
return out;
|
|
91631
|
-
}
|
|
91632
|
-
if (endpoint === "getPublicEventDetails") {
|
|
91633
|
-
ensureSiteId(out, context);
|
|
91634
|
-
return out;
|
|
91635
|
-
}
|
|
91636
|
-
if (endpoint === "listPublicProducts") {
|
|
91637
|
-
ensureSiteId(out, context);
|
|
91638
|
-
return out;
|
|
91639
|
-
}
|
|
91640
|
-
if (endpoint === "listPublicTeamMembers") {
|
|
91641
|
-
ensureSiteId(out, context);
|
|
91642
|
-
return out;
|
|
91643
|
-
}
|
|
91644
|
-
if (endpoint === "listPublicRouteCandidates") {
|
|
91645
|
-
ensureSiteId(out, context);
|
|
91646
|
-
return out;
|
|
91647
|
-
}
|
|
91648
|
-
if (endpoint === "getPublishedEntryPreview") {
|
|
91649
|
-
ensureSiteId(out, context);
|
|
91650
|
-
return out;
|
|
91651
|
-
}
|
|
91652
|
-
ensureSiteId(out, context);
|
|
91653
|
-
return out;
|
|
91654
|
-
}
|
|
91655
|
-
//#endregion
|
|
91656
91651
|
//#region src/rendering/helpers/siteCustomBlocks.ts
|
|
91657
91652
|
/**
|
|
91658
91653
|
* Prefer the DB-backed custom block manifest list (`site.customBlocks`) when available,
|
|
@@ -95889,6 +95884,24 @@ const navigationLinkInputSchemaOptions = [
|
|
|
95889
95884
|
];
|
|
95890
95885
|
z.discriminatedUnion("kind", navigationLinkInputSchemaOptions);
|
|
95891
95886
|
//#endregion
|
|
95887
|
+
//#region ../blocks/src/system/data/loaderEndpoints.ts
|
|
95888
|
+
const SUPPORTED_LOADER_ENDPOINTS$1 = [
|
|
95889
|
+
"listPublishedEntries",
|
|
95890
|
+
"getPublishedEntryPreview",
|
|
95891
|
+
"listPublicEvents",
|
|
95892
|
+
"listPublicEventCalendarWindow",
|
|
95893
|
+
"listPublicRecurringSchedule",
|
|
95894
|
+
"getPublicEventDetails",
|
|
95895
|
+
"listPublicRouteCandidates",
|
|
95896
|
+
"listPublicTeamMembers",
|
|
95897
|
+
"listPublicProducts",
|
|
95898
|
+
"listPublicPasses",
|
|
95899
|
+
"listPublicMemberships",
|
|
95900
|
+
"getPublicFormById",
|
|
95901
|
+
"getPublicBookingServices",
|
|
95902
|
+
"getPublicWeeklySlotAvailability"
|
|
95903
|
+
];
|
|
95904
|
+
//#endregion
|
|
95892
95905
|
//#region ../api/src/sdkConfig/contracts.ts
|
|
95893
95906
|
/**
|
|
95894
95907
|
* Canonical SDK config Zod contracts.
|
|
@@ -97087,6 +97100,451 @@ z.discriminatedUnion("kind", [z.object({
|
|
|
97087
97100
|
expectedRevision: z.number().int().positive()
|
|
97088
97101
|
}).strict()]);
|
|
97089
97102
|
//#endregion
|
|
97103
|
+
//#region ../blocks/src/system/data/utils.ts
|
|
97104
|
+
/**
|
|
97105
|
+
* Normalize data loaders from block definition
|
|
97106
|
+
*/
|
|
97107
|
+
function normalizeDataLoaders(def) {
|
|
97108
|
+
if (!def?.dataLoaders) return [];
|
|
97109
|
+
return Object.entries(def.dataLoaders).map(([key, loader]) => ({
|
|
97110
|
+
key,
|
|
97111
|
+
loader
|
|
97112
|
+
}));
|
|
97113
|
+
}
|
|
97114
|
+
/**
|
|
97115
|
+
* Normalize block content for data loading.
|
|
97116
|
+
* Priority: draftContent > content > publishedContent
|
|
97117
|
+
*/
|
|
97118
|
+
function normalizeContent(block) {
|
|
97119
|
+
const source = block.draftContent ?? block.content ?? block.publishedContent ?? {};
|
|
97120
|
+
if (!isObjectRecord$1(source)) return {};
|
|
97121
|
+
if ("data" in source) {
|
|
97122
|
+
const data = source.data;
|
|
97123
|
+
if (isObjectRecord$1(data)) return data;
|
|
97124
|
+
if (data === null || data === void 0) return {};
|
|
97125
|
+
}
|
|
97126
|
+
return source;
|
|
97127
|
+
}
|
|
97128
|
+
/**
|
|
97129
|
+
* Normalize params for API calls.
|
|
97130
|
+
* Converts supplied values to strings, preserving absent versus explicitly empty params.
|
|
97131
|
+
*/
|
|
97132
|
+
function normalizeParams(input) {
|
|
97133
|
+
if (!input || typeof input !== "object") return {};
|
|
97134
|
+
const output = {};
|
|
97135
|
+
for (const [key, value] of Object.entries(input)) if (value !== void 0 && value !== null) output[key] = coerceToString(value);
|
|
97136
|
+
return output;
|
|
97137
|
+
}
|
|
97138
|
+
function isNonArrayObject(value) {
|
|
97139
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
97140
|
+
}
|
|
97141
|
+
function safeJsonStringify(value) {
|
|
97142
|
+
try {
|
|
97143
|
+
return JSON.stringify(value);
|
|
97144
|
+
} catch {
|
|
97145
|
+
return;
|
|
97146
|
+
}
|
|
97147
|
+
}
|
|
97148
|
+
/**
|
|
97149
|
+
* Coerce value to string for API params
|
|
97150
|
+
*/
|
|
97151
|
+
function coerceToString(value) {
|
|
97152
|
+
if (value === null || value === void 0) return "";
|
|
97153
|
+
if (Array.isArray(value)) {
|
|
97154
|
+
if (value.some(isNonArrayObject)) {
|
|
97155
|
+
const json = safeJsonStringify(value);
|
|
97156
|
+
if (typeof json === "string") return json;
|
|
97157
|
+
}
|
|
97158
|
+
return value.map(coerceToString).join(",");
|
|
97159
|
+
}
|
|
97160
|
+
if (isNonArrayObject(value)) {
|
|
97161
|
+
const json = safeJsonStringify(value);
|
|
97162
|
+
if (typeof json === "string") return json;
|
|
97163
|
+
}
|
|
97164
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") return String(value);
|
|
97165
|
+
return "";
|
|
97166
|
+
}
|
|
97167
|
+
/**
|
|
97168
|
+
* The appointment-services catalogue (issue 1403) pairs the services with the
|
|
97169
|
+
* site's ordered categories. Both are needed to group them, so that response
|
|
97170
|
+
* is passed through whole; any other `{ services }` wrapper is unwrapped.
|
|
97171
|
+
*/
|
|
97172
|
+
function coerceServicesPayload(record) {
|
|
97173
|
+
return Array.isArray(record.services) && Array.isArray(record.categories) ? {
|
|
97174
|
+
services: record.services,
|
|
97175
|
+
categories: record.categories
|
|
97176
|
+
} : record.services;
|
|
97177
|
+
}
|
|
97178
|
+
/**
|
|
97179
|
+
* Extract data from API response.
|
|
97180
|
+
* Unwraps common response wrappers: { data }, { form }, { entries }, { services }, { teamMembers }
|
|
97181
|
+
*
|
|
97182
|
+
* Note: We check that properties are NOT functions to avoid returning
|
|
97183
|
+
* built-in methods like Array.prototype.entries
|
|
97184
|
+
*/
|
|
97185
|
+
function coercePayload(payload) {
|
|
97186
|
+
const linkedContentEntries = coerceLinkedContentEntriesPayload(payload);
|
|
97187
|
+
if (linkedContentEntries !== payload) return linkedContentEntries;
|
|
97188
|
+
if (payload && typeof payload === "object" && !Array.isArray(payload)) {
|
|
97189
|
+
const record = payload;
|
|
97190
|
+
if ("data" in record && typeof record.data !== "function") return record.data;
|
|
97191
|
+
if ("form" in record && typeof record.form !== "function") return record.form;
|
|
97192
|
+
if ("entries" in record && typeof record.entries !== "function") return record.entries;
|
|
97193
|
+
if ("services" in record && typeof record.services !== "function") return coerceServicesPayload(record);
|
|
97194
|
+
if ("teamMembers" in record && typeof record.teamMembers !== "function") return record.teamMembers;
|
|
97195
|
+
}
|
|
97196
|
+
return payload;
|
|
97197
|
+
}
|
|
97198
|
+
//#endregion
|
|
97199
|
+
//#region ../blocks/src/system/data/fetchLoaderData.ts
|
|
97200
|
+
const ALL_PAGE_SIZE = 50;
|
|
97201
|
+
/** The shared loader owns All pagination and rejects adapters that repeat a page. */
|
|
97202
|
+
async function fetchLoaderData(apiClient, endpoint, params) {
|
|
97203
|
+
if (params.limit === "all") return fetchAllPages(apiClient, endpoint, params, 0, /* @__PURE__ */ new Set());
|
|
97204
|
+
return coercePayload(await apiClient({
|
|
97205
|
+
endpoint,
|
|
97206
|
+
params
|
|
97207
|
+
}));
|
|
97208
|
+
}
|
|
97209
|
+
function planLoaderPage(data, offset, seenPages) {
|
|
97210
|
+
if (!isUnknownArray(data)) return {
|
|
97211
|
+
kind: "invalid",
|
|
97212
|
+
message: "Expected paged loader entries"
|
|
97213
|
+
};
|
|
97214
|
+
if (data.length < ALL_PAGE_SIZE) return {
|
|
97215
|
+
kind: "complete",
|
|
97216
|
+
entries: data
|
|
97217
|
+
};
|
|
97218
|
+
const ids = data.map((entry) => isObjectRecord$1(entry) && typeof entry.id === "string" ? entry.id : null);
|
|
97219
|
+
const key = JSON.stringify(ids.every((id) => id !== null) ? [...ids].sort() : data);
|
|
97220
|
+
if (seenPages.has(key)) return {
|
|
97221
|
+
kind: "invalid",
|
|
97222
|
+
message: "Paged loader made no progress"
|
|
97223
|
+
};
|
|
97224
|
+
return {
|
|
97225
|
+
kind: "continue",
|
|
97226
|
+
entries: data,
|
|
97227
|
+
offset: offset + data.length,
|
|
97228
|
+
seenPages: /* @__PURE__ */ new Set([...seenPages, key])
|
|
97229
|
+
};
|
|
97230
|
+
}
|
|
97231
|
+
async function fetchAllPages(apiClient, endpoint, params, offset, seenPages) {
|
|
97232
|
+
const page = planLoaderPage(coercePayload(await apiClient({
|
|
97233
|
+
endpoint,
|
|
97234
|
+
params: {
|
|
97235
|
+
...params,
|
|
97236
|
+
limit: String(ALL_PAGE_SIZE),
|
|
97237
|
+
offset: String(offset)
|
|
97238
|
+
}
|
|
97239
|
+
})), offset, seenPages);
|
|
97240
|
+
switch (page.kind) {
|
|
97241
|
+
case "invalid": throw new Error(page.message);
|
|
97242
|
+
case "complete": return page.entries;
|
|
97243
|
+
case "continue": return [...page.entries, ...await fetchAllPages(apiClient, endpoint, params, page.offset, page.seenPages)];
|
|
97244
|
+
default: return assertNever$3(page);
|
|
97245
|
+
}
|
|
97246
|
+
}
|
|
97247
|
+
function isUnknownArray(value) {
|
|
97248
|
+
return Array.isArray(value);
|
|
97249
|
+
}
|
|
97250
|
+
//#endregion
|
|
97251
|
+
//#region ../blocks/src/system/runtime/bindings.ts
|
|
97252
|
+
const shouldLogWarnings = isNonProductionEnv();
|
|
97253
|
+
function isPlainObject(value) {
|
|
97254
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
97255
|
+
}
|
|
97256
|
+
function isRouteMapEntry(value) {
|
|
97257
|
+
if (typeof value === "string") return true;
|
|
97258
|
+
return isPlainObject(value);
|
|
97259
|
+
}
|
|
97260
|
+
function isRouteMap(value) {
|
|
97261
|
+
if (!isPlainObject(value)) return false;
|
|
97262
|
+
return Object.values(value).every(isRouteMapEntry);
|
|
97263
|
+
}
|
|
97264
|
+
function isPageIdentifierMap(value) {
|
|
97265
|
+
if (!isPlainObject(value)) return false;
|
|
97266
|
+
return Object.values(value).every((v) => typeof v === "string");
|
|
97267
|
+
}
|
|
97268
|
+
function isEntryIdentifierMap(value) {
|
|
97269
|
+
if (!isPlainObject(value)) return false;
|
|
97270
|
+
for (const v of Object.values(value)) {
|
|
97271
|
+
if (!isPlainObject(v)) return false;
|
|
97272
|
+
if (!Object.values(v).every((inner) => typeof inner === "string")) return false;
|
|
97273
|
+
}
|
|
97274
|
+
return true;
|
|
97275
|
+
}
|
|
97276
|
+
function buildTransformContext(vm) {
|
|
97277
|
+
const root = vm.$root;
|
|
97278
|
+
const stage = root && isPlainObject(root) && root.previewStage === "preview" ? "preview" : "published";
|
|
97279
|
+
const routes = root && isPlainObject(root) && isRouteMap(root.routes) ? root.routes : void 0;
|
|
97280
|
+
const pagesByIdentifier = root && isPlainObject(root) && isPageIdentifierMap(root.pagesByIdentifier) ? root.pagesByIdentifier : void 0;
|
|
97281
|
+
const entriesByIdentifier = root && isPlainObject(root) && isEntryIdentifierMap(root.entriesByIdentifier) ? root.entriesByIdentifier : void 0;
|
|
97282
|
+
return {
|
|
97283
|
+
theme: defaultThemeTokens,
|
|
97284
|
+
stage,
|
|
97285
|
+
data: vm.content,
|
|
97286
|
+
routes,
|
|
97287
|
+
pagesByIdentifier,
|
|
97288
|
+
entriesByIdentifier
|
|
97289
|
+
};
|
|
97290
|
+
}
|
|
97291
|
+
function resolveParamsBindings(input, vm, meta) {
|
|
97292
|
+
if (input === null || typeof input !== "object") return input;
|
|
97293
|
+
if (Array.isArray(input)) return input.map((v) => resolveParamsBindings(v, vm, meta));
|
|
97294
|
+
const maybeBind = input.$bind;
|
|
97295
|
+
if (maybeBind && typeof maybeBind === "object") try {
|
|
97296
|
+
const binding = bindingSchema.parse(maybeBind);
|
|
97297
|
+
const value = resolveBinding(binding.from, vm);
|
|
97298
|
+
const resolved = value === void 0 || value === null ? binding.fallback : runTransforms(value, binding.transforms, buildTransformContext(vm), defaultTransforms);
|
|
97299
|
+
if (resolved === void 0 || resolved === null || resolved === "") return binding.fallback;
|
|
97300
|
+
return resolved;
|
|
97301
|
+
} catch (err) {
|
|
97302
|
+
if (shouldLogWarnings) console.warn(`bindings: failed to parse loader param binding for block "${meta?.blockKind ?? "unknown"}"`, err);
|
|
97303
|
+
return;
|
|
97304
|
+
}
|
|
97305
|
+
const out = {};
|
|
97306
|
+
for (const [k, v] of Object.entries(input)) out[k] = resolveParamsBindings(v, vm, meta);
|
|
97307
|
+
return out;
|
|
97308
|
+
}
|
|
97309
|
+
function resolveBinding(path, vm) {
|
|
97310
|
+
const segments = splitPath(path);
|
|
97311
|
+
if (!segments.length) return void 0;
|
|
97312
|
+
const [first, ...rest] = segments;
|
|
97313
|
+
let source = vm;
|
|
97314
|
+
if (first === "$root") {
|
|
97315
|
+
source = vm;
|
|
97316
|
+
return readFromSource(source, [first, ...rest]);
|
|
97317
|
+
}
|
|
97318
|
+
if (first === "content") {
|
|
97319
|
+
source = vm.content;
|
|
97320
|
+
return readFromSource(source, rest);
|
|
97321
|
+
}
|
|
97322
|
+
const contentResult = readFromSource(vm.content, segments);
|
|
97323
|
+
if (contentResult !== void 0) return contentResult;
|
|
97324
|
+
return readFromSource(vm, segments);
|
|
97325
|
+
}
|
|
97326
|
+
function splitPath(path) {
|
|
97327
|
+
const PATH_SEPARATOR_REGEX = /\./g;
|
|
97328
|
+
const BRACKET_ACCESS_REGEX = /\[(?<token>[^\]]+)\]/g;
|
|
97329
|
+
const segments = [];
|
|
97330
|
+
const parts = path.split(PATH_SEPARATOR_REGEX);
|
|
97331
|
+
for (const raw of parts) {
|
|
97332
|
+
if (!raw) continue;
|
|
97333
|
+
const baseMatch = raw.match(/^([^\[]+)/);
|
|
97334
|
+
if (baseMatch && baseMatch[1]) segments.push(baseMatch[1]);
|
|
97335
|
+
const bracketMatches = raw.matchAll(BRACKET_ACCESS_REGEX);
|
|
97336
|
+
for (const match of bracketMatches) {
|
|
97337
|
+
const token = match.groups?.token ?? "";
|
|
97338
|
+
if (token.startsWith("\"") || token.startsWith("'")) segments.push(token.slice(1, -1));
|
|
97339
|
+
else if (/^\d+$/.test(token)) segments.push(Number(token));
|
|
97340
|
+
else segments.push(token);
|
|
97341
|
+
}
|
|
97342
|
+
if (!baseMatch && !raw.includes("[")) segments.push(raw);
|
|
97343
|
+
}
|
|
97344
|
+
return segments;
|
|
97345
|
+
}
|
|
97346
|
+
function readFromSource(source, segments) {
|
|
97347
|
+
return segments.reduce((current, segment) => {
|
|
97348
|
+
if (current === void 0 || current === null) return void 0;
|
|
97349
|
+
if (typeof segment === "number") {
|
|
97350
|
+
if (Array.isArray(current)) return current[segment];
|
|
97351
|
+
return;
|
|
97352
|
+
}
|
|
97353
|
+
if (typeof current === "object" && current !== null && segment in current) return current[segment];
|
|
97354
|
+
}, source);
|
|
97355
|
+
}
|
|
97356
|
+
function isNonProductionEnv() {
|
|
97357
|
+
if (typeof globalThis === "undefined") return true;
|
|
97358
|
+
return globalThis.process?.env?.NODE_ENV !== "production";
|
|
97359
|
+
}
|
|
97360
|
+
//#endregion
|
|
97361
|
+
//#region ../blocks/src/system/data/prefetchBlockData.ts
|
|
97362
|
+
/**
|
|
97363
|
+
* Core block data prefetching logic (framework-agnostic).
|
|
97364
|
+
*
|
|
97365
|
+
* This module provides the shared implementation for prefetching block data loaders.
|
|
97366
|
+
* It works with any API client by accepting it as a parameter (dependency injection).
|
|
97367
|
+
*
|
|
97368
|
+
* Usage:
|
|
97369
|
+
* - Frontend: provide internal API client
|
|
97370
|
+
* - SDK: provide SDK client with endpoint mapping
|
|
97371
|
+
*/
|
|
97372
|
+
function projectDataLoaders(loaders, shouldLoad, blockId, blockKind) {
|
|
97373
|
+
if (!shouldLoad) return [...loaders];
|
|
97374
|
+
return loaders.filter(({ key }) => shouldLoad({
|
|
97375
|
+
blockId,
|
|
97376
|
+
blockKind,
|
|
97377
|
+
loaderKey: key
|
|
97378
|
+
}));
|
|
97379
|
+
}
|
|
97380
|
+
function shouldSkipResolvedLoader(input) {
|
|
97381
|
+
if (input.loader.requiredParams?.some((param) => !input.params[param]?.trim())) return true;
|
|
97382
|
+
return Boolean(input.isValidEndpoint && !input.isValidEndpoint(input.endpoint));
|
|
97383
|
+
}
|
|
97384
|
+
/**
|
|
97385
|
+
* Core data prefetching logic (framework-agnostic).
|
|
97386
|
+
*
|
|
97387
|
+
* This function is shared between frontend and SDK implementations.
|
|
97388
|
+
* It handles:
|
|
97389
|
+
* - Extracting data loaders from block definitions
|
|
97390
|
+
* - Resolving loader params with block content
|
|
97391
|
+
* - Executing server-mode loaders in parallel
|
|
97392
|
+
* - Organizing results by block ID and loader key
|
|
97393
|
+
*
|
|
97394
|
+
* @example
|
|
97395
|
+
* ```typescript
|
|
97396
|
+
* const resolved = await prefetchBlockData(page, context, {
|
|
97397
|
+
* apiClient: async ({ endpoint, params }) => {
|
|
97398
|
+
* return await myApiClient({ endpoint, params });
|
|
97399
|
+
* },
|
|
97400
|
+
* isValidEndpoint: (endpoint) => endpoint in API_ENDPOINTS,
|
|
97401
|
+
* });
|
|
97402
|
+
* ```
|
|
97403
|
+
*/
|
|
97404
|
+
async function prefetchBlockData$1(page, context, options) {
|
|
97405
|
+
return (await prefetchBlockDataWithFailures(page, context, options)).resolvedData;
|
|
97406
|
+
}
|
|
97407
|
+
async function prefetchBlockDataWithFailures(page, context, options) {
|
|
97408
|
+
const { apiClient, isValidEndpoint, onError, getCustomBlockLoaders, getBlockDefinition: getBlockDefinition$1 = getBlockDefinition, resolveParamsBindings: resolveParamsBindings$1 = resolveParamsBindings, shouldLoad } = options;
|
|
97409
|
+
const results = {};
|
|
97410
|
+
const loaderFailures = {};
|
|
97411
|
+
const tasks = [];
|
|
97412
|
+
for (const block of page.blocks) {
|
|
97413
|
+
const blockId = block.id;
|
|
97414
|
+
if (!blockId) continue;
|
|
97415
|
+
let loaders;
|
|
97416
|
+
const def = getBlockDefinition$1(block.kind);
|
|
97417
|
+
if (def) loaders = normalizeDataLoaders(def);
|
|
97418
|
+
else if (getCustomBlockLoaders) {
|
|
97419
|
+
const customLoaders = getCustomBlockLoaders(block.kind);
|
|
97420
|
+
loaders = customLoaders ? Object.entries(customLoaders).map(([key, loader]) => ({
|
|
97421
|
+
key,
|
|
97422
|
+
loader
|
|
97423
|
+
})) : [];
|
|
97424
|
+
} else loaders = [];
|
|
97425
|
+
loaders = projectDataLoaders(loaders, shouldLoad, blockId, block.kind);
|
|
97426
|
+
if (loaders.length === 0) continue;
|
|
97427
|
+
const root = {
|
|
97428
|
+
...context.root ?? {},
|
|
97429
|
+
siteId: context.siteId,
|
|
97430
|
+
pageId: context.pageId,
|
|
97431
|
+
previewStage: context.previewStage
|
|
97432
|
+
};
|
|
97433
|
+
const vm = {
|
|
97434
|
+
content: plannedLoaderContent(block, def, context),
|
|
97435
|
+
$root: root
|
|
97436
|
+
};
|
|
97437
|
+
for (const { key, loader } of loaders) {
|
|
97438
|
+
if (loader.mode === "client") continue;
|
|
97439
|
+
if (typeof loader.when !== "undefined") {
|
|
97440
|
+
if (resolveParamsBindings$1(loader.when, vm, { blockKind: block.kind }) !== true) continue;
|
|
97441
|
+
}
|
|
97442
|
+
const params = normalizeParams(resolveParamsBindings$1(loader.params, vm, { blockKind: block.kind }));
|
|
97443
|
+
const endpoint = loader.endpoint;
|
|
97444
|
+
if (shouldSkipResolvedLoader({
|
|
97445
|
+
loader,
|
|
97446
|
+
endpoint,
|
|
97447
|
+
params,
|
|
97448
|
+
isValidEndpoint
|
|
97449
|
+
})) continue;
|
|
97450
|
+
tasks.push((async () => {
|
|
97451
|
+
try {
|
|
97452
|
+
const data = await fetchLoaderData(apiClient, endpoint, params);
|
|
97453
|
+
const blockResults = results[blockId] ?? (results[blockId] = {});
|
|
97454
|
+
blockResults[key] = data;
|
|
97455
|
+
} catch (error) {
|
|
97456
|
+
const blockFailures = loaderFailures[blockId] ?? (loaderFailures[blockId] = {});
|
|
97457
|
+
blockFailures[key] = {
|
|
97458
|
+
endpoint,
|
|
97459
|
+
params
|
|
97460
|
+
};
|
|
97461
|
+
if (onError) onError(error, {
|
|
97462
|
+
block: block.kind,
|
|
97463
|
+
loader: key
|
|
97464
|
+
});
|
|
97465
|
+
}
|
|
97466
|
+
})());
|
|
97467
|
+
}
|
|
97468
|
+
}
|
|
97469
|
+
if (tasks.length > 0) await Promise.all(tasks);
|
|
97470
|
+
return {
|
|
97471
|
+
resolvedData: results,
|
|
97472
|
+
loaderFailures
|
|
97473
|
+
};
|
|
97474
|
+
}
|
|
97475
|
+
/** Prefetch executes the render-plan content stage before resolving loader bindings. */
|
|
97476
|
+
function plannedLoaderContent(block, definition, context) {
|
|
97477
|
+
const content = normalizeContent(block);
|
|
97478
|
+
if (!definition || content._arrangementLooks === void 0) return content;
|
|
97479
|
+
return planArrangementContent(block.kind, definition.manifest, content, context.previewStage === "preview" ? "authoring" : "public");
|
|
97480
|
+
}
|
|
97481
|
+
//#endregion
|
|
97482
|
+
//#region ../blocks/src/system/data/normalizeLoaderParams.ts
|
|
97483
|
+
function toStringParams(value) {
|
|
97484
|
+
if (!isObjectRecord$1(value)) return {};
|
|
97485
|
+
const out = {};
|
|
97486
|
+
for (const [k, v] of Object.entries(value)) if (typeof v === "string") out[k] = v;
|
|
97487
|
+
return out;
|
|
97488
|
+
}
|
|
97489
|
+
function stripEmptyStringValues(params, endpoint) {
|
|
97490
|
+
for (const [key, value] of Object.entries(params)) if (value === "" && !(key === "seriesIds" && (endpoint === "listPublicEvents" || endpoint === "listPublicEventCalendarWindow"))) delete params[key];
|
|
97491
|
+
}
|
|
97492
|
+
function ensureSiteId(params, context) {
|
|
97493
|
+
if (!params.siteId && typeof context.siteId === "string" && context.siteId) params.siteId = context.siteId;
|
|
97494
|
+
}
|
|
97495
|
+
/**
|
|
97496
|
+
* Normalize loader params emitted by the block runtime into a consistent shape
|
|
97497
|
+
* (canonical keys + required context-derived fields).
|
|
97498
|
+
*
|
|
97499
|
+
* Note: params are already stringified by the core prefetch implementation.
|
|
97500
|
+
*/
|
|
97501
|
+
function normalizeLoaderParams(endpoint, params, context) {
|
|
97502
|
+
const out = toStringParams(params);
|
|
97503
|
+
stripEmptyStringValues(out, endpoint);
|
|
97504
|
+
if (endpoint === "getPublicFormById") {
|
|
97505
|
+
ensureSiteId(out, context);
|
|
97506
|
+
if (!out.formId && out.formSlug) {
|
|
97507
|
+
out.formId = out.formSlug;
|
|
97508
|
+
delete out.formSlug;
|
|
97509
|
+
}
|
|
97510
|
+
return out;
|
|
97511
|
+
}
|
|
97512
|
+
if (endpoint === "getPublicBookingServices") {
|
|
97513
|
+
ensureSiteId(out, context);
|
|
97514
|
+
return out;
|
|
97515
|
+
}
|
|
97516
|
+
if (endpoint === "getPublicWeeklySlotAvailability") {
|
|
97517
|
+
ensureSiteId(out, context);
|
|
97518
|
+
return out;
|
|
97519
|
+
}
|
|
97520
|
+
if (endpoint === "listPublicEvents" || endpoint === "listPublicRecurringSchedule" || endpoint === "listPublicEventCalendarWindow") {
|
|
97521
|
+
ensureSiteId(out, context);
|
|
97522
|
+
return out;
|
|
97523
|
+
}
|
|
97524
|
+
if (endpoint === "getPublicEventDetails") {
|
|
97525
|
+
ensureSiteId(out, context);
|
|
97526
|
+
return out;
|
|
97527
|
+
}
|
|
97528
|
+
if (endpoint === "listPublicProducts") {
|
|
97529
|
+
ensureSiteId(out, context);
|
|
97530
|
+
return out;
|
|
97531
|
+
}
|
|
97532
|
+
if (endpoint === "listPublicTeamMembers") {
|
|
97533
|
+
ensureSiteId(out, context);
|
|
97534
|
+
return out;
|
|
97535
|
+
}
|
|
97536
|
+
if (endpoint === "listPublicRouteCandidates") {
|
|
97537
|
+
ensureSiteId(out, context);
|
|
97538
|
+
return out;
|
|
97539
|
+
}
|
|
97540
|
+
if (endpoint === "getPublishedEntryPreview") {
|
|
97541
|
+
ensureSiteId(out, context);
|
|
97542
|
+
return out;
|
|
97543
|
+
}
|
|
97544
|
+
ensureSiteId(out, context);
|
|
97545
|
+
return out;
|
|
97546
|
+
}
|
|
97547
|
+
//#endregion
|
|
97090
97548
|
//#region src/data/prefetchBlockData.ts
|
|
97091
97549
|
const SUPPORTED_LOADER_ENDPOINTS = SUPPORTED_LOADER_ENDPOINTS$1;
|
|
97092
97550
|
function isSupportedLoaderEndpoint(endpoint) {
|