@riverbankcms/sdk 0.90.0 → 0.91.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-KVXNF3VW.mjs → PreviewEditorSidebar-3TT47WCF.mjs} +3 -3
- package/dist/{PreviewEditorUI-J3JN5Z7T.mjs → PreviewEditorUI-ORCLLUNZ.mjs} +3 -3
- package/dist/SdkPreviewModeRuntime-GMCDQPZZ.mjs +8 -0
- package/dist/_dts/api/src/bookingConfig.d.ts +3 -0
- package/dist/_dts/api/src/event-listing-destination.d.ts +59 -0
- package/dist/_dts/api/src/index.d.ts +4 -0
- package/dist/_dts/api/src/navigation/dashboardSettingsNav.d.ts +0 -1
- package/dist/_dts/api/src/navigation.d.ts +2 -0
- package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +3 -1
- package/dist/_dts/api/src/settings/permissions.d.ts +273 -0
- package/dist/_dts/api/src/types.d.ts +1 -0
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +60 -2
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +12 -1
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +9 -9
- package/dist/_dts/blocks/src/system/blocks/team-members.d.ts +1 -1
- package/dist/_dts/blocks/src/system/manifest/fieldValidation/index.d.ts +17 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.contract.d.ts +5 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventPaymentOptions.d.ts +24 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/destination.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/pricing.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/utils.d.ts +7 -0
- package/dist/_dts/core/src/event-pricing.d.ts +12 -2
- package/dist/_dts/core/src/string.d.ts +12 -0
- package/dist/_dts/sdk/src/cli/sync/validation.d.ts +2 -2
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +11 -1
- package/dist/_dts/sdk/src/rendering/islands/types.d.ts +11 -1
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/{chunk-GSPFFUVB.mjs → chunk-AFPMCLS7.mjs} +2 -2
- package/dist/{chunk-RQ3XZ4SJ.mjs → chunk-GDT2QGIL.mjs} +1 -1
- package/dist/{chunk-PMBB6MQ7.mjs → chunk-RQUZYSES.mjs} +345 -153
- package/dist/{chunk-AEOYWPE4.mjs → chunk-S3YHJWEU.mjs} +7 -7
- package/dist/{chunk-UG7I7S7W.mjs → chunk-U5YM4AWE.mjs} +1 -1
- package/dist/{chunk-BOQXMCSP.mjs → chunk-ZA2S7H34.mjs} +3 -3
- package/dist/cli/index.mjs +363 -437
- package/dist/cli/init-docs/content/workflow-add-block.md +48 -0
- package/dist/cli/init-docs/content/workflow-custom-block.md +10 -0
- package/dist/client/{accordion-GXQNWQ6O.mjs → accordion-AFX37652.mjs} +2 -2
- package/dist/client/{bookingForm-STLUJ36H.mjs → bookingForm-32V5QCOW.mjs} +6 -6
- package/dist/client/bookings.mjs +1170 -571
- package/dist/client/{carousel-CVRN6EPP.mjs → carousel-TJGQJ7ER.mjs} +3 -3
- package/dist/client/{cart-IYIBA5CL.mjs → cart-JUU2JEW4.mjs} +6 -6
- package/dist/client/{checkout-O3BGM4GS.mjs → checkout-RD6BTFX4.mjs} +6 -6
- package/dist/client/{chunk-DAS5CIER.mjs → chunk-6QZIBNGV.mjs} +119 -21
- package/dist/client/{chunk-VFHZLZAC.mjs → chunk-6RN62XBV.mjs} +1 -1
- package/dist/client/{chunk-D3ETC2SU.mjs → chunk-C4LP6BPG.mjs} +1 -1
- package/dist/client/{chunk-NBFRJ5NB.mjs → chunk-CKXEUWWA.mjs} +2 -2
- package/dist/client/{chunk-4RTFGHZN.mjs → chunk-E6VIWZUG.mjs} +6 -3
- package/dist/client/{chunk-Z62JYS5O.mjs → chunk-FMZZHAIR.mjs} +2 -2
- package/dist/client/{chunk-FHU6PFPM.mjs → chunk-ISAUXU5R.mjs} +1 -1
- package/dist/client/{chunk-HIHOQGIP.mjs → chunk-LJCX6V7Q.mjs} +9 -9
- package/dist/client/{chunk-6DPXDOIL.mjs → chunk-MLBNVN4H.mjs} +99 -26
- package/dist/client/{chunk-7DH35FGA.mjs → chunk-PMNAV6LO.mjs} +1 -1
- package/dist/client/{chunk-MFPKS6QS.mjs → chunk-RMOFBBNA.mjs} +5 -5
- package/dist/client/{chunk-25W2EQUN.mjs → chunk-RWYFG625.mjs} +17 -8
- package/dist/client/client.mjs +305 -113
- package/dist/client/{courseRegistration-2D3ACMJR.mjs → courseRegistration-X63QAIVV.mjs} +6 -6
- package/dist/client/{eventCalendar-QY4UZUFF.mjs → eventCalendar-5T24GCZL.mjs} +9 -9
- package/dist/client/{eventCombined-RRCDKJC2.mjs → eventCombined-AZVTF22X.mjs} +9 -9
- package/dist/client/{eventDetails-YO335BUT.mjs → eventDetails-7GPFNLGF.mjs} +9 -9
- package/dist/client/{eventListing-PXA6GFQ3.mjs → eventListing-QEUMTMUM.mjs} +9 -9
- package/dist/client/{eventRegistration-2ZHEDDXO.mjs → eventRegistration-P2EDKCQZ.mjs} +9 -9
- package/dist/client/{form-ZS6KX4U2.mjs → form-NUJ7H4IN.mjs} +3 -3
- package/dist/client/{headerSection-QK5SLIIB.mjs → headerSection-JB7LECPL.mjs} +3 -3
- package/dist/client/hooks.mjs +93 -42
- package/dist/client/{locationMap-GFNIUD2X.mjs → locationMap-UEYWUCSW.mjs} +3 -3
- package/dist/client/{newsletterForm-PGLTTCUG.mjs → newsletterForm-S2YZQ2X7.mjs} +3 -3
- package/dist/client/{productDetail-OPBE5ZPI.mjs → productDetail-H5MADGG7.mjs} +6 -6
- package/dist/client/{productList-NI72Q62Z.mjs → productList-DK7YON7H.mjs} +6 -6
- package/dist/client/rendering/client.mjs +262 -70
- package/dist/client/rendering/islands.mjs +19 -19
- package/dist/client/rendering.mjs +306 -114
- package/dist/client/{shop-3ZQPEWYI.mjs → shop-6PA7RDRJ.mjs} +6 -6
- package/dist/client/spam-protection.mjs +10 -10
- package/dist/preview-next/client/runtime.mjs +5 -5
- package/dist/{sdk-runtime-FSHXCWDS.mjs → sdk-runtime-JP5347OB.mjs} +6 -6
- package/dist/server/components.mjs +149 -69
- package/dist/server/config-validation.mjs +85 -34
- package/dist/server/config.mjs +85 -34
- package/dist/server/data.mjs +93 -42
- package/dist/server/index.mjs +1 -1
- package/dist/server/navigation.mjs +2 -2
- package/dist/server/next.mjs +170 -90
- package/dist/server/page-converter.mjs +77 -26
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +161 -81
- package/dist/server/rendering.mjs +165 -85
- package/dist/server/routing.mjs +135 -58
- package/dist/server/server.mjs +102 -51
- package/package.json +2 -2
- package/dist/SdkPreviewModeRuntime-UBL6MSNP.mjs +0 -8
|
@@ -270,6 +270,8 @@ function publicEventPricingType(pricing) {
|
|
|
270
270
|
case "ticket_types":
|
|
271
271
|
case "course":
|
|
272
272
|
return isFreePublicEventPriceDisplay(pricing.display) ? "free" : "paid";
|
|
273
|
+
case "external":
|
|
274
|
+
return "external";
|
|
273
275
|
}
|
|
274
276
|
}
|
|
275
277
|
function publicEventPricingCurrency(pricing) {
|
|
@@ -281,6 +283,8 @@ function publicEventPricingCurrency(pricing) {
|
|
|
281
283
|
return pricing.currency;
|
|
282
284
|
case "course":
|
|
283
285
|
return pricing.display.display.currency;
|
|
286
|
+
case "external":
|
|
287
|
+
return null;
|
|
284
288
|
}
|
|
285
289
|
}
|
|
286
290
|
function publicEventScalarPrice(pricing) {
|
|
@@ -295,6 +299,7 @@ function publicEventPricingMode(pricing) {
|
|
|
295
299
|
return "ticket_types";
|
|
296
300
|
case "drop_in":
|
|
297
301
|
case "course":
|
|
302
|
+
case "external":
|
|
298
303
|
return void 0;
|
|
299
304
|
}
|
|
300
305
|
}
|
|
@@ -312,6 +317,7 @@ function isFreePublicEventPriceDisplay(display) {
|
|
|
312
317
|
case "range":
|
|
313
318
|
case "mixed":
|
|
314
319
|
case "unavailable":
|
|
320
|
+
case "external":
|
|
315
321
|
return false;
|
|
316
322
|
}
|
|
317
323
|
}
|
|
@@ -342,6 +348,8 @@ function formatBookingPriceDisplay(display, options = {}) {
|
|
|
342
348
|
return display.paidToAmount > display.paidFromAmount ? `Free / ${formatCurrencyAmount(display.paidFromAmount, display.currency, options)} - ${formatCurrencyAmount(display.paidToAmount, display.currency, options)}` : `Free / ${formatCurrencyAmount(display.paidFromAmount, display.currency, options)}`;
|
|
343
349
|
case "unavailable":
|
|
344
350
|
return "Pricing unavailable";
|
|
351
|
+
case "external":
|
|
352
|
+
return display.label;
|
|
345
353
|
case "course":
|
|
346
354
|
return formatCoursePriceDisplayLabel(display.display, options);
|
|
347
355
|
default:
|
|
@@ -465,10 +473,11 @@ function omitZeroAmountFutureRows(rows) {
|
|
|
465
473
|
if (rows.length <= 1) {
|
|
466
474
|
return rows;
|
|
467
475
|
}
|
|
468
|
-
const
|
|
469
|
-
if (
|
|
476
|
+
const firstRow = rows[0];
|
|
477
|
+
if (firstRow === void 0) {
|
|
470
478
|
return [];
|
|
471
479
|
}
|
|
480
|
+
const futureRows = rows.slice(1);
|
|
472
481
|
return [
|
|
473
482
|
firstRow,
|
|
474
483
|
...futureRows.filter((row) => row.amountCents > 0)
|
|
@@ -513,11 +522,11 @@ function isValidTimeZone(timeZone) {
|
|
|
513
522
|
}
|
|
514
523
|
function getSafeTimeZone(timeZone) {
|
|
515
524
|
const normalized = typeof timeZone === "string" ? timeZone.trim() : "";
|
|
516
|
-
return normalized && isValidTimeZone(normalized) ? normalized : FALLBACK_TIMEZONE;
|
|
525
|
+
return normalized.length > 0 && isValidTimeZone(normalized) ? normalized : FALLBACK_TIMEZONE;
|
|
517
526
|
}
|
|
518
527
|
function parseStrictBookingTimeZone(timeZone) {
|
|
519
528
|
const normalized = timeZone.trim();
|
|
520
|
-
if (
|
|
529
|
+
if (normalized.length === 0 || !isValidTimeZone(normalized)) {
|
|
521
530
|
return null;
|
|
522
531
|
}
|
|
523
532
|
return normalized;
|
|
@@ -603,7 +612,7 @@ function parseScheduledBookingDateTime(input) {
|
|
|
603
612
|
try {
|
|
604
613
|
const startsAt = toUtcIsoDateTimeString(input.startsAt);
|
|
605
614
|
const timeZone = parseStrictBookingTimeZone(input.timeZone);
|
|
606
|
-
if (
|
|
615
|
+
if (timeZone === null) {
|
|
607
616
|
return {
|
|
608
617
|
ok: false,
|
|
609
618
|
field: "timeZone",
|
|
@@ -742,7 +751,7 @@ function getBookingLocalDateKey(input) {
|
|
|
742
751
|
}
|
|
743
752
|
function parseBookingLocalDate(value) {
|
|
744
753
|
const match = LOCAL_DATE_PATTERN.exec(value.trim());
|
|
745
|
-
if (
|
|
754
|
+
if (match === null || match.groups === void 0) {
|
|
746
755
|
throw new Error(`Invalid booking date format: "${value}" (expected YYYY-MM-DD)`);
|
|
747
756
|
}
|
|
748
757
|
const year = Number(match.groups.year);
|
|
@@ -801,10 +810,10 @@ function normalizeLocationAddressText(value) {
|
|
|
801
810
|
return null;
|
|
802
811
|
}
|
|
803
812
|
const trimmed = value.trim();
|
|
804
|
-
return trimmed ? trimmed : null;
|
|
813
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
805
814
|
}
|
|
806
815
|
function hasLocationCoordinates(value) {
|
|
807
|
-
return typeof value
|
|
816
|
+
return value != null && typeof value.lat === "number" && typeof value.lng === "number";
|
|
808
817
|
}
|
|
809
818
|
function toLocationCoordinates(value) {
|
|
810
819
|
if (!hasLocationCoordinates(value)) {
|
|
@@ -821,6 +830,13 @@ var init_location = __esm({
|
|
|
821
830
|
}
|
|
822
831
|
});
|
|
823
832
|
|
|
833
|
+
// ../core/src/string.ts
|
|
834
|
+
var init_string = __esm({
|
|
835
|
+
"../core/src/string.ts"() {
|
|
836
|
+
"use strict";
|
|
837
|
+
}
|
|
838
|
+
});
|
|
839
|
+
|
|
824
840
|
// ../core/src/business-address.ts
|
|
825
841
|
var init_business_address = __esm({
|
|
826
842
|
"../core/src/business-address.ts"() {
|
|
@@ -961,13 +977,6 @@ var init_slug = __esm({
|
|
|
961
977
|
}
|
|
962
978
|
});
|
|
963
979
|
|
|
964
|
-
// ../core/src/string.ts
|
|
965
|
-
var init_string = __esm({
|
|
966
|
-
"../core/src/string.ts"() {
|
|
967
|
-
"use strict";
|
|
968
|
-
}
|
|
969
|
-
});
|
|
970
|
-
|
|
971
980
|
// ../core/src/uuid.ts
|
|
972
981
|
var init_uuid = __esm({
|
|
973
982
|
"../core/src/uuid.ts"() {
|
|
@@ -2075,7 +2084,7 @@ var init_schemas = __esm({
|
|
|
2075
2084
|
|
|
2076
2085
|
// ../blocks/src/system/blocks/events/shared/schemas.ts
|
|
2077
2086
|
import { z as z6 } from "zod";
|
|
2078
|
-
var eventPresetSchema, eventScheduleScopeSchema, eventDestinationModeSchema, eventVenueSchema, eventCategorySchema, pricingTypeSchema, accessRestrictionSchema, eventPricingModeSchema, publicCoursePriceDisplaySchema, publicEventPriceDisplaySchema, publicEventTicketTypePriceDisplaySchema, publicEventAttendanceModeSchema, publicEventAttendanceModeAvailabilitySchema, publicEventTicketTypeAvailabilitySchema, publicEventTicketTypeSchema, publicEventPricingSchema, publicTeamMemberSummarySchema, publicEventSchema, publicEventsArraySchema;
|
|
2087
|
+
var eventPresetSchema, eventScheduleScopeSchema, eventDestinationModeSchema, publicEventDestinationSchema, eventVenueSchema, eventCategorySchema, pricingTypeSchema, accessRestrictionSchema, eventPricingModeSchema, publicCoursePriceDisplaySchema, publicEventPriceDisplaySchema, publicEventTicketTypePriceDisplaySchema, publicEventAttendanceModeSchema, publicEventAttendanceModeAvailabilitySchema, publicEventTicketTypeAvailabilitySchema, publicEventTicketTypeSchema, publicEventPricingSchema, publicTeamMemberSummarySchema, publicEventSchema, publicEventsArraySchema;
|
|
2079
2088
|
var init_schemas2 = __esm({
|
|
2080
2089
|
"../blocks/src/system/blocks/events/shared/schemas.ts"() {
|
|
2081
2090
|
"use strict";
|
|
@@ -2086,6 +2095,18 @@ var init_schemas2 = __esm({
|
|
|
2086
2095
|
eventPresetSchema = z6.enum(["event", "class", "workshop", "retreat", "performance"]);
|
|
2087
2096
|
eventScheduleScopeSchema = z6.enum(["recurring", "oneOff"]);
|
|
2088
2097
|
eventDestinationModeSchema = z6.enum(["cms-managed", "system-managed"]);
|
|
2098
|
+
publicEventDestinationSchema = z6.discriminatedUnion("kind", [
|
|
2099
|
+
z6.object({
|
|
2100
|
+
kind: z6.literal("native"),
|
|
2101
|
+
mode: eventDestinationModeSchema,
|
|
2102
|
+
path: z6.string()
|
|
2103
|
+
}),
|
|
2104
|
+
z6.object({
|
|
2105
|
+
kind: z6.literal("external"),
|
|
2106
|
+
url: z6.string(),
|
|
2107
|
+
label: z6.string()
|
|
2108
|
+
})
|
|
2109
|
+
]);
|
|
2089
2110
|
eventVenueSchema = z6.object({
|
|
2090
2111
|
id: z6.string(),
|
|
2091
2112
|
name: z6.string(),
|
|
@@ -2100,7 +2121,7 @@ var init_schemas2 = __esm({
|
|
|
2100
2121
|
name: z6.string(),
|
|
2101
2122
|
color: z6.string().nullable()
|
|
2102
2123
|
});
|
|
2103
|
-
pricingTypeSchema = z6.enum(["free", "paid"]);
|
|
2124
|
+
pricingTypeSchema = z6.enum(["free", "paid", "external"]);
|
|
2104
2125
|
accessRestrictionSchema = z6.enum(["none", "category"]);
|
|
2105
2126
|
eventPricingModeSchema = z6.enum(["single", "ticket_types"]);
|
|
2106
2127
|
publicCoursePriceDisplaySchema = z6.discriminatedUnion("kind", [
|
|
@@ -2121,6 +2142,7 @@ var init_schemas2 = __esm({
|
|
|
2121
2142
|
currency: z6.string()
|
|
2122
2143
|
}),
|
|
2123
2144
|
z6.object({ kind: z6.literal("unavailable"), currency: z6.string() }),
|
|
2145
|
+
z6.object({ kind: z6.literal("external"), label: z6.string() }),
|
|
2124
2146
|
z6.object({ kind: z6.literal("course"), display: publicCoursePriceDisplaySchema })
|
|
2125
2147
|
]);
|
|
2126
2148
|
publicEventTicketTypePriceDisplaySchema = z6.union([
|
|
@@ -2199,6 +2221,10 @@ var init_schemas2 = __esm({
|
|
|
2199
2221
|
z6.object({
|
|
2200
2222
|
kind: z6.literal("course"),
|
|
2201
2223
|
display: z6.object({ kind: z6.literal("course"), display: publicCoursePriceDisplaySchema })
|
|
2224
|
+
}),
|
|
2225
|
+
z6.object({
|
|
2226
|
+
kind: z6.literal("external"),
|
|
2227
|
+
display: z6.object({ kind: z6.literal("external"), label: z6.string() })
|
|
2202
2228
|
})
|
|
2203
2229
|
]);
|
|
2204
2230
|
publicTeamMemberSummarySchema = z6.object({
|
|
@@ -2227,7 +2253,8 @@ var init_schemas2 = __esm({
|
|
|
2227
2253
|
image: mediaSchema.nullable().optional()
|
|
2228
2254
|
}).optional(),
|
|
2229
2255
|
slug: z6.string(),
|
|
2230
|
-
path: z6.string(),
|
|
2256
|
+
path: z6.string().nullable(),
|
|
2257
|
+
destination: publicEventDestinationSchema,
|
|
2231
2258
|
requiresRegistration: z6.boolean(),
|
|
2232
2259
|
deliveryMode: z6.enum(["in_person", "online", "hybrid"]),
|
|
2233
2260
|
attendanceModes: z6.array(publicEventAttendanceModeAvailabilitySchema),
|
|
@@ -24413,7 +24440,7 @@ function formatCalendarTitle(viewDate, view, days, monthNames = MONTH_NAMES) {
|
|
|
24413
24440
|
if (view === "week") {
|
|
24414
24441
|
const weekStart = days[0];
|
|
24415
24442
|
const weekEnd = days[6];
|
|
24416
|
-
if (
|
|
24443
|
+
if (weekStart === void 0 || weekEnd === void 0) {
|
|
24417
24444
|
return `${monthNames[viewDate.getMonth()] ?? ""} ${viewDate.getFullYear()}`;
|
|
24418
24445
|
}
|
|
24419
24446
|
const startMonth = monthNames[weekStart.getMonth()] ?? "";
|
|
@@ -24545,7 +24572,9 @@ function getLocalDateKey(isoTimestamp, timeZone) {
|
|
|
24545
24572
|
const year = parts.find((part) => part.type === "year")?.value;
|
|
24546
24573
|
const month = parts.find((part) => part.type === "month")?.value;
|
|
24547
24574
|
const day = parts.find((part) => part.type === "day")?.value;
|
|
24548
|
-
if (
|
|
24575
|
+
if (year === void 0 || year.length === 0) return null;
|
|
24576
|
+
if (month === void 0 || month.length === 0) return null;
|
|
24577
|
+
if (day === void 0 || day.length === 0) return null;
|
|
24549
24578
|
return `${year}-${month}-${day}`;
|
|
24550
24579
|
}
|
|
24551
24580
|
function isValidTimeZone2(timeZone) {
|
|
@@ -24802,7 +24831,7 @@ function enumerateDateKeys(startDateKey, endDateKey) {
|
|
|
24802
24831
|
}
|
|
24803
24832
|
function parseDateKey(dateKey) {
|
|
24804
24833
|
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(dateKey);
|
|
24805
|
-
if (
|
|
24834
|
+
if (match === null) {
|
|
24806
24835
|
throw new Error(`Invalid timetable date key: ${dateKey}`);
|
|
24807
24836
|
}
|
|
24808
24837
|
const [, year, month, day] = match;
|
|
@@ -24838,7 +24867,7 @@ function groupItemsByDate(items, accessors) {
|
|
|
24838
24867
|
const dateKey = getLocalDateKey(startsAt, timeZone);
|
|
24839
24868
|
if (dateKey == null) continue;
|
|
24840
24869
|
const existing = grouped.get(dateKey);
|
|
24841
|
-
if (existing) {
|
|
24870
|
+
if (existing !== void 0) {
|
|
24842
24871
|
existing.push(item);
|
|
24843
24872
|
} else {
|
|
24844
24873
|
grouped.set(dateKey, [item]);
|
|
@@ -24880,11 +24909,45 @@ var init_eventCapacity = __esm({
|
|
|
24880
24909
|
}
|
|
24881
24910
|
});
|
|
24882
24911
|
|
|
24912
|
+
// ../blocks/src/system/runtime/nodes/events/shared/destination.ts
|
|
24913
|
+
function isRecord5(value) {
|
|
24914
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
24915
|
+
}
|
|
24916
|
+
function isRuntimeEventDestination(value) {
|
|
24917
|
+
if (!isRecord5(value) || typeof value.kind !== "string") return false;
|
|
24918
|
+
if (value.kind === "native") {
|
|
24919
|
+
return (value.mode === "cms-managed" || value.mode === "system-managed") && typeof value.path === "string";
|
|
24920
|
+
}
|
|
24921
|
+
return value.kind === "external" && typeof value.url === "string" && typeof value.label === "string";
|
|
24922
|
+
}
|
|
24923
|
+
function resolveRuntimeEventDestination(event) {
|
|
24924
|
+
if (isRuntimeEventDestination(event.destination)) {
|
|
24925
|
+
return event.destination;
|
|
24926
|
+
}
|
|
24927
|
+
return {
|
|
24928
|
+
kind: "native",
|
|
24929
|
+
mode: event.eventDestinationMode === "system-managed" ? "system-managed" : "cms-managed",
|
|
24930
|
+
path: typeof event.path === "string" ? event.path : ""
|
|
24931
|
+
};
|
|
24932
|
+
}
|
|
24933
|
+
var init_destination = __esm({
|
|
24934
|
+
"../blocks/src/system/runtime/nodes/events/shared/destination.ts"() {
|
|
24935
|
+
"use strict";
|
|
24936
|
+
}
|
|
24937
|
+
});
|
|
24938
|
+
|
|
24883
24939
|
// ../blocks/src/system/runtime/nodes/events/shared/pricing.ts
|
|
24884
24940
|
function resolveRuntimeEventPricing(event) {
|
|
24885
24941
|
if (isPublicEventPricing(event.pricing)) {
|
|
24886
24942
|
return event.pricing;
|
|
24887
24943
|
}
|
|
24944
|
+
const destination = resolveRuntimeEventDestination(event);
|
|
24945
|
+
if (destination.kind === "external") {
|
|
24946
|
+
return {
|
|
24947
|
+
kind: "external",
|
|
24948
|
+
display: { kind: "external", label: "External registration" }
|
|
24949
|
+
};
|
|
24950
|
+
}
|
|
24888
24951
|
const legacy = event;
|
|
24889
24952
|
const currency = readCurrency(legacy.currency);
|
|
24890
24953
|
if (event.requiresRegistration === false) {
|
|
@@ -24921,22 +24984,22 @@ function resolveRuntimeEventPricing(event) {
|
|
|
24921
24984
|
function readCurrency(value) {
|
|
24922
24985
|
return typeof value === "string" && value.trim().length > 0 ? value : DEFAULT_EVENT_CURRENCY;
|
|
24923
24986
|
}
|
|
24924
|
-
function
|
|
24987
|
+
function isRecord6(value) {
|
|
24925
24988
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
24926
24989
|
}
|
|
24927
24990
|
function isPublicEventPricing(value) {
|
|
24928
|
-
if (!
|
|
24929
|
-
return value.kind === "drop_in" || value.kind === "free_registration" || value.kind === "single_paid" || value.kind === "ticket_types" || value.kind === "course";
|
|
24991
|
+
if (!isRecord6(value) || typeof value.kind !== "string") return false;
|
|
24992
|
+
return value.kind === "drop_in" || value.kind === "free_registration" || value.kind === "single_paid" || value.kind === "ticket_types" || value.kind === "course" || value.kind === "external";
|
|
24930
24993
|
}
|
|
24931
24994
|
function isPublicEventTicketType(value) {
|
|
24932
|
-
return
|
|
24995
|
+
return isRecord6(value) && typeof value.id === "string";
|
|
24933
24996
|
}
|
|
24934
24997
|
function readTicketTypePriceDisplay(value, currency) {
|
|
24935
24998
|
const display = readLegacyPriceDisplay(value, currency);
|
|
24936
|
-
return display.kind === "course" ? { kind: "unavailable", currency } : display;
|
|
24999
|
+
return display.kind === "course" || display.kind === "external" ? { kind: "unavailable", currency } : display;
|
|
24937
25000
|
}
|
|
24938
25001
|
function readLegacyPriceDisplay(value, currency) {
|
|
24939
|
-
if (!
|
|
25002
|
+
if (!isRecord6(value) || typeof value.kind !== "string") {
|
|
24940
25003
|
return { kind: "unavailable", currency };
|
|
24941
25004
|
}
|
|
24942
25005
|
const displayCurrency = readCurrency(value.currency);
|
|
@@ -24975,7 +25038,7 @@ function readLegacyPriceDisplay(value, currency) {
|
|
|
24975
25038
|
case "unavailable":
|
|
24976
25039
|
return { kind: "unavailable", currency: displayCurrency };
|
|
24977
25040
|
case "course":
|
|
24978
|
-
return
|
|
25041
|
+
return isRecord6(value.display) ? {
|
|
24979
25042
|
kind: "course",
|
|
24980
25043
|
display: readCoursePriceDisplay(value.display, displayCurrency)
|
|
24981
25044
|
} : {
|
|
@@ -25013,6 +25076,7 @@ var DEFAULT_EVENT_CURRENCY;
|
|
|
25013
25076
|
var init_pricing = __esm({
|
|
25014
25077
|
"../blocks/src/system/runtime/nodes/events/shared/pricing.ts"() {
|
|
25015
25078
|
"use strict";
|
|
25079
|
+
init_destination();
|
|
25016
25080
|
DEFAULT_EVENT_CURRENCY = "USD";
|
|
25017
25081
|
}
|
|
25018
25082
|
});
|
|
@@ -25135,16 +25199,28 @@ function formatEventPrice(event) {
|
|
|
25135
25199
|
function formatEventPriceDisplay(pricing) {
|
|
25136
25200
|
return formatEventPricing(pricing, { decimals: "auto" });
|
|
25137
25201
|
}
|
|
25202
|
+
function resolveEventHref(event) {
|
|
25203
|
+
const destination = resolveRuntimeEventDestination(event);
|
|
25204
|
+
return destination.kind === "external" ? destination.url : destination.path;
|
|
25205
|
+
}
|
|
25206
|
+
function resolveEventLinkProps(event) {
|
|
25207
|
+
const href = resolveEventHref(event);
|
|
25208
|
+
const destination = resolveRuntimeEventDestination(event);
|
|
25209
|
+
return destination.kind === "external" ? { href, target: "_blank", rel: "noopener noreferrer" } : { href };
|
|
25210
|
+
}
|
|
25138
25211
|
function resolveEventCta(event, buttonText) {
|
|
25139
25212
|
const { isFull: isSoldOut } = getEventAvailability(event);
|
|
25140
|
-
const
|
|
25213
|
+
const destination = resolveRuntimeEventDestination(event);
|
|
25214
|
+
const isExternal = destination.kind === "external";
|
|
25215
|
+
const defaultButtonText = isExternal ? destination.label : event.kind === "course_session" ? "Book course" : "Book";
|
|
25141
25216
|
const effectiveButtonText = buttonText ?? defaultButtonText;
|
|
25142
|
-
|
|
25143
|
-
|
|
25217
|
+
const href = resolveEventHref(event);
|
|
25218
|
+
if (!isExternal && isSoldOut) {
|
|
25219
|
+
return { label: "Sold out", href, external: false, hidden: true };
|
|
25144
25220
|
}
|
|
25145
25221
|
const enrollmentOpen = event.kind === "course_session" ? event.course?.enrollmentOpen !== false : true;
|
|
25146
25222
|
const label = !enrollmentOpen ? "Registration closed" : effectiveButtonText;
|
|
25147
|
-
return { label, href:
|
|
25223
|
+
return { label, href, external: isExternal, hidden: false };
|
|
25148
25224
|
}
|
|
25149
25225
|
var COLUMN_CLASSES;
|
|
25150
25226
|
var init_utils3 = __esm({
|
|
@@ -25153,6 +25229,7 @@ var init_utils3 = __esm({
|
|
|
25153
25229
|
init_src();
|
|
25154
25230
|
init_src3();
|
|
25155
25231
|
init_eventCapacity();
|
|
25232
|
+
init_destination();
|
|
25156
25233
|
init_pricing();
|
|
25157
25234
|
init_src3();
|
|
25158
25235
|
init_src3();
|
|
@@ -26690,6 +26767,8 @@ var init_EventCard = __esm({
|
|
|
26690
26767
|
"a",
|
|
26691
26768
|
{
|
|
26692
26769
|
href: cta.href,
|
|
26770
|
+
target: cta.external ? "_blank" : void 0,
|
|
26771
|
+
rel: cta.external ? "noopener noreferrer" : void 0,
|
|
26693
26772
|
className: `${buttonClass} event-card-cta`,
|
|
26694
26773
|
children: cta.label
|
|
26695
26774
|
}
|
|
@@ -27026,10 +27105,19 @@ var init_EventCompactRow = __esm({
|
|
|
27026
27105
|
formattedTime,
|
|
27027
27106
|
/* @__PURE__ */ jsx8("span", { className: "event-compact-row-action-price", children: price })
|
|
27028
27107
|
] }),
|
|
27029
|
-
cta.hidden ? /* @__PURE__ */ jsx8("span", { className: "event-compact-row-status", children: cta.label }) : /* @__PURE__ */ jsxs6(
|
|
27030
|
-
|
|
27031
|
-
|
|
27032
|
-
|
|
27108
|
+
cta.hidden ? /* @__PURE__ */ jsx8("span", { className: "event-compact-row-status", children: cta.label }) : /* @__PURE__ */ jsxs6(
|
|
27109
|
+
"a",
|
|
27110
|
+
{
|
|
27111
|
+
href: cta.href,
|
|
27112
|
+
target: cta.external ? "_blank" : void 0,
|
|
27113
|
+
rel: cta.external ? "noopener noreferrer" : void 0,
|
|
27114
|
+
className: `${buttonClass} event-compact-row-cta`,
|
|
27115
|
+
children: [
|
|
27116
|
+
/* @__PURE__ */ jsx8("span", { children: cta.label }),
|
|
27117
|
+
/* @__PURE__ */ jsx8(ArrowRightIcon, { "aria-hidden": "true" })
|
|
27118
|
+
]
|
|
27119
|
+
}
|
|
27120
|
+
)
|
|
27033
27121
|
] })
|
|
27034
27122
|
] })
|
|
27035
27123
|
] });
|
|
@@ -27932,7 +28020,7 @@ function resolveEventRequiresPayment(input) {
|
|
|
27932
28020
|
if (!input.event) {
|
|
27933
28021
|
return false;
|
|
27934
28022
|
}
|
|
27935
|
-
return publicEventPricingType(resolveRuntimeEventPricing(input.event))
|
|
28023
|
+
return publicEventPricingType(resolveRuntimeEventPricing(input.event)) === "paid";
|
|
27936
28024
|
}
|
|
27937
28025
|
function resolveDiscountContext(input) {
|
|
27938
28026
|
const selection = input.paymentSelection.method ? input.paymentSelection : null;
|
|
@@ -28064,15 +28152,16 @@ function buildEventRegistrationShellBodyText(stepLabels) {
|
|
|
28064
28152
|
return "Preparing dates, tickets, and booking details.";
|
|
28065
28153
|
}
|
|
28066
28154
|
function normalizeEventRegistrationEventInput(value) {
|
|
28067
|
-
if (!
|
|
28155
|
+
if (!isRecord7(value)) {
|
|
28068
28156
|
return value;
|
|
28069
28157
|
}
|
|
28070
28158
|
return {
|
|
28071
28159
|
...value,
|
|
28160
|
+
destination: resolveRuntimeEventDestination(value),
|
|
28072
28161
|
pricing: resolveRuntimeEventPricing(value)
|
|
28073
28162
|
};
|
|
28074
28163
|
}
|
|
28075
|
-
function
|
|
28164
|
+
function isRecord7(value) {
|
|
28076
28165
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
28077
28166
|
}
|
|
28078
28167
|
function buildEventRegistrationInteractiveIslandProps(props2) {
|
|
@@ -28098,6 +28187,7 @@ var init_event_registration_interactive = __esm({
|
|
|
28098
28187
|
init_event_registration_shared();
|
|
28099
28188
|
init_events();
|
|
28100
28189
|
init_pricing();
|
|
28190
|
+
init_destination();
|
|
28101
28191
|
init_islands();
|
|
28102
28192
|
init_runtime();
|
|
28103
28193
|
init_contract_schemas();
|
|
@@ -28565,7 +28655,7 @@ function deriveNewsletterSignupRuntimeSource(values) {
|
|
|
28565
28655
|
};
|
|
28566
28656
|
}
|
|
28567
28657
|
function sanitizeNewsletterSignupPublicContent(content) {
|
|
28568
|
-
if (!
|
|
28658
|
+
if (!isRecord8(content)) return content;
|
|
28569
28659
|
const provider = parseNewsletterSignupDestinationProvider(content.destinationProvider) ?? getProviderFromExplicitDestination(content.destination);
|
|
28570
28660
|
const {
|
|
28571
28661
|
destination: _destination,
|
|
@@ -28584,7 +28674,7 @@ function sanitizeNewsletterSignupPublicContent(content) {
|
|
|
28584
28674
|
return mutablePublicContent;
|
|
28585
28675
|
}
|
|
28586
28676
|
function getProviderFromExplicitDestination(destination) {
|
|
28587
|
-
if (!
|
|
28677
|
+
if (!isRecord8(destination) || typeof destination.tag !== "string") return null;
|
|
28588
28678
|
if (destination.tag === "riverbank_list") return "riverbank";
|
|
28589
28679
|
if (destination.tag === "mailchimp_audience") return "mailchimp";
|
|
28590
28680
|
return null;
|
|
@@ -28594,7 +28684,7 @@ function parseTrimmedString(value) {
|
|
|
28594
28684
|
const trimmed = value.trim();
|
|
28595
28685
|
return trimmed.length > 0 ? trimmed : null;
|
|
28596
28686
|
}
|
|
28597
|
-
function
|
|
28687
|
+
function isRecord8(value) {
|
|
28598
28688
|
return typeof value === "object" && value !== null;
|
|
28599
28689
|
}
|
|
28600
28690
|
var BLOCK_ID_PATTERN, SIGNED_DESTINATION_REF_PATTERN;
|
|
@@ -31391,7 +31481,7 @@ var init_embla_carousel_autoplay_esm = __esm({
|
|
|
31391
31481
|
function isObject(subject) {
|
|
31392
31482
|
return Object.prototype.toString.call(subject) === "[object Object]";
|
|
31393
31483
|
}
|
|
31394
|
-
function
|
|
31484
|
+
function isRecord9(subject) {
|
|
31395
31485
|
return isObject(subject) || Array.isArray(subject);
|
|
31396
31486
|
}
|
|
31397
31487
|
function canUseDOM() {
|
|
@@ -31408,7 +31498,7 @@ function areOptionsEqual(optionsA, optionsB) {
|
|
|
31408
31498
|
const valueA = optionsA[key];
|
|
31409
31499
|
const valueB = optionsB[key];
|
|
31410
31500
|
if (typeof valueA === "function") return `${valueA}` === `${valueB}`;
|
|
31411
|
-
if (!
|
|
31501
|
+
if (!isRecord9(valueA) || !isRecord9(valueB)) return valueA === valueB;
|
|
31412
31502
|
return areOptionsEqual(valueA, valueB);
|
|
31413
31503
|
});
|
|
31414
31504
|
}
|
|
@@ -34264,7 +34354,7 @@ function encodePublicProductCategorySelector(selector) {
|
|
|
34264
34354
|
};
|
|
34265
34355
|
}
|
|
34266
34356
|
}
|
|
34267
|
-
function
|
|
34357
|
+
function isRecord10(value) {
|
|
34268
34358
|
return typeof value === "object" && value !== null;
|
|
34269
34359
|
}
|
|
34270
34360
|
function isJsonResponseContentType(contentType) {
|
|
@@ -34287,10 +34377,10 @@ async function parseJsonBody(response) {
|
|
|
34287
34377
|
}
|
|
34288
34378
|
}
|
|
34289
34379
|
function getBlockApiErrorDetails(data) {
|
|
34290
|
-
if (!
|
|
34380
|
+
if (!isRecord10(data)) {
|
|
34291
34381
|
return {};
|
|
34292
34382
|
}
|
|
34293
|
-
const nestedError =
|
|
34383
|
+
const nestedError = isRecord10(data.error) ? data.error : void 0;
|
|
34294
34384
|
const message = typeof nestedError?.message === "string" ? nestedError.message : typeof data.message === "string" ? data.message : void 0;
|
|
34295
34385
|
const code = typeof nestedError?.code === "string" ? nestedError.code : typeof data.code === "string" ? data.code : void 0;
|
|
34296
34386
|
return { message, code };
|
|
@@ -37800,22 +37890,22 @@ function AltchaWidget({
|
|
|
37800
37890
|
if (typeof window === "undefined") return;
|
|
37801
37891
|
let widget = null;
|
|
37802
37892
|
Promise.resolve().then(() => (init_altcha(), altcha_exports)).then(() => {
|
|
37803
|
-
if (
|
|
37893
|
+
if (containerRef.current === null) return;
|
|
37804
37894
|
widget = document.createElement("altcha-widget");
|
|
37805
37895
|
widget.setAttribute("challengeurl", challengeUrl);
|
|
37806
|
-
if (auto) {
|
|
37896
|
+
if (auto === true) {
|
|
37807
37897
|
widget.setAttribute("auto", "onload");
|
|
37808
37898
|
}
|
|
37809
|
-
if (hidelogo) {
|
|
37899
|
+
if (hidelogo === true) {
|
|
37810
37900
|
widget.setAttribute("hidelogo", "true");
|
|
37811
37901
|
}
|
|
37812
37902
|
widget.setAttribute("hidefooter", "true");
|
|
37813
|
-
if (className) {
|
|
37903
|
+
if (className !== void 0 && className.length > 0) {
|
|
37814
37904
|
widget.className = className;
|
|
37815
37905
|
}
|
|
37816
37906
|
widget.addEventListener("statechange", ((event) => {
|
|
37817
37907
|
const { state, payload } = event.detail;
|
|
37818
|
-
if (state === "verified" && payload) {
|
|
37908
|
+
if (state === "verified" && payload !== void 0 && payload.length > 0) {
|
|
37819
37909
|
onSolutionChange?.(payload);
|
|
37820
37910
|
} else if (state === "error" || state === "expired") {
|
|
37821
37911
|
onSolutionChange?.(null);
|
|
@@ -37826,7 +37916,7 @@ function AltchaWidget({
|
|
|
37826
37916
|
console.error("Failed to load ALTCHA widget:", err4);
|
|
37827
37917
|
});
|
|
37828
37918
|
return () => {
|
|
37829
|
-
if (widget && containerRef.current) {
|
|
37919
|
+
if (widget !== null && containerRef.current !== null) {
|
|
37830
37920
|
containerRef.current.removeChild(widget);
|
|
37831
37921
|
}
|
|
37832
37922
|
};
|
|
@@ -37872,15 +37962,15 @@ var init_dist2 = __esm({
|
|
|
37872
37962
|
// ../altcha/src/index.ts
|
|
37873
37963
|
function getCmsApiUrl() {
|
|
37874
37964
|
const env = process.env.RIVERBANK_ENV;
|
|
37875
|
-
if (env) {
|
|
37965
|
+
if (env !== void 0 && env.length > 0) {
|
|
37876
37966
|
const envKey = `RIVERBANK_${env.toUpperCase()}_DASHBOARD_URL`;
|
|
37877
37967
|
const dashboardUrl2 = process.env[envKey];
|
|
37878
|
-
if (dashboardUrl2) {
|
|
37968
|
+
if (dashboardUrl2 !== void 0 && dashboardUrl2.length > 0) {
|
|
37879
37969
|
return `${dashboardUrl2.replace(/\/$/, "")}/api`;
|
|
37880
37970
|
}
|
|
37881
37971
|
}
|
|
37882
37972
|
const dashboardUrl = process.env.NEXT_PUBLIC_DASHBOARD_URL;
|
|
37883
|
-
if (dashboardUrl) {
|
|
37973
|
+
if (dashboardUrl !== void 0 && dashboardUrl.length > 0) {
|
|
37884
37974
|
return `${dashboardUrl.replace(/\/$/, "")}/api`;
|
|
37885
37975
|
}
|
|
37886
37976
|
throw new Error("Dashboard URL not configured. Set NEXT_PUBLIC_DASHBOARD_URL");
|
|
@@ -39229,8 +39319,10 @@ function buildBookingPaymentOptionViewModel(input) {
|
|
|
39229
39319
|
totalAmountCents: input.totalCents,
|
|
39230
39320
|
config: input.option.config
|
|
39231
39321
|
});
|
|
39322
|
+
const remainingBalance = Math.max(0, input.totalCents - dueToday);
|
|
39232
39323
|
const formattedTotal = formatPrice(input.totalCents, input.currency, input.locale);
|
|
39233
39324
|
const formattedDueToday = formatPrice(dueToday, input.currency, input.locale);
|
|
39325
|
+
const formattedRemainingBalance = formatPrice(remainingBalance, input.currency, input.locale);
|
|
39234
39326
|
const dueAt = resolveFlexibleBalanceDueAt({
|
|
39235
39327
|
bookingStartAt: input.bookingStartAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
39236
39328
|
dueDateRule: input.option.config.dueDateRule
|
|
@@ -39247,6 +39339,7 @@ function buildBookingPaymentOptionViewModel(input) {
|
|
|
39247
39339
|
summaryRows: [
|
|
39248
39340
|
{ label: "Total", value: formattedTotal },
|
|
39249
39341
|
{ label: "Due today", value: formattedDueToday },
|
|
39342
|
+
{ label: "Remaining balance", value: formattedRemainingBalance },
|
|
39250
39343
|
{ label: "Balance due by", value: formatScheduleDate(dueAt, input.locale) },
|
|
39251
39344
|
{
|
|
39252
39345
|
label: "Deposit policy",
|
|
@@ -44377,6 +44470,33 @@ function toEventDirectPaymentOption(option, mode) {
|
|
|
44377
44470
|
);
|
|
44378
44471
|
}
|
|
44379
44472
|
}
|
|
44473
|
+
function resolveEventRegistrationDirectPaymentSelection(input) {
|
|
44474
|
+
if (input.selection.method !== "stripe") {
|
|
44475
|
+
return { kind: "not-stripe" };
|
|
44476
|
+
}
|
|
44477
|
+
const fallbackOption = input.options[0];
|
|
44478
|
+
if (!fallbackOption) {
|
|
44479
|
+
return { kind: "unavailable" };
|
|
44480
|
+
}
|
|
44481
|
+
const requestedKind = input.selection.collectionOptionKind;
|
|
44482
|
+
const selectedOption = requestedKind == null ? input.options.find((option) => option.kind === "upfront") : input.options.find((option) => option.kind === requestedKind);
|
|
44483
|
+
if (selectedOption) {
|
|
44484
|
+
return {
|
|
44485
|
+
kind: "valid",
|
|
44486
|
+
selection: {
|
|
44487
|
+
method: "stripe",
|
|
44488
|
+
collectionOptionKind: selectedOption.kind
|
|
44489
|
+
}
|
|
44490
|
+
};
|
|
44491
|
+
}
|
|
44492
|
+
return {
|
|
44493
|
+
kind: "invalid",
|
|
44494
|
+
fallbackSelection: {
|
|
44495
|
+
method: "stripe",
|
|
44496
|
+
collectionOptionKind: fallbackOption.kind
|
|
44497
|
+
}
|
|
44498
|
+
};
|
|
44499
|
+
}
|
|
44380
44500
|
var DEFAULT_EVENT_DIRECT_PAYMENT_OPTION;
|
|
44381
44501
|
var init_eventPaymentOptions = __esm({
|
|
44382
44502
|
"../blocks/src/system/runtime/nodes/event-registration/eventPaymentOptions.ts"() {
|
|
@@ -44436,6 +44556,9 @@ function formatDirectPaymentOptionDetail(option) {
|
|
|
44436
44556
|
balanceDueBy ? `Balance due by: ${balanceDueBy.value}` : null
|
|
44437
44557
|
].filter((part) => Boolean(part)).join(" \xB7 ");
|
|
44438
44558
|
}
|
|
44559
|
+
function isDirectPaymentOptionSelected(option, selectionState) {
|
|
44560
|
+
return selectionState.kind === "valid" && selectionState.selection.collectionOptionKind === option.kind;
|
|
44561
|
+
}
|
|
44439
44562
|
var PaymentSelectionStep;
|
|
44440
44563
|
var init_PaymentSelectionStep = __esm({
|
|
44441
44564
|
"../blocks/src/system/runtime/nodes/event-registration/PaymentSelectionStep.tsx"() {
|
|
@@ -44464,8 +44587,28 @@ var init_PaymentSelectionStep = __esm({
|
|
|
44464
44587
|
}) => {
|
|
44465
44588
|
const occurrenceId = occurrenceContext?.id ?? event?.registrationOccurrenceId;
|
|
44466
44589
|
const selectedMethod = selectedSelection.method;
|
|
44590
|
+
const totalPrice = eligibility?.price ? eligibility.price * ticketsCount : 0;
|
|
44591
|
+
const canShowDirectPaymentOptions = Boolean(
|
|
44592
|
+
eligibility?.eligible && eligibility.canPayDirectly && eligibility.price
|
|
44593
|
+
);
|
|
44594
|
+
const directPaymentOptions = eligibility && canShowDirectPaymentOptions ? buildEventRegistrationPaymentOptionsViewModel({
|
|
44595
|
+
eventTitle: event?.title ?? "Event",
|
|
44596
|
+
paymentTerms: event?.paymentTerms,
|
|
44597
|
+
totalPriceCents: totalPrice,
|
|
44598
|
+
currency: eligibility.currency,
|
|
44599
|
+
startsAt: occurrenceContext?.startsAt ?? event?.startsAt
|
|
44600
|
+
}).options : [];
|
|
44601
|
+
const directPaymentSelectionState = resolveEventRegistrationDirectPaymentSelection({
|
|
44602
|
+
options: directPaymentOptions,
|
|
44603
|
+
selection: selectedSelection
|
|
44604
|
+
});
|
|
44605
|
+
const directPaymentFallbackSelection = directPaymentSelectionState.kind === "invalid" ? directPaymentSelectionState.fallbackSelection : null;
|
|
44606
|
+
const directPaymentFallbackKind = directPaymentFallbackSelection?.collectionOptionKind;
|
|
44467
44607
|
const canContinue = (() => {
|
|
44468
44608
|
if (!selectedMethod) return false;
|
|
44609
|
+
if (selectedMethod === "stripe") {
|
|
44610
|
+
return directPaymentSelectionState.kind === "valid";
|
|
44611
|
+
}
|
|
44469
44612
|
if (selectedMethod === "pass") return Boolean(selectedSelection.passId);
|
|
44470
44613
|
if (selectedMethod === "membership")
|
|
44471
44614
|
return Boolean(selectedSelection.membershipId);
|
|
@@ -44475,6 +44618,13 @@ var init_PaymentSelectionStep = __esm({
|
|
|
44475
44618
|
return Boolean(selectedSelection.bundleMembershipId);
|
|
44476
44619
|
return true;
|
|
44477
44620
|
})();
|
|
44621
|
+
useEffect12(() => {
|
|
44622
|
+
if (!directPaymentFallbackKind) return;
|
|
44623
|
+
onSelectionChange({
|
|
44624
|
+
method: "stripe",
|
|
44625
|
+
collectionOptionKind: directPaymentFallbackKind
|
|
44626
|
+
});
|
|
44627
|
+
}, [directPaymentFallbackKind, onSelectionChange]);
|
|
44478
44628
|
const getButtonText = useCallback7(() => {
|
|
44479
44629
|
if (selectedMethod === "stripe") return "Continue to Payment";
|
|
44480
44630
|
if (selectedMethod === "pass_bundle" || selectedMethod === "membership_bundle") {
|
|
@@ -44574,25 +44724,20 @@ var init_PaymentSelectionStep = __esm({
|
|
|
44574
44724
|
] }) })
|
|
44575
44725
|
] });
|
|
44576
44726
|
}
|
|
44577
|
-
const totalPrice = eligibility.price ? eligibility.price * ticketsCount : 0;
|
|
44578
|
-
const directPaymentOptions = buildEventRegistrationPaymentOptionsViewModel({
|
|
44579
|
-
eventTitle: event?.title ?? "Event",
|
|
44580
|
-
paymentTerms: event?.paymentTerms,
|
|
44581
|
-
totalPriceCents: totalPrice,
|
|
44582
|
-
currency: eligibility.currency,
|
|
44583
|
-
startsAt: occurrenceContext?.startsAt ?? event?.startsAt
|
|
44584
|
-
}).options;
|
|
44585
44727
|
const isMultiTicket = areEntitlementsDisabledForTicketCount(ticketsCount);
|
|
44586
44728
|
return /* @__PURE__ */ jsxs33("div", { className: "er-stack", children: [
|
|
44587
44729
|
/* @__PURE__ */ jsx47("h3", { className: "er-title", children: "Payment Options" }),
|
|
44588
44730
|
/* @__PURE__ */ jsxs33("div", { className: "er-payment-tiles", children: [
|
|
44589
|
-
|
|
44731
|
+
canShowDirectPaymentOptions && /* @__PURE__ */ jsx47(Fragment9, { children: directPaymentOptions.map((option) => /* @__PURE__ */ jsx47(
|
|
44590
44732
|
PaymentTile,
|
|
44591
44733
|
{
|
|
44592
44734
|
icon: /* @__PURE__ */ jsx47(CreditCard, { size: 24, "aria-hidden": "true" }),
|
|
44593
44735
|
label: option.label,
|
|
44594
44736
|
detail: formatDirectPaymentOptionDetail(option),
|
|
44595
|
-
selected:
|
|
44737
|
+
selected: isDirectPaymentOptionSelected(
|
|
44738
|
+
option,
|
|
44739
|
+
directPaymentSelectionState
|
|
44740
|
+
),
|
|
44596
44741
|
onClick: () => onSelectionChange({
|
|
44597
44742
|
method: "stripe",
|
|
44598
44743
|
collectionOptionKind: option.kind
|
|
@@ -45117,6 +45262,24 @@ import { Fragment as Fragment12, jsx as jsx55, jsxs as jsxs39 } from "react/jsx-
|
|
|
45117
45262
|
function isProductMethod(method) {
|
|
45118
45263
|
return method !== null && ["pass", "membership", "pass_bundle", "membership_bundle"].includes(method);
|
|
45119
45264
|
}
|
|
45265
|
+
function getSummaryRow(option, label) {
|
|
45266
|
+
return option.summaryRows.find((row) => row.label === label)?.value ?? null;
|
|
45267
|
+
}
|
|
45268
|
+
function getSelectedDirectPaymentOption(input) {
|
|
45269
|
+
const summaryEvent = input.wizard.selectedEvent ?? input.wizard.preSelectedEvent;
|
|
45270
|
+
if (!summaryEvent || input.wizard.paymentSelection.method !== "stripe") {
|
|
45271
|
+
return null;
|
|
45272
|
+
}
|
|
45273
|
+
const options = buildEventRegistrationPaymentOptionsViewModel({
|
|
45274
|
+
eventTitle: summaryEvent.title,
|
|
45275
|
+
paymentTerms: summaryEvent.paymentTerms,
|
|
45276
|
+
totalPriceCents: input.totalCents,
|
|
45277
|
+
currency: input.currency,
|
|
45278
|
+
startsAt: input.wizard.occurrenceContext?.startsAt ?? summaryEvent.startsAt
|
|
45279
|
+
}).options;
|
|
45280
|
+
const requestedKind = input.wizard.paymentSelection.collectionOptionKind ?? "upfront";
|
|
45281
|
+
return options.find((option) => option.kind === requestedKind) ?? options.find((option) => option.kind === "upfront") ?? options[0] ?? null;
|
|
45282
|
+
}
|
|
45120
45283
|
function EventRegistrationSummaryBar(props2) {
|
|
45121
45284
|
const { wizard } = props2;
|
|
45122
45285
|
const summaryEvent = wizard.selectedEvent ?? wizard.preSelectedEvent;
|
|
@@ -45131,6 +45294,18 @@ function EventRegistrationSummaryBar(props2) {
|
|
|
45131
45294
|
const autoAppliedDiscount = wizard.discountCode.trim().length > 0 ? null : wizard.autoAppliedDiscount;
|
|
45132
45295
|
const autoAppliedDiscountCents = Math.max(0, autoAppliedDiscount?.computedAmountCents ?? 0);
|
|
45133
45296
|
const discountedTotalCents = Math.max(0, subtotalCents - autoAppliedDiscountCents);
|
|
45297
|
+
const selectedDirectPaymentOption = getSelectedDirectPaymentOption({
|
|
45298
|
+
wizard,
|
|
45299
|
+
totalCents: discountedTotalCents,
|
|
45300
|
+
currency: summaryCurrency
|
|
45301
|
+
});
|
|
45302
|
+
const flexibleBalanceSummary = selectedDirectPaymentOption?.kind === "flexible_balance" ? {
|
|
45303
|
+
total: getSummaryRow(selectedDirectPaymentOption, "Total"),
|
|
45304
|
+
dueToday: getSummaryRow(selectedDirectPaymentOption, "Due today"),
|
|
45305
|
+
remainingBalance: getSummaryRow(selectedDirectPaymentOption, "Remaining balance"),
|
|
45306
|
+
balanceDueBy: getSummaryRow(selectedDirectPaymentOption, "Balance due by"),
|
|
45307
|
+
depositPolicy: getSummaryRow(selectedDirectPaymentOption, "Deposit policy")
|
|
45308
|
+
} : null;
|
|
45134
45309
|
if (!summaryTitle) return null;
|
|
45135
45310
|
const productMethod = isProductMethod(wizard.paymentSelection.method);
|
|
45136
45311
|
return /* @__PURE__ */ jsxs39(Fragment12, { children: [
|
|
@@ -45174,6 +45349,22 @@ function EventRegistrationSummaryBar(props2) {
|
|
|
45174
45349
|
summaryPrice > 0 && /* @__PURE__ */ jsx55("div", { className: "er-summary-bar-pricing", children: productMethod ? /* @__PURE__ */ jsxs39(Fragment12, { children: [
|
|
45175
45350
|
/* @__PURE__ */ jsx55("span", { className: "er-summary-bar-price er-summary-bar-price--struck", children: formatPrice(summaryPrice * wizard.ticketsCount, summaryCurrency) }),
|
|
45176
45351
|
/* @__PURE__ */ jsx55("div", { className: "er-summary-bar-included", children: wizard.paymentSelection.method === "pass" || wizard.paymentSelection.method === "pass_bundle" ? "1 pass credit" : "Included in membership" })
|
|
45352
|
+
] }) : flexibleBalanceSummary ? /* @__PURE__ */ jsxs39(Fragment12, { children: [
|
|
45353
|
+
flexibleBalanceSummary.total ? /* @__PURE__ */ jsxs39("div", { className: "er-summary-bar-product-detail", children: [
|
|
45354
|
+
"Total: ",
|
|
45355
|
+
flexibleBalanceSummary.total
|
|
45356
|
+
] }) : null,
|
|
45357
|
+
/* @__PURE__ */ jsx55("div", { className: "er-summary-bar-price", children: flexibleBalanceSummary.dueToday ?? formatPrice(discountedTotalCents, summaryCurrency) }),
|
|
45358
|
+
/* @__PURE__ */ jsx55("div", { className: "er-summary-bar-included", children: "Payable now" }),
|
|
45359
|
+
flexibleBalanceSummary.remainingBalance ? /* @__PURE__ */ jsxs39("div", { className: "er-summary-bar-product-detail", children: [
|
|
45360
|
+
"Remaining balance: ",
|
|
45361
|
+
flexibleBalanceSummary.remainingBalance,
|
|
45362
|
+
flexibleBalanceSummary.balanceDueBy ? ` due by ${flexibleBalanceSummary.balanceDueBy}` : ""
|
|
45363
|
+
] }) : null,
|
|
45364
|
+
flexibleBalanceSummary.depositPolicy ? /* @__PURE__ */ jsxs39("div", { className: "er-summary-bar-product-detail", children: [
|
|
45365
|
+
"Deposit: ",
|
|
45366
|
+
flexibleBalanceSummary.depositPolicy
|
|
45367
|
+
] }) : null
|
|
45177
45368
|
] }) : autoAppliedDiscount && autoAppliedDiscountCents > 0 ? /* @__PURE__ */ jsxs39(Fragment12, { children: [
|
|
45178
45369
|
/* @__PURE__ */ jsx55("span", { className: "er-summary-bar-price er-summary-bar-price--struck", children: formatPrice(subtotalCents, summaryCurrency) }),
|
|
45179
45370
|
/* @__PURE__ */ jsx55("div", { className: "er-summary-bar-price", children: formatPrice(discountedTotalCents, summaryCurrency) }),
|
|
@@ -45192,6 +45383,7 @@ var init_EventRegistrationSummaryBar = __esm({
|
|
|
45192
45383
|
"use client";
|
|
45193
45384
|
init_src();
|
|
45194
45385
|
init_utils5();
|
|
45386
|
+
init_eventPaymentOptions();
|
|
45195
45387
|
}
|
|
45196
45388
|
});
|
|
45197
45389
|
|
|
@@ -47336,7 +47528,7 @@ function EventDetailsView({
|
|
|
47336
47528
|
"a",
|
|
47337
47529
|
{
|
|
47338
47530
|
className: "rb-tile rb-tile--interactive",
|
|
47339
|
-
|
|
47531
|
+
...resolveEventLinkProps(e),
|
|
47340
47532
|
children: /* @__PURE__ */ jsx62(
|
|
47341
47533
|
DateTimeTile,
|
|
47342
47534
|
{
|
|
@@ -48882,7 +49074,7 @@ var init_AgendaEventCard = __esm({
|
|
|
48882
49074
|
showCapacity,
|
|
48883
49075
|
onClick
|
|
48884
49076
|
}) => {
|
|
48885
|
-
const
|
|
49077
|
+
const eventLinkProps = resolveEventLinkProps(event);
|
|
48886
49078
|
const categoryColor = event.eventCategory?.color || "rgb(var(--tb-accent))";
|
|
48887
49079
|
const price = formatEventPrice(event);
|
|
48888
49080
|
const { available, isFull } = getEventAvailability(event);
|
|
@@ -48943,7 +49135,7 @@ var init_AgendaEventCard = __esm({
|
|
|
48943
49135
|
}
|
|
48944
49136
|
);
|
|
48945
49137
|
}
|
|
48946
|
-
return /* @__PURE__ */ jsx72("a", {
|
|
49138
|
+
return /* @__PURE__ */ jsx72("a", { ...eventLinkProps, className: "event-agenda-card", children: cardContent });
|
|
48947
49139
|
};
|
|
48948
49140
|
}
|
|
48949
49141
|
});
|
|
@@ -55803,14 +55995,14 @@ function getSemanticIconComponent(name) {
|
|
|
55803
55995
|
|
|
55804
55996
|
// ../blocks/src/system/icons/value.ts
|
|
55805
55997
|
var NO_BLOCK_ICON_VALUE = { kind: "none" };
|
|
55806
|
-
function
|
|
55998
|
+
function isRecord11(value) {
|
|
55807
55999
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
55808
56000
|
}
|
|
55809
56001
|
function parseBlockIconValue(value) {
|
|
55810
56002
|
if (isSemanticIconId(value)) {
|
|
55811
56003
|
return { kind: "semantic", iconId: value };
|
|
55812
56004
|
}
|
|
55813
|
-
if (!
|
|
56005
|
+
if (!isRecord11(value)) {
|
|
55814
56006
|
return NO_BLOCK_ICON_VALUE;
|
|
55815
56007
|
}
|
|
55816
56008
|
switch (value.kind) {
|
|
@@ -55901,7 +56093,7 @@ function buildGeneratedBlockIconRenderAssetLookupFromUnknown(value) {
|
|
|
55901
56093
|
}
|
|
55902
56094
|
const inputs = [];
|
|
55903
56095
|
for (const [index, item] of value.entries()) {
|
|
55904
|
-
if (!
|
|
56096
|
+
if (!isRecord11(item)) {
|
|
55905
56097
|
return { kind: "invalid_asset_entry", index, reason: "not_object" };
|
|
55906
56098
|
}
|
|
55907
56099
|
const setId = parseGeneratedIconSetId(item.setId);
|
|
@@ -64323,7 +64515,7 @@ function inferLegacyOfferingsPreviewGroupOrder(overrides) {
|
|
|
64323
64515
|
return keys.length >= 2 ? keys : [];
|
|
64324
64516
|
}
|
|
64325
64517
|
function normalizeOfferingsPreviewContentForWrite(value) {
|
|
64326
|
-
if (!
|
|
64518
|
+
if (!isRecord12(value)) return null;
|
|
64327
64519
|
const groupOrderValue = value.groupOrder;
|
|
64328
64520
|
if (Array.isArray(groupOrderValue)) {
|
|
64329
64521
|
const normalized = normalizeOfferingsPreviewGroupOrder(groupOrderValue);
|
|
@@ -64336,7 +64528,7 @@ function normalizeOfferingsPreviewContentForWrite(value) {
|
|
|
64336
64528
|
return { ...value, groupOrder: [] };
|
|
64337
64529
|
}
|
|
64338
64530
|
const legacyOrder = inferLegacyOfferingsPreviewGroupOrder(
|
|
64339
|
-
Array.isArray(value.groupOverrides) ? value.groupOverrides.filter(
|
|
64531
|
+
Array.isArray(value.groupOverrides) ? value.groupOverrides.filter(isRecord12) : []
|
|
64340
64532
|
);
|
|
64341
64533
|
return legacyOrder.length > 0 ? { ...value, groupOrder: legacyOrder } : value;
|
|
64342
64534
|
}
|
|
@@ -64390,7 +64582,7 @@ function uniqueOfferingsPreviewSourceKeys(values) {
|
|
|
64390
64582
|
}
|
|
64391
64583
|
return keys;
|
|
64392
64584
|
}
|
|
64393
|
-
function
|
|
64585
|
+
function isRecord12(value) {
|
|
64394
64586
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
64395
64587
|
}
|
|
64396
64588
|
function mergeOrderedKeysWithDefaults(orderedKeys, defaultKeys) {
|
|
@@ -64852,7 +65044,7 @@ function isOfferingsPreviewItemLimit(value) {
|
|
|
64852
65044
|
return value === "1" || value === "2" || value === "3" || value === "4" || value === "5" || value === "6" || value === null;
|
|
64853
65045
|
}
|
|
64854
65046
|
function normalizeOfferingsPreviewGroupOverride(value) {
|
|
64855
|
-
if (!
|
|
65047
|
+
if (!isRecord13(value)) return [];
|
|
64856
65048
|
const override = {};
|
|
64857
65049
|
if (isOfferingsPreviewSourceKey(value.sourceKey) || value.sourceKey === null) {
|
|
64858
65050
|
override.sourceKey = value.sourceKey;
|
|
@@ -64884,12 +65076,12 @@ function isButtonVariant(value) {
|
|
|
64884
65076
|
return value === "primary" || value === "secondary" || value === "outline" || value === "link" || value === null;
|
|
64885
65077
|
}
|
|
64886
65078
|
function normalizeCardStylesContent(value) {
|
|
64887
|
-
return
|
|
65079
|
+
return isRecord13(value) || value === null ? value : void 0;
|
|
64888
65080
|
}
|
|
64889
65081
|
function normalizeSectionStylesContent(value) {
|
|
64890
|
-
return
|
|
65082
|
+
return isRecord13(value) || value === null ? value : void 0;
|
|
64891
65083
|
}
|
|
64892
|
-
function
|
|
65084
|
+
function isRecord13(value) {
|
|
64893
65085
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
64894
65086
|
}
|
|
64895
65087
|
|
|
@@ -68868,11 +69060,11 @@ function extractRouteUpdatedAt(candidate) {
|
|
|
68868
69060
|
}
|
|
68869
69061
|
function resolveRouteTargetForStage(routeIdValue, routes, stageInput) {
|
|
68870
69062
|
const routeId = typeof routeIdValue === "string" ? routeIdValue : null;
|
|
68871
|
-
if (
|
|
69063
|
+
if (routeId === null || routeId.length === 0 || routes === void 0) return null;
|
|
68872
69064
|
const routeEntry = routes[routeId];
|
|
68873
69065
|
if (!isRouteVisibleInStage(routeEntry, stageInput)) return null;
|
|
68874
69066
|
const href = extractRouteHref(routeEntry, stageInput);
|
|
68875
|
-
if (
|
|
69067
|
+
if (href === null) return null;
|
|
68876
69068
|
return {
|
|
68877
69069
|
routeId,
|
|
68878
69070
|
href,
|
|
@@ -69028,7 +69220,7 @@ import React33 from "react";
|
|
|
69028
69220
|
init_src();
|
|
69029
69221
|
var LINKED_CONTENT_ENTRY_META_KEY = "__rbLinkedContentEntry";
|
|
69030
69222
|
function coerceLinkedContentEntriesPayload(payload) {
|
|
69031
|
-
if (!
|
|
69223
|
+
if (!isRecord14(payload)) return payload;
|
|
69032
69224
|
const response = payload;
|
|
69033
69225
|
if (!Array.isArray(response.entries)) return payload;
|
|
69034
69226
|
const contentType = parsePublicContentTypeMeta(response.contentType);
|
|
@@ -69036,16 +69228,16 @@ function coerceLinkedContentEntriesPayload(payload) {
|
|
|
69036
69228
|
return response.entries.map((entry) => enrichLinkedContentEntry(entry, contentType));
|
|
69037
69229
|
}
|
|
69038
69230
|
function getLinkedContentEntryMeta(value) {
|
|
69039
|
-
if (!
|
|
69231
|
+
if (!isRecord14(value)) return null;
|
|
69040
69232
|
const candidate = value[LINKED_CONTENT_ENTRY_META_KEY];
|
|
69041
69233
|
return isLinkedContentEntryMeta(candidate) ? candidate : null;
|
|
69042
69234
|
}
|
|
69043
69235
|
function buildLinkedContentEditTarget(input) {
|
|
69044
69236
|
const { entry, sourceBlockId, sourceBlockKind, itemIndex } = input;
|
|
69045
|
-
if (!
|
|
69237
|
+
if (!isRecord14(entry)) return null;
|
|
69046
69238
|
const meta = getLinkedContentEntryMeta(entry);
|
|
69047
69239
|
if (!meta || meta.support.kind !== "supported") return null;
|
|
69048
|
-
const content =
|
|
69240
|
+
const content = isRecord14(entry.content) ? entry.content : {};
|
|
69049
69241
|
return {
|
|
69050
69242
|
kind: "linked-content-entry",
|
|
69051
69243
|
entryId: meta.entryId,
|
|
@@ -69095,12 +69287,12 @@ function resolveLinkedEntryInlineFieldEligibility(input) {
|
|
|
69095
69287
|
};
|
|
69096
69288
|
}
|
|
69097
69289
|
function enrichLinkedContentEntry(entry, contentType) {
|
|
69098
|
-
if (!
|
|
69290
|
+
if (!isRecord14(entry)) return entry;
|
|
69099
69291
|
const entryId = typeof entry.id === "string" ? entry.id : null;
|
|
69100
69292
|
if (!entryId) return entry;
|
|
69101
69293
|
const title = typeof entry.title === "string" && entry.title.trim().length > 0 ? entry.title : entryId;
|
|
69102
69294
|
const optimisticHash = typeof entry.optimisticHash === "string" && entry.optimisticHash.length > 0 ? entry.optimisticHash : null;
|
|
69103
|
-
const content =
|
|
69295
|
+
const content = isRecord14(entry.content) ? entry.content : {};
|
|
69104
69296
|
const meta = {
|
|
69105
69297
|
kind: "linked-content-entry",
|
|
69106
69298
|
entryId,
|
|
@@ -69196,7 +69388,7 @@ function capitalize(value) {
|
|
|
69196
69388
|
return value.charAt(0).toUpperCase() + value.slice(1).toLowerCase();
|
|
69197
69389
|
}
|
|
69198
69390
|
function parsePublicContentTypeMeta(value) {
|
|
69199
|
-
if (!
|
|
69391
|
+
if (!isRecord14(value)) return null;
|
|
69200
69392
|
if (typeof value.key !== "string" || value.key.trim().length === 0) return null;
|
|
69201
69393
|
return {
|
|
69202
69394
|
key: value.key,
|
|
@@ -69206,7 +69398,7 @@ function parsePublicContentTypeMeta(value) {
|
|
|
69206
69398
|
};
|
|
69207
69399
|
}
|
|
69208
69400
|
function parsePublicContentTypeLinkedEntryEditing(value) {
|
|
69209
|
-
if (!
|
|
69401
|
+
if (!isRecord14(value) || typeof value.kind !== "string") return null;
|
|
69210
69402
|
switch (value.kind) {
|
|
69211
69403
|
case "generic":
|
|
69212
69404
|
return { kind: "generic" };
|
|
@@ -69220,7 +69412,7 @@ function parsePublicContentTypeLinkedEntryEditing(value) {
|
|
|
69220
69412
|
}
|
|
69221
69413
|
}
|
|
69222
69414
|
function parsePublicContentTypeFieldMeta(value) {
|
|
69223
|
-
if (!
|
|
69415
|
+
if (!isRecord14(value)) return [];
|
|
69224
69416
|
if (typeof value.id !== "string" || typeof value.type !== "string") return [];
|
|
69225
69417
|
return [{
|
|
69226
69418
|
id: value.id,
|
|
@@ -69235,14 +69427,14 @@ function parseStringArray(value) {
|
|
|
69235
69427
|
return value.filter((item) => typeof item === "string");
|
|
69236
69428
|
}
|
|
69237
69429
|
function isLinkedContentEntryMeta(value) {
|
|
69238
|
-
if (!
|
|
69430
|
+
if (!isRecord14(value)) return false;
|
|
69239
69431
|
if (value.kind !== "linked-content-entry") return false;
|
|
69240
69432
|
if (typeof value.entryId !== "string") return false;
|
|
69241
69433
|
if (typeof value.contentTypeKey !== "string") return false;
|
|
69242
69434
|
if (typeof value.contentTypeLabel !== "string") return false;
|
|
69243
69435
|
if (typeof value.title !== "string") return false;
|
|
69244
69436
|
if (!(value.optimisticHash === null || typeof value.optimisticHash === "string")) return false;
|
|
69245
|
-
if (!
|
|
69437
|
+
if (!isRecord14(value.contentType)) return false;
|
|
69246
69438
|
if (!isLinkedEntryFieldSourceArray(value.fieldSources)) return false;
|
|
69247
69439
|
return isLinkedContentEditSupport(value.support);
|
|
69248
69440
|
}
|
|
@@ -69250,7 +69442,7 @@ function isLinkedEntryFieldSourceArray(value) {
|
|
|
69250
69442
|
return Array.isArray(value) && value.every(isLinkedEntryFieldSource);
|
|
69251
69443
|
}
|
|
69252
69444
|
function isLinkedEntryFieldSource(value) {
|
|
69253
|
-
if (!
|
|
69445
|
+
if (!isRecord14(value)) return false;
|
|
69254
69446
|
if (typeof value.displayPath !== "string") return false;
|
|
69255
69447
|
switch (value.kind) {
|
|
69256
69448
|
case "content-field":
|
|
@@ -69276,7 +69468,7 @@ function isLinkedEntryInlineFieldReadOnlyReason(value) {
|
|
|
69276
69468
|
}
|
|
69277
69469
|
}
|
|
69278
69470
|
function isLinkedContentEditSupport(value) {
|
|
69279
|
-
if (!
|
|
69471
|
+
if (!isRecord14(value) || typeof value.kind !== "string") return false;
|
|
69280
69472
|
switch (value.kind) {
|
|
69281
69473
|
case "supported":
|
|
69282
69474
|
return true;
|
|
@@ -69288,7 +69480,7 @@ function isLinkedContentEditSupport(value) {
|
|
|
69288
69480
|
return false;
|
|
69289
69481
|
}
|
|
69290
69482
|
}
|
|
69291
|
-
function
|
|
69483
|
+
function isRecord14(value) {
|
|
69292
69484
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
69293
69485
|
}
|
|
69294
69486
|
|
|
@@ -71937,7 +72129,7 @@ function renderCalendarSsr(display) {
|
|
|
71937
72129
|
dayEvents.slice(0, MAX_EVENTS_PER_DAY).map((event) => /* @__PURE__ */ jsxs90(
|
|
71938
72130
|
"a",
|
|
71939
72131
|
{
|
|
71940
|
-
|
|
72132
|
+
...resolveEventLinkProps(event),
|
|
71941
72133
|
className: "event-calendar-event",
|
|
71942
72134
|
title: `${event.title} at ${formatTime(event.startsAt, { timeZone: getEventTimeZone(event) })}`,
|
|
71943
72135
|
children: [
|
|
@@ -72065,7 +72257,7 @@ function renderTimetableSsr(display) {
|
|
|
72065
72257
|
day.events.length === 0 ? /* @__PURE__ */ jsx143("p", { className: "event-timetable-day-empty", children: "No classes" }) : day.events.map((cell) => /* @__PURE__ */ jsxs90(
|
|
72066
72258
|
"a",
|
|
72067
72259
|
{
|
|
72068
|
-
|
|
72260
|
+
...resolveEventLinkProps(cell.event),
|
|
72069
72261
|
className: "event-timetable-event",
|
|
72070
72262
|
title: `${cell.event.title}, ${cell.timeLabel}`,
|
|
72071
72263
|
style: {
|
|
@@ -72853,14 +73045,14 @@ function isDecoratedHeadingBlockKind(blockKind) {
|
|
|
72853
73045
|
return blockKind === "block.intro" || blockKind === "block.feature-cards" || blockKind === "block.testimonials" || blockKind === "block.faq";
|
|
72854
73046
|
}
|
|
72855
73047
|
function readVariant(blockContent) {
|
|
72856
|
-
if (!
|
|
73048
|
+
if (!isRecord15(blockContent)) return void 0;
|
|
72857
73049
|
const variant = blockContent.variant;
|
|
72858
73050
|
return typeof variant === "string" ? variant : void 0;
|
|
72859
73051
|
}
|
|
72860
73052
|
function isFaqDecoratedVariant(variant) {
|
|
72861
73053
|
return variant === "default" || variant === "question-columns";
|
|
72862
73054
|
}
|
|
72863
|
-
function
|
|
73055
|
+
function isRecord15(value) {
|
|
72864
73056
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
72865
73057
|
}
|
|
72866
73058
|
function buildHeadingDecorationWrapperClassName(className) {
|
|
@@ -97969,7 +98161,7 @@ function preset(id, verticalId, canonicalBehaviour, label, pluralLabel, descript
|
|
|
97969
98161
|
}
|
|
97970
98162
|
|
|
97971
98163
|
// ../api/src/utils/isRecord.ts
|
|
97972
|
-
function
|
|
98164
|
+
function isRecord16(value) {
|
|
97973
98165
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
97974
98166
|
}
|
|
97975
98167
|
|
|
@@ -98276,7 +98468,7 @@ function sanitizeMarks(marks) {
|
|
|
98276
98468
|
if (mark.type === "bold" || mark.type === "strong" || mark.type === "italic" || mark.type === "em") {
|
|
98277
98469
|
return [{ type: mark.type }];
|
|
98278
98470
|
}
|
|
98279
|
-
if (mark.type === "link" &&
|
|
98471
|
+
if (mark.type === "link" && isRecord16(mark.attrs) && typeof mark.attrs.href === "string") {
|
|
98280
98472
|
const attrs = { href: mark.attrs.href };
|
|
98281
98473
|
if (typeof mark.attrs.target === "string" && mark.attrs.target.trim().length > 0) {
|
|
98282
98474
|
attrs.target = mark.attrs.target;
|
|
@@ -98291,10 +98483,10 @@ function sanitizeMarks(marks) {
|
|
|
98291
98483
|
return sanitized.length > 0 ? sanitized : void 0;
|
|
98292
98484
|
}
|
|
98293
98485
|
function unwrapRichTextValue(value) {
|
|
98294
|
-
if (
|
|
98486
|
+
if (isRecord16(value) && isRecord16(value.doc)) {
|
|
98295
98487
|
return unwrapRichTextValue(value.doc);
|
|
98296
98488
|
}
|
|
98297
|
-
if (
|
|
98489
|
+
if (isRecord16(value) && value.type === "doc") {
|
|
98298
98490
|
return {
|
|
98299
98491
|
type: "doc",
|
|
98300
98492
|
content: Array.isArray(value.content) ? value.content.filter(isTipTapNodeLike).map(coerceTipTapNode) : []
|
|
@@ -98303,7 +98495,7 @@ function unwrapRichTextValue(value) {
|
|
|
98303
98495
|
return EMPTY_SITE_BANNER_BODY;
|
|
98304
98496
|
}
|
|
98305
98497
|
function isTipTapNodeLike(value) {
|
|
98306
|
-
return
|
|
98498
|
+
return isRecord16(value) && typeof value.type === "string";
|
|
98307
98499
|
}
|
|
98308
98500
|
function coerceTipTapNode(value) {
|
|
98309
98501
|
return {
|
|
@@ -98311,9 +98503,9 @@ function coerceTipTapNode(value) {
|
|
|
98311
98503
|
...Array.isArray(value.content) ? { content: value.content.filter(isTipTapNodeLike).map(coerceTipTapNode) } : {},
|
|
98312
98504
|
...typeof value.text === "string" ? { text: value.text } : {},
|
|
98313
98505
|
...Array.isArray(value.marks) ? {
|
|
98314
|
-
marks: value.marks.filter((mark) =>
|
|
98506
|
+
marks: value.marks.filter((mark) => isRecord16(mark) && typeof mark.type === "string").map((mark) => ({
|
|
98315
98507
|
type: mark.type,
|
|
98316
|
-
...
|
|
98508
|
+
...isRecord16(mark.attrs) ? { attrs: mark.attrs } : {}
|
|
98317
98509
|
}))
|
|
98318
98510
|
} : {}
|
|
98319
98511
|
};
|
|
@@ -98483,7 +98675,7 @@ var ENTRY_REF_KEYS = [
|
|
|
98483
98675
|
"entryId",
|
|
98484
98676
|
"slug"
|
|
98485
98677
|
];
|
|
98486
|
-
function
|
|
98678
|
+
function isRecord17(value) {
|
|
98487
98679
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
98488
98680
|
}
|
|
98489
98681
|
function extractManualEntryRef(item) {
|
|
@@ -98491,7 +98683,7 @@ function extractManualEntryRef(item) {
|
|
|
98491
98683
|
const trimmed = item.trim();
|
|
98492
98684
|
return trimmed.length > 0 ? trimmed : null;
|
|
98493
98685
|
}
|
|
98494
|
-
if (!
|
|
98686
|
+
if (!isRecord17(item)) return null;
|
|
98495
98687
|
for (const key of ENTRY_REF_KEYS) {
|
|
98496
98688
|
const raw = item[key];
|
|
98497
98689
|
if (typeof raw === "string" && raw.trim().length > 0) {
|
|
@@ -99012,7 +99204,7 @@ function collectMediaAssetSidecar(mediaAssets) {
|
|
|
99012
99204
|
return Array.isArray(mediaAssets) && mediaAssets.length > 0 ? mediaAssets : void 0;
|
|
99013
99205
|
}
|
|
99014
99206
|
function convertPageResponseBlock(block) {
|
|
99015
|
-
if (!
|
|
99207
|
+
if (!isRecord18(block)) {
|
|
99016
99208
|
throw new Error("Invalid block format in page API response");
|
|
99017
99209
|
}
|
|
99018
99210
|
if (typeof block.id !== "string" && block.id !== null) {
|
|
@@ -99043,20 +99235,20 @@ function buildPageOutline(input) {
|
|
|
99043
99235
|
blocks: input.blocks.map(convertPageResponseBlock)
|
|
99044
99236
|
};
|
|
99045
99237
|
}
|
|
99046
|
-
function
|
|
99238
|
+
function isRecord18(value) {
|
|
99047
99239
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
99048
99240
|
}
|
|
99049
99241
|
function readContentRecord(value) {
|
|
99050
|
-
return
|
|
99242
|
+
return isRecord18(value) ? value : void 0;
|
|
99051
99243
|
}
|
|
99052
99244
|
function readNestedContentRecord(value) {
|
|
99053
|
-
if (!
|
|
99245
|
+
if (!isRecord18(value)) return null;
|
|
99054
99246
|
return readContentRecord(value.data) ?? null;
|
|
99055
99247
|
}
|
|
99056
99248
|
function sanitizeSdkRuntimeBlockContent(blockKind, content) {
|
|
99057
99249
|
if (blockKind !== "block.newsletter-signup") return content;
|
|
99058
99250
|
const sanitized = sanitizeNewsletterSignupPublicContent(content);
|
|
99059
|
-
return
|
|
99251
|
+
return isRecord18(sanitized) ? sanitized : {};
|
|
99060
99252
|
}
|
|
99061
99253
|
function sanitizeNullableSdkRuntimeBlockContent(blockKind, content) {
|
|
99062
99254
|
return content ? sanitizeSdkRuntimeBlockContent(blockKind, content) : null;
|