@reblu/site-blocks 0.27.0 → 0.28.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 +11 -0
- package/README.md +46 -1
- package/dist/index.cjs +343 -272
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +52 -4
- package/dist/index.d.ts +52 -4
- package/dist/index.js +342 -272
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -22,6 +22,7 @@ var src_exports = {};
|
|
|
22
22
|
__export(src_exports, {
|
|
23
23
|
ALLOWED_YOUTUBE_HOSTS: () => ALLOWED_YOUTUBE_HOSTS,
|
|
24
24
|
AddedToCartToast: () => AddedToCartToast,
|
|
25
|
+
ArbitrationBadge: () => ArbitrationBadge,
|
|
25
26
|
CartAdjustmentsNotice: () => CartAdjustmentsNotice,
|
|
26
27
|
CartLineList: () => CartLineList,
|
|
27
28
|
CartSummary: () => CartSummary,
|
|
@@ -14369,6 +14370,33 @@ function FaqAccordion({
|
|
|
14369
14370
|
|
|
14370
14371
|
// src/components/trust-badges.tsx
|
|
14371
14372
|
var import_utils12 = require("@reblu/site-ui/utils");
|
|
14373
|
+
|
|
14374
|
+
// src/lib/trust-badge-media.ts
|
|
14375
|
+
var DEFAULT_ADHESION_NUMBER_LABEL = "N.\xBA de adhesi\xF3n";
|
|
14376
|
+
function safeHref(url) {
|
|
14377
|
+
if (typeof url !== "string") return null;
|
|
14378
|
+
try {
|
|
14379
|
+
const parsed = new URL(url);
|
|
14380
|
+
return parsed.protocol === "https:" || parsed.protocol === "http:" ? url : null;
|
|
14381
|
+
} catch {
|
|
14382
|
+
return null;
|
|
14383
|
+
}
|
|
14384
|
+
}
|
|
14385
|
+
function safeLogoSrc(url) {
|
|
14386
|
+
if (typeof url !== "string" || url === "") return null;
|
|
14387
|
+
if (url.startsWith("/")) return url.startsWith("//") || url.startsWith("/\\") ? null : url;
|
|
14388
|
+
return safeHref(url);
|
|
14389
|
+
}
|
|
14390
|
+
function adhesionNumberOf(badge) {
|
|
14391
|
+
const value = badge.adhesionNumber;
|
|
14392
|
+
return typeof value === "string" && value.trim() !== "" ? value.trim() : null;
|
|
14393
|
+
}
|
|
14394
|
+
function trustBadgeAlt(badge, numberLabel = DEFAULT_ADHESION_NUMBER_LABEL) {
|
|
14395
|
+
const number2 = adhesionNumberOf(badge);
|
|
14396
|
+
return number2 ? `${badge.name}. ${numberLabel} ${number2}` : badge.name;
|
|
14397
|
+
}
|
|
14398
|
+
|
|
14399
|
+
// src/components/trust-badges.tsx
|
|
14372
14400
|
var import_jsx_runtime16 = (
|
|
14373
14401
|
// eslint-disable-next-line @next/next/no-img-element -- framework-agnostic SDK; the SITE owns image optimisation
|
|
14374
14402
|
require("react/jsx-runtime")
|
|
@@ -14379,7 +14407,8 @@ var DEFAULT_TRUST_BADGE_HEADINGS = Object.freeze(
|
|
|
14379
14407
|
INSURANCE: "Aseguradoras",
|
|
14380
14408
|
SUBVENTION: "Financiaci\xF3n",
|
|
14381
14409
|
CERTIFICATION: "Certificaciones",
|
|
14382
|
-
AWARD: "Premios"
|
|
14410
|
+
AWARD: "Premios",
|
|
14411
|
+
CONSUMER_ARBITRATION: "Arbitraje de consumo"
|
|
14383
14412
|
}
|
|
14384
14413
|
);
|
|
14385
14414
|
var DEFAULT_TRUST_BADGE_TYPE_ORDER = Object.freeze([
|
|
@@ -14389,26 +14418,12 @@ var DEFAULT_TRUST_BADGE_TYPE_ORDER = Object.freeze([
|
|
|
14389
14418
|
"PARTNER",
|
|
14390
14419
|
"INSURANCE"
|
|
14391
14420
|
]);
|
|
14392
|
-
var KNOWN_TYPES = new Set(
|
|
14421
|
+
var KNOWN_TYPES = new Set(Object.keys(DEFAULT_TRUST_BADGE_HEADINGS));
|
|
14393
14422
|
function isUsable(value) {
|
|
14394
14423
|
if (typeof value !== "object" || value === null) return false;
|
|
14395
14424
|
const entry = value;
|
|
14396
14425
|
return typeof entry.type === "string" && KNOWN_TYPES.has(entry.type) && typeof entry.name === "string" && entry.name.trim() !== "";
|
|
14397
14426
|
}
|
|
14398
|
-
function safeHref(url) {
|
|
14399
|
-
if (typeof url !== "string") return null;
|
|
14400
|
-
try {
|
|
14401
|
-
const parsed = new URL(url);
|
|
14402
|
-
return parsed.protocol === "https:" || parsed.protocol === "http:" ? url : null;
|
|
14403
|
-
} catch {
|
|
14404
|
-
return null;
|
|
14405
|
-
}
|
|
14406
|
-
}
|
|
14407
|
-
function safeLogoSrc(url) {
|
|
14408
|
-
if (typeof url !== "string" || url === "") return null;
|
|
14409
|
-
if (url.startsWith("/")) return url.startsWith("//") || url.startsWith("/\\") ? null : url;
|
|
14410
|
-
return safeHref(url);
|
|
14411
|
-
}
|
|
14412
14427
|
function BadgeContent({ badge, logoClassName }) {
|
|
14413
14428
|
const src = safeLogoSrc(badge.logoUrl);
|
|
14414
14429
|
if (src) {
|
|
@@ -14416,7 +14431,7 @@ function BadgeContent({ badge, logoClassName }) {
|
|
|
14416
14431
|
"img",
|
|
14417
14432
|
{
|
|
14418
14433
|
src,
|
|
14419
|
-
alt: badge
|
|
14434
|
+
alt: trustBadgeAlt(badge),
|
|
14420
14435
|
loading: "lazy",
|
|
14421
14436
|
className: (0, import_utils12.cn)("h-12 w-auto object-contain", logoClassName)
|
|
14422
14437
|
}
|
|
@@ -14506,41 +14521,96 @@ function TrustBadges({
|
|
|
14506
14521
|
);
|
|
14507
14522
|
}
|
|
14508
14523
|
|
|
14509
|
-
// src/components/
|
|
14524
|
+
// src/components/arbitration-badge.tsx
|
|
14510
14525
|
var import_utils13 = require("@reblu/site-ui/utils");
|
|
14511
|
-
var import_button_variants2 = require("@reblu/site-ui/button-variants");
|
|
14512
14526
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
14527
|
+
function isArbitrationBadge(value) {
|
|
14528
|
+
if (typeof value !== "object" || value === null) return false;
|
|
14529
|
+
const entry = value;
|
|
14530
|
+
return entry.type === "CONSUMER_ARBITRATION" && typeof entry.name === "string" && entry.name.trim() !== "";
|
|
14531
|
+
}
|
|
14532
|
+
function ArbitrationBadge({
|
|
14533
|
+
badges,
|
|
14534
|
+
numberLabel = DEFAULT_ADHESION_NUMBER_LABEL,
|
|
14535
|
+
showNumber = true,
|
|
14536
|
+
newWindowLabel = "(se abre en una ventana nueva)",
|
|
14537
|
+
className,
|
|
14538
|
+
logoClassName,
|
|
14539
|
+
numberClassName
|
|
14540
|
+
}) {
|
|
14541
|
+
if (!Array.isArray(badges)) return null;
|
|
14542
|
+
const items = badges.filter(isArbitrationBadge);
|
|
14543
|
+
if (items.length === 0) return null;
|
|
14544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
14545
|
+
"ul",
|
|
14546
|
+
{
|
|
14547
|
+
"data-slot": "arbitration-badges",
|
|
14548
|
+
className: (0, import_utils13.cn)("flex flex-wrap items-start gap-6", className),
|
|
14549
|
+
children: items.map((badge) => {
|
|
14550
|
+
const src = safeLogoSrc(badge.logoUrl);
|
|
14551
|
+
const href = safeHref(badge.url);
|
|
14552
|
+
const number2 = adhesionNumberOf(badge);
|
|
14553
|
+
const caption = number2 && (showNumber || !src) ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: (0, import_utils13.cn)("text-xs", numberClassName), "aria-hidden": src ? "true" : void 0, children: `${numberLabel} ${number2}` }) : null;
|
|
14554
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "inline-flex flex-col items-center gap-1 text-center", children: [
|
|
14555
|
+
src ? (
|
|
14556
|
+
// eslint-disable-next-line @next/next/no-img-element -- framework-agnostic SDK; the SITE owns image optimisation
|
|
14557
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
14558
|
+
"img",
|
|
14559
|
+
{
|
|
14560
|
+
src,
|
|
14561
|
+
alt: trustBadgeAlt(badge, numberLabel),
|
|
14562
|
+
loading: "lazy",
|
|
14563
|
+
className: (0, import_utils13.cn)("h-16 w-auto object-contain", logoClassName)
|
|
14564
|
+
}
|
|
14565
|
+
)
|
|
14566
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-sm font-medium", children: badge.name }),
|
|
14567
|
+
caption
|
|
14568
|
+
] });
|
|
14569
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("li", { "data-slot": "arbitration-badge", children: href ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("a", { href, target: "_blank", rel: "noopener noreferrer", className: "inline-flex", children: [
|
|
14570
|
+
content,
|
|
14571
|
+
" ",
|
|
14572
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "sr-only", children: newWindowLabel })
|
|
14573
|
+
] }) : content }, badge.id);
|
|
14574
|
+
})
|
|
14575
|
+
}
|
|
14576
|
+
);
|
|
14577
|
+
}
|
|
14578
|
+
|
|
14579
|
+
// src/components/page-blocks.tsx
|
|
14580
|
+
var import_utils14 = require("@reblu/site-ui/utils");
|
|
14581
|
+
var import_button_variants2 = require("@reblu/site-ui/button-variants");
|
|
14582
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
14513
14583
|
var ALIASES = {
|
|
14514
14584
|
doctor_embed: "profile_embed",
|
|
14515
14585
|
specialty_embed: "page_embed"
|
|
14516
14586
|
};
|
|
14517
14587
|
function HeroBlock({ block, headingLevel }) {
|
|
14518
14588
|
const { title, subtitle, imageUrl } = block.data;
|
|
14519
|
-
return /* @__PURE__ */ (0,
|
|
14520
|
-
/* @__PURE__ */ (0,
|
|
14521
|
-
subtitle && /* @__PURE__ */ (0,
|
|
14522
|
-
imageUrl && /* @__PURE__ */ (0,
|
|
14589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "space-y-4", children: [
|
|
14590
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Heading, { level: headingLevel, className: "text-3xl font-bold tracking-tight md:text-4xl", children: title }),
|
|
14591
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-lg opacity-80", children: subtitle }),
|
|
14592
|
+
imageUrl && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "relative aspect-[21/9] w-full overflow-hidden rounded-xl bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("img", { src: imageUrl, alt: "", loading: "lazy", className: "h-full w-full object-cover" }) })
|
|
14523
14593
|
] });
|
|
14524
14594
|
}
|
|
14525
14595
|
function RichtextBlock({ block, headingLevel }) {
|
|
14526
|
-
return /* @__PURE__ */ (0,
|
|
14596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SafeHtml, { html: sanitizeHtml(block.data.html), headingOffset: headingLevel - 1 });
|
|
14527
14597
|
}
|
|
14528
14598
|
function FaqBlock({ block }) {
|
|
14529
|
-
return /* @__PURE__ */ (0,
|
|
14599
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(FaqAccordion, { items: block.data.items });
|
|
14530
14600
|
}
|
|
14531
14601
|
function StatsBlock({ block }) {
|
|
14532
|
-
return /* @__PURE__ */ (0,
|
|
14533
|
-
/* @__PURE__ */ (0,
|
|
14534
|
-
/* @__PURE__ */ (0,
|
|
14602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.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_runtime18.jsxs)("div", { className: "flex flex-col-reverse gap-1", children: [
|
|
14603
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("dt", { className: "text-sm opacity-80", children: item.label }),
|
|
14604
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("dd", { className: "text-3xl font-bold", children: item.value })
|
|
14535
14605
|
] }, i)) });
|
|
14536
14606
|
}
|
|
14537
14607
|
function TestimonialBlock({ block }) {
|
|
14538
14608
|
const { quote, author, role, avatarUrl } = block.data;
|
|
14539
|
-
return /* @__PURE__ */ (0,
|
|
14540
|
-
/* @__PURE__ */ (0,
|
|
14541
|
-
/* @__PURE__ */ (0,
|
|
14609
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("figure", { className: "space-y-4", children: [
|
|
14610
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("blockquote", { className: "text-xl italic", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { children: quote }) }),
|
|
14611
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("figcaption", { className: "flex items-center gap-3", children: [
|
|
14542
14612
|
avatarUrl && // eslint-disable-next-line @next/next/no-img-element
|
|
14543
|
-
/* @__PURE__ */ (0,
|
|
14613
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
14544
14614
|
"img",
|
|
14545
14615
|
{
|
|
14546
14616
|
src: avatarUrl,
|
|
@@ -14549,9 +14619,9 @@ function TestimonialBlock({ block }) {
|
|
|
14549
14619
|
className: "h-10 w-10 rounded-full object-cover"
|
|
14550
14620
|
}
|
|
14551
14621
|
),
|
|
14552
|
-
/* @__PURE__ */ (0,
|
|
14553
|
-
/* @__PURE__ */ (0,
|
|
14554
|
-
role && /* @__PURE__ */ (0,
|
|
14622
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { children: [
|
|
14623
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "font-semibold", children: author }),
|
|
14624
|
+
role && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "block text-sm opacity-80", children: role })
|
|
14555
14625
|
] })
|
|
14556
14626
|
] })
|
|
14557
14627
|
] });
|
|
@@ -14560,19 +14630,19 @@ function CtaSlotBlock(_props) {
|
|
|
14560
14630
|
return null;
|
|
14561
14631
|
}
|
|
14562
14632
|
function FeatureListBlock({ block }) {
|
|
14563
|
-
return /* @__PURE__ */ (0,
|
|
14633
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.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_runtime18.jsx)("li", { children: item.text }, i)) });
|
|
14564
14634
|
}
|
|
14565
14635
|
function GalleryBlock({ block }) {
|
|
14566
14636
|
const { images } = block.data;
|
|
14567
|
-
return /* @__PURE__ */ (0,
|
|
14637
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
14568
14638
|
"div",
|
|
14569
14639
|
{
|
|
14570
|
-
className: (0,
|
|
14640
|
+
className: (0, import_utils14.cn)(
|
|
14571
14641
|
"grid gap-4",
|
|
14572
14642
|
images.length > 1 ? "sm:grid-cols-2 lg:grid-cols-3" : "grid-cols-1"
|
|
14573
14643
|
),
|
|
14574
|
-
children: images.map((img, i) => /* @__PURE__ */ (0,
|
|
14575
|
-
/* @__PURE__ */ (0,
|
|
14644
|
+
children: images.map((img, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("figure", { className: "space-y-1", children: [
|
|
14645
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "relative aspect-video w-full overflow-hidden rounded-lg bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
14576
14646
|
"img",
|
|
14577
14647
|
{
|
|
14578
14648
|
src: img.url,
|
|
@@ -14581,7 +14651,7 @@ function GalleryBlock({ block }) {
|
|
|
14581
14651
|
className: "h-full w-full object-cover"
|
|
14582
14652
|
}
|
|
14583
14653
|
) }),
|
|
14584
|
-
img.caption && /* @__PURE__ */ (0,
|
|
14654
|
+
img.caption && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("figcaption", { className: "text-sm opacity-80", children: img.caption })
|
|
14585
14655
|
] }, `${img.url}-${i}`))
|
|
14586
14656
|
}
|
|
14587
14657
|
);
|
|
@@ -14591,13 +14661,13 @@ function EmbedCard({
|
|
|
14591
14661
|
headingLevel,
|
|
14592
14662
|
embedHref
|
|
14593
14663
|
}) {
|
|
14594
|
-
return /* @__PURE__ */ (0,
|
|
14664
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
14595
14665
|
"a",
|
|
14596
14666
|
{
|
|
14597
14667
|
href: embedHref(resolved),
|
|
14598
14668
|
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",
|
|
14599
14669
|
children: [
|
|
14600
|
-
resolved.coverImageUrl && /* @__PURE__ */ (0,
|
|
14670
|
+
resolved.coverImageUrl && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "aspect-video w-full overflow-hidden bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
14601
14671
|
"img",
|
|
14602
14672
|
{
|
|
14603
14673
|
src: resolved.coverImageUrl,
|
|
@@ -14606,24 +14676,24 @@ function EmbedCard({
|
|
|
14606
14676
|
className: "h-full w-full object-cover"
|
|
14607
14677
|
}
|
|
14608
14678
|
) }),
|
|
14609
|
-
/* @__PURE__ */ (0,
|
|
14610
|
-
/* @__PURE__ */ (0,
|
|
14611
|
-
resolved.role && /* @__PURE__ */ (0,
|
|
14612
|
-
resolved.excerpt && /* @__PURE__ */ (0,
|
|
14679
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "space-y-1 p-4", children: [
|
|
14680
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Heading, { level: headingLevel, className: "text-lg font-semibold", children: resolved.title }),
|
|
14681
|
+
resolved.role && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-sm text-muted-foreground", children: resolved.role }),
|
|
14682
|
+
resolved.excerpt && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-muted-foreground", children: resolved.excerpt })
|
|
14613
14683
|
] })
|
|
14614
14684
|
]
|
|
14615
14685
|
}
|
|
14616
14686
|
);
|
|
14617
14687
|
}
|
|
14618
14688
|
function PageEmbedBlock({ block, headingLevel, embedHref }) {
|
|
14619
|
-
return /* @__PURE__ */ (0,
|
|
14689
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(EmbedCard, { resolved: block.resolved, headingLevel, embedHref });
|
|
14620
14690
|
}
|
|
14621
14691
|
function ProfileEmbedBlock({
|
|
14622
14692
|
block,
|
|
14623
14693
|
headingLevel,
|
|
14624
14694
|
embedHref
|
|
14625
14695
|
}) {
|
|
14626
|
-
return /* @__PURE__ */ (0,
|
|
14696
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(EmbedCard, { resolved: block.resolved, headingLevel, embedHref });
|
|
14627
14697
|
}
|
|
14628
14698
|
var DEFAULT_RENDERERS = {
|
|
14629
14699
|
hero: HeroBlock,
|
|
@@ -14680,14 +14750,14 @@ function toIdFragment(value) {
|
|
|
14680
14750
|
function SectionCta2({ cta }) {
|
|
14681
14751
|
if (!hasUsableCta(cta)) return null;
|
|
14682
14752
|
const variant = toButtonVariant(cta.variant);
|
|
14683
|
-
return /* @__PURE__ */ (0,
|
|
14753
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "pt-2", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
14684
14754
|
"a",
|
|
14685
14755
|
{
|
|
14686
14756
|
href: cta.url,
|
|
14687
14757
|
"data-slot": "button",
|
|
14688
14758
|
"data-variant": variant,
|
|
14689
14759
|
"data-size": "default",
|
|
14690
|
-
className: (0,
|
|
14760
|
+
className: (0, import_utils14.cn)((0, import_button_variants2.buttonVariants)({ variant, size: "default" })),
|
|
14691
14761
|
...cta.isExternal ? { target: "_blank", rel: "noopener noreferrer" } : {},
|
|
14692
14762
|
children: cta.label
|
|
14693
14763
|
}
|
|
@@ -14713,17 +14783,17 @@ function PageBlocks({
|
|
|
14713
14783
|
const headingId = block.heading ? `${safePrefix}-${toIdFragment(block.id)}-heading` : void 0;
|
|
14714
14784
|
const background = block.backgroundColor;
|
|
14715
14785
|
return [
|
|
14716
|
-
/* @__PURE__ */ (0,
|
|
14786
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
14717
14787
|
"section",
|
|
14718
14788
|
{
|
|
14719
14789
|
"data-slot": "page-block",
|
|
14720
14790
|
"data-block-type": type,
|
|
14721
14791
|
"aria-labelledby": headingId,
|
|
14722
14792
|
style: surfaceStyle(background),
|
|
14723
|
-
className: (0,
|
|
14793
|
+
className: (0, import_utils14.cn)("space-y-6", background && "rounded-xl px-6 py-10", sectionClassName),
|
|
14724
14794
|
children: [
|
|
14725
|
-
block.heading && /* @__PURE__ */ (0,
|
|
14726
|
-
/* @__PURE__ */ (0,
|
|
14795
|
+
block.heading && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Heading, { level: headingLevel, className: "text-2xl font-bold tracking-tight", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { id: headingId, children: block.heading }) }),
|
|
14796
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
14727
14797
|
Renderer,
|
|
14728
14798
|
{
|
|
14729
14799
|
block,
|
|
@@ -14731,7 +14801,7 @@ function PageBlocks({
|
|
|
14731
14801
|
embedHref
|
|
14732
14802
|
}
|
|
14733
14803
|
),
|
|
14734
|
-
/* @__PURE__ */ (0,
|
|
14804
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SectionCta2, { cta: block.cta })
|
|
14735
14805
|
]
|
|
14736
14806
|
},
|
|
14737
14807
|
block.id
|
|
@@ -14739,12 +14809,12 @@ function PageBlocks({
|
|
|
14739
14809
|
];
|
|
14740
14810
|
});
|
|
14741
14811
|
if (sections.length === 0) return null;
|
|
14742
|
-
return /* @__PURE__ */ (0,
|
|
14812
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: (0, import_utils14.cn)("space-y-12", className), "data-slot": "page-blocks", children: sections });
|
|
14743
14813
|
}
|
|
14744
14814
|
|
|
14745
14815
|
// src/components/shop-filters.tsx
|
|
14746
|
-
var
|
|
14747
|
-
var
|
|
14816
|
+
var import_utils15 = require("@reblu/site-ui/utils");
|
|
14817
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
14748
14818
|
var DEFAULT_SHOP_PRICE_BANDS = [
|
|
14749
14819
|
{ max: 2500 },
|
|
14750
14820
|
{ min: 2500, max: 5e3 },
|
|
@@ -14788,7 +14858,7 @@ function priceBandLabel(band, t, currencyCode, locale) {
|
|
|
14788
14858
|
return "";
|
|
14789
14859
|
}
|
|
14790
14860
|
function OptionLink({ href, active, label, onActivate }) {
|
|
14791
|
-
return /* @__PURE__ */ (0,
|
|
14861
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
14792
14862
|
"a",
|
|
14793
14863
|
{
|
|
14794
14864
|
href,
|
|
@@ -14797,7 +14867,7 @@ function OptionLink({ href, active, label, onActivate }) {
|
|
|
14797
14867
|
event.preventDefault();
|
|
14798
14868
|
onActivate();
|
|
14799
14869
|
} : void 0,
|
|
14800
|
-
className: (0,
|
|
14870
|
+
className: (0, import_utils15.cn)(
|
|
14801
14871
|
"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",
|
|
14802
14872
|
active ? "border-transparent bg-primary text-primary-foreground" : "border-border text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
14803
14873
|
),
|
|
@@ -14806,9 +14876,9 @@ function OptionLink({ href, active, label, onActivate }) {
|
|
|
14806
14876
|
);
|
|
14807
14877
|
}
|
|
14808
14878
|
function FilterFieldset({ legend, children: children2 }) {
|
|
14809
|
-
return /* @__PURE__ */ (0,
|
|
14810
|
-
/* @__PURE__ */ (0,
|
|
14811
|
-
/* @__PURE__ */ (0,
|
|
14879
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("fieldset", { className: "space-y-2", children: [
|
|
14880
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("legend", { className: "text-sm font-medium text-foreground", children: legend }),
|
|
14881
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex flex-wrap gap-2", children: children2 })
|
|
14812
14882
|
] });
|
|
14813
14883
|
}
|
|
14814
14884
|
function ShopFilters({
|
|
@@ -14831,11 +14901,11 @@ function ShopFilters({
|
|
|
14831
14901
|
if (!shouldRenderShopFilters(facets, active)) {
|
|
14832
14902
|
return null;
|
|
14833
14903
|
}
|
|
14834
|
-
return /* @__PURE__ */ (0,
|
|
14904
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: (0, import_utils15.cn)("space-y-6", className), "data-slot": "shop-filters", children: [
|
|
14835
14905
|
visibleTaxonomies.map((axis) => {
|
|
14836
14906
|
const activeSlug = active.taxonomy?.[axis.key];
|
|
14837
|
-
return /* @__PURE__ */ (0,
|
|
14838
|
-
/* @__PURE__ */ (0,
|
|
14907
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(FilterFieldset, { legend: axis.label, children: [
|
|
14908
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
14839
14909
|
OptionLink,
|
|
14840
14910
|
{
|
|
14841
14911
|
href: hrefs.taxonomy(axis.key, void 0),
|
|
@@ -14850,7 +14920,7 @@ function ShopFilters({
|
|
|
14850
14920
|
),
|
|
14851
14921
|
axis.terms.map((term) => {
|
|
14852
14922
|
const isActive = activeSlug === term.slug;
|
|
14853
|
-
return /* @__PURE__ */ (0,
|
|
14923
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
14854
14924
|
OptionLink,
|
|
14855
14925
|
{
|
|
14856
14926
|
href: hrefs.taxonomy(axis.key, isActive ? void 0 : term.slug),
|
|
@@ -14870,9 +14940,9 @@ function ShopFilters({
|
|
|
14870
14940
|
}),
|
|
14871
14941
|
visibleAttributes.map((attr) => {
|
|
14872
14942
|
const activeValues = toValueArray(active.attr?.[attr.key]);
|
|
14873
|
-
return /* @__PURE__ */ (0,
|
|
14943
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(FilterFieldset, { legend: attr.label, children: attr.options.map((opt) => {
|
|
14874
14944
|
const isActive = activeValues.includes(opt.value);
|
|
14875
|
-
return /* @__PURE__ */ (0,
|
|
14945
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
14876
14946
|
OptionLink,
|
|
14877
14947
|
{
|
|
14878
14948
|
href: hrefs.attr(attr.key, opt.value),
|
|
@@ -14890,11 +14960,11 @@ function ShopFilters({
|
|
|
14890
14960
|
);
|
|
14891
14961
|
}) }, attr.key);
|
|
14892
14962
|
}),
|
|
14893
|
-
showPriceGroup && /* @__PURE__ */ (0,
|
|
14963
|
+
showPriceGroup && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(FilterFieldset, { legend: t.price, children: priceBands.map((band, i) => {
|
|
14894
14964
|
const isActive = active.priceMin === band.min && active.priceMax === band.max;
|
|
14895
14965
|
const nextMin = isActive ? void 0 : band.min;
|
|
14896
14966
|
const nextMax = isActive ? void 0 : band.max;
|
|
14897
|
-
return /* @__PURE__ */ (0,
|
|
14967
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
14898
14968
|
OptionLink,
|
|
14899
14969
|
{
|
|
14900
14970
|
href: hrefs.price(nextMin, nextMax),
|
|
@@ -14905,7 +14975,7 @@ function ShopFilters({
|
|
|
14905
14975
|
i
|
|
14906
14976
|
);
|
|
14907
14977
|
}) }),
|
|
14908
|
-
hasOnSale && /* @__PURE__ */ (0,
|
|
14978
|
+
hasOnSale && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
14909
14979
|
OptionLink,
|
|
14910
14980
|
{
|
|
14911
14981
|
href: hrefs.onSale(!active.onSale),
|
|
@@ -14914,7 +14984,7 @@ function ShopFilters({
|
|
|
14914
14984
|
onActivate: onChange ? () => onChange({ onSale: !active.onSale }) : void 0
|
|
14915
14985
|
}
|
|
14916
14986
|
),
|
|
14917
|
-
/* @__PURE__ */ (0,
|
|
14987
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
14918
14988
|
"a",
|
|
14919
14989
|
{
|
|
14920
14990
|
href: hrefs.clearAll(),
|
|
@@ -14930,8 +15000,8 @@ function ShopFilters({
|
|
|
14930
15000
|
}
|
|
14931
15001
|
|
|
14932
15002
|
// src/components/course-catalog-filters.tsx
|
|
14933
|
-
var
|
|
14934
|
-
var
|
|
15003
|
+
var import_utils16 = require("@reblu/site-ui/utils");
|
|
15004
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
14935
15005
|
var DEFAULT_COURSE_PRICE_BANDS = [
|
|
14936
15006
|
{ max: 5e3 },
|
|
14937
15007
|
{ min: 5e3, max: 15e3 },
|
|
@@ -14984,9 +15054,9 @@ function CourseCatalogFilters({
|
|
|
14984
15054
|
const showPrice = enabled.price !== false;
|
|
14985
15055
|
const isFree = Boolean(active.free);
|
|
14986
15056
|
if (!showCategories && !showInstructors && !showPrice) return null;
|
|
14987
|
-
return /* @__PURE__ */ (0,
|
|
14988
|
-
showCategories && /* @__PURE__ */ (0,
|
|
14989
|
-
/* @__PURE__ */ (0,
|
|
15057
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: (0, import_utils16.cn)("space-y-6", className), "data-slot": "course-catalog-filters", children: [
|
|
15058
|
+
showCategories && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(FilterFieldset, { legend: t.category, children: [
|
|
15059
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
14990
15060
|
OptionLink,
|
|
14991
15061
|
{
|
|
14992
15062
|
href: categoryHref(void 0),
|
|
@@ -14998,7 +15068,7 @@ function CourseCatalogFilters({
|
|
|
14998
15068
|
sortedCategories.map((category) => {
|
|
14999
15069
|
const isActive = active.category === category.slug;
|
|
15000
15070
|
const next2 = isActive ? void 0 : category.slug;
|
|
15001
|
-
return /* @__PURE__ */ (0,
|
|
15071
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
15002
15072
|
OptionLink,
|
|
15003
15073
|
{
|
|
15004
15074
|
href: categoryHref(next2),
|
|
@@ -15010,8 +15080,8 @@ function CourseCatalogFilters({
|
|
|
15010
15080
|
);
|
|
15011
15081
|
})
|
|
15012
15082
|
] }),
|
|
15013
|
-
showInstructors && /* @__PURE__ */ (0,
|
|
15014
|
-
/* @__PURE__ */ (0,
|
|
15083
|
+
showInstructors && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(FilterFieldset, { legend: t.instructor, children: [
|
|
15084
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
15015
15085
|
OptionLink,
|
|
15016
15086
|
{
|
|
15017
15087
|
href: hrefs.instructor(void 0),
|
|
@@ -15023,7 +15093,7 @@ function CourseCatalogFilters({
|
|
|
15023
15093
|
named.map((instructor) => {
|
|
15024
15094
|
const isActive = active.instructor === instructor.id;
|
|
15025
15095
|
const next2 = isActive ? void 0 : instructor.id;
|
|
15026
|
-
return /* @__PURE__ */ (0,
|
|
15096
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
15027
15097
|
OptionLink,
|
|
15028
15098
|
{
|
|
15029
15099
|
href: hrefs.instructor(next2),
|
|
@@ -15035,8 +15105,8 @@ function CourseCatalogFilters({
|
|
|
15035
15105
|
);
|
|
15036
15106
|
})
|
|
15037
15107
|
] }),
|
|
15038
|
-
showPrice && /* @__PURE__ */ (0,
|
|
15039
|
-
/* @__PURE__ */ (0,
|
|
15108
|
+
showPrice && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(FilterFieldset, { legend: t.price, children: [
|
|
15109
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
15040
15110
|
OptionLink,
|
|
15041
15111
|
{
|
|
15042
15112
|
href: hrefs.free(!isFree),
|
|
@@ -15051,7 +15121,7 @@ function CourseCatalogFilters({
|
|
|
15051
15121
|
const isActive = !isFree && active.priceMin === band.min && active.priceMax === band.max;
|
|
15052
15122
|
const nextMin = isActive ? void 0 : band.min;
|
|
15053
15123
|
const nextMax = isActive ? void 0 : band.max;
|
|
15054
|
-
return /* @__PURE__ */ (0,
|
|
15124
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
15055
15125
|
OptionLink,
|
|
15056
15126
|
{
|
|
15057
15127
|
href: hrefs.price(nextMin, nextMax),
|
|
@@ -15063,7 +15133,7 @@ function CourseCatalogFilters({
|
|
|
15063
15133
|
);
|
|
15064
15134
|
})
|
|
15065
15135
|
] }),
|
|
15066
|
-
/* @__PURE__ */ (0,
|
|
15136
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
15067
15137
|
"a",
|
|
15068
15138
|
{
|
|
15069
15139
|
href: hrefs.clearAll(),
|
|
@@ -15085,8 +15155,8 @@ function CourseCatalogFilters({
|
|
|
15085
15155
|
}
|
|
15086
15156
|
|
|
15087
15157
|
// src/components/cart-line-list.tsx
|
|
15088
|
-
var
|
|
15089
|
-
var
|
|
15158
|
+
var import_utils17 = require("@reblu/site-ui/utils");
|
|
15159
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
15090
15160
|
var DEFAULT_LABELS2 = {
|
|
15091
15161
|
quantityLabel: "Cantidad",
|
|
15092
15162
|
decrease: "Reducir cantidad",
|
|
@@ -15112,9 +15182,9 @@ function CartLineList({
|
|
|
15112
15182
|
}) {
|
|
15113
15183
|
const t = { ...DEFAULT_LABELS2, ...labels };
|
|
15114
15184
|
const noticeContent = notice === true ? t.cancelledNotice : notice;
|
|
15115
|
-
return /* @__PURE__ */ (0,
|
|
15116
|
-
/* @__PURE__ */ (0,
|
|
15117
|
-
noticeContent != null && noticeContent !== false && /* @__PURE__ */ (0,
|
|
15185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: (0, import_utils17.cn)("space-y-4", className), "data-slot": "cart-line-list", children: [
|
|
15186
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { "aria-live": "polite", className: "sr-only", children: liveMessage }),
|
|
15187
|
+
noticeContent != null && noticeContent !== false && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
15118
15188
|
"div",
|
|
15119
15189
|
{
|
|
15120
15190
|
role: "status",
|
|
@@ -15123,33 +15193,33 @@ function CartLineList({
|
|
|
15123
15193
|
children: noticeContent
|
|
15124
15194
|
}
|
|
15125
15195
|
),
|
|
15126
|
-
/* @__PURE__ */ (0,
|
|
15196
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("ul", { className: "space-y-4", children: items.map((item) => {
|
|
15127
15197
|
const maxQty = item.maxStock ?? Infinity;
|
|
15128
15198
|
const atMax = item.quantity >= maxQty;
|
|
15129
15199
|
const atMin = item.quantity <= 1;
|
|
15130
15200
|
const message = lineMessage?.(item);
|
|
15131
|
-
return /* @__PURE__ */ (0,
|
|
15201
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
15132
15202
|
"li",
|
|
15133
15203
|
{
|
|
15134
15204
|
className: "flex gap-4 rounded-xl border border-border bg-card p-4",
|
|
15135
15205
|
children: [
|
|
15136
|
-
/* @__PURE__ */ (0,
|
|
15137
|
-
/* @__PURE__ */ (0,
|
|
15138
|
-
/* @__PURE__ */ (0,
|
|
15139
|
-
item.variantName && /* @__PURE__ */ (0,
|
|
15140
|
-
/* @__PURE__ */ (0,
|
|
15206
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "h-20 w-20 flex-shrink-0 overflow-hidden rounded-lg bg-muted", children: item.imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("img", { src: item.imageUrl, alt: item.name, className: "h-full w-full object-cover" }) : null }),
|
|
15207
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
15208
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "truncate text-sm font-semibold leading-tight", children: item.name }),
|
|
15209
|
+
item.variantName && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "mt-0.5 text-xs text-muted-foreground", children: item.variantName }),
|
|
15210
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("p", { className: "mt-1 text-sm text-muted-foreground", children: [
|
|
15141
15211
|
formatPrice(item.unitPrice, currencyCode, locale),
|
|
15142
15212
|
" ",
|
|
15143
15213
|
t.unitPriceSuffix
|
|
15144
15214
|
] }),
|
|
15145
|
-
/* @__PURE__ */ (0,
|
|
15215
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
15146
15216
|
"div",
|
|
15147
15217
|
{
|
|
15148
15218
|
role: "group",
|
|
15149
15219
|
"aria-label": t.quantityLabel,
|
|
15150
15220
|
className: "mt-3 flex items-center gap-3",
|
|
15151
15221
|
children: [
|
|
15152
|
-
/* @__PURE__ */ (0,
|
|
15222
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
15153
15223
|
"button",
|
|
15154
15224
|
{
|
|
15155
15225
|
type: "button",
|
|
@@ -15160,8 +15230,8 @@ function CartLineList({
|
|
|
15160
15230
|
children: "\u2212"
|
|
15161
15231
|
}
|
|
15162
15232
|
),
|
|
15163
|
-
/* @__PURE__ */ (0,
|
|
15164
|
-
/* @__PURE__ */ (0,
|
|
15233
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "w-8 text-center text-sm font-semibold tabular-nums", children: item.quantity }),
|
|
15234
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
15165
15235
|
"button",
|
|
15166
15236
|
{
|
|
15167
15237
|
type: "button",
|
|
@@ -15172,7 +15242,7 @@ function CartLineList({
|
|
|
15172
15242
|
children: "+"
|
|
15173
15243
|
}
|
|
15174
15244
|
),
|
|
15175
|
-
onRemove && /* @__PURE__ */ (0,
|
|
15245
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
15176
15246
|
"button",
|
|
15177
15247
|
{
|
|
15178
15248
|
type: "button",
|
|
@@ -15185,7 +15255,7 @@ function CartLineList({
|
|
|
15185
15255
|
]
|
|
15186
15256
|
}
|
|
15187
15257
|
),
|
|
15188
|
-
message != null && message !== false && /* @__PURE__ */ (0,
|
|
15258
|
+
message != null && message !== false && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
15189
15259
|
"p",
|
|
15190
15260
|
{
|
|
15191
15261
|
className: "mt-2 text-sm text-destructive",
|
|
@@ -15194,7 +15264,7 @@ function CartLineList({
|
|
|
15194
15264
|
}
|
|
15195
15265
|
)
|
|
15196
15266
|
] }),
|
|
15197
|
-
/* @__PURE__ */ (0,
|
|
15267
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex-shrink-0 text-right", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-base font-bold", children: formatPrice(item.unitPrice * item.quantity, currencyCode, locale) }) })
|
|
15198
15268
|
]
|
|
15199
15269
|
},
|
|
15200
15270
|
lineKey(item.productId, item.variantId)
|
|
@@ -15204,8 +15274,8 @@ function CartLineList({
|
|
|
15204
15274
|
}
|
|
15205
15275
|
|
|
15206
15276
|
// src/components/cart-summary.tsx
|
|
15207
|
-
var
|
|
15208
|
-
var
|
|
15277
|
+
var import_utils18 = require("@reblu/site-ui/utils");
|
|
15278
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
15209
15279
|
var DEFAULT_LABELS3 = {
|
|
15210
15280
|
subtotal: "Subtotal",
|
|
15211
15281
|
discountPrefix: "Descuento",
|
|
@@ -15235,37 +15305,37 @@ function CartSummary({
|
|
|
15235
15305
|
const hasDiscount = Boolean(discountAmount && discountAmount > 0);
|
|
15236
15306
|
const noticeContent = notice === true ? t.cancelledNotice : notice;
|
|
15237
15307
|
const hasNotice = noticeContent != null && noticeContent !== false;
|
|
15238
|
-
const breakdown = /* @__PURE__ */ (0,
|
|
15308
|
+
const breakdown = /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
15239
15309
|
"dl",
|
|
15240
15310
|
{
|
|
15241
|
-
className: (0,
|
|
15311
|
+
className: (0, import_utils18.cn)("space-y-2 text-sm", !hasNotice && className),
|
|
15242
15312
|
"data-slot": "cart-summary",
|
|
15243
15313
|
children: [
|
|
15244
|
-
/* @__PURE__ */ (0,
|
|
15245
|
-
/* @__PURE__ */ (0,
|
|
15246
|
-
/* @__PURE__ */ (0,
|
|
15314
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex justify-between text-muted-foreground", children: [
|
|
15315
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("dt", { children: t.subtotal }),
|
|
15316
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("dd", { children: formatPrice(subtotal, currencyCode, locale) })
|
|
15247
15317
|
] }),
|
|
15248
|
-
hasDiscount && /* @__PURE__ */ (0,
|
|
15249
|
-
/* @__PURE__ */ (0,
|
|
15250
|
-
/* @__PURE__ */ (0,
|
|
15318
|
+
hasDiscount && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex justify-between text-green-600 dark:text-green-400", children: [
|
|
15319
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("dt", { children: autoDiscount ? t.staffDiscountApplied : `${t.discountPrefix}${discountCode ? ` (${discountCode})` : ""}` }),
|
|
15320
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("dd", { children: [
|
|
15251
15321
|
"-",
|
|
15252
15322
|
formatPrice(discountAmount, currencyCode, locale)
|
|
15253
15323
|
] })
|
|
15254
15324
|
] }),
|
|
15255
|
-
shippingEnabled && /* @__PURE__ */ (0,
|
|
15256
|
-
/* @__PURE__ */ (0,
|
|
15257
|
-
/* @__PURE__ */ (0,
|
|
15325
|
+
shippingEnabled && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex justify-between text-muted-foreground", children: [
|
|
15326
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("dt", { children: t.shipping }),
|
|
15327
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("dd", { children: shipping == null || !Number.isFinite(shipping) ? t.shippingCalculated : shipping === 0 ? t.freeShipping : formatPrice(shipping, currencyCode, locale) })
|
|
15258
15328
|
] }),
|
|
15259
|
-
/* @__PURE__ */ (0,
|
|
15260
|
-
/* @__PURE__ */ (0,
|
|
15261
|
-
/* @__PURE__ */ (0,
|
|
15329
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex justify-between border-t border-border pt-2 text-base font-bold", children: [
|
|
15330
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("dt", { children: t.total }),
|
|
15331
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("dd", { children: formatPrice(total, currencyCode, locale) })
|
|
15262
15332
|
] })
|
|
15263
15333
|
]
|
|
15264
15334
|
}
|
|
15265
15335
|
);
|
|
15266
15336
|
if (!hasNotice) return breakdown;
|
|
15267
|
-
return /* @__PURE__ */ (0,
|
|
15268
|
-
/* @__PURE__ */ (0,
|
|
15337
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: (0, import_utils18.cn)("space-y-3", className), "data-slot": "cart-summary-wrapper", children: [
|
|
15338
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15269
15339
|
"div",
|
|
15270
15340
|
{
|
|
15271
15341
|
role: "status",
|
|
@@ -15279,8 +15349,8 @@ function CartSummary({
|
|
|
15279
15349
|
}
|
|
15280
15350
|
|
|
15281
15351
|
// src/components/cart-adjustments-notice.tsx
|
|
15282
|
-
var
|
|
15283
|
-
var
|
|
15352
|
+
var import_utils19 = require("@reblu/site-ui/utils");
|
|
15353
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
15284
15354
|
var DEFAULT_LABELS4 = {
|
|
15285
15355
|
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.`,
|
|
15286
15356
|
quantityChanged: (name, quantity) => `Hemos ajustado la cantidad de ${name} a ${quantity} por el stock disponible.`,
|
|
@@ -15314,20 +15384,20 @@ function CartAdjustmentsNotice({
|
|
|
15314
15384
|
);
|
|
15315
15385
|
}
|
|
15316
15386
|
if (messages.length === 0) return null;
|
|
15317
|
-
return /* @__PURE__ */ (0,
|
|
15387
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
15318
15388
|
"div",
|
|
15319
15389
|
{
|
|
15320
15390
|
role: "status",
|
|
15321
|
-
className: (0,
|
|
15391
|
+
className: (0, import_utils19.cn)("rounded-lg border border-border bg-muted px-3 py-2 text-sm", className),
|
|
15322
15392
|
"data-slot": "cart-adjustments-notice",
|
|
15323
|
-
children: messages.length === 1 ? /* @__PURE__ */ (0,
|
|
15393
|
+
children: messages.length === 1 ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { children: messages[0] }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("ul", { className: "list-disc space-y-1 pl-4", children: messages.map((message, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("li", { children: message }, index)) })
|
|
15324
15394
|
}
|
|
15325
15395
|
);
|
|
15326
15396
|
}
|
|
15327
15397
|
|
|
15328
15398
|
// src/components/added-to-cart-toast.tsx
|
|
15329
|
-
var
|
|
15330
|
-
var
|
|
15399
|
+
var import_utils20 = require("@reblu/site-ui/utils");
|
|
15400
|
+
var import_jsx_runtime24 = (
|
|
15331
15401
|
// eslint-disable-next-line @next/next/no-img-element -- toast content, not a Next <Image> layout context
|
|
15332
15402
|
require("react/jsx-runtime")
|
|
15333
15403
|
);
|
|
@@ -15350,32 +15420,32 @@ function AddedToCartToast({
|
|
|
15350
15420
|
const message = status === "error" ? t.error : status === "outOfStock" ? t.outOfStock : t.success;
|
|
15351
15421
|
const hasThumbnail = Boolean(imageUrl && imageUrl.trim().length > 0);
|
|
15352
15422
|
const variant = status === "success" ? "success" : "error";
|
|
15353
|
-
return /* @__PURE__ */ (0,
|
|
15423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
15354
15424
|
"div",
|
|
15355
15425
|
{
|
|
15356
15426
|
"data-slot": "added-to-cart-toast",
|
|
15357
15427
|
"data-variant": variant,
|
|
15358
|
-
className: (0,
|
|
15428
|
+
className: (0, import_utils20.cn)(
|
|
15359
15429
|
"flex items-center gap-3 rounded-xl border border-border bg-card p-3 text-sm shadow-lg",
|
|
15360
15430
|
variant === "success" && "border-green-600/30 dark:border-green-400/30",
|
|
15361
15431
|
variant === "error" && "border-destructive/30",
|
|
15362
15432
|
className
|
|
15363
15433
|
),
|
|
15364
15434
|
children: [
|
|
15365
|
-
hasThumbnail && /* @__PURE__ */ (0,
|
|
15366
|
-
/* @__PURE__ */ (0,
|
|
15367
|
-
/* @__PURE__ */ (0,
|
|
15368
|
-
/* @__PURE__ */ (0,
|
|
15435
|
+
hasThumbnail && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("img", { src: imageUrl, alt: productName, className: "h-10 w-10 flex-shrink-0 rounded-lg object-cover" }),
|
|
15436
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
15437
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "truncate font-semibold text-foreground", children: productName }),
|
|
15438
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "truncate text-muted-foreground", children: quantity && quantity > 1 ? `${message} \xB7 x${quantity}` : message })
|
|
15369
15439
|
] }),
|
|
15370
|
-
/* @__PURE__ */ (0,
|
|
15440
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("a", { href: cartHref, className: "text-sm font-semibold text-primary underline-offset-2 hover:underline", children: t.viewCart }) })
|
|
15371
15441
|
]
|
|
15372
15442
|
}
|
|
15373
15443
|
);
|
|
15374
15444
|
}
|
|
15375
15445
|
|
|
15376
15446
|
// src/components/checkout-login-prompt.tsx
|
|
15377
|
-
var
|
|
15378
|
-
var
|
|
15447
|
+
var import_utils21 = require("@reblu/site-ui/utils");
|
|
15448
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
15379
15449
|
var DEFAULT_LABELS6 = {
|
|
15380
15450
|
title: "Identificaci\xF3n",
|
|
15381
15451
|
description: "Introduce tu email para agilizar el proceso o contin\xFAa como invitado.",
|
|
@@ -15402,26 +15472,26 @@ function CheckoutLoginPrompt({
|
|
|
15402
15472
|
if (!open) return null;
|
|
15403
15473
|
const t = { ...DEFAULT_LABELS6, ...labels };
|
|
15404
15474
|
const isValidEmail = EMAIL_PATTERN.test(email.trim());
|
|
15405
|
-
return /* @__PURE__ */ (0,
|
|
15406
|
-
/* @__PURE__ */ (0,
|
|
15407
|
-
/* @__PURE__ */ (0,
|
|
15475
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
15476
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "fixed inset-0 z-50 bg-black/50", onClick: onClose, "aria-hidden": "true" }),
|
|
15477
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
15408
15478
|
"div",
|
|
15409
15479
|
{
|
|
15410
15480
|
role: "dialog",
|
|
15411
15481
|
"aria-modal": "true",
|
|
15412
15482
|
"aria-labelledby": "checkout-login-prompt-title",
|
|
15413
15483
|
"data-slot": "checkout-login-prompt",
|
|
15414
|
-
className: (0,
|
|
15484
|
+
className: (0, import_utils21.cn)(
|
|
15415
15485
|
"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",
|
|
15416
15486
|
className
|
|
15417
15487
|
),
|
|
15418
15488
|
children: [
|
|
15419
|
-
/* @__PURE__ */ (0,
|
|
15420
|
-
/* @__PURE__ */ (0,
|
|
15421
|
-
/* @__PURE__ */ (0,
|
|
15422
|
-
/* @__PURE__ */ (0,
|
|
15489
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
|
|
15490
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { children: [
|
|
15491
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h2", { id: "checkout-login-prompt-title", className: "text-xl font-bold", children: t.title }),
|
|
15492
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "mt-1 text-sm text-muted-foreground", children: t.description })
|
|
15423
15493
|
] }),
|
|
15424
|
-
/* @__PURE__ */ (0,
|
|
15494
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
15425
15495
|
"button",
|
|
15426
15496
|
{
|
|
15427
15497
|
type: "button",
|
|
@@ -15432,9 +15502,9 @@ function CheckoutLoginPrompt({
|
|
|
15432
15502
|
}
|
|
15433
15503
|
)
|
|
15434
15504
|
] }),
|
|
15435
|
-
/* @__PURE__ */ (0,
|
|
15436
|
-
/* @__PURE__ */ (0,
|
|
15437
|
-
/* @__PURE__ */ (0,
|
|
15505
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "space-y-2", children: [
|
|
15506
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("label", { htmlFor: "checkout-login-prompt-email", className: "text-sm font-medium", children: t.emailLabel }),
|
|
15507
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
15438
15508
|
"input",
|
|
15439
15509
|
{
|
|
15440
15510
|
id: "checkout-login-prompt-email",
|
|
@@ -15443,29 +15513,29 @@ function CheckoutLoginPrompt({
|
|
|
15443
15513
|
value: email,
|
|
15444
15514
|
onChange: (e) => onEmailChange(e.target.value),
|
|
15445
15515
|
placeholder: t.emailPlaceholder,
|
|
15446
|
-
className: (0,
|
|
15516
|
+
className: (0, import_utils21.cn)(
|
|
15447
15517
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
15448
15518
|
error ? "border-destructive" : "border-border focus:border-primary"
|
|
15449
15519
|
)
|
|
15450
15520
|
}
|
|
15451
15521
|
),
|
|
15452
|
-
error && /* @__PURE__ */ (0,
|
|
15522
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-xs text-destructive", children: error })
|
|
15453
15523
|
] }),
|
|
15454
|
-
/* @__PURE__ */ (0,
|
|
15455
|
-
/* @__PURE__ */ (0,
|
|
15524
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "space-y-2", children: [
|
|
15525
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
15456
15526
|
"button",
|
|
15457
15527
|
{
|
|
15458
15528
|
type: "button",
|
|
15459
15529
|
onClick: onSubmitEmail,
|
|
15460
15530
|
disabled: checking || !isValidEmail,
|
|
15461
|
-
className: (0,
|
|
15531
|
+
className: (0, import_utils21.cn)(
|
|
15462
15532
|
"flex w-full cursor-pointer items-center justify-center gap-2 rounded-xl px-4 py-2.5 text-sm font-semibold transition-all",
|
|
15463
15533
|
checking || !isValidEmail ? "cursor-not-allowed bg-muted text-muted-foreground" : "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
15464
15534
|
),
|
|
15465
15535
|
children: checking ? t.checking : t.continueWithEmail
|
|
15466
15536
|
}
|
|
15467
15537
|
),
|
|
15468
|
-
/* @__PURE__ */ (0,
|
|
15538
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
15469
15539
|
"button",
|
|
15470
15540
|
{
|
|
15471
15541
|
type: "button",
|
|
@@ -15482,9 +15552,9 @@ function CheckoutLoginPrompt({
|
|
|
15482
15552
|
}
|
|
15483
15553
|
|
|
15484
15554
|
// src/components/checkout-form.tsx
|
|
15485
|
-
var
|
|
15555
|
+
var import_utils22 = require("@reblu/site-ui/utils");
|
|
15486
15556
|
var import_phone_input = require("@reblu/site-ui/phone-input");
|
|
15487
|
-
var
|
|
15557
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
15488
15558
|
var DEFAULT_LABELS7 = {
|
|
15489
15559
|
contactTitle: "Datos de contacto",
|
|
15490
15560
|
nameLabel: "Nombre completo",
|
|
@@ -15540,22 +15610,22 @@ function CheckoutForm({
|
|
|
15540
15610
|
event.preventDefault();
|
|
15541
15611
|
if (discountCode.trim() && !discountApplying) onApplyDiscount();
|
|
15542
15612
|
}
|
|
15543
|
-
return /* @__PURE__ */ (0,
|
|
15613
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
15544
15614
|
loginPrompt,
|
|
15545
|
-
/* @__PURE__ */ (0,
|
|
15615
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
15546
15616
|
"form",
|
|
15547
15617
|
{
|
|
15548
15618
|
"data-testid": "checkout-form",
|
|
15549
15619
|
onSubmit,
|
|
15550
|
-
className: (0,
|
|
15620
|
+
className: (0, import_utils22.cn)("space-y-8", className),
|
|
15551
15621
|
"data-slot": "checkout-form",
|
|
15552
15622
|
children: [
|
|
15553
|
-
/* @__PURE__ */ (0,
|
|
15554
|
-
/* @__PURE__ */ (0,
|
|
15555
|
-
/* @__PURE__ */ (0,
|
|
15556
|
-
/* @__PURE__ */ (0,
|
|
15557
|
-
/* @__PURE__ */ (0,
|
|
15558
|
-
/* @__PURE__ */ (0,
|
|
15623
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("section", { className: "space-y-4", children: [
|
|
15624
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h2", { className: "border-b border-border pb-2 text-lg font-semibold", children: t.contactTitle }),
|
|
15625
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
|
|
15626
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "space-y-1", children: [
|
|
15627
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("label", { htmlFor: "checkout-form-name", className: "text-sm font-medium", children: t.nameLabel }),
|
|
15628
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
15559
15629
|
"input",
|
|
15560
15630
|
{
|
|
15561
15631
|
id: "checkout-form-name",
|
|
@@ -15564,17 +15634,17 @@ function CheckoutForm({
|
|
|
15564
15634
|
value: contact.name,
|
|
15565
15635
|
onChange: (e) => patchContact({ name: e.target.value }),
|
|
15566
15636
|
placeholder: t.namePlaceholder,
|
|
15567
|
-
className: (0,
|
|
15637
|
+
className: (0, import_utils22.cn)(
|
|
15568
15638
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
15569
15639
|
contactErrors?.name ? "border-destructive" : "border-border focus:border-primary"
|
|
15570
15640
|
)
|
|
15571
15641
|
}
|
|
15572
15642
|
),
|
|
15573
|
-
contactErrors?.name && /* @__PURE__ */ (0,
|
|
15643
|
+
contactErrors?.name && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-xs text-destructive", children: contactErrors.name })
|
|
15574
15644
|
] }),
|
|
15575
|
-
/* @__PURE__ */ (0,
|
|
15576
|
-
/* @__PURE__ */ (0,
|
|
15577
|
-
/* @__PURE__ */ (0,
|
|
15645
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "space-y-1", children: [
|
|
15646
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("label", { htmlFor: "checkout-form-email", className: "text-sm font-medium", children: t.emailLabel }),
|
|
15647
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
15578
15648
|
"input",
|
|
15579
15649
|
{
|
|
15580
15650
|
id: "checkout-form-email",
|
|
@@ -15583,15 +15653,15 @@ function CheckoutForm({
|
|
|
15583
15653
|
value: contact.email,
|
|
15584
15654
|
onChange: (e) => patchContact({ email: e.target.value }),
|
|
15585
15655
|
placeholder: t.emailPlaceholder,
|
|
15586
|
-
className: (0,
|
|
15656
|
+
className: (0, import_utils22.cn)(
|
|
15587
15657
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
15588
15658
|
contactErrors?.email ? "border-destructive" : "border-border focus:border-primary"
|
|
15589
15659
|
)
|
|
15590
15660
|
}
|
|
15591
15661
|
),
|
|
15592
|
-
contactErrors?.email && /* @__PURE__ */ (0,
|
|
15662
|
+
contactErrors?.email && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-xs text-destructive", children: contactErrors.email })
|
|
15593
15663
|
] }),
|
|
15594
|
-
/* @__PURE__ */ (0,
|
|
15664
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
15595
15665
|
import_phone_input.PhoneInput,
|
|
15596
15666
|
{
|
|
15597
15667
|
id: "checkout-form-phone",
|
|
@@ -15605,26 +15675,26 @@ function CheckoutForm({
|
|
|
15605
15675
|
] })
|
|
15606
15676
|
] }),
|
|
15607
15677
|
children2,
|
|
15608
|
-
generalError ? /* @__PURE__ */ (0,
|
|
15609
|
-
/* @__PURE__ */ (0,
|
|
15610
|
-
/* @__PURE__ */ (0,
|
|
15611
|
-
autoDiscount ? /* @__PURE__ */ (0,
|
|
15678
|
+
generalError ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { role: "alert", className: "text-sm text-destructive", children: generalError }) : null,
|
|
15679
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("section", { className: "space-y-3", children: [
|
|
15680
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h2", { className: "border-b border-border pb-2 text-lg font-semibold", children: t.discountTitle }),
|
|
15681
|
+
autoDiscount ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
15612
15682
|
"div",
|
|
15613
15683
|
{
|
|
15614
15684
|
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",
|
|
15615
15685
|
"data-slot": "checkout-staff-discount",
|
|
15616
15686
|
children: [
|
|
15617
|
-
/* @__PURE__ */ (0,
|
|
15618
|
-
/* @__PURE__ */ (0,
|
|
15687
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "font-semibold", children: t.staffDiscountApplied }),
|
|
15688
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: t.discountAppliedSuffix(formatPrice(autoDiscount.amount, currencyCode, locale)) })
|
|
15619
15689
|
]
|
|
15620
15690
|
}
|
|
15621
15691
|
) : null,
|
|
15622
|
-
appliedDiscount && !autoDiscount ? /* @__PURE__ */ (0,
|
|
15623
|
-
/* @__PURE__ */ (0,
|
|
15624
|
-
/* @__PURE__ */ (0,
|
|
15625
|
-
/* @__PURE__ */ (0,
|
|
15692
|
+
appliedDiscount && !autoDiscount ? /* @__PURE__ */ (0, import_jsx_runtime26.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: [
|
|
15693
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center gap-2 text-sm text-green-700 dark:text-green-400", children: [
|
|
15694
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "font-semibold", children: appliedDiscount.code }),
|
|
15695
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: t.discountAppliedSuffix(formatPrice(appliedDiscount.amount, currencyCode, locale)) })
|
|
15626
15696
|
] }),
|
|
15627
|
-
/* @__PURE__ */ (0,
|
|
15697
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
15628
15698
|
"button",
|
|
15629
15699
|
{
|
|
15630
15700
|
type: "button",
|
|
@@ -15634,9 +15704,9 @@ function CheckoutForm({
|
|
|
15634
15704
|
children: t.removeDiscount
|
|
15635
15705
|
}
|
|
15636
15706
|
)
|
|
15637
|
-
] }) : /* @__PURE__ */ (0,
|
|
15638
|
-
/* @__PURE__ */ (0,
|
|
15639
|
-
/* @__PURE__ */ (0,
|
|
15707
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex gap-2", children: [
|
|
15708
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("label", { htmlFor: "checkout-form-discount-code", className: "sr-only", children: t.discountTitle }),
|
|
15709
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
15640
15710
|
"input",
|
|
15641
15711
|
{
|
|
15642
15712
|
id: "checkout-form-discount-code",
|
|
@@ -15648,7 +15718,7 @@ function CheckoutForm({
|
|
|
15648
15718
|
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"
|
|
15649
15719
|
}
|
|
15650
15720
|
),
|
|
15651
|
-
/* @__PURE__ */ (0,
|
|
15721
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
15652
15722
|
"button",
|
|
15653
15723
|
{
|
|
15654
15724
|
type: "button",
|
|
@@ -15659,14 +15729,14 @@ function CheckoutForm({
|
|
|
15659
15729
|
}
|
|
15660
15730
|
)
|
|
15661
15731
|
] }),
|
|
15662
|
-
discountError && /* @__PURE__ */ (0,
|
|
15732
|
+
discountError && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-xs text-destructive", children: discountError })
|
|
15663
15733
|
] }),
|
|
15664
|
-
/* @__PURE__ */ (0,
|
|
15734
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
15665
15735
|
"button",
|
|
15666
15736
|
{
|
|
15667
15737
|
type: "submit",
|
|
15668
15738
|
disabled: submitting || submitDisabled,
|
|
15669
|
-
className: (0,
|
|
15739
|
+
className: (0, import_utils22.cn)(
|
|
15670
15740
|
"flex w-full cursor-pointer items-center justify-center gap-2 rounded-xl px-4 py-3 font-semibold transition-all",
|
|
15671
15741
|
submitting || submitDisabled ? "cursor-not-allowed bg-muted text-muted-foreground" : "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
15672
15742
|
),
|
|
@@ -15680,11 +15750,11 @@ function CheckoutForm({
|
|
|
15680
15750
|
}
|
|
15681
15751
|
|
|
15682
15752
|
// src/components/order-confirmation.tsx
|
|
15683
|
-
var
|
|
15753
|
+
var import_utils24 = require("@reblu/site-ui/utils");
|
|
15684
15754
|
|
|
15685
15755
|
// src/components/order-invoice-link.tsx
|
|
15686
|
-
var
|
|
15687
|
-
var
|
|
15756
|
+
var import_utils23 = require("@reblu/site-ui/utils");
|
|
15757
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
15688
15758
|
var DEFAULT_LABELS8 = {
|
|
15689
15759
|
linkLabel: "Descargar la factura {number}",
|
|
15690
15760
|
signInHint: "Te pediremos que inicies sesi\xF3n para abrirla."
|
|
@@ -15692,8 +15762,8 @@ var DEFAULT_LABELS8 = {
|
|
|
15692
15762
|
function OrderInvoiceLink({ invoice, labels, className }) {
|
|
15693
15763
|
if (!invoice) return null;
|
|
15694
15764
|
const t = { ...DEFAULT_LABELS8, ...labels };
|
|
15695
|
-
return /* @__PURE__ */ (0,
|
|
15696
|
-
/* @__PURE__ */ (0,
|
|
15765
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: (0, import_utils23.cn)("space-y-1 text-sm", className), "data-slot": "order-invoice-link", children: [
|
|
15766
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
15697
15767
|
"a",
|
|
15698
15768
|
{
|
|
15699
15769
|
href: invoice.url,
|
|
@@ -15701,12 +15771,12 @@ function OrderInvoiceLink({ invoice, labels, className }) {
|
|
|
15701
15771
|
children: t.linkLabel.replace("{number}", invoice.number)
|
|
15702
15772
|
}
|
|
15703
15773
|
),
|
|
15704
|
-
/* @__PURE__ */ (0,
|
|
15774
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-muted-foreground", children: t.signInHint })
|
|
15705
15775
|
] });
|
|
15706
15776
|
}
|
|
15707
15777
|
|
|
15708
15778
|
// src/components/order-confirmation.tsx
|
|
15709
|
-
var
|
|
15779
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
15710
15780
|
var DEFAULT_LABELS9 = {
|
|
15711
15781
|
pollingTitle: "Confirmando tu pedido\u2026",
|
|
15712
15782
|
pollingDescription: "Estamos procesando el pago, un momento\u2026",
|
|
@@ -15772,43 +15842,43 @@ function OrderConfirmation({
|
|
|
15772
15842
|
const showOrderReference = Boolean(order) && !showFullOrderSummary && (status === "refunded" || status === "partially_refunded" || status === "pending_timeout");
|
|
15773
15843
|
const showSessionReference = !order && sessionId && (status === "timeout" || status === "not_found" || status === "pending_timeout");
|
|
15774
15844
|
const showRecheck = (status === "pending_timeout" || status === "error") && onRecheck;
|
|
15775
|
-
return /* @__PURE__ */ (0,
|
|
15776
|
-
/* @__PURE__ */ (0,
|
|
15777
|
-
/* @__PURE__ */ (0,
|
|
15778
|
-
showFullOrderSummary && order && /* @__PURE__ */ (0,
|
|
15779
|
-
/* @__PURE__ */ (0,
|
|
15780
|
-
/* @__PURE__ */ (0,
|
|
15781
|
-
/* @__PURE__ */ (0,
|
|
15845
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: (0, import_utils24.cn)("space-y-6 text-center", className), "data-slot": "order-confirmation", children: [
|
|
15846
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("h1", { className: "text-3xl font-bold", children: title }),
|
|
15847
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "text-lg text-muted-foreground", children: description }),
|
|
15848
|
+
showFullOrderSummary && order && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "space-y-6", children: [
|
|
15849
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
15850
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.orderNumberLabel }),
|
|
15851
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "font-mono text-lg font-semibold", children: order.orderNumber })
|
|
15782
15852
|
] }),
|
|
15783
|
-
/* @__PURE__ */ (0,
|
|
15784
|
-
order.items.map((item, idx) => /* @__PURE__ */ (0,
|
|
15853
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "mx-auto max-w-sm space-y-3 rounded-xl border border-border bg-card p-5 text-left", children: [
|
|
15854
|
+
order.items.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
15785
15855
|
"div",
|
|
15786
15856
|
{
|
|
15787
15857
|
className: "flex justify-between gap-4 text-sm",
|
|
15788
15858
|
children: [
|
|
15789
|
-
/* @__PURE__ */ (0,
|
|
15859
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "max-w-[60%] truncate text-muted-foreground", children: [
|
|
15790
15860
|
item.product.name,
|
|
15791
15861
|
item.variant ? ` (${item.variant.name})` : "",
|
|
15792
15862
|
" x",
|
|
15793
15863
|
item.quantity
|
|
15794
15864
|
] }),
|
|
15795
|
-
/* @__PURE__ */ (0,
|
|
15865
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: formatPrice(item.total, currencyCode, locale) })
|
|
15796
15866
|
]
|
|
15797
15867
|
},
|
|
15798
15868
|
idx
|
|
15799
15869
|
)),
|
|
15800
|
-
/* @__PURE__ */ (0,
|
|
15801
|
-
/* @__PURE__ */ (0,
|
|
15802
|
-
/* @__PURE__ */ (0,
|
|
15870
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "space-y-1 border-t border-border pt-3 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex justify-between pt-1 text-base font-bold", children: [
|
|
15871
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: t.totalLabel }),
|
|
15872
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: formatPrice(order.total, currencyCode, locale) })
|
|
15803
15873
|
] }) })
|
|
15804
15874
|
] }),
|
|
15805
|
-
/* @__PURE__ */ (0,
|
|
15875
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("p", { className: "mx-auto max-w-sm text-sm text-muted-foreground", children: [
|
|
15806
15876
|
t.confirmationEmailPrefix,
|
|
15807
15877
|
" ",
|
|
15808
|
-
/* @__PURE__ */ (0,
|
|
15878
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "font-medium text-foreground", children: order.customerEmail }),
|
|
15809
15879
|
"."
|
|
15810
15880
|
] }),
|
|
15811
|
-
/* @__PURE__ */ (0,
|
|
15881
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
15812
15882
|
OrderInvoiceLink,
|
|
15813
15883
|
{
|
|
15814
15884
|
invoice: order.invoice,
|
|
@@ -15816,11 +15886,11 @@ function OrderConfirmation({
|
|
|
15816
15886
|
}
|
|
15817
15887
|
)
|
|
15818
15888
|
] }),
|
|
15819
|
-
showOrderReference && order && /* @__PURE__ */ (0,
|
|
15820
|
-
/* @__PURE__ */ (0,
|
|
15821
|
-
/* @__PURE__ */ (0,
|
|
15889
|
+
showOrderReference && order && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
15890
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.orderReferenceLabel }),
|
|
15891
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "font-mono text-lg font-semibold", children: order.orderNumber })
|
|
15822
15892
|
] }),
|
|
15823
|
-
status === "failed" && cartHref && /* @__PURE__ */ (0,
|
|
15893
|
+
status === "failed" && cartHref && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
15824
15894
|
"a",
|
|
15825
15895
|
{
|
|
15826
15896
|
href: cartHref,
|
|
@@ -15828,7 +15898,7 @@ function OrderConfirmation({
|
|
|
15828
15898
|
children: t.backToCartLabel
|
|
15829
15899
|
}
|
|
15830
15900
|
),
|
|
15831
|
-
showRecheck && /* @__PURE__ */ (0,
|
|
15901
|
+
showRecheck && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
15832
15902
|
"button",
|
|
15833
15903
|
{
|
|
15834
15904
|
type: "button",
|
|
@@ -15837,16 +15907,16 @@ function OrderConfirmation({
|
|
|
15837
15907
|
children: t.recheckLabel
|
|
15838
15908
|
}
|
|
15839
15909
|
),
|
|
15840
|
-
showSessionReference && /* @__PURE__ */ (0,
|
|
15841
|
-
/* @__PURE__ */ (0,
|
|
15842
|
-
/* @__PURE__ */ (0,
|
|
15910
|
+
showSessionReference && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
15911
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.sessionReferenceLabel }),
|
|
15912
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "break-all font-mono text-sm font-semibold", children: sessionId })
|
|
15843
15913
|
] })
|
|
15844
15914
|
] });
|
|
15845
15915
|
}
|
|
15846
15916
|
|
|
15847
15917
|
// src/components/full-invoice-fields.tsx
|
|
15848
|
-
var
|
|
15849
|
-
var
|
|
15918
|
+
var import_utils25 = require("@reblu/site-ui/utils");
|
|
15919
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
15850
15920
|
var EMPTY_FULL_INVOICE_VALUE = {
|
|
15851
15921
|
wantsFullInvoice: false,
|
|
15852
15922
|
billingIdType: "NIF",
|
|
@@ -15963,12 +16033,12 @@ function FullInvoiceFields({
|
|
|
15963
16033
|
const showFields = value.wantsFullInvoice || overCap;
|
|
15964
16034
|
const isSpanishNif = value.billingIdType === "NIF";
|
|
15965
16035
|
const set = (key2, next2) => onChange({ ...value, [key2]: next2 });
|
|
15966
|
-
const error = (key2) => errors[key2] ? /* @__PURE__ */ (0,
|
|
16036
|
+
const error = (key2) => errors[key2] ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { id: `full-invoice-${key2}-error`, className: "text-sm text-destructive", children: errors[key2] }) : null;
|
|
15967
16037
|
const invalid2 = (key2) => errors[key2] ? { "aria-invalid": true, "aria-describedby": `full-invoice-${key2}-error` } : {};
|
|
15968
|
-
return /* @__PURE__ */ (0,
|
|
15969
|
-
overCap ? /* @__PURE__ */ (0,
|
|
15970
|
-
/* @__PURE__ */ (0,
|
|
15971
|
-
/* @__PURE__ */ (0,
|
|
16038
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("section", { className: (0, import_utils25.cn)("space-y-4", className), "data-slot": "full-invoice-fields", children: [
|
|
16039
|
+
overCap ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { role: "note", className: "rounded-lg border border-border p-4 text-sm", children: t.overCapNotice }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "space-y-1", children: [
|
|
16040
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("label", { className: "flex items-center gap-2 text-sm font-medium", children: [
|
|
16041
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
15972
16042
|
"input",
|
|
15973
16043
|
{
|
|
15974
16044
|
type: "checkbox",
|
|
@@ -15978,12 +16048,12 @@ function FullInvoiceFields({
|
|
|
15978
16048
|
),
|
|
15979
16049
|
t.toggle
|
|
15980
16050
|
] }),
|
|
15981
|
-
/* @__PURE__ */ (0,
|
|
16051
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "text-sm text-muted-foreground", children: t.underCapNotice })
|
|
15982
16052
|
] }),
|
|
15983
|
-
showFields && /* @__PURE__ */ (0,
|
|
15984
|
-
/* @__PURE__ */ (0,
|
|
15985
|
-
/* @__PURE__ */ (0,
|
|
15986
|
-
/* @__PURE__ */ (0,
|
|
16053
|
+
showFields && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
|
|
16054
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "space-y-1", children: [
|
|
16055
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("label", { htmlFor: "full-invoice-id-type", className: "text-sm font-medium", children: t.idType }),
|
|
16056
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
15987
16057
|
"select",
|
|
15988
16058
|
{
|
|
15989
16059
|
id: "full-invoice-id-type",
|
|
@@ -15992,14 +16062,14 @@ function FullInvoiceFields({
|
|
|
15992
16062
|
value: value.billingIdType,
|
|
15993
16063
|
onChange: (e) => set("billingIdType", e.target.value),
|
|
15994
16064
|
...invalid2("billingIdType"),
|
|
15995
|
-
children: ID_TYPES.map((type) => /* @__PURE__ */ (0,
|
|
16065
|
+
children: ID_TYPES.map((type) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("option", { value: type, children: t.idTypeOptions[type] }, type))
|
|
15996
16066
|
}
|
|
15997
16067
|
),
|
|
15998
16068
|
error("billingIdType")
|
|
15999
16069
|
] }),
|
|
16000
|
-
!isSpanishNif && /* @__PURE__ */ (0,
|
|
16001
|
-
/* @__PURE__ */ (0,
|
|
16002
|
-
/* @__PURE__ */ (0,
|
|
16070
|
+
!isSpanishNif && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "space-y-1", children: [
|
|
16071
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("label", { htmlFor: "full-invoice-id-country", className: "text-sm font-medium", children: t.idCountry }),
|
|
16072
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
16003
16073
|
"select",
|
|
16004
16074
|
{
|
|
16005
16075
|
id: "full-invoice-id-country",
|
|
@@ -16009,16 +16079,16 @@ function FullInvoiceFields({
|
|
|
16009
16079
|
onChange: (e) => set("billingIdCountry", e.target.value),
|
|
16010
16080
|
...invalid2("billingIdCountry"),
|
|
16011
16081
|
children: [
|
|
16012
|
-
/* @__PURE__ */ (0,
|
|
16013
|
-
countries.map((c) => /* @__PURE__ */ (0,
|
|
16082
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("option", { value: "", disabled: true, children: t.chooseCountry }),
|
|
16083
|
+
countries.map((c) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("option", { value: c.code, children: c.name }, c.code))
|
|
16014
16084
|
]
|
|
16015
16085
|
}
|
|
16016
16086
|
),
|
|
16017
16087
|
error("billingIdCountry")
|
|
16018
16088
|
] }),
|
|
16019
|
-
/* @__PURE__ */ (0,
|
|
16020
|
-
/* @__PURE__ */ (0,
|
|
16021
|
-
/* @__PURE__ */ (0,
|
|
16089
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "space-y-1", children: [
|
|
16090
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("label", { htmlFor: "full-invoice-nif", className: "text-sm font-medium", children: isSpanishNif ? t.spanishNif : t.documentNumber }),
|
|
16091
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
16022
16092
|
"input",
|
|
16023
16093
|
{
|
|
16024
16094
|
id: "full-invoice-nif",
|
|
@@ -16031,9 +16101,9 @@ function FullInvoiceFields({
|
|
|
16031
16101
|
),
|
|
16032
16102
|
error("billingNif")
|
|
16033
16103
|
] }),
|
|
16034
|
-
/* @__PURE__ */ (0,
|
|
16035
|
-
/* @__PURE__ */ (0,
|
|
16036
|
-
/* @__PURE__ */ (0,
|
|
16104
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "space-y-1", children: [
|
|
16105
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("label", { htmlFor: "full-invoice-name", className: "text-sm font-medium", children: t.name }),
|
|
16106
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
16037
16107
|
"input",
|
|
16038
16108
|
{
|
|
16039
16109
|
id: "full-invoice-name",
|
|
@@ -16046,9 +16116,9 @@ function FullInvoiceFields({
|
|
|
16046
16116
|
),
|
|
16047
16117
|
error("billingName")
|
|
16048
16118
|
] }),
|
|
16049
|
-
/* @__PURE__ */ (0,
|
|
16050
|
-
/* @__PURE__ */ (0,
|
|
16051
|
-
/* @__PURE__ */ (0,
|
|
16119
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "space-y-1 sm:col-span-2", children: [
|
|
16120
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("label", { htmlFor: "full-invoice-street", className: "text-sm font-medium", children: t.street }),
|
|
16121
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
16052
16122
|
"input",
|
|
16053
16123
|
{
|
|
16054
16124
|
id: "full-invoice-street",
|
|
@@ -16060,9 +16130,9 @@ function FullInvoiceFields({
|
|
|
16060
16130
|
}
|
|
16061
16131
|
)
|
|
16062
16132
|
] }),
|
|
16063
|
-
/* @__PURE__ */ (0,
|
|
16064
|
-
/* @__PURE__ */ (0,
|
|
16065
|
-
/* @__PURE__ */ (0,
|
|
16133
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "space-y-1", children: [
|
|
16134
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("label", { htmlFor: "full-invoice-postal-code", className: "text-sm font-medium", children: t.postalCode }),
|
|
16135
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
16066
16136
|
"input",
|
|
16067
16137
|
{
|
|
16068
16138
|
id: "full-invoice-postal-code",
|
|
@@ -16073,9 +16143,9 @@ function FullInvoiceFields({
|
|
|
16073
16143
|
}
|
|
16074
16144
|
)
|
|
16075
16145
|
] }),
|
|
16076
|
-
/* @__PURE__ */ (0,
|
|
16077
|
-
/* @__PURE__ */ (0,
|
|
16078
|
-
/* @__PURE__ */ (0,
|
|
16146
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "space-y-1", children: [
|
|
16147
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("label", { htmlFor: "full-invoice-city", className: "text-sm font-medium", children: t.city }),
|
|
16148
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
16079
16149
|
"input",
|
|
16080
16150
|
{
|
|
16081
16151
|
id: "full-invoice-city",
|
|
@@ -16086,9 +16156,9 @@ function FullInvoiceFields({
|
|
|
16086
16156
|
}
|
|
16087
16157
|
)
|
|
16088
16158
|
] }),
|
|
16089
|
-
/* @__PURE__ */ (0,
|
|
16090
|
-
/* @__PURE__ */ (0,
|
|
16091
|
-
/* @__PURE__ */ (0,
|
|
16159
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "space-y-1", children: [
|
|
16160
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("label", { htmlFor: "full-invoice-country", className: "text-sm font-medium", children: t.country }),
|
|
16161
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
16092
16162
|
"select",
|
|
16093
16163
|
{
|
|
16094
16164
|
id: "full-invoice-country",
|
|
@@ -16096,18 +16166,18 @@ function FullInvoiceFields({
|
|
|
16096
16166
|
required: true,
|
|
16097
16167
|
value: value.country,
|
|
16098
16168
|
onChange: (e) => set("country", e.target.value),
|
|
16099
|
-
children: countries.map((c) => /* @__PURE__ */ (0,
|
|
16169
|
+
children: countries.map((c) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("option", { value: c.code, children: c.name }, c.code))
|
|
16100
16170
|
}
|
|
16101
16171
|
)
|
|
16102
16172
|
] }),
|
|
16103
|
-
/* @__PURE__ */ (0,
|
|
16173
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "sm:col-span-2", children: error("address") })
|
|
16104
16174
|
] })
|
|
16105
16175
|
] });
|
|
16106
16176
|
}
|
|
16107
16177
|
|
|
16108
16178
|
// src/components/contact-interest-field.tsx
|
|
16109
|
-
var
|
|
16110
|
-
var
|
|
16179
|
+
var import_utils26 = require("@reblu/site-ui/utils");
|
|
16180
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
16111
16181
|
function ContactInterestField({
|
|
16112
16182
|
interest,
|
|
16113
16183
|
value,
|
|
@@ -16124,18 +16194,18 @@ function ContactInterestField({
|
|
|
16124
16194
|
else next2.delete(option2);
|
|
16125
16195
|
onChange(interest.options.filter((candidate) => next2.has(candidate)));
|
|
16126
16196
|
};
|
|
16127
|
-
return /* @__PURE__ */ (0,
|
|
16128
|
-
/* @__PURE__ */ (0,
|
|
16129
|
-
/* @__PURE__ */ (0,
|
|
16197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("fieldset", { "data-slot": "contact-interest", className: (0, import_utils26.cn)("space-y-2", className), children: [
|
|
16198
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("legend", { className: "text-sm font-medium", children: interest.label }),
|
|
16199
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex flex-col gap-2", children: interest.options.map((option2, index) => {
|
|
16130
16200
|
const id = `${idPrefix}-${index}`;
|
|
16131
|
-
return /* @__PURE__ */ (0,
|
|
16201
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
16132
16202
|
"label",
|
|
16133
16203
|
{
|
|
16134
16204
|
htmlFor: id,
|
|
16135
16205
|
"data-slot": "contact-interest-option",
|
|
16136
16206
|
className: "flex items-center gap-2 text-sm",
|
|
16137
16207
|
children: [
|
|
16138
|
-
/* @__PURE__ */ (0,
|
|
16208
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
16139
16209
|
"input",
|
|
16140
16210
|
{
|
|
16141
16211
|
id,
|
|
@@ -16160,6 +16230,7 @@ var import_site_contracts = require("@reblu/site-contracts");
|
|
|
16160
16230
|
0 && (module.exports = {
|
|
16161
16231
|
ALLOWED_YOUTUBE_HOSTS,
|
|
16162
16232
|
AddedToCartToast,
|
|
16233
|
+
ArbitrationBadge,
|
|
16163
16234
|
CartAdjustmentsNotice,
|
|
16164
16235
|
CartLineList,
|
|
16165
16236
|
CartSummary,
|