/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
"use client";
import { Children, isValidElement } from "react";
//#region src/components/client/Modal/utils.ts
function getModalSlot(child) {
	if (!isValidElement(child)) return null;
	return child.type?.__modalSlot ?? null;
}
function separateChildren(children) {
	let title = null;
	let description = null;
	let content = null;
	let actions = null;
	Children.forEach(children, (child) => {
		if (child == null || child === false || child === true || child === "") return;
		const slot = getModalSlot(child);
		if (slot === "title") title = child;
		else if (slot === "description") description = child;
		else if (slot === "content") content = child;
		else if (slot === "actions") actions = child;
	});
	return {
		title,
		description,
		content,
		actions
	};
}
//#endregion
export { separateChildren };
