import{aX as F,p as P,al as M,g as N,aj as R,ao as y,aY as j,cb as O,az as Q,u as X,a_ as Y,aa as p,a$ as q,a6 as G,a8 as H,a7 as J,d as l,cc as K,i as s,n as f,e as b,v as U,E as S,aQ as k,y as W,bI as Z,af as ee,m as ae,ag as te,b0 as le,ah as ne,b1 as se,f as oe,aD as ie,h as ce,ai as re}from"./index-GaWRVcb2.js";const ue=F("v-alert-title"),de=P({iconSize:[Number,String],iconSizes:{type:Array,default:()=>[["x-small",10],["small",16],["default",24],["large",28],["x-large",32]]}},"iconSize");function ve(e,o){return{iconSize:M(()=>{const a=new Map(e.iconSizes),t=e.iconSize??o()??"default";return a.has(t)?a.get(t):t})}}const me=["success","info","warning","error"],ye=P({border:{type:[Boolean,String],validator:e=>typeof e=="boolean"||["top","end","bottom","start"].includes(e)},borderColor:String,closable:Boolean,closeIcon:{type:re,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=>me.includes(e)},...ce(),...ie(),...oe(),...se(),...de(),...ne(),...le(),...te(),...ae(),...ee(),...Z({variant:"flat"})},"VAlert"),be=N()({name:"VAlert",props:ye(),emits:{"click:close":e=>!0,"update:modelValue":e=>!0},setup(e,o){let{emit:r,slots:a}=o;const t=R(e,"modelValue"),i=y(()=>{if(e.icon!==!1)return e.type?e.icon??`$${e.type}`:e.icon}),{iconSize:g}=ve(e,()=>e.prominent?44:void 0),{themeClasses:z}=j(e),{colorClasses:V,colorStyles:C,variantClasses:x}=O(()=>({color:e.color??e.type,variant:e.variant})),{densityClasses:_}=Q(e),{dimensionStyles:h}=X(e),{elevationClasses:I}=Y(e),{locationStyles:B}=p(e),{positionClasses:A}=q(e),{roundedClasses:T}=G(e),{textColorClasses:D,textColorStyles:$}=H(()=>e.borderColor),{t:L}=J(),u=y(()=>({"aria-label":L(e.closeLabel),onClick(c){t.value=!1,r("click:close",c)}}));return()=>{const c=!!(a.prepend||i.value),w=!!(a.title||e.title),E=!!(a.close||e.closable),d={density:e.density,icon:i.value,size:e.iconSize||e.prominent?g.value:void 0};return t.value&&l(e.tag,{class:b(["v-alert",e.border&&{"v-alert--border":!!e.border,[`v-alert--border-${e.border===!0?"start":e.border}`]:!0},{"v-alert--prominent":e.prominent},z.value,V.value,_.value,I.value,A.value,T.value,x.value,e.class]),style:f([C.value,h.value,B.value,e.style]),role:"alert"},{default:()=>{var v,m;return[K(!1,"v-alert"),e.border&&s("div",{key:"border",class:b(["v-alert__border",D.value]),style:f($.value)},null),c&&s("div",{key:"prepend",class:"v-alert__prepend"},[a.prepend?l(k,{key:"prepend-defaults",disabled:!i.value,defaults:{VIcon:{...d}}},a.prepend):l(U,S({key:"prepend-icon"},d),null)]),s("div",{class:"v-alert__content"},[w&&l(ue,{key:"title"},{default:()=>{var n;return[((n=a.title)==null?void 0:n.call(a))??e.title]}}),((v=a.text)==null?void 0:v.call(a))??e.text,(m=a.default)==null?void 0:m.call(a)]),a.append&&s("div",{key:"append",class:"v-alert__append"},[a.append()]),E&&s("div",{key:"close",class:"v-alert__close"},[a.close?l(k,{key:"close-defaults",defaults:{VBtn:{icon:e.closeIcon,size:"x-small",variant:"text"}}},{default:()=>{var n;return[(n=a.close)==null?void 0:n.call(a,{props:u.value})]}}):l(W,S({key:"close-btn",icon:e.closeIcon,size:"x-small",variant:"text"},u.value),null)])]}})}}});export{be as V,ue as a};
