import{$ as h,aR as b,a0 as v,a1 as x,e as c,ac as r,s as e,B as u,af as d,ag as q,f as k,ak as C,q as S,m as $,c as B,am as p,o as m}from"./B3fabVUf.js";import w from"./C-sCiTCq.js";const P={slots:{root:"relative my-5 group",header:"flex items-center gap-1.5 border border-muted bg-default border-b-0 relative rounded-t-md px-4 py-3",filename:"text-default text-sm/6",icon:"size-4 shrink-0",copy:"absolute top-[11px] right-[11px] lg:opacity-0 lg:group-hover:opacity-100 transition",base:"group font-mono text-sm/6 border border-muted bg-muted rounded-md px-4 py-3 whitespace-pre-wrap break-words overflow-x-auto focus:outline-none **:[.line]:block **:[.line.highlight]:-mx-4 **:[.line.highlight]:px-4 **:[.line.highlight]:bg-accented/50!"},variants:{filename:{true:{root:"[&>pre]:rounded-t-none [&>pre]:my-0 my-5"}}}},A={__name:"ProsePre",props:{icon:{type:null,required:!1},code:{type:String,required:!1},language:{type:String,required:!1},filename:{type:String,required:!1},highlights:{type:Array,required:!1},hideHeader:{type:Boolean,required:!1},meta:{type:String,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1}},setup(a){const t=a,{t:f}=h(),{copy:g,copied:y}=b(),l=v(),s=x("prose.pre",t),o=B(()=>p({extend:p(P),...l.ui?.prose?.pre||{}})());return(i,n)=>(m(),c("div",{class:r(o.value.root({class:[e(s)?.root],filename:!!a.filename}))},[a.filename&&!a.hideHeader?(m(),c("div",{key:0,class:r(o.value.header({class:e(s)?.header}))},[u(w,{icon:a.icon,filename:a.filename,class:r(o.value.icon({class:e(s)?.icon}))},null,8,["icon","filename","class"]),d("span",{class:r(o.value.filename({class:e(s)?.filename}))},q(a.filename),3)],2)):k("",!0),u(C,{icon:e(y)?e(l).ui.icons.copyCheck:e(l).ui.icons.copy,color:"neutral",variant:"outline",size:"sm","aria-label":e(f)("prose.pre.copy"),class:r(o.value.copy({class:e(s)?.copy})),tabindex:"-1",onClick:n[0]||(n[0]=z=>e(g)(t.code||""))},null,8,["icon","aria-label","class"]),d("pre",$({class:o.value.base({class:[e(s)?.base,t.class]})},i.$attrs),[S(i.$slots,"default")],16)],2))}};export{A as default};
