import * as r from "monaco-editor";
import { getJsonAstNodeFromPath as m } from "./get-json-ast-node-from-path.js";
import { configureJson as a } from "../configure-language-support.js";
const u = (s) => {
  const o = r.editor.createModel(s ?? "", "json");
  return a(o.uri.toString()), {
    model: o,
    getRangeFromPath: async (i) => {
      const t = await m(o, i);
      if (!t)
        return null;
      const e = o.getPositionAt(t.offset), n = o.getPositionAt(t.offset + t.length);
      return new r.Range(e.lineNumber, e.column, n.lineNumber, n.column);
    }
  };
};
export {
  u as createJsonModel
};
