"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const React = __importStar(require("react"));
const react_syntax_highlighter_1 = require("react-syntax-highlighter");
const vs_1 = __importDefault(require("react-syntax-highlighter/dist/cjs/styles/prism/vs"));
const xonokai_1 = __importDefault(require("react-syntax-highlighter/dist/cjs/styles/prism/xonokai"));
const customStyle = {
    padding: "10px 0px 10px 10px",
    margin: "0px",
    backgroundColor: "var(--cm-background, #fafafa)",
    border: "none"
};
const Highlighter = (props) => {
    let language = props.language;
    if (language === "ipython") {
        language = "python";
    }
    else if (language === "text/x-scala") {
        // Adjust for the scala codemirror type
        language = "scala";
    }
    else if (language.startsWith("text/x-")) {
        // Strip off the language from the mimetype
        language = language.slice("text/x-".length);
    }
    return (React.createElement(react_syntax_highlighter_1.Prism, { style: props.theme === "light" ? vs_1.default : xonokai_1.default, language: language, className: props.className, customStyle: customStyle }, props.children));
};
Highlighter.defaultProps = {
    theme: "light",
    language: "text",
    children: "",
    className: "input"
};
exports.default = Highlighter;
//# sourceMappingURL=index.js.map