import { toHexadecimal } from "./to-hexadecimal.js";
import { toDecimal } from "./to-decimal.js";
import { toNamed } from "./to-named.js";
function formatSmart(r, i, a) {
	let o = toHexadecimal(r, i, a.omitOptionalSemicolons), s;
	if ((a.useNamedReferences || a.useShortestReferences) && (s = toNamed(r, i, a.omitOptionalSemicolons, a.attribute)), (a.useShortestReferences || !s) && a.useShortestReferences) {
		let e = toDecimal(r, i, a.omitOptionalSemicolons);
		e.length < o.length && (o = e);
	}
	return s && (!a.useShortestReferences || s.length < o.length) ? s : o;
}
export { formatSmart };
