@qodo/design-system 0.17.2 → 0.17.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/design-system.css +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +272 -257
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -201,7 +201,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
201
201
|
- less than the value passed to \`max\` (or ${Ea} if no \`max\` prop is set)
|
|
202
202
|
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
203
203
|
|
|
204
|
-
Defaulting to \`null\`.`}var jy=yd,Ny=Cd;function ky({className:e,value:t,...r}){return s.jsx(jy,{"data-slot":"progress",className:j("qodo qodo-progress bg-primary/20 relative h-2 w-full overflow-hidden rounded-full dark:bg-primary/20",e),...r,children:s.jsx(Ny,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all dark:bg-primary",style:{transform:`translateX(-${100-(t||0)}%)`}})})}function Ed({className:e,...t}){return s.jsx("div",{className:j("qodo qodo-skeleton animate-pulse rounded-md bg-neutral-900/10 dark:bg-neutral-50/10",e),...t})}var Vn="Switch",[Ty,lP]=we(Vn),[Ay,_y]=Ty(Vn),Rd=c.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:o,defaultChecked:a,required:i,disabled:l,value:d="on",onCheckedChange:u,form:f,...p}=e,[g,m]=c.useState(null),b=se(t,C=>m(C)),v=c.useRef(!1),h=g?f||!!g.closest("form"):!0,[y,x]=ye({prop:o,defaultProp:a??!1,onChange:u,caller:Vn});return s.jsxs(Ay,{scope:r,checked:y,disabled:l,children:[s.jsx(H.button,{type:"button",role:"switch","aria-checked":y,"aria-required":i,"data-state":kd(y),"data-disabled":l?"":void 0,disabled:l,value:d,...p,ref:b,onClick:F(e.onClick,C=>{x(E=>!E),h&&(v.current=C.isPropagationStopped(),v.current||C.stopPropagation())})}),h&&s.jsx(Nd,{control:g,bubbles:!v.current,name:n,value:d,checked:y,required:i,disabled:l,form:f,style:{transform:"translateX(-100%)"}})]})});Rd.displayName=Vn;var Pd="SwitchThumb",jd=c.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,o=_y(Pd,r);return s.jsx(H.span,{"data-state":kd(o.checked),"data-disabled":o.disabled?"":void 0,...n,ref:t})});jd.displayName=Pd;var Iy="SwitchBubbleInput",Nd=c.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...o},a)=>{const i=c.useRef(null),l=se(i,a),d=da(r),u=ia(t);return c.useEffect(()=>{const f=i.current;if(!f)return;const p=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(p,"checked").set;if(d!==r&&m){const b=new Event("click",{bubbles:n});m.call(f,r),f.dispatchEvent(b)}},[d,r,n]),s.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...o,tabIndex:-1,ref:l,style:{...o.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Nd.displayName=Iy;function kd(e){return e?"checked":"unchecked"}var My=Rd,Oy=jd;function Dy({className:e,...t}){return s.jsx(My,{"data-slot":"switch",className:j("qodo qodo-switch peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:data-[state=checked]:bg-primary dark:data-[state=unchecked]:bg-input",e),...t,children:s.jsx(Oy,{"data-slot":"switch-thumb",className:j("bg-background pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground")})})}var Td="Toggle",Ra=c.forwardRef((e,t)=>{const{pressed:r,defaultPressed:n,onPressedChange:o,...a}=e,[i,l]=ye({prop:r,onChange:o,defaultProp:n??!1,caller:Td});return s.jsx(H.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":e.disabled?"":void 0,...a,ref:t,onClick:F(e.onClick,()=>{e.disabled||l(!i)})})});Ra.displayName=Td;var $y=Ra;const Ad=wn("qodo qodo-toggle inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium text-foreground hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap dark:text-foreground dark:hover:bg-muted dark:hover:text-muted-foreground dark:data-[state=on]:bg-accent dark:data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent text-foreground dark:bg-transparent dark:text-foreground",outline:"border border-input bg-transparent text-foreground shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-transparent dark:text-foreground dark:hover:bg-accent dark:hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function Ly({className:e,variant:t,size:r,...n}){return s.jsx($y,{"data-slot":"toggle",className:j(Ad({variant:t,size:r,className:e})),...n})}var yo="rovingFocusGroup.onEntryFocus",Fy={bubbles:!1,cancelable:!0},Ir="RovingFocusGroup",[Go,_d,Vy]=En(Ir),[By,gt]=we(Ir,[Vy]),[Gy,Wy]=By(Ir),Id=c.forwardRef((e,t)=>s.jsx(Go.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(Go.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(zy,{...e,ref:t})})}));Id.displayName=Ir;var zy=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:a,currentTabStopId:i,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:d,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...p}=e,g=c.useRef(null),m=se(t,g),b=Tt(a),[v,h]=ye({prop:i,defaultProp:l??null,onChange:d,caller:Ir}),[y,x]=c.useState(!1),C=De(u),E=_d(r),N=c.useRef(!1),[T,A]=c.useState(0);return c.useEffect(()=>{const P=g.current;if(P)return P.addEventListener(yo,C),()=>P.removeEventListener(yo,C)},[C]),s.jsx(Gy,{scope:r,orientation:n,dir:b,loop:o,currentTabStopId:v,onItemFocus:c.useCallback(P=>h(P),[h]),onItemShiftTab:c.useCallback(()=>x(!0),[]),onFocusableItemAdd:c.useCallback(()=>A(P=>P+1),[]),onFocusableItemRemove:c.useCallback(()=>A(P=>P-1),[]),children:s.jsx(H.div,{tabIndex:y||T===0?-1:0,"data-orientation":n,...p,ref:m,style:{outline:"none",...e.style},onMouseDown:F(e.onMouseDown,()=>{N.current=!0}),onFocus:F(e.onFocus,P=>{const V=!N.current;if(P.target===P.currentTarget&&V&&!y){const U=new CustomEvent(yo,Fy);if(P.currentTarget.dispatchEvent(U),!U.defaultPrevented){const re=E().filter(I=>I.focusable),te=re.find(I=>I.active),Q=re.find(I=>I.id===v),D=[te,Q,...re].filter(Boolean).map(I=>I.ref.current);Dd(D,f)}}N.current=!1}),onBlur:F(e.onBlur,()=>x(!1))})})}),Md="RovingFocusGroupItem",Od=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:a,children:i,...l}=e,d=me(),u=a||d,f=Wy(Md,r),p=f.currentTabStopId===u,g=_d(r),{onFocusableItemAdd:m,onFocusableItemRemove:b,currentTabStopId:v}=f;return c.useEffect(()=>{if(n)return m(),()=>b()},[n,m,b]),s.jsx(Go.ItemSlot,{scope:r,id:u,focusable:n,active:o,children:s.jsx(H.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...l,ref:t,onMouseDown:F(e.onMouseDown,h=>{n?f.onItemFocus(u):h.preventDefault()}),onFocus:F(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:F(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){f.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const y=Hy(h,f.orientation,f.dir);if(y!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let C=g().filter(E=>E.focusable).map(E=>E.ref.current);if(y==="last")C.reverse();else if(y==="prev"||y==="next"){y==="prev"&&C.reverse();const E=C.indexOf(h.currentTarget);C=f.loop?Ky(C,E+1):C.slice(E+1)}setTimeout(()=>Dd(C))}}),children:typeof i=="function"?i({isCurrentTabStop:p,hasTabStop:v!=null}):i})})});Od.displayName=Md;var qy={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Uy(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Hy(e,t,r){const n=Uy(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return qy[n]}function Dd(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function Ky(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Bn=Id,Gn=Od,vt="ToggleGroup",[$d,cP]=we(vt,[gt]),Ld=gt(),Pa=S.forwardRef((e,t)=>{const{type:r,...n}=e;if(r==="single"){const o=n;return s.jsx(Yy,{...o,ref:t})}if(r==="multiple"){const o=n;return s.jsx(Xy,{...o,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${vt}\``)});Pa.displayName=vt;var[Fd,Vd]=$d(vt),Yy=S.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:o=()=>{},...a}=e,[i,l]=ye({prop:r,defaultProp:n??"",onChange:o,caller:vt});return s.jsx(Fd,{scope:e.__scopeToggleGroup,type:"single",value:S.useMemo(()=>i?[i]:[],[i]),onItemActivate:l,onItemDeactivate:S.useCallback(()=>l(""),[l]),children:s.jsx(Bd,{...a,ref:t})})}),Xy=S.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:o=()=>{},...a}=e,[i,l]=ye({prop:r,defaultProp:n??[],onChange:o,caller:vt}),d=S.useCallback(f=>l((p=[])=>[...p,f]),[l]),u=S.useCallback(f=>l((p=[])=>p.filter(g=>g!==f)),[l]);return s.jsx(Fd,{scope:e.__scopeToggleGroup,type:"multiple",value:i,onItemActivate:d,onItemDeactivate:u,children:s.jsx(Bd,{...a,ref:t})})});Pa.displayName=vt;var[Zy,Jy]=$d(vt),Bd=S.forwardRef((e,t)=>{const{__scopeToggleGroup:r,disabled:n=!1,rovingFocus:o=!0,orientation:a,dir:i,loop:l=!0,...d}=e,u=Ld(r),f=Tt(i),p={role:"group",dir:f,...d};return s.jsx(Zy,{scope:r,rovingFocus:o,disabled:n,children:o?s.jsx(Bn,{asChild:!0,...u,orientation:a,dir:f,loop:l,children:s.jsx(H.div,{...p,ref:t})}):s.jsx(H.div,{...p,ref:t})})}),fn="ToggleGroupItem",Gd=S.forwardRef((e,t)=>{const r=Vd(fn,e.__scopeToggleGroup),n=Jy(fn,e.__scopeToggleGroup),o=Ld(e.__scopeToggleGroup),a=r.value.includes(e.value),i=n.disabled||e.disabled,l={...e,pressed:a,disabled:i},d=S.useRef(null);return n.rovingFocus?s.jsx(Gn,{asChild:!0,...o,focusable:!i,active:a,ref:d,children:s.jsx(ri,{...l,ref:t})}):s.jsx(ri,{...l,ref:t})});Gd.displayName=fn;var ri=S.forwardRef((e,t)=>{const{__scopeToggleGroup:r,value:n,...o}=e,a=Vd(fn,r),i={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},l=a.type==="single"?i:void 0;return s.jsx(Ra,{...l,...o,ref:t,onPressedChange:d=>{d?a.onItemActivate(n):a.onItemDeactivate(n)}})}),Qy=Pa,ew=Gd;const Wd=c.createContext({size:"default",variant:"default"});function tw({className:e,variant:t,size:r,children:n,...o}){return s.jsx(Qy,{"data-slot":"toggle-group","data-variant":t,"data-size":r,className:j("qodo qodo-toggle-group group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs dark:data-[variant=outline]:shadow-xs",e),...o,children:s.jsx(Wd.Provider,{value:{variant:t,size:r},children:n})})}function rw({className:e,children:t,variant:r,size:n,...o}){const a=c.useContext(Wd);return s.jsx(ew,{"data-slot":"toggle-group-item","data-variant":a.variant||r,"data-size":a.size||n,className:j(Ad({variant:a.variant||r,size:a.size||n}),"qodo qodo-toggle-group-item min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",e),...o,children:t})}var Wn="Collapsible",[nw,zd]=we(Wn),[ow,ja]=nw(Wn),qd=c.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:o,disabled:a,onOpenChange:i,...l}=e,[d,u]=ye({prop:n,defaultProp:o??!1,onChange:i,caller:Wn});return s.jsx(ow,{scope:r,disabled:a,contentId:me(),open:d,onOpenToggle:c.useCallback(()=>u(f=>!f),[u]),children:s.jsx(H.div,{"data-state":ka(d),"data-disabled":a?"":void 0,...l,ref:t})})});qd.displayName=Wn;var Ud="CollapsibleTrigger",Hd=c.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,o=ja(Ud,r);return s.jsx(H.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":ka(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:t,onClick:F(e.onClick,o.onOpenToggle)})});Hd.displayName=Ud;var Na="CollapsibleContent",Kd=c.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=ja(Na,e.__scopeCollapsible);return s.jsx(Re,{present:r||o.open,children:({present:a})=>s.jsx(aw,{...n,ref:t,present:a})})});Kd.displayName=Na;var aw=c.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:o,...a}=e,i=ja(Na,r),[l,d]=c.useState(n),u=c.useRef(null),f=se(t,u),p=c.useRef(0),g=p.current,m=c.useRef(0),b=m.current,v=i.open||l,h=c.useRef(v),y=c.useRef(void 0);return c.useEffect(()=>{const x=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(x)},[]),be(()=>{const x=u.current;if(x){y.current=y.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const C=x.getBoundingClientRect();p.current=C.height,m.current=C.width,h.current||(x.style.transitionDuration=y.current.transitionDuration,x.style.animationName=y.current.animationName),d(n)}},[i.open,n]),s.jsx(H.div,{"data-state":ka(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!v,...a,ref:f,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:v&&o})});function ka(e){return e?"open":"closed"}var sw=qd,iw=Hd,lw=Kd,Ve="Accordion",cw=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Ta,dw,uw]=En(Ve),[zn,dP]=we(Ve,[uw,zd]),Aa=zd(),Yd=S.forwardRef((e,t)=>{const{type:r,...n}=e,o=n,a=n;return s.jsx(Ta.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?s.jsx(gw,{...a,ref:t}):s.jsx(mw,{...o,ref:t})})});Yd.displayName=Ve;var[Xd,fw]=zn(Ve),[Zd,pw]=zn(Ve,{collapsible:!1}),mw=S.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:o=()=>{},collapsible:a=!1,...i}=e,[l,d]=ye({prop:r,defaultProp:n??"",onChange:o,caller:Ve});return s.jsx(Xd,{scope:e.__scopeAccordion,value:S.useMemo(()=>l?[l]:[],[l]),onItemOpen:d,onItemClose:S.useCallback(()=>a&&d(""),[a,d]),children:s.jsx(Zd,{scope:e.__scopeAccordion,collapsible:a,children:s.jsx(Jd,{...i,ref:t})})})}),gw=S.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:o=()=>{},...a}=e,[i,l]=ye({prop:r,defaultProp:n??[],onChange:o,caller:Ve}),d=S.useCallback(f=>l((p=[])=>[...p,f]),[l]),u=S.useCallback(f=>l((p=[])=>p.filter(g=>g!==f)),[l]);return s.jsx(Xd,{scope:e.__scopeAccordion,value:i,onItemOpen:d,onItemClose:u,children:s.jsx(Zd,{scope:e.__scopeAccordion,collapsible:!0,children:s.jsx(Jd,{...a,ref:t})})})}),[vw,qn]=zn(Ve),Jd=S.forwardRef((e,t)=>{const{__scopeAccordion:r,disabled:n,dir:o,orientation:a="vertical",...i}=e,l=S.useRef(null),d=se(l,t),u=dw(r),p=Tt(o)==="ltr",g=F(e.onKeyDown,m=>{var P;if(!cw.includes(m.key))return;const b=m.target,v=u().filter(V=>{var U;return!((U=V.ref.current)!=null&&U.disabled)}),h=v.findIndex(V=>V.ref.current===b),y=v.length;if(h===-1)return;m.preventDefault();let x=h;const C=0,E=y-1,N=()=>{x=h+1,x>E&&(x=C)},T=()=>{x=h-1,x<C&&(x=E)};switch(m.key){case"Home":x=C;break;case"End":x=E;break;case"ArrowRight":a==="horizontal"&&(p?N():T());break;case"ArrowDown":a==="vertical"&&N();break;case"ArrowLeft":a==="horizontal"&&(p?T():N());break;case"ArrowUp":a==="vertical"&&T();break}const A=x%y;(P=v[A].ref.current)==null||P.focus()});return s.jsx(vw,{scope:r,disabled:n,direction:o,orientation:a,children:s.jsx(Ta.Slot,{scope:r,children:s.jsx(H.div,{...i,"data-orientation":a,ref:d,onKeyDown:n?void 0:g})})})}),pn="AccordionItem",[hw,_a]=zn(pn),Qd=S.forwardRef((e,t)=>{const{__scopeAccordion:r,value:n,...o}=e,a=qn(pn,r),i=fw(pn,r),l=Aa(r),d=me(),u=n&&i.value.includes(n)||!1,f=a.disabled||e.disabled;return s.jsx(hw,{scope:r,open:u,disabled:f,triggerId:d,children:s.jsx(sw,{"data-orientation":a.orientation,"data-state":au(u),...l,...o,ref:t,disabled:f,open:u,onOpenChange:p=>{p?i.onItemOpen(n):i.onItemClose(n)}})})});Qd.displayName=pn;var eu="AccordionHeader",tu=S.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,o=qn(Ve,r),a=_a(eu,r);return s.jsx(H.h3,{"data-orientation":o.orientation,"data-state":au(a.open),"data-disabled":a.disabled?"":void 0,...n,ref:t})});tu.displayName=eu;var Wo="AccordionTrigger",ru=S.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,o=qn(Ve,r),a=_a(Wo,r),i=pw(Wo,r),l=Aa(r);return s.jsx(Ta.ItemSlot,{scope:r,children:s.jsx(iw,{"aria-disabled":a.open&&!i.collapsible||void 0,"data-orientation":o.orientation,id:a.triggerId,...l,...n,ref:t})})});ru.displayName=Wo;var nu="AccordionContent",ou=S.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,o=qn(Ve,r),a=_a(nu,r),i=Aa(r);return s.jsx(lw,{role:"region","aria-labelledby":a.triggerId,"data-orientation":o.orientation,...i,...n,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});ou.displayName=nu;function au(e){return e?"open":"closed"}var xw=Yd,bw=Qd,yw=tu,ww=ru,Cw=ou;function Sw({...e}){return s.jsx(xw,{"data-slot":"accordion",...e})}function Ew({className:e,...t}){return s.jsx(bw,{"data-slot":"accordion-item",className:j("qodo qodo-accordion-item border-b last:border-b-0 dark:border-border",e),...t})}function Rw({className:e,children:t,...r}){return s.jsx(yw,{className:"flex",children:s.jsxs(ww,{"data-slot":"accordion-trigger",className:j("qodo qodo-accordion-trigger focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium text-foreground transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180 dark:text-foreground dark:focus-visible:border-ring dark:focus-visible:ring-ring/50",e),...r,children:[t,s.jsx(Cn,{className:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200 dark:text-muted-foreground"})]})})}function Pw({className:e,children:t,...r}){return s.jsx(Cw,{"data-slot":"accordion-content",className:j("qodo qodo-accordion-content","data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm text-foreground dark:text-foreground"),...r,children:s.jsx("div",{className:j("pt-0 pb-4",e),children:t})})}var Un="Tabs",[jw,uP]=we(Un,[gt]),su=gt(),[Nw,Ia]=jw(Un),iu=c.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:a,orientation:i="horizontal",dir:l,activationMode:d="automatic",...u}=e,f=Tt(l),[p,g]=ye({prop:n,onChange:o,defaultProp:a??"",caller:Un});return s.jsx(Nw,{scope:r,baseId:me(),value:p,onValueChange:g,orientation:i,dir:f,activationMode:d,children:s.jsx(H.div,{dir:f,"data-orientation":i,...u,ref:t})})});iu.displayName=Un;var lu="TabsList",cu=c.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...o}=e,a=Ia(lu,r),i=su(r);return s.jsx(Bn,{asChild:!0,...i,orientation:a.orientation,dir:a.dir,loop:n,children:s.jsx(H.div,{role:"tablist","aria-orientation":a.orientation,...o,ref:t})})});cu.displayName=lu;var du="TabsTrigger",uu=c.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...a}=e,i=Ia(du,r),l=su(r),d=mu(i.baseId,n),u=gu(i.baseId,n),f=n===i.value;return s.jsx(Gn,{asChild:!0,...l,focusable:!o,active:f,children:s.jsx(H.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":u,"data-state":f?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:d,...a,ref:t,onMouseDown:F(e.onMouseDown,p=>{!o&&p.button===0&&p.ctrlKey===!1?i.onValueChange(n):p.preventDefault()}),onKeyDown:F(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&i.onValueChange(n)}),onFocus:F(e.onFocus,()=>{const p=i.activationMode!=="manual";!f&&!o&&p&&i.onValueChange(n)})})})});uu.displayName=du;var fu="TabsContent",pu=c.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:o,children:a,...i}=e,l=Ia(fu,r),d=mu(l.baseId,n),u=gu(l.baseId,n),f=n===l.value,p=c.useRef(f);return c.useEffect(()=>{const g=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(g)},[]),s.jsx(Re,{present:o||f,children:({present:g})=>s.jsx(H.div,{"data-state":f?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":d,hidden:!g,id:u,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:g&&a})})});pu.displayName=fu;function mu(e,t){return`${e}-trigger-${t}`}function gu(e,t){return`${e}-content-${t}`}var kw=iu,Tw=cu,Aw=uu,_w=pu;function Iw({className:e,...t}){return s.jsx(kw,{"data-slot":"tabs",className:j("qodo qodo-tabs flex flex-col gap-2",e),...t})}function Mw({className:e,...t}){return s.jsx(Tw,{"data-slot":"tabs-list",className:j("inline-flex w-full items-end justify-start gap-4",e),...t})}function Ow({className:e,...t}){return s.jsx(Aw,{"data-slot":"tabs-trigger",className:j("text-[var(--text-interactive-neutral-idle)] hover:text-[var(--text-interactive-neutral-hover)] data-[state=active]:text-[var(--text-interactive-emphasis-active)] focus-visible:ring-ring/50 focus-visible:outline-ring inline-flex items-center justify-center gap-1.5 border-b border-transparent py-4 text-xs font-normal whitespace-nowrap transition-[color,border-color] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed data-[state=active]:border-[var(--color-purple-400)] relative -mb-px tracking-[0.01em] leading-[150%] cursor-pointer [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function Dw({className:e,...t}){return s.jsx(_w,{"data-slot":"tabs-content",className:j("flex-1 outline-none",e),...t})}var $w=e=>e.type==="checkbox",fr=e=>e instanceof Date,Ma=e=>e==null;const vu=e=>typeof e=="object";var kt=e=>!Ma(e)&&!Array.isArray(e)&&vu(e)&&!fr(e),Lw=e=>kt(e)&&e.target?$w(e.target)?e.target.checked:e.target.value:e,Fw=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Vw=(e,t)=>e.has(Fw(t)),Bw=e=>{const t=e.constructor&&e.constructor.prototype;return kt(t)&&t.hasOwnProperty("isPrototypeOf")},Gw=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function hu(e){let t;const r=Array.isArray(e),n=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(Gw&&(e instanceof Blob||n))&&(r||kt(e)))if(t=r?[]:Object.create(Object.getPrototypeOf(e)),!r&&!Bw(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=hu(e[o]));else return e;return t}var xu=e=>/^\w*$/.test(e),zo=e=>e===void 0,Ww=e=>Array.isArray(e)?e.filter(Boolean):[],bu=e=>Ww(e.replace(/["|']|\]/g,"").split(/\.|\[/)),je=(e,t,r)=>{if(!t||!kt(e))return r;const n=(xu(t)?[t]:bu(t)).reduce((o,a)=>Ma(o)?o:o[a],e);return zo(n)||n===e?zo(e[t])?r:e[t]:n},wo=e=>typeof e=="boolean",ni=(e,t,r)=>{let n=-1;const o=xu(t)?[t]:bu(t),a=o.length,i=a-1;for(;++n<a;){const l=o[n];let d=r;if(n!==i){const u=e[l];d=kt(u)||Array.isArray(u)?u:isNaN(+o[n+1])?{}:[]}if(l==="__proto__"||l==="constructor"||l==="prototype")return;e[l]=d,e=e[l]}};const oi={BLUR:"blur",CHANGE:"change"},ai={all:"all"},Oa=S.createContext(null);Oa.displayName="HookFormContext";const or=()=>S.useContext(Oa),zw=e=>{const{children:t,...r}=e;return S.createElement(Oa.Provider,{value:r},t)};var qw=(e,t,r,n=!0)=>{const o={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(o,a,{get:()=>{const i=a;return t._proxyFormState[i]!==ai.all&&(t._proxyFormState[i]=!n||ai.all),r&&(r[i]=!0),e[i]}});return o};const yu=typeof window<"u"?S.useLayoutEffect:S.useEffect;function wu(e){const t=or(),{control:r=t.control,disabled:n,name:o,exact:a}=e||{},[i,l]=S.useState(r._formState),d=S.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return yu(()=>r._subscribe({name:o,formState:d.current,exact:a,callback:u=>{!n&&l({...r._formState,...u})}}),[o,n,a]),S.useEffect(()=>{d.current.isValid&&r._setValid(!0)},[r]),S.useMemo(()=>qw(i,r,d.current,!1),[i,r])}var Uw=e=>typeof e=="string",Hw=(e,t,r,n,o)=>Uw(e)?je(r,e,o):Array.isArray(e)?e.map(a=>je(r,a)):r,si=e=>Ma(e)||!vu(e);function Cu(e,t,r=new WeakSet){if(si(e)||si(t))return e===t;if(fr(e)&&fr(t))return e.getTime()===t.getTime();const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const a of n){const i=e[a];if(!o.includes(a))return!1;if(a!=="ref"){const l=t[a];if(fr(i)&&fr(l)||kt(i)&&kt(l)||Array.isArray(i)&&Array.isArray(l)?!Cu(i,l,r):i!==l)return!1}}return!0}function Kw(e){const t=or(),{control:r=t.control,name:n,defaultValue:o,disabled:a,exact:i,compute:l}=e||{},d=S.useRef(o),u=S.useRef(l),f=S.useRef(void 0);u.current=l;const p=S.useMemo(()=>r._getWatch(n,d.current),[r,n]),[g,m]=S.useState(u.current?u.current(p):p);return yu(()=>r._subscribe({name:n,formState:{values:!0},exact:i,callback:b=>{if(!a){const v=Hw(n,r._names,b.values||r._formValues,!1,d.current);if(u.current){const h=u.current(v);Cu(h,f.current)||(m(h),f.current=h)}else m(v)}}}),[r,a,n,i]),S.useEffect(()=>r._removeUnmounted()),g}function Yw(e){const t=or(),{name:r,disabled:n,control:o=t.control,shouldUnregister:a,defaultValue:i}=e,l=Vw(o._names.array,r),d=S.useMemo(()=>je(o._formValues,r,je(o._defaultValues,r,i)),[o,r,i]),u=Kw({control:o,name:r,defaultValue:d,exact:!0}),f=wu({control:o,name:r,exact:!0}),p=S.useRef(e),g=S.useRef(o.register(r,{...e.rules,value:u,...wo(e.disabled)?{disabled:e.disabled}:{}}));p.current=e;const m=S.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!je(f.errors,r)},isDirty:{enumerable:!0,get:()=>!!je(f.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!je(f.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!je(f.validatingFields,r)},error:{enumerable:!0,get:()=>je(f.errors,r)}}),[f,r]),b=S.useCallback(x=>g.current.onChange({target:{value:Lw(x),name:r},type:oi.CHANGE}),[r]),v=S.useCallback(()=>g.current.onBlur({target:{value:je(o._formValues,r),name:r},type:oi.BLUR}),[r,o._formValues]),h=S.useCallback(x=>{const C=je(o._fields,r);C&&x&&(C._f.ref={focus:()=>x.focus&&x.focus(),select:()=>x.select&&x.select(),setCustomValidity:E=>x.setCustomValidity(E),reportValidity:()=>x.reportValidity()})},[o._fields,r]),y=S.useMemo(()=>({name:r,value:u,...wo(n)||f.disabled?{disabled:f.disabled||n}:{},onChange:b,onBlur:v,ref:h}),[r,n,f.disabled,b,v,h,u]);return S.useEffect(()=>{const x=o._options.shouldUnregister||a;o.register(r,{...p.current.rules,...wo(p.current.disabled)?{disabled:p.current.disabled}:{}});const C=(E,N)=>{const T=je(o._fields,E);T&&T._f&&(T._f.mount=N)};if(C(r,!0),x){const E=hu(je(o._options.defaultValues,r));ni(o._defaultValues,r,E),zo(je(o._formValues,r))&&ni(o._formValues,r,E)}return!l&&o.register(r),()=>{(l?x&&!o._state.action:x)?o.unregister(r):C(r,!1)}},[r,o,l,a]),S.useEffect(()=>{o._setDisabledField({disabled:n,name:r})},[n,r,o]),S.useMemo(()=>({field:y,formState:f,fieldState:m}),[y,f,m])}const Su=e=>e.render(Yw(e)),Eu=S.createContext(void 0),Ru=e=>{const{methods:t,disabled:r,readOnly:n,children:o}=e;return s.jsx(Eu.Provider,{value:{disabled:r,readOnly:n},children:s.jsx(zw,{...t,children:o})})},Pu=()=>{const e=S.useContext(Eu),t=or();if(!e||!t)throw new Error("formContext must be used within a FormProvider");return{...e,...t}},Xw=({type:e="button",...t})=>{const r=()=>e==="submit"||e==="reset"?"default":"outline";return s.jsx(Qe,{type:e,variant:r(),...t})};var ju={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ii=S.createContext&&S.createContext(ju),Zw=["attr","size","title"];function Jw(e,t){if(e==null)return{};var r=Qw(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Qw(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function mn(){return mn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mn.apply(this,arguments)}function li(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function gn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?li(Object(r),!0).forEach(function(n){e0(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):li(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function e0(e,t,r){return t=t0(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t0(e){var t=r0(e,"string");return typeof t=="symbol"?t:t+""}function r0(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Nu(e){return e&&e.map((t,r)=>S.createElement(t.tag,gn({key:r},t.attr),Nu(t.child)))}function ku(e){return t=>S.createElement(n0,mn({attr:gn({},e.attr)},t),Nu(e.child))}function n0(e){var t=r=>{var{attr:n,size:o,title:a}=e,i=Jw(e,Zw),l=o||r.size||"1em",d;return r.className&&(d=r.className),e.className&&(d=(d?d+" ":"")+e.className),S.createElement("svg",mn({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,i,{className:d,style:gn(gn({color:e.color||r.color},r.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),a&&S.createElement("title",null,a),e.children)};return ii!==void 0?S.createElement(ii.Consumer,null,r=>t(r)):t(ju)}function o0(e){return ku({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Circle_Info"},child:[{tag:"g",attr:{},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M11.5,15a.5.5,0,0,0,1,0h0V10.981a.5.5,0,0,0-1,0Z"},child:[]},{tag:"circle",attr:{cx:"12",cy:"8.999",r:"0.5"},child:[]}]},{tag:"path",attr:{d:"M12,2.065A9.934,9.934,0,1,1,2.066,12,9.945,9.945,0,0,1,12,2.065Zm0,18.867A8.934,8.934,0,1,0,3.066,12,8.944,8.944,0,0,0,12,20.932Z"},child:[]}]}]}]})(e)}var a0="Label",Tu=c.forwardRef((e,t)=>s.jsx(H.label,{...e,ref:t,onMouseDown:r=>{var o;r.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Tu.displayName=a0;var s0=Tu;function Au({className:e,...t}){return s.jsx(s0,{"data-slot":"label",className:j("qodo qodo-label flex items-center text-purple-muted-300 gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}const _u=c.createContext({}),i0=({...e})=>s.jsx(_u.Provider,{value:{name:e.name},children:s.jsx(Su,{...e})}),Hn=()=>{const e=c.useContext(_u),t=c.useContext(Iu),{getFieldState:r}=or(),n=wu({name:e.name}),o=r(e.name,n);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:a}=t;return{id:a,name:e.name,formItemId:`${a}-form-item`,formDescriptionId:`${a}-form-item-description`,formMessageId:`${a}-form-item-message`,...o}},Iu=c.createContext({});function l0({className:e,...t}){const r=c.useId();return s.jsx(Iu.Provider,{value:{id:r},children:s.jsx("div",{"data-slot":"form-item",className:j("qodo qodo-form-item grid gap-2",e),...t})})}function c0({className:e,...t}){const{formItemId:r}=Hn();return s.jsx(Au,{"data-slot":"form-label",className:j("data-[error=true]:text-destructive font-normal text-sm",e),htmlFor:r,...t})}function d0({...e}){const{error:t,formItemId:r,formDescriptionId:n,formMessageId:o}=Hn();return s.jsx(Qg,{"data-slot":"form-control",id:r,"aria-describedby":t?`${n} ${o}`:`${n}`,"aria-invalid":!!t,...e})}function u0({className:e,...t}){const{formDescriptionId:r}=Hn();return s.jsx("p",{"data-slot":"form-description",id:r,className:j("text-purple-muted-300 text-sm",e),...t})}function f0({className:e,...t}){const{error:r,formMessageId:n}=Hn(),o=r?String((r==null?void 0:r.message)??""):t.children;return o?s.jsx("p",{"data-slot":"form-message",id:n,className:j("text-destructive text-sm",e),...t,children:o}):null}var[Kn,fP]=we("Tooltip",[ut]),Yn=ut(),Mu="TooltipProvider",p0=700,qo="tooltip.open",[m0,Da]=Kn(Mu),Ou=e=>{const{__scopeTooltip:t,delayDuration:r=p0,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:a}=e,i=c.useRef(!0),l=c.useRef(!1),d=c.useRef(0);return c.useEffect(()=>{const u=d.current;return()=>window.clearTimeout(u)},[]),s.jsx(m0,{scope:t,isOpenDelayedRef:i,delayDuration:r,onOpen:c.useCallback(()=>{window.clearTimeout(d.current),i.current=!1},[]),onClose:c.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>i.current=!0,n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:c.useCallback(u=>{l.current=u},[]),disableHoverableContent:o,children:a})};Ou.displayName=Mu;var yr="Tooltip",[g0,Mr]=Kn(yr),Du=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o,onOpenChange:a,disableHoverableContent:i,delayDuration:l}=e,d=Da(yr,e.__scopeTooltip),u=Yn(t),[f,p]=c.useState(null),g=me(),m=c.useRef(0),b=i??d.disableHoverableContent,v=l??d.delayDuration,h=c.useRef(!1),[y,x]=ye({prop:n,defaultProp:o??!1,onChange:A=>{A?(d.onOpen(),document.dispatchEvent(new CustomEvent(qo))):d.onClose(),a==null||a(A)},caller:yr}),C=c.useMemo(()=>y?h.current?"delayed-open":"instant-open":"closed",[y]),E=c.useCallback(()=>{window.clearTimeout(m.current),m.current=0,h.current=!1,x(!0)},[x]),N=c.useCallback(()=>{window.clearTimeout(m.current),m.current=0,x(!1)},[x]),T=c.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{h.current=!0,x(!0),m.current=0},v)},[v,x]);return c.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),s.jsx(Nr,{...u,children:s.jsx(g0,{scope:t,contentId:g,open:y,stateAttribute:C,trigger:f,onTriggerChange:p,onTriggerEnter:c.useCallback(()=>{d.isOpenDelayedRef.current?T():E()},[d.isOpenDelayedRef,T,E]),onTriggerLeave:c.useCallback(()=>{b?N():(window.clearTimeout(m.current),m.current=0)},[N,b]),onOpen:E,onClose:N,disableHoverableContent:b,children:r})})};Du.displayName=yr;var Uo="TooltipTrigger",$u=c.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Mr(Uo,r),a=Da(Uo,r),i=Yn(r),l=c.useRef(null),d=se(t,l,o.onTriggerChange),u=c.useRef(!1),f=c.useRef(!1),p=c.useCallback(()=>u.current=!1,[]);return c.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),s.jsx(kr,{asChild:!0,...i,children:s.jsx(H.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:d,onPointerMove:F(e.onPointerMove,g=>{g.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:F(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:F(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:F(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:F(e.onBlur,o.onClose),onClick:F(e.onClick,o.onClose)})})});$u.displayName=Uo;var $a="TooltipPortal",[v0,h0]=Kn($a,{forceMount:void 0}),Lu=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:o}=e,a=Mr($a,t);return s.jsx(v0,{scope:t,forceMount:r,children:s.jsx(Re,{present:r||a.open,children:s.jsx(rr,{asChild:!0,container:o,children:n})})})};Lu.displayName=$a;var Xt="TooltipContent",Fu=c.forwardRef((e,t)=>{const r=h0(Xt,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...a}=e,i=Mr(Xt,e.__scopeTooltip);return s.jsx(Re,{present:n||i.open,children:i.disableHoverableContent?s.jsx(Vu,{side:o,...a,ref:t}):s.jsx(x0,{side:o,...a,ref:t})})}),x0=c.forwardRef((e,t)=>{const r=Mr(Xt,e.__scopeTooltip),n=Da(Xt,e.__scopeTooltip),o=c.useRef(null),a=se(t,o),[i,l]=c.useState(null),{trigger:d,onClose:u}=r,f=o.current,{onPointerInTransitChange:p}=n,g=c.useCallback(()=>{l(null),p(!1)},[p]),m=c.useCallback((b,v)=>{const h=b.currentTarget,y={x:b.clientX,y:b.clientY},x=C0(y,h.getBoundingClientRect()),C=S0(y,x),E=E0(v.getBoundingClientRect()),N=P0([...C,...E]);l(N),p(!0)},[p]);return c.useEffect(()=>()=>g(),[g]),c.useEffect(()=>{if(d&&f){const b=h=>m(h,f),v=h=>m(h,d);return d.addEventListener("pointerleave",b),f.addEventListener("pointerleave",v),()=>{d.removeEventListener("pointerleave",b),f.removeEventListener("pointerleave",v)}}},[d,f,m,g]),c.useEffect(()=>{if(i){const b=v=>{const h=v.target,y={x:v.clientX,y:v.clientY},x=(d==null?void 0:d.contains(h))||(f==null?void 0:f.contains(h)),C=!R0(y,i);x?g():C&&(g(),u())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[d,f,i,u,g]),s.jsx(Vu,{...e,ref:a})}),[b0,y0]=Kn(yr,{isInside:!1}),w0=tv("TooltipContent"),Vu=c.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:i,...l}=e,d=Mr(Xt,r),u=Yn(r),{onClose:f}=d;return c.useEffect(()=>(document.addEventListener(qo,f),()=>document.removeEventListener(qo,f)),[f]),c.useEffect(()=>{if(d.trigger){const p=g=>{const m=g.target;m!=null&&m.contains(d.trigger)&&f()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[d.trigger,f]),s.jsx(Qt,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:p=>p.preventDefault(),onDismiss:f,children:s.jsxs(Tn,{"data-state":d.stateAttribute,...u,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[s.jsx(w0,{children:n}),s.jsx(b0,{scope:r,isInside:!0,children:s.jsx(Hh,{id:d.contentId,role:"tooltip",children:o||n})})]})})});Fu.displayName=Xt;var Bu="TooltipArrow",Gu=c.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Yn(r);return y0(Bu,r).isInside?null:s.jsx(An,{...o,...n,ref:t})});Gu.displayName=Bu;function C0(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(r,n,o,a)){case a:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function S0(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function E0(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function R0(e,t){const{x:r,y:n}=e;let o=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){const l=t[a],d=t[i],u=l.x,f=l.y,p=d.x,g=d.y;f>n!=g>n&&r<(p-u)*(n-f)/(g-f)+u&&(o=!o)}return o}function P0(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),j0(t)}function j0(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const a=t[t.length-1],i=t[t.length-2];if((a.x-i.x)*(o.y-i.y)>=(a.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const a=r[r.length-1],i=r[r.length-2];if((a.x-i.x)*(o.y-i.y)>=(a.y-i.y)*(o.x-i.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var N0=Ou,k0=Du,T0=$u,A0=Lu,_0=Fu,I0=Gu;function Wu({delayDuration:e=0,...t}){return s.jsx(N0,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function zu({...e}){return s.jsx(Wu,{children:s.jsx(k0,{"data-slot":"tooltip",...e})})}function qu({...e}){return s.jsx(T0,{"data-slot":"tooltip-trigger",...e})}function Uu({className:e,sideOffset:t=0,children:r,disableArrow:n=!1,...o}){return s.jsx(A0,{children:s.jsxs(_0,{"data-slot":"tooltip-content",sideOffset:t,className:j("qodo qodo-tooltip-content bg-purple-muted-700 border border-purple-muted-600 text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e,{"py-2.5":n}),...o,children:[r,!n&&s.jsx(I0,{className:"bg-purple-muted-700 fill-purple-muted-700 z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const ar=e=>t=>{const{name:r,label:n,description:o,tooltip:a,required:i=!1,...l}=t,{control:d,disabled:u,readOnly:f}=Pu(),p=()=>a?s.jsxs(zu,{children:[s.jsx(qu,{asChild:!0,children:s.jsx("span",{children:s.jsx(o0,{size:16})})}),s.jsx(Uu,{children:s.jsx("p",{children:a})})]}):s.jsx(s.Fragment,{}),g=()=>o?s.jsx(u0,{children:o}):s.jsx(s.Fragment,{});return s.jsx(i0,{control:d,name:r,render:({field:m,fieldState:b})=>s.jsxs(l0,{className:"flex flex-col gap-1.5",children:[n&&s.jsx(c0,{children:s.jsxs("span",{className:"flex items-center gap-1",children:[n,i&&s.jsx("span",{className:"text-purple-muted-300",children:"*"}),!!a&&p()]})}),s.jsx(d0,{children:s.jsx(e,{...m,disabled:u,...l,readOnly:f,error:!!b.error})}),!!o&&g(),s.jsx(f0,{})]})})},M0=S.forwardRef((e,t)=>s.jsx(Rr,{...e,ref:t})),O0=S.forwardRef((e,t)=>ar(M0)({...e,ref:t})),D0=S.forwardRef((e,t)=>{const{options:r=[],onChange:n=()=>{},searchPlaceholder:o,onSearchChange:a,...i}=e,l=d=>{n({target:{value:d}})};return s.jsx(Ca,{ref:t,options:r,onValueChange:l,searchPlaceholder:o,onSearchChange:a,...i})}),$0=ar(D0);var La="Radio",[L0,Hu]=we(La),[F0,V0]=L0(La),Ku=c.forwardRef((e,t)=>{const{__scopeRadio:r,name:n,checked:o=!1,required:a,disabled:i,value:l="on",onCheck:d,form:u,...f}=e,[p,g]=c.useState(null),m=se(t,h=>g(h)),b=c.useRef(!1),v=p?u||!!p.closest("form"):!0;return s.jsxs(F0,{scope:r,checked:o,disabled:i,children:[s.jsx(H.button,{type:"button",role:"radio","aria-checked":o,"data-state":Ju(o),"data-disabled":i?"":void 0,disabled:i,value:l,...f,ref:m,onClick:F(e.onClick,h=>{o||d==null||d(),v&&(b.current=h.isPropagationStopped(),b.current||h.stopPropagation())})}),v&&s.jsx(Zu,{control:p,bubbles:!b.current,name:n,value:l,checked:o,required:a,disabled:i,form:u,style:{transform:"translateX(-100%)"}})]})});Ku.displayName=La;var Yu="RadioIndicator",Xu=c.forwardRef((e,t)=>{const{__scopeRadio:r,forceMount:n,...o}=e,a=V0(Yu,r);return s.jsx(Re,{present:n||a.checked,children:s.jsx(H.span,{"data-state":Ju(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:t})})});Xu.displayName=Yu;var B0="RadioBubbleInput",Zu=c.forwardRef(({__scopeRadio:e,control:t,checked:r,bubbles:n=!0,...o},a)=>{const i=c.useRef(null),l=se(i,a),d=da(r),u=ia(t);return c.useEffect(()=>{const f=i.current;if(!f)return;const p=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(p,"checked").set;if(d!==r&&m){const b=new Event("click",{bubbles:n});m.call(f,r),f.dispatchEvent(b)}},[d,r,n]),s.jsx(H.input,{type:"radio","aria-hidden":!0,defaultChecked:r,...o,tabIndex:-1,ref:l,style:{...o.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Zu.displayName=B0;function Ju(e){return e?"checked":"unchecked"}var G0=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Xn="RadioGroup",[W0,pP]=we(Xn,[gt,Hu]),Qu=gt(),ef=Hu(),[z0,q0]=W0(Xn),tf=c.forwardRef((e,t)=>{const{__scopeRadioGroup:r,name:n,defaultValue:o,value:a,required:i=!1,disabled:l=!1,orientation:d,dir:u,loop:f=!0,onValueChange:p,...g}=e,m=Qu(r),b=Tt(u),[v,h]=ye({prop:a,defaultProp:o??null,onChange:p,caller:Xn});return s.jsx(z0,{scope:r,name:n,required:i,disabled:l,value:v,onValueChange:h,children:s.jsx(Bn,{asChild:!0,...m,orientation:d,dir:b,loop:f,children:s.jsx(H.div,{role:"radiogroup","aria-required":i,"aria-orientation":d,"data-disabled":l?"":void 0,dir:b,...g,ref:t})})})});tf.displayName=Xn;var rf="RadioGroupItem",nf=c.forwardRef((e,t)=>{const{__scopeRadioGroup:r,disabled:n,...o}=e,a=q0(rf,r),i=a.disabled||n,l=Qu(r),d=ef(r),u=c.useRef(null),f=se(t,u),p=a.value===o.value,g=c.useRef(!1);return c.useEffect(()=>{const m=v=>{G0.includes(v.key)&&(g.current=!0)},b=()=>g.current=!1;return document.addEventListener("keydown",m),document.addEventListener("keyup",b),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keyup",b)}},[]),s.jsx(Gn,{asChild:!0,...l,focusable:!i,active:p,children:s.jsx(Ku,{disabled:i,required:a.required,checked:p,...d,...o,name:a.name,ref:f,onCheck:()=>a.onValueChange(o.value),onKeyDown:F(m=>{m.key==="Enter"&&m.preventDefault()}),onFocus:F(o.onFocus,()=>{var m;g.current&&((m=u.current)==null||m.click())})})})});nf.displayName=rf;var U0="RadioGroupIndicator",of=c.forwardRef((e,t)=>{const{__scopeRadioGroup:r,...n}=e,o=ef(r);return s.jsx(Xu,{...o,...n,ref:t})});of.displayName=U0;var H0=tf,K0=nf,Y0=of;function X0({className:e,...t}){const{readOnly:r,...n}=t;return s.jsx(H0,{"data-slot":"radio-group","data-readonly":r||void 0,disabled:n.disabled||r,className:j("qodo qodo-radio-group grid gap-3 group",e),...n})}function Z0({className:e,...t}){return s.jsx(K0,{"data-slot":"radio-group-item",className:j("qodo qodo-radio-group-item dark:border-purple-muted-200 dark:text-purple-muted-200 focus-visible:border-ring focus-visible:ring-ring/50","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive","aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px]","disabled:cursor-not-allowed disabled:opacity-50","group-data-[readonly]:opacity-100 group-data-[readonly]:cursor-default","mt-[2px] mr-0",e),...t,children:s.jsx(Y0,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:s.jsx(jg,{className:"fill-purple-muted-200 absolute top-1/2 left-1/2 size-3 -translate-x-1/2 -translate-y-1/2"})})})}const Fa=S.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:o,disabled:a=!1,readOnly:i=!1,className:l,direction:d="horizontal",dir:u="ltr",name:f,onChange:p,...g}=e,m=v=>{i||(p==null||p({target:{value:v}}),o==null||o(v))},b=j("qodo qodo-custom-radio-group","flex",{"flex-row gap-6":d==="horizontal","flex-col gap-3":d==="vertical"},l);return s.jsx(X0,{name:f,ref:t,value:r,defaultValue:n,onValueChange:m,disabled:a||i,readOnly:i,className:b,dir:u,...g})});Fa.displayName="BaseRadioGroupComponent";const Va=({value:e="",disabled:t,error:r,name:n="radio",children:o,className:a})=>{const i=`${n}-${e}`;return s.jsxs(Au,{htmlFor:i,className:j("flex items-start p-4 rounded-lg gap-2 transition-all duration-200","font-normal text-purple-muted-200 dark:text-purple-muted-200 leading-5",{"cursor-pointer hover:bg-muted/50":!t,"opacity-50 !cursor-not-allowed hover:!bg-transparent":t,"border border-destructive":r},a),children:[s.jsx(Z0,{value:e,id:i,disabled:t||r}),o]},e)};Va.displayName="RadioGroupItemComponent";const J0=ar(Fa),Q0=e=>s.jsx("hr",{className:"w-full h-px border-purple-muted-500",...e}),eC=({children:e,description:t,className:r})=>s.jsxs("div",{className:j("space-y-1",r),children:[s.jsx("h2",{className:"flex items-center gap-2.5 text-2xl text-white",children:e}),t&&s.jsx("span",{className:"text-sm text-purple-muted-300",children:t})]}),af=S.forwardRef(({direction:e="horizontal",className:t,...r},n)=>{const o=j("flex flex-row gap-6",{"flex-col":e==="vertical"},t);return s.jsx("div",{ref:n,className:o,...r})});af.displayName="FormGroup";function tC({className:e,rows:t,...r}){return s.jsx("textarea",{"data-slot":"textarea",rows:t,className:j("qodo qodo-textarea border-input px-3 py-2 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20","dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex min-h-16 w-full rounded-md border bg-transparent","placeholder:text-purple-muted-400 text-purple-muted-300 shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] selection:bg-primary selection:text-primary-foreground disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-purple-muted-700 disabled:border-purple-muted-500 disabled:text-purple-muted-400 read-only:bg-purple-muted-700 read-only:border-purple-muted-400 read-only:cursor-default read-only:text-purple-muted-200 md:text-sm",{"field-sizing-content":!t},e),...r})}const rC=S.forwardRef((e,t)=>ar(tC)({...e,ref:t})),sf=({label:e,id:t,onRemoveTag:r,disabled:n,className:o,variant:a="default"})=>s.jsxs(Yt,{variant:a,disabled:n,size:"sm",className:j("flex items-center gap-1 px-2 py-0.5","font-normal whitespace-nowrap",o),children:[e,r&&s.jsx(Qe,{type:"button",variant:"ghost",size:"icon",className:"p-0 w-[10px] h-[10px] text-inherit disabled:text-inherit",onClick:i=>{i.stopPropagation(),r==null||r(t)},"aria-label":`Remove ${e}`,disabled:n,children:s.jsx(Sn,{className:"w-[10px] h-[10px]"})})]}),nC=({label:e,id:t,onClick:r,onDeleteSuggestion:n,deleteText:o,className:a,tagClassName:i,tagVariant:l})=>s.jsx("div",{onClick:r,className:j("bg-transparent hover:bg-purple-muted-800 rounded-sm py-1 px-2",a),children:s.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[s.jsx(sf,{label:e,id:t,className:i,variant:l}),n&&s.jsx(Qe,{type:"button",variant:"ghost",className:"p-0 text-xs font-normal h-[10px]",onMouseDown:d=>d.preventDefault(),onClick:d=>{d.stopPropagation(),n==null||n(t)},"aria-label":`${o} ${e}`,children:o||s.jsx(zg,{className:"h-4 w-4"})})]})}),Co={BACKSPACE:"Backspace",ESCAPE:"Escape",ENTER:"Enter"},oC=e=>{if(!e)return"";let t=e.toLowerCase();return t=t.replace(/[_\s]+/g,"-"),t=t.replace(/[^a-z0-9-]/g,""),t=t.replace(/-+/g,"-"),t=t.replace(/^-|-$/g,""),t},lf=({value:e=[],variant:t="default",placeholder:r="Type to add a tag...",deleteText:n="Delete",suggestions:o=[],allowCreate:a=!0,maxTags:i=100,disabled:l=!1,className:d,suggestionWrapperClassName:u,suggestionClassName:f,tagClassName:p,tagInputIcon:g,onDeleteSuggestion:m,onBlur:b,normalizeTags:v=oC,onChange:h=()=>{},onAddTag:y=()=>{},onRemoveTag:x=()=>{},onResetTags:C=()=>{}})=>{const[E,N]=S.useState(""),[T,A]=S.useState(!1),P=S.useRef(null),V=S.useRef(null),U=S.useRef(null),[re,te]=S.useState();S.useEffect(()=>{V.current&&te(V.current.offsetWidth)},[]);const Q=e.length>=i,W=L=>{if(Q||e.some(K=>K.id===L.id))return;const _=[...e,L];h(_),y(L)},D=L=>{const _=e.filter(K=>K.id!==L);h(_),x(L)},I=()=>{h==null||h([]),C()},O=L=>{const _=L.target.value;N(_),A(!0)},R=()=>{const L=E.trim().toLowerCase();if(!L)return[];const _=new Set(e.map(K=>K.id));return o.filter(K=>K.label.toLowerCase().includes(L)&&!_.has(K.id))},M=L=>v?v(L):L,B=()=>{const L=E.trim();if(!L)return;const _=M(L);if(!_)return;if(e.some(ee=>ee.id===_)){N(""),A(!1);return}const K=o.find(ee=>ee.id===_||M(ee.label)===_);K?W(K):a&&W({id:_,label:_}),N(""),A(!1)},J=L=>{const _=L.key===Co.BACKSPACE&&!E&&e.length>0,K=L.key===Co.ENTER&&E,ee=L.key===Co.ESCAPE;K?(L.preventDefault(),B(),U.current&&(U.current.scrollLeft=U.current.scrollWidth)):_?D(e[e.length-1].id):ee&&A(!1)},k=()=>{if(E&&R().length>0)return s.jsx(wa,{className:"p-0 border-transparent bg-[var(--fill-interactive-neutral-idle)] gap-2",align:"start",style:{width:re??void 0},onOpenAutoFocus:L=>L.preventDefault(),onCloseAutoFocus:L=>L.preventDefault(),onMouseDown:L=>L.preventDefault(),children:s.jsx("div",{className:j("max-h-[200px] overflow-y-auto flex flex-col gap-1 p-1",u),children:R().map(L=>s.jsx(nC,{label:L.label,id:L.id,onDeleteSuggestion:m,deleteText:n,className:f,tagClassName:p,tagVariant:t,onClick:()=>{var _;W(L),N(""),A(!1),(_=P.current)==null||_.focus()}},L.id))})})},G=()=>g||s.jsx(Gg,{className:"h-4 w-4 stroke-[var(--icon-bg-neutral-mild)]"}),Z=()=>e.map(L=>s.jsx(sf,{label:L.label,id:L.id,onRemoveTag:D,disabled:l,className:p,variant:t},L.id)),z=()=>e.length===0?s.jsx(s.Fragment,{}):s.jsx(Sn,{className:"h-4 w-4 hover:cursor-pointer stroke-[var(--icon-input-neutral-idle)] hover:stroke-[var(--icon-input-neutral-hover)]",onClick:I});return s.jsx("div",{className:j("w-full",d),children:s.jsxs(ba,{open:T&&!l,onOpenChange:A,modal:!1,children:[s.jsx(ya,{className:"w-full",children:s.jsxs("div",{ref:V,tabIndex:-1,className:j("flex items-center gap-2 border border-[var(--border-tag-neutral-idle)] bg-purple-muted-800 py-0.5 px-3 rounded-md scrollbar-thin",{"opacity-60":l}),onClick:L=>{var _;L.stopPropagation(),A(!0),(_=P.current)==null||_.focus()},children:[G(),s.jsxs("div",{ref:U,className:"flex items-center gap-2 w-full whitespace-normal overflow-x-auto",children:[Z(),s.jsx(Rr,{ref:P,value:E,onChange:O,onClick:L=>L.stopPropagation(),onFocus:()=>A(!0),onBlur:b,onKeyDown:J,placeholder:r,disabled:l||Q,className:j("m-0 h-6.5 flex-1 min-w-[6rem] border-0 bg-transparent dark:bg-transparent p-0 shadow-none focus-visible:outline-none focus-visible:ring-0 font-normal text-xs","placeholder:text-[var(--text-input-neutral-placeholder)] dark:placeholder:text-[var(--text-input-neutral-placeholder)] placeholder:text-xs")})]}),z()]})}),k()]})})};function aC(e){const{control:t}=or();return s.jsx(Su,{name:e.name,control:t,render:({field:r})=>s.jsx(lf,{...e,value:r.value,onChange:r.onChange,onBlur:r.onBlur})})}const sC=ar(aC),iC=12,ci={SINGLE:"single",MULTIPLE:"multiple"},di={LTR:"ltr"};var cf=typeof global=="object"&&global&&global.Object===Object&&global,lC=typeof self=="object"&&self&&self.Object===Object&&self,ht=cf||lC||Function("return this")(),vn=ht.Symbol,df=Object.prototype,cC=df.hasOwnProperty,dC=df.toString,dr=vn?vn.toStringTag:void 0;function uC(e){var t=cC.call(e,dr),r=e[dr];try{e[dr]=void 0;var n=!0}catch{}var o=dC.call(e);return n&&(t?e[dr]=r:delete e[dr]),o}var fC=Object.prototype,pC=fC.toString;function mC(e){return pC.call(e)}var gC="[object Null]",vC="[object Undefined]",ui=vn?vn.toStringTag:void 0;function Or(e){return e==null?e===void 0?vC:gC:ui&&ui in Object(e)?uC(e):mC(e)}function Ba(e){return e!=null&&typeof e=="object"}var hC=Array.isArray;function uf(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var xC="[object AsyncFunction]",bC="[object Function]",yC="[object GeneratorFunction]",wC="[object Proxy]";function ff(e){if(!uf(e))return!1;var t=Or(e);return t==bC||t==yC||t==xC||t==wC}var So=ht["__core-js_shared__"],fi=(function(){var e=/[^.]+$/.exec(So&&So.keys&&So.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function CC(e){return!!fi&&fi in e}var SC=Function.prototype,EC=SC.toString;function _t(e){if(e!=null){try{return EC.call(e)}catch{}try{return e+""}catch{}}return""}var RC=/[\\^$.*+?()[\]{}|]/g,PC=/^\[object .+?Constructor\]$/,jC=Function.prototype,NC=Object.prototype,kC=jC.toString,TC=NC.hasOwnProperty,AC=RegExp("^"+kC.call(TC).replace(RC,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function _C(e){if(!uf(e)||CC(e))return!1;var t=ff(e)?AC:PC;return t.test(_t(e))}function IC(e,t){return e==null?void 0:e[t]}function Dr(e,t){var r=IC(e,t);return _C(r)?r:void 0}var Ho=Dr(ht,"WeakMap"),MC=9007199254740991;function pf(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=MC}function OC(e){return e!=null&&pf(e.length)&&!ff(e)}var DC=Object.prototype;function mf(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||DC;return e===r}var $C="[object Arguments]";function pi(e){return Ba(e)&&Or(e)==$C}var gf=Object.prototype,LC=gf.hasOwnProperty,FC=gf.propertyIsEnumerable,VC=pi((function(){return arguments})())?pi:function(e){return Ba(e)&&LC.call(e,"callee")&&!FC.call(e,"callee")};function BC(){return!1}var vf=typeof exports=="object"&&exports&&!exports.nodeType&&exports,mi=vf&&typeof module=="object"&&module&&!module.nodeType&&module,GC=mi&&mi.exports===vf,gi=GC?ht.Buffer:void 0,WC=gi?gi.isBuffer:void 0,zC=WC||BC,qC="[object Arguments]",UC="[object Array]",HC="[object Boolean]",KC="[object Date]",YC="[object Error]",XC="[object Function]",ZC="[object Map]",JC="[object Number]",QC="[object Object]",e1="[object RegExp]",t1="[object Set]",r1="[object String]",n1="[object WeakMap]",o1="[object ArrayBuffer]",a1="[object DataView]",s1="[object Float32Array]",i1="[object Float64Array]",l1="[object Int8Array]",c1="[object Int16Array]",d1="[object Int32Array]",u1="[object Uint8Array]",f1="[object Uint8ClampedArray]",p1="[object Uint16Array]",m1="[object Uint32Array]",pe={};pe[s1]=pe[i1]=pe[l1]=pe[c1]=pe[d1]=pe[u1]=pe[f1]=pe[p1]=pe[m1]=!0;pe[qC]=pe[UC]=pe[o1]=pe[HC]=pe[a1]=pe[KC]=pe[YC]=pe[XC]=pe[ZC]=pe[JC]=pe[QC]=pe[e1]=pe[t1]=pe[r1]=pe[n1]=!1;function g1(e){return Ba(e)&&pf(e.length)&&!!pe[Or(e)]}function v1(e){return function(t){return e(t)}}var hf=typeof exports=="object"&&exports&&!exports.nodeType&&exports,hr=hf&&typeof module=="object"&&module&&!module.nodeType&&module,h1=hr&&hr.exports===hf,Eo=h1&&cf.process,vi=(function(){try{var e=hr&&hr.require&&hr.require("util").types;return e||Eo&&Eo.binding&&Eo.binding("util")}catch{}})(),hi=vi&&vi.isTypedArray,x1=hi?v1(hi):g1;function b1(e,t){return function(r){return e(t(r))}}var y1=b1(Object.keys,Object),w1=Object.prototype,C1=w1.hasOwnProperty;function S1(e){if(!mf(e))return y1(e);var t=[];for(var r in Object(e))C1.call(e,r)&&r!="constructor"&&t.push(r);return t}var Ko=Dr(ht,"Map"),Yo=Dr(ht,"DataView"),Xo=Dr(ht,"Promise"),Zo=Dr(ht,"Set"),xi="[object Map]",E1="[object Object]",bi="[object Promise]",yi="[object Set]",wi="[object WeakMap]",Ci="[object DataView]",R1=_t(Yo),P1=_t(Ko),j1=_t(Xo),N1=_t(Zo),k1=_t(Ho),Ct=Or;(Yo&&Ct(new Yo(new ArrayBuffer(1)))!=Ci||Ko&&Ct(new Ko)!=xi||Xo&&Ct(Xo.resolve())!=bi||Zo&&Ct(new Zo)!=yi||Ho&&Ct(new Ho)!=wi)&&(Ct=function(e){var t=Or(e),r=t==E1?e.constructor:void 0,n=r?_t(r):"";if(n)switch(n){case R1:return Ci;case P1:return xi;case j1:return bi;case N1:return yi;case k1:return wi}return t});var T1="[object Map]",A1="[object Set]",_1=Object.prototype,I1=_1.hasOwnProperty;function $r(e){if(e==null)return!0;if(OC(e)&&(hC(e)||typeof e=="string"||typeof e.splice=="function"||zC(e)||x1(e)||VC(e)))return!e.length;var t=Ct(e);if(t==T1||t==A1)return!e.size;if(mf(e))return!S1(e).length;for(var r in e)if(I1.call(e,r))return!1;return!0}function Zn(e){return!e.children||e.children.length===0?[e.value]:e.children.flatMap(t=>Zn(t))}function Ga(e){const t=[e.value];return e.children&&e.children.forEach(r=>{t.push(...Ga(r))}),t}function Wa(e,t){return $r(e.children)?!1:Zn(e).every(n=>t.has(n))}function M1(e,t){return $r(e.children)?!1:Zn(e).some(n=>t.has(n))}function xf(e,t){for(const r of e){if(r.value===t)return r;if(r.children){const n=xf(r.children,t);if(n)return n}}return null}function za(e,t){const r=new Map;for(const n of e){const o=t(n);o&&r.set(o[0],o[1]),n.children&&za(n.children,t).forEach((i,l)=>r.set(l,i))}return r}function bf(e,t){e.forEach(r=>{$r(r.children)||(Wa(r,t)?t.add(r.value):t.delete(r.value),r.children&&bf(r.children,t))})}const O1=e=>e?Array.isArray(e)?e:[e]:[],D1=e=>za(e,t=>[t.value,t.label]),$1=e=>za(e,t=>t.icon?[t.value,t.icon]:null);function L1(e,t){Ga(e).forEach(n=>t.delete(n))}function F1(e,t){Ga(e).forEach(n=>t.add(n))}function yf(e,t){const r=new Set(t);return e.flatMap(n=>!$r(n.children)&&n.children?Wa(n,r)?[n.value]:yf(n.children,t):r.has(n.value)?[n.value]:[])}function V1(e){return e&&e>1?e*iC:0}function wf({option:e,selected:t,onSelect:r,nestLevel:n=0,disabled:o=!1,dir:a=di.LTR}){const i=!$r(e.children),l=t.has(e.value),d=`${V1(n)}px`,u=Wa(e,t),p=M1(e,t)&&!u,g=l||u,m=()=>{if(n!==0)return s.jsx(kg,{className:"w-4 text-[var(--text-interactive-neutral-idle)]"})},b=()=>{if(e.icon)return s.jsx("div",{className:"flex-shrink-0 [&>svg]:text-[var(--text-interactive-neutral-idle)]!",children:e.icon})},v=()=>p?s.jsx(Ag,{className:"w-2 h-2 flex-shrink-0 transition-opacity text-[var(--text-interactive-neutral-idle)]"}):s.jsx(Er,{className:j("h-4 w-4 flex-shrink-0 transition-opacity text-[var(--text-interactive-neutral-idle)] opacity-0",{"opacity-100":g})}),h=()=>{if(i)return e.children.map(x=>s.jsx(wf,{option:x,selected:t,onSelect:r,nestLevel:n+1,dir:a},x.value))},y=()=>s.jsxs("div",{className:j("flex items-center w-full gap-2 flex-row",{"flex-row-reverse":a===di.LTR}),style:{paddingLeft:d},children:[s.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[m(),b(),s.jsx("span",{className:"flex-1 text-[var(--text-interactive-neutral-active)]",children:e.label})]}),v()]});return s.jsxs("div",{children:[s.jsx(od,{disabled:e.disabled||o,onSelect:()=>r(e.value,i),className:j("text-[var(--text-interactive-neutral-idle)] hover:text-[var(--text-interactive-neutral-hover)]! cursor-pointer disabled:cursor-not-allowed","focus:text-[var(--text-interactive-neutral-active)] data-[selected=true]:text-[var(--text-interactive-neutral-hover)]!",{"bg-[var(--fill-interactive-neutral-idle)]":g}),children:y()}),h()]})}function B1({value:e,options:t=[],onSelect:r,disabled:n=!1,mode:o=ci.SINGLE,placeholder:a="Select...",inputPlaceholder:i="Search...",emptyState:l="No option found.",triggerClassName:d,triggerWrapperClassName:u,badgeClassName:f,badgeVariant:p="text",searchable:g=!1,toggleIcon:m=s.jsx(Cn,{}),dir:b="ltr",...v}){const[h,y]=S.useState(0),[x,C]=S.useState(!1),E=S.useRef(null),N=o===ci.MULTIPLE,[T,A]=S.useState(e!==void 0?e:N?[]:""),P=O1(T),V=new Set(P);S.useEffect(()=>{E.current&&y(E.current.offsetWidth)},[T]);const U=D1(t),re=$1(t);S.useEffect(()=>{e!==void 0&&A(N?e||[]:e||"")},[e,N]);function te(O,R){if(!N){A(O),r==null||r(O),C(!1);return}A(M=>{const B=Array.isArray(M)?M:[],J=new Set(B),k=xf(t,O);if(!k)return B;R?Q(k,J):W(O,J);const G=Array.from(J);return r==null||r(G),G})}function Q(O,R){Zn(O).every(J=>R.has(J))?L1(O,R):F1(O,R)}function W(O,R){R.has(O)?R.delete(O):R.add(O),bf(t,R)}const D=()=>{const O=yf(t,P);return O.length===0?s.jsx(Yt,{variant:p,size:"md",className:j("text-purple-muted-300",f),children:a}):O.map(M=>{const B=re.get(M),J=U.get(M)||M;return s.jsx(Yt,{variant:p,size:"md",className:j("text-[var(--text-bg-neutral-mid)]",f),children:s.jsxs("div",{className:"flex items-center gap-1",children:[B&&s.jsx("div",{className:"flex-shrink-0",children:B}),s.jsx("span",{children:J})]})},M)})},I=()=>{if(g)return s.jsx(ed,{className:"placeholder:text-[var(--text-bg-neutral-mid)] text-[var(--text-interactive-neutral-active)]",placeholder:i})};return s.jsxs(ba,{open:x,onOpenChange:n?void 0:C,children:[s.jsx(ya,{asChild:!0,disabled:n,children:s.jsxs("div",{className:j("flex items-center gap-1.5 justify-between py-1 px-3 w-[100%] border border-[var(--border-interactive-neutral-idle)] bg-[var(--fill-input-neutral-idle)] rounded-sm scrollbar-thin","aria-invalid:!border-destructive aria-invalid:!ring-destructive/20 dark:aria-invalid:!ring-destructive/40",{"cursor-pointer hover:border-[var(--border-input-neutral-hover)] hover:bg-[var(--fill-input-neutral-hover)]":!n,"cursor-not-allowed opacity-75 ":n},u),ref:E,"aria-disabled":n,...v,children:[s.jsx("div",{className:j("flex justify-start text-start w-[100%] whitespace-nowrap overflow-x-auto gap-1.5",d),children:D()}),s.jsx("div",{className:"[&>svg]:text-[var(--icon-input-neutral-idle)] [&>svg]:hover:text-[var(--icon-input-neutral-hover)] [&>svg]:w-4 [&>svg]:h-4",children:m})]})}),s.jsx(wa,{className:"p-0 border bg-[var(--fill-interactive-neutral-idle)] border-[var(--border-interactive-neutral-idle)] [&>svg]:text-purple-muted-300",style:{width:h??"auto"},children:s.jsxs(Qc,{className:"bg-[var(--fill-interactive-neutral-idle)]",children:[I(),s.jsxs(td,{children:[s.jsx(rd,{children:l}),s.jsx(nd,{children:t.map(O=>s.jsx(wf,{disabled:n,option:O,selected:V,onSelect:te,dir:b},O.value))})]})]})})]})}const Cf=S.forwardRef(e=>{const{options:t,onChange:r,readOnly:n,value:o,disabled:a,mode:i,...l}=e,d=u=>{n||r&&r({target:{value:u}})};return s.jsx(B1,{options:t,value:o,disabled:a,...l,onSelect:d,mode:i})});Cf.displayName="BaseSelectComponent";const G1=ar(Cf),Ie=e=>{const{className:t,disabled:r=!1,readOnly:n=!1,methods:o,onSubmit:a=()=>{},...i}=e,{handleSubmit:l}=o,d=j("qodo qodo-form","flex flex-col gap-6",t);return s.jsx(Ru,{methods:o,disabled:r,readOnly:n,children:s.jsx("form",{className:d,onSubmit:l(a),...i})})};Ie.Button=Xw;Ie.Input=O0;Ie.Select=G1;Ie.Combobox=$0;Ie.RadioGroup=J0;Ie.RadioGroupItem=Va;Ie.Group=af;Ie.Textarea=rC;Ie.Divider=Q0;Ie.Title=eC;Ie.TagsInput=sC;function W1(e){return e==null?[]:Array.isArray(e)?e:[e]}var z1=e=>Array.from(Array(e).keys()),Si=e=>(e==null?void 0:e.constructor.name)==="Array",q1=(e,t)=>{if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!qa(e[r],t[r]))return!1;return!0},qa=(e,t)=>{if(Object.is(e,t))return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(typeof(e==null?void 0:e.isEqual)=="function"&&typeof(t==null?void 0:t.isEqual)=="function")return e.isEqual(t);if(typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();if(Si(e)&&Si(t))return q1(Array.from(e),Array.from(t));if(typeof e!="object"||typeof t!="object")return!1;const r=Object.keys(t??Object.create(null)),n=r.length;for(let o=0;o<n;o++)if(!Reflect.has(e,r[o]))return!1;for(let o=0;o<n;o++){const a=r[o];if(!qa(e[a],t[a]))return!1}return!0},U1=e=>e!=null&&typeof e=="object",nn=e=>typeof e=="string",pr=e=>typeof e=="function",H1=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),K1=e=>Object.prototype.toString.call(e),Sf=Function.prototype.toString,Y1=Sf.call(Object),X1=e=>{if(!U1(e)||K1(e)!="[object Object]"||Q1(e))return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const r=H1(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Sf.call(r)==Y1},Z1=e=>typeof e=="object"&&e!==null&&"$$typeof"in e&&"props"in e,J1=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,Q1=e=>Z1(e)||J1(e),eS=e=>e(),tS=(...e)=>(...t)=>{e.forEach(function(r){r==null||r(...t)})},rS=e=>Number.isNaN(e),nS=e=>rS(e)?0:e,oS=(e,t,r)=>{const n=nS(e),o=n>=t,a=r==null||n<=r;return o&&a};function Ef(e){if(!X1(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(n=>typeof n=="string"),r={};for(const n of t){const o=e[n];o!==void 0&&(r[n]=Ef(o))}return r}function Ei(...e){const t=e.length===1?e[0]:e[1];(e.length===2?e[0]:!0)&&process.env.NODE_ENV!=="production"&&console.warn(t)}function aS(e,t){if(e==null)throw new Error(t())}var Rf=e=>typeof e=="object"&&e!==null,We=e=>e?"":void 0,sS=9,iS=e=>Rf(e)&&e.nodeType===sS,lS=e=>Rf(e)&&e===e.window;function cS(e){if(!e)return!1;const t=e.getRootNode();return Pf(t)===e}function dS(e){return iS(e)?e:lS(e)?e.document:(e==null?void 0:e.ownerDocument)??document}function Pf(e){let t=e.activeElement;for(;t!=null&&t.shadowRoot;){const r=t.shadowRoot.activeElement;if(!r||r===t)break;t=r}return t}var uS=(...e)=>e.map(t=>{var r;return(r=t==null?void 0:t.trim)==null?void 0:r.call(t)}).filter(Boolean).join(" "),fS=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,Ri=e=>{const t={};let r;for(;r=fS.exec(e);)t[r[1]]=r[2];return t},pS=(e,t)=>{if(nn(e)){if(nn(t))return`${e};${t}`;e=Ri(e)}else nn(t)&&(t=Ri(t));return Object.assign({},e??{},t??{})};function Be(...e){let t={};for(let r of e){if(!r)continue;for(let o in t){if(o.startsWith("on")&&typeof t[o]=="function"&&typeof r[o]=="function"){t[o]=tS(r[o],t[o]);continue}if(o==="className"||o==="class"){t[o]=uS(t[o],r[o]);continue}if(o==="style"){t[o]=pS(t[o],r[o]);continue}t[o]=r[o]!==void 0?r[o]:t[o]}for(let o in r)t[o]===void 0&&(t[o]=r[o]);const n=Object.getOwnPropertySymbols(r);for(let o of n)t[o]=r[o]}return t}function mS(e,t,r){let n=[],o;return a=>{const i=e(a);return(i.length!==n.length||i.some((d,u)=>!qa(n[u],d)))&&(n=i,o=t(i,a)),o}}var Wt=(e=>(e.NotStarted="Not Started",e.Started="Started",e.Stopped="Stopped",e))(Wt||{}),Ro="__init__";function gS(e){const t=()=>{var i;return((i=e.getRootNode)==null?void 0:i.call(e))??document},r=()=>dS(t());return{...e,getRootNode:t,getDoc:r,getWin:()=>r().defaultView??window,getActiveElement:()=>Pf(t()),isActiveElement:cS,getById:i=>t().getElementById(i)}}function vS(e){return new Proxy({},{get(t,r){return r==="style"?n=>e({style:n}).style:e}})}var hS=()=>e=>Array.from(new Set(e)),jf=typeof globalThis.document<"u"?S.useLayoutEffect:S.useEffect;function hn(e){const t=e().value??e().defaultValue,r=e().isEqual??Object.is,[n]=S.useState(t),[o,a]=S.useState(n),i=e().value!==void 0,l=S.useRef(o);l.current=i?e().value:o;const d=S.useRef(l.current);jf(()=>{d.current=l.current},[o,e().value]);const u=p=>{var b,v;const g=d.current,m=pr(p)?p(g):p;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:m,prev:g}),i||a(m),r(m,g)||(v=(b=e()).onChange)==null||v.call(b,m,g)};function f(){return i?e().value:o}return{initial:n,ref:l,get:f,set(p){(e().sync?Sr.flushSync:eS)(()=>u(p))},invoke(p,g){var m,b;(b=(m=e()).onChange)==null||b.call(m,p,g)},hash(p){var g,m;return((m=(g=e()).hash)==null?void 0:m.call(g,p))??String(p)}}}hn.cleanup=e=>{S.useEffect(()=>e,[])};hn.ref=e=>{const t=S.useRef(e);return{get:()=>t.current,set:r=>{t.current=r}}};function xS(e){const t=S.useRef(e);return{get(r){return t.current[r]},set(r,n){t.current[r]=n}}}var bS=(e,t)=>{const r=S.useRef(!1),n=S.useRef(!1);S.useEffect(()=>{if(r.current&&n.current)return t();n.current=!0},[...(e??[]).map(o=>typeof o=="function"?o():o)]),S.useEffect(()=>(r.current=!0,()=>{r.current=!1}),[])};function yS(e,t={}){var re,te,Q,W;const r=S.useMemo(()=>{const{id:D,ids:I,getRootNode:O}=t;return gS({id:D,ids:I,getRootNode:O})},[t]),n=(...D)=>{e.debug&&console.log(...D)},o=((re=e.props)==null?void 0:re.call(e,{props:Ef(t),scope:r}))??t,a=wS(o),i=(te=e.context)==null?void 0:te.call(e,{prop:a,bindable:hn,scope:r,flush:Pi,getContext(){return d},getComputed(){return N},getRefs(){return v},getEvent(){return m()}}),l=Nf(i),d={get(D){var I;return(I=l.current)==null?void 0:I[D].ref.current},set(D,I){var O;(O=l.current)==null||O[D].set(I)},initial(D){var I;return(I=l.current)==null?void 0:I[D].initial},hash(D){var O,R;const I=(O=l.current)==null?void 0:O[D].get();return(R=l.current)==null?void 0:R[D].hash(I)}},u=S.useRef(new Map),f=S.useRef(null),p=S.useRef(null),g=S.useRef({type:""}),m=()=>({...g.current,current(){return g.current},previous(){return p.current}}),b=()=>({...T,matches(...D){return D.includes(T.ref.current)},hasTag(D){var I,O;return!!((O=(I=e.states[T.ref.current])==null?void 0:I.tags)!=null&&O.includes(D))}}),v=xS(((Q=e.refs)==null?void 0:Q.call(e,{prop:a,context:d}))??{}),h=()=>({state:b(),context:d,event:m(),prop:a,send:U,action:y,guard:x,track:bS,refs:v,computed:N,flush:Pi,scope:r,choose:E}),y=D=>{const I=pr(D)?D(h()):D;if(!I)return;const O=I.map(R=>{var B,J;const M=(J=(B=e.implementations)==null?void 0:B.actions)==null?void 0:J[R];return M||Ei(`[zag-js] No implementation found for action "${JSON.stringify(R)}"`),M});for(const R of O)R==null||R(h())},x=D=>{var I,O;return pr(D)?D(h()):(O=(I=e.implementations)==null?void 0:I.guards)==null?void 0:O[D](h())},C=D=>{const I=pr(D)?D(h()):D;if(!I)return;const O=I.map(M=>{var J,k;const B=(k=(J=e.implementations)==null?void 0:J.effects)==null?void 0:k[M];return B||Ei(`[zag-js] No implementation found for effect "${JSON.stringify(M)}"`),B}),R=[];for(const M of O){const B=M==null?void 0:M(h());B&&R.push(B)}return()=>R.forEach(M=>M==null?void 0:M())},E=D=>W1(D).find(I=>{let O=!I.guard;return nn(I.guard)?O=!!x(I.guard):pr(I.guard)&&(O=I.guard(h())),O}),N=D=>{aS(e.computed,()=>"[zag-js] No computed object found on machine");const I=e.computed[D];return I({context:d,event:m(),prop:a,refs:v,scope:r,computed:N})},T=hn(()=>({defaultValue:e.initialState({prop:a}),onChange(D,I){var R,M,B,J;if(I){const k=u.current.get(I);k==null||k(),u.current.delete(I)}I&&y((R=e.states[I])==null?void 0:R.exit),y((M=f.current)==null?void 0:M.actions);const O=C((B=e.states[D])==null?void 0:B.effects);if(O&&u.current.set(D,O),I===Ro){y(e.entry);const k=C(e.effects);k&&u.current.set(Ro,k)}y((J=e.states[D])==null?void 0:J.entry)}})),A=S.useRef(void 0),P=S.useRef(Wt.NotStarted);jf(()=>{queueMicrotask(()=>{const O=P.current===Wt.Started;P.current=Wt.Started,n(O?"rehydrating...":"initializing...");const R=A.current??T.initial;T.invoke(R,O?T.get():Ro)});const D=u.current,I=T.ref.current;return()=>{n("unmounting..."),A.current=I,P.current=Wt.Stopped,D.forEach(O=>O==null?void 0:O()),u.current=new Map,f.current=null,queueMicrotask(()=>{y(e.exit)})}},[]);const V=()=>"ref"in T?T.ref.current:T.get(),U=D=>{queueMicrotask(()=>{var J,k;if(P.current!==Wt.Started)return;p.current=g.current,g.current=D;let I=V();const O=((J=e.states[I].on)==null?void 0:J[D.type])??((k=e.on)==null?void 0:k[D.type]),R=E(O);if(!R)return;f.current=R;const M=R.target??I;n("transition",D.type,R.target||I,`(${R.actions})`);const B=M!==I;B?Sr.flushSync(()=>T.set(M)):R.reenter&&!B?T.invoke(I,I):y(R.actions??[])})};return(W=e.watch)==null||W.call(e,h()),{state:b(),send:U,context:d,prop:a,scope:r,refs:v,computed:N,event:m(),getStatus:()=>P.current}}function Nf(e){const t=S.useRef(e);return t.current=e,t}function wS(e){const t=Nf(e);return function(n){return t.current[n]}}function Pi(e){queueMicrotask(()=>{Sr.flushSync(()=>e())})}var CS=vS(e=>e);function SS(...e){return t=>{const r=[];for(const n of e)if(typeof n=="function"){const o=n(t);typeof o=="function"&&r.push(o)}else n&&(n.current=t);if(r.length)return()=>{for(const n of r)n()}}}function ES(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}const Po=e=>{const t=S.memo(S.forwardRef((r,n)=>{const{asChild:o,children:a,...i}=r;if(!o)return S.createElement(e,{...i,ref:n},a);if(!S.isValidElement(a))return null;const l=S.Children.only(a),d=ES(l);return S.cloneElement(l,{...Be(i,l.props),ref:n?SS(n,d):d})}));return t.displayName=e.displayName||e.name,t},RS=()=>{const e=new Map;return new Proxy(Po,{apply(t,r,n){return Po(n[0])},get(t,r){const n=r;return e.has(n)||e.set(n,Po(n)),e.get(n)}})},Xe=RS();function PS(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Lr(e={}){const{name:t,strict:r=!0,hookName:n="useContext",providerName:o="Provider",errorMessage:a,defaultValue:i}=e,l=S.createContext(i);l.displayName=t;function d(){var f;const u=S.useContext(l);if(!u&&r){const p=new Error(a??PS(n,o));throw p.name="ContextError",(f=Error.captureStackTrace)==null||f.call(Error,p,d),p}return u}return[l.Provider,d,l]}const[jS,nt]=Lr({name:"StepsContext",hookName:"useStepsContext",providerName:"<StepsProvider />"}),kf=S.forwardRef((e,t)=>{const r=nt(),n=Be(r.getContentProps({index:r.count}),e);return s.jsx(Xe.div,{...n,ref:t})});kf.displayName="StepsCompletedContent";const Ua=()=>(e,t)=>t.reduce((r,n)=>{const[o,a]=r,i=n;return a[i]!==void 0&&(o[i]=a[i]),delete a[i],[o,a]},[{},{...e}]),Tf=S.forwardRef((e,t)=>{const[r,n]=Ua()(e,["index"]),o=nt(),a=Be(o.getContentProps(r),n);return s.jsx(Xe.div,{...a,ref:t})});Tf.displayName="StepsContent";const[NS,Ha]=Lr({name:"StepsItemPropsContext",hookName:"useStepsItemPropsContext",providerName:"<StepsItemPropsProvider />"}),Af=S.forwardRef((e,t)=>{const r=nt(),n=Ha(),o=Be(r.getIndicatorProps(n),e);return s.jsx(Xe.div,{...o,ref:t})});Af.displayName="StepsIndicator";const[kS,mP]=Lr({name:"StepsItemContext",hookName:"useStepsItemContext",providerName:"<StepsItem />"}),_f=S.forwardRef((e,t)=>{const[r,n]=Ua()(e,["index"]),o=nt(),a=Be(o.getItemProps(r),n),i=o.getItemState(r);return s.jsx(NS,{value:r,children:s.jsx(kS,{value:i,children:s.jsx(Xe.div,{...a,ref:t})})})});_f.displayName="StepsItem";const If=S.forwardRef((e,t)=>{const r=nt(),n=Be(r.getListProps(),e);return s.jsx(Xe.div,{...n,ref:t})});If.displayName="StepsList";const Mf=S.forwardRef((e,t)=>{const r=nt(),n=Be(r.getNextTriggerProps(),e);return s.jsx(Xe.button,{...n,ref:t})});Mf.displayName="StepsNextTrigger";const Of=S.forwardRef((e,t)=>{const r=nt(),n=Be(r.getPrevTriggerProps(),e);return s.jsx(Xe.button,{...n,ref:t})});Of.displayName="StepsPrevTrigger";var mr=(e,t=[])=>({parts:(...r)=>{if(TS(t))return mr(e,r);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...r)=>mr(e,[...t,...r]),omit:(...r)=>mr(e,t.filter(n=>!r.includes(n))),rename:r=>mr(r,t),keys:()=>t,build:()=>[...new Set(t)].reduce((r,n)=>Object.assign(r,{[n]:{selector:[`&[data-scope="${Vt(e)}"][data-part="${Vt(n)}"]`,`& [data-scope="${Vt(e)}"][data-part="${Vt(n)}"]`].join(", "),attrs:{"data-scope":Vt(e),"data-part":Vt(n)}}}),{})}),Vt=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),TS=e=>e.length===0,AS=mr("steps").parts("root","list","item","trigger","indicator","separator","content","nextTrigger","prevTrigger","progress"),ze=AS.build(),_S=e=>{var t;return((t=e.ids)==null?void 0:t.root)??`steps:${e.id}`},IS=e=>{var t;return((t=e.ids)==null?void 0:t.list)??`steps:${e.id}:list`},ji=(e,t)=>{var r,n;return((n=(r=e.ids)==null?void 0:r.triggerId)==null?void 0:n.call(r,t))??`steps:${e.id}:trigger:${t}`},MS=(e,t)=>{var r,n;return((n=(r=e.ids)==null?void 0:r.contentId)==null?void 0:n.call(r,t))??`steps:${e.id}:content:${t}`};function OS(e,t){const{context:r,send:n,computed:o,prop:a,scope:i}=e,l=r.get("step"),d=a("count"),u=o("percent"),f=o("hasNextStep"),p=o("hasPrevStep"),g=y=>({triggerId:ji(i,y.index),contentId:MS(i,y.index),current:y.index===l,completed:y.index<l,incomplete:y.index>l,index:y.index,first:y.index===0,last:y.index===d-1}),m=()=>{n({type:"STEP.NEXT",src:"next.trigger.click"})},b=()=>{n({type:"STEP.PREV",src:"prev.trigger.click"})},v=()=>{n({type:"STEP.RESET",src:"reset.trigger.click"})},h=y=>{n({type:"STEP.SET",value:y,src:"api.setValue"})};return{value:l,count:d,percent:u,hasNextStep:f,hasPrevStep:p,isCompleted:o("completed"),goToNextStep:m,goToPrevStep:b,resetStep:v,getItemState:g,setStep:h,getRootProps(){return t.element({...ze.root.attrs,id:_S(i),dir:a("dir"),"data-orientation":a("orientation"),style:{"--percent":`${u}%`}})},getListProps(){const x=z1(d).map((C,E)=>ji(i,E));return t.element({...ze.list.attrs,dir:a("dir"),id:IS(i),role:"tablist","aria-owns":x.join(" "),"aria-orientation":a("orientation"),"data-orientation":a("orientation")})},getItemProps(y){const x=g(y);return t.element({...ze.item.attrs,dir:a("dir"),"aria-current":x.current?"step":void 0,"data-orientation":a("orientation")})},getTriggerProps(y){const x=g(y);return t.button({...ze.trigger.attrs,id:x.triggerId,role:"tab",dir:a("dir"),tabIndex:!a("linear")||x.current?0:-1,"aria-selected":x.current,"aria-controls":x.contentId,"data-state":x.current?"open":"closed","data-orientation":a("orientation"),"data-complete":We(x.completed),"data-current":We(x.current),"data-incomplete":We(x.incomplete),onClick(C){C.defaultPrevented||a("linear")||n({type:"STEP.SET",value:y.index,src:"trigger.click"})}})},getContentProps(y){const x=g(y);return t.element({...ze.content.attrs,dir:a("dir"),id:x.contentId,role:"tabpanel",tabIndex:0,hidden:!x.current,"data-state":x.current?"open":"closed","data-orientation":a("orientation"),"aria-labelledby":x.triggerId})},getIndicatorProps(y){const x=g(y);return t.element({...ze.indicator.attrs,dir:a("dir"),"aria-hidden":!0,"data-complete":We(x.completed),"data-current":We(x.current),"data-incomplete":We(x.incomplete)})},getSeparatorProps(y){const x=g(y);return t.element({...ze.separator.attrs,dir:a("dir"),"data-orientation":a("orientation"),"data-complete":We(x.completed),"data-current":We(x.current),"data-incomplete":We(x.incomplete)})},getNextTriggerProps(){return t.button({...ze.nextTrigger.attrs,dir:a("dir"),type:"button",disabled:!f,onClick(y){y.defaultPrevented||m()}})},getPrevTriggerProps(){return t.button({dir:a("dir"),...ze.prevTrigger.attrs,type:"button",disabled:!p,onClick(y){y.defaultPrevented||b()}})},getProgressProps(){return t.element({dir:a("dir"),...ze.progress.attrs,role:"progressbar","aria-valuenow":u,"aria-valuemin":0,"aria-valuemax":100,"aria-valuetext":`${u}% complete`,"data-complete":We(u===100)})}}}var DS={props({props:e}){return{defaultStep:0,count:1,linear:!1,orientation:"horizontal",...e}},context({prop:e,bindable:t}){return{step:t(()=>({defaultValue:e("defaultStep"),value:e("step"),onChange(r){var o,a;(o=e("onStepChange"))==null||o({step:r}),r==e("count")&&((a=e("onStepComplete"))==null||a())}}))}},computed:{percent:mS(({context:e,prop:t})=>[e.get("step"),t("count")],([e,t])=>e/t*100),hasNextStep:({context:e,prop:t})=>e.get("step")<t("count"),hasPrevStep:({context:e})=>e.get("step")>0,completed:({context:e,prop:t})=>e.get("step")===t("count")},initialState(){return"idle"},entry:["validateStep"],states:{idle:{on:{"STEP.SET":{actions:["setStep"]},"STEP.NEXT":{actions:["goToNextStep"]},"STEP.PREV":{actions:["goToPrevStep"]},"STEP.RESET":{actions:["resetStep"]}}}},implementations:{actions:{goToNextStep({context:e,prop:t}){const r=Math.min(e.get("step")+1,t("count"));e.set("step",r)},goToPrevStep({context:e}){const t=Math.max(e.get("step")-1,0);e.set("step",t)},resetStep({context:e}){e.set("step",0)},setStep({context:e,event:t}){e.set("step",t.value)},validateStep({context:e,prop:t}){$S(t("count"),e.get("step"))}}}},$S=(e,t)=>{if(!oS(t,0,e))throw new RangeError(`[zag-js/steps] step index ${t} is out of bounds`)};hS()(["count","dir","getRootNode","id","ids","linear","onStepChange","onStepComplete","orientation","step","defaultStep"]);const[gP,LS]=Lr({name:"EnvironmentContext",hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:{getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window}}),[vP,FS]=Lr({name:"LocaleContext",hookName:"useLocaleContext",providerName:"<LocaleProvider />",strict:!1,defaultValue:{dir:"ltr",locale:"en-US"}});function VS(e){const t=S.useId(),{getRootNode:r}=LS(),{dir:n}=FS(),o={id:t,dir:n,getRootNode:r,...e},a=yS(DS,o);return OS(a,CS)}const Df=S.forwardRef((e,t)=>{const[r,n]=Ua()(e,["defaultStep","id","ids","count","linear","onStepChange","onStepComplete","orientation","step"]),o=VS(r),a=Be(o.getRootProps(),n);return s.jsx(jS,{value:o,children:s.jsx(Xe.div,{...a,ref:t})})});Df.displayName="StepsRoot";const $f=S.forwardRef((e,t)=>{const r=nt(),n=Ha(),o=Be(r.getSeparatorProps(n),e);return s.jsx(Xe.div,{...o,ref:t})});$f.displayName="StepsSeparator";const Lf=S.forwardRef((e,t)=>{const r=nt(),n=Ha(),o=Be(r.getTriggerProps(n),e);return s.jsx(Xe.button,{...o,ref:t})});Lf.displayName="StepsTrigger";function BS(e){return ku({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M20 6 9 17l-5-5"},child:[]}]})(e)}const Ff=S.createContext(void 0),GS=({children:e,step:t})=>s.jsx(Ff.Provider,{value:{step:t},children:e}),Vf=()=>{const e=S.useContext(Ff);if(!e)throw new Error("useSteps must be used within a StepsProvider");return e},WS=({className:e,step:t,...r})=>{const n=j("qodo qodo-steps","flex flex-col gap-4",e);return s.jsx(GS,{step:t??0,children:s.jsx(Df,{className:n,step:t,...r})})},zS=({className:e,...t})=>{const r=j("flex flex-row gap-4",e);return s.jsx(If,{className:r,...t})},qS=({className:e,...t})=>{const r=j("flex flex-row items-center gap-4",e);return s.jsx(_f,{className:r,...t})},US=({className:e,...t})=>{const r=j("flex flex-row items-center gap-4 text-purple-muted-100 text-sm",e);return s.jsx(Lf,{className:r,...t})},HS=({index:e,className:t,...r})=>{const{step:n}=Vf(),o=e===n,a=e<n,i=j("flex items-center justify-center w-8 h-8 rounded-full text-white",a&&"bg-green-700",o&&"bg-green-600",!a&&!o&&"bg-purple-muted-500",t),l=j({"text-white":o,"text-purple-muted-300":!a&&e!==n});return s.jsx(Af,{className:i,...r,children:a?s.jsx(BS,{className:"text-green-400"}):s.jsx("span",{className:l,children:e+1})})},KS=({index:e,className:t,...r})=>{const{step:n}=Vf(),o=e<n,a=j("min-w-12 h-px",o?"bg-green-400":"bg-gray-400",t);return s.jsx($f,{className:a,...r})},YS=({className:e,...t})=>{const r=j(e);return s.jsx(Tf,{className:r,...t})},XS=({className:e,...t})=>{const r=j(e);return s.jsx(kf,{className:r,...t})},ZS=({className:e,...t})=>{const r=j("bg-primary text-white px-4 py-2 rounded-md",e);return s.jsx(Of,{className:r,...t})},JS=({className:e,...t})=>{const r=j("bg-primary text-white px-4 py-2 rounded-md",e);return s.jsx(Mf,{className:r,...t})},QS={Root:WS,List:zS,Item:qS,Trigger:US,Indicator:HS,Separator:KS,Content:YS,CompletedContent:XS,PrevTrigger:ZS,NextTrigger:JS},Fr=({children:e,content:t,providerProps:r={},triggerProps:n={},contentProps:o={}})=>s.jsx(Wu,{...r,children:s.jsxs(zu,{children:[s.jsx(qu,{...n,children:e}),t&&s.jsx(Uu,{...o,children:t})]})});/**
|
|
204
|
+
Defaulting to \`null\`.`}var jy=yd,Ny=Cd;function ky({className:e,value:t,...r}){return s.jsx(jy,{"data-slot":"progress",className:j("qodo qodo-progress bg-primary/20 relative h-2 w-full overflow-hidden rounded-full dark:bg-primary/20",e),...r,children:s.jsx(Ny,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all dark:bg-primary",style:{transform:`translateX(-${100-(t||0)}%)`}})})}function Ed({className:e,...t}){return s.jsx("div",{className:j("qodo qodo-skeleton animate-pulse rounded-md bg-neutral-900/10 dark:bg-neutral-50/10",e),...t})}var Vn="Switch",[Ty,lP]=we(Vn),[Ay,_y]=Ty(Vn),Rd=c.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:o,defaultChecked:a,required:i,disabled:l,value:d="on",onCheckedChange:u,form:f,...p}=e,[g,m]=c.useState(null),b=se(t,C=>m(C)),v=c.useRef(!1),h=g?f||!!g.closest("form"):!0,[y,x]=ye({prop:o,defaultProp:a??!1,onChange:u,caller:Vn});return s.jsxs(Ay,{scope:r,checked:y,disabled:l,children:[s.jsx(H.button,{type:"button",role:"switch","aria-checked":y,"aria-required":i,"data-state":kd(y),"data-disabled":l?"":void 0,disabled:l,value:d,...p,ref:b,onClick:F(e.onClick,C=>{x(E=>!E),h&&(v.current=C.isPropagationStopped(),v.current||C.stopPropagation())})}),h&&s.jsx(Nd,{control:g,bubbles:!v.current,name:n,value:d,checked:y,required:i,disabled:l,form:f,style:{transform:"translateX(-100%)"}})]})});Rd.displayName=Vn;var Pd="SwitchThumb",jd=c.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,o=_y(Pd,r);return s.jsx(H.span,{"data-state":kd(o.checked),"data-disabled":o.disabled?"":void 0,...n,ref:t})});jd.displayName=Pd;var Iy="SwitchBubbleInput",Nd=c.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...o},a)=>{const i=c.useRef(null),l=se(i,a),d=da(r),u=ia(t);return c.useEffect(()=>{const f=i.current;if(!f)return;const p=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(p,"checked").set;if(d!==r&&m){const b=new Event("click",{bubbles:n});m.call(f,r),f.dispatchEvent(b)}},[d,r,n]),s.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...o,tabIndex:-1,ref:l,style:{...o.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Nd.displayName=Iy;function kd(e){return e?"checked":"unchecked"}var My=Rd,Oy=jd;function Dy({className:e,...t}){return s.jsx(My,{"data-slot":"switch",className:j("qodo qodo-switch peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:data-[state=checked]:bg-primary dark:data-[state=unchecked]:bg-input",e),...t,children:s.jsx(Oy,{"data-slot":"switch-thumb",className:j("bg-background pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground")})})}var Td="Toggle",Ra=c.forwardRef((e,t)=>{const{pressed:r,defaultPressed:n,onPressedChange:o,...a}=e,[i,l]=ye({prop:r,onChange:o,defaultProp:n??!1,caller:Td});return s.jsx(H.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":e.disabled?"":void 0,...a,ref:t,onClick:F(e.onClick,()=>{e.disabled||l(!i)})})});Ra.displayName=Td;var $y=Ra;const Ad=wn("qodo qodo-toggle inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium text-foreground hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap dark:text-foreground dark:hover:bg-muted dark:hover:text-muted-foreground dark:data-[state=on]:bg-accent dark:data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent text-foreground dark:bg-transparent dark:text-foreground",outline:"border border-input bg-transparent text-foreground shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-transparent dark:text-foreground dark:hover:bg-accent dark:hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function Ly({className:e,variant:t,size:r,...n}){return s.jsx($y,{"data-slot":"toggle",className:j(Ad({variant:t,size:r,className:e})),...n})}var yo="rovingFocusGroup.onEntryFocus",Fy={bubbles:!1,cancelable:!0},Ir="RovingFocusGroup",[Go,_d,Vy]=En(Ir),[By,gt]=we(Ir,[Vy]),[Gy,Wy]=By(Ir),Id=c.forwardRef((e,t)=>s.jsx(Go.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(Go.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(zy,{...e,ref:t})})}));Id.displayName=Ir;var zy=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:a,currentTabStopId:i,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:d,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...p}=e,g=c.useRef(null),m=se(t,g),b=Tt(a),[v,h]=ye({prop:i,defaultProp:l??null,onChange:d,caller:Ir}),[y,x]=c.useState(!1),C=De(u),E=_d(r),N=c.useRef(!1),[T,A]=c.useState(0);return c.useEffect(()=>{const P=g.current;if(P)return P.addEventListener(yo,C),()=>P.removeEventListener(yo,C)},[C]),s.jsx(Gy,{scope:r,orientation:n,dir:b,loop:o,currentTabStopId:v,onItemFocus:c.useCallback(P=>h(P),[h]),onItemShiftTab:c.useCallback(()=>x(!0),[]),onFocusableItemAdd:c.useCallback(()=>A(P=>P+1),[]),onFocusableItemRemove:c.useCallback(()=>A(P=>P-1),[]),children:s.jsx(H.div,{tabIndex:y||T===0?-1:0,"data-orientation":n,...p,ref:m,style:{outline:"none",...e.style},onMouseDown:F(e.onMouseDown,()=>{N.current=!0}),onFocus:F(e.onFocus,P=>{const V=!N.current;if(P.target===P.currentTarget&&V&&!y){const U=new CustomEvent(yo,Fy);if(P.currentTarget.dispatchEvent(U),!U.defaultPrevented){const re=E().filter(I=>I.focusable),te=re.find(I=>I.active),Q=re.find(I=>I.id===v),D=[te,Q,...re].filter(Boolean).map(I=>I.ref.current);Dd(D,f)}}N.current=!1}),onBlur:F(e.onBlur,()=>x(!1))})})}),Md="RovingFocusGroupItem",Od=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:a,children:i,...l}=e,d=me(),u=a||d,f=Wy(Md,r),p=f.currentTabStopId===u,g=_d(r),{onFocusableItemAdd:m,onFocusableItemRemove:b,currentTabStopId:v}=f;return c.useEffect(()=>{if(n)return m(),()=>b()},[n,m,b]),s.jsx(Go.ItemSlot,{scope:r,id:u,focusable:n,active:o,children:s.jsx(H.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...l,ref:t,onMouseDown:F(e.onMouseDown,h=>{n?f.onItemFocus(u):h.preventDefault()}),onFocus:F(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:F(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){f.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const y=Hy(h,f.orientation,f.dir);if(y!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let C=g().filter(E=>E.focusable).map(E=>E.ref.current);if(y==="last")C.reverse();else if(y==="prev"||y==="next"){y==="prev"&&C.reverse();const E=C.indexOf(h.currentTarget);C=f.loop?Ky(C,E+1):C.slice(E+1)}setTimeout(()=>Dd(C))}}),children:typeof i=="function"?i({isCurrentTabStop:p,hasTabStop:v!=null}):i})})});Od.displayName=Md;var qy={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Uy(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Hy(e,t,r){const n=Uy(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return qy[n]}function Dd(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function Ky(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Bn=Id,Gn=Od,vt="ToggleGroup",[$d,cP]=we(vt,[gt]),Ld=gt(),Pa=S.forwardRef((e,t)=>{const{type:r,...n}=e;if(r==="single"){const o=n;return s.jsx(Yy,{...o,ref:t})}if(r==="multiple"){const o=n;return s.jsx(Xy,{...o,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${vt}\``)});Pa.displayName=vt;var[Fd,Vd]=$d(vt),Yy=S.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:o=()=>{},...a}=e,[i,l]=ye({prop:r,defaultProp:n??"",onChange:o,caller:vt});return s.jsx(Fd,{scope:e.__scopeToggleGroup,type:"single",value:S.useMemo(()=>i?[i]:[],[i]),onItemActivate:l,onItemDeactivate:S.useCallback(()=>l(""),[l]),children:s.jsx(Bd,{...a,ref:t})})}),Xy=S.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:o=()=>{},...a}=e,[i,l]=ye({prop:r,defaultProp:n??[],onChange:o,caller:vt}),d=S.useCallback(f=>l((p=[])=>[...p,f]),[l]),u=S.useCallback(f=>l((p=[])=>p.filter(g=>g!==f)),[l]);return s.jsx(Fd,{scope:e.__scopeToggleGroup,type:"multiple",value:i,onItemActivate:d,onItemDeactivate:u,children:s.jsx(Bd,{...a,ref:t})})});Pa.displayName=vt;var[Zy,Jy]=$d(vt),Bd=S.forwardRef((e,t)=>{const{__scopeToggleGroup:r,disabled:n=!1,rovingFocus:o=!0,orientation:a,dir:i,loop:l=!0,...d}=e,u=Ld(r),f=Tt(i),p={role:"group",dir:f,...d};return s.jsx(Zy,{scope:r,rovingFocus:o,disabled:n,children:o?s.jsx(Bn,{asChild:!0,...u,orientation:a,dir:f,loop:l,children:s.jsx(H.div,{...p,ref:t})}):s.jsx(H.div,{...p,ref:t})})}),fn="ToggleGroupItem",Gd=S.forwardRef((e,t)=>{const r=Vd(fn,e.__scopeToggleGroup),n=Jy(fn,e.__scopeToggleGroup),o=Ld(e.__scopeToggleGroup),a=r.value.includes(e.value),i=n.disabled||e.disabled,l={...e,pressed:a,disabled:i},d=S.useRef(null);return n.rovingFocus?s.jsx(Gn,{asChild:!0,...o,focusable:!i,active:a,ref:d,children:s.jsx(ri,{...l,ref:t})}):s.jsx(ri,{...l,ref:t})});Gd.displayName=fn;var ri=S.forwardRef((e,t)=>{const{__scopeToggleGroup:r,value:n,...o}=e,a=Vd(fn,r),i={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},l=a.type==="single"?i:void 0;return s.jsx(Ra,{...l,...o,ref:t,onPressedChange:d=>{d?a.onItemActivate(n):a.onItemDeactivate(n)}})}),Qy=Pa,ew=Gd;const Wd=c.createContext({size:"default",variant:"default"});function tw({className:e,variant:t,size:r,children:n,...o}){return s.jsx(Qy,{"data-slot":"toggle-group","data-variant":t,"data-size":r,className:j("qodo qodo-toggle-group group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs dark:data-[variant=outline]:shadow-xs",e),...o,children:s.jsx(Wd.Provider,{value:{variant:t,size:r},children:n})})}function rw({className:e,children:t,variant:r,size:n,...o}){const a=c.useContext(Wd);return s.jsx(ew,{"data-slot":"toggle-group-item","data-variant":a.variant||r,"data-size":a.size||n,className:j(Ad({variant:a.variant||r,size:a.size||n}),"qodo qodo-toggle-group-item min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",e),...o,children:t})}var Wn="Collapsible",[nw,zd]=we(Wn),[ow,ja]=nw(Wn),qd=c.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:o,disabled:a,onOpenChange:i,...l}=e,[d,u]=ye({prop:n,defaultProp:o??!1,onChange:i,caller:Wn});return s.jsx(ow,{scope:r,disabled:a,contentId:me(),open:d,onOpenToggle:c.useCallback(()=>u(f=>!f),[u]),children:s.jsx(H.div,{"data-state":ka(d),"data-disabled":a?"":void 0,...l,ref:t})})});qd.displayName=Wn;var Ud="CollapsibleTrigger",Hd=c.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,o=ja(Ud,r);return s.jsx(H.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":ka(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:t,onClick:F(e.onClick,o.onOpenToggle)})});Hd.displayName=Ud;var Na="CollapsibleContent",Kd=c.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=ja(Na,e.__scopeCollapsible);return s.jsx(Re,{present:r||o.open,children:({present:a})=>s.jsx(aw,{...n,ref:t,present:a})})});Kd.displayName=Na;var aw=c.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:o,...a}=e,i=ja(Na,r),[l,d]=c.useState(n),u=c.useRef(null),f=se(t,u),p=c.useRef(0),g=p.current,m=c.useRef(0),b=m.current,v=i.open||l,h=c.useRef(v),y=c.useRef(void 0);return c.useEffect(()=>{const x=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(x)},[]),be(()=>{const x=u.current;if(x){y.current=y.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const C=x.getBoundingClientRect();p.current=C.height,m.current=C.width,h.current||(x.style.transitionDuration=y.current.transitionDuration,x.style.animationName=y.current.animationName),d(n)}},[i.open,n]),s.jsx(H.div,{"data-state":ka(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!v,...a,ref:f,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:v&&o})});function ka(e){return e?"open":"closed"}var sw=qd,iw=Hd,lw=Kd,Ve="Accordion",cw=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Ta,dw,uw]=En(Ve),[zn,dP]=we(Ve,[uw,zd]),Aa=zd(),Yd=S.forwardRef((e,t)=>{const{type:r,...n}=e,o=n,a=n;return s.jsx(Ta.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?s.jsx(gw,{...a,ref:t}):s.jsx(mw,{...o,ref:t})})});Yd.displayName=Ve;var[Xd,fw]=zn(Ve),[Zd,pw]=zn(Ve,{collapsible:!1}),mw=S.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:o=()=>{},collapsible:a=!1,...i}=e,[l,d]=ye({prop:r,defaultProp:n??"",onChange:o,caller:Ve});return s.jsx(Xd,{scope:e.__scopeAccordion,value:S.useMemo(()=>l?[l]:[],[l]),onItemOpen:d,onItemClose:S.useCallback(()=>a&&d(""),[a,d]),children:s.jsx(Zd,{scope:e.__scopeAccordion,collapsible:a,children:s.jsx(Jd,{...i,ref:t})})})}),gw=S.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:o=()=>{},...a}=e,[i,l]=ye({prop:r,defaultProp:n??[],onChange:o,caller:Ve}),d=S.useCallback(f=>l((p=[])=>[...p,f]),[l]),u=S.useCallback(f=>l((p=[])=>p.filter(g=>g!==f)),[l]);return s.jsx(Xd,{scope:e.__scopeAccordion,value:i,onItemOpen:d,onItemClose:u,children:s.jsx(Zd,{scope:e.__scopeAccordion,collapsible:!0,children:s.jsx(Jd,{...a,ref:t})})})}),[vw,qn]=zn(Ve),Jd=S.forwardRef((e,t)=>{const{__scopeAccordion:r,disabled:n,dir:o,orientation:a="vertical",...i}=e,l=S.useRef(null),d=se(l,t),u=dw(r),p=Tt(o)==="ltr",g=F(e.onKeyDown,m=>{var P;if(!cw.includes(m.key))return;const b=m.target,v=u().filter(V=>{var U;return!((U=V.ref.current)!=null&&U.disabled)}),h=v.findIndex(V=>V.ref.current===b),y=v.length;if(h===-1)return;m.preventDefault();let x=h;const C=0,E=y-1,N=()=>{x=h+1,x>E&&(x=C)},T=()=>{x=h-1,x<C&&(x=E)};switch(m.key){case"Home":x=C;break;case"End":x=E;break;case"ArrowRight":a==="horizontal"&&(p?N():T());break;case"ArrowDown":a==="vertical"&&N();break;case"ArrowLeft":a==="horizontal"&&(p?T():N());break;case"ArrowUp":a==="vertical"&&T();break}const A=x%y;(P=v[A].ref.current)==null||P.focus()});return s.jsx(vw,{scope:r,disabled:n,direction:o,orientation:a,children:s.jsx(Ta.Slot,{scope:r,children:s.jsx(H.div,{...i,"data-orientation":a,ref:d,onKeyDown:n?void 0:g})})})}),pn="AccordionItem",[hw,_a]=zn(pn),Qd=S.forwardRef((e,t)=>{const{__scopeAccordion:r,value:n,...o}=e,a=qn(pn,r),i=fw(pn,r),l=Aa(r),d=me(),u=n&&i.value.includes(n)||!1,f=a.disabled||e.disabled;return s.jsx(hw,{scope:r,open:u,disabled:f,triggerId:d,children:s.jsx(sw,{"data-orientation":a.orientation,"data-state":au(u),...l,...o,ref:t,disabled:f,open:u,onOpenChange:p=>{p?i.onItemOpen(n):i.onItemClose(n)}})})});Qd.displayName=pn;var eu="AccordionHeader",tu=S.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,o=qn(Ve,r),a=_a(eu,r);return s.jsx(H.h3,{"data-orientation":o.orientation,"data-state":au(a.open),"data-disabled":a.disabled?"":void 0,...n,ref:t})});tu.displayName=eu;var Wo="AccordionTrigger",ru=S.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,o=qn(Ve,r),a=_a(Wo,r),i=pw(Wo,r),l=Aa(r);return s.jsx(Ta.ItemSlot,{scope:r,children:s.jsx(iw,{"aria-disabled":a.open&&!i.collapsible||void 0,"data-orientation":o.orientation,id:a.triggerId,...l,...n,ref:t})})});ru.displayName=Wo;var nu="AccordionContent",ou=S.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,o=qn(Ve,r),a=_a(nu,r),i=Aa(r);return s.jsx(lw,{role:"region","aria-labelledby":a.triggerId,"data-orientation":o.orientation,...i,...n,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});ou.displayName=nu;function au(e){return e?"open":"closed"}var xw=Yd,bw=Qd,yw=tu,ww=ru,Cw=ou;function Sw({...e}){return s.jsx(xw,{"data-slot":"accordion",...e})}function Ew({className:e,...t}){return s.jsx(bw,{"data-slot":"accordion-item",className:j("qodo qodo-accordion-item border-b last:border-b-0 dark:border-border",e),...t})}function Rw({className:e,children:t,...r}){return s.jsx(yw,{className:"flex",children:s.jsxs(ww,{"data-slot":"accordion-trigger",className:j("qodo qodo-accordion-trigger focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium text-foreground transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180 dark:text-foreground dark:focus-visible:border-ring dark:focus-visible:ring-ring/50",e),...r,children:[t,s.jsx(Cn,{className:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200 dark:text-muted-foreground"})]})})}function Pw({className:e,children:t,...r}){return s.jsx(Cw,{"data-slot":"accordion-content",className:j("qodo qodo-accordion-content","data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm text-foreground dark:text-foreground"),...r,children:s.jsx("div",{className:j("pt-0 pb-4",e),children:t})})}var Un="Tabs",[jw,uP]=we(Un,[gt]),su=gt(),[Nw,Ia]=jw(Un),iu=c.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:a,orientation:i="horizontal",dir:l,activationMode:d="automatic",...u}=e,f=Tt(l),[p,g]=ye({prop:n,onChange:o,defaultProp:a??"",caller:Un});return s.jsx(Nw,{scope:r,baseId:me(),value:p,onValueChange:g,orientation:i,dir:f,activationMode:d,children:s.jsx(H.div,{dir:f,"data-orientation":i,...u,ref:t})})});iu.displayName=Un;var lu="TabsList",cu=c.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...o}=e,a=Ia(lu,r),i=su(r);return s.jsx(Bn,{asChild:!0,...i,orientation:a.orientation,dir:a.dir,loop:n,children:s.jsx(H.div,{role:"tablist","aria-orientation":a.orientation,...o,ref:t})})});cu.displayName=lu;var du="TabsTrigger",uu=c.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...a}=e,i=Ia(du,r),l=su(r),d=mu(i.baseId,n),u=gu(i.baseId,n),f=n===i.value;return s.jsx(Gn,{asChild:!0,...l,focusable:!o,active:f,children:s.jsx(H.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":u,"data-state":f?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:d,...a,ref:t,onMouseDown:F(e.onMouseDown,p=>{!o&&p.button===0&&p.ctrlKey===!1?i.onValueChange(n):p.preventDefault()}),onKeyDown:F(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&i.onValueChange(n)}),onFocus:F(e.onFocus,()=>{const p=i.activationMode!=="manual";!f&&!o&&p&&i.onValueChange(n)})})})});uu.displayName=du;var fu="TabsContent",pu=c.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:o,children:a,...i}=e,l=Ia(fu,r),d=mu(l.baseId,n),u=gu(l.baseId,n),f=n===l.value,p=c.useRef(f);return c.useEffect(()=>{const g=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(g)},[]),s.jsx(Re,{present:o||f,children:({present:g})=>s.jsx(H.div,{"data-state":f?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":d,hidden:!g,id:u,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:g&&a})})});pu.displayName=fu;function mu(e,t){return`${e}-trigger-${t}`}function gu(e,t){return`${e}-content-${t}`}var kw=iu,Tw=cu,Aw=uu,_w=pu;function Iw({className:e,...t}){return s.jsx(kw,{"data-slot":"tabs",className:j("qodo qodo-tabs flex flex-col gap-2",e),...t})}function Mw({className:e,...t}){return s.jsx(Tw,{"data-slot":"tabs-list",className:j("inline-flex w-full items-end justify-start gap-4",e),...t})}function Ow({className:e,...t}){return s.jsx(Aw,{"data-slot":"tabs-trigger",className:j("text-[var(--text-interactive-neutral-idle)] hover:text-[var(--text-interactive-neutral-hover)] data-[state=active]:text-[var(--text-interactive-emphasis-active)] focus-visible:ring-ring/50 focus-visible:outline-ring inline-flex items-center justify-center gap-1.5 border-b border-transparent py-4 text-xs font-normal whitespace-nowrap transition-[color,border-color] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed data-[state=active]:border-[var(--color-purple-400)] relative -mb-px tracking-[0.01em] leading-[150%] cursor-pointer [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function Dw({className:e,...t}){return s.jsx(_w,{"data-slot":"tabs-content",className:j("flex-1 outline-none",e),...t})}var $w=e=>e.type==="checkbox",fr=e=>e instanceof Date,Ma=e=>e==null;const vu=e=>typeof e=="object";var kt=e=>!Ma(e)&&!Array.isArray(e)&&vu(e)&&!fr(e),Lw=e=>kt(e)&&e.target?$w(e.target)?e.target.checked:e.target.value:e,Fw=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Vw=(e,t)=>e.has(Fw(t)),Bw=e=>{const t=e.constructor&&e.constructor.prototype;return kt(t)&&t.hasOwnProperty("isPrototypeOf")},Gw=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function hu(e){let t;const r=Array.isArray(e),n=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(Gw&&(e instanceof Blob||n))&&(r||kt(e)))if(t=r?[]:Object.create(Object.getPrototypeOf(e)),!r&&!Bw(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=hu(e[o]));else return e;return t}var xu=e=>/^\w*$/.test(e),zo=e=>e===void 0,Ww=e=>Array.isArray(e)?e.filter(Boolean):[],bu=e=>Ww(e.replace(/["|']|\]/g,"").split(/\.|\[/)),je=(e,t,r)=>{if(!t||!kt(e))return r;const n=(xu(t)?[t]:bu(t)).reduce((o,a)=>Ma(o)?o:o[a],e);return zo(n)||n===e?zo(e[t])?r:e[t]:n},wo=e=>typeof e=="boolean",ni=(e,t,r)=>{let n=-1;const o=xu(t)?[t]:bu(t),a=o.length,i=a-1;for(;++n<a;){const l=o[n];let d=r;if(n!==i){const u=e[l];d=kt(u)||Array.isArray(u)?u:isNaN(+o[n+1])?{}:[]}if(l==="__proto__"||l==="constructor"||l==="prototype")return;e[l]=d,e=e[l]}};const oi={BLUR:"blur",CHANGE:"change"},ai={all:"all"},Oa=S.createContext(null);Oa.displayName="HookFormContext";const or=()=>S.useContext(Oa),zw=e=>{const{children:t,...r}=e;return S.createElement(Oa.Provider,{value:r},t)};var qw=(e,t,r,n=!0)=>{const o={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(o,a,{get:()=>{const i=a;return t._proxyFormState[i]!==ai.all&&(t._proxyFormState[i]=!n||ai.all),r&&(r[i]=!0),e[i]}});return o};const yu=typeof window<"u"?S.useLayoutEffect:S.useEffect;function wu(e){const t=or(),{control:r=t.control,disabled:n,name:o,exact:a}=e||{},[i,l]=S.useState(r._formState),d=S.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return yu(()=>r._subscribe({name:o,formState:d.current,exact:a,callback:u=>{!n&&l({...r._formState,...u})}}),[o,n,a]),S.useEffect(()=>{d.current.isValid&&r._setValid(!0)},[r]),S.useMemo(()=>qw(i,r,d.current,!1),[i,r])}var Uw=e=>typeof e=="string",Hw=(e,t,r,n,o)=>Uw(e)?je(r,e,o):Array.isArray(e)?e.map(a=>je(r,a)):r,si=e=>Ma(e)||!vu(e);function Cu(e,t,r=new WeakSet){if(si(e)||si(t))return e===t;if(fr(e)&&fr(t))return e.getTime()===t.getTime();const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const a of n){const i=e[a];if(!o.includes(a))return!1;if(a!=="ref"){const l=t[a];if(fr(i)&&fr(l)||kt(i)&&kt(l)||Array.isArray(i)&&Array.isArray(l)?!Cu(i,l,r):i!==l)return!1}}return!0}function Kw(e){const t=or(),{control:r=t.control,name:n,defaultValue:o,disabled:a,exact:i,compute:l}=e||{},d=S.useRef(o),u=S.useRef(l),f=S.useRef(void 0);u.current=l;const p=S.useMemo(()=>r._getWatch(n,d.current),[r,n]),[g,m]=S.useState(u.current?u.current(p):p);return yu(()=>r._subscribe({name:n,formState:{values:!0},exact:i,callback:b=>{if(!a){const v=Hw(n,r._names,b.values||r._formValues,!1,d.current);if(u.current){const h=u.current(v);Cu(h,f.current)||(m(h),f.current=h)}else m(v)}}}),[r,a,n,i]),S.useEffect(()=>r._removeUnmounted()),g}function Yw(e){const t=or(),{name:r,disabled:n,control:o=t.control,shouldUnregister:a,defaultValue:i}=e,l=Vw(o._names.array,r),d=S.useMemo(()=>je(o._formValues,r,je(o._defaultValues,r,i)),[o,r,i]),u=Kw({control:o,name:r,defaultValue:d,exact:!0}),f=wu({control:o,name:r,exact:!0}),p=S.useRef(e),g=S.useRef(o.register(r,{...e.rules,value:u,...wo(e.disabled)?{disabled:e.disabled}:{}}));p.current=e;const m=S.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!je(f.errors,r)},isDirty:{enumerable:!0,get:()=>!!je(f.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!je(f.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!je(f.validatingFields,r)},error:{enumerable:!0,get:()=>je(f.errors,r)}}),[f,r]),b=S.useCallback(x=>g.current.onChange({target:{value:Lw(x),name:r},type:oi.CHANGE}),[r]),v=S.useCallback(()=>g.current.onBlur({target:{value:je(o._formValues,r),name:r},type:oi.BLUR}),[r,o._formValues]),h=S.useCallback(x=>{const C=je(o._fields,r);C&&x&&(C._f.ref={focus:()=>x.focus&&x.focus(),select:()=>x.select&&x.select(),setCustomValidity:E=>x.setCustomValidity(E),reportValidity:()=>x.reportValidity()})},[o._fields,r]),y=S.useMemo(()=>({name:r,value:u,...wo(n)||f.disabled?{disabled:f.disabled||n}:{},onChange:b,onBlur:v,ref:h}),[r,n,f.disabled,b,v,h,u]);return S.useEffect(()=>{const x=o._options.shouldUnregister||a;o.register(r,{...p.current.rules,...wo(p.current.disabled)?{disabled:p.current.disabled}:{}});const C=(E,N)=>{const T=je(o._fields,E);T&&T._f&&(T._f.mount=N)};if(C(r,!0),x){const E=hu(je(o._options.defaultValues,r));ni(o._defaultValues,r,E),zo(je(o._formValues,r))&&ni(o._formValues,r,E)}return!l&&o.register(r),()=>{(l?x&&!o._state.action:x)?o.unregister(r):C(r,!1)}},[r,o,l,a]),S.useEffect(()=>{o._setDisabledField({disabled:n,name:r})},[n,r,o]),S.useMemo(()=>({field:y,formState:f,fieldState:m}),[y,f,m])}const Su=e=>e.render(Yw(e)),Eu=S.createContext(void 0),Ru=e=>{const{methods:t,disabled:r,readOnly:n,children:o}=e;return s.jsx(Eu.Provider,{value:{disabled:r,readOnly:n},children:s.jsx(zw,{...t,children:o})})},Pu=()=>{const e=S.useContext(Eu),t=or();if(!e||!t)throw new Error("formContext must be used within a FormProvider");return{...e,...t}},Xw=({type:e="button",...t})=>{const r=()=>e==="submit"||e==="reset"?"default":"outline";return s.jsx(Qe,{type:e,variant:r(),...t})};var ju={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ii=S.createContext&&S.createContext(ju),Zw=["attr","size","title"];function Jw(e,t){if(e==null)return{};var r=Qw(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Qw(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function mn(){return mn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mn.apply(this,arguments)}function li(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function gn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?li(Object(r),!0).forEach(function(n){e0(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):li(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function e0(e,t,r){return t=t0(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t0(e){var t=r0(e,"string");return typeof t=="symbol"?t:t+""}function r0(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Nu(e){return e&&e.map((t,r)=>S.createElement(t.tag,gn({key:r},t.attr),Nu(t.child)))}function ku(e){return t=>S.createElement(n0,mn({attr:gn({},e.attr)},t),Nu(e.child))}function n0(e){var t=r=>{var{attr:n,size:o,title:a}=e,i=Jw(e,Zw),l=o||r.size||"1em",d;return r.className&&(d=r.className),e.className&&(d=(d?d+" ":"")+e.className),S.createElement("svg",mn({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,i,{className:d,style:gn(gn({color:e.color||r.color},r.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),a&&S.createElement("title",null,a),e.children)};return ii!==void 0?S.createElement(ii.Consumer,null,r=>t(r)):t(ju)}function o0(e){return ku({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Circle_Info"},child:[{tag:"g",attr:{},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M11.5,15a.5.5,0,0,0,1,0h0V10.981a.5.5,0,0,0-1,0Z"},child:[]},{tag:"circle",attr:{cx:"12",cy:"8.999",r:"0.5"},child:[]}]},{tag:"path",attr:{d:"M12,2.065A9.934,9.934,0,1,1,2.066,12,9.945,9.945,0,0,1,12,2.065Zm0,18.867A8.934,8.934,0,1,0,3.066,12,8.944,8.944,0,0,0,12,20.932Z"},child:[]}]}]}]})(e)}var a0="Label",Tu=c.forwardRef((e,t)=>s.jsx(H.label,{...e,ref:t,onMouseDown:r=>{var o;r.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Tu.displayName=a0;var s0=Tu;function Au({className:e,...t}){return s.jsx(s0,{"data-slot":"label",className:j("qodo qodo-label flex items-center text-purple-muted-300 gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}const _u=c.createContext({}),i0=({...e})=>s.jsx(_u.Provider,{value:{name:e.name},children:s.jsx(Su,{...e})}),Hn=()=>{const e=c.useContext(_u),t=c.useContext(Iu),{getFieldState:r}=or(),n=wu({name:e.name}),o=r(e.name,n);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:a}=t;return{id:a,name:e.name,formItemId:`${a}-form-item`,formDescriptionId:`${a}-form-item-description`,formMessageId:`${a}-form-item-message`,...o}},Iu=c.createContext({});function l0({className:e,...t}){const r=c.useId();return s.jsx(Iu.Provider,{value:{id:r},children:s.jsx("div",{"data-slot":"form-item",className:j("qodo qodo-form-item grid gap-2",e),...t})})}function c0({className:e,...t}){const{formItemId:r}=Hn();return s.jsx(Au,{"data-slot":"form-label",className:j("data-[error=true]:text-destructive font-normal text-sm",e),htmlFor:r,...t})}function d0({...e}){const{error:t,formItemId:r,formDescriptionId:n,formMessageId:o}=Hn();return s.jsx(Qg,{"data-slot":"form-control",id:r,"aria-describedby":t?`${n} ${o}`:`${n}`,"aria-invalid":!!t,...e})}function u0({className:e,...t}){const{formDescriptionId:r}=Hn();return s.jsx("p",{"data-slot":"form-description",id:r,className:j("text-purple-muted-300 text-sm",e),...t})}function f0({className:e,...t}){const{error:r,formMessageId:n}=Hn(),o=r?String((r==null?void 0:r.message)??""):t.children;return o?s.jsx("p",{"data-slot":"form-message",id:n,className:j("text-destructive text-sm",e),...t,children:o}):null}var[Kn,fP]=we("Tooltip",[ut]),Yn=ut(),Mu="TooltipProvider",p0=700,qo="tooltip.open",[m0,Da]=Kn(Mu),Ou=e=>{const{__scopeTooltip:t,delayDuration:r=p0,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:a}=e,i=c.useRef(!0),l=c.useRef(!1),d=c.useRef(0);return c.useEffect(()=>{const u=d.current;return()=>window.clearTimeout(u)},[]),s.jsx(m0,{scope:t,isOpenDelayedRef:i,delayDuration:r,onOpen:c.useCallback(()=>{window.clearTimeout(d.current),i.current=!1},[]),onClose:c.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>i.current=!0,n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:c.useCallback(u=>{l.current=u},[]),disableHoverableContent:o,children:a})};Ou.displayName=Mu;var yr="Tooltip",[g0,Mr]=Kn(yr),Du=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o,onOpenChange:a,disableHoverableContent:i,delayDuration:l}=e,d=Da(yr,e.__scopeTooltip),u=Yn(t),[f,p]=c.useState(null),g=me(),m=c.useRef(0),b=i??d.disableHoverableContent,v=l??d.delayDuration,h=c.useRef(!1),[y,x]=ye({prop:n,defaultProp:o??!1,onChange:A=>{A?(d.onOpen(),document.dispatchEvent(new CustomEvent(qo))):d.onClose(),a==null||a(A)},caller:yr}),C=c.useMemo(()=>y?h.current?"delayed-open":"instant-open":"closed",[y]),E=c.useCallback(()=>{window.clearTimeout(m.current),m.current=0,h.current=!1,x(!0)},[x]),N=c.useCallback(()=>{window.clearTimeout(m.current),m.current=0,x(!1)},[x]),T=c.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{h.current=!0,x(!0),m.current=0},v)},[v,x]);return c.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),s.jsx(Nr,{...u,children:s.jsx(g0,{scope:t,contentId:g,open:y,stateAttribute:C,trigger:f,onTriggerChange:p,onTriggerEnter:c.useCallback(()=>{d.isOpenDelayedRef.current?T():E()},[d.isOpenDelayedRef,T,E]),onTriggerLeave:c.useCallback(()=>{b?N():(window.clearTimeout(m.current),m.current=0)},[N,b]),onOpen:E,onClose:N,disableHoverableContent:b,children:r})})};Du.displayName=yr;var Uo="TooltipTrigger",$u=c.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Mr(Uo,r),a=Da(Uo,r),i=Yn(r),l=c.useRef(null),d=se(t,l,o.onTriggerChange),u=c.useRef(!1),f=c.useRef(!1),p=c.useCallback(()=>u.current=!1,[]);return c.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),s.jsx(kr,{asChild:!0,...i,children:s.jsx(H.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:d,onPointerMove:F(e.onPointerMove,g=>{g.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:F(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:F(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:F(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:F(e.onBlur,o.onClose),onClick:F(e.onClick,o.onClose)})})});$u.displayName=Uo;var $a="TooltipPortal",[v0,h0]=Kn($a,{forceMount:void 0}),Lu=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:o}=e,a=Mr($a,t);return s.jsx(v0,{scope:t,forceMount:r,children:s.jsx(Re,{present:r||a.open,children:s.jsx(rr,{asChild:!0,container:o,children:n})})})};Lu.displayName=$a;var Xt="TooltipContent",Fu=c.forwardRef((e,t)=>{const r=h0(Xt,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...a}=e,i=Mr(Xt,e.__scopeTooltip);return s.jsx(Re,{present:n||i.open,children:i.disableHoverableContent?s.jsx(Vu,{side:o,...a,ref:t}):s.jsx(x0,{side:o,...a,ref:t})})}),x0=c.forwardRef((e,t)=>{const r=Mr(Xt,e.__scopeTooltip),n=Da(Xt,e.__scopeTooltip),o=c.useRef(null),a=se(t,o),[i,l]=c.useState(null),{trigger:d,onClose:u}=r,f=o.current,{onPointerInTransitChange:p}=n,g=c.useCallback(()=>{l(null),p(!1)},[p]),m=c.useCallback((b,v)=>{const h=b.currentTarget,y={x:b.clientX,y:b.clientY},x=C0(y,h.getBoundingClientRect()),C=S0(y,x),E=E0(v.getBoundingClientRect()),N=P0([...C,...E]);l(N),p(!0)},[p]);return c.useEffect(()=>()=>g(),[g]),c.useEffect(()=>{if(d&&f){const b=h=>m(h,f),v=h=>m(h,d);return d.addEventListener("pointerleave",b),f.addEventListener("pointerleave",v),()=>{d.removeEventListener("pointerleave",b),f.removeEventListener("pointerleave",v)}}},[d,f,m,g]),c.useEffect(()=>{if(i){const b=v=>{const h=v.target,y={x:v.clientX,y:v.clientY},x=(d==null?void 0:d.contains(h))||(f==null?void 0:f.contains(h)),C=!R0(y,i);x?g():C&&(g(),u())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[d,f,i,u,g]),s.jsx(Vu,{...e,ref:a})}),[b0,y0]=Kn(yr,{isInside:!1}),w0=tv("TooltipContent"),Vu=c.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:i,...l}=e,d=Mr(Xt,r),u=Yn(r),{onClose:f}=d;return c.useEffect(()=>(document.addEventListener(qo,f),()=>document.removeEventListener(qo,f)),[f]),c.useEffect(()=>{if(d.trigger){const p=g=>{const m=g.target;m!=null&&m.contains(d.trigger)&&f()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[d.trigger,f]),s.jsx(Qt,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:p=>p.preventDefault(),onDismiss:f,children:s.jsxs(Tn,{"data-state":d.stateAttribute,...u,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[s.jsx(w0,{children:n}),s.jsx(b0,{scope:r,isInside:!0,children:s.jsx(Hh,{id:d.contentId,role:"tooltip",children:o||n})})]})})});Fu.displayName=Xt;var Bu="TooltipArrow",Gu=c.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Yn(r);return y0(Bu,r).isInside?null:s.jsx(An,{...o,...n,ref:t})});Gu.displayName=Bu;function C0(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(r,n,o,a)){case a:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function S0(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function E0(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function R0(e,t){const{x:r,y:n}=e;let o=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){const l=t[a],d=t[i],u=l.x,f=l.y,p=d.x,g=d.y;f>n!=g>n&&r<(p-u)*(n-f)/(g-f)+u&&(o=!o)}return o}function P0(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),j0(t)}function j0(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const a=t[t.length-1],i=t[t.length-2];if((a.x-i.x)*(o.y-i.y)>=(a.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const a=r[r.length-1],i=r[r.length-2];if((a.x-i.x)*(o.y-i.y)>=(a.y-i.y)*(o.x-i.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var N0=Ou,k0=Du,T0=$u,A0=Lu,_0=Fu,I0=Gu;function Wu({delayDuration:e=0,...t}){return s.jsx(N0,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function zu({...e}){return s.jsx(Wu,{children:s.jsx(k0,{"data-slot":"tooltip",...e})})}function qu({...e}){return s.jsx(T0,{"data-slot":"tooltip-trigger",...e})}function Uu({className:e,sideOffset:t=0,children:r,disableArrow:n=!1,...o}){return s.jsx(A0,{children:s.jsxs(_0,{"data-slot":"tooltip-content",sideOffset:t,className:j("qodo qodo-tooltip-content bg-purple-muted-700 border border-purple-muted-600 text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e,{"py-2.5":n}),...o,children:[r,!n&&s.jsx(I0,{className:"bg-purple-muted-700 fill-purple-muted-700 z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const ar=e=>t=>{const{name:r,label:n,description:o,tooltip:a,required:i=!1,...l}=t,{control:d,disabled:u,readOnly:f}=Pu(),p=()=>a?s.jsxs(zu,{children:[s.jsx(qu,{asChild:!0,children:s.jsx("span",{children:s.jsx(o0,{size:16})})}),s.jsx(Uu,{children:s.jsx("p",{children:a})})]}):s.jsx(s.Fragment,{}),g=()=>o?s.jsx(u0,{children:o}):s.jsx(s.Fragment,{});return s.jsx(i0,{control:d,name:r,render:({field:m,fieldState:b})=>s.jsxs(l0,{className:"flex flex-col gap-1.5",children:[n&&s.jsx(c0,{children:s.jsxs("span",{className:"flex items-center gap-1",children:[n,i&&s.jsx("span",{className:"text-purple-muted-300",children:"*"}),!!a&&p()]})}),s.jsx(d0,{children:s.jsx(e,{...m,disabled:u,...l,readOnly:f,error:!!b.error})}),!!o&&g(),s.jsx(f0,{})]})})},M0=S.forwardRef((e,t)=>s.jsx(Rr,{...e,ref:t})),O0=S.forwardRef((e,t)=>ar(M0)({...e,ref:t})),D0=S.forwardRef((e,t)=>{const{options:r=[],onChange:n=()=>{},searchPlaceholder:o,onSearchChange:a,...i}=e,l=d=>{n({target:{value:d}})};return s.jsx(Ca,{ref:t,options:r,onValueChange:l,searchPlaceholder:o,onSearchChange:a,...i})}),$0=ar(D0);var La="Radio",[L0,Hu]=we(La),[F0,V0]=L0(La),Ku=c.forwardRef((e,t)=>{const{__scopeRadio:r,name:n,checked:o=!1,required:a,disabled:i,value:l="on",onCheck:d,form:u,...f}=e,[p,g]=c.useState(null),m=se(t,h=>g(h)),b=c.useRef(!1),v=p?u||!!p.closest("form"):!0;return s.jsxs(F0,{scope:r,checked:o,disabled:i,children:[s.jsx(H.button,{type:"button",role:"radio","aria-checked":o,"data-state":Ju(o),"data-disabled":i?"":void 0,disabled:i,value:l,...f,ref:m,onClick:F(e.onClick,h=>{o||d==null||d(),v&&(b.current=h.isPropagationStopped(),b.current||h.stopPropagation())})}),v&&s.jsx(Zu,{control:p,bubbles:!b.current,name:n,value:l,checked:o,required:a,disabled:i,form:u,style:{transform:"translateX(-100%)"}})]})});Ku.displayName=La;var Yu="RadioIndicator",Xu=c.forwardRef((e,t)=>{const{__scopeRadio:r,forceMount:n,...o}=e,a=V0(Yu,r);return s.jsx(Re,{present:n||a.checked,children:s.jsx(H.span,{"data-state":Ju(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:t})})});Xu.displayName=Yu;var B0="RadioBubbleInput",Zu=c.forwardRef(({__scopeRadio:e,control:t,checked:r,bubbles:n=!0,...o},a)=>{const i=c.useRef(null),l=se(i,a),d=da(r),u=ia(t);return c.useEffect(()=>{const f=i.current;if(!f)return;const p=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(p,"checked").set;if(d!==r&&m){const b=new Event("click",{bubbles:n});m.call(f,r),f.dispatchEvent(b)}},[d,r,n]),s.jsx(H.input,{type:"radio","aria-hidden":!0,defaultChecked:r,...o,tabIndex:-1,ref:l,style:{...o.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Zu.displayName=B0;function Ju(e){return e?"checked":"unchecked"}var G0=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Xn="RadioGroup",[W0,pP]=we(Xn,[gt,Hu]),Qu=gt(),ef=Hu(),[z0,q0]=W0(Xn),tf=c.forwardRef((e,t)=>{const{__scopeRadioGroup:r,name:n,defaultValue:o,value:a,required:i=!1,disabled:l=!1,orientation:d,dir:u,loop:f=!0,onValueChange:p,...g}=e,m=Qu(r),b=Tt(u),[v,h]=ye({prop:a,defaultProp:o??null,onChange:p,caller:Xn});return s.jsx(z0,{scope:r,name:n,required:i,disabled:l,value:v,onValueChange:h,children:s.jsx(Bn,{asChild:!0,...m,orientation:d,dir:b,loop:f,children:s.jsx(H.div,{role:"radiogroup","aria-required":i,"aria-orientation":d,"data-disabled":l?"":void 0,dir:b,...g,ref:t})})})});tf.displayName=Xn;var rf="RadioGroupItem",nf=c.forwardRef((e,t)=>{const{__scopeRadioGroup:r,disabled:n,...o}=e,a=q0(rf,r),i=a.disabled||n,l=Qu(r),d=ef(r),u=c.useRef(null),f=se(t,u),p=a.value===o.value,g=c.useRef(!1);return c.useEffect(()=>{const m=v=>{G0.includes(v.key)&&(g.current=!0)},b=()=>g.current=!1;return document.addEventListener("keydown",m),document.addEventListener("keyup",b),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keyup",b)}},[]),s.jsx(Gn,{asChild:!0,...l,focusable:!i,active:p,children:s.jsx(Ku,{disabled:i,required:a.required,checked:p,...d,...o,name:a.name,ref:f,onCheck:()=>a.onValueChange(o.value),onKeyDown:F(m=>{m.key==="Enter"&&m.preventDefault()}),onFocus:F(o.onFocus,()=>{var m;g.current&&((m=u.current)==null||m.click())})})})});nf.displayName=rf;var U0="RadioGroupIndicator",of=c.forwardRef((e,t)=>{const{__scopeRadioGroup:r,...n}=e,o=ef(r);return s.jsx(Xu,{...o,...n,ref:t})});of.displayName=U0;var H0=tf,K0=nf,Y0=of;function X0({className:e,...t}){const{readOnly:r,...n}=t;return s.jsx(H0,{"data-slot":"radio-group","data-readonly":r||void 0,disabled:n.disabled||r,className:j("qodo qodo-radio-group grid gap-3 group",e),...n})}function Z0({className:e,...t}){return s.jsx(K0,{"data-slot":"radio-group-item",className:j("qodo qodo-radio-group-item dark:border-purple-muted-200 dark:text-purple-muted-200 focus-visible:border-ring focus-visible:ring-ring/50","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive","aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px]","disabled:cursor-not-allowed disabled:opacity-50","group-data-[readonly]:opacity-100 group-data-[readonly]:cursor-default","mt-[2px] mr-0",e),...t,children:s.jsx(Y0,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:s.jsx(jg,{className:"fill-purple-muted-200 absolute top-1/2 left-1/2 size-3 -translate-x-1/2 -translate-y-1/2"})})})}const Fa=S.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:o,disabled:a=!1,readOnly:i=!1,className:l,direction:d="horizontal",dir:u="ltr",name:f,onChange:p,...g}=e,m=v=>{i||(p==null||p({target:{value:v}}),o==null||o(v))},b=j("qodo qodo-custom-radio-group","flex",{"flex-row gap-6":d==="horizontal","flex-col gap-3":d==="vertical"},l);return s.jsx(X0,{name:f,ref:t,value:r,defaultValue:n,onValueChange:m,disabled:a||i,readOnly:i,className:b,dir:u,...g})});Fa.displayName="BaseRadioGroupComponent";const Va=({value:e="",disabled:t,error:r,name:n="radio",children:o,className:a})=>{const i=`${n}-${e}`;return s.jsxs(Au,{htmlFor:i,className:j("flex items-start p-4 rounded-lg gap-2 transition-all duration-200","font-normal text-purple-muted-200 dark:text-purple-muted-200 leading-5",{"cursor-pointer hover:bg-muted/50":!t,"opacity-50 !cursor-not-allowed hover:!bg-transparent":t,"border border-destructive":r},a),children:[s.jsx(Z0,{value:e,id:i,disabled:t||r}),o]},e)};Va.displayName="RadioGroupItemComponent";const J0=ar(Fa),Q0=e=>s.jsx("hr",{className:"w-full h-px border-purple-muted-500",...e}),eC=({children:e,description:t,className:r})=>s.jsxs("div",{className:j("space-y-1",r),children:[s.jsx("h2",{className:"flex items-center gap-2.5 text-2xl text-white",children:e}),t&&s.jsx("span",{className:"text-sm text-purple-muted-300",children:t})]}),af=S.forwardRef(({direction:e="horizontal",className:t,...r},n)=>{const o=j("flex flex-row gap-6",{"flex-col":e==="vertical"},t);return s.jsx("div",{ref:n,className:o,...r})});af.displayName="FormGroup";function tC({className:e,rows:t,...r}){return s.jsx("textarea",{"data-slot":"textarea",rows:t,className:j("qodo qodo-textarea border-input px-3 py-2 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20","dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex min-h-16 w-full rounded-md border bg-transparent","placeholder:text-purple-muted-400 text-purple-muted-300 shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] selection:bg-primary selection:text-primary-foreground disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-purple-muted-700 disabled:border-purple-muted-500 disabled:text-purple-muted-400 read-only:bg-purple-muted-700 read-only:border-purple-muted-400 read-only:cursor-default read-only:text-purple-muted-200 md:text-sm",{"field-sizing-content":!t},e),...r})}const rC=S.forwardRef(({variant:e="default",className:t,...r},n)=>{const o=ar(tC);return s.jsx(o,{...r,ref:n,className:j({"font-plex-mono text-sm leading-relaxed rounded dark:bg-fill-input-neutral-idle px-3 py-2 border-0":e==="code"},t)})}),sf=({label:e,id:t,onRemoveTag:r,disabled:n,className:o,variant:a="default"})=>s.jsxs(Yt,{variant:a,disabled:n,size:"sm",className:j("flex items-center gap-1 px-2 py-0.5","font-normal whitespace-nowrap",o),children:[e,r&&s.jsx(Qe,{type:"button",variant:"ghost",size:"icon",className:"p-0 w-[10px] h-[10px] text-inherit disabled:text-inherit",onClick:i=>{i.stopPropagation(),r==null||r(t)},"aria-label":`Remove ${e}`,disabled:n,children:s.jsx(Sn,{className:"w-[10px] h-[10px]"})})]}),nC=({label:e,id:t,onClick:r,onDeleteSuggestion:n,deleteText:o,className:a,tagClassName:i,tagVariant:l})=>s.jsx("div",{onClick:r,className:j("bg-transparent hover:bg-purple-muted-800 rounded-sm py-1 px-2",a),children:s.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[s.jsx(sf,{label:e,id:t,className:i,variant:l}),n&&s.jsx(Qe,{type:"button",variant:"ghost",className:"p-0 text-xs font-normal h-[10px]",onMouseDown:d=>d.preventDefault(),onClick:d=>{d.stopPropagation(),n==null||n(t)},"aria-label":`${o} ${e}`,children:o||s.jsx(zg,{className:"h-4 w-4"})})]})}),Co={BACKSPACE:"Backspace",ESCAPE:"Escape",ENTER:"Enter"},oC=e=>{if(!e)return"";let t=e.toLowerCase();return t=t.replace(/[_\s]+/g,"-"),t=t.replace(/[^a-z0-9-]/g,""),t=t.replace(/-+/g,"-"),t=t.replace(/^-|-$/g,""),t},lf=({value:e=[],variant:t="default",placeholder:r="Type to add a tag...",deleteText:n="Delete",suggestions:o=[],allowCreate:a=!0,maxTags:i=100,disabled:l=!1,className:d,suggestionWrapperClassName:u,suggestionClassName:f,tagClassName:p,tagInputIcon:g,onDeleteSuggestion:m,onBlur:b,normalizeTags:v=oC,onChange:h=()=>{},onAddTag:y=()=>{},onRemoveTag:x=()=>{},onResetTags:C=()=>{}})=>{const[E,N]=S.useState(""),[T,A]=S.useState(!1),P=S.useRef(null),V=S.useRef(null),U=S.useRef(null),[re,te]=S.useState();S.useEffect(()=>{V.current&&te(V.current.offsetWidth)},[]);const Q=e.length>=i,W=L=>{if(Q||e.some(K=>K.id===L.id))return;const _=[...e,L];h(_),y(L)},D=L=>{const _=e.filter(K=>K.id!==L);h(_),x(L)},I=()=>{h==null||h([]),C()},O=L=>{const _=L.target.value;N(_),A(!0)},R=()=>{const L=E.trim().toLowerCase();if(!L)return[];const _=new Set(e.map(K=>K.id));return o.filter(K=>K.label.toLowerCase().includes(L)&&!_.has(K.id))},M=L=>v?v(L):L,B=()=>{const L=E.trim();if(!L)return;const _=M(L);if(!_)return;if(e.some(ee=>ee.id===_)){N(""),A(!1);return}const K=o.find(ee=>ee.id===_||M(ee.label)===_);K?W(K):a&&W({id:_,label:_}),N(""),A(!1)},J=L=>{const _=L.key===Co.BACKSPACE&&!E&&e.length>0,K=L.key===Co.ENTER&&E,ee=L.key===Co.ESCAPE;K?(L.preventDefault(),B(),U.current&&(U.current.scrollLeft=U.current.scrollWidth)):_?D(e[e.length-1].id):ee&&A(!1)},k=()=>{if(E&&R().length>0)return s.jsx(wa,{className:"p-0 border-transparent bg-[var(--fill-interactive-neutral-idle)] gap-2",align:"start",style:{width:re??void 0},onOpenAutoFocus:L=>L.preventDefault(),onCloseAutoFocus:L=>L.preventDefault(),onMouseDown:L=>L.preventDefault(),children:s.jsx("div",{className:j("max-h-[200px] overflow-y-auto flex flex-col gap-1 p-1",u),children:R().map(L=>s.jsx(nC,{label:L.label,id:L.id,onDeleteSuggestion:m,deleteText:n,className:f,tagClassName:p,tagVariant:t,onClick:()=>{var _;W(L),N(""),A(!1),(_=P.current)==null||_.focus()}},L.id))})})},G=()=>g||s.jsx(Gg,{className:"h-4 w-4 stroke-[var(--icon-bg-neutral-mild)]"}),Z=()=>e.map(L=>s.jsx(sf,{label:L.label,id:L.id,onRemoveTag:D,disabled:l,className:p,variant:t},L.id)),z=()=>e.length===0?s.jsx(s.Fragment,{}):s.jsx(Sn,{className:"h-4 w-4 hover:cursor-pointer stroke-[var(--icon-input-neutral-idle)] hover:stroke-[var(--icon-input-neutral-hover)]",onClick:I});return s.jsx("div",{className:j("w-full",d),children:s.jsxs(ba,{open:T&&!l,onOpenChange:A,modal:!1,children:[s.jsx(ya,{className:"w-full",children:s.jsxs("div",{ref:V,tabIndex:-1,className:j("flex items-center gap-2 border border-[var(--border-tag-neutral-idle)] bg-purple-muted-800 py-0.5 px-3 rounded-md scrollbar-thin",{"opacity-60":l}),onClick:L=>{var _;L.stopPropagation(),A(!0),(_=P.current)==null||_.focus()},children:[G(),s.jsxs("div",{ref:U,className:"flex items-center gap-2 w-full whitespace-normal overflow-x-auto",children:[Z(),s.jsx(Rr,{ref:P,value:E,onChange:O,onClick:L=>L.stopPropagation(),onFocus:()=>A(!0),onBlur:b,onKeyDown:J,placeholder:r,disabled:l||Q,className:j("m-0 h-6.5 flex-1 min-w-[6rem] border-0 bg-transparent dark:bg-transparent p-0 shadow-none focus-visible:outline-none focus-visible:ring-0 font-normal text-xs","placeholder:text-[var(--text-input-neutral-placeholder)] dark:placeholder:text-[var(--text-input-neutral-placeholder)] placeholder:text-xs")})]}),z()]})}),k()]})})};function aC(e){const{control:t}=or();return s.jsx(Su,{name:e.name,control:t,render:({field:r})=>s.jsx(lf,{...e,value:r.value,onChange:r.onChange,onBlur:r.onBlur})})}const sC=ar(aC),iC=12,ci={SINGLE:"single",MULTIPLE:"multiple"},di={LTR:"ltr"};var cf=typeof global=="object"&&global&&global.Object===Object&&global,lC=typeof self=="object"&&self&&self.Object===Object&&self,ht=cf||lC||Function("return this")(),vn=ht.Symbol,df=Object.prototype,cC=df.hasOwnProperty,dC=df.toString,dr=vn?vn.toStringTag:void 0;function uC(e){var t=cC.call(e,dr),r=e[dr];try{e[dr]=void 0;var n=!0}catch{}var o=dC.call(e);return n&&(t?e[dr]=r:delete e[dr]),o}var fC=Object.prototype,pC=fC.toString;function mC(e){return pC.call(e)}var gC="[object Null]",vC="[object Undefined]",ui=vn?vn.toStringTag:void 0;function Or(e){return e==null?e===void 0?vC:gC:ui&&ui in Object(e)?uC(e):mC(e)}function Ba(e){return e!=null&&typeof e=="object"}var hC=Array.isArray;function uf(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var xC="[object AsyncFunction]",bC="[object Function]",yC="[object GeneratorFunction]",wC="[object Proxy]";function ff(e){if(!uf(e))return!1;var t=Or(e);return t==bC||t==yC||t==xC||t==wC}var So=ht["__core-js_shared__"],fi=(function(){var e=/[^.]+$/.exec(So&&So.keys&&So.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function CC(e){return!!fi&&fi in e}var SC=Function.prototype,EC=SC.toString;function _t(e){if(e!=null){try{return EC.call(e)}catch{}try{return e+""}catch{}}return""}var RC=/[\\^$.*+?()[\]{}|]/g,PC=/^\[object .+?Constructor\]$/,jC=Function.prototype,NC=Object.prototype,kC=jC.toString,TC=NC.hasOwnProperty,AC=RegExp("^"+kC.call(TC).replace(RC,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function _C(e){if(!uf(e)||CC(e))return!1;var t=ff(e)?AC:PC;return t.test(_t(e))}function IC(e,t){return e==null?void 0:e[t]}function Dr(e,t){var r=IC(e,t);return _C(r)?r:void 0}var Ho=Dr(ht,"WeakMap"),MC=9007199254740991;function pf(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=MC}function OC(e){return e!=null&&pf(e.length)&&!ff(e)}var DC=Object.prototype;function mf(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||DC;return e===r}var $C="[object Arguments]";function pi(e){return Ba(e)&&Or(e)==$C}var gf=Object.prototype,LC=gf.hasOwnProperty,FC=gf.propertyIsEnumerable,VC=pi((function(){return arguments})())?pi:function(e){return Ba(e)&&LC.call(e,"callee")&&!FC.call(e,"callee")};function BC(){return!1}var vf=typeof exports=="object"&&exports&&!exports.nodeType&&exports,mi=vf&&typeof module=="object"&&module&&!module.nodeType&&module,GC=mi&&mi.exports===vf,gi=GC?ht.Buffer:void 0,WC=gi?gi.isBuffer:void 0,zC=WC||BC,qC="[object Arguments]",UC="[object Array]",HC="[object Boolean]",KC="[object Date]",YC="[object Error]",XC="[object Function]",ZC="[object Map]",JC="[object Number]",QC="[object Object]",e1="[object RegExp]",t1="[object Set]",r1="[object String]",n1="[object WeakMap]",o1="[object ArrayBuffer]",a1="[object DataView]",s1="[object Float32Array]",i1="[object Float64Array]",l1="[object Int8Array]",c1="[object Int16Array]",d1="[object Int32Array]",u1="[object Uint8Array]",f1="[object Uint8ClampedArray]",p1="[object Uint16Array]",m1="[object Uint32Array]",pe={};pe[s1]=pe[i1]=pe[l1]=pe[c1]=pe[d1]=pe[u1]=pe[f1]=pe[p1]=pe[m1]=!0;pe[qC]=pe[UC]=pe[o1]=pe[HC]=pe[a1]=pe[KC]=pe[YC]=pe[XC]=pe[ZC]=pe[JC]=pe[QC]=pe[e1]=pe[t1]=pe[r1]=pe[n1]=!1;function g1(e){return Ba(e)&&pf(e.length)&&!!pe[Or(e)]}function v1(e){return function(t){return e(t)}}var hf=typeof exports=="object"&&exports&&!exports.nodeType&&exports,hr=hf&&typeof module=="object"&&module&&!module.nodeType&&module,h1=hr&&hr.exports===hf,Eo=h1&&cf.process,vi=(function(){try{var e=hr&&hr.require&&hr.require("util").types;return e||Eo&&Eo.binding&&Eo.binding("util")}catch{}})(),hi=vi&&vi.isTypedArray,x1=hi?v1(hi):g1;function b1(e,t){return function(r){return e(t(r))}}var y1=b1(Object.keys,Object),w1=Object.prototype,C1=w1.hasOwnProperty;function S1(e){if(!mf(e))return y1(e);var t=[];for(var r in Object(e))C1.call(e,r)&&r!="constructor"&&t.push(r);return t}var Ko=Dr(ht,"Map"),Yo=Dr(ht,"DataView"),Xo=Dr(ht,"Promise"),Zo=Dr(ht,"Set"),xi="[object Map]",E1="[object Object]",bi="[object Promise]",yi="[object Set]",wi="[object WeakMap]",Ci="[object DataView]",R1=_t(Yo),P1=_t(Ko),j1=_t(Xo),N1=_t(Zo),k1=_t(Ho),Ct=Or;(Yo&&Ct(new Yo(new ArrayBuffer(1)))!=Ci||Ko&&Ct(new Ko)!=xi||Xo&&Ct(Xo.resolve())!=bi||Zo&&Ct(new Zo)!=yi||Ho&&Ct(new Ho)!=wi)&&(Ct=function(e){var t=Or(e),r=t==E1?e.constructor:void 0,n=r?_t(r):"";if(n)switch(n){case R1:return Ci;case P1:return xi;case j1:return bi;case N1:return yi;case k1:return wi}return t});var T1="[object Map]",A1="[object Set]",_1=Object.prototype,I1=_1.hasOwnProperty;function $r(e){if(e==null)return!0;if(OC(e)&&(hC(e)||typeof e=="string"||typeof e.splice=="function"||zC(e)||x1(e)||VC(e)))return!e.length;var t=Ct(e);if(t==T1||t==A1)return!e.size;if(mf(e))return!S1(e).length;for(var r in e)if(I1.call(e,r))return!1;return!0}function Zn(e){return!e.children||e.children.length===0?[e.value]:e.children.flatMap(t=>Zn(t))}function Ga(e){const t=[e.value];return e.children&&e.children.forEach(r=>{t.push(...Ga(r))}),t}function Wa(e,t){return $r(e.children)?!1:Zn(e).every(n=>t.has(n))}function M1(e,t){return $r(e.children)?!1:Zn(e).some(n=>t.has(n))}function xf(e,t){for(const r of e){if(r.value===t)return r;if(r.children){const n=xf(r.children,t);if(n)return n}}return null}function za(e,t){const r=new Map;for(const n of e){const o=t(n);o&&r.set(o[0],o[1]),n.children&&za(n.children,t).forEach((i,l)=>r.set(l,i))}return r}function bf(e,t){e.forEach(r=>{$r(r.children)||(Wa(r,t)?t.add(r.value):t.delete(r.value),r.children&&bf(r.children,t))})}const O1=e=>e?Array.isArray(e)?e:[e]:[],D1=e=>za(e,t=>[t.value,t.label]),$1=e=>za(e,t=>t.icon?[t.value,t.icon]:null);function L1(e,t){Ga(e).forEach(n=>t.delete(n))}function F1(e,t){Ga(e).forEach(n=>t.add(n))}function yf(e,t){const r=new Set(t);return e.flatMap(n=>!$r(n.children)&&n.children?Wa(n,r)?[n.value]:yf(n.children,t):r.has(n.value)?[n.value]:[])}function V1(e){return e&&e>1?e*iC:0}function wf({option:e,selected:t,onSelect:r,nestLevel:n=0,disabled:o=!1,dir:a=di.LTR}){const i=!$r(e.children),l=t.has(e.value),d=`${V1(n)}px`,u=Wa(e,t),p=M1(e,t)&&!u,g=l||u,m=()=>{if(n!==0)return s.jsx(kg,{className:"w-4 text-[var(--text-interactive-neutral-idle)]"})},b=()=>{if(e.icon)return s.jsx("div",{className:"flex-shrink-0 [&>svg]:text-[var(--text-interactive-neutral-idle)]!",children:e.icon})},v=()=>p?s.jsx(Ag,{className:"w-2 h-2 flex-shrink-0 transition-opacity text-[var(--text-interactive-neutral-idle)]"}):s.jsx(Er,{className:j("h-4 w-4 flex-shrink-0 transition-opacity text-[var(--text-interactive-neutral-idle)] opacity-0",{"opacity-100":g})}),h=()=>{if(i)return e.children.map(x=>s.jsx(wf,{option:x,selected:t,onSelect:r,nestLevel:n+1,dir:a},x.value))},y=()=>s.jsxs("div",{className:j("flex items-center w-full gap-2 flex-row",{"flex-row-reverse":a===di.LTR}),style:{paddingLeft:d},children:[s.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[m(),b(),s.jsx("span",{className:"flex-1 text-[var(--text-interactive-neutral-active)]",children:e.label})]}),v()]});return s.jsxs("div",{children:[s.jsx(od,{disabled:e.disabled||o,onSelect:()=>r(e.value,i),className:j("text-[var(--text-interactive-neutral-idle)] hover:text-[var(--text-interactive-neutral-hover)]! cursor-pointer disabled:cursor-not-allowed","focus:text-[var(--text-interactive-neutral-active)] data-[selected=true]:text-[var(--text-interactive-neutral-hover)]!",{"bg-[var(--fill-interactive-neutral-idle)]":g}),children:y()}),h()]})}function B1({value:e,options:t=[],onSelect:r,disabled:n=!1,mode:o=ci.SINGLE,placeholder:a="Select...",inputPlaceholder:i="Search...",emptyState:l="No option found.",triggerClassName:d,triggerWrapperClassName:u,badgeClassName:f,badgeVariant:p="text",searchable:g=!1,toggleIcon:m=s.jsx(Cn,{}),dir:b="ltr",...v}){const[h,y]=S.useState(0),[x,C]=S.useState(!1),E=S.useRef(null),N=o===ci.MULTIPLE,[T,A]=S.useState(e!==void 0?e:N?[]:""),P=O1(T),V=new Set(P);S.useEffect(()=>{E.current&&y(E.current.offsetWidth)},[T]);const U=D1(t),re=$1(t);S.useEffect(()=>{e!==void 0&&A(N?e||[]:e||"")},[e,N]);function te(O,R){if(!N){A(O),r==null||r(O),C(!1);return}A(M=>{const B=Array.isArray(M)?M:[],J=new Set(B),k=xf(t,O);if(!k)return B;R?Q(k,J):W(O,J);const G=Array.from(J);return r==null||r(G),G})}function Q(O,R){Zn(O).every(J=>R.has(J))?L1(O,R):F1(O,R)}function W(O,R){R.has(O)?R.delete(O):R.add(O),bf(t,R)}const D=()=>{const O=yf(t,P);return O.length===0?s.jsx(Yt,{variant:p,size:"md",className:j("text-purple-muted-300",f),children:a}):O.map(M=>{const B=re.get(M),J=U.get(M)||M;return s.jsx(Yt,{variant:p,size:"md",className:j("text-[var(--text-bg-neutral-mid)]",f),children:s.jsxs("div",{className:"flex items-center gap-1",children:[B&&s.jsx("div",{className:"flex-shrink-0",children:B}),s.jsx("span",{children:J})]})},M)})},I=()=>{if(g)return s.jsx(ed,{className:"placeholder:text-[var(--text-bg-neutral-mid)] text-[var(--text-interactive-neutral-active)]",placeholder:i})};return s.jsxs(ba,{open:x,onOpenChange:n?void 0:C,children:[s.jsx(ya,{asChild:!0,disabled:n,children:s.jsxs("div",{className:j("flex items-center gap-1.5 justify-between py-1 px-3 w-[100%] border border-[var(--border-interactive-neutral-idle)] bg-[var(--fill-input-neutral-idle)] rounded-sm scrollbar-thin","aria-invalid:!border-destructive aria-invalid:!ring-destructive/20 dark:aria-invalid:!ring-destructive/40",{"cursor-pointer hover:border-[var(--border-input-neutral-hover)] hover:bg-[var(--fill-input-neutral-hover)]":!n,"cursor-not-allowed opacity-75 ":n},u),ref:E,"aria-disabled":n,...v,children:[s.jsx("div",{className:j("flex justify-start text-start w-[100%] whitespace-nowrap overflow-x-auto gap-1.5",d),children:D()}),s.jsx("div",{className:"[&>svg]:text-[var(--icon-input-neutral-idle)] [&>svg]:hover:text-[var(--icon-input-neutral-hover)] [&>svg]:w-4 [&>svg]:h-4",children:m})]})}),s.jsx(wa,{className:"p-0 border bg-[var(--fill-interactive-neutral-idle)] border-[var(--border-interactive-neutral-idle)] [&>svg]:text-purple-muted-300",style:{width:h??"auto"},children:s.jsxs(Qc,{className:"bg-[var(--fill-interactive-neutral-idle)]",children:[I(),s.jsxs(td,{children:[s.jsx(rd,{children:l}),s.jsx(nd,{children:t.map(O=>s.jsx(wf,{disabled:n,option:O,selected:V,onSelect:te,dir:b},O.value))})]})]})})]})}const Cf=S.forwardRef(e=>{const{options:t,onChange:r,readOnly:n,value:o,disabled:a,mode:i,...l}=e,d=u=>{n||r&&r({target:{value:u}})};return s.jsx(B1,{options:t,value:o,disabled:a,...l,onSelect:d,mode:i})});Cf.displayName="BaseSelectComponent";const G1=ar(Cf),Ie=e=>{const{className:t,disabled:r=!1,readOnly:n=!1,methods:o,onSubmit:a=()=>{},...i}=e,{handleSubmit:l}=o,d=j("qodo qodo-form","flex flex-col gap-6",t);return s.jsx(Ru,{methods:o,disabled:r,readOnly:n,children:s.jsx("form",{className:d,onSubmit:l(a),...i})})};Ie.Button=Xw;Ie.Input=O0;Ie.Select=G1;Ie.Combobox=$0;Ie.RadioGroup=J0;Ie.RadioGroupItem=Va;Ie.Group=af;Ie.Textarea=rC;Ie.Divider=Q0;Ie.Title=eC;Ie.TagsInput=sC;function W1(e){return e==null?[]:Array.isArray(e)?e:[e]}var z1=e=>Array.from(Array(e).keys()),Si=e=>(e==null?void 0:e.constructor.name)==="Array",q1=(e,t)=>{if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!qa(e[r],t[r]))return!1;return!0},qa=(e,t)=>{if(Object.is(e,t))return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(typeof(e==null?void 0:e.isEqual)=="function"&&typeof(t==null?void 0:t.isEqual)=="function")return e.isEqual(t);if(typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();if(Si(e)&&Si(t))return q1(Array.from(e),Array.from(t));if(typeof e!="object"||typeof t!="object")return!1;const r=Object.keys(t??Object.create(null)),n=r.length;for(let o=0;o<n;o++)if(!Reflect.has(e,r[o]))return!1;for(let o=0;o<n;o++){const a=r[o];if(!qa(e[a],t[a]))return!1}return!0},U1=e=>e!=null&&typeof e=="object",nn=e=>typeof e=="string",pr=e=>typeof e=="function",H1=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),K1=e=>Object.prototype.toString.call(e),Sf=Function.prototype.toString,Y1=Sf.call(Object),X1=e=>{if(!U1(e)||K1(e)!="[object Object]"||Q1(e))return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const r=H1(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Sf.call(r)==Y1},Z1=e=>typeof e=="object"&&e!==null&&"$$typeof"in e&&"props"in e,J1=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,Q1=e=>Z1(e)||J1(e),eS=e=>e(),tS=(...e)=>(...t)=>{e.forEach(function(r){r==null||r(...t)})},rS=e=>Number.isNaN(e),nS=e=>rS(e)?0:e,oS=(e,t,r)=>{const n=nS(e),o=n>=t,a=r==null||n<=r;return o&&a};function Ef(e){if(!X1(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(n=>typeof n=="string"),r={};for(const n of t){const o=e[n];o!==void 0&&(r[n]=Ef(o))}return r}function Ei(...e){const t=e.length===1?e[0]:e[1];(e.length===2?e[0]:!0)&&process.env.NODE_ENV!=="production"&&console.warn(t)}function aS(e,t){if(e==null)throw new Error(t())}var Rf=e=>typeof e=="object"&&e!==null,We=e=>e?"":void 0,sS=9,iS=e=>Rf(e)&&e.nodeType===sS,lS=e=>Rf(e)&&e===e.window;function cS(e){if(!e)return!1;const t=e.getRootNode();return Pf(t)===e}function dS(e){return iS(e)?e:lS(e)?e.document:(e==null?void 0:e.ownerDocument)??document}function Pf(e){let t=e.activeElement;for(;t!=null&&t.shadowRoot;){const r=t.shadowRoot.activeElement;if(!r||r===t)break;t=r}return t}var uS=(...e)=>e.map(t=>{var r;return(r=t==null?void 0:t.trim)==null?void 0:r.call(t)}).filter(Boolean).join(" "),fS=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,Ri=e=>{const t={};let r;for(;r=fS.exec(e);)t[r[1]]=r[2];return t},pS=(e,t)=>{if(nn(e)){if(nn(t))return`${e};${t}`;e=Ri(e)}else nn(t)&&(t=Ri(t));return Object.assign({},e??{},t??{})};function Be(...e){let t={};for(let r of e){if(!r)continue;for(let o in t){if(o.startsWith("on")&&typeof t[o]=="function"&&typeof r[o]=="function"){t[o]=tS(r[o],t[o]);continue}if(o==="className"||o==="class"){t[o]=uS(t[o],r[o]);continue}if(o==="style"){t[o]=pS(t[o],r[o]);continue}t[o]=r[o]!==void 0?r[o]:t[o]}for(let o in r)t[o]===void 0&&(t[o]=r[o]);const n=Object.getOwnPropertySymbols(r);for(let o of n)t[o]=r[o]}return t}function mS(e,t,r){let n=[],o;return a=>{const i=e(a);return(i.length!==n.length||i.some((d,u)=>!qa(n[u],d)))&&(n=i,o=t(i,a)),o}}var Wt=(e=>(e.NotStarted="Not Started",e.Started="Started",e.Stopped="Stopped",e))(Wt||{}),Ro="__init__";function gS(e){const t=()=>{var i;return((i=e.getRootNode)==null?void 0:i.call(e))??document},r=()=>dS(t());return{...e,getRootNode:t,getDoc:r,getWin:()=>r().defaultView??window,getActiveElement:()=>Pf(t()),isActiveElement:cS,getById:i=>t().getElementById(i)}}function vS(e){return new Proxy({},{get(t,r){return r==="style"?n=>e({style:n}).style:e}})}var hS=()=>e=>Array.from(new Set(e)),jf=typeof globalThis.document<"u"?S.useLayoutEffect:S.useEffect;function hn(e){const t=e().value??e().defaultValue,r=e().isEqual??Object.is,[n]=S.useState(t),[o,a]=S.useState(n),i=e().value!==void 0,l=S.useRef(o);l.current=i?e().value:o;const d=S.useRef(l.current);jf(()=>{d.current=l.current},[o,e().value]);const u=p=>{var b,v;const g=d.current,m=pr(p)?p(g):p;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:m,prev:g}),i||a(m),r(m,g)||(v=(b=e()).onChange)==null||v.call(b,m,g)};function f(){return i?e().value:o}return{initial:n,ref:l,get:f,set(p){(e().sync?Sr.flushSync:eS)(()=>u(p))},invoke(p,g){var m,b;(b=(m=e()).onChange)==null||b.call(m,p,g)},hash(p){var g,m;return((m=(g=e()).hash)==null?void 0:m.call(g,p))??String(p)}}}hn.cleanup=e=>{S.useEffect(()=>e,[])};hn.ref=e=>{const t=S.useRef(e);return{get:()=>t.current,set:r=>{t.current=r}}};function xS(e){const t=S.useRef(e);return{get(r){return t.current[r]},set(r,n){t.current[r]=n}}}var bS=(e,t)=>{const r=S.useRef(!1),n=S.useRef(!1);S.useEffect(()=>{if(r.current&&n.current)return t();n.current=!0},[...(e??[]).map(o=>typeof o=="function"?o():o)]),S.useEffect(()=>(r.current=!0,()=>{r.current=!1}),[])};function yS(e,t={}){var re,te,Q,W;const r=S.useMemo(()=>{const{id:D,ids:I,getRootNode:O}=t;return gS({id:D,ids:I,getRootNode:O})},[t]),n=(...D)=>{e.debug&&console.log(...D)},o=((re=e.props)==null?void 0:re.call(e,{props:Ef(t),scope:r}))??t,a=wS(o),i=(te=e.context)==null?void 0:te.call(e,{prop:a,bindable:hn,scope:r,flush:Pi,getContext(){return d},getComputed(){return N},getRefs(){return v},getEvent(){return m()}}),l=Nf(i),d={get(D){var I;return(I=l.current)==null?void 0:I[D].ref.current},set(D,I){var O;(O=l.current)==null||O[D].set(I)},initial(D){var I;return(I=l.current)==null?void 0:I[D].initial},hash(D){var O,R;const I=(O=l.current)==null?void 0:O[D].get();return(R=l.current)==null?void 0:R[D].hash(I)}},u=S.useRef(new Map),f=S.useRef(null),p=S.useRef(null),g=S.useRef({type:""}),m=()=>({...g.current,current(){return g.current},previous(){return p.current}}),b=()=>({...T,matches(...D){return D.includes(T.ref.current)},hasTag(D){var I,O;return!!((O=(I=e.states[T.ref.current])==null?void 0:I.tags)!=null&&O.includes(D))}}),v=xS(((Q=e.refs)==null?void 0:Q.call(e,{prop:a,context:d}))??{}),h=()=>({state:b(),context:d,event:m(),prop:a,send:U,action:y,guard:x,track:bS,refs:v,computed:N,flush:Pi,scope:r,choose:E}),y=D=>{const I=pr(D)?D(h()):D;if(!I)return;const O=I.map(R=>{var B,J;const M=(J=(B=e.implementations)==null?void 0:B.actions)==null?void 0:J[R];return M||Ei(`[zag-js] No implementation found for action "${JSON.stringify(R)}"`),M});for(const R of O)R==null||R(h())},x=D=>{var I,O;return pr(D)?D(h()):(O=(I=e.implementations)==null?void 0:I.guards)==null?void 0:O[D](h())},C=D=>{const I=pr(D)?D(h()):D;if(!I)return;const O=I.map(M=>{var J,k;const B=(k=(J=e.implementations)==null?void 0:J.effects)==null?void 0:k[M];return B||Ei(`[zag-js] No implementation found for effect "${JSON.stringify(M)}"`),B}),R=[];for(const M of O){const B=M==null?void 0:M(h());B&&R.push(B)}return()=>R.forEach(M=>M==null?void 0:M())},E=D=>W1(D).find(I=>{let O=!I.guard;return nn(I.guard)?O=!!x(I.guard):pr(I.guard)&&(O=I.guard(h())),O}),N=D=>{aS(e.computed,()=>"[zag-js] No computed object found on machine");const I=e.computed[D];return I({context:d,event:m(),prop:a,refs:v,scope:r,computed:N})},T=hn(()=>({defaultValue:e.initialState({prop:a}),onChange(D,I){var R,M,B,J;if(I){const k=u.current.get(I);k==null||k(),u.current.delete(I)}I&&y((R=e.states[I])==null?void 0:R.exit),y((M=f.current)==null?void 0:M.actions);const O=C((B=e.states[D])==null?void 0:B.effects);if(O&&u.current.set(D,O),I===Ro){y(e.entry);const k=C(e.effects);k&&u.current.set(Ro,k)}y((J=e.states[D])==null?void 0:J.entry)}})),A=S.useRef(void 0),P=S.useRef(Wt.NotStarted);jf(()=>{queueMicrotask(()=>{const O=P.current===Wt.Started;P.current=Wt.Started,n(O?"rehydrating...":"initializing...");const R=A.current??T.initial;T.invoke(R,O?T.get():Ro)});const D=u.current,I=T.ref.current;return()=>{n("unmounting..."),A.current=I,P.current=Wt.Stopped,D.forEach(O=>O==null?void 0:O()),u.current=new Map,f.current=null,queueMicrotask(()=>{y(e.exit)})}},[]);const V=()=>"ref"in T?T.ref.current:T.get(),U=D=>{queueMicrotask(()=>{var J,k;if(P.current!==Wt.Started)return;p.current=g.current,g.current=D;let I=V();const O=((J=e.states[I].on)==null?void 0:J[D.type])??((k=e.on)==null?void 0:k[D.type]),R=E(O);if(!R)return;f.current=R;const M=R.target??I;n("transition",D.type,R.target||I,`(${R.actions})`);const B=M!==I;B?Sr.flushSync(()=>T.set(M)):R.reenter&&!B?T.invoke(I,I):y(R.actions??[])})};return(W=e.watch)==null||W.call(e,h()),{state:b(),send:U,context:d,prop:a,scope:r,refs:v,computed:N,event:m(),getStatus:()=>P.current}}function Nf(e){const t=S.useRef(e);return t.current=e,t}function wS(e){const t=Nf(e);return function(n){return t.current[n]}}function Pi(e){queueMicrotask(()=>{Sr.flushSync(()=>e())})}var CS=vS(e=>e);function SS(...e){return t=>{const r=[];for(const n of e)if(typeof n=="function"){const o=n(t);typeof o=="function"&&r.push(o)}else n&&(n.current=t);if(r.length)return()=>{for(const n of r)n()}}}function ES(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}const Po=e=>{const t=S.memo(S.forwardRef((r,n)=>{const{asChild:o,children:a,...i}=r;if(!o)return S.createElement(e,{...i,ref:n},a);if(!S.isValidElement(a))return null;const l=S.Children.only(a),d=ES(l);return S.cloneElement(l,{...Be(i,l.props),ref:n?SS(n,d):d})}));return t.displayName=e.displayName||e.name,t},RS=()=>{const e=new Map;return new Proxy(Po,{apply(t,r,n){return Po(n[0])},get(t,r){const n=r;return e.has(n)||e.set(n,Po(n)),e.get(n)}})},Xe=RS();function PS(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Lr(e={}){const{name:t,strict:r=!0,hookName:n="useContext",providerName:o="Provider",errorMessage:a,defaultValue:i}=e,l=S.createContext(i);l.displayName=t;function d(){var f;const u=S.useContext(l);if(!u&&r){const p=new Error(a??PS(n,o));throw p.name="ContextError",(f=Error.captureStackTrace)==null||f.call(Error,p,d),p}return u}return[l.Provider,d,l]}const[jS,nt]=Lr({name:"StepsContext",hookName:"useStepsContext",providerName:"<StepsProvider />"}),kf=S.forwardRef((e,t)=>{const r=nt(),n=Be(r.getContentProps({index:r.count}),e);return s.jsx(Xe.div,{...n,ref:t})});kf.displayName="StepsCompletedContent";const Ua=()=>(e,t)=>t.reduce((r,n)=>{const[o,a]=r,i=n;return a[i]!==void 0&&(o[i]=a[i]),delete a[i],[o,a]},[{},{...e}]),Tf=S.forwardRef((e,t)=>{const[r,n]=Ua()(e,["index"]),o=nt(),a=Be(o.getContentProps(r),n);return s.jsx(Xe.div,{...a,ref:t})});Tf.displayName="StepsContent";const[NS,Ha]=Lr({name:"StepsItemPropsContext",hookName:"useStepsItemPropsContext",providerName:"<StepsItemPropsProvider />"}),Af=S.forwardRef((e,t)=>{const r=nt(),n=Ha(),o=Be(r.getIndicatorProps(n),e);return s.jsx(Xe.div,{...o,ref:t})});Af.displayName="StepsIndicator";const[kS,mP]=Lr({name:"StepsItemContext",hookName:"useStepsItemContext",providerName:"<StepsItem />"}),_f=S.forwardRef((e,t)=>{const[r,n]=Ua()(e,["index"]),o=nt(),a=Be(o.getItemProps(r),n),i=o.getItemState(r);return s.jsx(NS,{value:r,children:s.jsx(kS,{value:i,children:s.jsx(Xe.div,{...a,ref:t})})})});_f.displayName="StepsItem";const If=S.forwardRef((e,t)=>{const r=nt(),n=Be(r.getListProps(),e);return s.jsx(Xe.div,{...n,ref:t})});If.displayName="StepsList";const Mf=S.forwardRef((e,t)=>{const r=nt(),n=Be(r.getNextTriggerProps(),e);return s.jsx(Xe.button,{...n,ref:t})});Mf.displayName="StepsNextTrigger";const Of=S.forwardRef((e,t)=>{const r=nt(),n=Be(r.getPrevTriggerProps(),e);return s.jsx(Xe.button,{...n,ref:t})});Of.displayName="StepsPrevTrigger";var mr=(e,t=[])=>({parts:(...r)=>{if(TS(t))return mr(e,r);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...r)=>mr(e,[...t,...r]),omit:(...r)=>mr(e,t.filter(n=>!r.includes(n))),rename:r=>mr(r,t),keys:()=>t,build:()=>[...new Set(t)].reduce((r,n)=>Object.assign(r,{[n]:{selector:[`&[data-scope="${Vt(e)}"][data-part="${Vt(n)}"]`,`& [data-scope="${Vt(e)}"][data-part="${Vt(n)}"]`].join(", "),attrs:{"data-scope":Vt(e),"data-part":Vt(n)}}}),{})}),Vt=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),TS=e=>e.length===0,AS=mr("steps").parts("root","list","item","trigger","indicator","separator","content","nextTrigger","prevTrigger","progress"),ze=AS.build(),_S=e=>{var t;return((t=e.ids)==null?void 0:t.root)??`steps:${e.id}`},IS=e=>{var t;return((t=e.ids)==null?void 0:t.list)??`steps:${e.id}:list`},ji=(e,t)=>{var r,n;return((n=(r=e.ids)==null?void 0:r.triggerId)==null?void 0:n.call(r,t))??`steps:${e.id}:trigger:${t}`},MS=(e,t)=>{var r,n;return((n=(r=e.ids)==null?void 0:r.contentId)==null?void 0:n.call(r,t))??`steps:${e.id}:content:${t}`};function OS(e,t){const{context:r,send:n,computed:o,prop:a,scope:i}=e,l=r.get("step"),d=a("count"),u=o("percent"),f=o("hasNextStep"),p=o("hasPrevStep"),g=y=>({triggerId:ji(i,y.index),contentId:MS(i,y.index),current:y.index===l,completed:y.index<l,incomplete:y.index>l,index:y.index,first:y.index===0,last:y.index===d-1}),m=()=>{n({type:"STEP.NEXT",src:"next.trigger.click"})},b=()=>{n({type:"STEP.PREV",src:"prev.trigger.click"})},v=()=>{n({type:"STEP.RESET",src:"reset.trigger.click"})},h=y=>{n({type:"STEP.SET",value:y,src:"api.setValue"})};return{value:l,count:d,percent:u,hasNextStep:f,hasPrevStep:p,isCompleted:o("completed"),goToNextStep:m,goToPrevStep:b,resetStep:v,getItemState:g,setStep:h,getRootProps(){return t.element({...ze.root.attrs,id:_S(i),dir:a("dir"),"data-orientation":a("orientation"),style:{"--percent":`${u}%`}})},getListProps(){const x=z1(d).map((C,E)=>ji(i,E));return t.element({...ze.list.attrs,dir:a("dir"),id:IS(i),role:"tablist","aria-owns":x.join(" "),"aria-orientation":a("orientation"),"data-orientation":a("orientation")})},getItemProps(y){const x=g(y);return t.element({...ze.item.attrs,dir:a("dir"),"aria-current":x.current?"step":void 0,"data-orientation":a("orientation")})},getTriggerProps(y){const x=g(y);return t.button({...ze.trigger.attrs,id:x.triggerId,role:"tab",dir:a("dir"),tabIndex:!a("linear")||x.current?0:-1,"aria-selected":x.current,"aria-controls":x.contentId,"data-state":x.current?"open":"closed","data-orientation":a("orientation"),"data-complete":We(x.completed),"data-current":We(x.current),"data-incomplete":We(x.incomplete),onClick(C){C.defaultPrevented||a("linear")||n({type:"STEP.SET",value:y.index,src:"trigger.click"})}})},getContentProps(y){const x=g(y);return t.element({...ze.content.attrs,dir:a("dir"),id:x.contentId,role:"tabpanel",tabIndex:0,hidden:!x.current,"data-state":x.current?"open":"closed","data-orientation":a("orientation"),"aria-labelledby":x.triggerId})},getIndicatorProps(y){const x=g(y);return t.element({...ze.indicator.attrs,dir:a("dir"),"aria-hidden":!0,"data-complete":We(x.completed),"data-current":We(x.current),"data-incomplete":We(x.incomplete)})},getSeparatorProps(y){const x=g(y);return t.element({...ze.separator.attrs,dir:a("dir"),"data-orientation":a("orientation"),"data-complete":We(x.completed),"data-current":We(x.current),"data-incomplete":We(x.incomplete)})},getNextTriggerProps(){return t.button({...ze.nextTrigger.attrs,dir:a("dir"),type:"button",disabled:!f,onClick(y){y.defaultPrevented||m()}})},getPrevTriggerProps(){return t.button({dir:a("dir"),...ze.prevTrigger.attrs,type:"button",disabled:!p,onClick(y){y.defaultPrevented||b()}})},getProgressProps(){return t.element({dir:a("dir"),...ze.progress.attrs,role:"progressbar","aria-valuenow":u,"aria-valuemin":0,"aria-valuemax":100,"aria-valuetext":`${u}% complete`,"data-complete":We(u===100)})}}}var DS={props({props:e}){return{defaultStep:0,count:1,linear:!1,orientation:"horizontal",...e}},context({prop:e,bindable:t}){return{step:t(()=>({defaultValue:e("defaultStep"),value:e("step"),onChange(r){var o,a;(o=e("onStepChange"))==null||o({step:r}),r==e("count")&&((a=e("onStepComplete"))==null||a())}}))}},computed:{percent:mS(({context:e,prop:t})=>[e.get("step"),t("count")],([e,t])=>e/t*100),hasNextStep:({context:e,prop:t})=>e.get("step")<t("count"),hasPrevStep:({context:e})=>e.get("step")>0,completed:({context:e,prop:t})=>e.get("step")===t("count")},initialState(){return"idle"},entry:["validateStep"],states:{idle:{on:{"STEP.SET":{actions:["setStep"]},"STEP.NEXT":{actions:["goToNextStep"]},"STEP.PREV":{actions:["goToPrevStep"]},"STEP.RESET":{actions:["resetStep"]}}}},implementations:{actions:{goToNextStep({context:e,prop:t}){const r=Math.min(e.get("step")+1,t("count"));e.set("step",r)},goToPrevStep({context:e}){const t=Math.max(e.get("step")-1,0);e.set("step",t)},resetStep({context:e}){e.set("step",0)},setStep({context:e,event:t}){e.set("step",t.value)},validateStep({context:e,prop:t}){$S(t("count"),e.get("step"))}}}},$S=(e,t)=>{if(!oS(t,0,e))throw new RangeError(`[zag-js/steps] step index ${t} is out of bounds`)};hS()(["count","dir","getRootNode","id","ids","linear","onStepChange","onStepComplete","orientation","step","defaultStep"]);const[gP,LS]=Lr({name:"EnvironmentContext",hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:{getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window}}),[vP,FS]=Lr({name:"LocaleContext",hookName:"useLocaleContext",providerName:"<LocaleProvider />",strict:!1,defaultValue:{dir:"ltr",locale:"en-US"}});function VS(e){const t=S.useId(),{getRootNode:r}=LS(),{dir:n}=FS(),o={id:t,dir:n,getRootNode:r,...e},a=yS(DS,o);return OS(a,CS)}const Df=S.forwardRef((e,t)=>{const[r,n]=Ua()(e,["defaultStep","id","ids","count","linear","onStepChange","onStepComplete","orientation","step"]),o=VS(r),a=Be(o.getRootProps(),n);return s.jsx(jS,{value:o,children:s.jsx(Xe.div,{...a,ref:t})})});Df.displayName="StepsRoot";const $f=S.forwardRef((e,t)=>{const r=nt(),n=Ha(),o=Be(r.getSeparatorProps(n),e);return s.jsx(Xe.div,{...o,ref:t})});$f.displayName="StepsSeparator";const Lf=S.forwardRef((e,t)=>{const r=nt(),n=Ha(),o=Be(r.getTriggerProps(n),e);return s.jsx(Xe.button,{...o,ref:t})});Lf.displayName="StepsTrigger";function BS(e){return ku({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M20 6 9 17l-5-5"},child:[]}]})(e)}const Ff=S.createContext(void 0),GS=({children:e,step:t})=>s.jsx(Ff.Provider,{value:{step:t},children:e}),Vf=()=>{const e=S.useContext(Ff);if(!e)throw new Error("useSteps must be used within a StepsProvider");return e},WS=({className:e,step:t,...r})=>{const n=j("qodo qodo-steps","flex flex-col gap-4",e);return s.jsx(GS,{step:t??0,children:s.jsx(Df,{className:n,step:t,...r})})},zS=({className:e,...t})=>{const r=j("flex flex-row gap-4",e);return s.jsx(If,{className:r,...t})},qS=({className:e,...t})=>{const r=j("flex flex-row items-center gap-4",e);return s.jsx(_f,{className:r,...t})},US=({className:e,...t})=>{const r=j("flex flex-row items-center gap-4 text-purple-muted-100 text-sm",e);return s.jsx(Lf,{className:r,...t})},HS=({index:e,className:t,...r})=>{const{step:n}=Vf(),o=e===n,a=e<n,i=j("flex items-center justify-center w-8 h-8 rounded-full text-white",a&&"bg-green-700",o&&"bg-green-600",!a&&!o&&"bg-purple-muted-500",t),l=j({"text-white":o,"text-purple-muted-300":!a&&e!==n});return s.jsx(Af,{className:i,...r,children:a?s.jsx(BS,{className:"text-green-400"}):s.jsx("span",{className:l,children:e+1})})},KS=({index:e,className:t,...r})=>{const{step:n}=Vf(),o=e<n,a=j("min-w-12 h-px",o?"bg-green-400":"bg-gray-400",t);return s.jsx($f,{className:a,...r})},YS=({className:e,...t})=>{const r=j(e);return s.jsx(Tf,{className:r,...t})},XS=({className:e,...t})=>{const r=j(e);return s.jsx(kf,{className:r,...t})},ZS=({className:e,...t})=>{const r=j("bg-primary text-white px-4 py-2 rounded-md",e);return s.jsx(Of,{className:r,...t})},JS=({className:e,...t})=>{const r=j("bg-primary text-white px-4 py-2 rounded-md",e);return s.jsx(Mf,{className:r,...t})},QS={Root:WS,List:zS,Item:qS,Trigger:US,Indicator:HS,Separator:KS,Content:YS,CompletedContent:XS,PrevTrigger:ZS,NextTrigger:JS},Fr=({children:e,content:t,providerProps:r={},triggerProps:n={},contentProps:o={}})=>s.jsx(Wu,{...r,children:s.jsxs(zu,{children:[s.jsx(qu,{...n,children:e}),t&&s.jsx(Uu,{...o,children:t})]})});/**
|
|
205
205
|
* react-table
|
|
206
206
|
*
|
|
207
207
|
* Copyright (c) TanStack
|