import{j as c}from"./query-vendor-CZu0EHPe.js";import{r as l}from"./react-vendor-0bvDbF03.js";import{ad as S,b as f,m as M}from"./index-DMdfL0Ih.js";function I(e,r=[]){let s=[];function a(u,i){const o=l.createContext(i),n=s.length;s=[...s,i];function d(p){const{scope:x,children:g,...m}=p,C=x?.[e][n]||o,E=l.useMemo(()=>m,Object.values(m));return c.jsx(C.Provider,{value:E,children:g})}function N(p,x){const g=x?.[e][n]||o,m=l.useContext(g);if(m)return m;if(i!==void 0)return i;throw new Error(`\`${p}\` must be used within \`${u}\``)}return d.displayName=u+"Provider",[d,N]}const t=()=>{const u=s.map(i=>l.createContext(i));return function(o){const n=o?.[e]||u;return l.useMemo(()=>({[`__scope${e}`]:{...o,[e]:n}}),[o,n])}};return t.scopeName=e,[a,R(t,...r)]}function R(...e){const r=e[0];if(e.length===1)return r;const s=()=>{const a=e.map(t=>({useScope:t(),scopeName:t.scopeName}));return function(u){const i=a.reduce((o,{useScope:n,scopeName:d})=>{const p=n(u)[`__scope${d}`];return{...o,...p}},{});return l.useMemo(()=>({[`__scope${r.scopeName}`]:i}),[i])}};return s.scopeName=r.scopeName,s}var h="Progress",b=100,[V,U]=I(h),[A,O]=V(h),_=l.forwardRef((e,r)=>{const{__scopeProgress:s,value:a=null,max:t,getValueLabel:u=L,...i}=e;(t||t===0)&&!$(t)&&console.error(T(`${t}`,"Progress"));const o=$(t)?t:b;a!==null&&!w(a,o)&&console.error(G(`${a}`,"Progress"));const n=w(a,o)?a:null,d=v(n)?u(n,o):void 0;return c.jsx(A,{scope:s,value:n,max:o,children:c.jsx(S.div,{"aria-valuemax":o,"aria-valuemin":0,"aria-valuenow":v(n)?n:void 0,"aria-valuetext":d,role:"progressbar","data-state":j(n,o),"data-value":n??void 0,"data-max":o,...i,ref:r})})});_.displayName=h;var y="ProgressIndicator",D=l.forwardRef((e,r)=>{const{__scopeProgress:s,...a}=e,t=O(y,s);return c.jsx(S.div,{"data-state":j(t.value,t.max),"data-value":t.value??void 0,"data-max":t.max,...a,ref:r})});D.displayName=y;function L(e,r){return`${Math.round(e/r*100)}%`}function j(e,r){return e==null?"indeterminate":e===r?"complete":"loading"}function v(e){return typeof e=="number"}function $(e){return v(e)&&!isNaN(e)&&e>0}function w(e,r){return v(e)&&!isNaN(e)&&e<=r&&e>=0}function T(e,r){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${r}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${b}\`.`}function G(e,r){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${r}\`. The \`value\` prop must be:
- a positive number
- less than the value passed to \`max\` (or ${b} if no \`max\` prop is set)
- \`null\` or \`undefined\` if the progress is indeterminate.
Defaulting to \`null\`.`}var P=_;const k=l.forwardRef(({className:e,value:r,indicatorColor:s,animated:a=!0,...t},u)=>a?c.jsx(P,{ref:u,className:f("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...t,children:c.jsx(M.div,{className:f("h-full flex-1 bg-primary transition-all",s),initial:{width:0},animate:{width:`${r||0}%`},transition:{duration:.8,ease:"easeOut"}})}):c.jsx(P,{ref:u,className:f("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...t,children:c.jsx("div",{className:f("h-full flex-1 bg-primary transition-all",s),style:{width:`${r||0}%`}})}));k.displayName=P.displayName;export{k as P};
//# sourceMappingURL=progress-BIKvHsrl.js.map