import{c as D}from"./BKDgfSxC.js";import{bI as f,O as M,au as w,cv as F,bL as N,cM as O,cd as R,cr as q,cu as E,cz as j,cI as W,cq as p,a3 as l,bo as d,bm as v,c3 as m,ce as G,cg as H,f as J,be as K,bc as Q,bb as U,b8 as X,b7 as Y,b6 as Z,b2 as ee,b0 as ae,a$ as te,a_ as le,at as se,W as s,r as ne,bi as y,q as b,V as oe}from"#entry";const ie=D("v-alert-title"),ce=f({iconSize:[Number,String],iconSizes:{type:Array,default:()=>[["x-small",10],["small",16],["default",24],["large",28],["x-large",32]]}},"iconSize");function re(e,n){return{iconSize:M(()=>{const a=new Map(e.iconSizes),t=e.iconSize??n()??"default";return a.has(t)?a.get(t):t})}}const ue=["success","info","warning","error"],de=f({border:{type:[Boolean,String],validator:e=>typeof e=="boolean"||["top","end","bottom","start"].includes(e)},borderColor:String,closable:Boolean,closeIcon:{type:J,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=>ue.includes(e)},...le(),...te(),...ae(),...ee(),...ce(),...Z(),...Y(),...X(),...U(),...Q(),...K({variant:"flat"})},"VAlert"),ye=w()({name:"VAlert",props:de(),emits:{"click:close":e=>!0,"update:modelValue":e=>!0},setup(e,n){let{emit:c,slots:a}=n;const t=F(e,"modelValue"),o=m(()=>{if(e.icon!==!1)return e.type?e.icon??`$${e.type}`:e.icon}),{iconSize:S}=re(e,()=>e.prominent?44:void 0),{themeClasses:k}=N(e),{colorClasses:P,colorStyles:V,variantClasses:z}=O(()=>({color:e.color??e.type,variant:e.variant})),{densityClasses:g}=R(e),{dimensionStyles:C}=G(e),{elevationClasses:x}=H(e),{locationStyles:_}=q(e),{positionClasses:I}=E(e),{roundedClasses:B}=j(e),{textColorClasses:h,textColorStyles:A}=W(()=>e.borderColor),{t:T}=p(),r=m(()=>({"aria-label":T(e.closeLabel),onClick(i){t.value=!1,c("click:close",i)}}));return()=>{const i=!!(a.prepend||o.value),L=!!(a.title||e.title),$=!!(a.close||e.closable),u={density:e.density,icon:o.value,size:e.iconSize||e.prominent?S.value:void 0};return t.value&&l(e.tag,{class:v(["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,P.value,g.value,x.value,I.value,B.value,z.value,e.class]),style:d([V.value,C.value,_.value,e.style]),role:"alert"},{default:()=>[se(!1,"v-alert"),e.border&&s("div",{key:"border",class:v(["v-alert__border",h.value]),style:d(A.value)},null),i&&s("div",{key:"prepend",class:"v-alert__prepend"},[a.prepend?l(b,{key:"prepend-defaults",disabled:!o.value,defaults:{VIcon:{...u}}},a.prepend):l(ne,y({key:"prepend-icon"},u),null)]),s("div",{class:"v-alert__content"},[L&&l(ie,{key:"title"},{default:()=>[a.title?.()??e.title]}),a.text?.()??e.text,a.default?.()]),a.append&&s("div",{key:"append",class:"v-alert__append"},[a.append()]),$&&s("div",{key:"close",class:"v-alert__close"},[a.close?l(b,{key:"close-defaults",defaults:{VBtn:{icon:e.closeIcon,size:"x-small",variant:"text"}}},{default:()=>[a.close?.({props:r.value})]}):l(oe,y({key:"close-btn",icon:e.closeIcon,size:"x-small",variant:"text"},r.value),null)])]})}}});export{ye as V};
