import { RULESET as i, KEYFRAMES as f, COMMENT as n, DECLARATION as p, IMPORT as E, LAYER as v } from "./Enum.mjs";
import { strlen as t } from "./Utility.mjs";
function a(r, s) {
  for (var o = "", u = 0; u < r.length; u++)
    o += s(r[u], u, r, s) || "";
  return o;
}
function A(r, s, o, u) {
  switch (r.type) {
    case v:
      if (r.children.length)
        break;
    case E:
    case p:
      return r.return = r.return || r.value;
    case n:
      return "";
    case f:
      return r.return = r.value + "{" + a(r.children, u) + "}";
    case i:
      if (!t(r.value = r.props.join(",")))
        return "";
  }
  return t(o = a(r.children, u)) ? r.return = r.value + "{" + o + "}" : "";
}
export {
  a as serialize,
  A as stringify
};
