import { __require as J } from "../../../error-ex@1.3.2/node_modules/error-ex/index.js";
import { __require as E } from "../../../json-parse-even-better-errors@2.3.1/node_modules/json-parse-even-better-errors/index.js";
import { __require as N } from "../../../lines-and-columns@1.2.4/node_modules/lines-and-columns/build/index.js";
import { __require as g } from "../../../@babel_code-frame@7.16.7/node_modules/@babel/code-frame/lib/index.js";
var i, l;
function S() {
  if (l)
    return i;
  l = 1;
  const n = J(), p = E(), { default: d } = N(), { codeFrameColumns: f } = g(), c = n("JSONError", {
    fileName: n.append("in %s"),
    codeFrame: n.append(`

%s
`)
  }), u = (o, e, s) => {
    typeof e == "string" && (s = e, e = null);
    try {
      try {
        return JSON.parse(o, e);
      } catch (r) {
        throw p(o, e), r;
      }
    } catch (r) {
      r.message = r.message.replace(/\n/g, "");
      const t = r.message.match(/in JSON at position (\d+) while parsing/), a = new c(r);
      if (s && (a.fileName = s), t && t.length > 0) {
        const h = new d(o), q = Number(t[1]), m = h.locationForIndex(q), _ = f(
          o,
          { start: { line: m.line + 1, column: m.column + 1 } },
          { highlightCode: !0 }
        );
        a.codeFrame = _;
      }
      throw a;
    }
  };
  return u.JSONError = c, i = u, i;
}
export {
  S as __require
};
//# sourceMappingURL=index.js.map
