import{I as d,N as v,a3 as i,t as N,J as M,S as T,a4 as _,a5 as m,P as E,a6 as p,a7 as w,a8 as C,a9 as b,aa as g,ab as H,ac as O}from"./qex-fw8l.js";function L(h,y,u=!1,f=!1,t=!1,R=!1){var n=h,e="";if(u){var l=h;d&&(n=v(i(l)))}N(()=>{var s=T;if(e===(e=y()??"")){d&&M();return}if(u&&!d){s.nodes=null,l.innerHTML=e,e!==""&&_(i(l),l.lastChild);return}if(s.nodes!==null&&(m(s.nodes.start,s.nodes.end),s.nodes=null),e!==""){if(d){E.data;for(var a=M(),c=a;a!==null&&(a.nodeType!==p||a.data!=="");)c=a,a=w(a);if(a===null)throw C(),b;_(E,c),n=v(a);return}var A=f?H:t?O:void 0,o=g(f?"svg":t?"math":"template",A);o.innerHTML=e;var r=f||t?o:o.content;if(_(i(r),r.lastChild),f||t)for(;i(r);)n.before(i(r));else n.before(r)}})}export{L as h};
