import{c as $}from"./BML-0xFj.js";import{p as b,i as w,g as F,k as R,b4 as M,bX as N,bA as p,as as E,cR as O,ap as j,aq as q,u as H,b as l,ah as d,n as v,aH as m,aA as W,aW as X,I as G,bF as J,av as K,aw as Q,ax as U,cS as Y,ay as Z,aT as ee,au as ae,bB as te,az as le,f as se,c as s,h as ne,l as y,d as f,V as oe}from"#entry";const ie=$("v-alert-title"),ce=b({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:w(()=>{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=b({border:{type:[Boolean,String],validator:e=>typeof e=="boolean"||["top","end","bottom","start"].includes(e)},borderColor:String,closable:Boolean,closeIcon:{type:G,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(),...U(),...Q(),...K(),...J({variant:"flat"})},"VAlert"),ye=F()({name:"VAlert",props:de(),emits:{"click:close":e=>!0,"update:modelValue":e=>!0},setup(e,n){let{emit:c,slots:a}=n;const t=R(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}=M(e),{colorClasses:P,colorStyles:V,variantClasses:z}=N(()=>({color:e.color??e.type,variant:e.variant})),{densityClasses:g}=p(e),{dimensionStyles:C}=W(e),{elevationClasses:x}=X(e),{locationStyles:_}=E(e),{positionClasses:h}=O(e),{roundedClasses:A}=j(e),{textColorClasses:B,textColorStyles:I}=q(()=>e.borderColor),{t:T}=H(),r=m(()=>({"aria-label":T(e.closeLabel),onClick(i){t.value=!1,c("click:close",i)}}));return()=>{const i=!!(a.prepend||o.value),D=!!(a.title||e.title),L=!!(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,h.value,A.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",B.value]),style:d(I.value)},null),i&&s("div",{key:"prepend",class:"v-alert__prepend"},[a.prepend?l(f,{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"},[D&&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()]),L&&s("div",{key:"close",class:"v-alert__close"},[a.close?l(f,{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};
