import{d as g}from"./client-bnemmvey.js";import{k as v,l as d,n as C,Q as o,S as s,U as t,Y as c,F as i,ab as _,a5 as y}from"./vendor/json-editor-vue-fw81xiot.js";const B=["innerHTML"],b=["textContent"],T=v({__name:"NCodeBlock",props:{code:{},lang:{},lines:{type:Boolean,default:!0},inline:{type:Boolean},transformRendered:{}},emits:["loaded"],setup(p,{emit:u}){const e=p,m=u,l=d(()=>{const n=e.lang==="text"?{code:e.code,supported:!1}:g.value?.devtools.renderCodeHighlight(e.code,e.lang)||{code:e.code,supported:!1};return n.supported&&e.transformRendered&&(n.code=e.transformRendered(n.code)),n.supported&&C(()=>m("loaded")),n}),r=d(()=>["n-code-block shiki",e.lines&&!e.inline?"n-code-block-lines":""]);return(n,a)=>n.lang&&l.value.supported?(o(),s("pre",{key:0,class:c(r.value)},[t("code",{innerHTML:l.value.code},null,8,B)],2)):(o(),s("pre",{key:1,class:c(r.value)},[t("code",null,[(o(!0),s(i,null,_(n.code.split(`
`),(f,k)=>(o(),s(i,{key:k},[t("span",{class:"line",textContent:y(f)},null,8,b),a[0]||(a[0]=t("br",null,null,-1))],64))),128))])],2))}});export{T as _};
