@riverbankcms/sdk 0.90.0 → 0.90.1
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-FNFRVSIM.mjs} +2 -2
- package/dist/{PreviewEditorUI-J3JN5Z7T.mjs → PreviewEditorUI-3WXJFQXG.mjs} +2 -2
- package/dist/SdkPreviewModeRuntime-2UCIMKUB.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/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/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-PMBB6MQ7.mjs → chunk-CR2VX432.mjs} +297 -117
- package/dist/{chunk-AEOYWPE4.mjs → chunk-FA6LVZ7C.mjs} +5 -5
- package/dist/{chunk-RQ3XZ4SJ.mjs → chunk-H6TT5ZXI.mjs} +1 -1
- package/dist/{chunk-GSPFFUVB.mjs → chunk-SYYJZPKU.mjs} +1 -1
- package/dist/cli/index.mjs +160 -103
- package/dist/client/{accordion-GXQNWQ6O.mjs → accordion-4K7VGZ3I.mjs} +2 -2
- package/dist/client/{bookingForm-STLUJ36H.mjs → bookingForm-3QXA3CIS.mjs} +5 -5
- package/dist/client/bookings.mjs +1154 -556
- package/dist/client/{carousel-CVRN6EPP.mjs → carousel-BEJKNGQ7.mjs} +3 -3
- package/dist/client/{cart-IYIBA5CL.mjs → cart-44BBM6XG.mjs} +6 -6
- package/dist/client/{checkout-O3BGM4GS.mjs → checkout-THMHEYKF.mjs} +6 -6
- package/dist/client/{chunk-25W2EQUN.mjs → chunk-3H5CLFKT.mjs} +8 -0
- package/dist/client/{chunk-MFPKS6QS.mjs → chunk-4COPESPO.mjs} +5 -5
- package/dist/client/{chunk-4RTFGHZN.mjs → chunk-5AJIMWKS.mjs} +6 -3
- package/dist/client/{chunk-6DPXDOIL.mjs → chunk-B4H6QMPY.mjs} +93 -22
- package/dist/client/{chunk-VFHZLZAC.mjs → chunk-DQIRKNZE.mjs} +1 -1
- package/dist/client/{chunk-7DH35FGA.mjs → chunk-EJBHK74Y.mjs} +1 -1
- package/dist/client/{chunk-DAS5CIER.mjs → chunk-JV7ZNAOU.mjs} +118 -20
- package/dist/client/{chunk-FHU6PFPM.mjs → chunk-KNTLBQ3N.mjs} +1 -1
- package/dist/client/{chunk-Z62JYS5O.mjs → chunk-PEDNDLPB.mjs} +2 -2
- package/dist/client/{chunk-NBFRJ5NB.mjs → chunk-SLY6UDAS.mjs} +2 -2
- package/dist/client/{chunk-D3ETC2SU.mjs → chunk-ZIAF2DA4.mjs} +1 -1
- package/dist/client/client.mjs +272 -83
- package/dist/client/{courseRegistration-2D3ACMJR.mjs → courseRegistration-URX7RCCK.mjs} +5 -5
- package/dist/client/{eventCalendar-QY4UZUFF.mjs → eventCalendar-GTENOQCE.mjs} +8 -8
- package/dist/client/{eventCombined-RRCDKJC2.mjs → eventCombined-EZVB72MF.mjs} +8 -8
- package/dist/client/{eventDetails-YO335BUT.mjs → eventDetails-CH4BJR5Z.mjs} +8 -8
- package/dist/client/{eventListing-PXA6GFQ3.mjs → eventListing-4BVOI5HS.mjs} +8 -8
- package/dist/client/{eventRegistration-2ZHEDDXO.mjs → eventRegistration-37LPIKIE.mjs} +8 -8
- package/dist/client/{form-ZS6KX4U2.mjs → form-FX3Y54YK.mjs} +2 -2
- package/dist/client/{headerSection-QK5SLIIB.mjs → headerSection-UOZZGVYL.mjs} +3 -3
- package/dist/client/hooks.mjs +86 -35
- package/dist/client/{locationMap-GFNIUD2X.mjs → locationMap-VSIPKV35.mjs} +3 -3
- package/dist/client/{newsletterForm-PGLTTCUG.mjs → newsletterForm-6FRJKNAF.mjs} +2 -2
- package/dist/client/{productDetail-OPBE5ZPI.mjs → productDetail-6AHMLXCO.mjs} +6 -6
- package/dist/client/{productList-NI72Q62Z.mjs → productList-M2CYIZVH.mjs} +6 -6
- package/dist/client/rendering/client.mjs +231 -42
- package/dist/client/rendering/islands.mjs +19 -19
- package/dist/client/rendering.mjs +273 -84
- package/dist/client/{shop-3ZQPEWYI.mjs → shop-AUOT6GEX.mjs} +6 -6
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/{sdk-runtime-FSHXCWDS.mjs → sdk-runtime-6GPJNLU6.mjs} +4 -4
- package/dist/server/components.mjs +136 -58
- package/dist/server/config-validation.mjs +78 -27
- package/dist/server/config.mjs +78 -27
- package/dist/server/data.mjs +86 -35
- package/dist/server/index.mjs +1 -1
- package/dist/server/next.mjs +157 -79
- package/dist/server/page-converter.mjs +72 -21
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +148 -70
- package/dist/server/rendering.mjs +152 -74
- package/dist/server/routing.mjs +121 -44
- package/dist/server/server.mjs +95 -44
- package/package.json +2 -2
- package/dist/SdkPreviewModeRuntime-UBL6MSNP.mjs +0 -8
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { normalizeCarouselProps, CarouselNodeClient } from './chunk-
|
|
1
|
+
import { normalizeCarouselProps, CarouselNodeClient } from './chunk-EJBHK74Y.mjs';
|
|
2
2
|
import './chunk-6N7YRNYU.mjs';
|
|
3
3
|
import { mountReactIsland } from './chunk-N7PBWBWQ.mjs';
|
|
4
|
-
import { defineIslandPropsDecoder } from './chunk-
|
|
5
|
-
import './chunk-
|
|
4
|
+
import { defineIslandPropsDecoder } from './chunk-B4H6QMPY.mjs';
|
|
5
|
+
import './chunk-3H5CLFKT.mjs';
|
|
6
6
|
import { jsx } from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
8
|
var decode = defineIslandPropsDecoder("carousel");
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { mountShopBlockIsland, CartClient } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
1
|
+
import { mountShopBlockIsland, CartClient } from './chunk-4COPESPO.mjs';
|
|
2
|
+
import './chunk-DQIRKNZE.mjs';
|
|
3
|
+
import './chunk-EJBHK74Y.mjs';
|
|
4
4
|
import './chunk-6N7YRNYU.mjs';
|
|
5
5
|
import './chunk-L4J5Y62O.mjs';
|
|
6
|
-
import './chunk-
|
|
6
|
+
import './chunk-SLY6UDAS.mjs';
|
|
7
7
|
import './chunk-3DCJ45Z2.mjs';
|
|
8
8
|
import './chunk-WBQG7VJA.mjs';
|
|
9
9
|
import './chunk-WHZQDPBZ.mjs';
|
|
10
10
|
import './chunk-N7PBWBWQ.mjs';
|
|
11
|
-
import { defineIslandPropsDecoder } from './chunk-
|
|
12
|
-
import './chunk-
|
|
11
|
+
import { defineIslandPropsDecoder } from './chunk-B4H6QMPY.mjs';
|
|
12
|
+
import './chunk-3H5CLFKT.mjs';
|
|
13
13
|
|
|
14
14
|
// src/rendering/islands/enhancers/cart.tsx
|
|
15
15
|
var decode = defineIslandPropsDecoder("cart");
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { mountShopBlockIsland, CheckoutClient } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
1
|
+
import { mountShopBlockIsland, CheckoutClient } from './chunk-4COPESPO.mjs';
|
|
2
|
+
import './chunk-DQIRKNZE.mjs';
|
|
3
|
+
import './chunk-EJBHK74Y.mjs';
|
|
4
4
|
import './chunk-6N7YRNYU.mjs';
|
|
5
5
|
import './chunk-L4J5Y62O.mjs';
|
|
6
|
-
import './chunk-
|
|
6
|
+
import './chunk-SLY6UDAS.mjs';
|
|
7
7
|
import './chunk-3DCJ45Z2.mjs';
|
|
8
8
|
import './chunk-WBQG7VJA.mjs';
|
|
9
9
|
import './chunk-WHZQDPBZ.mjs';
|
|
10
10
|
import './chunk-N7PBWBWQ.mjs';
|
|
11
|
-
import { defineIslandPropsDecoder } from './chunk-
|
|
12
|
-
import './chunk-
|
|
11
|
+
import { defineIslandPropsDecoder } from './chunk-B4H6QMPY.mjs';
|
|
12
|
+
import './chunk-3H5CLFKT.mjs';
|
|
13
13
|
|
|
14
14
|
// src/rendering/islands/enhancers/checkout.tsx
|
|
15
15
|
var decode = defineIslandPropsDecoder("checkout");
|
|
@@ -88,6 +88,8 @@ function publicEventPricingType(pricing) {
|
|
|
88
88
|
case "ticket_types":
|
|
89
89
|
case "course":
|
|
90
90
|
return isFreePublicEventPriceDisplay(pricing.display) ? "free" : "paid";
|
|
91
|
+
case "external":
|
|
92
|
+
return "external";
|
|
91
93
|
}
|
|
92
94
|
}
|
|
93
95
|
function publicEventPricingCurrency(pricing) {
|
|
@@ -99,6 +101,8 @@ function publicEventPricingCurrency(pricing) {
|
|
|
99
101
|
return pricing.currency;
|
|
100
102
|
case "course":
|
|
101
103
|
return pricing.display.display.currency;
|
|
104
|
+
case "external":
|
|
105
|
+
return null;
|
|
102
106
|
}
|
|
103
107
|
}
|
|
104
108
|
function publicEventScalarPrice(pricing) {
|
|
@@ -113,6 +117,7 @@ function publicEventPricingMode(pricing) {
|
|
|
113
117
|
return "ticket_types";
|
|
114
118
|
case "drop_in":
|
|
115
119
|
case "course":
|
|
120
|
+
case "external":
|
|
116
121
|
return void 0;
|
|
117
122
|
}
|
|
118
123
|
}
|
|
@@ -130,6 +135,7 @@ function isFreePublicEventPriceDisplay(display) {
|
|
|
130
135
|
case "range":
|
|
131
136
|
case "mixed":
|
|
132
137
|
case "unavailable":
|
|
138
|
+
case "external":
|
|
133
139
|
return false;
|
|
134
140
|
}
|
|
135
141
|
}
|
|
@@ -160,6 +166,8 @@ function formatBookingPriceDisplay(display, options = {}) {
|
|
|
160
166
|
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)}`;
|
|
161
167
|
case "unavailable":
|
|
162
168
|
return "Pricing unavailable";
|
|
169
|
+
case "external":
|
|
170
|
+
return display.label;
|
|
163
171
|
case "course":
|
|
164
172
|
return formatCoursePriceDisplayLabel(display.display, options);
|
|
165
173
|
default:
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { addPassToCommerceCart, useCommerceCart } from './chunk-
|
|
3
|
-
import { CarouselNodeClient } from './chunk-
|
|
2
|
+
import { addPassToCommerceCart, useCommerceCart } from './chunk-DQIRKNZE.mjs';
|
|
3
|
+
import { CarouselNodeClient } from './chunk-EJBHK74Y.mjs';
|
|
4
4
|
import { buildRouteIslandApiConfig } from './chunk-L4J5Y62O.mjs';
|
|
5
|
-
import { useDiscountCodeUi, createBodyThemePortalRoot, consumeSearchParams, scrollToBlock, TerminalPanel, StateIcon, CheckIcon, CrossIcon, ActionRow, DiscountCodeDisclosure, consumeSearchParam, buildCheckoutReturnUrls } from './chunk-
|
|
5
|
+
import { useDiscountCodeUi, createBodyThemePortalRoot, consumeSearchParams, scrollToBlock, TerminalPanel, StateIcon, CheckIcon, CrossIcon, ActionRow, DiscountCodeDisclosure, consumeSearchParam, buildCheckoutReturnUrls } from './chunk-SLY6UDAS.mjs';
|
|
6
6
|
import { ModalShell, resolveDedicatedCheckoutPath } from './chunk-WBQG7VJA.mjs';
|
|
7
7
|
import { useBlockApi, FeedbackMessage, BlockApiProvider, discountAvailabilityHasDiscounts, discountAvailabilityAllowsManualEntry, getAutoAppliedDiscountPreview } from './chunk-WHZQDPBZ.mjs';
|
|
8
8
|
import { mountReactIsland } from './chunk-N7PBWBWQ.mjs';
|
|
9
|
-
import { themeButtonClassName, formatCommercePrice, formatInterval, getShopDisplayForItems, deriveCommerceCheckoutState, buildProductDetailDisplay, productItemKey, buildProductCartItem, buildProductCardDisplay, assertNever as assertNever$1, reportWorkflowError, clearWorkflowFeedback, unwrapRichTextRoot, createRichTextDocFromMarkdown, isRecord } from './chunk-
|
|
10
|
-
import { assertNever, ok, err, getCurrentResolveImageUrlContext, resolveImageUrlWithContext, ImagePresets } from './chunk-
|
|
9
|
+
import { themeButtonClassName, formatCommercePrice, formatInterval, getShopDisplayForItems, deriveCommerceCheckoutState, buildProductDetailDisplay, productItemKey, buildProductCartItem, buildProductCardDisplay, assertNever as assertNever$1, reportWorkflowError, clearWorkflowFeedback, unwrapRichTextRoot, createRichTextDocFromMarkdown, isRecord } from './chunk-B4H6QMPY.mjs';
|
|
10
|
+
import { assertNever, ok, err, getCurrentResolveImageUrlContext, resolveImageUrlWithContext, ImagePresets } from './chunk-3H5CLFKT.mjs';
|
|
11
11
|
import * as React3 from 'react';
|
|
12
12
|
import React3__default, { useState, useRef, useCallback, useEffect } from 'react';
|
|
13
13
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { formatPrice } from './chunk-
|
|
3
|
-
import { assertNever } from './chunk-
|
|
4
|
-
import { resolveFlexibleBalanceInitialPaymentCents, resolveFlexibleBalanceDueAt, getBookingInstalmentDepositRefundability, splitAmountWithRemainderInFirst, addIntervalPreservingMonthAnchor, clampConfiguredAmount, getBookingInstalmentPlanIntervalCount, omitZeroAmountFutureRows } from './chunk-
|
|
2
|
+
import { formatPrice } from './chunk-SLY6UDAS.mjs';
|
|
3
|
+
import { assertNever } from './chunk-B4H6QMPY.mjs';
|
|
4
|
+
import { resolveFlexibleBalanceInitialPaymentCents, resolveFlexibleBalanceDueAt, getBookingInstalmentDepositRefundability, splitAmountWithRemainderInFirst, addIntervalPreservingMonthAnchor, clampConfiguredAmount, getBookingInstalmentPlanIntervalCount, omitZeroAmountFutureRows } from './chunk-3H5CLFKT.mjs';
|
|
5
5
|
import { useReducer, useRef, useCallback, useEffect } from 'react';
|
|
6
6
|
|
|
7
7
|
// ../blocks/src/system/runtime/shared/bookingPaymentOptionCopy.ts
|
|
@@ -146,8 +146,10 @@ function buildBookingPaymentOptionViewModel(input) {
|
|
|
146
146
|
totalAmountCents: input.totalCents,
|
|
147
147
|
config: input.option.config
|
|
148
148
|
});
|
|
149
|
+
const remainingBalance = Math.max(0, input.totalCents - dueToday);
|
|
149
150
|
const formattedTotal = formatPrice(input.totalCents, input.currency, input.locale);
|
|
150
151
|
const formattedDueToday = formatPrice(dueToday, input.currency, input.locale);
|
|
152
|
+
const formattedRemainingBalance = formatPrice(remainingBalance, input.currency, input.locale);
|
|
151
153
|
const dueAt = resolveFlexibleBalanceDueAt({
|
|
152
154
|
bookingStartAt: input.bookingStartAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
153
155
|
dueDateRule: input.option.config.dueDateRule
|
|
@@ -164,6 +166,7 @@ function buildBookingPaymentOptionViewModel(input) {
|
|
|
164
166
|
summaryRows: [
|
|
165
167
|
{ label: "Total", value: formattedTotal },
|
|
166
168
|
{ label: "Due today", value: formattedDueToday },
|
|
169
|
+
{ label: "Remaining balance", value: formattedRemainingBalance },
|
|
167
170
|
{ label: "Balance due by", value: formatScheduleDate(dueAt, input.locale) },
|
|
168
171
|
{
|
|
169
172
|
label: "Deposit policy",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { parseAspectRatioValue, parseColorTokenParts, toBookingTimeZone, formatBookingDate, toScheduledBookingDateTime, formatBookingTime, toScheduledBookingDateRange, formatBookingDateParts, formatEventPricing, ImagePresets, getBookingLocalDateKey, publicEventPricingType, formatCurrencyAmount, getCurrentResolveImageUrlContext, renderVideo, renderAudio, resolveMediaNodeResponsiveImage, MediaPlaceholder, computeMediaTransformStyle, rgbColorValue } from './chunk-
|
|
1
|
+
import { parseAspectRatioValue, parseColorTokenParts, toBookingTimeZone, formatBookingDate, toScheduledBookingDateTime, formatBookingTime, toScheduledBookingDateRange, formatBookingDateParts, formatEventPricing, ImagePresets, getBookingLocalDateKey, publicEventPricingType, formatCurrencyAmount, getCurrentResolveImageUrlContext, renderVideo, renderAudio, resolveMediaNodeResponsiveImage, MediaPlaceholder, computeMediaTransformStyle, rgbColorValue } from './chunk-3H5CLFKT.mjs';
|
|
2
2
|
import z2, { z } from 'zod';
|
|
3
3
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
|
|
@@ -356,6 +356,18 @@ z.array(publicCourseSchema);
|
|
|
356
356
|
var eventPresetSchema = z.enum(["event", "class", "workshop", "retreat", "performance"]);
|
|
357
357
|
var eventScheduleScopeSchema = z.enum(["recurring", "oneOff"]);
|
|
358
358
|
var eventDestinationModeSchema = z.enum(["cms-managed", "system-managed"]);
|
|
359
|
+
var publicEventDestinationSchema = z.discriminatedUnion("kind", [
|
|
360
|
+
z.object({
|
|
361
|
+
kind: z.literal("native"),
|
|
362
|
+
mode: eventDestinationModeSchema,
|
|
363
|
+
path: z.string()
|
|
364
|
+
}),
|
|
365
|
+
z.object({
|
|
366
|
+
kind: z.literal("external"),
|
|
367
|
+
url: z.string(),
|
|
368
|
+
label: z.string()
|
|
369
|
+
})
|
|
370
|
+
]);
|
|
359
371
|
var eventVenueSchema = z.object({
|
|
360
372
|
id: z.string(),
|
|
361
373
|
name: z.string(),
|
|
@@ -370,7 +382,7 @@ var eventCategorySchema = z.object({
|
|
|
370
382
|
name: z.string(),
|
|
371
383
|
color: z.string().nullable()
|
|
372
384
|
});
|
|
373
|
-
z.enum(["free", "paid"]);
|
|
385
|
+
z.enum(["free", "paid", "external"]);
|
|
374
386
|
var accessRestrictionSchema = z.enum(["none", "category"]);
|
|
375
387
|
z.enum(["single", "ticket_types"]);
|
|
376
388
|
var publicCoursePriceDisplaySchema = z.discriminatedUnion("kind", [
|
|
@@ -391,6 +403,7 @@ z.discriminatedUnion("kind", [
|
|
|
391
403
|
currency: z.string()
|
|
392
404
|
}),
|
|
393
405
|
z.object({ kind: z.literal("unavailable"), currency: z.string() }),
|
|
406
|
+
z.object({ kind: z.literal("external"), label: z.string() }),
|
|
394
407
|
z.object({ kind: z.literal("course"), display: publicCoursePriceDisplaySchema })
|
|
395
408
|
]);
|
|
396
409
|
var publicEventTicketTypePriceDisplaySchema = z.union([
|
|
@@ -469,6 +482,10 @@ var publicEventPricingSchema = z.discriminatedUnion("kind", [
|
|
|
469
482
|
z.object({
|
|
470
483
|
kind: z.literal("course"),
|
|
471
484
|
display: z.object({ kind: z.literal("course"), display: publicCoursePriceDisplaySchema })
|
|
485
|
+
}),
|
|
486
|
+
z.object({
|
|
487
|
+
kind: z.literal("external"),
|
|
488
|
+
display: z.object({ kind: z.literal("external"), label: z.string() })
|
|
472
489
|
})
|
|
473
490
|
]);
|
|
474
491
|
var publicTeamMemberSummarySchema = z.object({
|
|
@@ -497,7 +514,8 @@ var publicEventSchema = z.object({
|
|
|
497
514
|
image: mediaSchema.nullable().optional()
|
|
498
515
|
}).optional(),
|
|
499
516
|
slug: z.string(),
|
|
500
|
-
path: z.string(),
|
|
517
|
+
path: z.string().nullable(),
|
|
518
|
+
destination: publicEventDestinationSchema,
|
|
501
519
|
requiresRegistration: z.boolean(),
|
|
502
520
|
deliveryMode: z.enum(["in_person", "online", "hybrid"]),
|
|
503
521
|
attendanceModes: z.array(publicEventAttendanceModeAvailabilitySchema),
|
|
@@ -5695,12 +5713,41 @@ function getEventAvailability(event) {
|
|
|
5695
5713
|
return { available, isFull: false };
|
|
5696
5714
|
}
|
|
5697
5715
|
|
|
5716
|
+
// ../blocks/src/system/runtime/nodes/events/shared/destination.ts
|
|
5717
|
+
function isRecord3(value) {
|
|
5718
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
5719
|
+
}
|
|
5720
|
+
function isRuntimeEventDestination(value) {
|
|
5721
|
+
if (!isRecord3(value) || typeof value.kind !== "string") return false;
|
|
5722
|
+
if (value.kind === "native") {
|
|
5723
|
+
return (value.mode === "cms-managed" || value.mode === "system-managed") && typeof value.path === "string";
|
|
5724
|
+
}
|
|
5725
|
+
return value.kind === "external" && typeof value.url === "string" && typeof value.label === "string";
|
|
5726
|
+
}
|
|
5727
|
+
function resolveRuntimeEventDestination(event) {
|
|
5728
|
+
if (isRuntimeEventDestination(event.destination)) {
|
|
5729
|
+
return event.destination;
|
|
5730
|
+
}
|
|
5731
|
+
return {
|
|
5732
|
+
kind: "native",
|
|
5733
|
+
mode: event.eventDestinationMode === "system-managed" ? "system-managed" : "cms-managed",
|
|
5734
|
+
path: typeof event.path === "string" ? event.path : ""
|
|
5735
|
+
};
|
|
5736
|
+
}
|
|
5737
|
+
|
|
5698
5738
|
// ../blocks/src/system/runtime/nodes/events/shared/pricing.ts
|
|
5699
5739
|
var DEFAULT_EVENT_CURRENCY = "USD";
|
|
5700
5740
|
function resolveRuntimeEventPricing(event) {
|
|
5701
5741
|
if (isPublicEventPricing(event.pricing)) {
|
|
5702
5742
|
return event.pricing;
|
|
5703
5743
|
}
|
|
5744
|
+
const destination = resolveRuntimeEventDestination(event);
|
|
5745
|
+
if (destination.kind === "external") {
|
|
5746
|
+
return {
|
|
5747
|
+
kind: "external",
|
|
5748
|
+
display: { kind: "external", label: "External registration" }
|
|
5749
|
+
};
|
|
5750
|
+
}
|
|
5704
5751
|
const legacy = event;
|
|
5705
5752
|
const currency = readCurrency(legacy.currency);
|
|
5706
5753
|
if (event.requiresRegistration === false) {
|
|
@@ -5737,22 +5784,22 @@ function resolveRuntimeEventPricing(event) {
|
|
|
5737
5784
|
function readCurrency(value) {
|
|
5738
5785
|
return typeof value === "string" && value.trim().length > 0 ? value : DEFAULT_EVENT_CURRENCY;
|
|
5739
5786
|
}
|
|
5740
|
-
function
|
|
5787
|
+
function isRecord4(value) {
|
|
5741
5788
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
5742
5789
|
}
|
|
5743
5790
|
function isPublicEventPricing(value) {
|
|
5744
|
-
if (!
|
|
5745
|
-
return value.kind === "drop_in" || value.kind === "free_registration" || value.kind === "single_paid" || value.kind === "ticket_types" || value.kind === "course";
|
|
5791
|
+
if (!isRecord4(value) || typeof value.kind !== "string") return false;
|
|
5792
|
+
return value.kind === "drop_in" || value.kind === "free_registration" || value.kind === "single_paid" || value.kind === "ticket_types" || value.kind === "course" || value.kind === "external";
|
|
5746
5793
|
}
|
|
5747
5794
|
function isPublicEventTicketType(value) {
|
|
5748
|
-
return
|
|
5795
|
+
return isRecord4(value) && typeof value.id === "string";
|
|
5749
5796
|
}
|
|
5750
5797
|
function readTicketTypePriceDisplay(value, currency) {
|
|
5751
5798
|
const display = readLegacyPriceDisplay(value, currency);
|
|
5752
|
-
return display.kind === "course" ? { kind: "unavailable", currency } : display;
|
|
5799
|
+
return display.kind === "course" || display.kind === "external" ? { kind: "unavailable", currency } : display;
|
|
5753
5800
|
}
|
|
5754
5801
|
function readLegacyPriceDisplay(value, currency) {
|
|
5755
|
-
if (!
|
|
5802
|
+
if (!isRecord4(value) || typeof value.kind !== "string") {
|
|
5756
5803
|
return { kind: "unavailable", currency };
|
|
5757
5804
|
}
|
|
5758
5805
|
const displayCurrency = readCurrency(value.currency);
|
|
@@ -5791,7 +5838,7 @@ function readLegacyPriceDisplay(value, currency) {
|
|
|
5791
5838
|
case "unavailable":
|
|
5792
5839
|
return { kind: "unavailable", currency: displayCurrency };
|
|
5793
5840
|
case "course":
|
|
5794
|
-
return
|
|
5841
|
+
return isRecord4(value.display) ? {
|
|
5795
5842
|
kind: "course",
|
|
5796
5843
|
display: readCoursePriceDisplay(value.display, displayCurrency)
|
|
5797
5844
|
} : {
|
|
@@ -5949,16 +5996,28 @@ function formatEventPrice(event) {
|
|
|
5949
5996
|
function formatEventPriceDisplay(pricing) {
|
|
5950
5997
|
return formatEventPricing(pricing, { decimals: "auto" });
|
|
5951
5998
|
}
|
|
5999
|
+
function resolveEventHref(event) {
|
|
6000
|
+
const destination = resolveRuntimeEventDestination(event);
|
|
6001
|
+
return destination.kind === "external" ? destination.url : destination.path;
|
|
6002
|
+
}
|
|
6003
|
+
function resolveEventLinkProps(event) {
|
|
6004
|
+
const href = resolveEventHref(event);
|
|
6005
|
+
const destination = resolveRuntimeEventDestination(event);
|
|
6006
|
+
return destination.kind === "external" ? { href, target: "_blank", rel: "noopener noreferrer" } : { href };
|
|
6007
|
+
}
|
|
5952
6008
|
function resolveEventCta(event, buttonText) {
|
|
5953
6009
|
const { isFull: isSoldOut } = getEventAvailability(event);
|
|
5954
|
-
const
|
|
6010
|
+
const destination = resolveRuntimeEventDestination(event);
|
|
6011
|
+
const isExternal = destination.kind === "external";
|
|
6012
|
+
const defaultButtonText = isExternal ? destination.label : event.kind === "course_session" ? "Book course" : "Book";
|
|
5955
6013
|
const effectiveButtonText = buttonText ?? defaultButtonText;
|
|
5956
|
-
|
|
5957
|
-
|
|
6014
|
+
const href = resolveEventHref(event);
|
|
6015
|
+
if (!isExternal && isSoldOut) {
|
|
6016
|
+
return { label: "Sold out", href, external: false, hidden: true };
|
|
5958
6017
|
}
|
|
5959
6018
|
const enrollmentOpen = event.kind === "course_session" ? event.course?.enrollmentOpen !== false : true;
|
|
5960
6019
|
const label = !enrollmentOpen ? "Registration closed" : effectiveButtonText;
|
|
5961
|
-
return { label, href:
|
|
6020
|
+
return { label, href, external: isExternal, hidden: false };
|
|
5962
6021
|
}
|
|
5963
6022
|
var MediaNodeServer = ({
|
|
5964
6023
|
value,
|
|
@@ -6149,6 +6208,8 @@ var EventCard = ({
|
|
|
6149
6208
|
"a",
|
|
6150
6209
|
{
|
|
6151
6210
|
href: cta.href,
|
|
6211
|
+
target: cta.external ? "_blank" : void 0,
|
|
6212
|
+
rel: cta.external ? "noopener noreferrer" : void 0,
|
|
6152
6213
|
className: `${buttonClass} event-card-cta`,
|
|
6153
6214
|
children: cta.label
|
|
6154
6215
|
}
|
|
@@ -6504,10 +6565,19 @@ var EventCompactRow = ({
|
|
|
6504
6565
|
formattedTime,
|
|
6505
6566
|
/* @__PURE__ */ jsx("span", { className: "event-compact-row-action-price", children: price })
|
|
6506
6567
|
] }),
|
|
6507
|
-
cta.hidden ? /* @__PURE__ */ jsx("span", { className: "event-compact-row-status", children: cta.label }) : /* @__PURE__ */ jsxs(
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
|
-
|
|
6568
|
+
cta.hidden ? /* @__PURE__ */ jsx("span", { className: "event-compact-row-status", children: cta.label }) : /* @__PURE__ */ jsxs(
|
|
6569
|
+
"a",
|
|
6570
|
+
{
|
|
6571
|
+
href: cta.href,
|
|
6572
|
+
target: cta.external ? "_blank" : void 0,
|
|
6573
|
+
rel: cta.external ? "noopener noreferrer" : void 0,
|
|
6574
|
+
className: `${buttonClass} event-compact-row-cta`,
|
|
6575
|
+
children: [
|
|
6576
|
+
/* @__PURE__ */ jsx("span", { children: cta.label }),
|
|
6577
|
+
/* @__PURE__ */ jsx(ArrowRightIcon, { "aria-hidden": "true" })
|
|
6578
|
+
]
|
|
6579
|
+
}
|
|
6580
|
+
)
|
|
6511
6581
|
] })
|
|
6512
6582
|
] })
|
|
6513
6583
|
] });
|
|
@@ -7253,7 +7323,7 @@ function resolveEventRequiresPayment(input) {
|
|
|
7253
7323
|
if (!input.event) {
|
|
7254
7324
|
return false;
|
|
7255
7325
|
}
|
|
7256
|
-
return publicEventPricingType(resolveRuntimeEventPricing(input.event))
|
|
7326
|
+
return publicEventPricingType(resolveRuntimeEventPricing(input.event)) === "paid";
|
|
7257
7327
|
}
|
|
7258
7328
|
function resolveDiscountContext(input) {
|
|
7259
7329
|
const selection = input.paymentSelection.method ? input.paymentSelection : null;
|
|
@@ -7474,15 +7544,16 @@ var eventRegistrationBlockRuntime = defineClientOwnedBlockRuntime({
|
|
|
7474
7544
|
})
|
|
7475
7545
|
});
|
|
7476
7546
|
function normalizeEventRegistrationEventInput(value) {
|
|
7477
|
-
if (!
|
|
7547
|
+
if (!isRecord5(value)) {
|
|
7478
7548
|
return value;
|
|
7479
7549
|
}
|
|
7480
7550
|
return {
|
|
7481
7551
|
...value,
|
|
7552
|
+
destination: resolveRuntimeEventDestination(value),
|
|
7482
7553
|
pricing: resolveRuntimeEventPricing(value)
|
|
7483
7554
|
};
|
|
7484
7555
|
}
|
|
7485
|
-
function
|
|
7556
|
+
function isRecord5(value) {
|
|
7486
7557
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
7487
7558
|
}
|
|
7488
7559
|
var eventRegistrationInteractiveIslandPropsCodec = createInteractiveIslandCodec({
|
|
@@ -8900,4 +8971,4 @@ function defineIslandPropsDecoder(kind) {
|
|
|
8900
8971
|
};
|
|
8901
8972
|
}
|
|
8902
8973
|
|
|
8903
|
-
export { BOOKING_FORM_DATA_RESERVED_KEYS, DateTimeTile, EMPTY_COMMERCE_CART_STATE, EmptyState, EventCard, EventCompactRow, MAX_EVENTS_PER_DAY, MONTH_NAMES, WIZARD_STEPS, addMonths, assertNever, buildCalendarViewport, buildCartDisplay, buildEventCalendarListingRender, buildEventRuntimeFilters, buildPassCartItem, buildProductCardDisplay, buildProductCartItem, buildProductDetailDisplay, buildTimetableModel, clearWorkflowFeedback, createRichTextDocFromMarkdown, defineIslandPropsDecoder, deriveBookingFormViewState, deriveCommerceCheckoutState, err, findEventByOccurrenceId, findPreSelectedEvent, formatBookingSubmissionPreparationError, formatCommercePrice, formatDate, formatDateKey, formatEventDateParts, formatEventPrice, formatEventPriceDisplay, formatEventTeacherLine, formatInterval, formatTime, getBookingRedirectStateFromLocation, getBookingSuccessMessage, getCardOrientation, getContainerClass, getEventAvailability, getEventRuntimeFiltersKey, getOrderedDayNames, getShopDisplayForItems, getStepNumber, getThreeMonthRange, getWizardStepsForContext, groupEventsByDate, isEventContentType, isRecord, isToday, logger, normalizeCsvIds, normalizeCsvString, normalizeEventBlockKind, normalizeOptionalId, ok, okWith, parseStoredCommerceCartState, prepareBookingSubmission, productItemKey, reduceCommerceCart, reportWorkflowError, reportWorkflowSuccess, resolveAppointmentCheckoutVerificationState, resolveBookingPaymentStep, resolveBookingSiteId, resolveDefaultBookingServiceId, resolveDiscountContext, resolveEventRequiresPayment, resolveRegistrationTarget, resolveRuntimeEventPricing, shiftCalendarAnchorDate, themeButtonClassName, toRegistrationEvents, toSelectedCollectionOptionKind, unwrapRichTextRoot };
|
|
8974
|
+
export { BOOKING_FORM_DATA_RESERVED_KEYS, DateTimeTile, EMPTY_COMMERCE_CART_STATE, EmptyState, EventCard, EventCompactRow, MAX_EVENTS_PER_DAY, MONTH_NAMES, WIZARD_STEPS, addMonths, assertNever, buildCalendarViewport, buildCartDisplay, buildEventCalendarListingRender, buildEventRuntimeFilters, buildPassCartItem, buildProductCardDisplay, buildProductCartItem, buildProductDetailDisplay, buildTimetableModel, clearWorkflowFeedback, createRichTextDocFromMarkdown, defineIslandPropsDecoder, deriveBookingFormViewState, deriveCommerceCheckoutState, err, findEventByOccurrenceId, findPreSelectedEvent, formatBookingSubmissionPreparationError, formatCommercePrice, formatDate, formatDateKey, formatEventDateParts, formatEventPrice, formatEventPriceDisplay, formatEventTeacherLine, formatInterval, formatTime, getBookingRedirectStateFromLocation, getBookingSuccessMessage, getCardOrientation, getContainerClass, getEventAvailability, getEventRuntimeFiltersKey, getOrderedDayNames, getShopDisplayForItems, getStepNumber, getThreeMonthRange, getWizardStepsForContext, groupEventsByDate, isEventContentType, isRecord, isToday, logger, normalizeCsvIds, normalizeCsvString, normalizeEventBlockKind, normalizeOptionalId, ok, okWith, parseStoredCommerceCartState, prepareBookingSubmission, productItemKey, reduceCommerceCart, reportWorkflowError, reportWorkflowSuccess, resolveAppointmentCheckoutVerificationState, resolveBookingPaymentStep, resolveBookingSiteId, resolveDefaultBookingServiceId, resolveDiscountContext, resolveEventLinkProps, resolveEventRequiresPayment, resolveRegistrationTarget, resolveRuntimeEventPricing, shiftCalendarAnchorDate, themeButtonClassName, toRegistrationEvents, toSelectedCollectionOptionKind, unwrapRichTextRoot };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EMPTY_COMMERCE_CART_STATE, parseStoredCommerceCartState, reduceCommerceCart, buildPassCartItem } from './chunk-
|
|
1
|
+
import { EMPTY_COMMERCE_CART_STATE, parseStoredCommerceCartState, reduceCommerceCart, buildPassCartItem } from './chunk-B4H6QMPY.mjs';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
4
|
var EMPTY_STATE = EMPTY_COMMERCE_CART_STATE;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { ChevronLeft, ChevronRight } from './chunk-6N7YRNYU.mjs';
|
|
3
|
-
import { clsx_default } from './chunk-
|
|
3
|
+
import { clsx_default } from './chunk-3H5CLFKT.mjs';
|
|
4
4
|
import React, { useRef, useState, useCallback, useEffect } from 'react';
|
|
5
5
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
6
6
|
|