import { toHexadecimal } from "./lib-util-to-hexadecimal.js";
import { toDecimal } from "./lib-util-to-decimal.js";
import { toNamed } from "./lib-util-to-named.js";
function formatSmart(code, next, options) {
  let numeric = toHexadecimal(code, next, options.omitOptionalSemicolons);
  let named;
  if (options.useNamedReferences || options.useShortestReferences) {
    named = toNamed(
      code,
      next,
      options.omitOptionalSemicolons,
      options.attribute
    );
  }
  if ((options.useShortestReferences || !named) && options.useShortestReferences) {
    const decimal = toDecimal(code, next, options.omitOptionalSemicolons);
    if (decimal.length < numeric.length) {
      numeric = decimal;
    }
  }
  return named && (!options.useShortestReferences || named.length < numeric.length) ? named : numeric;
}
export {
  formatSmart
};
//# sourceMappingURL=lib-util-format-smart.js.map
