import{i as L,G as $,v as F,r as w,a as R,F as E,u as N,z as O,b as j,H as q,c as G,s as H,w as J,k as M,d as p,h as d,V as K}from"./VAvatar-x_79C0tA.js";import{a as Q}from"./VProgressCircular-ubzZW5PC.js";import{b as U,m as W,c as X,a as Y}from"./tag-Dx3OexMp.js";import{v as Z,x as ee,T as ae,ac as v,aq as te,y as le,a as t,a6 as m,J as y,C as se,I as ne,e as s,B as oe}from"./index-CTxlYqj4.js";const re=L("v-alert-title"),ie=["success","info","warning","error"],ce=ee({border:{type:[Boolean,String],validator:e=>typeof e=="boolean"||["top","end","bottom","start"].includes(e)},borderColor:String,closable:Boolean,closeIcon:{type:ne,default:"$close"},closeLabel:{type:String,default:"$vuetify.close"},icon:{type:[Boolean,String,Function,Object],default:null},modelValue:{type:Boolean,default:!0},prominent:Boolean,title:String,text:String,type:{type:String,validator:e=>ie.includes(e)},...Y(),...J(),...X(),...H(),...G(),...q(),...j(),...W(),...se(),...O({variant:"flat"})},"VAlert"),ye=Z()({name:"VAlert",props:ce(),emits:{"click:close":e=>!0,"update:modelValue":e=>!0},setup(e,f){let{emit:b,slots:a}=f;const r=ae(e,"modelValue"),n=v(()=>{if(e.icon!==!1)return e.type?e.icon??`$${e.type}`:e.icon}),{themeClasses:k}=te(e),{colorClasses:V,colorStyles:C,variantClasses:P}=$(()=>({color:e.color??e.type,variant:e.variant})),{densityClasses:g}=F(e),{dimensionStyles:x}=U(e),{elevationClasses:S}=w(e),{locationStyles:_}=R(e),{positionClasses:B}=E(e),{roundedClasses:T}=N(e),{textColorClasses:h,textColorStyles:z}=Q(()=>e.borderColor),{t:I}=le(),i=v(()=>({"aria-label":I(e.closeLabel),onClick(o){r.value=!1,b("click:close",o)}}));return()=>{const o=!!(a.prepend||n.value),A=!!(a.title||e.title),D=!!(a.close||e.closable);return r.value&&t(e.tag,{class:y(["v-alert",e.border&&{"v-alert--border":!!e.border,[`v-alert--border-${e.border===!0?"start":e.border}`]:!0},{"v-alert--prominent":e.prominent},k.value,V.value,g.value,S.value,B.value,T.value,P.value,e.class]),style:m([C.value,x.value,_.value,e.style]),role:"alert"},{default:()=>{var c,u;return[M(!1,"v-alert"),e.border&&s("div",{key:"border",class:y(["v-alert__border",h.value]),style:m(z.value)},null),o&&s("div",{key:"prepend",class:"v-alert__prepend"},[a.prepend?t(d,{key:"prepend-defaults",disabled:!n.value,defaults:{VIcon:{density:e.density,icon:n.value,size:e.prominent?44:28}}},a.prepend):t(p,{key:"prepend-icon",density:e.density,icon:n.value,size:e.prominent?44:28},null)]),s("div",{class:"v-alert__content"},[A&&t(re,{key:"title"},{default:()=>{var l;return[((l=a.title)==null?void 0:l.call(a))??e.title]}}),((c=a.text)==null?void 0:c.call(a))??e.text,(u=a.default)==null?void 0:u.call(a)]),a.append&&s("div",{key:"append",class:"v-alert__append"},[a.append()]),D&&s("div",{key:"close",class:"v-alert__close"},[a.close?t(d,{key:"close-defaults",defaults:{VBtn:{icon:e.closeIcon,size:"x-small",variant:"text"}}},{default:()=>{var l;return[(l=a.close)==null?void 0:l.call(a,{props:i.value})]}}):t(K,oe({key:"close-btn",icon:e.closeIcon,size:"x-small",variant:"text"},i.value),null)])]}})}}});export{ye as V};
