@bowlos/reservations 0.41.0 → 1.0.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.
Files changed (61) hide show
  1. package/AGENTS.md +20 -5
  2. package/CHANGELOG.md +22 -0
  3. package/HEADLESS.md +187 -41
  4. package/README.md +77 -0
  5. package/dist/{account-DEX2Lr78.d.cts → account-b8chVpED.d.cts} +892 -14
  6. package/dist/{account-DEX2Lr78.d.ts → account-b8chVpED.d.ts} +892 -14
  7. package/dist/booking-change-B-ADuVEz.d.cts +562 -0
  8. package/dist/booking-change-BrJ-XESC.d.ts +562 -0
  9. package/dist/chunk-43WZ6TLQ.js +12 -0
  10. package/dist/chunk-43WZ6TLQ.js.map +1 -0
  11. package/dist/{chunk-VJIS56OO.js → chunk-CTJODEHR.js} +119 -7
  12. package/dist/chunk-CTJODEHR.js.map +1 -0
  13. package/dist/{chunk-YAXBZJMI.js → chunk-EPYGIJRJ.js} +20 -3
  14. package/dist/chunk-EPYGIJRJ.js.map +1 -0
  15. package/dist/{chunk-BWJHRJN6.js → chunk-EXEKCMQ2.js} +57 -22
  16. package/dist/chunk-EXEKCMQ2.js.map +1 -0
  17. package/dist/{chunk-44WKP6MW.js → chunk-IDRTMFJJ.js} +36 -3
  18. package/dist/chunk-IDRTMFJJ.js.map +1 -0
  19. package/dist/{chunk-FMFHNBDH.js → chunk-LFFANITL.js} +98 -12
  20. package/dist/chunk-LFFANITL.js.map +1 -0
  21. package/dist/cli.cjs +5 -0
  22. package/dist/cli.cjs.map +1 -1
  23. package/dist/components.cjs +670 -131
  24. package/dist/components.cjs.map +1 -1
  25. package/dist/components.d.cts +19 -7
  26. package/dist/components.d.ts +19 -7
  27. package/dist/components.js +304 -66
  28. package/dist/components.js.map +1 -1
  29. package/dist/index.cjs +67 -0
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.d.cts +4 -4
  32. package/dist/index.d.ts +4 -4
  33. package/dist/index.js +5 -4
  34. package/dist/index.js.map +1 -1
  35. package/dist/payments.cjs +34 -12
  36. package/dist/payments.cjs.map +1 -1
  37. package/dist/payments.d.cts +10 -2
  38. package/dist/payments.d.ts +10 -2
  39. package/dist/payments.js +6 -78
  40. package/dist/payments.js.map +1 -1
  41. package/dist/{react-CrRciA7I.d.ts → react-cqGEohr0.d.cts} +4 -2
  42. package/dist/{react-QJrsaOnN.d.cts → react-s4J-e10i.d.ts} +4 -2
  43. package/dist/react.cjs +202 -19
  44. package/dist/react.cjs.map +1 -1
  45. package/dist/react.d.cts +28 -6
  46. package/dist/react.d.ts +28 -6
  47. package/dist/react.js +5 -5
  48. package/package.json +2 -1
  49. package/templates/center-site/README.md +1 -0
  50. package/templates/center-site/app/book/event-reservation-form.tsx +276 -0
  51. package/templates/center-site/app/book/page.tsx +107 -49
  52. package/templates/center-site/app/catalog/page.tsx +3 -1
  53. package/templates/center-site/app/events/[slug]/page.tsx +7 -10
  54. package/templates/center-site/package.json +1 -1
  55. package/dist/booking-change-4DGu-B08.d.ts +0 -1282
  56. package/dist/booking-change-aK6P37FZ.d.cts +0 -1282
  57. package/dist/chunk-44WKP6MW.js.map +0 -1
  58. package/dist/chunk-BWJHRJN6.js.map +0 -1
  59. package/dist/chunk-FMFHNBDH.js.map +0 -1
  60. package/dist/chunk-VJIS56OO.js.map +0 -1
  61. package/dist/chunk-YAXBZJMI.js.map +0 -1
@@ -1,9 +1,9 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { CSSProperties, ReactNode } from 'react';
3
- import { aR as PublicSurface, aA as CatalogItem, aG as EventOffer, ah as GetWalletPassUrlArgs, ap as BookingChangePayment } from './booking-change-aK6P37FZ.cjs';
4
- export { aB as CatalogResult, aC as CatalogSection } from './booking-change-aK6P37FZ.cjs';
5
- import { a7 as PricingMode, a5 as PaymentIntentInfo, r as Customer, ad as SavedCardScope } from './account-DEX2Lr78.cjs';
6
- import { d as UseAccountResult } from './react-QJrsaOnN.cjs';
3
+ import { a1 as PublicSurface, N as EventOffer, D as CatalogItem, l as GetWalletPassUrlArgs, p as BookingChangePayment } from './booking-change-B-ADuVEz.cjs';
4
+ export { F as CatalogResult, H as CatalogSection } from './booking-change-B-ADuVEz.cjs';
5
+ import { b5 as PricingMode, a7 as BookingAddonSelection, b3 as PaymentIntentInfo, an as Customer, bb as SavedCardScope, aI as JoinWaitlistArgs } from './account-b8chVpED.cjs';
6
+ import { d as UseAccountResult } from './react-cqGEohr0.cjs';
7
7
  import { InquiryFormType } from '@bowlos/shared';
8
8
 
9
9
  /**
@@ -102,6 +102,12 @@ interface BookingFlowProps {
102
102
  productId: string;
103
103
  pricingMode?: PricingMode;
104
104
  durationMinutes?: number;
105
+ /** Reservation-mode offer from the gateway. Pass the offer even when its session is unavailable. */
106
+ eventOffer?: Pick<EventOffer, "slug" | "session"> & {
107
+ includedAddons?: readonly BookingAddonSelection[];
108
+ /** Supply the configured shoe add-on ID when the product has no public detail. */
109
+ defaultShoeAddonId?: string | null;
110
+ };
105
111
  defaultDateISO?: string;
106
112
  defaultStartMinuteOfDay?: number;
107
113
  /**
@@ -147,7 +153,7 @@ interface BookingFlowProps {
147
153
  * signed-in customer) and pay-to-confirm by default. Built on `useBookingFlow`.
148
154
  * Must render inside a `<BowlosProvider>`; theme with `<BowlosTheme>`. White-label.
149
155
  */
150
- declare function BookingFlow({ centerId, productId, pricingMode, durationMinutes, defaultDateISO, defaultStartMinuteOfDay, renderPayment, onConfirmed, unitLabel, completeSaleOnly, accountHref, labels, className, }: BookingFlowProps): react_jsx_runtime.JSX.Element;
156
+ declare function BookingFlow(props: BookingFlowProps): react_jsx_runtime.JSX.Element;
151
157
 
152
158
  /** Visible strings — override any subset for copy/i18n. */
153
159
  interface AuthGateLabels {
@@ -326,7 +332,7 @@ interface AccountDashboardLabels {
326
332
  autoRenews: string;
327
333
  balanceDue: string;
328
334
  }
329
- type AccountSection = "reservations" | "memberships" | "loyalty" | "credits" | "passes" | "eventOrders" | "packageOrders" | "gameCards" | "profile" | "communications" | "paymentMethods" | "security" | "privacy";
335
+ type AccountSection = "waitlist" | "reservations" | "memberships" | "loyalty" | "credits" | "passes" | "eventOrders" | "packageOrders" | "gameCards" | "profile" | "communications" | "paymentMethods" | "security" | "privacy";
330
336
  interface AccountDashboardProps {
331
337
  /** The Brand this site belongs to (account reads are Brand-scoped). */
332
338
  brandId: string;
@@ -770,4 +776,10 @@ interface BookingChangeProps {
770
776
  }
771
777
  declare function BookingChange({ brandId, centerId, reservationId, expectedVersion, initial, unitNoun, renderPayment, labels, className, }: BookingChangeProps): react_jsx_runtime.JSX.Element;
772
778
 
773
- export { AccountDashboard, type AccountDashboardLabels, type AccountDashboardProps, AccountMenu, type AccountMenuLabels, type AccountMenuProps, type AccountSection, AddToWalletButtons, type AddToWalletButtonsProps, AuthForm, AuthGate, type AuthGateLabels, type AuthGateProps, type AuthGateRenderContext, BOWLOS_DEFAULT_THEME, BookingCatalog, type BookingCatalogLabels, type BookingCatalogProps, BookingChange, type BookingChangeProps, BookingFlow, type BookingFlowLabels, type BookingFlowProps, BowlosTheme, type BowlosThemeTokens, CatalogItem, ChangePasswordForm, type ChangePasswordFormProps, CommunicationPrefs, type CommunicationPrefsProps, EventList, type EventListLabels, type EventListProps, type FlashBrand, FlashSale, FlashSaleIndex, type FlashSaleIndexItem, type FlashSaleIndexLabels, type FlashSaleIndexProps, type FlashSaleIndexView, type FlashSaleItem, type FlashSaleLabels, type FlashSaleProps, type FlashSaleView, GameCardHistory, type GameCardHistoryProps, InquiryForm, type InquiryFormProps, MaintenanceBanner, type MaintenanceBannerProps, MembershipDetail, type MembershipDetailProps, type MyCreditEntry, type MyCredits, type MyLoyalty, type MyMembershipSummary, type MyPass, type MyReservationSummary, PricingTable, type PricingTableLabels, type PricingTableProps, PrivacyCenter, type PrivacyCenterProps, ProfileForm, type ProfileFormProps, SavedCards, type SavedCardsProps, formatCents, formatCentsRange };
779
+ interface WaitlistJoinProps {
780
+ args: JoinWaitlistArgs;
781
+ onJoined?: () => void;
782
+ }
783
+ declare function WaitlistJoin({ args, onJoined }: WaitlistJoinProps): react_jsx_runtime.JSX.Element;
784
+
785
+ export { AccountDashboard, type AccountDashboardLabels, type AccountDashboardProps, AccountMenu, type AccountMenuLabels, type AccountMenuProps, type AccountSection, AddToWalletButtons, type AddToWalletButtonsProps, AuthForm, AuthGate, type AuthGateLabels, type AuthGateProps, type AuthGateRenderContext, BOWLOS_DEFAULT_THEME, BookingCatalog, type BookingCatalogLabels, type BookingCatalogProps, BookingChange, type BookingChangeProps, BookingFlow, type BookingFlowLabels, type BookingFlowProps, BowlosTheme, type BowlosThemeTokens, CatalogItem, ChangePasswordForm, type ChangePasswordFormProps, CommunicationPrefs, type CommunicationPrefsProps, EventList, type EventListLabels, type EventListProps, type FlashBrand, FlashSale, FlashSaleIndex, type FlashSaleIndexItem, type FlashSaleIndexLabels, type FlashSaleIndexProps, type FlashSaleIndexView, type FlashSaleItem, type FlashSaleLabels, type FlashSaleProps, type FlashSaleView, GameCardHistory, type GameCardHistoryProps, InquiryForm, type InquiryFormProps, MaintenanceBanner, type MaintenanceBannerProps, MembershipDetail, type MembershipDetailProps, type MyCreditEntry, type MyCredits, type MyLoyalty, type MyMembershipSummary, type MyPass, type MyReservationSummary, PricingTable, type PricingTableLabels, type PricingTableProps, PrivacyCenter, type PrivacyCenterProps, ProfileForm, type ProfileFormProps, SavedCards, type SavedCardsProps, WaitlistJoin, type WaitlistJoinProps, formatCents, formatCentsRange };
@@ -1,9 +1,9 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { CSSProperties, ReactNode } from 'react';
3
- import { aR as PublicSurface, aA as CatalogItem, aG as EventOffer, ah as GetWalletPassUrlArgs, ap as BookingChangePayment } from './booking-change-4DGu-B08.js';
4
- export { aB as CatalogResult, aC as CatalogSection } from './booking-change-4DGu-B08.js';
5
- import { a7 as PricingMode, a5 as PaymentIntentInfo, r as Customer, ad as SavedCardScope } from './account-DEX2Lr78.js';
6
- import { d as UseAccountResult } from './react-CrRciA7I.js';
3
+ import { a1 as PublicSurface, N as EventOffer, D as CatalogItem, l as GetWalletPassUrlArgs, p as BookingChangePayment } from './booking-change-BrJ-XESC.js';
4
+ export { F as CatalogResult, H as CatalogSection } from './booking-change-BrJ-XESC.js';
5
+ import { b5 as PricingMode, a7 as BookingAddonSelection, b3 as PaymentIntentInfo, an as Customer, bb as SavedCardScope, aI as JoinWaitlistArgs } from './account-b8chVpED.js';
6
+ import { d as UseAccountResult } from './react-s4J-e10i.js';
7
7
  import { InquiryFormType } from '@bowlos/shared';
8
8
 
9
9
  /**
@@ -102,6 +102,12 @@ interface BookingFlowProps {
102
102
  productId: string;
103
103
  pricingMode?: PricingMode;
104
104
  durationMinutes?: number;
105
+ /** Reservation-mode offer from the gateway. Pass the offer even when its session is unavailable. */
106
+ eventOffer?: Pick<EventOffer, "slug" | "session"> & {
107
+ includedAddons?: readonly BookingAddonSelection[];
108
+ /** Supply the configured shoe add-on ID when the product has no public detail. */
109
+ defaultShoeAddonId?: string | null;
110
+ };
105
111
  defaultDateISO?: string;
106
112
  defaultStartMinuteOfDay?: number;
107
113
  /**
@@ -147,7 +153,7 @@ interface BookingFlowProps {
147
153
  * signed-in customer) and pay-to-confirm by default. Built on `useBookingFlow`.
148
154
  * Must render inside a `<BowlosProvider>`; theme with `<BowlosTheme>`. White-label.
149
155
  */
150
- declare function BookingFlow({ centerId, productId, pricingMode, durationMinutes, defaultDateISO, defaultStartMinuteOfDay, renderPayment, onConfirmed, unitLabel, completeSaleOnly, accountHref, labels, className, }: BookingFlowProps): react_jsx_runtime.JSX.Element;
156
+ declare function BookingFlow(props: BookingFlowProps): react_jsx_runtime.JSX.Element;
151
157
 
152
158
  /** Visible strings — override any subset for copy/i18n. */
153
159
  interface AuthGateLabels {
@@ -326,7 +332,7 @@ interface AccountDashboardLabels {
326
332
  autoRenews: string;
327
333
  balanceDue: string;
328
334
  }
329
- type AccountSection = "reservations" | "memberships" | "loyalty" | "credits" | "passes" | "eventOrders" | "packageOrders" | "gameCards" | "profile" | "communications" | "paymentMethods" | "security" | "privacy";
335
+ type AccountSection = "waitlist" | "reservations" | "memberships" | "loyalty" | "credits" | "passes" | "eventOrders" | "packageOrders" | "gameCards" | "profile" | "communications" | "paymentMethods" | "security" | "privacy";
330
336
  interface AccountDashboardProps {
331
337
  /** The Brand this site belongs to (account reads are Brand-scoped). */
332
338
  brandId: string;
@@ -770,4 +776,10 @@ interface BookingChangeProps {
770
776
  }
771
777
  declare function BookingChange({ brandId, centerId, reservationId, expectedVersion, initial, unitNoun, renderPayment, labels, className, }: BookingChangeProps): react_jsx_runtime.JSX.Element;
772
778
 
773
- export { AccountDashboard, type AccountDashboardLabels, type AccountDashboardProps, AccountMenu, type AccountMenuLabels, type AccountMenuProps, type AccountSection, AddToWalletButtons, type AddToWalletButtonsProps, AuthForm, AuthGate, type AuthGateLabels, type AuthGateProps, type AuthGateRenderContext, BOWLOS_DEFAULT_THEME, BookingCatalog, type BookingCatalogLabels, type BookingCatalogProps, BookingChange, type BookingChangeProps, BookingFlow, type BookingFlowLabels, type BookingFlowProps, BowlosTheme, type BowlosThemeTokens, CatalogItem, ChangePasswordForm, type ChangePasswordFormProps, CommunicationPrefs, type CommunicationPrefsProps, EventList, type EventListLabels, type EventListProps, type FlashBrand, FlashSale, FlashSaleIndex, type FlashSaleIndexItem, type FlashSaleIndexLabels, type FlashSaleIndexProps, type FlashSaleIndexView, type FlashSaleItem, type FlashSaleLabels, type FlashSaleProps, type FlashSaleView, GameCardHistory, type GameCardHistoryProps, InquiryForm, type InquiryFormProps, MaintenanceBanner, type MaintenanceBannerProps, MembershipDetail, type MembershipDetailProps, type MyCreditEntry, type MyCredits, type MyLoyalty, type MyMembershipSummary, type MyPass, type MyReservationSummary, PricingTable, type PricingTableLabels, type PricingTableProps, PrivacyCenter, type PrivacyCenterProps, ProfileForm, type ProfileFormProps, SavedCards, type SavedCardsProps, formatCents, formatCentsRange };
779
+ interface WaitlistJoinProps {
780
+ args: JoinWaitlistArgs;
781
+ onJoined?: () => void;
782
+ }
783
+ declare function WaitlistJoin({ args, onJoined }: WaitlistJoinProps): react_jsx_runtime.JSX.Element;
784
+
785
+ export { AccountDashboard, type AccountDashboardLabels, type AccountDashboardProps, AccountMenu, type AccountMenuLabels, type AccountMenuProps, type AccountSection, AddToWalletButtons, type AddToWalletButtonsProps, AuthForm, AuthGate, type AuthGateLabels, type AuthGateProps, type AuthGateRenderContext, BOWLOS_DEFAULT_THEME, BookingCatalog, type BookingCatalogLabels, type BookingCatalogProps, BookingChange, type BookingChangeProps, BookingFlow, type BookingFlowLabels, type BookingFlowProps, BowlosTheme, type BowlosThemeTokens, CatalogItem, ChangePasswordForm, type ChangePasswordFormProps, CommunicationPrefs, type CommunicationPrefsProps, EventList, type EventListLabels, type EventListProps, type FlashBrand, FlashSale, FlashSaleIndex, type FlashSaleIndexItem, type FlashSaleIndexLabels, type FlashSaleIndexProps, type FlashSaleIndexView, type FlashSaleItem, type FlashSaleLabels, type FlashSaleProps, type FlashSaleView, GameCardHistory, type GameCardHistoryProps, InquiryForm, type InquiryFormProps, MaintenanceBanner, type MaintenanceBannerProps, MembershipDetail, type MembershipDetailProps, type MyCreditEntry, type MyCredits, type MyLoyalty, type MyMembershipSummary, type MyPass, type MyReservationSummary, PricingTable, type PricingTableLabels, type PricingTableProps, PrivacyCenter, type PrivacyCenterProps, ProfileForm, type ProfileFormProps, SavedCards, type SavedCardsProps, WaitlistJoin, type WaitlistJoinProps, formatCents, formatCentsRange };
@@ -1,12 +1,13 @@
1
- import { INQUIRY_FORMS } from './chunk-YAXBZJMI.js';
2
- import { useBookingFlow, useCenters, useMyGameCardHistory, useWalletPassUrl, useUpdateMyProfile, useMyCommunicationPrefs, useSetMyCommunicationPref, useAccountDeletion, useMyMembershipMembers, useAddMyMembershipMember, useCancelMyMembership, useOpenMembershipBillingPortal, useBookingChange, useMyPackageOrders } from './chunk-VJIS56OO.js';
1
+ import { durationsForStart, isFixedSession, formatSessionRange, INQUIRY_FORMS } from './chunk-EPYGIJRJ.js';
2
+ import { useSlotPrices, useProduct, useBookingFlow, useCenters, useMyGameCardHistory, useWalletPassUrl, useUpdateMyProfile, useMyCommunicationPrefs, useSetMyCommunicationPref, useAccountDeletion, useMyMembershipMembers, useAddMyMembershipMember, useCancelMyMembership, useOpenMembershipBillingPortal, useBookingChange, useWaitlistJoin, useMyPackageOrders } from './chunk-CTJODEHR.js';
3
3
  import './chunk-I37IJNYU.js';
4
- import { token, styles, formatCents, formatMinuteLabel, AccountPanel, QueryState, useAccountAction, minutesToTime, useCountdown, formatCentsRange, timeToMinutes } from './chunk-FMFHNBDH.js';
5
- export { BOWLOS_DEFAULT_THEME, BowlosTheme, formatCents, formatCentsRange } from './chunk-FMFHNBDH.js';
6
- import { useTestMode, useAccount, useAvailability, useBookingPreview, useAddons, useStartTimes, useSavedCards, useRemoveCard, useSetDefaultCard, useChangePassword, useBowlosMutation, useMyReservations, useMyMemberships, useMyLoyalty, useMyCredits, useMyPasses, useFlashSale, useFlashSales, useCatalog, useRetailPricing, useMyMembershipDetail, useMyGameCards, useMyEventOrders } from './chunk-BWJHRJN6.js';
7
- import { availableUnitCount } from './chunk-44WKP6MW.js';
4
+ import { token, styles, formatCents, AccountPanel, QueryState, useAccountAction, minutesToTime, useCountdown, formatCentsRange, timeToMinutes, AddCardForm } from './chunk-LFFANITL.js';
5
+ export { BOWLOS_DEFAULT_THEME, BowlosTheme, formatCents, formatCentsRange } from './chunk-LFFANITL.js';
6
+ import { formatMinuteLabel } from './chunk-43WZ6TLQ.js';
7
+ import { useTestMode, useAccount, useEventOfferOptions, useAddons, useAvailability, useBookingPreview, useStartTimes, useSavedCards, useRemoveCard, useSetDefaultCard, useChangePassword, useBowlosMutation, useMyReservations, useMyMemberships, useMyLoyalty, useMyCredits, useMyPasses, useFlashSale, useFlashSales, useCatalog, useRetailPricing, useMyMembershipDetail, useMyGameCards, useMyEventOrders, useBowlosQuery } from './chunk-EXEKCMQ2.js';
8
+ import { availableUnitCount } from './chunk-IDRTMFJJ.js';
8
9
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
9
- import { useState, useEffect, useMemo, useRef } from 'react';
10
+ import { useState, useEffect, useRef } from 'react';
10
11
 
11
12
  var DEFAULT_MESSAGE = "We're performing maintenance \u2014 online booking is temporarily unavailable. Please check back soon.";
12
13
  function MaintenanceBanner({
@@ -353,11 +354,22 @@ function formatDateLabel(dateISO) {
353
354
  day: "numeric"
354
355
  });
355
356
  }
356
- function BookingFlow({
357
+ function BookingFlow(props) {
358
+ const offer = props.eventOffer;
359
+ return /* @__PURE__ */ jsx(
360
+ BookingFlowContent,
361
+ {
362
+ ...props
363
+ },
364
+ offer ? JSON.stringify([offer.slug, props.centerId, props.productId, offer.session?.dateISO]) : "regular"
365
+ );
366
+ }
367
+ function BookingFlowContent({
357
368
  centerId,
358
369
  productId,
359
- pricingMode = "per_unit_per_hour",
360
- durationMinutes = 60,
370
+ pricingMode: defaultPricingMode = "per_unit_per_hour",
371
+ durationMinutes: defaultDurationMinutes = 60,
372
+ eventOffer,
361
373
  defaultDateISO = "",
362
374
  defaultStartMinuteOfDay = 18 * 60,
363
375
  renderPayment,
@@ -373,24 +385,71 @@ function BookingFlow({
373
385
  const signedIn = account.status === "linked" && account.customer !== null;
374
386
  const acctName = account.customer?.fullName ?? "";
375
387
  const acctEmail = account.customer?.email ?? "";
376
- const [dateISO, setDateISO] = useState(defaultDateISO);
388
+ const session = eventOffer?.session;
389
+ const eventOfferSlug = eventOffer?.slug.trim();
390
+ const pricingMode = session?.pricingMode ?? defaultPricingMode;
391
+ const [regularDate, setDateISO] = useState(defaultDateISO);
392
+ const dateISO = eventOffer ? session?.dateISO ?? "" : regularDate;
377
393
  useEffect(() => {
378
- if (!defaultDateISO && dateISO === "") setDateISO(todayISO());
379
- }, [defaultDateISO, dateISO]);
380
- const [startMinuteOfDay, setStartMinuteOfDay] = useState(defaultStartMinuteOfDay);
381
- const endMinuteOfDay = startMinuteOfDay + durationMinutes;
394
+ if (!eventOffer && !defaultDateISO && dateISO === "") setDateISO(todayISO());
395
+ }, [eventOffer, defaultDateISO, dateISO]);
396
+ const [pickedStart, setStartMinuteOfDay] = useState(defaultStartMinuteOfDay);
397
+ const [pickedDuration, setDuration] = useState(0);
382
398
  const [count, setCount] = useState(1);
399
+ const [bowlers, setBowlers] = useState(1);
400
+ const [games, setGames] = useState(1);
401
+ const partyCap = session?.maxPartySizePerUnit == null ? void 0 : session.maxPartySizePerUnit * count;
402
+ const persons = Math.min(bowlers, partyCap ?? Infinity);
403
+ const eventArgs = {
404
+ centerId,
405
+ productId,
406
+ dateISO,
407
+ eventOfferSlug: eventOfferSlug ?? "",
408
+ mode: pricingMode,
409
+ units: count,
410
+ persons,
411
+ ...pricingMode === "per_game" ? { games } : {}
412
+ };
413
+ const discovery = useEventOfferOptions(eventArgs, {
414
+ enabled: Boolean(session && eventOfferSlug),
415
+ auth: signedIn
416
+ });
417
+ const eventOptions = discovery.loading || discovery.error ? [] : discovery.data ?? [];
418
+ const eventStart = eventOptions.some((option) => option.startMinuteOfDay === pickedStart) ? pickedStart : eventOptions[0]?.startMinuteOfDay;
419
+ const startMinuteOfDay = eventOffer ? eventStart ?? 0 : pickedStart;
420
+ const durations = durationsForStart(eventOptions, startMinuteOfDay);
421
+ const durationMinutes = eventOffer ? durations.includes(pickedDuration) ? pickedDuration : durations[0] ?? 0 : defaultDurationMinutes;
422
+ const endMinuteOfDay = startMinuteOfDay + durationMinutes;
423
+ const eventSlotReady = Boolean(session && eventOfferSlug && eventStart !== void 0 && durationMinutes > 0);
424
+ const fixed = session != null && isFixedSession(session);
425
+ const slotPrices = useSlotPrices(
426
+ { ...eventArgs, duration: durationMinutes, slots: [startMinuteOfDay] },
427
+ { enabled: eventSlotReady, auth: signedIn }
428
+ );
429
+ const eventSlotUnavailable = slotPrices.data !== null && slotPrices.data[0]?.headlinePriceCents == null;
383
430
  const [payMessage, setPayMessage] = useState(null);
384
431
  const [reviewing, setReviewing] = useState(false);
385
- const [addonQtys, setAddonQtys] = useState({});
386
- const selectedAddons = useMemo(
387
- () => Object.entries(addonQtys).filter(([, q]) => q > 0).map(([addonId, quantity]) => ({ addonId, quantity })),
388
- [addonQtys]
432
+ const [addonQtys, setAddonQtys] = useState(
433
+ () => Object.fromEntries((eventOffer?.includedAddons ?? []).map(({ addonId, quantity }) => [addonId, quantity]))
434
+ );
435
+ const addons = useAddons({ productId }, { enabled: !eventOffer || Boolean(session && eventOfferSlug) });
436
+ const knownShoeId = session?.defaultShoeAddonId !== void 0 ? session.defaultShoeAddonId : eventOffer?.defaultShoeAddonId;
437
+ const needsShoeId = Boolean(
438
+ session?.shoesIncluded && knownShoeId === void 0 && addons.data?.length
389
439
  );
390
- const countArgs = pricingMode === "per_person_per_hour" ? { persons: count } : pricingMode === "per_game" ? { games: count } : { units: count };
440
+ const product = useProduct({ productId }, {
441
+ enabled: needsShoeId,
442
+ keepPreviousData: false
443
+ });
444
+ const shoeAddonId = knownShoeId !== void 0 ? knownShoeId : product.data?.defaultShoeAddonId;
445
+ const addonList = (addons.data ?? []).filter(
446
+ (addon) => !session?.shoesIncluded || shoeAddonId !== void 0 && addon.id !== shoeAddonId
447
+ );
448
+ const selectedAddons = Object.entries(addonQtys).filter(([id, quantity]) => quantity > 0 && (!eventOffer || addonList.some((addon) => addon.id === id))).map(([addonId, quantity]) => ({ addonId, quantity }));
449
+ const countArgs = eventOffer ? { units: count, persons, ...pricingMode === "per_game" ? { games } : {} } : pricingMode === "per_person_per_hour" ? { persons: count } : pricingMode === "per_game" ? { games: count } : { units: count };
391
450
  const availability = useAvailability(
392
451
  { productId, dateISO, startMinuteOfDay, endMinuteOfDay },
393
- { enabled: dateISO !== "" }
452
+ { enabled: !eventOffer && dateISO !== "" }
394
453
  );
395
454
  const preview = useBookingPreview(
396
455
  {
@@ -401,14 +460,14 @@ function BookingFlow({
401
460
  endMinuteOfDay,
402
461
  mode: pricingMode,
403
462
  ...countArgs,
463
+ ...eventOffer ? { eventOfferSlug } : {},
404
464
  addons: selectedAddons
405
465
  },
406
- { enabled: dateISO !== "", auth: signedIn }
466
+ { enabled: eventOffer ? eventSlotReady : dateISO !== "", auth: signedIn }
407
467
  );
408
- const addons = useAddons({ productId }, { enabled: true });
409
468
  const startTimes = useStartTimes(
410
469
  { productId, dateISO, durationMinutes, mode: pricingMode },
411
- { enabled: dateISO !== "" }
470
+ { enabled: !eventOffer && dateISO !== "" }
412
471
  );
413
472
  const flow = useBookingFlow();
414
473
  const onConfirmedRef = useRef(onConfirmed);
@@ -436,25 +495,25 @@ function BookingFlow({
436
495
  void prepareRef.current();
437
496
  }
438
497
  }, [completeSaleOnly, flow.status]);
439
- const bookingArgs = useMemo(
440
- () => ({
441
- centerId,
442
- productId,
443
- dateISO,
444
- startMinuteOfDay,
445
- endMinuteOfDay,
446
- mode: pricingMode,
447
- ...pricingMode === "per_person_per_hour" ? { persons: count } : pricingMode === "per_game" ? { games: count } : { units: count },
448
- addons: selectedAddons,
449
- // Always the signed-in customer — online booking requires login.
450
- customer: { fullName: acctName, email: acctEmail, marketingOptIn: false }
451
- }),
452
- [centerId, productId, dateISO, startMinuteOfDay, endMinuteOfDay, pricingMode, count, selectedAddons, acctName, acctEmail]
453
- );
498
+ const bookingArgs = {
499
+ centerId,
500
+ productId,
501
+ dateISO,
502
+ startMinuteOfDay,
503
+ endMinuteOfDay,
504
+ mode: pricingMode,
505
+ ...countArgs,
506
+ ...eventOffer ? { eventOfferSlug } : {},
507
+ addons: selectedAddons,
508
+ customer: { fullName: acctName, email: acctEmail, marketingOptIn: false }
509
+ };
454
510
  const availableUnits = availability.data ? availableUnitCount(availability.data) : null;
455
511
  const quoteCents = preview.data?.totalCentsPerPlan?.[0]?.totalCents ?? null;
456
- const addonList = addons.data ?? [];
457
- const startOptions = startTimes.data ?? [];
512
+ const startOptions = eventOffer ? eventOptions.map((option) => option.startMinuteOfDay) : startTimes.data ?? [];
513
+ const addonsSettled = (addons.data !== null || addons.error !== null) && (!needsShoeId || product.data !== null || product.error !== null);
514
+ const eventReady = eventSlotReady && addonsSettled && slotPrices.data !== null && !eventSlotUnavailable && !slotPrices.loading && !slotPrices.error && !preview.loading && !preview.error;
515
+ const eventReadError = discovery.error ?? slotPrices.error ?? preview.error;
516
+ const eventUnavailable = !session || !eventOfferSlug || eventSlotUnavailable || eventReadError?.code === "NOT_FOUND";
458
517
  const s = styles();
459
518
  if (flow.status === "confirmed") {
460
519
  return /* @__PURE__ */ jsxs("div", { className, style: s.card, children: [
@@ -523,7 +582,7 @@ function BookingFlow({
523
582
  const fee = preview.data?.reservationFee;
524
583
  const feeCents = typeof fee?.amountCents === "number" ? fee.amountCents : 0;
525
584
  const feeLabel = typeof fee?.label === "string" && fee.label ? fee.label : t.reservationFeeLabel;
526
- const reservationLine = t.reservationLineLabel.replace("{count}", String(count)).replace("{unit}", countNoun(preview.data?.unitNoun, count, COUNT_LABEL[pricingMode])).replace("{date}", formatDateLabel(dateISO)).replace("{time}", `${formatMinuteLabel(startMinuteOfDay)}\u2013${formatMinuteLabel(endMinuteOfDay)}`);
585
+ const reservationLine = t.reservationLineLabel.replace("{count}", String(count)).replace("{unit}", countNoun(preview.data?.unitNoun, count, eventOffer ? unitLabel.plural : COUNT_LABEL[pricingMode])).replace("{date}", formatDateLabel(dateISO)).replace("{time}", eventOffer ? formatSessionRange(startMinuteOfDay, endMinuteOfDay) : `${formatMinuteLabel(startMinuteOfDay)}\u2013${formatMinuteLabel(endMinuteOfDay)}`);
527
586
  const chosenAddons = addonList.map((a) => ({ ...a, quantity: addonQtys[a.id] ?? 0 })).filter((a) => a.quantity > 0);
528
587
  const fallbackAddonsCents = chosenAddons.reduce(
529
588
  (sum, a) => sum + a.priceCents * a.quantity,
@@ -546,7 +605,7 @@ function BookingFlow({
546
605
  ] }),
547
606
  /* @__PURE__ */ jsx("span", { style: s.muted, children: formatCents(a.lineSubtotalCents) })
548
607
  ] }, a.addonId)),
549
- plan.shoesIncluded ? /* @__PURE__ */ jsxs("div", { style: s.rowBetween, children: [
608
+ session?.shoesIncluded || plan.shoesIncluded ? /* @__PURE__ */ jsxs("div", { style: s.rowBetween, children: [
550
609
  /* @__PURE__ */ jsx("span", { style: s.muted, children: "Shoes included" }),
551
610
  /* @__PURE__ */ jsx("span", { style: s.muted, children: "\u2014" })
552
611
  ] }) : null,
@@ -593,7 +652,7 @@ function BookingFlow({
593
652
  {
594
653
  type: "button",
595
654
  style: s.primaryBtn,
596
- disabled: holding || preview.loading || quoteCents == null,
655
+ disabled: holding || preview.loading || quoteCents == null || Boolean(eventOffer && !eventReady),
597
656
  onClick: () => void flow.startHold(bookingArgs),
598
657
  children: holding ? t.securing : t.continueToPayment
599
658
  }
@@ -608,6 +667,7 @@ function BookingFlow({
608
667
  ] })
609
668
  ),
610
669
  /* @__PURE__ */ jsx("button", { type: "button", style: s.linkBtn, disabled: holding, onClick: () => setReviewing(false), children: t.editOrder }),
670
+ eventOffer && eventReadError && /* @__PURE__ */ jsx("p", { role: "alert", style: s.error, children: eventUnavailable ? "This event session is unavailable." : eventReadError.message }),
611
671
  flow.error && /* @__PURE__ */ jsxs("p", { style: s.error, children: [
612
672
  flow.error.code,
613
673
  " \u2014 ",
@@ -617,29 +677,68 @@ function BookingFlow({
617
677
  }
618
678
  const onSubmit = (e) => {
619
679
  e.preventDefault();
620
- setReviewing(true);
680
+ if (!eventOffer || eventReady && quoteCents !== null) setReviewing(true);
621
681
  };
622
682
  return /* @__PURE__ */ jsxs("form", { className, style: s.card, onSubmit, children: [
623
683
  /* @__PURE__ */ jsx("h3", { style: s.heading, children: t.heading }),
624
- /* @__PURE__ */ jsxs("label", { style: s.label, children: [
625
- t.date,
626
- /* @__PURE__ */ jsx("input", { type: "date", value: dateISO, onChange: (e) => setDateISO(e.target.value), style: s.input, required: true })
627
- ] }),
628
- /* @__PURE__ */ jsxs("label", { style: s.label, children: [
629
- t.start,
630
- startTimes.loading ? /* @__PURE__ */ jsx("span", { style: s.meta, children: t.loadingTimes }) : startOptions.length === 0 ? /* @__PURE__ */ jsx("span", { style: s.meta, children: t.noTimes }) : /* @__PURE__ */ jsx(
631
- "select",
632
- {
633
- value: startMinuteOfDay,
634
- onChange: (e) => setStartMinuteOfDay(Number(e.target.value)),
635
- style: s.input,
636
- children: startOptions.map((min) => /* @__PURE__ */ jsx("option", { value: min, children: formatMinuteLabel(min) }, min))
637
- }
638
- )
684
+ eventOffer ? /* @__PURE__ */ jsxs(Fragment, { children: [
685
+ session && /* @__PURE__ */ jsxs("p", { style: s.body, children: [
686
+ t.date,
687
+ " \xB7 ",
688
+ /* @__PURE__ */ jsx("time", { dateTime: dateISO, children: formatDateLabel(dateISO) })
689
+ ] }),
690
+ eventUnavailable && /* @__PURE__ */ jsx("p", { role: "status", style: s.meta, children: "This event session is unavailable." }),
691
+ !eventUnavailable && eventReadError && /* @__PURE__ */ jsx("p", { role: "alert", style: s.error, children: eventReadError.message }),
692
+ discovery.loading ? /* @__PURE__ */ jsx("p", { role: "status", style: s.meta, children: t.loadingTimes }) : startOptions.length === 0 ? !eventUnavailable && !eventReadError && /* @__PURE__ */ jsx("p", { role: "status", style: s.meta, children: "No event sessions available for this party." }) : /* @__PURE__ */ jsxs(Fragment, { children: [
693
+ fixed && startOptions.length === 1 ? /* @__PURE__ */ jsx("p", { style: s.body, children: formatSessionRange(startMinuteOfDay, endMinuteOfDay) }) : /* @__PURE__ */ jsxs("label", { style: s.label, children: [
694
+ t.start,
695
+ /* @__PURE__ */ jsx(
696
+ "select",
697
+ {
698
+ value: startMinuteOfDay,
699
+ style: s.input,
700
+ onChange: (e) => setStartMinuteOfDay(Number(e.target.value)),
701
+ children: startOptions.map((start) => /* @__PURE__ */ jsx("option", { value: start, children: fixed ? formatSessionRange(start, start + durationMinutes) : formatMinuteLabel(start) }, start))
702
+ }
703
+ )
704
+ ] }),
705
+ !fixed && /* @__PURE__ */ jsxs("label", { style: s.label, children: [
706
+ "Duration",
707
+ /* @__PURE__ */ jsx(
708
+ "select",
709
+ {
710
+ value: durationMinutes,
711
+ style: s.input,
712
+ onChange: (e) => setDuration(Number(e.target.value)),
713
+ children: durations.map((duration) => /* @__PURE__ */ jsxs("option", { value: duration, children: [
714
+ duration,
715
+ " minutes"
716
+ ] }, duration))
717
+ }
718
+ )
719
+ ] })
720
+ ] })
721
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
722
+ /* @__PURE__ */ jsxs("label", { style: s.label, children: [
723
+ t.date,
724
+ /* @__PURE__ */ jsx("input", { type: "date", value: dateISO, onChange: (e) => setDateISO(e.target.value), style: s.input, required: true })
725
+ ] }),
726
+ /* @__PURE__ */ jsxs("label", { style: s.label, children: [
727
+ t.start,
728
+ startTimes.loading ? /* @__PURE__ */ jsx("span", { style: s.meta, children: t.loadingTimes }) : startOptions.length === 0 ? /* @__PURE__ */ jsx("span", { style: s.meta, children: t.noTimes }) : /* @__PURE__ */ jsx(
729
+ "select",
730
+ {
731
+ value: startMinuteOfDay,
732
+ onChange: (e) => setStartMinuteOfDay(Number(e.target.value)),
733
+ style: s.input,
734
+ children: startOptions.map((min) => /* @__PURE__ */ jsx("option", { value: min, children: formatMinuteLabel(min) }, min))
735
+ }
736
+ )
737
+ ] })
639
738
  ] }),
640
739
  /* @__PURE__ */ jsxs("label", { style: s.label, children: [
641
740
  titleCase(
642
- (availability.data?.unitNoun ?? preview.data?.unitNoun)?.plural ?? COUNT_LABEL[pricingMode]
741
+ (availability.data?.unitNoun ?? preview.data?.unitNoun)?.plural ?? (eventOffer ? unitLabel.plural : COUNT_LABEL[pricingMode])
643
742
  ),
644
743
  /* @__PURE__ */ jsx(
645
744
  "input",
@@ -647,11 +746,47 @@ function BookingFlow({
647
746
  type: "number",
648
747
  min: 1,
649
748
  value: count,
650
- onChange: (e) => setCount(Math.max(1, Number(e.target.value) || 1)),
749
+ onChange: (e) => {
750
+ const next = Math.max(1, Number(e.target.value) || 1);
751
+ setCount(eventOffer ? Math.floor(next) : next);
752
+ const cap = session?.maxPartySizePerUnit;
753
+ if (cap != null) setBowlers(Math.min(persons, Math.floor(next) * cap));
754
+ },
651
755
  style: s.input
652
756
  }
653
757
  )
654
758
  ] }),
759
+ session && /* @__PURE__ */ jsxs(Fragment, { children: [
760
+ /* @__PURE__ */ jsxs("label", { style: s.label, children: [
761
+ "Bowlers",
762
+ /* @__PURE__ */ jsx(
763
+ "input",
764
+ {
765
+ style: s.input,
766
+ type: "number",
767
+ min: 1,
768
+ max: partyCap,
769
+ value: persons,
770
+ onChange: (e) => setBowlers(Math.min(partyCap ?? Infinity, Math.max(1, Math.floor(Number(e.target.value) || 1))))
771
+ }
772
+ )
773
+ ] }),
774
+ pricingMode === "per_game" && /* @__PURE__ */ jsxs("label", { style: s.label, children: [
775
+ "Games",
776
+ /* @__PURE__ */ jsx(
777
+ "input",
778
+ {
779
+ style: s.input,
780
+ type: "number",
781
+ min: 1,
782
+ value: games,
783
+ onChange: (e) => setGames(Math.max(1, Math.floor(Number(e.target.value) || 1)))
784
+ }
785
+ )
786
+ ] }),
787
+ session.shoesIncluded && /* @__PURE__ */ jsx("p", { style: s.meta, children: "Shoes included" }),
788
+ (product.error || addons.error) && /* @__PURE__ */ jsx("p", { role: "alert", style: s.error, children: "Unable to load add-ons." })
789
+ ] }),
655
790
  addonList.length > 0 ? /* @__PURE__ */ jsxs("div", { style: s.stack, children: [
656
791
  /* @__PURE__ */ jsx("p", { style: s.sectionTitle, children: t.addonsHeading }),
657
792
  addonList.map((addon) => /* @__PURE__ */ jsxs("div", { style: s.rowBetween, children: [
@@ -690,16 +825,16 @@ function BookingFlow({
690
825
  /* @__PURE__ */ jsx("a", { href: accountHref, style: s.linkBtn, children: t.notYou })
691
826
  ] }) : null
692
827
  ] }) : t.signInAtCheckout }),
693
- /* @__PURE__ */ jsxs("p", { style: s.meta, "aria-live": "polite", children: [
828
+ /* @__PURE__ */ jsx("p", { style: s.meta, "aria-live": "polite", children: eventOffer ? eventReady && quoteCents !== null ? formatCents(quoteCents) : "" : /* @__PURE__ */ jsxs(Fragment, { children: [
694
829
  dateISO === "" || startOptions.length === 0 ? "" : availability.loading ? t.checkingAvailability : availableUnits !== null ? `${availableUnits} ${countNoun(availability.data?.unitNoun ?? unitLabel, availableUnits, unitLabel.plural)} available` : availability.error ? availability.error.code : "",
695
830
  startOptions.length > 0 && quoteCents !== null ? ` \xB7 ${formatCents(quoteCents)}` : ""
696
- ] }),
831
+ ] }) }),
697
832
  /* @__PURE__ */ jsx(
698
833
  "button",
699
834
  {
700
835
  type: "submit",
701
836
  style: s.primaryBtn,
702
- disabled: dateISO === "" || startOptions.length === 0 || quoteCents === null,
837
+ disabled: dateISO === "" || startOptions.length === 0 || quoteCents === null || Boolean(eventOffer && !eventReady),
703
838
  children: t.reviewOrder
704
839
  }
705
840
  ),
@@ -1073,6 +1208,42 @@ function CommunicationPrefs({ brandId, labels, className }) {
1073
1208
  action.feedback
1074
1209
  ] });
1075
1210
  }
1211
+ function MyWaitlist({ brandId, centerId }) {
1212
+ const rows = useBowlosQuery(
1213
+ "listMyWaitlist",
1214
+ { brandId, centerId },
1215
+ { auth: true }
1216
+ );
1217
+ const leave = useBowlosMutation("leaveWaitlist", {
1218
+ auth: true
1219
+ });
1220
+ const action = useAccountAction();
1221
+ return /* @__PURE__ */ jsxs(AccountPanel, { title: "Pending \u2014 waitlist", children: [
1222
+ /* @__PURE__ */ jsx(QueryState, { ...rows, loadingLabel: "Loading\u2026" }),
1223
+ /* @__PURE__ */ jsx("ul", { children: rows.data?.filter((e) => e.status === "waiting" || e.status === "pending_card").map((e) => /* @__PURE__ */ jsxs("li", { children: [
1224
+ e.product,
1225
+ " \u2014 ",
1226
+ e.dateISO,
1227
+ " \u2014 ",
1228
+ formatCents(e.amountCents),
1229
+ " \u2014",
1230
+ " ",
1231
+ e.status === "pending_card" ? "Card required" : "Card on file",
1232
+ /* @__PURE__ */ jsx(
1233
+ "button",
1234
+ {
1235
+ disabled: action.busy,
1236
+ onClick: () => void action.run(async () => {
1237
+ await leave.run({ brandId, centerId, entryId: e.entryId });
1238
+ await rows.refetch();
1239
+ }, "Removed from waitlist \u2014 not charged."),
1240
+ children: "Leave"
1241
+ }
1242
+ )
1243
+ ] }, e.entryId)) }),
1244
+ action.feedback
1245
+ ] });
1246
+ }
1076
1247
  function SavedCards({
1077
1248
  brandId,
1078
1249
  centerId,
@@ -1512,6 +1683,8 @@ function Dashboard({
1512
1683
  /* @__PURE__ */ jsx("p", { style: s.listTitle, children: p.kind }),
1513
1684
  /* @__PURE__ */ jsx("span", { style: s.badge, children: p.state })
1514
1685
  ] }, p.id)) }) }, section);
1686
+ case "waitlist":
1687
+ return /* @__PURE__ */ jsx(MyWaitlist, { brandId, centerId }, section);
1515
1688
  case "eventOrders":
1516
1689
  return /* @__PURE__ */ jsx(EventOrders, { brandId, title: labels?.eventOrders }, section);
1517
1690
  case "packageOrders":
@@ -2455,7 +2628,72 @@ function BookingChange({
2455
2628
  !["idle", "pay", "polling", "applying", "previewing"].includes(change.status) && /* @__PURE__ */ jsx("button", { style: styles().ghostBtn, disabled: action.busy, onClick: change.reset, children: t.reset })
2456
2629
  ] });
2457
2630
  }
2631
+ function WaitlistJoin({ args, onJoined }) {
2632
+ const flow = useWaitlistJoin();
2633
+ const [consent, setConsent] = useState(false);
2634
+ return /* @__PURE__ */ jsxs("section", { "aria-label": "Join waitlist", children: [
2635
+ flow.status === "idle" && /* @__PURE__ */ jsx(
2636
+ "button",
2637
+ {
2638
+ onClick: () => {
2639
+ setConsent(false);
2640
+ void flow.join(args).catch(() => {
2641
+ });
2642
+ },
2643
+ children: "Join waitlist"
2644
+ }
2645
+ ),
2646
+ flow.status === "quoting" && /* @__PURE__ */ jsx("p", { children: "Getting your price\u2026" }),
2647
+ flow.status === "card" && flow.entry && /* @__PURE__ */ jsxs(Fragment, { children: [
2648
+ /* @__PURE__ */ jsxs("p", { children: [
2649
+ formatCents(flow.entry.amountCents),
2650
+ " \u2014 charged only if a spot opens."
2651
+ ] }),
2652
+ !flow.setupIntent ? /* @__PURE__ */ jsxs(Fragment, { children: [
2653
+ /* @__PURE__ */ jsxs("label", { children: [
2654
+ /* @__PURE__ */ jsx(
2655
+ "input",
2656
+ {
2657
+ type: "checkbox",
2658
+ checked: consent,
2659
+ onChange: (e) => setConsent(e.target.checked)
2660
+ }
2661
+ ),
2662
+ "I authorize a charge of ",
2663
+ formatCents(flow.entry.amountCents),
2664
+ " to this card if a spot opens."
2665
+ ] }),
2666
+ /* @__PURE__ */ jsx(
2667
+ "button",
2668
+ {
2669
+ disabled: !consent,
2670
+ onClick: () => void flow.createCardSetup().catch(() => {
2671
+ }),
2672
+ children: "Add card"
2673
+ }
2674
+ )
2675
+ ] }) : /* @__PURE__ */ jsx(
2676
+ AddCardForm,
2677
+ {
2678
+ brandId: args.brandId ?? "",
2679
+ centerId: args.centerId,
2680
+ setupIntent: flow.setupIntent,
2681
+ onSetupConfirmed: async (intent) => {
2682
+ await flow.cardConfirmed(intent);
2683
+ onJoined?.();
2684
+ }
2685
+ }
2686
+ )
2687
+ ] }),
2688
+ flow.status === "confirming" && /* @__PURE__ */ jsx("p", { children: "Confirming\u2026" }),
2689
+ flow.status === "joined" && /* @__PURE__ */ jsx("p", { children: "Pending \u2014 waitlist. You will be charged only if a spot opens." }),
2690
+ flow.status === "error" && /* @__PURE__ */ jsxs(Fragment, { children: [
2691
+ /* @__PURE__ */ jsx("p", { role: "alert", children: flow.error instanceof Error ? flow.error.message : "Unable to join waitlist." }),
2692
+ /* @__PURE__ */ jsx("button", { onClick: flow.reset, children: "Try again" })
2693
+ ] })
2694
+ ] });
2695
+ }
2458
2696
 
2459
- export { AccountDashboard, AccountMenu, AddToWalletButtons, AuthForm, AuthGate, BookingCatalog, BookingChange, BookingFlow, ChangePasswordForm, CommunicationPrefs, EventList, FlashSale, FlashSaleIndex, GameCardHistory, InquiryForm, MaintenanceBanner, MembershipDetail, PricingTable, PrivacyCenter, ProfileForm, SavedCards };
2697
+ export { AccountDashboard, AccountMenu, AddToWalletButtons, AuthForm, AuthGate, BookingCatalog, BookingChange, BookingFlow, ChangePasswordForm, CommunicationPrefs, EventList, FlashSale, FlashSaleIndex, GameCardHistory, InquiryForm, MaintenanceBanner, MembershipDetail, PricingTable, PrivacyCenter, ProfileForm, SavedCards, WaitlistJoin };
2460
2698
  //# sourceMappingURL=components.js.map
2461
2699
  //# sourceMappingURL=components.js.map