import{f as h,g as a,b as w,o as l,n as _,x,c as d,j as N,K as g,d as c,t as S,a as k,w as z,T as B}from"./BVo-4L0X.js";import{z as V,A as v,d7 as C,D as $}from"./CfjfYOu4.js";const I={"data-test-id":"s-progress-indicator-circular__root",class:"s-progress-indicator s-progress-indicator-circular border-box relative flex items-center justify-center mx-auto",role:"progressbar","aria-valuemin":"0","aria-valuemax":"100"},D=["viewBox"],P=["stroke-width"],M=["stroke-width","stroke-dashoffset"],q={key:0,"data-test-id":"s-progress-indicator-circular__content",class:"s-progress-indicator-circular__content"},m=20,F=h({__name:"SProgressIndicatorCircular",props:{...v(),value:{type:[Number,String],default:0},showValue:Boolean,rotate:{type:[Number,String],default:0},width:{type:[Number,String],default:4}},setup(r){const e=r,o={small:48,regular:44},s=2*Math.PI*m,n=a(()=>Math.max(0,Math.min(100,typeof e.value=="string"?Number.parseFloat(e.value):e.value))),u=a(()=>Number(e.width)),i=a(()=>m/(1-u.value/o[e.size])*2),t=a(()=>u.value/o[e.size]*i.value),p=a(()=>(100-n.value)/100*s+"px"),f=a(()=>({transform:`rotate(calc(-90deg + ${Number(e.rotate)}deg))`})),b=a(()=>`0 0 ${i.value} ${i.value}`);return(A,E)=>(l(),d("div",I,[(l(),d("svg",{class:"s-progress-indicator-circular__svg-tag absolute m-auto h-full w-full",style:g(f.value),xmlns:"http://www.w3.org/2000/svg",viewBox:b.value},[c("circle",{class:"s-progress-indicator-circular__underlay z-10",fill:"transparent",cx:"50%",cy:"50%",r:m,"stroke-width":t.value,"stroke-dasharray":s,"stroke-dashoffset":"0"},null,8,P),c("circle",{class:"s-progress-indicator-circular__overlay z-20",fill:"transparent",cx:"50%",cy:"50%",r:m,"stroke-width":t.value,"stroke-dasharray":s,"stroke-dashoffset":p.value},null,8,M)],12,D)),r.showValue?(l(),d("div",q,S(n.value),1)):N("",!0)]))}}),T={key:1,class:"s-progress-indicator-linear__indeterminate h-full"},j=h({__name:"SProgressIndicatorLinear",props:{...v(),indeterminate:Boolean,max:{type:[Number,String],default:100},value:{type:[Number,String],default:0},showValue:Boolean,height:{type:[Number,String]}},setup(r){const e=r,o=a(()=>typeof e.max=="string"?Number.parseInt(e.max,10):e.max),s=a(()=>e.height?typeof e.height=="string"?Number.parseInt(e.height,10):e.height:null),n=a(()=>(typeof e.value=="string"?Number.parseFloat(e.value):e.value)/o.value*100),u=a(()=>e.indeterminate?"progress-linear-fade":"progress-linear-x-transition");return(i,t)=>(l(),d("div",{"data-test-id":"s-progress-indicator-linear__root",class:"s-progress-indicator s-progress-indicator-linear relative !w-full overflow-hidden bg-transparent",role:"progressbar","aria-valuemin":"0","aria-valuemax":"100",style:g(s.value?{height:`${s.value}px`}:void 0)},[t[1]||(t[1]=c("div",{class:"s-progress-indicator-linear__background absolute bottom-0 left-0 top-0 w-full"},null,-1)),k(B,{name:u.value},{default:z(()=>[e.indeterminate?(l(),d("div",T,t[0]||(t[0]=[c("div",{class:"s-progress-indicator-linear__indeterminate long absolute top-0 bottom-0 left-0 right-auto h-full w-auto"},null,-1),c("div",{class:"s-progress-indicator-linear__indeterminate short absolute top-0 bottom-0 left-0 right-auto h-full w-auto"},null,-1)]))):(l(),d("div",{key:0,class:"s-progress-indicator-linear__determinate absolute left-0 h-full",style:g({width:`${n.value}%`})},null,4))]),_:1},8,["name"])],4))}}),y="s-progress-indicator",R=h({__name:"SProgressIndicator",props:{...v(),...V(),type:{type:String,validator:function(r){return["linear","circular"].includes(r)},required:!1,default:"circular"},indeterminate:{type:Boolean,default:!0,required:!1},max:{type:[Number,String],default:100},value:{type:[Number,String],default:0},showValue:Boolean,rotate:{type:[Number,String],default:0},width:{type:[Number,String],default:4},height:{type:[Number,String]}},setup(r){const e=r,{sizeClasses:o}=C(e,y),{themeClasses:s}=$(e,y),n=a(()=>"s-progress-indicator--type-"+(e.type||"circular")),u=a(()=>[n.value,s.value,o.value,{"s-progress-indicator--indeterminate":!!e.indeterminate,"s-progress-indicator--determinate":!e.indeterminate}]),i={linear:j,circular:F},t=a(()=>i[e.type]?i[e.type]:i.circular);return(p,f)=>(l(),w(x(t.value),{type:r.type,size:p.size,width:r.width,height:r.height,theme:p.theme,value:r.value,class:_(u.value),showValue:r.showValue,indeterminate:r.indeterminate},null,8,["type","size","width","height","theme","value","class","showValue","indeterminate"]))}});export{R as default};