@bowlos/reservations 0.32.0 → 0.34.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 (35) hide show
  1. package/HEADLESS.md +108 -20
  2. package/README.md +20 -0
  3. package/dist/{account-B5i2ddbT.d.ts → account-CsCusw5Z.d.ts} +1 -1
  4. package/dist/{account-bfaIAO_T.d.cts → account-Di8nktqp.d.cts} +1 -1
  5. package/dist/{catalog-Dq8gpdAA.d.ts → catalog-DT-ePirK.d.ts} +1 -1
  6. package/dist/{catalog-BtvuX49Y.d.cts → catalog-DdvLcOrs.d.cts} +1 -1
  7. package/dist/{chunk-BFSMRBWB.js → chunk-CAXGTKJQ.js} +3 -3
  8. package/dist/{chunk-BFSMRBWB.js.map → chunk-CAXGTKJQ.js.map} +1 -1
  9. package/dist/{chunk-MJHRMLJO.js → chunk-GIAJQPMM.js} +2 -2
  10. package/dist/{chunk-MJHRMLJO.js.map → chunk-GIAJQPMM.js.map} +1 -1
  11. package/dist/components.cjs +54 -17
  12. package/dist/components.cjs.map +1 -1
  13. package/dist/components.d.cts +4 -4
  14. package/dist/components.d.ts +4 -4
  15. package/dist/components.js +56 -19
  16. package/dist/components.js.map +1 -1
  17. package/dist/{data-qGBxYRJB.d.cts → data-BaHVz6fa.d.cts} +43 -1
  18. package/dist/{data-qGBxYRJB.d.ts → data-BaHVz6fa.d.ts} +43 -1
  19. package/dist/index.cjs +27 -0
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.d.cts +54 -5
  22. package/dist/index.d.ts +54 -5
  23. package/dist/index.js +28 -3
  24. package/dist/index.js.map +1 -1
  25. package/dist/payments.d.cts +1 -1
  26. package/dist/payments.d.ts +1 -1
  27. package/dist/{react-9kBVKWRt.d.ts → react-DImwA9C9.d.ts} +2 -2
  28. package/dist/{react--xfZz9Y4.d.cts → react-DK1elmLQ.d.cts} +2 -2
  29. package/dist/react.cjs.map +1 -1
  30. package/dist/react.d.cts +5 -5
  31. package/dist/react.d.ts +5 -5
  32. package/dist/react.js +3 -3
  33. package/package.json +1 -1
  34. package/templates/center-site/app/catalog/page.tsx +10 -8
  35. package/templates/center-site/package.json +1 -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 { m as PublicSurface, g as CatalogItem } from './catalog-BtvuX49Y.cjs';
4
- export { h as CatalogResult, i as CatalogSection } from './catalog-BtvuX49Y.cjs';
5
- import { U as PricingMode, S as PaymentIntentInfo, l as Customer } from './data-qGBxYRJB.cjs';
6
- import { d as UseAccountResult } from './react--xfZz9Y4.cjs';
3
+ import { m as PublicSurface, g as CatalogItem } from './catalog-DdvLcOrs.cjs';
4
+ export { h as CatalogResult, i as CatalogSection } from './catalog-DdvLcOrs.cjs';
5
+ import { U as PricingMode, S as PaymentIntentInfo, l as Customer } from './data-BaHVz6fa.cjs';
6
+ import { d as UseAccountResult } from './react-DK1elmLQ.cjs';
7
7
  import { InquiryFormType } from '@bowlos/shared';
8
8
 
9
9
  /**
@@ -1,9 +1,9 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { CSSProperties, ReactNode } from 'react';
3
- import { m as PublicSurface, g as CatalogItem } from './catalog-Dq8gpdAA.js';
4
- export { h as CatalogResult, i as CatalogSection } from './catalog-Dq8gpdAA.js';
5
- import { U as PricingMode, S as PaymentIntentInfo, l as Customer } from './data-qGBxYRJB.js';
6
- import { d as UseAccountResult } from './react-9kBVKWRt.js';
3
+ import { m as PublicSurface, g as CatalogItem } from './catalog-DT-ePirK.js';
4
+ export { h as CatalogResult, i as CatalogSection } from './catalog-DT-ePirK.js';
5
+ import { U as PricingMode, S as PaymentIntentInfo, l as Customer } from './data-BaHVz6fa.js';
6
+ import { d as UseAccountResult } from './react-DImwA9C9.js';
7
7
  import { InquiryFormType } from '@bowlos/shared';
8
8
 
9
9
  /**
@@ -1,6 +1,6 @@
1
1
  import { INQUIRY_FORMS } from './chunk-EQH5HDYQ.js';
2
- import { useTestMode, useAccount, useAvailability, useBookingPreview, useAddons, useStartTimes, useBookingFlow, useMyReservations, useMyMemberships, useMyLoyalty, useMyCredits, useMyPasses, useFlashSale, useFlashSales, useCatalog, useRetailPricing } from './chunk-BFSMRBWB.js';
3
- import { availableUnitCount } from './chunk-MJHRMLJO.js';
2
+ import { useTestMode, useAccount, useAvailability, useBookingPreview, useAddons, useStartTimes, useBookingFlow, useMyReservations, useMyMemberships, useMyLoyalty, useMyCredits, useMyPasses, useFlashSale, useFlashSales, useCatalog, useRetailPricing } from './chunk-CAXGTKJQ.js';
3
+ import { availableUnitCount } from './chunk-GIAJQPMM.js';
4
4
  import { token, styles, formatCents, formatMinuteLabel, minutesToTime, useCountdown, formatCentsRange } from './chunk-Y3YSDO3H.js';
5
5
  export { BOWLOS_DEFAULT_THEME, BowlosTheme, formatCents, formatCentsRange } from './chunk-Y3YSDO3H.js';
6
6
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -505,37 +505,74 @@ function BookingFlow({
505
505
  }
506
506
  const holding = flow.status === "holding";
507
507
  if (reviewing) {
508
- const chosenAddons = addonList.map((a) => ({ ...a, quantity: addonQtys[a.id] ?? 0 })).filter((a) => a.quantity > 0);
509
- const addonsSubtotalCents = chosenAddons.reduce(
510
- (sum, a) => sum + a.priceCents * a.quantity,
511
- 0
508
+ const plan = preview.data?.plans?.[0];
509
+ const planId = plan?.pricePlanId;
510
+ const taxForPlan = (preview.data?.taxLinesPerPlan ?? []).find(
511
+ (tp) => tp.pricePlanId === planId
512
512
  );
513
+ const totalForPlan = (preview.data?.totalCentsPerPlan ?? []).find((tp) => tp.pricePlanId === planId)?.totalCents ?? quoteCents;
513
514
  const fee = preview.data?.reservationFee;
514
515
  const feeCents = typeof fee?.amountCents === "number" ? fee.amountCents : 0;
515
516
  const feeLabel = typeof fee?.label === "string" && fee.label ? fee.label : t.reservationFeeLabel;
516
- const reservationCents = quoteCents != null ? quoteCents - addonsSubtotalCents - feeCents : null;
517
517
  const reservationLine = t.reservationLineLabel.replace("{count}", String(count)).replace("{unit}", COUNT_LABEL[pricingMode]).replace("{date}", formatDateLabel(dateISO)).replace("{time}", `${formatMinuteLabel(startMinuteOfDay)}\u2013${formatMinuteLabel(endMinuteOfDay)}`);
518
+ const chosenAddons = addonList.map((a) => ({ ...a, quantity: addonQtys[a.id] ?? 0 })).filter((a) => a.quantity > 0);
519
+ const fallbackAddonsCents = chosenAddons.reduce(
520
+ (sum, a) => sum + a.priceCents * a.quantity,
521
+ 0
522
+ );
523
+ const fallbackReservationCents = quoteCents != null ? quoteCents - fallbackAddonsCents - feeCents : null;
518
524
  return /* @__PURE__ */ jsxs("div", { className, style: s.card, children: [
519
525
  /* @__PURE__ */ jsx("h3", { style: s.heading, children: t.reviewHeading }),
520
- /* @__PURE__ */ jsxs("div", { style: s.rowBetween, children: [
521
- /* @__PURE__ */ jsx("span", { style: s.body, children: reservationLine }),
522
- reservationCents != null ? /* @__PURE__ */ jsx("span", { style: s.body, children: formatCents(reservationCents) }) : null
523
- ] }),
524
- chosenAddons.map((a) => /* @__PURE__ */ jsxs("div", { style: s.rowBetween, children: [
525
- /* @__PURE__ */ jsxs("span", { style: s.muted, children: [
526
- a.name,
527
- " \xD7 ",
528
- a.quantity
526
+ plan?.pricePlanName ? /* @__PURE__ */ jsx("p", { style: s.muted, children: plan.pricePlanName }) : null,
527
+ plan ? /* @__PURE__ */ jsxs(Fragment, { children: [
528
+ /* @__PURE__ */ jsxs("div", { style: s.rowBetween, children: [
529
+ /* @__PURE__ */ jsx("span", { style: s.body, children: reservationLine }),
530
+ /* @__PURE__ */ jsx("span", { style: s.body, children: formatCents(plan.baseSubtotalCents) })
529
531
  ] }),
530
- /* @__PURE__ */ jsx("span", { style: s.muted, children: formatCents(a.priceCents * a.quantity) })
531
- ] }, a.id)),
532
+ plan.addonLineItems.map((a) => /* @__PURE__ */ jsxs("div", { style: s.rowBetween, children: [
533
+ /* @__PURE__ */ jsxs("span", { style: s.muted, children: [
534
+ a.addonName,
535
+ " \xD7 ",
536
+ a.quantity
537
+ ] }),
538
+ /* @__PURE__ */ jsx("span", { style: s.muted, children: formatCents(a.lineSubtotalCents) })
539
+ ] }, a.addonId)),
540
+ plan.shoesIncluded ? /* @__PURE__ */ jsxs("div", { style: s.rowBetween, children: [
541
+ /* @__PURE__ */ jsx("span", { style: s.muted, children: "Shoes included" }),
542
+ /* @__PURE__ */ jsx("span", { style: s.muted, children: "\u2014" })
543
+ ] }) : null,
544
+ plan.appliedDiscount && plan.appliedDiscount.amountCents > 0 ? /* @__PURE__ */ jsxs("div", { style: s.rowBetween, children: [
545
+ /* @__PURE__ */ jsx("span", { style: s.muted, children: plan.appliedDiscount.label }),
546
+ /* @__PURE__ */ jsxs("span", { style: s.muted, children: [
547
+ "\u2212",
548
+ formatCents(plan.appliedDiscount.amountCents)
549
+ ] })
550
+ ] }) : null,
551
+ (taxForPlan?.taxLines ?? []).map((tl) => /* @__PURE__ */ jsxs("div", { style: s.rowBetween, children: [
552
+ /* @__PURE__ */ jsx("span", { style: s.muted, children: tl.label }),
553
+ /* @__PURE__ */ jsx("span", { style: s.muted, children: formatCents(tl.taxCents) })
554
+ ] }, tl.rateId))
555
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
556
+ fallbackReservationCents != null ? /* @__PURE__ */ jsxs("div", { style: s.rowBetween, children: [
557
+ /* @__PURE__ */ jsx("span", { style: s.body, children: reservationLine }),
558
+ /* @__PURE__ */ jsx("span", { style: s.body, children: formatCents(fallbackReservationCents) })
559
+ ] }) : null,
560
+ chosenAddons.map((a) => /* @__PURE__ */ jsxs("div", { style: s.rowBetween, children: [
561
+ /* @__PURE__ */ jsxs("span", { style: s.muted, children: [
562
+ a.name,
563
+ " \xD7 ",
564
+ a.quantity
565
+ ] }),
566
+ /* @__PURE__ */ jsx("span", { style: s.muted, children: formatCents(a.priceCents * a.quantity) })
567
+ ] }, a.id))
568
+ ] }),
532
569
  feeCents > 0 ? /* @__PURE__ */ jsxs("div", { style: s.rowBetween, children: [
533
570
  /* @__PURE__ */ jsx("span", { style: s.muted, children: feeLabel }),
534
571
  /* @__PURE__ */ jsx("span", { style: s.muted, children: formatCents(feeCents) })
535
572
  ] }) : null,
536
573
  /* @__PURE__ */ jsxs("div", { style: s.rowBetween, children: [
537
574
  /* @__PURE__ */ jsx("strong", { children: t.orderTotal }),
538
- /* @__PURE__ */ jsx("strong", { children: quoteCents != null ? formatCents(quoteCents) : "\u2014" })
575
+ /* @__PURE__ */ jsx("strong", { children: totalForPlan != null ? formatCents(totalForPlan) : "\u2014" })
539
576
  ] }),
540
577
  signedIn ? (
541
578
  // Signed in → place the hold + pay. Disabled until the (possibly