import { L as o } from "./index-Lexical2.js";
import { L as n } from "./index-LexicalToolkit.js";
const p = (s) => {
  const {
    editor: t
  } = s;
  return {
    replaceSelection: (i) => {
      t.update(() => {
        const e = o.$getSelection();
        if (o.$isRangeSelection(e)) {
          e.removeText();
          const c = n.convertHtmlToNodes(i, t);
          e.insertNodes(c);
        }
      });
    }
  };
};
export {
  p as useRteAiAssistantAi
};
