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