import { FluentIcon } from "../../../../utilities/iconLibrary/FluentIcon.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
import { Link } from "react-router-dom";
import PropTypes from "prop-types";
import "./UdpActionCard.css";
//#region src/UI/inputs/buttons/UdpActionCard/UdpActionCard.jsx
/**
* UdpActionCard - An accessible workflow card component
*
* @param {Object} props
* @param {React.Component} props.icon - Fluent UI icon component
* @param {string} props.iconColor - Icon color (CSS var, hex, or system color: info, warning, error, success, note)
* @param {string} props.primaryText - Main heading text
* @param {string} props.secondaryText - Description text
* @param {string} [props.href] - External link URL
* @param {string} [props.to] - React Router link path
* @param {function} [props.onClick] - Click handler
* @param {string} [props.className] - Additional CSS classes
*/
const UdpActionCard = (t0) => {
	const $ = c(50);
	let href;
	let icon;
	let onClick;
	let primaryText;
	let rest;
	let secondaryText;
	let t1;
	let t2;
	let to;
	if ($[0] !== t0) {
		({icon, iconColor: t1, primaryText, secondaryText, href, to, onClick, className: t2, ...rest} = t0);
		$[0] = t0;
		$[1] = href;
		$[2] = icon;
		$[3] = onClick;
		$[4] = primaryText;
		$[5] = rest;
		$[6] = secondaryText;
		$[7] = t1;
		$[8] = t2;
		$[9] = to;
	} else {
		href = $[1];
		icon = $[2];
		onClick = $[3];
		primaryText = $[4];
		rest = $[5];
		secondaryText = $[6];
		t1 = $[7];
		t2 = $[8];
		to = $[9];
	}
	const iconColor = t1 === void 0 ? "info" : t1;
	const className = t2 === void 0 ? "" : t2;
	let t3;
	if ($[10] !== iconColor) {
		const getIconColor = () => {
			const systemColors = {
				info: "var(--info-color-main)",
				warning: "var(--warning-color-main)",
				error: "var(--error-color-main)",
				success: "var(--success-color-main)",
				note: "var(--note-color-main)",
				primary: "var(--primary-color-main)",
				secondary: "var(--secondary-color-main)"
			};
			if (systemColors[iconColor]) return systemColors[iconColor];
			if (iconColor.startsWith("var(--")) return iconColor;
			return iconColor;
		};
		t3 = getIconColor();
		$[10] = iconColor;
		$[11] = t3;
	} else t3 = $[11];
	const resolvedIconColor = t3;
	if (!icon) {
		console.error("UdpActionCard: icon prop is required");
		return null;
	}
	let t4;
	if ($[12] !== resolvedIconColor) {
		t4 = { color: resolvedIconColor };
		$[12] = resolvedIconColor;
		$[13] = t4;
	} else t4 = $[13];
	let t5;
	if ($[14] !== icon) {
		t5 = /* @__PURE__ */ React.createElement(FluentIcon, {
			component: icon,
			size: 48,
			customSize: true
		});
		$[14] = icon;
		$[15] = t5;
	} else t5 = $[15];
	let t6;
	if ($[16] !== t4 || $[17] !== t5) {
		t6 = /* @__PURE__ */ React.createElement("div", {
			className: "udp-action-card__icon",
			style: t4
		}, t5);
		$[16] = t4;
		$[17] = t5;
		$[18] = t6;
	} else t6 = $[18];
	let t7;
	if ($[19] !== primaryText) {
		t7 = /* @__PURE__ */ React.createElement("div", { className: "udp-action-card__primary-text" }, primaryText);
		$[19] = primaryText;
		$[20] = t7;
	} else t7 = $[20];
	let t8;
	if ($[21] !== secondaryText) {
		t8 = /* @__PURE__ */ React.createElement("div", { className: "udp-action-card__secondary-text" }, secondaryText);
		$[21] = secondaryText;
		$[22] = t8;
	} else t8 = $[22];
	let t9;
	if ($[23] !== t7 || $[24] !== t8) {
		t9 = /* @__PURE__ */ React.createElement("div", { className: "udp-action-card__content" }, t7, t8);
		$[23] = t7;
		$[24] = t8;
		$[25] = t9;
	} else t9 = $[25];
	let t10;
	if ($[26] !== t6 || $[27] !== t9) {
		t10 = /* @__PURE__ */ React.createElement(React.Fragment, null, t6, t9);
		$[26] = t6;
		$[27] = t9;
		$[28] = t10;
	} else t10 = $[28];
	const cardContent = t10;
	const t11 = `udp-action-card ${className}`;
	let t12;
	if ($[29] !== resolvedIconColor) {
		t12 = { "--card-border-color": resolvedIconColor };
		$[29] = resolvedIconColor;
		$[30] = t12;
	} else t12 = $[30];
	let t13;
	if ($[31] !== rest || $[32] !== t11 || $[33] !== t12) {
		t13 = {
			className: t11,
			style: t12,
			...rest
		};
		$[31] = rest;
		$[32] = t11;
		$[33] = t12;
		$[34] = t13;
	} else t13 = $[34];
	const commonProps = t13;
	if (href) {
		let t14;
		if ($[35] !== cardContent || $[36] !== commonProps || $[37] !== href) {
			t14 = /* @__PURE__ */ React.createElement("a", {
				...commonProps,
				href,
				rel: "noopener noreferrer"
			}, cardContent);
			$[35] = cardContent;
			$[36] = commonProps;
			$[37] = href;
			$[38] = t14;
		} else t14 = $[38];
		return t14;
	}
	if (to) {
		let t14;
		if ($[39] !== cardContent || $[40] !== commonProps || $[41] !== to) {
			t14 = /* @__PURE__ */ React.createElement(Link, {
				...commonProps,
				to
			}, cardContent);
			$[39] = cardContent;
			$[40] = commonProps;
			$[41] = to;
			$[42] = t14;
		} else t14 = $[42];
		return t14;
	}
	if (onClick) {
		let t14;
		if ($[43] !== cardContent || $[44] !== commonProps || $[45] !== onClick) {
			t14 = /* @__PURE__ */ React.createElement("button", {
				...commonProps,
				onClick,
				type: "button"
			}, cardContent);
			$[43] = cardContent;
			$[44] = commonProps;
			$[45] = onClick;
			$[46] = t14;
		} else t14 = $[46];
		return t14;
	}
	let t14;
	if ($[47] !== cardContent || $[48] !== commonProps) {
		t14 = /* @__PURE__ */ React.createElement("div", {
			...commonProps,
			role: "article"
		}, cardContent);
		$[47] = cardContent;
		$[48] = commonProps;
		$[49] = t14;
	} else t14 = $[49];
	return t14;
};
UdpActionCard.propTypes = {
	icon: PropTypes.elementType.isRequired,
	iconColor: PropTypes.string,
	primaryText: PropTypes.string.isRequired,
	secondaryText: PropTypes.string.isRequired,
	href: PropTypes.string,
	to: PropTypes.string,
	onClick: PropTypes.func,
	className: PropTypes.string
};
//#endregion
export { UdpActionCard };

//# sourceMappingURL=UdpActionCard.mjs.map