import { n as __exportAll } from "./chunk-B-1-B7_t.js";
import { n as cn } from "./utils-DXzSsU1e.js";
import { a as CardDescription_default, n as CardTitle_default, o as CardContent_default, r as CardHeader_default, s as Card_default } from "./card-X74FuL7B.js";
import { t as ElementRenderer_default } from "./ElementRenderer-DV1pZRd4.js";
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, normalizeClass, normalizeStyle, openBlock, renderList, toDisplayString, unref, withCtx } from "vue";
//#region src/components/compositions/elements/card/ListCard.vue?vue&type=script&setup=true&lang.ts
var _hoisted_1 = {
	key: 0,
	class: "py-3 text-sm text-muted-foreground"
};
var ListCard_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
	__name: "ListCard",
	props: {
		label: {},
		title: {},
		subtitle: {},
		showCard: {
			type: Boolean,
			default: true
		},
		gutterY: { default: "1rem" },
		gutterX: { default: "0" },
		nestedElements: { default: () => [] },
		item: { default: () => ({}) },
		classList: {}
	},
	setup(__props) {
		/**
		* `card.list` element composition.
		*
		* Renders a vertical stack of nested child elements inside an optional
		* Card chrome. Acts as the element-tier equivalent of `ElementListCard`
		* and replaces `configuration-block.elements-block` as the canonical
		* inline element container.
		*
		* In the FormBuilder the canvas resolves `elementList` IDs → objects and
		* passes them here as `nestedElements`. In static JSON the host can also
		* supply `nestedElements` directly.
		*/
		const props = __props;
		const heading = computed(() => props.title ?? props.label);
		const children = computed(() => (props.nestedElements ?? []).filter((e) => typeof e === "object" && e !== null && typeof e.type === "string"));
		const bodyStyle = computed(() => ({
			rowGap: props.gutterY,
			columnGap: props.gutterX
		}));
		return (_ctx, _cache) => {
			return props.showCard !== false ? (openBlock(), createBlock(unref(Card_default), {
				key: 0,
				class: normalizeClass(unref(cn)(props.classList)),
				"data-element-list-card": ""
			}, {
				default: withCtx(() => [heading.value || props.subtitle ? (openBlock(), createBlock(unref(CardHeader_default), { key: 0 }, {
					default: withCtx(() => [heading.value ? (openBlock(), createBlock(unref(CardTitle_default), { key: 0 }, {
						default: withCtx(() => [createTextVNode(toDisplayString(heading.value), 1)]),
						_: 1
					})) : createCommentVNode("", true), props.subtitle ? (openBlock(), createBlock(unref(CardDescription_default), { key: 1 }, {
						default: withCtx(() => [createTextVNode(toDisplayString(props.subtitle), 1)]),
						_: 1
					})) : createCommentVNode("", true)]),
					_: 1
				})) : createCommentVNode("", true), createVNode(unref(CardContent_default), {
					class: "flex flex-col",
					style: normalizeStyle(bodyStyle.value)
				}, {
					default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(children.value, (child) => {
						return openBlock(), createBlock(ElementRenderer_default, {
							key: child.id,
							element: child,
							item: props.item
						}, null, 8, ["element", "item"]);
					}), 128)), !children.value.length ? (openBlock(), createElementBlock("p", _hoisted_1, " No elements configured. ")) : createCommentVNode("", true)]),
					_: 1
				}, 8, ["style"])]),
				_: 1
			}, 8, ["class"])) : (openBlock(), createElementBlock("div", {
				key: 1,
				class: normalizeClass(["flex flex-col", unref(cn)(props.classList)]),
				style: normalizeStyle(bodyStyle.value),
				"data-element-list-card": ""
			}, [(openBlock(true), createElementBlock(Fragment, null, renderList(children.value, (child) => {
				return openBlock(), createBlock(ElementRenderer_default, {
					key: child.id,
					element: child,
					item: props.item
				}, null, 8, ["element", "item"]);
			}), 128))], 6));
		};
	}
});
//#endregion
//#region src/components/compositions/elements/card/ListCard.vue
var ListCard_exports = /* @__PURE__ */ __exportAll({ default: () => ListCard_default });
var ListCard_default = ListCard_vue_vue_type_script_setup_true_lang_default;
//#endregion
export { ListCard_exports as n, ListCard_default as t };

//# sourceMappingURL=ListCard-BYMgRygo.js.map