import{a5 as O,a6 as f,a as I,h as P,a7 as V,a8 as h,j as s,ab as t,o as l,c as u,x as z,Y as g,q as E,b as C,t as v,E as m,aS as A,ac as b,F as R,n as T,e as q,aT as D}from"./BVKxFB48.js";const J={wrapper:"w-full flex flex-col gap-2",indicator:{container:{base:"flex flex-row justify-end",width:"min-w-fit",transition:"transition-all"},align:"text-end",width:"w-fit",color:"text-gray-400 dark:text-gray-500",size:{"2xs":"text-xs",xs:"text-xs",sm:"text-sm",md:"text-sm",lg:"text-sm",xl:"text-base","2xl":"text-base"}},progress:{base:"block appearance-none border-none overflow-hidden",width:"w-full [&::-webkit-progress-bar]:w-full",size:{"2xs":"h-px",xs:"h-0.5",sm:"h-1",md:"h-2",lg:"h-3",xl:"h-4","2xl":"h-5"},rounded:"rounded-full [&::-webkit-progress-bar]:rounded-full",track:"[&::-webkit-progress-bar]:bg-gray-200 [&::-webkit-progress-bar]:dark:bg-gray-700 [@supports(selector(&::-moz-progress-bar))]:bg-gray-200 [@supports(selector(&::-moz-progress-bar))]:dark:bg-gray-700",bar:"[&::-webkit-progress-value]:rounded-full [&::-webkit-progress-value]:transition-all [&::-webkit-progress-value]:ease-in-out [&::-moz-progress-bar]:rounded-full",color:"text-{color}-500 dark:text-{color}-400",background:"[&::-webkit-progress-value]:bg-current [&::-moz-progress-bar]:bg-current",indeterminate:{base:"indeterminate:relative",rounded:"indeterminate:after:rounded-full [&:indeterminate::-webkit-progress-value]:rounded-full [&:indeterminate::-moz-progress-bar]:rounded-full"}},steps:{base:"grid grid-cols-1",color:"text-{color}-500 dark:text-{color}-400",size:{"2xs":"text-xs",xs:"text-xs",sm:"text-sm",md:"text-sm",lg:"text-sm",xl:"text-base","2xl":"text-base"}},step:{base:"transition-all opacity-0 truncate row-start-1 col-start-1",align:"text-end",active:"opacity-100",first:"text-gray-500 dark:text-gray-400"},animation:{carousel:"bar-animation-carousel","carousel-inverse":"bar-animation-carousel-inverse",swing:"bar-animation-swing",elastic:"bar-animation-elastic"},default:{color:"primary",size:"md",animation:"carousel"}},i=O(f.ui.strategy,f.ui.progress,J),L=P({inheritAttrs:!1,props:{value:{type:Number,default:null},max:{type:[Number,Array],default:100},indicator:{type:Boolean,default:!1},animation:{type:String,default:()=>i.default.animation,validator(e){return Object.keys(i.animation).includes(e)}},size:{type:String,default:()=>i.default.size,validator(e){return Object.keys(i.progress.size).includes(e)}},color:{type:String,default:()=>i.default.color,validator(e){return f.ui.colors.includes(e)}},class:{type:[String,Object,Array],default:()=>""},ui:{type:Object,default:()=>({})}},setup(e){const{ui:a,attrs:y}=V("progress",h(e,"ui"),i,h(e,"class")),x=s(()=>t(a.value.indicator.container.base,a.value.indicator.container.width,a.value.indicator.container.transition)),w=s(()=>t(a.value.indicator.align,a.value.indicator.width,a.value.indicator.color,a.value.indicator.size[e.size])),k=s(()=>{var n;const r=[a.value.progress.base,a.value.progress.width,a.value.progress.size[e.size],a.value.progress.rounded,a.value.progress.track,a.value.progress.bar,(n=a.value.progress.color)==null?void 0:n.replaceAll("{color}",e.color),a.value.progress.background,a.value.progress.indeterminate.base,a.value.progress.indeterminate.rounded];return d.value&&r.push(a.value.animation[e.animation]),t(...r)}),c=s(()=>{var r;return t(a.value.steps.base,(r=a.value.steps.color)==null?void 0:r.replaceAll("{color}",e.color),a.value.steps.size[e.size])}),o=s(()=>t(a.value.step.base,a.value.step.align)),S=s(()=>t(a.value.step.active)),$=s(()=>t(a.value.step.first));function N(r){return r===Number(e.value)}function j(r){return r===0}function B(r){r=Number(r);const n=[o.value];return j(r)&&n.push($.value),N(r)&&n.push(S.value),n.join(" ")}const d=s(()=>e.value===void 0||e.value===null),F=s(()=>Array.isArray(e.max)),p=s(()=>d.value?null:Array.isArray(e.max)?e.max.length-1:Number(e.max)),M=s(()=>{if(!d.value)switch(!0){case e.value<0:return 0;case e.value>p.value:return 100;default:return e.value/p.value*100}});return{ui:a,attrs:y,indicatorContainerClass:x,indicatorClass:w,progressClass:k,stepsClass:c,stepClasses:B,isIndeterminate:d,isSteps:F,realMax:p,percent:M}}});function U(e,a,y,x,w,k){return l(),u("div",b({class:e.ui.wrapper},e.attrs),[e.indicator||e.$slots.indicator?z(e.$slots,"indicator",A(b({key:0},{percent:e.percent})),()=>[e.isSteps?m("",!0):(l(),u("div",{key:0,class:g(e.indicatorContainerClass),style:E({width:`${e.percent}%`})},[C("div",{class:g(e.indicatorClass)},v(Math.round(e.percent))+"% ",3)],6))],!0):m("",!0),C("progress",b({class:e.progressClass},{value:e.value,max:e.realMax}),v(e.percent!==void 0?`${Math.round(e.percent)}%`:void 0),17),e.isSteps?(l(),u("div",{key:1,class:g(e.stepsClass)},[(l(!0),u(R,null,T(e.max,(c,o)=>(l(),u("div",{key:o,class:g(e.stepClasses(o))},[z(e.$slots,`step-${o}`,A(D({step:c})),()=>[q(v(c),1)],!0)],2))),128))],2)):m("",!0)],16)}const G=I(L,[["render",U],["__scopeId","data-v-1e545a26"]]);export{G as _};
