@reblu/site-blocks 0.15.0 → 0.17.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 +27 -0
- package/README.md +48 -16
- package/dist/client.cjs +31 -14
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +9 -2
- package/dist/client.d.ts +9 -2
- package/dist/client.js +31 -13
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +116 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +52 -6
- package/dist/index.d.ts +52 -6
- package/dist/index.js +224 -136
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -13129,11 +13129,21 @@ function slotClassName(structural, defaults, consumer) {
|
|
|
13129
13129
|
}
|
|
13130
13130
|
|
|
13131
13131
|
// src/components/markdown-renderer.tsx
|
|
13132
|
-
import { Fragment, jsx } from "react/jsx-runtime";
|
|
13132
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
13133
13133
|
var HTML_TO_DOM_OPTIONS = { lowerCaseAttributeNames: false };
|
|
13134
13134
|
function parse3(html5, options) {
|
|
13135
13135
|
return domToReact(htmlToDOM(html5, HTML_TO_DOM_OPTIONS), options);
|
|
13136
13136
|
}
|
|
13137
|
+
function isAllowedImage(src, prefixes) {
|
|
13138
|
+
if (!src) return false;
|
|
13139
|
+
let url;
|
|
13140
|
+
try {
|
|
13141
|
+
url = new URL(src);
|
|
13142
|
+
} catch {
|
|
13143
|
+
return false;
|
|
13144
|
+
}
|
|
13145
|
+
return prefixes.some((prefix) => url.href.startsWith(prefix));
|
|
13146
|
+
}
|
|
13137
13147
|
var HEADING_CLASSES = {
|
|
13138
13148
|
1: "text-3xl font-bold mt-8 mb-4 first:mt-0",
|
|
13139
13149
|
2: "text-2xl font-bold mt-7 mb-3 first:mt-0",
|
|
@@ -13183,10 +13193,49 @@ function authorAttributes(el) {
|
|
|
13183
13193
|
function isExternalHref(href) {
|
|
13184
13194
|
return !!href && /^(https?:)?\/\//.test(href);
|
|
13185
13195
|
}
|
|
13186
|
-
function
|
|
13196
|
+
function soleImage(p2) {
|
|
13197
|
+
let image = null;
|
|
13198
|
+
for (const child of p2.children) {
|
|
13199
|
+
if (child instanceof Element) {
|
|
13200
|
+
if (child.name !== "img" || image) return null;
|
|
13201
|
+
image = child;
|
|
13202
|
+
} else if (child.type !== "text" || child.data?.trim()) {
|
|
13203
|
+
return null;
|
|
13204
|
+
}
|
|
13205
|
+
}
|
|
13206
|
+
return image;
|
|
13207
|
+
}
|
|
13208
|
+
function buildOptions(headingOffset, images) {
|
|
13209
|
+
const renderImage = (img) => {
|
|
13210
|
+
if (!images || !isAllowedImage(img.attribs.src, images.allowedUrlPrefixes)) return null;
|
|
13211
|
+
const image = { src: img.attribs.src, alt: img.attribs.alt ?? "" };
|
|
13212
|
+
if (images.render) return /* @__PURE__ */ jsx(Fragment, { children: images.render(image) });
|
|
13213
|
+
return /* @__PURE__ */ jsx(
|
|
13214
|
+
"img",
|
|
13215
|
+
{
|
|
13216
|
+
src: image.src,
|
|
13217
|
+
alt: image.alt,
|
|
13218
|
+
loading: "lazy",
|
|
13219
|
+
decoding: "async",
|
|
13220
|
+
className: "rounded-lg w-full h-auto"
|
|
13221
|
+
}
|
|
13222
|
+
);
|
|
13223
|
+
};
|
|
13187
13224
|
const options = {
|
|
13188
13225
|
replace: (node) => {
|
|
13189
13226
|
if (!(node instanceof Element)) return void 0;
|
|
13227
|
+
if (images && node.name === "p") {
|
|
13228
|
+
const img = soleImage(node);
|
|
13229
|
+
if (img) {
|
|
13230
|
+
const rendered = renderImage(img);
|
|
13231
|
+
if (rendered === null) return /* @__PURE__ */ jsx(Fragment, {});
|
|
13232
|
+
const caption = img.attribs.title?.trim();
|
|
13233
|
+
return /* @__PURE__ */ jsxs("figure", { className: "my-8", children: [
|
|
13234
|
+
rendered,
|
|
13235
|
+
caption ? /* @__PURE__ */ jsx("figcaption", { className: "mt-2 text-center text-sm text-muted-foreground", children: caption }) : null
|
|
13236
|
+
] });
|
|
13237
|
+
}
|
|
13238
|
+
}
|
|
13190
13239
|
const children2 = () => domToReact(node.children, options);
|
|
13191
13240
|
const { name, attribs } = node;
|
|
13192
13241
|
const author = authorAttributes(node);
|
|
@@ -13245,6 +13294,7 @@ function buildOptions(headingOffset) {
|
|
|
13245
13294
|
);
|
|
13246
13295
|
}
|
|
13247
13296
|
case "img":
|
|
13297
|
+
if (images) return renderImage(node) ?? /* @__PURE__ */ jsx(Fragment, {});
|
|
13248
13298
|
if (!attribs.src) return /* @__PURE__ */ jsx(Fragment, {});
|
|
13249
13299
|
return (
|
|
13250
13300
|
// Plain <img> keeps the block portable — a distributable can't assume a
|
|
@@ -13288,10 +13338,15 @@ function buildOptions(headingOffset) {
|
|
|
13288
13338
|
};
|
|
13289
13339
|
return options;
|
|
13290
13340
|
}
|
|
13291
|
-
function MarkdownRenderer({
|
|
13341
|
+
function MarkdownRenderer({
|
|
13342
|
+
content,
|
|
13343
|
+
className,
|
|
13344
|
+
headingOffset = 0,
|
|
13345
|
+
images
|
|
13346
|
+
}) {
|
|
13292
13347
|
const html5 = markdownToSafeHtml(content);
|
|
13293
13348
|
if (!html5) return null;
|
|
13294
|
-
return /* @__PURE__ */ jsx("div", { className: slotClassName("max-w-none", "", className), "data-slot": "markdown", children: parse3(html5, buildOptions(headingOffset)) });
|
|
13349
|
+
return /* @__PURE__ */ jsx("div", { className: slotClassName("max-w-none", "", className), "data-slot": "markdown", children: parse3(html5, buildOptions(headingOffset, images)) });
|
|
13295
13350
|
}
|
|
13296
13351
|
function SafeHtml({ html: html5, className, headingOffset = 0 }) {
|
|
13297
13352
|
if (!html5) return null;
|
|
@@ -13299,7 +13354,7 @@ function SafeHtml({ html: html5, className, headingOffset = 0 }) {
|
|
|
13299
13354
|
}
|
|
13300
13355
|
|
|
13301
13356
|
// src/components/course-description.tsx
|
|
13302
|
-
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
13357
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
13303
13358
|
function isVisiblyEmpty(html5) {
|
|
13304
13359
|
if (/<(img|iframe|hr)\b/i.test(html5)) return false;
|
|
13305
13360
|
return html5.replace(/<[^>]*>/g, "").trim() === "";
|
|
@@ -13330,7 +13385,7 @@ function CourseDescription({
|
|
|
13330
13385
|
return /* @__PURE__ */ jsx2("div", { "data-slot": "course-description", className, children: body3 });
|
|
13331
13386
|
}
|
|
13332
13387
|
const Tag = `h${headingLevel}`;
|
|
13333
|
-
return /* @__PURE__ */
|
|
13388
|
+
return /* @__PURE__ */ jsxs2(
|
|
13334
13389
|
"section",
|
|
13335
13390
|
{
|
|
13336
13391
|
"data-slot": "course-description",
|
|
@@ -13350,7 +13405,7 @@ import { cn as cn3 } from "@reblu/site-ui/utils";
|
|
|
13350
13405
|
// src/components/_page-parts.tsx
|
|
13351
13406
|
import { cn as cn2 } from "@reblu/site-ui/utils";
|
|
13352
13407
|
import { buttonVariants } from "@reblu/site-ui/button-variants";
|
|
13353
|
-
import { Fragment as Fragment2, jsx as jsx3, jsxs as
|
|
13408
|
+
import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
13354
13409
|
var KNOWN_BUTTON_VARIANTS = /* @__PURE__ */ new Set([
|
|
13355
13410
|
"default",
|
|
13356
13411
|
"destructive",
|
|
@@ -13363,7 +13418,7 @@ function toButtonVariant(variant) {
|
|
|
13363
13418
|
return variant && KNOWN_BUTTON_VARIANTS.has(variant) ? variant : "default";
|
|
13364
13419
|
}
|
|
13365
13420
|
function PageHero({ page }) {
|
|
13366
|
-
return /* @__PURE__ */
|
|
13421
|
+
return /* @__PURE__ */ jsxs3("header", { className: "space-y-4", children: [
|
|
13367
13422
|
page.category && /* @__PURE__ */ jsx3("span", { className: "inline-flex items-center rounded-full bg-secondary px-3 py-1 text-sm font-medium text-secondary-foreground", children: page.category.name }),
|
|
13368
13423
|
/* @__PURE__ */ jsx3("h1", { className: "text-4xl font-bold tracking-tight", children: page.title }),
|
|
13369
13424
|
page.subtitle && /* @__PURE__ */ jsx3("p", { className: "text-lg text-muted-foreground", children: page.subtitle }),
|
|
@@ -13396,7 +13451,7 @@ function SectionCta({ section }) {
|
|
|
13396
13451
|
}
|
|
13397
13452
|
function SectionImages({ section }) {
|
|
13398
13453
|
if (section.images.length === 0) return null;
|
|
13399
|
-
return /* @__PURE__ */ jsx3("div", { className: cn2("grid gap-4", section.images.length > 1 ? "sm:grid-cols-2" : "grid-cols-1"), children: section.images.map((img) => /* @__PURE__ */
|
|
13454
|
+
return /* @__PURE__ */ jsx3("div", { className: cn2("grid gap-4", section.images.length > 1 ? "sm:grid-cols-2" : "grid-cols-1"), children: section.images.map((img) => /* @__PURE__ */ jsxs3("figure", { className: "space-y-1", children: [
|
|
13400
13455
|
/* @__PURE__ */ jsx3("div", { className: "relative aspect-video w-full overflow-hidden rounded-lg bg-muted", children: /* @__PURE__ */ jsx3("img", { src: img.url, alt: img.alt, loading: "lazy", className: "h-full w-full object-cover" }) }),
|
|
13401
13456
|
img.caption && /* @__PURE__ */ jsx3("figcaption", { className: "text-sm text-muted-foreground", children: img.caption })
|
|
13402
13457
|
] }, `${img.url}-${img.order}`)) });
|
|
@@ -13405,21 +13460,21 @@ function PageSectionBlock({ section }) {
|
|
|
13405
13460
|
const imageFirst = section.layout === "IMAGE_TEXT";
|
|
13406
13461
|
const sideBySide = section.layout === "TEXT_IMAGE" || section.layout === "IMAGE_TEXT";
|
|
13407
13462
|
const hasImages = section.images.length > 0;
|
|
13408
|
-
const body3 = /* @__PURE__ */
|
|
13463
|
+
const body3 = /* @__PURE__ */ jsxs3("div", { className: "space-y-4", children: [
|
|
13409
13464
|
section.heading && /* @__PURE__ */ jsx3("h2", { className: "text-2xl font-bold", children: section.heading }),
|
|
13410
13465
|
/* @__PURE__ */ jsx3(SafeHtml, { html: sanitizeHtml(section.contentHtml), headingOffset: 2 }),
|
|
13411
13466
|
/* @__PURE__ */ jsx3(SectionCta, { section })
|
|
13412
13467
|
] });
|
|
13413
13468
|
if (sideBySide && hasImages) {
|
|
13414
|
-
return /* @__PURE__ */ jsx3("section", { className: "grid items-center gap-8 md:grid-cols-2", children: imageFirst ? /* @__PURE__ */
|
|
13469
|
+
return /* @__PURE__ */ jsx3("section", { className: "grid items-center gap-8 md:grid-cols-2", children: imageFirst ? /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
13415
13470
|
/* @__PURE__ */ jsx3(SectionImages, { section }),
|
|
13416
13471
|
body3
|
|
13417
|
-
] }) : /* @__PURE__ */
|
|
13472
|
+
] }) : /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
13418
13473
|
body3,
|
|
13419
13474
|
/* @__PURE__ */ jsx3(SectionImages, { section })
|
|
13420
13475
|
] }) });
|
|
13421
13476
|
}
|
|
13422
|
-
return /* @__PURE__ */
|
|
13477
|
+
return /* @__PURE__ */ jsxs3("section", { className: "space-y-4", children: [
|
|
13423
13478
|
body3,
|
|
13424
13479
|
/* @__PURE__ */ jsx3(SectionImages, { section })
|
|
13425
13480
|
] });
|
|
@@ -13431,9 +13486,9 @@ function PageSectionList({ sections }) {
|
|
|
13431
13486
|
}
|
|
13432
13487
|
|
|
13433
13488
|
// src/components/treatment.tsx
|
|
13434
|
-
import { jsx as jsx4, jsxs as
|
|
13489
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
13435
13490
|
function Treatment({ page, className }) {
|
|
13436
|
-
return /* @__PURE__ */
|
|
13491
|
+
return /* @__PURE__ */ jsxs4("article", { className: cn3("space-y-12", className), "data-slot": "treatment", children: [
|
|
13437
13492
|
/* @__PURE__ */ jsx4(PageHero, { page }),
|
|
13438
13493
|
/* @__PURE__ */ jsx4(PageSectionList, { sections: page.sections })
|
|
13439
13494
|
] });
|
|
@@ -13444,7 +13499,7 @@ import { cn as cn5 } from "@reblu/site-ui/utils";
|
|
|
13444
13499
|
|
|
13445
13500
|
// src/components/page-card-grid.tsx
|
|
13446
13501
|
import { cn as cn4 } from "@reblu/site-ui/utils";
|
|
13447
|
-
import { jsx as jsx5, jsxs as
|
|
13502
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
13448
13503
|
var defaultPageHref = (page) => `/${page.slug}`;
|
|
13449
13504
|
var pageKey = (page) => `${page.category?.slug ?? ""}/${page.slug}`;
|
|
13450
13505
|
function PageCardGrid(props) {
|
|
@@ -13459,9 +13514,9 @@ function PageCardGridSection({
|
|
|
13459
13514
|
}) {
|
|
13460
13515
|
if (pages.length === 0) return null;
|
|
13461
13516
|
const showHeading = keepEmptyHeading ? heading !== void 0 : !!heading;
|
|
13462
|
-
return /* @__PURE__ */
|
|
13517
|
+
return /* @__PURE__ */ jsxs5("section", { className: cn4("space-y-6", className), children: [
|
|
13463
13518
|
showHeading && /* @__PURE__ */ jsx5("h2", { className: "text-2xl font-bold", children: heading }),
|
|
13464
|
-
/* @__PURE__ */ jsx5("ul", { className: "grid list-none grid-cols-1 gap-6 p-0 sm:grid-cols-2 lg:grid-cols-3", children: pages.map((page) => /* @__PURE__ */ jsx5("li", { children: /* @__PURE__ */
|
|
13519
|
+
/* @__PURE__ */ jsx5("ul", { className: "grid list-none grid-cols-1 gap-6 p-0 sm:grid-cols-2 lg:grid-cols-3", children: pages.map((page) => /* @__PURE__ */ jsx5("li", { children: /* @__PURE__ */ jsxs5(
|
|
13465
13520
|
"a",
|
|
13466
13521
|
{
|
|
13467
13522
|
href: pageHref(page),
|
|
@@ -13476,7 +13531,7 @@ function PageCardGridSection({
|
|
|
13476
13531
|
className: "h-full w-full object-cover transition-transform group-hover:scale-105"
|
|
13477
13532
|
}
|
|
13478
13533
|
) }),
|
|
13479
|
-
/* @__PURE__ */
|
|
13534
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex flex-1 flex-col gap-2 p-4", children: [
|
|
13480
13535
|
/* @__PURE__ */ jsx5("h3", { className: "font-semibold leading-tight transition-colors group-hover:text-primary", children: page.title }),
|
|
13481
13536
|
page.excerpt && /* @__PURE__ */ jsx5("p", { className: "line-clamp-2 text-sm text-muted-foreground", children: page.excerpt })
|
|
13482
13537
|
] })
|
|
@@ -13487,7 +13542,7 @@ function PageCardGridSection({
|
|
|
13487
13542
|
}
|
|
13488
13543
|
|
|
13489
13544
|
// src/components/parent-page.tsx
|
|
13490
|
-
import { jsx as jsx6, jsxs as
|
|
13545
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
13491
13546
|
var defaultChildPageHref = (slug) => `/${slug}`;
|
|
13492
13547
|
function ParentPage({
|
|
13493
13548
|
page,
|
|
@@ -13502,7 +13557,7 @@ function ParentPage({
|
|
|
13502
13557
|
const pages = childPages ?? treatments ?? [];
|
|
13503
13558
|
const hrefFor = childPageHref ?? treatmentHref ?? defaultChildPageHref;
|
|
13504
13559
|
const label = childPagesLabel ?? treatmentsLabel ?? "Treatments";
|
|
13505
|
-
return /* @__PURE__ */
|
|
13560
|
+
return /* @__PURE__ */ jsxs6("article", { className: cn5("space-y-12", className), "data-slot": "specialty", children: [
|
|
13506
13561
|
/* @__PURE__ */ jsx6(PageHero, { page }),
|
|
13507
13562
|
/* @__PURE__ */ jsx6(PageSectionList, { sections: page.sections }),
|
|
13508
13563
|
/* @__PURE__ */ jsx6(
|
|
@@ -13522,13 +13577,13 @@ var Specialty = ParentPage;
|
|
|
13522
13577
|
|
|
13523
13578
|
// src/components/profile-card.tsx
|
|
13524
13579
|
import { cn as cn6 } from "@reblu/site-ui/utils";
|
|
13525
|
-
import { jsx as jsx7, jsxs as
|
|
13580
|
+
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
13526
13581
|
function initials(name) {
|
|
13527
13582
|
return name.split(/\s+/).filter(Boolean).slice(0, 2).map((part) => part[0]?.toUpperCase() ?? "").join("");
|
|
13528
13583
|
}
|
|
13529
13584
|
function ProfileCard({ name, role, imageUrl, specialties = [], bio, href, className }) {
|
|
13530
13585
|
const NameTag = href ? "a" : "span";
|
|
13531
|
-
return /* @__PURE__ */
|
|
13586
|
+
return /* @__PURE__ */ jsxs7(
|
|
13532
13587
|
"article",
|
|
13533
13588
|
{
|
|
13534
13589
|
className: cn6(
|
|
@@ -13538,7 +13593,7 @@ function ProfileCard({ name, role, imageUrl, specialties = [], bio, href, classN
|
|
|
13538
13593
|
"data-slot": "profile-card",
|
|
13539
13594
|
children: [
|
|
13540
13595
|
/* @__PURE__ */ jsx7("div", { className: "relative h-24 w-24 overflow-hidden rounded-full bg-muted", children: imageUrl ? /* @__PURE__ */ jsx7("img", { src: imageUrl, alt: name, loading: "lazy", className: "h-full w-full object-cover" }) : /* @__PURE__ */ jsx7("span", { className: "flex h-full w-full items-center justify-center text-2xl font-semibold text-muted-foreground", "aria-hidden": "true", children: initials(name) }) }),
|
|
13541
|
-
/* @__PURE__ */
|
|
13596
|
+
/* @__PURE__ */ jsxs7("div", { className: "space-y-1", children: [
|
|
13542
13597
|
/* @__PURE__ */ jsx7("h3", { className: "text-lg font-semibold leading-tight", children: /* @__PURE__ */ jsx7(
|
|
13543
13598
|
NameTag,
|
|
13544
13599
|
{
|
|
@@ -13564,11 +13619,11 @@ function ProfileCard({ name, role, imageUrl, specialties = [], bio, href, classN
|
|
|
13564
13619
|
|
|
13565
13620
|
// src/components/product-card.tsx
|
|
13566
13621
|
import { cn as cn7 } from "@reblu/site-ui/utils";
|
|
13567
|
-
import { jsx as jsx8, jsxs as
|
|
13622
|
+
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
13568
13623
|
function ProductCard({ product, href, currencyCode = "EUR", locale, className }) {
|
|
13569
13624
|
const image = product.images.find((i) => i.isPrimary) ?? product.images[0];
|
|
13570
13625
|
const hasDiscount = product.comparePrice != null && product.comparePrice > product.price;
|
|
13571
|
-
return /* @__PURE__ */
|
|
13626
|
+
return /* @__PURE__ */ jsxs8(
|
|
13572
13627
|
"article",
|
|
13573
13628
|
{
|
|
13574
13629
|
className: cn7(
|
|
@@ -13586,11 +13641,11 @@ function ProductCard({ product, href, currencyCode = "EUR", locale, className })
|
|
|
13586
13641
|
className: "h-full w-full object-cover transition-transform group-hover:scale-105"
|
|
13587
13642
|
}
|
|
13588
13643
|
) : /* @__PURE__ */ jsx8("div", { className: "flex h-full items-center justify-center text-4xl text-muted-foreground/30", "aria-hidden": "true", children: "\u{1F6CD}\uFE0F" }) }),
|
|
13589
|
-
/* @__PURE__ */
|
|
13644
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex flex-1 flex-col gap-2 p-4", children: [
|
|
13590
13645
|
product.category && /* @__PURE__ */ jsx8("span", { className: "inline-flex w-fit items-center rounded-full bg-secondary px-2.5 py-0.5 text-xs font-medium text-secondary-foreground", children: product.category.name }),
|
|
13591
13646
|
/* @__PURE__ */ jsx8("h3", { className: "text-base font-semibold leading-tight", children: href ? /* @__PURE__ */ jsx8("a", { href, className: "transition-colors hover:text-primary", children: product.name }) : product.name }),
|
|
13592
13647
|
product.shortDescription && /* @__PURE__ */ jsx8("p", { className: "line-clamp-2 text-sm text-muted-foreground", children: product.shortDescription }),
|
|
13593
|
-
/* @__PURE__ */
|
|
13648
|
+
/* @__PURE__ */ jsxs8("div", { className: "mt-auto flex items-baseline gap-2 pt-2", children: [
|
|
13594
13649
|
/* @__PURE__ */ jsx8("span", { className: "text-lg font-bold text-foreground", children: formatPrice(product.price, currencyCode, locale) }),
|
|
13595
13650
|
hasDiscount && /* @__PURE__ */ jsx8("span", { className: "text-sm text-muted-foreground line-through", children: formatPrice(product.comparePrice, currencyCode, locale) })
|
|
13596
13651
|
] })
|
|
@@ -13794,7 +13849,7 @@ var __iconNode8 = [
|
|
|
13794
13849
|
var Truck = createLucideIcon("truck", __iconNode8);
|
|
13795
13850
|
|
|
13796
13851
|
// src/components/product-trust-items.tsx
|
|
13797
|
-
import { jsx as jsx9, jsxs as
|
|
13852
|
+
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
13798
13853
|
var DEFAULT_TRUST_ICONS = Object.freeze({
|
|
13799
13854
|
shipping: Truck,
|
|
13800
13855
|
returns: RotateCcw,
|
|
@@ -13828,7 +13883,7 @@ function ProductTrustItems({
|
|
|
13828
13883
|
return [{ key: `${index}-${icon}`, Icon: Icon2, text: text3 }];
|
|
13829
13884
|
});
|
|
13830
13885
|
if (rows.length === 0) return null;
|
|
13831
|
-
return /* @__PURE__ */ jsx9(List, { "data-slot": "product-trust-items", className: slotClassName("space-y-2.5", "", className), children: rows.map(({ key: key2, Icon: Icon2, text: text3 }) => /* @__PURE__ */
|
|
13886
|
+
return /* @__PURE__ */ jsx9(List, { "data-slot": "product-trust-items", className: slotClassName("space-y-2.5", "", className), children: rows.map(({ key: key2, Icon: Icon2, text: text3 }) => /* @__PURE__ */ jsxs9("li", { className: slotClassName("flex items-center gap-3", "text-sm text-muted-foreground", itemClassName), children: [
|
|
13832
13887
|
/* @__PURE__ */ jsx9(Icon2, { "aria-hidden": "true", className: "h-4 w-4 shrink-0 text-foreground/60" }),
|
|
13833
13888
|
/* @__PURE__ */ jsx9("span", { children: text3 })
|
|
13834
13889
|
] }, key2)) });
|
|
@@ -13852,7 +13907,7 @@ function Heading({
|
|
|
13852
13907
|
}
|
|
13853
13908
|
|
|
13854
13909
|
// src/components/faq-accordion.tsx
|
|
13855
|
-
import { jsx as jsx11, jsxs as
|
|
13910
|
+
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
13856
13911
|
function FaqAccordion({
|
|
13857
13912
|
items,
|
|
13858
13913
|
heading,
|
|
@@ -13863,16 +13918,16 @@ function FaqAccordion({
|
|
|
13863
13918
|
}) {
|
|
13864
13919
|
const visible = items.map((item, index) => ({ item, index })).filter(({ item }) => item.q.trim() !== "");
|
|
13865
13920
|
if (visible.length === 0) return null;
|
|
13866
|
-
return /* @__PURE__ */
|
|
13921
|
+
return /* @__PURE__ */ jsxs10("div", { className: cn8("space-y-4", className), "data-slot": "faq-accordion", children: [
|
|
13867
13922
|
heading && /* @__PURE__ */ jsx11(Heading, { level: headingLevel, className: "text-2xl font-semibold tracking-tight", children: heading }),
|
|
13868
|
-
/* @__PURE__ */ jsx11("div", { className: "divide-y divide-border rounded-xl border border-border", children: visible.map(({ item, index }) => /* @__PURE__ */
|
|
13923
|
+
/* @__PURE__ */ jsx11("div", { className: "divide-y divide-border rounded-xl border border-border", children: visible.map(({ item, index }) => /* @__PURE__ */ jsxs10(
|
|
13869
13924
|
"details",
|
|
13870
13925
|
{
|
|
13871
13926
|
className: "group px-4",
|
|
13872
13927
|
"data-slot": "faq-item",
|
|
13873
13928
|
...defaultOpen.includes(index) ? { open: true } : {},
|
|
13874
13929
|
children: [
|
|
13875
|
-
/* @__PURE__ */
|
|
13930
|
+
/* @__PURE__ */ jsxs10("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-4 py-4 font-medium focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring [&::-webkit-details-marker]:hidden", children: [
|
|
13876
13931
|
questionHeadingLevel ? /* @__PURE__ */ jsx11(Heading, { level: questionHeadingLevel, className: "text-base font-medium", children: item.q }) : /* @__PURE__ */ jsx11("span", { children: item.q }),
|
|
13877
13932
|
/* @__PURE__ */ jsx11(
|
|
13878
13933
|
"span",
|
|
@@ -13893,7 +13948,7 @@ function FaqAccordion({
|
|
|
13893
13948
|
|
|
13894
13949
|
// src/components/trust-badges.tsx
|
|
13895
13950
|
import { cn as cn9 } from "@reblu/site-ui/utils";
|
|
13896
|
-
import { jsx as jsx12, jsxs as
|
|
13951
|
+
import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
13897
13952
|
var DEFAULT_TRUST_BADGE_HEADINGS = Object.freeze(
|
|
13898
13953
|
{
|
|
13899
13954
|
PARTNER: "Colaboradores",
|
|
@@ -13925,14 +13980,20 @@ function safeHref(url) {
|
|
|
13925
13980
|
return null;
|
|
13926
13981
|
}
|
|
13927
13982
|
}
|
|
13983
|
+
function safeLogoSrc(url) {
|
|
13984
|
+
if (typeof url !== "string" || url === "") return null;
|
|
13985
|
+
if (url.startsWith("/")) return url.startsWith("//") || url.startsWith("/\\") ? null : url;
|
|
13986
|
+
return safeHref(url);
|
|
13987
|
+
}
|
|
13928
13988
|
function BadgeContent({ badge, logoClassName }) {
|
|
13929
|
-
|
|
13989
|
+
const src = safeLogoSrc(badge.logoUrl);
|
|
13990
|
+
if (src) {
|
|
13930
13991
|
return (
|
|
13931
13992
|
// eslint-disable-next-line @next/next/no-img-element -- framework-agnostic SDK; the SITE owns image optimisation
|
|
13932
13993
|
/* @__PURE__ */ jsx12(
|
|
13933
13994
|
"img",
|
|
13934
13995
|
{
|
|
13935
|
-
src
|
|
13996
|
+
src,
|
|
13936
13997
|
alt: badge.name,
|
|
13937
13998
|
loading: "lazy",
|
|
13938
13999
|
className: cn9("h-12 w-auto object-contain", logoClassName)
|
|
@@ -13946,11 +14007,14 @@ function TrustBadges({
|
|
|
13946
14007
|
badges,
|
|
13947
14008
|
headings,
|
|
13948
14009
|
types = DEFAULT_TRUST_BADGE_TYPE_ORDER,
|
|
14010
|
+
heading,
|
|
14011
|
+
headingId = "trust-badges-heading",
|
|
13949
14012
|
headingLevel = 2,
|
|
13950
14013
|
newWindowLabel = "(se abre en una ventana nueva)",
|
|
13951
14014
|
className,
|
|
13952
14015
|
groupClassName,
|
|
13953
14016
|
headingClassName,
|
|
14017
|
+
sectionHeadingClassName,
|
|
13954
14018
|
listClassName,
|
|
13955
14019
|
logoClassName
|
|
13956
14020
|
}) {
|
|
@@ -13959,59 +14023,79 @@ function TrustBadges({
|
|
|
13959
14023
|
const groups = types.flatMap((type) => {
|
|
13960
14024
|
const items = usable.filter((b2) => b2.type === type).map((b2, index) => ({ b: b2, index })).sort((x2, y2) => (x2.b.sortOrder ?? 0) - (y2.b.sortOrder ?? 0) || x2.index - y2.index).map(({ b: b2 }) => b2);
|
|
13961
14025
|
if (items.length === 0) return [];
|
|
13962
|
-
const
|
|
13963
|
-
return [{ type,
|
|
14026
|
+
const groupHeading = headings && Object.prototype.hasOwnProperty.call(headings, type) ? headings[type] : DEFAULT_TRUST_BADGE_HEADINGS[type];
|
|
14027
|
+
return [{ type, groupHeading, items }];
|
|
13964
14028
|
});
|
|
13965
14029
|
if (groups.length === 0) return null;
|
|
13966
|
-
|
|
14030
|
+
const hasHeading = heading !== void 0 && heading !== null && heading !== "";
|
|
14031
|
+
const groupHeadingLevel = hasHeading ? nextHeadingLevel(headingLevel) : headingLevel;
|
|
14032
|
+
const content = groups.map(({ type, groupHeading, items }) => /* @__PURE__ */ jsxs11(
|
|
13967
14033
|
"div",
|
|
13968
14034
|
{
|
|
13969
14035
|
"data-slot": "trust-badge-group",
|
|
13970
14036
|
"data-type": type,
|
|
13971
14037
|
className: cn9("space-y-3", groupClassName),
|
|
13972
14038
|
children: [
|
|
13973
|
-
|
|
14039
|
+
groupHeading ? /* @__PURE__ */ jsx12(
|
|
13974
14040
|
Heading,
|
|
13975
14041
|
{
|
|
13976
|
-
level:
|
|
13977
|
-
className:
|
|
13978
|
-
|
|
14042
|
+
level: groupHeadingLevel,
|
|
14043
|
+
className: slotClassName(
|
|
14044
|
+
"",
|
|
14045
|
+
"text-sm font-semibold uppercase tracking-widest",
|
|
14046
|
+
headingClassName
|
|
14047
|
+
),
|
|
14048
|
+
children: groupHeading
|
|
13979
14049
|
}
|
|
13980
14050
|
) : null,
|
|
13981
14051
|
/* @__PURE__ */ jsx12("ul", { className: cn9("flex flex-wrap items-center gap-6", listClassName), children: items.map((badge) => {
|
|
13982
14052
|
const href = safeHref(badge.url);
|
|
13983
|
-
return /* @__PURE__ */ jsx12("li", { children: href ? /* @__PURE__ */
|
|
13984
|
-
|
|
13985
|
-
|
|
13986
|
-
|
|
13987
|
-
|
|
13988
|
-
rel: "noopener noreferrer",
|
|
13989
|
-
className: "inline-flex",
|
|
13990
|
-
children: [
|
|
13991
|
-
/* @__PURE__ */ jsx12(BadgeContent, { badge, logoClassName }),
|
|
13992
|
-
" ",
|
|
13993
|
-
/* @__PURE__ */ jsx12("span", { className: "sr-only", children: newWindowLabel })
|
|
13994
|
-
]
|
|
13995
|
-
}
|
|
13996
|
-
) : /* @__PURE__ */ jsx12(BadgeContent, { badge, logoClassName }) }, badge.id);
|
|
14053
|
+
return /* @__PURE__ */ jsx12("li", { children: href ? /* @__PURE__ */ jsxs11("a", { href, target: "_blank", rel: "noopener noreferrer", className: "inline-flex", children: [
|
|
14054
|
+
/* @__PURE__ */ jsx12(BadgeContent, { badge, logoClassName }),
|
|
14055
|
+
" ",
|
|
14056
|
+
/* @__PURE__ */ jsx12("span", { className: "sr-only", children: newWindowLabel })
|
|
14057
|
+
] }) : /* @__PURE__ */ jsx12(BadgeContent, { badge, logoClassName }) }, badge.id);
|
|
13997
14058
|
}) })
|
|
13998
14059
|
]
|
|
13999
14060
|
},
|
|
14000
14061
|
type
|
|
14001
|
-
))
|
|
14062
|
+
));
|
|
14063
|
+
if (!hasHeading) {
|
|
14064
|
+
return /* @__PURE__ */ jsx12("div", { "data-slot": "trust-badges", className: cn9("space-y-6", className), children: content });
|
|
14065
|
+
}
|
|
14066
|
+
const Tag = `h${headingLevel}`;
|
|
14067
|
+
return /* @__PURE__ */ jsxs11(
|
|
14068
|
+
"section",
|
|
14069
|
+
{
|
|
14070
|
+
"data-slot": "trust-badges",
|
|
14071
|
+
"aria-labelledby": headingId,
|
|
14072
|
+
className: cn9("space-y-6", className),
|
|
14073
|
+
children: [
|
|
14074
|
+
/* @__PURE__ */ jsx12(
|
|
14075
|
+
Tag,
|
|
14076
|
+
{
|
|
14077
|
+
id: headingId,
|
|
14078
|
+
className: slotClassName("", "text-xl font-semibold", sectionHeadingClassName),
|
|
14079
|
+
children: heading
|
|
14080
|
+
}
|
|
14081
|
+
),
|
|
14082
|
+
content
|
|
14083
|
+
]
|
|
14084
|
+
}
|
|
14085
|
+
);
|
|
14002
14086
|
}
|
|
14003
14087
|
|
|
14004
14088
|
// src/components/page-blocks.tsx
|
|
14005
14089
|
import { cn as cn10 } from "@reblu/site-ui/utils";
|
|
14006
14090
|
import { buttonVariants as buttonVariants2 } from "@reblu/site-ui/button-variants";
|
|
14007
|
-
import { jsx as jsx13, jsxs as
|
|
14091
|
+
import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
14008
14092
|
var ALIASES = {
|
|
14009
14093
|
doctor_embed: "profile_embed",
|
|
14010
14094
|
specialty_embed: "page_embed"
|
|
14011
14095
|
};
|
|
14012
14096
|
function HeroBlock({ block, headingLevel }) {
|
|
14013
14097
|
const { title, subtitle, imageUrl } = block.data;
|
|
14014
|
-
return /* @__PURE__ */
|
|
14098
|
+
return /* @__PURE__ */ jsxs12("div", { className: "space-y-4", children: [
|
|
14015
14099
|
/* @__PURE__ */ jsx13(Heading, { level: headingLevel, className: "text-3xl font-bold tracking-tight md:text-4xl", children: title }),
|
|
14016
14100
|
subtitle && /* @__PURE__ */ jsx13("p", { className: "text-lg opacity-80", children: subtitle }),
|
|
14017
14101
|
imageUrl && /* @__PURE__ */ jsx13("div", { className: "relative aspect-[21/9] w-full overflow-hidden rounded-xl bg-muted", children: /* @__PURE__ */ jsx13("img", { src: imageUrl, alt: "", loading: "lazy", className: "h-full w-full object-cover" }) })
|
|
@@ -14024,16 +14108,16 @@ function FaqBlock({ block }) {
|
|
|
14024
14108
|
return /* @__PURE__ */ jsx13(FaqAccordion, { items: block.data.items });
|
|
14025
14109
|
}
|
|
14026
14110
|
function StatsBlock({ block }) {
|
|
14027
|
-
return /* @__PURE__ */ jsx13("dl", { className: "grid gap-6 sm:grid-cols-2 lg:grid-cols-4", children: block.data.items.map((item, i) => /* @__PURE__ */
|
|
14111
|
+
return /* @__PURE__ */ jsx13("dl", { className: "grid gap-6 sm:grid-cols-2 lg:grid-cols-4", children: block.data.items.map((item, i) => /* @__PURE__ */ jsxs12("div", { className: "flex flex-col-reverse gap-1", children: [
|
|
14028
14112
|
/* @__PURE__ */ jsx13("dt", { className: "text-sm opacity-80", children: item.label }),
|
|
14029
14113
|
/* @__PURE__ */ jsx13("dd", { className: "text-3xl font-bold", children: item.value })
|
|
14030
14114
|
] }, i)) });
|
|
14031
14115
|
}
|
|
14032
14116
|
function TestimonialBlock({ block }) {
|
|
14033
14117
|
const { quote, author, role, avatarUrl } = block.data;
|
|
14034
|
-
return /* @__PURE__ */
|
|
14118
|
+
return /* @__PURE__ */ jsxs12("figure", { className: "space-y-4", children: [
|
|
14035
14119
|
/* @__PURE__ */ jsx13("blockquote", { className: "text-xl italic", children: /* @__PURE__ */ jsx13("p", { children: quote }) }),
|
|
14036
|
-
/* @__PURE__ */
|
|
14120
|
+
/* @__PURE__ */ jsxs12("figcaption", { className: "flex items-center gap-3", children: [
|
|
14037
14121
|
avatarUrl && // eslint-disable-next-line @next/next/no-img-element
|
|
14038
14122
|
/* @__PURE__ */ jsx13(
|
|
14039
14123
|
"img",
|
|
@@ -14044,7 +14128,7 @@ function TestimonialBlock({ block }) {
|
|
|
14044
14128
|
className: "h-10 w-10 rounded-full object-cover"
|
|
14045
14129
|
}
|
|
14046
14130
|
),
|
|
14047
|
-
/* @__PURE__ */
|
|
14131
|
+
/* @__PURE__ */ jsxs12("span", { children: [
|
|
14048
14132
|
/* @__PURE__ */ jsx13("span", { className: "font-semibold", children: author }),
|
|
14049
14133
|
role && /* @__PURE__ */ jsx13("span", { className: "block text-sm opacity-80", children: role })
|
|
14050
14134
|
] })
|
|
@@ -14066,7 +14150,7 @@ function GalleryBlock({ block }) {
|
|
|
14066
14150
|
"grid gap-4",
|
|
14067
14151
|
images.length > 1 ? "sm:grid-cols-2 lg:grid-cols-3" : "grid-cols-1"
|
|
14068
14152
|
),
|
|
14069
|
-
children: images.map((img, i) => /* @__PURE__ */
|
|
14153
|
+
children: images.map((img, i) => /* @__PURE__ */ jsxs12("figure", { className: "space-y-1", children: [
|
|
14070
14154
|
/* @__PURE__ */ jsx13("div", { className: "relative aspect-video w-full overflow-hidden rounded-lg bg-muted", children: /* @__PURE__ */ jsx13(
|
|
14071
14155
|
"img",
|
|
14072
14156
|
{
|
|
@@ -14086,7 +14170,7 @@ function EmbedCard({
|
|
|
14086
14170
|
headingLevel,
|
|
14087
14171
|
embedHref
|
|
14088
14172
|
}) {
|
|
14089
|
-
return /* @__PURE__ */
|
|
14173
|
+
return /* @__PURE__ */ jsxs12(
|
|
14090
14174
|
"a",
|
|
14091
14175
|
{
|
|
14092
14176
|
href: embedHref(resolved),
|
|
@@ -14101,7 +14185,7 @@ function EmbedCard({
|
|
|
14101
14185
|
className: "h-full w-full object-cover"
|
|
14102
14186
|
}
|
|
14103
14187
|
) }),
|
|
14104
|
-
/* @__PURE__ */
|
|
14188
|
+
/* @__PURE__ */ jsxs12("div", { className: "space-y-1 p-4", children: [
|
|
14105
14189
|
/* @__PURE__ */ jsx13(Heading, { level: headingLevel, className: "text-lg font-semibold", children: resolved.title }),
|
|
14106
14190
|
resolved.role && /* @__PURE__ */ jsx13("p", { className: "text-sm text-muted-foreground", children: resolved.role }),
|
|
14107
14191
|
resolved.excerpt && /* @__PURE__ */ jsx13("p", { className: "text-muted-foreground", children: resolved.excerpt })
|
|
@@ -14208,7 +14292,7 @@ function PageBlocks({
|
|
|
14208
14292
|
const headingId = block.heading ? `${safePrefix}-${toIdFragment(block.id)}-heading` : void 0;
|
|
14209
14293
|
const background = block.backgroundColor;
|
|
14210
14294
|
return [
|
|
14211
|
-
/* @__PURE__ */
|
|
14295
|
+
/* @__PURE__ */ jsxs12(
|
|
14212
14296
|
"section",
|
|
14213
14297
|
{
|
|
14214
14298
|
"data-slot": "page-block",
|
|
@@ -14239,7 +14323,7 @@ function PageBlocks({
|
|
|
14239
14323
|
|
|
14240
14324
|
// src/components/shop-filters.tsx
|
|
14241
14325
|
import { cn as cn11 } from "@reblu/site-ui/utils";
|
|
14242
|
-
import { jsx as jsx14, jsxs as
|
|
14326
|
+
import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
14243
14327
|
var DEFAULT_SHOP_PRICE_BANDS = [
|
|
14244
14328
|
{ max: 2500 },
|
|
14245
14329
|
{ min: 2500, max: 5e3 },
|
|
@@ -14301,7 +14385,7 @@ function OptionLink({ href, active, label, onActivate }) {
|
|
|
14301
14385
|
);
|
|
14302
14386
|
}
|
|
14303
14387
|
function FilterFieldset({ legend, children: children2 }) {
|
|
14304
|
-
return /* @__PURE__ */
|
|
14388
|
+
return /* @__PURE__ */ jsxs13("fieldset", { className: "space-y-2", children: [
|
|
14305
14389
|
/* @__PURE__ */ jsx14("legend", { className: "text-sm font-medium text-foreground", children: legend }),
|
|
14306
14390
|
/* @__PURE__ */ jsx14("div", { className: "flex flex-wrap gap-2", children: children2 })
|
|
14307
14391
|
] });
|
|
@@ -14326,10 +14410,10 @@ function ShopFilters({
|
|
|
14326
14410
|
if (!shouldRenderShopFilters(facets, active)) {
|
|
14327
14411
|
return null;
|
|
14328
14412
|
}
|
|
14329
|
-
return /* @__PURE__ */
|
|
14413
|
+
return /* @__PURE__ */ jsxs13("div", { className: cn11("space-y-6", className), "data-slot": "shop-filters", children: [
|
|
14330
14414
|
visibleTaxonomies.map((axis) => {
|
|
14331
14415
|
const activeSlug = active.taxonomy?.[axis.key];
|
|
14332
|
-
return /* @__PURE__ */
|
|
14416
|
+
return /* @__PURE__ */ jsxs13(FilterFieldset, { legend: axis.label, children: [
|
|
14333
14417
|
/* @__PURE__ */ jsx14(
|
|
14334
14418
|
OptionLink,
|
|
14335
14419
|
{
|
|
@@ -14426,7 +14510,7 @@ function ShopFilters({
|
|
|
14426
14510
|
|
|
14427
14511
|
// src/components/cart-line-list.tsx
|
|
14428
14512
|
import { cn as cn12 } from "@reblu/site-ui/utils";
|
|
14429
|
-
import { jsx as jsx15, jsxs as
|
|
14513
|
+
import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
14430
14514
|
var DEFAULT_LABELS2 = {
|
|
14431
14515
|
quantityLabel: "Cantidad",
|
|
14432
14516
|
decrease: "Reducir cantidad",
|
|
@@ -14452,7 +14536,7 @@ function CartLineList({
|
|
|
14452
14536
|
}) {
|
|
14453
14537
|
const t = { ...DEFAULT_LABELS2, ...labels };
|
|
14454
14538
|
const noticeContent = notice === true ? t.cancelledNotice : notice;
|
|
14455
|
-
return /* @__PURE__ */
|
|
14539
|
+
return /* @__PURE__ */ jsxs14("div", { className: cn12("space-y-4", className), "data-slot": "cart-line-list", children: [
|
|
14456
14540
|
/* @__PURE__ */ jsx15("div", { "aria-live": "polite", className: "sr-only", children: liveMessage }),
|
|
14457
14541
|
noticeContent != null && noticeContent !== false && /* @__PURE__ */ jsx15(
|
|
14458
14542
|
"div",
|
|
@@ -14468,21 +14552,21 @@ function CartLineList({
|
|
|
14468
14552
|
const atMax = item.quantity >= maxQty;
|
|
14469
14553
|
const atMin = item.quantity <= 1;
|
|
14470
14554
|
const message = lineMessage?.(item);
|
|
14471
|
-
return /* @__PURE__ */
|
|
14555
|
+
return /* @__PURE__ */ jsxs14(
|
|
14472
14556
|
"li",
|
|
14473
14557
|
{
|
|
14474
14558
|
className: "flex gap-4 rounded-xl border border-border bg-card p-4",
|
|
14475
14559
|
children: [
|
|
14476
14560
|
/* @__PURE__ */ jsx15("div", { className: "h-20 w-20 flex-shrink-0 overflow-hidden rounded-lg bg-muted", children: item.imageUrl ? /* @__PURE__ */ jsx15("img", { src: item.imageUrl, alt: item.name, className: "h-full w-full object-cover" }) : null }),
|
|
14477
|
-
/* @__PURE__ */
|
|
14561
|
+
/* @__PURE__ */ jsxs14("div", { className: "min-w-0 flex-1", children: [
|
|
14478
14562
|
/* @__PURE__ */ jsx15("p", { className: "truncate text-sm font-semibold leading-tight", children: item.name }),
|
|
14479
14563
|
item.variantName && /* @__PURE__ */ jsx15("p", { className: "mt-0.5 text-xs text-muted-foreground", children: item.variantName }),
|
|
14480
|
-
/* @__PURE__ */
|
|
14564
|
+
/* @__PURE__ */ jsxs14("p", { className: "mt-1 text-sm text-muted-foreground", children: [
|
|
14481
14565
|
formatPrice(item.unitPrice, currencyCode, locale),
|
|
14482
14566
|
" ",
|
|
14483
14567
|
t.unitPriceSuffix
|
|
14484
14568
|
] }),
|
|
14485
|
-
/* @__PURE__ */
|
|
14569
|
+
/* @__PURE__ */ jsxs14(
|
|
14486
14570
|
"div",
|
|
14487
14571
|
{
|
|
14488
14572
|
role: "group",
|
|
@@ -14545,7 +14629,7 @@ function CartLineList({
|
|
|
14545
14629
|
|
|
14546
14630
|
// src/components/cart-summary.tsx
|
|
14547
14631
|
import { cn as cn13 } from "@reblu/site-ui/utils";
|
|
14548
|
-
import { jsx as jsx16, jsxs as
|
|
14632
|
+
import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
14549
14633
|
var DEFAULT_LABELS3 = {
|
|
14550
14634
|
subtotal: "Subtotal",
|
|
14551
14635
|
discountPrefix: "Descuento",
|
|
@@ -14572,31 +14656,31 @@ function CartSummary({
|
|
|
14572
14656
|
const hasDiscount = Boolean(discount && discount > 0);
|
|
14573
14657
|
const noticeContent = notice === true ? t.cancelledNotice : notice;
|
|
14574
14658
|
const hasNotice = noticeContent != null && noticeContent !== false;
|
|
14575
|
-
const breakdown = /* @__PURE__ */
|
|
14659
|
+
const breakdown = /* @__PURE__ */ jsxs15(
|
|
14576
14660
|
"dl",
|
|
14577
14661
|
{
|
|
14578
14662
|
className: cn13("space-y-2 text-sm", !hasNotice && className),
|
|
14579
14663
|
"data-slot": "cart-summary",
|
|
14580
14664
|
children: [
|
|
14581
|
-
/* @__PURE__ */
|
|
14665
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex justify-between text-muted-foreground", children: [
|
|
14582
14666
|
/* @__PURE__ */ jsx16("dt", { children: t.subtotal }),
|
|
14583
14667
|
/* @__PURE__ */ jsx16("dd", { children: formatPrice(subtotal, currencyCode, locale) })
|
|
14584
14668
|
] }),
|
|
14585
|
-
hasDiscount && /* @__PURE__ */
|
|
14586
|
-
/* @__PURE__ */
|
|
14669
|
+
hasDiscount && /* @__PURE__ */ jsxs15("div", { className: "flex justify-between text-green-600 dark:text-green-400", children: [
|
|
14670
|
+
/* @__PURE__ */ jsxs15("dt", { children: [
|
|
14587
14671
|
t.discountPrefix,
|
|
14588
14672
|
discountCode ? ` (${discountCode})` : ""
|
|
14589
14673
|
] }),
|
|
14590
|
-
/* @__PURE__ */
|
|
14674
|
+
/* @__PURE__ */ jsxs15("dd", { children: [
|
|
14591
14675
|
"-",
|
|
14592
14676
|
formatPrice(discount, currencyCode, locale)
|
|
14593
14677
|
] })
|
|
14594
14678
|
] }),
|
|
14595
|
-
shippingEnabled && /* @__PURE__ */
|
|
14679
|
+
shippingEnabled && /* @__PURE__ */ jsxs15("div", { className: "flex justify-between text-muted-foreground", children: [
|
|
14596
14680
|
/* @__PURE__ */ jsx16("dt", { children: t.shipping }),
|
|
14597
14681
|
/* @__PURE__ */ jsx16("dd", { children: shipping == null || !Number.isFinite(shipping) ? t.shippingCalculated : shipping === 0 ? t.freeShipping : formatPrice(shipping, currencyCode, locale) })
|
|
14598
14682
|
] }),
|
|
14599
|
-
/* @__PURE__ */
|
|
14683
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex justify-between border-t border-border pt-2 text-base font-bold", children: [
|
|
14600
14684
|
/* @__PURE__ */ jsx16("dt", { children: t.total }),
|
|
14601
14685
|
/* @__PURE__ */ jsx16("dd", { children: formatPrice(total, currencyCode, locale) })
|
|
14602
14686
|
] })
|
|
@@ -14604,7 +14688,7 @@ function CartSummary({
|
|
|
14604
14688
|
}
|
|
14605
14689
|
);
|
|
14606
14690
|
if (!hasNotice) return breakdown;
|
|
14607
|
-
return /* @__PURE__ */
|
|
14691
|
+
return /* @__PURE__ */ jsxs15("div", { className: cn13("space-y-3", className), "data-slot": "cart-summary-wrapper", children: [
|
|
14608
14692
|
/* @__PURE__ */ jsx16(
|
|
14609
14693
|
"div",
|
|
14610
14694
|
{
|
|
@@ -14667,7 +14751,7 @@ function CartAdjustmentsNotice({
|
|
|
14667
14751
|
|
|
14668
14752
|
// src/components/added-to-cart-toast.tsx
|
|
14669
14753
|
import { cn as cn15 } from "@reblu/site-ui/utils";
|
|
14670
|
-
import { jsx as jsx18, jsxs as
|
|
14754
|
+
import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
14671
14755
|
var DEFAULT_LABELS5 = {
|
|
14672
14756
|
success: "A\xF1adido al carrito",
|
|
14673
14757
|
error: "No se pudo a\xF1adir al carrito",
|
|
@@ -14687,7 +14771,7 @@ function AddedToCartToast({
|
|
|
14687
14771
|
const message = status === "error" ? t.error : status === "outOfStock" ? t.outOfStock : t.success;
|
|
14688
14772
|
const hasThumbnail = Boolean(imageUrl && imageUrl.trim().length > 0);
|
|
14689
14773
|
const variant = status === "success" ? "success" : "error";
|
|
14690
|
-
return /* @__PURE__ */
|
|
14774
|
+
return /* @__PURE__ */ jsxs16(
|
|
14691
14775
|
"div",
|
|
14692
14776
|
{
|
|
14693
14777
|
"data-slot": "added-to-cart-toast",
|
|
@@ -14701,7 +14785,7 @@ function AddedToCartToast({
|
|
|
14701
14785
|
children: [
|
|
14702
14786
|
hasThumbnail && // eslint-disable-next-line @next/next/no-img-element -- toast content, not a Next <Image> layout context
|
|
14703
14787
|
/* @__PURE__ */ jsx18("img", { src: imageUrl, alt: productName, className: "h-10 w-10 flex-shrink-0 rounded-lg object-cover" }),
|
|
14704
|
-
/* @__PURE__ */
|
|
14788
|
+
/* @__PURE__ */ jsxs16("div", { className: "min-w-0 flex-1", children: [
|
|
14705
14789
|
/* @__PURE__ */ jsx18("p", { className: "truncate font-semibold text-foreground", children: productName }),
|
|
14706
14790
|
/* @__PURE__ */ jsx18("p", { className: "truncate text-muted-foreground", children: quantity && quantity > 1 ? `${message} \xB7 x${quantity}` : message })
|
|
14707
14791
|
] }),
|
|
@@ -14713,7 +14797,7 @@ function AddedToCartToast({
|
|
|
14713
14797
|
|
|
14714
14798
|
// src/components/checkout-login-prompt.tsx
|
|
14715
14799
|
import { cn as cn16 } from "@reblu/site-ui/utils";
|
|
14716
|
-
import { Fragment as Fragment3, jsx as jsx19, jsxs as
|
|
14800
|
+
import { Fragment as Fragment3, jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
14717
14801
|
var DEFAULT_LABELS6 = {
|
|
14718
14802
|
title: "Identificaci\xF3n",
|
|
14719
14803
|
description: "Introduce tu email para agilizar el proceso o contin\xFAa como invitado.",
|
|
@@ -14740,9 +14824,9 @@ function CheckoutLoginPrompt({
|
|
|
14740
14824
|
if (!open) return null;
|
|
14741
14825
|
const t = { ...DEFAULT_LABELS6, ...labels };
|
|
14742
14826
|
const isValidEmail = EMAIL_PATTERN.test(email.trim());
|
|
14743
|
-
return /* @__PURE__ */
|
|
14827
|
+
return /* @__PURE__ */ jsxs17(Fragment3, { children: [
|
|
14744
14828
|
/* @__PURE__ */ jsx19("div", { className: "fixed inset-0 z-50 bg-black/50", onClick: onClose, "aria-hidden": "true" }),
|
|
14745
|
-
/* @__PURE__ */
|
|
14829
|
+
/* @__PURE__ */ jsxs17(
|
|
14746
14830
|
"div",
|
|
14747
14831
|
{
|
|
14748
14832
|
role: "dialog",
|
|
@@ -14754,8 +14838,8 @@ function CheckoutLoginPrompt({
|
|
|
14754
14838
|
className
|
|
14755
14839
|
),
|
|
14756
14840
|
children: [
|
|
14757
|
-
/* @__PURE__ */
|
|
14758
|
-
/* @__PURE__ */
|
|
14841
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex items-start justify-between gap-3", children: [
|
|
14842
|
+
/* @__PURE__ */ jsxs17("div", { children: [
|
|
14759
14843
|
/* @__PURE__ */ jsx19("h2", { id: "checkout-login-prompt-title", className: "text-xl font-bold", children: t.title }),
|
|
14760
14844
|
/* @__PURE__ */ jsx19("p", { className: "mt-1 text-sm text-muted-foreground", children: t.description })
|
|
14761
14845
|
] }),
|
|
@@ -14770,7 +14854,7 @@ function CheckoutLoginPrompt({
|
|
|
14770
14854
|
}
|
|
14771
14855
|
)
|
|
14772
14856
|
] }),
|
|
14773
|
-
/* @__PURE__ */
|
|
14857
|
+
/* @__PURE__ */ jsxs17("div", { className: "space-y-2", children: [
|
|
14774
14858
|
/* @__PURE__ */ jsx19("label", { htmlFor: "checkout-login-prompt-email", className: "text-sm font-medium", children: t.emailLabel }),
|
|
14775
14859
|
/* @__PURE__ */ jsx19(
|
|
14776
14860
|
"input",
|
|
@@ -14789,7 +14873,7 @@ function CheckoutLoginPrompt({
|
|
|
14789
14873
|
),
|
|
14790
14874
|
error && /* @__PURE__ */ jsx19("p", { className: "text-xs text-destructive", children: error })
|
|
14791
14875
|
] }),
|
|
14792
|
-
/* @__PURE__ */
|
|
14876
|
+
/* @__PURE__ */ jsxs17("div", { className: "space-y-2", children: [
|
|
14793
14877
|
/* @__PURE__ */ jsx19(
|
|
14794
14878
|
"button",
|
|
14795
14879
|
{
|
|
@@ -14822,7 +14906,7 @@ function CheckoutLoginPrompt({
|
|
|
14822
14906
|
// src/components/checkout-form.tsx
|
|
14823
14907
|
import { cn as cn17 } from "@reblu/site-ui/utils";
|
|
14824
14908
|
import { PhoneInput } from "@reblu/site-ui/phone-input";
|
|
14825
|
-
import { Fragment as Fragment4, jsx as jsx20, jsxs as
|
|
14909
|
+
import { Fragment as Fragment4, jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
14826
14910
|
var DEFAULT_LABELS7 = {
|
|
14827
14911
|
contactTitle: "Datos de contacto",
|
|
14828
14912
|
nameLabel: "Nombre completo",
|
|
@@ -14876,9 +14960,9 @@ function CheckoutForm({
|
|
|
14876
14960
|
event.preventDefault();
|
|
14877
14961
|
if (discountCode.trim() && !discountApplying) onApplyDiscount();
|
|
14878
14962
|
}
|
|
14879
|
-
return /* @__PURE__ */
|
|
14963
|
+
return /* @__PURE__ */ jsxs18(Fragment4, { children: [
|
|
14880
14964
|
loginPrompt,
|
|
14881
|
-
/* @__PURE__ */
|
|
14965
|
+
/* @__PURE__ */ jsxs18(
|
|
14882
14966
|
"form",
|
|
14883
14967
|
{
|
|
14884
14968
|
"data-testid": "checkout-form",
|
|
@@ -14886,10 +14970,10 @@ function CheckoutForm({
|
|
|
14886
14970
|
className: cn17("space-y-8", className),
|
|
14887
14971
|
"data-slot": "checkout-form",
|
|
14888
14972
|
children: [
|
|
14889
|
-
/* @__PURE__ */
|
|
14973
|
+
/* @__PURE__ */ jsxs18("section", { className: "space-y-4", children: [
|
|
14890
14974
|
/* @__PURE__ */ jsx20("h2", { className: "border-b border-border pb-2 text-lg font-semibold", children: t.contactTitle }),
|
|
14891
|
-
/* @__PURE__ */
|
|
14892
|
-
/* @__PURE__ */
|
|
14975
|
+
/* @__PURE__ */ jsxs18("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
|
|
14976
|
+
/* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
|
|
14893
14977
|
/* @__PURE__ */ jsx20("label", { htmlFor: "checkout-form-name", className: "text-sm font-medium", children: t.nameLabel }),
|
|
14894
14978
|
/* @__PURE__ */ jsx20(
|
|
14895
14979
|
"input",
|
|
@@ -14908,7 +14992,7 @@ function CheckoutForm({
|
|
|
14908
14992
|
),
|
|
14909
14993
|
contactErrors?.name && /* @__PURE__ */ jsx20("p", { className: "text-xs text-destructive", children: contactErrors.name })
|
|
14910
14994
|
] }),
|
|
14911
|
-
/* @__PURE__ */
|
|
14995
|
+
/* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
|
|
14912
14996
|
/* @__PURE__ */ jsx20("label", { htmlFor: "checkout-form-email", className: "text-sm font-medium", children: t.emailLabel }),
|
|
14913
14997
|
/* @__PURE__ */ jsx20(
|
|
14914
14998
|
"input",
|
|
@@ -14942,10 +15026,10 @@ function CheckoutForm({
|
|
|
14942
15026
|
] }),
|
|
14943
15027
|
children2,
|
|
14944
15028
|
generalError ? /* @__PURE__ */ jsx20("p", { role: "alert", className: "text-sm text-destructive", children: generalError }) : null,
|
|
14945
|
-
/* @__PURE__ */
|
|
15029
|
+
/* @__PURE__ */ jsxs18("section", { className: "space-y-3", children: [
|
|
14946
15030
|
/* @__PURE__ */ jsx20("h2", { className: "border-b border-border pb-2 text-lg font-semibold", children: t.discountTitle }),
|
|
14947
|
-
appliedDiscount ? /* @__PURE__ */
|
|
14948
|
-
/* @__PURE__ */
|
|
15031
|
+
appliedDiscount ? /* @__PURE__ */ jsxs18("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: [
|
|
15032
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2 text-sm text-green-700 dark:text-green-400", children: [
|
|
14949
15033
|
/* @__PURE__ */ jsx20("span", { className: "font-semibold", children: appliedDiscount.code }),
|
|
14950
15034
|
/* @__PURE__ */ jsx20("span", { children: t.discountAppliedSuffix(formatPrice(appliedDiscount.amount, currencyCode, locale)) })
|
|
14951
15035
|
] }),
|
|
@@ -14959,7 +15043,7 @@ function CheckoutForm({
|
|
|
14959
15043
|
children: t.removeDiscount
|
|
14960
15044
|
}
|
|
14961
15045
|
)
|
|
14962
|
-
] }) : /* @__PURE__ */
|
|
15046
|
+
] }) : /* @__PURE__ */ jsxs18("div", { className: "flex gap-2", children: [
|
|
14963
15047
|
/* @__PURE__ */ jsx20("label", { htmlFor: "checkout-form-discount-code", className: "sr-only", children: t.discountTitle }),
|
|
14964
15048
|
/* @__PURE__ */ jsx20(
|
|
14965
15049
|
"input",
|
|
@@ -15009,7 +15093,7 @@ import { cn as cn19 } from "@reblu/site-ui/utils";
|
|
|
15009
15093
|
|
|
15010
15094
|
// src/components/order-invoice-link.tsx
|
|
15011
15095
|
import { cn as cn18 } from "@reblu/site-ui/utils";
|
|
15012
|
-
import { jsx as jsx21, jsxs as
|
|
15096
|
+
import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
15013
15097
|
var DEFAULT_LABELS8 = {
|
|
15014
15098
|
linkLabel: "Descargar la factura {number}",
|
|
15015
15099
|
signInHint: "Te pediremos que inicies sesi\xF3n para abrirla."
|
|
@@ -15017,7 +15101,7 @@ var DEFAULT_LABELS8 = {
|
|
|
15017
15101
|
function OrderInvoiceLink({ invoice, labels, className }) {
|
|
15018
15102
|
if (!invoice) return null;
|
|
15019
15103
|
const t = { ...DEFAULT_LABELS8, ...labels };
|
|
15020
|
-
return /* @__PURE__ */
|
|
15104
|
+
return /* @__PURE__ */ jsxs19("div", { className: cn18("space-y-1 text-sm", className), "data-slot": "order-invoice-link", children: [
|
|
15021
15105
|
/* @__PURE__ */ jsx21(
|
|
15022
15106
|
"a",
|
|
15023
15107
|
{
|
|
@@ -15031,7 +15115,7 @@ function OrderInvoiceLink({ invoice, labels, className }) {
|
|
|
15031
15115
|
}
|
|
15032
15116
|
|
|
15033
15117
|
// src/components/order-confirmation.tsx
|
|
15034
|
-
import { jsx as jsx22, jsxs as
|
|
15118
|
+
import { jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
15035
15119
|
var DEFAULT_LABELS9 = {
|
|
15036
15120
|
pollingTitle: "Confirmando tu pedido\u2026",
|
|
15037
15121
|
pollingDescription: "Estamos procesando el pago, un momento\u2026",
|
|
@@ -15095,21 +15179,21 @@ function OrderConfirmation({
|
|
|
15095
15179
|
const showOrderReference = Boolean(order) && !showFullOrderSummary && (status === "refunded" || status === "partially_refunded" || status === "pending_timeout");
|
|
15096
15180
|
const showSessionReference = !order && sessionId && (status === "timeout" || status === "not_found" || status === "pending_timeout");
|
|
15097
15181
|
const showRecheck = (status === "pending_timeout" || status === "error") && onRecheck;
|
|
15098
|
-
return /* @__PURE__ */
|
|
15182
|
+
return /* @__PURE__ */ jsxs20("div", { className: cn19("space-y-6 text-center", className), "data-slot": "order-confirmation", children: [
|
|
15099
15183
|
/* @__PURE__ */ jsx22("h1", { className: "text-3xl font-bold", children: title }),
|
|
15100
15184
|
/* @__PURE__ */ jsx22("p", { className: "text-lg text-muted-foreground", children: description }),
|
|
15101
|
-
showFullOrderSummary && order && /* @__PURE__ */
|
|
15102
|
-
/* @__PURE__ */
|
|
15185
|
+
showFullOrderSummary && order && /* @__PURE__ */ jsxs20("div", { className: "space-y-6", children: [
|
|
15186
|
+
/* @__PURE__ */ jsxs20("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
15103
15187
|
/* @__PURE__ */ jsx22("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.orderNumberLabel }),
|
|
15104
15188
|
/* @__PURE__ */ jsx22("p", { className: "font-mono text-lg font-semibold", children: order.orderNumber })
|
|
15105
15189
|
] }),
|
|
15106
|
-
/* @__PURE__ */
|
|
15107
|
-
order.items.map((item, idx) => /* @__PURE__ */
|
|
15190
|
+
/* @__PURE__ */ jsxs20("div", { className: "mx-auto max-w-sm space-y-3 rounded-xl border border-border bg-card p-5 text-left", children: [
|
|
15191
|
+
order.items.map((item, idx) => /* @__PURE__ */ jsxs20(
|
|
15108
15192
|
"div",
|
|
15109
15193
|
{
|
|
15110
15194
|
className: "flex justify-between gap-4 text-sm",
|
|
15111
15195
|
children: [
|
|
15112
|
-
/* @__PURE__ */
|
|
15196
|
+
/* @__PURE__ */ jsxs20("span", { className: "max-w-[60%] truncate text-muted-foreground", children: [
|
|
15113
15197
|
item.product.name,
|
|
15114
15198
|
item.variant ? ` (${item.variant.name})` : "",
|
|
15115
15199
|
" x",
|
|
@@ -15120,12 +15204,12 @@ function OrderConfirmation({
|
|
|
15120
15204
|
},
|
|
15121
15205
|
idx
|
|
15122
15206
|
)),
|
|
15123
|
-
/* @__PURE__ */ jsx22("div", { className: "space-y-1 border-t border-border pt-3 text-sm", children: /* @__PURE__ */
|
|
15207
|
+
/* @__PURE__ */ jsx22("div", { className: "space-y-1 border-t border-border pt-3 text-sm", children: /* @__PURE__ */ jsxs20("div", { className: "flex justify-between pt-1 text-base font-bold", children: [
|
|
15124
15208
|
/* @__PURE__ */ jsx22("span", { children: t.totalLabel }),
|
|
15125
15209
|
/* @__PURE__ */ jsx22("span", { children: formatPrice(order.total, currencyCode, locale) })
|
|
15126
15210
|
] }) })
|
|
15127
15211
|
] }),
|
|
15128
|
-
/* @__PURE__ */
|
|
15212
|
+
/* @__PURE__ */ jsxs20("p", { className: "mx-auto max-w-sm text-sm text-muted-foreground", children: [
|
|
15129
15213
|
t.confirmationEmailPrefix,
|
|
15130
15214
|
" ",
|
|
15131
15215
|
/* @__PURE__ */ jsx22("span", { className: "font-medium text-foreground", children: order.customerEmail }),
|
|
@@ -15139,7 +15223,7 @@ function OrderConfirmation({
|
|
|
15139
15223
|
}
|
|
15140
15224
|
)
|
|
15141
15225
|
] }),
|
|
15142
|
-
showOrderReference && order && /* @__PURE__ */
|
|
15226
|
+
showOrderReference && order && /* @__PURE__ */ jsxs20("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
15143
15227
|
/* @__PURE__ */ jsx22("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.orderReferenceLabel }),
|
|
15144
15228
|
/* @__PURE__ */ jsx22("p", { className: "font-mono text-lg font-semibold", children: order.orderNumber })
|
|
15145
15229
|
] }),
|
|
@@ -15160,7 +15244,7 @@ function OrderConfirmation({
|
|
|
15160
15244
|
children: t.recheckLabel
|
|
15161
15245
|
}
|
|
15162
15246
|
),
|
|
15163
|
-
showSessionReference && /* @__PURE__ */
|
|
15247
|
+
showSessionReference && /* @__PURE__ */ jsxs20("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
15164
15248
|
/* @__PURE__ */ jsx22("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.sessionReferenceLabel }),
|
|
15165
15249
|
/* @__PURE__ */ jsx22("p", { className: "break-all font-mono text-sm font-semibold", children: sessionId })
|
|
15166
15250
|
] })
|
|
@@ -15169,7 +15253,7 @@ function OrderConfirmation({
|
|
|
15169
15253
|
|
|
15170
15254
|
// src/components/full-invoice-fields.tsx
|
|
15171
15255
|
import { cn as cn20 } from "@reblu/site-ui/utils";
|
|
15172
|
-
import { jsx as jsx23, jsxs as
|
|
15256
|
+
import { jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
15173
15257
|
var EMPTY_FULL_INVOICE_VALUE = {
|
|
15174
15258
|
wantsFullInvoice: false,
|
|
15175
15259
|
billingIdType: "NIF",
|
|
@@ -15288,9 +15372,9 @@ function FullInvoiceFields({
|
|
|
15288
15372
|
const set = (key2, next2) => onChange({ ...value, [key2]: next2 });
|
|
15289
15373
|
const error = (key2) => errors[key2] ? /* @__PURE__ */ jsx23("p", { id: `full-invoice-${key2}-error`, className: "text-sm text-destructive", children: errors[key2] }) : null;
|
|
15290
15374
|
const invalid2 = (key2) => errors[key2] ? { "aria-invalid": true, "aria-describedby": `full-invoice-${key2}-error` } : {};
|
|
15291
|
-
return /* @__PURE__ */
|
|
15292
|
-
overCap ? /* @__PURE__ */ jsx23("p", { role: "note", className: "rounded-lg border border-border p-4 text-sm", children: t.overCapNotice }) : /* @__PURE__ */
|
|
15293
|
-
/* @__PURE__ */
|
|
15375
|
+
return /* @__PURE__ */ jsxs21("section", { className: cn20("space-y-4", className), "data-slot": "full-invoice-fields", children: [
|
|
15376
|
+
overCap ? /* @__PURE__ */ jsx23("p", { role: "note", className: "rounded-lg border border-border p-4 text-sm", children: t.overCapNotice }) : /* @__PURE__ */ jsxs21("div", { className: "space-y-1", children: [
|
|
15377
|
+
/* @__PURE__ */ jsxs21("label", { className: "flex items-center gap-2 text-sm font-medium", children: [
|
|
15294
15378
|
/* @__PURE__ */ jsx23(
|
|
15295
15379
|
"input",
|
|
15296
15380
|
{
|
|
@@ -15303,8 +15387,8 @@ function FullInvoiceFields({
|
|
|
15303
15387
|
] }),
|
|
15304
15388
|
/* @__PURE__ */ jsx23("p", { className: "text-sm text-muted-foreground", children: t.underCapNotice })
|
|
15305
15389
|
] }),
|
|
15306
|
-
showFields && /* @__PURE__ */
|
|
15307
|
-
/* @__PURE__ */
|
|
15390
|
+
showFields && /* @__PURE__ */ jsxs21("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
|
|
15391
|
+
/* @__PURE__ */ jsxs21("div", { className: "space-y-1", children: [
|
|
15308
15392
|
/* @__PURE__ */ jsx23("label", { htmlFor: "full-invoice-id-type", className: "text-sm font-medium", children: t.idType }),
|
|
15309
15393
|
/* @__PURE__ */ jsx23(
|
|
15310
15394
|
"select",
|
|
@@ -15320,9 +15404,9 @@ function FullInvoiceFields({
|
|
|
15320
15404
|
),
|
|
15321
15405
|
error("billingIdType")
|
|
15322
15406
|
] }),
|
|
15323
|
-
!isSpanishNif && /* @__PURE__ */
|
|
15407
|
+
!isSpanishNif && /* @__PURE__ */ jsxs21("div", { className: "space-y-1", children: [
|
|
15324
15408
|
/* @__PURE__ */ jsx23("label", { htmlFor: "full-invoice-id-country", className: "text-sm font-medium", children: t.idCountry }),
|
|
15325
|
-
/* @__PURE__ */
|
|
15409
|
+
/* @__PURE__ */ jsxs21(
|
|
15326
15410
|
"select",
|
|
15327
15411
|
{
|
|
15328
15412
|
id: "full-invoice-id-country",
|
|
@@ -15339,7 +15423,7 @@ function FullInvoiceFields({
|
|
|
15339
15423
|
),
|
|
15340
15424
|
error("billingIdCountry")
|
|
15341
15425
|
] }),
|
|
15342
|
-
/* @__PURE__ */
|
|
15426
|
+
/* @__PURE__ */ jsxs21("div", { className: "space-y-1", children: [
|
|
15343
15427
|
/* @__PURE__ */ jsx23("label", { htmlFor: "full-invoice-nif", className: "text-sm font-medium", children: isSpanishNif ? t.spanishNif : t.documentNumber }),
|
|
15344
15428
|
/* @__PURE__ */ jsx23(
|
|
15345
15429
|
"input",
|
|
@@ -15354,7 +15438,7 @@ function FullInvoiceFields({
|
|
|
15354
15438
|
),
|
|
15355
15439
|
error("billingNif")
|
|
15356
15440
|
] }),
|
|
15357
|
-
/* @__PURE__ */
|
|
15441
|
+
/* @__PURE__ */ jsxs21("div", { className: "space-y-1", children: [
|
|
15358
15442
|
/* @__PURE__ */ jsx23("label", { htmlFor: "full-invoice-name", className: "text-sm font-medium", children: t.name }),
|
|
15359
15443
|
/* @__PURE__ */ jsx23(
|
|
15360
15444
|
"input",
|
|
@@ -15369,7 +15453,7 @@ function FullInvoiceFields({
|
|
|
15369
15453
|
),
|
|
15370
15454
|
error("billingName")
|
|
15371
15455
|
] }),
|
|
15372
|
-
/* @__PURE__ */
|
|
15456
|
+
/* @__PURE__ */ jsxs21("div", { className: "space-y-1 sm:col-span-2", children: [
|
|
15373
15457
|
/* @__PURE__ */ jsx23("label", { htmlFor: "full-invoice-street", className: "text-sm font-medium", children: t.street }),
|
|
15374
15458
|
/* @__PURE__ */ jsx23(
|
|
15375
15459
|
"input",
|
|
@@ -15383,7 +15467,7 @@ function FullInvoiceFields({
|
|
|
15383
15467
|
}
|
|
15384
15468
|
)
|
|
15385
15469
|
] }),
|
|
15386
|
-
/* @__PURE__ */
|
|
15470
|
+
/* @__PURE__ */ jsxs21("div", { className: "space-y-1", children: [
|
|
15387
15471
|
/* @__PURE__ */ jsx23("label", { htmlFor: "full-invoice-postal-code", className: "text-sm font-medium", children: t.postalCode }),
|
|
15388
15472
|
/* @__PURE__ */ jsx23(
|
|
15389
15473
|
"input",
|
|
@@ -15396,7 +15480,7 @@ function FullInvoiceFields({
|
|
|
15396
15480
|
}
|
|
15397
15481
|
)
|
|
15398
15482
|
] }),
|
|
15399
|
-
/* @__PURE__ */
|
|
15483
|
+
/* @__PURE__ */ jsxs21("div", { className: "space-y-1", children: [
|
|
15400
15484
|
/* @__PURE__ */ jsx23("label", { htmlFor: "full-invoice-city", className: "text-sm font-medium", children: t.city }),
|
|
15401
15485
|
/* @__PURE__ */ jsx23(
|
|
15402
15486
|
"input",
|
|
@@ -15409,7 +15493,7 @@ function FullInvoiceFields({
|
|
|
15409
15493
|
}
|
|
15410
15494
|
)
|
|
15411
15495
|
] }),
|
|
15412
|
-
/* @__PURE__ */
|
|
15496
|
+
/* @__PURE__ */ jsxs21("div", { className: "space-y-1", children: [
|
|
15413
15497
|
/* @__PURE__ */ jsx23("label", { htmlFor: "full-invoice-country", className: "text-sm font-medium", children: t.country }),
|
|
15414
15498
|
/* @__PURE__ */ jsx23(
|
|
15415
15499
|
"select",
|
|
@@ -15427,6 +15511,9 @@ function FullInvoiceFields({
|
|
|
15427
15511
|
] })
|
|
15428
15512
|
] });
|
|
15429
15513
|
}
|
|
15514
|
+
|
|
15515
|
+
// src/index.ts
|
|
15516
|
+
import { DATA_REQUEST_TYPES } from "@reblu/site-contracts";
|
|
15430
15517
|
export {
|
|
15431
15518
|
ALLOWED_YOUTUBE_HOSTS,
|
|
15432
15519
|
AddedToCartToast,
|
|
@@ -15436,6 +15523,7 @@ export {
|
|
|
15436
15523
|
CheckoutForm,
|
|
15437
15524
|
CheckoutLoginPrompt,
|
|
15438
15525
|
CourseDescription,
|
|
15526
|
+
DATA_REQUEST_TYPES,
|
|
15439
15527
|
DEFAULT_INVOICE_COUNTRIES,
|
|
15440
15528
|
DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE,
|
|
15441
15529
|
DEFAULT_SHOP_ERROR_MESSAGES,
|