import j from"./Icon.fe8c0e68.js";import O from"./Avatar.b92bd51d.js";import S from"./Button.b41c8ed4.js";import{E as A,G as f,g as N,j as z,N as I,o as s,c as n,a as u,k as r,y as c,l as i,K as l,H as $,d as C,t as B,F as b,x as h,O as m}from"./entry.9e31e8a4.js";import{t as M}from"./tw-merge.27ca352e.js";import{c as V,u as E}from"./ui.config.7ae255de.js";import{_ as F}from"./_plugin-vue_export-helper.c27b6911.js";import"./Link.cc0949f5.js";import"./nuxt-link.f786ecc0.js";const o=A(f.ui.strategy,f.ui.alert,V),q=N({components:{UIcon:j,UAvatar:O,UButton:S},inheritAttrs:!1,props:{title:{type:String,required:!0},description:{type:String,default:null},icon:{type:String,default:()=>o.default.icon},avatar:{type:Object,default:null},closeButton:{type:Object,default:()=>o.default.closeButton},actions:{type:Array,default:()=>[]},color:{type:String,default:()=>o.default.color,validator(e){return[...f.ui.colors,...Object.keys(o.color)].includes(e)}},variant:{type:String,default:()=>o.default.variant,validator(e){return[...Object.keys(o.variant),...Object.values(o.color).flatMap(t=>Object.keys(t))].includes(e)}},ui:{type:Object,default:void 0}},emits:["close"],setup(e){const{ui:t,attrs:v,attrsClass:y}=E("alert",e.ui,o),k=z(()=>{const g=t.value.color?.[e.color]?.[e.variant]||t.value.variant[e.variant];return M(I(t.value.wrapper,t.value.rounded,t.value.shadow,t.value.padding,g?.replaceAll("{color}",e.color)),y)});return{ui:t,attrs:v,alertClass:k}}}),D={class:"w-0 flex-1"},G={key:1,class:"mt-3 flex items-center gap-2"},H={class:"flex-shrink-0 flex items-center gap-3"},J={key:0,class:"flex items-center gap-2"};function K(e,t,v,y,k,g){const U=j,w=O,d=S;return s(),n("div",l({class:e.alertClass},e.attrs),[u("div",{class:c(["flex gap-3",{"items-start":e.description||e.$slots.description,"items-center":!e.description&&!e.$slots.description}])},[e.icon?(s(),r(U,{key:0,name:e.icon,class:c(e.ui.icon.base)},null,8,["name","class"])):i("",!0),e.avatar?(s(),r(w,l({key:1},{size:e.ui.avatar.size,...e.avatar},{class:e.ui.avatar.base}),null,16,["class"])):i("",!0),u("div",D,[u("p",{class:c(e.ui.title)},[$(e.$slots,"title",{title:e.title},()=>[C(B(e.title),1)])],2),e.description||e.$slots.description?(s(),n("p",{key:0,class:c(e.ui.description)},[$(e.$slots,"description",{description:e.description},()=>[C(B(e.description),1)])],2)):i("",!0),(e.description||e.$slots.description)&&e.actions.length?(s(),n("div",G,[(s(!0),n(b,null,h(e.actions,(a,p)=>(s(),r(d,l({key:p},{...e.ui.default.actionButton,...a},{onClick:m(a.click,["stop"])}),null,16,["onClick"]))),128))])):i("",!0)]),u("div",H,[!e.description&&!e.$slots.description&&e.actions.length?(s(),n("div",J,[(s(!0),n(b,null,h(e.actions,(a,p)=>(s(),r(d,l({key:p},{...e.ui.default.actionButton,...a},{onClick:m(a.click,["stop"])}),null,16,["onClick"]))),128))])):i("",!0),e.closeButton?(s(),r(d,l({key:1,"aria-label":"Close"},{...e.ui.default.closeButton,...e.closeButton},{onClick:t[0]||(t[0]=m(a=>e.$emit("close"),["stop"]))}),null,16)):i("",!0)])],2)],16)}const _=F(q,[["render",K]]);export{_ as default};
