import { getUnexpectedInvocationParameterMessage as u } from "./utils/getUnexpectedInvocationParameterMessage.js";
const g = (t, i) => {
  const c = Object.keys(t);
  return (n, r) => {
    if (typeof n > "u" && (n = i()), process.env.NODE_ENV !== "production") {
      const e = u(
        n,
        t,
        r
      );
      e && console.error(e);
    }
    return n.withMutations((e) => {
      c.forEach((o) => {
        const f = t[o], d = e.get(o), s = f(d, r);
        if (s === void 0)
          throw new Error(
            'Reducer "' + o + '" returned undefined when handling "' + r.type + '" action. To ignore an action, you must explicitly return the previous state.'
          );
        e.set(o, s);
      });
    });
  };
};
export {
  g as combineReducers
};
