"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.MDXDocReader = void 0;
function _docs() {
  const data = require("@teambit/docs");
  _docs = function () {
    return data;
  };
  return data;
}
function _mdxCompilers() {
  const data = require("@teambit/mdx.compilers.mdx-transpiler");
  _mdxCompilers = function () {
    return data;
  };
  return data;
}
class MDXDocReader {
  constructor(extensions) {
    this.extensions = extensions;
  }
  async read(path, contents) {
    const output = await (0, _mdxCompilers().compile)(contents.toString('utf-8'), {
      filepath: path
    });
    const metadata = output.getMetadata();
    const doc = _docs().Doc.from(path, metadata);
    return doc;
  }
  isFormatSupported(format) {
    return this.extensions.includes(format);
  }
}
exports.MDXDocReader = MDXDocReader;

//# sourceMappingURL=mdx.doc-reader.js.map