import{E,b as P,q as V,_ as W,a as N,u as M,c as $,P as H,g as v,o as m,N as y,Q as k,r as C,h as c,j as l,w as b,B as T,as as _,O as w,W as B,n as S,T as I,l as R}from"./index-5orz1M6_.js";import{c as j}from"./el-input-D_xPEeA2.js";let h;const G=s=>{var n;if(!E)return 0;if(h!==void 0)return h;const t=document.createElement("div");t.className=`${s}-scrollbar__wrap`,t.style.visibility="hidden",t.style.width="100px",t.style.position="absolute",t.style.top="-9999px",document.body.appendChild(t);const a=t.offsetWidth;t.style.overflow="scroll";const e=document.createElement("div");e.style.width="100%",t.appendChild(e);const i=e.offsetWidth;return(n=t.parentNode)==null||n.removeChild(t),h=a-i,h};function J(s,n){if(!E)return;if(!n){s.scrollTop=0;return}const t=[];let a=n.offsetParent;for(;a!==null&&s!==a&&s.contains(a);)t.push(a),a=a.offsetParent;const e=n.offsetTop+t.reduce((g,o)=>g+o.offsetTop,0),i=e+n.offsetHeight,r=s.scrollTop,p=r+s.clientHeight;e<r?s.scrollTop=e:i>p&&(s.scrollTop=i-s.clientHeight)}const q=P({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:V},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),F={close:s=>s instanceof MouseEvent,click:s=>s instanceof MouseEvent},K=N({name:"ElTag"}),O=N({...K,props:q,emits:F,setup(s,{emit:n}){const t=s,a=j(),e=M("tag"),i=$(()=>{const{type:o,hit:u,effect:d,closable:f,round:z}=t;return[e.b(),e.is("closable",f),e.m(o||"primary"),e.m(a.value),e.m(d),e.is("hit",u),e.is("round",z)]}),r=o=>{n("close",o)},p=o=>{n("click",o)},g=o=>{var u,d,f;(f=(d=(u=o==null?void 0:o.component)==null?void 0:u.subTree)==null?void 0:d.component)!=null&&f.bum&&(o.component.subTree.component.bum=null)};return(o,u)=>o.disableTransitions?(m(),H("span",{key:0,class:c(l(i)),style:S({backgroundColor:o.color}),onClick:p},[y("span",{class:c(l(e).e("content"))},[C(o.$slots,"default")],2),o.closable?(m(),v(l(B),{key:0,class:c(l(e).e("close")),onClick:w(r,["stop"])},{default:b(()=>[T(l(_))]),_:1},8,["class","onClick"])):k("v-if",!0)],6)):(m(),v(I,{key:1,name:`${l(e).namespace.value}-zoom-in-center`,appear:"",onVnodeMounted:g},{default:b(()=>[y("span",{class:c(l(i)),style:S({backgroundColor:o.color}),onClick:p},[y("span",{class:c(l(e).e("content"))},[C(o.$slots,"default")],2),o.closable?(m(),v(l(B),{key:0,class:c(l(e).e("close")),onClick:w(r,["stop"])},{default:b(()=>[T(l(_))]),_:1},8,["class","onClick"])):k("v-if",!0)],6)]),_:3},8,["name"]))}});var Q=W(O,[["__file","tag.vue"]]);const L=R(Q);export{L as E,G as g,J as s,q as t};
