var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports, "__esModule", { value: true });exports.createHighlighter = createHighlighter;exports.processTokens = processTokens;var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));

var _core = require("vendor/shiki/core/core");
var _engineJavascript = require("vendor/shiki/core/engine-javascript");function

initializeHighlighter(_x, _x2) {return _initializeHighlighter.apply(this, arguments);}function _initializeHighlighter() {_initializeHighlighter = (0, _asyncToGenerator2.default)(function* (langs, themes) {
    return (0, _core.createHighlighterCore)({
      engine: (0, _engineJavascript.createJavaScriptRegexEngine)(),
      langs: langs,
      themes: themes
    });
  });return _initializeHighlighter.apply(this, arguments);}function

createHighlighter(_x3) {return _createHighlighter.apply(this, arguments);}function _createHighlighter() {_createHighlighter = (0, _asyncToGenerator2.default)(function* (_ref) {var langs = _ref.langs,themes = _ref.themes;
    if (!(langs != null && langs.length) || !(themes != null && themes.length)) {
      throw new Error('Please provide both `langs` and `themes` when creating a highlighter.');
    }

    try {
      var highlighter = yield initializeHighlighter(langs, themes);
      console.log('Initialized highlighter:', highlighter);
      return highlighter;
    }
    catch (error) {
      console.error('Failed to create highlighter:', error);
      throw error;
    }
  });return _createHighlighter.apply(this, arguments);}

function processTokens(tokens) {
  return tokens.map(function (token) {var _token$fontStyle;return {
      content: token.content,
      color: token.color || '#000000',
      fontStyle: (_token$fontStyle = token.fontStyle) == null ? void 0 : _token$fontStyle.toString()
    };});
}
//# sourceMappingURL=index.js.map