import{aP as E,p as P,a5 as M,g as N,a3 as O,ay as y,bl as R,cm as j,aF as J,u as Z,bk as p,be as q,cd as G,bc as H,a2 as K,Z as Q,d as l,cn as U,i as s,n as f,e as b,v as W,E as S,ac as k,y as X,c7 as Y,bh as ee,m as ae,bi as te,ce as le,bj as ne,bm as se,f as oe,aJ as ie,h as ce,aO as re}from"./index-BBhBboPS.js";const ue=E("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(),...Y({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=O(e,"modelValue"),i=y(()=>{if(e.icon!==!1)return e.type?e.icon??`$${e.type}`:e.icon}),{iconSize:V}=ve(e,()=>e.prominent?44:void 0),{themeClasses:g}=R(e),{colorClasses:z,colorStyles:C,variantClasses:x}=j(()=>({color:e.color??e.type,variant:e.variant})),{densityClasses:_}=J(e),{dimensionStyles:h}=Z(e),{elevationClasses:B}=p(e),{locationStyles:I}=q(e),{positionClasses:A}=G(e),{roundedClasses:T}=H(e),{textColorClasses:D,textColorStyles:L}=K(()=>e.borderColor),{t:$}=Q(),u=y(()=>({"aria-label":$(e.closeLabel),onClick(c){t.value=!1,r("click:close",c)}}));return()=>{const c=!!(a.prepend||i.value),F=!!(a.title||e.title),w=!!(a.close||e.closable),d={density:e.density,icon:i.value,size:e.iconSize||e.prominent?V.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},g.value,z.value,_.value,B.value,A.value,T.value,x.value,e.class]),style:f([C.value,h.value,I.value,e.style]),role:"alert"},{default:()=>{var v,m;return[U(!1,"v-alert"),e.border&&s("div",{key:"border",class:b(["v-alert__border",D.value]),style:f(L.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(W,S({key:"prepend-icon"},d),null)]),s("div",{class:"v-alert__content"},[F&&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()]),w&&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(X,S({key:"close-btn",icon:e.closeIcon,size:"x-small",variant:"text"},u.value),null)])]}})}}});export{be as V,ue as a};
