import{d as c,c as m,o as l,b as f,w as d,r as h,T as u,e as b,f as s,g as p}from"./index.477073af.js";import{n as g,aa as y}from"./index.ef672c15.js";const x=s("div",{class:"absolute left-0 flex w-full items-center justify-center"},[s("svg",{class:"h-4 w-4 animate-spin",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[s("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),s("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})])],-1),C=c({__name:"ElButton",props:{loading:{type:[Boolean,String],default:!1},btn:{type:String,required:!0},size:{type:String,default:""},to:{type:String,default:""},href:{type:String,default:""},disabled:{type:Boolean,default:!1},format:{type:String,default:"inline"}},setup(t){const o=t,a=m(()=>{const r=o.btn;let e="";r=="danger"?e="text-red-600 bg-white hover:bg-red-600 focus:ring-red-600 border-red-600 hover:text-white":r=="warning"?e="text-orange-500 bg-white hover:bg-orange-500 focus:ring-orange-500 border-orange-500 hover:text-white":r=="secondary"?e="text-primary-600 bg-primary-50 hover:bg-primary-500 hover:bg-primary-500 hover:text-white focus:ring-primary-500 border-primary-50 hover:border-primary-500":r=="primary"?e="text-white bg-primary-500 hover:bg-primary-600 hover:border-primary-600 focus:ring-primary-100 border-primary-500":r=="outline"?e="text-primary-500  hover:bg-primary-50 focus:ring-primary-100 border-primary-500":r=="outlineWhite"?e="text-white hover:bg-white bg-opacity-05 focus:ring-white border-white":r=="green"?e="text-green-600 bg-green-50 hover:bg-green-500 hover:bg-green-500 hover:text-white focus:ring-green-500 border-green-50 hover:border-green-500":r=="subtle"?e="border-slate-200 text-slate-500  hover:border-slate-400 focus:ring-primary-100":r=="theme"?e="border-theme-300 text-theme-700 bg-theme-100 hover:bg-theme-200":e="border-slate-300 text-slate-700 bg-white hover:border-slate-400 focus:ring-primary-100";let i="px-2.5 py-1.5 text-sm";o.size=="md"?i="px-3 py-1.5 text-base":o.size=="sm"||o.size=="xs"?i="px-2 py-1 text-xs":o.size=="lg"&&(i="px-4 py-2 text-base rounded-md");let n="inline-flex";return o.format=="block"&&(n="flex justify-center w-full"),e+=` ${i} ${n}`,o.disabled&&(e=a.value+" opacity-40 cursor-not-allowed"),e});return(r,e)=>(l(),f(h(t.to?"router-link":t.href?"a":"button"),{to:t.to,class:g(["relative select-none items-center rounded-lg border font-medium ring-offset-2 focus:outline-none focus:ring-2",y(a)]),href:t.href},{default:d(()=>[t.loading?(l(),f(u,{key:0,name:"fade"},{default:d(()=>[x]),_:1})):b("v-if",!0),s("span",{class:g(["flex items-center",t.loading?"opacity-0":""])},[p(r.$slots,"default")],2)]),_:3},8,["to","class","href"]))}});export{C as _};
