var v = Object.defineProperty;
var u = (n, m) => v(n, "name", { value: m, configurable: !0 });
import { InternalOneofInfo as N } from "./field.js";
import { localFieldName as T, fieldJsonName as k } from "./names.js";
import { LongType as _, ScalarType as s } from "../scalar.js";
function L(n, m) {
  var l, d, f, i, t, r;
  const p = [];
  let a;
  for (const e of typeof n == "function" ? n() : n) {
    const o = e;
    if (o.localName = T(e.name, e.oneof !== void 0), o.jsonName = (l = e.jsonName) !== null && l !== void 0 ? l : k(e.name), o.repeated = (d = e.repeated) !== null && d !== void 0 ? d : !1, e.kind == "scalar" && (o.L = (f = e.L) !== null && f !== void 0 ? f : _.BIGINT), o.delimited = (i = e.delimited) !== null && i !== void 0 ? i : !1, o.req = (t = e.req) !== null && t !== void 0 ? t : !1, o.opt = (r = e.opt) !== null && r !== void 0 ? r : !1, e.packed === void 0 && (o.packed = e.kind == "enum" || e.kind == "scalar" && e.T != s.BYTES && e.T != s.STRING), e.oneof !== void 0) {
      const c = typeof e.oneof == "string" ? e.oneof : e.oneof.name;
      (!a || a.name != c) && (a = new N(c)), o.oneof = a, a.addField(o);
    }
    p.push(o);
  }
  return p;
}
u(L, "normalizeFieldInfos");
export {
  L as normalizeFieldInfos
};
