function f(e, n, r) {
  return Object.keys(e).reduce((s, t) => n(s, e[t], t), r);
}
function g(e, n) {
  Object.keys(e).forEach((r) => n(e[r], r));
}
function p(e, n, r, s) {
  const t = {};
  return g(e, (o, u) => {
    const c = r[u];
    c !== n[u] && (t[u] = c, o(s, c));
  }), t;
}
function d(e, n, r) {
  return f(r, (t, i, o) => (typeof e[o] == "function" && t.push(google.maps.event.addListener(n, i, e[o])), t), []);
}
function a(e) {
  google.maps.event.removeListener(e);
}
function v(e = []) {
  e.forEach(a);
}
function E({
  updaterMap: e,
  eventMap: n,
  prevProps: r,
  nextProps: s,
  instance: t
}) {
  const i = d(s, t, n);
  return p(e, r, s, t), i;
}
export {
  p as applyUpdaterToNextProps,
  E as applyUpdatersToPropsAndRegisterEvents,
  d as registerEvents,
  v as unregisterEvents
};
