import { __require as x } from "./index-LexicalComposerContext2.js";
import E from "react";
var o, d;
function w() {
  if (d) return o;
  d = 1;
  var l = x(), r = E, s = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? r.useLayoutEffect : r.useEffect;
  function f(e) {
    let [t] = l.useLexicalComposerContext(), n = r.useMemo(() => e(t), [t, e]), i = r.useRef(n.initialValueFn()), [m, a] = r.useState(i.current);
    return s(() => {
      let { initialValueFn: b, subscribe: _ } = n, u = b();
      return i.current !== u && (i.current = u, a(u)), _((c) => {
        i.current = c, a(c);
      });
    }, [n, e]), m;
  }
  function p(e) {
    return { initialValueFn: () => e.isEditable(), subscribe: (t) => e.registerEditableListener(t) };
  }
  return o = function() {
    return f(p);
  }, o;
}
export {
  w as __require
};
