/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
import { __toESM } from "../_virtual/_rolldown/runtime.js";
import { require_plugin } from "../node_modules/.bun/tailwindcss@3.4.19_7500dce058369e0a/node_modules/tailwindcss/plugin.js";
import { entries } from "../packages/utils/dist/entries.js";
import { shouldNotMergeTokensIntoTailwindTheme } from "../utils/composeTailwindPlugins.js";
import { mapValues } from "../packages/utils/dist/mapValues.js";
import { assertUnreachable } from "../packages/utils/dist/assertUnreachable.js";
//#region ../tailwind-internal/dist/plugins/breakpoints.js
/*! © 2026 Yahoo, Inc. UDS Tailwind Internal v0.0.0-development */
var import_plugin = /* @__PURE__ */ __toESM(require_plugin(), 1);
const UDS_BREAKPOINTS_THEME_KEY = "udsBreakpoints";
const getScreensTheme = (config, mergeTokensIntoTailwindTheme) => {
	const breakpoints = mapValues(config, (breakpoint) => {
		switch (breakpoint.type) {
			case "px": return `${breakpoint.value}px`;
		}
		return assertUnreachable(breakpoint.type);
	});
	if (!mergeTokensIntoTailwindTheme) return { [UDS_BREAKPOINTS_THEME_KEY]: breakpoints };
	return {
		[UDS_BREAKPOINTS_THEME_KEY]: breakpoints,
		screens: breakpoints
	};
};
const breakpointsPlugin = import_plugin.default.withOptions(({ config }) => ({ addVariant }) => {
	const breakpoints = entries(config.breakpoints).sort(([, { value: minWidthA }], [, { value: minWidthB }]) => minWidthA - minWidthB);
	for (const [name, { value: minWidth }] of breakpoints) addVariant(`uds-${name}`, `@media (min-width: ${minWidth}px)`);
}, ({ config, disableOverrideTailwindTheme }) => {
	const shouldNotMergeScreensTokensIntoTailwindTheme = shouldNotMergeTokensIntoTailwindTheme(disableOverrideTailwindTheme, "screens");
	return { theme: { extend: { ...getScreensTheme(config.breakpoints, !shouldNotMergeScreensTokensIntoTailwindTheme) } } };
});
//#endregion
export { breakpointsPlugin };
