/*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
const require_index = require("../../css-tokens/dist/index.cjs");
const require_index$1 = require("../../modes/dist/index.cjs");
const require_fromEntries = require("../../utils/fromEntries.cjs");
const require_composeTailwindPlugins = require("../utils/composeTailwindPlugins.cjs");
let tailwindcss_plugin_js = require("tailwindcss/plugin.js");
tailwindcss_plugin_js = require_runtime.__toESM(tailwindcss_plugin_js, 1);
//#region src/tailwind/plugins/borderWidth.ts
const UDS_BORDER_WIDTH_THEME_KEY = "udsBorderWidth";
const udsBorderWidthToCSSVariable = (token) => `var(--${require_index.BORDER_WIDTH_PREFIX}-${token})`;
const getBorderWidthTheme = (config, mergeTokensIntoTailwindTheme) => {
	/**
	* Given the UDS border width tokens in config (none, thin, medium, thick), create a tailwind
	* border width theme value that points to the corresponding UDS CSS variables.
	*
	* For example:
	*
	*   {
	*     thin: 'var(--uds-border-width-thin)',
	*     thick: 'var(--uds-border-width-thick)',
	*   }
	*
	* Note: The values of the CSS variables are defined elsewhere. This code only ensures the Tailwind-generated
	* classes are mapped to the correct CSS variable.
	*/
	const udsBorderWidths = require_fromEntries.fromEntries(Object.keys(config).map((udsAlias) => [udsAlias, udsBorderWidthToCSSVariable(udsAlias)]));
	if (!mergeTokensIntoTailwindTheme) return { [UDS_BORDER_WIDTH_THEME_KEY]: udsBorderWidths };
	const widths = {
		...udsBorderWidths,
		DEFAULT: udsBorderWidthToCSSVariable("thin"),
		"2": udsBorderWidthToCSSVariable("medium"),
		"4": udsBorderWidthToCSSVariable("thick")
	};
	return {
		[UDS_BORDER_WIDTH_THEME_KEY]: udsBorderWidths,
		borderWidth: widths,
		outlineWidth: {
			...widths,
			DEFAULT: "2px"
		},
		outlineOffset: {
			...widths,
			DEFAULT: "2px"
		}
	};
};
const borderWidthPlugin = tailwindcss_plugin_js.default.withOptions(() => ({ matchUtilities, theme }) => {
	matchUtilities({
		"uds-border-width": (value) => ({ "border-width": value }),
		"uds-border-width-x": (value) => ({
			"border-left-width": value,
			"border-right-width": value
		}),
		"uds-border-width-y": (value) => ({
			"border-top-width": value,
			"border-bottom-width": value
		}),
		"uds-border-width-top": (value) => ({ "border-top-width": value }),
		"uds-border-width-right": (value) => ({ "border-right-width": value }),
		"uds-border-width-bottom": (value) => ({ "border-bottom-width": value }),
		"uds-border-width-left": (value) => ({ "border-left-width": value }),
		"uds-border-width-start": (value) => ({ "border-inline-start-width": value }),
		"uds-border-width-end": (value) => ({ "border-inline-end-width": value })
	}, { values: theme(UDS_BORDER_WIDTH_THEME_KEY) });
}, ({ config, disableOverrideTailwindTheme }) => {
	const shouldNotMergeBorderWidthTokensIntoTailwindTheme = require_composeTailwindPlugins.shouldNotMergeTokensIntoTailwindTheme(disableOverrideTailwindTheme, "borderWidth");
	return { theme: { extend: { ...getBorderWidthTheme(config.scaleMode[require_index$1.DEFAULT_SCALE_MODE].borderWidth, !shouldNotMergeBorderWidthTokensIntoTailwindTheme) } } };
});
//#endregion
exports.UDS_BORDER_WIDTH_THEME_KEY = UDS_BORDER_WIDTH_THEME_KEY;
exports.borderWidthPlugin = borderWidthPlugin;
