import { x as R, K as Ks, y as jsxRuntimeExports, z as Qe } from "./server-build-D_RLM6Vr.js";
import { r as reactExports } from "./app-Czg8_lQt.js";
import "node:stream";
import "util";
import "crypto";
import "async_hooks";
import "stream";
import "node:process";
import "node:path";
import "node:url";
import "module";
import "node:fs/promises";
import "node:crypto";
import "tty";
import "os";
import "node:module";
import "node:fs";
import "node:child_process";
import "node:util";
import "node:timers/promises";
import "events";
import "node:assert";
import "node:net";
import "node:http";
import "node:querystring";
import "node:events";
import "node:diagnostics_channel";
import "node:tls";
import "node:buffer";
import "node:zlib";
import "node:perf_hooks";
import "node:util/types";
import "node:sqlite";
import "node:worker_threads";
import "node:async_hooks";
import "node:console";
import "node:timers";
import "node:dns";
import "path";
import "fs";
import "net";
import "node:os";
import "express";
var L = ({ code: s, language: t, raw: e, className: n, ...d$1 }) => {
  let { shikiTheme: l } = reactExports.useContext(R), o = Ks(), [m, i] = reactExports.useState(e);
  return reactExports.useEffect(() => {
    if (!o) {
      i(e);
      return;
    }
    let g = o.highlight({ code: s, language: t, themes: l }, (p) => {
      i(p);
    });
    g && i(g);
  }, [s, t, l, o, e]), jsxRuntimeExports.jsx(Qe, { className: n, language: t, result: m, ...d$1 });
};
export {
  L as HighlightedCodeBlockBody
};
