import{_ as d,$ as f,a0 as g,a1 as m,e as v,q as x,af as C,B as y,s as e,ac as n,ak as b,al as h,c as _,am as i,o as q}from"./B3fabVUf.js";const B={slots:{root:"relative [&_pre]:h-[200px]",footer:"h-16 absolute inset-x-px bottom-px rounded-b-md flex items-center justify-center",trigger:"group",triggerIcon:"group-data-[state=open]:rotate-180"},variants:{open:{true:{root:"[&_pre]:h-auto [&_pre]:min-h-[200px] [&_pre]:max-h-[80vh] [&_pre]:pb-12"},false:{root:"[&_pre]:overflow-hidden",footer:"bg-gradient-to-t from-muted"}}}},I={__name:"ProseCodeCollapse",props:h({icon:{type:null,required:!1},name:{type:String,required:!1},openText:{type:String,required:!1},closeText:{type:String,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:["update:open"],setup(l){const o=l,a=d(l,"open",{type:Boolean,default:!1}),{t:r}=f(),p=g(),s=m("prose.codeCollapse",o),t=_(()=>i({extend:i(B),...p.ui?.prose?.codeCollapse||{}})({open:a.value}));return(u,c)=>(q(),v("div",{class:n(t.value.root({class:[e(s)?.root,o.class]}))},[x(u.$slots,"default"),C("div",{class:n(t.value.footer({class:e(s)?.footer}))},[y(b,{icon:l.icon||e(p).ui.icons.chevronDown,color:"neutral",variant:"outline","data-state":a.value?"open":"closed",label:`${a.value?o.closeText||e(r)("prose.codeCollapse.closeText"):o.openText||e(r)("prose.codeCollapse.openText")} ${o.name||e(r)("prose.codeCollapse.name")}`,class:n(t.value.trigger({class:e(s)?.trigger})),ui:{leadingIcon:t.value.triggerIcon({class:e(s)?.triggerIcon})},onClick:c[0]||(c[0]=T=>a.value=!a.value)},null,8,["icon","data-state","label","class","ui"])],2)],2))}};export{I as default};
