@riverbankcms/sdk 0.93.0 → 0.95.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/{PreviewEditorSidebar-D3PAF7NW.mjs → PreviewEditorSidebar-6FQYKOSB.mjs} +3 -3
- package/dist/{PreviewEditorUI-G5JVJEIJ.mjs → PreviewEditorUI-NPO2XMFB.mjs} +3 -3
- package/dist/SdkPreviewModeRuntime-PBEFH5AL.mjs +8 -0
- package/dist/_dts/api/src/bookingOperations.d.ts +7 -0
- package/dist/_dts/api/src/bookingRecords.d.ts +3 -0
- package/dist/_dts/api/src/cache-tags.d.ts +4 -0
- package/dist/_dts/api/src/contentRuntime.d.ts +14 -0
- package/dist/_dts/api/src/endpoints.d.ts +8 -0
- package/dist/_dts/api/src/event-presentation.d.ts +15 -0
- package/dist/_dts/api/src/index.d.ts +1 -1
- package/dist/_dts/api/src/public/endpoints.d.ts +1 -1
- package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +17 -4
- package/dist/_dts/api/src/shared-contracts.d.ts +19 -9
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +6 -1
- package/dist/_dts/blocks/src/portal/types.d.ts +7 -0
- package/dist/_dts/blocks/src/system/runtime/api/index.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/api/types.d.ts +21 -6
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/TicketSelectionStep.d.ts +5 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.contract.d.ts +5 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/hooks.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/sessionStorage.d.ts +9 -6
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/ticketSelectionLines.d.ts +36 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/types.d.ts +7 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationStripeReturn.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationSubmit.d.ts +2 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +19 -4
- package/dist/_dts/content-model/src/entry-slots/types.d.ts +6 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +163 -2
- package/dist/_dts/media-core/src/assetsInUseSummary.d.ts +7 -0
- package/dist/_dts/media-core/src/mediaUsageProjection.d.ts +29 -1
- package/dist/_dts/sdk/src/client/types.d.ts +7 -2
- package/dist/_dts/sdk/src/next/middleware.d.ts +1 -0
- package/dist/_dts/sdk/src/next/redirect-destination.d.ts +3 -0
- package/dist/_dts/sdk/src/next/route-outcome-proxy.d.ts +22 -0
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +20 -1
- package/dist/_dts/sdk/src/public-api/runtime.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/loadContent.d.ts +9 -1
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/{chunk-XIK2HYI3.mjs → chunk-4A6NWO3X.mjs} +7 -7
- package/dist/{chunk-NT76QGIJ.mjs → chunk-7ED5UNHL.mjs} +14 -0
- package/dist/{chunk-AQ6RT6LZ.mjs → chunk-K2SJTZMX.mjs} +2 -2
- package/dist/{chunk-A63UXN3P.mjs → chunk-PJPFTVZG.mjs} +2 -2
- package/dist/{chunk-AJZGT6YG.mjs → chunk-VTPPVAOL.mjs} +1 -1
- package/dist/{chunk-PCNCETBI.mjs → chunk-VZBSD4AJ.mjs} +449 -183
- package/dist/cli/index.mjs +176 -73
- package/dist/client/{accordion-RNQIPG55.mjs → accordion-LGO4IO5U.mjs} +1 -1
- package/dist/client/{bookingForm-HYEEVRLP.mjs → bookingForm-MWLS4LGU.mjs} +3 -3
- package/dist/client/bookings.mjs +211 -105
- package/dist/client/{carousel-W7DQ3YPU.mjs → carousel-6AHNP5HA.mjs} +1 -1
- package/dist/client/{cart-PXJ3SXXO.mjs → cart-CIXGYAZB.mjs} +4 -4
- package/dist/client/{checkout-X3JYSOXI.mjs → checkout-OTX6O3DN.mjs} +4 -4
- package/dist/client/{chunk-Q47XGAGS.mjs → chunk-AVBQSUIS.mjs} +1 -1
- package/dist/client/{chunk-WERRJXNJ.mjs → chunk-HOP7MKAZ.mjs} +1 -1
- package/dist/client/{chunk-IXDSXF2D.mjs → chunk-INRIT6DP.mjs} +353 -187
- package/dist/client/{chunk-DUOHLWLF.mjs → chunk-MYCXAKWP.mjs} +2 -2
- package/dist/client/{chunk-J6TMMMXW.mjs → chunk-R3NQTBWE.mjs} +1 -1
- package/dist/client/{chunk-YYVGSYBO.mjs → chunk-TREIML53.mjs} +3 -3
- package/dist/client/{chunk-6SYGVVWA.mjs → chunk-V67AT7ZW.mjs} +3 -0
- package/dist/client/{chunk-PICR3NTQ.mjs → chunk-Y2PMKCXO.mjs} +1 -1
- package/dist/client/client.mjs +503 -183
- package/dist/client/{courseRegistration-QZ67PVHO.mjs → courseRegistration-2LU6C3JL.mjs} +3 -3
- package/dist/client/{eventCalendar-V3BDHQNT.mjs → eventCalendar-OKUSISBZ.mjs} +6 -6
- package/dist/client/{eventCombined-XYFRN2RG.mjs → eventCombined-CMF6CD4S.mjs} +6 -6
- package/dist/client/{eventDetails-TFE5TWKV.mjs → eventDetails-XYWH7WXI.mjs} +6 -6
- package/dist/client/{eventListing-IQ6AGWZ6.mjs → eventListing-EK5DJTAH.mjs} +6 -6
- package/dist/client/{eventRegistration-WGJVFKQJ.mjs → eventRegistration-XDOSICV6.mjs} +6 -6
- package/dist/client/{form-6UZY6RUA.mjs → form-J6GOHKYG.mjs} +1 -1
- package/dist/client/{headerSection-RSFXY6V3.mjs → headerSection-C5SYJTRW.mjs} +2 -2
- package/dist/client/hooks.mjs +14 -0
- package/dist/client/{locationMap-24FH67I4.mjs → locationMap-QSQIFVVT.mjs} +2 -2
- package/dist/client/{newsletterForm-QVL3MLTN.mjs → newsletterForm-47VXJRWK.mjs} +1 -1
- package/dist/client/{productDetail-ZDYN3G4T.mjs → productDetail-5U6ISCC2.mjs} +4 -4
- package/dist/client/{productList-4BMJLQHZ.mjs → productList-XDZUMR3P.mjs} +4 -4
- package/dist/client/rendering/client.mjs +362 -182
- package/dist/client/rendering/islands.mjs +18 -18
- package/dist/client/rendering.mjs +489 -182
- package/dist/client/{shop-U5C634FF.mjs → shop-ZSZKIY3R.mjs} +4 -4
- package/dist/preview-next/before-render.mjs +14 -0
- package/dist/preview-next/client/runtime.mjs +5 -5
- package/dist/preview-next/middleware.mjs +14 -0
- package/dist/{sdk-runtime-VGV46WVB.mjs → sdk-runtime-PHNM7MRD.mjs} +6 -6
- package/dist/server/components.mjs +111 -0
- package/dist/server/config-validation.mjs +14 -0
- package/dist/server/config.mjs +14 -0
- package/dist/server/data.mjs +14 -0
- package/dist/server/index.mjs +44 -1
- package/dist/server/next/middleware.mjs +120 -0
- package/dist/server/next.mjs +225 -2
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +111 -0
- package/dist/server/rendering.mjs +127 -0
- package/dist/server/routing.mjs +14 -0
- package/dist/server/server.mjs +60 -1
- package/dist/server/theme-bridge.mjs +97 -0
- package/dist/styles/index.css +95 -0
- package/package.json +5 -1
- package/dist/SdkPreviewModeRuntime-NHTLRNQD.mjs +0 -8
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { buildBookingPaymentSelectionViewModel, usePolling } from './chunk-
|
|
2
|
+
import { buildBookingPaymentSelectionViewModel, usePolling } from './chunk-MYCXAKWP.mjs';
|
|
3
3
|
import { SpinnerNode } from './chunk-OLAOAZEO.mjs';
|
|
4
4
|
import { buildRouteIslandApiConfig } from './chunk-L4J5Y62O.mjs';
|
|
5
|
-
import { scrollToBlock, useDiscountCodeUi, buildCheckoutReturnUrls, DiscountCodeDisclosure } from './chunk-
|
|
5
|
+
import { scrollToBlock, useDiscountCodeUi, buildCheckoutReturnUrls, DiscountCodeDisclosure } from './chunk-R3NQTBWE.mjs';
|
|
6
6
|
import { FieldValidationMessage, getFieldValidationControlProps } from './chunk-3DCJ45Z2.mjs';
|
|
7
7
|
import './chunk-WBQG7VJA.mjs';
|
|
8
8
|
import { isSpamProtectionEnabled, getChallengeUrl, AltchaWidget } from './chunk-LJCX6V7Q.mjs';
|
|
9
9
|
import { BlockApiProvider, useBlockApi, FeedbackMessage } from './chunk-TNGL2WJF.mjs';
|
|
10
10
|
import { mountReactIsland } from './chunk-N7PBWBWQ.mjs';
|
|
11
|
-
import { defineIslandPropsDecoder, resolveBookingSiteId, resolveDefaultBookingServiceId, getBookingRedirectStateFromLocation, deriveBookingFormViewState, logger, getBookingSuccessMessage, getBookingServiceSlidingScale, formatBookingCentsAsCurrencyInput, parseBookingCurrencyInputToCents, resolveAppointmentCheckoutVerificationState, themeButtonClassName, toSelectedCollectionOptionKind, assertNever, prepareBookingSubmission, formatBookingSubmissionPreparationError, resolveBookingPaymentStep, BOOKING_FORM_DATA_RESERVED_KEYS, isBookingServiceSlidingAmountInRange, clearWorkflowFeedback, reportWorkflowError, reportWorkflowSuccess, okWith, err } from './chunk-
|
|
11
|
+
import { defineIslandPropsDecoder, resolveBookingSiteId, resolveDefaultBookingServiceId, getBookingRedirectStateFromLocation, deriveBookingFormViewState, logger, getBookingSuccessMessage, getBookingServiceSlidingScale, formatBookingCentsAsCurrencyInput, parseBookingCurrencyInputToCents, resolveAppointmentCheckoutVerificationState, themeButtonClassName, toSelectedCollectionOptionKind, assertNever, prepareBookingSubmission, formatBookingSubmissionPreparationError, resolveBookingPaymentStep, BOOKING_FORM_DATA_RESERVED_KEYS, isBookingServiceSlidingAmountInRange, clearWorkflowFeedback, reportWorkflowError, reportWorkflowSuccess, okWith, err } from './chunk-V67AT7ZW.mjs';
|
|
12
12
|
import { resolveBookingTimeZoneId, DEFAULT_BOOKING_TIME_ZONE, unsafeAsFormId, unsafeAsAppointmentResourceId, unsafeAsCustomerPassId, unsafeAsAppointmentServiceId, formatLocalScheduleDate, addLocalScheduleDays, parseBookingLocalDate, unsafeAsPassId, formatCurrencyAmount, formatBookingInstant } from './chunk-PCHACQEB.mjs';
|
|
13
13
|
import React2, { useRef, useState, useMemo, useReducer, useEffect, useCallback, useLayoutEffect } from 'react';
|
|
14
14
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
package/dist/client/bookings.mjs
CHANGED
|
@@ -12446,6 +12446,9 @@ function resolveDiscountContext(input) {
|
|
|
12446
12446
|
if (!input.eventRequiresPayment) {
|
|
12447
12447
|
return null;
|
|
12448
12448
|
}
|
|
12449
|
+
if (input.ticketsCount <= 0) {
|
|
12450
|
+
return null;
|
|
12451
|
+
}
|
|
12449
12452
|
if (selection?.method && selection.method !== "stripe") {
|
|
12450
12453
|
return null;
|
|
12451
12454
|
}
|
|
@@ -16960,6 +16963,7 @@ function transformEligibilityResponse(response) {
|
|
|
16960
16963
|
requiresPayment: eligibility.requiresPayment,
|
|
16961
16964
|
pricingMode: eligibility.pricingMode,
|
|
16962
16965
|
selectedTicketTypeId: eligibility.selectedTicketTypeId ?? null,
|
|
16966
|
+
ticketLines: eligibility.ticketLines ?? [],
|
|
16963
16967
|
ticketTypes: eligibility.ticketTypes ?? [],
|
|
16964
16968
|
isFull: eligibility.isFull,
|
|
16965
16969
|
waitlistEnabled: eligibility.waitlistEnabled,
|
|
@@ -17002,6 +17006,48 @@ function findSelectedTicketType(input) {
|
|
|
17002
17006
|
// ../blocks/src/system/runtime/nodes/event-registration/hooks.ts
|
|
17003
17007
|
import { useState as useState3, useEffect as useEffect8, useCallback as useCallback5, useRef as useRef9, useReducer as useReducer7 } from "react";
|
|
17004
17008
|
|
|
17009
|
+
// ../blocks/src/system/runtime/nodes/event-registration/ticketSelectionLines.ts
|
|
17010
|
+
function normalizeTicketSelectionLines(lines) {
|
|
17011
|
+
const quantitiesByTicketType = /* @__PURE__ */ new Map();
|
|
17012
|
+
for (const line of lines) {
|
|
17013
|
+
const quantity = Math.floor(line.quantity);
|
|
17014
|
+
if (quantity <= 0) continue;
|
|
17015
|
+
const key = line.ticketTypeId ?? null;
|
|
17016
|
+
quantitiesByTicketType.set(key, (quantitiesByTicketType.get(key) ?? 0) + quantity);
|
|
17017
|
+
}
|
|
17018
|
+
return [...quantitiesByTicketType.entries()].map(([ticketTypeId, quantity]) => ({
|
|
17019
|
+
ticketTypeId,
|
|
17020
|
+
quantity
|
|
17021
|
+
}));
|
|
17022
|
+
}
|
|
17023
|
+
function getTicketSelectionTotal(lines) {
|
|
17024
|
+
return normalizeTicketSelectionLines(lines).reduce((total, line) => total + line.quantity, 0);
|
|
17025
|
+
}
|
|
17026
|
+
function getSingleSelectedTicketTypeId(lines) {
|
|
17027
|
+
const normalized = normalizeTicketSelectionLines(lines);
|
|
17028
|
+
return normalized.length === 1 ? normalized[0]?.ticketTypeId ?? null : null;
|
|
17029
|
+
}
|
|
17030
|
+
function calculateTicketSelectionSubtotal(input) {
|
|
17031
|
+
return normalizeTicketSelectionLines(input.lines).reduce((subtotal, line) => {
|
|
17032
|
+
const ticketType = line.ticketTypeId ? input.ticketTypes.find((candidate) => candidate.id === line.ticketTypeId) ?? null : null;
|
|
17033
|
+
const unitPriceCents = ticketType?.priceAmount ?? input.fallbackUnitPriceCents;
|
|
17034
|
+
return subtotal + Math.max(0, unitPriceCents) * line.quantity;
|
|
17035
|
+
}, 0);
|
|
17036
|
+
}
|
|
17037
|
+
function buildTicketSelectionSummaryLines(input) {
|
|
17038
|
+
return normalizeTicketSelectionLines(input.lines).map((line) => {
|
|
17039
|
+
const ticketType = line.ticketTypeId ? input.ticketTypes.find((candidate) => candidate.id === line.ticketTypeId) ?? null : null;
|
|
17040
|
+
const unitPriceCents = ticketType?.priceAmount ?? input.fallbackUnitPriceCents;
|
|
17041
|
+
return {
|
|
17042
|
+
ticketTypeId: line.ticketTypeId,
|
|
17043
|
+
label: ticketType?.name ?? input.fallbackLabel,
|
|
17044
|
+
quantity: line.quantity,
|
|
17045
|
+
unitPriceCents,
|
|
17046
|
+
subtotalCents: Math.max(0, unitPriceCents) * line.quantity
|
|
17047
|
+
};
|
|
17048
|
+
});
|
|
17049
|
+
}
|
|
17050
|
+
|
|
17005
17051
|
// ../blocks/src/system/runtime/nodes/event-registration/hooks.state.ts
|
|
17006
17052
|
var initialEligibilityLookupState = {
|
|
17007
17053
|
tag: "idle",
|
|
@@ -17108,6 +17154,7 @@ function usePortalAuth() {
|
|
|
17108
17154
|
}
|
|
17109
17155
|
function useEligibility(params) {
|
|
17110
17156
|
const api = useBlockApi();
|
|
17157
|
+
const ticketSelectionsKey = JSON.stringify(normalizeTicketSelectionLines(params.ticketSelections));
|
|
17111
17158
|
const [state, dispatch] = useReducer7(
|
|
17112
17159
|
eligibilityLookupReducer,
|
|
17113
17160
|
initialEligibilityLookupState
|
|
@@ -17121,7 +17168,8 @@ function useEligibility(params) {
|
|
|
17121
17168
|
dispatch({ type: "reset" });
|
|
17122
17169
|
return;
|
|
17123
17170
|
}
|
|
17124
|
-
|
|
17171
|
+
const ticketSelections = JSON.parse(ticketSelectionsKey);
|
|
17172
|
+
if (!params.occurrenceId || !params.email.trim() || ticketSelections.length === 0) {
|
|
17125
17173
|
requestIdRef.current += 1;
|
|
17126
17174
|
dispatch({ type: "reset" });
|
|
17127
17175
|
return;
|
|
@@ -17133,10 +17181,9 @@ function useEligibility(params) {
|
|
|
17133
17181
|
const result = await api.checkEligibility({
|
|
17134
17182
|
occurrenceId: params.occurrenceId,
|
|
17135
17183
|
attendanceMode: params.attendanceMode ?? void 0,
|
|
17136
|
-
|
|
17184
|
+
ticketSelections,
|
|
17137
17185
|
selectedSlidingAmount: params.selectedSlidingAmount ?? void 0,
|
|
17138
|
-
email: params.email.trim().toLowerCase()
|
|
17139
|
-
ticketsCount: params.ticketsCount
|
|
17186
|
+
email: params.email.trim().toLowerCase()
|
|
17140
17187
|
});
|
|
17141
17188
|
if (cancelled || requestIdRef.current !== requestId) return;
|
|
17142
17189
|
dispatch({
|
|
@@ -17155,7 +17202,15 @@ function useEligibility(params) {
|
|
|
17155
17202
|
return () => {
|
|
17156
17203
|
cancelled = true;
|
|
17157
17204
|
};
|
|
17158
|
-
}, [
|
|
17205
|
+
}, [
|
|
17206
|
+
api,
|
|
17207
|
+
params.enabled,
|
|
17208
|
+
params.occurrenceId,
|
|
17209
|
+
params.attendanceMode,
|
|
17210
|
+
ticketSelectionsKey,
|
|
17211
|
+
params.selectedSlidingAmount,
|
|
17212
|
+
params.email
|
|
17213
|
+
]);
|
|
17159
17214
|
return {
|
|
17160
17215
|
state,
|
|
17161
17216
|
eligibility: state.eligibility,
|
|
@@ -17231,9 +17286,15 @@ function savePendingRegistration(siteId, occurrenceId, data) {
|
|
|
17231
17286
|
}
|
|
17232
17287
|
try {
|
|
17233
17288
|
const key = getStorageKey(siteId, occurrenceId);
|
|
17289
|
+
const ticketSelections = normalizeTicketSelectionLines(data.ticketSelections);
|
|
17290
|
+
if (ticketSelections.length === 0) {
|
|
17291
|
+
console.warn("[sessionStorage] No ticket selections to save, skipping registration state");
|
|
17292
|
+
return;
|
|
17293
|
+
}
|
|
17234
17294
|
const entry = {
|
|
17235
17295
|
...data,
|
|
17236
|
-
|
|
17296
|
+
ticketSelections,
|
|
17297
|
+
version: 4,
|
|
17237
17298
|
timestamp: Date.now()
|
|
17238
17299
|
};
|
|
17239
17300
|
sessionStorage.setItem(key, JSON.stringify(entry));
|
|
@@ -17279,8 +17340,8 @@ function parseAndValidateEntry(stored, key) {
|
|
|
17279
17340
|
return null;
|
|
17280
17341
|
}
|
|
17281
17342
|
const version = raw.version;
|
|
17282
|
-
if (version !==
|
|
17283
|
-
console.warn("[sessionStorage]
|
|
17343
|
+
if (version !== 4) {
|
|
17344
|
+
console.warn("[sessionStorage] Outdated version, ignoring entry");
|
|
17284
17345
|
sessionStorage.removeItem(key);
|
|
17285
17346
|
return null;
|
|
17286
17347
|
}
|
|
@@ -17296,34 +17357,12 @@ function parseAndValidateEntry(stored, key) {
|
|
|
17296
17357
|
sessionStorage.removeItem(key);
|
|
17297
17358
|
return null;
|
|
17298
17359
|
}
|
|
17299
|
-
|
|
17300
|
-
|
|
17301
|
-
|
|
17302
|
-
|
|
17303
|
-
attendeeId: legacy.attendeeId,
|
|
17304
|
-
formData: legacy.formData,
|
|
17305
|
-
ticketsCount: legacy.ticketsCount,
|
|
17306
|
-
selectedEventId: legacy.selectedEventId,
|
|
17307
|
-
selectedAttendanceMode: null,
|
|
17308
|
-
selectedTicketTypeId: null,
|
|
17309
|
-
paymentSelection: { method: legacy.paymentMethod },
|
|
17310
|
-
timestamp: legacy.timestamp
|
|
17311
|
-
};
|
|
17312
|
-
}
|
|
17313
|
-
if (entry.version === 2) {
|
|
17314
|
-
return {
|
|
17315
|
-
version: 3,
|
|
17316
|
-
attendeeId: entry.attendeeId,
|
|
17317
|
-
formData: entry.formData,
|
|
17318
|
-
ticketsCount: entry.ticketsCount,
|
|
17319
|
-
selectedEventId: entry.selectedEventId,
|
|
17320
|
-
selectedAttendanceMode: null,
|
|
17321
|
-
selectedTicketTypeId: null,
|
|
17322
|
-
paymentSelection: entry.paymentSelection,
|
|
17323
|
-
timestamp: entry.timestamp
|
|
17324
|
-
};
|
|
17360
|
+
const ticketSelections = normalizeTicketSelectionLines(entry.ticketSelections);
|
|
17361
|
+
if (ticketSelections.length === 0 || getTicketSelectionTotal(ticketSelections) <= 0) {
|
|
17362
|
+
sessionStorage.removeItem(key);
|
|
17363
|
+
return null;
|
|
17325
17364
|
}
|
|
17326
|
-
return entry;
|
|
17365
|
+
return { ...entry, ticketSelections };
|
|
17327
17366
|
} catch {
|
|
17328
17367
|
console.warn("[sessionStorage] Failed to parse entry, removing");
|
|
17329
17368
|
sessionStorage.removeItem(key);
|
|
@@ -17355,8 +17394,9 @@ function cleanupStaleRegistrations() {
|
|
|
17355
17394
|
const stored = sessionStorage.getItem(key);
|
|
17356
17395
|
if (!stored) continue;
|
|
17357
17396
|
const entry = JSON.parse(stored);
|
|
17358
|
-
const
|
|
17359
|
-
|
|
17397
|
+
const timestamp = typeof entry.timestamp === "number" ? entry.timestamp : NaN;
|
|
17398
|
+
const age = Date.now() - timestamp;
|
|
17399
|
+
if (!Number.isFinite(timestamp) || age > STALE_THRESHOLD_MS) {
|
|
17360
17400
|
keysToRemove.push(key);
|
|
17361
17401
|
}
|
|
17362
17402
|
} catch {
|
|
@@ -17681,7 +17721,7 @@ function useEventRegistrationStripeReturn(options) {
|
|
|
17681
17721
|
setRegistrationResult,
|
|
17682
17722
|
setSelectedEvent,
|
|
17683
17723
|
setSelectedAttendanceMode,
|
|
17684
|
-
|
|
17724
|
+
setTicketSelections,
|
|
17685
17725
|
setStep,
|
|
17686
17726
|
setTicketsCount,
|
|
17687
17727
|
step
|
|
@@ -17700,13 +17740,13 @@ function useEventRegistrationStripeReturn(options) {
|
|
|
17700
17740
|
const pending = getPendingRegistration(siteId, occurrenceId || void 0);
|
|
17701
17741
|
if (!pending) return;
|
|
17702
17742
|
setFormData(pending.formData);
|
|
17703
|
-
|
|
17743
|
+
setTicketSelections(pending.ticketSelections);
|
|
17744
|
+
setTicketsCount(getTicketSelectionTotal(pending.ticketSelections));
|
|
17704
17745
|
if (pending.selectedEventId) {
|
|
17705
17746
|
const event = events.find((e) => e.publicEventId === pending.selectedEventId) ?? null;
|
|
17706
17747
|
if (event) setSelectedEvent(event);
|
|
17707
17748
|
}
|
|
17708
17749
|
setSelectedAttendanceMode(pending.selectedAttendanceMode ?? null);
|
|
17709
|
-
setSelectedTicketTypeId(pending.selectedTicketTypeId ?? null);
|
|
17710
17750
|
setPaymentSelection(pending.paymentSelection);
|
|
17711
17751
|
if (registrationStatus === "cancelled") {
|
|
17712
17752
|
setStep("select-payment");
|
|
@@ -17758,6 +17798,10 @@ function useEventRegistrationSubmit(options) {
|
|
|
17758
17798
|
}
|
|
17759
17799
|
options.setStep("submitting");
|
|
17760
17800
|
try {
|
|
17801
|
+
const ticketSelections = normalizeTicketSelectionLines(options.ticketSelections);
|
|
17802
|
+
if (ticketSelections.length === 0) {
|
|
17803
|
+
throw new Error("Choose at least one ticket to continue.");
|
|
17804
|
+
}
|
|
17761
17805
|
const isBundle = method === "pass_bundle" || method === "membership_bundle";
|
|
17762
17806
|
const bundleProductId = isBundle ? passId || membershipId : void 0;
|
|
17763
17807
|
const selectionSnapshot = (() => {
|
|
@@ -17786,11 +17830,10 @@ function useEventRegistrationSubmit(options) {
|
|
|
17786
17830
|
const result = await options.api.registerForEvent({
|
|
17787
17831
|
occurrenceId: submitOccurrenceId,
|
|
17788
17832
|
attendanceMode: options.selectedAttendanceMode ?? void 0,
|
|
17789
|
-
|
|
17833
|
+
ticketSelections,
|
|
17790
17834
|
selectedSlidingAmount: options.selectedSlidingAmount ?? void 0,
|
|
17791
17835
|
email: options.formData.email.trim().toLowerCase(),
|
|
17792
17836
|
name: options.formData.name.trim(),
|
|
17793
|
-
ticketsCount: options.ticketsCount,
|
|
17794
17837
|
phone: options.formData.phone.trim() || void 0,
|
|
17795
17838
|
notes: options.formData.notes.trim() || void 0,
|
|
17796
17839
|
altchaSolution: options.altchaSolution,
|
|
@@ -17835,10 +17878,9 @@ function useEventRegistrationSubmit(options) {
|
|
|
17835
17878
|
savePendingRegistration(siteId, submitOccurrenceId, {
|
|
17836
17879
|
attendeeId: result.attendeeId,
|
|
17837
17880
|
formData: options.formData,
|
|
17838
|
-
|
|
17881
|
+
ticketSelections,
|
|
17839
17882
|
selectedEventId: options.registrationTarget?.selectedEventId ?? null,
|
|
17840
17883
|
selectedAttendanceMode: options.selectedAttendanceMode,
|
|
17841
|
-
selectedTicketTypeId: options.selectedTicketTypeId ?? null,
|
|
17842
17884
|
paymentSelection: selectionSnapshot
|
|
17843
17885
|
});
|
|
17844
17886
|
}
|
|
@@ -17950,7 +17992,6 @@ function useEventRegistrationWizard(options) {
|
|
|
17950
17992
|
createInitialRegistrationFlowState
|
|
17951
17993
|
);
|
|
17952
17994
|
const step = flowState.step;
|
|
17953
|
-
const ticketsCount = flowState.ticketsCount;
|
|
17954
17995
|
const paymentSelection = flowState.paymentSelection;
|
|
17955
17996
|
const [selectedEvent, setSelectedEvent] = useState4(preSelectedEvent ?? null);
|
|
17956
17997
|
const [formData, setFormData] = useState4({ name: "", email: "", phone: "", notes: "" });
|
|
@@ -17961,7 +18002,7 @@ function useEventRegistrationWizard(options) {
|
|
|
17961
18002
|
const [selectedAttendanceMode, setSelectedAttendanceMode] = useState4(
|
|
17962
18003
|
preSelectedEvent?.deliveryMode === "online" ? "online" : preSelectedEvent?.deliveryMode === "in_person" ? "in_person" : null
|
|
17963
18004
|
);
|
|
17964
|
-
const [
|
|
18005
|
+
const [selectedTicketLines, setSelectedTicketLines] = useState4([]);
|
|
17965
18006
|
const [selectedSlidingAmountInput, setSelectedSlidingAmountInput] = useState4(() => {
|
|
17966
18007
|
const slidingScale = getSlidingScaleForEvent(preSelectedEvent ?? null);
|
|
17967
18008
|
return slidingScale?.suggestedAmount !== null && slidingScale?.suggestedAmount !== void 0 ? formatCentsAsCurrencyInput(slidingScale.suggestedAmount) : "";
|
|
@@ -17997,14 +18038,51 @@ function useEventRegistrationWizard(options) {
|
|
|
17997
18038
|
[options.occurrenceContext, selectedEvent]
|
|
17998
18039
|
);
|
|
17999
18040
|
const occurrenceId = registrationTarget?.occurrenceId ?? "";
|
|
18041
|
+
const currentEvent = selectedEvent ?? preSelectedEvent;
|
|
18042
|
+
const currentEventPricing = currentEvent ? resolveRuntimeEventPricing(currentEvent) : null;
|
|
18043
|
+
const currentEventUsesTicketTypes = currentEventPricing !== null && publicEventPricingMode(currentEventPricing) === "ticket_types";
|
|
18044
|
+
const selectedModeAvailability = selectedAttendanceMode ? (currentEvent?.attendanceModes ?? []).find((mode) => mode.mode === selectedAttendanceMode) ?? null : null;
|
|
18045
|
+
const currentAvailableSpots = selectedModeAvailability?.availableSpots ?? currentEvent?.availableSpots;
|
|
18046
|
+
const currentWaitlistEnabled = selectedModeAvailability?.waitlistEnabled ?? currentEvent?.waitlistEnabled ?? false;
|
|
18047
|
+
const currentCanJoinWaitlist = currentAvailableSpots === 0 && currentWaitlistEnabled === true;
|
|
18048
|
+
const usesTicketTypeSelections = currentEventUsesTicketTypes && !currentCanJoinWaitlist;
|
|
18049
|
+
const eventTicketTypesForSelection = useMemo6(
|
|
18050
|
+
() => getVisibleTicketTypes({
|
|
18051
|
+
event: currentEvent,
|
|
18052
|
+
eligibility: null,
|
|
18053
|
+
selectedAttendanceMode
|
|
18054
|
+
}),
|
|
18055
|
+
[currentEvent, selectedAttendanceMode]
|
|
18056
|
+
);
|
|
18057
|
+
const normalizedSelectedTicketLines = useMemo6(
|
|
18058
|
+
() => normalizeTicketSelectionLines(selectedTicketLines),
|
|
18059
|
+
[selectedTicketLines]
|
|
18060
|
+
);
|
|
18061
|
+
const ticketTypeSelectionTotal = useMemo6(
|
|
18062
|
+
() => getTicketSelectionTotal(normalizedSelectedTicketLines),
|
|
18063
|
+
[normalizedSelectedTicketLines]
|
|
18064
|
+
);
|
|
18065
|
+
const ticketsCount = usesTicketTypeSelections ? ticketTypeSelectionTotal : flowState.ticketsCount;
|
|
18066
|
+
const ticketSelections = useMemo6(() => {
|
|
18067
|
+
if (waitlistClaim.claim) {
|
|
18068
|
+
return [{ ticketTypeId: null, quantity: 1 }];
|
|
18069
|
+
}
|
|
18070
|
+
if (usesTicketTypeSelections) {
|
|
18071
|
+
return normalizedSelectedTicketLines;
|
|
18072
|
+
}
|
|
18073
|
+
return [{ ticketTypeId: null, quantity: ticketsCount }];
|
|
18074
|
+
}, [normalizedSelectedTicketLines, ticketsCount, usesTicketTypeSelections, waitlistClaim.claim]);
|
|
18075
|
+
useEffect11(() => {
|
|
18076
|
+
if (flowState.ticketsCount === ticketsCount) return;
|
|
18077
|
+
dispatchFlow({ type: "set-tickets-count", ticketsCount });
|
|
18078
|
+
}, [flowState.ticketsCount, ticketsCount]);
|
|
18000
18079
|
const eligibilityResult = useEligibility({
|
|
18001
18080
|
enabled: portalAuthState === "authenticated" || step === "enter-details" || step === "select-payment",
|
|
18002
18081
|
occurrenceId,
|
|
18003
18082
|
attendanceMode: selectedAttendanceMode,
|
|
18004
|
-
|
|
18083
|
+
ticketSelections,
|
|
18005
18084
|
selectedSlidingAmount: parseCurrencyInputToCents(selectedSlidingAmountInput),
|
|
18006
|
-
email: formData.email
|
|
18007
|
-
ticketsCount
|
|
18085
|
+
email: formData.email
|
|
18008
18086
|
});
|
|
18009
18087
|
const existingRegistrationResult = useExistingEventRegistration({
|
|
18010
18088
|
isAuthenticated: portalAuthState === "authenticated",
|
|
@@ -18110,7 +18188,7 @@ function useEventRegistrationWizard(options) {
|
|
|
18110
18188
|
setTicketsCount,
|
|
18111
18189
|
setSelectedEvent,
|
|
18112
18190
|
setSelectedAttendanceMode,
|
|
18113
|
-
|
|
18191
|
+
setTicketSelections: (lines) => setSelectedTicketLines(normalizeTicketSelectionLines(lines)),
|
|
18114
18192
|
setPaymentSelection: (selection) => dispatchFlow({ type: "set-manual-payment-selection", selection }),
|
|
18115
18193
|
setPendingAttendeeId,
|
|
18116
18194
|
setStep,
|
|
@@ -18123,20 +18201,21 @@ function useEventRegistrationWizard(options) {
|
|
|
18123
18201
|
}, [selectedEvent, preSelectedEvent]);
|
|
18124
18202
|
const visibleTicketTypes = useMemo6(
|
|
18125
18203
|
() => getVisibleTicketTypes({
|
|
18126
|
-
event:
|
|
18204
|
+
event: currentEvent,
|
|
18127
18205
|
eligibility,
|
|
18128
18206
|
selectedAttendanceMode
|
|
18129
18207
|
}),
|
|
18130
|
-
[
|
|
18208
|
+
[currentEvent, selectedAttendanceMode, eligibility]
|
|
18131
18209
|
);
|
|
18210
|
+
const singleSelectedTicketTypeId = getSingleSelectedTicketTypeId(normalizedSelectedTicketLines);
|
|
18132
18211
|
const selectedTicketType = useMemo6(
|
|
18133
18212
|
() => findSelectedTicketType({
|
|
18134
|
-
event:
|
|
18213
|
+
event: currentEvent,
|
|
18135
18214
|
eligibility,
|
|
18136
|
-
selectedTicketTypeId,
|
|
18215
|
+
selectedTicketTypeId: singleSelectedTicketTypeId,
|
|
18137
18216
|
selectedAttendanceMode
|
|
18138
18217
|
}),
|
|
18139
|
-
[
|
|
18218
|
+
[currentEvent, eligibility, selectedAttendanceMode, singleSelectedTicketTypeId]
|
|
18140
18219
|
);
|
|
18141
18220
|
const selectedSlidingAmount = useMemo6(
|
|
18142
18221
|
() => parseCurrencyInputToCents(selectedSlidingAmountInput),
|
|
@@ -18151,37 +18230,44 @@ function useEventRegistrationWizard(options) {
|
|
|
18151
18230
|
selectedAmount: selectedSlidingAmount
|
|
18152
18231
|
});
|
|
18153
18232
|
const ticketTypeSelectionRequired = useMemo6(() => {
|
|
18154
|
-
const event =
|
|
18233
|
+
const event = currentEvent;
|
|
18155
18234
|
if (!event || publicEventPricingMode(resolveRuntimeEventPricing(event)) !== "ticket_types") {
|
|
18156
18235
|
return false;
|
|
18157
18236
|
}
|
|
18158
18237
|
if ((event.deliveryMode ?? "in_person") === "hybrid" && !selectedAttendanceMode) {
|
|
18159
18238
|
return false;
|
|
18160
18239
|
}
|
|
18161
|
-
const
|
|
18162
|
-
const canJoinWaitlist = (
|
|
18240
|
+
const selectedModeAvailability2 = selectedAttendanceMode ? (event.attendanceModes ?? []).find((mode) => mode.mode === selectedAttendanceMode) ?? null : null;
|
|
18241
|
+
const canJoinWaitlist = (selectedModeAvailability2?.availableSpots ?? event.availableSpots) === 0 && (selectedModeAvailability2?.waitlistEnabled ?? event.waitlistEnabled) === true;
|
|
18163
18242
|
return !canJoinWaitlist;
|
|
18164
|
-
}, [
|
|
18165
|
-
const
|
|
18166
|
-
|
|
18167
|
-
|
|
18243
|
+
}, [currentEvent, selectedAttendanceMode]);
|
|
18244
|
+
const hasValidTicketSelection = !ticketTypeSelectionRequired || normalizedSelectedTicketLines.length > 0 && normalizedSelectedTicketLines.every((line) => {
|
|
18245
|
+
if (!line.ticketTypeId) return false;
|
|
18246
|
+
const ticketType = visibleTicketTypes.find((candidate) => candidate.id === line.ticketTypeId) ?? null;
|
|
18247
|
+
return ticketType?.availability.kind === "available";
|
|
18248
|
+
});
|
|
18168
18249
|
useEffect11(() => {
|
|
18169
|
-
|
|
18170
|
-
|
|
18171
|
-
|
|
18172
|
-
setSelectedTicketTypeId(null);
|
|
18250
|
+
if (!usesTicketTypeSelections) {
|
|
18251
|
+
if (selectedTicketLines.length > 0) {
|
|
18252
|
+
setSelectedTicketLines([]);
|
|
18173
18253
|
}
|
|
18174
18254
|
return;
|
|
18175
18255
|
}
|
|
18176
|
-
const
|
|
18177
|
-
|
|
18178
|
-
|
|
18256
|
+
const availableTicketTypes = eventTicketTypesForSelection.filter(
|
|
18257
|
+
(ticketType) => ticketType.availability.kind === "available"
|
|
18258
|
+
);
|
|
18259
|
+
const implicitTicketType = getImplicitSingleAvailableTicketType(eventTicketTypesForSelection);
|
|
18260
|
+
if (implicitTicketType && normalizedSelectedTicketLines.length === 0) {
|
|
18261
|
+
setSelectedTicketLines([{ ticketTypeId: implicitTicketType.id, quantity: 1 }]);
|
|
18179
18262
|
return;
|
|
18180
18263
|
}
|
|
18181
|
-
|
|
18182
|
-
|
|
18264
|
+
const filteredLines = normalizedSelectedTicketLines.filter(
|
|
18265
|
+
(line) => line.ticketTypeId && availableTicketTypes.some((ticketType) => ticketType.id === line.ticketTypeId)
|
|
18266
|
+
);
|
|
18267
|
+
if (filteredLines.length !== normalizedSelectedTicketLines.length) {
|
|
18268
|
+
setSelectedTicketLines(filteredLines);
|
|
18183
18269
|
}
|
|
18184
|
-
}, [
|
|
18270
|
+
}, [eventTicketTypesForSelection, normalizedSelectedTicketLines, selectedTicketLines.length, usesTicketTypeSelections]);
|
|
18185
18271
|
useEffect11(() => {
|
|
18186
18272
|
if (!requireGuestDetails) {
|
|
18187
18273
|
if (guests.length > 0) setGuests([]);
|
|
@@ -18225,21 +18311,20 @@ function useEventRegistrationWizard(options) {
|
|
|
18225
18311
|
return resolveEventRequiresPayment({
|
|
18226
18312
|
eligibility,
|
|
18227
18313
|
selectedTicketType,
|
|
18228
|
-
event:
|
|
18314
|
+
event: currentEvent
|
|
18229
18315
|
});
|
|
18230
18316
|
},
|
|
18231
18317
|
[
|
|
18232
18318
|
eligibility,
|
|
18233
18319
|
selectedTicketType,
|
|
18234
|
-
|
|
18235
|
-
preSelectedEvent,
|
|
18320
|
+
currentEvent,
|
|
18236
18321
|
selectedEventSlidingScale,
|
|
18237
18322
|
selectedSlidingAmount
|
|
18238
18323
|
]
|
|
18239
18324
|
);
|
|
18240
18325
|
const handleDetailsComplete = async () => {
|
|
18241
|
-
if (ticketTypeSelectionRequired && !
|
|
18242
|
-
const message = "
|
|
18326
|
+
if (ticketTypeSelectionRequired && !hasValidTicketSelection) {
|
|
18327
|
+
const message = "Choose at least one available ticket to continue.";
|
|
18243
18328
|
setErrorMessage(message);
|
|
18244
18329
|
setStep("error");
|
|
18245
18330
|
return { ok: false, reason: "blocked", message };
|
|
@@ -18324,27 +18409,39 @@ function useEventRegistrationWizard(options) {
|
|
|
18324
18409
|
const discountContext = useMemo6(
|
|
18325
18410
|
() => resolveDiscountContext({
|
|
18326
18411
|
paymentSelection,
|
|
18327
|
-
event:
|
|
18412
|
+
event: currentEvent,
|
|
18328
18413
|
eventRequiresPayment,
|
|
18329
18414
|
ticketsCount
|
|
18330
18415
|
}),
|
|
18331
|
-
[eventRequiresPayment, paymentSelection,
|
|
18416
|
+
[currentEvent, eventRequiresPayment, paymentSelection, ticketsCount]
|
|
18417
|
+
);
|
|
18418
|
+
const fallbackUnitPriceCents = useMemo6(
|
|
18419
|
+
() => currentEvent ? publicEventScalarPrice(resolveRuntimeEventPricing(currentEvent)) ?? 0 : 0,
|
|
18420
|
+
[currentEvent]
|
|
18421
|
+
);
|
|
18422
|
+
const ticketSelectionSubtotalCents = useMemo6(() => {
|
|
18423
|
+
if (!usesTicketTypeSelections) {
|
|
18424
|
+
return Math.max(0, eligibility?.price ?? fallbackUnitPriceCents * ticketsCount);
|
|
18425
|
+
}
|
|
18426
|
+
return calculateTicketSelectionSubtotal({
|
|
18427
|
+
lines: normalizedSelectedTicketLines,
|
|
18428
|
+
ticketTypes: visibleTicketTypes,
|
|
18429
|
+
fallbackUnitPriceCents
|
|
18430
|
+
});
|
|
18431
|
+
}, [eligibility, fallbackUnitPriceCents, normalizedSelectedTicketLines, ticketsCount, usesTicketTypeSelections, visibleTicketTypes]);
|
|
18432
|
+
const ticketSelectionSummaryLines = useMemo6(
|
|
18433
|
+
() => buildTicketSelectionSummaryLines({
|
|
18434
|
+
lines: ticketSelections,
|
|
18435
|
+
ticketTypes: visibleTicketTypes,
|
|
18436
|
+
fallbackLabel: "Ticket",
|
|
18437
|
+
fallbackUnitPriceCents
|
|
18438
|
+
}),
|
|
18439
|
+
[fallbackUnitPriceCents, ticketSelections, visibleTicketTypes]
|
|
18332
18440
|
);
|
|
18333
18441
|
const discountSubtotalCents = useMemo6(() => {
|
|
18334
18442
|
if (discountContext?.type !== "event") return void 0;
|
|
18335
|
-
|
|
18336
|
-
|
|
18337
|
-
return Math.max(0, eventPriceCents * ticketsCount);
|
|
18338
|
-
}, [
|
|
18339
|
-
discountContext,
|
|
18340
|
-
selectedTicketType,
|
|
18341
|
-
eligibility,
|
|
18342
|
-
selectedEvent,
|
|
18343
|
-
preSelectedEvent,
|
|
18344
|
-
selectedEventSlidingScale,
|
|
18345
|
-
selectedSlidingAmount,
|
|
18346
|
-
ticketsCount
|
|
18347
|
-
]);
|
|
18443
|
+
return ticketSelectionSubtotalCents;
|
|
18444
|
+
}, [discountContext, ticketSelectionSubtotalCents]);
|
|
18348
18445
|
const discountUi = useDiscountCodeUi({ api, discountContext, subtotalCents: discountSubtotalCents });
|
|
18349
18446
|
const selectionMethod = paymentSelection.method;
|
|
18350
18447
|
const shouldShowDiscountToggle = discountContext !== null && discountUi.manualCodeEntryAllowed && (selectionMethod === "stripe" || selectionMethod === "pass_bundle" || selectionMethod === "membership_bundle");
|
|
@@ -18352,9 +18449,8 @@ function useEventRegistrationWizard(options) {
|
|
|
18352
18449
|
api,
|
|
18353
18450
|
registrationTarget,
|
|
18354
18451
|
selectedAttendanceMode,
|
|
18355
|
-
|
|
18452
|
+
ticketSelections,
|
|
18356
18453
|
selectedSlidingAmount,
|
|
18357
|
-
ticketsCount,
|
|
18358
18454
|
formData,
|
|
18359
18455
|
altchaSolution,
|
|
18360
18456
|
requireGuestDetails,
|
|
@@ -18375,12 +18471,12 @@ function useEventRegistrationWizard(options) {
|
|
|
18375
18471
|
setSelectedAttendanceMode(
|
|
18376
18472
|
(event.deliveryMode ?? "in_person") === "hybrid" ? null : (event.deliveryMode ?? "in_person") === "online" ? "online" : "in_person"
|
|
18377
18473
|
);
|
|
18378
|
-
|
|
18474
|
+
setSelectedTicketLines([]);
|
|
18379
18475
|
dispatchFlow({ type: "event-changed", hasPreSelectedContext: true });
|
|
18380
18476
|
};
|
|
18381
18477
|
const handleRetry = () => {
|
|
18382
18478
|
dispatchFlow({ type: "reset", hasPreSelectedContext });
|
|
18383
|
-
|
|
18479
|
+
setSelectedTicketLines([]);
|
|
18384
18480
|
setSelectedSlidingAmountInput("");
|
|
18385
18481
|
setSelectedAttendanceMode(
|
|
18386
18482
|
preSelectedEvent?.deliveryMode === "online" ? "online" : preSelectedEvent?.deliveryMode === "in_person" ? "in_person" : null
|
|
@@ -18416,17 +18512,20 @@ function useEventRegistrationWizard(options) {
|
|
|
18416
18512
|
setTicketsCount,
|
|
18417
18513
|
selectedAttendanceMode,
|
|
18418
18514
|
setSelectedAttendanceMode,
|
|
18419
|
-
|
|
18420
|
-
|
|
18515
|
+
ticketSelections,
|
|
18516
|
+
selectedTicketLines: normalizedSelectedTicketLines,
|
|
18517
|
+
setSelectedTicketLines: (lines) => setSelectedTicketLines(normalizeTicketSelectionLines(lines)),
|
|
18421
18518
|
selectedSlidingAmountInput,
|
|
18422
18519
|
setSelectedSlidingAmountInput,
|
|
18423
18520
|
selectedSlidingAmount,
|
|
18424
18521
|
selectedEventSlidingScale,
|
|
18425
18522
|
slidingScaleSelectionMessage,
|
|
18426
18523
|
selectedTicketType,
|
|
18524
|
+
ticketSelectionSummaryLines,
|
|
18525
|
+
ticketSelectionSubtotalCents,
|
|
18427
18526
|
visibleTicketTypes,
|
|
18428
18527
|
ticketTypeSelectionRequired,
|
|
18429
|
-
|
|
18528
|
+
hasValidTicketSelection,
|
|
18430
18529
|
eventRequiresPayment,
|
|
18431
18530
|
formData,
|
|
18432
18531
|
setFormData,
|
|
@@ -19304,11 +19403,11 @@ function useEventRegistrationController(options) {
|
|
|
19304
19403
|
wizard.setStep("select-tickets");
|
|
19305
19404
|
return { ok: true };
|
|
19306
19405
|
case "select-tickets":
|
|
19307
|
-
if (wizard.ticketTypeSelectionRequired && !wizard.
|
|
19406
|
+
if (wizard.ticketTypeSelectionRequired && !wizard.hasValidTicketSelection) {
|
|
19308
19407
|
return {
|
|
19309
19408
|
ok: false,
|
|
19310
19409
|
reason: "blocked",
|
|
19311
|
-
message: "
|
|
19410
|
+
message: "Choose at least one available ticket to continue."
|
|
19312
19411
|
};
|
|
19313
19412
|
}
|
|
19314
19413
|
wizard.setStep("enter-details");
|
|
@@ -19384,6 +19483,7 @@ function useEventRegistrationController(options) {
|
|
|
19384
19483
|
},
|
|
19385
19484
|
[directPaymentOptions, wizard]
|
|
19386
19485
|
);
|
|
19486
|
+
const selectedTicketTypeId = getSingleSelectedTicketTypeId(wizard.selectedTicketLines);
|
|
19387
19487
|
const showSpamProtection = options.spamProtectionEnabled ?? isSpamProtectionEnabled();
|
|
19388
19488
|
const spamProtection = showSpamProtection ? {
|
|
19389
19489
|
enabled: true,
|
|
@@ -19410,11 +19510,14 @@ function useEventRegistrationController(options) {
|
|
|
19410
19510
|
tickets: {
|
|
19411
19511
|
count: wizard.ticketsCount,
|
|
19412
19512
|
max: wizard.maxTicketsNum,
|
|
19413
|
-
|
|
19513
|
+
selections: wizard.ticketSelections,
|
|
19514
|
+
summaryLines: wizard.ticketSelectionSummaryLines,
|
|
19515
|
+
subtotalCents: wizard.ticketSelectionSubtotalCents,
|
|
19516
|
+
selectedTicketTypeId,
|
|
19414
19517
|
selectedTicketType: wizard.selectedTicketType,
|
|
19415
19518
|
visibleTicketTypes: wizard.visibleTicketTypes,
|
|
19416
19519
|
selectionRequired: wizard.ticketTypeSelectionRequired,
|
|
19417
|
-
hasValidSelection: wizard.
|
|
19520
|
+
hasValidSelection: wizard.hasValidTicketSelection,
|
|
19418
19521
|
eventRequiresPayment: wizard.eventRequiresPayment,
|
|
19419
19522
|
selectedAttendanceMode: wizard.selectedAttendanceMode
|
|
19420
19523
|
},
|
|
@@ -19457,7 +19560,10 @@ function useEventRegistrationController(options) {
|
|
|
19457
19560
|
actions: {
|
|
19458
19561
|
selectEvent: wizard.handleEventSelect,
|
|
19459
19562
|
selectAttendanceMode: wizard.setSelectedAttendanceMode,
|
|
19460
|
-
selectTicketType:
|
|
19563
|
+
selectTicketType: (ticketTypeId) => {
|
|
19564
|
+
wizard.setSelectedTicketLines(ticketTypeId ? [{ ticketTypeId, quantity: 1 }] : []);
|
|
19565
|
+
},
|
|
19566
|
+
setTicketSelections: wizard.setSelectedTicketLines,
|
|
19461
19567
|
setTicketsCount: wizard.setTicketsCount,
|
|
19462
19568
|
updateAttendee,
|
|
19463
19569
|
updateGuests,
|
|
@@ -19535,7 +19641,7 @@ function resolveHeadlessDirectPaymentOptions(wizard) {
|
|
|
19535
19641
|
return buildEventRegistrationPaymentOptionsViewModel({
|
|
19536
19642
|
eventTitle: event?.title ?? "Event",
|
|
19537
19643
|
paymentTerms: event?.paymentTerms,
|
|
19538
|
-
totalPriceCents: eligibility.price
|
|
19644
|
+
totalPriceCents: eligibility.price,
|
|
19539
19645
|
currency: eligibility.currency,
|
|
19540
19646
|
startsAt: wizard.occurrenceContext?.startsAt ?? event?.startsAt
|
|
19541
19647
|
}).options;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { normalizeCarouselProps, CarouselNodeClient } from './chunk-JNE6UI6U.mjs';
|
|
2
2
|
import './chunk-6N7YRNYU.mjs';
|
|
3
3
|
import { mountReactIsland } from './chunk-N7PBWBWQ.mjs';
|
|
4
|
-
import { defineIslandPropsDecoder } from './chunk-
|
|
4
|
+
import { defineIslandPropsDecoder } from './chunk-V67AT7ZW.mjs';
|
|
5
5
|
import './chunk-PCHACQEB.mjs';
|
|
6
6
|
import { jsx } from 'react/jsx-runtime';
|
|
7
7
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { mountShopBlockIsland, CartClient } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
import { mountShopBlockIsland, CartClient } from './chunk-TREIML53.mjs';
|
|
2
|
+
import './chunk-AVBQSUIS.mjs';
|
|
3
3
|
import './chunk-JNE6UI6U.mjs';
|
|
4
4
|
import './chunk-6N7YRNYU.mjs';
|
|
5
5
|
import './chunk-L4J5Y62O.mjs';
|
|
6
|
-
import './chunk-
|
|
6
|
+
import './chunk-R3NQTBWE.mjs';
|
|
7
7
|
import './chunk-3DCJ45Z2.mjs';
|
|
8
8
|
import './chunk-WBQG7VJA.mjs';
|
|
9
9
|
import './chunk-TNGL2WJF.mjs';
|
|
10
10
|
import './chunk-N7PBWBWQ.mjs';
|
|
11
|
-
import { defineIslandPropsDecoder } from './chunk-
|
|
11
|
+
import { defineIslandPropsDecoder } from './chunk-V67AT7ZW.mjs';
|
|
12
12
|
import './chunk-PCHACQEB.mjs';
|
|
13
13
|
|
|
14
14
|
// src/rendering/islands/enhancers/cart.tsx
|