import { lt as __exportAll } from "./translation-adapter-B-Vhfzbz.mjs";
import { n as useWidgetInteraction } from "./WidgetInteractionContext-I716c8kj.mjs";
import { f as getGapField, i as getBorderColorField, l as getColorField, m as getPaddingField, n as borderWidthClasses, o as getBorderRadiusField, r as gapValues, s as getBorderWidthField, t as borderColorClasses, u as getFontSizeField } from "./registries-BZVov8GL.mjs";
import { t as purify } from "./purify.es-DI2Tffdk.mjs";
import { t as MediaRenderer } from "./MediaRenderer-BydUiy9x.mjs";
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
import { jsx, jsxs } from "react/jsx-runtime";
import { ChevronLeft, ChevronRight } from "lucide-react";
//#region ../widgets/src/widgets/list-widget/helpers.ts
/**
* Maps the schema's BorderRadiusOptions to a Tailwind `rounded-*` class.
* `"full"` is converted to `rounded-2xl` because the list item cards and
* featured section read better as large-radius rectangles than as
* pill-shaped containers.
*/
const cardRadiusClass = (radius) => radius === "full" ? "rounded-2xl" : `rounded-${radius}`;
//#endregion
//#region ../widgets/src/widgets/list-widget/FeaturedSection.tsx
function FeaturedSection({ borderRadius, titleSize, featuredTitle, featuredSubtitle, featuredButtonText, featuredButtonUrl, featuredSubtitleColor, featuredSubtitleSize, asset }) {
	return /* @__PURE__ */ jsxs("div", {
		className: `group relative h-full min-h-[320px] w-full overflow-hidden ${cardRadiusClass(borderRadius)}`,
		children: [
			/* @__PURE__ */ jsx("div", {
				className: "absolute inset-0 h-full w-full",
				children: /* @__PURE__ */ jsx(MediaRenderer, {
					src: asset.url,
					mediaType: asset.isVideo ? "video" : "image",
					alt: featuredTitle || "Featured",
					objectFit: "cover",
					autoplay: asset.isVideo,
					loop: asset.isVideo,
					muted: asset.isVideo,
					controls: false
				})
			}),
			/* @__PURE__ */ jsx("div", {
				className: "pointer-events-none absolute inset-0",
				style: { background: "linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,0.55) 100%)" }
			}),
			/* @__PURE__ */ jsxs("div", {
				className: "absolute inset-0 flex flex-col items-start justify-end p-10",
				children: [
					featuredTitle && /* @__PURE__ */ jsx("h3", {
						className: `font-header mb-3 font-medium tracking-tight text-white text-${titleSize === "md" ? "base" : titleSize}`,
						children: featuredTitle
					}),
					featuredSubtitle && /* @__PURE__ */ jsx("p", {
						className: `mb-6 max-w-md text-${featuredSubtitleColor}/80 text-${featuredSubtitleSize === "md" ? "base" : featuredSubtitleSize} leading-relaxed`,
						children: featuredSubtitle
					}),
					featuredButtonText && /* @__PURE__ */ jsxs("a", {
						href: featuredButtonUrl || "#",
						className: `text-foreground inline-flex items-center gap-2 bg-white px-6 py-3 text-sm font-medium tracking-tight transition-opacity hover:opacity-90 ${cardRadiusClass(borderRadius)}`,
						children: [featuredButtonText, /* @__PURE__ */ jsx("span", {
							"aria-hidden": "true",
							className: "transition-transform group-hover:translate-x-0.5",
							children: "→"
						})]
					})
				]
			})
		]
	});
}
//#endregion
//#region ../widgets/src/widgets/list-widget/ListItemCard.tsx
function getStringValue(value) {
	if (!value) return "";
	if (typeof value === "string") return value;
	if (typeof value === "number") return String(value);
	if (typeof value === "object" && value !== null) {
		if ("body" in value) {
			const body = value.body;
			if (typeof body === "string") return body;
		}
		if ("text" in value) {
			const text = value.text;
			if (typeof text === "string") return text;
		}
		if ("value" in value) {
			const val = value.value;
			if (typeof val === "string") return val;
			if (typeof val === "number") return String(val);
		}
	}
	return "";
}
function stripParentheticalText(text) {
	return text.replace(/\s*\([^)]*\)/g, "").trim();
}
function formatPrice(value) {
	const str = getStringValue(value);
	if (!str) return "";
	return stripParentheticalText(str);
}
function ListItemCardContent({ item, padding, itemTitleColor, itemTitleSize, descriptionColor, descriptionSize, priceColor, priceSize, originalPriceColor, metaTextColor, metaTextSize, showMetaText }) {
	const hasPrice = Boolean(item.display_price || item.price);
	const hasOriginal = Boolean(item.originalPrice);
	return /* @__PURE__ */ jsxs("div", {
		className: `flex flex-1 flex-col p-${padding}`,
		children: [
			item.title && /* @__PURE__ */ jsx("h3", {
				className: `text-${itemTitleColor} text-${itemTitleSize === "md" ? "base" : itemTitleSize} font-header mb-1.5 leading-snug font-medium tracking-tight`,
				children: getStringValue(item.title)
			}),
			item.description && /* @__PURE__ */ jsx("div", {
				className: `text-${descriptionColor}/60 text-${descriptionSize === "md" ? "base" : descriptionSize} mb-3 line-clamp-2 overflow-hidden leading-relaxed`,
				dangerouslySetInnerHTML: { __html: purify.sanitize(item.description ?? "", {
					ALLOWED_TAGS: [
						"br",
						"strong",
						"em",
						"b",
						"i",
						"ul",
						"ol",
						"li",
						"p"
					],
					ALLOWED_ATTR: []
				}) }
			}),
			(hasPrice || hasOriginal) && /* @__PURE__ */ jsxs("div", {
				className: "mt-auto flex items-baseline gap-2",
				children: [hasPrice && /* @__PURE__ */ jsx("span", {
					className: `text-${priceColor} text-${priceSize === "md" ? "base" : priceSize} font-semibold tracking-tight tabular-nums`,
					children: formatPrice(item.display_price || item.price)
				}), hasOriginal && /* @__PURE__ */ jsx("span", {
					className: `text-${originalPriceColor}/50 text-${descriptionSize === "md" ? "base" : descriptionSize} tabular-nums line-through`,
					children: formatPrice(item.originalPrice)
				})]
			}),
			showMetaText && (item.qv || item.cv) && /* @__PURE__ */ jsxs("div", {
				className: `mt-2 flex gap-4 text-${metaTextColor}/70 text-${metaTextSize === "md" ? "base" : metaTextSize} font-medium tracking-wide uppercase`,
				children: [item.qv && /* @__PURE__ */ jsxs("span", { children: [
					/* @__PURE__ */ jsx("span", {
						className: "opacity-50",
						children: "QV"
					}),
					" ",
					/* @__PURE__ */ jsx("span", {
						className: "tabular-nums",
						children: getStringValue(item.qv)
					})
				] }), item.cv && /* @__PURE__ */ jsxs("span", { children: [
					/* @__PURE__ */ jsx("span", {
						className: "opacity-50",
						children: "CV"
					}),
					" ",
					/* @__PURE__ */ jsx("span", {
						className: "tabular-nums",
						children: getStringValue(item.cv)
					})
				] })]
			})
		]
	});
}
function DiscountBadge({ discount }) {
	return /* @__PURE__ */ jsx("div", {
		className: "bg-background text-foreground absolute top-3 left-3 z-10 rounded-full px-2.5 py-1 text-[10px] font-semibold tracking-[0.08em] uppercase",
		children: getStringValue(discount)
	});
}
//#endregion
//#region ../widgets/src/widgets/list-widget/UnorderedList.tsx
const getImageUrl$1 = (item) => {
	return item.imageUrl || item.image;
};
const getAspectRatioClass = (ratio) => {
	return {
		square: "aspect-square",
		landscape: "aspect-video",
		portrait: "aspect-[3/4]"
	}[ratio];
};
const getResponsiveGridClass = (columns) => {
	return {
		1: "grid-cols-2 @lg:grid-cols-1",
		2: "grid-cols-2 @lg:grid-cols-2",
		3: "grid-cols-2 @lg:grid-cols-3",
		4: "grid-cols-2 @lg:grid-cols-4",
		5: "grid-cols-2 @lg:grid-cols-5",
		6: "grid-cols-2 @lg:grid-cols-6"
	}[columns] || "grid-cols-2 @lg:grid-cols-3";
};
function UnorderedList({ items, columns, gap, borderRadius, imageAspectRatio, showBadge, padding, itemTitleColor, itemTitleSize, descriptionColor, descriptionSize, priceColor, priceSize, originalPriceColor, metaTextColor, metaTextSize, showMetaText }) {
	const gridClass = getResponsiveGridClass(columns);
	const { onItemClick } = useWidgetInteraction();
	return /* @__PURE__ */ jsx("div", {
		className: `grid ${gridClass} gap-${gapValues[gap]}`,
		children: items.map((item) => {
			const imageUrl = getImageUrl$1(item);
			const aspectRatioClass = getAspectRatioClass(imageAspectRatio);
			return /* @__PURE__ */ jsxs("div", {
				className: `group relative flex flex-col ${onItemClick ? "cursor-pointer" : ""}`,
				...onItemClick ? {
					role: "button",
					tabIndex: 0,
					onClick: () => onItemClick(item),
					onKeyDown: (e) => {
						if (e.key === "Enter" || e.key === " ") {
							e.preventDefault();
							onItemClick(item);
						}
					}
				} : {},
				children: [imageUrl && /* @__PURE__ */ jsxs("div", {
					className: `relative w-full ${aspectRatioClass} bg-muted/30 overflow-hidden ${cardRadiusClass(borderRadius)}`,
					children: [showBadge && item.discount && /* @__PURE__ */ jsx(DiscountBadge, { discount: item.discount }), /* @__PURE__ */ jsx("img", {
						src: imageUrl,
						alt: item.title || "Product",
						className: "h-full w-full object-cover transition-opacity duration-300 group-hover:opacity-90"
					})]
				}), /* @__PURE__ */ jsx("div", {
					className: "mt-4",
					children: /* @__PURE__ */ jsx(ListItemCardContent, {
						item,
						padding,
						itemTitleColor,
						itemTitleSize,
						descriptionColor,
						descriptionSize,
						priceColor,
						priceSize,
						originalPriceColor,
						metaTextColor,
						metaTextSize,
						showMetaText
					})
				})]
			}, item.id);
		})
	});
}
//#endregion
//#region ../widgets/src/widgets/list-widget/OrderedList.tsx
const getImageUrl = (item) => {
	return item.imageUrl || item.image;
};
const formatRank = (n) => n < 10 ? `0${n}` : String(n);
function OrderedList({ items, scrollAxis, gap, borderRadius, imageAspectRatio: _imageAspectRatio, showBadge, padding, itemTitleColor, itemTitleSize, descriptionColor, descriptionSize, priceColor, priceSize, originalPriceColor, metaTextColor, metaTextSize, numberColor, numberSize, showMetaText, scrollContainerRef: externalScrollRef }) {
	const internalScrollRef = useRef(null);
	const scrollContainerRef = externalScrollRef ?? internalScrollRef;
	const { onItemClick } = useWidgetInteraction();
	const interactionProps = (item) => onItemClick ? {
		role: "button",
		tabIndex: 0,
		onClick: () => onItemClick(item),
		onKeyDown: (e) => {
			if (e.key === "Enter" || e.key === " ") {
				e.preventDefault();
				onItemClick(item);
			}
		}
	} : {};
	const contentProps = {
		padding,
		itemTitleColor,
		itemTitleSize,
		descriptionColor,
		descriptionSize,
		priceColor,
		priceSize,
		originalPriceColor,
		metaTextColor,
		metaTextSize,
		showMetaText
	};
	if (scrollAxis === "horizontal") return /* @__PURE__ */ jsx("div", {
		className: "relative",
		children: /* @__PURE__ */ jsx("div", {
			ref: scrollContainerRef,
			className: `flex gap-${gapValues[gap]} scrollbar-hide overflow-x-auto overflow-y-hidden scroll-smooth`,
			children: items.map((item, index) => {
				const imageUrl = getImageUrl(item);
				const rank = index + 1;
				return /* @__PURE__ */ jsxs("div", {
					className: `group relative flex flex-shrink-0 flex-col ${onItemClick ? "cursor-pointer" : ""}`,
					...interactionProps(item),
					children: [/* @__PURE__ */ jsxs("div", {
						className: "flex items-end",
						children: [
							/* @__PURE__ */ jsxs("span", {
								className: "sr-only",
								children: [
									"Rank ",
									rank,
									": "
								]
							}),
							/* @__PURE__ */ jsx("span", {
								className: `text-${numberColor} pointer-events-none flex-shrink-0 font-black italic tabular-nums select-none`,
								style: {
									fontSize: "11rem",
									lineHeight: "0.82",
									letterSpacing: "-0.06em"
								},
								"aria-hidden": "true",
								children: rank
							}),
							imageUrl && /* @__PURE__ */ jsxs("div", {
								className: `relative aspect-[3/4] w-[200px] flex-shrink-0 ${cardRadiusClass(borderRadius)} bg-muted/30 overflow-hidden`,
								children: [showBadge && item.discount && /* @__PURE__ */ jsx(DiscountBadge, { discount: item.discount }), /* @__PURE__ */ jsx("img", {
									src: imageUrl,
									alt: item.title || "Product",
									className: "h-full w-full object-cover"
								})]
							})
						]
					}), /* @__PURE__ */ jsx("div", {
						className: "mt-5 ml-auto w-[200px]",
						children: /* @__PURE__ */ jsx(ListItemCardContent, {
							item,
							...contentProps
						})
					})]
				}, item.id);
			})
		})
	});
	if (scrollAxis === "vertical") return /* @__PURE__ */ jsx("div", {
		className: `flex flex-col gap-${gapValues[gap]}`,
		children: items.map((item, index) => {
			const imageUrl = getImageUrl(item);
			const rank = index + 1;
			const isLast = index === items.length - 1;
			return /* @__PURE__ */ jsxs("div", {
				className: `group relative flex items-center gap-${gapValues[gap]} py-6 ${!isLast ? "border-b" : ""} ${onItemClick ? "cursor-pointer" : ""}`,
				style: !isLast ? { borderColor: "color-mix(in oklch, var(--color-foreground) 8%, transparent)" } : void 0,
				...interactionProps(item),
				children: [
					/* @__PURE__ */ jsxs("span", {
						className: "sr-only",
						children: [
							"Rank ",
							rank,
							": "
						]
					}),
					/* @__PURE__ */ jsx("span", {
						className: `text-${numberColor} font-header w-14 flex-shrink-0 text-${numberSize === "md" ? "base" : numberSize} leading-none font-light tracking-tight italic`,
						"aria-hidden": "true",
						children: formatRank(rank)
					}),
					imageUrl && /* @__PURE__ */ jsx("div", {
						className: `relative h-16 w-16 flex-shrink-0 overflow-hidden ${cardRadiusClass(borderRadius)} bg-muted/30`,
						children: /* @__PURE__ */ jsx("img", {
							src: imageUrl,
							alt: item.title || "Product",
							className: "h-full w-full object-cover"
						})
					}),
					/* @__PURE__ */ jsx("div", {
						className: "min-w-0 flex-1",
						children: /* @__PURE__ */ jsx(ListItemCardContent, {
							item,
							...contentProps
						})
					}),
					showBadge && item.discount && /* @__PURE__ */ jsx("span", {
						className: "text-muted ml-2 flex-shrink-0 text-[10px] font-semibold tracking-[0.08em] uppercase",
						children: getStringValue(item.discount)
					})
				]
			}, item.id);
		})
	});
	return null;
}
//#endregion
//#region ../widgets/src/widgets/ListWidget.tsx
var ListWidget_exports = /* @__PURE__ */ __exportAll({
	ListWidget: () => ListWidget,
	listWidgetPropertySchema: () => listWidgetPropertySchema
});
const DEFAULT_ITEMS = [];
function getFeaturedAssetUrl(value) {
	if (!value) return void 0;
	if (typeof value === "string") return {
		url: value,
		isVideo: /\.(mp4|webm|ogg|mov)$/i.test(value)
	};
	if (typeof value === "object") {
		const videoUrl = value.videoUrl || value.video_url || value.url;
		const isVideoByKind = value.kind === "video";
		if (videoUrl && (isVideoByKind || /\.(mp4|webm|ogg|mov)(?:$|\?|#)/i.test(videoUrl))) return {
			url: videoUrl,
			isVideo: true
		};
		const imageUrl = value.imageUrl || value.image_url || value.url;
		if (imageUrl) return {
			url: imageUrl,
			isVideo: false
		};
	}
}
function ListWidget({ listType = "unordered", scrollAxis = "horizontal", titleEnabled = true, title, items = DEFAULT_ITEMS, titleColor = "foreground", titleSize = "lg", itemTitleColor = "foreground", itemTitleSize = "sm", descriptionColor = "foreground", descriptionSize = "sm", priceColor = "foreground", priceSize = "md", originalPriceColor = "muted", metaTextColor = "muted", metaTextSize = "xs", numberColor = "primary", numberSize = "2xl", borderRadius = "md", borderWidth = "none", borderColor = "muted", padding = 4, gap = "md", columns = 3, imageAspectRatio = "square", background = {
	type: "solid",
	color: "background"
}, showBadge = true, showMetaText = true, maxItems = 12, showFeaturedSection = false, featuredAsset, featuredTitle, featuredSubtitle, featuredButtonText, featuredButtonUrl, featuredSubtitleColor = "background", featuredSubtitleSize = "md", className, ...props }) {
	const displayItems = maxItems ? items.slice(0, maxItems) : items;
	const hasItems = displayItems.length > 0;
	const itemStyleProps = {
		padding,
		itemTitleColor,
		itemTitleSize,
		descriptionColor,
		descriptionSize,
		priceColor,
		priceSize,
		originalPriceColor,
		metaTextColor,
		metaTextSize,
		showMetaText,
		showBadge,
		borderRadius,
		imageAspectRatio,
		gap
	};
	const hasFeaturedAsset = getFeaturedAssetUrl(featuredAsset);
	const shouldShowFeaturedSection = showFeaturedSection && hasFeaturedAsset;
	const backgroundColor = background.color || "background";
	const backgroundImage = (background.resource?.image_url || background.resource?.imageUrl) && background.type === "image" ? `url(${background.resource.image_url || background.resource.imageUrl})` : "none";
	const isOrderedHorizontal = listType === "ordered" && scrollAxis === "horizontal";
	const showScrollArrows = isOrderedHorizontal && hasItems && displayItems.length > 1;
	const { scrollContainerRef, canScrollPrev, canScrollNext, scrollByAmount } = useHorizontalScrollState({
		enabled: showScrollArrows,
		contentLength: displayItems.length
	});
	const hasTitle = titleEnabled && title;
	const showTitleRow = hasTitle || showScrollArrows;
	return /* @__PURE__ */ jsxs("div", {
		className: `@container bg-${backgroundColor} p-${padding === 0 && borderWidth !== "none" ? 4 : padding} rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== "none" ? borderColorClasses[borderColor] : ""} ${className}`,
		style: { backgroundImage },
		...props,
		children: [showTitleRow && /* @__PURE__ */ jsxs("div", {
			className: "mb-8 flex items-center justify-between gap-4",
			children: [hasTitle ? /* @__PURE__ */ jsx("h2", {
				className: `text-${titleColor} text-${titleSize === "md" ? "base" : titleSize} font-header leading-tight font-medium tracking-tight`,
				children: title
			}) : /* @__PURE__ */ jsx("span", {}), showScrollArrows && /* @__PURE__ */ jsxs("div", {
				className: "flex shrink-0 items-center gap-2",
				children: [/* @__PURE__ */ jsx("button", {
					type: "button",
					onClick: () => scrollByAmount("prev"),
					disabled: !canScrollPrev,
					"aria-label": "Previous items",
					className: `text-${numberColor} flex size-9 items-center justify-center rounded-full transition-opacity hover:opacity-60 disabled:cursor-not-allowed disabled:opacity-20`,
					style: { boxShadow: `inset 0 0 0 1px color-mix(in oklch, var(--color-${numberColor}) 25%, transparent)` },
					children: /* @__PURE__ */ jsx(ChevronLeft, {
						"aria-hidden": "true",
						className: "size-4"
					})
				}), /* @__PURE__ */ jsx("button", {
					type: "button",
					onClick: () => scrollByAmount("next"),
					disabled: !canScrollNext,
					"aria-label": "Next items",
					className: `text-${numberColor} flex size-9 items-center justify-center rounded-full transition-opacity hover:opacity-60 disabled:cursor-not-allowed disabled:opacity-20`,
					style: { boxShadow: `inset 0 0 0 1px color-mix(in oklch, var(--color-${numberColor}) 25%, transparent)` },
					children: /* @__PURE__ */ jsx(ChevronRight, {
						"aria-hidden": "true",
						className: "size-4"
					})
				})]
			})]
		}), !hasItems ? /* @__PURE__ */ jsx("div", {
			className: "flex items-center justify-center py-20 text-center",
			children: /* @__PURE__ */ jsx("p", {
				className: "text-muted/70 text-sm tracking-tight",
				children: "No items to display"
			})
		}) : shouldShowFeaturedSection ? /* @__PURE__ */ jsxs("div", {
			className: "flex flex-col gap-4 @lg:flex-row @lg:gap-6",
			children: [/* @__PURE__ */ jsx("div", {
				className: "w-full @lg:w-[45%]",
				children: /* @__PURE__ */ jsx(FeaturedSection, {
					borderRadius,
					titleSize,
					featuredTitle,
					featuredSubtitle,
					featuredButtonText,
					featuredButtonUrl,
					featuredSubtitleColor,
					featuredSubtitleSize,
					asset: hasFeaturedAsset
				})
			}), /* @__PURE__ */ jsx("div", {
				className: "w-full @lg:w-[55%]",
				children: listType === "unordered" ? /* @__PURE__ */ jsx(UnorderedList, {
					items: displayItems,
					columns,
					...itemStyleProps
				}) : /* @__PURE__ */ jsx(OrderedList, {
					items: displayItems,
					scrollAxis,
					numberColor,
					numberSize,
					scrollContainerRef: isOrderedHorizontal ? scrollContainerRef : void 0,
					...itemStyleProps
				})
			})]
		}) : listType === "unordered" ? /* @__PURE__ */ jsx(UnorderedList, {
			items: displayItems,
			columns,
			...itemStyleProps
		}) : /* @__PURE__ */ jsx(OrderedList, {
			items: displayItems,
			scrollAxis,
			numberColor,
			numberSize,
			scrollContainerRef: isOrderedHorizontal ? scrollContainerRef : void 0,
			...itemStyleProps
		})]
	});
}
const SCROLL_BUTTON_AMOUNT = 300;
const SCROLL_EDGE_TOLERANCE = 4;
const useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
function useHorizontalScrollState({ enabled, contentLength }) {
	const scrollContainerRef = useRef(null);
	const [canScrollPrev, setCanScrollPrev] = useState(false);
	const [canScrollNext, setCanScrollNext] = useState(false);
	const resetScrollState = useCallback(() => {
		setCanScrollPrev(false);
		setCanScrollNext(false);
	}, []);
	const updateScrollState = useCallback(() => {
		const el = scrollContainerRef.current;
		if (!enabled || !el) {
			resetScrollState();
			return;
		}
		setCanScrollPrev(el.scrollLeft > SCROLL_EDGE_TOLERANCE);
		setCanScrollNext(el.scrollLeft + el.clientWidth < el.scrollWidth - SCROLL_EDGE_TOLERANCE);
	}, [enabled, resetScrollState]);
	useIsomorphicLayoutEffect(() => {
		updateScrollState();
	}, [updateScrollState]);
	useEffect(() => {
		if (!enabled) {
			resetScrollState();
			return;
		}
		const el = scrollContainerRef.current;
		if (!el) {
			resetScrollState();
			return;
		}
		updateScrollState();
		el.addEventListener("scroll", updateScrollState, { passive: true });
		const resize = typeof ResizeObserver !== "undefined" ? new ResizeObserver(updateScrollState) : void 0;
		resize?.observe(el);
		return () => {
			el.removeEventListener("scroll", updateScrollState);
			resize?.disconnect();
		};
	}, [
		enabled,
		resetScrollState,
		updateScrollState,
		contentLength
	]);
	return {
		scrollContainerRef,
		canScrollPrev,
		canScrollNext,
		scrollByAmount: useCallback((direction) => {
			const el = scrollContainerRef.current;
			if (!el) return;
			const amount = SCROLL_BUTTON_AMOUNT + (parseFloat(getComputedStyle(el).gap) || 0);
			el.scrollTo({
				left: el.scrollLeft + (direction === "next" ? amount : -amount),
				behavior: "smooth"
			});
		}, [])
	};
}
const listWidgetPropertySchema = {
	widgetType: "ListWidget",
	displayName: "List",
	tabsConfig: [{
		id: "styling",
		label: "Styling"
	}, {
		id: "data",
		label: "Data"
	}],
	dataSourceTargetProps: ["items"],
	fields: [
		{
			key: "titleEnabled",
			label: "Widget Title",
			type: "boolean",
			description: "Enable the title displayed above the list",
			defaultValue: true,
			tab: "styling",
			group: "Title"
		},
		{
			key: "title",
			label: "Title",
			type: "text",
			description: "Header text for the list",
			defaultValue: "List",
			tab: "styling",
			group: "Title",
			requiresKeyToBeTrue: "titleEnabled"
		},
		getFontSizeField({
			key: "titleSize",
			label: "Title Font Size",
			description: "Size of the list title",
			defaultValue: "xl",
			tab: "styling",
			group: "Title",
			requiresKeyToBeTrue: "titleEnabled"
		}),
		getColorField({
			key: "titleColor",
			label: "Title Color",
			description: "Color for the list title",
			defaultValue: "foreground",
			tab: "styling",
			group: "Title",
			requiresKeyToBeTrue: "titleEnabled"
		}),
		getPaddingField({
			key: "padding",
			label: "Padding",
			description: "Padding inside the container",
			defaultValue: 4,
			tab: "styling",
			group: "Design"
		}),
		getBorderRadiusField({
			key: "borderRadius",
			label: "Border Radius",
			description: "Rounded corners for the container and images",
			defaultValue: "md",
			tab: "styling",
			group: "Design"
		}),
		getBorderWidthField({
			key: "borderWidth",
			label: "Border Width",
			description: "Border width for the widget",
			defaultValue: "none",
			tab: "styling",
			group: "Design"
		}),
		getBorderColorField({
			key: "borderColor",
			label: "Border Color",
			description: "Border color for the widget",
			defaultValue: "muted",
			tab: "styling",
			group: "Design"
		}),
		getGapField({
			key: "gap",
			label: "Gap",
			description: "Spacing between items",
			defaultValue: "md",
			tab: "styling",
			group: "Design"
		}),
		{
			type: "background",
			defaultValue: "background",
			key: "background",
			label: "Background",
			description: "Background color or image for the widget",
			tab: "styling",
			group: "Design"
		},
		{
			key: "listType",
			label: "List Type",
			type: "select",
			description: "Type of list layout",
			defaultValue: "unordered",
			options: [{
				label: "Unordered (Grid)",
				value: "unordered"
			}, {
				label: "Ordered (Numbered)",
				value: "ordered"
			}],
			tab: "styling",
			group: "List Configuration"
		},
		{
			key: "maxItems",
			label: "Max Items",
			type: "number",
			description: "Maximum number of items to display",
			min: 1,
			max: 100,
			step: 1,
			defaultValue: 12,
			tab: "styling",
			group: "List Configuration"
		},
		{
			key: "imageAspectRatio",
			label: "Image Aspect Ratio",
			type: "buttonGroup",
			description: "Aspect ratio for item images (unordered list — ordered layouts use a fixed ratio per axis)",
			defaultValue: "square",
			options: [
				{
					label: "Square",
					value: "square"
				},
				{
					label: "Landscape",
					value: "landscape"
				},
				{
					label: "Portrait",
					value: "portrait"
				}
			],
			tab: "styling",
			group: "List Configuration",
			requiresKeyValue: {
				key: "listType",
				value: "unordered"
			}
		},
		{
			key: "showBadge",
			label: "Show Discount Badge",
			type: "boolean",
			description: "Display discount badge on images",
			defaultValue: true,
			tab: "styling",
			group: "List Configuration"
		},
		{
			key: "showMetaText",
			label: "Show QV/CV Text",
			type: "boolean",
			description: "Display QV and CV values",
			defaultValue: true,
			tab: "styling",
			group: "List Configuration"
		},
		{
			key: "columns",
			label: "Grid Columns",
			type: "number",
			description: "Number of columns in the grid (unordered list only)",
			min: 1,
			max: 6,
			step: 1,
			defaultValue: 3,
			tab: "styling",
			group: "Unordered List Configuration",
			requiresKeyValue: {
				key: "listType",
				value: "unordered"
			}
		},
		{
			key: "scrollAxis",
			label: "Scroll Direction",
			type: "select",
			description: "Direction for ordered list scrolling",
			defaultValue: "horizontal",
			options: [{
				label: "Horizontal",
				value: "horizontal"
			}, {
				label: "Vertical",
				value: "vertical"
			}],
			tab: "styling",
			group: "Ordered List Configuration",
			requiresKeyValue: {
				key: "listType",
				value: "ordered"
			}
		},
		getColorField({
			key: "numberColor",
			label: "Number Color",
			description: "Color for ordered list numbers",
			defaultValue: "primary",
			tab: "styling",
			group: "Ordered List Configuration",
			requiresKeyValue: {
				key: "listType",
				value: "ordered"
			}
		}),
		getFontSizeField({
			key: "numberSize",
			label: "Number Font Size",
			description: "Size of ordered list numbers (vertical scroll only — horizontal uses a fixed editorial size)",
			defaultValue: "2xl",
			tab: "styling",
			group: "Ordered List Configuration",
			requiresKeyValue: [{
				key: "listType",
				value: "ordered"
			}, {
				key: "scrollAxis",
				value: "vertical"
			}]
		}),
		getColorField({
			key: "itemTitleColor",
			label: "Item Title Color",
			description: "Color for item titles",
			defaultValue: "foreground",
			tab: "styling",
			group: "Item Styling"
		}),
		getFontSizeField({
			key: "itemTitleSize",
			label: "Item Title Font Size",
			description: "Size of item titles",
			defaultValue: "sm",
			tab: "styling",
			group: "Item Styling"
		}),
		{
			key: "separator2",
			type: "separator",
			label: "Separator",
			tab: "styling",
			group: "Item Styling"
		},
		getColorField({
			key: "descriptionColor",
			label: "Description Color",
			description: "Color for descriptions",
			defaultValue: "foreground",
			tab: "styling",
			group: "Item Styling"
		}),
		getFontSizeField({
			key: "descriptionSize",
			label: "Description Font Size",
			description: "Size of descriptions",
			defaultValue: "sm",
			tab: "styling",
			group: "Item Styling"
		}),
		{
			key: "separator3",
			type: "separator",
			label: "Separator",
			tab: "styling",
			group: "Item Styling"
		},
		getColorField({
			key: "priceColor",
			label: "Price Color",
			description: "Color for prices",
			defaultValue: "foreground",
			tab: "styling",
			group: "Item Styling"
		}),
		getFontSizeField({
			key: "priceSize",
			label: "Price Font Size",
			description: "Size of prices",
			defaultValue: "md",
			tab: "styling",
			group: "Item Styling"
		}),
		getColorField({
			key: "originalPriceColor",
			label: "Original Price Color",
			description: "Color for crossed-out original prices",
			defaultValue: "foreground",
			tab: "styling",
			group: "Item Styling"
		}),
		{
			key: "separator4",
			type: "separator",
			label: "Separator",
			tab: "styling",
			group: "Item Styling"
		},
		getColorField({
			key: "metaTextColor",
			label: "Meta Text Color",
			description: "Color for QV/CV text",
			defaultValue: "foreground",
			tab: "styling",
			group: "Item Styling"
		}),
		getFontSizeField({
			key: "metaTextSize",
			label: "Meta Text Font Size",
			description: "Size of QV/CV text",
			defaultValue: "xs",
			tab: "styling",
			group: "Item Styling"
		}),
		{
			key: "showFeaturedSection",
			label: "Show Featured Section",
			type: "boolean",
			description: "Display a featured content section",
			defaultValue: false,
			tab: "styling",
			group: "Featured Section"
		},
		{
			key: "featuredAsset",
			label: "Featured Asset",
			type: "image",
			accept: "any",
			description: "Select a single image or video resource for the featured section",
			tab: "styling",
			group: "Featured Section",
			requiresKeyToBeTrue: "showFeaturedSection"
		},
		{
			key: "featuredTitle",
			label: "Featured Title",
			type: "text",
			description: "Title for featured section",
			tab: "styling",
			group: "Featured Section",
			requiresKeyToBeTrue: "showFeaturedSection"
		},
		{
			key: "featuredSubtitle",
			label: "Featured Subtitle",
			type: "text",
			description: "Subtitle for featured section",
			tab: "styling",
			group: "Featured Section",
			requiresKeyToBeTrue: "showFeaturedSection"
		},
		{
			key: "featuredButtonText",
			label: "Featured Button Text",
			type: "text",
			description: "Text for featured section button",
			tab: "styling",
			group: "Featured Section",
			requiresKeyToBeTrue: "showFeaturedSection"
		},
		{
			key: "featuredButtonUrl",
			label: "Featured Button URL",
			type: "text",
			description: "URL for featured section button",
			tab: "styling",
			group: "Featured Section",
			requiresKeyToBeTrue: "showFeaturedSection"
		},
		getColorField({
			key: "featuredSubtitleColor",
			label: "Featured Subtitle Color",
			description: "Color for featured subtitle",
			defaultValue: "background",
			tab: "styling",
			group: "Featured Section",
			requiresKeyToBeTrue: "showFeaturedSection"
		}),
		getFontSizeField({
			key: "featuredSubtitleSize",
			label: "Featured Subtitle Font Size",
			description: "Size of featured subtitle",
			defaultValue: "md",
			tab: "styling",
			group: "Featured Section",
			requiresKeyToBeTrue: "showFeaturedSection"
		}),
		{
			key: "dataSource",
			label: "Data Source",
			type: "dataSource",
			description: "",
			tab: "data",
			group: "Data Configuration"
		}
	],
	itemConfigSchema: {
		description: "Configure settings for this list item",
		fields: [
			{
				key: "title",
				label: "Custom Title",
				type: "text",
				description: "Override the item's title"
			},
			{
				key: "description",
				label: "Custom Description",
				type: "textarea",
				description: "Override the item's description",
				rows: 3
			},
			{
				key: "price",
				label: "Price",
				type: "text",
				description: "Current price"
			},
			{
				key: "originalPrice",
				label: "Original Price",
				type: "text",
				description: "Original price (will be crossed out)"
			},
			{
				key: "discount",
				label: "Discount Badge",
				type: "text",
				description: "Discount text (e.g., '40% Off')"
			},
			{
				key: "qv",
				label: "QV Value",
				type: "text",
				description: "Qualifying Volume value"
			},
			{
				key: "cv",
				label: "CV Value",
				type: "text",
				description: "Commission Volume value"
			},
			{
				key: "image",
				label: "Image URL",
				type: "text",
				description: "Custom image URL for this item"
			}
		]
	}
};
//#endregion
export { ListWidget_exports as n, listWidgetPropertySchema as r, ListWidget as t };

//# sourceMappingURL=ListWidget-QgFIR9fE.mjs.map