import{p as _,q as P,r as S,K as V,k as E,t as M,c,A as s,o as l,x as r,b as d,h as O,y as i,z as n,u as e,a as b,N as f,v as o,O as h,w as v,D as q}from"./index-DRopsKkO.js";import{a as W,b as j}from"./index-_-ijfL1Q.js";import{a as K}from"./BasePage-C3DiNX0e.js";const R="UAlert",x={wrapper:{base:"border p-4 flex flex-col rounded-dynamic",variants:{variant:{primary:"bg-{color}-600 text-white border-transparent",secondary:"border-{color}-600 text-{color}-600",thirdary:"bg-{color}-50 text-{color}-600 border-transparent"},size:{xs:"text-2xs",sm:"text-xs",md:"text-sm",lg:"text-base"}},compoundVariants:[{variant:"thirdary",bordered:!0,class:"border-{color}-100"},{color:"white",variant:"primary",class:"text-gray-900 bg-white"},{color:"white",variant:"secondary",class:"text-gray-900 border-gray-200"},{color:"white",variant:"thirdary",class:"text-gray-900 bg-white"},{color:"white",variant:"thirdary",bordered:!0,class:"border-gray-200"},{color:"grayscale",variant:"primary",class:"bg-gray-900"},{color:"grayscale",variant:"secondary",class:"text-gray-900 border-gray-900"},{color:"grayscale",variant:"thirdary",class:"text-gray-900 bg-gray-50"},{color:"grayscale",variant:"thirdary",bordered:!0,class:"border-gray-200"},{color:"gray",variant:"primary",class:"bg-gray-500"},{color:"gray",variant:"secondary",class:"text-gray-500 border-gray-500"},{color:"gray",variant:"thirdary",class:"text-gray-500 bg-gray-50"},{color:"gray",variant:"thirdary",bordered:!0,class:"border-gray-500"}]},body:"flex items-start justify-between",contentWrapper:"flex gap-2",content:"",title:{base:"font-bold leading-tight",variants:{size:{xs:"text-xs",sm:"text-sm",md:"text-base",lg:"text-lg"}}},description:"",text:{base:"{UText}",defaults:{size:{xs:"sm",sm:"sm",md:"md",lg:"lg"}}},closeButton:"{UButton}",closeIcon:{base:"{UIcon}",defaults:{size:{xs:"3xs",sm:"2xs",md:"xs",lg:"sm"}}},defaults:{variant:"primary",color:"brand",size:"md",timeout:0,bordered:!1,closable:!1,closeIcon:"close"}},F=["data-test"],G=["textContent"],H=["textContent"],Y=_({inheritAttrs:!1,__name:"UAlert",props:P({title:{},description:{},variant:{},bordered:{type:Boolean},size:{},color:{},timeout:{},closable:{type:Boolean},config:{},dataTest:{}},{...q(x,R)}),emits:["hidden"],setup(w,{emit:A}){const a=w,C=A,y=S(!0);V(()=>{a.timeout>0&&setTimeout(()=>u(),a.timeout)});function u(){y.value=!1,C("hidden")}const m=E(()=>a.variant==="primary"||a.color==="white"?a.color==="white"?"grayscale":"white":a.color),{getDataTest:g,config:p,wrapperAttrs:$,bodyAttrs:k,contentAttrs:B,textAttrs:z,titleAttrs:N,descriptionAttrs:I,closeButtonAttrs:U,closeIconAttrs:D,contentWrapperAttrs:T}=M(x);return(t,J)=>y.value?(l(),c("div",o({key:0},e($),{"data-test":e(g)()}),[r(t.$slots,"top"),d("div",i(n(e(k))),[d("div",i(n(e(T))),[r(t.$slots,"left"),d("div",i(n(e(B))),[e(f)(t.$slots.default)?s("",!0):r(t.$slots,"title",{key:0,title:t.title},()=>[t.title?(l(),c("div",o({key:0},e(N),{textContent:h(t.title)}),null,16,G)):s("",!0)]),e(f)(t.$slots.default)?s("",!0):r(t.$slots,"description",{key:1,description:t.description},()=>[t.description?(l(),c("div",o({key:0},e(I),{textContent:h(t.description)}),null,16,H)):s("",!0)]),b(K,i(n(e(z))),{default:v(()=>[r(t.$slots,"default")]),_:3},16)],16),r(t.$slots,"right")],16),t.closable?(l(),O(W,o({key:0,square:"",size:"xs",color:m.value,variant:"thirdary"},e(U),{onClick:u}),{default:v(()=>[r(t.$slots,"close",{iconName:e(p).defaults.closeIcon},()=>[b(j,o({internal:"",color:m.value,name:e(p).defaults.closeIcon},e(D),{"data-test":e(g)("button")}),null,16,["color","name","data-test"])])]),_:3},16,["color"])):s("",!0)],16),r(t.$slots,"bottom")],16,F)):s("",!0)}});export{Y as _};
