/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
"use client";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
require("../../../_virtual/_rolldown/runtime.cjs");
let react = require("react");
let react_jsx_runtime = require("react/jsx-runtime");
//#region src/components/client/Toast/UDSToastConfigProvider.tsx
const ToastContext = (0, react.createContext)(void 0);
const UDSToastConfigProvider = ({ children, value }) => {
	const existingContext = (0, react.useContext)(ToastContext);
	const isMerge = typeof value === "object" && "type" in value && value.type === "merge";
	if (isMerge && !existingContext) throw new Error("Cannot merge context values without an existing ToastContext");
	const finalValue = isMerge ? {
		...existingContext,
		...value.value
	} : value;
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToastContext.Provider, {
		value: finalValue,
		children
	});
};
UDSToastConfigProvider.displayName = "UDSToastConfigProvider";
const useToastConfig = (sizeProp, variantProp) => {
	const context = (0, react.useContext)(ToastContext);
	if (!context) throw new Error("useToastConfig must be used within a UDSConfigProvider or UDSToastConfigProvider");
	const { defaultSize, defaultVariant, textVariant, textColor, iconSize, buttonSize, buttonVariant, iconVariant, ...rest } = context;
	const size = sizeProp ?? defaultSize;
	const variant = variantProp ?? defaultVariant;
	return {
		...rest,
		size,
		variant,
		textVariant: textVariant[size],
		textColor: textColor[variant],
		iconSize: iconSize[size],
		buttonSize: buttonSize[size],
		buttonVariant: buttonVariant[variant],
		iconVariant: iconVariant[variant]
	};
};
//#endregion
exports.UDSToastConfigProvider = UDSToastConfigProvider;
exports.useToastConfig = useToastConfig;
