"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index.cjs38.js"),n=require("react"),x=require("./index.cjs40.js"),r=require("./index.cjs63.js"),m=require("./index.cjs8.js"),p=require("./index.cjs9.js"),h=({code:s,lang:i="text",filename:l,className:j,testId:a})=>{const[u,f]=n.useState(""),[c,d]=n.useState(null);return n.useEffect(()=>{let o=!1;return d(null),Promise.resolve().then(()=>require("./index.cjs62.js")).then(({codeToHtml:t})=>t(s,{lang:i,themes:{light:"github-light",dark:"github-dark"}})).then(t=>{o||f(t)}).catch(t=>{o||d(t instanceof Error?t:new Error(String(t)))}),()=>{o=!0}},[s,i]),c?e.jsxRuntimeExports.jsx(m.Root,{as:"div",className:x(r.default.root,r.default.error),testId:a,role:"alert",children:e.jsxRuntimeExports.jsxs(p.Typography,{variant:"caption",as:"span",color:"secondary",children:["Ошибка подсветки: ",c.message]})}):e.jsxRuntimeExports.jsxs(m.Root,{className:x(r.default.root,j),testId:a,children:[l!=null&&e.jsxRuntimeExports.jsx(p.Typography,{variant:"caption",as:"div",className:r.default.filename,children:l}),e.jsxRuntimeExports.jsx("div",{className:r.default.code,children:u?e.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:u},suppressHydrationWarning:!0}):e.jsxRuntimeExports.jsx("pre",{children:e.jsxRuntimeExports.jsx("code",{children:s})})})]})};h.displayName="CodeBlock";exports.CodeBlock=h;
//# sourceMappingURL=index.cjs26.js.map
