@edx/frontend-app-alacarte-checkout 1.74.0 → 1.76.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 (44) hide show
  1. package/dist/components/AlacarteConfirmation/AlacarteConfirmation.js +4 -4
  2. package/dist/components/AlacarteConfirmation/AlacarteConfirmation.js.map +1 -1
  3. package/dist/components/AlacarteConfirmation/Messages.d.ts +0 -5
  4. package/dist/components/AlacarteConfirmation/Messages.js +0 -5
  5. package/dist/components/AlacarteConfirmation/Messages.js.map +1 -1
  6. package/dist/components/CartSummary/CartSummary.js +2 -2
  7. package/dist/components/CartSummary/CartSummary.js.map +1 -1
  8. package/dist/components/Checkout/Checkout.js +10 -6
  9. package/dist/components/Checkout/Checkout.js.map +1 -1
  10. package/dist/components/Checkout/Messages.d.ts +10 -0
  11. package/dist/components/Checkout/Messages.js +10 -0
  12. package/dist/components/Checkout/Messages.js.map +1 -1
  13. package/dist/components/OrderBlockedModal/OrderBlockedModal.js +2 -2
  14. package/dist/components/OrderBlockedModal/OrderBlockedModal.js.map +1 -1
  15. package/dist/components/PaymentForm/PaymentForm.js +3 -3
  16. package/dist/components/PaymentForm/PaymentForm.js.map +1 -1
  17. package/dist/components/PaymentTimeoutAlert/PaymentTimeoutAlert.js +2 -2
  18. package/dist/components/PaymentTimeoutAlert/PaymentTimeoutAlert.js.map +1 -1
  19. package/dist/components/PromoCode/Messages.d.ts +12 -2
  20. package/dist/components/PromoCode/Messages.js +18 -8
  21. package/dist/components/PromoCode/Messages.js.map +1 -1
  22. package/dist/components/PromoCode/PromoCode.d.ts +4 -1
  23. package/dist/components/PromoCode/PromoCode.js +29 -16
  24. package/dist/components/PromoCode/PromoCode.js.map +1 -1
  25. package/dist/components/PurchaseBlockedModal/PurchaseBlockedModal.js +2 -2
  26. package/dist/components/PurchaseBlockedModal/PurchaseBlockedModal.js.map +1 -1
  27. package/dist/components/StatusScreens/StatusScreens.js +1 -1
  28. package/dist/components/StatusScreens/StatusScreens.js.map +1 -1
  29. package/dist/constants.d.ts +3 -3
  30. package/dist/constants.js +5 -4
  31. package/dist/constants.js.map +1 -1
  32. package/dist/data/hooks/useAlacarteCheckout.d.ts +4 -1
  33. package/dist/data/hooks/useAlacarteCheckout.js +25 -10
  34. package/dist/data/hooks/useAlacarteCheckout.js.map +1 -1
  35. package/dist/style.scss +0 -2
  36. package/dist/styles/components/checkout.scss +2 -5
  37. package/dist/styles/components/promoCode.scss +48 -100
  38. package/dist/types/alacarte.d.ts +2 -2
  39. package/dist/types/alacarte.js.map +1 -1
  40. package/dist/utils/placeOrderErrors.d.ts +3 -0
  41. package/dist/utils/placeOrderErrors.js +6 -0
  42. package/dist/utils/placeOrderErrors.js.map +1 -1
  43. package/package.json +1 -1
  44. package/dist/styles/_srOverlay.scss +0 -17
@@ -3,7 +3,7 @@ import { useEffect, useMemo, useRef } from 'react';
3
3
  import { Alert, Button, Col, Icon, Row } from '@openedx/paragon';
4
4
  import { Error as ErrorIcon, Monitor } from '@openedx/paragon/icons';
5
5
  import { useIntl } from '@openedx/frontend-base';
6
- import { BILLING_SUPPORT_EMAIL, REFUND_POLICY_URL } from '../../constants';
6
+ import { BILLING_SUPPORT_EMAIL, getRefundPolicyUrl } from '../../constants';
7
7
  import { ProcessingScreen } from '../StatusScreens/StatusScreens';
8
8
  import { normalizeCourseName, purchasedProgramCourseNames } from '../../utils/programOrderCourses';
9
9
  import messages from './Messages';
@@ -100,9 +100,9 @@ const AlacarteConfirmation = ({ order, awaiting, error, onContinue, productDetai
100
100
  }) })] })), _jsxs("div", { className: "alacarte-confirmation__price-row alacarte-confirmation__price-row--paid", children: [_jsx("span", { children: formatMessage(messages.amountPaid) }), _jsx("span", { children: money(paid) })] })] }));
101
101
  return (_jsx("div", { className: "alacarte-confirmation", "data-testid": "alacarte-confirmation", children: _jsxs(Row, { className: "alacarte-confirmation__row", children: [_jsxs(Col, { xs: 12, className: "alacarte-confirmation__main alacarte-confirmation__intro", children: [_jsx("h1", { ref: headlineRef, tabIndex: -1, className: "alacarte-confirmation__headline font-weight-bold mb-4", children: formatMessage(messages.headline) }), _jsx("p", { className: "alacarte-confirmation__subheadline mb-4", children: formatMessage(programOrder ? messages.subheadlineProgram : messages.subheadlineCourse, { productLabel }) }), _jsxs("div", { className: "alacarte-confirmation__ctas d-flex align-items-center flex-wrap mb-4.5", children: [_jsx(Button, { variant: "brand", className: "alacarte-confirmation__cta-primary", onClick: onContinue, children: formatMessage(programOrder ? messages.startProgram : messages.startCourse) }), orderHistoryUrl && (_jsx("a", { href: orderHistoryUrl, target: "_blank", rel: "noopener noreferrer", className: "alacarte-confirmation__order-history", "aria-label": formatMessage(messages.viewOrderHistoryLabel), children: formatMessage(messages.viewOrderHistory) }))] })] }), _jsx(Col, { xs: 12, className: "alacarte-confirmation__summary-col", children: summaryCard }), _jsxs(Col, { xs: 12, className: "alacarte-confirmation__main alacarte-confirmation__details", children: [programOrder && (purchasedCourseNames.length > 0 || previouslyPurchased.length > 0) && (_jsxs("div", { className: "alacarte-confirmation__about-program mb-5", children: [_jsx("h3", { className: "alacarte-confirmation__about-title", children: formatMessage(messages.aboutProgram) }), purchasedCourseNames.length > 0 && (_jsxs(_Fragment, { children: [_jsx("h4", { className: "alacarte-confirmation__courses-included", children: formatMessage(messages.coursesIncluded, { count: programCourseTotal }) }), _jsx("ul", { className: "alacarte-confirmation__course-list mb-0", children: purchasedCourseNames.map((name) => (_jsx("li", { children: name }, name))) })] })), previouslyPurchased.length > 0 && (_jsxs("div", { className: "alacarte-confirmation__previously-purchased", "data-testid": "confirmation-previously-purchased", children: [_jsx("h4", { className: "alacarte-confirmation__previously-purchased-heading", children: formatMessage(messages.previouslyPurchased, {
102
102
  count: previouslyPurchased.length,
103
- }) }), _jsx("ul", { className: "alacarte-confirmation__course-list mb-0", children: previouslyPurchased.map((name) => (_jsx("li", { children: name }, name))) })] }))] })), _jsxs(Row, { children: [_jsxs(Col, { xs: 12, md: 7, className: "mb-4", children: [_jsx("h3", { className: "h5 font-weight-bold mb-3", children: formatMessage(messages.whatsIncluded) }), _jsxs("ul", { className: "alacarte-confirmation__benefits", children: [_jsx("li", { children: formatMessage(messages.benefit1) }), _jsx("li", { children: formatMessage(messages.benefit2) }), _jsx("li", { children: formatMessage(messages.benefit3) })] })] }), _jsxs(Col, { xs: 12, md: 5, className: "mb-4", children: [_jsxs("div", { className: "mb-3", children: [_jsx("h3", { className: "alacarte-confirmation__detail-heading font-weight-bold mb-0", children: formatMessage(messages.orderNumber) }), _jsx("p", { className: "text-muted mb-0", children: order.orderNumber })] }), _jsxs("div", { children: [_jsx("h3", { className: "alacarte-confirmation__detail-heading font-weight-bold mb-0", children: formatMessage(messages.purchaseDate) }), _jsx("p", { className: "text-muted mb-0", children: purchaseDate !== null && purchaseDate !== void 0 ? purchaseDate : '' })] })] })] }), _jsx("hr", { className: "alacarte-confirmation__divider" }), _jsx("p", { className: "alacarte-confirmation__refund text-muted small mb-0", children: formatMessage(messages.refundNotice, {
104
- email: (_jsx("a", { href: `mailto:${BILLING_SUPPORT_EMAIL}`, "aria-label": formatMessage(messages.billingEmailLabel), children: BILLING_SUPPORT_EMAIL })),
105
- refundPolicy: (_jsx("a", { href: REFUND_POLICY_URL, target: "_blank", rel: "noopener noreferrer", "aria-label": formatMessage(messages.refundPolicyLabel), children: formatMessage(messages.refundPolicy) })),
103
+ }) }), _jsx("ul", { className: "alacarte-confirmation__course-list mb-0", children: previouslyPurchased.map((name) => (_jsx("li", { children: name }, name))) })] }))] })), _jsxs(Row, { children: [_jsxs(Col, { xs: 12, md: 7, className: "mb-4", children: [_jsx("h3", { className: "h5 font-weight-bold mb-3", children: formatMessage(messages.whatsIncluded) }), _jsxs("ul", { className: "alacarte-confirmation__benefits", children: [_jsx("li", { children: formatMessage(messages.benefit1) }), _jsx("li", { children: formatMessage(messages.benefit2) }), _jsx("li", { children: formatMessage(messages.benefit3) })] })] }), _jsxs(Col, { xs: 12, md: 5, className: "mb-4", children: [_jsxs("div", { className: "mb-3", children: [_jsx("h3", { className: "alacarte-confirmation__detail-heading font-weight-bold mb-0", children: formatMessage(messages.orderNumber) }), _jsx("p", { className: "text-gray-700 mb-0", children: order.orderNumber })] }), _jsxs("div", { children: [_jsx("h3", { className: "alacarte-confirmation__detail-heading font-weight-bold mb-0", children: formatMessage(messages.purchaseDate) }), _jsx("p", { className: "text-gray-700 mb-0", children: purchaseDate !== null && purchaseDate !== void 0 ? purchaseDate : '' })] })] })] }), _jsx("hr", { className: "alacarte-confirmation__divider" }), _jsx("p", { className: "alacarte-confirmation__refund text-gray-700 small mb-0", children: formatMessage(messages.refundNotice, {
104
+ email: (_jsx("a", { href: `mailto:${BILLING_SUPPORT_EMAIL}`, children: BILLING_SUPPORT_EMAIL })),
105
+ refundPolicy: (_jsx("a", { href: getRefundPolicyUrl(), target: "_blank", rel: "noopener noreferrer", "aria-label": formatMessage(messages.refundPolicyLabel), children: formatMessage(messages.refundPolicy) })),
106
106
  }) })] })] }) }));
107
107
  };
108
108
  export default AlacarteConfirmation;
@@ -1 +1 @@
1
- {"version":3,"file":"AlacarteConfirmation.js","sourceRoot":"","sources":["../../../src/components/AlacarteConfirmation/AlacarteConfirmation.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAKlE,OAAO,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,i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AEpD,qBAAqB,GACpB,CACL;gCACD,YAAY,EAAE,CACZ,YACE,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,gBACb,aAAa,CAAC,QAAQ,CAAC,iBAAiB,CAAC,YAEpD,aAAa,CAAC,QAAQ,CAAC,YAAY,CAAC,GACnC,CACL;6BACF,CAAC,GACA,IACA,IACF,GACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC","sourcesContent":["import React, { useEffect, useMemo, useRef } from 'react';\nimport { Alert, Button, Col, Icon, Row } from '@openedx/paragon';\nimport { Error as ErrorIcon, Monitor } from '@openedx/paragon/icons';\nimport { useIntl } from '@openedx/frontend-base';\nimport { BILLING_SUPPORT_EMAIL, REFUND_POLICY_URL } from '../../constants';\nimport { ProcessingScreen } from '../StatusScreens/StatusScreens';\nimport type { CourseDetail } from '../../types';\nimport type {\n AlacarteProgramOwnedCourse, PlacedOrder, ProductDetail, ProgramDetail,\n} from '../../types/alacarte';\nimport { normalizeCourseName, purchasedProgramCourseNames } from '../../utils/programOrderCourses';\nimport messages from './Messages';\n\nexport interface AlacarteConfirmationProps {\n order: PlacedOrder | null,\n awaiting: boolean,\n error: string | null,\n onContinue?: () => void,\n /** Optional catalog detail from checkout — logo / brand. */\n productDetail?: ProductDetail | null,\n /** Display title from the checkout line (course or program name). */\n productTitle?: string | null,\n /** Program member courses already owned before this order. */\n ownedCourses?: AlacarteProgramOwnedCourse[] | null,\n /** Learner order-history / dashboard URL for the secondary CTA. */\n orderHistoryUrl?: string | null,\n /** ISO timestamp the order was placed (tPlacedAt, falling back to\n * biCreatedAt). Drives the purchase date. */\n placedAt?: string | null,\n}\n\nfunction isProgramDetail(detail: ProductDetail | null): detail is ProgramDetail {\n return !!detail && 'tCourses' in detail;\n}\n\nfunction isProgramOrder(order: PlacedOrder, productDetail: ProductDetail | null): boolean {\n return isProgramDetail(productDetail)\n || order.lines.some((line) => line.kind === 'program' || !!line.programId);\n}\n\nfunction formatPurchaseDate(locale: string, date: Date): string {\n return new Intl.DateTimeFormat(locale, {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n }).format(date);\n}\n\nconst AlacarteConfirmation = ({\n order,\n awaiting,\n error,\n onContinue,\n productDetail = null,\n productTitle = null,\n ownedCourses = null,\n orderHistoryUrl = null,\n placedAt = null,\n}: AlacarteConfirmationProps) => {\n const { formatMessage, locale = 'en-US' } = useIntl();\n\n const placedAtDate = useMemo(() => {\n const parsed = placedAt ? new Date(placedAt) : null;\n return parsed && !Number.isNaN(parsed.getTime()) ? parsed : null;\n }, [placedAt]);\n\n const purchaseDate = useMemo(\n () => (placedAtDate ? formatPurchaseDate(locale, placedAtDate) : null),\n [locale, placedAtDate],\n );\n\n // Checkout swaps to this view in place, unmounting the focused Pay now\n // button. Start keyboard and screen reader users at the headline so the\n // next Tab reaches the CTAs instead of restarting from the site header.\n const headlineRef = useRef<HTMLHeadingElement>(null);\n const hasOrder = !!order;\n useEffect(() => {\n if (hasOrder) headlineRef.current?.focus();\n }, [hasOrder]);\n\n if (awaiting && !order) {\n return <ProcessingScreen />;\n }\n\n if (error && !order) {\n return (\n <Alert variant=\"danger\" icon={ErrorIcon}>\n {formatMessage(messages.orderLoadError, { error })}\n </Alert>\n );\n }\n\n if (!order) {\n return null;\n }\n\n const programOrder = isProgramOrder(order, productDetail);\n const courseDetail = productDetail && 'maId' in productDetail\n ? (productDetail as CourseDetail)\n : null;\n const programDetail = productDetail && 'tCourses' in productDetail\n ? (productDetail as ProgramDetail)\n : null;\n\n const firstLine = order.lines[0];\n const brand = courseDetail?.tBrandText?.trim()\n || programDetail?.tCourses?.[0]?.tBrandText?.trim()\n || '';\n const baseName = productTitle\n || firstLine?.name\n || (programOrder ? 'your program' : 'your course');\n\n const productLabel = !programOrder && brand && !productTitle?.includes(brand)\n ? `${brand}: ${baseName}`\n : baseName;\n\n const orgLogo = courseDetail?.imageUrl\n || programDetail?.tCourses?.[0]?.tOrgLogoUrl\n || programDetail?.tCourses?.[0]?.imageUrl\n || null;\n\n const currency = order.totals?.currency ?? 'USD';\n // Subtotal is price less owned-course deduction (before coupon/offer discount).\n const subtotal = Math.max(\n 0,\n (order.totals?.price ?? 0) - (order.totals?.deduction ?? 0),\n );\n const discount = order.totals?.discount ?? 0;\n const paid = order.totals?.paid ?? 0;\n\n const money = (amount: number) => formatMessage(messages.moneyAmount, {\n amount: amount.toFixed(2),\n currency,\n });\n\n const linePurchased = programOrder\n ? order.lines.map((line) => line.name?.trim()).filter((name): name is string => !!name)\n : [];\n // Partial program: catalog courses the learner does not already own are\n // the ones this order bought, when that count matches the order lines.\n const catalogPurchased = programOrder && isProgramDetail(programDetail)\n ? purchasedProgramCourseNames(programDetail.tCourses, ownedCourses ?? [], order.lines.length)\n : null;\n const purchasedCourseNames = catalogPurchased ?? linePurchased;\n const purchasedNameSet = new Set(purchasedCourseNames.map(normalizeCourseName));\n\n const previouslyPurchased = purchasedCourseNames.length === 0\n ? []\n : (ownedCourses ?? [])\n .map((c) => c.name?.trim())\n .filter((name): name is string => !!name && !purchasedNameSet.has(normalizeCourseName(name)));\n\n const programCourseTotal = programDetail?.tCourses?.length\n ?? (purchasedCourseNames.length + previouslyPurchased.length);\n\n const summaryCard = (\n <div className=\"alacarte-confirmation__summary\">\n <h2 className=\"alacarte-confirmation__summary-title font-weight-bold mb-0\">\n {formatMessage(messages.purchaseSummary)}\n </h2>\n <hr className=\"alacarte-confirmation__summary-divider\" />\n\n <div className=\"alacarte-confirmation__product d-flex align-items-start\">\n {/* Decorative — the institution is named in the product title. */}\n {orgLogo ? (\n <img\n src={orgLogo}\n alt=\"\"\n aria-hidden=\"true\"\n className=\"alacarte-confirmation__org-logo\"\n />\n ) : (\n <div\n className=\"alacarte-confirmation__org-logo alacarte-confirmation__org-logo--placeholder\"\n aria-hidden\n />\n )}\n <div>\n <span className=\"alacarte-confirmation__badge\">\n <Icon src={Monitor} className=\"alacarte-confirmation__badge-icon\" aria-hidden=\"true\" />\n {formatMessage(messages.verifiedCertificate)}\n </span>\n <p className=\"alacarte-confirmation__product-name font-weight-bold mb-0\">\n {productLabel}\n </p>\n </div>\n </div>\n\n <hr className=\"alacarte-confirmation__summary-divider\" />\n\n <div className=\"alacarte-confirmation__price-row\">\n <span>{formatMessage(messages.subtotal)}</span>\n <span>{money(subtotal)}</span>\n </div>\n {discount > 0 && (\n <div className=\"alacarte-confirmation__price-row alacarte-confirmation__price-row--discount\">\n <span>{formatMessage(messages.discountsApplied)}</span>\n <span>\n {formatMessage(messages.discountAmount, {\n amount: discount.toFixed(2),\n currency,\n })}\n </span>\n </div>\n )}\n <div className=\"alacarte-confirmation__price-row alacarte-confirmation__price-row--paid\">\n <span>{formatMessage(messages.amountPaid)}</span>\n <span>{money(paid)}</span>\n </div>\n </div>\n );\n\n return (\n <div className=\"alacarte-confirmation\" data-testid=\"alacarte-confirmation\">\n {/* DOM order is the reading order on every breakpoint: intro, purchase\n summary, then order details. From lg up, the grid in\n alacarteConfirmation.scss moves the summary to the right column. */}\n <Row className=\"alacarte-confirmation__row\">\n <Col xs={12} className=\"alacarte-confirmation__main alacarte-confirmation__intro\">\n <h1\n ref={headlineRef}\n tabIndex={-1}\n className=\"alacarte-confirmation__headline font-weight-bold mb-4\"\n >\n {formatMessage(messages.headline)}\n </h1>\n <p className=\"alacarte-confirmation__subheadline mb-4\">\n {formatMessage(\n programOrder ? messages.subheadlineProgram : messages.subheadlineCourse,\n { productLabel },\n )}\n </p>\n\n <div className=\"alacarte-confirmation__ctas d-flex align-items-center flex-wrap mb-4.5\">\n <Button\n variant=\"brand\"\n className=\"alacarte-confirmation__cta-primary\"\n onClick={onContinue}\n >\n {formatMessage(programOrder ? messages.startProgram : messages.startCourse)}\n </Button>\n {orderHistoryUrl && (\n <a\n href={orderHistoryUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"alacarte-confirmation__order-history\"\n aria-label={formatMessage(messages.viewOrderHistoryLabel)}\n >\n {formatMessage(messages.viewOrderHistory)}\n </a>\n )}\n </div>\n </Col>\n\n <Col xs={12} className=\"alacarte-confirmation__summary-col\">\n {summaryCard}\n </Col>\n\n <Col xs={12} className=\"alacarte-confirmation__main alacarte-confirmation__details\">\n {programOrder && (purchasedCourseNames.length > 0 || previouslyPurchased.length > 0) && (\n <div className=\"alacarte-confirmation__about-program mb-5\">\n <h3 className=\"alacarte-confirmation__about-title\">\n {formatMessage(messages.aboutProgram)}\n </h3>\n {purchasedCourseNames.length > 0 && (\n <>\n <h4 className=\"alacarte-confirmation__courses-included\">\n {formatMessage(messages.coursesIncluded, { count: programCourseTotal })}\n </h4>\n <ul className=\"alacarte-confirmation__course-list mb-0\">\n {purchasedCourseNames.map((name) => (\n <li key={name}>{name}</li>\n ))}\n </ul>\n </>\n )}\n {previouslyPurchased.length > 0 && (\n <div\n className=\"alacarte-confirmation__previously-purchased\"\n data-testid=\"confirmation-previously-purchased\"\n >\n <h4 className=\"alacarte-confirmation__previously-purchased-heading\">\n {formatMessage(messages.previouslyPurchased, {\n count: previouslyPurchased.length,\n })}\n </h4>\n <ul className=\"alacarte-confirmation__course-list mb-0\">\n {previouslyPurchased.map((name) => (\n <li key={name}>{name}</li>\n ))}\n </ul>\n </div>\n )}\n </div>\n )}\n\n <Row>\n <Col xs={12} md={7} className=\"mb-4\">\n <h3 className=\"h5 font-weight-bold mb-3\">\n {formatMessage(messages.whatsIncluded)}\n </h3>\n <ul className=\"alacarte-confirmation__benefits\">\n <li>{formatMessage(messages.benefit1)}</li>\n <li>{formatMessage(messages.benefit2)}</li>\n <li>{formatMessage(messages.benefit3)}</li>\n </ul>\n </Col>\n <Col xs={12} md={5} className=\"mb-4\">\n <div className=\"mb-3\">\n <h3 className=\"alacarte-confirmation__detail-heading font-weight-bold mb-0\">\n {formatMessage(messages.orderNumber)}\n </h3>\n <p className=\"text-muted mb-0\">{order.orderNumber}</p>\n </div>\n <div>\n <h3 className=\"alacarte-confirmation__detail-heading font-weight-bold mb-0\">\n {formatMessage(messages.purchaseDate)}\n </h3>\n <p className=\"text-muted mb-0\">{purchaseDate ?? ''}</p>\n </div>\n </Col>\n </Row>\n\n <hr className=\"alacarte-confirmation__divider\" />\n <p className=\"alacarte-confirmation__refund text-muted small mb-0\">\n {formatMessage(messages.refundNotice, {\n email: (\n <a\n href={`mailto:${BILLING_SUPPORT_EMAIL}`}\n aria-label={formatMessage(messages.billingEmailLabel)}\n >\n {BILLING_SUPPORT_EMAIL}\n </a>\n ),\n refundPolicy: (\n <a\n href={REFUND_POLICY_URL}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n aria-label={formatMessage(messages.refundPolicyLabel)}\n >\n {formatMessage(messages.refundPolicy)}\n </a>\n ),\n })}\n </p>\n </Col>\n </Row>\n </div>\n );\n};\n\nexport default AlacarteConfirmation;\n"]}
1
+ {"version":3,"file":"AlacarteConfirmation.js","sourceRoot":"","sources":["../../../src/components/AlacarteConfirmation/AlacarteConfirmation.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAKlE,OAAO,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AACnG,OAAO,QAAQ,MAAM,YAAY,CAAC;AAoBlC,SAAS,eAAe,CAAC,MAA4B;IACnD,OAAO,CAAC,CAAC,MAAM,IAAI,UAAU,IAAI,MAAM,CAA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CAAC,QAAQ,CAAC,YAAY,CAAC,GACnC,CACL;6BACF,CAAC,GACA,IACA,IACF,GACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC","sourcesContent":["import React, { useEffect, useMemo, useRef } from 'react';\nimport { Alert, Button, Col, Icon, Row } from '@openedx/paragon';\nimport { Error as ErrorIcon, Monitor } from '@openedx/paragon/icons';\nimport { useIntl } from '@openedx/frontend-base';\nimport { BILLING_SUPPORT_EMAIL, getRefundPolicyUrl } from '../../constants';\nimport { ProcessingScreen } from '../StatusScreens/StatusScreens';\nimport type { CourseDetail } from '../../types';\nimport type {\n AlacarteProgramOwnedCourse, PlacedOrder, ProductDetail, ProgramDetail,\n} from '../../types/alacarte';\nimport { normalizeCourseName, purchasedProgramCourseNames } from '../../utils/programOrderCourses';\nimport messages from './Messages';\n\nexport interface AlacarteConfirmationProps {\n order: PlacedOrder | null,\n awaiting: boolean,\n error: string | null,\n onContinue?: () => void,\n /** Optional catalog detail from checkout — logo / brand. */\n productDetail?: ProductDetail | null,\n /** Display title from the checkout line (course or program name). */\n productTitle?: string | null,\n /** Program member courses already owned before this order. */\n ownedCourses?: AlacarteProgramOwnedCourse[] | null,\n /** Learner order-history / dashboard URL for the secondary CTA. */\n orderHistoryUrl?: string | null,\n /** ISO timestamp the order was placed (tPlacedAt, falling back to\n * biCreatedAt). Drives the purchase date. */\n placedAt?: string | null,\n}\n\nfunction isProgramDetail(detail: ProductDetail | null): detail is ProgramDetail {\n return !!detail && 'tCourses' in detail;\n}\n\nfunction isProgramOrder(order: PlacedOrder, productDetail: ProductDetail | null): boolean {\n return isProgramDetail(productDetail)\n || order.lines.some((line) => line.kind === 'program' || !!line.programId);\n}\n\nfunction formatPurchaseDate(locale: string, date: Date): string {\n return new Intl.DateTimeFormat(locale, {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n }).format(date);\n}\n\nconst AlacarteConfirmation = ({\n order,\n awaiting,\n error,\n onContinue,\n productDetail = null,\n productTitle = null,\n ownedCourses = null,\n orderHistoryUrl = null,\n placedAt = null,\n}: AlacarteConfirmationProps) => {\n const { formatMessage, locale = 'en-US' } = useIntl();\n\n const placedAtDate = useMemo(() => {\n const parsed = placedAt ? new Date(placedAt) : null;\n return parsed && !Number.isNaN(parsed.getTime()) ? parsed : null;\n }, [placedAt]);\n\n const purchaseDate = useMemo(\n () => (placedAtDate ? formatPurchaseDate(locale, placedAtDate) : null),\n [locale, placedAtDate],\n );\n\n // Checkout swaps to this view in place, unmounting the focused Pay now\n // button. Start keyboard and screen reader users at the headline so the\n // next Tab reaches the CTAs instead of restarting from the site header.\n const headlineRef = useRef<HTMLHeadingElement>(null);\n const hasOrder = !!order;\n useEffect(() => {\n if (hasOrder) headlineRef.current?.focus();\n }, [hasOrder]);\n\n if (awaiting && !order) {\n return <ProcessingScreen />;\n }\n\n if (error && !order) {\n return (\n <Alert variant=\"danger\" icon={ErrorIcon}>\n {formatMessage(messages.orderLoadError, { error })}\n </Alert>\n );\n }\n\n if (!order) {\n return null;\n }\n\n const programOrder = isProgramOrder(order, productDetail);\n const courseDetail = productDetail && 'maId' in productDetail\n ? (productDetail as CourseDetail)\n : null;\n const programDetail = productDetail && 'tCourses' in productDetail\n ? (productDetail as ProgramDetail)\n : null;\n\n const firstLine = order.lines[0];\n const brand = courseDetail?.tBrandText?.trim()\n || programDetail?.tCourses?.[0]?.tBrandText?.trim()\n || '';\n const baseName = productTitle\n || firstLine?.name\n || (programOrder ? 'your program' : 'your course');\n\n const productLabel = !programOrder && brand && !productTitle?.includes(brand)\n ? `${brand}: ${baseName}`\n : baseName;\n\n const orgLogo = courseDetail?.imageUrl\n || programDetail?.tCourses?.[0]?.tOrgLogoUrl\n || programDetail?.tCourses?.[0]?.imageUrl\n || null;\n\n const currency = order.totals?.currency ?? 'USD';\n // Subtotal is price less owned-course deduction (before coupon/offer discount).\n const subtotal = Math.max(\n 0,\n (order.totals?.price ?? 0) - (order.totals?.deduction ?? 0),\n );\n const discount = order.totals?.discount ?? 0;\n const paid = order.totals?.paid ?? 0;\n\n const money = (amount: number) => formatMessage(messages.moneyAmount, {\n amount: amount.toFixed(2),\n currency,\n });\n\n const linePurchased = programOrder\n ? order.lines.map((line) => line.name?.trim()).filter((name): name is string => !!name)\n : [];\n // Partial program: catalog courses the learner does not already own are\n // the ones this order bought, when that count matches the order lines.\n const catalogPurchased = programOrder && isProgramDetail(programDetail)\n ? purchasedProgramCourseNames(programDetail.tCourses, ownedCourses ?? [], order.lines.length)\n : null;\n const purchasedCourseNames = catalogPurchased ?? linePurchased;\n const purchasedNameSet = new Set(purchasedCourseNames.map(normalizeCourseName));\n\n const previouslyPurchased = purchasedCourseNames.length === 0\n ? []\n : (ownedCourses ?? [])\n .map((c) => c.name?.trim())\n .filter((name): name is string => !!name && !purchasedNameSet.has(normalizeCourseName(name)));\n\n const programCourseTotal = programDetail?.tCourses?.length\n ?? (purchasedCourseNames.length + previouslyPurchased.length);\n\n const summaryCard = (\n <div className=\"alacarte-confirmation__summary\">\n <h2 className=\"alacarte-confirmation__summary-title font-weight-bold mb-0\">\n {formatMessage(messages.purchaseSummary)}\n </h2>\n <hr className=\"alacarte-confirmation__summary-divider\" />\n\n <div className=\"alacarte-confirmation__product d-flex align-items-start\">\n {/* Decorative — the institution is named in the product title. */}\n {orgLogo ? (\n <img\n src={orgLogo}\n alt=\"\"\n aria-hidden=\"true\"\n className=\"alacarte-confirmation__org-logo\"\n />\n ) : (\n <div\n className=\"alacarte-confirmation__org-logo alacarte-confirmation__org-logo--placeholder\"\n aria-hidden\n />\n )}\n <div>\n <span className=\"alacarte-confirmation__badge\">\n <Icon src={Monitor} className=\"alacarte-confirmation__badge-icon\" aria-hidden=\"true\" />\n {formatMessage(messages.verifiedCertificate)}\n </span>\n <p className=\"alacarte-confirmation__product-name font-weight-bold mb-0\">\n {productLabel}\n </p>\n </div>\n </div>\n\n <hr className=\"alacarte-confirmation__summary-divider\" />\n\n <div className=\"alacarte-confirmation__price-row\">\n <span>{formatMessage(messages.subtotal)}</span>\n <span>{money(subtotal)}</span>\n </div>\n {discount > 0 && (\n <div className=\"alacarte-confirmation__price-row alacarte-confirmation__price-row--discount\">\n <span>{formatMessage(messages.discountsApplied)}</span>\n <span>\n {formatMessage(messages.discountAmount, {\n amount: discount.toFixed(2),\n currency,\n })}\n </span>\n </div>\n )}\n <div className=\"alacarte-confirmation__price-row alacarte-confirmation__price-row--paid\">\n <span>{formatMessage(messages.amountPaid)}</span>\n <span>{money(paid)}</span>\n </div>\n </div>\n );\n\n return (\n <div className=\"alacarte-confirmation\" data-testid=\"alacarte-confirmation\">\n {/* DOM order is the reading order on every breakpoint: intro, purchase\n summary, then order details. From lg up, the grid in\n alacarteConfirmation.scss moves the summary to the right column. */}\n <Row className=\"alacarte-confirmation__row\">\n <Col xs={12} className=\"alacarte-confirmation__main alacarte-confirmation__intro\">\n <h1\n ref={headlineRef}\n tabIndex={-1}\n className=\"alacarte-confirmation__headline font-weight-bold mb-4\"\n >\n {formatMessage(messages.headline)}\n </h1>\n <p className=\"alacarte-confirmation__subheadline mb-4\">\n {formatMessage(\n programOrder ? messages.subheadlineProgram : messages.subheadlineCourse,\n { productLabel },\n )}\n </p>\n\n <div className=\"alacarte-confirmation__ctas d-flex align-items-center flex-wrap mb-4.5\">\n <Button\n variant=\"brand\"\n className=\"alacarte-confirmation__cta-primary\"\n onClick={onContinue}\n >\n {formatMessage(programOrder ? messages.startProgram : messages.startCourse)}\n </Button>\n {orderHistoryUrl && (\n <a\n href={orderHistoryUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"alacarte-confirmation__order-history\"\n aria-label={formatMessage(messages.viewOrderHistoryLabel)}\n >\n {formatMessage(messages.viewOrderHistory)}\n </a>\n )}\n </div>\n </Col>\n\n <Col xs={12} className=\"alacarte-confirmation__summary-col\">\n {summaryCard}\n </Col>\n\n <Col xs={12} className=\"alacarte-confirmation__main alacarte-confirmation__details\">\n {programOrder && (purchasedCourseNames.length > 0 || previouslyPurchased.length > 0) && (\n <div className=\"alacarte-confirmation__about-program mb-5\">\n <h3 className=\"alacarte-confirmation__about-title\">\n {formatMessage(messages.aboutProgram)}\n </h3>\n {purchasedCourseNames.length > 0 && (\n <>\n <h4 className=\"alacarte-confirmation__courses-included\">\n {formatMessage(messages.coursesIncluded, { count: programCourseTotal })}\n </h4>\n <ul className=\"alacarte-confirmation__course-list mb-0\">\n {purchasedCourseNames.map((name) => (\n <li key={name}>{name}</li>\n ))}\n </ul>\n </>\n )}\n {previouslyPurchased.length > 0 && (\n <div\n className=\"alacarte-confirmation__previously-purchased\"\n data-testid=\"confirmation-previously-purchased\"\n >\n <h4 className=\"alacarte-confirmation__previously-purchased-heading\">\n {formatMessage(messages.previouslyPurchased, {\n count: previouslyPurchased.length,\n })}\n </h4>\n <ul className=\"alacarte-confirmation__course-list mb-0\">\n {previouslyPurchased.map((name) => (\n <li key={name}>{name}</li>\n ))}\n </ul>\n </div>\n )}\n </div>\n )}\n\n <Row>\n <Col xs={12} md={7} className=\"mb-4\">\n <h3 className=\"h5 font-weight-bold mb-3\">\n {formatMessage(messages.whatsIncluded)}\n </h3>\n <ul className=\"alacarte-confirmation__benefits\">\n <li>{formatMessage(messages.benefit1)}</li>\n <li>{formatMessage(messages.benefit2)}</li>\n <li>{formatMessage(messages.benefit3)}</li>\n </ul>\n </Col>\n <Col xs={12} md={5} className=\"mb-4\">\n <div className=\"mb-3\">\n <h3 className=\"alacarte-confirmation__detail-heading font-weight-bold mb-0\">\n {formatMessage(messages.orderNumber)}\n </h3>\n <p className=\"text-gray-700 mb-0\">{order.orderNumber}</p>\n </div>\n <div>\n <h3 className=\"alacarte-confirmation__detail-heading font-weight-bold mb-0\">\n {formatMessage(messages.purchaseDate)}\n </h3>\n <p className=\"text-gray-700 mb-0\">{purchaseDate ?? ''}</p>\n </div>\n </Col>\n </Row>\n\n <hr className=\"alacarte-confirmation__divider\" />\n <p className=\"alacarte-confirmation__refund text-gray-700 small mb-0\">\n {formatMessage(messages.refundNotice, {\n email: (\n <a href={`mailto:${BILLING_SUPPORT_EMAIL}`}>\n {BILLING_SUPPORT_EMAIL}\n </a>\n ),\n refundPolicy: (\n <a\n href={getRefundPolicyUrl()}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n aria-label={formatMessage(messages.refundPolicyLabel)}\n >\n {formatMessage(messages.refundPolicy)}\n </a>\n ),\n })}\n </p>\n </Col>\n </Row>\n </div>\n );\n};\n\nexport default AlacarteConfirmation;\n"]}
@@ -89,11 +89,6 @@ declare const messages: {
89
89
  defaultMessage: string;
90
90
  description: string;
91
91
  };
92
- billingEmailLabel: {
93
- id: string;
94
- defaultMessage: string;
95
- description: string;
96
- };
97
92
  refundPolicy: {
98
93
  id: string;
99
94
  defaultMessage: string;
@@ -90,11 +90,6 @@ const messages = defineMessages({
90
90
  defaultMessage: 'For course or program refunds, contact {email}. See our {refundPolicy} for details.',
91
91
  description: 'Refund contact line at the bottom of the confirmation page; {email} is the billing email link, {refundPolicy} the Refund Policy link',
92
92
  },
93
- billingEmailLabel: {
94
- id: 'checkout.alacarteConfirmation.billingEmailLabel',
95
- defaultMessage: 'Email billing at edx dot org',
96
- description: 'Accessible label for the billing@edx.org email link',
97
- },
98
93
  refundPolicy: {
99
94
  id: 'checkout.alacarteConfirmation.refundPolicy',
100
95
  defaultMessage: 'Refund Policy',
@@ -1 +1 @@
1
- {"version":3,"file":"Messages.js","sourceRoot":"","sources":["../../../src/components/AlacarteConfirmation/Messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,cAAc,EAAE;QACd,EAAE,EAAE,8CAA8C;QAClD,cAAc,EAAE,yFAAyF;QACzG,WAAW,EAAE,8DAA8D;KAC5E;IACD,QAAQ,EAAE;QACR,EAAE,EAAE,wCAAwC;QAC5C,cAAc,EAAE,iCAAiC;QACjD,WAAW,EAAE,yDAAyD;KACvE;IACD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AuB;KACrC;IACD,WAAW,EAAE;QACX,EAAE,EAAE,2CAA2C;QAC/C,cAAc,EAAE,sBAAsB;QACtC,WAAW,EAAE,wCAAwC;KACtD;IACD,cAAc,EAAE;QACd,EAAE,EAAE,8CAA8C;QAClD,cAAc,EAAE,uBAAuB;QACvC,WAAW,EAAE,4CAA4C;KAC1D;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n orderLoadError: {\n id: 'checkout.alacarteConfirmation.orderLoadError',\n defaultMessage: 'We could not load your order ({error}). Please refresh or check your learner dashboard.',\n description: 'Error shown when getTwouOrder fails on the confirmation page',\n },\n headline: {\n id: 'checkout.alacarteConfirmation.headline',\n defaultMessage: \"You're ready to begin learning.\",\n description: 'Main headline on the à la carte order confirmation page',\n },\n subheadlineCourse: {\n id: 'checkout.alacarteConfirmation.subheadlineCourse',\n defaultMessage: \"Your payment is complete and you're enrolled in {productLabel}. Below is a summary of your order.\",\n description: 'Confirmation subheadline for a course purchase',\n },\n subheadlineProgram: {\n id: 'checkout.alacarteConfirmation.subheadlineProgram',\n defaultMessage: \"Your payment is complete and you're enrolled in {productLabel}. Below is a summary of your order.\",\n description: 'Confirmation subheadline for a program purchase',\n },\n startCourse: {\n id: 'checkout.alacarteConfirmation.startCourse',\n defaultMessage: 'Start course',\n description: 'Primary CTA after buying a course',\n },\n startProgram: {\n id: 'checkout.alacarteConfirmation.startProgram',\n defaultMessage: 'Start program',\n description: 'Primary CTA after buying a program',\n },\n viewOrderHistory: {\n id: 'checkout.alacarteConfirmation.viewOrderHistory',\n defaultMessage: 'View order history',\n description: 'Secondary link to the learner order history',\n },\n viewOrderHistoryLabel: {\n id: 'checkout.alacarteConfirmation.viewOrderHistoryLabel',\n defaultMessage: 'View order history, opens in a new tab',\n description: 'Accessible label for the order history link, which opens in a new tab',\n },\n aboutProgram: {\n id: 'checkout.alacarteConfirmation.aboutProgram',\n defaultMessage: 'About program',\n description: 'Heading for the list of courses included in a program order',\n },\n coursesIncluded: {\n id: 'checkout.alacarteConfirmation.coursesIncluded',\n defaultMessage: 'Courses included in this program ({count}):',\n description: 'Subheading above newly purchased program courses; count is the full program size',\n },\n previouslyPurchased: {\n id: 'checkout.alacarteConfirmation.previouslyPurchased',\n defaultMessage: 'Courses previously purchased ({count}):',\n description: 'Heading above member courses the learner already owned before this order',\n },\n whatsIncluded: {\n id: 'checkout.alacarteConfirmation.whatsIncluded',\n defaultMessage: \"What's included\",\n description: 'Benefits section heading on the confirmation page',\n },\n benefit1: {\n id: 'checkout.alacarteConfirmation.benefit1',\n defaultMessage: 'Access to graded assignments and exams',\n description: 'First à la carte purchase benefit',\n },\n benefit2: {\n id: 'checkout.alacarteConfirmation.benefit2',\n defaultMessage: 'Shareable Certificate upon completion',\n description: 'Second à la carte purchase benefit',\n },\n benefit3: {\n id: 'checkout.alacarteConfirmation.benefit3',\n defaultMessage: '24/7 Global Support',\n description: 'Third à la carte purchase benefit',\n },\n orderNumber: {\n id: 'checkout.alacarteConfirmation.orderNumber',\n defaultMessage: 'Order number',\n description: 'Order number label',\n },\n purchaseDate: {\n id: 'checkout.alacarteConfirmation.purchaseDate',\n defaultMessage: 'Purchase date',\n description: 'Purchase date label',\n },\n refundNotice: {\n id: 'checkout.alacarteConfirmation.refundContact',\n defaultMessage: 'For course or program refunds, contact {email}. See our {refundPolicy} for details.',\n description: 'Refund contact line at the bottom of the confirmation page; {email} is the billing email link, {refundPolicy} the Refund Policy link',\n },\n billingEmailLabel: {\n id: 'checkout.alacarteConfirmation.billingEmailLabel',\n defaultMessage: 'Email billing at edx dot org',\n description: 'Accessible label for the billing@edx.org email link',\n },\n refundPolicy: {\n id: 'checkout.alacarteConfirmation.refundPolicy',\n defaultMessage: 'Refund Policy',\n description: 'Link text for the refund policy in the refund contact line',\n },\n refundPolicyLabel: {\n id: 'checkout.alacarteConfirmation.refundPolicyLabel',\n defaultMessage: 'Refund Policy, opens in a new tab',\n description: 'Accessible label for the Refund Policy link, which opens in a new tab',\n },\n purchaseSummary: {\n id: 'checkout.alacarteConfirmation.purchaseSummary',\n defaultMessage: 'Purchase summary',\n description: 'Sidebar heading for the purchase summary card',\n },\n verifiedCertificate: {\n id: 'checkout.alacarteConfirmation.verifiedCertificate',\n defaultMessage: 'Verified certificate',\n description: 'Badge on the purchase summary product',\n },\n subtotal: {\n id: 'checkout.alacarteConfirmation.subtotal',\n defaultMessage: 'Subtotal',\n description: 'Subtotal row label',\n },\n discountsApplied: {\n id: 'checkout.alacarteConfirmation.discountsApplied',\n defaultMessage: 'Discounts applied',\n description: 'Discount row label',\n },\n amountPaid: {\n id: 'checkout.alacarteConfirmation.amountPaid',\n defaultMessage: 'Amount paid',\n description: 'Amount paid row label',\n },\n moneyAmount: {\n id: 'checkout.alacarteConfirmation.moneyAmount',\n defaultMessage: '${amount} {currency}',\n description: 'Formatted money amount e.g. $12.00 USD',\n },\n discountAmount: {\n id: 'checkout.alacarteConfirmation.discountAmount',\n defaultMessage: '-${amount} {currency}',\n description: 'Formatted discount amount e.g. -$10.00 USD',\n },\n});\n\nexport default messages;\n"]}
1
+ {"version":3,"file":"Messages.js","sourceRoot":"","sources":["../../../src/components/AlacarteConfirmation/Messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,cAAc,EAAE;QACd,EAAE,EAAE,8CAA8C;QAClD,cAAc,EAAE,yFAAyF;QACzG,WAAW,EAAE,8DAA8D;KAC5E;IACD,QAAQ,EAAE;QACR,EAAE,EAAE,wCAAwC;QAC5C,cAAc,EAAE,iCAAiC;QACjD,WAAW,EAAE,yDAAyD;KACvE;IACD,iBAAiB,EAAE;QACjB,EAAE,EAAE,iDAAiD;QACrD,cAAc,EAAE,mGAAmG;QACnH,WAAW,EAAE,gDAAgD;KAC9D;IACD,kBAAkB,EAAE;QAClB,EAAE,EAA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,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n orderLoadError: {\n id: 'checkout.alacarteConfirmation.orderLoadError',\n defaultMessage: 'We could not load your order ({error}). Please refresh or check your learner dashboard.',\n description: 'Error shown when getTwouOrder fails on the confirmation page',\n },\n headline: {\n id: 'checkout.alacarteConfirmation.headline',\n defaultMessage: \"You're ready to begin learning.\",\n description: 'Main headline on the à la carte order confirmation page',\n },\n subheadlineCourse: {\n id: 'checkout.alacarteConfirmation.subheadlineCourse',\n defaultMessage: \"Your payment is complete and you're enrolled in {productLabel}. Below is a summary of your order.\",\n description: 'Confirmation subheadline for a course purchase',\n },\n subheadlineProgram: {\n id: 'checkout.alacarteConfirmation.subheadlineProgram',\n defaultMessage: \"Your payment is complete and you're enrolled in {productLabel}. Below is a summary of your order.\",\n description: 'Confirmation subheadline for a program purchase',\n },\n startCourse: {\n id: 'checkout.alacarteConfirmation.startCourse',\n defaultMessage: 'Start course',\n description: 'Primary CTA after buying a course',\n },\n startProgram: {\n id: 'checkout.alacarteConfirmation.startProgram',\n defaultMessage: 'Start program',\n description: 'Primary CTA after buying a program',\n },\n viewOrderHistory: {\n id: 'checkout.alacarteConfirmation.viewOrderHistory',\n defaultMessage: 'View order history',\n description: 'Secondary link to the learner order history',\n },\n viewOrderHistoryLabel: {\n id: 'checkout.alacarteConfirmation.viewOrderHistoryLabel',\n defaultMessage: 'View order history, opens in a new tab',\n description: 'Accessible label for the order history link, which opens in a new tab',\n },\n aboutProgram: {\n id: 'checkout.alacarteConfirmation.aboutProgram',\n defaultMessage: 'About program',\n description: 'Heading for the list of courses included in a program order',\n },\n coursesIncluded: {\n id: 'checkout.alacarteConfirmation.coursesIncluded',\n defaultMessage: 'Courses included in this program ({count}):',\n description: 'Subheading above newly purchased program courses; count is the full program size',\n },\n previouslyPurchased: {\n id: 'checkout.alacarteConfirmation.previouslyPurchased',\n defaultMessage: 'Courses previously purchased ({count}):',\n description: 'Heading above member courses the learner already owned before this order',\n },\n whatsIncluded: {\n id: 'checkout.alacarteConfirmation.whatsIncluded',\n defaultMessage: \"What's included\",\n description: 'Benefits section heading on the confirmation page',\n },\n benefit1: {\n id: 'checkout.alacarteConfirmation.benefit1',\n defaultMessage: 'Access to graded assignments and exams',\n description: 'First à la carte purchase benefit',\n },\n benefit2: {\n id: 'checkout.alacarteConfirmation.benefit2',\n defaultMessage: 'Shareable Certificate upon completion',\n description: 'Second à la carte purchase benefit',\n },\n benefit3: {\n id: 'checkout.alacarteConfirmation.benefit3',\n defaultMessage: '24/7 Global Support',\n description: 'Third à la carte purchase benefit',\n },\n orderNumber: {\n id: 'checkout.alacarteConfirmation.orderNumber',\n defaultMessage: 'Order number',\n description: 'Order number label',\n },\n purchaseDate: {\n id: 'checkout.alacarteConfirmation.purchaseDate',\n defaultMessage: 'Purchase date',\n description: 'Purchase date label',\n },\n refundNotice: {\n id: 'checkout.alacarteConfirmation.refundContact',\n defaultMessage: 'For course or program refunds, contact {email}. See our {refundPolicy} for details.',\n description: 'Refund contact line at the bottom of the confirmation page; {email} is the billing email link, {refundPolicy} the Refund Policy link',\n },\n refundPolicy: {\n id: 'checkout.alacarteConfirmation.refundPolicy',\n defaultMessage: 'Refund Policy',\n description: 'Link text for the refund policy in the refund contact line',\n },\n refundPolicyLabel: {\n id: 'checkout.alacarteConfirmation.refundPolicyLabel',\n defaultMessage: 'Refund Policy, opens in a new tab',\n description: 'Accessible label for the Refund Policy link, which opens in a new tab',\n },\n purchaseSummary: {\n id: 'checkout.alacarteConfirmation.purchaseSummary',\n defaultMessage: 'Purchase summary',\n description: 'Sidebar heading for the purchase summary card',\n },\n verifiedCertificate: {\n id: 'checkout.alacarteConfirmation.verifiedCertificate',\n defaultMessage: 'Verified certificate',\n description: 'Badge on the purchase summary product',\n },\n subtotal: {\n id: 'checkout.alacarteConfirmation.subtotal',\n defaultMessage: 'Subtotal',\n description: 'Subtotal row label',\n },\n discountsApplied: {\n id: 'checkout.alacarteConfirmation.discountsApplied',\n defaultMessage: 'Discounts applied',\n description: 'Discount row label',\n },\n amountPaid: {\n id: 'checkout.alacarteConfirmation.amountPaid',\n defaultMessage: 'Amount paid',\n description: 'Amount paid row label',\n },\n moneyAmount: {\n id: 'checkout.alacarteConfirmation.moneyAmount',\n defaultMessage: '${amount} {currency}',\n description: 'Formatted money amount e.g. $12.00 USD',\n },\n discountAmount: {\n id: 'checkout.alacarteConfirmation.discountAmount',\n defaultMessage: '-${amount} {currency}',\n description: 'Formatted discount amount e.g. -$10.00 USD',\n },\n});\n\nexport default messages;\n"]}
@@ -55,9 +55,9 @@ const CartSummary = ({ productTitle, productBlurb, learnerCount: learnerCountPro
55
55
  })
56
56
  : '';
57
57
  const pairText = (label, value) => [label, value].filter(Boolean).join(' ');
58
- return (_jsxs("div", { className: "cart-summary", children: [_jsxs("div", { className: "cart-summary__card card pgn__card pgn__card-light p-3", children: [_jsxs(Card.Section, { className: "d-flex justify-content-between align-items-center p-0 pb-3", children: [_jsx("h2", { className: "cart-summary__heading font-weight-bold text-gray-900 mb-0", children: formatMessage(messages.summaryHeading) }), _jsxs(Badge, { variant: "light", className: "d-flex align-items-center px-2 py-1", children: [_jsx(Icon, { src: Group, className: "mr-1", style: { width: '1rem', height: '1rem' } }), subscriberCount == null ? (_jsx("span", { className: "cart-summary__count-skeleton", "aria-busy": "true", "aria-label": formatMessage(messages.loadingSubscribers), "data-testid": "subscriber-count-skeleton", children: _jsx(Skeleton, { width: 96, height: 12 }) })) : (formatMessage(messages.learnersSubscribed, {
58
+ return (_jsxs("div", { className: "cart-summary", children: [_jsxs("div", { className: "cart-summary__card card pgn__card pgn__card-light p-3", children: [_jsxs(Card.Section, { className: "d-flex justify-content-between align-items-center p-0 pb-3", children: [_jsx("h2", { className: "cart-summary__heading font-weight-bold text-gray-900 mb-0", children: formatMessage(messages.summaryHeading) }), _jsxs(Badge, { variant: "light", className: "d-flex align-items-center px-2 py-1", children: [_jsx(Icon, { src: Group, className: "mr-1", style: { width: '1rem', height: '1rem' } }), subscriberCount == null ? (_jsx("span", { className: "cart-summary__count-skeleton", role: "status", "aria-busy": "true", "aria-label": formatMessage(messages.loadingSubscribers), "data-testid": "subscriber-count-skeleton", children: _jsx(Skeleton, { width: 96, height: 12 }) })) : (formatMessage(messages.learnersSubscribed, {
59
59
  count: subscriberCount.toLocaleString(),
60
- }))] })] }), _jsx(Card.Divider, {}), _jsxs(Card.Section, { className: "p-0 py-3", children: [course ? (_jsx(CourseEnrollmentCard, { course: course, variant: "summary" })) : programDetail ? (_jsx(ProgramEnrollmentCard, { program: programDetail, programName: lineName !== null && lineName !== void 0 ? lineName : '', ownedCourses: ownedCourses })) : lineName ? (_jsx("p", { className: "font-weight-bold mb-0 text-primary-500", children: lineName })) : (_jsxs("div", { className: "d-flex align-items-start", children: [_jsx(EdxUnlimitedLogo, { ariaLabel: "edX Plus" }), _jsxs("div", { children: [_jsx("p", { className: "font-weight-bold mb-0 text-primary-500", children: title }), _jsx("p", { className: "small mb-0 text-gray-900", children: blurb })] })] })), !programDetail && ownedCourseNames && (_jsx("p", { className: "cart-summary__already-yours small text-gray-700 mb-0 mt-2", "data-testid": "already-yours", children: formatMessage(messages.alreadyYours, { names: ownedCourseNames }) }))] }), _jsx(Card.Divider, {}), _jsxs(Card.Section, { className: "cart-summary__subtotal-row position-relative d-flex justify-content-between align-items-center p-0 pt-3", children: [_jsx("span", { className: "sr-overlay", children: pairText(formatMessage(messages.subtotal), subtotalText) }), _jsx("span", { className: "cart-summary__subtotal text-gray-900", "aria-hidden": "true", children: formatMessage(messages.subtotal) }), _jsx("span", { className: "cart-summary__subtotal text-gray-900", "aria-hidden": "true", children: subtotalText })] }), discount && (_jsxs(Card.Section, { className: "position-relative d-flex justify-content-between align-items-center p-0", "data-testid": "discount-row", children: [_jsx("span", { className: "sr-overlay", children: pairText(formatMessage(messages.discountApplied), discountText) }), _jsx("span", { className: "text-success font-weight-bold", "aria-hidden": "true", children: formatMessage(messages.discountApplied) }), _jsx("span", { className: "text-success font-weight-bold", "aria-hidden": "true", children: discountText })] })), _jsx(Card.Section, { className: "p-0", children: _jsxs("div", { className: "position-relative d-flex justify-content-between align-items-center", "aria-live": "polite", "aria-atomic": "true", "data-testid": "todays-total", children: [_jsx("span", { className: "sr-overlay", children: pairText(formatMessage(messages.todaysTotal), totalText) }), _jsx("span", { className: "cart-summary__total-label text-gray-900", "aria-hidden": "true", children: formatMessage(messages.todaysTotal) }), _jsx("span", { className: "cart-summary__total-value mb-0 text-gray-900", "aria-hidden": "true", children: totalText })] }) })] }), promoCode ? _jsx(PromoCode, Object.assign({}, promoCode)) : null, _jsxs("div", { className: "cart-summary__stats d-none d-lg-flex", children: [_jsxs("div", { className: "cart-summary__stat d-flex align-items-center mr-4", children: [_jsx("img", { src: learnersIcon, alt: "", width: 50, height: 50, className: "mr-2" }), _jsxs("div", { className: "position-relative", children: [_jsx("span", { className: "sr-overlay", children: formatMessage(messages.learnersStatScreenReader) }), _jsx("p", { className: "cart-summary__stat-count font-weight-bold text-gray-600 mb-0", "aria-hidden": "true", children: formatMessage(messages.learnersCount) }), _jsx("p", { className: "cart-summary__stat-label text-gray-600 mb-0", "aria-hidden": "true", children: formatMessage(messages.learnersLabel) })] })] }), _jsxs("div", { className: "cart-summary__stat d-flex align-items-center", children: [_jsx("img", { src: institutionsIcon, alt: "", width: 50, height: 50, className: "mr-2" }), _jsxs("div", { className: "position-relative", children: [_jsx("span", { className: "sr-overlay", children: formatMessage(messages.institutionsStatScreenReader) }), _jsx("p", { className: "cart-summary__stat-count font-weight-bold text-gray-600 mb-0", "aria-hidden": "true", children: formatMessage(messages.institutionsCount) }), _jsx("p", { className: "cart-summary__stat-label text-gray-600 mb-0", "aria-hidden": "true", children: formatMessage(messages.institutionsLabel) })] })] })] })] }));
60
+ }))] })] }), _jsx(Card.Divider, {}), _jsxs(Card.Section, { className: "p-0 py-3", children: [course ? (_jsx(CourseEnrollmentCard, { course: course, variant: "summary" })) : programDetail ? (_jsx(ProgramEnrollmentCard, { program: programDetail, programName: lineName !== null && lineName !== void 0 ? lineName : '', ownedCourses: ownedCourses })) : lineName ? (_jsx("p", { className: "font-weight-bold mb-0 text-primary-500", children: lineName })) : (_jsxs("div", { className: "d-flex align-items-start", children: [_jsx(EdxUnlimitedLogo, { ariaLabel: "edX Plus" }), _jsxs("div", { children: [_jsx("p", { className: "font-weight-bold mb-0 text-primary-500", children: title }), _jsx("p", { className: "small mb-0 text-gray-900", children: blurb })] })] })), !programDetail && ownedCourseNames && (_jsx("p", { className: "cart-summary__already-yours small text-gray-700 mb-0 mt-2", "data-testid": "already-yours", children: formatMessage(messages.alreadyYours, { names: ownedCourseNames }) }))] }), _jsx(Card.Divider, {}), _jsxs(Card.Section, { className: "cart-summary__subtotal-row d-flex justify-content-between align-items-center p-0 pt-3", children: [_jsx("span", { className: "sr-only", children: pairText(formatMessage(messages.subtotal), subtotalText) }), _jsx("span", { className: "cart-summary__subtotal text-gray-900", "aria-hidden": "true", children: formatMessage(messages.subtotal) }), _jsx("span", { className: "cart-summary__subtotal text-gray-900", "aria-hidden": "true", children: subtotalText })] }), discount && (_jsxs(Card.Section, { className: "d-flex justify-content-between align-items-center p-0", "data-testid": "discount-row", children: [_jsx("span", { className: "sr-only", children: pairText(formatMessage(messages.discountApplied), discountText) }), _jsx("span", { className: "text-success font-weight-bold", "aria-hidden": "true", children: formatMessage(messages.discountApplied) }), _jsx("span", { className: "text-success font-weight-bold", "aria-hidden": "true", children: discountText })] })), _jsx(Card.Section, { className: "p-0", children: _jsxs("div", { className: "d-flex justify-content-between align-items-center", "aria-live": "polite", "aria-atomic": "true", "data-testid": "todays-total", children: [_jsx("span", { className: "sr-only", children: pairText(formatMessage(messages.todaysTotal), totalText) }), _jsx("span", { className: "cart-summary__total-label text-gray-900", "aria-hidden": "true", children: formatMessage(messages.todaysTotal) }), _jsx("span", { className: "cart-summary__total-value mb-0 text-gray-900", "aria-hidden": "true", children: totalText })] }) })] }), promoCode ? _jsx(PromoCode, Object.assign({}, promoCode)) : null, _jsxs("div", { className: "cart-summary__stats d-none d-lg-flex", children: [_jsxs("div", { className: "cart-summary__stat d-flex align-items-center mr-4", children: [_jsx("img", { src: learnersIcon, alt: "", width: 50, height: 50, className: "mr-2" }), _jsxs("div", { children: [_jsx("span", { className: "sr-only", children: formatMessage(messages.learnersStatScreenReader) }), _jsx("p", { className: "cart-summary__stat-count font-weight-bold text-gray-600 mb-0", "aria-hidden": "true", children: formatMessage(messages.learnersCount) }), _jsx("p", { className: "cart-summary__stat-label text-gray-600 mb-0", "aria-hidden": "true", children: formatMessage(messages.learnersLabel) })] })] }), _jsxs("div", { className: "cart-summary__stat d-flex align-items-center", children: [_jsx("img", { src: institutionsIcon, alt: "", width: 50, height: 50, className: "mr-2" }), _jsxs("div", { children: [_jsx("span", { className: "sr-only", children: formatMessage(messages.institutionsStatScreenReader) }), _jsx("p", { className: "cart-summary__stat-count font-weight-bold text-gray-600 mb-0", "aria-hidden": "true", children: formatMessage(messages.institutionsCount) }), _jsx("p", { className: "cart-summary__stat-label text-gray-600 mb-0", "aria-hidden": "true", children: formatMessage(messages.institutionsLabel) })] })] })] })] }));
61
61
  };
62
62
  export default CartSummary;
63
63
  //# sourceMappingURL=CartSummary.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CartSummary.js","sourceRoot":"","sources":["../../../src/components/CartSummary/CartSummary.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,oBAAoB,MAAM,8CAA8C,CAAC;AAChF,OAAO,qBAAqB,MAAM,gDAAgD,CAAC;AACnF,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAI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EAAC,YAAY,YAAE,aAAa,CAAC,QAAQ,CAAC,wBAAwB,CAAC,GAAQ,EACtF,YAAG,SAAS,EAAC,8DAA8D,iBAAa,MAAM,YAC3F,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,GACpC,EACJ,YAAG,SAAS,EAAC,6CAA6C,iBAAa,MAAM,YAC1E,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,GACpC,IACA,IACF,EACN,eAAK,SAAS,EAAC,8CAA8C,aAC3D,cAAK,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAC,EAAE,EAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAC,MAAM,GAAG,EAC7E,eAAK,SAAS,EAAC,mBAAmB,aAChC,eAAM,SAAS,EAAC,YAAY,YAAE,aAAa,CAAC,QAAQ,CAAC,4BAA4B,CAAC,GAAQ,EAC1F,YAAG,SAAS,EAAC,8DAA8D,iBAAa,MAAM,YAC3F,aAAa,CAAC,QAAQ,CAAC,iBAAiB,CAAC,GACxC,EACJ,YAAG,SAAS,EAAC,6CAA6C,iBAAa,MAAM,YAC1E,aAAa,CAAC,QAAQ,CAAC,iBAAiB,CAAC,GACxC,IACA,IACF,IACF,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import React from 'react';\nimport { Badge, Card, Icon, Skeleton } from '@openedx/paragon';\nimport { Group } from '@openedx/paragon/icons';\nimport { useIntl } from '@openedx/frontend-base';\nimport { EdxUnlimitedLogo } from '../BrandMarks/BrandMarks';\nimport CourseEnrollmentCard from '../CourseEnrollmentCard/CourseEnrollmentCard';\nimport ProgramEnrollmentCard from '../ProgramEnrollmentCard/ProgramEnrollmentCard';\nimport PromoCode from '../PromoCode/PromoCode';\nimport type { PromoCodeProps } from '../PromoCode/PromoCode';\nimport type { CourseDetail } from '../../types';\nimport type { AlacarteLine, ProgramDetail } from '../../types/alacarte';\nimport messages from './Messages';\nimport learnersIcon from './world-icon.svg';\nimport institutionsIcon from './student-icon.svg';\n\nexport type BillingCycle = 'monthly' | 'annual';\n\nexport interface CartSummaryProps {\n productTitle?: string,\n productBlurb?: string,\n /** Promotional monthly price amount e.g. \"39\" */\n monthlyAmount?: string,\n /** Regular monthly price after the promo period e.g. \"59\" */\n monthlyRegularAmount?: string,\n /** Length of the promotional period in months */\n promoMonths?: number,\n /** Annual price amount e.g. \"299\" */\n annualAmount?: string,\n currency?: string,\n defaultCycle?: BillingCycle,\n monthlyRenewalLabel?: string,\n annualRenewalLabel?: string,\n /** Called when the learner switches monthly ↔ annual. */\n onCycleChange?: (cycle: BillingCycle) => void,\n learnerCount?: number,\n /** When set, shows the course enrollment preview card below the summary card. */\n course?: CourseDetail | null,\n /** À la carte checkout line — when present, drives the subtotal/total and\n * the product name shown, in place of the generic edX Plus placeholder. */\n alacarteLine?: AlacarteLine | null,\n /** Program catalog detail (filterTwouProgram) — when present, drives the\n * \"Courses included in this program\" list. */\n programDetail?: ProgramDetail | null,\n /** Fallback program name — used when there is no alacarteLine to provide it\n * (e.g. already-owned overlay). */\n programName?: string | null,\n /** Coupon input — when set, wires PromoCode to tCheckoutUpdate. */\n promoCode?: PromoCodeProps | null,\n}\n\nconst CartSummary = ({\n productTitle,\n productBlurb,\n learnerCount: learnerCountProp,\n course = null,\n alacarteLine = null,\n programDetail = null,\n programName: programNameProp = null,\n promoCode = null,\n}: CartSummaryProps) => {\n const { formatMessage } = useIntl();\n const title = productTitle ?? formatMessage(messages.productTitle);\n const blurb = productBlurb ?? formatMessage(messages.productBlurb);\n\n // Prefer the product's own enrollment count (course or program catalog field).\n const isProgramLine = alacarteLine?.kind === 'program';\n const subscriberCount = course?.tEnrollmentCount\n ?? programDetail?.tEnrollmentCount\n ?? learnerCountProp\n ?? null;\n\n // No fallback amount — an unresolved à la carte line means we don't know\n // the price yet, so the row is left blank rather than showing a made-up\n // number that could be mistaken for the real one.\n // Program subtotal is price less owned-course deduction (before coupon/discount).\n const deductionAmount = isProgramLine && alacarteLine.kind === 'program'\n ? (alacarteLine.deduction?.amount ?? 0)\n : 0;\n const subtotalAmount = alacarteLine?.price\n ? Math.max(0, alacarteLine.price.amount - deductionAmount)\n : null;\n const subtotalText = subtotalAmount != null && alacarteLine?.price\n ? formatMessage(messages.subtotalAmount, {\n amount: subtotalAmount.toFixed(2), currency: alacarteLine.price.currency,\n })\n : '';\n const totalText = alacarteLine?.amountDue\n ? formatMessage(messages.todaysTotalValue, {\n amount: alacarteLine.amountDue.amount.toFixed(2), currency: alacarteLine.amountDue.currency,\n })\n : '';\n\n const lineName = alacarteLine\n ? (alacarteLine.kind === 'course' ? alacarteLine.courseName : alacarteLine.programName)\n : programNameProp;\n\n const ownedCourses = isProgramLine && alacarteLine.kind === 'program'\n ? (alacarteLine.ownedCourses ?? [])\n : [];\n const ownedCourseNames = ownedCourses\n .map((c) => c.name)\n .filter(Boolean)\n .join(', ');\n const discount = alacarteLine?.discount ?? null;\n const discountText = discount\n ? formatMessage(messages.discountAmount, {\n amount: discount.amount.toFixed(2),\n currency: discount.currency,\n })\n : '';\n\n const pairText = (label: string, value: string) => [label, value].filter(Boolean).join(' ');\n\n return (\n <div className=\"cart-summary\">\n {/* Paragon's Card always sets tabIndex=-1, which makes VoiceOver treat the\n whole summary as a single focusable group. Same markup, no tabindex. */}\n <div className=\"cart-summary__card card pgn__card pgn__card-light p-3\">\n <Card.Section className=\"d-flex justify-content-between align-items-center p-0 pb-3\">\n <h2 className=\"cart-summary__heading font-weight-bold text-gray-900 mb-0\">\n {formatMessage(messages.summaryHeading)}\n </h2>\n <Badge\n variant=\"light\"\n className=\"d-flex align-items-center px-2 py-1\"\n >\n <Icon\n src={Group}\n className=\"mr-1\"\n style={{ width: '1rem', height: '1rem' }}\n />\n {subscriberCount == null ? (\n <span\n className=\"cart-summary__count-skeleton\"\n aria-busy=\"true\"\n aria-label={formatMessage(messages.loadingSubscribers)}\n data-testid=\"subscriber-count-skeleton\"\n >\n <Skeleton width={96} height={12} />\n </span>\n ) : (\n formatMessage(messages.learnersSubscribed, {\n count: subscriberCount.toLocaleString(),\n })\n )}\n </Badge>\n </Card.Section>\n\n <Card.Divider />\n\n <Card.Section className=\"p-0 py-3\">\n {course ? (\n <CourseEnrollmentCard course={course} variant=\"summary\" />\n ) : programDetail ? (\n <ProgramEnrollmentCard\n program={programDetail}\n programName={lineName ?? ''}\n ownedCourses={ownedCourses}\n />\n ) : lineName ? (\n <p className=\"font-weight-bold mb-0 text-primary-500\">{lineName}</p>\n ) : (\n <div className=\"d-flex align-items-start\">\n <EdxUnlimitedLogo ariaLabel=\"edX Plus\" />\n <div>\n <p className=\"font-weight-bold mb-0 text-primary-500\">{title}</p>\n <p className=\"small mb-0 text-gray-900\">{blurb}</p>\n </div>\n </div>\n )}\n {/* Fallback when catalog detail hasn't loaded yet — once it has,\n owned courses are listed under \"Previously purchased\" in the card. */}\n {!programDetail && ownedCourseNames && (\n <p\n className=\"cart-summary__already-yours small text-gray-700 mb-0 mt-2\"\n data-testid=\"already-yours\"\n >\n {formatMessage(messages.alreadyYours, { names: ownedCourseNames })}\n </p>\n )}\n </Card.Section>\n\n <Card.Divider />\n\n {/* VoiceOver reads each flex child as its own item, so every row exposes\n its label and value as one overlay string and hides the visual spans. */}\n <Card.Section className=\"cart-summary__subtotal-row position-relative d-flex justify-content-between align-items-center p-0 pt-3\">\n <span className=\"sr-overlay\">{pairText(formatMessage(messages.subtotal), subtotalText)}</span>\n <span className=\"cart-summary__subtotal text-gray-900\" aria-hidden=\"true\">\n {formatMessage(messages.subtotal)}\n </span>\n <span className=\"cart-summary__subtotal text-gray-900\" aria-hidden=\"true\">\n {subtotalText}\n </span>\n </Card.Section>\n\n {discount && (\n <Card.Section\n className=\"position-relative d-flex justify-content-between align-items-center p-0\"\n data-testid=\"discount-row\"\n >\n <span className=\"sr-overlay\">{pairText(formatMessage(messages.discountApplied), discountText)}</span>\n <span className=\"text-success font-weight-bold\" aria-hidden=\"true\">\n {formatMessage(messages.discountApplied)}\n </span>\n <span className=\"text-success font-weight-bold\" aria-hidden=\"true\">\n {discountText}\n </span>\n </Card.Section>\n )}\n\n <Card.Section className=\"p-0\">\n {/* Announces the new total when a coupon is applied or removed. */}\n <div\n className=\"position-relative d-flex justify-content-between align-items-center\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n data-testid=\"todays-total\"\n >\n <span className=\"sr-overlay\">{pairText(formatMessage(messages.todaysTotal), totalText)}</span>\n <span className=\"cart-summary__total-label text-gray-900\" aria-hidden=\"true\">\n {formatMessage(messages.todaysTotal)}\n </span>\n <span className=\"cart-summary__total-value mb-0 text-gray-900\" aria-hidden=\"true\">\n {totalText}\n </span>\n </div>\n </Card.Section>\n </div>\n\n {promoCode ? <PromoCode {...promoCode} /> : null}\n\n {/* Stats row. Each stat is read as one phrase (\"100 million learners\"):\n \"100M\" alone is read as \"100 meters\". */}\n <div className=\"cart-summary__stats d-none d-lg-flex\">\n <div className=\"cart-summary__stat d-flex align-items-center mr-4\">\n <img src={learnersIcon} alt=\"\" width={50} height={50} className=\"mr-2\" />\n <div className=\"position-relative\">\n <span className=\"sr-overlay\">{formatMessage(messages.learnersStatScreenReader)}</span>\n <p className=\"cart-summary__stat-count font-weight-bold text-gray-600 mb-0\" aria-hidden=\"true\">\n {formatMessage(messages.learnersCount)}\n </p>\n <p className=\"cart-summary__stat-label text-gray-600 mb-0\" aria-hidden=\"true\">\n {formatMessage(messages.learnersLabel)}\n </p>\n </div>\n </div>\n <div className=\"cart-summary__stat d-flex align-items-center\">\n <img src={institutionsIcon} alt=\"\" width={50} height={50} className=\"mr-2\" />\n <div className=\"position-relative\">\n <span className=\"sr-overlay\">{formatMessage(messages.institutionsStatScreenReader)}</span>\n <p className=\"cart-summary__stat-count font-weight-bold text-gray-600 mb-0\" aria-hidden=\"true\">\n {formatMessage(messages.institutionsCount)}\n </p>\n <p className=\"cart-summary__stat-label text-gray-600 mb-0\" aria-hidden=\"true\">\n {formatMessage(messages.institutionsLabel)}\n </p>\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nexport default CartSummary;\n"]}
1
+ {"version":3,"file":"CartSummary.js","sourceRoot":"","sources":["../../../src/components/CartSummary/CartSummary.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,oBAAoB,MAAM,8CAA8C,CAAC;AAChF,OAAO,qBAAqB,MAAM,gDAAgD,CAAC;AACnF,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAI/C,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAqClD,MAAM,WAAW,GAAG,CAAC,EACnB,YAAY,EACZ,YAAY,EACZ,YAAY,EAAE,gBAAgB,EAC9B,MAAM,GAAG,IAAI,EACb,YAAY,GAAG,IAAI,EACnB,aAAa,GAAG,IAAI,EACpB,WAAW,EAAE,eAAe,GAAG,IAAI,EACnC,SAAS,GAAG,IAAI,GACC,EAAE,EAAE;;IACrB,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpC,MAAM,KAAK,GAAG,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,aAAa,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IACnE,MAAM,KAAK,GAAG,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,aAAa,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IAEnE,+EAA+E;IAC/E,MAAM,aAAa,GAAG,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI,MAAK,SAAS,CA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A,IACF,IACF,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import React from 'react';\nimport { Badge, Card, Icon, Skeleton } from '@openedx/paragon';\nimport { Group } from '@openedx/paragon/icons';\nimport { useIntl } from '@openedx/frontend-base';\nimport { EdxUnlimitedLogo } from '../BrandMarks/BrandMarks';\nimport CourseEnrollmentCard from '../CourseEnrollmentCard/CourseEnrollmentCard';\nimport ProgramEnrollmentCard from '../ProgramEnrollmentCard/ProgramEnrollmentCard';\nimport PromoCode from '../PromoCode/PromoCode';\nimport type { PromoCodeProps } from '../PromoCode/PromoCode';\nimport type { CourseDetail } from '../../types';\nimport type { AlacarteLine, ProgramDetail } from '../../types/alacarte';\nimport messages from './Messages';\nimport learnersIcon from './world-icon.svg';\nimport institutionsIcon from './student-icon.svg';\n\nexport type BillingCycle = 'monthly' | 'annual';\n\nexport interface CartSummaryProps {\n productTitle?: string,\n productBlurb?: string,\n /** Promotional monthly price amount e.g. \"39\" */\n monthlyAmount?: string,\n /** Regular monthly price after the promo period e.g. \"59\" */\n monthlyRegularAmount?: string,\n /** Length of the promotional period in months */\n promoMonths?: number,\n /** Annual price amount e.g. \"299\" */\n annualAmount?: string,\n currency?: string,\n defaultCycle?: BillingCycle,\n monthlyRenewalLabel?: string,\n annualRenewalLabel?: string,\n /** Called when the learner switches monthly ↔ annual. */\n onCycleChange?: (cycle: BillingCycle) => void,\n learnerCount?: number,\n /** When set, shows the course enrollment preview card below the summary card. */\n course?: CourseDetail | null,\n /** À la carte checkout line — when present, drives the subtotal/total and\n * the product name shown, in place of the generic edX Plus placeholder. */\n alacarteLine?: AlacarteLine | null,\n /** Program catalog detail (filterTwouProgram) — when present, drives the\n * \"Courses included in this program\" list. */\n programDetail?: ProgramDetail | null,\n /** Fallback program name — used when there is no alacarteLine to provide it\n * (e.g. already-owned overlay). */\n programName?: string | null,\n /** Coupon input — when set, wires PromoCode to tCheckoutUpdate. */\n promoCode?: PromoCodeProps | null,\n}\n\nconst CartSummary = ({\n productTitle,\n productBlurb,\n learnerCount: learnerCountProp,\n course = null,\n alacarteLine = null,\n programDetail = null,\n programName: programNameProp = null,\n promoCode = null,\n}: CartSummaryProps) => {\n const { formatMessage } = useIntl();\n const title = productTitle ?? formatMessage(messages.productTitle);\n const blurb = productBlurb ?? formatMessage(messages.productBlurb);\n\n // Prefer the product's own enrollment count (course or program catalog field).\n const isProgramLine = alacarteLine?.kind === 'program';\n const subscriberCount = course?.tEnrollmentCount\n ?? programDetail?.tEnrollmentCount\n ?? learnerCountProp\n ?? null;\n\n // No fallback amount — an unresolved à la carte line means we don't know\n // the price yet, so the row is left blank rather than showing a made-up\n // number that could be mistaken for the real one.\n // Program subtotal is price less owned-course deduction (before coupon/discount).\n const deductionAmount = isProgramLine && alacarteLine.kind === 'program'\n ? (alacarteLine.deduction?.amount ?? 0)\n : 0;\n const subtotalAmount = alacarteLine?.price\n ? Math.max(0, alacarteLine.price.amount - deductionAmount)\n : null;\n const subtotalText = subtotalAmount != null && alacarteLine?.price\n ? formatMessage(messages.subtotalAmount, {\n amount: subtotalAmount.toFixed(2), currency: alacarteLine.price.currency,\n })\n : '';\n const totalText = alacarteLine?.amountDue\n ? formatMessage(messages.todaysTotalValue, {\n amount: alacarteLine.amountDue.amount.toFixed(2), currency: alacarteLine.amountDue.currency,\n })\n : '';\n\n const lineName = alacarteLine\n ? (alacarteLine.kind === 'course' ? alacarteLine.courseName : alacarteLine.programName)\n : programNameProp;\n\n const ownedCourses = isProgramLine && alacarteLine.kind === 'program'\n ? (alacarteLine.ownedCourses ?? [])\n : [];\n const ownedCourseNames = ownedCourses\n .map((c) => c.name)\n .filter(Boolean)\n .join(', ');\n const discount = alacarteLine?.discount ?? null;\n const discountText = discount\n ? formatMessage(messages.discountAmount, {\n amount: discount.amount.toFixed(2),\n currency: discount.currency,\n })\n : '';\n\n const pairText = (label: string, value: string) => [label, value].filter(Boolean).join(' ');\n\n return (\n <div className=\"cart-summary\">\n {/* Paragon's Card always sets tabIndex=-1, which makes VoiceOver treat the\n whole summary as a single focusable group. Same markup, no tabindex. */}\n <div className=\"cart-summary__card card pgn__card pgn__card-light p-3\">\n <Card.Section className=\"d-flex justify-content-between align-items-center p-0 pb-3\">\n <h2 className=\"cart-summary__heading font-weight-bold text-gray-900 mb-0\">\n {formatMessage(messages.summaryHeading)}\n </h2>\n <Badge\n variant=\"light\"\n className=\"d-flex align-items-center px-2 py-1\"\n >\n <Icon\n src={Group}\n className=\"mr-1\"\n style={{ width: '1rem', height: '1rem' }}\n />\n {subscriberCount == null ? (\n <span\n className=\"cart-summary__count-skeleton\"\n role=\"status\"\n aria-busy=\"true\"\n aria-label={formatMessage(messages.loadingSubscribers)}\n data-testid=\"subscriber-count-skeleton\"\n >\n <Skeleton width={96} height={12} />\n </span>\n ) : (\n formatMessage(messages.learnersSubscribed, {\n count: subscriberCount.toLocaleString(),\n })\n )}\n </Badge>\n </Card.Section>\n\n <Card.Divider />\n\n <Card.Section className=\"p-0 py-3\">\n {course ? (\n <CourseEnrollmentCard course={course} variant=\"summary\" />\n ) : programDetail ? (\n <ProgramEnrollmentCard\n program={programDetail}\n programName={lineName ?? ''}\n ownedCourses={ownedCourses}\n />\n ) : lineName ? (\n <p className=\"font-weight-bold mb-0 text-primary-500\">{lineName}</p>\n ) : (\n <div className=\"d-flex align-items-start\">\n <EdxUnlimitedLogo ariaLabel=\"edX Plus\" />\n <div>\n <p className=\"font-weight-bold mb-0 text-primary-500\">{title}</p>\n <p className=\"small mb-0 text-gray-900\">{blurb}</p>\n </div>\n </div>\n )}\n {/* Fallback when catalog detail hasn't loaded yet — once it has,\n owned courses are listed under \"Previously purchased\" in the card. */}\n {!programDetail && ownedCourseNames && (\n <p\n className=\"cart-summary__already-yours small text-gray-700 mb-0 mt-2\"\n data-testid=\"already-yours\"\n >\n {formatMessage(messages.alreadyYours, { names: ownedCourseNames })}\n </p>\n )}\n </Card.Section>\n\n <Card.Divider />\n\n {/* VoiceOver reads each flex child as its own item, so every row exposes\n its label and value as one sr-only string and hides the visual spans. */}\n <Card.Section className=\"cart-summary__subtotal-row d-flex justify-content-between align-items-center p-0 pt-3\">\n <span className=\"sr-only\">{pairText(formatMessage(messages.subtotal), subtotalText)}</span>\n <span className=\"cart-summary__subtotal text-gray-900\" aria-hidden=\"true\">\n {formatMessage(messages.subtotal)}\n </span>\n <span className=\"cart-summary__subtotal text-gray-900\" aria-hidden=\"true\">\n {subtotalText}\n </span>\n </Card.Section>\n\n {discount && (\n <Card.Section\n className=\"d-flex justify-content-between align-items-center p-0\"\n data-testid=\"discount-row\"\n >\n <span className=\"sr-only\">{pairText(formatMessage(messages.discountApplied), discountText)}</span>\n <span className=\"text-success font-weight-bold\" aria-hidden=\"true\">\n {formatMessage(messages.discountApplied)}\n </span>\n <span className=\"text-success font-weight-bold\" aria-hidden=\"true\">\n {discountText}\n </span>\n </Card.Section>\n )}\n\n <Card.Section className=\"p-0\">\n {/* Announces the new total when a coupon is applied or removed. */}\n <div\n className=\"d-flex justify-content-between align-items-center\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n data-testid=\"todays-total\"\n >\n <span className=\"sr-only\">{pairText(formatMessage(messages.todaysTotal), totalText)}</span>\n <span className=\"cart-summary__total-label text-gray-900\" aria-hidden=\"true\">\n {formatMessage(messages.todaysTotal)}\n </span>\n <span className=\"cart-summary__total-value mb-0 text-gray-900\" aria-hidden=\"true\">\n {totalText}\n </span>\n </div>\n </Card.Section>\n </div>\n\n {promoCode ? <PromoCode {...promoCode} /> : null}\n\n {/* Stats row. Each stat is read as one phrase (\"100 million learners\"):\n \"100M\" alone is read as \"100 meters\". */}\n <div className=\"cart-summary__stats d-none d-lg-flex\">\n <div className=\"cart-summary__stat d-flex align-items-center mr-4\">\n <img src={learnersIcon} alt=\"\" width={50} height={50} className=\"mr-2\" />\n <div>\n <span className=\"sr-only\">{formatMessage(messages.learnersStatScreenReader)}</span>\n <p className=\"cart-summary__stat-count font-weight-bold text-gray-600 mb-0\" aria-hidden=\"true\">\n {formatMessage(messages.learnersCount)}\n </p>\n <p className=\"cart-summary__stat-label text-gray-600 mb-0\" aria-hidden=\"true\">\n {formatMessage(messages.learnersLabel)}\n </p>\n </div>\n </div>\n <div className=\"cart-summary__stat d-flex align-items-center\">\n <img src={institutionsIcon} alt=\"\" width={50} height={50} className=\"mr-2\" />\n <div>\n <span className=\"sr-only\">{formatMessage(messages.institutionsStatScreenReader)}</span>\n <p className=\"cart-summary__stat-count font-weight-bold text-gray-600 mb-0\" aria-hidden=\"true\">\n {formatMessage(messages.institutionsCount)}\n </p>\n <p className=\"cart-summary__stat-label text-gray-600 mb-0\" aria-hidden=\"true\">\n {formatMessage(messages.institutionsLabel)}\n </p>\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nexport default CartSummary;\n"]}
@@ -272,9 +272,13 @@ const Checkout = (_a) => {
272
272
  const handleSeeMyCourses = () => {
273
273
  window.location.href = learnerDashboardUrl || homeUrl || '/';
274
274
  };
275
- const { paymentTimedOut } = alacarte;
276
- // Grey out and block the form + summary; only the alerts above stay usable.
277
- const isLocked = isAlreadyOwned || paymentTimedOut;
275
+ const handleReturnToHomepage = () => {
276
+ window.location.href = homeUrl || '/';
277
+ };
278
+ const { paymentTimedOut, checkoutPaused } = alacarte;
279
+ // Grey out and block the form + summary. The header (h1 + alerts) sits
280
+ // outside the overlay so its text keeps full contrast.
281
+ const isLocked = isAlreadyOwned || paymentTimedOut || checkoutPaused;
278
282
  // The overlay only blocks the pointer — inert takes the locked content out
279
283
  // of the tab order too.
280
284
  const lockedInertRef = useInert(isLocked);
@@ -344,7 +348,7 @@ const Checkout = (_a) => {
344
348
  // Price differs from what the learner viewed before checkout (ALC-159).
345
349
  const showPriceChangedAlert = !!alacarte.priceChanged && !dismissedPriceChange && !isLocked;
346
350
  const priceChangedKind = isProgramProduct ? 'program' : 'course';
347
- return (_jsxs(_Fragment, { children: [alacarteDebug, _jsxs(Row, { className: "checkout__container bg-light-200", children: [alacarte.sanctionsBlocked && (_jsx(OrderBlockedModal, { isOpen: true, referenceCode: alacarte.sanctionsBlocked.referenceCode, homeUrl: homeUrl })), alacarte.purchaseBlocked && (_jsx(PurchaseBlockedModal, { isOpen: true, homeUrl: homeUrl })), _jsx(Col, { xs: 12, className: isLocked ? 'checkout__locked-overlay' : '', children: _jsxs(Row, { className: "checkout__layout", children: [_jsx(Col, { xs: 12, className: "checkout__header", children: _jsxs("div", { children: [_jsx("h1", { className: "font-weight-bold text-primary-900 mb-lg-4", children: "Checkout" }), paymentTimedOut && (_jsx(PaymentTimeoutAlert, { className: "checkout__overlay-alert mb-3" })), isAlreadyOwned && (_jsxs(Alert, { variant: "danger", icon: ErrorIcon, className: "checkout__overlay-alert mb-3", "data-testid": "already-owned-alert", children: [_jsx("p", { className: "mb-3", children: alreadyOwnedMessage }), _jsxs("div", { className: "d-flex align-items-center justify-content-end gap-3 flex-wrap", children: [orderHistoryUrl && (_jsx("a", { href: orderHistoryUrl, className: "checkout__order-history text-gray-900 font-weight-bold", children: formatMessage(messages.viewOrderHistory) })), isAlreadyOwnedProgram ? (_jsx(Button, { variant: "brand", className: "rounded-pill", onClick: handleSeeMyCourses, children: formatMessage(messages.seeMyCourses) })) : (_jsx(Button, { variant: "brand", className: "rounded-pill", onClick: handleStartCourse, children: formatMessage(messages.goToCourse) }))] })] })), c.error && (_jsx(Alert, { variant: "danger", icon: ErrorIcon, dismissible: true, onClose: c.clearError, children: c.error })), alacarte.placeOrderError && (_jsx(Alert, { variant: "danger", icon: ErrorIcon, dismissible: true, onClose: alacarte.clearPlaceOrderError, className: "mb-3", children: alacarte.placeOrderError })), ((_w = alacarte.paymentDecline) === null || _w === void 0 ? void 0 : _w.message) && !alacarte.placeOrderError && !paymentTimedOut && (_jsx(Alert, { variant: "danger", icon: ErrorIcon, className: "mb-3", "data-testid": "payment-decline-alert", children: getLearnerFacingStripeMessage({
351
+ return (_jsxs(_Fragment, { children: [alacarteDebug, _jsxs(Row, { className: "checkout__container bg-light-200", children: [alacarte.sanctionsBlocked && (_jsx(OrderBlockedModal, { isOpen: true, referenceCode: alacarte.sanctionsBlocked.referenceCode, homeUrl: homeUrl })), alacarte.purchaseBlocked && (_jsx(PurchaseBlockedModal, { isOpen: true, homeUrl: homeUrl })), _jsx(Col, { xs: 12, children: _jsxs(Row, { className: "checkout__layout", children: [_jsx(Col, { xs: 12, className: "checkout__header", children: _jsxs("div", { children: [_jsx("h1", { className: "font-weight-bold text-primary-900 mb-lg-4", children: "Checkout" }), paymentTimedOut && (_jsx(PaymentTimeoutAlert, { className: "checkout__overlay-alert mb-3" })), checkoutPaused && (_jsxs(Alert, { variant: "danger", icon: ErrorIcon, className: "checkout__overlay-alert mb-3", "data-testid": "checkout-paused-alert", children: [_jsx("p", { className: "mb-3", children: formatMessage(messages.checkoutPaused) }), _jsx("div", { className: "d-flex align-items-center justify-content-end", children: _jsx(Button, { variant: "brand", className: "rounded-pill", onClick: handleReturnToHomepage, children: formatMessage(messages.returnToHomepage) }) })] })), isAlreadyOwned && !checkoutPaused && (_jsxs(Alert, { variant: "danger", icon: ErrorIcon, className: "checkout__overlay-alert mb-3", "data-testid": "already-owned-alert", children: [_jsx("p", { className: "mb-3", children: alreadyOwnedMessage }), _jsxs("div", { className: "d-flex align-items-center justify-content-end gap-3 flex-wrap", children: [orderHistoryUrl && (_jsx("a", { href: orderHistoryUrl, className: "checkout__order-history text-gray-900 font-weight-bold", children: formatMessage(messages.viewOrderHistory) })), isAlreadyOwnedProgram ? (_jsx(Button, { variant: "brand", className: "rounded-pill", onClick: handleSeeMyCourses, children: formatMessage(messages.seeMyCourses) })) : (_jsx(Button, { variant: "brand", className: "rounded-pill", onClick: handleStartCourse, children: formatMessage(messages.goToCourse) }))] })] })), c.error && (_jsx(Alert, { variant: "danger", icon: ErrorIcon, dismissible: true, onClose: c.clearError, children: c.error })), alacarte.placeOrderError && (_jsx(Alert, { variant: "danger", icon: ErrorIcon, dismissible: true, onClose: alacarte.clearPlaceOrderError, className: "mb-3", children: alacarte.placeOrderError })), ((_w = alacarte.paymentDecline) === null || _w === void 0 ? void 0 : _w.message) && !alacarte.placeOrderError && !paymentTimedOut && (_jsx(Alert, { variant: "danger", icon: ErrorIcon, className: "mb-3", "data-testid": "payment-decline-alert", children: getLearnerFacingStripeMessage({
348
352
  message: alacarte.paymentDecline.message,
349
353
  code: (_x = alacarte.paymentDecline.code) !== null && _x !== void 0 ? _x : undefined,
350
354
  }) })), alacarte.paymentInterrupted && !alacarte.paymentDecline && !alacarte.placeOrderError && !paymentTimedOut && (_jsx(Alert, { variant: "danger", icon: ErrorIcon, dismissible: true, onClose: alacarte.clearPaymentInterrupted, className: "mb-3", "data-testid": "payment-interrupted-alert", children: formatMessage(messages.paymentInterruptedAlert) })), alacarte.walletPaymentCancelled && !alacarte.paymentInterrupted
@@ -374,7 +378,7 @@ const Checkout = (_a) => {
374
378
  alacarte.clearRemovedCouponCode();
375
379
  setFocusCouponAlert(false);
376
380
  }, className: "coupon-removed-alert", "data-testid": "coupon-removed-alert", role: "status", focusOnMount: focusCouponAlert, returnFocus: focusCouponControl, children: codeIndex === -1 ? removedText : (_jsxs(_Fragment, { children: [removedText.slice(0, codeIndex), _jsx("strong", { children: removedCode }), removedText.slice(codeIndex + removedCode.length)] })) }, removedCode));
377
- })()] }))] }) }), _jsx(Col, { xs: 12, className: "payment__summary", children: _jsx("div", { ref: lockedInertRef, "data-testid": "checkout-summary-region", children: c.phase === 'success' ? (_jsx(EnrollmentSummary, { course: c.course, onStartCourse: handleStartCourse })) : (_jsx(CartSummary, { defaultCycle: selectedCycle, onCycleChange: c.processingSubscription ? undefined : c.setCycle, course: courseForSummary, alacarteLine: alacarte.line, programDetail: alacarteProgramDetail, programName: alacarte.ownedProductName, promoCode: isAlacarteReady ? {
381
+ })()] }))] }) }), _jsx(Col, { xs: 12, className: "payment__summary", children: _jsx("div", { ref: lockedInertRef, className: isLocked ? 'checkout__locked-overlay' : undefined, "data-testid": "checkout-summary-region", children: c.phase === 'success' ? (_jsx(EnrollmentSummary, { course: c.course, onStartCourse: handleStartCourse })) : (_jsx(CartSummary, { defaultCycle: selectedCycle, onCycleChange: c.processingSubscription ? undefined : c.setCycle, course: courseForSummary, alacarteLine: alacarte.line, programDetail: alacarteProgramDetail, programName: alacarte.ownedProductName, promoCode: isAlacarteReady ? {
378
382
  value: promoCodeValue,
379
383
  // Keep a coupon error up while the learner edits the code;
380
384
  // applyCoupon clears it on the next Apply.
@@ -396,7 +400,7 @@ const Checkout = (_a) => {
396
400
  error: alacarte.couponError,
397
401
  isApplying: alacarte.couponApplying,
398
402
  disabled: alacarte.placingOrder,
399
- } : null })) }) }), _jsx(Col, { xs: 12, className: "payment__options", children: _jsxs("div", { ref: lockedInertRef, "data-testid": "checkout-payment-region", children: [showForm && zeroAmountDue && (_jsx(ZeroCostForm, { amountDue: zeroAmountDue, submitting: alacarte.placingOrder || alacarte.awaitingPlacedOrder, onBuyNow: handleZeroCostBuyNow })), showForm && !zeroAmountDue && (_jsx(PaymentForm, { billing: c.billing, setField: c.setField, numberMountRef: c.numberMountRef, expiryMountRef: c.expiryMountRef, cvcMountRef: c.cvcMountRef, cardError: c.cardError, cardFieldStates: c.cardFieldStates, stripeReady: c.stripeReady, sessionReady: c.sessionReady, submitting: isAlacarteReady
403
+ } : null })) }) }), _jsx(Col, { xs: 12, className: "payment__options", children: _jsxs("div", { ref: lockedInertRef, className: isLocked ? 'checkout__locked-overlay' : undefined, "data-testid": "checkout-payment-region", children: [showForm && zeroAmountDue && (_jsx(ZeroCostForm, { amountDue: zeroAmountDue, submitting: alacarte.placingOrder || alacarte.awaitingPlacedOrder, onBuyNow: handleZeroCostBuyNow })), showForm && !zeroAmountDue && (_jsx(PaymentForm, { billing: c.billing, setField: c.setField, numberMountRef: c.numberMountRef, expiryMountRef: c.expiryMountRef, cvcMountRef: c.cvcMountRef, cardError: c.cardError, cardFieldStates: c.cardFieldStates, stripeReady: c.stripeReady, sessionReady: c.sessionReady, submitting: isAlacarteReady
400
404
  ? (alacarte.placingOrder || alacarte.awaitingPlacedOrder)
401
405
  : c.processingSubscription, onPlaceOrder: isAlacarteReady
402
406
  ? () => {