import { __exports as e } from "./index-_virtual30.js";
import p from "react";
import { __require as P } from "./index-LexicalComposerContext2.js";
import { __require as O } from "./index-LexicalOnChangePlugin.js";
import { __require as q } from "./index-LexicalHtml2.js";
var g;
function H() {
  if (g) return e;
  g = 1;
  var s = e && e.__importDefault || function(n) {
    return n && n.__esModule ? n : { default: n };
  };
  Object.defineProperty(e, "__esModule", { value: !0 }), e.OnChangeContentPlugin = void 0;
  const c = s(p), m = P(), f = O(), h = q();
  let a, u;
  function x(n) {
    const { onHtmlChange: l, onTextChange: _ } = n, [C] = (0, m.useLexicalComposerContext)();
    return c.default.createElement(f.OnChangePlugin, { onChange: (r) => {
      r.read(() => {
        var o;
        let i = (0, h.$generateHtmlFromNodes)(C);
        const t = ((o = C.getRootElement()) === null || o === void 0 ? void 0 : o.textContent) || "";
        i !== a && (l && l(i, t, r), a = i), t !== u && (_ && _(t, t, r), u = t);
      });
    } });
  }
  return e.OnChangeContentPlugin = x, e;
}
export {
  H as __require
};
