@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { ApiRequestError } from './chunk-
|
|
2
|
+
import { ApiRequestError } from './chunk-ZA2S7H34.mjs';
|
|
3
3
|
import { __commonJS, __export, __toESM } from './chunk-R7POPVJR.mjs';
|
|
4
4
|
import * as React61 from 'react';
|
|
5
5
|
import React61__default, { createContext, forwardRef, useContext, createElement, useRef, useMemo, useEffect, useState, useCallback, useImperativeHandle, useLayoutEffect, memo, createRef, Component as Component$1, useDebugValue, useId as useId$1, useSyncExternalStore, isValidElement, cloneElement, useReducer, startTransition } from 'react';
|
|
@@ -209,6 +209,8 @@ function publicEventPricingType(pricing) {
|
|
|
209
209
|
case "ticket_types":
|
|
210
210
|
case "course":
|
|
211
211
|
return isFreePublicEventPriceDisplay(pricing.display) ? "free" : "paid";
|
|
212
|
+
case "external":
|
|
213
|
+
return "external";
|
|
212
214
|
}
|
|
213
215
|
}
|
|
214
216
|
function publicEventPricingCurrency(pricing) {
|
|
@@ -220,6 +222,8 @@ function publicEventPricingCurrency(pricing) {
|
|
|
220
222
|
return pricing.currency;
|
|
221
223
|
case "course":
|
|
222
224
|
return pricing.display.display.currency;
|
|
225
|
+
case "external":
|
|
226
|
+
return null;
|
|
223
227
|
}
|
|
224
228
|
}
|
|
225
229
|
function publicEventScalarPrice(pricing) {
|
|
@@ -234,6 +238,7 @@ function publicEventPricingMode(pricing) {
|
|
|
234
238
|
return "ticket_types";
|
|
235
239
|
case "drop_in":
|
|
236
240
|
case "course":
|
|
241
|
+
case "external":
|
|
237
242
|
return void 0;
|
|
238
243
|
}
|
|
239
244
|
}
|
|
@@ -251,6 +256,7 @@ function isFreePublicEventPriceDisplay(display) {
|
|
|
251
256
|
case "range":
|
|
252
257
|
case "mixed":
|
|
253
258
|
case "unavailable":
|
|
259
|
+
case "external":
|
|
254
260
|
return false;
|
|
255
261
|
}
|
|
256
262
|
}
|
|
@@ -281,6 +287,8 @@ function formatBookingPriceDisplay(display, options = {}) {
|
|
|
281
287
|
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)}`;
|
|
282
288
|
case "unavailable":
|
|
283
289
|
return "Pricing unavailable";
|
|
290
|
+
case "external":
|
|
291
|
+
return display.label;
|
|
284
292
|
case "course":
|
|
285
293
|
return formatCoursePriceDisplayLabel(display.display, options);
|
|
286
294
|
default:
|
|
@@ -377,10 +385,11 @@ function omitZeroAmountFutureRows(rows) {
|
|
|
377
385
|
if (rows.length <= 1) {
|
|
378
386
|
return rows;
|
|
379
387
|
}
|
|
380
|
-
const
|
|
381
|
-
if (
|
|
388
|
+
const firstRow = rows[0];
|
|
389
|
+
if (firstRow === void 0) {
|
|
382
390
|
return [];
|
|
383
391
|
}
|
|
392
|
+
const futureRows = rows.slice(1);
|
|
384
393
|
return [
|
|
385
394
|
firstRow,
|
|
386
395
|
...futureRows.filter((row) => row.amountCents > 0)
|
|
@@ -423,11 +432,11 @@ function isValidTimeZone(timeZone) {
|
|
|
423
432
|
}
|
|
424
433
|
function getSafeTimeZone(timeZone) {
|
|
425
434
|
const normalized = typeof timeZone === "string" ? timeZone.trim() : "";
|
|
426
|
-
return normalized && isValidTimeZone(normalized) ? normalized : FALLBACK_TIMEZONE;
|
|
435
|
+
return normalized.length > 0 && isValidTimeZone(normalized) ? normalized : FALLBACK_TIMEZONE;
|
|
427
436
|
}
|
|
428
437
|
function parseStrictBookingTimeZone(timeZone) {
|
|
429
438
|
const normalized = timeZone.trim();
|
|
430
|
-
if (
|
|
439
|
+
if (normalized.length === 0 || !isValidTimeZone(normalized)) {
|
|
431
440
|
return null;
|
|
432
441
|
}
|
|
433
442
|
return normalized;
|
|
@@ -514,7 +523,7 @@ function parseScheduledBookingDateTime(input) {
|
|
|
514
523
|
try {
|
|
515
524
|
const startsAt = toUtcIsoDateTimeString(input.startsAt);
|
|
516
525
|
const timeZone = parseStrictBookingTimeZone(input.timeZone);
|
|
517
|
-
if (
|
|
526
|
+
if (timeZone === null) {
|
|
518
527
|
return {
|
|
519
528
|
ok: false,
|
|
520
529
|
field: "timeZone",
|
|
@@ -653,7 +662,7 @@ function getBookingLocalDateKey(input) {
|
|
|
653
662
|
}
|
|
654
663
|
function parseBookingLocalDate(value) {
|
|
655
664
|
const match2 = LOCAL_DATE_PATTERN.exec(value.trim());
|
|
656
|
-
if (
|
|
665
|
+
if (match2 === null || match2.groups === void 0) {
|
|
657
666
|
throw new Error(`Invalid booking date format: "${value}" (expected YYYY-MM-DD)`);
|
|
658
667
|
}
|
|
659
668
|
const year = Number(match2.groups.year);
|
|
@@ -687,10 +696,10 @@ function normalizeLocationAddressText(value) {
|
|
|
687
696
|
return null;
|
|
688
697
|
}
|
|
689
698
|
const trimmed = value.trim();
|
|
690
|
-
return trimmed ? trimmed : null;
|
|
699
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
691
700
|
}
|
|
692
701
|
function hasLocationCoordinates(value) {
|
|
693
|
-
return typeof value
|
|
702
|
+
return value != null && typeof value.lat === "number" && typeof value.lng === "number";
|
|
694
703
|
}
|
|
695
704
|
function toLocationCoordinates(value) {
|
|
696
705
|
if (!hasLocationCoordinates(value)) {
|
|
@@ -60154,6 +60163,18 @@ var publicCoursesArraySchema = z.array(publicCourseSchema);
|
|
|
60154
60163
|
var eventPresetSchema = z.enum(["event", "class", "workshop", "retreat", "performance"]);
|
|
60155
60164
|
var eventScheduleScopeSchema = z.enum(["recurring", "oneOff"]);
|
|
60156
60165
|
var eventDestinationModeSchema = z.enum(["cms-managed", "system-managed"]);
|
|
60166
|
+
var publicEventDestinationSchema = z.discriminatedUnion("kind", [
|
|
60167
|
+
z.object({
|
|
60168
|
+
kind: z.literal("native"),
|
|
60169
|
+
mode: eventDestinationModeSchema,
|
|
60170
|
+
path: z.string()
|
|
60171
|
+
}),
|
|
60172
|
+
z.object({
|
|
60173
|
+
kind: z.literal("external"),
|
|
60174
|
+
url: z.string(),
|
|
60175
|
+
label: z.string()
|
|
60176
|
+
})
|
|
60177
|
+
]);
|
|
60157
60178
|
var eventVenueSchema = z.object({
|
|
60158
60179
|
id: z.string(),
|
|
60159
60180
|
name: z.string(),
|
|
@@ -60168,7 +60189,7 @@ var eventCategorySchema = z.object({
|
|
|
60168
60189
|
name: z.string(),
|
|
60169
60190
|
color: z.string().nullable()
|
|
60170
60191
|
});
|
|
60171
|
-
z.enum(["free", "paid"]);
|
|
60192
|
+
z.enum(["free", "paid", "external"]);
|
|
60172
60193
|
var accessRestrictionSchema = z.enum(["none", "category"]);
|
|
60173
60194
|
z.enum(["single", "ticket_types"]);
|
|
60174
60195
|
var publicCoursePriceDisplaySchema = z.discriminatedUnion("kind", [
|
|
@@ -60189,6 +60210,7 @@ z.discriminatedUnion("kind", [
|
|
|
60189
60210
|
currency: z.string()
|
|
60190
60211
|
}),
|
|
60191
60212
|
z.object({ kind: z.literal("unavailable"), currency: z.string() }),
|
|
60213
|
+
z.object({ kind: z.literal("external"), label: z.string() }),
|
|
60192
60214
|
z.object({ kind: z.literal("course"), display: publicCoursePriceDisplaySchema })
|
|
60193
60215
|
]);
|
|
60194
60216
|
var publicEventTicketTypePriceDisplaySchema = z.union([
|
|
@@ -60267,6 +60289,10 @@ var publicEventPricingSchema = z.discriminatedUnion("kind", [
|
|
|
60267
60289
|
z.object({
|
|
60268
60290
|
kind: z.literal("course"),
|
|
60269
60291
|
display: z.object({ kind: z.literal("course"), display: publicCoursePriceDisplaySchema })
|
|
60292
|
+
}),
|
|
60293
|
+
z.object({
|
|
60294
|
+
kind: z.literal("external"),
|
|
60295
|
+
display: z.object({ kind: z.literal("external"), label: z.string() })
|
|
60270
60296
|
})
|
|
60271
60297
|
]);
|
|
60272
60298
|
var publicTeamMemberSummarySchema = z.object({
|
|
@@ -60295,7 +60321,8 @@ var publicEventSchema = z.object({
|
|
|
60295
60321
|
image: mediaSchema2.nullable().optional()
|
|
60296
60322
|
}).optional(),
|
|
60297
60323
|
slug: z.string(),
|
|
60298
|
-
path: z.string(),
|
|
60324
|
+
path: z.string().nullable(),
|
|
60325
|
+
destination: publicEventDestinationSchema,
|
|
60299
60326
|
requiresRegistration: z.boolean(),
|
|
60300
60327
|
deliveryMode: z.enum(["in_person", "online", "hybrid"]),
|
|
60301
60328
|
attendanceModes: z.array(publicEventAttendanceModeAvailabilitySchema),
|
|
@@ -60591,12 +60618,41 @@ function isEventContentType(slug) {
|
|
|
60591
60618
|
return EVENT_CONTENT_TYPE_SLUGS.includes(slug);
|
|
60592
60619
|
}
|
|
60593
60620
|
|
|
60621
|
+
// ../blocks/src/system/runtime/nodes/events/shared/destination.ts
|
|
60622
|
+
function isRecord6(value) {
|
|
60623
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
60624
|
+
}
|
|
60625
|
+
function isRuntimeEventDestination(value) {
|
|
60626
|
+
if (!isRecord6(value) || typeof value.kind !== "string") return false;
|
|
60627
|
+
if (value.kind === "native") {
|
|
60628
|
+
return (value.mode === "cms-managed" || value.mode === "system-managed") && typeof value.path === "string";
|
|
60629
|
+
}
|
|
60630
|
+
return value.kind === "external" && typeof value.url === "string" && typeof value.label === "string";
|
|
60631
|
+
}
|
|
60632
|
+
function resolveRuntimeEventDestination(event) {
|
|
60633
|
+
if (isRuntimeEventDestination(event.destination)) {
|
|
60634
|
+
return event.destination;
|
|
60635
|
+
}
|
|
60636
|
+
return {
|
|
60637
|
+
kind: "native",
|
|
60638
|
+
mode: event.eventDestinationMode === "system-managed" ? "system-managed" : "cms-managed",
|
|
60639
|
+
path: typeof event.path === "string" ? event.path : ""
|
|
60640
|
+
};
|
|
60641
|
+
}
|
|
60642
|
+
|
|
60594
60643
|
// ../blocks/src/system/runtime/nodes/events/shared/pricing.ts
|
|
60595
60644
|
var DEFAULT_EVENT_CURRENCY = "USD";
|
|
60596
60645
|
function resolveRuntimeEventPricing(event) {
|
|
60597
60646
|
if (isPublicEventPricing(event.pricing)) {
|
|
60598
60647
|
return event.pricing;
|
|
60599
60648
|
}
|
|
60649
|
+
const destination = resolveRuntimeEventDestination(event);
|
|
60650
|
+
if (destination.kind === "external") {
|
|
60651
|
+
return {
|
|
60652
|
+
kind: "external",
|
|
60653
|
+
display: { kind: "external", label: "External registration" }
|
|
60654
|
+
};
|
|
60655
|
+
}
|
|
60600
60656
|
const legacy = event;
|
|
60601
60657
|
const currency = readCurrency(legacy.currency);
|
|
60602
60658
|
if (event.requiresRegistration === false) {
|
|
@@ -60633,22 +60689,22 @@ function resolveRuntimeEventPricing(event) {
|
|
|
60633
60689
|
function readCurrency(value) {
|
|
60634
60690
|
return typeof value === "string" && value.trim().length > 0 ? value : DEFAULT_EVENT_CURRENCY;
|
|
60635
60691
|
}
|
|
60636
|
-
function
|
|
60692
|
+
function isRecord7(value) {
|
|
60637
60693
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
60638
60694
|
}
|
|
60639
60695
|
function isPublicEventPricing(value) {
|
|
60640
|
-
if (!
|
|
60641
|
-
return value.kind === "drop_in" || value.kind === "free_registration" || value.kind === "single_paid" || value.kind === "ticket_types" || value.kind === "course";
|
|
60696
|
+
if (!isRecord7(value) || typeof value.kind !== "string") return false;
|
|
60697
|
+
return value.kind === "drop_in" || value.kind === "free_registration" || value.kind === "single_paid" || value.kind === "ticket_types" || value.kind === "course" || value.kind === "external";
|
|
60642
60698
|
}
|
|
60643
60699
|
function isPublicEventTicketType(value) {
|
|
60644
|
-
return
|
|
60700
|
+
return isRecord7(value) && typeof value.id === "string";
|
|
60645
60701
|
}
|
|
60646
60702
|
function readTicketTypePriceDisplay(value, currency) {
|
|
60647
60703
|
const display = readLegacyPriceDisplay(value, currency);
|
|
60648
|
-
return display.kind === "course" ? { kind: "unavailable", currency } : display;
|
|
60704
|
+
return display.kind === "course" || display.kind === "external" ? { kind: "unavailable", currency } : display;
|
|
60649
60705
|
}
|
|
60650
60706
|
function readLegacyPriceDisplay(value, currency) {
|
|
60651
|
-
if (!
|
|
60707
|
+
if (!isRecord7(value) || typeof value.kind !== "string") {
|
|
60652
60708
|
return { kind: "unavailable", currency };
|
|
60653
60709
|
}
|
|
60654
60710
|
const displayCurrency = readCurrency(value.currency);
|
|
@@ -60687,7 +60743,7 @@ function readLegacyPriceDisplay(value, currency) {
|
|
|
60687
60743
|
case "unavailable":
|
|
60688
60744
|
return { kind: "unavailable", currency: displayCurrency };
|
|
60689
60745
|
case "course":
|
|
60690
|
-
return
|
|
60746
|
+
return isRecord7(value.display) ? {
|
|
60691
60747
|
kind: "course",
|
|
60692
60748
|
display: readCoursePriceDisplay(value.display, displayCurrency)
|
|
60693
60749
|
} : {
|
|
@@ -60794,7 +60850,7 @@ function resolveEventRequiresPayment(input) {
|
|
|
60794
60850
|
if (!input.event) {
|
|
60795
60851
|
return false;
|
|
60796
60852
|
}
|
|
60797
|
-
return publicEventPricingType(resolveRuntimeEventPricing(input.event))
|
|
60853
|
+
return publicEventPricingType(resolveRuntimeEventPricing(input.event)) === "paid";
|
|
60798
60854
|
}
|
|
60799
60855
|
function resolveDiscountContext(input) {
|
|
60800
60856
|
const selection = input.paymentSelection.method ? input.paymentSelection : null;
|
|
@@ -61008,15 +61064,16 @@ var eventRegistrationBlockRuntime = defineClientOwnedBlockRuntime({
|
|
|
61008
61064
|
})
|
|
61009
61065
|
});
|
|
61010
61066
|
function normalizeEventRegistrationEventInput(value) {
|
|
61011
|
-
if (!
|
|
61067
|
+
if (!isRecord8(value)) {
|
|
61012
61068
|
return value;
|
|
61013
61069
|
}
|
|
61014
61070
|
return {
|
|
61015
61071
|
...value,
|
|
61072
|
+
destination: resolveRuntimeEventDestination(value),
|
|
61016
61073
|
pricing: resolveRuntimeEventPricing(value)
|
|
61017
61074
|
};
|
|
61018
61075
|
}
|
|
61019
|
-
function
|
|
61076
|
+
function isRecord8(value) {
|
|
61020
61077
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
61021
61078
|
}
|
|
61022
61079
|
function buildEventRegistrationInteractiveIslandProps(props2) {
|
|
@@ -62279,7 +62336,7 @@ function formatCalendarTitle(viewDate, view, days, monthNames = MONTH_NAMES) {
|
|
|
62279
62336
|
if (view === "week") {
|
|
62280
62337
|
const weekStart = days[0];
|
|
62281
62338
|
const weekEnd = days[6];
|
|
62282
|
-
if (
|
|
62339
|
+
if (weekStart === void 0 || weekEnd === void 0) {
|
|
62283
62340
|
return `${monthNames[viewDate.getMonth()] ?? ""} ${viewDate.getFullYear()}`;
|
|
62284
62341
|
}
|
|
62285
62342
|
const startMonth = monthNames[weekStart.getMonth()] ?? "";
|
|
@@ -62385,7 +62442,9 @@ function getLocalDateKey(isoTimestamp, timeZone) {
|
|
|
62385
62442
|
const year = parts.find((part) => part.type === "year")?.value;
|
|
62386
62443
|
const month = parts.find((part) => part.type === "month")?.value;
|
|
62387
62444
|
const day = parts.find((part) => part.type === "day")?.value;
|
|
62388
|
-
if (
|
|
62445
|
+
if (year === void 0 || year.length === 0) return null;
|
|
62446
|
+
if (month === void 0 || month.length === 0) return null;
|
|
62447
|
+
if (day === void 0 || day.length === 0) return null;
|
|
62389
62448
|
return `${year}-${month}-${day}`;
|
|
62390
62449
|
}
|
|
62391
62450
|
var validTimeZoneCache = /* @__PURE__ */ new Map();
|
|
@@ -62642,7 +62701,7 @@ function enumerateDateKeys(startDateKey, endDateKey) {
|
|
|
62642
62701
|
}
|
|
62643
62702
|
function parseDateKey(dateKey) {
|
|
62644
62703
|
const match2 = /^(\d{4})-(\d{2})-(\d{2})$/.exec(dateKey);
|
|
62645
|
-
if (
|
|
62704
|
+
if (match2 === null) {
|
|
62646
62705
|
throw new Error(`Invalid timetable date key: ${dateKey}`);
|
|
62647
62706
|
}
|
|
62648
62707
|
const [, year, month, day] = match2;
|
|
@@ -62662,7 +62721,7 @@ function groupItemsByDate(items, accessors) {
|
|
|
62662
62721
|
const dateKey = getLocalDateKey(startsAt, timeZone);
|
|
62663
62722
|
if (dateKey == null) continue;
|
|
62664
62723
|
const existing = grouped.get(dateKey);
|
|
62665
|
-
if (existing) {
|
|
62724
|
+
if (existing !== void 0) {
|
|
62666
62725
|
existing.push(item);
|
|
62667
62726
|
} else {
|
|
62668
62727
|
grouped.set(dateKey, [item]);
|
|
@@ -62806,16 +62865,28 @@ function formatEventPrice(event) {
|
|
|
62806
62865
|
function formatEventPriceDisplay(pricing) {
|
|
62807
62866
|
return formatEventPricing(pricing, { decimals: "auto" });
|
|
62808
62867
|
}
|
|
62868
|
+
function resolveEventHref(event) {
|
|
62869
|
+
const destination = resolveRuntimeEventDestination(event);
|
|
62870
|
+
return destination.kind === "external" ? destination.url : destination.path;
|
|
62871
|
+
}
|
|
62872
|
+
function resolveEventLinkProps(event) {
|
|
62873
|
+
const href = resolveEventHref(event);
|
|
62874
|
+
const destination = resolveRuntimeEventDestination(event);
|
|
62875
|
+
return destination.kind === "external" ? { href, target: "_blank", rel: "noopener noreferrer" } : { href };
|
|
62876
|
+
}
|
|
62809
62877
|
function resolveEventCta(event, buttonText) {
|
|
62810
62878
|
const { isFull: isSoldOut } = getEventAvailability(event);
|
|
62811
|
-
const
|
|
62879
|
+
const destination = resolveRuntimeEventDestination(event);
|
|
62880
|
+
const isExternal = destination.kind === "external";
|
|
62881
|
+
const defaultButtonText = isExternal ? destination.label : event.kind === "course_session" ? "Book course" : "Book";
|
|
62812
62882
|
const effectiveButtonText = buttonText ?? defaultButtonText;
|
|
62813
|
-
|
|
62814
|
-
|
|
62883
|
+
const href = resolveEventHref(event);
|
|
62884
|
+
if (!isExternal && isSoldOut) {
|
|
62885
|
+
return { label: "Sold out", href, external: false, hidden: true };
|
|
62815
62886
|
}
|
|
62816
62887
|
const enrollmentOpen = event.kind === "course_session" ? event.course?.enrollmentOpen !== false : true;
|
|
62817
62888
|
const label = !enrollmentOpen ? "Registration closed" : effectiveButtonText;
|
|
62818
|
-
return { label, href:
|
|
62889
|
+
return { label, href, external: isExternal, hidden: false };
|
|
62819
62890
|
}
|
|
62820
62891
|
|
|
62821
62892
|
// ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
@@ -64234,6 +64305,8 @@ var EventCard = ({
|
|
|
64234
64305
|
"a",
|
|
64235
64306
|
{
|
|
64236
64307
|
href: cta.href,
|
|
64308
|
+
target: cta.external ? "_blank" : void 0,
|
|
64309
|
+
rel: cta.external ? "noopener noreferrer" : void 0,
|
|
64237
64310
|
className: `${buttonClass} event-card-cta`,
|
|
64238
64311
|
children: cta.label
|
|
64239
64312
|
}
|
|
@@ -64320,10 +64393,19 @@ var EventCompactRow = ({
|
|
|
64320
64393
|
formattedTime,
|
|
64321
64394
|
/* @__PURE__ */ jsx("span", { className: "event-compact-row-action-price", children: price })
|
|
64322
64395
|
] }),
|
|
64323
|
-
cta.hidden ? /* @__PURE__ */ jsx("span", { className: "event-compact-row-status", children: cta.label }) : /* @__PURE__ */ jsxs(
|
|
64324
|
-
|
|
64325
|
-
|
|
64326
|
-
|
|
64396
|
+
cta.hidden ? /* @__PURE__ */ jsx("span", { className: "event-compact-row-status", children: cta.label }) : /* @__PURE__ */ jsxs(
|
|
64397
|
+
"a",
|
|
64398
|
+
{
|
|
64399
|
+
href: cta.href,
|
|
64400
|
+
target: cta.external ? "_blank" : void 0,
|
|
64401
|
+
rel: cta.external ? "noopener noreferrer" : void 0,
|
|
64402
|
+
className: `${buttonClass} event-compact-row-cta`,
|
|
64403
|
+
children: [
|
|
64404
|
+
/* @__PURE__ */ jsx("span", { children: cta.label }),
|
|
64405
|
+
/* @__PURE__ */ jsx(ArrowRightIcon, { "aria-hidden": "true" })
|
|
64406
|
+
]
|
|
64407
|
+
}
|
|
64408
|
+
)
|
|
64327
64409
|
] })
|
|
64328
64410
|
] })
|
|
64329
64411
|
] });
|
|
@@ -65927,7 +66009,7 @@ function inferLegacyOfferingsPreviewGroupOrder(overrides) {
|
|
|
65927
66009
|
return keys2.length >= 2 ? keys2 : [];
|
|
65928
66010
|
}
|
|
65929
66011
|
function normalizeOfferingsPreviewContentForWrite(value) {
|
|
65930
|
-
if (!
|
|
66012
|
+
if (!isRecord9(value)) return null;
|
|
65931
66013
|
const groupOrderValue = value.groupOrder;
|
|
65932
66014
|
if (Array.isArray(groupOrderValue)) {
|
|
65933
66015
|
const normalized = normalizeOfferingsPreviewGroupOrder(groupOrderValue);
|
|
@@ -65940,7 +66022,7 @@ function normalizeOfferingsPreviewContentForWrite(value) {
|
|
|
65940
66022
|
return { ...value, groupOrder: [] };
|
|
65941
66023
|
}
|
|
65942
66024
|
const legacyOrder = inferLegacyOfferingsPreviewGroupOrder(
|
|
65943
|
-
Array.isArray(value.groupOverrides) ? value.groupOverrides.filter(
|
|
66025
|
+
Array.isArray(value.groupOverrides) ? value.groupOverrides.filter(isRecord9) : []
|
|
65944
66026
|
);
|
|
65945
66027
|
return legacyOrder.length > 0 ? { ...value, groupOrder: legacyOrder } : value;
|
|
65946
66028
|
}
|
|
@@ -65994,7 +66076,7 @@ function uniqueOfferingsPreviewSourceKeys(values) {
|
|
|
65994
66076
|
}
|
|
65995
66077
|
return keys2;
|
|
65996
66078
|
}
|
|
65997
|
-
function
|
|
66079
|
+
function isRecord9(value) {
|
|
65998
66080
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
65999
66081
|
}
|
|
66000
66082
|
function mergeOrderedKeysWithDefaults(orderedKeys, defaultKeys) {
|
|
@@ -66456,7 +66538,7 @@ function isOfferingsPreviewItemLimit(value) {
|
|
|
66456
66538
|
return value === "1" || value === "2" || value === "3" || value === "4" || value === "5" || value === "6" || value === null;
|
|
66457
66539
|
}
|
|
66458
66540
|
function normalizeOfferingsPreviewGroupOverride(value) {
|
|
66459
|
-
if (!
|
|
66541
|
+
if (!isRecord10(value)) return [];
|
|
66460
66542
|
const override = {};
|
|
66461
66543
|
if (isOfferingsPreviewSourceKey(value.sourceKey) || value.sourceKey === null) {
|
|
66462
66544
|
override.sourceKey = value.sourceKey;
|
|
@@ -66488,12 +66570,12 @@ function isButtonVariant(value) {
|
|
|
66488
66570
|
return value === "primary" || value === "secondary" || value === "outline" || value === "link" || value === null;
|
|
66489
66571
|
}
|
|
66490
66572
|
function normalizeCardStylesContent(value) {
|
|
66491
|
-
return
|
|
66573
|
+
return isRecord10(value) || value === null ? value : void 0;
|
|
66492
66574
|
}
|
|
66493
66575
|
function normalizeSectionStylesContent(value) {
|
|
66494
|
-
return
|
|
66576
|
+
return isRecord10(value) || value === null ? value : void 0;
|
|
66495
66577
|
}
|
|
66496
|
-
function
|
|
66578
|
+
function isRecord10(value) {
|
|
66497
66579
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
66498
66580
|
}
|
|
66499
66581
|
var embedFields = [
|
|
@@ -71766,11 +71848,11 @@ function extractRouteUpdatedAt(candidate) {
|
|
|
71766
71848
|
}
|
|
71767
71849
|
function resolveRouteTargetForStage(routeIdValue, routes, stageInput) {
|
|
71768
71850
|
const routeId = typeof routeIdValue === "string" ? routeIdValue : null;
|
|
71769
|
-
if (
|
|
71851
|
+
if (routeId === null || routeId.length === 0 || routes === void 0) return null;
|
|
71770
71852
|
const routeEntry = routes[routeId];
|
|
71771
71853
|
if (!isRouteVisibleInStage(routeEntry, stageInput)) return null;
|
|
71772
71854
|
const href = extractRouteHref(routeEntry, stageInput);
|
|
71773
|
-
if (
|
|
71855
|
+
if (href === null) return null;
|
|
71774
71856
|
return {
|
|
71775
71857
|
routeId,
|
|
71776
71858
|
href,
|
|
@@ -71916,7 +71998,7 @@ var defaultTransforms = createTransformRegistry(builtinTransformDefinitions);
|
|
|
71916
71998
|
// ../blocks/src/system/data/linkedContentEntries.ts
|
|
71917
71999
|
var LINKED_CONTENT_ENTRY_META_KEY = "__rbLinkedContentEntry";
|
|
71918
72000
|
function coerceLinkedContentEntriesPayload(payload) {
|
|
71919
|
-
if (!
|
|
72001
|
+
if (!isRecord11(payload)) return payload;
|
|
71920
72002
|
const response = payload;
|
|
71921
72003
|
if (!Array.isArray(response.entries)) return payload;
|
|
71922
72004
|
const contentType = parsePublicContentTypeMeta(response.contentType);
|
|
@@ -71924,16 +72006,16 @@ function coerceLinkedContentEntriesPayload(payload) {
|
|
|
71924
72006
|
return response.entries.map((entry) => enrichLinkedContentEntry(entry, contentType));
|
|
71925
72007
|
}
|
|
71926
72008
|
function getLinkedContentEntryMeta(value) {
|
|
71927
|
-
if (!
|
|
72009
|
+
if (!isRecord11(value)) return null;
|
|
71928
72010
|
const candidate = value[LINKED_CONTENT_ENTRY_META_KEY];
|
|
71929
72011
|
return isLinkedContentEntryMeta(candidate) ? candidate : null;
|
|
71930
72012
|
}
|
|
71931
72013
|
function buildLinkedContentEditTarget(input) {
|
|
71932
72014
|
const { entry, sourceBlockId, sourceBlockKind, itemIndex } = input;
|
|
71933
|
-
if (!
|
|
72015
|
+
if (!isRecord11(entry)) return null;
|
|
71934
72016
|
const meta = getLinkedContentEntryMeta(entry);
|
|
71935
72017
|
if (!meta || meta.support.kind !== "supported") return null;
|
|
71936
|
-
const content =
|
|
72018
|
+
const content = isRecord11(entry.content) ? entry.content : {};
|
|
71937
72019
|
return {
|
|
71938
72020
|
kind: "linked-content-entry",
|
|
71939
72021
|
entryId: meta.entryId,
|
|
@@ -71983,12 +72065,12 @@ function resolveLinkedEntryInlineFieldEligibility(input) {
|
|
|
71983
72065
|
};
|
|
71984
72066
|
}
|
|
71985
72067
|
function enrichLinkedContentEntry(entry, contentType) {
|
|
71986
|
-
if (!
|
|
72068
|
+
if (!isRecord11(entry)) return entry;
|
|
71987
72069
|
const entryId = typeof entry.id === "string" ? entry.id : null;
|
|
71988
72070
|
if (!entryId) return entry;
|
|
71989
72071
|
const title = typeof entry.title === "string" && entry.title.trim().length > 0 ? entry.title : entryId;
|
|
71990
72072
|
const optimisticHash = typeof entry.optimisticHash === "string" && entry.optimisticHash.length > 0 ? entry.optimisticHash : null;
|
|
71991
|
-
const content =
|
|
72073
|
+
const content = isRecord11(entry.content) ? entry.content : {};
|
|
71992
72074
|
const meta = {
|
|
71993
72075
|
kind: "linked-content-entry",
|
|
71994
72076
|
entryId,
|
|
@@ -72084,7 +72166,7 @@ function capitalize(value) {
|
|
|
72084
72166
|
return value.charAt(0).toUpperCase() + value.slice(1).toLowerCase();
|
|
72085
72167
|
}
|
|
72086
72168
|
function parsePublicContentTypeMeta(value) {
|
|
72087
|
-
if (!
|
|
72169
|
+
if (!isRecord11(value)) return null;
|
|
72088
72170
|
if (typeof value.key !== "string" || value.key.trim().length === 0) return null;
|
|
72089
72171
|
return {
|
|
72090
72172
|
key: value.key,
|
|
@@ -72094,7 +72176,7 @@ function parsePublicContentTypeMeta(value) {
|
|
|
72094
72176
|
};
|
|
72095
72177
|
}
|
|
72096
72178
|
function parsePublicContentTypeLinkedEntryEditing(value) {
|
|
72097
|
-
if (!
|
|
72179
|
+
if (!isRecord11(value) || typeof value.kind !== "string") return null;
|
|
72098
72180
|
switch (value.kind) {
|
|
72099
72181
|
case "generic":
|
|
72100
72182
|
return { kind: "generic" };
|
|
@@ -72108,7 +72190,7 @@ function parsePublicContentTypeLinkedEntryEditing(value) {
|
|
|
72108
72190
|
}
|
|
72109
72191
|
}
|
|
72110
72192
|
function parsePublicContentTypeFieldMeta(value) {
|
|
72111
|
-
if (!
|
|
72193
|
+
if (!isRecord11(value)) return [];
|
|
72112
72194
|
if (typeof value.id !== "string" || typeof value.type !== "string") return [];
|
|
72113
72195
|
return [{
|
|
72114
72196
|
id: value.id,
|
|
@@ -72123,14 +72205,14 @@ function parseStringArray(value) {
|
|
|
72123
72205
|
return value.filter((item) => typeof item === "string");
|
|
72124
72206
|
}
|
|
72125
72207
|
function isLinkedContentEntryMeta(value) {
|
|
72126
|
-
if (!
|
|
72208
|
+
if (!isRecord11(value)) return false;
|
|
72127
72209
|
if (value.kind !== "linked-content-entry") return false;
|
|
72128
72210
|
if (typeof value.entryId !== "string") return false;
|
|
72129
72211
|
if (typeof value.contentTypeKey !== "string") return false;
|
|
72130
72212
|
if (typeof value.contentTypeLabel !== "string") return false;
|
|
72131
72213
|
if (typeof value.title !== "string") return false;
|
|
72132
72214
|
if (!(value.optimisticHash === null || typeof value.optimisticHash === "string")) return false;
|
|
72133
|
-
if (!
|
|
72215
|
+
if (!isRecord11(value.contentType)) return false;
|
|
72134
72216
|
if (!isLinkedEntryFieldSourceArray(value.fieldSources)) return false;
|
|
72135
72217
|
return isLinkedContentEditSupport(value.support);
|
|
72136
72218
|
}
|
|
@@ -72138,7 +72220,7 @@ function isLinkedEntryFieldSourceArray(value) {
|
|
|
72138
72220
|
return Array.isArray(value) && value.every(isLinkedEntryFieldSource);
|
|
72139
72221
|
}
|
|
72140
72222
|
function isLinkedEntryFieldSource(value) {
|
|
72141
|
-
if (!
|
|
72223
|
+
if (!isRecord11(value)) return false;
|
|
72142
72224
|
if (typeof value.displayPath !== "string") return false;
|
|
72143
72225
|
switch (value.kind) {
|
|
72144
72226
|
case "content-field":
|
|
@@ -72164,7 +72246,7 @@ function isLinkedEntryInlineFieldReadOnlyReason(value) {
|
|
|
72164
72246
|
}
|
|
72165
72247
|
}
|
|
72166
72248
|
function isLinkedContentEditSupport(value) {
|
|
72167
|
-
if (!
|
|
72249
|
+
if (!isRecord11(value) || typeof value.kind !== "string") return false;
|
|
72168
72250
|
switch (value.kind) {
|
|
72169
72251
|
case "supported":
|
|
72170
72252
|
return true;
|
|
@@ -72176,7 +72258,7 @@ function isLinkedContentEditSupport(value) {
|
|
|
72176
72258
|
return false;
|
|
72177
72259
|
}
|
|
72178
72260
|
}
|
|
72179
|
-
function
|
|
72261
|
+
function isRecord11(value) {
|
|
72180
72262
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
72181
72263
|
}
|
|
72182
72264
|
var Section2 = forwardRef(function Section3({
|
|
@@ -73780,12 +73862,12 @@ function resolveBookingSiteId(siteId, form2) {
|
|
|
73780
73862
|
return siteId || form2?.siteId || "";
|
|
73781
73863
|
}
|
|
73782
73864
|
function normalizeBookingFormConfig(form2) {
|
|
73783
|
-
if (!
|
|
73865
|
+
if (!isRecord12(form2)) return null;
|
|
73784
73866
|
const id = readNonEmptyString(form2.id);
|
|
73785
73867
|
const name = readNonEmptyString(form2.name);
|
|
73786
73868
|
if (!id || !name) return null;
|
|
73787
|
-
const schemaSource =
|
|
73788
|
-
const settingsSource =
|
|
73869
|
+
const schemaSource = isRecord12(form2.schema) ? form2.schema : isRecord12(form2.schemaJson) ? form2.schemaJson : null;
|
|
73870
|
+
const settingsSource = isRecord12(form2.settings) ? form2.settings : isRecord12(form2.settingsJson) ? form2.settingsJson : null;
|
|
73789
73871
|
return {
|
|
73790
73872
|
id,
|
|
73791
73873
|
name,
|
|
@@ -73809,10 +73891,10 @@ function normalizeBookingServices(services) {
|
|
|
73809
73891
|
if (Array.isArray(services)) {
|
|
73810
73892
|
return services.filter(isBookingFormService).map(normalizeService);
|
|
73811
73893
|
}
|
|
73812
|
-
if (
|
|
73894
|
+
if (isRecord12(services) && "services" in services) {
|
|
73813
73895
|
return Array.isArray(services.services) ? services.services.filter(isBookingFormService).map(normalizeService) : [];
|
|
73814
73896
|
}
|
|
73815
|
-
return
|
|
73897
|
+
return isRecord12(services) ? Object.values(services).filter(isBookingFormService).map(normalizeService) : [];
|
|
73816
73898
|
}
|
|
73817
73899
|
function normalizeBookingSchema(value) {
|
|
73818
73900
|
if (!value) return void 0;
|
|
@@ -73824,7 +73906,7 @@ function normalizeBookingSchema(value) {
|
|
|
73824
73906
|
};
|
|
73825
73907
|
}
|
|
73826
73908
|
function readBookingFormField(value) {
|
|
73827
|
-
if (!
|
|
73909
|
+
if (!isRecord12(value)) return null;
|
|
73828
73910
|
const id = readNonEmptyString(value.id);
|
|
73829
73911
|
const label = readNonEmptyString(value.label);
|
|
73830
73912
|
const type = readBookingFieldType(value.type);
|
|
@@ -73870,7 +73952,7 @@ function readBookingFieldOptions(value) {
|
|
|
73870
73952
|
return options.length > 0 ? options : void 0;
|
|
73871
73953
|
}
|
|
73872
73954
|
function readBookingFieldOption(value) {
|
|
73873
|
-
if (!
|
|
73955
|
+
if (!isRecord12(value)) return null;
|
|
73874
73956
|
const optionValue = readNonEmptyString(value.value);
|
|
73875
73957
|
const label = readNonEmptyString(value.label);
|
|
73876
73958
|
return optionValue && label ? { value: optionValue, label } : null;
|
|
@@ -73887,7 +73969,7 @@ function normalizeBookingSettings(value) {
|
|
|
73887
73969
|
};
|
|
73888
73970
|
}
|
|
73889
73971
|
function isBookingFormService(value) {
|
|
73890
|
-
return
|
|
73972
|
+
return isRecord12(value) && typeof value.id === "string" && typeof value.siteId === "string" && typeof value.title === "string";
|
|
73891
73973
|
}
|
|
73892
73974
|
function collectBookingCustomFields(data) {
|
|
73893
73975
|
const customFields = {};
|
|
@@ -73917,7 +73999,7 @@ function readStringArray(value) {
|
|
|
73917
73999
|
const strings = value.filter((item) => typeof item === "string");
|
|
73918
74000
|
return strings.length > 0 ? strings : void 0;
|
|
73919
74001
|
}
|
|
73920
|
-
function
|
|
74002
|
+
function isRecord12(value) {
|
|
73921
74003
|
return typeof value === "object" && value !== null;
|
|
73922
74004
|
}
|
|
73923
74005
|
function getBookingServicePaymentSelectionMode(service) {
|
|
@@ -74691,7 +74773,7 @@ function EventDetailsView({
|
|
|
74691
74773
|
"a",
|
|
74692
74774
|
{
|
|
74693
74775
|
className: "rb-tile rb-tile--interactive",
|
|
74694
|
-
|
|
74776
|
+
...resolveEventLinkProps(e3),
|
|
74695
74777
|
children: /* @__PURE__ */ jsx(
|
|
74696
74778
|
DateTimeTile,
|
|
74697
74779
|
{
|
|
@@ -76305,7 +76387,7 @@ var AgendaEventCard = ({
|
|
|
76305
76387
|
showCapacity,
|
|
76306
76388
|
onClick
|
|
76307
76389
|
}) => {
|
|
76308
|
-
const
|
|
76390
|
+
const eventLinkProps = resolveEventLinkProps(event);
|
|
76309
76391
|
const categoryColor = event.eventCategory?.color || "rgb(var(--tb-accent))";
|
|
76310
76392
|
const price = formatEventPrice(event);
|
|
76311
76393
|
const { available, isFull } = getEventAvailability(event);
|
|
@@ -76366,7 +76448,7 @@ var AgendaEventCard = ({
|
|
|
76366
76448
|
}
|
|
76367
76449
|
);
|
|
76368
76450
|
}
|
|
76369
|
-
return /* @__PURE__ */ jsx("a", {
|
|
76451
|
+
return /* @__PURE__ */ jsx("a", { ...eventLinkProps, className: "event-agenda-card", children: cardContent });
|
|
76370
76452
|
};
|
|
76371
76453
|
var FULL_DAY_NAMES = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
|
76372
76454
|
function formatAgendaDayHeader(date) {
|
|
@@ -76603,7 +76685,7 @@ function renderCalendarSsr(display) {
|
|
|
76603
76685
|
dayEvents.slice(0, MAX_EVENTS_PER_DAY).map((event) => /* @__PURE__ */ jsxs(
|
|
76604
76686
|
"a",
|
|
76605
76687
|
{
|
|
76606
|
-
|
|
76688
|
+
...resolveEventLinkProps(event),
|
|
76607
76689
|
className: "event-calendar-event",
|
|
76608
76690
|
title: `${event.title} at ${formatTime(event.startsAt, { timeZone: getEventTimeZone(event) })}`,
|
|
76609
76691
|
children: [
|
|
@@ -76731,7 +76813,7 @@ function renderTimetableSsr(display) {
|
|
|
76731
76813
|
day.events.length === 0 ? /* @__PURE__ */ jsx("p", { className: "event-timetable-day-empty", children: "No classes" }) : day.events.map((cell) => /* @__PURE__ */ jsxs(
|
|
76732
76814
|
"a",
|
|
76733
76815
|
{
|
|
76734
|
-
|
|
76816
|
+
...resolveEventLinkProps(cell.event),
|
|
76735
76817
|
className: "event-timetable-event",
|
|
76736
76818
|
title: `${cell.event.title}, ${cell.timeLabel}`,
|
|
76737
76819
|
style: {
|
|
@@ -77524,14 +77606,14 @@ function isDecoratedHeadingBlockKind(blockKind) {
|
|
|
77524
77606
|
return blockKind === "block.intro" || blockKind === "block.feature-cards" || blockKind === "block.testimonials" || blockKind === "block.faq";
|
|
77525
77607
|
}
|
|
77526
77608
|
function readVariant(blockContent) {
|
|
77527
|
-
if (!
|
|
77609
|
+
if (!isRecord13(blockContent)) return void 0;
|
|
77528
77610
|
const variant = blockContent.variant;
|
|
77529
77611
|
return typeof variant === "string" ? variant : void 0;
|
|
77530
77612
|
}
|
|
77531
77613
|
function isFaqDecoratedVariant(variant) {
|
|
77532
77614
|
return variant === "default" || variant === "question-columns";
|
|
77533
77615
|
}
|
|
77534
|
-
function
|
|
77616
|
+
function isRecord13(value) {
|
|
77535
77617
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
77536
77618
|
}
|
|
77537
77619
|
function buildHeadingDecorationWrapperClassName(className) {
|
|
@@ -95146,14 +95228,14 @@ function backgroundCapabilityFromModes(modeCapabilities) {
|
|
|
95146
95228
|
};
|
|
95147
95229
|
}
|
|
95148
95230
|
function parseBackgroundOverrideFromContent(content) {
|
|
95149
|
-
const sectionStyles =
|
|
95231
|
+
const sectionStyles = isRecord14(content._sectionStyles) ? content._sectionStyles : null;
|
|
95150
95232
|
return parseBackgroundOverride(sectionStyles?.background);
|
|
95151
95233
|
}
|
|
95152
95234
|
function parseBackgroundOverride(value) {
|
|
95153
95235
|
if (value === null || value === void 0) {
|
|
95154
95236
|
return { kind: "supported", override: DEFAULT_BACKGROUND_OVERRIDE };
|
|
95155
95237
|
}
|
|
95156
|
-
if (!
|
|
95238
|
+
if (!isRecord14(value)) {
|
|
95157
95239
|
return { kind: "legacy", reason: "unsupported-shape", background: {} };
|
|
95158
95240
|
}
|
|
95159
95241
|
if (Object.keys(value).length === 0) {
|
|
@@ -95234,7 +95316,7 @@ function serializeBackgroundOverride(override) {
|
|
|
95234
95316
|
}
|
|
95235
95317
|
}
|
|
95236
95318
|
function applyBackgroundOverrideContentPatch(content, override) {
|
|
95237
|
-
const sectionStyles =
|
|
95319
|
+
const sectionStyles = isRecord14(content._sectionStyles) ? content._sectionStyles : {};
|
|
95238
95320
|
const serialized = serializeBackgroundOverride(override);
|
|
95239
95321
|
if (serialized === null) {
|
|
95240
95322
|
const nextSectionStyles = omitRecordKey2(sectionStyles, "background");
|
|
@@ -95436,7 +95518,7 @@ function imageAllowed(mediaId, pool) {
|
|
|
95436
95518
|
return pool?.some((item) => item.mediaId === mediaId) ?? false;
|
|
95437
95519
|
}
|
|
95438
95520
|
function parseImageMediaAssetId(value) {
|
|
95439
|
-
if (!
|
|
95521
|
+
if (!isRecord14(value)) return { kind: "missing" };
|
|
95440
95522
|
if (value.type !== void 0 && value.type !== "image") return { kind: "missing" };
|
|
95441
95523
|
const parsed = parseMediaAssetId(value.assetId);
|
|
95442
95524
|
if (!parsed.ok) {
|
|
@@ -95484,18 +95566,18 @@ function omitRecordKey2(content, key) {
|
|
|
95484
95566
|
Object.entries(content).filter(([entryKey]) => entryKey !== key)
|
|
95485
95567
|
);
|
|
95486
95568
|
}
|
|
95487
|
-
function
|
|
95569
|
+
function isRecord14(value) {
|
|
95488
95570
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
95489
95571
|
}
|
|
95490
95572
|
|
|
95491
95573
|
// ../path-utils/src/index.ts
|
|
95492
95574
|
var PATH_SEPARATOR_REGEX2 = /\./g;
|
|
95493
95575
|
var BRACKET_ACCESS_REGEX2 = /\[([^\]]+)\]/g;
|
|
95494
|
-
function
|
|
95576
|
+
function isRecord15(value) {
|
|
95495
95577
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
95496
95578
|
}
|
|
95497
95579
|
function isPathContainer(value) {
|
|
95498
|
-
return Array.isArray(value) ||
|
|
95580
|
+
return Array.isArray(value) || isRecord15(value);
|
|
95499
95581
|
}
|
|
95500
95582
|
function createPathContainer(nextIsIndex) {
|
|
95501
95583
|
return nextIsIndex ? [] : {};
|
|
@@ -95525,7 +95607,7 @@ function parsePath(path) {
|
|
|
95525
95607
|
for (const raw of parts) {
|
|
95526
95608
|
if (!raw) continue;
|
|
95527
95609
|
const baseMatch = raw.match(/^[^\[]+/);
|
|
95528
|
-
if (baseMatch) {
|
|
95610
|
+
if (baseMatch !== null) {
|
|
95529
95611
|
const base2 = baseMatch[1] ?? baseMatch[0];
|
|
95530
95612
|
if (/^\d+$/.test(base2)) {
|
|
95531
95613
|
segments.push(Number(base2));
|
|
@@ -95544,7 +95626,7 @@ function parsePath(path) {
|
|
|
95544
95626
|
segments.push(token);
|
|
95545
95627
|
}
|
|
95546
95628
|
}
|
|
95547
|
-
if (
|
|
95629
|
+
if (baseMatch === null && !raw.includes("[")) {
|
|
95548
95630
|
segments.push(raw);
|
|
95549
95631
|
}
|
|
95550
95632
|
}
|
|
@@ -98546,16 +98628,16 @@ function unwrapResponse(result) {
|
|
|
98546
98628
|
}
|
|
98547
98629
|
|
|
98548
98630
|
// ../api/src/utils/isRecord.ts
|
|
98549
|
-
function
|
|
98631
|
+
function isRecord16(value) {
|
|
98550
98632
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
98551
98633
|
}
|
|
98552
98634
|
|
|
98553
98635
|
// ../api/src/utils/error-propagation.ts
|
|
98554
98636
|
function extractApiErrorMessage(body) {
|
|
98555
|
-
if (!
|
|
98637
|
+
if (!isRecord16(body)) {
|
|
98556
98638
|
return null;
|
|
98557
98639
|
}
|
|
98558
|
-
if (
|
|
98640
|
+
if (isRecord16(body.error)) {
|
|
98559
98641
|
if (typeof body.error.message === "string" && body.error.message.trim().length > 0) {
|
|
98560
98642
|
return body.error.message;
|
|
98561
98643
|
}
|
|
@@ -110755,14 +110837,14 @@ CollapsibleContent.displayName = CONTENT_NAME5;
|
|
|
110755
110837
|
var CollapsibleContentImpl = React61.forwardRef((props2, forwardedRef) => {
|
|
110756
110838
|
const { __scopeCollapsible, present, children, ...contentProps } = props2;
|
|
110757
110839
|
const context = useCollapsibleContext(CONTENT_NAME5, __scopeCollapsible);
|
|
110758
|
-
const [
|
|
110840
|
+
const [isPresent2, setIsPresent] = React61.useState(present);
|
|
110759
110841
|
const ref = React61.useRef(null);
|
|
110760
110842
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
110761
110843
|
const heightRef = React61.useRef(0);
|
|
110762
110844
|
const height = heightRef.current;
|
|
110763
110845
|
const widthRef = React61.useRef(0);
|
|
110764
110846
|
const width = widthRef.current;
|
|
110765
|
-
const isOpen = context.open ||
|
|
110847
|
+
const isOpen = context.open || isPresent2;
|
|
110766
110848
|
const isMountAnimationPreventedRef = React61.useRef(isOpen);
|
|
110767
110849
|
const originalStylesRef = React61.useRef(void 0);
|
|
110768
110850
|
React61.useEffect(() => {
|
|
@@ -113455,7 +113537,7 @@ ColorPicker.displayName = "ColorPicker";
|
|
|
113455
113537
|
function isObject2(subject) {
|
|
113456
113538
|
return Object.prototype.toString.call(subject) === "[object Object]";
|
|
113457
113539
|
}
|
|
113458
|
-
function
|
|
113540
|
+
function isRecord17(subject) {
|
|
113459
113541
|
return isObject2(subject) || Array.isArray(subject);
|
|
113460
113542
|
}
|
|
113461
113543
|
function canUseDOM2() {
|
|
@@ -113472,7 +113554,7 @@ function areOptionsEqual(optionsA, optionsB) {
|
|
|
113472
113554
|
const valueA = optionsA[key];
|
|
113473
113555
|
const valueB = optionsB[key];
|
|
113474
113556
|
if (typeof valueA === "function") return `${valueA}` === `${valueB}`;
|
|
113475
|
-
if (!
|
|
113557
|
+
if (!isRecord17(valueA) || !isRecord17(valueB)) return valueA === valueB;
|
|
113476
113558
|
return areOptionsEqual(valueA, valueB);
|
|
113477
113559
|
});
|
|
113478
113560
|
}
|
|
@@ -123315,7 +123397,7 @@ function ResizableSplitPane({
|
|
|
123315
123397
|
}
|
|
123316
123398
|
|
|
123317
123399
|
// ../block-form/src/utils/typeGuards.ts
|
|
123318
|
-
function
|
|
123400
|
+
function isRecord18(value) {
|
|
123319
123401
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
123320
123402
|
}
|
|
123321
123403
|
function isObjectRecord3(value) {
|
|
@@ -123573,9 +123655,9 @@ function createStoreBackend(options) {
|
|
|
123573
123655
|
},
|
|
123574
123656
|
reset: (values) => {
|
|
123575
123657
|
if (scope === "blocks") {
|
|
123576
|
-
getBlocksSlice().updateBlockBaseline?.(getBlockId(),
|
|
123658
|
+
getBlocksSlice().updateBlockBaseline?.(getBlockId(), isRecord18(values) ? values : null);
|
|
123577
123659
|
} else {
|
|
123578
|
-
const recordValues =
|
|
123660
|
+
const recordValues = isRecord18(values) ? values : null;
|
|
123579
123661
|
getRootSlice().hydrate?.(recordValues, recordValues);
|
|
123580
123662
|
}
|
|
123581
123663
|
},
|
|
@@ -125542,7 +125624,7 @@ function useRepeaterRowErrors(field, index2, backend, basePath) {
|
|
|
125542
125624
|
const rowErrorNode = getErrorAtPath(errorsRoot, rowPath);
|
|
125543
125625
|
if (!rowErrorNode) return [];
|
|
125544
125626
|
const rowValues = backend.getValue(rowPath);
|
|
125545
|
-
const valueContext =
|
|
125627
|
+
const valueContext = isRecord18(rowValues) ? rowValues : {};
|
|
125546
125628
|
const baseSegments = rowPath.split(".").filter((s2) => s2.length > 0);
|
|
125547
125629
|
const results = [];
|
|
125548
125630
|
let fieldsToTraverse = [];
|
|
@@ -125581,7 +125663,7 @@ function useRepeaterRowErrors(field, index2, backend, basePath) {
|
|
|
125581
125663
|
const itemError = errorArray[itemIndex];
|
|
125582
125664
|
let nestedFields = [];
|
|
125583
125665
|
if (childRepeater.polymorphic && childRepeater.itemTypes) {
|
|
125584
|
-
const itemType =
|
|
125666
|
+
const itemType = isRecord18(itemValue) && typeof itemValue._type === "string" ? itemValue._type : Object.keys(childRepeater.itemTypes)[0] ?? "";
|
|
125585
125667
|
const typeSchema = itemType ? childRepeater.itemTypes[itemType] : void 0;
|
|
125586
125668
|
if (typeSchema) {
|
|
125587
125669
|
nestedFields = typeSchema.fields;
|
|
@@ -125613,13 +125695,13 @@ function getErrorAtPath(errors, path) {
|
|
|
125613
125695
|
const segments = path.split(".").filter((s2) => s2.length > 0);
|
|
125614
125696
|
let current = errors;
|
|
125615
125697
|
for (const segment of segments) {
|
|
125616
|
-
if (!
|
|
125698
|
+
if (!isRecord18(current)) return void 0;
|
|
125617
125699
|
current = current[segment];
|
|
125618
125700
|
}
|
|
125619
125701
|
return current;
|
|
125620
125702
|
}
|
|
125621
125703
|
function getChildValue(node, key) {
|
|
125622
|
-
if (
|
|
125704
|
+
if (isRecord18(node)) {
|
|
125623
125705
|
return node[key];
|
|
125624
125706
|
}
|
|
125625
125707
|
return void 0;
|
|
@@ -125634,7 +125716,7 @@ function extractMessage(error) {
|
|
|
125634
125716
|
}
|
|
125635
125717
|
return void 0;
|
|
125636
125718
|
}
|
|
125637
|
-
if (
|
|
125719
|
+
if (isRecord18(error) && typeof error.message === "string") {
|
|
125638
125720
|
return error.message;
|
|
125639
125721
|
}
|
|
125640
125722
|
return void 0;
|
|
@@ -126097,7 +126179,7 @@ var BlockApiError = class extends Error {
|
|
|
126097
126179
|
this.name = "BlockApiError";
|
|
126098
126180
|
}
|
|
126099
126181
|
};
|
|
126100
|
-
function
|
|
126182
|
+
function isRecord19(value) {
|
|
126101
126183
|
return typeof value === "object" && value !== null;
|
|
126102
126184
|
}
|
|
126103
126185
|
function isJsonResponseContentType(contentType) {
|
|
@@ -126120,10 +126202,10 @@ async function parseJsonBody(response) {
|
|
|
126120
126202
|
}
|
|
126121
126203
|
}
|
|
126122
126204
|
function getBlockApiErrorDetails(data) {
|
|
126123
|
-
if (!
|
|
126205
|
+
if (!isRecord19(data)) {
|
|
126124
126206
|
return {};
|
|
126125
126207
|
}
|
|
126126
|
-
const nestedError =
|
|
126208
|
+
const nestedError = isRecord19(data.error) ? data.error : void 0;
|
|
126127
126209
|
const message2 = typeof nestedError?.message === "string" ? nestedError.message : typeof data.message === "string" ? data.message : void 0;
|
|
126128
126210
|
const code = typeof nestedError?.code === "string" ? nestedError.code : typeof data.code === "string" ? data.code : void 0;
|
|
126129
126211
|
return { message: message2, code };
|
|
@@ -126833,22 +126915,22 @@ function AltchaWidget({
|
|
|
126833
126915
|
if (typeof window === "undefined") return;
|
|
126834
126916
|
let widget = null;
|
|
126835
126917
|
import('./altcha-EKUEQ4RP.mjs').then(() => {
|
|
126836
|
-
if (
|
|
126918
|
+
if (containerRef.current === null) return;
|
|
126837
126919
|
widget = document.createElement("altcha-widget");
|
|
126838
126920
|
widget.setAttribute("challengeurl", challengeUrl);
|
|
126839
|
-
if (auto) {
|
|
126921
|
+
if (auto === true) {
|
|
126840
126922
|
widget.setAttribute("auto", "onload");
|
|
126841
126923
|
}
|
|
126842
|
-
if (hidelogo) {
|
|
126924
|
+
if (hidelogo === true) {
|
|
126843
126925
|
widget.setAttribute("hidelogo", "true");
|
|
126844
126926
|
}
|
|
126845
126927
|
widget.setAttribute("hidefooter", "true");
|
|
126846
|
-
if (className) {
|
|
126928
|
+
if (className !== void 0 && className.length > 0) {
|
|
126847
126929
|
widget.className = className;
|
|
126848
126930
|
}
|
|
126849
126931
|
widget.addEventListener("statechange", ((event) => {
|
|
126850
126932
|
const { state, payload } = event.detail;
|
|
126851
|
-
if (state === "verified" && payload) {
|
|
126933
|
+
if (state === "verified" && payload !== void 0 && payload.length > 0) {
|
|
126852
126934
|
onSolutionChange?.(payload);
|
|
126853
126935
|
} else if (state === "error" || state === "expired") {
|
|
126854
126936
|
onSolutionChange?.(null);
|
|
@@ -126859,7 +126941,7 @@ function AltchaWidget({
|
|
|
126859
126941
|
console.error("Failed to load ALTCHA widget:", err4);
|
|
126860
126942
|
});
|
|
126861
126943
|
return () => {
|
|
126862
|
-
if (widget && containerRef.current) {
|
|
126944
|
+
if (widget !== null && containerRef.current !== null) {
|
|
126863
126945
|
containerRef.current.removeChild(widget);
|
|
126864
126946
|
}
|
|
126865
126947
|
};
|
|
@@ -126900,15 +126982,15 @@ new TextEncoder();
|
|
|
126900
126982
|
// ../altcha/src/index.ts
|
|
126901
126983
|
function getCmsApiUrl() {
|
|
126902
126984
|
const env = process.env.RIVERBANK_ENV;
|
|
126903
|
-
if (env) {
|
|
126985
|
+
if (env !== void 0 && env.length > 0) {
|
|
126904
126986
|
const envKey = `RIVERBANK_${env.toUpperCase()}_DASHBOARD_URL`;
|
|
126905
126987
|
const dashboardUrl2 = process.env[envKey];
|
|
126906
|
-
if (dashboardUrl2) {
|
|
126988
|
+
if (dashboardUrl2 !== void 0 && dashboardUrl2.length > 0) {
|
|
126907
126989
|
return `${dashboardUrl2.replace(/\/$/, "")}/api`;
|
|
126908
126990
|
}
|
|
126909
126991
|
}
|
|
126910
126992
|
const dashboardUrl = process.env.NEXT_PUBLIC_DASHBOARD_URL;
|
|
126911
|
-
if (dashboardUrl) {
|
|
126993
|
+
if (dashboardUrl !== void 0 && dashboardUrl.length > 0) {
|
|
126912
126994
|
return `${dashboardUrl.replace(/\/$/, "")}/api`;
|
|
126913
126995
|
}
|
|
126914
126996
|
throw new Error("Dashboard URL not configured. Set NEXT_PUBLIC_DASHBOARD_URL");
|
|
@@ -127726,8 +127808,10 @@ function buildBookingPaymentOptionViewModel(input) {
|
|
|
127726
127808
|
totalAmountCents: input.totalCents,
|
|
127727
127809
|
config: input.option.config
|
|
127728
127810
|
});
|
|
127811
|
+
const remainingBalance = Math.max(0, input.totalCents - dueToday);
|
|
127729
127812
|
const formattedTotal = formatPrice(input.totalCents, input.currency, input.locale);
|
|
127730
127813
|
const formattedDueToday = formatPrice(dueToday, input.currency, input.locale);
|
|
127814
|
+
const formattedRemainingBalance = formatPrice(remainingBalance, input.currency, input.locale);
|
|
127731
127815
|
const dueAt = resolveFlexibleBalanceDueAt({
|
|
127732
127816
|
bookingStartAt: input.bookingStartAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
127733
127817
|
dueDateRule: input.option.config.dueDateRule
|
|
@@ -127744,6 +127828,7 @@ function buildBookingPaymentOptionViewModel(input) {
|
|
|
127744
127828
|
summaryRows: [
|
|
127745
127829
|
{ label: "Total", value: formattedTotal },
|
|
127746
127830
|
{ label: "Due today", value: formattedDueToday },
|
|
127831
|
+
{ label: "Remaining balance", value: formattedRemainingBalance },
|
|
127747
127832
|
{ label: "Balance due by", value: formatScheduleDate(dueAt, input.locale) },
|
|
127748
127833
|
{
|
|
127749
127834
|
label: "Deposit policy",
|
|
@@ -132385,6 +132470,33 @@ function toEventDirectPaymentOption(option, mode) {
|
|
|
132385
132470
|
);
|
|
132386
132471
|
}
|
|
132387
132472
|
}
|
|
132473
|
+
function resolveEventRegistrationDirectPaymentSelection(input) {
|
|
132474
|
+
if (input.selection.method !== "stripe") {
|
|
132475
|
+
return { kind: "not-stripe" };
|
|
132476
|
+
}
|
|
132477
|
+
const fallbackOption = input.options[0];
|
|
132478
|
+
if (!fallbackOption) {
|
|
132479
|
+
return { kind: "unavailable" };
|
|
132480
|
+
}
|
|
132481
|
+
const requestedKind = input.selection.collectionOptionKind;
|
|
132482
|
+
const selectedOption = requestedKind == null ? input.options.find((option) => option.kind === "upfront") : input.options.find((option) => option.kind === requestedKind);
|
|
132483
|
+
if (selectedOption) {
|
|
132484
|
+
return {
|
|
132485
|
+
kind: "valid",
|
|
132486
|
+
selection: {
|
|
132487
|
+
method: "stripe",
|
|
132488
|
+
collectionOptionKind: selectedOption.kind
|
|
132489
|
+
}
|
|
132490
|
+
};
|
|
132491
|
+
}
|
|
132492
|
+
return {
|
|
132493
|
+
kind: "invalid",
|
|
132494
|
+
fallbackSelection: {
|
|
132495
|
+
method: "stripe",
|
|
132496
|
+
collectionOptionKind: fallbackOption.kind
|
|
132497
|
+
}
|
|
132498
|
+
};
|
|
132499
|
+
}
|
|
132388
132500
|
function PaymentCheckIcon() {
|
|
132389
132501
|
return /* @__PURE__ */ jsx("div", { className: "er-check", children: /* @__PURE__ */ jsx(CheckIcon2, {}) });
|
|
132390
132502
|
}
|
|
@@ -132430,6 +132542,9 @@ function formatDirectPaymentOptionDetail(option) {
|
|
|
132430
132542
|
balanceDueBy ? `Balance due by: ${balanceDueBy.value}` : null
|
|
132431
132543
|
].filter((part) => Boolean(part)).join(" \xB7 ");
|
|
132432
132544
|
}
|
|
132545
|
+
function isDirectPaymentOptionSelected(option, selectionState) {
|
|
132546
|
+
return selectionState.kind === "valid" && selectionState.selection.collectionOptionKind === option.kind;
|
|
132547
|
+
}
|
|
132433
132548
|
var PaymentSelectionStep = ({
|
|
132434
132549
|
event,
|
|
132435
132550
|
occurrenceContext,
|
|
@@ -132446,8 +132561,28 @@ var PaymentSelectionStep = ({
|
|
|
132446
132561
|
}) => {
|
|
132447
132562
|
const occurrenceId = occurrenceContext?.id ?? event?.registrationOccurrenceId;
|
|
132448
132563
|
const selectedMethod = selectedSelection.method;
|
|
132564
|
+
const totalPrice = eligibility?.price ? eligibility.price * ticketsCount : 0;
|
|
132565
|
+
const canShowDirectPaymentOptions = Boolean(
|
|
132566
|
+
eligibility?.eligible && eligibility.canPayDirectly && eligibility.price
|
|
132567
|
+
);
|
|
132568
|
+
const directPaymentOptions = eligibility && canShowDirectPaymentOptions ? buildEventRegistrationPaymentOptionsViewModel({
|
|
132569
|
+
eventTitle: event?.title ?? "Event",
|
|
132570
|
+
paymentTerms: event?.paymentTerms,
|
|
132571
|
+
totalPriceCents: totalPrice,
|
|
132572
|
+
currency: eligibility.currency,
|
|
132573
|
+
startsAt: occurrenceContext?.startsAt ?? event?.startsAt
|
|
132574
|
+
}).options : [];
|
|
132575
|
+
const directPaymentSelectionState = resolveEventRegistrationDirectPaymentSelection({
|
|
132576
|
+
options: directPaymentOptions,
|
|
132577
|
+
selection: selectedSelection
|
|
132578
|
+
});
|
|
132579
|
+
const directPaymentFallbackSelection = directPaymentSelectionState.kind === "invalid" ? directPaymentSelectionState.fallbackSelection : null;
|
|
132580
|
+
const directPaymentFallbackKind = directPaymentFallbackSelection?.collectionOptionKind;
|
|
132449
132581
|
const canContinue = (() => {
|
|
132450
132582
|
if (!selectedMethod) return false;
|
|
132583
|
+
if (selectedMethod === "stripe") {
|
|
132584
|
+
return directPaymentSelectionState.kind === "valid";
|
|
132585
|
+
}
|
|
132451
132586
|
if (selectedMethod === "pass") return Boolean(selectedSelection.passId);
|
|
132452
132587
|
if (selectedMethod === "membership")
|
|
132453
132588
|
return Boolean(selectedSelection.membershipId);
|
|
@@ -132457,6 +132592,13 @@ var PaymentSelectionStep = ({
|
|
|
132457
132592
|
return Boolean(selectedSelection.bundleMembershipId);
|
|
132458
132593
|
return true;
|
|
132459
132594
|
})();
|
|
132595
|
+
useEffect(() => {
|
|
132596
|
+
if (!directPaymentFallbackKind) return;
|
|
132597
|
+
onSelectionChange({
|
|
132598
|
+
method: "stripe",
|
|
132599
|
+
collectionOptionKind: directPaymentFallbackKind
|
|
132600
|
+
});
|
|
132601
|
+
}, [directPaymentFallbackKind, onSelectionChange]);
|
|
132460
132602
|
const getButtonText = useCallback(() => {
|
|
132461
132603
|
if (selectedMethod === "stripe") return "Continue to Payment";
|
|
132462
132604
|
if (selectedMethod === "pass_bundle" || selectedMethod === "membership_bundle") {
|
|
@@ -132556,25 +132698,20 @@ var PaymentSelectionStep = ({
|
|
|
132556
132698
|
] }) })
|
|
132557
132699
|
] });
|
|
132558
132700
|
}
|
|
132559
|
-
const totalPrice = eligibility.price ? eligibility.price * ticketsCount : 0;
|
|
132560
|
-
const directPaymentOptions = buildEventRegistrationPaymentOptionsViewModel({
|
|
132561
|
-
eventTitle: event?.title ?? "Event",
|
|
132562
|
-
paymentTerms: event?.paymentTerms,
|
|
132563
|
-
totalPriceCents: totalPrice,
|
|
132564
|
-
currency: eligibility.currency,
|
|
132565
|
-
startsAt: occurrenceContext?.startsAt ?? event?.startsAt
|
|
132566
|
-
}).options;
|
|
132567
132701
|
const isMultiTicket = areEntitlementsDisabledForTicketCount(ticketsCount);
|
|
132568
132702
|
return /* @__PURE__ */ jsxs("div", { className: "er-stack", children: [
|
|
132569
132703
|
/* @__PURE__ */ jsx("h3", { className: "er-title", children: "Payment Options" }),
|
|
132570
132704
|
/* @__PURE__ */ jsxs("div", { className: "er-payment-tiles", children: [
|
|
132571
|
-
|
|
132705
|
+
canShowDirectPaymentOptions && /* @__PURE__ */ jsx(Fragment, { children: directPaymentOptions.map((option) => /* @__PURE__ */ jsx(
|
|
132572
132706
|
PaymentTile,
|
|
132573
132707
|
{
|
|
132574
132708
|
icon: /* @__PURE__ */ jsx(CreditCard, { size: 24, "aria-hidden": "true" }),
|
|
132575
132709
|
label: option.label,
|
|
132576
132710
|
detail: formatDirectPaymentOptionDetail(option),
|
|
132577
|
-
selected:
|
|
132711
|
+
selected: isDirectPaymentOptionSelected(
|
|
132712
|
+
option,
|
|
132713
|
+
directPaymentSelectionState
|
|
132714
|
+
),
|
|
132578
132715
|
onClick: () => onSelectionChange({
|
|
132579
132716
|
method: "stripe",
|
|
132580
132717
|
collectionOptionKind: option.kind
|
|
@@ -132994,6 +133131,24 @@ function EventRegistrationWizardActions(props2) {
|
|
|
132994
133131
|
function isProductMethod(method) {
|
|
132995
133132
|
return method !== null && ["pass", "membership", "pass_bundle", "membership_bundle"].includes(method);
|
|
132996
133133
|
}
|
|
133134
|
+
function getSummaryRow(option, label) {
|
|
133135
|
+
return option.summaryRows.find((row) => row.label === label)?.value ?? null;
|
|
133136
|
+
}
|
|
133137
|
+
function getSelectedDirectPaymentOption(input) {
|
|
133138
|
+
const summaryEvent = input.wizard.selectedEvent ?? input.wizard.preSelectedEvent;
|
|
133139
|
+
if (!summaryEvent || input.wizard.paymentSelection.method !== "stripe") {
|
|
133140
|
+
return null;
|
|
133141
|
+
}
|
|
133142
|
+
const options = buildEventRegistrationPaymentOptionsViewModel({
|
|
133143
|
+
eventTitle: summaryEvent.title,
|
|
133144
|
+
paymentTerms: summaryEvent.paymentTerms,
|
|
133145
|
+
totalPriceCents: input.totalCents,
|
|
133146
|
+
currency: input.currency,
|
|
133147
|
+
startsAt: input.wizard.occurrenceContext?.startsAt ?? summaryEvent.startsAt
|
|
133148
|
+
}).options;
|
|
133149
|
+
const requestedKind = input.wizard.paymentSelection.collectionOptionKind ?? "upfront";
|
|
133150
|
+
return options.find((option) => option.kind === requestedKind) ?? options.find((option) => option.kind === "upfront") ?? options[0] ?? null;
|
|
133151
|
+
}
|
|
132997
133152
|
function EventRegistrationSummaryBar(props2) {
|
|
132998
133153
|
const { wizard } = props2;
|
|
132999
133154
|
const summaryEvent = wizard.selectedEvent ?? wizard.preSelectedEvent;
|
|
@@ -133008,6 +133163,18 @@ function EventRegistrationSummaryBar(props2) {
|
|
|
133008
133163
|
const autoAppliedDiscount = wizard.discountCode.trim().length > 0 ? null : wizard.autoAppliedDiscount;
|
|
133009
133164
|
const autoAppliedDiscountCents = Math.max(0, autoAppliedDiscount?.computedAmountCents ?? 0);
|
|
133010
133165
|
const discountedTotalCents = Math.max(0, subtotalCents - autoAppliedDiscountCents);
|
|
133166
|
+
const selectedDirectPaymentOption = getSelectedDirectPaymentOption({
|
|
133167
|
+
wizard,
|
|
133168
|
+
totalCents: discountedTotalCents,
|
|
133169
|
+
currency: summaryCurrency
|
|
133170
|
+
});
|
|
133171
|
+
const flexibleBalanceSummary = selectedDirectPaymentOption?.kind === "flexible_balance" ? {
|
|
133172
|
+
total: getSummaryRow(selectedDirectPaymentOption, "Total"),
|
|
133173
|
+
dueToday: getSummaryRow(selectedDirectPaymentOption, "Due today"),
|
|
133174
|
+
remainingBalance: getSummaryRow(selectedDirectPaymentOption, "Remaining balance"),
|
|
133175
|
+
balanceDueBy: getSummaryRow(selectedDirectPaymentOption, "Balance due by"),
|
|
133176
|
+
depositPolicy: getSummaryRow(selectedDirectPaymentOption, "Deposit policy")
|
|
133177
|
+
} : null;
|
|
133011
133178
|
if (!summaryTitle) return null;
|
|
133012
133179
|
const productMethod = isProductMethod(wizard.paymentSelection.method);
|
|
133013
133180
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -133051,6 +133218,22 @@ function EventRegistrationSummaryBar(props2) {
|
|
|
133051
133218
|
summaryPrice > 0 && /* @__PURE__ */ jsx("div", { className: "er-summary-bar-pricing", children: productMethod ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
133052
133219
|
/* @__PURE__ */ jsx("span", { className: "er-summary-bar-price er-summary-bar-price--struck", children: formatPrice(summaryPrice * wizard.ticketsCount, summaryCurrency) }),
|
|
133053
133220
|
/* @__PURE__ */ jsx("div", { className: "er-summary-bar-included", children: wizard.paymentSelection.method === "pass" || wizard.paymentSelection.method === "pass_bundle" ? "1 pass credit" : "Included in membership" })
|
|
133221
|
+
] }) : flexibleBalanceSummary ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
133222
|
+
flexibleBalanceSummary.total ? /* @__PURE__ */ jsxs("div", { className: "er-summary-bar-product-detail", children: [
|
|
133223
|
+
"Total: ",
|
|
133224
|
+
flexibleBalanceSummary.total
|
|
133225
|
+
] }) : null,
|
|
133226
|
+
/* @__PURE__ */ jsx("div", { className: "er-summary-bar-price", children: flexibleBalanceSummary.dueToday ?? formatPrice(discountedTotalCents, summaryCurrency) }),
|
|
133227
|
+
/* @__PURE__ */ jsx("div", { className: "er-summary-bar-included", children: "Payable now" }),
|
|
133228
|
+
flexibleBalanceSummary.remainingBalance ? /* @__PURE__ */ jsxs("div", { className: "er-summary-bar-product-detail", children: [
|
|
133229
|
+
"Remaining balance: ",
|
|
133230
|
+
flexibleBalanceSummary.remainingBalance,
|
|
133231
|
+
flexibleBalanceSummary.balanceDueBy ? ` due by ${flexibleBalanceSummary.balanceDueBy}` : ""
|
|
133232
|
+
] }) : null,
|
|
133233
|
+
flexibleBalanceSummary.depositPolicy ? /* @__PURE__ */ jsxs("div", { className: "er-summary-bar-product-detail", children: [
|
|
133234
|
+
"Deposit: ",
|
|
133235
|
+
flexibleBalanceSummary.depositPolicy
|
|
133236
|
+
] }) : null
|
|
133054
133237
|
] }) : autoAppliedDiscount && autoAppliedDiscountCents > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
133055
133238
|
/* @__PURE__ */ jsx("span", { className: "er-summary-bar-price er-summary-bar-price--struck", children: formatPrice(subtotalCents, summaryCurrency) }),
|
|
133056
133239
|
/* @__PURE__ */ jsx("div", { className: "er-summary-bar-price", children: formatPrice(discountedTotalCents, summaryCurrency) }),
|
|
@@ -142540,7 +142723,7 @@ function NewsletterFormClient({
|
|
|
142540
142723
|
var newsletter_form_client_default = NewsletterFormClient;
|
|
142541
142724
|
|
|
142542
142725
|
// ../blocks/src/system/runtime/components/registry.client.tsx
|
|
142543
|
-
function
|
|
142726
|
+
function isRecord20(value) {
|
|
142544
142727
|
return typeof value === "object" && value !== null;
|
|
142545
142728
|
}
|
|
142546
142729
|
function buildRenderFromLooseProps(runtime, mode, props2) {
|
|
@@ -142560,14 +142743,14 @@ function withRuntimeBackedEnvelope(source, runtime, render) {
|
|
|
142560
142743
|
function normalizeLegacyInteractiveRenderProps(runtime, mode, props2) {
|
|
142561
142744
|
const source = props2;
|
|
142562
142745
|
const render = props2["render"];
|
|
142563
|
-
if (!
|
|
142746
|
+
if (!isRecord20(render)) {
|
|
142564
142747
|
return withRuntimeBackedEnvelope(
|
|
142565
142748
|
source,
|
|
142566
142749
|
runtime,
|
|
142567
142750
|
buildRenderFromLooseProps(runtime, mode, props2)
|
|
142568
142751
|
);
|
|
142569
142752
|
}
|
|
142570
|
-
if (
|
|
142753
|
+
if (isRecord20(render["hydration"])) {
|
|
142571
142754
|
return withRuntimeBackedEnvelope(
|
|
142572
142755
|
source,
|
|
142573
142756
|
runtime,
|
|
@@ -142577,7 +142760,7 @@ function normalizeLegacyInteractiveRenderProps(runtime, mode, props2) {
|
|
|
142577
142760
|
}
|
|
142578
142761
|
);
|
|
142579
142762
|
}
|
|
142580
|
-
if (!
|
|
142763
|
+
if (!isRecord20(render["display"])) {
|
|
142581
142764
|
return withRuntimeBackedEnvelope(
|
|
142582
142765
|
source,
|
|
142583
142766
|
runtime,
|
|
@@ -148834,7 +149017,7 @@ function sanitizeMarks(marks) {
|
|
|
148834
149017
|
if (mark.type === "bold" || mark.type === "strong" || mark.type === "italic" || mark.type === "em") {
|
|
148835
149018
|
return [{ type: mark.type }];
|
|
148836
149019
|
}
|
|
148837
|
-
if (mark.type === "link" &&
|
|
149020
|
+
if (mark.type === "link" && isRecord16(mark.attrs) && typeof mark.attrs.href === "string") {
|
|
148838
149021
|
const attrs = { href: mark.attrs.href };
|
|
148839
149022
|
if (typeof mark.attrs.target === "string" && mark.attrs.target.trim().length > 0) {
|
|
148840
149023
|
attrs.target = mark.attrs.target;
|
|
@@ -148849,10 +149032,10 @@ function sanitizeMarks(marks) {
|
|
|
148849
149032
|
return sanitized.length > 0 ? sanitized : void 0;
|
|
148850
149033
|
}
|
|
148851
149034
|
function unwrapRichTextValue(value) {
|
|
148852
|
-
if (
|
|
149035
|
+
if (isRecord16(value) && isRecord16(value.doc)) {
|
|
148853
149036
|
return unwrapRichTextValue(value.doc);
|
|
148854
149037
|
}
|
|
148855
|
-
if (
|
|
149038
|
+
if (isRecord16(value) && value.type === "doc") {
|
|
148856
149039
|
return {
|
|
148857
149040
|
type: "doc",
|
|
148858
149041
|
content: Array.isArray(value.content) ? value.content.filter(isTipTapNodeLike).map(coerceTipTapNode) : []
|
|
@@ -148861,7 +149044,7 @@ function unwrapRichTextValue(value) {
|
|
|
148861
149044
|
return EMPTY_SITE_BANNER_BODY;
|
|
148862
149045
|
}
|
|
148863
149046
|
function isTipTapNodeLike(value) {
|
|
148864
|
-
return
|
|
149047
|
+
return isRecord16(value) && typeof value.type === "string";
|
|
148865
149048
|
}
|
|
148866
149049
|
function coerceTipTapNode(value) {
|
|
148867
149050
|
return {
|
|
@@ -148869,9 +149052,9 @@ function coerceTipTapNode(value) {
|
|
|
148869
149052
|
...Array.isArray(value.content) ? { content: value.content.filter(isTipTapNodeLike).map(coerceTipTapNode) } : {},
|
|
148870
149053
|
...typeof value.text === "string" ? { text: value.text } : {},
|
|
148871
149054
|
...Array.isArray(value.marks) ? {
|
|
148872
|
-
marks: value.marks.filter((mark) =>
|
|
149055
|
+
marks: value.marks.filter((mark) => isRecord16(mark) && typeof mark.type === "string").map((mark) => ({
|
|
148873
149056
|
type: mark.type,
|
|
148874
|
-
...
|
|
149057
|
+
...isRecord16(mark.attrs) ? { attrs: mark.attrs } : {}
|
|
148875
149058
|
}))
|
|
148876
149059
|
} : {}
|
|
148877
149060
|
};
|
|
@@ -149327,6 +149510,15 @@ function fromArray(items) {
|
|
|
149327
149510
|
if (first2 === void 0) return err3("empty_array");
|
|
149328
149511
|
return ok$1([first2, ...rest]);
|
|
149329
149512
|
}
|
|
149513
|
+
function isPresent(value) {
|
|
149514
|
+
return value !== null && value !== void 0;
|
|
149515
|
+
}
|
|
149516
|
+
function isNonEmptyString(value) {
|
|
149517
|
+
return typeof value === "string" && value.length > 0;
|
|
149518
|
+
}
|
|
149519
|
+
function hasText(value) {
|
|
149520
|
+
return isNonEmptyString(value);
|
|
149521
|
+
}
|
|
149330
149522
|
var IMAGE_FILE_FORMATS = [
|
|
149331
149523
|
"jpeg",
|
|
149332
149524
|
"png",
|
|
@@ -149411,7 +149603,7 @@ function asPositiveSeconds(value) {
|
|
|
149411
149603
|
if (!Number.isSafeInteger(value) || value <= 0) return err3("not-positive-seconds");
|
|
149412
149604
|
return ok$1(value);
|
|
149413
149605
|
}
|
|
149414
|
-
function
|
|
149606
|
+
function isRecord21(value) {
|
|
149415
149607
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
149416
149608
|
}
|
|
149417
149609
|
function parseFileKindJson(value) {
|
|
@@ -149636,7 +149828,7 @@ function parseEntitledCustomerAccessScopeJson(value) {
|
|
|
149636
149828
|
}
|
|
149637
149829
|
}
|
|
149638
149830
|
function requireRecord(value) {
|
|
149639
|
-
if (!
|
|
149831
|
+
if (!isRecord21(value)) return err3("expected-object");
|
|
149640
149832
|
return ok$1(value);
|
|
149641
149833
|
}
|
|
149642
149834
|
function requireString(value) {
|
|
@@ -149754,14 +149946,14 @@ function assertRelativeStoragePath(value) {
|
|
|
149754
149946
|
}
|
|
149755
149947
|
var pad = (value) => value.toString().padStart(2, "0");
|
|
149756
149948
|
var extractExtension = (filename) => {
|
|
149757
|
-
if (!filename) return "";
|
|
149949
|
+
if (!hasText(filename)) return "";
|
|
149758
149950
|
const lastDot = filename.lastIndexOf(".");
|
|
149759
149951
|
if (lastDot === -1) return "";
|
|
149760
149952
|
return filename.slice(lastDot).toLowerCase();
|
|
149761
149953
|
};
|
|
149762
149954
|
var generateId4 = () => {
|
|
149763
149955
|
const crypto2 = globalThis.crypto;
|
|
149764
|
-
if (crypto2 && typeof crypto2.getRandomValues === "function") {
|
|
149956
|
+
if (isPresent(crypto2) && typeof crypto2.getRandomValues === "function") {
|
|
149765
149957
|
const array = crypto2.getRandomValues(/* @__PURE__ */ new Uint32Array(4));
|
|
149766
149958
|
return Array.from(array).map((value) => value.toString(16).padStart(8, "0")).join("-");
|
|
149767
149959
|
}
|
|
@@ -157408,12 +157600,12 @@ var DEFAULT_MESSAGES = {
|
|
|
157408
157600
|
update: "Failed to update media asset",
|
|
157409
157601
|
delete: "Failed to delete media asset"
|
|
157410
157602
|
};
|
|
157411
|
-
function
|
|
157603
|
+
function isRecord22(value) {
|
|
157412
157604
|
return typeof value === "object" && value !== null;
|
|
157413
157605
|
}
|
|
157414
|
-
var normalizeLabels = (labels) => labels && labels.length ? labels.map((label) => label.trim()).filter(
|
|
157606
|
+
var normalizeLabels = (labels) => labels !== void 0 && labels.length > 0 ? labels.map((label) => label.trim()).filter((label) => label.length > 0).join(",") : void 0;
|
|
157415
157607
|
var fileFilterForMediaKinds = (mediaKinds) => {
|
|
157416
|
-
if (
|
|
157608
|
+
if (mediaKinds === void 0 || mediaKinds.length !== 1) return void 0;
|
|
157417
157609
|
const [mediaKind] = mediaKinds;
|
|
157418
157610
|
if (mediaKind === void 0) return void 0;
|
|
157419
157611
|
switch (mediaKind) {
|
|
@@ -157446,7 +157638,7 @@ var filterUpdatePayload = (input) => {
|
|
|
157446
157638
|
return payload;
|
|
157447
157639
|
};
|
|
157448
157640
|
var extractErrorMessage = (body) => {
|
|
157449
|
-
if (!
|
|
157641
|
+
if (!isRecord22(body)) return typeof body === "string" && body.trim().length > 0 ? body : null;
|
|
157450
157642
|
for (const key of [
|
|
157451
157643
|
"error",
|
|
157452
157644
|
"message",
|
|
@@ -157459,11 +157651,11 @@ var extractErrorMessage = (body) => {
|
|
|
157459
157651
|
const details = body.details;
|
|
157460
157652
|
if (Array.isArray(details)) for (const entry of details) {
|
|
157461
157653
|
if (typeof entry === "string" && entry.trim().length > 0) return entry;
|
|
157462
|
-
if (
|
|
157654
|
+
if (isRecord22(entry) && typeof entry.message === "string" && entry.message.trim().length > 0) return entry.message;
|
|
157463
157655
|
}
|
|
157464
157656
|
const errors = body.errors;
|
|
157465
157657
|
if (Array.isArray(errors)) {
|
|
157466
|
-
for (const entry of errors) if (
|
|
157658
|
+
for (const entry of errors) if (isRecord22(entry) && typeof entry.message === "string" && entry.message.trim().length > 0) return entry.message;
|
|
157467
157659
|
}
|
|
157468
157660
|
return null;
|
|
157469
157661
|
};
|
|
@@ -157570,7 +157762,7 @@ function createCachedMediaRepo(baseRepo, options) {
|
|
|
157570
157762
|
}
|
|
157571
157763
|
function readCache(key, cache) {
|
|
157572
157764
|
const entry = cache.get(key);
|
|
157573
|
-
if (
|
|
157765
|
+
if (entry === void 0) return null;
|
|
157574
157766
|
if (entry.expiresAt <= Date.now()) {
|
|
157575
157767
|
cache.delete(key);
|
|
157576
157768
|
return null;
|
|
@@ -157592,10 +157784,10 @@ function createCachedMediaRepo(baseRepo, options) {
|
|
|
157592
157784
|
async getAsset(assetId) {
|
|
157593
157785
|
const cacheKey = `asset:${assetId}`;
|
|
157594
157786
|
const entry = globalAssetCache.get(cacheKey);
|
|
157595
|
-
if (entry) if (entry.expiresAt > Date.now()) return entry.data;
|
|
157787
|
+
if (entry !== void 0) if (entry.expiresAt > Date.now()) return entry.data;
|
|
157596
157788
|
else globalAssetCache.delete(cacheKey);
|
|
157597
157789
|
const inflightRequest = globalAssetInflightRequests.get(assetId);
|
|
157598
|
-
if (inflightRequest) return inflightRequest;
|
|
157790
|
+
if (inflightRequest !== void 0) return inflightRequest;
|
|
157599
157791
|
const fetchPromise = baseRepo.getAsset(assetId).then((result) => {
|
|
157600
157792
|
writeCache(cacheKey, result, globalAssetCache);
|
|
157601
157793
|
globalAssetInflightRequests.delete(assetId);
|
|
@@ -157610,7 +157802,7 @@ function createCachedMediaRepo(baseRepo, options) {
|
|
|
157610
157802
|
async listAssets(options2) {
|
|
157611
157803
|
const cacheKey = buildCacheKey(options2);
|
|
157612
157804
|
const cached = readCache(cacheKey, globalListCache);
|
|
157613
|
-
if (cached) return cached;
|
|
157805
|
+
if (cached !== null) return cached;
|
|
157614
157806
|
const result = await baseRepo.listAssets(options2);
|
|
157615
157807
|
writeCache(cacheKey, result, globalListCache);
|
|
157616
157808
|
return result;
|
|
@@ -159990,7 +160182,7 @@ function sanitizeSlugInput(value, maxLength) {
|
|
|
159990
160182
|
}
|
|
159991
160183
|
|
|
159992
160184
|
// ../block-form/src/widgets/SlugField/utils/slugUtils.ts
|
|
159993
|
-
function
|
|
160185
|
+
function isRecord23(value) {
|
|
159994
160186
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
159995
160187
|
}
|
|
159996
160188
|
function isUnknownArray6(value) {
|
|
@@ -160006,7 +160198,7 @@ function ensureUniqueSlug(candidate, backend, collectionPath, currentIndex, fiel
|
|
|
160006
160198
|
for (let i2 = 0; i2 < items.length; i2 += 1) {
|
|
160007
160199
|
if (i2 === currentIndex) continue;
|
|
160008
160200
|
const item = items[i2];
|
|
160009
|
-
if (
|
|
160201
|
+
if (isRecord23(item)) {
|
|
160010
160202
|
const value = item[fieldId];
|
|
160011
160203
|
if (typeof value === "string") {
|
|
160012
160204
|
const normalized = normalize2(value.trim());
|
|
@@ -182929,7 +183121,7 @@ function normaliseDoc(doc3) {
|
|
|
182929
183121
|
}
|
|
182930
183122
|
|
|
182931
183123
|
// ../editor/src/primitives/rich-text/sanitize.ts
|
|
182932
|
-
function
|
|
183124
|
+
function isRecord24(value) {
|
|
182933
183125
|
return typeof value === "object" && value !== null;
|
|
182934
183126
|
}
|
|
182935
183127
|
function getFromMapLike(mapLike, name) {
|
|
@@ -182954,7 +183146,7 @@ function parentInlineContent(parentType) {
|
|
|
182954
183146
|
return Boolean(p2?.inlineContent);
|
|
182955
183147
|
}
|
|
182956
183148
|
function extractText(nodeJson) {
|
|
182957
|
-
if (!
|
|
183149
|
+
if (!isRecord24(nodeJson)) return "";
|
|
182958
183150
|
if (nodeJson.type === "text" && typeof nodeJson.text === "string") {
|
|
182959
183151
|
return nodeJson.text;
|
|
182960
183152
|
}
|
|
@@ -182965,13 +183157,13 @@ function sanitizeMarksJson(schema, marks, unsupported) {
|
|
|
182965
183157
|
if (!Array.isArray(marks)) return void 0;
|
|
182966
183158
|
const out = [];
|
|
182967
183159
|
for (const markJson of marks) {
|
|
182968
|
-
if (!
|
|
183160
|
+
if (!isRecord24(markJson) || typeof markJson.type !== "string") continue;
|
|
182969
183161
|
if (!schemaHasMark(schema, markJson.type)) {
|
|
182970
183162
|
unsupported.marks.add(markJson.type);
|
|
182971
183163
|
continue;
|
|
182972
183164
|
}
|
|
182973
183165
|
const next = { type: markJson.type };
|
|
182974
|
-
if (
|
|
183166
|
+
if (isRecord24(markJson.attrs)) next.attrs = markJson.attrs;
|
|
182975
183167
|
out.push(next);
|
|
182976
183168
|
}
|
|
182977
183169
|
return out.length > 0 ? out : void 0;
|
|
@@ -182980,7 +183172,7 @@ function coerceChildrenForParentJson(schema, parentType, children) {
|
|
|
182980
183172
|
if (parentInlineContent(parentType)) {
|
|
182981
183173
|
const inlines = [];
|
|
182982
183174
|
for (const child of children) {
|
|
182983
|
-
if (
|
|
183175
|
+
if (isRecord24(child) && typeof child.type === "string" && nodeTypeIsInline(schema, child.type)) {
|
|
182984
183176
|
inlines.push(child);
|
|
182985
183177
|
continue;
|
|
182986
183178
|
}
|
|
@@ -183003,7 +183195,7 @@ function coerceChildrenForParentJson(schema, parentType, children) {
|
|
|
183003
183195
|
inlineBuffer = [];
|
|
183004
183196
|
};
|
|
183005
183197
|
for (const child of children) {
|
|
183006
|
-
if (
|
|
183198
|
+
if (isRecord24(child) && typeof child.type === "string" && nodeTypeIsInline(schema, child.type)) {
|
|
183007
183199
|
inlineBuffer.push(child);
|
|
183008
183200
|
continue;
|
|
183009
183201
|
}
|
|
@@ -183014,7 +183206,7 @@ function coerceChildrenForParentJson(schema, parentType, children) {
|
|
|
183014
183206
|
return blocks;
|
|
183015
183207
|
}
|
|
183016
183208
|
function sanitizeNodeJson(schema, nodeJson, parentType, unsupported) {
|
|
183017
|
-
if (!
|
|
183209
|
+
if (!isRecord24(nodeJson) || typeof nodeJson.type !== "string") return [];
|
|
183018
183210
|
const type = nodeJson.type;
|
|
183019
183211
|
if (type === "text") {
|
|
183020
183212
|
const text2 = typeof nodeJson.text === "string" ? nodeJson.text : "";
|
|
@@ -183035,7 +183227,7 @@ function sanitizeNodeJson(schema, nodeJson, parentType, unsupported) {
|
|
|
183035
183227
|
const coercedChildren = coerceChildrenForParentJson(schema, nodeType, sanitizedChildren);
|
|
183036
183228
|
const marks = sanitizeMarksJson(schema, nodeJson.marks, unsupported);
|
|
183037
183229
|
const next = { type };
|
|
183038
|
-
if (
|
|
183230
|
+
if (isRecord24(nodeJson.attrs)) next.attrs = nodeJson.attrs;
|
|
183039
183231
|
if (marks) next.marks = marks;
|
|
183040
183232
|
if (hasRawChildren || coercedChildren.length > 0) next.content = coercedChildren;
|
|
183041
183233
|
return [next];
|
|
@@ -183055,7 +183247,7 @@ function sanitizeRichTextContentForSchema(schema, content) {
|
|
|
183055
183247
|
const coerced = coerceChildrenForParentJson(schema, topType, children);
|
|
183056
183248
|
const out = { type: "doc", content: coerced };
|
|
183057
183249
|
const maybeAttrs = docJson.attrs;
|
|
183058
|
-
if (
|
|
183250
|
+
if (isRecord24(maybeAttrs)) {
|
|
183059
183251
|
out.attrs = maybeAttrs;
|
|
183060
183252
|
}
|
|
183061
183253
|
return {
|