import{r as e,j as r}from"./router.chunk.YsRm4bSN.js";import{c as n}from"./ui-radix.chunk.Xzokq_Gv.js";import{a}from"./utils.chunk.C1IATKsN.js";import{c as o}from"./main.chunk.N-eZ2ybB.js";function t(...r){const n=r[0];if(1===r.length)return n;const a=()=>{const a=r.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(r){const o=a.reduce((e,{useScope:n,scopeName:a})=>({...e,...n(r)[`__scope${a}`]}),{});return e.useMemo(()=>({[`__scope${n.scopeName}`]:o}),[o])}};return a.scopeName=n.scopeName,a}var s=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((a,o)=>{const t=n(`Primitive.${o}`),s=e.forwardRef((e,n)=>{const{asChild:a,...s}=e,u=a?t:o;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),r.jsx(u,{...s,ref:n})});return s.displayName=`Primitive.${o}`,{...a,[o]:s}},{}),u="Progress",i=100,[l]=function(n,a=[]){let o=[];const s=()=>{const r=o.map(r=>e.createContext(r));return function(a){const o=a?.[n]||r;return e.useMemo(()=>({[`__scope${n}`]:{...a,[n]:o}}),[a,o])}};return s.scopeName=n,[function(a,t){const s=e.createContext(t);s.displayName=a+"Context";const u=o.length;o=[...o,t];const i=a=>{const{scope:o,children:t,...i}=a,l=o?.[n]?.[u]||s,d=e.useMemo(()=>i,Object.values(i));return r.jsx(l.Provider,{value:d,children:t})};return i.displayName=a+"Provider",[i,function(r,o){const i=o?.[n]?.[u]||s,l=e.useContext(i);if(l)return l;if(void 0!==t)return t;throw new Error(`\`${r}\` must be used within \`${a}\``)}]},t(s,...a)]}(u),[d,c]=l(u),f=e.forwardRef((e,n)=>{const{__scopeProgress:a,value:o=null,max:t,getValueLabel:u=v,...l}=e;!t&&0!==t||h(t)||console.error(`Invalid prop \`max\` of value \`${`${t}`}\` supplied to \`${"Progress"}\`. Only numbers greater than 0 are valid max values. Defaulting to \`100\`.`);const c=h(t)?t:i;null===o||x(o,c)||console.error(function(e,r){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${r}\`. The \`value\` prop must be:\n  - a positive number\n  - less than the value passed to \`max\` (or 100 if no \`max\` prop is set)\n  - \`null\` or \`undefined\` if the progress is indeterminate.\n\nDefaulting to \`null\`.`}(`${o}`,"Progress"));const f=x(o,c)?o:null,m=w(f)?u(f,c):void 0;return r.jsx(d,{scope:a,value:f,max:c,children:r.jsx(s.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":w(f)?f:void 0,"aria-valuetext":m,role:"progressbar","data-state":g(f,c),"data-value":f??void 0,"data-max":c,...l,ref:n})})});f.displayName=u;var m="ProgressIndicator",p=e.forwardRef((e,n)=>{const{__scopeProgress:a,...o}=e,t=c(m,a);return r.jsx(s.div,{"data-state":g(t.value,t.max),"data-value":t.value??void 0,"data-max":t.max,...o,ref:n})});function v(e,r){return`${Math.round(e/r*100)}%`}function g(e,r){return null==e?"indeterminate":e===r?"complete":"loading"}function w(e){return"number"==typeof e}function h(e){return w(e)&&!isNaN(e)&&e>0}function x(e,r){return w(e)&&!isNaN(e)&&e<=r&&e>=0}p.displayName=m;var N=f,b=p;const $=a("growfund-relative growfund-h-2 growfund-w-full growfund-overflow-hidden growfund-rounded-full growfund-bg-background-fill-tertiary",{variants:{size:{default:"growfund-h-2",sm:"growfund-h-1",lg:"growfund-h-3"}},defaultVariants:{size:"default"}}),j=e.forwardRef(({className:e,value:n,size:a="default",...t},s)=>r.jsx(N,{ref:s,className:o($({size:a}),e),...t,children:r.jsx(b,{className:"growfund-h-full growfund-w-full growfund-flex-1 growfund-bg-background-fill-brand growfund-transition-all growfund-rounded-full",style:{transform:`translateX(-${String(100-(n??0))}%)`}})}));j.displayName=N.displayName;export{j as P};
