import{_ as t}from"./Icon.5a1d6ed4.js";import{m as e,e as a,t as r}from"./entry.f2005aa0.js";import{t as s}from"./tw-merge.55efcad2.js";import{u as l}from"./selectMenu.742e7884.js";import{_ as i}from"./_plugin-vue_export-helper.1b428a4d.js";import{j as o,t as n,k as p,a as u,b as c,L as x,M as h,Q as m,a7 as d,a2 as g,V as f,a9 as w,N as y}from"./swiper-vue.e1c52112.js";const b=e(a.ui.strategy,a.ui.avatar,{wrapper:"relative inline-flex items-center justify-center flex-shrink-0",background:"bg-gray-100 dark:bg-gray-800",rounded:"rounded-full",text:"font-medium leading-none text-gray-900 dark:text-white truncate",placeholder:"font-medium leading-none text-gray-500 dark:text-gray-400 truncate",size:{"3xs":"h-4 w-4 text-[8px]","2xs":"h-5 w-5 text-[10px]",xs:"h-6 w-6 text-xs",sm:"h-8 w-8 text-sm",md:"h-10 w-10 text-base",lg:"h-12 w-12 text-lg",xl:"h-14 w-14 text-xl","2xl":"h-16 w-16 text-2xl","3xl":"h-20 w-20 text-3xl"},chip:{base:"absolute rounded-full ring-1 ring-white dark:ring-gray-900 flex items-center justify-center text-white dark:text-gray-900 font-medium",background:"bg-{color}-500 dark:bg-{color}-400",position:{"top-right":"top-0 right-0","bottom-right":"bottom-0 right-0","top-left":"top-0 left-0","bottom-left":"bottom-0 left-0"},size:{"3xs":"h-[4px] min-w-[4px] text-[4px] p-px","2xs":"h-[5px] min-w-[5px] text-[5px] p-px",xs:"h-1.5 min-w-[0.375rem] text-[6px] p-px",sm:"h-2 min-w-[0.5rem] text-[7px] p-0.5",md:"h-2.5 min-w-[0.625rem] text-[8px] p-0.5",lg:"h-3 min-w-[0.75rem] text-[10px] p-0.5",xl:"h-3.5 min-w-[0.875rem] text-[11px] p-1","2xl":"h-4 min-w-[1rem] text-[12px] p-1","3xl":"h-5 min-w-[1.25rem] text-[14px] p-1"}},icon:{base:"text-gray-500 dark:text-gray-400 flex-shrink-0",size:{"3xs":"h-2 w-2","2xs":"h-2.5 w-2.5",xs:"h-3 w-3",sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6",xl:"h-7 w-7","2xl":"h-8 w-8","3xl":"h-10 w-10"}},default:{size:"sm",icon:null,chipColor:null,chipPosition:"top-right"}}),v=o({components:{UIcon:t},inheritAttrs:!1,props:{src:{type:[String,Boolean],default:null},alt:{type:String,default:null},text:{type:String,default:null},icon:{type:String,default:()=>b.default.icon},size:{type:String,default:()=>b.default.size,validator:t=>Object.keys(b.size).includes(t)},chipColor:{type:String,default:()=>b.default.chipColor,validator:t=>["gray",...a.ui.colors].includes(t)},chipPosition:{type:String,default:()=>b.default.chipPosition,validator:t=>Object.keys(b.chip.position).includes(t)},chipText:{type:[String,Number],default:null},imgClass:{type:String,default:""},class:{type:[String,Object,Array],default:()=>""},ui:{type:Object,default:()=>({})}},setup(t){const{ui:e,attrs:a}=l("avatar",n(t,"ui"),b),i=p((()=>"boolean"==typeof t.src?null:t.src)),o=p((()=>(t.alt||"").split(" ").map((t=>t.charAt(0))).join("").substring(0,2))),x=p((()=>s(r(e.value.wrapper,(g.value||!i.value)&&e.value.background,e.value.rounded,e.value.size[t.size]),t.class))),h=p((()=>s(r(e.value.rounded,e.value.size[t.size]),t.imgClass))),m=p((()=>r(e.value.icon.base,e.value.icon.size[t.size]))),d=p((()=>r(e.value.chip.base,e.value.chip.size[t.size],e.value.chip.position[t.chipPosition],e.value.chip.background.replaceAll("{color}",t.chipColor)))),g=u(!1);return c((()=>t.src),(()=>{g.value&&(g.value=!1)})),{ui:e,attrs:a,wrapperClass:x,imgClass:h,iconClass:m,chipClass:d,url:i,placeholder:o,error:g,onError:function(){g.value=!0}}}}),k=["alt","src"];const z=i(v,[["render",function(e,a,r,s,l,i){const o=t;return x(),h("span",{class:d(e.wrapperClass)},[e.url&&!e.error?(x(),h("img",m({key:0,class:e.imgClass,alt:e.alt,src:e.url},e.attrs,{onError:a[0]||(a[0]=(...t)=>e.onError&&e.onError(...t))}),null,16,k)):e.text?(x(),h("span",{key:1,class:d(e.ui.text)},g(e.text),3)):e.icon?(x(),f(o,{key:2,name:e.icon,class:d(e.iconClass)},null,8,["name","class"])):e.placeholder?(x(),h("span",{key:3,class:d(e.ui.placeholder)},g(e.placeholder),3)):w("",!0),e.chipColor?(x(),h("span",{key:4,class:d(e.chipClass)},g(e.chipText),3)):w("",!0),y(e.$slots,"default")],2)}]]);export{z as _};
