@reblu/site-blocks 0.30.0 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -0
- package/README.md +236 -5
- package/dist/client.cjs +632 -0
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +105 -3
- package/dist/client.d.ts +105 -3
- package/dist/client.js +629 -0
- package/dist/client.js.map +1 -1
- package/dist/full-invoice-fields-DMX0sjPG.d.cts +140 -0
- package/dist/full-invoice-fields-DMX0sjPG.d.ts +140 -0
- package/dist/index.cjs +956 -349
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +223 -130
- package/dist/index.d.ts +223 -130
- package/dist/index.js +943 -350
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/dist/_heading-BsNbc1wc.d.cts +0 -4
- package/dist/_heading-BsNbc1wc.d.ts +0 -4
package/dist/index.cjs
CHANGED
|
@@ -23,6 +23,9 @@ __export(src_exports, {
|
|
|
23
23
|
ALLOWED_YOUTUBE_HOSTS: () => ALLOWED_YOUTUBE_HOSTS,
|
|
24
24
|
AddedToCartToast: () => AddedToCartToast,
|
|
25
25
|
ArbitrationBadge: () => ArbitrationBadge,
|
|
26
|
+
BeforeAfterPairs: () => BeforeAfterPairs,
|
|
27
|
+
CARD_ICON_NAMES: () => CARD_ICON_NAMES,
|
|
28
|
+
CardIconSvg: () => CardIconSvg,
|
|
26
29
|
CartAdjustmentsNotice: () => CartAdjustmentsNotice,
|
|
27
30
|
CartLineIncludes: () => CartLineIncludes,
|
|
28
31
|
CartLineList: () => CartLineList,
|
|
@@ -31,14 +34,18 @@ __export(src_exports, {
|
|
|
31
34
|
CheckoutForm: () => CheckoutForm,
|
|
32
35
|
CheckoutLoginPrompt: () => CheckoutLoginPrompt,
|
|
33
36
|
CheckoutPayAction: () => CheckoutPayAction,
|
|
37
|
+
CheckoutQuoteNotice: () => CheckoutQuoteNotice,
|
|
34
38
|
CheckoutQuoteSummary: () => CheckoutQuoteSummary,
|
|
35
39
|
CheckoutTermsAcceptance: () => CheckoutTermsAcceptance,
|
|
40
|
+
ChipList: () => ChipList,
|
|
36
41
|
ContactInterestField: () => ContactInterestField,
|
|
37
42
|
CourseCatalogFilters: () => CourseCatalogFilters,
|
|
38
43
|
CourseDescription: () => CourseDescription,
|
|
39
44
|
CoursePurchaseTerms: () => CoursePurchaseTerms,
|
|
40
45
|
DATA_REQUEST_TYPES: () => import_site_contracts.DATA_REQUEST_TYPES,
|
|
46
|
+
DEFAULT_BEFORE_AFTER_LABELS: () => DEFAULT_BEFORE_AFTER_LABELS,
|
|
41
47
|
DEFAULT_CHECKOUT_DELIVERY_CHOICE_LABELS: () => DEFAULT_CHECKOUT_DELIVERY_CHOICE_LABELS,
|
|
48
|
+
DEFAULT_CHECKOUT_QUOTE_NOTICE_LABELS: () => DEFAULT_CHECKOUT_QUOTE_NOTICE_LABELS,
|
|
42
49
|
DEFAULT_CHECKOUT_QUOTE_SUMMARY_LABELS: () => DEFAULT_CHECKOUT_QUOTE_SUMMARY_LABELS,
|
|
43
50
|
DEFAULT_COURSE_CATALOG_FILTERS_LABELS: () => DEFAULT_COURSE_CATALOG_FILTERS_LABELS,
|
|
44
51
|
DEFAULT_COURSE_PRICE_BANDS: () => DEFAULT_COURSE_PRICE_BANDS,
|
|
@@ -55,6 +62,8 @@ __export(src_exports, {
|
|
|
55
62
|
EMPTY_FULL_INVOICE_VALUE: () => EMPTY_FULL_INVOICE_VALUE,
|
|
56
63
|
FaqAccordion: () => FaqAccordion,
|
|
57
64
|
FullInvoiceFields: () => FullInvoiceFields,
|
|
65
|
+
IconCardGrid: () => IconCardGrid,
|
|
66
|
+
ImageTextSplit: () => ImageTextSplit,
|
|
58
67
|
LegalDocument: () => LegalDocument,
|
|
59
68
|
LessonPreview: () => LessonPreview,
|
|
60
69
|
MarkdownRenderer: () => MarkdownRenderer,
|
|
@@ -67,6 +76,7 @@ __export(src_exports, {
|
|
|
67
76
|
ProductTrustItems: () => ProductTrustItems,
|
|
68
77
|
ProfessionalFields: () => ProfessionalFields,
|
|
69
78
|
ProfileCard: () => ProfileCard,
|
|
79
|
+
Reviews: () => Reviews,
|
|
70
80
|
SafeHtml: () => SafeHtml,
|
|
71
81
|
ShopFilters: () => ShopFilters,
|
|
72
82
|
Specialty: () => Specialty,
|
|
@@ -75,11 +85,14 @@ __export(src_exports, {
|
|
|
75
85
|
buildFaqPageJsonLd: () => buildFaqPageJsonLd,
|
|
76
86
|
buildShareUrls: () => buildShareUrls,
|
|
77
87
|
bundleComponentsToIncludes: () => bundleComponentsToIncludes,
|
|
88
|
+
checkoutQuoteNotice: () => checkoutQuoteNotice,
|
|
78
89
|
collectFaqItems: () => collectFaqItems,
|
|
90
|
+
courseSellsAsGuest: () => courseSellsAsGuest,
|
|
79
91
|
defaultCheckoutFulfillment: () => defaultCheckoutFulfillment,
|
|
80
92
|
formatPrice: () => formatPrice,
|
|
81
93
|
getShopErrorMessage: () => getShopErrorMessage,
|
|
82
94
|
isAllowedYouTubeHost: () => isAllowedYouTubeHost,
|
|
95
|
+
isCheckoutDeliveryComplete: () => isCheckoutDeliveryComplete,
|
|
83
96
|
isOverSimplifiedInvoiceCap: () => isOverSimplifiedInvoiceCap,
|
|
84
97
|
markdownToPlainText: () => markdownToPlainText,
|
|
85
98
|
markdownToSafeHtml: () => markdownToSafeHtml,
|
|
@@ -88,6 +101,7 @@ __export(src_exports, {
|
|
|
88
101
|
sanitizeHtml: () => sanitizeHtml,
|
|
89
102
|
shopIssuesInvoices: () => shopIssuesInvoices,
|
|
90
103
|
shouldRenderShopFilters: () => shouldRenderShopFilters,
|
|
104
|
+
toAcademyCheckoutInvoiceFields: () => toAcademyCheckoutInvoiceFields,
|
|
91
105
|
toCheckoutFulfillmentFields: () => toCheckoutFulfillmentFields,
|
|
92
106
|
toCheckoutInvoiceFields: () => toCheckoutInvoiceFields,
|
|
93
107
|
toCheckoutTermsFields: () => toCheckoutTermsFields
|
|
@@ -14589,41 +14603,503 @@ function ArbitrationBadge({
|
|
|
14589
14603
|
);
|
|
14590
14604
|
}
|
|
14591
14605
|
|
|
14592
|
-
// src/components/
|
|
14606
|
+
// src/components/reviews.tsx
|
|
14593
14607
|
var import_utils14 = require("@reblu/site-ui/utils");
|
|
14594
|
-
var import_button_variants2 = require("@reblu/site-ui/button-variants");
|
|
14595
14608
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
14609
|
+
function isHttps(value) {
|
|
14610
|
+
if (typeof value !== "string") return false;
|
|
14611
|
+
try {
|
|
14612
|
+
const url = new URL(value);
|
|
14613
|
+
return url.protocol === "https:" && url.hostname !== "";
|
|
14614
|
+
} catch {
|
|
14615
|
+
return false;
|
|
14616
|
+
}
|
|
14617
|
+
}
|
|
14618
|
+
function isUsable2(value) {
|
|
14619
|
+
if (typeof value !== "object" || value === null) return false;
|
|
14620
|
+
const review = value;
|
|
14621
|
+
return typeof review.id === "string" && typeof review.authorName === "string" && review.authorName.trim() !== "" && typeof review.rating === "number" && Number.isInteger(review.rating) && review.rating >= 1 && review.rating <= 5 && typeof review.sourceName === "string" && isHttps(review.sourceUrl);
|
|
14622
|
+
}
|
|
14623
|
+
function formatDay(day, locale) {
|
|
14624
|
+
if (!/^\d{4}-\d{2}-\d{2}$/.test(day)) return null;
|
|
14625
|
+
const date = /* @__PURE__ */ new Date(`${day}T00:00:00.000Z`);
|
|
14626
|
+
if (Number.isNaN(date.getTime())) return null;
|
|
14627
|
+
return new Intl.DateTimeFormat(locale, { dateStyle: "long", timeZone: "UTC" }).format(date);
|
|
14628
|
+
}
|
|
14629
|
+
var STAR_PATH = "M12 2.5l2.9 5.9 6.5.9-4.7 4.6 1.1 6.5L12 17.3l-5.8 3.1 1.1-6.5L2.6 9.3l6.5-.9z";
|
|
14630
|
+
function Stars({ rating }) {
|
|
14631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { role: "img", "aria-label": `${rating} de 5 estrellas`, className: "flex gap-0.5", children: [1, 2, 3, 4, 5].map((n) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
14632
|
+
"svg",
|
|
14633
|
+
{
|
|
14634
|
+
"aria-hidden": "true",
|
|
14635
|
+
viewBox: "0 0 24 24",
|
|
14636
|
+
width: "16",
|
|
14637
|
+
height: "16",
|
|
14638
|
+
"data-filled": n <= rating ? "true" : "false",
|
|
14639
|
+
className: n <= rating ? "fill-current" : "fill-none opacity-40",
|
|
14640
|
+
stroke: "currentColor",
|
|
14641
|
+
strokeWidth: "1.5",
|
|
14642
|
+
strokeLinejoin: "round",
|
|
14643
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: STAR_PATH })
|
|
14644
|
+
},
|
|
14645
|
+
n
|
|
14646
|
+
)) });
|
|
14647
|
+
}
|
|
14648
|
+
function Reviews({
|
|
14649
|
+
reviews,
|
|
14650
|
+
heading,
|
|
14651
|
+
headingId = "reviews-heading",
|
|
14652
|
+
headingLevel = 2,
|
|
14653
|
+
notice,
|
|
14654
|
+
noticePosition = "below",
|
|
14655
|
+
linkLabel = (name) => `Ver en ${name}`,
|
|
14656
|
+
newWindowLabel = "(se abre en una pesta\xF1a nueva)",
|
|
14657
|
+
locale = "es-ES",
|
|
14658
|
+
className,
|
|
14659
|
+
headingClassName,
|
|
14660
|
+
gridClassName,
|
|
14661
|
+
cardClassName,
|
|
14662
|
+
noticeClassName
|
|
14663
|
+
}) {
|
|
14664
|
+
if (!Array.isArray(reviews) || reviews.length === 0) return null;
|
|
14665
|
+
const usable = reviews.filter(isUsable2);
|
|
14666
|
+
if (usable.length === 0) return null;
|
|
14667
|
+
const hasNotice = notice !== void 0 && notice !== null && notice !== "";
|
|
14668
|
+
const noticeNode = hasNotice ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
14669
|
+
"p",
|
|
14670
|
+
{
|
|
14671
|
+
"data-slot": "reviews-notice",
|
|
14672
|
+
className: slotClassName("", "text-sm text-muted-foreground", noticeClassName),
|
|
14673
|
+
children: notice
|
|
14674
|
+
}
|
|
14675
|
+
) : null;
|
|
14676
|
+
const grid = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
14677
|
+
"ul",
|
|
14678
|
+
{
|
|
14679
|
+
"data-slot": "reviews-grid",
|
|
14680
|
+
className: slotClassName("grid gap-6", "sm:grid-cols-2 lg:grid-cols-3", gridClassName),
|
|
14681
|
+
children: usable.map((review) => {
|
|
14682
|
+
const date = formatDay(review.reviewDate, locale);
|
|
14683
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
14684
|
+
"article",
|
|
14685
|
+
{
|
|
14686
|
+
"data-slot": "review",
|
|
14687
|
+
"data-source": review.source,
|
|
14688
|
+
className: (0, import_utils14.cn)("flex h-full flex-col gap-3 rounded-lg border p-5", cardClassName),
|
|
14689
|
+
children: [
|
|
14690
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Stars, { rating: review.rating }),
|
|
14691
|
+
review.text && review.text.trim() !== "" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("blockquote", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { children: review.text }) }) : null,
|
|
14692
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("footer", { className: "mt-auto space-y-1 text-sm", children: [
|
|
14693
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "font-semibold", children: review.authorName }),
|
|
14694
|
+
date ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("time", { dateTime: review.reviewDate, className: "block text-muted-foreground", children: date }) : null,
|
|
14695
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
14696
|
+
"a",
|
|
14697
|
+
{
|
|
14698
|
+
href: review.sourceUrl,
|
|
14699
|
+
target: "_blank",
|
|
14700
|
+
rel: "noopener nofollow",
|
|
14701
|
+
className: "inline-flex underline underline-offset-4",
|
|
14702
|
+
children: [
|
|
14703
|
+
linkLabel(review.sourceName),
|
|
14704
|
+
" ",
|
|
14705
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "sr-only", children: newWindowLabel })
|
|
14706
|
+
]
|
|
14707
|
+
}
|
|
14708
|
+
)
|
|
14709
|
+
] })
|
|
14710
|
+
]
|
|
14711
|
+
}
|
|
14712
|
+
) }, review.id);
|
|
14713
|
+
})
|
|
14714
|
+
}
|
|
14715
|
+
);
|
|
14716
|
+
const body3 = /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
14717
|
+
noticePosition === "above" ? noticeNode : null,
|
|
14718
|
+
grid,
|
|
14719
|
+
noticePosition === "below" ? noticeNode : null
|
|
14720
|
+
] });
|
|
14721
|
+
const hasHeading = heading !== void 0 && heading !== null && heading !== "";
|
|
14722
|
+
if (!hasHeading) {
|
|
14723
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { "data-slot": "reviews", className: (0, import_utils14.cn)("space-y-4", className), children: body3 });
|
|
14724
|
+
}
|
|
14725
|
+
const Tag = `h${headingLevel}`;
|
|
14726
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("section", { "data-slot": "reviews", "aria-labelledby": headingId, className: (0, import_utils14.cn)("space-y-4", className), children: [
|
|
14727
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Tag, { id: headingId, className: slotClassName("", "text-xl font-semibold", headingClassName), children: heading }),
|
|
14728
|
+
body3
|
|
14729
|
+
] });
|
|
14730
|
+
}
|
|
14731
|
+
|
|
14732
|
+
// src/components/page-blocks.tsx
|
|
14733
|
+
var import_utils16 = require("@reblu/site-ui/utils");
|
|
14734
|
+
var import_button_variants2 = require("@reblu/site-ui/button-variants");
|
|
14735
|
+
|
|
14736
|
+
// src/components/content-blocks.tsx
|
|
14737
|
+
var import_utils15 = require("@reblu/site-ui/utils");
|
|
14738
|
+
|
|
14739
|
+
// src/components/_card-icons.ts
|
|
14740
|
+
var CARD_ICON_NODES = {
|
|
14741
|
+
check: [["path", { d: "M20 6 9 17l-5-5" }]],
|
|
14742
|
+
star: [
|
|
14743
|
+
[
|
|
14744
|
+
"path",
|
|
14745
|
+
{
|
|
14746
|
+
d: "M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z"
|
|
14747
|
+
}
|
|
14748
|
+
]
|
|
14749
|
+
],
|
|
14750
|
+
heart: [
|
|
14751
|
+
[
|
|
14752
|
+
"path",
|
|
14753
|
+
{
|
|
14754
|
+
d: "M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5"
|
|
14755
|
+
}
|
|
14756
|
+
]
|
|
14757
|
+
],
|
|
14758
|
+
"shield-check": [
|
|
14759
|
+
[
|
|
14760
|
+
"path",
|
|
14761
|
+
{
|
|
14762
|
+
d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"
|
|
14763
|
+
}
|
|
14764
|
+
],
|
|
14765
|
+
["path", { d: "m9 12 2 2 4-4" }]
|
|
14766
|
+
],
|
|
14767
|
+
sparkles: [
|
|
14768
|
+
[
|
|
14769
|
+
"path",
|
|
14770
|
+
{
|
|
14771
|
+
d: "M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z"
|
|
14772
|
+
}
|
|
14773
|
+
],
|
|
14774
|
+
["path", { d: "M20 2v4" }],
|
|
14775
|
+
["path", { d: "M22 4h-4" }],
|
|
14776
|
+
["circle", { cx: "4", cy: "20", r: "2" }]
|
|
14777
|
+
],
|
|
14778
|
+
clock: [
|
|
14779
|
+
["path", { d: "M12 6v6l4 2" }],
|
|
14780
|
+
["circle", { cx: "12", cy: "12", r: "10" }]
|
|
14781
|
+
],
|
|
14782
|
+
calendar: [
|
|
14783
|
+
["path", { d: "M8 2v4" }],
|
|
14784
|
+
["path", { d: "M16 2v4" }],
|
|
14785
|
+
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2" }],
|
|
14786
|
+
["path", { d: "M3 10h18" }]
|
|
14787
|
+
],
|
|
14788
|
+
user: [
|
|
14789
|
+
["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }],
|
|
14790
|
+
["circle", { cx: "12", cy: "7", r: "4" }]
|
|
14791
|
+
],
|
|
14792
|
+
users: [
|
|
14793
|
+
["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" }],
|
|
14794
|
+
["path", { d: "M16 3.128a4 4 0 0 1 0 7.744" }],
|
|
14795
|
+
["path", { d: "M22 21v-2a4 4 0 0 0-3-3.87" }],
|
|
14796
|
+
["circle", { cx: "9", cy: "7", r: "4" }]
|
|
14797
|
+
],
|
|
14798
|
+
phone: [
|
|
14799
|
+
[
|
|
14800
|
+
"path",
|
|
14801
|
+
{
|
|
14802
|
+
d: "M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384"
|
|
14803
|
+
}
|
|
14804
|
+
]
|
|
14805
|
+
],
|
|
14806
|
+
mail: [
|
|
14807
|
+
["path", { d: "m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7" }],
|
|
14808
|
+
["rect", { x: "2", y: "4", width: "20", height: "16", rx: "2" }]
|
|
14809
|
+
],
|
|
14810
|
+
"map-pin": [
|
|
14811
|
+
[
|
|
14812
|
+
"path",
|
|
14813
|
+
{
|
|
14814
|
+
d: "M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0"
|
|
14815
|
+
}
|
|
14816
|
+
],
|
|
14817
|
+
["circle", { cx: "12", cy: "10", r: "3" }]
|
|
14818
|
+
],
|
|
14819
|
+
leaf: [
|
|
14820
|
+
[
|
|
14821
|
+
"path",
|
|
14822
|
+
{ d: "M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z" }
|
|
14823
|
+
],
|
|
14824
|
+
["path", { d: "M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12" }]
|
|
14825
|
+
],
|
|
14826
|
+
droplet: [
|
|
14827
|
+
[
|
|
14828
|
+
"path",
|
|
14829
|
+
{
|
|
14830
|
+
d: "M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z"
|
|
14831
|
+
}
|
|
14832
|
+
]
|
|
14833
|
+
],
|
|
14834
|
+
sun: [
|
|
14835
|
+
["circle", { cx: "12", cy: "12", r: "4" }],
|
|
14836
|
+
["path", { d: "M12 2v2" }],
|
|
14837
|
+
["path", { d: "M12 20v2" }],
|
|
14838
|
+
["path", { d: "m4.93 4.93 1.41 1.41" }],
|
|
14839
|
+
["path", { d: "m17.66 17.66 1.41 1.41" }],
|
|
14840
|
+
["path", { d: "M2 12h2" }],
|
|
14841
|
+
["path", { d: "M20 12h2" }],
|
|
14842
|
+
["path", { d: "m6.34 17.66-1.41 1.41" }],
|
|
14843
|
+
["path", { d: "m19.07 4.93-1.41 1.41" }]
|
|
14844
|
+
],
|
|
14845
|
+
zap: [
|
|
14846
|
+
[
|
|
14847
|
+
"path",
|
|
14848
|
+
{
|
|
14849
|
+
d: "M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"
|
|
14850
|
+
}
|
|
14851
|
+
]
|
|
14852
|
+
],
|
|
14853
|
+
award: [
|
|
14854
|
+
[
|
|
14855
|
+
"path",
|
|
14856
|
+
{
|
|
14857
|
+
d: "m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526"
|
|
14858
|
+
}
|
|
14859
|
+
],
|
|
14860
|
+
["circle", { cx: "12", cy: "8", r: "6" }]
|
|
14861
|
+
],
|
|
14862
|
+
target: [
|
|
14863
|
+
["circle", { cx: "12", cy: "12", r: "10" }],
|
|
14864
|
+
["circle", { cx: "12", cy: "12", r: "6" }],
|
|
14865
|
+
["circle", { cx: "12", cy: "12", r: "2" }]
|
|
14866
|
+
],
|
|
14867
|
+
lightbulb: [
|
|
14868
|
+
[
|
|
14869
|
+
"path",
|
|
14870
|
+
{
|
|
14871
|
+
d: "M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"
|
|
14872
|
+
}
|
|
14873
|
+
],
|
|
14874
|
+
["path", { d: "M9 18h6" }],
|
|
14875
|
+
["path", { d: "M10 22h4" }]
|
|
14876
|
+
],
|
|
14877
|
+
smile: [
|
|
14878
|
+
["circle", { cx: "12", cy: "12", r: "10" }],
|
|
14879
|
+
["path", { d: "M8 14s1.5 2 4 2 4-2 4-2" }],
|
|
14880
|
+
["line", { x1: "9", x2: "9.01", y1: "9", y2: "9" }],
|
|
14881
|
+
["line", { x1: "15", x2: "15.01", y1: "9", y2: "9" }]
|
|
14882
|
+
],
|
|
14883
|
+
"thumbs-up": [
|
|
14884
|
+
[
|
|
14885
|
+
"path",
|
|
14886
|
+
{
|
|
14887
|
+
d: "M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z"
|
|
14888
|
+
}
|
|
14889
|
+
],
|
|
14890
|
+
["path", { d: "M7 10v12" }]
|
|
14891
|
+
],
|
|
14892
|
+
info: [
|
|
14893
|
+
["circle", { cx: "12", cy: "12", r: "10" }],
|
|
14894
|
+
["path", { d: "M12 16v-4" }],
|
|
14895
|
+
["path", { d: "M12 8h.01" }]
|
|
14896
|
+
]
|
|
14897
|
+
};
|
|
14898
|
+
|
|
14899
|
+
// src/components/content-blocks.tsx
|
|
14900
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
14901
|
+
var DEFAULT_BEFORE_AFTER_LABELS = Object.freeze({ before: "Antes", after: "Despu\xE9s" });
|
|
14902
|
+
function PairImage({ url, alt, label }) {
|
|
14903
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("figure", { className: "space-y-2", children: [
|
|
14904
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "relative aspect-[4/3] w-full overflow-hidden rounded-lg bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
14905
|
+
"img",
|
|
14906
|
+
{
|
|
14907
|
+
src: url,
|
|
14908
|
+
alt,
|
|
14909
|
+
loading: "lazy",
|
|
14910
|
+
decoding: "async",
|
|
14911
|
+
className: "h-full w-full object-cover"
|
|
14912
|
+
}
|
|
14913
|
+
) }),
|
|
14914
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("figcaption", { className: "text-sm font-semibold", children: label })
|
|
14915
|
+
] });
|
|
14916
|
+
}
|
|
14917
|
+
function BeforeAfterPairs({
|
|
14918
|
+
pairs,
|
|
14919
|
+
showCaption = false,
|
|
14920
|
+
caption,
|
|
14921
|
+
labels = DEFAULT_BEFORE_AFTER_LABELS,
|
|
14922
|
+
className
|
|
14923
|
+
}) {
|
|
14924
|
+
const visibleCaption = showCaption && caption && caption.trim() !== "" ? caption : null;
|
|
14925
|
+
if (pairs.length === 0 && !visibleCaption) return null;
|
|
14926
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { "data-slot": "before-after", className: (0, import_utils15.cn)("space-y-4", className), children: [
|
|
14927
|
+
pairs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("ul", { className: "grid gap-6 lg:grid-cols-2", children: pairs.map((pair, i) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
14928
|
+
"li",
|
|
14929
|
+
{
|
|
14930
|
+
"data-slot": "before-after-pair",
|
|
14931
|
+
className: "grid grid-cols-1 gap-3 sm:grid-cols-2",
|
|
14932
|
+
children: [
|
|
14933
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(PairImage, { url: pair.beforeUrl, alt: pair.alt ?? "", label: labels.before }),
|
|
14934
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(PairImage, { url: pair.afterUrl, alt: pair.alt ?? "", label: labels.after })
|
|
14935
|
+
]
|
|
14936
|
+
},
|
|
14937
|
+
`${pair.beforeUrl}-${pair.afterUrl}-${i}`
|
|
14938
|
+
)) }),
|
|
14939
|
+
visibleCaption && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { "data-slot": "before-after-caption", className: "whitespace-pre-line text-sm opacity-80", children: visibleCaption })
|
|
14940
|
+
] });
|
|
14941
|
+
}
|
|
14942
|
+
function ChipList({ items, className }) {
|
|
14943
|
+
const visible = items.filter((item) => item.trim() !== "");
|
|
14944
|
+
if (visible.length === 0) return null;
|
|
14945
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("ul", { "data-slot": "chip-list", className: (0, import_utils15.cn)("flex flex-wrap gap-3", className), children: visible.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
14946
|
+
"li",
|
|
14947
|
+
{
|
|
14948
|
+
"data-slot": "chip",
|
|
14949
|
+
className: "rounded-full border border-primary/20 bg-primary/10 px-4 py-2 text-sm font-medium text-primary",
|
|
14950
|
+
children: item
|
|
14951
|
+
},
|
|
14952
|
+
`${item}-${i}`
|
|
14953
|
+
)) });
|
|
14954
|
+
}
|
|
14955
|
+
var CARD_ICON_NAMES = Object.freeze(Object.keys(CARD_ICON_NODES));
|
|
14956
|
+
function hasCardIcon(icon) {
|
|
14957
|
+
return Object.prototype.hasOwnProperty.call(CARD_ICON_NODES, icon);
|
|
14958
|
+
}
|
|
14959
|
+
function CardIconSvg({ icon, className }) {
|
|
14960
|
+
if (!hasCardIcon(icon)) return null;
|
|
14961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
14962
|
+
"svg",
|
|
14963
|
+
{
|
|
14964
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
14965
|
+
viewBox: "0 0 24 24",
|
|
14966
|
+
fill: "none",
|
|
14967
|
+
stroke: "currentColor",
|
|
14968
|
+
strokeWidth: 2,
|
|
14969
|
+
strokeLinecap: "round",
|
|
14970
|
+
strokeLinejoin: "round",
|
|
14971
|
+
"aria-hidden": "true",
|
|
14972
|
+
focusable: "false",
|
|
14973
|
+
"data-icon": icon,
|
|
14974
|
+
className: (0, import_utils15.cn)("h-5 w-5", className),
|
|
14975
|
+
children: CARD_ICON_NODES[icon].map(([Tag, attrs], i) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Tag, { ...attrs }, i))
|
|
14976
|
+
}
|
|
14977
|
+
);
|
|
14978
|
+
}
|
|
14979
|
+
function IconCardGrid({ items, intro, headingLevel = 3, className }) {
|
|
14980
|
+
const hasIntro = !!intro && intro.trim() !== "";
|
|
14981
|
+
if (items.length === 0 && !hasIntro) return null;
|
|
14982
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { "data-slot": "icon-cards", className: (0, import_utils15.cn)("space-y-6", className), children: [
|
|
14983
|
+
hasIntro && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "max-w-prose text-lg opacity-80", children: intro }),
|
|
14984
|
+
items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
14985
|
+
"ul",
|
|
14986
|
+
{
|
|
14987
|
+
"data-slot": "icon-card-grid",
|
|
14988
|
+
className: "grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3",
|
|
14989
|
+
children: items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
14990
|
+
"li",
|
|
14991
|
+
{
|
|
14992
|
+
"data-slot": "icon-card",
|
|
14993
|
+
className: "space-y-3 rounded-xl border border-border bg-card p-6 text-card-foreground",
|
|
14994
|
+
children: [
|
|
14995
|
+
hasCardIcon(item.icon) && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "inline-flex h-12 w-12 items-center justify-center rounded-xl bg-primary/10 text-primary", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CardIconSvg, { icon: item.icon }) }),
|
|
14996
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Heading, { level: headingLevel, className: "text-lg font-semibold", children: item.title }),
|
|
14997
|
+
item.text && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-muted-foreground", children: item.text })
|
|
14998
|
+
]
|
|
14999
|
+
},
|
|
15000
|
+
`${item.title}-${i}`
|
|
15001
|
+
))
|
|
15002
|
+
}
|
|
15003
|
+
)
|
|
15004
|
+
] });
|
|
15005
|
+
}
|
|
15006
|
+
var KICKER_CLASS_NAME = "text-sm font-semibold uppercase tracking-wider opacity-80";
|
|
15007
|
+
function ImageTextSplit({
|
|
15008
|
+
imageUrl,
|
|
15009
|
+
alt,
|
|
15010
|
+
imageSide,
|
|
15011
|
+
mobileOrder = "image_first",
|
|
15012
|
+
html: html5,
|
|
15013
|
+
kicker,
|
|
15014
|
+
heading,
|
|
15015
|
+
headingLevel = 2,
|
|
15016
|
+
headingId,
|
|
15017
|
+
className
|
|
15018
|
+
}) {
|
|
15019
|
+
const textFirst = mobileOrder === "text_first";
|
|
15020
|
+
const imageRight = imageSide === "right";
|
|
15021
|
+
const hasKicker = !!kicker && kicker.trim() !== "";
|
|
15022
|
+
const bodyOffset = heading ? headingLevel : headingLevel - 1;
|
|
15023
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
15024
|
+
"div",
|
|
15025
|
+
{
|
|
15026
|
+
"data-slot": "image-text",
|
|
15027
|
+
"data-image-side": imageRight ? "right" : "left",
|
|
15028
|
+
className: (0, import_utils15.cn)("grid grid-cols-1 items-center gap-8 md:grid-cols-2", className),
|
|
15029
|
+
children: [
|
|
15030
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
15031
|
+
"div",
|
|
15032
|
+
{
|
|
15033
|
+
"data-slot": "image-text-media",
|
|
15034
|
+
className: (0, import_utils15.cn)(textFirst ? "order-2" : "order-1", imageRight ? "md:order-2" : "md:order-1"),
|
|
15035
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "relative aspect-[4/3] w-full overflow-hidden rounded-xl bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
15036
|
+
"img",
|
|
15037
|
+
{
|
|
15038
|
+
src: imageUrl,
|
|
15039
|
+
alt: alt ?? "",
|
|
15040
|
+
loading: "lazy",
|
|
15041
|
+
decoding: "async",
|
|
15042
|
+
className: "h-full w-full object-cover"
|
|
15043
|
+
}
|
|
15044
|
+
) })
|
|
15045
|
+
}
|
|
15046
|
+
),
|
|
15047
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
15048
|
+
"div",
|
|
15049
|
+
{
|
|
15050
|
+
"data-slot": "image-text-body",
|
|
15051
|
+
className: (0, import_utils15.cn)(
|
|
15052
|
+
"space-y-4",
|
|
15053
|
+
textFirst ? "order-1" : "order-2",
|
|
15054
|
+
imageRight ? "md:order-1" : "md:order-2"
|
|
15055
|
+
),
|
|
15056
|
+
children: [
|
|
15057
|
+
(hasKicker || heading) && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "space-y-2", children: [
|
|
15058
|
+
hasKicker && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { "data-slot": "page-block-kicker", className: KICKER_CLASS_NAME, children: kicker }),
|
|
15059
|
+
heading && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Heading, { level: headingLevel, className: "text-2xl font-bold tracking-tight", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { id: headingId, children: heading }) })
|
|
15060
|
+
] }),
|
|
15061
|
+
html5 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SafeHtml, { html: sanitizeHtml(html5), headingOffset: bodyOffset })
|
|
15062
|
+
]
|
|
15063
|
+
}
|
|
15064
|
+
)
|
|
15065
|
+
]
|
|
15066
|
+
}
|
|
15067
|
+
);
|
|
15068
|
+
}
|
|
15069
|
+
|
|
15070
|
+
// src/components/page-blocks.tsx
|
|
15071
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
14596
15072
|
var ALIASES = {
|
|
14597
15073
|
doctor_embed: "profile_embed",
|
|
14598
15074
|
specialty_embed: "page_embed"
|
|
14599
15075
|
};
|
|
14600
15076
|
function HeroBlock({ block, headingLevel }) {
|
|
14601
15077
|
const { title, subtitle, imageUrl } = block.data;
|
|
14602
|
-
return /* @__PURE__ */ (0,
|
|
14603
|
-
/* @__PURE__ */ (0,
|
|
14604
|
-
subtitle && /* @__PURE__ */ (0,
|
|
14605
|
-
imageUrl && /* @__PURE__ */ (0,
|
|
15078
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "space-y-4", children: [
|
|
15079
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Heading, { level: headingLevel, className: "text-3xl font-bold tracking-tight md:text-4xl", children: title }),
|
|
15080
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-lg opacity-80", children: subtitle }),
|
|
15081
|
+
imageUrl && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "relative aspect-[21/9] w-full overflow-hidden rounded-xl bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("img", { src: imageUrl, alt: "", loading: "lazy", className: "h-full w-full object-cover" }) })
|
|
14606
15082
|
] });
|
|
14607
15083
|
}
|
|
14608
15084
|
function RichtextBlock({ block, headingLevel }) {
|
|
14609
|
-
return /* @__PURE__ */ (0,
|
|
15085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SafeHtml, { html: sanitizeHtml(block.data.html), headingOffset: headingLevel - 1 });
|
|
14610
15086
|
}
|
|
14611
15087
|
function FaqBlock({ block }) {
|
|
14612
|
-
return /* @__PURE__ */ (0,
|
|
15088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(FaqAccordion, { items: block.data.items });
|
|
14613
15089
|
}
|
|
14614
15090
|
function StatsBlock({ block }) {
|
|
14615
|
-
return /* @__PURE__ */ (0,
|
|
14616
|
-
/* @__PURE__ */ (0,
|
|
14617
|
-
/* @__PURE__ */ (0,
|
|
15091
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("dl", { className: "grid gap-6 sm:grid-cols-2 lg:grid-cols-4", children: block.data.items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col-reverse gap-1", children: [
|
|
15092
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("dt", { className: "text-sm opacity-80", children: item.label }),
|
|
15093
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("dd", { className: "text-3xl font-bold", children: item.value })
|
|
14618
15094
|
] }, i)) });
|
|
14619
15095
|
}
|
|
14620
15096
|
function TestimonialBlock({ block }) {
|
|
14621
15097
|
const { quote, author, role, avatarUrl } = block.data;
|
|
14622
|
-
return /* @__PURE__ */ (0,
|
|
14623
|
-
/* @__PURE__ */ (0,
|
|
14624
|
-
/* @__PURE__ */ (0,
|
|
15098
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("figure", { className: "space-y-4", children: [
|
|
15099
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("blockquote", { className: "text-xl italic", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: quote }) }),
|
|
15100
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("figcaption", { className: "flex items-center gap-3", children: [
|
|
14625
15101
|
avatarUrl && // eslint-disable-next-line @next/next/no-img-element
|
|
14626
|
-
/* @__PURE__ */ (0,
|
|
15102
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
14627
15103
|
"img",
|
|
14628
15104
|
{
|
|
14629
15105
|
src: avatarUrl,
|
|
@@ -14632,9 +15108,9 @@ function TestimonialBlock({ block }) {
|
|
|
14632
15108
|
className: "h-10 w-10 rounded-full object-cover"
|
|
14633
15109
|
}
|
|
14634
15110
|
),
|
|
14635
|
-
/* @__PURE__ */ (0,
|
|
14636
|
-
/* @__PURE__ */ (0,
|
|
14637
|
-
role && /* @__PURE__ */ (0,
|
|
15111
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
|
|
15112
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "font-semibold", children: author }),
|
|
15113
|
+
role && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "block text-sm opacity-80", children: role })
|
|
14638
15114
|
] })
|
|
14639
15115
|
] })
|
|
14640
15116
|
] });
|
|
@@ -14643,19 +15119,19 @@ function CtaSlotBlock(_props) {
|
|
|
14643
15119
|
return null;
|
|
14644
15120
|
}
|
|
14645
15121
|
function FeatureListBlock({ block }) {
|
|
14646
|
-
return /* @__PURE__ */ (0,
|
|
15122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("ul", { className: "grid list-disc gap-2 pl-5 sm:grid-cols-2", children: block.data.items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("li", { children: item.text }, i)) });
|
|
14647
15123
|
}
|
|
14648
15124
|
function GalleryBlock({ block }) {
|
|
14649
15125
|
const { images } = block.data;
|
|
14650
|
-
return /* @__PURE__ */ (0,
|
|
15126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
14651
15127
|
"div",
|
|
14652
15128
|
{
|
|
14653
|
-
className: (0,
|
|
15129
|
+
className: (0, import_utils16.cn)(
|
|
14654
15130
|
"grid gap-4",
|
|
14655
15131
|
images.length > 1 ? "sm:grid-cols-2 lg:grid-cols-3" : "grid-cols-1"
|
|
14656
15132
|
),
|
|
14657
|
-
children: images.map((img, i) => /* @__PURE__ */ (0,
|
|
14658
|
-
/* @__PURE__ */ (0,
|
|
15133
|
+
children: images.map((img, i) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("figure", { className: "space-y-1", children: [
|
|
15134
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "relative aspect-video w-full overflow-hidden rounded-lg bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
14659
15135
|
"img",
|
|
14660
15136
|
{
|
|
14661
15137
|
src: img.url,
|
|
@@ -14664,7 +15140,7 @@ function GalleryBlock({ block }) {
|
|
|
14664
15140
|
className: "h-full w-full object-cover"
|
|
14665
15141
|
}
|
|
14666
15142
|
) }),
|
|
14667
|
-
img.caption && /* @__PURE__ */ (0,
|
|
15143
|
+
img.caption && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("figcaption", { className: "text-sm opacity-80", children: img.caption })
|
|
14668
15144
|
] }, `${img.url}-${i}`))
|
|
14669
15145
|
}
|
|
14670
15146
|
);
|
|
@@ -14674,13 +15150,13 @@ function EmbedCard({
|
|
|
14674
15150
|
headingLevel,
|
|
14675
15151
|
embedHref
|
|
14676
15152
|
}) {
|
|
14677
|
-
return /* @__PURE__ */ (0,
|
|
15153
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
14678
15154
|
"a",
|
|
14679
15155
|
{
|
|
14680
15156
|
href: embedHref(resolved),
|
|
14681
15157
|
className: "group block overflow-hidden rounded-xl border border-border bg-card text-card-foreground transition-shadow hover:shadow-md focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",
|
|
14682
15158
|
children: [
|
|
14683
|
-
resolved.coverImageUrl && /* @__PURE__ */ (0,
|
|
15159
|
+
resolved.coverImageUrl && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "aspect-video w-full overflow-hidden bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
14684
15160
|
"img",
|
|
14685
15161
|
{
|
|
14686
15162
|
src: resolved.coverImageUrl,
|
|
@@ -14689,24 +15165,51 @@ function EmbedCard({
|
|
|
14689
15165
|
className: "h-full w-full object-cover"
|
|
14690
15166
|
}
|
|
14691
15167
|
) }),
|
|
14692
|
-
/* @__PURE__ */ (0,
|
|
14693
|
-
/* @__PURE__ */ (0,
|
|
14694
|
-
resolved.role && /* @__PURE__ */ (0,
|
|
14695
|
-
resolved.excerpt && /* @__PURE__ */ (0,
|
|
15168
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "space-y-1 p-4", children: [
|
|
15169
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Heading, { level: headingLevel, className: "text-lg font-semibold", children: resolved.title }),
|
|
15170
|
+
resolved.role && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-sm text-muted-foreground", children: resolved.role }),
|
|
15171
|
+
resolved.excerpt && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-muted-foreground", children: resolved.excerpt })
|
|
14696
15172
|
] })
|
|
14697
15173
|
]
|
|
14698
15174
|
}
|
|
14699
15175
|
);
|
|
14700
15176
|
}
|
|
14701
15177
|
function PageEmbedBlock({ block, headingLevel, embedHref }) {
|
|
14702
|
-
return /* @__PURE__ */ (0,
|
|
15178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(EmbedCard, { resolved: block.resolved, headingLevel, embedHref });
|
|
14703
15179
|
}
|
|
14704
15180
|
function ProfileEmbedBlock({
|
|
14705
15181
|
block,
|
|
14706
15182
|
headingLevel,
|
|
14707
15183
|
embedHref
|
|
14708
15184
|
}) {
|
|
14709
|
-
return /* @__PURE__ */ (0,
|
|
15185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(EmbedCard, { resolved: block.resolved, headingLevel, embedHref });
|
|
15186
|
+
}
|
|
15187
|
+
function BeforeAfterBlock({ block }) {
|
|
15188
|
+
const { pairs, showCaption, caption } = block.data;
|
|
15189
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(BeforeAfterPairs, { pairs, showCaption, caption });
|
|
15190
|
+
}
|
|
15191
|
+
function ChipsBlock({ block }) {
|
|
15192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ChipList, { items: block.data.items });
|
|
15193
|
+
}
|
|
15194
|
+
function ImageTextBlock({ block, headingLevel, headingId }) {
|
|
15195
|
+
const { kicker, imageUrl, alt, imageSide, mobileOrder, html: html5 } = block.data;
|
|
15196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
15197
|
+
ImageTextSplit,
|
|
15198
|
+
{
|
|
15199
|
+
imageUrl,
|
|
15200
|
+
alt,
|
|
15201
|
+
imageSide,
|
|
15202
|
+
mobileOrder,
|
|
15203
|
+
html: html5,
|
|
15204
|
+
kicker,
|
|
15205
|
+
heading: block.heading,
|
|
15206
|
+
headingLevel,
|
|
15207
|
+
headingId
|
|
15208
|
+
}
|
|
15209
|
+
);
|
|
15210
|
+
}
|
|
15211
|
+
function IconCardsBlock({ block, headingLevel }) {
|
|
15212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(IconCardGrid, { items: block.data.items, intro: block.data.intro, headingLevel });
|
|
14710
15213
|
}
|
|
14711
15214
|
var DEFAULT_RENDERERS = {
|
|
14712
15215
|
hero: HeroBlock,
|
|
@@ -14718,8 +15221,25 @@ var DEFAULT_RENDERERS = {
|
|
|
14718
15221
|
feature_list: FeatureListBlock,
|
|
14719
15222
|
gallery: GalleryBlock,
|
|
14720
15223
|
page_embed: PageEmbedBlock,
|
|
14721
|
-
profile_embed: ProfileEmbedBlock
|
|
15224
|
+
profile_embed: ProfileEmbedBlock,
|
|
15225
|
+
before_after: BeforeAfterBlock,
|
|
15226
|
+
chips: ChipsBlock,
|
|
15227
|
+
icon_cards: IconCardsBlock,
|
|
15228
|
+
image_text: ImageTextBlock
|
|
14722
15229
|
};
|
|
15230
|
+
var KICKER_TYPES = /* @__PURE__ */ new Set([
|
|
15231
|
+
"before_after",
|
|
15232
|
+
"chips",
|
|
15233
|
+
"icon_cards"
|
|
15234
|
+
]);
|
|
15235
|
+
var OWN_HEADING_TYPES = /* @__PURE__ */ new Set([
|
|
15236
|
+
"image_text"
|
|
15237
|
+
]);
|
|
15238
|
+
function kickerOf(type, block) {
|
|
15239
|
+
if (!KICKER_TYPES.has(type)) return null;
|
|
15240
|
+
const kicker = block.data.kicker;
|
|
15241
|
+
return typeof kicker === "string" && kicker.trim() !== "" ? kicker : null;
|
|
15242
|
+
}
|
|
14723
15243
|
var EMBED_TYPES = /* @__PURE__ */ new Set([
|
|
14724
15244
|
"page_embed",
|
|
14725
15245
|
"profile_embed"
|
|
@@ -14763,14 +15283,14 @@ function toIdFragment(value) {
|
|
|
14763
15283
|
function SectionCta2({ cta }) {
|
|
14764
15284
|
if (!hasUsableCta(cta)) return null;
|
|
14765
15285
|
const variant = toButtonVariant(cta.variant);
|
|
14766
|
-
return /* @__PURE__ */ (0,
|
|
15286
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "pt-2", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
14767
15287
|
"a",
|
|
14768
15288
|
{
|
|
14769
15289
|
href: cta.url,
|
|
14770
15290
|
"data-slot": "button",
|
|
14771
15291
|
"data-variant": variant,
|
|
14772
15292
|
"data-size": "default",
|
|
14773
|
-
className: (0,
|
|
15293
|
+
className: (0, import_utils16.cn)((0, import_button_variants2.buttonVariants)({ variant, size: "default" })),
|
|
14774
15294
|
...cta.isExternal ? { target: "_blank", rel: "noopener noreferrer" } : {},
|
|
14775
15295
|
children: cta.label
|
|
14776
15296
|
}
|
|
@@ -14795,18 +15315,29 @@ function PageBlocks({
|
|
|
14795
15315
|
const Renderer = components?.[type] ?? DEFAULT_RENDERERS[type];
|
|
14796
15316
|
const headingId = block.heading ? `${safePrefix}-${toIdFragment(block.id)}-heading` : void 0;
|
|
14797
15317
|
const background = block.backgroundColor;
|
|
15318
|
+
const kicker = kickerOf(type, block);
|
|
15319
|
+
const ownsHeading = OWN_HEADING_TYPES.has(type);
|
|
14798
15320
|
return [
|
|
14799
|
-
/* @__PURE__ */ (0,
|
|
15321
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
14800
15322
|
"section",
|
|
14801
15323
|
{
|
|
14802
15324
|
"data-slot": "page-block",
|
|
14803
15325
|
"data-block-type": type,
|
|
14804
15326
|
"aria-labelledby": headingId,
|
|
14805
15327
|
style: surfaceStyle(background),
|
|
14806
|
-
className: (0,
|
|
15328
|
+
className: (0, import_utils16.cn)("space-y-6", background && "rounded-xl px-6 py-10", sectionClassName),
|
|
14807
15329
|
children: [
|
|
14808
|
-
|
|
14809
|
-
/* @__PURE__ */ (0,
|
|
15330
|
+
kicker && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { "data-slot": "page-block-kicker", className: (0, import_utils16.cn)("-mb-4", KICKER_CLASS_NAME), children: kicker }),
|
|
15331
|
+
block.heading && !ownsHeading && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Heading, { level: headingLevel, className: "text-2xl font-bold tracking-tight", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { id: headingId, children: block.heading }) }),
|
|
15332
|
+
ownsHeading ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
15333
|
+
Renderer,
|
|
15334
|
+
{
|
|
15335
|
+
block,
|
|
15336
|
+
headingLevel,
|
|
15337
|
+
embedHref,
|
|
15338
|
+
headingId
|
|
15339
|
+
}
|
|
15340
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
14810
15341
|
Renderer,
|
|
14811
15342
|
{
|
|
14812
15343
|
block,
|
|
@@ -14814,7 +15345,7 @@ function PageBlocks({
|
|
|
14814
15345
|
embedHref
|
|
14815
15346
|
}
|
|
14816
15347
|
),
|
|
14817
|
-
/* @__PURE__ */ (0,
|
|
15348
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SectionCta2, { cta: block.cta })
|
|
14818
15349
|
]
|
|
14819
15350
|
},
|
|
14820
15351
|
block.id
|
|
@@ -14822,12 +15353,12 @@ function PageBlocks({
|
|
|
14822
15353
|
];
|
|
14823
15354
|
});
|
|
14824
15355
|
if (sections.length === 0) return null;
|
|
14825
|
-
return /* @__PURE__ */ (0,
|
|
15356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: (0, import_utils16.cn)("space-y-12", className), "data-slot": "page-blocks", children: sections });
|
|
14826
15357
|
}
|
|
14827
15358
|
|
|
14828
15359
|
// src/components/shop-filters.tsx
|
|
14829
|
-
var
|
|
14830
|
-
var
|
|
15360
|
+
var import_utils17 = require("@reblu/site-ui/utils");
|
|
15361
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
14831
15362
|
var DEFAULT_SHOP_PRICE_BANDS = [
|
|
14832
15363
|
{ max: 2500 },
|
|
14833
15364
|
{ min: 2500, max: 5e3 },
|
|
@@ -14871,7 +15402,7 @@ function priceBandLabel(band, t, currencyCode, locale) {
|
|
|
14871
15402
|
return "";
|
|
14872
15403
|
}
|
|
14873
15404
|
function OptionLink({ href, active, label, onActivate }) {
|
|
14874
|
-
return /* @__PURE__ */ (0,
|
|
15405
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
14875
15406
|
"a",
|
|
14876
15407
|
{
|
|
14877
15408
|
href,
|
|
@@ -14880,7 +15411,7 @@ function OptionLink({ href, active, label, onActivate }) {
|
|
|
14880
15411
|
event.preventDefault();
|
|
14881
15412
|
onActivate();
|
|
14882
15413
|
} : void 0,
|
|
14883
|
-
className: (0,
|
|
15414
|
+
className: (0, import_utils17.cn)(
|
|
14884
15415
|
"inline-flex items-center rounded-full border px-3 py-1 text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
14885
15416
|
active ? "border-transparent bg-primary text-primary-foreground" : "border-border text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
14886
15417
|
),
|
|
@@ -14889,9 +15420,9 @@ function OptionLink({ href, active, label, onActivate }) {
|
|
|
14889
15420
|
);
|
|
14890
15421
|
}
|
|
14891
15422
|
function FilterFieldset({ legend, children: children2 }) {
|
|
14892
|
-
return /* @__PURE__ */ (0,
|
|
14893
|
-
/* @__PURE__ */ (0,
|
|
14894
|
-
/* @__PURE__ */ (0,
|
|
15423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("fieldset", { className: "space-y-2", children: [
|
|
15424
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("legend", { className: "text-sm font-medium text-foreground", children: legend }),
|
|
15425
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex flex-wrap gap-2", children: children2 })
|
|
14895
15426
|
] });
|
|
14896
15427
|
}
|
|
14897
15428
|
function ShopFilters({
|
|
@@ -14914,11 +15445,11 @@ function ShopFilters({
|
|
|
14914
15445
|
if (!shouldRenderShopFilters(facets, active)) {
|
|
14915
15446
|
return null;
|
|
14916
15447
|
}
|
|
14917
|
-
return /* @__PURE__ */ (0,
|
|
15448
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: (0, import_utils17.cn)("space-y-6", className), "data-slot": "shop-filters", children: [
|
|
14918
15449
|
visibleTaxonomies.map((axis) => {
|
|
14919
15450
|
const activeSlug = active.taxonomy?.[axis.key];
|
|
14920
|
-
return /* @__PURE__ */ (0,
|
|
14921
|
-
/* @__PURE__ */ (0,
|
|
15451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(FilterFieldset, { legend: axis.label, children: [
|
|
15452
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
14922
15453
|
OptionLink,
|
|
14923
15454
|
{
|
|
14924
15455
|
href: hrefs.taxonomy(axis.key, void 0),
|
|
@@ -14933,7 +15464,7 @@ function ShopFilters({
|
|
|
14933
15464
|
),
|
|
14934
15465
|
axis.terms.map((term) => {
|
|
14935
15466
|
const isActive = activeSlug === term.slug;
|
|
14936
|
-
return /* @__PURE__ */ (0,
|
|
15467
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
14937
15468
|
OptionLink,
|
|
14938
15469
|
{
|
|
14939
15470
|
href: hrefs.taxonomy(axis.key, isActive ? void 0 : term.slug),
|
|
@@ -14953,9 +15484,9 @@ function ShopFilters({
|
|
|
14953
15484
|
}),
|
|
14954
15485
|
visibleAttributes.map((attr) => {
|
|
14955
15486
|
const activeValues = toValueArray(active.attr?.[attr.key]);
|
|
14956
|
-
return /* @__PURE__ */ (0,
|
|
15487
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FilterFieldset, { legend: attr.label, children: attr.options.map((opt) => {
|
|
14957
15488
|
const isActive = activeValues.includes(opt.value);
|
|
14958
|
-
return /* @__PURE__ */ (0,
|
|
15489
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
14959
15490
|
OptionLink,
|
|
14960
15491
|
{
|
|
14961
15492
|
href: hrefs.attr(attr.key, opt.value),
|
|
@@ -14973,11 +15504,11 @@ function ShopFilters({
|
|
|
14973
15504
|
);
|
|
14974
15505
|
}) }, attr.key);
|
|
14975
15506
|
}),
|
|
14976
|
-
showPriceGroup && /* @__PURE__ */ (0,
|
|
15507
|
+
showPriceGroup && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FilterFieldset, { legend: t.price, children: priceBands.map((band, i) => {
|
|
14977
15508
|
const isActive = active.priceMin === band.min && active.priceMax === band.max;
|
|
14978
15509
|
const nextMin = isActive ? void 0 : band.min;
|
|
14979
15510
|
const nextMax = isActive ? void 0 : band.max;
|
|
14980
|
-
return /* @__PURE__ */ (0,
|
|
15511
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
14981
15512
|
OptionLink,
|
|
14982
15513
|
{
|
|
14983
15514
|
href: hrefs.price(nextMin, nextMax),
|
|
@@ -14988,7 +15519,7 @@ function ShopFilters({
|
|
|
14988
15519
|
i
|
|
14989
15520
|
);
|
|
14990
15521
|
}) }),
|
|
14991
|
-
hasOnSale && /* @__PURE__ */ (0,
|
|
15522
|
+
hasOnSale && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
14992
15523
|
OptionLink,
|
|
14993
15524
|
{
|
|
14994
15525
|
href: hrefs.onSale(!active.onSale),
|
|
@@ -14997,7 +15528,7 @@ function ShopFilters({
|
|
|
14997
15528
|
onActivate: onChange ? () => onChange({ onSale: !active.onSale }) : void 0
|
|
14998
15529
|
}
|
|
14999
15530
|
),
|
|
15000
|
-
/* @__PURE__ */ (0,
|
|
15531
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
15001
15532
|
"a",
|
|
15002
15533
|
{
|
|
15003
15534
|
href: hrefs.clearAll(),
|
|
@@ -15013,8 +15544,8 @@ function ShopFilters({
|
|
|
15013
15544
|
}
|
|
15014
15545
|
|
|
15015
15546
|
// src/components/course-catalog-filters.tsx
|
|
15016
|
-
var
|
|
15017
|
-
var
|
|
15547
|
+
var import_utils18 = require("@reblu/site-ui/utils");
|
|
15548
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
15018
15549
|
var DEFAULT_COURSE_PRICE_BANDS = [
|
|
15019
15550
|
{ max: 5e3 },
|
|
15020
15551
|
{ min: 5e3, max: 15e3 },
|
|
@@ -15067,9 +15598,9 @@ function CourseCatalogFilters({
|
|
|
15067
15598
|
const showPrice = enabled.price !== false;
|
|
15068
15599
|
const isFree = Boolean(active.free);
|
|
15069
15600
|
if (!showCategories && !showInstructors && !showPrice) return null;
|
|
15070
|
-
return /* @__PURE__ */ (0,
|
|
15071
|
-
showCategories && /* @__PURE__ */ (0,
|
|
15072
|
-
/* @__PURE__ */ (0,
|
|
15601
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: (0, import_utils18.cn)("space-y-6", className), "data-slot": "course-catalog-filters", children: [
|
|
15602
|
+
showCategories && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(FilterFieldset, { legend: t.category, children: [
|
|
15603
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15073
15604
|
OptionLink,
|
|
15074
15605
|
{
|
|
15075
15606
|
href: categoryHref(void 0),
|
|
@@ -15081,7 +15612,7 @@ function CourseCatalogFilters({
|
|
|
15081
15612
|
sortedCategories.map((category) => {
|
|
15082
15613
|
const isActive = active.category === category.slug;
|
|
15083
15614
|
const next2 = isActive ? void 0 : category.slug;
|
|
15084
|
-
return /* @__PURE__ */ (0,
|
|
15615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15085
15616
|
OptionLink,
|
|
15086
15617
|
{
|
|
15087
15618
|
href: categoryHref(next2),
|
|
@@ -15093,8 +15624,8 @@ function CourseCatalogFilters({
|
|
|
15093
15624
|
);
|
|
15094
15625
|
})
|
|
15095
15626
|
] }),
|
|
15096
|
-
showInstructors && /* @__PURE__ */ (0,
|
|
15097
|
-
/* @__PURE__ */ (0,
|
|
15627
|
+
showInstructors && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(FilterFieldset, { legend: t.instructor, children: [
|
|
15628
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15098
15629
|
OptionLink,
|
|
15099
15630
|
{
|
|
15100
15631
|
href: hrefs.instructor(void 0),
|
|
@@ -15106,7 +15637,7 @@ function CourseCatalogFilters({
|
|
|
15106
15637
|
named.map((instructor) => {
|
|
15107
15638
|
const isActive = active.instructor === instructor.id;
|
|
15108
15639
|
const next2 = isActive ? void 0 : instructor.id;
|
|
15109
|
-
return /* @__PURE__ */ (0,
|
|
15640
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15110
15641
|
OptionLink,
|
|
15111
15642
|
{
|
|
15112
15643
|
href: hrefs.instructor(next2),
|
|
@@ -15118,8 +15649,8 @@ function CourseCatalogFilters({
|
|
|
15118
15649
|
);
|
|
15119
15650
|
})
|
|
15120
15651
|
] }),
|
|
15121
|
-
showPrice && /* @__PURE__ */ (0,
|
|
15122
|
-
/* @__PURE__ */ (0,
|
|
15652
|
+
showPrice && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(FilterFieldset, { legend: t.price, children: [
|
|
15653
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15123
15654
|
OptionLink,
|
|
15124
15655
|
{
|
|
15125
15656
|
href: hrefs.free(!isFree),
|
|
@@ -15134,7 +15665,7 @@ function CourseCatalogFilters({
|
|
|
15134
15665
|
const isActive = !isFree && active.priceMin === band.min && active.priceMax === band.max;
|
|
15135
15666
|
const nextMin = isActive ? void 0 : band.min;
|
|
15136
15667
|
const nextMax = isActive ? void 0 : band.max;
|
|
15137
|
-
return /* @__PURE__ */ (0,
|
|
15668
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15138
15669
|
OptionLink,
|
|
15139
15670
|
{
|
|
15140
15671
|
href: hrefs.price(nextMin, nextMax),
|
|
@@ -15146,7 +15677,7 @@ function CourseCatalogFilters({
|
|
|
15146
15677
|
);
|
|
15147
15678
|
})
|
|
15148
15679
|
] }),
|
|
15149
|
-
/* @__PURE__ */ (0,
|
|
15680
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15150
15681
|
"a",
|
|
15151
15682
|
{
|
|
15152
15683
|
href: hrefs.clearAll(),
|
|
@@ -15168,8 +15699,8 @@ function CourseCatalogFilters({
|
|
|
15168
15699
|
}
|
|
15169
15700
|
|
|
15170
15701
|
// src/components/cart-line-list.tsx
|
|
15171
|
-
var
|
|
15172
|
-
var
|
|
15702
|
+
var import_utils19 = require("@reblu/site-ui/utils");
|
|
15703
|
+
var import_jsx_runtime23 = (
|
|
15173
15704
|
// eslint-disable-next-line react/no-array-index-key -- entries are positional, SITE-built rows
|
|
15174
15705
|
require("react/jsx-runtime")
|
|
15175
15706
|
);
|
|
@@ -15185,17 +15716,17 @@ var DEFAULT_LABELS2 = {
|
|
|
15185
15716
|
function CartLineIncludes({ entries, note, className }) {
|
|
15186
15717
|
const hasNote = note != null && note !== false && note !== "";
|
|
15187
15718
|
if (entries.length === 0 && !hasNote) return null;
|
|
15188
|
-
return /* @__PURE__ */ (0,
|
|
15719
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
15189
15720
|
"div",
|
|
15190
15721
|
{
|
|
15191
|
-
className: (0,
|
|
15722
|
+
className: (0, import_utils19.cn)("mt-2 space-y-2 rounded-lg bg-muted px-4 py-3 text-sm", className),
|
|
15192
15723
|
"data-slot": "cart-line-includes",
|
|
15193
15724
|
children: [
|
|
15194
|
-
entries.length > 0 && /* @__PURE__ */ (0,
|
|
15195
|
-
/* @__PURE__ */ (0,
|
|
15196
|
-
/* @__PURE__ */ (0,
|
|
15725
|
+
entries.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("dl", { className: "grid grid-cols-[max-content_1fr] gap-x-4 gap-y-1.5", children: entries.map((entry, idx) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "contents", children: [
|
|
15726
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("dt", { className: "font-semibold text-muted-foreground", children: entry.label }),
|
|
15727
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("dd", { className: "m-0", children: entry.value })
|
|
15197
15728
|
] }, idx)) }),
|
|
15198
|
-
hasNote && /* @__PURE__ */ (0,
|
|
15729
|
+
hasNote && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-muted-foreground", children: note })
|
|
15199
15730
|
]
|
|
15200
15731
|
}
|
|
15201
15732
|
);
|
|
@@ -15224,9 +15755,9 @@ function CartLineList({
|
|
|
15224
15755
|
}) {
|
|
15225
15756
|
const t = { ...DEFAULT_LABELS2, ...labels };
|
|
15226
15757
|
const noticeContent = notice === true ? t.cancelledNotice : notice;
|
|
15227
|
-
return /* @__PURE__ */ (0,
|
|
15228
|
-
/* @__PURE__ */ (0,
|
|
15229
|
-
noticeContent != null && noticeContent !== false && /* @__PURE__ */ (0,
|
|
15758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: (0, import_utils19.cn)("space-y-4", className), "data-slot": "cart-line-list", children: [
|
|
15759
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { "aria-live": "polite", className: "sr-only", children: liveMessage }),
|
|
15760
|
+
noticeContent != null && noticeContent !== false && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
15230
15761
|
"div",
|
|
15231
15762
|
{
|
|
15232
15763
|
role: "status",
|
|
@@ -15235,34 +15766,34 @@ function CartLineList({
|
|
|
15235
15766
|
children: noticeContent
|
|
15236
15767
|
}
|
|
15237
15768
|
),
|
|
15238
|
-
/* @__PURE__ */ (0,
|
|
15769
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("ul", { className: "space-y-4", children: items.map((item) => {
|
|
15239
15770
|
const maxQty = item.maxStock ?? Infinity;
|
|
15240
15771
|
const atMax = item.quantity >= maxQty;
|
|
15241
15772
|
const atMin = item.quantity <= 1;
|
|
15242
15773
|
const message = lineMessage?.(item);
|
|
15243
15774
|
const includes = lineIncludes?.(item);
|
|
15244
|
-
return /* @__PURE__ */ (0,
|
|
15775
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
15245
15776
|
"li",
|
|
15246
15777
|
{
|
|
15247
15778
|
className: "flex gap-4 rounded-xl border border-border bg-card p-4",
|
|
15248
15779
|
children: [
|
|
15249
|
-
/* @__PURE__ */ (0,
|
|
15250
|
-
/* @__PURE__ */ (0,
|
|
15251
|
-
/* @__PURE__ */ (0,
|
|
15252
|
-
item.variantName && /* @__PURE__ */ (0,
|
|
15253
|
-
/* @__PURE__ */ (0,
|
|
15780
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "h-20 w-20 flex-shrink-0 overflow-hidden rounded-lg bg-muted", children: item.imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("img", { src: item.imageUrl, alt: item.name, className: "h-full w-full object-cover" }) : null }),
|
|
15781
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
15782
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "truncate text-sm font-semibold leading-tight", children: item.name }),
|
|
15783
|
+
item.variantName && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "mt-0.5 text-xs text-muted-foreground", children: item.variantName }),
|
|
15784
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("p", { className: "mt-1 text-sm text-muted-foreground", children: [
|
|
15254
15785
|
formatPrice(item.unitPrice, currencyCode, locale),
|
|
15255
15786
|
" ",
|
|
15256
15787
|
t.unitPriceSuffix
|
|
15257
15788
|
] }),
|
|
15258
|
-
/* @__PURE__ */ (0,
|
|
15789
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
15259
15790
|
"div",
|
|
15260
15791
|
{
|
|
15261
15792
|
role: "group",
|
|
15262
15793
|
"aria-label": t.quantityLabel,
|
|
15263
15794
|
className: "mt-3 flex items-center gap-3",
|
|
15264
15795
|
children: [
|
|
15265
|
-
/* @__PURE__ */ (0,
|
|
15796
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
15266
15797
|
"button",
|
|
15267
15798
|
{
|
|
15268
15799
|
type: "button",
|
|
@@ -15273,8 +15804,8 @@ function CartLineList({
|
|
|
15273
15804
|
children: "\u2212"
|
|
15274
15805
|
}
|
|
15275
15806
|
),
|
|
15276
|
-
/* @__PURE__ */ (0,
|
|
15277
|
-
/* @__PURE__ */ (0,
|
|
15807
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "w-8 text-center text-sm font-semibold tabular-nums", children: item.quantity }),
|
|
15808
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
15278
15809
|
"button",
|
|
15279
15810
|
{
|
|
15280
15811
|
type: "button",
|
|
@@ -15285,7 +15816,7 @@ function CartLineList({
|
|
|
15285
15816
|
children: "+"
|
|
15286
15817
|
}
|
|
15287
15818
|
),
|
|
15288
|
-
onRemove && /* @__PURE__ */ (0,
|
|
15819
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
15289
15820
|
"button",
|
|
15290
15821
|
{
|
|
15291
15822
|
type: "button",
|
|
@@ -15298,7 +15829,7 @@ function CartLineList({
|
|
|
15298
15829
|
]
|
|
15299
15830
|
}
|
|
15300
15831
|
),
|
|
15301
|
-
message != null && message !== false && /* @__PURE__ */ (0,
|
|
15832
|
+
message != null && message !== false && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
15302
15833
|
"p",
|
|
15303
15834
|
{
|
|
15304
15835
|
className: "mt-2 text-sm text-destructive",
|
|
@@ -15306,12 +15837,12 @@ function CartLineList({
|
|
|
15306
15837
|
children: message
|
|
15307
15838
|
}
|
|
15308
15839
|
),
|
|
15309
|
-
includes != null && includes !== false && /* @__PURE__ */ (0,
|
|
15310
|
-
/* @__PURE__ */ (0,
|
|
15840
|
+
includes != null && includes !== false && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("details", { className: "mt-2", "data-slot": "cart-line-list-includes", children: [
|
|
15841
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("summary", { className: "cursor-pointer text-sm font-semibold text-primary", children: t.includesSummary }),
|
|
15311
15842
|
includes
|
|
15312
15843
|
] })
|
|
15313
15844
|
] }),
|
|
15314
|
-
/* @__PURE__ */ (0,
|
|
15845
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex-shrink-0 text-right", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-base font-bold", children: formatPrice(item.unitPrice * item.quantity, currencyCode, locale) }) })
|
|
15315
15846
|
]
|
|
15316
15847
|
},
|
|
15317
15848
|
lineKey(item.productId, item.variantId)
|
|
@@ -15321,8 +15852,8 @@ function CartLineList({
|
|
|
15321
15852
|
}
|
|
15322
15853
|
|
|
15323
15854
|
// src/components/cart-summary.tsx
|
|
15324
|
-
var
|
|
15325
|
-
var
|
|
15855
|
+
var import_utils20 = require("@reblu/site-ui/utils");
|
|
15856
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
15326
15857
|
var DEFAULT_LABELS3 = {
|
|
15327
15858
|
subtotal: "Subtotal",
|
|
15328
15859
|
discountPrefix: "Descuento",
|
|
@@ -15352,37 +15883,37 @@ function CartSummary({
|
|
|
15352
15883
|
const hasDiscount = Boolean(discountAmount && discountAmount > 0);
|
|
15353
15884
|
const noticeContent = notice === true ? t.cancelledNotice : notice;
|
|
15354
15885
|
const hasNotice = noticeContent != null && noticeContent !== false;
|
|
15355
|
-
const breakdown = /* @__PURE__ */ (0,
|
|
15886
|
+
const breakdown = /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
15356
15887
|
"dl",
|
|
15357
15888
|
{
|
|
15358
|
-
className: (0,
|
|
15889
|
+
className: (0, import_utils20.cn)("space-y-2 text-sm", !hasNotice && className),
|
|
15359
15890
|
"data-slot": "cart-summary",
|
|
15360
15891
|
children: [
|
|
15361
|
-
/* @__PURE__ */ (0,
|
|
15362
|
-
/* @__PURE__ */ (0,
|
|
15363
|
-
/* @__PURE__ */ (0,
|
|
15892
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex justify-between text-muted-foreground", children: [
|
|
15893
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("dt", { children: t.subtotal }),
|
|
15894
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("dd", { children: formatPrice(subtotal, currencyCode, locale) })
|
|
15364
15895
|
] }),
|
|
15365
|
-
hasDiscount && /* @__PURE__ */ (0,
|
|
15366
|
-
/* @__PURE__ */ (0,
|
|
15367
|
-
/* @__PURE__ */ (0,
|
|
15896
|
+
hasDiscount && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex justify-between text-green-600 dark:text-green-400", children: [
|
|
15897
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("dt", { children: autoDiscount ? t.staffDiscountApplied : `${t.discountPrefix}${discountCode ? ` (${discountCode})` : ""}` }),
|
|
15898
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("dd", { children: [
|
|
15368
15899
|
"-",
|
|
15369
15900
|
formatPrice(discountAmount, currencyCode, locale)
|
|
15370
15901
|
] })
|
|
15371
15902
|
] }),
|
|
15372
|
-
shippingEnabled && /* @__PURE__ */ (0,
|
|
15373
|
-
/* @__PURE__ */ (0,
|
|
15374
|
-
/* @__PURE__ */ (0,
|
|
15903
|
+
shippingEnabled && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex justify-between text-muted-foreground", children: [
|
|
15904
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("dt", { children: t.shipping }),
|
|
15905
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("dd", { children: shipping == null || !Number.isFinite(shipping) ? t.shippingCalculated : shipping === 0 ? t.freeShipping : formatPrice(shipping, currencyCode, locale) })
|
|
15375
15906
|
] }),
|
|
15376
|
-
/* @__PURE__ */ (0,
|
|
15377
|
-
/* @__PURE__ */ (0,
|
|
15378
|
-
/* @__PURE__ */ (0,
|
|
15907
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex justify-between border-t border-border pt-2 text-base font-bold", children: [
|
|
15908
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("dt", { children: t.total }),
|
|
15909
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("dd", { children: formatPrice(total, currencyCode, locale) })
|
|
15379
15910
|
] })
|
|
15380
15911
|
]
|
|
15381
15912
|
}
|
|
15382
15913
|
);
|
|
15383
15914
|
if (!hasNotice) return breakdown;
|
|
15384
|
-
return /* @__PURE__ */ (0,
|
|
15385
|
-
/* @__PURE__ */ (0,
|
|
15915
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: (0, import_utils20.cn)("space-y-3", className), "data-slot": "cart-summary-wrapper", children: [
|
|
15916
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
15386
15917
|
"div",
|
|
15387
15918
|
{
|
|
15388
15919
|
role: "status",
|
|
@@ -15396,8 +15927,8 @@ function CartSummary({
|
|
|
15396
15927
|
}
|
|
15397
15928
|
|
|
15398
15929
|
// src/components/cart-adjustments-notice.tsx
|
|
15399
|
-
var
|
|
15400
|
-
var
|
|
15930
|
+
var import_utils21 = require("@reblu/site-ui/utils");
|
|
15931
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
15401
15932
|
var DEFAULT_LABELS4 = {
|
|
15402
15933
|
removed: (names) => names.length === 1 ? `Hemos quitado del carrito: ${names[0]}, ya no est\xE1 disponible.` : `Hemos quitado del carrito: ${names.join(", ")}, ya no est\xE1n disponibles.`,
|
|
15403
15934
|
quantityChanged: (name, quantity) => `Hemos ajustado la cantidad de ${name} a ${quantity} por el stock disponible.`,
|
|
@@ -15431,20 +15962,20 @@ function CartAdjustmentsNotice({
|
|
|
15431
15962
|
);
|
|
15432
15963
|
}
|
|
15433
15964
|
if (messages.length === 0) return null;
|
|
15434
|
-
return /* @__PURE__ */ (0,
|
|
15965
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
15435
15966
|
"div",
|
|
15436
15967
|
{
|
|
15437
15968
|
role: "status",
|
|
15438
|
-
className: (0,
|
|
15969
|
+
className: (0, import_utils21.cn)("rounded-lg border border-border bg-muted px-3 py-2 text-sm", className),
|
|
15439
15970
|
"data-slot": "cart-adjustments-notice",
|
|
15440
|
-
children: messages.length === 1 ? /* @__PURE__ */ (0,
|
|
15971
|
+
children: messages.length === 1 ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { children: messages[0] }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("ul", { className: "list-disc space-y-1 pl-4", children: messages.map((message, index) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("li", { children: message }, index)) })
|
|
15441
15972
|
}
|
|
15442
15973
|
);
|
|
15443
15974
|
}
|
|
15444
15975
|
|
|
15445
15976
|
// src/components/added-to-cart-toast.tsx
|
|
15446
|
-
var
|
|
15447
|
-
var
|
|
15977
|
+
var import_utils22 = require("@reblu/site-ui/utils");
|
|
15978
|
+
var import_jsx_runtime26 = (
|
|
15448
15979
|
// eslint-disable-next-line @next/next/no-img-element -- toast content, not a Next <Image> layout context
|
|
15449
15980
|
require("react/jsx-runtime")
|
|
15450
15981
|
);
|
|
@@ -15467,32 +15998,32 @@ function AddedToCartToast({
|
|
|
15467
15998
|
const message = status === "error" ? t.error : status === "outOfStock" ? t.outOfStock : t.success;
|
|
15468
15999
|
const hasThumbnail = Boolean(imageUrl && imageUrl.trim().length > 0);
|
|
15469
16000
|
const variant = status === "success" ? "success" : "error";
|
|
15470
|
-
return /* @__PURE__ */ (0,
|
|
16001
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
15471
16002
|
"div",
|
|
15472
16003
|
{
|
|
15473
16004
|
"data-slot": "added-to-cart-toast",
|
|
15474
16005
|
"data-variant": variant,
|
|
15475
|
-
className: (0,
|
|
16006
|
+
className: (0, import_utils22.cn)(
|
|
15476
16007
|
"flex items-center gap-3 rounded-xl border border-border bg-card p-3 text-sm shadow-lg",
|
|
15477
16008
|
variant === "success" && "border-green-600/30 dark:border-green-400/30",
|
|
15478
16009
|
variant === "error" && "border-destructive/30",
|
|
15479
16010
|
className
|
|
15480
16011
|
),
|
|
15481
16012
|
children: [
|
|
15482
|
-
hasThumbnail && /* @__PURE__ */ (0,
|
|
15483
|
-
/* @__PURE__ */ (0,
|
|
15484
|
-
/* @__PURE__ */ (0,
|
|
15485
|
-
/* @__PURE__ */ (0,
|
|
16013
|
+
hasThumbnail && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("img", { src: imageUrl, alt: productName, className: "h-10 w-10 flex-shrink-0 rounded-lg object-cover" }),
|
|
16014
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
16015
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "truncate font-semibold text-foreground", children: productName }),
|
|
16016
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "truncate text-muted-foreground", children: quantity && quantity > 1 ? `${message} \xB7 x${quantity}` : message })
|
|
15486
16017
|
] }),
|
|
15487
|
-
/* @__PURE__ */ (0,
|
|
16018
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("a", { href: cartHref, className: "text-sm font-semibold text-primary underline-offset-2 hover:underline", children: t.viewCart }) })
|
|
15488
16019
|
]
|
|
15489
16020
|
}
|
|
15490
16021
|
);
|
|
15491
16022
|
}
|
|
15492
16023
|
|
|
15493
16024
|
// src/components/checkout-login-prompt.tsx
|
|
15494
|
-
var
|
|
15495
|
-
var
|
|
16025
|
+
var import_utils23 = require("@reblu/site-ui/utils");
|
|
16026
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
15496
16027
|
var DEFAULT_LABELS6 = {
|
|
15497
16028
|
title: "Identificaci\xF3n",
|
|
15498
16029
|
description: "Introduce tu email para agilizar el proceso o contin\xFAa como invitado.",
|
|
@@ -15519,26 +16050,26 @@ function CheckoutLoginPrompt({
|
|
|
15519
16050
|
if (!open) return null;
|
|
15520
16051
|
const t = { ...DEFAULT_LABELS6, ...labels };
|
|
15521
16052
|
const isValidEmail = EMAIL_PATTERN.test(email.trim());
|
|
15522
|
-
return /* @__PURE__ */ (0,
|
|
15523
|
-
/* @__PURE__ */ (0,
|
|
15524
|
-
/* @__PURE__ */ (0,
|
|
16053
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
|
|
16054
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "fixed inset-0 z-50 bg-black/50", onClick: onClose, "aria-hidden": "true" }),
|
|
16055
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
15525
16056
|
"div",
|
|
15526
16057
|
{
|
|
15527
16058
|
role: "dialog",
|
|
15528
16059
|
"aria-modal": "true",
|
|
15529
16060
|
"aria-labelledby": "checkout-login-prompt-title",
|
|
15530
16061
|
"data-slot": "checkout-login-prompt",
|
|
15531
|
-
className: (0,
|
|
16062
|
+
className: (0, import_utils23.cn)(
|
|
15532
16063
|
"fixed left-1/2 top-1/2 z-50 w-full max-w-md -translate-x-1/2 -translate-y-1/2 space-y-5 rounded-2xl border border-border bg-background p-6 shadow-2xl",
|
|
15533
16064
|
className
|
|
15534
16065
|
),
|
|
15535
16066
|
children: [
|
|
15536
|
-
/* @__PURE__ */ (0,
|
|
15537
|
-
/* @__PURE__ */ (0,
|
|
15538
|
-
/* @__PURE__ */ (0,
|
|
15539
|
-
/* @__PURE__ */ (0,
|
|
16067
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
|
|
16068
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { children: [
|
|
16069
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h2", { id: "checkout-login-prompt-title", className: "text-xl font-bold", children: t.title }),
|
|
16070
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "mt-1 text-sm text-muted-foreground", children: t.description })
|
|
15540
16071
|
] }),
|
|
15541
|
-
/* @__PURE__ */ (0,
|
|
16072
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
15542
16073
|
"button",
|
|
15543
16074
|
{
|
|
15544
16075
|
type: "button",
|
|
@@ -15549,9 +16080,9 @@ function CheckoutLoginPrompt({
|
|
|
15549
16080
|
}
|
|
15550
16081
|
)
|
|
15551
16082
|
] }),
|
|
15552
|
-
/* @__PURE__ */ (0,
|
|
15553
|
-
/* @__PURE__ */ (0,
|
|
15554
|
-
/* @__PURE__ */ (0,
|
|
16083
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "space-y-2", children: [
|
|
16084
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("label", { htmlFor: "checkout-login-prompt-email", className: "text-sm font-medium", children: t.emailLabel }),
|
|
16085
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
15555
16086
|
"input",
|
|
15556
16087
|
{
|
|
15557
16088
|
id: "checkout-login-prompt-email",
|
|
@@ -15560,29 +16091,29 @@ function CheckoutLoginPrompt({
|
|
|
15560
16091
|
value: email,
|
|
15561
16092
|
onChange: (e) => onEmailChange(e.target.value),
|
|
15562
16093
|
placeholder: t.emailPlaceholder,
|
|
15563
|
-
className: (0,
|
|
16094
|
+
className: (0, import_utils23.cn)(
|
|
15564
16095
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
15565
16096
|
error ? "border-destructive" : "border-border focus:border-primary"
|
|
15566
16097
|
)
|
|
15567
16098
|
}
|
|
15568
16099
|
),
|
|
15569
|
-
error && /* @__PURE__ */ (0,
|
|
16100
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-xs text-destructive", children: error })
|
|
15570
16101
|
] }),
|
|
15571
|
-
/* @__PURE__ */ (0,
|
|
15572
|
-
/* @__PURE__ */ (0,
|
|
16102
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "space-y-2", children: [
|
|
16103
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
15573
16104
|
"button",
|
|
15574
16105
|
{
|
|
15575
16106
|
type: "button",
|
|
15576
16107
|
onClick: onSubmitEmail,
|
|
15577
16108
|
disabled: checking || !isValidEmail,
|
|
15578
|
-
className: (0,
|
|
16109
|
+
className: (0, import_utils23.cn)(
|
|
15579
16110
|
"flex w-full cursor-pointer items-center justify-center gap-2 rounded-xl px-4 py-2.5 text-sm font-semibold transition-all",
|
|
15580
16111
|
checking || !isValidEmail ? "cursor-not-allowed bg-muted text-muted-foreground" : "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
15581
16112
|
),
|
|
15582
16113
|
children: checking ? t.checking : t.continueWithEmail
|
|
15583
16114
|
}
|
|
15584
16115
|
),
|
|
15585
|
-
/* @__PURE__ */ (0,
|
|
16116
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
15586
16117
|
"button",
|
|
15587
16118
|
{
|
|
15588
16119
|
type: "button",
|
|
@@ -15599,9 +16130,9 @@ function CheckoutLoginPrompt({
|
|
|
15599
16130
|
}
|
|
15600
16131
|
|
|
15601
16132
|
// src/components/checkout-form.tsx
|
|
15602
|
-
var
|
|
16133
|
+
var import_utils24 = require("@reblu/site-ui/utils");
|
|
15603
16134
|
var import_phone_input = require("@reblu/site-ui/phone-input");
|
|
15604
|
-
var
|
|
16135
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
15605
16136
|
var DEFAULT_LABELS7 = {
|
|
15606
16137
|
contactTitle: "Datos de contacto",
|
|
15607
16138
|
nameLabel: "Nombre completo",
|
|
@@ -15657,22 +16188,22 @@ function CheckoutForm({
|
|
|
15657
16188
|
event.preventDefault();
|
|
15658
16189
|
if (discountCode.trim() && !discountApplying) onApplyDiscount();
|
|
15659
16190
|
}
|
|
15660
|
-
return /* @__PURE__ */ (0,
|
|
16191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
15661
16192
|
loginPrompt,
|
|
15662
|
-
/* @__PURE__ */ (0,
|
|
16193
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
15663
16194
|
"form",
|
|
15664
16195
|
{
|
|
15665
16196
|
"data-testid": "checkout-form",
|
|
15666
16197
|
onSubmit,
|
|
15667
|
-
className: (0,
|
|
16198
|
+
className: (0, import_utils24.cn)("space-y-8", className),
|
|
15668
16199
|
"data-slot": "checkout-form",
|
|
15669
16200
|
children: [
|
|
15670
|
-
/* @__PURE__ */ (0,
|
|
15671
|
-
/* @__PURE__ */ (0,
|
|
15672
|
-
/* @__PURE__ */ (0,
|
|
15673
|
-
/* @__PURE__ */ (0,
|
|
15674
|
-
/* @__PURE__ */ (0,
|
|
15675
|
-
/* @__PURE__ */ (0,
|
|
16201
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("section", { className: "space-y-4", children: [
|
|
16202
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("h2", { className: "border-b border-border pb-2 text-lg font-semibold", children: t.contactTitle }),
|
|
16203
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
|
|
16204
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "space-y-1", children: [
|
|
16205
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("label", { htmlFor: "checkout-form-name", className: "text-sm font-medium", children: t.nameLabel }),
|
|
16206
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
15676
16207
|
"input",
|
|
15677
16208
|
{
|
|
15678
16209
|
id: "checkout-form-name",
|
|
@@ -15681,17 +16212,17 @@ function CheckoutForm({
|
|
|
15681
16212
|
value: contact.name,
|
|
15682
16213
|
onChange: (e) => patchContact({ name: e.target.value }),
|
|
15683
16214
|
placeholder: t.namePlaceholder,
|
|
15684
|
-
className: (0,
|
|
16215
|
+
className: (0, import_utils24.cn)(
|
|
15685
16216
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
15686
16217
|
contactErrors?.name ? "border-destructive" : "border-border focus:border-primary"
|
|
15687
16218
|
)
|
|
15688
16219
|
}
|
|
15689
16220
|
),
|
|
15690
|
-
contactErrors?.name && /* @__PURE__ */ (0,
|
|
16221
|
+
contactErrors?.name && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "text-xs text-destructive", children: contactErrors.name })
|
|
15691
16222
|
] }),
|
|
15692
|
-
/* @__PURE__ */ (0,
|
|
15693
|
-
/* @__PURE__ */ (0,
|
|
15694
|
-
/* @__PURE__ */ (0,
|
|
16223
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "space-y-1", children: [
|
|
16224
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("label", { htmlFor: "checkout-form-email", className: "text-sm font-medium", children: t.emailLabel }),
|
|
16225
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
15695
16226
|
"input",
|
|
15696
16227
|
{
|
|
15697
16228
|
id: "checkout-form-email",
|
|
@@ -15700,15 +16231,15 @@ function CheckoutForm({
|
|
|
15700
16231
|
value: contact.email,
|
|
15701
16232
|
onChange: (e) => patchContact({ email: e.target.value }),
|
|
15702
16233
|
placeholder: t.emailPlaceholder,
|
|
15703
|
-
className: (0,
|
|
16234
|
+
className: (0, import_utils24.cn)(
|
|
15704
16235
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
15705
16236
|
contactErrors?.email ? "border-destructive" : "border-border focus:border-primary"
|
|
15706
16237
|
)
|
|
15707
16238
|
}
|
|
15708
16239
|
),
|
|
15709
|
-
contactErrors?.email && /* @__PURE__ */ (0,
|
|
16240
|
+
contactErrors?.email && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "text-xs text-destructive", children: contactErrors.email })
|
|
15710
16241
|
] }),
|
|
15711
|
-
/* @__PURE__ */ (0,
|
|
16242
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
15712
16243
|
import_phone_input.PhoneInput,
|
|
15713
16244
|
{
|
|
15714
16245
|
id: "checkout-form-phone",
|
|
@@ -15722,26 +16253,26 @@ function CheckoutForm({
|
|
|
15722
16253
|
] })
|
|
15723
16254
|
] }),
|
|
15724
16255
|
children2,
|
|
15725
|
-
generalError ? /* @__PURE__ */ (0,
|
|
15726
|
-
/* @__PURE__ */ (0,
|
|
15727
|
-
/* @__PURE__ */ (0,
|
|
15728
|
-
autoDiscount ? /* @__PURE__ */ (0,
|
|
16256
|
+
generalError ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { role: "alert", className: "text-sm text-destructive", children: generalError }) : null,
|
|
16257
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("section", { className: "space-y-3", children: [
|
|
16258
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("h2", { className: "border-b border-border pb-2 text-lg font-semibold", children: t.discountTitle }),
|
|
16259
|
+
autoDiscount ? /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
15729
16260
|
"div",
|
|
15730
16261
|
{
|
|
15731
16262
|
className: "flex items-center gap-2 rounded-lg border border-green-200 bg-green-50 px-4 py-3 text-sm text-green-700 dark:border-green-800 dark:bg-green-900/20 dark:text-green-400",
|
|
15732
16263
|
"data-slot": "checkout-staff-discount",
|
|
15733
16264
|
children: [
|
|
15734
|
-
/* @__PURE__ */ (0,
|
|
15735
|
-
/* @__PURE__ */ (0,
|
|
16265
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "font-semibold", children: t.staffDiscountApplied }),
|
|
16266
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: t.discountAppliedSuffix(formatPrice(autoDiscount.amount, currencyCode, locale)) })
|
|
15736
16267
|
]
|
|
15737
16268
|
}
|
|
15738
16269
|
) : null,
|
|
15739
|
-
appliedDiscount && !autoDiscount ? /* @__PURE__ */ (0,
|
|
15740
|
-
/* @__PURE__ */ (0,
|
|
15741
|
-
/* @__PURE__ */ (0,
|
|
15742
|
-
/* @__PURE__ */ (0,
|
|
16270
|
+
appliedDiscount && !autoDiscount ? /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center justify-between rounded-lg border border-green-200 bg-green-50 px-4 py-3 dark:border-green-800 dark:bg-green-900/20", children: [
|
|
16271
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center gap-2 text-sm text-green-700 dark:text-green-400", children: [
|
|
16272
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "font-semibold", children: appliedDiscount.code }),
|
|
16273
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: t.discountAppliedSuffix(formatPrice(appliedDiscount.amount, currencyCode, locale)) })
|
|
15743
16274
|
] }),
|
|
15744
|
-
/* @__PURE__ */ (0,
|
|
16275
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
15745
16276
|
"button",
|
|
15746
16277
|
{
|
|
15747
16278
|
type: "button",
|
|
@@ -15751,9 +16282,9 @@ function CheckoutForm({
|
|
|
15751
16282
|
children: t.removeDiscount
|
|
15752
16283
|
}
|
|
15753
16284
|
)
|
|
15754
|
-
] }) : /* @__PURE__ */ (0,
|
|
15755
|
-
/* @__PURE__ */ (0,
|
|
15756
|
-
/* @__PURE__ */ (0,
|
|
16285
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex gap-2", children: [
|
|
16286
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("label", { htmlFor: "checkout-form-discount-code", className: "sr-only", children: t.discountTitle }),
|
|
16287
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
15757
16288
|
"input",
|
|
15758
16289
|
{
|
|
15759
16290
|
id: "checkout-form-discount-code",
|
|
@@ -15765,7 +16296,7 @@ function CheckoutForm({
|
|
|
15765
16296
|
className: "flex-1 rounded-lg border border-border bg-background px-3 py-2 text-sm uppercase transition focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/20"
|
|
15766
16297
|
}
|
|
15767
16298
|
),
|
|
15768
|
-
/* @__PURE__ */ (0,
|
|
16299
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
15769
16300
|
"button",
|
|
15770
16301
|
{
|
|
15771
16302
|
type: "button",
|
|
@@ -15776,14 +16307,14 @@ function CheckoutForm({
|
|
|
15776
16307
|
}
|
|
15777
16308
|
)
|
|
15778
16309
|
] }),
|
|
15779
|
-
discountError && /* @__PURE__ */ (0,
|
|
16310
|
+
discountError && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "text-xs text-destructive", children: discountError })
|
|
15780
16311
|
] }),
|
|
15781
|
-
/* @__PURE__ */ (0,
|
|
16312
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
15782
16313
|
"button",
|
|
15783
16314
|
{
|
|
15784
16315
|
type: "submit",
|
|
15785
16316
|
disabled: submitting || submitDisabled,
|
|
15786
|
-
className: (0,
|
|
16317
|
+
className: (0, import_utils24.cn)(
|
|
15787
16318
|
"flex w-full cursor-pointer items-center justify-center gap-2 rounded-xl px-4 py-3 font-semibold transition-all",
|
|
15788
16319
|
submitting || submitDisabled ? "cursor-not-allowed bg-muted text-muted-foreground" : "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
15789
16320
|
),
|
|
@@ -15797,11 +16328,11 @@ function CheckoutForm({
|
|
|
15797
16328
|
}
|
|
15798
16329
|
|
|
15799
16330
|
// src/components/order-confirmation.tsx
|
|
15800
|
-
var
|
|
16331
|
+
var import_utils26 = require("@reblu/site-ui/utils");
|
|
15801
16332
|
|
|
15802
16333
|
// src/components/order-invoice-link.tsx
|
|
15803
|
-
var
|
|
15804
|
-
var
|
|
16334
|
+
var import_utils25 = require("@reblu/site-ui/utils");
|
|
16335
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
15805
16336
|
var DEFAULT_LABELS8 = {
|
|
15806
16337
|
linkLabel: "Descargar la factura {number}",
|
|
15807
16338
|
signInHint: "Te pediremos que inicies sesi\xF3n para abrirla."
|
|
@@ -15809,8 +16340,8 @@ var DEFAULT_LABELS8 = {
|
|
|
15809
16340
|
function OrderInvoiceLink({ invoice, labels, className }) {
|
|
15810
16341
|
if (!invoice) return null;
|
|
15811
16342
|
const t = { ...DEFAULT_LABELS8, ...labels };
|
|
15812
|
-
return /* @__PURE__ */ (0,
|
|
15813
|
-
/* @__PURE__ */ (0,
|
|
16343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: (0, import_utils25.cn)("space-y-1 text-sm", className), "data-slot": "order-invoice-link", children: [
|
|
16344
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
15814
16345
|
"a",
|
|
15815
16346
|
{
|
|
15816
16347
|
href: invoice.url,
|
|
@@ -15818,19 +16349,21 @@ function OrderInvoiceLink({ invoice, labels, className }) {
|
|
|
15818
16349
|
children: t.linkLabel.replace("{number}", invoice.number)
|
|
15819
16350
|
}
|
|
15820
16351
|
),
|
|
15821
|
-
/* @__PURE__ */ (0,
|
|
16352
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "text-muted-foreground", children: t.signInHint })
|
|
15822
16353
|
] });
|
|
15823
16354
|
}
|
|
15824
16355
|
|
|
15825
16356
|
// src/components/order-confirmation.tsx
|
|
15826
|
-
var
|
|
16357
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
15827
16358
|
var DEFAULT_LABELS9 = {
|
|
15828
16359
|
pollingTitle: "Confirmando tu pedido\u2026",
|
|
15829
16360
|
pollingDescription: "Estamos procesando el pago, un momento\u2026",
|
|
15830
16361
|
foundTitle: "\xA1Pedido confirmado!",
|
|
15831
|
-
// REB-
|
|
15832
|
-
//
|
|
15833
|
-
|
|
16362
|
+
// REB-1200 (owner OK 6-Nov): no «con tu acceso» sentence — buyers who
|
|
16363
|
+
// already have an account (staff, returning clients) get no new access.
|
|
16364
|
+
// `{number}` and `{email}` come from the order. Files are never served here.
|
|
16365
|
+
foundDescription: "Tu pedido {number} est\xE1 confirmado. Te hemos enviado el resumen a {email}.",
|
|
16366
|
+
foundWithoutOrderDescription: "Tu pedido est\xE1 confirmado.",
|
|
15834
16367
|
timeoutTitle: "Pago recibido",
|
|
15835
16368
|
timeoutDescription: "Tu pago se ha procesado. Recibir\xE1s un email de confirmaci\xF3n en breve.",
|
|
15836
16369
|
orderNumberLabel: "Pedido confirmado",
|
|
@@ -15856,6 +16389,12 @@ var DEFAULT_LABELS9 = {
|
|
|
15856
16389
|
invoiceLinkLabel: "Descargar la factura {number}",
|
|
15857
16390
|
invoiceSignInHint: "Te pediremos que inicies sesi\xF3n para abrirla."
|
|
15858
16391
|
};
|
|
16392
|
+
function foundDescription(t, order) {
|
|
16393
|
+
const template = t.foundDescription;
|
|
16394
|
+
if (!/\{(number|email)\}/.test(template)) return template;
|
|
16395
|
+
if (!order) return t.foundWithoutOrderDescription;
|
|
16396
|
+
return template.replaceAll("{number}", order.orderNumber).replaceAll("{email}", order.customerEmail);
|
|
16397
|
+
}
|
|
15859
16398
|
function OrderConfirmation({
|
|
15860
16399
|
status,
|
|
15861
16400
|
order,
|
|
@@ -15882,50 +16421,50 @@ function OrderConfirmation({
|
|
|
15882
16421
|
}
|
|
15883
16422
|
if (status === "not_found") return { title: t.notFoundTitle, description: t.notFoundDescription };
|
|
15884
16423
|
if (status === "error") return { title: t.errorTitle, description: t.errorDescription };
|
|
15885
|
-
if (isFound || order) return { title: t.foundTitle, description: t
|
|
16424
|
+
if (isFound || order) return { title: t.foundTitle, description: foundDescription(t, order) };
|
|
15886
16425
|
return { title: t.timeoutTitle, description: t.timeoutDescription };
|
|
15887
16426
|
})();
|
|
15888
16427
|
const showFullOrderSummary = Boolean(order) && (isFound || status === "timeout");
|
|
15889
16428
|
const showOrderReference = Boolean(order) && !showFullOrderSummary && (status === "refunded" || status === "partially_refunded" || status === "pending_timeout");
|
|
15890
16429
|
const showSessionReference = !order && sessionId && (status === "timeout" || status === "not_found" || status === "pending_timeout");
|
|
15891
16430
|
const showRecheck = (status === "pending_timeout" || status === "error") && onRecheck;
|
|
15892
|
-
return /* @__PURE__ */ (0,
|
|
15893
|
-
/* @__PURE__ */ (0,
|
|
15894
|
-
/* @__PURE__ */ (0,
|
|
15895
|
-
showFullOrderSummary && order && /* @__PURE__ */ (0,
|
|
15896
|
-
/* @__PURE__ */ (0,
|
|
15897
|
-
/* @__PURE__ */ (0,
|
|
15898
|
-
/* @__PURE__ */ (0,
|
|
16431
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: (0, import_utils26.cn)("space-y-6 text-center", className), "data-slot": "order-confirmation", children: [
|
|
16432
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h1", { className: "text-3xl font-bold", children: title }),
|
|
16433
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "text-lg text-muted-foreground", children: description }),
|
|
16434
|
+
showFullOrderSummary && order && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "space-y-6", children: [
|
|
16435
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
16436
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.orderNumberLabel }),
|
|
16437
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "font-mono text-lg font-semibold", children: order.orderNumber })
|
|
15899
16438
|
] }),
|
|
15900
|
-
/* @__PURE__ */ (0,
|
|
15901
|
-
order.items.map((item, idx) => /* @__PURE__ */ (0,
|
|
16439
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "mx-auto max-w-sm space-y-3 rounded-xl border border-border bg-card p-5 text-left", children: [
|
|
16440
|
+
order.items.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
15902
16441
|
"div",
|
|
15903
16442
|
{
|
|
15904
16443
|
className: "flex justify-between gap-4 text-sm",
|
|
15905
16444
|
children: [
|
|
15906
|
-
/* @__PURE__ */ (0,
|
|
16445
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { className: "max-w-[60%] truncate text-muted-foreground", children: [
|
|
15907
16446
|
item.product.name,
|
|
15908
16447
|
item.variant ? ` (${item.variant.name})` : "",
|
|
15909
16448
|
" x",
|
|
15910
16449
|
item.quantity
|
|
15911
16450
|
] }),
|
|
15912
|
-
/* @__PURE__ */ (0,
|
|
16451
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: formatPrice(item.total, currencyCode, locale) })
|
|
15913
16452
|
]
|
|
15914
16453
|
},
|
|
15915
16454
|
idx
|
|
15916
16455
|
)),
|
|
15917
|
-
/* @__PURE__ */ (0,
|
|
15918
|
-
/* @__PURE__ */ (0,
|
|
15919
|
-
/* @__PURE__ */ (0,
|
|
16456
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "space-y-1 border-t border-border pt-3 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex justify-between pt-1 text-base font-bold", children: [
|
|
16457
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: t.totalLabel }),
|
|
16458
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: formatPrice(order.total, currencyCode, locale) })
|
|
15920
16459
|
] }) })
|
|
15921
16460
|
] }),
|
|
15922
|
-
/* @__PURE__ */ (0,
|
|
16461
|
+
t.foundDescription.includes("{email}") ? null : /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("p", { className: "mx-auto max-w-sm text-sm text-muted-foreground", children: [
|
|
15923
16462
|
t.confirmationEmailPrefix,
|
|
15924
16463
|
" ",
|
|
15925
|
-
/* @__PURE__ */ (0,
|
|
16464
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "font-medium text-foreground", children: order.customerEmail }),
|
|
15926
16465
|
"."
|
|
15927
16466
|
] }),
|
|
15928
|
-
/* @__PURE__ */ (0,
|
|
16467
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
15929
16468
|
OrderInvoiceLink,
|
|
15930
16469
|
{
|
|
15931
16470
|
invoice: order.invoice,
|
|
@@ -15933,11 +16472,11 @@ function OrderConfirmation({
|
|
|
15933
16472
|
}
|
|
15934
16473
|
)
|
|
15935
16474
|
] }),
|
|
15936
|
-
showOrderReference && order && /* @__PURE__ */ (0,
|
|
15937
|
-
/* @__PURE__ */ (0,
|
|
15938
|
-
/* @__PURE__ */ (0,
|
|
16475
|
+
showOrderReference && order && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
16476
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.orderReferenceLabel }),
|
|
16477
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "font-mono text-lg font-semibold", children: order.orderNumber })
|
|
15939
16478
|
] }),
|
|
15940
|
-
status === "failed" && cartHref && /* @__PURE__ */ (0,
|
|
16479
|
+
status === "failed" && cartHref && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
15941
16480
|
"a",
|
|
15942
16481
|
{
|
|
15943
16482
|
href: cartHref,
|
|
@@ -15945,7 +16484,7 @@ function OrderConfirmation({
|
|
|
15945
16484
|
children: t.backToCartLabel
|
|
15946
16485
|
}
|
|
15947
16486
|
),
|
|
15948
|
-
showRecheck && /* @__PURE__ */ (0,
|
|
16487
|
+
showRecheck && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
15949
16488
|
"button",
|
|
15950
16489
|
{
|
|
15951
16490
|
type: "button",
|
|
@@ -15954,16 +16493,16 @@ function OrderConfirmation({
|
|
|
15954
16493
|
children: t.recheckLabel
|
|
15955
16494
|
}
|
|
15956
16495
|
),
|
|
15957
|
-
showSessionReference && /* @__PURE__ */ (0,
|
|
15958
|
-
/* @__PURE__ */ (0,
|
|
15959
|
-
/* @__PURE__ */ (0,
|
|
16496
|
+
showSessionReference && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
16497
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.sessionReferenceLabel }),
|
|
16498
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "break-all font-mono text-sm font-semibold", children: sessionId })
|
|
15960
16499
|
] })
|
|
15961
16500
|
] });
|
|
15962
16501
|
}
|
|
15963
16502
|
|
|
15964
16503
|
// src/components/full-invoice-fields.tsx
|
|
15965
|
-
var
|
|
15966
|
-
var
|
|
16504
|
+
var import_utils27 = require("@reblu/site-ui/utils");
|
|
16505
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
15967
16506
|
var EMPTY_FULL_INVOICE_VALUE = {
|
|
15968
16507
|
wantsFullInvoice: false,
|
|
15969
16508
|
billingIdType: "NIF",
|
|
@@ -16080,12 +16619,12 @@ function FullInvoiceFields({
|
|
|
16080
16619
|
const showFields = value.wantsFullInvoice || overCap;
|
|
16081
16620
|
const isSpanishNif = value.billingIdType === "NIF";
|
|
16082
16621
|
const set = (key2, next2) => onChange({ ...value, [key2]: next2 });
|
|
16083
|
-
const error = (key2) => errors[key2] ? /* @__PURE__ */ (0,
|
|
16622
|
+
const error = (key2) => errors[key2] ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { id: `full-invoice-${key2}-error`, className: "text-sm text-destructive", children: errors[key2] }) : null;
|
|
16084
16623
|
const invalid2 = (key2) => errors[key2] ? { "aria-invalid": true, "aria-describedby": `full-invoice-${key2}-error` } : {};
|
|
16085
|
-
return /* @__PURE__ */ (0,
|
|
16086
|
-
overCap ? /* @__PURE__ */ (0,
|
|
16087
|
-
/* @__PURE__ */ (0,
|
|
16088
|
-
/* @__PURE__ */ (0,
|
|
16624
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("section", { className: (0, import_utils27.cn)("space-y-4", className), "data-slot": "full-invoice-fields", children: [
|
|
16625
|
+
overCap ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { role: "note", className: "rounded-lg border border-border p-4 text-sm", children: t.overCapNotice }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "space-y-1", children: [
|
|
16626
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { className: "flex items-center gap-2 text-sm font-medium", children: [
|
|
16627
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
16089
16628
|
"input",
|
|
16090
16629
|
{
|
|
16091
16630
|
type: "checkbox",
|
|
@@ -16095,12 +16634,12 @@ function FullInvoiceFields({
|
|
|
16095
16634
|
),
|
|
16096
16635
|
t.toggle
|
|
16097
16636
|
] }),
|
|
16098
|
-
/* @__PURE__ */ (0,
|
|
16637
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-sm text-muted-foreground", children: t.underCapNotice })
|
|
16099
16638
|
] }),
|
|
16100
|
-
showFields && /* @__PURE__ */ (0,
|
|
16101
|
-
/* @__PURE__ */ (0,
|
|
16102
|
-
/* @__PURE__ */ (0,
|
|
16103
|
-
/* @__PURE__ */ (0,
|
|
16639
|
+
showFields && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
|
|
16640
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "space-y-1", children: [
|
|
16641
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("label", { htmlFor: "full-invoice-id-type", className: "text-sm font-medium", children: t.idType }),
|
|
16642
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
16104
16643
|
"select",
|
|
16105
16644
|
{
|
|
16106
16645
|
id: "full-invoice-id-type",
|
|
@@ -16109,14 +16648,14 @@ function FullInvoiceFields({
|
|
|
16109
16648
|
value: value.billingIdType,
|
|
16110
16649
|
onChange: (e) => set("billingIdType", e.target.value),
|
|
16111
16650
|
...invalid2("billingIdType"),
|
|
16112
|
-
children: ID_TYPES.map((type) => /* @__PURE__ */ (0,
|
|
16651
|
+
children: ID_TYPES.map((type) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: type, children: t.idTypeOptions[type] }, type))
|
|
16113
16652
|
}
|
|
16114
16653
|
),
|
|
16115
16654
|
error("billingIdType")
|
|
16116
16655
|
] }),
|
|
16117
|
-
!isSpanishNif && /* @__PURE__ */ (0,
|
|
16118
|
-
/* @__PURE__ */ (0,
|
|
16119
|
-
/* @__PURE__ */ (0,
|
|
16656
|
+
!isSpanishNif && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "space-y-1", children: [
|
|
16657
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("label", { htmlFor: "full-invoice-id-country", className: "text-sm font-medium", children: t.idCountry }),
|
|
16658
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
16120
16659
|
"select",
|
|
16121
16660
|
{
|
|
16122
16661
|
id: "full-invoice-id-country",
|
|
@@ -16126,16 +16665,16 @@ function FullInvoiceFields({
|
|
|
16126
16665
|
onChange: (e) => set("billingIdCountry", e.target.value),
|
|
16127
16666
|
...invalid2("billingIdCountry"),
|
|
16128
16667
|
children: [
|
|
16129
|
-
/* @__PURE__ */ (0,
|
|
16130
|
-
countries.map((c) => /* @__PURE__ */ (0,
|
|
16668
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: "", disabled: true, children: t.chooseCountry }),
|
|
16669
|
+
countries.map((c) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: c.code, children: c.name }, c.code))
|
|
16131
16670
|
]
|
|
16132
16671
|
}
|
|
16133
16672
|
),
|
|
16134
16673
|
error("billingIdCountry")
|
|
16135
16674
|
] }),
|
|
16136
|
-
/* @__PURE__ */ (0,
|
|
16137
|
-
/* @__PURE__ */ (0,
|
|
16138
|
-
/* @__PURE__ */ (0,
|
|
16675
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "space-y-1", children: [
|
|
16676
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("label", { htmlFor: "full-invoice-nif", className: "text-sm font-medium", children: isSpanishNif ? t.spanishNif : t.documentNumber }),
|
|
16677
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
16139
16678
|
"input",
|
|
16140
16679
|
{
|
|
16141
16680
|
id: "full-invoice-nif",
|
|
@@ -16148,9 +16687,9 @@ function FullInvoiceFields({
|
|
|
16148
16687
|
),
|
|
16149
16688
|
error("billingNif")
|
|
16150
16689
|
] }),
|
|
16151
|
-
/* @__PURE__ */ (0,
|
|
16152
|
-
/* @__PURE__ */ (0,
|
|
16153
|
-
/* @__PURE__ */ (0,
|
|
16690
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "space-y-1", children: [
|
|
16691
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("label", { htmlFor: "full-invoice-name", className: "text-sm font-medium", children: t.name }),
|
|
16692
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
16154
16693
|
"input",
|
|
16155
16694
|
{
|
|
16156
16695
|
id: "full-invoice-name",
|
|
@@ -16163,9 +16702,9 @@ function FullInvoiceFields({
|
|
|
16163
16702
|
),
|
|
16164
16703
|
error("billingName")
|
|
16165
16704
|
] }),
|
|
16166
|
-
/* @__PURE__ */ (0,
|
|
16167
|
-
/* @__PURE__ */ (0,
|
|
16168
|
-
/* @__PURE__ */ (0,
|
|
16705
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "space-y-1 sm:col-span-2", children: [
|
|
16706
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("label", { htmlFor: "full-invoice-street", className: "text-sm font-medium", children: t.street }),
|
|
16707
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
16169
16708
|
"input",
|
|
16170
16709
|
{
|
|
16171
16710
|
id: "full-invoice-street",
|
|
@@ -16177,9 +16716,9 @@ function FullInvoiceFields({
|
|
|
16177
16716
|
}
|
|
16178
16717
|
)
|
|
16179
16718
|
] }),
|
|
16180
|
-
/* @__PURE__ */ (0,
|
|
16181
|
-
/* @__PURE__ */ (0,
|
|
16182
|
-
/* @__PURE__ */ (0,
|
|
16719
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "space-y-1", children: [
|
|
16720
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("label", { htmlFor: "full-invoice-postal-code", className: "text-sm font-medium", children: t.postalCode }),
|
|
16721
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
16183
16722
|
"input",
|
|
16184
16723
|
{
|
|
16185
16724
|
id: "full-invoice-postal-code",
|
|
@@ -16190,9 +16729,9 @@ function FullInvoiceFields({
|
|
|
16190
16729
|
}
|
|
16191
16730
|
)
|
|
16192
16731
|
] }),
|
|
16193
|
-
/* @__PURE__ */ (0,
|
|
16194
|
-
/* @__PURE__ */ (0,
|
|
16195
|
-
/* @__PURE__ */ (0,
|
|
16732
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "space-y-1", children: [
|
|
16733
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("label", { htmlFor: "full-invoice-city", className: "text-sm font-medium", children: t.city }),
|
|
16734
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
16196
16735
|
"input",
|
|
16197
16736
|
{
|
|
16198
16737
|
id: "full-invoice-city",
|
|
@@ -16203,9 +16742,9 @@ function FullInvoiceFields({
|
|
|
16203
16742
|
}
|
|
16204
16743
|
)
|
|
16205
16744
|
] }),
|
|
16206
|
-
/* @__PURE__ */ (0,
|
|
16207
|
-
/* @__PURE__ */ (0,
|
|
16208
|
-
/* @__PURE__ */ (0,
|
|
16745
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "space-y-1", children: [
|
|
16746
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("label", { htmlFor: "full-invoice-country", className: "text-sm font-medium", children: t.country }),
|
|
16747
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
16209
16748
|
"select",
|
|
16210
16749
|
{
|
|
16211
16750
|
id: "full-invoice-country",
|
|
@@ -16213,18 +16752,18 @@ function FullInvoiceFields({
|
|
|
16213
16752
|
required: true,
|
|
16214
16753
|
value: value.country,
|
|
16215
16754
|
onChange: (e) => set("country", e.target.value),
|
|
16216
|
-
children: countries.map((c) => /* @__PURE__ */ (0,
|
|
16755
|
+
children: countries.map((c) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: c.code, children: c.name }, c.code))
|
|
16217
16756
|
}
|
|
16218
16757
|
)
|
|
16219
16758
|
] }),
|
|
16220
|
-
/* @__PURE__ */ (0,
|
|
16759
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "sm:col-span-2", children: error("address") })
|
|
16221
16760
|
] })
|
|
16222
16761
|
] });
|
|
16223
16762
|
}
|
|
16224
16763
|
|
|
16225
16764
|
// src/components/checkout-delivery-choice.tsx
|
|
16226
|
-
var
|
|
16227
|
-
var
|
|
16765
|
+
var import_utils28 = require("@reblu/site-ui/utils");
|
|
16766
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
16228
16767
|
var EMPTY_CHECKOUT_ADDRESS = {
|
|
16229
16768
|
firstName: "",
|
|
16230
16769
|
lastName: "",
|
|
@@ -16287,17 +16826,17 @@ function CheckoutDeliveryChoice({
|
|
|
16287
16826
|
const isPickup = value?.type === "PICKUP";
|
|
16288
16827
|
const isShipping = value?.type === "SHIPPING";
|
|
16289
16828
|
const errorId = `${uid}-delivery-error`;
|
|
16290
|
-
return /* @__PURE__ */ (0,
|
|
16829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
16291
16830
|
"fieldset",
|
|
16292
16831
|
{
|
|
16293
16832
|
"data-slot": "checkout-delivery",
|
|
16294
16833
|
"aria-describedby": error ? errorId : void 0,
|
|
16295
|
-
className: (0,
|
|
16834
|
+
className: (0, import_utils28.cn)("space-y-4", className),
|
|
16296
16835
|
children: [
|
|
16297
|
-
/* @__PURE__ */ (0,
|
|
16298
|
-
/* @__PURE__ */ (0,
|
|
16299
|
-
homeDelivery ? /* @__PURE__ */ (0,
|
|
16300
|
-
/* @__PURE__ */ (0,
|
|
16836
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("legend", { className: "mb-2 text-lg font-semibold", children: t.legend }),
|
|
16837
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "grid gap-3 sm:grid-cols-2", children: [
|
|
16838
|
+
homeDelivery ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("label", { className: "flex cursor-pointer items-start gap-3 rounded-xl border border-border p-4 has-[:checked]:border-primary", children: [
|
|
16839
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
16301
16840
|
"input",
|
|
16302
16841
|
{
|
|
16303
16842
|
type: "radio",
|
|
@@ -16307,42 +16846,42 @@ function CheckoutDeliveryChoice({
|
|
|
16307
16846
|
className: "mt-0.5 size-4 accent-primary"
|
|
16308
16847
|
}
|
|
16309
16848
|
),
|
|
16310
|
-
/* @__PURE__ */ (0,
|
|
16311
|
-
/* @__PURE__ */ (0,
|
|
16312
|
-
/* @__PURE__ */ (0,
|
|
16313
|
-
/* @__PURE__ */ (0,
|
|
16849
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "flex-1 space-y-1", children: [
|
|
16850
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "flex justify-between gap-2 font-medium", children: [
|
|
16851
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { children: copy.shippingOptionLabel }),
|
|
16852
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "tabular-nums", children: homeCost })
|
|
16314
16853
|
] }),
|
|
16315
|
-
delivery.estimatedDeliveryText ? /* @__PURE__ */ (0,
|
|
16854
|
+
delivery.estimatedDeliveryText ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "block text-sm text-muted-foreground", children: delivery.estimatedDeliveryText }) : null
|
|
16316
16855
|
] })
|
|
16317
16856
|
] }) : null,
|
|
16318
|
-
pickup ? /* @__PURE__ */ (0,
|
|
16319
|
-
/* @__PURE__ */ (0,
|
|
16857
|
+
pickup ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("label", { className: "flex cursor-pointer items-start gap-3 rounded-xl border border-border p-4 has-[:checked]:border-primary", children: [
|
|
16858
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
16320
16859
|
"input",
|
|
16321
16860
|
{
|
|
16322
16861
|
type: "radio",
|
|
16323
16862
|
name: `${uid}-method`,
|
|
16324
16863
|
checked: isPickup,
|
|
16325
|
-
onChange: () => onChange(
|
|
16864
|
+
onChange: () => onChange(pickupFulfillment(delivery)),
|
|
16326
16865
|
className: "mt-0.5 size-4 accent-primary"
|
|
16327
16866
|
}
|
|
16328
16867
|
),
|
|
16329
|
-
/* @__PURE__ */ (0,
|
|
16330
|
-
/* @__PURE__ */ (0,
|
|
16331
|
-
/* @__PURE__ */ (0,
|
|
16868
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "flex flex-1 justify-between gap-2 font-medium", children: [
|
|
16869
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { children: copy.pickupOptionLabel }),
|
|
16870
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { children: t.free })
|
|
16332
16871
|
] })
|
|
16333
16872
|
] }) : null
|
|
16334
16873
|
] }),
|
|
16335
|
-
error ? /* @__PURE__ */ (0,
|
|
16336
|
-
isPickup ? /* @__PURE__ */ (0,
|
|
16337
|
-
/* @__PURE__ */ (0,
|
|
16874
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { id: errorId, role: "alert", className: "text-sm text-destructive", children: error }) : null,
|
|
16875
|
+
isPickup ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { role: "radiogroup", "aria-labelledby": `${uid}-points`, className: "space-y-2", children: [
|
|
16876
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { id: `${uid}-points`, className: "text-sm font-medium", children: t.pickupPointsLegend }),
|
|
16338
16877
|
delivery.pickupLocations.map((location2) => {
|
|
16339
16878
|
const descId = `${uid}-point-${location2.id}`;
|
|
16340
|
-
return /* @__PURE__ */ (0,
|
|
16879
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
16341
16880
|
"label",
|
|
16342
16881
|
{
|
|
16343
16882
|
className: "flex cursor-pointer items-start gap-3 rounded-lg border border-border p-3 has-[:checked]:border-primary",
|
|
16344
16883
|
children: [
|
|
16345
|
-
/* @__PURE__ */ (0,
|
|
16884
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
16346
16885
|
"input",
|
|
16347
16886
|
{
|
|
16348
16887
|
type: "radio",
|
|
@@ -16353,9 +16892,9 @@ function CheckoutDeliveryChoice({
|
|
|
16353
16892
|
className: "mt-0.5 size-4 accent-primary"
|
|
16354
16893
|
}
|
|
16355
16894
|
),
|
|
16356
|
-
/* @__PURE__ */ (0,
|
|
16357
|
-
/* @__PURE__ */ (0,
|
|
16358
|
-
/* @__PURE__ */ (0,
|
|
16895
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "space-y-0.5 text-sm", children: [
|
|
16896
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "block font-medium", children: location2.name }),
|
|
16897
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { id: descId, className: "block text-muted-foreground", children: pickupDescription(location2) })
|
|
16359
16898
|
] })
|
|
16360
16899
|
]
|
|
16361
16900
|
},
|
|
@@ -16363,14 +16902,14 @@ function CheckoutDeliveryChoice({
|
|
|
16363
16902
|
);
|
|
16364
16903
|
})
|
|
16365
16904
|
] }) : null,
|
|
16366
|
-
isShipping ? /* @__PURE__ */ (0,
|
|
16367
|
-
/* @__PURE__ */ (0,
|
|
16368
|
-
/* @__PURE__ */ (0,
|
|
16905
|
+
isShipping ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("fieldset", { className: "space-y-3", children: [
|
|
16906
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("legend", { className: "mb-2 text-sm font-medium", children: t.addressLegend }),
|
|
16907
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: ADDRESS_FIELDS.map(({ key: key2, autoComplete, required, wide }) => {
|
|
16369
16908
|
const fieldId = `${uid}-${key2}`;
|
|
16370
16909
|
const fieldError = addressErrors?.[key2];
|
|
16371
|
-
return /* @__PURE__ */ (0,
|
|
16372
|
-
/* @__PURE__ */ (0,
|
|
16373
|
-
/* @__PURE__ */ (0,
|
|
16910
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: (0, import_utils28.cn)("space-y-1", wide && "sm:col-span-2"), children: [
|
|
16911
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("label", { htmlFor: fieldId, className: "text-sm font-medium", children: t[key2] }),
|
|
16912
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
16374
16913
|
"input",
|
|
16375
16914
|
{
|
|
16376
16915
|
id: fieldId,
|
|
@@ -16381,13 +16920,13 @@ function CheckoutDeliveryChoice({
|
|
|
16381
16920
|
onChange: (e) => onAddressChange({ ...address, [key2]: e.target.value }),
|
|
16382
16921
|
"aria-invalid": fieldError ? true : void 0,
|
|
16383
16922
|
"aria-describedby": fieldError ? `${fieldId}-error` : void 0,
|
|
16384
|
-
className: (0,
|
|
16923
|
+
className: (0, import_utils28.cn)(
|
|
16385
16924
|
INPUT_CLASS,
|
|
16386
16925
|
fieldError ? "border-destructive" : "border-border focus:border-primary"
|
|
16387
16926
|
)
|
|
16388
16927
|
}
|
|
16389
16928
|
),
|
|
16390
|
-
fieldError ? /* @__PURE__ */ (0,
|
|
16929
|
+
fieldError ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { id: `${fieldId}-error`, className: "text-sm text-destructive", children: fieldError }) : null
|
|
16391
16930
|
] }, key2);
|
|
16392
16931
|
}) })
|
|
16393
16932
|
] }) : null
|
|
@@ -16395,12 +16934,19 @@ function CheckoutDeliveryChoice({
|
|
|
16395
16934
|
}
|
|
16396
16935
|
);
|
|
16397
16936
|
}
|
|
16937
|
+
function pickupFulfillment(delivery) {
|
|
16938
|
+
const [only, ...rest] = delivery.pickupLocations;
|
|
16939
|
+
return only && rest.length === 0 ? { type: "PICKUP", pickupLocationId: only.id } : { type: "PICKUP" };
|
|
16940
|
+
}
|
|
16398
16941
|
function defaultCheckoutFulfillment(delivery) {
|
|
16399
16942
|
if (!delivery) return null;
|
|
16400
16943
|
if (delivery.methods.homeDelivery) return { type: "SHIPPING" };
|
|
16401
16944
|
if (!delivery.methods.pickup) return null;
|
|
16402
|
-
|
|
16403
|
-
|
|
16945
|
+
return pickupFulfillment(delivery);
|
|
16946
|
+
}
|
|
16947
|
+
function isCheckoutDeliveryComplete(value, requiresDelivery = true) {
|
|
16948
|
+
if (!value || !requiresDelivery) return true;
|
|
16949
|
+
return value.type !== "PICKUP" || Boolean(value.pickupLocationId);
|
|
16404
16950
|
}
|
|
16405
16951
|
function quoteRequiresDelivery(quote) {
|
|
16406
16952
|
return quote ? quote.lines.some((line) => line.isShippable) : true;
|
|
@@ -16422,8 +16968,8 @@ function toCheckoutFulfillmentFields(value, address, requiresDelivery = true) {
|
|
|
16422
16968
|
}
|
|
16423
16969
|
|
|
16424
16970
|
// src/components/checkout-quote-summary.tsx
|
|
16425
|
-
var
|
|
16426
|
-
var
|
|
16971
|
+
var import_utils29 = require("@reblu/site-ui/utils");
|
|
16972
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
16427
16973
|
var DEFAULT_CHECKOUT_QUOTE_SUMMARY_LABELS = {
|
|
16428
16974
|
subtotal: "Subtotal",
|
|
16429
16975
|
discount: (codeOrLabel, isAutomatic) => isAutomatic ? codeOrLabel : `Descuento (${codeOrLabel})`,
|
|
@@ -16440,9 +16986,9 @@ function Row({
|
|
|
16440
16986
|
value,
|
|
16441
16987
|
className
|
|
16442
16988
|
}) {
|
|
16443
|
-
return /* @__PURE__ */ (0,
|
|
16444
|
-
/* @__PURE__ */ (0,
|
|
16445
|
-
/* @__PURE__ */ (0,
|
|
16989
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { "data-slot": "checkout-quote-row", className: (0, import_utils29.cn)("flex justify-between gap-4", className), children: [
|
|
16990
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("dt", { children: name }),
|
|
16991
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("dd", { className: "shrink-0 tabular-nums", children: value })
|
|
16446
16992
|
] });
|
|
16447
16993
|
}
|
|
16448
16994
|
function CheckoutQuoteSummary({
|
|
@@ -16458,22 +17004,22 @@ function CheckoutQuoteSummary({
|
|
|
16458
17004
|
const price = (cents) => formatPrice(cents, currencyCode, locale);
|
|
16459
17005
|
const { fulfillment, shipping, tax, discount } = quote;
|
|
16460
17006
|
const Tag = `h${headingLevel}`;
|
|
16461
|
-
return /* @__PURE__ */ (0,
|
|
16462
|
-
heading ? /* @__PURE__ */ (0,
|
|
16463
|
-
/* @__PURE__ */ (0,
|
|
16464
|
-
/* @__PURE__ */ (0,
|
|
16465
|
-
/* @__PURE__ */ (0,
|
|
16466
|
-
line.variantName ? /* @__PURE__ */ (0,
|
|
16467
|
-
/* @__PURE__ */ (0,
|
|
16468
|
-
line.kindLabel ? /* @__PURE__ */ (0,
|
|
16469
|
-
/* @__PURE__ */ (0,
|
|
17007
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("section", { "data-slot": "checkout-quote-summary", className: slotClassName("space-y-4", "", className), children: [
|
|
17008
|
+
heading ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Tag, { className: "text-lg font-semibold", children: heading }) : null,
|
|
17009
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("ul", { className: "space-y-3 text-sm", children: quote.lines.map((line) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("li", { className: "flex justify-between gap-4", children: [
|
|
17010
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "min-w-0 space-y-0.5", children: [
|
|
17011
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "font-medium", children: line.name }),
|
|
17012
|
+
line.variantName ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-muted-foreground", children: line.variantName }) : null,
|
|
17013
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("p", { className: "flex flex-wrap items-center gap-2 text-muted-foreground", children: [
|
|
17014
|
+
line.kindLabel ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { "data-slot": "checkout-quote-kind", className: "rounded-full border border-border px-2 py-0.5 text-xs font-medium text-foreground", children: line.kindLabel }) : null,
|
|
17015
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: t.quantityTimesUnit(line.quantity, price(line.unitPrice)) })
|
|
16470
17016
|
] })
|
|
16471
17017
|
] }),
|
|
16472
|
-
/* @__PURE__ */ (0,
|
|
17018
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "shrink-0 tabular-nums", children: price(line.total) })
|
|
16473
17019
|
] }, `${line.productId}-${line.variantId ?? ""}`)) }),
|
|
16474
|
-
/* @__PURE__ */ (0,
|
|
16475
|
-
/* @__PURE__ */ (0,
|
|
16476
|
-
discount && discount.amount > 0 ? /* @__PURE__ */ (0,
|
|
17020
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("dl", { className: "space-y-2 border-t border-border pt-3 text-sm", children: [
|
|
17021
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Row, { name: t.subtotal, value: price(quote.subtotal) }),
|
|
17022
|
+
discount && discount.amount > 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
16477
17023
|
Row,
|
|
16478
17024
|
{
|
|
16479
17025
|
className: "text-green-700 dark:text-green-400",
|
|
@@ -16481,17 +17027,17 @@ function CheckoutQuoteSummary({
|
|
|
16481
17027
|
value: `\u2212${price(discount.amount)}`
|
|
16482
17028
|
}
|
|
16483
17029
|
) : null,
|
|
16484
|
-
fulfillment.type ? /* @__PURE__ */ (0,
|
|
17030
|
+
fulfillment.type ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
16485
17031
|
Row,
|
|
16486
17032
|
{
|
|
16487
|
-
name: /* @__PURE__ */ (0,
|
|
17033
|
+
name: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
16488
17034
|
fulfillment.label ?? t.delivery,
|
|
16489
|
-
fulfillment.type === "PICKUP" && fulfillment.pickupLocation ? /* @__PURE__ */ (0,
|
|
17035
|
+
fulfillment.type === "PICKUP" && fulfillment.pickupLocation ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "block text-muted-foreground", children: fulfillment.pickupLocation.name }) : null
|
|
16490
17036
|
] }),
|
|
16491
17037
|
value: fulfillment.type === "PICKUP" || shipping.isFree ? t.free : price(shipping.cost)
|
|
16492
17038
|
}
|
|
16493
17039
|
) : null,
|
|
16494
|
-
tax.isLineVisible ? tax.breakdown.map((entry) => /* @__PURE__ */ (0,
|
|
17040
|
+
tax.isLineVisible ? tax.breakdown.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
16495
17041
|
Row,
|
|
16496
17042
|
{
|
|
16497
17043
|
className: tax.isIncluded ? "text-muted-foreground" : void 0,
|
|
@@ -16500,19 +17046,44 @@ function CheckoutQuoteSummary({
|
|
|
16500
17046
|
},
|
|
16501
17047
|
entry.label
|
|
16502
17048
|
)) : null,
|
|
16503
|
-
/* @__PURE__ */ (0,
|
|
17049
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Row, { className: "border-t border-border pt-2 text-base font-bold", name: t.total, value: price(quote.total) })
|
|
16504
17050
|
] }),
|
|
16505
|
-
tax.isIncluded ? /* @__PURE__ */ (0,
|
|
16506
|
-
fulfillment.type === "SHIPPING" && !shipping.isFree && shipping.remainingForFree ? /* @__PURE__ */ (0,
|
|
16507
|
-
fulfillment.type && quote.deliveryEstimateText ? /* @__PURE__ */ (0,
|
|
16508
|
-
quote.discountError ? /* @__PURE__ */ (0,
|
|
16509
|
-
quote.blockingReason ? /* @__PURE__ */ (0,
|
|
17051
|
+
tax.isIncluded ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-sm text-muted-foreground", children: t.taxesIncludedNote }) : null,
|
|
17052
|
+
fulfillment.type === "SHIPPING" && !shipping.isFree && shipping.remainingForFree ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-sm text-muted-foreground", children: t.remainingForFree(price(shipping.remainingForFree)) }) : null,
|
|
17053
|
+
fulfillment.type && quote.deliveryEstimateText ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { "data-slot": "checkout-quote-estimate", className: "text-sm text-muted-foreground", children: quote.deliveryEstimateText }) : null,
|
|
17054
|
+
quote.discountError ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { role: "status", className: "text-sm text-destructive", children: quote.discountError.message }) : null,
|
|
17055
|
+
quote.blockingReason ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { role: "alert", className: "rounded-lg border border-destructive/50 bg-destructive/10 p-3 text-sm text-destructive", children: quote.blockingReason.message }) : null
|
|
16510
17056
|
] });
|
|
16511
17057
|
}
|
|
17058
|
+
var DEFAULT_CHECKOUT_QUOTE_NOTICE_LABELS = {
|
|
17059
|
+
pickupLocationRequired: "Elige un punto de recogida"
|
|
17060
|
+
};
|
|
17061
|
+
function checkoutQuoteNotice({
|
|
17062
|
+
fulfillment,
|
|
17063
|
+
requiresDelivery = true,
|
|
17064
|
+
error
|
|
17065
|
+
}) {
|
|
17066
|
+
if (!isCheckoutDeliveryComplete(fulfillment, requiresDelivery)) return "PICKUP_LOCATION_REQUIRED";
|
|
17067
|
+
if (error?.code === "PICKUP_LOCATION_INVALID") return "PICKUP_LOCATION_REQUIRED";
|
|
17068
|
+
return null;
|
|
17069
|
+
}
|
|
17070
|
+
function CheckoutQuoteNotice({ reason, labels, className }) {
|
|
17071
|
+
if (!reason) return null;
|
|
17072
|
+
const t = { ...DEFAULT_CHECKOUT_QUOTE_NOTICE_LABELS, ...labels };
|
|
17073
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
17074
|
+
"p",
|
|
17075
|
+
{
|
|
17076
|
+
role: "status",
|
|
17077
|
+
"data-slot": "checkout-quote-notice",
|
|
17078
|
+
className: slotClassName("rounded-lg border border-border bg-muted p-3 text-sm", "", className),
|
|
17079
|
+
children: t.pickupLocationRequired
|
|
17080
|
+
}
|
|
17081
|
+
);
|
|
17082
|
+
}
|
|
16512
17083
|
|
|
16513
17084
|
// src/components/checkout-terms-acceptance.tsx
|
|
16514
|
-
var
|
|
16515
|
-
var
|
|
17085
|
+
var import_utils30 = require("@reblu/site-ui/utils");
|
|
17086
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
16516
17087
|
function splitTermsLabel(label) {
|
|
16517
17088
|
const at = label.indexOf("{terms}");
|
|
16518
17089
|
return at === -1 ? [`${label} `, ""] : [label.slice(0, at), label.slice(at + "{terms}".length)];
|
|
@@ -16534,9 +17105,9 @@ function CheckoutTermsAcceptance({
|
|
|
16534
17105
|
(part) => part.replaceAll("{tenant}", copy.tenantName)
|
|
16535
17106
|
);
|
|
16536
17107
|
const newTab = copy.isTermsLinkNewTab;
|
|
16537
|
-
return /* @__PURE__ */ (0,
|
|
16538
|
-
/* @__PURE__ */ (0,
|
|
16539
|
-
/* @__PURE__ */ (0,
|
|
17108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { "data-slot": "checkout-terms", className: (0, import_utils30.cn)("space-y-1", className), children: [
|
|
17109
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-start gap-3", children: [
|
|
17110
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
16540
17111
|
"input",
|
|
16541
17112
|
{
|
|
16542
17113
|
id: boxId,
|
|
@@ -16549,9 +17120,9 @@ function CheckoutTermsAcceptance({
|
|
|
16549
17120
|
className: "mt-0.5 size-5 shrink-0 cursor-pointer accent-primary"
|
|
16550
17121
|
}
|
|
16551
17122
|
),
|
|
16552
|
-
/* @__PURE__ */ (0,
|
|
17123
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("label", { htmlFor: boxId, className: "text-sm leading-relaxed", children: [
|
|
16553
17124
|
before,
|
|
16554
|
-
/* @__PURE__ */ (0,
|
|
17125
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
16555
17126
|
"a",
|
|
16556
17127
|
{
|
|
16557
17128
|
href: copy.termsLinkUrl ?? termsHref,
|
|
@@ -16559,9 +17130,9 @@ function CheckoutTermsAcceptance({
|
|
|
16559
17130
|
className: "font-medium underline underline-offset-2 hover:text-primary",
|
|
16560
17131
|
children: [
|
|
16561
17132
|
copy.termsLinkText,
|
|
16562
|
-
newTab ? /* @__PURE__ */ (0,
|
|
17133
|
+
newTab ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
16563
17134
|
" ",
|
|
16564
|
-
/* @__PURE__ */ (0,
|
|
17135
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "sr-only", children: newTabHint })
|
|
16565
17136
|
] }) : null
|
|
16566
17137
|
]
|
|
16567
17138
|
}
|
|
@@ -16569,7 +17140,7 @@ function CheckoutTermsAcceptance({
|
|
|
16569
17140
|
after
|
|
16570
17141
|
] })
|
|
16571
17142
|
] }),
|
|
16572
|
-
error ? /* @__PURE__ */ (0,
|
|
17143
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { id: errorId, className: "pl-8 text-sm text-destructive", children: error }) : null
|
|
16573
17144
|
] });
|
|
16574
17145
|
}
|
|
16575
17146
|
function toCheckoutTermsFields(copy, accepted) {
|
|
@@ -16578,8 +17149,8 @@ function toCheckoutTermsFields(copy, accepted) {
|
|
|
16578
17149
|
}
|
|
16579
17150
|
|
|
16580
17151
|
// src/components/checkout-pay-action.tsx
|
|
16581
|
-
var
|
|
16582
|
-
var
|
|
17152
|
+
var import_utils31 = require("@reblu/site-ui/utils");
|
|
17153
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
16583
17154
|
function CheckoutPayAction({
|
|
16584
17155
|
label,
|
|
16585
17156
|
notice,
|
|
@@ -16593,28 +17164,50 @@ function CheckoutPayAction({
|
|
|
16593
17164
|
}) {
|
|
16594
17165
|
const noticeId = `${id}-notice`;
|
|
16595
17166
|
const isDisabled = submitting || disabled;
|
|
16596
|
-
return /* @__PURE__ */ (0,
|
|
16597
|
-
/* @__PURE__ */ (0,
|
|
17167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { "data-slot": "checkout-pay-action", className: (0, import_utils31.cn)("space-y-3", className), children: [
|
|
17168
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
16598
17169
|
"button",
|
|
16599
17170
|
{
|
|
16600
17171
|
type: "submit",
|
|
16601
17172
|
disabled: isDisabled,
|
|
16602
17173
|
"aria-busy": submitting || void 0,
|
|
16603
17174
|
"aria-describedby": notice ? noticeId : void 0,
|
|
16604
|
-
className: buttonClassName ?? (0,
|
|
17175
|
+
className: buttonClassName ?? (0, import_utils31.cn)(
|
|
16605
17176
|
"flex w-full items-center justify-center gap-2 rounded-xl px-4 py-3 text-base font-semibold transition-all",
|
|
16606
17177
|
isDisabled ? "cursor-not-allowed bg-muted text-muted-foreground" : "cursor-pointer bg-primary text-primary-foreground hover:bg-primary/90"
|
|
16607
17178
|
),
|
|
16608
17179
|
children: submitting ? submittingLabel : label
|
|
16609
17180
|
}
|
|
16610
17181
|
),
|
|
16611
|
-
notice ? /* @__PURE__ */ (0,
|
|
17182
|
+
notice ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { id: noticeId, "data-slot": "checkout-pay-notice", className: noticeClassName ?? "text-sm text-muted-foreground", children: notice }) : null
|
|
16612
17183
|
] });
|
|
16613
17184
|
}
|
|
16614
17185
|
|
|
17186
|
+
// src/lib/course-guest-checkout.ts
|
|
17187
|
+
function courseSellsAsGuest(course) {
|
|
17188
|
+
return course.salesEnabled && !course.requiresValidation && course.priceCents > 0;
|
|
17189
|
+
}
|
|
17190
|
+
function toAcademyCheckoutInvoiceFields(value, overCap, issuesInvoices = true) {
|
|
17191
|
+
if (!issuesInvoices) return {};
|
|
17192
|
+
if (!value.wantsFullInvoice && !overCap) return {};
|
|
17193
|
+
const billing = {
|
|
17194
|
+
billingName: value.billingName.trim(),
|
|
17195
|
+
billingNif: value.billingNif.trim(),
|
|
17196
|
+
billingIdType: value.billingIdType,
|
|
17197
|
+
...value.billingIdType === "NIF" ? {} : { billingIdCountry: value.billingIdCountry },
|
|
17198
|
+
billingAddress: {
|
|
17199
|
+
street: value.street.trim(),
|
|
17200
|
+
postalCode: value.postalCode.trim(),
|
|
17201
|
+
city: value.city.trim(),
|
|
17202
|
+
country: value.country
|
|
17203
|
+
}
|
|
17204
|
+
};
|
|
17205
|
+
return { ...value.wantsFullInvoice ? { wantsFullInvoice: true } : {}, billing };
|
|
17206
|
+
}
|
|
17207
|
+
|
|
16615
17208
|
// src/components/contact-interest-field.tsx
|
|
16616
|
-
var
|
|
16617
|
-
var
|
|
17209
|
+
var import_utils32 = require("@reblu/site-ui/utils");
|
|
17210
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
16618
17211
|
function ContactInterestField({
|
|
16619
17212
|
interest,
|
|
16620
17213
|
value,
|
|
@@ -16631,18 +17224,18 @@ function ContactInterestField({
|
|
|
16631
17224
|
else next2.delete(option2);
|
|
16632
17225
|
onChange(interest.options.filter((candidate) => next2.has(candidate)));
|
|
16633
17226
|
};
|
|
16634
|
-
return /* @__PURE__ */ (0,
|
|
16635
|
-
/* @__PURE__ */ (0,
|
|
16636
|
-
/* @__PURE__ */ (0,
|
|
17227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("fieldset", { "data-slot": "contact-interest", className: (0, import_utils32.cn)("space-y-2", className), children: [
|
|
17228
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("legend", { className: "text-sm font-medium", children: interest.label }),
|
|
17229
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "flex flex-col gap-2", children: interest.options.map((option2, index) => {
|
|
16637
17230
|
const id = `${idPrefix}-${index}`;
|
|
16638
|
-
return /* @__PURE__ */ (0,
|
|
17231
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
16639
17232
|
"label",
|
|
16640
17233
|
{
|
|
16641
17234
|
htmlFor: id,
|
|
16642
17235
|
"data-slot": "contact-interest-option",
|
|
16643
17236
|
className: "flex items-center gap-2 text-sm",
|
|
16644
17237
|
children: [
|
|
16645
|
-
/* @__PURE__ */ (0,
|
|
17238
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
16646
17239
|
"input",
|
|
16647
17240
|
{
|
|
16648
17241
|
id,
|
|
@@ -16668,6 +17261,9 @@ var import_site_contracts = require("@reblu/site-contracts");
|
|
|
16668
17261
|
ALLOWED_YOUTUBE_HOSTS,
|
|
16669
17262
|
AddedToCartToast,
|
|
16670
17263
|
ArbitrationBadge,
|
|
17264
|
+
BeforeAfterPairs,
|
|
17265
|
+
CARD_ICON_NAMES,
|
|
17266
|
+
CardIconSvg,
|
|
16671
17267
|
CartAdjustmentsNotice,
|
|
16672
17268
|
CartLineIncludes,
|
|
16673
17269
|
CartLineList,
|
|
@@ -16676,14 +17272,18 @@ var import_site_contracts = require("@reblu/site-contracts");
|
|
|
16676
17272
|
CheckoutForm,
|
|
16677
17273
|
CheckoutLoginPrompt,
|
|
16678
17274
|
CheckoutPayAction,
|
|
17275
|
+
CheckoutQuoteNotice,
|
|
16679
17276
|
CheckoutQuoteSummary,
|
|
16680
17277
|
CheckoutTermsAcceptance,
|
|
17278
|
+
ChipList,
|
|
16681
17279
|
ContactInterestField,
|
|
16682
17280
|
CourseCatalogFilters,
|
|
16683
17281
|
CourseDescription,
|
|
16684
17282
|
CoursePurchaseTerms,
|
|
16685
17283
|
DATA_REQUEST_TYPES,
|
|
17284
|
+
DEFAULT_BEFORE_AFTER_LABELS,
|
|
16686
17285
|
DEFAULT_CHECKOUT_DELIVERY_CHOICE_LABELS,
|
|
17286
|
+
DEFAULT_CHECKOUT_QUOTE_NOTICE_LABELS,
|
|
16687
17287
|
DEFAULT_CHECKOUT_QUOTE_SUMMARY_LABELS,
|
|
16688
17288
|
DEFAULT_COURSE_CATALOG_FILTERS_LABELS,
|
|
16689
17289
|
DEFAULT_COURSE_PRICE_BANDS,
|
|
@@ -16700,6 +17300,8 @@ var import_site_contracts = require("@reblu/site-contracts");
|
|
|
16700
17300
|
EMPTY_FULL_INVOICE_VALUE,
|
|
16701
17301
|
FaqAccordion,
|
|
16702
17302
|
FullInvoiceFields,
|
|
17303
|
+
IconCardGrid,
|
|
17304
|
+
ImageTextSplit,
|
|
16703
17305
|
LegalDocument,
|
|
16704
17306
|
LessonPreview,
|
|
16705
17307
|
MarkdownRenderer,
|
|
@@ -16712,6 +17314,7 @@ var import_site_contracts = require("@reblu/site-contracts");
|
|
|
16712
17314
|
ProductTrustItems,
|
|
16713
17315
|
ProfessionalFields,
|
|
16714
17316
|
ProfileCard,
|
|
17317
|
+
Reviews,
|
|
16715
17318
|
SafeHtml,
|
|
16716
17319
|
ShopFilters,
|
|
16717
17320
|
Specialty,
|
|
@@ -16720,11 +17323,14 @@ var import_site_contracts = require("@reblu/site-contracts");
|
|
|
16720
17323
|
buildFaqPageJsonLd,
|
|
16721
17324
|
buildShareUrls,
|
|
16722
17325
|
bundleComponentsToIncludes,
|
|
17326
|
+
checkoutQuoteNotice,
|
|
16723
17327
|
collectFaqItems,
|
|
17328
|
+
courseSellsAsGuest,
|
|
16724
17329
|
defaultCheckoutFulfillment,
|
|
16725
17330
|
formatPrice,
|
|
16726
17331
|
getShopErrorMessage,
|
|
16727
17332
|
isAllowedYouTubeHost,
|
|
17333
|
+
isCheckoutDeliveryComplete,
|
|
16728
17334
|
isOverSimplifiedInvoiceCap,
|
|
16729
17335
|
markdownToPlainText,
|
|
16730
17336
|
markdownToSafeHtml,
|
|
@@ -16733,6 +17339,7 @@ var import_site_contracts = require("@reblu/site-contracts");
|
|
|
16733
17339
|
sanitizeHtml,
|
|
16734
17340
|
shopIssuesInvoices,
|
|
16735
17341
|
shouldRenderShopFilters,
|
|
17342
|
+
toAcademyCheckoutInvoiceFields,
|
|
16736
17343
|
toCheckoutFulfillmentFields,
|
|
16737
17344
|
toCheckoutInvoiceFields,
|
|
16738
17345
|
toCheckoutTermsFields
|