import { toHexadecimal as e } from "./to-hexadecimal.js";
import { toDecimal as t } from "./to-decimal.js";
import { toNamed as n } from "./to-named.js";
//#region ../../node_modules/stringify-entities/lib/util/format-smart.js
function r(r, i, a) {
	let o = e(r, i, a.omitOptionalSemicolons), s;
	if ((a.useNamedReferences || a.useShortestReferences) && (s = n(r, i, a.omitOptionalSemicolons, a.attribute)), (a.useShortestReferences || !s) && a.useShortestReferences) {
		let e = t(r, i, a.omitOptionalSemicolons);
		e.length < o.length && (o = e);
	}
	return s && (!a.useShortestReferences || s.length < o.length) ? s : o;
}
//#endregion
export { r as formatSmart };
