import{r as l,j as s}from"./iframe-B8FSoBNY.js";import{c}from"./compiler-runtime-BXE7OOXE.js";import{o as f}from"./rich-text-theme-Bkhh9rAZ.js";import{h as E}from"./CodeBlockPlugin-C3OWpvP8.js";import"./preload-helper-PPVm8Dsz.js";import"./index-DaXC_qY_.js";import"./index-DpB4ozcR.js";import"./factory-DAJZwK4o.js";import"./flex-DAJL4AFZ.js";import"./index-B0y2_lLF.js";import"./index-cFwdnc0b.js";import"./create-recipe-context-BU56IzEo.js";import"./textarea-rqmaWSc5.js";import"./factory-BR3bc_RM.js";import"./use-field-context-DoxKQlMm.js";import"./computed-style-C0hzrq9-.js";import"./table-BKNSzs2r.js";import"./create-slot-recipe-context-DAhDE6G_.js";function u(p){const t=c.c(5),{equation:a,inline:o}=p,m=l.useRef(null);let n,e;t[0]!==a||t[1]!==o?(n=()=>{const i=m.current;i!==null&&E.render(a,i,{displayMode:!o,errorColor:"#cc0000",output:"html",strict:"warn",throwOnError:!1,trust:!1})},e=[a,o],t[0]=a,t[1]=o,t[2]=n,t[3]=e):(n=t[2],e=t[3]),l.useEffect(n,e);let r;return t[4]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(s.Fragment,{children:[s.jsx("img",{src:"#",alt:""}),s.jsx("span",{ref:m}),s.jsx("img",{src:"#",alt:""})]}),t[4]=r):r=t[4],r}u.__docgenInfo={description:"",methods:[],displayName:"KatexRenderer"};class x extends l.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t){this.props.onError(t)}render(){return this.state.hasError?null:this.props.children}}function h(p){const t=c.c(8),{equation:a,inline:o}=p,[m]=f(),[n]=l.useState(a);let e;t[0]!==m?(e=d=>m._onError(d),t[0]=m,t[1]=e):e=t[1];let r;t[2]!==n||t[3]!==o?(r=s.jsx(u,{equation:n,inline:o}),t[2]=n,t[3]=o,t[4]=r):r=t[4];let i;return t[5]!==e||t[6]!==r?(i=s.jsx(x,{onError:e,children:r}),t[5]=e,t[6]=r,t[7]=i):i=t[7],i}h.__docgenInfo={description:"",methods:[],displayName:"EquationComponent",props:{equation:{required:!0,tsType:{name:"string"},description:""},inline:{required:!0,tsType:{name:"boolean"},description:""}}};export{h as default};
