import { useComponentBaseConfig } from "../config-provider/context.js";
import useCSSVarCls_default from "../config-provider/hooks/useCSSVarCls.js";
import style_default from "./style/index.js";
import { TypeIcon, getCloseIcon } from "./PurePanel.js";
import { computed, createVNode, defineComponent } from "vue";
import { clsx } from "@v-c/util";
import { NotificationList } from "@v-c/notification";

//#region src/notification/PureList.tsx
/**
* @private Internal component. Do not use in production.
* Mirrors ant-design 6.4.0 `notification._InternalListDoNotUseOrYouWillBeFired`.
*/
const PureList = /* @__PURE__ */ defineComponent((props) => {
	const { getPrefixCls } = useComponentBaseConfig("notification", props);
	const prefixCls = computed(() => getPrefixCls("notification"));
	const rootCls = useCSSVarCls_default(prefixCls);
	const [hashId, cssVarCls] = style_default(prefixCls, rootCls);
	return () => {
		const noticePrefixCls = `${prefixCls.value}-notice`;
		const configList = props.items.map((item) => {
			const { actions, description, duration, key, showProgress, title, type } = item;
			const typeIconCls = `${noticePrefixCls}-icon-${type}`;
			return {
				key,
				actions,
				closable: { closeIcon: getCloseIcon(noticePrefixCls) },
				description,
				duration,
				icon: TypeIcon[type] ? createVNode(TypeIcon[type]) : null,
				showProgress,
				title,
				class: `${noticePrefixCls}-${type}`,
				classNames: { icon: typeIconCls }
			};
		});
		return createVNode(NotificationList, {
			"prefixCls": prefixCls.value,
			"placement": props.placement ?? "topRight",
			"configList": configList,
			"class": clsx(hashId.value, cssVarCls.value, rootCls.value),
			"classNames": props.classes,
			"style": props.style,
			"stack": false
		}, null);
	};
}, {
	props: {
		items: {
			type: Array,
			required: true
		},
		placement: {
			type: String,
			required: false
		},
		classes: {
			type: [Object, Function],
			required: false
		},
		style: {
			type: Object,
			required: false
		}
	},
	name: "NotificationPureList",
	inheritAttrs: false
});
var PureList_default = PureList;

//#endregion
export { PureList_default as default };