UNPKG

@tntx/markdown-preview-react

Version:
1,289 lines (1,248 loc) 66.9 kB
// src/MdPreviewer/index.tsx import React7, { useEffect as useEffect2, useLayoutEffect, useRef as useRef2 } from "react"; import ReactMarkdown from "react-markdown"; import remarkGfm from "remark-gfm"; import rehypeHighlight from "rehype-highlight"; import rehypeRaw from "rehype-raw"; // ../../node_modules/.pnpm/@ant-design+icons@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/components/Context.js import { createContext } from "react"; var IconContext = /* @__PURE__ */ createContext({}); var Context_default = IconContext; // ../../node_modules/.pnpm/@babel+runtime@7.26.9/node_modules/@babel/runtime/helpers/esm/extends.js function _extends() { return _extends = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } // ../../node_modules/.pnpm/@babel+runtime@7.26.9/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } // ../../node_modules/.pnpm/@babel+runtime@7.26.9/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = true, o = false; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = false; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = true) ; } catch (r2) { o = true, n = r2; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } // ../../node_modules/.pnpm/@babel+runtime@7.26.9/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } // ../../node_modules/.pnpm/@babel+runtime@7.26.9/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } // ../../node_modules/.pnpm/@babel+runtime@7.26.9/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } // ../../node_modules/.pnpm/@babel+runtime@7.26.9/node_modules/@babel/runtime/helpers/esm/slicedToArray.js function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); } // ../../node_modules/.pnpm/@babel+runtime@7.26.9/node_modules/@babel/runtime/helpers/esm/typeof.js function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { return typeof o2; } : function(o2) { return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; }, _typeof(o); } // ../../node_modules/.pnpm/@babel+runtime@7.26.9/node_modules/@babel/runtime/helpers/esm/toPrimitive.js function toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } // ../../node_modules/.pnpm/@babel+runtime@7.26.9/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js function toPropertyKey(t) { var i = toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } // ../../node_modules/.pnpm/@babel+runtime@7.26.9/node_modules/@babel/runtime/helpers/esm/defineProperty.js function _defineProperty(e, r, t) { return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; } // ../../node_modules/.pnpm/@babel+runtime@7.26.9/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; } // ../../node_modules/.pnpm/@babel+runtime@7.26.9/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } // ../../node_modules/.pnpm/@ant-design+icons@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/components/AntdIcon.js import * as React3 from "react"; import classNames from "classnames"; // ../../node_modules/.pnpm/@ant-design+fast-color@2.0.6/node_modules/@ant-design/fast-color/es/FastColor.js var round = Math.round; function splitColorStr(str, parseNum) { const match = str.replace(/^[^(]*\((.*)/, "$1").replace(/\).*/, "").match(/\d*\.?\d+%?/g) || []; const numList = match.map((item) => parseFloat(item)); for (let i = 0; i < 3; i += 1) { numList[i] = parseNum(numList[i] || 0, match[i] || "", i); } if (match[3]) { numList[3] = match[3].includes("%") ? numList[3] / 100 : numList[3]; } else { numList[3] = 1; } return numList; } var parseHSVorHSL = (num, _, index) => index === 0 ? num : num / 100; function limitRange(value, max) { const mergedMax = max || 255; if (value > mergedMax) { return mergedMax; } if (value < 0) { return 0; } return value; } var FastColor = class _FastColor { constructor(input) { _defineProperty(this, "isValid", true); _defineProperty(this, "r", 0); _defineProperty(this, "g", 0); _defineProperty(this, "b", 0); _defineProperty(this, "a", 1); _defineProperty(this, "_h", void 0); _defineProperty(this, "_s", void 0); _defineProperty(this, "_l", void 0); _defineProperty(this, "_v", void 0); _defineProperty(this, "_max", void 0); _defineProperty(this, "_min", void 0); _defineProperty(this, "_brightness", void 0); function matchFormat(str) { return str[0] in input && str[1] in input && str[2] in input; } if (!input) { } else if (typeof input === "string") { let matchPrefix2 = function(prefix) { return trimStr.startsWith(prefix); }; var matchPrefix = matchPrefix2; const trimStr = input.trim(); if (/^#?[A-F\d]{3,8}$/i.test(trimStr)) { this.fromHexString(trimStr); } else if (matchPrefix2("rgb")) { this.fromRgbString(trimStr); } else if (matchPrefix2("hsl")) { this.fromHslString(trimStr); } else if (matchPrefix2("hsv") || matchPrefix2("hsb")) { this.fromHsvString(trimStr); } } else if (input instanceof _FastColor) { this.r = input.r; this.g = input.g; this.b = input.b; this.a = input.a; this._h = input._h; this._s = input._s; this._l = input._l; this._v = input._v; } else if (matchFormat("rgb")) { this.r = limitRange(input.r); this.g = limitRange(input.g); this.b = limitRange(input.b); this.a = typeof input.a === "number" ? limitRange(input.a, 1) : 1; } else if (matchFormat("hsl")) { this.fromHsl(input); } else if (matchFormat("hsv")) { this.fromHsv(input); } else { throw new Error("@ant-design/fast-color: unsupported input " + JSON.stringify(input)); } } // ======================= Setter ======================= setR(value) { return this._sc("r", value); } setG(value) { return this._sc("g", value); } setB(value) { return this._sc("b", value); } setA(value) { return this._sc("a", value, 1); } setHue(value) { const hsv = this.toHsv(); hsv.h = value; return this._c(hsv); } // ======================= Getter ======================= /** * Returns the perceived luminance of a color, from 0-1. * @see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef */ getLuminance() { function adjustGamma(raw) { const val = raw / 255; return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4); } const R = adjustGamma(this.r); const G = adjustGamma(this.g); const B = adjustGamma(this.b); return 0.2126 * R + 0.7152 * G + 0.0722 * B; } getHue() { if (typeof this._h === "undefined") { const delta = this.getMax() - this.getMin(); if (delta === 0) { this._h = 0; } else { this._h = round(60 * (this.r === this.getMax() ? (this.g - this.b) / delta + (this.g < this.b ? 6 : 0) : this.g === this.getMax() ? (this.b - this.r) / delta + 2 : (this.r - this.g) / delta + 4)); } } return this._h; } getSaturation() { if (typeof this._s === "undefined") { const delta = this.getMax() - this.getMin(); if (delta === 0) { this._s = 0; } else { this._s = delta / this.getMax(); } } return this._s; } getLightness() { if (typeof this._l === "undefined") { this._l = (this.getMax() + this.getMin()) / 510; } return this._l; } getValue() { if (typeof this._v === "undefined") { this._v = this.getMax() / 255; } return this._v; } /** * Returns the perceived brightness of the color, from 0-255. * Note: this is not the b of HSB * @see http://www.w3.org/TR/AERT#color-contrast */ getBrightness() { if (typeof this._brightness === "undefined") { this._brightness = (this.r * 299 + this.g * 587 + this.b * 114) / 1e3; } return this._brightness; } // ======================== Func ======================== darken(amount = 10) { const h = this.getHue(); const s = this.getSaturation(); let l = this.getLightness() - amount / 100; if (l < 0) { l = 0; } return this._c({ h, s, l, a: this.a }); } lighten(amount = 10) { const h = this.getHue(); const s = this.getSaturation(); let l = this.getLightness() + amount / 100; if (l > 1) { l = 1; } return this._c({ h, s, l, a: this.a }); } /** * Mix the current color a given amount with another color, from 0 to 100. * 0 means no mixing (return current color). */ mix(input, amount = 50) { const color = this._c(input); const p = amount / 100; const calc = (key) => (color[key] - this[key]) * p + this[key]; const rgba = { r: round(calc("r")), g: round(calc("g")), b: round(calc("b")), a: round(calc("a") * 100) / 100 }; return this._c(rgba); } /** * Mix the color with pure white, from 0 to 100. * Providing 0 will do nothing, providing 100 will always return white. */ tint(amount = 10) { return this.mix({ r: 255, g: 255, b: 255, a: 1 }, amount); } /** * Mix the color with pure black, from 0 to 100. * Providing 0 will do nothing, providing 100 will always return black. */ shade(amount = 10) { return this.mix({ r: 0, g: 0, b: 0, a: 1 }, amount); } onBackground(background) { const bg = this._c(background); const alpha = this.a + bg.a * (1 - this.a); const calc = (key) => { return round((this[key] * this.a + bg[key] * bg.a * (1 - this.a)) / alpha); }; return this._c({ r: calc("r"), g: calc("g"), b: calc("b"), a: alpha }); } // ======================= Status ======================= isDark() { return this.getBrightness() < 128; } isLight() { return this.getBrightness() >= 128; } // ======================== MISC ======================== equals(other) { return this.r === other.r && this.g === other.g && this.b === other.b && this.a === other.a; } clone() { return this._c(this); } // ======================= Format ======================= toHexString() { let hex = "#"; const rHex = (this.r || 0).toString(16); hex += rHex.length === 2 ? rHex : "0" + rHex; const gHex = (this.g || 0).toString(16); hex += gHex.length === 2 ? gHex : "0" + gHex; const bHex = (this.b || 0).toString(16); hex += bHex.length === 2 ? bHex : "0" + bHex; if (typeof this.a === "number" && this.a >= 0 && this.a < 1) { const aHex = round(this.a * 255).toString(16); hex += aHex.length === 2 ? aHex : "0" + aHex; } return hex; } /** CSS support color pattern */ toHsl() { return { h: this.getHue(), s: this.getSaturation(), l: this.getLightness(), a: this.a }; } /** CSS support color pattern */ toHslString() { const h = this.getHue(); const s = round(this.getSaturation() * 100); const l = round(this.getLightness() * 100); return this.a !== 1 ? `hsla(${h},${s}%,${l}%,${this.a})` : `hsl(${h},${s}%,${l}%)`; } /** Same as toHsb */ toHsv() { return { h: this.getHue(), s: this.getSaturation(), v: this.getValue(), a: this.a }; } toRgb() { return { r: this.r, g: this.g, b: this.b, a: this.a }; } toRgbString() { return this.a !== 1 ? `rgba(${this.r},${this.g},${this.b},${this.a})` : `rgb(${this.r},${this.g},${this.b})`; } toString() { return this.toRgbString(); } // ====================== Privates ====================== /** Return a new FastColor object with one channel changed */ _sc(rgb, value, max) { const clone = this.clone(); clone[rgb] = limitRange(value, max); return clone; } _c(input) { return new this.constructor(input); } getMax() { if (typeof this._max === "undefined") { this._max = Math.max(this.r, this.g, this.b); } return this._max; } getMin() { if (typeof this._min === "undefined") { this._min = Math.min(this.r, this.g, this.b); } return this._min; } fromHexString(trimStr) { const withoutPrefix = trimStr.replace("#", ""); function connectNum(index1, index2) { return parseInt(withoutPrefix[index1] + withoutPrefix[index2 || index1], 16); } if (withoutPrefix.length < 6) { this.r = connectNum(0); this.g = connectNum(1); this.b = connectNum(2); this.a = withoutPrefix[3] ? connectNum(3) / 255 : 1; } else { this.r = connectNum(0, 1); this.g = connectNum(2, 3); this.b = connectNum(4, 5); this.a = withoutPrefix[6] ? connectNum(6, 7) / 255 : 1; } } fromHsl({ h, s, l, a }) { this._h = h % 360; this._s = s; this._l = l; this.a = typeof a === "number" ? a : 1; if (s <= 0) { const rgb = round(l * 255); this.r = rgb; this.g = rgb; this.b = rgb; } let r = 0, g = 0, b = 0; const huePrime = h / 60; const chroma = (1 - Math.abs(2 * l - 1)) * s; const secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1)); if (huePrime >= 0 && huePrime < 1) { r = chroma; g = secondComponent; } else if (huePrime >= 1 && huePrime < 2) { r = secondComponent; g = chroma; } else if (huePrime >= 2 && huePrime < 3) { g = chroma; b = secondComponent; } else if (huePrime >= 3 && huePrime < 4) { g = secondComponent; b = chroma; } else if (huePrime >= 4 && huePrime < 5) { r = secondComponent; b = chroma; } else if (huePrime >= 5 && huePrime < 6) { r = chroma; b = secondComponent; } const lightnessModification = l - chroma / 2; this.r = round((r + lightnessModification) * 255); this.g = round((g + lightnessModification) * 255); this.b = round((b + lightnessModification) * 255); } fromHsv({ h, s, v, a }) { this._h = h % 360; this._s = s; this._v = v; this.a = typeof a === "number" ? a : 1; const vv = round(v * 255); this.r = vv; this.g = vv; this.b = vv; if (s <= 0) { return; } const hh = h / 60; const i = Math.floor(hh); const ff = hh - i; const p = round(v * (1 - s) * 255); const q = round(v * (1 - s * ff) * 255); const t = round(v * (1 - s * (1 - ff)) * 255); switch (i) { case 0: this.g = t; this.b = p; break; case 1: this.r = q; this.b = p; break; case 2: this.r = p; this.b = t; break; case 3: this.r = p; this.g = q; break; case 4: this.r = t; this.g = p; break; case 5: default: this.g = p; this.b = q; break; } } fromHsvString(trimStr) { const cells = splitColorStr(trimStr, parseHSVorHSL); this.fromHsv({ h: cells[0], s: cells[1], v: cells[2], a: cells[3] }); } fromHslString(trimStr) { const cells = splitColorStr(trimStr, parseHSVorHSL); this.fromHsl({ h: cells[0], s: cells[1], l: cells[2], a: cells[3] }); } fromRgbString(trimStr) { const cells = splitColorStr(trimStr, (num, txt) => ( // Convert percentage to number. e.g. 50% -> 128 txt.includes("%") ? round(num / 100 * 255) : num )); this.r = cells[0]; this.g = cells[1]; this.b = cells[2]; this.a = cells[3]; } }; // ../../node_modules/.pnpm/@ant-design+colors@7.2.0/node_modules/@ant-design/colors/es/generate.js var hueStep = 2; var saturationStep = 0.16; var saturationStep2 = 0.05; var brightnessStep1 = 0.05; var brightnessStep2 = 0.15; var lightColorCount = 5; var darkColorCount = 4; var darkColorMap = [{ index: 7, amount: 15 }, { index: 6, amount: 25 }, { index: 5, amount: 30 }, { index: 5, amount: 45 }, { index: 5, amount: 65 }, { index: 5, amount: 85 }, { index: 4, amount: 90 }, { index: 3, amount: 95 }, { index: 2, amount: 97 }, { index: 1, amount: 98 }]; function getHue(hsv, i, light) { var hue; if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) { hue = light ? Math.round(hsv.h) - hueStep * i : Math.round(hsv.h) + hueStep * i; } else { hue = light ? Math.round(hsv.h) + hueStep * i : Math.round(hsv.h) - hueStep * i; } if (hue < 0) { hue += 360; } else if (hue >= 360) { hue -= 360; } return hue; } function getSaturation(hsv, i, light) { if (hsv.h === 0 && hsv.s === 0) { return hsv.s; } var saturation; if (light) { saturation = hsv.s - saturationStep * i; } else if (i === darkColorCount) { saturation = hsv.s + saturationStep; } else { saturation = hsv.s + saturationStep2 * i; } if (saturation > 1) { saturation = 1; } if (light && i === lightColorCount && saturation > 0.1) { saturation = 0.1; } if (saturation < 0.06) { saturation = 0.06; } return Math.round(saturation * 100) / 100; } function getValue(hsv, i, light) { var value; if (light) { value = hsv.v + brightnessStep1 * i; } else { value = hsv.v - brightnessStep2 * i; } value = Math.max(0, Math.min(1, value)); return Math.round(value * 100) / 100; } function generate(color) { var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; var patterns = []; var pColor = new FastColor(color); var hsv = pColor.toHsv(); for (var i = lightColorCount; i > 0; i -= 1) { var c = new FastColor({ h: getHue(hsv, i, true), s: getSaturation(hsv, i, true), v: getValue(hsv, i, true) }); patterns.push(c); } patterns.push(pColor); for (var _i = 1; _i <= darkColorCount; _i += 1) { var _c = new FastColor({ h: getHue(hsv, _i), s: getSaturation(hsv, _i), v: getValue(hsv, _i) }); patterns.push(_c); } if (opts.theme === "dark") { return darkColorMap.map(function(_ref) { var index = _ref.index, amount = _ref.amount; return new FastColor(opts.backgroundColor || "#141414").mix(patterns[index], amount).toHexString(); }); } return patterns.map(function(c2) { return c2.toHexString(); }); } // ../../node_modules/.pnpm/@ant-design+colors@7.2.0/node_modules/@ant-design/colors/es/presets.js var red = ["#fff1f0", "#ffccc7", "#ffa39e", "#ff7875", "#ff4d4f", "#f5222d", "#cf1322", "#a8071a", "#820014", "#5c0011"]; red.primary = red[5]; var volcano = ["#fff2e8", "#ffd8bf", "#ffbb96", "#ff9c6e", "#ff7a45", "#fa541c", "#d4380d", "#ad2102", "#871400", "#610b00"]; volcano.primary = volcano[5]; var orange = ["#fff7e6", "#ffe7ba", "#ffd591", "#ffc069", "#ffa940", "#fa8c16", "#d46b08", "#ad4e00", "#873800", "#612500"]; orange.primary = orange[5]; var gold = ["#fffbe6", "#fff1b8", "#ffe58f", "#ffd666", "#ffc53d", "#faad14", "#d48806", "#ad6800", "#874d00", "#613400"]; gold.primary = gold[5]; var yellow = ["#feffe6", "#ffffb8", "#fffb8f", "#fff566", "#ffec3d", "#fadb14", "#d4b106", "#ad8b00", "#876800", "#614700"]; yellow.primary = yellow[5]; var lime = ["#fcffe6", "#f4ffb8", "#eaff8f", "#d3f261", "#bae637", "#a0d911", "#7cb305", "#5b8c00", "#3f6600", "#254000"]; lime.primary = lime[5]; var green = ["#f6ffed", "#d9f7be", "#b7eb8f", "#95de64", "#73d13d", "#52c41a", "#389e0d", "#237804", "#135200", "#092b00"]; green.primary = green[5]; var cyan = ["#e6fffb", "#b5f5ec", "#87e8de", "#5cdbd3", "#36cfc9", "#13c2c2", "#08979c", "#006d75", "#00474f", "#002329"]; cyan.primary = cyan[5]; var blue = ["#e6f4ff", "#bae0ff", "#91caff", "#69b1ff", "#4096ff", "#1677ff", "#0958d9", "#003eb3", "#002c8c", "#001d66"]; blue.primary = blue[5]; var geekblue = ["#f0f5ff", "#d6e4ff", "#adc6ff", "#85a5ff", "#597ef7", "#2f54eb", "#1d39c4", "#10239e", "#061178", "#030852"]; geekblue.primary = geekblue[5]; var purple = ["#f9f0ff", "#efdbff", "#d3adf7", "#b37feb", "#9254de", "#722ed1", "#531dab", "#391085", "#22075e", "#120338"]; purple.primary = purple[5]; var magenta = ["#fff0f6", "#ffd6e7", "#ffadd2", "#ff85c0", "#f759ab", "#eb2f96", "#c41d7f", "#9e1068", "#780650", "#520339"]; magenta.primary = magenta[5]; var grey = ["#a6a6a6", "#999999", "#8c8c8c", "#808080", "#737373", "#666666", "#404040", "#1a1a1a", "#000000", "#000000"]; grey.primary = grey[5]; var redDark = ["#2a1215", "#431418", "#58181c", "#791a1f", "#a61d24", "#d32029", "#e84749", "#f37370", "#f89f9a", "#fac8c3"]; redDark.primary = redDark[5]; var volcanoDark = ["#2b1611", "#441d12", "#592716", "#7c3118", "#aa3e19", "#d84a1b", "#e87040", "#f3956a", "#f8b692", "#fad4bc"]; volcanoDark.primary = volcanoDark[5]; var orangeDark = ["#2b1d11", "#442a11", "#593815", "#7c4a15", "#aa6215", "#d87a16", "#e89a3c", "#f3b765", "#f8cf8d", "#fae3b7"]; orangeDark.primary = orangeDark[5]; var goldDark = ["#2b2111", "#443111", "#594214", "#7c5914", "#aa7714", "#d89614", "#e8b339", "#f3cc62", "#f8df8b", "#faedb5"]; goldDark.primary = goldDark[5]; var yellowDark = ["#2b2611", "#443b11", "#595014", "#7c6e14", "#aa9514", "#d8bd14", "#e8d639", "#f3ea62", "#f8f48b", "#fafab5"]; yellowDark.primary = yellowDark[5]; var limeDark = ["#1f2611", "#2e3c10", "#3e4f13", "#536d13", "#6f9412", "#8bbb11", "#a9d134", "#c9e75d", "#e4f88b", "#f0fab5"]; limeDark.primary = limeDark[5]; var greenDark = ["#162312", "#1d3712", "#274916", "#306317", "#3c8618", "#49aa19", "#6abe39", "#8fd460", "#b2e58b", "#d5f2bb"]; greenDark.primary = greenDark[5]; var cyanDark = ["#112123", "#113536", "#144848", "#146262", "#138585", "#13a8a8", "#33bcb7", "#58d1c9", "#84e2d8", "#b2f1e8"]; cyanDark.primary = cyanDark[5]; var blueDark = ["#111a2c", "#112545", "#15325b", "#15417e", "#1554ad", "#1668dc", "#3c89e8", "#65a9f3", "#8dc5f8", "#b7dcfa"]; blueDark.primary = blueDark[5]; var geekblueDark = ["#131629", "#161d40", "#1c2755", "#203175", "#263ea0", "#2b4acb", "#5273e0", "#7f9ef3", "#a8c1f8", "#d2e0fa"]; geekblueDark.primary = geekblueDark[5]; var purpleDark = ["#1a1325", "#24163a", "#301c4d", "#3e2069", "#51258f", "#642ab5", "#854eca", "#ab7ae0", "#cda8f0", "#ebd7fa"]; purpleDark.primary = purpleDark[5]; var magentaDark = ["#291321", "#40162f", "#551c3b", "#75204f", "#a02669", "#cb2b83", "#e0529c", "#f37fb7", "#f8a8cc", "#fad2e3"]; magentaDark.primary = magentaDark[5]; var greyDark = ["#151515", "#1f1f1f", "#2d2d2d", "#393939", "#494949", "#5a5a5a", "#6a6a6a", "#7b7b7b", "#888888", "#969696"]; greyDark.primary = greyDark[5]; // ../../node_modules/.pnpm/@babel+runtime@7.26.9/node_modules/@babel/runtime/helpers/esm/objectSpread2.js function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function(r2) { return Object.getOwnPropertyDescriptor(e, r2).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function(r2) { _defineProperty(e, r2, t[r2]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) { Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); }); } return e; } // ../../node_modules/.pnpm/@ant-design+icons@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/components/IconBase.js import * as React2 from "react"; // ../../node_modules/.pnpm/rc-util@5.44.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/rc-util/es/Dom/canUseDom.js function canUseDom() { return !!(typeof window !== "undefined" && window.document && window.document.createElement); } // ../../node_modules/.pnpm/rc-util@5.44.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/rc-util/es/Dom/contains.js function contains(root, n) { if (!root) { return false; } if (root.contains) { return root.contains(n); } var node = n; while (node) { if (node === root) { return true; } node = node.parentNode; } return false; } // ../../node_modules/.pnpm/rc-util@5.44.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/rc-util/es/Dom/dynamicCSS.js var APPEND_ORDER = "data-rc-order"; var APPEND_PRIORITY = "data-rc-priority"; var MARK_KEY = "rc-util-key"; var containerCache = /* @__PURE__ */ new Map(); function getMark() { var _ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, mark = _ref.mark; if (mark) { return mark.startsWith("data-") ? mark : "data-".concat(mark); } return MARK_KEY; } function getContainer(option) { if (option.attachTo) { return option.attachTo; } var head = document.querySelector("head"); return head || document.body; } function getOrder(prepend) { if (prepend === "queue") { return "prependQueue"; } return prepend ? "prepend" : "append"; } function findStyles(container) { return Array.from((containerCache.get(container) || container).children).filter(function(node) { return node.tagName === "STYLE"; }); } function injectCSS(css) { var option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; if (!canUseDom()) { return null; } var csp = option.csp, prepend = option.prepend, _option$priority = option.priority, priority = _option$priority === void 0 ? 0 : _option$priority; var mergedOrder = getOrder(prepend); var isPrependQueue = mergedOrder === "prependQueue"; var styleNode = document.createElement("style"); styleNode.setAttribute(APPEND_ORDER, mergedOrder); if (isPrependQueue && priority) { styleNode.setAttribute(APPEND_PRIORITY, "".concat(priority)); } if (csp !== null && csp !== void 0 && csp.nonce) { styleNode.nonce = csp === null || csp === void 0 ? void 0 : csp.nonce; } styleNode.innerHTML = css; var container = getContainer(option); var firstChild = container.firstChild; if (prepend) { if (isPrependQueue) { var existStyle = (option.styles || findStyles(container)).filter(function(node) { if (!["prepend", "prependQueue"].includes(node.getAttribute(APPEND_ORDER))) { return false; } var nodePriority = Number(node.getAttribute(APPEND_PRIORITY) || 0); return priority >= nodePriority; }); if (existStyle.length) { container.insertBefore(styleNode, existStyle[existStyle.length - 1].nextSibling); return styleNode; } } container.insertBefore(styleNode, firstChild); } else { container.appendChild(styleNode); } return styleNode; } function findExistNode(key) { var option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; var container = getContainer(option); return (option.styles || findStyles(container)).find(function(node) { return node.getAttribute(getMark(option)) === key; }); } function syncRealContainer(container, option) { var cachedRealContainer = containerCache.get(container); if (!cachedRealContainer || !contains(document, cachedRealContainer)) { var placeholderStyle = injectCSS("", option); var parentNode = placeholderStyle.parentNode; containerCache.set(container, parentNode); container.removeChild(placeholderStyle); } } function updateCSS(css, key) { var originOption = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; var container = getContainer(originOption); var styles = findStyles(container); var option = _objectSpread2(_objectSpread2({}, originOption), {}, { styles }); syncRealContainer(container, option); var existNode = findExistNode(key, option); if (existNode) { var _option$csp, _option$csp2; if ((_option$csp = option.csp) !== null && _option$csp !== void 0 && _option$csp.nonce && existNode.nonce !== ((_option$csp2 = option.csp) === null || _option$csp2 === void 0 ? void 0 : _option$csp2.nonce)) { var _option$csp3; existNode.nonce = (_option$csp3 = option.csp) === null || _option$csp3 === void 0 ? void 0 : _option$csp3.nonce; } if (existNode.innerHTML !== css) { existNode.innerHTML = css; } return existNode; } var newNode = injectCSS(css, option); newNode.setAttribute(getMark(option), key); return newNode; } // ../../node_modules/.pnpm/rc-util@5.44.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/rc-util/es/Dom/shadow.js function getRoot(ele) { var _ele$getRootNode; return ele === null || ele === void 0 || (_ele$getRootNode = ele.getRootNode) === null || _ele$getRootNode === void 0 ? void 0 : _ele$getRootNode.call(ele); } function inShadow(ele) { return getRoot(ele) instanceof ShadowRoot; } function getShadowRoot(ele) { return inShadow(ele) ? getRoot(ele) : null; } // ../../node_modules/.pnpm/rc-util@5.44.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/rc-util/es/warning.js var warned = {}; var preWarningFns = []; var preMessage = function preMessage2(fn) { preWarningFns.push(fn); }; function warning(valid, message) { if (process.env.NODE_ENV !== "production" && !valid && console !== void 0) { var finalMessage = preWarningFns.reduce(function(msg, preMessageFn) { return preMessageFn(msg !== null && msg !== void 0 ? msg : "", "warning"); }, message); if (finalMessage) { console.error("Warning: ".concat(finalMessage)); } } } function note(valid, message) { if (process.env.NODE_ENV !== "production" && !valid && console !== void 0) { var finalMessage = preWarningFns.reduce(function(msg, preMessageFn) { return preMessageFn(msg !== null && msg !== void 0 ? msg : "", "note"); }, message); if (finalMessage) { console.warn("Note: ".concat(finalMessage)); } } } function resetWarned() { warned = {}; } function call(method, valid, message) { if (!valid && !warned[message]) { method(false, message); warned[message] = true; } } function warningOnce(valid, message) { call(warning, valid, message); } function noteOnce(valid, message) { call(note, valid, message); } warningOnce.preMessage = preMessage; warningOnce.resetWarned = resetWarned; warningOnce.noteOnce = noteOnce; var warning_default = warningOnce; // ../../node_modules/.pnpm/@ant-design+icons@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/utils.js import React, { useContext, useEffect } from "react"; function camelCase(input) { return input.replace(/-(.)/g, function(match, g) { return g.toUpperCase(); }); } function warning2(valid, message) { warning_default(valid, "[@ant-design/icons] ".concat(message)); } function isIconDefinition(target) { return _typeof(target) === "object" && typeof target.name === "string" && typeof target.theme === "string" && (_typeof(target.icon) === "object" || typeof target.icon === "function"); } function normalizeAttrs() { var attrs = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; return Object.keys(attrs).reduce(function(acc, key) { var val = attrs[key]; switch (key) { case "class": acc.className = val; delete acc.class; break; default: delete acc[key]; acc[camelCase(key)] = val; } return acc; }, {}); } function generate2(node, key, rootProps) { if (!rootProps) { return /* @__PURE__ */ React.createElement(node.tag, _objectSpread2({ key }, normalizeAttrs(node.attrs)), (node.children || []).map(function(child, index) { return generate2(child, "".concat(key, "-").concat(node.tag, "-").concat(index)); })); } return /* @__PURE__ */ React.createElement(node.tag, _objectSpread2(_objectSpread2({ key }, normalizeAttrs(node.attrs)), rootProps), (node.children || []).map(function(child, index) { return generate2(child, "".concat(key, "-").concat(node.tag, "-").concat(index)); })); } function getSecondaryColor(primaryColor) { return generate(primaryColor)[0]; } function normalizeTwoToneColors(twoToneColor) { if (!twoToneColor) { return []; } return Array.isArray(twoToneColor) ? twoToneColor : [twoToneColor]; } var iconStyles = "\n.anticon {\n display: inline-flex;\n align-items: center;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n"; var useInsertStyles = function useInsertStyles2(eleRef) { var _useContext = useContext(Context_default), csp = _useContext.csp, prefixCls = _useContext.prefixCls, layer = _useContext.layer; var mergedStyleStr = iconStyles; if (prefixCls) { mergedStyleStr = mergedStyleStr.replace(/anticon/g, prefixCls); } if (layer) { mergedStyleStr = "@layer ".concat(layer, " {\n").concat(mergedStyleStr, "\n}"); } useEffect(function() { var ele = eleRef.current; var shadowRoot = getShadowRoot(ele); updateCSS(mergedStyleStr, "@ant-design-icons", { prepend: !layer, csp, attachTo: shadowRoot }); }, []); }; // ../../node_modules/.pnpm/@ant-design+icons@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/components/IconBase.js var _excluded = ["icon", "className", "onClick", "style", "primaryColor", "secondaryColor"]; var twoToneColorPalette = { primaryColor: "#333", secondaryColor: "#E6E6E6", calculated: false }; function setTwoToneColors(_ref) { var primaryColor = _ref.primaryColor, secondaryColor = _ref.secondaryColor; twoToneColorPalette.primaryColor = primaryColor; twoToneColorPalette.secondaryColor = secondaryColor || getSecondaryColor(primaryColor); twoToneColorPalette.calculated = !!secondaryColor; } function getTwoToneColors() { return _objectSpread2({}, twoToneColorPalette); } var IconBase = function IconBase2(props) { var icon = props.icon, className = props.className, onClick = props.onClick, style = props.style, primaryColor = props.primaryColor, secondaryColor = props.secondaryColor, restProps = _objectWithoutProperties(props, _excluded); var svgRef = React2.useRef(); var colors = twoToneColorPalette; if (primaryColor) { colors = { primaryColor, secondaryColor: secondaryColor || getSecondaryColor(primaryColor) }; } useInsertStyles(svgRef); warning2(isIconDefinition(icon), "icon should be icon definiton, but got ".concat(icon)); if (!isIconDefinition(icon)) { return null; } var target = icon; if (target && typeof target.icon === "function") { target = _objectSpread2(_objectSpread2({}, target), {}, { icon: target.icon(colors.primaryColor, colors.secondaryColor) }); } return generate2(target.icon, "svg-".concat(target.name), _objectSpread2(_objectSpread2({ className, onClick, style, "data-icon": target.name, width: "1em", height: "1em", fill: "currentColor", "aria-hidden": "true" }, restProps), {}, { ref: svgRef })); }; IconBase.displayName = "IconReact"; IconBase.getTwoToneColors = getTwoToneColors; IconBase.setTwoToneColors = setTwoToneColors; var IconBase_default = IconBase; // ../../node_modules/.pnpm/@ant-design+icons@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/components/twoTonePrimaryColor.js function setTwoToneColor(twoToneColor) { var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor), _normalizeTwoToneColo2 = _slicedToArray(_normalizeTwoToneColo, 2), primaryColor = _normalizeTwoToneColo2[0], secondaryColor = _normalizeTwoToneColo2[1]; return IconBase_default.setTwoToneColors({ primaryColor, secondaryColor }); } function getTwoToneColor() { var colors = IconBase_default.getTwoToneColors(); if (!colors.calculated) { return colors.primaryColor; } return [colors.primaryColor, colors.secondaryColor]; } // ../../node_modules/.pnpm/@ant-design+icons@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/components/AntdIcon.js var _excluded2 = ["className", "icon", "spin", "rotate", "tabIndex", "onClick", "twoToneColor"]; setTwoToneColor(blue.primary); var Icon = /* @__PURE__ */ React3.forwardRef(function(props, ref) { var className = props.className, icon = props.icon, spin = props.spin, rotate = props.rotate, tabIndex = props.tabIndex, onClick = props.onClick, twoToneColor = props.twoToneColor, restProps = _objectWithoutProperties(props, _excluded2); var _React$useContext = React3.useContext(Context_default), _React$useContext$pre = _React$useContext.prefixCls, prefixCls = _React$useContext$pre === void 0 ? "anticon" : _React$useContext$pre, rootClassName = _React$useContext.rootClassName; var classString = classNames(rootClassName, prefixCls, _defineProperty(_defineProperty({}, "".concat(prefixCls, "-").concat(icon.name), !!icon.name), "".concat(prefixCls, "-spin"), !!spin || icon.name === "loading"), className); var iconTabIndex = tabIndex; if (iconTabIndex === void 0 && onClick) { iconTabIndex = -1; } var svgStyle = rotate ? { msTransform: "rotate(".concat(rotate, "deg)"), transform: "rotate(".concat(rotate, "deg)") } : void 0; var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor), _normalizeTwoToneColo2 = _slicedToArray(_normalizeTwoToneColo, 2), primaryColor = _normalizeTwoToneColo2[0], secondaryColor = _normalizeTwoToneColo2[1]; return /* @__PURE__ */ React3.createElement("span", _extends({ role: "img", "aria-label": icon.name }, restProps, { ref, tabIndex: iconTabIndex, onClick, className: classString }), /* @__PURE__ */ React3.createElement(IconBase_default, { icon, primaryColor, secondaryColor, style: svgStyle })); }); Icon.displayName = "AntdIcon"; Icon.getTwoToneColor = getTwoToneColor; Icon.setTwoToneColor = setTwoToneColor; var AntdIcon_default = Icon; // ../../node_modules/.pnpm/@ant-design+icons@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/icons/CheckOutlined.js import * as React4 from "react"; // ../../node_modules/.pnpm/@ant-design+icons-svg@4.4.2/node_modules/@ant-design/icons-svg/es/asn/CheckOutlined.js var CheckOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z" } }] }, "name": "check", "theme": "outlined" }; var CheckOutlined_default = CheckOutlined; // ../../node_modules/.pnpm/@ant-design+icons@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/icons/CheckOutlined.js var CheckOutlined2 = function CheckOutlined3(props, ref) { return /* @__PURE__ */ React4.createElement(AntdIcon_default, _extends({}, props, { ref, icon: CheckOutlined_default })); }; var RefIcon = /* @__PURE__ */ React4.forwardRef(CheckOutlined2); if (process.env.NODE_ENV !== "production") { RefIcon.displayName = "CheckOutlined"; } var CheckOutlined_default2 = RefIcon; // ../../node_modules/.pnpm/@ant-design+icons@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/icons/CodeOutlined.js import * as React5 from "react"; // ../../node_modules/.pnpm/@ant-design+icons-svg@4.4.2/node_modules/@ant-design/icons-svg/es/asn/CodeOutlined.js var CodeOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M516 673c0 4.4 3.4 8 7.5 8h185c4.1 0 7.5-3.6 7.5-8v-48c0-4.4-3.4-8-7.5-8h-185c-4.1 0-7.5 3.6-7.5 8v48zm-194.9 6.1l192-161c3.8-3.2 3.8-9.1 0-12.3l-192-160.9A7.95 7.95 0 00308 351v62.7c0 2.4 1 4.6 2.9 6.1L420.7 512l-109.8 92.2a8.1 8.1 0 00-2.9 6.1V673c0 6.8 7.9 10.5 13.1 6.1zM880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z" } }] }, "name": "code", "theme": "outlined" }; var CodeOutlined_default = CodeOutlined; // ../../node_modules/.pnpm/@ant-design+icons@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/icons/CodeOutlined.js var CodeOutlined2 = function CodeOutlined3(props, ref) { return /* @__PURE__ */ React5.createElement(AntdIcon_default, _extends({}, props, { ref, icon: CodeOutlined_default })); }; var RefIcon2 = /* @__PURE__ */ React5.forwardRef(CodeOutlined2); if (process.env.NODE_ENV !== "production") { RefIcon2.displayName = "CodeOutlined"; } var CodeOutlined_default2 = RefIcon2; // ../../node_modules/.pnpm/@ant-design+icons@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/icons/CopyOutlined.js import * as React6 from "react"; // ../../node_modules/.pnpm/@ant-design+icons-svg@4.4.2/node_modules/@ant-design/icons-svg/es/asn/CopyOutlined.js var CopyOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z" } }] }, "name": "copy", "theme": "outlined" }; var CopyOutlined_default = CopyOutlined; // ../../node_modules/.pnpm/@ant-design+icons@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/icons/CopyOutlined.js var CopyOutlined2 = function CopyOutlined3(props, ref) { return /* @__PURE__ */ React6.createElement(AntdIcon_default, _extends({}, props, { ref, icon: CopyOutlined_default })); }; var RefIcon3 = /* @__PURE__ */ React6.forwardRef(CopyOutlined2); if (process.env.NODE_ENV !== "production") { RefIcon3.displayName = "CopyOutlined"; } var CopyOutlined_default2 = RefIcon3; // src/MdPreviewer/index.tsx import { createRoot } from "react-dom/client"; import "highlight.js/styles/github.css"; // #style-inject:#style-inject function styleInject(css, { insertAt } = {}) { if (!css || typeof document === "undefined") return; const head = document.head || document.getElementsByTagName("head")[0]; const style = document.createElement("style"); style.type = "text/css"; if (insertAt === "top") { if (head.firstChild) { head.insertBefore(style, head.firstChild); } else { head.appendChild(style); } } else { head.appendChild(style); } if (style.styleSheet) { style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); } } // src/MdPreviewer/github-markdown-light.css styleInject('.tntx-markdown-body {\n color-scheme: light;\n -ms-text-size-adjust: 100%;\n -webkit-text-size-adjust: 100%;\n margin: 0;\n color: #1a1a1a;\n font-family:\n -apple-system,\n BlinkMacSystemFont,\n "Segoe UI",\n "Inter",\n "Roboto",\n "Helvetica Neue",\n Arial,\n sans-serif,\n "Apple Color Emoji",\n "Segoe UI Emoji";\n font-size: 16px;\n line-height: 1.75;\n word-wrap: break-word;\n max-width: 100%;\n}\n.tntx-markdown-body h1 {\n margin: 2rem 0 1.5rem;\n font-weight: 700;\n font-size: 2.5rem;\n line-height: 1.2;\n letter-spacing: -0.02em;\n color: #0a0a0a;\n padding-bottom: 0.75rem;\n border-bottom: 2px solid #e5e7eb;\n}\n.tntx-markdown-body h2 {\n margin: 2.5rem 0 1.25rem;\n font-weight: 600;\n font-size: 1.875rem;\n line-height: 1.3;\n letter-spacing: -0.01em;\n color: #111827;\n padding-bottom: 0.5rem;\n border-bottom: 1px solid #e5e7eb;\n}\n.tntx-markdown-body h3 {\n margin: 2rem 0 1rem;\n font-weight: 600;\n font-size: 1.5rem;\n line-height: 1.4;\n color: #1f2937;\n}\n.tntx-markdown-body h4 {\n margin: 1.5rem 0 0.75rem;\n font-weight: 600;\n font-size: 1.25rem;\n line-height: 1.5;\n color: #374151;\n}\n.tntx-markdown-body h5 {\n margin: 1.25rem 0 0.5rem;\n font-weight: 600;\n font-size: 1.125rem;\n line-height: 1.5;\n color: #4b5563;\n}\n.tntx-markdown-body h6 {\n margin: 1rem 0 0.5rem;\n font-weight: 600;\n font-size: 1rem;\n line-height: 1.5;\n color: #6b7280;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n}\n.tntx-markdown-body p {\n margin: 1.25rem 0;\n color: #374151;\n line-height: 1.75;\n}\n.tntx-markdown-body a {\n color: #2563eb;\n text-decoration: none;\n font-weight: 500;\n border-bottom: 1px solid transparent;\n transition: all 0.2s ease;\n}\n.tntx-markdown-body a:hover {\n color: #1d4ed8;\n border-bottom-color: #2563eb;\n}\n.tntx-markdown-body a:focus {\n outline: 2px solid #2563eb;\n outline-offset: 2px;\n border-radius: 2px;\n}\n.tntx-markdown-body code {\n font-family:\n "SF Mono",\n "Monaco",\n "Inconsolata",\n "Fira Code",\n "Droid Sans Mono",\n "Source Code Pro",\n monospace;\n font-size: 0.875em;\n padding: 0.2em 0.4em;\n margin: 0 0.125em;\n background: #f3f4f6;\n border: 1px solid #e5e7eb;\n border-radius: 6px;\n color: #dc2626;\n font-weight: 500;\n white-space: pre-wrap;\n word-break: break-word;\n}\n.tntx-markdown-body pre {\n margin: 1.5rem 0;\n padding: 1.25rem;\n overflow-x: auto;\n font-family:\n "SF Mono",\n "Monaco",\n "Inconsolata",\n "Fira Code",\n "Droid Sans Mono",\n "Source Code Pro",\n monospace;\n font-size: 0.875rem;\n line-height: 1.7;\n background: #1e1e1e;\n border: 1px solid #2d2d2d;\n border-radius: 12px;\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);\n}\n.tntx-markdown-body pre code {\n display: block;\n padding: 0;\n margin: 0;\n background: transparent;\n border: none;\n color: #d4d4d4;\n font-size: inherit;\n white-space: pre;\n word-break: normal;\n overflow-wrap: normal;\n font-weight: 400;\n}\n.tntx-markdown-body pre code::before,\n.tntx-markdown-body pre code::after {\n display: none;\n}\n.tntx-markdown-body .mac-code-block {\n margin: 1.5rem 0;\n background: #ffffff;\n border: 1px solid #e5e7eb;\n border-radius: 8px;\n overflow: hidden;\n box-shadow: 0 4px 6px -1px rgba(