import{r as u,j as l,cH as f,cI as I,bU as y}from"./index-B_1BLMrZ.js";var d="Progress",v=100,[E]=I(d),[R,j]=E(d),m=u.forwardRef((r,e)=>{const{__scopeProgress:n,value:o=null,max:a,getValueLabel:b=w,...h}=r;(a||a===0)&&!c(a)&&console.error(_(`${a}`,"Progress"));const s=c(a)?a:v;o!==null&&!p(o,s)&&console.error(M(`${o}`,"Progress"));const t=p(o,s)?o:null,$=i(t)?b(t,s):void 0;return l.jsx(R,{scope:n,value:t,max:s,children:l.jsx(f.div,{"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":i(t)?t:void 0,"aria-valuetext":$,role:"progressbar","data-state":P(t,s),"data-value":t??void 0,"data-max":s,...h,ref:e})})});m.displayName=d;var x="ProgressIndicator",g=u.forwardRef((r,e)=>{const{__scopeProgress:n,...o}=r,a=j(x,n);return l.jsx(f.div,{"data-state":P(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...o,ref:e})});g.displayName=x;function w(r,e){return`${Math.round(r/e*100)}%`}function P(r,e){return r==null?"indeterminate":r===e?"complete":"loading"}function i(r){return typeof r=="number"}function c(r){return i(r)&&!isNaN(r)&&r>0}function p(r,e){return i(r)&&!isNaN(r)&&r<=e&&r>=0}function _(r,e){return`Invalid prop \`max\` of value \`${r}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${v}\`.`}function M(r,e){return`Invalid prop \`value\` of value \`${r}\` supplied to \`${e}\`. The \`value\` prop must be:
  - a positive number
  - less than the value passed to \`max\` (or ${v} if no \`max\` prop is set)
  - \`null\` or \`undefined\` if the progress is indeterminate.

Defaulting to \`null\`.`}var N=m,V=g;const A=u.forwardRef(({className:r,value:e,...n},o)=>l.jsx(N,{ref:o,className:y("relative h-4 w-full overflow-hidden rounded-full bg-secondary",r),...n,children:l.jsx(V,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})}));A.displayName=N.displayName;export{A as P};
