import{L as v,V as z,O as I,bD as C,bM as D,e as o,bE as L,N as l,R as N,I as O,a2 as q,W as w}from"./index-BDh_pN-M.js";import{L as E}from"./index-Bg8xNGen.js";const[U,a]=I("button"),V=z({},L,{tag:l("button"),text:String,icon:String,type:l("default"),size:l("normal"),color:String,block:Boolean,plain:Boolean,round:Boolean,square:Boolean,loading:Boolean,hairline:Boolean,disabled:Boolean,iconPrefix:String,nativeType:l("button"),loadingSize:N,loadingText:String,loadingType:String,iconPosition:l("left")});var _=v({name:U,props:V,emits:["click"],setup(n,{emit:g,slots:t}){const f=C(),b=()=>t.loading?t.loading():o(E,{size:n.loadingSize,type:n.loadingType,class:a("loading")},null),c=()=>{if(n.loading)return b();if(t.icon)return o("div",{class:a("icon")},[t.icon()]);if(n.icon)return o(O,{name:n.icon,class:a("icon"),classPrefix:n.iconPrefix},null)},m=()=>{let e;if(n.loading?e=n.loadingText:e=t.default?t.default():n.text,e)return o("span",{class:a("text")},[e])},x=()=>{const{color:e,plain:r}=n;if(e){const i={color:r?e:"white"};return r||(i.background=e),e.includes("gradient")?i.border=0:i.borderColor=e,i}},y=e=>{n.loading?q(e):n.disabled||(g("click",e),f())};return()=>{const{tag:e,type:r,size:i,block:S,round:B,plain:P,square:k,loading:T,disabled:s,hairline:d,nativeType:R,iconPosition:u}=n,h=[a([r,i,{plain:P,block:S,round:B,square:k,loading:T,disabled:s,hairline:d}]),{[D]:d}];return o(e,{type:R,class:h,style:x(),disabled:s,onClick:y},{default:()=>[o("div",{class:a("content")},[u==="left"&&c(),m(),u==="right"&&c()])]})}}});const W=w(_);export{W as B};
