gymatra-ui 0.3.2 → 0.3.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/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),Y=require("@base-ui/react/accordion"),p=require("react"),xe=require("@base-ui/react/avatar"),He=require("@base-ui/react/checkbox"),F=require("@base-ui/react/combobox"),W=require("@base-ui/react/dialog"),U=require("@base-ui/react/field"),Ct=require("@base-ui/react/form"),St=require("@base-ui/react/input"),_=require("@base-ui/react/select"),we=require("@base-ui/react/switch"),L=require("@base-ui/react/menu"),zt=require("@base-ui/react/menubar"),H=require("@base-ui/react/popover"),X=require("@base-ui/react/progress"),Pt=require("@base-ui/react/separator"),ee=require("@base-ui/react/tabs"),It=require("@base-ui/react/toggle"),Mt=require("@base-ui/react/toggle-group"),se=require("@base-ui/react/tooltip"),Mr=require("react-phone-number-input/input"),ne=require("react-phone-number-input"),yt=require("react-phone-number-input/flags"),gt=require("react-phone-number-input/locale/fr.json");function l(...t){return t.filter(Boolean).join(" ")}const Tr={default:"divide-y divide-border rounded-lg border border-border bg-white",separated:"flex flex-col gap-2",flush:"divide-y divide-border"},Lr={default:"",separated:"rounded-lg border border-border bg-white",flush:""},jt={default:"px-4",separated:"px-4",flush:"px-0"};function Rr(){return e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:"size-4 shrink-0 text-text-muted transition-transform duration-200 group-data-[panel-open]:rotate-180 motion-reduce:transition-none",children:e.jsx("path",{d:"m6 9 6 6 6-6"})})}function Br({items:t,multiple:r=!1,value:s,defaultValue:n,onValueChange:a,variant:o="default",disabled:i=!1,headingLevel:d=3,className:m}){const u=`h${d}`;return e.jsx(Y.Accordion.Root,{multiple:r,value:s,defaultValue:n,onValueChange:a?c=>a(c):void 0,disabled:i,className:l("w-full",Tr[o],m),children:t.map(c=>e.jsxs(Y.Accordion.Item,{value:c.value,disabled:c.disabled,className:Lr[o],children:[e.jsx(Y.Accordion.Header,{render:e.jsx(u,{}),className:"m-0",children:e.jsxs(Y.Accordion.Trigger,{className:l("group flex w-full cursor-pointer items-center gap-3 py-3.5 text-start outline-none transition-colors",jt[o],o!=="flush"&&"hover:bg-surface-muted/50",o==="separated"&&"rounded-lg data-[panel-open]:rounded-b-none","focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary","data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 data-[disabled]:hover:bg-transparent"),children:[c.icon&&e.jsx("span",{"aria-hidden":"true",className:"flex shrink-0 text-text-muted group-data-[panel-open]:text-primary [&>svg]:size-4",children:c.icon}),e.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[e.jsx("span",{className:"text-sm font-medium text-text",children:c.title}),c.description&&e.jsx("span",{className:"text-xs font-normal text-text-muted",children:c.description})]}),c.meta&&e.jsx("span",{className:"shrink-0",children:c.meta}),e.jsx(Rr,{})]})}),e.jsx(Y.Accordion.Panel,{className:l("h-[var(--accordion-panel-height)] overflow-hidden transition-[height] duration-200 ease-out motion-reduce:transition-none","data-[starting-style]:h-0 data-[ending-style]:h-0"),children:e.jsx("div",{className:l("pb-4 text-sm leading-6 text-text-muted",jt[o],!!c.icon&&(o==="flush"?"ps-7":"ps-11")),children:c.content})})]},c.value))})}const Ar=Y.Accordion.Root,Dr=Y.Accordion.Item,Fr=Y.Accordion.Header,Er=Y.Accordion.Trigger,Wr=Y.Accordion.Panel,ge=t=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t}),Or={info:ge(e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"12",cy:"12",r:"9"}),e.jsx("path",{d:"M12 11v5M12 8h.01"})]})),neutral:ge(e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"12",cy:"12",r:"9"}),e.jsx("path",{d:"M12 11v5M12 8h.01"})]})),success:ge(e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"12",cy:"12",r:"9"}),e.jsx("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]})),warning:ge(e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M10.3 4.3 2.6 18a2 2 0 0 0 1.7 3h15.4a2 2 0 0 0 1.7-3L13.7 4.3a2 2 0 0 0-3.4 0Z"}),e.jsx("path",{d:"M12 9.5v4M12 17h.01"})]})),danger:ge(e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"12",cy:"12",r:"9"}),e.jsx("path",{d:"M12 7.5v5M12 16h.01"})]}))},$r={info:"text-info",success:"text-success",warning:"text-warning",danger:"text-danger",neutral:"text-text-muted"},Vr={soft:{info:"bg-info-soft",success:"bg-success-soft",warning:"bg-warning-soft",danger:"bg-danger-soft",neutral:"bg-surface-muted"},outline:{info:"border border-border bg-white",success:"border border-border bg-white",warning:"border border-border bg-white",danger:"border border-border bg-white",neutral:"border border-border bg-white"}},Tt=p.forwardRef(({tone:t="info",variant:r="soft",title:s,description:n,icon:a,action:o,onClose:i,closeLabel:d="Fermer",className:m,children:u,role:c,...f},b)=>{const h=a===void 0?Or[t]:a,x=n??u;return e.jsxs("div",{ref:b,role:c??(t==="danger"||t==="warning"?"alert":"status"),className:l("flex w-full items-start gap-3 rounded-lg px-4 py-3",Vr[r][t],m),...f,children:[h!==null&&e.jsx("span",{"aria-hidden":"true",className:l("mt-0.5 flex size-5 shrink-0 [&>svg]:size-5",$r[t]),children:h}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-0.5",children:[s&&e.jsx("p",{className:"text-sm font-semibold text-text",children:s}),x&&e.jsx("div",{className:"text-sm leading-6 text-text-muted",children:x})]}),o&&e.jsx("div",{className:"flex shrink-0 items-center gap-2 self-center",children:o}),i&&e.jsx("button",{type:"button",onClick:i,"aria-label":d,className:"-me-1 flex size-7 shrink-0 cursor-pointer items-center justify-center self-start rounded-md text-text-muted transition-colors hover:bg-white hover:text-text motion-reduce:transition-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",className:"size-4","aria-hidden":"true",children:e.jsx("path",{d:"M6 6l12 12M18 6 6 18"})})})]})});Tt.displayName="GymatraAlert";const Lt=p.createContext(null),_e={xs:{root:"size-6 text-xs",status:"size-1.5 ring-1"},sm:{root:"size-8 text-xs",status:"size-2 ring-1.5"},md:{root:"size-10 text-sm",status:"size-2.5 ring-2"},lg:{root:"size-12 text-base",status:"size-3 ring-2"},xl:{root:"size-16 text-lg",status:"size-3.5 ring-2"},"2xl":{root:"size-20 text-2xl",status:"size-4 ring-2"}},Ke={circle:"rounded-full",square:"rounded-lg"},vt={primary:"bg-primary-soft text-primary",secondary:"bg-surface-muted text-text",success:"bg-success-soft text-success",warning:"bg-warning-soft text-warning",danger:"bg-danger-soft text-danger",info:"bg-info-soft text-info",neutral:"bg-surface-muted text-text-muted"},qr={online:"bg-success",busy:"bg-danger",away:"bg-warning",offline:"bg-text-subtle"};function Ur(t){if(!t)return"";const r=t.trim().split(/\s+/).filter(Boolean);return r.length===0?"":r.length===1?r[0].slice(0,2).toUpperCase():(r[0][0]+r[r.length-1][0]).toUpperCase()}function Hr({className:t}){return e.jsxs("svg",{className:l("size-1/2 opacity-65",t),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"}),e.jsx("circle",{cx:"12",cy:"7",r:"4"})]})}function ke({src:t,alt:r="Avatar",name:s,fallback:n,size:a,shape:o,variant:i="primary",status:d,statusPosition:m="bottom-right",bordered:u=!1,delayMs:c=0,className:f,children:b,...h}){const x=p.useContext(Lt),g=a??(x==null?void 0:x.size)??"md",y=o??(x==null?void 0:x.shape)??"circle",v=_e[g]??_e.md,k=Ke[y]??Ke.circle,j=vt[i]??vt.primary,N=s?Ur(s):void 0,z=n??N??e.jsx(Hr,{});return e.jsxs("span",{className:l("relative inline-flex shrink-0 select-none",f),...h,children:[e.jsx(xe.Avatar.Root,{className:l("flex items-center justify-center overflow-hidden font-medium transition-all",v.root,k,j,u&&"border border-border",x&&"ring-2 ring-white"),children:b||e.jsxs(e.Fragment,{children:[t&&e.jsx(xe.Avatar.Image,{src:t,alt:r||s||"Avatar",className:"size-full object-cover"}),e.jsx(xe.Avatar.Fallback,{delay:c,className:"flex size-full items-center justify-center uppercase tracking-wider",children:z})]})}),d&&e.jsx("span",{className:l("absolute rounded-full ring-white",v.status,qr[d],m==="bottom-right"&&(y==="circle"?"bottom-0 end-0 translate-x-[1px] translate-y-[1px]":"bottom-[-2px] end-[-2px]"),m==="top-right"&&(y==="circle"?"top-0 end-0 translate-x-[1px] -translate-y-[1px]":"top-[-2px] end-[-2px]")),"aria-hidden":"true"})]})}const _r={xs:"-space-x-1.5",sm:"-space-x-2",md:"-space-x-2.5",lg:"-space-x-3",xl:"-space-x-4","2xl":"-space-x-5"};function Rt({children:t,max:r,size:s="md",shape:n="circle",spacing:a="tight",className:o,...i}){const d=p.Children.toArray(t).filter(p.isValidElement),m=d.length,u=r!==void 0&&r>=0&&m>r,c=u?d.slice(0,r):d,f=u?m-r:0,b=a==="tight"?_r[s]:a==="normal"?"-space-x-1":"space-x-1";return e.jsx(Lt.Provider,{value:{size:s,shape:n},children:e.jsxs("div",{role:"group","aria-label":`Groupe de ${m} avatars`,className:l("inline-flex items-center",b,o),...i,children:[c.map(h=>e.jsx("span",{className:"relative inline-flex hover:z-10",children:h},h.key)),f>0&&e.jsxs("span",{role:"img","aria-label":`${f} autre${f>1?"s":""}`,title:`${f} autre${f>1?"s":""}`,className:l("relative inline-flex shrink-0 select-none items-center justify-center bg-surface-muted font-medium text-text-muted ring-2 ring-white",_e[s].root,Ke[n]),children:["+",f]})]})})}ke.Root=xe.Avatar.Root;ke.Image=xe.Avatar.Image;ke.Fallback=xe.Avatar.Fallback;ke.Group=Rt;const Kr={default:"bg-surface-muted text-text-muted",primary:"bg-primary-soft text-primary",secondary:"bg-surface text-text",outline:"bg-transparent text-text border border-border",success:"bg-success-soft text-success",warning:"bg-warning-soft text-warning",danger:"bg-danger-soft text-danger",info:"bg-info-soft text-info"},Qr={sm:"h-5 px-2 text-xs gap-1",md:"h-6 px-2.5 text-xs gap-1.5",lg:"h-7 px-3 text-xs font-medium gap-1.5"},Ze=p.forwardRef(({variant:t="default",size:r="md",pill:s=!0,dot:n=!1,check:a=!1,circle:o=!1,startIcon:i,endIcon:d,className:m,children:u,...c},f)=>e.jsxs("span",{ref:f,className:l("inline-flex items-center justify-center font-medium border-0 select-none transition-colors",s?"rounded-full":"rounded-md",Kr[t],Qr[r],m),...c,children:[o||n?e.jsx("span",{className:l("rounded-full border-2 border-current shrink-0",r==="sm"?"size-2":"size-2.5"),"aria-hidden":"true"}):a?e.jsx("svg",{className:l("shrink-0",r==="sm"?"size-3":r==="lg"?"size-3.5":"size-3"),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})}):null,i&&e.jsx("span",{className:"inline-flex shrink-0 items-center justify-center","aria-hidden":"true",children:i}),u&&e.jsx("span",{className:"truncate",children:u}),d&&e.jsx("span",{className:"inline-flex shrink-0 items-center justify-center","aria-hidden":"true",children:d})]}));Ze.displayName="GymatraBadge";function Bt({items:t,separator:r="/",className:s,...n}){return e.jsx("nav",{"aria-label":"Breadcrumb",className:l("inline-block",s),...n,children:e.jsx("ol",{className:"flex flex-wrap items-center gap-1.5 text-sm text-text-muted m-0 p-0 list-none",children:t.map((a,o)=>{const i=o===t.length-1;return e.jsxs("li",{className:"inline-flex items-center gap-1.5",children:[!i&&a.href?e.jsxs("a",{href:a.href,onClick:a.onClick,className:"inline-flex items-center gap-1.5 rounded px-0.5 text-sm text-text-muted transition-colors hover:text-text outline-none focus-visible:outline-2 focus-visible:outline-primary",children:[a.icon,e.jsx("span",{children:a.label})]}):e.jsxs("span",{className:l("inline-flex items-center gap-1.5 px-0.5 text-sm",i?"font-medium text-text":"text-text-muted"),"aria-current":i?"page":void 0,children:[a.icon,e.jsx("span",{children:a.label})]}),!i&&e.jsx("span",{className:"text-xs text-text-subtle select-none px-0.5","aria-hidden":"true",children:r})]},o)})})})}Bt.displayName="GymatraBreadcrumb";function At({className:t,...r}){return e.jsx("ol",{className:l("flex flex-wrap items-center gap-1.5 text-sm text-text-muted m-0 p-0 list-none",t),...r})}At.displayName="GymatraBreadcrumbList";function Dt({className:t,...r}){return e.jsx("li",{className:l("inline-flex items-center gap-1.5",t),...r})}Dt.displayName="GymatraBreadcrumbItem";function Ft({className:t,...r}){return e.jsx("a",{className:l("inline-flex items-center gap-1.5 rounded px-0.5 text-sm text-text-muted transition-colors hover:text-text outline-none focus-visible:outline-2 focus-visible:outline-primary",t),...r})}Ft.displayName="GymatraBreadcrumbLink";function Et({className:t,...r}){return e.jsx("span",{"aria-current":"page",className:l("inline-flex items-center gap-1.5 px-0.5 text-sm font-medium text-text",t),...r})}Et.displayName="GymatraBreadcrumbPage";function Wt({children:t="/",className:r,...s}){return e.jsx("span",{"aria-hidden":"true",className:l("text-xs text-text-subtle select-none px-0.5",r),...s,children:t})}Wt.displayName="GymatraBreadcrumbSeparator";function Ot({className:t,...r}){return e.jsx("span",{"aria-hidden":"true",className:l("flex size-6 items-center justify-center text-text-muted select-none text-xs font-medium",t),...r,children:"…"})}Ot.displayName="GymatraBreadcrumbEllipsis";const wt={primary:"bg-primary text-white hover:bg-primary-hover active:bg-primary-active focus-visible:outline-primary shadow-none border-0",secondary:"bg-surface-muted text-text hover:bg-border/60 active:bg-border focus-visible:outline-primary shadow-none border-0",outline:"bg-transparent text-text border border-border hover:bg-surface-muted hover:text-text active:bg-border/40 focus-visible:outline-primary shadow-none",soft:"bg-primary-soft text-primary hover:bg-primary-soft/70 active:bg-primary/15 focus-visible:outline-primary shadow-none border-0",ghost:"bg-transparent text-text-muted hover:text-text hover:bg-surface-muted active:bg-border/40 focus-visible:outline-primary shadow-none border-0",danger:"bg-danger text-white hover:bg-danger/90 active:bg-danger/80 focus-visible:outline-danger shadow-none border-0",success:"bg-success text-white hover:bg-success/90 active:bg-success/80 focus-visible:outline-success shadow-none border-0",warning:"bg-warning text-white hover:bg-warning/90 active:bg-warning/80 focus-visible:outline-warning shadow-none border-0",info:"bg-info text-white hover:bg-info/90 active:bg-info/80 focus-visible:outline-info shadow-none border-0","outline-primary":"bg-transparent text-primary border border-primary/40 hover:bg-primary-soft hover:border-primary active:bg-primary/15 focus-visible:outline-primary shadow-none","outline-danger":"bg-transparent text-danger border border-danger/40 hover:bg-danger-soft hover:border-danger active:bg-danger/15 focus-visible:outline-danger shadow-none","outline-warning":"bg-transparent text-warning border border-warning/40 hover:bg-warning-soft hover:border-warning active:bg-warning/15 focus-visible:outline-warning shadow-none","outline-success":"bg-transparent text-success border border-success/40 hover:bg-success-soft hover:border-success active:bg-success/15 focus-visible:outline-success shadow-none","outline-info":"bg-transparent text-info border border-info/40 hover:bg-info-soft hover:border-info active:bg-info/15 focus-visible:outline-info shadow-none"},Zr={xs:"h-7 px-2.5 text-xs gap-1.5",sm:"h-8 px-3 text-sm gap-1.5",md:"h-10 px-4 text-sm gap-2",lg:"h-11 px-5 text-sm gap-2.5",xl:"h-12 px-6 text-base gap-3",icon:"size-9 p-0 justify-center text-sm gap-0"},Jr={normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},Yr={xs:"size-3.5",sm:"size-4",md:"size-4",lg:"size-4.5",xl:"size-5",icon:"size-4.5"};function Xr(t,r){if(r&&r!=="default"){if(t==="outline")return`outline-${r}`;if(t==="primary")return r}return t}const Le=p.forwardRef(({variant:t="primary",color:r,size:s="md",weight:n="medium",pill:a=!1,fullWidth:o=!1,startIcon:i,endIcon:d,loading:m=!1,loadingText:u,disabled:c,children:f,className:b,type:h="button",...x},g)=>{const y=c||m,v=Yr[s],k=Xr(t,r);return e.jsx("button",{ref:g,type:h,disabled:y,"aria-busy":m?!0:void 0,className:l("inline-flex cursor-pointer items-center justify-center transition-all duration-150 select-none",a?"rounded-full":s==="xs"?"rounded":s==="xl"?"rounded-lg":"rounded-md",o?"w-full":"",Jr[n],"focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none disabled:opacity-50",wt[k]||wt.primary,Zr[s],b),...x,children:m?e.jsxs(e.Fragment,{children:[e.jsxs("svg",{className:l("animate-spin shrink-0",v),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),u?e.jsx("span",{children:u}):f?e.jsx("span",{children:f}):null]}):e.jsxs(e.Fragment,{children:[i&&e.jsx("span",{className:l("inline-flex shrink-0 items-center justify-center",v),"aria-hidden":"true",children:i}),f&&e.jsx("span",{children:f}),d&&e.jsx("span",{className:l("inline-flex shrink-0 items-center justify-center",v),"aria-hidden":"true",children:d})]})})});Le.displayName="GymatraButton";const es={sm:{box:"size-3.5",icon:"size-2.5",offset:"mt-[3px]"},md:{box:"size-4",icon:"size-3",offset:"mt-0.5"},lg:{box:"size-5",icon:"size-3.5",offset:"mt-0"}};function ts({className:t}){return e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3.5",strokeLinecap:"round",strokeLinejoin:"round",className:t,"aria-hidden":"true",children:e.jsx("path",{d:"M20 6 9 17l-5-5"})})}function rs({className:t}){return e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3.5",strokeLinecap:"round","aria-hidden":"true",className:t,children:e.jsx("path",{d:"M5 12h14"})})}const Je=p.forwardRef(({label:t,description:r,size:s="md",invalid:n=!1,indeterminate:a=!1,disabled:o=!1,onChange:i,onCheckedChange:d,className:m,wrapperClassName:u,...c},f)=>{const b=es[s],h=e.jsx(He.Checkbox.Root,{ref:f,indeterminate:a,disabled:o,"aria-invalid":n||void 0,onCheckedChange:(x,g)=>{d==null||d(x,g),i==null||i(x)},className:l("inline-flex shrink-0 cursor-pointer items-center justify-center rounded-sm border border-border-strong bg-white text-white outline-none transition-colors motion-reduce:transition-none","hover:border-text-subtle","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary","data-[checked]:border-primary data-[checked]:bg-primary data-[indeterminate]:border-primary data-[indeterminate]:bg-primary","aria-[invalid=true]:border-danger aria-[invalid=true]:focus-visible:outline-danger","data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 data-[disabled]:hover:border-border-strong",b.box,!!(t||r)&&b.offset,m),...c,children:e.jsx(He.Checkbox.Indicator,{className:"flex items-center justify-center",keepMounted:!1,children:a?e.jsx(rs,{className:b.icon}):e.jsx(ts,{className:b.icon})})});return!t&&!r?h:e.jsxs("label",{className:l("inline-flex select-none items-start gap-2.5",o?"cursor-not-allowed":"cursor-pointer",u),children:[h,e.jsxs("span",{className:"flex min-w-0 flex-col",children:[t&&e.jsx("span",{className:l("text-sm font-medium leading-5",o?"text-text-subtle":"text-text"),children:t}),r&&e.jsx("span",{className:"text-xs leading-normal text-text-muted",children:r})]})]})});Je.displayName="GymatraCheckbox";const ss=F.Combobox.Root,ns=F.Combobox.Trigger,as=F.Combobox.Portal,os=F.Combobox.Positioner,is=F.Combobox.List,ls=F.Combobox.Group,cs=F.Combobox.Separator,ds=F.Combobox.Clear,us=F.Combobox.Chips,xs=F.Combobox.Chip,ms=F.Combobox.ChipRemove,$t=p.forwardRef(({className:t,startIcon:r,error:s,disabled:n,...a},o)=>e.jsxs("div",{className:l("relative flex items-center w-full h-10 rounded-md border bg-white transition-colors",n?"border-border bg-surface-muted opacity-50 cursor-not-allowed":s?"border-danger focus-within:border-danger focus-within:ring-1 focus-within:ring-danger":"border-border hover:border-text-subtle focus-within:border-primary focus-within:ring-1 focus-within:ring-primary"),children:[r&&e.jsx("span",{className:"shrink-0 pl-3 text-text-subtle pointer-events-none flex items-center justify-center",children:r}),e.jsx(F.Combobox.Input,{ref:o,disabled:n,className:l("h-full w-full bg-transparent px-3.5 py-2 text-sm text-text placeholder:text-text-subtle outline-none border-0 ring-0 shadow-none focus:outline-none focus:ring-0 focus:border-0",t),...a}),e.jsx("span",{className:"shrink-0 pr-3 text-text-subtle pointer-events-none flex items-center justify-center",children:e.jsx("svg",{className:"size-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m6 9 6 6 6-6"})})})]}));$t.displayName="GymatraComboboxInput";const Ye=p.forwardRef(({className:t,children:r,...s},n)=>e.jsx(F.Combobox.Popup,{ref:n,className:l("z-50 min-w-[var(--anchor-width)] max-h-64 overflow-y-auto rounded-lg border border-border bg-white p-1 text-sm text-text outline-none shadow-none",t),...s,children:r}));Ye.displayName="GymatraComboboxPopup";function ps({className:t="size-3.5"}){return e.jsx("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})})}const Re=p.forwardRef(({className:t,children:r,icon:s,description:n,...a},o)=>e.jsxs(F.Combobox.Item,{ref:o,className:l("group relative flex w-full cursor-pointer select-none items-center justify-between gap-2 rounded-md px-2.5 py-1.5 text-sm text-text outline-none transition-colors","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","data-[highlighted]:bg-surface-muted data-[highlighted]:text-text","data-[selected]:font-medium data-[selected]:text-primary",t),...a,children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s&&e.jsx("span",{className:"shrink-0 size-4 text-text-muted flex items-center justify-center",children:s}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate",children:r}),n&&e.jsx("div",{className:"text-xs text-text-muted truncate",children:n})]})]}),e.jsx(F.Combobox.ItemIndicator,{className:"shrink-0 size-4 flex items-center justify-center text-primary",children:e.jsx(ps,{})})]}));Re.displayName="GymatraComboboxItem";const Xe=p.forwardRef(({className:t,children:r,...s},n)=>e.jsx(F.Combobox.Empty,{ref:n,className:l("px-3 py-2 text-sm text-text-muted text-center",t),...s,children:r??"Aucun résultat trouvé"}));Xe.displayName="GymatraComboboxEmpty";const et=p.forwardRef(({className:t,...r},s)=>e.jsx(F.Combobox.GroupLabel,{ref:s,className:l("px-2.5 py-1 text-xs font-semibold uppercase tracking-wider text-text-muted select-none",t),...r}));et.displayName="GymatraComboboxGroupLabel";function fs(t){return t.map(r=>typeof r=="string"?{value:r,label:r}:r)}function bs({label:t,helperText:r,error:s,options:n,value:a,defaultValue:o,onValueChange:i,onChange:d,placeholder:m="Rechercher ou sélectionner...",emptyText:u="Aucun résultat trouvé",disabled:c=!1,required:f=!1,className:b,startIcon:h}){const x=fs(n),g=x.some(j=>!!j.group),y={};g&&x.forEach(j=>{const N=j.group||"Autres";y[N]||(y[N]=[]),y[N].push(j)});const v=j=>{i==null||i(j),d==null||d(j)},k=a!==void 0?{value:a,onValueChange:v,items:x}:o!==void 0?{defaultValue:o,onValueChange:v,items:x}:{onValueChange:v,items:x};return e.jsxs("div",{className:l("w-full space-y-1.5",b),children:[t&&e.jsxs("label",{className:"block text-xs font-medium text-text-muted",children:[t,f&&e.jsx("span",{className:"text-danger ml-0.5",children:"*"})]}),e.jsxs(F.Combobox.Root,{...k,disabled:c,children:[e.jsxs("div",{className:l("relative flex items-center w-full h-10 rounded-md border bg-white transition-colors",c?"border-border bg-surface-muted opacity-50 cursor-not-allowed":s?"border-danger focus-within:border-danger focus-within:ring-1 focus-within:ring-danger":"border-border hover:border-text-subtle focus-within:border-primary focus-within:ring-1 focus-within:ring-primary"),children:[h&&e.jsx("span",{className:"shrink-0 pl-3 text-text-subtle pointer-events-none flex items-center justify-center",children:h}),e.jsx(F.Combobox.Input,{placeholder:m,disabled:c,className:"h-full w-full bg-transparent px-3.5 py-2 text-sm text-text placeholder:text-text-subtle outline-none border-0 ring-0 shadow-none focus:outline-none focus:ring-0 focus:border-0"}),e.jsx("span",{className:"shrink-0 pr-3 text-text-subtle pointer-events-none flex items-center justify-center",children:e.jsx("svg",{className:"size-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m6 9 6 6 6-6"})})})]}),e.jsx(F.Combobox.Portal,{children:e.jsx(F.Combobox.Positioner,{sideOffset:4,className:"z-[10020] outline-none",children:e.jsxs(Ye,{children:[e.jsx(Xe,{children:u}),e.jsx(F.Combobox.List,{children:g?Object.entries(y).map(([j,N])=>e.jsxs(F.Combobox.Group,{children:[e.jsx(et,{children:j}),N.map(z=>e.jsx(Re,{value:z.value,disabled:z.disabled,icon:z.icon,description:z.description,children:z.label},z.value))]},j)):x.map(j=>e.jsx(Re,{value:j.value,disabled:j.disabled,icon:j.icon,description:j.description,children:j.label},j.value))})]})})})]}),s?e.jsx("p",{className:"text-xs text-danger",children:s}):r?e.jsx("p",{className:"text-xs text-text-muted",children:r}):null]})}const Vt={sm:"max-w-[420px]",md:"max-w-lg",lg:"max-w-xl",xl:"max-w-2xl"};function hs({variant:t}){switch(t){case"danger":case"delete":return e.jsx("svg",{className:"size-12 text-danger stroke-[1.5]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})});case"warning":return e.jsx("svg",{className:"size-12 text-warning stroke-[1.5]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"})});case"success":return e.jsx("svg",{className:"size-12 text-success stroke-[1.5]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})});case"info":return e.jsx("svg",{className:"size-12 text-info stroke-[1.5]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"})});case"primary":return e.jsx("svg",{className:"size-12 text-primary stroke-[1.5]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z"})});default:return null}}function qt({open:t,defaultOpen:r,onOpenChange:s,trigger:n,variant:a="default",size:o="sm",title:i,description:d,icon:m,align:u="center",children:c,confirmLabel:f,onConfirm:b,confirmVariant:h,cancelLabel:x="Annuler",onCancel:g,loading:y=!1,confirmDisabled:v=!1,showCloseButton:k=!1,footer:j,className:N}){const z=a==="danger"||a==="delete",C=f??(b?z?"Supprimer":"Confirmer":void 0),S=m===!1?null:m!==void 0?m:e.jsx(hs,{variant:a}),w=()=>h||(z?"danger":a==="warning"?"warning":a==="success"?"success":a==="info"?"info":"primary"),P=e.jsxs(W.Dialog.Portal,{children:[e.jsx(W.Dialog.Backdrop,{className:"fixed inset-0 z-[10010] bg-around/40 transition-opacity duration-150 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0"}),e.jsxs(W.Dialog.Popup,{className:l("fixed left-1/2 top-1/2 z-[10010] -translate-x-1/2 -translate-y-1/2","w-[calc(100%-2rem)] bg-white rounded-lg border border-border p-6 shadow-none","flex flex-col focus:outline-none transition-all duration-150","data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0",Vt[o],u==="center"?"items-center text-center":"items-start text-left",N),children:[k&&e.jsx(W.Dialog.Close,{className:"size-8 inline-flex items-center justify-center absolute right-3.5 top-3.5 rounded-md text-text-muted hover:bg-surface-muted hover:text-text cursor-pointer transition-colors focus-visible:outline-primary","aria-label":"Fermer",onClick:g,children:e.jsxs("svg",{className:"size-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),S&&e.jsx("div",{className:"flex items-center justify-center mb-3 text-center",children:S}),i&&e.jsx(W.Dialog.Title,{className:l("text-lg font-semibold text-text leading-snug",u==="center"?"text-center":"text-left"),children:i}),d&&e.jsx(W.Dialog.Description,{className:l("text-sm text-text-muted mt-2 leading-relaxed",u==="center"?"text-center":"text-left"),children:d}),c&&e.jsx("div",{className:"mt-4 w-full text-left",children:c}),j!==void 0?j:(C||x)&&e.jsxs("div",{className:l("w-full mt-6",x&&C?"grid grid-cols-2 gap-3":"flex justify-end gap-3"),children:[x&&e.jsx(W.Dialog.Close,{render:e.jsx(Le,{variant:"outline",size:"md",className:"w-full text-sm font-medium",onClick:g,disabled:y,children:x})}),C&&e.jsx(Le,{variant:w(),size:"md",className:"w-full text-sm font-medium",onClick:b,loading:y,disabled:v||y,children:C})]})]})]});return e.jsxs(W.Dialog.Root,{open:t,defaultOpen:r,onOpenChange:s,children:[n&&e.jsx(W.Dialog.Trigger,{render:n}),P]})}const me=Object.assign(qt,{Root:W.Dialog.Root,Trigger:W.Dialog.Trigger,Portal:W.Dialog.Portal,Backdrop:p.forwardRef(function({className:r,...s},n){return e.jsx(W.Dialog.Backdrop,{ref:n,className:l("fixed inset-0 z-[10010] bg-around/40 transition-opacity duration-150 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0",r),...s})}),Popup:p.forwardRef(function({className:r,size:s="sm",...n},a){return e.jsx(W.Dialog.Popup,{ref:a,className:l("fixed left-1/2 top-1/2 z-[10010] -translate-x-1/2 -translate-y-1/2","w-[calc(100%-2rem)] bg-white rounded-lg border border-border p-6 shadow-none","flex flex-col focus:outline-none transition-all duration-150","data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0",Vt[s],r),...n})}),Title:p.forwardRef(function({className:r,...s},n){return e.jsx(W.Dialog.Title,{ref:n,className:l("text-lg font-semibold text-text leading-snug",r),...s})}),Description:p.forwardRef(function({className:r,...s},n){return e.jsx(W.Dialog.Description,{ref:n,className:l("text-sm text-text-muted mt-2 leading-relaxed",r),...s})}),Close:W.Dialog.Close}),ys=W.Dialog.Root,gs=W.Dialog.Trigger,js=W.Dialog.Portal,vs=me.Backdrop,ws=me.Popup,Ns=me.Popup,ks=me.Title,Gs=me.Description,Cs=W.Dialog.Close,Qe={s:25,m:35,l:50,xl:70,full:100},Ss=360;function zs(t){return typeof t=="number"?`${t}px`:`${Qe[t??"m"]??Qe.m}vw`}const Ps={s:"w-[25vw]",m:"w-[35vw]",l:"w-[50vw]",xl:"w-[70vw]",full:"w-screen"},Me=p.forwardRef(({size:t,animated:r,mobileLayer:s,label:n,children:a},o)=>e.jsx("div",{ref:o,role:"dialog","aria-modal":"true","aria-label":n,className:l("flex min-h-0 min-w-90 max-w-full shrink flex-col overflow-y-auto overflow-x-hidden border-s border-border bg-white shadow-none","transition-[translate,opacity] duration-300 ease-[cubic-bezier(0.16,1,0.3,1)] motion-reduce:transition-none",typeof t=="number"?void 0:Ps[t],r?"pointer-events-auto translate-x-0 opacity-100":"pointer-events-none translate-x-full opacity-0 rtl:-translate-x-full","max-[900px]:fixed max-[900px]:inset-0 max-[900px]:!w-full max-[900px]:min-w-0 max-[900px]:border-0",s),style:typeof t=="number"?{width:t}:void 0,children:a}));Me.displayName="DrawerSlot";const tt=p.createContext(void 0),Ut=()=>{const t=p.useContext(tt);if(!t)throw new Error("useGymatraDrawer must be used within a GymatraDrawerProvider");return t},Is=Ut,Ms=tt;function Ht({children:t}){const[r,s]=p.useState(!1),[n,a]=p.useState(!1),[o,i]=p.useState(!1),[d,m]=p.useState("m"),[u,c]=p.useState(null),[f,b]=p.useState(null),h=p.useRef(null),x=p.useRef(null),[g,y]=p.useState(!1),[v,k]=p.useState(!1),[j,N]=p.useState(!1),[z,T]=p.useState("l"),[C,S]=p.useState(null),[w,P]=p.useState(null),E=p.useRef(null),R=p.useRef(null),[$,te]=p.useState(!1),[I,V]=p.useState(!1),[ae,B]=p.useState(!1),[O,K]=p.useState("s"),[q,Q]=p.useState(null),[Se,oe]=p.useState(null),be=p.useRef(null),ie=p.useRef(null);p.useEffect(()=>{if(n&&r){const G=requestAnimationFrame(()=>{i(!0)});return()=>cancelAnimationFrame(G)}else i(!1)},[n,r]),p.useEffect(()=>{if(v&&g){const G=requestAnimationFrame(()=>{N(!0)});return()=>cancelAnimationFrame(G)}else N(!1)},[v,g]),p.useEffect(()=>{if(I&&$){const G=requestAnimationFrame(()=>{B(!0)});return()=>cancelAnimationFrame(G)}else B(!1)},[I,$]),p.useEffect(()=>{const G=()=>{ye()};return window.addEventListener("popstate",G),()=>window.removeEventListener("popstate",G)},[]);const he=(G,M="s",A={})=>{ie.current&&clearTimeout(ie.current),Q(()=>G),K(M),oe(A),V(!0),te(!0)},Z=()=>{te(!1),B(!1),ie.current&&clearTimeout(ie.current),ie.current=setTimeout(()=>{V(!1),Q(null),oe(null)},300)},ze=(G,M="l",A={})=>{R.current&&clearTimeout(R.current),S(()=>G),T(M),P(A),k(!0),y(!0)},ce=()=>{Z(),y(!1),N(!1),R.current&&clearTimeout(R.current),R.current=setTimeout(()=>{k(!1),S(null),P(null)},300)},Ve=(G,M="m",A={})=>{x.current&&clearTimeout(x.current),c(()=>G),m(M),b(A),a(!0),s(!0)},de=()=>{Z(),ce(),s(!1),i(!1),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{a(!1),c(null),b(null)},300)},ye=()=>{de()};p.useEffect(()=>{const G=M=>{M.key==="Escape"&&($?Z():g?ce():r&&de())};if(r||g||$)return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[r,g,$]);const Pe=n||v||I,qe=o||j||ae,Ie=(r?1:0)+(g?1:0)+($?1:0);return e.jsxs(tt.Provider,{value:{openDrawer:Ve,closeDrawer:de,isOpen:r,size:d,contentProps:f,Component:u,openSecondDrawer:ze,closeSecondDrawer:ce,isSecondOpen:g,secondSize:z,secondContentProps:w,SecondComponent:C,openThirdDrawer:he,closeThirdDrawer:Z,isThirdOpen:$,thirdSize:O,thirdContentProps:Se,ThirdComponent:q,closeAll:ye,openCount:Ie},children:[t,Pe&&e.jsx("div",{"aria-hidden":"true",onClick:()=>{$?Z():g?ce():r&&de()},className:l("fixed inset-0 z-[9990] bg-around/40 cursor-pointer","transition-opacity duration-300 ease-out",qe?"opacity-100":"opacity-0 pointer-events-none")}),Pe&&e.jsxs("div",{className:"pointer-events-none fixed inset-y-0 end-0 z-[10000] flex max-w-full items-stretch justify-end gap-1.5 overflow-x-auto overflow-y-hidden max-[900px]:inset-0",children:[I&&e.jsx(Me,{ref:be,size:O,animated:ae,mobileLayer:"max-[900px]:z-30",label:"Tiroir de niveau 3",children:q&&e.jsx(q,{...Se||{}})}),v&&e.jsx(Me,{ref:E,size:z,animated:j,mobileLayer:"max-[900px]:z-20",label:"Tiroir de niveau 2",children:C&&e.jsx(C,{...w||{}})}),n&&e.jsx(Me,{ref:h,size:d,animated:o,mobileLayer:"max-[900px]:z-10",label:"Tiroir",children:u&&e.jsx(u,{...f||{}})})]})]})}const Ts=Ht;function Ls({title:t,description:r,icon:s,showCloseButton:n=!0,onClose:a,footer:o,className:i,children:d,...m}){return e.jsxs("div",{className:l("flex h-full flex-col bg-white text-text min-h-0",i),...m,children:[(t||n)&&e.jsxs("div",{className:"sticky top-0 z-20 shrink-0 bg-white",children:[e.jsxs("div",{className:"flex items-center justify-between px-5 pt-4 pb-3 sm:px-6",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0 pe-3",children:[s&&e.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-primary-soft text-primary",children:s}),e.jsxs("div",{className:"min-w-0",children:[t&&e.jsx("h3",{className:"text-base font-semibold text-text truncate",children:t}),r&&e.jsx("p",{className:"text-xs text-text-muted truncate mt-0.5",children:r})]})]}),n&&e.jsx("button",{type:"button",onClick:a,"aria-label":"Fermer",className:"size-8 inline-flex shrink-0 items-center justify-center rounded-md text-text-muted hover:bg-surface-muted hover:text-text cursor-pointer transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",children:e.jsxs("svg",{className:"size-4.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsx("div",{className:"mx-5 sm:mx-6 border-b border-border"})]}),e.jsx("div",{className:"flex-1 space-y-4 overflow-y-auto p-5 text-sm text-text",children:d}),o&&e.jsx("div",{className:"flex shrink-0 items-center justify-end gap-2.5 border-t border-border bg-white px-5 py-3.5",children:o})]})}function Rs(){return e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("path",{d:"M3 9l2.5-5h13L21 9"}),e.jsx("path",{d:"M3 9h5l1.5 3h5L16 9h5v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1Z"})]})}const Bs={sm:{root:"gap-3 px-4 py-6",tile:"size-10 [&>svg]:size-5",title:"text-sm",description:"text-xs"},md:{root:"gap-4 px-6 py-10",tile:"size-12 [&>svg]:size-6",title:"text-base",description:"text-sm"},lg:{root:"gap-5 px-6 py-16",tile:"size-14 [&>svg]:size-7",title:"text-lg",description:"text-sm"}},As={plain:"",bordered:"rounded-lg border border-dashed border-border-strong",muted:"rounded-lg bg-surface-muted"},Ds={neutral:{plain:"bg-surface-muted text-text-muted",bordered:"bg-surface-muted text-text-muted",muted:"bg-white text-text-muted"},primary:{plain:"bg-primary-soft text-primary",bordered:"bg-primary-soft text-primary",muted:"bg-white text-primary"},danger:{plain:"bg-danger-soft text-danger",bordered:"bg-danger-soft text-danger",muted:"bg-white text-danger"}},_t=p.forwardRef(({title:t,description:r,icon:s,action:n,secondaryAction:a,size:o="md",variant:i="plain",tone:d="neutral",headingLevel:m=3,className:u,...c},f)=>{const b=Bs[o],h=`h${m}`,x=s===void 0?e.jsx(Rs,{}):s;return e.jsxs("div",{ref:f,className:l("flex w-full flex-col items-center justify-center text-center",b.root,As[i],u),...c,children:[x!==null&&e.jsx("span",{"aria-hidden":"true",className:l("flex shrink-0 items-center justify-center rounded-full",b.tile,Ds[d][i]),children:x}),e.jsxs("div",{className:"max-w-sm space-y-1",children:[e.jsx(h,{className:l("font-semibold text-text",b.title),children:t}),r&&e.jsx("p",{className:l("text-text-muted",b.description),children:r})]}),(n||a)&&e.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[a,n]})]})});_t.displayName="GymatraEmptyState";function Fs({className:t="size-3.5"}){return e.jsx("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m6 9 6 6 6-6"})})}function rt({label:t,options:r,multiple:s=!1,value:n,defaultValue:a,onChange:o,placeholder:i,bordered:d=!0,showCount:m=!0,size:u="sm",width:c,className:f,disabled:b=!1}){const[h,x]=p.useState(()=>typeof a<"u"?a:s?[]:r.length>0?r[0].value:""),[g,y]=p.useState(!1),v=p.useRef(null),k=n??h,j=s?Array.isArray(k)?k:k?[k]:[]:typeof k=="string"&&k!==""?[k]:[];let N;if(s)if(j.length===0)N=i??`All ${t}`;else if(j.length===1){const w=r.find(P=>P.value===j[0]);N=w?w.label:j[0]}else j.length===r.length?N=`All (${j.length})`:N=`${j.length} selected`;else{const w=j[0],P=r.find(E=>E.value===w);N=P?P.label:i??`All ${t}`}const z=s?j.length>0:!!(j[0]&&j[0]!=="all"&&j[0]!=="");p.useEffect(()=>{function w(P){v.current&&!v.current.contains(P.target)&&y(!1)}if(g)return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[g]),p.useEffect(()=>{function w(P){P.key==="Escape"&&y(!1)}if(g)return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[g]);function T(w){if(s){const E=j.includes(w)?j.filter(R=>R!==w):[...j,w];typeof n>"u"&&x(E),o==null||o(E)}else typeof n>"u"&&x(w),o==null||o(w),y(!1)}function C(){const w=r.filter(P=>!P.disabled).map(P=>P.value);typeof n>"u"&&x(w),o==null||o(w)}function S(){const w=[];typeof n>"u"&&x(w),o==null||o(w)}return e.jsxs("div",{ref:v,className:l("relative inline-block text-left",f),children:[e.jsxs("button",{type:"button",disabled:b,onClick:()=>y(w=>!w),"aria-haspopup":"listbox","aria-expanded":g,"aria-label":`${t}: ${N}`,className:l("inline-flex items-center justify-between gap-2 rounded-md text-text cursor-pointer transition-colors outline-none","focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary","disabled:pointer-events-none disabled:opacity-50",u==="sm"?"h-8.5 px-3 text-sm":"h-10 px-3.5 text-sm",c||(u==="sm"?"w-[165px]":"w-[185px]"),d?"border border-border bg-white hover:border-border-strong hover:bg-surface/50":"border-0 bg-transparent hover:bg-surface/50",g&&"bg-primary-soft/50 text-primary",z&&!g&&"bg-primary-soft/50 text-primary"),children:[e.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[e.jsxs("span",{className:"text-text-muted",children:[t,":"]}),e.jsx("span",{className:"truncate",children:N})]}),e.jsx("span",{className:l("text-text-subtle transition-transform duration-150 flex items-center shrink-0",g&&"rotate-180 text-primary"),"aria-hidden":"true",children:e.jsx(Fs,{})})]}),g&&e.jsxs("div",{role:"listbox","aria-multiselectable":s,"aria-label":t,className:"absolute left-0 z-50 mt-1 min-w-[190px] w-max max-w-[280px] rounded-lg border border-border bg-white p-1.5 shadow-none focus:outline-none",children:[s&&r.length>2&&e.jsxs("div",{className:"flex items-center justify-between border-b border-border px-2 py-1.5 mb-1 text-xs text-text-muted",children:[e.jsxs("span",{children:[j.length," of ",r.length," selected"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:C,className:"text-primary hover:underline font-medium cursor-pointer",children:"All"}),e.jsx("span",{className:"text-border","aria-hidden":"true",children:"|"}),e.jsx("button",{type:"button",onClick:S,className:"text-text-muted hover:text-text hover:underline cursor-pointer",children:"Clear"})]})]}),e.jsx("div",{className:"max-h-60 overflow-y-auto space-y-0.5",children:r.map(w=>{const P=j.includes(w.value);return e.jsxs("button",{type:"button",role:"option","aria-selected":P,disabled:w.disabled,onClick:()=>T(w.value),className:l("flex w-full items-center justify-between gap-2.5 rounded-md px-2 py-1.5 text-sm text-left cursor-pointer transition-colors outline-none","hover:bg-surface hover:text-text","focus-visible:bg-surface focus-visible:text-primary","disabled:pointer-events-none disabled:opacity-40",P?"bg-primary-soft/40 text-primary font-medium":"text-text font-normal"),children:[e.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[e.jsx("span",{"aria-hidden":"true",className:l("size-5 shrink-0 rounded-md flex items-center justify-center border transition-colors",P?"border-primary bg-primary text-white":"border-border-strong bg-white hover:border-text-subtle"),children:P&&e.jsx("svg",{"aria-hidden":"true",className:"size-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})})}),e.jsx("span",{className:"truncate",children:w.label})]}),m&&typeof w.count<"u"&&e.jsx("span",{className:l("shrink-0 rounded px-1.5 py-0.5 text-xs font-medium leading-none",P?"bg-primary text-white":"bg-surface text-text-muted"),children:w.count})]},w.value)})})]})]})}rt.displayName="GymatraFilterSelect";function Es({className:t="size-4"}){return e.jsxs("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"11",cy:"11",r:"7"}),e.jsx("path",{d:"m21 21-4.35-4.35"})]})}function Kt({className:t="size-3"}){return e.jsx("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})}function Ws({className:t="size-3.5"}){return e.jsx("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m6 9 6 6 6-6"})})}function Os({className:t="size-3.5"}){return e.jsx("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"})})}function Qt({value:t,onChange:r,onClear:s,placeholder:n="Search...",borderless:a=!0,className:o,...i}){const d=!!(t&&String(t).length>0);return e.jsxs("div",{className:l("relative flex items-center shrink-0",a?"w-[180px] min-w-[140px] max-w-[220px]":"w-60",o),children:[e.jsx("span",{className:"pointer-events-none absolute left-0.5 flex items-center text-text-subtle","aria-hidden":"true",children:e.jsx(Es,{className:"size-4"})}),e.jsx("input",{type:"search",value:t,onChange:r,placeholder:n,className:l("w-full h-9 bg-transparent text-sm text-text placeholder:text-sm placeholder:text-text-subtle",a?"border-0 ring-0 outline-none shadow-none pl-6 pr-5 focus:border-0 focus:ring-0 focus:outline-none focus:shadow-none active:border-0 active:ring-0 active:outline-none":"rounded-md border border-border pl-8 pr-6 focus:border-primary focus:outline-2 focus:outline-primary/30"),...i}),d&&s&&e.jsx("button",{type:"button",onClick:s,"aria-label":"Clear search",className:"absolute right-0.5 flex size-5 items-center justify-center text-text-subtle hover:text-text cursor-pointer transition-colors",children:e.jsx(Kt,{className:"size-3.5"})})]})}function $s({label:t,options:r,value:s,defaultValue:n,onChange:a,className:o,...i}){return e.jsxs("div",{className:l("relative inline-flex items-center",o),children:[e.jsx("select",{value:s,defaultValue:n,onChange:a,"aria-label":t,className:"h-8.5 rounded-md border border-border bg-surface pl-2.5 pr-7 text-sm text-text outline-none hover:border-border-strong focus-visible:border-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary cursor-pointer appearance-none transition-colors",...i,children:r.map(d=>e.jsx("option",{value:d.value,children:d.label},d.value))}),e.jsx("span",{className:"pointer-events-none absolute right-2 text-text-subtle flex items-center","aria-hidden":"true",children:e.jsx(Ws,{})})]})}function Zt({label:t,valueLabel:r,onRemove:s,className:n}){return e.jsxs("span",{className:l("inline-flex h-6 items-center gap-1.5 rounded border border-border bg-surface px-2 text-xs text-text",n),children:[e.jsxs("span",{className:"text-text-muted",children:[t,":"]}),e.jsx("span",{className:"font-medium text-text",children:r}),e.jsx("button",{type:"button",onClick:s,"aria-label":`Remove filter ${t}: ${r}`,className:"inline-flex size-3.5 items-center justify-center rounded-full text-text-muted hover:text-text cursor-pointer transition-colors",children:e.jsx(Kt,{})})]})}function Jt({searchValue:t,onSearchChange:r,searchPlaceholder:s="Search...",searchBorderless:n=!0,totalCount:a,countLabel:o="Results",actions:i,filters:d=[],activeFilters:m=[],onResetFilters:u,isFiltersOpen:c,defaultFiltersOpen:f=!1,onToggleFilters:b,filterButtonLabel:h="Filters",bottomContent:x,className:g,children:y,...v}){const[k,j]=p.useState(f),N=c??k;function z(){const S=!N;typeof c>"u"&&j(S),b==null||b(S)}const T=typeof t<"u"||typeof r<"u";d.length>0||m.length>0;const C=m.length;return e.jsxs("div",{className:l("flex flex-col w-full",g),...v,children:[e.jsxs("div",{className:"flex flex-wrap items-center min-h-12 py-1.5 ps-3.5 pe-1.5 gap-3 rounded-lg border border-border bg-surface",children:[T&&e.jsx(Qt,{value:t,onChange:S=>r==null?void 0:r(S.target.value),onClear:()=>r==null?void 0:r(""),placeholder:s,borderless:n}),T&&typeof a<"u"&&e.jsx("span",{className:"h-5 w-px shrink-0 bg-border","aria-hidden":"true"}),typeof a<"u"&&e.jsxs("div",{className:"inline-flex items-center gap-1.5 whitespace-nowrap text-sm text-text-muted",children:[e.jsx("span",{className:"font-medium text-text",children:a}),e.jsx("span",{children:o})]}),y,e.jsxs("div",{className:"ms-auto flex flex-wrap items-center gap-2.5",children:[d.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"h-5 w-px shrink-0 bg-border","aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.map(S=>e.jsx(rt,{label:S.label,options:S.options,multiple:S.multiple,value:S.value,defaultValue:S.defaultValue,onChange:S.onChange},S.id)),u&&(m.length>0||!!t)&&e.jsx("button",{type:"button",onClick:u,className:"rounded px-1.5 py-0.5 text-xs font-medium text-primary hover:underline cursor-pointer transition-opacity",children:"Reset"})]})]}),i,x&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"h-5 w-px shrink-0 bg-border","aria-hidden":"true"}),e.jsxs("button",{type:"button",onClick:z,"aria-expanded":N,"aria-label":`${N?"Hide":"Show"} filters`,title:h,"data-active":N||C>0,className:"relative inline-flex size-8 shrink-0 items-center justify-center rounded-md border-0 bg-transparent text-text hover:bg-surface-muted hover:text-primary cursor-pointer transition-colors outline-none focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary data-[active=true]:bg-primary-soft data-[active=true]:text-primary",children:[e.jsx(Os,{}),C>0&&e.jsx("span",{className:"absolute -top-1 -right-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-primary px-1 text-xs font-medium leading-none text-white",children:C})]})]})]})]}),m.length>0&&e.jsx("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 px-1","aria-label":"Applied filters",children:m.map(S=>e.jsx(Zt,{label:S.label,valueLabel:S.valueLabel,onRemove:S.onRemove},S.id))}),N&&x&&e.jsx("div",{className:"mt-2.5 flex flex-col gap-3 rounded-lg border border-border bg-surface p-3.5 transition-all",children:x})]})}Jt.displayName="GymatraFilterBar";function D({label:t,error:r,helperText:s,required:n,disabled:a,focused:o,startAdornment:i,endAdornment:d,className:m,wrapperClassName:u,children:c,...f}){const b=!!r;return e.jsxs("div",{className:l("relative w-full pt-2.5 pb-1",a&&"opacity-60 pointer-events-none",u),...f,children:[e.jsxs("div",{className:l("group relative flex items-center w-full min-h-11 rounded-md border bg-white transition-all",b?"border-danger focus-within:border-danger focus-within:ring-1 focus-within:ring-danger":o?"border-primary ring-1 ring-primary":"border-border hover:border-text-subtle focus-within:border-primary focus-within:ring-1 focus-within:ring-primary",m),children:[t&&e.jsxs("label",{className:l("pointer-events-none absolute -top-3 start-3 z-10 px-1.5 bg-white text-sm leading-none font-medium transition-colors select-none",b?"text-danger":o?"text-primary":"text-text-muted group-focus-within:text-primary group-hover:text-text"),children:[t,n&&e.jsx("span",{className:"ms-0.5 text-danger","aria-hidden":"true",children:"*"})]}),i&&e.jsx("div",{className:"flex shrink-0 items-center ps-3 text-text-muted select-none",children:i}),e.jsx("div",{className:"flex-1 min-w-0 flex items-center",children:c}),d&&e.jsx("div",{className:"flex shrink-0 items-center pe-3 text-text-muted select-none",children:d})]}),(r||s)&&e.jsxs("p",{className:l("mt-2 text-xs flex items-center gap-1 ps-1",b?"text-danger font-medium":"text-text-muted"),children:[b&&e.jsxs("svg",{className:"size-3.5 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),e.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),e.jsx("span",{children:r||s})]})]})}const pe=p.forwardRef(({label:t,error:r,helperText:s,startIcon:n,endIcon:a,prefixText:o,suffixText:i,type:d="text",placeholder:m,disabled:u,required:c,className:f,wrapperClassName:b,...h},x)=>{const g=!!(n||o),y=!!(i||a);return e.jsx(D,{label:t,error:r,helperText:s,required:c,disabled:u,wrapperClassName:b,startAdornment:g?e.jsxs("div",{className:"flex items-center gap-1.5 text-text-muted text-sm",children:[n,o&&e.jsx("span",{className:"font-medium text-text select-none",children:o})]}):void 0,endAdornment:y?e.jsxs("div",{className:"flex items-center gap-1.5 text-text-muted text-sm",children:[i&&e.jsx("span",{className:"font-medium text-text select-none",children:i}),a]}):void 0,children:e.jsx("input",{ref:x,type:d,disabled:u,placeholder:m||(typeof t=="string"?t:void 0),className:l("w-full h-11 bg-transparent text-sm text-text placeholder:text-text-subtle/80 outline-none border-0 border-none ring-0 shadow-none focus:ring-0 focus:outline-none focus:border-0",g?"ps-2.5":"ps-3.5",y?"pe-2.5":"pe-3.5","disabled:cursor-not-allowed",f),...h})})});pe.displayName="GymatraTextInput";const Yt=p.forwardRef(({label:t="Email",startIcon:r,...s},n)=>{const a=e.jsxs("svg",{className:"size-4 text-text-subtle",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),e.jsx("path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"})]});return e.jsx(pe,{ref:n,type:"email",label:t,startIcon:r??a,autoComplete:"email",...s})});Yt.displayName="GymatraEmailInput";const Xt=p.forwardRef(({label:t="Mot de passe",startIcon:r,...s},n)=>{const[a,o]=p.useState(!1),i=e.jsxs("svg",{className:"size-4 text-text-subtle",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]});return e.jsx(pe,{ref:n,type:a?"text":"password",label:t,startIcon:r??i,autoComplete:"current-password",endIcon:e.jsx("button",{type:"button",tabIndex:-1,onClick:()=>o(!a),className:"text-text-muted hover:text-text cursor-pointer transition-colors p-1","aria-label":a?"Masquer":"Afficher",children:a?e.jsxs("svg",{className:"size-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),e.jsx("line",{x1:"1",y1:"23",x2:"23",y2:"1"})]}):e.jsxs("svg",{className:"size-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}),...s})});Xt.displayName="GymatraPasswordInput";const er=p.forwardRef(({label:t="Rechercher",startIcon:r,value:s,onChange:n,onClear:a,...o},i)=>{const[d,m]=p.useState(""),u=s!==void 0,c=u?String(s):d,f=e.jsxs("svg",{className:"size-4 text-text-subtle",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),b=()=>{u||m(""),a==null||a()};return e.jsx(pe,{ref:i,type:"search",label:t,value:s,onChange:h=>{u||m(h.target.value),n==null||n(h)},startIcon:r??f,endIcon:c?e.jsx("button",{type:"button",onClick:b,className:"text-text-muted hover:text-text cursor-pointer p-0.5 rounded-full hover:bg-surface-muted transition-colors","aria-label":"Effacer",children:e.jsxs("svg",{className:"size-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}):void 0,...o})});er.displayName="GymatraSearchInput";const Nt=["MA","DZ","TN","FR","ES","BE","CA","US","GB","SA","AE","QA","TR"],kt={MA:"Maroc",DZ:"Algérie",TN:"Tunisie",FR:"France",ES:"Espagne",BE:"Belgique",CA:"Canada",US:"États-Unis",GB:"Royaume-Uni",SA:"Arabie Saoudite",AE:"Émirats Arabes Unis",QA:"Qatar",TR:"Turquie",IT:"Italie",DE:"Allemagne",CH:"Suisse",NL:"Pays-Bas",PT:"Portugal",EG:"Égypte",SN:"Sénégal",CI:"Côte d'Ivoire"},tr=({name:t,label:r="Téléphone",error:s,helperText:n,value:a,defaultValue:o,onChange:i,onBlur:d,defaultCountry:m="MA",disabled:u,required:c,autoValidate:f=!1,invalidErrorMessage:b,placeholder:h,className:x,wrapperClassName:g})=>{const[y,v]=p.useState(m),[k,j]=p.useState(o),[N,z]=p.useState(!1),[T,C]=p.useState(""),S=p.useRef(null),w=p.useRef(null),P=a!==void 0?a:k,E=B=>{a===void 0&&j(B),i==null||i(B)},R=yt[y],$=y?ne.getCountryCallingCode(y):"212",te=!!(f&&P&&P.trim().length>3&&!ne.isValidPhoneNumber(P)),I=s||(te?b||"Numéro de téléphone invalide pour ce pays":void 0),V=p.useMemo(()=>{const O=ne.getCountries().filter(K=>!Nt.includes(K));return[...Nt,...O]},[]),ae=p.useMemo(()=>{if(!T.trim())return V;const B=T.toLowerCase().trim();return V.filter(O=>{const K=(gt[O]||kt[O]||O).toLowerCase(),q=ne.getCountryCallingCode(O);return K.includes(B)||q.includes(B)||O.toLowerCase().includes(B)})},[V,T]);return p.useEffect(()=>{const B=O=>{S.current&&!S.current.contains(O.target)&&z(!1)};return N&&(document.addEventListener("mousedown",B),setTimeout(()=>{var O;return(O=w.current)==null?void 0:O.focus()},50)),()=>document.removeEventListener("mousedown",B)},[N]),e.jsxs("div",{ref:S,className:"relative w-full",children:[e.jsx(D,{label:r,error:I,helperText:n,required:c,disabled:u,focused:N,wrapperClassName:g,className:x,startAdornment:e.jsxs("div",{className:"relative flex items-center pe-1 self-stretch",children:[e.jsxs("button",{type:"button",disabled:u,onClick:()=>{u||(z(!N),C(""))},className:"flex items-center gap-1.5 py-1 px-1 -ms-1 rounded hover:bg-surface-muted transition-colors cursor-pointer select-none text-sm text-text outline-none focus-visible:ring-1 focus-visible:ring-primary","aria-expanded":N,"aria-label":"Sélectionner le pays",children:[e.jsx("span",{className:"flex items-center justify-center w-5 h-3.5 rounded-xs overflow-hidden border border-border/80 shrink-0 bg-surface-muted [&>svg]:size-full [&>svg]:object-cover",children:R?e.jsx(R,{title:y}):e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-text-muted","aria-hidden":"true",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]})}),e.jsx("svg",{className:l("size-3 text-text-subtle shrink-0 transition-transform duration-200",N&&"rotate-180"),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:e.jsx("polyline",{points:"6 9 12 15 18 9"})}),e.jsxs("span",{className:"font-medium text-text text-sm ms-0.5",children:["+",$]})]}),e.jsx("span",{className:"h-4 w-px bg-border ms-1.5 me-1 shrink-0","aria-hidden":"true"})]}),children:e.jsx(Mr,{name:t,country:y,value:P,onChange:E,onBlur:d,disabled:u,placeholder:h||(y==="MA"?"06 55 12 34 56":"Numéro de téléphone"),className:l("w-full h-11 ps-1 pe-3.5 bg-transparent text-sm text-text placeholder:text-text-subtle/80 outline-none border-0 border-none ring-0 shadow-none focus:ring-0 focus:outline-none focus:border-0","disabled:cursor-not-allowed",x)})}),N&&e.jsxs("div",{className:"absolute top-[calc(100%+6px)] start-0 z-50 w-72 rounded-lg border border-border bg-white p-2 shadow-none max-h-72 flex flex-col",children:[e.jsxs("div",{className:"relative mb-2 shrink-0",children:[e.jsx("div",{className:"absolute inset-y-0 start-2.5 flex items-center pointer-events-none text-text-subtle",children:e.jsxs("svg",{className:"size-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}),e.jsx("input",{ref:w,type:"text",value:T,onChange:B=>C(B.target.value),placeholder:"Rechercher pays ou indicatif...",className:"w-full h-8 ps-8 pe-2.5 bg-surface-muted rounded text-sm text-text placeholder:text-text-subtle outline-none border border-border focus:border-primary focus:bg-white transition-colors"})]}),e.jsx("div",{className:"flex-1 overflow-y-auto space-y-0.5 pe-1",children:ae.length===0?e.jsx("div",{className:"px-3 py-4 text-sm text-center text-text-muted",children:"Aucun pays trouvé"}):ae.map(B=>{const O=yt[B],K=ne.getCountryCallingCode(B),q=gt[B]||kt[B]||B,Q=B===y;return e.jsxs("button",{type:"button",onClick:()=>{v(B),z(!1),C("")},className:l("w-full flex items-center justify-between px-2.5 py-1.5 rounded text-sm transition-colors cursor-pointer text-start",Q?"bg-primary-soft text-primary font-medium":"text-text hover:bg-surface-muted"),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"flex items-center justify-center w-5 h-3.5 rounded-xs overflow-hidden border border-border/80 shrink-0 bg-surface-muted [&>svg]:size-full [&>svg]:object-cover",children:O?e.jsx(O,{title:q}):e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-text-muted","aria-hidden":"true",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]})}),e.jsx("span",{className:"truncate",children:q})]}),e.jsxs("span",{className:l("text-xs shrink-0 ms-2 font-medium",Q?"text-primary":"text-text-muted"),children:["+",K]})]},B)})})]})]})};tr.displayName="GymatraPhoneInput";const rr=p.forwardRef(({label:t="Site web",prefixText:r="https://",...s},n)=>{const a=e.jsxs("svg",{className:"size-4 text-text-subtle",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),e.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]});return e.jsx(pe,{ref:n,type:"url",label:t,startIcon:a,prefixText:r,placeholder:"example.com",...s})});rr.displayName="GymatraUrlInput";const Ge=p.forwardRef(({label:t="Nombre",error:r,helperText:s,step:n=1,min:a,max:o,showSteppers:i=!0,prefixText:d,suffixText:m,disabled:u,required:c,className:f,value:b,defaultValue:h,onChange:x,...g},y)=>{const v=p.useRef(null),k=j=>{const N=v.current;!N||u||(j==="up"?N.stepUp():N.stepDown(),N.dispatchEvent(new Event("change",{bubbles:!0})))};return e.jsx(D,{label:t,error:r,helperText:s,required:c,disabled:u,startAdornment:d?e.jsx("span",{className:"text-xs text-text-muted font-medium select-none",children:d}):void 0,endAdornment:i?e.jsxs("div",{className:"flex flex-col border-s border-border -me-1 self-stretch my-0.5 justify-center",children:[e.jsx("button",{type:"button",tabIndex:-1,disabled:u,onClick:()=>k("up"),className:"px-1.5 py-0 text-text-muted hover:text-text hover:bg-surface-muted transition-colors cursor-pointer flex-1 flex items-center justify-center","aria-label":"Augmenter",children:e.jsx("svg",{className:"size-2.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:e.jsx("polyline",{points:"18 15 12 9 6 15"})})}),e.jsx("button",{type:"button",tabIndex:-1,disabled:u,onClick:()=>k("down"),className:"px-1.5 py-0 text-text-muted hover:text-text hover:bg-surface-muted transition-colors cursor-pointer border-t border-border flex-1 flex items-center justify-center","aria-label":"Diminuer",children:e.jsx("svg",{className:"size-2.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:e.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}):m?e.jsx("span",{className:"text-xs text-text-muted font-medium select-none",children:m}):void 0,children:e.jsx("input",{ref:j=>{v.current=j,typeof y=="function"?y(j):y&&(y.current=j)},type:"number",step:n,min:a,max:o,disabled:u,value:b,defaultValue:h,onChange:x,className:l("w-full h-11 bg-transparent text-sm text-text placeholder:text-text-subtle outline-none border-0 border-none ring-0 shadow-none focus:ring-0 focus:outline-none focus:border-0 [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",d?"ps-2.5":"ps-3.5",i||m?"pe-2.5":"pe-3.5",f),...g})})});Ge.displayName="GymatraNumberInput";const Vs=Ge,sr=p.forwardRef(({label:t="Montant",currency:r="DH",currencyPosition:s="end",step:n=.01,min:a=0,placeholder:o="0.00",...i},d)=>{const m=s==="start";return e.jsx(Ge,{ref:d,label:t,step:n,min:a,placeholder:o,showSteppers:!1,prefixText:m?r:void 0,suffixText:m?void 0:r,...i})});sr.displayName="GymatraCurrencyInput";const nr=p.forwardRef(({label:t="Pourcentage",min:r=0,max:s=100,step:n=1,placeholder:a="0",...o},i)=>e.jsx(Ge,{ref:i,label:t,min:r,max:s,step:n,placeholder:a,showSteppers:!1,suffixText:"%",...o}));nr.displayName="GymatraPercentageInput";const ar=p.forwardRef(({label:t="Date",error:r,helperText:s,required:n,disabled:a,className:o,...i},d)=>e.jsx(D,{label:t,error:r,helperText:s,required:n,disabled:a,endAdornment:e.jsxs("svg",{className:"size-4 text-text-subtle pointer-events-none",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),e.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),e.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),e.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]}),children:e.jsx("input",{ref:d,type:"date",disabled:a,className:l("w-full h-11 px-3 bg-transparent text-sm text-text outline-none border-0 border-none ring-0 shadow-none focus:ring-0 focus:outline-none focus:border-0 [color-scheme:light]",o),...i})}));ar.displayName="GymatraDateInput";const or=p.forwardRef(({label:t="Heure",error:r,helperText:s,required:n,disabled:a,className:o,...i},d)=>e.jsx(D,{label:t,error:r,helperText:s,required:n,disabled:a,endAdornment:e.jsxs("svg",{className:"size-4 text-text-subtle pointer-events-none",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("polyline",{points:"12 6 12 12 16 14"})]}),children:e.jsx("input",{ref:d,type:"time",disabled:a,className:l("w-full h-11 px-3 bg-transparent text-sm text-text outline-none border-0 border-none ring-0 shadow-none focus:ring-0 focus:outline-none focus:border-0 [color-scheme:light]",o),...i})}));or.displayName="GymatraTimeInput";const ir=p.forwardRef(({label:t="Date & Heure",error:r,helperText:s,required:n,disabled:a,className:o,...i},d)=>e.jsx(D,{label:t,error:r,helperText:s,required:n,disabled:a,endAdornment:e.jsxs("svg",{className:"size-4 text-text-subtle pointer-events-none",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),e.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),e.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),e.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]}),children:e.jsx("input",{ref:d,type:"datetime-local",disabled:a,className:l("w-full h-11 px-3 bg-transparent text-sm text-text outline-none border-0 border-none ring-0 shadow-none focus:ring-0 focus:outline-none focus:border-0 [color-scheme:light]",o),...i})}));ir.displayName="GymatraDateTimeInput";function qs({label:t="Période (Début - Fin)",startDate:r,endDate:s,onStartDateChange:n,onEndDateChange:a,error:o,helperText:i,disabled:d,required:m,className:u}){return e.jsx(D,{label:t,error:o,helperText:i,required:m,disabled:d,className:u,endAdornment:e.jsxs("svg",{className:"size-4 text-text-subtle pointer-events-none",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),e.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),e.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),e.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]}),children:e.jsxs("div",{className:"flex items-center w-full px-2",children:[e.jsx("input",{type:"date",value:r,disabled:d,onChange:c=>n==null?void 0:n(c.target.value),className:"flex-1 h-11 bg-transparent text-sm text-text outline-none border-0 border-none ring-0 shadow-none focus:ring-0 focus:outline-none focus:border-0 [color-scheme:light]"}),e.jsx("span",{className:"px-2 text-text-muted select-none",children:"→"}),e.jsx("input",{type:"date",value:s,disabled:d,onChange:c=>a==null?void 0:a(c.target.value),className:"flex-1 h-11 bg-transparent text-sm text-text outline-none border-0 border-none ring-0 shadow-none focus:ring-0 focus:outline-none focus:border-0 [color-scheme:light]"})]})})}function Us({name:t,label:r="Sélection",options:s,value:n,defaultValue:a,onChange:o,onBlur:i,placeholder:d="Sélectionner une option...",searchable:m=!1,searchPlaceholder:u="Rechercher...",clearable:c=!1,error:f,helperText:b,required:h,disabled:x,className:g,wrapperClassName:y}){const[v,k]=p.useState(a),[j,N]=p.useState(!1),[z,T]=p.useState(""),C=p.useRef(null),S=p.useRef(null),w=n!==void 0,P=w?n:v,E=s.find(I=>I.value===P);p.useEffect(()=>{const I=V=>{C.current&&!C.current.contains(V.target)&&N(!1)};if(j)return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[j]),p.useEffect(()=>{j&&m&&S.current&&S.current.focus(),j||T("")},[j,m]);const R=z.trim()?s.filter(I=>I.label.toLowerCase().includes(z.toLowerCase())||I.description&&I.description.toLowerCase().includes(z.toLowerCase())):s,$=I=>{I.disabled||(w||k(I.value),o==null||o(I.value),N(!1))},te=I=>{I.stopPropagation(),w||k(void 0),o==null||o(void 0)};return e.jsxs("div",{ref:C,className:l("relative w-full",y),children:[t&&e.jsx("input",{type:"hidden",name:t,value:P!==void 0?String(P):""}),e.jsx(D,{label:r,error:f,helperText:b,required:h,disabled:x,focused:j,endAdornment:e.jsxs("div",{className:"flex items-center gap-1",children:[c&&P!==void 0&&!x&&e.jsx("button",{type:"button",tabIndex:-1,onClick:te,className:"size-5 flex items-center justify-center rounded text-text-subtle hover:text-text hover:bg-surface-muted transition-colors cursor-pointer",title:"Effacer",children:e.jsxs("svg",{className:"size-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),e.jsx("svg",{className:l("size-4 text-text-subtle transition-transform duration-200 pointer-events-none",j&&"rotate-180"),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),children:e.jsx("button",{type:"button",disabled:x,onClick:()=>N(I=>!I),onBlur:i,className:l("w-full h-11 px-3.5 flex items-center justify-start text-start bg-transparent text-sm outline-none cursor-pointer border-0 ring-0",x&&"cursor-not-allowed text-text-subtle",g),children:E?e.jsxs("span",{className:"flex items-center gap-2 truncate text-text font-normal",children:[E.icon&&e.jsx("span",{className:"shrink-0 text-text-muted",children:E.icon}),e.jsx("span",{className:"truncate",children:E.label})]}):e.jsx("span",{className:"text-text-subtle/80 truncate",children:d})})}),j&&e.jsxs("div",{className:"absolute top-[calc(100%+4px)] start-0 z-50 w-full rounded-lg border border-border bg-white p-1.5 shadow-none max-h-72 overflow-y-auto animate-in fade-in-50 zoom-in-95",children:[m&&e.jsx("div",{className:"p-1 pb-1.5 border-b border-border mb-1",children:e.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5 bg-surface-muted rounded-md text-xs",children:[e.jsxs("svg",{className:"size-3.5 text-text-subtle shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),e.jsx("input",{ref:S,type:"text",value:z,onChange:I=>T(I.target.value),placeholder:u,className:"w-full bg-transparent text-text outline-none placeholder:text-text-subtle text-sm"}),z&&e.jsx("button",{type:"button",onClick:()=>T(""),className:"size-3.5 text-text-subtle hover:text-text cursor-pointer",children:"×"})]})}),e.jsx("div",{className:"space-y-0.5",children:R.length===0?e.jsx("div",{className:"py-4 text-center text-sm text-text-muted",children:"Aucun résultat trouvé"}):R.map(I=>{const V=I.value===P;return e.jsxs("button",{type:"button",disabled:I.disabled,onClick:()=>$(I),className:l("w-full flex items-center justify-between gap-2 px-3 py-2 rounded-md text-sm text-start transition-colors cursor-pointer",V?"bg-primary-soft text-primary font-medium":"text-text hover:bg-surface-muted",I.disabled&&"opacity-40 cursor-not-allowed hover:bg-transparent"),children:[e.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[I.icon&&e.jsx("span",{className:"shrink-0 text-text-muted",children:I.icon}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate font-medium",children:I.label}),I.description&&e.jsx("div",{className:"text-xs text-text-muted truncate mt-0.5",children:I.description})]})]}),V&&e.jsx("svg",{className:"size-4 text-primary shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})})]},String(I.value))})})]})]})}const lr=p.forwardRef(({label:t="Sélection",options:r,error:s,helperText:n,placeholder:a="Choisir...",disabled:o,required:i,className:d,children:m,...u},c)=>e.jsx(D,{label:t,error:s,helperText:n,required:i,disabled:o,endAdornment:e.jsx("svg",{className:"size-4 text-text-subtle pointer-events-none",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("polyline",{points:"6 9 12 15 18 9"})}),children:e.jsxs("select",{ref:c,disabled:o,className:l("w-full h-11 ps-3.5 pe-8 bg-transparent text-sm text-text outline-none appearance-none cursor-pointer border-0 border-none ring-0 shadow-none focus:ring-0 focus:outline-none focus:border-0",d),...u,children:[a&&e.jsx("option",{value:"",children:a}),r.map(f=>e.jsx("option",{value:f.value,children:f.label},f.value)),m]})}));lr.displayName="GymatraSelectField";function Hs({label:t="Sélection multiple",options:r,value:s=[],onChange:n,error:a,helperText:o,placeholder:i="Sélectionner...",disabled:d,required:m}){const[u,c]=p.useState(!1),f=p.useRef(null);p.useEffect(()=>{const x=g=>{f.current&&!f.current.contains(g.target)&&c(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[]);const b=x=>{s.includes(x)?n==null||n(s.filter(g=>g!==x)):n==null||n([...s,x])},h=r.filter(x=>s.includes(x.value));return e.jsxs("div",{ref:f,className:"relative w-full",children:[e.jsx(D,{label:t,error:a,helperText:o,required:m,disabled:d,focused:u,endAdornment:e.jsx("svg",{className:l("size-4 text-text-subtle transition-transform",u&&"rotate-180"),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("polyline",{points:"6 9 12 15 18 9"})}),children:e.jsx("button",{type:"button",disabled:d,onClick:()=>c(!u),className:"w-full min-h-11 py-2 px-3.5 flex flex-wrap items-center gap-1.5 text-left text-sm text-text outline-none cursor-pointer",children:h.length===0?e.jsx("span",{className:"text-text-subtle",children:i}):h.map(x=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-surface-muted px-2 py-0.5 text-xs font-medium text-text border border-border",children:[x.label,e.jsx("span",{role:"button",tabIndex:0,onClick:g=>{g.stopPropagation(),b(x.value)},className:"text-text-muted hover:text-text cursor-pointer",children:"×"})]},x.value))})}),u&&e.jsx("div",{className:"absolute top-[calc(100%+4px)] start-0 z-50 w-full rounded-md border border-border bg-white p-1.5 shadow-none max-h-56 overflow-y-auto",children:r.map(x=>{const g=s.includes(x.value);return e.jsxs("div",{onClick:()=>b(x.value),className:l("flex items-center justify-between px-2.5 py-1.5 rounded text-sm cursor-pointer transition-colors",g?"bg-primary-soft text-primary font-medium":"text-text hover:bg-surface-muted"),children:[e.jsx("span",{children:x.label}),g&&e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"size-4 text-primary","aria-hidden":"true",children:e.jsx("path",{d:"M20 6 9 17l-5-5"})})]},x.value)})})]})}function _s({label:t="Autocomplétion",suggestions:r,value:s="",onChange:n,placeholder:a="Commencez à taper...",error:o,helperText:i}){const[d,m]=p.useState(!1),[u,c]=p.useState(s),f=p.useRef(null),b=s!==void 0?s:u,h=r.filter(x=>x.toLowerCase().includes(b.toLowerCase())&&x.toLowerCase()!==b.toLowerCase());return p.useEffect(()=>{const x=g=>{f.current&&!f.current.contains(g.target)&&m(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[]),e.jsxs("div",{ref:f,className:"relative w-full",children:[e.jsx(D,{label:t,error:o,helperText:i,focused:d&&h.length>0,children:e.jsx("input",{type:"text",value:b,placeholder:a,onFocus:()=>m(!0),onChange:x=>{const g=x.target.value;c(g),n==null||n(g),m(!0)},className:"w-full h-11 px-3.5 bg-transparent text-sm text-text placeholder:text-text-subtle outline-none border-0 border-none ring-0 shadow-none focus:ring-0 focus:outline-none focus:border-0"})}),d&&h.length>0&&e.jsx("div",{className:"absolute top-[calc(100%+4px)] start-0 z-50 w-full rounded-md border border-border bg-white p-1 shadow-none max-h-48 overflow-y-auto",children:h.map((x,g)=>e.jsx("div",{onClick:()=>{c(x),n==null||n(x),m(!1)},className:"px-3 py-2 rounded text-sm text-text hover:bg-surface-muted cursor-pointer transition-colors",children:x},g))})]})}const Ks=we.Switch.Root,Qs=we.Switch.Thumb;function Zs(t="md"){switch(t){case"sm":return{track:"h-5 w-9 p-0.5",thumb:"size-4 data-[checked]:translate-x-4 rtl:data-[checked]:-translate-x-4"};case"lg":return{track:"h-7 w-13 p-0.5",thumb:"size-6 data-[checked]:translate-x-6 rtl:data-[checked]:-translate-x-6"};case"md":default:return{track:"h-6 w-11 p-0.5",thumb:"size-5 data-[checked]:translate-x-5 rtl:data-[checked]:-translate-x-5"}}}function Js(t="primary"){switch(t){case"success":return"data-[checked]:bg-success focus-visible:outline-success";case"danger":return"data-[checked]:bg-danger focus-visible:outline-danger";case"warning":return"data-[checked]:bg-warning focus-visible:outline-warning";case"primary":default:return"data-[checked]:bg-primary focus-visible:outline-primary"}}const st=p.forwardRef(({size:t="md",variant:r="primary",label:s,description:n,labelPosition:a="right",onCheckedChange:o,onChange:i,disabled:d=!1,className:m,wrapperClassName:u,...c},f)=>{const b=Zs(t),h=Js(r),x=(y,v)=>{o==null||o(y,v),i==null||i(y)},g=e.jsx(we.Switch.Root,{ref:f,disabled:d,onCheckedChange:x,className:l("relative inline-flex shrink-0 cursor-pointer items-center rounded-full border-0 bg-text-subtle transition-colors duration-200 outline-none select-none shadow-none motion-reduce:transition-none","focus-visible:outline-2 focus-visible:outline-offset-2","data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50",b.track,h,m),...c,children:e.jsx(we.Switch.Thumb,{className:l("pointer-events-none block rounded-full bg-white transition-transform duration-200 shadow-none translate-x-0 motion-reduce:transition-none",b.thumb)})});return!s&&!n?g:a==="left"?e.jsxs("label",{className:l("flex cursor-pointer select-none items-center justify-between gap-4 w-full",d&&"cursor-not-allowed",u),children:[e.jsxs("span",{className:"flex min-w-0 flex-col",children:[s&&e.jsx("span",{className:l("text-sm font-medium leading-tight",d?"text-text-subtle":"text-text"),children:s}),n&&e.jsx("span",{className:"mt-0.5 text-xs leading-normal text-text-muted",children:n})]}),g]}):e.jsxs("label",{className:l("inline-flex cursor-pointer select-none items-center gap-3",d&&"cursor-not-allowed",u),children:[g,e.jsxs("span",{className:"flex min-w-0 flex-col",children:[s&&e.jsx("span",{className:l("text-sm font-medium leading-tight",d?"text-text-subtle":"text-text"),children:s}),n&&e.jsx("span",{className:"mt-0.5 text-xs leading-normal text-text-muted",children:n})]})]})});st.displayName="GymatraSwitch";function Ys({label:t,boxLabel:r,description:s,error:n,helperText:a,disabled:o,className:i,...d}){return e.jsx(D,{label:t,error:n,helperText:a,disabled:o,className:i,children:e.jsx(Je,{label:r,description:s,disabled:o,invalid:!!n,wrapperClassName:"flex w-full p-3",...d})})}function Xs({label:t="Options",name:r,options:s,value:n,defaultValue:a,onChange:o,direction:i="horizontal",error:d,helperText:m,disabled:u}){return e.jsx(D,{label:t,error:d,helperText:m,disabled:u,children:e.jsx("div",{className:l("p-3 w-full flex flex-wrap gap-4",i==="vertical"&&"flex-col gap-2.5"),children:s.map(c=>e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[e.jsx("input",{type:"radio",name:r,value:c.value,checked:n!==void 0?n===c.value:void 0,defaultChecked:a===c.value,onChange:()=>o==null?void 0:o(c.value),disabled:u,className:"size-4 accent-primary"}),e.jsx("span",{className:"text-sm font-medium text-text",children:c.label})]},c.value))})})}function en({label:t,switchLabel:r,description:s,checked:n,defaultChecked:a,onChange:o,error:i,helperText:d,disabled:m}){return e.jsx(D,{label:t,error:i,helperText:d,disabled:m,children:e.jsx(st,{label:r,description:s,labelPosition:"left",checked:n,defaultChecked:a,onChange:o,disabled:m,"aria-invalid":i?!0:void 0,wrapperClassName:"p-3"})})}function tn({label:t,options:r,value:s,onChange:n,error:a,helperText:o}){return e.jsx(D,{label:t,error:a,helperText:o,children:e.jsx("div",{className:"flex items-center p-1.5 w-full gap-1",children:r.map(i=>e.jsx("button",{type:"button",onClick:()=>n(i.value),className:l("flex-1 h-8 rounded text-sm font-medium transition-colors cursor-pointer",s===i.value?"bg-primary text-white shadow-none":"bg-surface-muted text-text-muted hover:bg-border/60 hover:text-text"),children:i.label},i.value))})})}const cr=p.forwardRef(({label:t="Description",error:r,helperText:s,required:n,disabled:a,className:o,placeholder:i,rows:d=3,...m},u)=>e.jsx(D,{label:t,error:r,helperText:s,required:n,disabled:a,children:e.jsx("textarea",{ref:u,rows:d,disabled:a,placeholder:i||(typeof t=="string"?t:void 0),className:l("w-full p-3 bg-transparent text-sm text-text placeholder:text-text-subtle/80 outline-none resize-none",o),...m})}));cr.displayName="GymatraTextareaField";function rn({label:t="Contenu enrichi",value:r,defaultValue:s="",onChange:n,placeholder:a="Rédigez votre texte...",error:o,helperText:i,disabled:d}){const[m,u]=p.useState(s),c=r!==void 0?r:m,f=b=>{const h=`${c} [${b}]`;r===void 0&&u(h),n==null||n(h)};return e.jsx(D,{label:t,error:o,helperText:i,disabled:d,children:e.jsxs("div",{className:"flex flex-col w-full",children:[e.jsxs("div",{className:"flex items-center gap-1 border-b border-border p-2 bg-surface-muted/50",children:[e.jsx("button",{type:"button",onClick:()=>f("b"),className:"size-7 rounded text-sm font-semibold text-text hover:bg-white transition-colors",title:"Gras",children:"B"}),e.jsx("button",{type:"button",onClick:()=>f("i"),className:"size-7 rounded text-sm italic font-serif text-text hover:bg-white transition-colors",title:"Italique",children:"I"}),e.jsx("button",{type:"button",onClick:()=>f("u"),className:"size-7 rounded text-sm underline text-text hover:bg-white transition-colors",title:"Souligné",children:"U"}),e.jsx("span",{className:"h-4 w-px bg-border mx-1"}),e.jsx("button",{type:"button",onClick:()=>f("ul"),className:"size-7 rounded text-sm text-text hover:bg-white transition-colors flex items-center justify-center",title:"Liste à puces",children:e.jsxs("svg",{className:"size-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("line",{x1:"8",y1:"6",x2:"21",y2:"6"}),e.jsx("line",{x1:"8",y1:"12",x2:"21",y2:"12"}),e.jsx("line",{x1:"8",y1:"18",x2:"21",y2:"18"}),e.jsx("line",{x1:"3",y1:"6",x2:"3.01",y2:"6"}),e.jsx("line",{x1:"3",y1:"12",x2:"3.01",y2:"12"}),e.jsx("line",{x1:"3",y1:"18",x2:"3.01",y2:"18"})]})}),e.jsx("button",{type:"button",onClick:()=>f("link"),className:"size-7 rounded text-sm text-text hover:bg-white transition-colors flex items-center justify-center",title:"Lien",children:e.jsxs("svg",{className:"size-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),e.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})})]}),e.jsx("textarea",{rows:4,value:c,disabled:d,placeholder:a,onChange:b=>{r===void 0&&u(b.target.value),n==null||n(b.target.value)},className:"w-full p-3 bg-transparent text-sm text-text placeholder:text-text-subtle/80 outline-none resize-none"})]})})}function sn({label:t="Fichiers joints",accept:r,multiple:s=!1,onFilesSelected:n,error:a,helperText:o,disabled:i}){const[d,m]=p.useState([]),u=p.useId(),c=f=>{if(!f||f.length===0)return;const b=Array.from(f);m(b.map(h=>h.name)),n==null||n(b)};return e.jsx(D,{label:t,error:a,helperText:o,disabled:i,children:e.jsxs("div",{className:"flex flex-col w-full p-3.5",children:[e.jsx("input",{id:u,type:"file",accept:r,multiple:s,disabled:i,onChange:f=>c(f.target.files),className:"hidden"}),e.jsxs("label",{htmlFor:u,className:"flex flex-col items-center justify-center border-2 border-dashed border-border rounded-md p-4 bg-surface-muted/30 hover:bg-surface-muted cursor-pointer transition-colors text-center",children:[e.jsxs("svg",{className:"size-6 text-text-subtle mb-1.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[e.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),e.jsx("polyline",{points:"17 8 12 3 7 8"}),e.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),e.jsx("span",{className:"text-sm font-medium text-primary",children:"Cliquez pour parcourir"}),e.jsx("span",{className:"text-xs text-text-muted mt-0.5",children:"ou glissez-déposez vos fichiers ici"})]}),d.length>0&&e.jsx("div",{className:"mt-2.5 flex flex-wrap gap-1.5",children:d.map((f,b)=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-surface-muted px-2 py-0.5 text-xs text-text border border-border",children:["📄 ",f]},b))})]})})}function nn({label:t="Téléverser une image",onImageSelected:r,error:s,helperText:n,disabled:a}){const[o,i]=p.useState(null),d=p.useId(),m=u=>{const c=u==null?void 0:u[0];c&&(i(URL.createObjectURL(c)),r==null||r(c))};return e.jsx(D,{label:t,error:s,helperText:n,disabled:a,children:e.jsxs("div",{className:"flex items-center justify-between w-full p-3.5 gap-3",children:[e.jsx("input",{id:d,type:"file",accept:"image/*",disabled:a,onChange:u=>m(u.target.files),className:"hidden"}),o?e.jsxs("div",{className:"flex items-center gap-3 w-full",children:[e.jsx("img",{src:o,alt:"Aperçu",className:"size-14 rounded-md object-cover border border-border shrink-0"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("label",{htmlFor:d,className:"text-xs font-medium text-primary hover:underline cursor-pointer block",children:"Changer l'image"}),e.jsx("button",{type:"button",onClick:()=>i(null),className:"mt-1 text-xs text-danger hover:underline cursor-pointer",children:"Supprimer"})]})]}):e.jsxs("label",{htmlFor:d,className:"flex items-center gap-3 w-full cursor-pointer",children:[e.jsx("div",{className:"size-12 rounded-md bg-surface-muted border border-border flex items-center justify-center text-text-subtle shrink-0",children:e.jsxs("svg",{className:"size-6",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),e.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),e.jsx("polyline",{points:"21 15 16 10 5 21"})]})}),e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-text block",children:"Sélectionner une photo"}),e.jsx("span",{className:"text-xs text-text-muted",children:"PNG, JPG, WebP jusqu'à 5MB"})]})]})]})})}function an({label:t="Photo de profil",initialSrc:r,onAvatarChange:s,error:n,helperText:a,disabled:o}){const[i,d]=p.useState(r??null),m=p.useId(),u=c=>{const f=c==null?void 0:c[0];f&&(d(URL.createObjectURL(f)),s==null||s(f))};return e.jsx(D,{label:t,error:n,helperText:a,disabled:o,children:e.jsxs("div",{className:"flex items-center gap-3.5 w-full p-3.5",children:[e.jsx("input",{id:m,type:"file",accept:"image/*",disabled:o,onChange:c=>u(c.target.files),className:"hidden"}),e.jsx("div",{className:"size-12 rounded-full border border-border bg-surface-muted overflow-hidden flex items-center justify-center shrink-0",children:i?e.jsx("img",{src:i,alt:"Avatar",className:"size-full object-cover"}):e.jsx("svg",{className:"size-6 text-text-subtle",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:e.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"})})}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:m,className:"inline-flex h-8 items-center justify-center rounded-md border border-border bg-surface px-3 text-xs font-medium text-text hover:bg-surface-muted cursor-pointer transition-colors",children:"Téléverser une photo"}),e.jsx("span",{className:"text-xs text-text-muted block mt-0.5",children:"Format carré recommandé"})]})]})})}const on=["#224086","#10B981","#EF4444","#F59E0B","#8B5CF6","#06B6D4","#1E293B"];function dr({name:t,label:r="Couleur",value:s,defaultValue:n="#224086",onChange:a,onBlur:o,presets:i=on,showPresets:d=!0,error:m,helperText:u,disabled:c,required:f,className:b,wrapperClassName:h}){const[x,g]=p.useState(n),y=s!==void 0?s:x,v=j=>{s===void 0&&g(j),a==null||a(j)},k=y.startsWith("#")?y.slice(1):y;return e.jsx(D,{label:r,error:m,helperText:u,required:f,disabled:c,wrapperClassName:h,className:b,startAdornment:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"relative size-6 rounded border border-border overflow-hidden cursor-pointer shrink-0 shadow-none hover:border-text-subtle transition-colors",children:[e.jsx("div",{className:"w-full h-full",style:{backgroundColor:y||"#224086"}}),e.jsx("input",{type:"color",value:y.startsWith("#")&&y.length===7?y:"#224086",disabled:c,onChange:j=>v(j.target.value.toUpperCase()),className:"absolute inset-0 opacity-0 w-full h-full cursor-pointer disabled:cursor-not-allowed","aria-label":"Choisir la couleur"})]}),e.jsx("span",{className:"text-text-muted font-mono text-sm select-none",children:"#"})]}),endAdornment:d&&i.length>0?e.jsx("div",{className:"flex items-center gap-1.5 pe-1",children:i.slice(0,7).map(j=>{const N=y.toLowerCase()===j.toLowerCase();return e.jsx("button",{type:"button",disabled:c,onClick:()=>v(j),className:l("size-4 rounded-full border transition-all cursor-pointer hover:scale-115 shrink-0",N?"ring-2 ring-primary ring-offset-1 border-white scale-110":"border-border/60 hover:border-text-subtle"),style:{backgroundColor:j},title:j,"aria-label":`Couleur ${j}`},j)})}):void 0,children:e.jsx("input",{name:t,type:"text",value:k.toUpperCase(),disabled:c,maxLength:6,onChange:j=>{const N=j.target.value.replace(/[^0-9A-Fa-f]/g,"");N.length<=6&&v(`#${N}`)},onBlur:o,placeholder:"224086",className:l("w-full h-11 ps-1 pe-2 bg-transparent text-sm font-mono text-text placeholder:text-text-subtle/80 uppercase outline-none border-0 border-none ring-0 shadow-none focus:ring-0 focus:outline-none focus:border-0","disabled:cursor-not-allowed")})})}const ln=dr;function cn({label:t="Intensité",min:r=0,max:s=100,step:n=1,value:a,defaultValue:o=50,unit:i="%",onChange:d,error:m,helperText:u,disabled:c}){const[f,b]=p.useState(o),h=a!==void 0?a:f;return e.jsx(D,{label:t,error:m,helperText:u,disabled:c,children:e.jsxs("div",{className:"flex items-center gap-3 w-full p-3",children:[e.jsx("input",{type:"range",min:r,max:s,step:n,value:h,disabled:c,onChange:x=>{const g=Number(x.target.value);a===void 0&&b(g),d==null||d(g)},className:"flex-1 accent-primary cursor-pointer"}),e.jsxs("span",{className:"min-w-10 text-right text-sm font-medium text-text font-mono tabular-nums",children:[h,i]})]})})}function dn({label:t="Fourchette",min:r=0,max:s=1e3,minValue:n=100,maxValue:a=600,unit:o="€",onRangeChange:i,error:d,helperText:m}){const[u,c]=p.useState(n),[f,b]=p.useState(a);return e.jsx(D,{label:t,error:d,helperText:m,children:e.jsxs("div",{className:"flex items-center justify-between w-full p-3 gap-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5 flex-1",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Min:"}),e.jsx("input",{type:"number",min:r,max:f,value:u,onChange:h=>{const x=Number(h.target.value);c(x),i==null||i(x,f)},className:"w-full h-8 px-2 rounded border border-border text-sm text-text outline-none focus:border-primary"}),e.jsx("span",{className:"text-xs text-text-muted",children:o})]}),e.jsx("span",{className:"text-text-muted",children:"—"}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-1",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Max:"}),e.jsx("input",{type:"number",min:u,max:s,value:f,onChange:h=>{const x=Number(h.target.value);b(x),i==null||i(u,x)},className:"w-full h-8 px-2 rounded border border-border text-sm text-text outline-none focus:border-primary"}),e.jsx("span",{className:"text-xs text-text-muted",children:o})]})]})})}function un({label:t="Code de validation (OTP)",length:r=6,value:s,onChange:n,error:a,helperText:o,disabled:i}){const d=p.useId(),[m,u]=p.useState(""),c=s!==void 0?s:m,f=(h,x)=>{x.length>1&&(x=x.slice(-1));const g=c.padEnd(r," ").split("");g[h]=x||" ";const y=g.join("").trimEnd();if(s===void 0&&u(y),n==null||n(y),x&&h<r-1){const v=document.getElementById(`${d}-otp-${h+1}`);v==null||v.focus()}},b=(h,x)=>{if(x.key==="Backspace"&&!c[h]&&h>0){const g=document.getElementById(`${d}-otp-${h-1}`);g==null||g.focus()}};return e.jsx(D,{label:t,error:a,helperText:o,disabled:i,children:e.jsx("div",{className:"flex items-center justify-between w-full p-3 gap-2",children:Array.from({length:r}).map((h,x)=>e.jsx("input",{id:`${d}-otp-${x}`,"aria-label":`Chiffre ${x+1} sur ${r}`,type:"text",inputMode:"numeric",maxLength:1,disabled:i,value:c[x]&&c[x]!==" "?c[x]:"",onChange:g=>f(x,g.target.value),onKeyDown:g=>b(x,g),className:"size-10 rounded-md border border-border bg-surface-muted text-center text-base font-semibold text-text focus:border-primary focus:bg-white focus:outline-none"},x))})})}function Ce({label:t,error:r,helperText:s,required:n,disabled:a,startAdornment:o,endAdornment:i,focused:d,hasValue:m,className:u,children:c,...f}){const b=!!r;return e.jsxs("div",{className:l("relative w-full pt-2.5 pb-1",a&&"opacity-60 pointer-events-none",u),...f,children:[e.jsxs("div",{className:l("group relative flex items-center w-full min-h-11 rounded-md border bg-white transition-all",b?"border-danger focus-within:border-danger focus-within:ring-1 focus-within:ring-danger":d?"border-primary ring-1 ring-primary":"border-border hover:border-text-subtle focus-within:border-primary focus-within:ring-1 focus-within:ring-primary"),children:[e.jsxs("label",{className:l("pointer-events-none absolute -top-3 start-3 z-10 px-1.5 bg-white text-sm leading-none font-medium transition-colors select-none",b?"text-danger":d?"text-primary":"text-text-muted group-focus-within:text-primary group-hover:text-text"),children:[t,n&&e.jsx("span",{className:"ms-0.5 text-danger",children:"*"})]}),o&&e.jsx("div",{className:"flex shrink-0 items-center ps-3 text-text-muted select-none",children:o}),e.jsx("div",{className:"flex-1 min-w-0 flex items-center",children:c}),i&&e.jsx("div",{className:"flex shrink-0 items-center pe-3 text-text-muted select-none",children:i})]}),(r||s)&&e.jsx("p",{className:l("mt-1 text-xs leading-none ps-1",b?"text-danger":"text-text-muted"),children:r||s})]})}const ur=p.forwardRef(({label:t,error:r,helperText:s,startIcon:n,endIcon:a,prefixText:o,suffixText:i,type:d="text",value:m,defaultValue:u,onChange:c,disabled:f,required:b,className:h,placeholder:x,...g},y)=>{const[v,k]=p.useState(!1),[j,N]=p.useState(u??""),z=m!==void 0,T=d==="password",C=T?v?"text":"password":d;return e.jsx(Ce,{label:t,error:r,helperText:s,required:b,disabled:f,className:h,startAdornment:n||o?e.jsxs("div",{className:"flex items-center gap-1.5 text-text-muted text-sm",children:[n,o&&e.jsx("span",{className:"font-medium text-text",children:o})]}):void 0,endAdornment:T?e.jsx("button",{type:"button",tabIndex:-1,onClick:()=>k(!v),className:"text-text-muted hover:text-text cursor-pointer transition-colors","aria-label":v?"Hide password":"Show password",children:v?e.jsxs("svg",{className:"size-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),e.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}):e.jsxs("svg",{className:"size-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}):i||a?e.jsxs("div",{className:"flex items-center gap-1.5 text-text-muted text-sm",children:[i&&e.jsx("span",{className:"font-medium text-text",children:i}),a]}):void 0,children:e.jsx("input",{ref:y,type:C,value:m,defaultValue:u,onChange:S=>{z||N(S.target.value),c==null||c(S)},disabled:f,placeholder:x||(typeof t=="string"?t:void 0),className:l("w-full h-11 px-3.5 bg-transparent text-sm text-text placeholder:text-text-subtle/80 outline-none border-0 border-none ring-0 shadow-none focus:ring-0 focus:outline-none focus:border-0","disabled:cursor-not-allowed"),...g})})});ur.displayName="GymatraTextField";const xr=p.forwardRef(({label:t,error:r,helperText:s,required:n,disabled:a,className:o,placeholder:i,rows:d=3,...m},u)=>e.jsx(Ce,{label:t,error:r,helperText:s,required:n,disabled:a,className:o,children:e.jsx("textarea",{ref:u,rows:d,disabled:a,placeholder:i||(typeof t=="string"?t:void 0),className:"w-full p-3 bg-transparent text-sm text-text placeholder:text-text-subtle/80 outline-none resize-none",...m})}));xr.displayName="GymatraFloatingTextarea";const mr=p.forwardRef(({label:t,error:r,helperText:s,required:n,disabled:a,options:o,className:i,children:d,...m},u)=>e.jsx(Ce,{label:t,error:r,helperText:s,required:n,disabled:a,className:i,endAdornment:e.jsx("svg",{className:"size-4 text-text-subtle pointer-events-none",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("polyline",{points:"6 9 12 15 18 9"})}),children:e.jsxs("select",{ref:u,disabled:a,className:"w-full h-11 ps-3.5 pe-8 bg-transparent text-sm text-text outline-none appearance-none cursor-pointer border-0 border-none ring-0 shadow-none focus:ring-0 focus:outline-none focus:border-0",...m,children:[o.map(c=>e.jsx("option",{value:c.value,children:c.label},c.value)),d]})}));mr.displayName="GymatraFloatingSelect";function xn({length:t=6,value:r="",onChange:s,label:n="Code OTP / PIN",error:a,disabled:o}){const[i,d]=p.useState(r),m=r!==void 0?r:i,u=(f,b)=>{b.length>1&&(b=b.slice(-1));const h=m.padEnd(t," ").split("");h[f]=b||" ";const x=h.join("").trimEnd();if(r===void 0&&d(x),s==null||s(x),b&&f<t-1){const g=document.getElementById(`otp-digit-${f+1}`);g==null||g.focus()}},c=(f,b)=>{if(b.key==="Backspace"&&!m[f]&&f>0){const h=document.getElementById(`otp-digit-${f-1}`);h==null||h.focus()}};return e.jsx("div",{className:"relative",children:e.jsx(Ce,{label:n,error:a,disabled:o,children:e.jsx("div",{className:"flex items-center justify-between w-full p-2.5 gap-2",children:Array.from({length:t}).map((f,b)=>e.jsx("input",{id:`otp-digit-${b}`,type:"text",inputMode:"numeric",maxLength:1,disabled:o,value:m[b]&&m[b]!==" "?m[b]:"",onChange:h=>u(b,h.target.value),onKeyDown:h=>c(b,h),className:"size-10 rounded-md border border-border bg-surface-muted text-center text-base font-semibold text-text focus:border-primary focus:bg-white focus:outline-none"},b))})})})}function mn({label:t="Photo de profil",src:r,onChange:s,disabled:n}){const[a,o]=p.useState(r),i=p.useId(),d=m=>{var c;const u=(c=m.target.files)==null?void 0:c[0];if(u){const f=URL.createObjectURL(u);o(f),s==null||s(u)}};return e.jsxs("div",{className:"relative rounded-md border border-border p-3.5 bg-white",children:[e.jsx("label",{className:"absolute -top-2.5 start-2.5 px-1 bg-white text-xs font-medium text-text-muted",children:t}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"relative size-12 shrink-0 rounded-full border border-border overflow-hidden bg-surface-muted flex items-center justify-center text-text-muted",children:a?e.jsx("img",{src:a,alt:"Avatar preview",className:"size-full object-cover"}):e.jsx("svg",{className:"size-6",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",children:e.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"})})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("input",{id:i,type:"file",accept:"image/*",disabled:n,onChange:d,className:"hidden"}),e.jsx("label",{htmlFor:i,className:"inline-flex h-8 items-center justify-center rounded-md border border-border bg-surface px-3 text-xs font-medium text-text hover:bg-surface-muted cursor-pointer transition-colors",children:"Téléverser une image"}),e.jsx("p",{className:"mt-1 text-xs text-text-muted",children:"PNG, JPG jusqu'à 2MB"})]})]})]})}const pr="grid min-w-0 gap-1.5 text-text",fr="text-xs font-medium text-text-muted",br="ms-1 text-primary",hr="text-xs text-text-muted",Te="text-xs text-danger",nt="flex min-h-10 w-full items-center rounded-md border border-border bg-white px-3 text-sm text-text placeholder:text-text-subtle outline-none transition-colors hover:border-border-strong focus-visible:border-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary/30 aria-[invalid=true]:border-danger data-[invalid]:border-danger disabled:cursor-not-allowed disabled:bg-surface-muted disabled:text-text-subtle";function pn({className:t,...r}){return e.jsx(Ct.Form,{...r,className:typeof t=="function"?s=>l("flex flex-col gap-6",t(s)):l("flex flex-col gap-6",t)})}function fn({name:t,label:r,description:s,error:n,required:a,disabled:o,validate:i,validationMode:d,className:m,children:u}){return e.jsxs(U.Field.Root,{name:t,invalid:!!n,disabled:o,validate:i,validationMode:d,className:l(pr,m),children:[e.jsxs(U.Field.Label,{className:fr,children:[r,a&&e.jsx("span",{className:br,"aria-hidden":"true",children:"*"})]}),u,s&&e.jsx(U.Field.Description,{className:hr,children:s}),n?e.jsx(U.Field.Error,{match:!0,className:Te,children:n}):e.jsx(U.Field.Error,{match:"valueMissing",className:Te,children:"This field is required."}),!n&&e.jsx(U.Field.Error,{match:"typeMismatch",className:Te,children:"Enter a valid value."})]})}const yr=p.forwardRef(({className:t,...r},s)=>e.jsx(U.Field.Control,{ref:s,render:e.jsx(St.Input,{}),...r,className:l(nt,t)}));yr.displayName="GymatraInput";function bn({rows:t=4,className:r,...s}){return e.jsx(U.Field.Control,{...s,render:e.jsx("textarea",{rows:t}),className:l(nt,"min-h-24 resize-y py-2.5",r)})}function hn({name:t,label:r,description:s,error:n,options:a,value:o,defaultValue:i,onValueChange:d,placeholder:m="Choose an option",required:u,disabled:c,className:f}){const b=p.useId(),h=s?`${b}-description`:void 0,x=`${b}-error`;return e.jsxs(U.Field.Root,{name:t,invalid:!!n,disabled:c,className:l(pr,f),children:[e.jsxs(U.Field.Label,{htmlFor:b,className:fr,children:[r,u&&e.jsx("span",{className:br,"aria-hidden":"true",children:"*"})]}),e.jsxs(_.Select.Root,{name:t,id:b,items:a,value:o,defaultValue:i,onValueChange:d,required:u,disabled:c,children:[e.jsxs(_.Select.Trigger,{"aria-describedby":[h,x].filter(Boolean).join(" "),"aria-invalid":n?!0:void 0,className:l(nt,"cursor-pointer justify-between gap-3 text-start data-[popup-open]:border-primary"),children:[e.jsx(_.Select.Value,{placeholder:m}),e.jsx(_.Select.Icon,{"aria-hidden":"true",className:"flex text-text-muted",children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"size-4",children:e.jsx("path",{d:"m6 9 6 6 6-6"})})})]}),e.jsx(_.Select.Portal,{children:e.jsx(_.Select.Positioner,{sideOffset:4,className:"z-[10020] outline-none",children:e.jsx(_.Select.Popup,{className:"min-w-[var(--anchor-width)] overflow-hidden rounded-md border border-border bg-white p-1 text-text shadow-none outline-none",children:e.jsx(_.Select.List,{children:a.map(g=>e.jsxs(_.Select.Item,{value:g.value,className:"flex min-h-9 cursor-default items-center justify-between gap-2 rounded-sm px-2.5 text-sm text-text outline-none data-[highlighted]:bg-primary-soft data-[highlighted]:text-primary data-[selected]:font-semibold data-[selected]:text-primary",children:[e.jsx(_.Select.ItemText,{children:g.label}),e.jsx(_.Select.ItemIndicator,{className:"flex text-primary",children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"size-4","aria-hidden":"true",children:e.jsx("path",{d:"M20 6 9 17l-5-5"})})})]},g.value))})})})})]}),s&&e.jsx(U.Field.Description,{id:h,className:hr,children:s}),e.jsx(U.Field.Error,{id:x,match:n?!0:"valueMissing",className:Te,children:n??"Choose an option."})]})}const yn=L.Menu.Root,gn=L.Menu.Trigger,jn=L.Menu.Portal,vn=L.Menu.Positioner,gr=L.Menu.Group,wn=L.Menu.RadioGroup,Nn=L.Menu.SubmenuRoot,fe=p.forwardRef(({className:t,children:r,...s},n)=>e.jsx(L.Menu.Popup,{ref:n,className:l("z-50 min-w-48 rounded-lg border border-border bg-white p-1 text-sm text-text outline-none shadow-none",t),...s,children:r}));fe.displayName="GymatraMenuPopup";const Ae=p.forwardRef(({variant:t="default",startIcon:r,endIcon:s,shortcut:n,className:a,children:o,...i},d)=>e.jsxs(L.Menu.Item,{ref:d,className:l("group relative flex w-full cursor-pointer select-none items-center gap-2 rounded-md px-2.5 py-1.5 text-sm outline-none transition-colors","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t==="danger"?"text-danger data-[highlighted]:bg-danger-soft data-[highlighted]:text-danger font-medium":t==="primary"?"text-primary data-[highlighted]:bg-primary-soft data-[highlighted]:text-primary font-medium":"text-text data-[highlighted]:bg-surface-muted data-[highlighted]:text-text",a),...i,children:[r&&e.jsx("span",{className:"shrink-0 size-4 text-text-muted group-data-[highlighted]:text-current flex items-center justify-center",children:r}),e.jsx("span",{className:"flex-1 truncate",children:o}),n&&e.jsx("kbd",{className:"ml-auto pl-3 font-mono text-xs text-text-muted",children:n}),s&&e.jsx("span",{className:"shrink-0 size-4 text-text-muted group-data-[highlighted]:text-current flex items-center justify-center ml-auto",children:s})]}));Ae.displayName="GymatraMenuItem";const De=p.forwardRef(({className:t,...r},s)=>e.jsx(L.Menu.Separator,{ref:s,className:l("my-1 h-px bg-border -mx-1",t),...r}));De.displayName="GymatraMenuSeparator";const Fe=p.forwardRef(({className:t,...r},s)=>e.jsx(L.Menu.GroupLabel,{ref:s,className:l("px-2.5 py-1 text-xs font-semibold uppercase tracking-wider text-text-muted select-none",t),...r}));Fe.displayName="GymatraMenuGroupLabel";function kn({className:t="size-3.5"}){return e.jsx("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})})}function Gn({className:t="size-3.5"}){return e.jsx("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m9 18 6-6-6-6"})})}const Ee=p.forwardRef(({className:t,children:r,shortcut:s,...n},a)=>e.jsxs(L.Menu.CheckboxItem,{ref:a,className:l("group relative flex w-full cursor-pointer select-none items-center gap-2 rounded-md px-2.5 py-1.5 text-sm text-text outline-none transition-colors","data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-surface-muted",t),...n,children:[e.jsx("span",{className:"shrink-0 size-4 flex items-center justify-center text-primary",children:e.jsx(L.Menu.CheckboxItemIndicator,{children:e.jsx(kn,{})})}),e.jsx("span",{className:"flex-1 truncate",children:r}),s&&e.jsx("kbd",{className:"ml-auto pl-3 font-mono text-xs text-text-muted",children:s})]}));Ee.displayName="GymatraMenuCheckboxItem";const We=p.forwardRef(({className:t,children:r,...s},n)=>e.jsxs(L.Menu.RadioItem,{ref:n,className:l("group relative flex w-full cursor-pointer select-none items-center gap-2 rounded-md px-2.5 py-1.5 text-sm text-text outline-none transition-colors","data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-surface-muted",t),...s,children:[e.jsx("span",{className:"shrink-0 size-4 flex items-center justify-center text-primary",children:e.jsx(L.Menu.RadioItemIndicator,{children:e.jsx("span",{className:"size-2 rounded-full bg-primary"})})}),e.jsx("span",{className:"flex-1 truncate",children:r})]}));We.displayName="GymatraMenuRadioItem";const Oe=p.forwardRef(({startIcon:t,className:r,children:s,...n},a)=>e.jsxs(L.Menu.SubmenuTrigger,{ref:a,className:l("group relative flex w-full cursor-pointer select-none items-center justify-between gap-2 rounded-md px-2.5 py-1.5 text-sm text-text outline-none transition-colors","data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-surface-muted",r),...n,children:[e.jsxs("div",{className:"flex items-center gap-2 truncate",children:[t&&e.jsx("span",{className:"shrink-0 size-4 text-text-muted group-data-[highlighted]:text-current flex items-center justify-center",children:t}),e.jsx("span",{className:"truncate",children:s})]}),e.jsx(Gn,{className:"size-3.5 text-text-muted shrink-0"})]}));Oe.displayName="GymatraMenuSubmenuTrigger";function $e(t){const r=[];let s=0;for(;s<t.length;){const n=t[s];if(n.type!=="label"){r.push(Gt(n,s)),s++;continue}const a=s,o=[];for(s++;s<t.length&&t[s].type!=="label"&&t[s].type!=="separator";)o.push(Gt(t[s],s)),s++;r.push(e.jsxs(gr,{children:[e.jsx(Fe,{children:n.label}),o]},n.key??`menu-group-${a}`))}return r}function Gt(t,r){const s=t.key??`menu-item-${r}`;return t.type==="separator"?e.jsx(De,{},s):t.type==="checkbox"?e.jsx(Ee,{checked:t.checked,onCheckedChange:t.onCheckedChange,shortcut:t.shortcut,disabled:t.disabled,children:t.label},s):t.type==="radio"?e.jsx(We,{value:t.value??String(s),disabled:t.disabled,children:t.label},s):t.items&&t.items.length>0?e.jsxs(L.Menu.SubmenuRoot,{children:[e.jsx(Oe,{startIcon:t.startIcon??t.icon,disabled:t.disabled,children:t.label}),e.jsx(L.Menu.Portal,{children:e.jsx(L.Menu.Positioner,{sideOffset:4,align:"start",className:"z-[10020] outline-none",children:e.jsx(fe,{children:$e(t.items)})})})]},s):e.jsx(Ae,{variant:t.variant,startIcon:t.startIcon??t.icon,endIcon:t.endIcon,shortcut:t.shortcut,disabled:t.disabled,onClick:t.onClick,children:t.label},s)}function Cn({trigger:t,items:r,open:s,defaultOpen:n,onOpenChange:a,side:o="bottom",align:i="start",sideOffset:d=6,width:m="min-w-[200px]",popupClassName:u,children:c}){const f=s!==void 0?{open:s,onOpenChange:a}:n!==void 0?{defaultOpen:n,onOpenChange:a}:{onOpenChange:a};return e.jsxs(L.Menu.Root,{...f,children:[e.jsx(L.Menu.Trigger,{render:p.isValidElement(t)?t:e.jsx("button",{type:"button",children:t})}),e.jsx(L.Menu.Portal,{children:e.jsx(L.Menu.Positioner,{side:o,align:i,sideOffset:d,className:"z-[10020] outline-none",children:e.jsx(fe,{className:l(m,u),children:r&&r.length>0?$e(r):c})})})]})}const Sn=zt.Menubar,zn=L.Menu.Root,Pn=L.Menu.Portal,In=L.Menu.Positioner,Mn=L.Menu.Group,Tn=L.Menu.RadioGroup,Ln=L.Menu.SubmenuRoot,Rn=fe,Bn=Ae,An=De,Dn=Fe,Fn=Ee,En=We,Wn=Oe,at=p.forwardRef(({className:t,startIcon:r,children:s,...n},a)=>e.jsxs(L.Menu.Trigger,{ref:a,className:l("flex cursor-pointer select-none items-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium text-text outline-none transition-colors","hover:bg-surface-muted hover:text-text","data-[popup-open]:bg-primary-soft data-[popup-open]:text-primary","focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary","data-[disabled]:opacity-50 data-[disabled]:pointer-events-none",t),...n,children:[r&&e.jsx("span",{className:"shrink-0 size-4 text-text-muted flex items-center justify-center",children:r}),e.jsx("span",{children:s})]}));at.displayName="GymatraMenubarTrigger";const jr=p.forwardRef(({menus:t,bordered:r=!0,className:s,children:n,...a},o)=>e.jsx(zt.Menubar,{ref:o,className:l("flex items-center gap-0.5 text-sm text-text select-none",r?"rounded-md border border-border bg-white p-1 shadow-none":"bg-transparent p-0.5",s),...a,children:t&&t.length>0?t.map((i,d)=>{const m=i.key??`menubar-menu-${d}`;return e.jsxs(L.Menu.Root,{disabled:i.disabled,children:[e.jsx(at,{startIcon:i.startIcon,disabled:i.disabled,children:i.trigger}),e.jsx(L.Menu.Portal,{children:e.jsx(L.Menu.Positioner,{side:i.side??"bottom",align:i.align??"start",sideOffset:i.sideOffset??6,className:"z-[10020] outline-none",children:e.jsx(fe,{className:l(i.width??"min-w-52",i.popupClassName),children:$e(i.items)})})})]},m)}):n}));jr.displayName="GymatraMenubar";function On({className:t="size-3.5"}){return e.jsx("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m15 18-6-6 6-6"})})}function $n({className:t="size-3.5"}){return e.jsx("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m9 18 6-6-6-6"})})}function Vn({className:t="size-3"}){return e.jsx("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m6 9 6 6 6-6"})})}function qn({className:t="size-3"}){return e.jsx("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})})}function ot({page:t,total:r,pageSize:s,onPageChange:n,pageSizeOptions:a,onPageSizeChange:o,showSummary:i=!0,className:d,...m}){const u=Math.max(1,Math.ceil(r/s)),c=Math.min(Math.max(1,t),u),f=r===0?0:(c-1)*s+1,b=Math.min(c*s,r),[h,x]=p.useState(!1),g=p.useRef(null);p.useEffect(()=>{function k(j){g.current&&!g.current.contains(j.target)&&x(!1)}if(h)return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[h]);function y(){return u<=7?Array.from({length:u},(k,j)=>j+1):c<=4?[1,2,3,4,5,"ellipsis",u]:c>=u-3?[1,"ellipsis",u-4,u-3,u-2,u-1,u]:[1,"ellipsis",c-1,c,c+1,"ellipsis",u]}const v=y();return e.jsxs("div",{className:l("flex flex-wrap items-center justify-between gap-3 pt-3 px-1 text-sm text-text-muted",d),...m,children:[e.jsxs("div",{className:"flex items-center gap-2 text-text-muted text-sm",children:[i&&e.jsxs("span",{children:["Display ",f," to ",b," of ",r]}),a&&a.length>0&&o&&e.jsxs("div",{ref:g,className:"relative inline-block text-left",children:[e.jsxs("button",{type:"button",onClick:()=>x(k=>!k),"aria-haspopup":"listbox","aria-expanded":h,"aria-label":`Rows per page: ${s}`,className:l("inline-flex h-7 items-center justify-between gap-2 rounded-md border border-border bg-white px-2.5 text-sm text-text cursor-pointer transition-colors outline-none","hover:border-border-strong hover:bg-surface/50","focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary",h&&"border-primary bg-primary-soft/30 text-primary"),children:[e.jsx("span",{children:s}),e.jsx("span",{className:l("text-text-subtle transition-transform duration-150 flex items-center",h&&"rotate-180 text-primary"),"aria-hidden":"true",children:e.jsx(Vn,{})})]}),h&&e.jsx("div",{role:"listbox","aria-label":"Rows per page",className:"absolute left-0 bottom-full z-50 mb-1 min-w-[75px] rounded-lg border border-border bg-white p-1 shadow-none focus:outline-none",children:a.map(k=>{const j=k===s;return e.jsxs("button",{type:"button",role:"option","aria-selected":j,onClick:()=>{o(k),x(!1)},className:l("flex w-full items-center justify-between rounded px-2 py-1 text-sm text-left cursor-pointer transition-colors outline-none","hover:bg-surface hover:text-text",j?"bg-primary-soft/40 text-primary font-medium":"text-text font-normal"),children:[e.jsx("span",{children:k}),j&&e.jsx("span",{className:"text-primary","aria-hidden":"true",children:e.jsx(qn,{})})]},k)})})]})]}),e.jsxs("div",{className:"flex items-center gap-1 ms-auto",children:[e.jsx("button",{type:"button",disabled:c<=1,onClick:()=>n(c-1),"aria-label":"Previous page",className:"flex size-7 items-center justify-center rounded-full text-text-muted hover:text-text hover:bg-surface disabled:pointer-events-none disabled:opacity-30 cursor-pointer transition-colors",children:e.jsx(On,{})}),v.map((k,j)=>{if(k==="ellipsis")return e.jsx("span",{className:"flex size-7 items-center justify-center text-text-subtle select-none",children:"…"},`ellipsis-${j}`);const N=k===c;return e.jsx("button",{type:"button",onClick:()=>n(k),"aria-current":N?"page":void 0,className:l("flex size-7 items-center justify-center rounded-full text-sm font-medium cursor-pointer transition-colors",N?"bg-primary text-white":"text-text hover:bg-surface"),children:k},k)}),e.jsx("button",{type:"button",disabled:c>=u,onClick:()=>n(c+1),"aria-label":"Next page",className:"flex size-7 items-center justify-center rounded-full text-text-muted hover:text-text hover:bg-surface disabled:pointer-events-none disabled:opacity-30 cursor-pointer transition-colors",children:e.jsx($n,{})})]})]})}ot.displayName="GymatraPagination";const Un=H.Popover.Root,Hn=H.Popover.Trigger,_n=H.Popover.Portal,Kn=H.Popover.Positioner,it=p.forwardRef(({className:t,children:r,...s},n)=>e.jsx(H.Popover.Popup,{ref:n,className:l("relative z-50 rounded-lg border border-border bg-white p-4 text-text outline-none shadow-none",t),...s,children:r}));it.displayName="GymatraPopoverPopup";const lt=p.forwardRef(({className:t,...r},s)=>e.jsx(H.Popover.Title,{ref:s,className:l("text-sm font-semibold text-text",t),...r}));lt.displayName="GymatraPopoverTitle";const ct=p.forwardRef(({className:t,...r},s)=>e.jsx(H.Popover.Description,{ref:s,className:l("mt-1 text-xs leading-relaxed text-text-muted",t),...r}));ct.displayName="GymatraPopoverDescription";function Qn({className:t="size-3.5"}){return e.jsx("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})}const dt=p.forwardRef(({className:t,children:r,...s},n)=>e.jsx(H.Popover.Close,{ref:n,className:l("absolute top-3 right-3 rounded-md p-1 text-text-muted hover:bg-surface-muted hover:text-text cursor-pointer transition-colors outline-none focus-visible:outline-2 focus-visible:outline-primary",t),"aria-label":"Fermer",...s,children:r??e.jsx(Qn,{})}));dt.displayName="GymatraPopoverClose";const vr=p.forwardRef(({className:t,...r},s)=>e.jsx(H.Popover.Arrow,{ref:s,className:l("fill-white stroke-border stroke-1",t),...r}));vr.displayName="GymatraPopoverArrow";function Zn({trigger:t,title:r,description:s,content:n,children:a,footer:o,side:i="bottom",align:d="center",sideOffset:m=8,width:u="w-80",showCloseButton:c=!0,open:f,defaultOpen:b,onOpenChange:h,modal:x=!1,popupClassName:g}){const y=f!==void 0?{open:f,onOpenChange:h,modal:x}:b!==void 0?{defaultOpen:b,onOpenChange:h,modal:x}:{onOpenChange:h,modal:x};return e.jsxs(H.Popover.Root,{...y,children:[e.jsx(H.Popover.Trigger,{render:p.isValidElement(t)?t:e.jsx("button",{type:"button",children:t})}),e.jsx(H.Popover.Portal,{children:e.jsx(H.Popover.Positioner,{side:i,align:d,sideOffset:m,className:"z-[10020] outline-none",children:e.jsxs(it,{className:l(u,g),children:[c&&e.jsx(dt,{}),(r||s)&&e.jsxs("div",{className:l("space-y-1",c?"pr-6":void 0),children:[r&&e.jsx(lt,{children:r}),s&&e.jsx(ct,{children:s})]}),(n||a)&&e.jsx("div",{className:l(r||s?"mt-3":void 0),children:n??a}),o&&e.jsx("div",{className:"mt-4 pt-3 border-t border-border flex items-center justify-end gap-2",children:o})]})})})]})}const Jn=X.Progress.Root,Yn=X.Progress.Track,Xn=X.Progress.Indicator,ea=X.Progress.Label,ta=X.Progress.Value,ra={primary:"bg-primary",success:"bg-success",warning:"bg-warning",danger:"bg-danger",info:"bg-info"},sa={xs:"h-1",sm:"h-1.5",md:"h-2",lg:"h-3"},na={pill:"rounded-full",rounded:"rounded-md",square:"rounded-none"};function aa({value:t,min:r=0,max:s=100,label:n,description:a,showValue:o=!0,formatValue:i,variant:d="primary",size:m="md",shape:u="pill",className:c,trackClassName:f,indicatorClassName:b}){const h=t===null,x=na[u],g=t!==null?Math.round((t-r)/(s-r)*100):0;return e.jsxs(X.Progress.Root,{value:t,min:r,max:s,className:l("w-full space-y-1.5",c),children:[(n||o)&&e.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs font-medium",children:[e.jsxs("div",{className:"space-y-0.5 min-w-0",children:[n&&e.jsx(X.Progress.Label,{className:"text-text font-medium truncate",children:n}),a&&e.jsx("p",{className:"text-xs text-text-muted",children:a})]}),o&&!h&&e.jsx("span",{className:"text-text-muted font-mono font-medium shrink-0 ml-auto",children:i?i(t):`${g}%`})]}),e.jsx(X.Progress.Track,{className:l("relative w-full overflow-hidden bg-surface-muted",sa[m],x,f),children:e.jsx(X.Progress.Indicator,{className:l("h-full transition-all duration-300 ease-out",ra[d],x,h&&"w-1/3 animate-[indeterminate_1.5s_infinite_ease-in-out]",b)})})]})}const oa={primary:"text-primary",success:"text-success",warning:"text-warning",danger:"text-danger",info:"text-info"};function ia({value:t,size:r=80,strokeWidth:s=8,variant:n="primary",children:a,className:o,showValue:i=!0}){const d=Math.min(100,Math.max(0,t)),m=(r-s)/2,u=2*Math.PI*m,c=u-d/100*u;return e.jsxs("div",{className:l("relative inline-flex items-center justify-center shrink-0",o),style:{width:r,height:r},role:"progressbar","aria-valuenow":d,"aria-valuemin":0,"aria-valuemax":100,children:[e.jsxs("svg",{className:"-rotate-90 origin-center",width:r,height:r,viewBox:`0 0 ${r} ${r}`,children:[e.jsx("circle",{className:"text-surface-muted",strokeWidth:s,stroke:"currentColor",fill:"transparent",r:m,cx:r/2,cy:r/2}),e.jsx("circle",{className:l(oa[n],"transition-all duration-500 ease-out"),strokeWidth:s,strokeDasharray:u,strokeDashoffset:c,strokeLinecap:"round",stroke:"currentColor",fill:"transparent",r:m,cx:r/2,cy:r/2})]}),e.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-center p-1",children:a??(i&&e.jsxs("span",{className:"text-xs font-medium font-mono tabular-nums text-text",children:[Math.round(d),"%"]}))})]})}const la=Pt.Separator,wr=p.forwardRef(({orientation:t="horizontal",variant:r="default",decorative:s=!0,label:n,children:a,labelPosition:o="center",className:i,...d},m)=>{const u=t==="horizontal",c=n??a,f=()=>{switch(r){case"subtle":return u?"h-px w-full bg-border/50":"w-px h-full min-h-[1rem] bg-border/50 self-stretch";case"primary":return u?"h-px w-full bg-primary/40":"w-px h-full min-h-[1rem] bg-primary/40 self-stretch";case"dashed":return u?"h-0 w-full border-t border-dashed border-border":"w-0 h-full min-h-[1rem] border-s border-dashed border-border self-stretch";case"dotted":return u?"h-0 w-full border-t border-dotted border-border":"w-0 h-full min-h-[1rem] border-s border-dotted border-border self-stretch";case"default":default:return u?"h-px w-full bg-border":"w-px h-full min-h-[1rem] bg-border self-stretch"}};if(u&&c){const b=f();return e.jsxs("div",{ref:m,role:s?"none":"separator","aria-orientation":"horizontal",className:l("flex w-full items-center select-none text-xs font-medium text-text-muted",i),...d,children:[e.jsx("div",{className:l(o==="start"?"w-6 shrink-0":"flex-1",b)}),e.jsx("span",{className:"px-3 shrink-0 flex items-center gap-1.5",children:c}),e.jsx("div",{className:l(o==="end"?"w-6 shrink-0":"flex-1",b)})]})}return e.jsx(Pt.Separator,{ref:m,orientation:t,role:s?"none":"separator",className:l("shrink-0",f(),i),...d})});wr.displayName="GymatraSeparator";const ue=p.createContext(null);function Nr(){const t=p.useContext(ue);if(!t)throw new Error("useGymatraStepper must be used within a GymatraStepper");return t}function kr({className:t}){return e.jsx("svg",{className:l("size-3.5",t),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})})}function ca({className:t}){return e.jsxs("svg",{className:l("size-3.5",t),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),e.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})}function da({steps:t,currentStep:r,activeStep:s,orientation:n="horizontal",variant:a="numbered",layout:o="inline",size:i="md",clickable:d=!1,allowStepAdvance:m=!1,onStepClick:u,className:c,children:f,...b}){const h=r??s??0,x=t?t.length:p.Children.count(f),g={currentStep:h,orientation:n,variant:a,size:i,layout:o,clickable:d,allowStepAdvance:m,onStepClick:u,totalSteps:x};return n==="vertical"?e.jsx(ue.Provider,{value:g,children:e.jsx("div",{role:"navigation","aria-label":"Progress Stepper",className:l("w-full flex flex-col",c),...b,children:t?t.map((y,v)=>{const k=v===t.length-1,j=y.status??(v<h?"complete":v===h?"current":"upcoming");return e.jsx(Gr,{stepIndex:v,status:j,title:y.title,description:y.description,icon:y.icon,completedIcon:y.completedIcon,errorIcon:y.errorIcon,optional:y.optional,disabled:y.disabled,badge:y.badge,isLast:k},y.id??v)}):f})}):t&&a==="pills"&&n==="horizontal"?e.jsx(ue.Provider,{value:g,children:e.jsx("nav",{role:"navigation","aria-label":"Progress Stepper",className:l("w-full text-text",c),...b,children:e.jsx("ol",{className:"flex flex-wrap items-center gap-2 sm:gap-2.5 w-full",children:t.map((y,v)=>{const k=v===t.length-1,j=y.status??(v<h?"complete":v===h?"current":"upcoming"),N=j==="complete",z=j==="current",T=j==="error",C=d&&!y.disabled&&(m||N||z),S=()=>{C&&u&&u(v,y)};return e.jsxs("li",{className:"inline-flex items-center gap-2",children:[e.jsxs("button",{type:"button",disabled:!C||y.disabled,onClick:S,"aria-current":z?"step":void 0,className:l("inline-flex items-center gap-2 px-3 py-1.5 rounded-full text-xs transition-all outline-none",z?"bg-primary text-white font-medium ring-2 ring-primary/25":N?"bg-primary-soft text-primary font-medium hover:bg-primary-soft/80":T?"bg-danger-soft text-danger border border-danger/30 font-medium":"bg-surface-muted text-text-muted font-normal hover:text-text",C&&"cursor-pointer focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2",!C&&"cursor-default",y.disabled&&"opacity-50 pointer-events-none"),children:[e.jsx("span",{className:l("flex size-4 items-center justify-center rounded-full text-xs font-medium shrink-0",z?"bg-white/20 text-white":N?"bg-primary text-white":T?"bg-danger text-white":"bg-border text-text-muted"),children:N?e.jsx(kr,{className:"size-2.5"}):v+1}),e.jsx("span",{className:"truncate",children:y.title})]}),!k&&e.jsx("span",{className:"text-text-subtle text-xs select-none","aria-hidden":"true",children:"/"})]},y.id??v)})})})}):t&&n==="horizontal"&&o==="centered"?e.jsx(ue.Provider,{value:g,children:e.jsx("nav",{role:"navigation","aria-label":"Progress Stepper",className:l("w-full text-text",c),...b,children:e.jsx("ol",{className:"flex items-start justify-between w-full",children:t.map((y,v)=>{const k=v===0,j=v===t.length-1,N=y.status??(v<h?"complete":v===h?"current":"upcoming"),z=N==="complete",T=N==="current",C=d&&!y.disabled&&(m||z||T),S=()=>{C&&u&&u(v,y)},w=P=>{C&&(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),S())};return e.jsxs("li",{className:"relative flex-1 flex flex-col items-center text-center group",children:[!k&&e.jsx("div",{"aria-hidden":"true",className:"absolute top-4 -translate-y-1/2 left-0 right-1/2 h-0.5 bg-border -z-0",children:e.jsx("div",{className:l("h-full transition-all duration-300",v<=h?"bg-primary":"bg-transparent")})}),!j&&e.jsx("div",{"aria-hidden":"true",className:"absolute top-4 -translate-y-1/2 left-1/2 right-0 h-0.5 bg-border -z-0",children:e.jsx("div",{className:l("h-full transition-all duration-300",v<h?"bg-primary":"bg-transparent")})}),e.jsxs("div",{role:C?"button":void 0,tabIndex:C?0:void 0,onClick:C?S:void 0,onKeyDown:C?w:void 0,"aria-current":T?"step":void 0,className:l("relative z-10 flex flex-col items-center outline-none group rounded-lg p-1 transition-colors",C&&"cursor-pointer hover:bg-surface-muted/40 focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2",y.disabled&&"opacity-50 pointer-events-none"),children:[e.jsx("div",{className:"bg-white rounded-full p-0.5 ring-4 ring-white",children:e.jsx(Ne,{stepIndex:v,status:N,icon:y.icon,completedIcon:y.completedIcon,errorIcon:y.errorIcon,variant:a,size:i})}),e.jsxs("div",{className:"mt-2 flex flex-col items-center max-w-[140px]",children:[e.jsx("span",{className:l("text-xs leading-tight transition-colors",T?"text-primary font-medium":z?"text-text font-medium":N==="error"?"text-danger font-medium":"text-text-muted"),children:y.title}),y.description&&e.jsx("span",{className:"text-xs text-text-muted mt-0.5 hidden sm:block truncate w-full",children:y.description}),y.badge&&e.jsx("span",{className:"mt-1",children:y.badge})]})]})]},y.id??v)})})})}):t&&n==="horizontal"?e.jsx(ue.Provider,{value:g,children:e.jsx("nav",{role:"navigation","aria-label":"Progress Stepper",className:l("w-full text-text",c),...b,children:e.jsx("ol",{className:"flex items-center w-full",children:t.map((y,v)=>{const k=v===t.length-1,j=y.status??(v<h?"complete":v===h?"current":"upcoming"),N=j==="complete",z=j==="current",T=j==="error",C=d&&!y.disabled&&(m||N||z),S=()=>{C&&u&&u(v,y)},w=P=>{C&&(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),S())};return e.jsxs("li",{className:l("flex items-center min-w-0",k?"flex-none":"flex-1"),children:[e.jsxs("div",{role:C?"button":void 0,tabIndex:C?0:void 0,onClick:C?S:void 0,onKeyDown:C?w:void 0,"aria-current":z?"step":void 0,className:l("flex items-center gap-2.5 sm:gap-3 shrink-0 rounded-lg outline-none transition-colors p-1 -m-1",C&&"cursor-pointer hover:bg-surface-muted/50 focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2",y.disabled&&"opacity-50 pointer-events-none"),children:[e.jsx(Ne,{stepIndex:v,status:j,icon:y.icon,completedIcon:y.completedIcon,errorIcon:y.errorIcon,variant:a,size:i}),e.jsxs("div",{className:"flex flex-col text-start min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.jsx("span",{className:l("leading-tight truncate transition-colors",i==="sm"?"text-xs":i==="lg"?"text-base":"text-sm",z?"text-primary font-medium":N?"text-text font-medium":T?"text-danger font-medium":"text-text-muted font-normal"),children:y.title}),y.optional&&e.jsx("span",{className:"text-xs text-text-muted font-normal",children:"(Facultatif)"}),y.badge&&e.jsx("span",{children:y.badge})]}),y.description&&e.jsx("span",{className:"text-text-muted leading-tight mt-0.5 truncate hidden md:inline-block text-xs",children:y.description})]})]}),!k&&e.jsx("div",{"aria-hidden":"true",className:"flex-1 mx-2 sm:mx-4 h-0.5 min-w-3 sm:min-w-6 bg-border relative overflow-hidden rounded-full shrink",children:e.jsx("div",{className:l("h-full w-full transition-all duration-300",v<h?"bg-primary":"bg-transparent")})})]},y.id??v)})})})}):e.jsx(ue.Provider,{value:g,children:e.jsx("div",{role:"navigation","aria-label":"Progress Stepper",className:l("w-full text-text",n==="horizontal"?"flex flex-row items-start justify-between":"flex flex-col space-y-0",c),...b,children:f})})}function Gr({stepIndex:t=0,status:r,title:s,description:n,icon:a,completedIcon:o,errorIcon:i,optional:d,disabled:m,badge:u,isLast:c=!1,className:f,children:b,...h}){const{currentStep:x,orientation:g,variant:y,size:v,clickable:k,allowStepAdvance:j,onStepClick:N}=Nr(),z=r??(t<x?"complete":t===x?"current":"upcoming"),T=z==="complete",C=z==="current",S=z==="error",w=k&&!m&&(j||T||C),P=()=>{w&&N&&N(t)},E=R=>{w&&(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),P())};return g==="vertical"?e.jsxs("div",{className:l("relative flex items-stretch gap-3.5 group",m&&"opacity-50 pointer-events-none",f),...h,children:[e.jsxs("div",{className:"flex flex-col items-center shrink-0",children:[e.jsx("div",{role:w?"button":void 0,tabIndex:w?0:void 0,onClick:w?P:void 0,onKeyDown:w?E:void 0,"aria-current":C?"step":void 0,className:l("rounded-full outline-none transition-transform",w&&"cursor-pointer hover:scale-105 focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2"),children:e.jsx(Ne,{stepIndex:t,status:z,icon:a,completedIcon:o,errorIcon:i,variant:y,size:v})}),!c&&e.jsx("div",{className:l("w-0.5 flex-1 my-1.5 transition-colors duration-200 min-h-7",T?"bg-primary":"bg-border"),"aria-hidden":"true"})]}),e.jsxs("div",{className:l("flex-1 min-w-0 pb-6",c&&"pb-1"),children:[e.jsxs("div",{role:w?"button":void 0,tabIndex:w?0:void 0,onClick:w?P:void 0,onKeyDown:w?E:void 0,className:l("flex flex-col outline-none rounded-md",w&&"cursor-pointer"),children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:l("leading-tight transition-colors",v==="sm"?"text-xs":v==="lg"?"text-base":"text-sm",C?"text-primary font-medium":T?"text-text font-medium":S?"text-danger font-medium":"text-text-muted font-normal"),children:s}),d&&e.jsx("span",{className:"text-xs text-text-muted font-normal",children:"(Facultatif)"}),u&&e.jsx("span",{children:u})]}),n&&e.jsx("p",{className:"text-xs text-text-muted mt-0.5 leading-relaxed",children:n})]}),b&&e.jsx("div",{className:"mt-2.5",children:b})]})]}):e.jsx("div",{className:l("group relative flex flex-col items-center flex-1 text-center sm:flex-row sm:items-start sm:text-start",m&&"opacity-50 pointer-events-none",f),...h,children:e.jsxs("div",{role:w?"button":void 0,tabIndex:w?0:void 0,onClick:w?P:void 0,onKeyDown:w?E:void 0,"aria-current":C?"step":void 0,className:l("flex items-start gap-3 rounded-lg transition-colors outline-none flex-col sm:flex-row items-center sm:items-start",w&&"cursor-pointer p-1.5 -m-1.5 rounded-md hover:bg-surface-muted/70 focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2"),children:[e.jsx(Ne,{stepIndex:t,status:z,icon:a,completedIcon:o,errorIcon:i,variant:y,size:v}),(s||n||b)&&e.jsxs("div",{className:"min-w-0 flex flex-col items-center sm:items-start",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s&&e.jsx("span",{className:l("leading-tight truncate transition-colors",v==="sm"?"text-xs":v==="lg"?"text-base":"text-sm",C?"text-primary font-medium":T?"text-text font-medium":S?"text-danger font-medium":"text-text-muted font-normal"),children:s}),d&&e.jsx("span",{className:"text-xs text-text-muted font-normal",children:"(Facultatif)"}),u&&e.jsx("span",{children:u})]}),n&&e.jsx("p",{className:"text-text-muted leading-relaxed mt-0.5 text-xs",children:n}),b]})]})})}function Ne({stepIndex:t,status:r,icon:s,completedIcon:n,errorIcon:a,variant:o="numbered",size:i="md"}){const d=r==="complete",m=r==="current",u=r==="error";if(o==="dots"){const f=i==="sm"?"size-2.5":i==="lg"?"size-4":"size-3";return e.jsx("span",{"aria-hidden":"true",className:l("rounded-full shrink-0 transition-all duration-200 mt-1.5",f,d?"bg-primary":m?"bg-primary ring-4 ring-primary/25 scale-125":u?"bg-danger ring-2 ring-danger/20":"bg-border")})}const c=i==="sm"?"size-6 text-xs":i==="lg"?"size-10 text-sm":"size-8 text-xs font-medium";return e.jsx("span",{className:l("relative flex shrink-0 items-center justify-center rounded-full transition-all duration-200 select-none",c,d?"bg-primary text-white border border-primary shadow-none":m?"bg-primary text-white border border-primary ring-4 ring-primary/20 font-medium":u?"bg-danger-soft text-danger border-2 border-danger font-medium":"bg-surface-muted text-text-muted border border-border"),"aria-hidden":"true",children:d?n??e.jsx(kr,{}):u?a??e.jsx(ca,{}):o==="icons"&&s?s:e.jsx("span",{children:t+1})})}function ua({status:t="upcoming",className:r}){const s=t==="complete";return e.jsx("div",{"aria-hidden":"true",className:l("flex-1 hidden sm:flex items-center self-start mt-4 px-2",r),children:e.jsx("div",{className:l("h-0.5 w-full transition-colors duration-200",s?"bg-primary":"bg-border")})})}function xa({active:t=!0,className:r,children:s,...n}){return t?e.jsx("div",{className:l("text-xs text-text",r),...n,children:s}):null}function ma({direction:t}){return e.jsxs("svg",{"aria-hidden":"true",className:"size-3.5 shrink-0",viewBox:"0 0 16 16",fill:"currentColor",children:[e.jsx("path",{d:"M5 12V4M5 4L2.5 6.5M5 4L7.5 6.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",className:t==="asc"?"text-primary opacity-100":"opacity-35"}),e.jsx("path",{d:"M11 4V12M11 12L8.5 9.5M11 12L13.5 9.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",className:t==="desc"?"text-primary opacity-100":"opacity-35"})]})}function pa({className:t="size-3.5"}){return e.jsx("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m6 9 6 6 6-6"})})}function Cr({variant:t="cards",className:r,...s}){return e.jsx("div",{className:"w-full overflow-x-auto",children:e.jsx("table",{className:l("w-full text-left text-sm",t==="cards"?"border-separate border-spacing-y-2":"border-collapse border border-border rounded-lg bg-white overflow-hidden",r),...s})})}Cr.displayName="GymatraTable";function ut({className:t,...r}){return e.jsx("thead",{className:l("text-xs font-semibold uppercase tracking-wider text-text-muted",t),...r})}ut.displayName="GymatraTableHeader";function xt({className:t,...r}){return e.jsx("tbody",{className:l("space-y-2",t),...r})}xt.displayName="GymatraTableBody";function mt({className:t,selected:r,variant:s="cards",...n}){return e.jsx("tr",{"data-selected":r,className:l("group transition-all bg-white hover:bg-surface/60","data-[selected=true]:bg-primary-soft/30",s==="cards"?"[&>td:first-child]:rounded-s-lg [&>td:last-child]:rounded-e-lg [&>td]:border-y [&>td]:border-border [&>td:first-child]:border-s [&>td:last-child]:border-e [&>td]:shadow-none":"border-b border-border last:border-b-0",t),...n})}mt.displayName="GymatraTableRow";function je({className:t,align:r="left",density:s="normal",...n}){const a=s==="compact"?"py-1.5 px-3 text-xs":s==="relaxed"?"py-3.5 px-4 text-xs":"py-2.5 px-3.5 text-xs";return e.jsx("th",{className:l("font-semibold uppercase tracking-wider text-text-muted align-middle whitespace-nowrap",a,r==="center"&&"text-center",r==="right"&&"text-right",t),...n})}je.displayName="GymatraTableHead";function ve({className:t,align:r="left",density:s="normal",...n}){const a=s==="compact"?"py-2 px-3 text-sm":s==="relaxed"?"py-4 px-4 text-sm":"py-3 px-3.5 text-sm";return e.jsx("td",{className:l("align-middle text-text bg-inherit",a,r==="center"&&"text-center",r==="right"&&"text-right",t),...n})}ve.displayName="GymatraTableCell";function pt({children:t,direction:r,onSort:s,align:n="left",density:a="normal",className:o,...i}){const d=!!r,m=a==="compact"?"py-1.5 px-3 text-xs":a==="relaxed"?"py-3.5 px-4 text-xs":"py-2.5 px-3.5 text-xs";return e.jsx("th",{className:l("font-semibold uppercase tracking-wider align-middle whitespace-nowrap",m,n==="center"&&"text-center",n==="right"&&"text-right",o),...i,children:e.jsxs("button",{type:"button",onClick:s,className:l("inline-flex items-center gap-1.5 cursor-pointer transition-colors outline-none","focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary",d?"text-primary font-semibold":"text-text-muted hover:text-text"),children:[e.jsx("span",{children:t}),e.jsx(ma,{direction:r})]})})}pt.displayName="GymatraTableSortHead";function Be({checked:t=!1,onChange:r,indeterminate:s=!1,"aria-label":n}){return e.jsxs("button",{type:"button",role:"checkbox","aria-checked":s?"mixed":t,"aria-label":n,onClick:()=>r==null?void 0:r(!t),className:l("size-5 shrink-0 rounded-md flex items-center justify-center border cursor-pointer transition-colors outline-none","focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary",t||s?"border-primary bg-primary text-white":"border-border-strong bg-white hover:border-text-subtle"),children:[t&&!s&&e.jsx("svg",{"aria-hidden":"true",className:"size-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})}),s&&e.jsx("span",{className:"h-0.5 w-3 bg-white rounded-full"})]})}Be.displayName="GymatraTableCheckbox";function ft({columnsCount:t,hasCheckbox:r=!1,hasExpand:s=!1,density:n="normal",variant:a="cards"}){const o=n==="compact"?"py-2 px-3":n==="relaxed"?"py-4 px-4":"py-3 px-3.5";return e.jsxs("tr",{className:l("bg-white transition-opacity",a==="cards"?"[&>td:first-child]:rounded-s-lg [&>td:last-child]:rounded-e-lg [&>td]:border-y [&>td]:border-border [&>td:first-child]:border-s [&>td:last-child]:border-e":"border-b border-border last:border-b-0"),children:[s&&e.jsx("td",{className:l("w-8 text-center align-middle",o),children:e.jsx("div",{className:"size-4 mx-auto rounded bg-surface-muted animate-pulse"})}),r&&e.jsx("td",{className:l("w-8 align-middle",o),children:e.jsx("div",{className:"size-5 rounded-md bg-surface-muted animate-pulse"})}),Array.from({length:t}).map((i,d)=>e.jsx("td",{className:l("align-middle",o),children:d===0?e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"size-8 shrink-0 rounded-full bg-surface-muted animate-pulse"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"h-3.5 w-28 rounded bg-surface-muted animate-pulse"}),e.jsx("div",{className:"h-2.5 w-20 rounded bg-surface-muted/70 animate-pulse"})]})]}):e.jsx("div",{className:l("h-3.5 rounded bg-surface-muted animate-pulse",d===1?"w-24":d===t-1?"w-16":"w-20")})},d))]})}ft.displayName="GymatraTableSkeletonRow";function bt({rowCount:t=5,columnsCount:r,hasCheckbox:s=!1,hasExpand:n=!1,density:a="normal",variant:o="cards"}){return e.jsx(e.Fragment,{children:Array.from({length:t}).map((i,d)=>e.jsx(ft,{columnsCount:r,hasCheckbox:s,hasExpand:n,density:a,variant:o},d))})}bt.displayName="GymatraTableSkeleton";function Sr({columns:t,data:r,rowKey:s=(C,S)=>C.id??S,sort:n,defaultSort:a,onSortChange:o,selectable:i=!1,selectedIds:d,onSelectionChange:m,selectionActions:u,pagination:c,emptyTitle:f="No data found",emptyDescription:b="There are no records matching your criteria.",loading:h=!1,skeletonRowCount:x=5,density:g="normal",variant:y="cards",onRowClick:v,expandedRowRender:k,expandedRowKeys:j,onExpandedRowsChange:N,className:z,...T}){const[C,S]=p.useState(a),w=n??C,[P,E]=p.useState([]),R=d??P,[$,te]=p.useState([]),I=j??$,[V,ae]=p.useState((c==null?void 0:c.page)??1),[B,O]=p.useState((c==null?void 0:c.pageSize)??10),K=(c==null?void 0:c.page)??V,q=(c==null?void 0:c.pageSize)??B,Q=!!k;function Se(G){let M;(w==null?void 0:w.key)!==G?M={key:G,direction:"asc"}:w.direction==="asc"?M={key:G,direction:"desc"}:M=void 0,typeof n>"u"&&S(M),o==null||o(M)}const oe=p.useMemo(()=>w?[...r].sort((G,M)=>{const A=G[w.key],re=M[w.key];if(A===re)return 0;if(A==null)return 1;if(re==null)return-1;const le=String(A).localeCompare(String(re),void 0,{numeric:!0});return w.direction==="asc"?le:-le}):r,[r,w]),be=typeof(c==null?void 0:c.total)<"u",ie=be?c.total:oe.length,he=p.useMemo(()=>{if(!c||be)return oe;const G=(K-1)*q;return oe.slice(G,G+q)},[oe,c,be,K,q]),Z=he.map((G,M)=>s(G,M)),ze=Z.length>0&&Z.every(G=>R.includes(G)),ce=Z.some(G=>R.includes(G))&&!ze;function Ve(G){let M;if(G){const A=new Set([...R,...Z]);M=Array.from(A)}else M=R.filter(A=>!Z.includes(A));typeof d>"u"&&E(M),m==null||m(M)}function de(G,M){let A;M?A=[...R,G]:A=R.filter(re=>re!==G),typeof d>"u"&&E(A),m==null||m(A)}function ye(){typeof d>"u"&&E([]),m==null||m([])}function Pe(G){let M;I.includes(G)?M=I.filter(A=>A!==G):M=[...I,G],typeof j>"u"&&te(M),N==null||N(M)}const qe=R.length>0,Ie=t.length+(i?1:0)+(Q?1:0);return e.jsxs("div",{className:l("flex flex-col w-full relative",z),...T,children:[e.jsx("div",{className:l("fixed bottom-6 left-1/2 -translate-x-1/2 z-50 transition-all duration-200 ease-out","w-[calc(100%-2rem)] max-w-lg sm:w-auto",qe&&u?"translate-y-0 opacity-100 pointer-events-auto":"translate-y-4 opacity-0 pointer-events-none"),children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between sm:justify-start gap-3 rounded-lg border border-border bg-white px-4 py-2 text-sm shadow-none",children:[e.jsx("span",{className:"font-medium text-text",children:R.length===1?"1 item selected":`${R.length} items selected`}),e.jsx("span",{className:"hidden sm:inline-block h-4 w-px bg-border","aria-hidden":"true"}),e.jsx("div",{className:"flex items-center gap-1.5 ms-auto sm:ms-0",children:typeof u=="function"?u(R,ye):u}),e.jsx("span",{className:"hidden sm:inline-block h-4 w-px bg-border","aria-hidden":"true"}),e.jsx("button",{type:"button",onClick:ye,"aria-label":"Cancel selection",title:"Cancel selection",className:"flex size-6 items-center justify-center rounded-full text-text-muted hover:bg-surface hover:text-text cursor-pointer transition-colors outline-none focus-visible:outline-2 focus-visible:outline-primary",children:e.jsx("svg",{"aria-hidden":"true",className:"size-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})})]})}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:l("w-full text-left text-sm",y==="cards"?"border-separate border-spacing-y-2":"border-collapse border border-border rounded-lg bg-white overflow-hidden"),children:[e.jsx(ut,{children:e.jsxs("tr",{children:[Q&&e.jsx(je,{density:g,className:"w-8 px-2"}),i&&e.jsx(je,{density:g,className:"w-8 px-3",children:e.jsx(Be,{checked:ze,indeterminate:ce,onChange:Ve,"aria-label":"Select all rows on current page"})}),t.map(G=>G.sortable?e.jsx(pt,{direction:(w==null?void 0:w.key)===G.key?w.direction:void 0,onSort:()=>Se(G.key),align:G.align,density:g,className:G.width,children:G.header},G.key):e.jsx(je,{align:G.align,density:g,className:G.width,children:G.header},G.key))]})}),e.jsx(xt,{children:h?e.jsx(bt,{rowCount:x,columnsCount:t.length,hasCheckbox:i,hasExpand:Q,density:g,variant:y}):he.length>0?he.map((G,M)=>{const A=s(G,M),re=R.includes(A),le=I.includes(A);return e.jsxs(p.Fragment,{children:[e.jsxs(mt,{selected:re,variant:y,onClick:J=>{const Ue=J.target;Ue.closest("button")||Ue.closest("input")||Ue.closest("a")||v==null||v(G,M)},className:l(v&&"cursor-pointer hover:border-primary/40"),children:[Q&&e.jsx(ve,{density:g,className:"w-8 px-2 text-center",children:e.jsx("button",{type:"button",onClick:J=>{J.stopPropagation(),Pe(A)},"aria-expanded":le,"aria-label":le?"Collapse row":"Expand row",className:"size-6 inline-flex items-center justify-center rounded text-text-muted hover:text-text hover:bg-surface-muted transition-transform cursor-pointer outline-none focus-visible:outline-2 focus-visible:outline-primary",children:e.jsx("span",{className:l("inline-block transition-transform duration-150",le&&"rotate-180"),children:e.jsx(pa,{})})})}),i&&e.jsx(ve,{density:g,className:"w-8 px-3",children:e.jsx(Be,{checked:re,onChange:J=>de(A,J),"aria-label":`Select row ${A}`})}),t.map(J=>e.jsx(ve,{align:J.align,density:g,children:J.render?J.render(G,M):G[J.key]},J.key))]}),Q&&le&&e.jsx("tr",{className:l(y==="cards"?"bg-surface-muted/30":"bg-surface-muted/40 border-b border-border"),children:e.jsx("td",{colSpan:Ie,className:l("px-5 py-4 text-sm text-text",y==="cards"&&"rounded-lg border border-border border-dashed my-1"),children:k==null?void 0:k(G,M)})})]},A)}):e.jsx("tr",{children:e.jsxs("td",{colSpan:Ie,className:"rounded-lg border border-border bg-white px-4 py-12 text-center text-text-muted",children:[e.jsx("p",{className:"font-semibold text-text",children:f}),e.jsx("p",{className:"mt-1 text-sm text-text-muted",children:b})]})})})]})}),c&&!h&&e.jsx(ot,{page:K,pageSize:q,total:ie,onPageChange:G=>{var M;typeof c.page>"u"&&ae(G),(M=c.onPageChange)==null||M.call(c,G)},pageSizeOptions:c.pageSizeOptions,onPageSizeChange:G=>{var M;typeof c.pageSize>"u"&&O(G),(M=c.onPageSizeChange)==null||M.call(c,G)},showSummary:c.showSummary})]})}Sr.displayName="GymatraDataTable";const fa=ee.Tabs.Root,ba=ee.Tabs.List,ha=ee.Tabs.Tab,ya=ee.Tabs.Panel,ga=ee.Tabs.Indicator,ja={sm:"h-8 px-2.5 text-sm gap-1.5",md:"h-9 px-3.5 text-sm gap-2",lg:"h-11 px-4 text-base gap-2.5"};function va(t,r,s,n="horizontal"){const a="inline-flex items-center justify-center font-medium transition-colors select-none outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary disabled:pointer-events-none disabled:opacity-50 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 cursor-pointer",o=ja[r],i=s?"flex-1":"";switch(t){case"line":return n==="vertical"?l(a,o,i,"justify-start border-r-2 -mr-px border-transparent text-text-muted hover:text-text hover:border-border","data-[active]:border-primary aria-selected:border-primary data-[active]:text-primary aria-selected:text-primary"):l(a,o,i,"border-b-2 -mb-px border-transparent text-text-muted hover:text-text hover:border-border","data-[active]:border-primary aria-selected:border-primary data-[active]:text-primary aria-selected:text-primary");case"pills":return l(a,o,i,"rounded-md border border-transparent text-text-muted hover:text-text hover:bg-surface-muted/60","data-[active]:bg-white aria-selected:bg-white data-[active]:text-primary aria-selected:text-primary data-[active]:border-border aria-selected:border-border");case"enclosed":return l(a,o,i,"rounded-t-md border-t border-x -mb-px border-transparent text-text-muted hover:text-text hover:bg-surface-muted/40","data-[active]:border-border aria-selected:border-border data-[active]:bg-white aria-selected:bg-white data-[active]:text-primary aria-selected:text-primary data-[active]:border-b-transparent aria-selected:border-b-transparent");case"soft":default:return l(a,o,i,"rounded-md text-text-muted hover:bg-surface-muted hover:text-text","data-[active]:bg-primary-soft aria-selected:bg-primary-soft data-[active]:text-primary aria-selected:text-primary")}}function wa(t,r="horizontal",s){if(r==="vertical")return t==="line"?"flex flex-col border-r border-border gap-1":t==="pills"?"flex flex-col rounded-lg border border-border bg-surface-muted/60 p-1 gap-1":"flex flex-col gap-1";const n=s?"w-full":"";switch(t){case"line":return l("flex items-center border-b border-border gap-2 sm:gap-6",n);case"pills":return l("inline-flex items-center rounded-lg border border-border bg-surface-muted/60 p-1 gap-1",n);case"enclosed":return l("flex items-center border-b border-border gap-1",n);case"soft":default:return l("flex items-center gap-1.5",n)}}function Na({value:t,defaultValue:r,onValueChange:s,variant:n="line",size:a="md",orientation:o="horizontal",fullWidth:i=!1,items:d,children:m,className:u,listClassName:c,panelClassName:f}){const b=r??(d&&d.length>0?d[0].value:void 0),h=t!==void 0?{value:t}:b!==void 0?{defaultValue:b}:{};return e.jsx(ee.Tabs.Root,{...h,onValueChange:x=>{typeof x=="string"&&(s==null||s(x))},orientation:o,className:l(o==="vertical"?"flex gap-6 items-start":"flex flex-col",u),children:d&&d.length>0?e.jsxs(e.Fragment,{children:[e.jsx(ee.Tabs.List,{className:l(wa(n,o,i),c),children:d.map(x=>{const g=x.startIcon??x.icon;return e.jsxs(ee.Tabs.Tab,{value:x.value,disabled:x.disabled,className:l(va(n,a,i,o)),children:[g&&e.jsx("span",{className:"shrink-0 size-4 flex items-center justify-center",children:g}),e.jsx("span",{children:x.label}),x.badge!==void 0&&e.jsx(Ze,{variant:x.badgeVariant??"default",size:"sm",pill:!0,className:"ml-1 text-xs px-1.5 py-0 h-4 min-w-4",children:x.badge}),x.endIcon&&e.jsx("span",{className:"shrink-0 size-4 flex items-center justify-center",children:x.endIcon})]},x.value)})}),d.map(x=>x.content?e.jsx(ee.Tabs.Panel,{value:x.value,className:l("pt-4 focus-visible:outline-none",f),children:x.content},x.value):null)]}):m})}const ka=It.Toggle,Ga=Mt.ToggleGroup;function zr(t="default"){switch(t){case"outline":return l("border border-border bg-white text-text","hover:bg-surface-muted hover:border-text-subtle","data-[pressed]:border-primary data-[pressed]:bg-primary-soft data-[pressed]:text-primary data-[pressed]:font-medium");case"solid":return l("bg-surface-muted text-text","hover:bg-surface-muted/80","data-[pressed]:bg-primary data-[pressed]:text-white data-[pressed]:font-medium");case"ghost":return l("bg-transparent text-text-muted","hover:bg-surface-muted hover:text-text","data-[pressed]:bg-surface-muted data-[pressed]:text-primary data-[pressed]:font-medium");case"default":default:return l("bg-surface-muted text-text","hover:bg-surface-muted/80 hover:text-text","data-[pressed]:bg-primary-soft data-[pressed]:text-primary data-[pressed]:font-medium")}}function Pr(t="md"){switch(t){case"sm":return"h-8 px-2.5 text-sm gap-1.5 rounded-md";case"lg":return"h-11 px-4 text-base gap-2.5 rounded-md";case"md":default:return"h-9.5 px-3 text-sm gap-2 rounded-md"}}const ht=p.forwardRef(({variant:t="default",size:r="md",startIcon:s,endIcon:n,className:a,children:o,...i},d)=>e.jsxs(It.Toggle,{ref:d,className:l("inline-flex items-center justify-center select-none outline-none transition-colors shadow-none font-medium","focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary","data-[disabled]:opacity-50 data-[disabled]:pointer-events-none",Pr(r),zr(t),a),...i,children:[s&&e.jsx("span",{className:"shrink-0 size-4 flex items-center justify-center",children:s}),o&&e.jsx("span",{children:o}),n&&e.jsx("span",{className:"shrink-0 size-4 flex items-center justify-center",children:n})]}));ht.displayName="GymatraToggle";const Ca=p.forwardRef(({options:t,value:r,defaultValue:s,onValueChange:n,size:a="md",variant:o="default",bordered:i=!0,multiple:d=!1,orientation:m="horizontal",className:u,children:c,...f},b)=>{const h=r!==void 0?Array.isArray(r)?r:[r]:void 0,x=s!==void 0?Array.isArray(s)?s:[s]:void 0,g=v=>{n&&n(d?v:v[0]??"")},y=m==="vertical";return e.jsx(Mt.ToggleGroup,{ref:b,value:h,defaultValue:x,onValueChange:g,multiple:d,orientation:m,className:l("inline-flex select-none",y?"flex-col items-stretch gap-1":"flex-row items-center gap-1",i?"rounded-md border border-border bg-white p-1 shadow-none":"bg-transparent p-0.5",u),...f,children:t&&t.length>0?t.map(v=>e.jsx(ht,{value:v.value,size:a,variant:o,disabled:v.disabled,"aria-label":v.ariaLabel||(typeof v.label=="string"?v.label:void 0),startIcon:v.startIcon??v.icon,endIcon:v.endIcon,children:v.label},v.value)):c})}),Sa=se.Tooltip.Provider,za={dark:"bg-text text-white",light:"border border-border bg-white text-text"},Pa={dark:"bg-text",light:l("border-border bg-white","data-[side=top]:border-b data-[side=top]:border-r","data-[side=bottom]:border-t data-[side=bottom]:border-l","data-[side=left]:border-t data-[side=left]:border-r","data-[side=right]:border-b data-[side=right]:border-l")},Ia={dark:"bg-white/15 text-white",light:"bg-surface-muted text-text-muted"};function Ir({content:t,shortcut:r,children:s,side:n="top",align:a="center",sideOffset:o=8,delay:i=300,closeDelay:d=0,showArrow:m=!0,disabled:u=!1,open:c,defaultOpen:f,onOpenChange:b,className:h,variant:x="dark"}){return e.jsx(se.Tooltip.Provider,{delay:i,closeDelay:d,children:e.jsxs(se.Tooltip.Root,{open:c,defaultOpen:f,onOpenChange:b,disabled:u,children:[e.jsx(se.Tooltip.Trigger,{render:s}),e.jsx(se.Tooltip.Portal,{children:e.jsx(se.Tooltip.Positioner,{side:n,align:a,sideOffset:o,className:"z-[10030] outline-none",children:e.jsxs(se.Tooltip.Popup,{className:l("relative flex max-w-xs items-center gap-2 rounded-md px-2.5 py-1.5 text-xs font-medium leading-snug outline-none","origin-[var(--transform-origin)] transition-[opacity,scale] duration-150 motion-reduce:transition-none","data-[starting-style]:scale-95 data-[starting-style]:opacity-0 data-[ending-style]:scale-95 data-[ending-style]:opacity-0",za[x],h),children:[m&&e.jsx(se.Tooltip.Arrow,{className:l("size-2 rotate-45","data-[side=top]:-bottom-1 data-[side=bottom]:-top-1 data-[side=left]:-right-1 data-[side=right]:-left-1",Pa[x])}),e.jsx("span",{className:"min-w-0",children:t}),r&&e.jsx("kbd",{className:l("shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-xs font-normal",Ia[x]),children:r})]})})})]})})}Ir.displayName="GymatraTooltip";Object.defineProperty(exports,"BaseUICheckbox",{enumerable:!0,get:()=>He.Checkbox});Object.defineProperty(exports,"BaseUIField",{enumerable:!0,get:()=>U.Field});Object.defineProperty(exports,"BaseUIForm",{enumerable:!0,get:()=>Ct.Form});Object.defineProperty(exports,"BaseUIInput",{enumerable:!0,get:()=>St.Input});Object.defineProperty(exports,"BaseUISelect",{enumerable:!0,get:()=>_.Select});Object.defineProperty(exports,"BaseUISwitch",{enumerable:!0,get:()=>we.Switch});Object.defineProperty(exports,"formatPhoneNumber",{enumerable:!0,get:()=>ne.formatPhoneNumber});Object.defineProperty(exports,"formatPhoneNumberIntl",{enumerable:!0,get:()=>ne.formatPhoneNumberIntl});Object.defineProperty(exports,"isValidPhoneNumber",{enumerable:!0,get:()=>ne.isValidPhoneNumber});exports.DRAWER_MIN_WIDTH=Ss;exports.DRAWER_SIZES=Qe;exports.GymatraAccordion=Br;exports.GymatraAccordionHeader=Fr;exports.GymatraAccordionItemPrimitive=Dr;exports.GymatraAccordionPanel=Wr;exports.GymatraAccordionRoot=Ar;exports.GymatraAccordionTrigger=Er;exports.GymatraAlert=Tt;exports.GymatraAutocomplete=_s;exports.GymatraAvatar=ke;exports.GymatraAvatarGroup=Rt;exports.GymatraAvatarUpload=mn;exports.GymatraAvatarUploadField=an;exports.GymatraBadge=Ze;exports.GymatraBreadcrumb=Bt;exports.GymatraBreadcrumbEllipsis=Ot;exports.GymatraBreadcrumbItem=Dt;exports.GymatraBreadcrumbLink=Ft;exports.GymatraBreadcrumbList=At;exports.GymatraBreadcrumbPage=Et;exports.GymatraBreadcrumbSeparator=Wt;exports.GymatraButton=Le;exports.GymatraCheckbox=Je;exports.GymatraCheckboxField=Ys;exports.GymatraCircularProgress=ia;exports.GymatraColorPicker=ln;exports.GymatraColorPickerField=dr;exports.GymatraCombobox=bs;exports.GymatraComboboxChip=xs;exports.GymatraComboboxChipRemove=ms;exports.GymatraComboboxChips=us;exports.GymatraComboboxClear=ds;exports.GymatraComboboxEmpty=Xe;exports.GymatraComboboxGroup=ls;exports.GymatraComboboxGroupLabel=et;exports.GymatraComboboxInput=$t;exports.GymatraComboboxItem=Re;exports.GymatraComboboxList=is;exports.GymatraComboboxPopup=Ye;exports.GymatraComboboxPortal=as;exports.GymatraComboboxPositioner=os;exports.GymatraComboboxRoot=ss;exports.GymatraComboboxSeparator=cs;exports.GymatraComboboxTrigger=ns;exports.GymatraCurrencyInput=sr;exports.GymatraCustomSelect=Us;exports.GymatraDataTable=Sr;exports.GymatraDateInput=ar;exports.GymatraDateRangeInput=qs;exports.GymatraDateTimeInput=ir;exports.GymatraDialog=me;exports.GymatraDialogBackdrop=vs;exports.GymatraDialogClose=Cs;exports.GymatraDialogComponent=qt;exports.GymatraDialogContent=Ns;exports.GymatraDialogDescription=Gs;exports.GymatraDialogPopup=ws;exports.GymatraDialogPortal=js;exports.GymatraDialogRoot=ys;exports.GymatraDialogTitle=ks;exports.GymatraDialogTrigger=gs;exports.GymatraDrawerPanel=Ls;exports.GymatraDrawerProvider=Ht;exports.GymatraEmailInput=Yt;exports.GymatraEmptyState=_t;exports.GymatraField=fn;exports.GymatraFieldContainer=D;exports.GymatraFileUploadField=sn;exports.GymatraFilterBar=Jt;exports.GymatraFilterBarChip=Zt;exports.GymatraFilterBarSearch=Qt;exports.GymatraFilterBarSelect=$s;exports.GymatraFilterSelect=rt;exports.GymatraFloatingField=Ce;exports.GymatraFloatingSelect=mr;exports.GymatraFloatingTextarea=xr;exports.GymatraForm=pn;exports.GymatraImageUploadField=nn;exports.GymatraInput=yr;exports.GymatraMenu=Cn;exports.GymatraMenuCheckboxItem=Ee;exports.GymatraMenuGroup=gr;exports.GymatraMenuGroupLabel=Fe;exports.GymatraMenuItem=Ae;exports.GymatraMenuPopup=fe;exports.GymatraMenuPortal=jn;exports.GymatraMenuPositioner=vn;exports.GymatraMenuRadioGroup=wn;exports.GymatraMenuRadioItem=We;exports.GymatraMenuRoot=yn;exports.GymatraMenuSeparator=De;exports.GymatraMenuSubmenuRoot=Nn;exports.GymatraMenuSubmenuTrigger=Oe;exports.GymatraMenuTrigger=gn;exports.GymatraMenubar=jr;exports.GymatraMenubarCheckboxItem=Fn;exports.GymatraMenubarGroup=Mn;exports.GymatraMenubarGroupLabel=Dn;exports.GymatraMenubarItem=Bn;exports.GymatraMenubarMenu=zn;exports.GymatraMenubarPopup=Rn;exports.GymatraMenubarPortal=Pn;exports.GymatraMenubarPositioner=In;exports.GymatraMenubarRadioGroup=Tn;exports.GymatraMenubarRadioItem=En;exports.GymatraMenubarRoot=Sn;exports.GymatraMenubarSeparator=An;exports.GymatraMenubarSubmenuRoot=Ln;exports.GymatraMenubarSubmenuTrigger=Wn;exports.GymatraMenubarTrigger=at;exports.GymatraMultiSelect=Hs;exports.GymatraNumberInput=Ge;exports.GymatraNumericField=Vs;exports.GymatraOtpField=un;exports.GymatraOtpInput=xn;exports.GymatraPagination=ot;exports.GymatraPasswordInput=Xt;exports.GymatraPercentageInput=nr;exports.GymatraPhoneInput=tr;exports.GymatraPopover=Zn;exports.GymatraPopoverArrow=vr;exports.GymatraPopoverClose=dt;exports.GymatraPopoverDescription=ct;exports.GymatraPopoverPopup=it;exports.GymatraPopoverPortal=_n;exports.GymatraPopoverPositioner=Kn;exports.GymatraPopoverRoot=Un;exports.GymatraPopoverTitle=lt;exports.GymatraPopoverTrigger=Hn;exports.GymatraProgress=aa;exports.GymatraProgressIndicator=Xn;exports.GymatraProgressLabel=ea;exports.GymatraProgressRoot=Jn;exports.GymatraProgressTrack=Yn;exports.GymatraProgressValue=ta;exports.GymatraRadioGroupField=Xs;exports.GymatraRangeField=dn;exports.GymatraRichTextEditor=rn;exports.GymatraSearchInput=er;exports.GymatraSelect=hn;exports.GymatraSelectField=lr;exports.GymatraSeparator=wr;exports.GymatraSeparatorRoot=la;exports.GymatraSliderField=cn;exports.GymatraStep=Gr;exports.GymatraStepConnector=ua;exports.GymatraStepContent=xa;exports.GymatraStepIndicator=Ne;exports.GymatraStepper=da;exports.GymatraSwitch=st;exports.GymatraSwitchField=en;exports.GymatraSwitchRoot=Ks;exports.GymatraSwitchThumb=Qs;exports.GymatraTab=ha;exports.GymatraTable=Cr;exports.GymatraTableBody=xt;exports.GymatraTableCell=ve;exports.GymatraTableCheckbox=Be;exports.GymatraTableHead=je;exports.GymatraTableHeader=ut;exports.GymatraTableRow=mt;exports.GymatraTableSkeleton=bt;exports.GymatraTableSkeletonRow=ft;exports.GymatraTableSortHead=pt;exports.GymatraTabs=Na;exports.GymatraTabsIndicator=ga;exports.GymatraTabsList=ba;exports.GymatraTabsPanel=ya;exports.GymatraTabsRoot=fa;exports.GymatraTextField=ur;exports.GymatraTextInput=pe;exports.GymatraTextarea=bn;exports.GymatraTextareaField=cr;exports.GymatraTimeInput=or;exports.GymatraToggle=ht;exports.GymatraToggleField=tn;exports.GymatraToggleGroup=Ca;exports.GymatraToggleGroupRoot=Ga;exports.GymatraToggleRoot=ka;exports.GymatraTooltip=Ir;exports.GymatraTooltipProvider=Sa;exports.GymatraUrlInput=rr;exports.SidebarContext=Ms;exports.SidebarProvider=Ts;exports.cn=l;exports.getDrawerWidth=zs;exports.getToggleSizeClasses=Pr;exports.getToggleVariantClasses=zr;exports.renderMenuItems=$e;exports.useGymatraDrawer=Ut;exports.useGymatraStepper=Nr;exports.useSidebar=Is;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),X=require("@base-ui/react/accordion"),f=require("react"),pe=require("@base-ui/react/avatar"),J=require("chart.js"),rt=require("react-chartjs-2"),Je=require("@base-ui/react/checkbox"),F=require("@base-ui/react/combobox"),W=require("@base-ui/react/dialog"),V=require("@base-ui/react/field"),Dt=require("@base-ui/react/form"),Ft=require("@base-ui/react/input"),_=require("@base-ui/react/select"),ke=require("@base-ui/react/switch"),L=require("@base-ui/react/menu"),Et=require("@base-ui/react/menubar"),U=require("@base-ui/react/popover"),ee=require("@base-ui/react/progress"),Wt=require("@base-ui/react/separator"),te=require("@base-ui/react/tabs"),$t=require("@base-ui/react/toggle"),Ot=require("@base-ui/react/toggle-group"),ne=require("@base-ui/react/tooltip"),Kr=require("react-phone-number-input/input"),ae=require("react-phone-number-input"),St=require("react-phone-number-input/flags"),zt=require("react-phone-number-input/locale/fr.json");function Zr(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(r,s,n.get?n:{enumerable:!0,get:()=>t[s]})}}return r.default=t,Object.freeze(r)}const Ge=Zr(f);function c(...t){return t.filter(Boolean).join(" ")}const Qr={default:"divide-y divide-border rounded-lg border border-border bg-white",separated:"flex flex-col gap-2",flush:"divide-y divide-border"},Yr={default:"",separated:"rounded-lg border border-border bg-white",flush:""},Pt={default:"px-4",separated:"px-4",flush:"px-0"};function Jr(){return e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:"size-4 shrink-0 text-text-muted transition-transform duration-200 group-data-[panel-open]:rotate-180 motion-reduce:transition-none",children:e.jsx("path",{d:"m6 9 6 6 6-6"})})}function Xr({items:t,multiple:r=!1,value:s,defaultValue:n,onValueChange:a,variant:o="default",disabled:i=!1,headingLevel:l=3,className:m}){const u=`h${l}`;return e.jsx(X.Accordion.Root,{multiple:r,value:s,defaultValue:n,onValueChange:a?d=>a(d):void 0,disabled:i,className:c("w-full",Qr[o],m),children:t.map(d=>e.jsxs(X.Accordion.Item,{value:d.value,disabled:d.disabled,className:Yr[o],children:[e.jsx(X.Accordion.Header,{render:e.jsx(u,{}),className:"m-0",children:e.jsxs(X.Accordion.Trigger,{className:c("group flex w-full cursor-pointer items-center gap-3 py-3.5 text-start outline-none transition-colors",Pt[o],o!=="flush"&&"hover:bg-surface-muted/50",o==="separated"&&"rounded-lg data-[panel-open]:rounded-b-none","focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary","data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 data-[disabled]:hover:bg-transparent"),children:[d.icon&&e.jsx("span",{"aria-hidden":"true",className:"flex shrink-0 text-text-muted group-data-[panel-open]:text-primary [&>svg]:size-4",children:d.icon}),e.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[e.jsx("span",{className:"text-sm font-medium text-text",children:d.title}),d.description&&e.jsx("span",{className:"text-xs font-normal text-text-muted",children:d.description})]}),d.meta&&e.jsx("span",{className:"shrink-0",children:d.meta}),e.jsx(Jr,{})]})}),e.jsx(X.Accordion.Panel,{className:c("h-[var(--accordion-panel-height)] overflow-hidden transition-[height] duration-200 ease-out motion-reduce:transition-none","data-[starting-style]:h-0 data-[ending-style]:h-0"),children:e.jsx("div",{className:c("pb-4 text-sm leading-6 text-text-muted",Pt[o],!!d.icon&&(o==="flush"?"ps-7":"ps-11")),children:d.content})})]},d.value))})}const es=X.Accordion.Root,ts=X.Accordion.Item,rs=X.Accordion.Header,ss=X.Accordion.Trigger,ns=X.Accordion.Panel,ve=t=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t}),as={info:ve(e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"12",cy:"12",r:"9"}),e.jsx("path",{d:"M12 11v5M12 8h.01"})]})),neutral:ve(e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"12",cy:"12",r:"9"}),e.jsx("path",{d:"M12 11v5M12 8h.01"})]})),success:ve(e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"12",cy:"12",r:"9"}),e.jsx("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]})),warning:ve(e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M10.3 4.3 2.6 18a2 2 0 0 0 1.7 3h15.4a2 2 0 0 0 1.7-3L13.7 4.3a2 2 0 0 0-3.4 0Z"}),e.jsx("path",{d:"M12 9.5v4M12 17h.01"})]})),danger:ve(e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"12",cy:"12",r:"9"}),e.jsx("path",{d:"M12 7.5v5M12 16h.01"})]}))},os={info:"text-info",success:"text-success",warning:"text-warning",danger:"text-danger",neutral:"text-text-muted"},is={soft:{info:"bg-info-soft",success:"bg-success-soft",warning:"bg-warning-soft",danger:"bg-danger-soft",neutral:"bg-surface-muted"},outline:{info:"border border-border bg-white",success:"border border-border bg-white",warning:"border border-border bg-white",danger:"border border-border bg-white",neutral:"border border-border bg-white"}},Ht=f.forwardRef(({tone:t="info",variant:r="soft",title:s,description:n,icon:a,action:o,onClose:i,closeLabel:l="Fermer",className:m,children:u,role:d,...h},b)=>{const p=a===void 0?as[t]:a,x=n??u;return e.jsxs("div",{ref:b,role:d??(t==="danger"||t==="warning"?"alert":"status"),className:c("flex w-full items-start gap-3 rounded-lg px-4 py-3",is[r][t],m),...h,children:[p!==null&&e.jsx("span",{"aria-hidden":"true",className:c("mt-0.5 flex size-5 shrink-0 [&>svg]:size-5",os[t]),children:p}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-0.5",children:[s&&e.jsx("p",{className:"text-sm font-semibold text-text",children:s}),x&&e.jsx("div",{className:"text-sm leading-6 text-text-muted",children:x})]}),o&&e.jsx("div",{className:"flex shrink-0 items-center gap-2 self-center",children:o}),i&&e.jsx("button",{type:"button",onClick:i,"aria-label":l,className:"-me-1 flex size-7 shrink-0 cursor-pointer items-center justify-center self-start rounded-md text-text-muted transition-colors hover:bg-white hover:text-text motion-reduce:transition-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",className:"size-4","aria-hidden":"true",children:e.jsx("path",{d:"M6 6l12 12M18 6 6 18"})})})]})});Ht.displayName="GymatraAlert";const qt=f.createContext(null),Xe={xs:{root:"size-6 text-xs",status:"size-1.5 ring-1"},sm:{root:"size-8 text-xs",status:"size-2 ring-1.5"},md:{root:"size-10 text-sm",status:"size-2.5 ring-2"},lg:{root:"size-12 text-base",status:"size-3 ring-2"},xl:{root:"size-16 text-lg",status:"size-3.5 ring-2"},"2xl":{root:"size-20 text-2xl",status:"size-4 ring-2"}},et={circle:"rounded-full",square:"rounded-lg"},Mt={primary:"bg-primary-soft text-primary",secondary:"bg-surface-muted text-text",success:"bg-success-soft text-success",warning:"bg-warning-soft text-warning",danger:"bg-danger-soft text-danger",info:"bg-info-soft text-info",neutral:"bg-surface-muted text-text-muted"},ls={online:"bg-success",busy:"bg-danger",away:"bg-warning",offline:"bg-text-subtle"};function cs(t){if(!t)return"";const r=t.trim().split(/\s+/).filter(Boolean);return r.length===0?"":r.length===1?r[0].slice(0,2).toUpperCase():(r[0][0]+r[r.length-1][0]).toUpperCase()}function ds({className:t}){return e.jsxs("svg",{className:c("size-1/2 opacity-65",t),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"}),e.jsx("circle",{cx:"12",cy:"7",r:"4"})]})}function ze({src:t,alt:r="Avatar",name:s,fallback:n,size:a,shape:o,variant:i="primary",status:l,statusPosition:m="bottom-right",bordered:u=!1,delayMs:d=0,className:h,children:b,...p}){const x=f.useContext(qt),y=a??(x==null?void 0:x.size)??"md",g=o??(x==null?void 0:x.shape)??"circle",j=Xe[y]??Xe.md,k=et[g]??et.circle,v=Mt[i]??Mt.primary,w=s?cs(s):void 0,C=n??w??e.jsx(ds,{});return e.jsxs("span",{className:c("relative inline-flex shrink-0 select-none",h),...p,children:[e.jsx(pe.Avatar.Root,{className:c("flex items-center justify-center overflow-hidden font-medium transition-all",j.root,k,v,u&&"border border-border",x&&"ring-2 ring-white"),children:b||e.jsxs(e.Fragment,{children:[t&&e.jsx(pe.Avatar.Image,{src:t,alt:r||s||"Avatar",className:"size-full object-cover"}),e.jsx(pe.Avatar.Fallback,{delay:d,className:"flex size-full items-center justify-center uppercase tracking-wider",children:C})]})}),l&&e.jsx("span",{className:c("absolute rounded-full ring-white",j.status,ls[l],m==="bottom-right"&&(g==="circle"?"bottom-0 end-0 translate-x-[1px] translate-y-[1px]":"bottom-[-2px] end-[-2px]"),m==="top-right"&&(g==="circle"?"top-0 end-0 translate-x-[1px] -translate-y-[1px]":"top-[-2px] end-[-2px]")),"aria-hidden":"true"})]})}const us={xs:"-space-x-1.5",sm:"-space-x-2",md:"-space-x-2.5",lg:"-space-x-3",xl:"-space-x-4","2xl":"-space-x-5"};function Vt({children:t,max:r,size:s="md",shape:n="circle",spacing:a="tight",className:o,...i}){const l=f.Children.toArray(t).filter(f.isValidElement),m=l.length,u=r!==void 0&&r>=0&&m>r,d=u?l.slice(0,r):l,h=u?m-r:0,b=a==="tight"?us[s]:a==="normal"?"-space-x-1":"space-x-1";return e.jsx(qt.Provider,{value:{size:s,shape:n},children:e.jsxs("div",{role:"group","aria-label":`Groupe de ${m} avatars`,className:c("inline-flex items-center",b,o),...i,children:[d.map(p=>e.jsx("span",{className:"relative inline-flex hover:z-10",children:p},p.key)),h>0&&e.jsxs("span",{role:"img","aria-label":`${h} autre${h>1?"s":""}`,title:`${h} autre${h>1?"s":""}`,className:c("relative inline-flex shrink-0 select-none items-center justify-center bg-surface-muted font-medium text-text-muted ring-2 ring-white",Xe[s].root,et[n]),children:["+",h]})]})})}ze.Root=pe.Avatar.Root;ze.Image=pe.Avatar.Image;ze.Fallback=pe.Avatar.Fallback;ze.Group=Vt;const xs={default:"bg-surface-muted text-text-muted",primary:"bg-primary-soft text-primary",secondary:"bg-surface text-text",outline:"bg-transparent text-text border border-border",success:"bg-success-soft text-success",warning:"bg-warning-soft text-warning",danger:"bg-danger-soft text-danger",info:"bg-info-soft text-info"},ms={sm:"h-5 px-2 text-xs gap-1",md:"h-6 px-2.5 text-xs gap-1.5",lg:"h-7 px-3 text-xs font-medium gap-1.5"},st=f.forwardRef(({variant:t="default",size:r="md",pill:s=!0,dot:n=!1,check:a=!1,circle:o=!1,startIcon:i,endIcon:l,className:m,children:u,...d},h)=>e.jsxs("span",{ref:h,className:c("inline-flex items-center justify-center font-medium border-0 select-none transition-colors",s?"rounded-full":"rounded-md",xs[t],ms[r],m),...d,children:[o||n?e.jsx("span",{className:c("rounded-full border-2 border-current shrink-0",r==="sm"?"size-2":"size-2.5"),"aria-hidden":"true"}):a?e.jsx("svg",{className:c("shrink-0",r==="sm"?"size-3":r==="lg"?"size-3.5":"size-3"),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})}):null,i&&e.jsx("span",{className:"inline-flex shrink-0 items-center justify-center","aria-hidden":"true",children:i}),u&&e.jsx("span",{className:"truncate",children:u}),l&&e.jsx("span",{className:"inline-flex shrink-0 items-center justify-center","aria-hidden":"true",children:l})]}));st.displayName="GymatraBadge";function Ut({items:t,separator:r="/",className:s,...n}){return e.jsx("nav",{"aria-label":"Breadcrumb",className:c("inline-block",s),...n,children:e.jsx("ol",{className:"flex flex-wrap items-center gap-1.5 text-sm text-text-muted m-0 p-0 list-none",children:t.map((a,o)=>{const i=o===t.length-1;return e.jsxs("li",{className:"inline-flex items-center gap-1.5",children:[!i&&a.href?e.jsxs("a",{href:a.href,onClick:a.onClick,className:"inline-flex items-center gap-1.5 rounded px-0.5 text-sm text-text-muted transition-colors hover:text-text outline-none focus-visible:outline-2 focus-visible:outline-primary",children:[a.icon,e.jsx("span",{children:a.label})]}):e.jsxs("span",{className:c("inline-flex items-center gap-1.5 px-0.5 text-sm",i?"font-medium text-text":"text-text-muted"),"aria-current":i?"page":void 0,children:[a.icon,e.jsx("span",{children:a.label})]}),!i&&e.jsx("span",{className:"text-xs text-text-subtle select-none px-0.5","aria-hidden":"true",children:r})]},o)})})})}Ut.displayName="GymatraBreadcrumb";function _t({className:t,...r}){return e.jsx("ol",{className:c("flex flex-wrap items-center gap-1.5 text-sm text-text-muted m-0 p-0 list-none",t),...r})}_t.displayName="GymatraBreadcrumbList";function Kt({className:t,...r}){return e.jsx("li",{className:c("inline-flex items-center gap-1.5",t),...r})}Kt.displayName="GymatraBreadcrumbItem";function Zt({className:t,...r}){return e.jsx("a",{className:c("inline-flex items-center gap-1.5 rounded px-0.5 text-sm text-text-muted transition-colors hover:text-text outline-none focus-visible:outline-2 focus-visible:outline-primary",t),...r})}Zt.displayName="GymatraBreadcrumbLink";function Qt({className:t,...r}){return e.jsx("span",{"aria-current":"page",className:c("inline-flex items-center gap-1.5 px-0.5 text-sm font-medium text-text",t),...r})}Qt.displayName="GymatraBreadcrumbPage";function Yt({children:t="/",className:r,...s}){return e.jsx("span",{"aria-hidden":"true",className:c("text-xs text-text-subtle select-none px-0.5",r),...s,children:t})}Yt.displayName="GymatraBreadcrumbSeparator";function Jt({className:t,...r}){return e.jsx("span",{"aria-hidden":"true",className:c("flex size-6 items-center justify-center text-text-muted select-none text-xs font-medium",t),...r,children:"…"})}Jt.displayName="GymatraBreadcrumbEllipsis";J.Chart.register(J.CategoryScale,J.LinearScale,J.PointElement,J.LineElement,J.BarElement,J.ArcElement,J.Filler,J.Legend,J.Tooltip);const Ce=["#3563c9","#f47230","#00b894","#f2a600","#ee7fac","#008a17","#6a4ce2","#ec4647"],de={primary:"#224086",text:"#172033",textMuted:"#667085",border:"#e1e5ed",surface:"#ffffff"};function It(){if(typeof window>"u")return de;const t=getComputedStyle(document.documentElement),r=(s,n)=>t.getPropertyValue(s).trim()||n;return{primary:r("--color-primary",de.primary),text:r("--color-text",de.text),textMuted:r("--color-text-muted",de.textMuted),border:r("--color-border",de.border),surface:de.surface}}function We(){const[t,r]=Ge.useState(de);return Ge.useEffect(()=>{r(It());const s=new MutationObserver(()=>r(It()));return s.observe(document.documentElement,{attributes:!0,attributeFilter:["style","class","data-theme"]}),()=>s.disconnect()},[]),t}function Xt(t,r){const s=t.replace("#","");if(!/^[0-9a-f]{6}$/i.test(s))return t;const[n,a,o]=[0,2,4].map(i=>parseInt(s.slice(i,i+2),16));return`rgba(${n}, ${a}, ${o}, ${r})`}const er=(t,r,s)=>t[r].color??(t.length===1?s.primary:Ce[r%Ce.length]);function nt(t){return{backgroundColor:t.surface,titleColor:t.text,bodyColor:t.text,borderColor:t.border,borderWidth:1,padding:10,cornerRadius:6,boxWidth:8,boxHeight:8,boxPadding:4,usePointStyle:!0,titleFont:{size:12,weight:600},bodyFont:{size:12}}}function tr(t,r){return{display:r,position:"bottom",align:"start",labels:{color:t.textMuted,usePointStyle:!0,pointStyle:"circle",boxWidth:8,boxHeight:8,padding:16,font:{size:12}}}}function at({title:t,labels:r,series:s,formatValue:n}){const a=n??(o=>String(o));return e.jsxs("table",{className:"sr-only",children:[e.jsx("caption",{children:t}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",children:"—"}),s.map(o=>e.jsx("th",{scope:"col",children:o.label},o.label))]})}),e.jsx("tbody",{children:r.map((o,i)=>e.jsxs("tr",{children:[e.jsx("th",{scope:"row",children:o}),s.map(l=>e.jsx("td",{children:l.data[i]!=null?a(l.data[i]):"—"},l.label))]},o))})]})}function ps({labels:t,series:r,title:s,height:n=240,formatValue:a,legend:o="auto",area:i=!1,curved:l=!0,className:m}){const u=We(),d=o==="auto"?r.length>1:o,h=a??(p=>String(p)),b={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:tr(u,d),tooltip:{...nt(u),callbacks:{label:p=>` ${p.dataset.label} : ${h(Number(p.raw))}`}}},scales:{x:{grid:{display:!1},border:{color:u.border},ticks:{color:u.textMuted,font:{size:12},maxRotation:0,autoSkipPadding:16}},y:{beginAtZero:!0,grid:{color:u.border},border:{display:!1},ticks:{color:u.textMuted,font:{size:12},maxTicksLimit:5,callback:p=>h(Number(p))}}}};return e.jsxs("div",{className:c("relative w-full",m),style:{height:n},children:[e.jsx(rt.Line,{role:"img","aria-label":s,options:b,data:{labels:[...t],datasets:r.map((p,x)=>{const y=er(r,x,u);return{label:p.label,data:[...p.data],borderColor:y,backgroundColor:i?Xt(y,.08):y,fill:i,borderWidth:2,tension:l?.35:0,pointRadius:0,pointHoverRadius:5,pointHoverBackgroundColor:y,pointHoverBorderColor:u.surface,pointHoverBorderWidth:2}})}}),e.jsx(at,{title:s,labels:t,series:r,formatValue:a})]})}function fs({labels:t,series:r,title:s,height:n=240,formatValue:a,legend:o="auto",horizontal:i=!1,stacked:l=!1,className:m}){const u=We(),d=o==="auto"?r.length>1:o,h=a??(y=>String(y)),b=i?"x":"y",p=i?"y":"x",x={responsive:!0,maintainAspectRatio:!1,indexAxis:i?"y":"x",interaction:{mode:"index",intersect:!1},plugins:{legend:tr(u,d),tooltip:{...nt(u),callbacks:{label:y=>` ${y.dataset.label} : ${h(Number(y.raw))}`}}},scales:{[p]:{stacked:l,grid:{display:!1},border:{color:u.border},ticks:{color:i?u.text:u.textMuted,font:{size:12},maxRotation:0,autoSkipPadding:12}},[b]:{stacked:l,beginAtZero:!0,grid:{color:u.border},border:{display:!1},ticks:{color:u.textMuted,font:{size:12},maxTicksLimit:5,callback:y=>h(Number(y))}}}};return e.jsxs("div",{className:c("relative w-full",m),style:{height:n},children:[e.jsx(rt.Bar,{role:"img","aria-label":s,options:x,data:{labels:[...t],datasets:r.map((y,g)=>{const j=er(r,g,u),k=g===r.length-1;return{label:y.label,data:[...y.data],backgroundColor:j,hoverBackgroundColor:j,borderRadius:l&&!k?0:4,borderSkipped:"start",borderColor:u.surface,borderWidth:l?{[i?"right":"top"]:2}:0,maxBarThickness:28,categoryPercentage:.7,barPercentage:r.length>1&&!l?.72:.9}})}}),e.jsx(at,{title:s,labels:t,series:r,formatValue:a})]})}function hs({data:t,title:r,centerValue:s,centerLabel:n,size:a=180,formatValue:o,showList:i=!0,className:l}){const m=We(),u=o??(p=>String(p)),d=t.reduce((p,x)=>p+x.value,0),h=t.map((p,x)=>p.color??Ce[x%Ce.length]),b={responsive:!0,maintainAspectRatio:!1,cutout:"72%",plugins:{legend:{display:!1},tooltip:{...nt(m),callbacks:{label:p=>{const x=Number(p.raw),y=d?Math.round(x/d*100):0;return` ${p.label} : ${u(x)} (${y} %)`}}}}};return e.jsxs("div",{className:c("flex flex-wrap items-center gap-6",l),children:[e.jsxs("div",{className:"relative shrink-0",style:{width:a,height:a},children:[e.jsx(rt.Doughnut,{role:"img","aria-label":r,options:b,data:{labels:t.map(p=>p.label),datasets:[{data:t.map(p=>p.value),backgroundColor:h,hoverBackgroundColor:h,borderColor:m.surface,borderWidth:2,hoverOffset:4}]}}),e.jsxs("div",{className:"pointer-events-none absolute inset-0 flex flex-col items-center justify-center text-center",children:[e.jsx("span",{className:"text-2xl font-semibold tabular-nums text-text",children:s??u(d)}),n&&e.jsx("span",{className:"text-xs text-text-muted",children:n})]})]}),i&&e.jsx("ul",{className:"min-w-40 flex-1 space-y-2",children:t.map((p,x)=>e.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[e.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:h[x]},"aria-hidden":"true"}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-text",children:p.label}),e.jsx("span",{className:"tabular-nums text-text",children:u(p.value)}),e.jsxs("span",{className:"w-10 text-end tabular-nums text-text-muted",children:[d?Math.round(p.value/d*100):0," %"]})]},p.label))}),e.jsx(at,{title:r,labels:t.map(p=>p.label),series:[{label:r,data:t.map(p=>p.value)}],formatValue:o})]})}const rr=Ge.forwardRef(({title:t,description:r,action:s,variant:n="outline",className:a,children:o,...i},l)=>{const m=Ge.useId();return e.jsxs("section",{ref:l,"aria-labelledby":m,className:c("flex min-w-0 flex-col gap-4",n==="outline"&&"rounded-lg border border-border bg-white px-4 py-3.5",a),...i,children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{id:m,className:"truncate text-sm font-semibold text-text",children:t}),r&&e.jsx("p",{className:"truncate text-xs text-text-muted",children:r})]}),s&&e.jsx("div",{className:"flex shrink-0 items-center gap-2",children:s})]}),o]})});rr.displayName="GymatraChartCard";const Tt={primary:"bg-primary text-white hover:bg-primary-hover active:bg-primary-active focus-visible:outline-primary shadow-none border-0",secondary:"bg-surface-muted text-text hover:bg-border/60 active:bg-border focus-visible:outline-primary shadow-none border-0",outline:"bg-transparent text-text border border-border hover:bg-surface-muted hover:text-text active:bg-border/40 focus-visible:outline-primary shadow-none",soft:"bg-primary-soft text-primary hover:bg-primary-soft/70 active:bg-primary/15 focus-visible:outline-primary shadow-none border-0",ghost:"bg-transparent text-text-muted hover:text-text hover:bg-surface-muted active:bg-border/40 focus-visible:outline-primary shadow-none border-0",danger:"bg-danger text-white hover:bg-danger/90 active:bg-danger/80 focus-visible:outline-danger shadow-none border-0",success:"bg-success text-white hover:bg-success/90 active:bg-success/80 focus-visible:outline-success shadow-none border-0",warning:"bg-warning text-white hover:bg-warning/90 active:bg-warning/80 focus-visible:outline-warning shadow-none border-0",info:"bg-info text-white hover:bg-info/90 active:bg-info/80 focus-visible:outline-info shadow-none border-0","outline-primary":"bg-transparent text-primary border border-primary/40 hover:bg-primary-soft hover:border-primary active:bg-primary/15 focus-visible:outline-primary shadow-none","outline-danger":"bg-transparent text-danger border border-danger/40 hover:bg-danger-soft hover:border-danger active:bg-danger/15 focus-visible:outline-danger shadow-none","outline-warning":"bg-transparent text-warning border border-warning/40 hover:bg-warning-soft hover:border-warning active:bg-warning/15 focus-visible:outline-warning shadow-none","outline-success":"bg-transparent text-success border border-success/40 hover:bg-success-soft hover:border-success active:bg-success/15 focus-visible:outline-success shadow-none","outline-info":"bg-transparent text-info border border-info/40 hover:bg-info-soft hover:border-info active:bg-info/15 focus-visible:outline-info shadow-none"},bs={xs:"h-7 px-2.5 text-xs gap-1.5",sm:"h-8 px-3 text-sm gap-1.5",md:"h-10 px-4 text-sm gap-2",lg:"h-11 px-5 text-sm gap-2.5",xl:"h-12 px-6 text-base gap-3",icon:"size-9 p-0 justify-center text-sm gap-0"},ys={normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},gs={xs:"size-3.5",sm:"size-4",md:"size-4",lg:"size-4.5",xl:"size-5",icon:"size-4.5"};function js(t,r){if(r&&r!=="default"){if(t==="outline")return`outline-${r}`;if(t==="primary")return r}return t}const De=f.forwardRef(({variant:t="primary",color:r,size:s="md",weight:n="medium",pill:a=!1,fullWidth:o=!1,startIcon:i,endIcon:l,loading:m=!1,loadingText:u,disabled:d,children:h,className:b,type:p="button",...x},y)=>{const g=d||m,j=gs[s],k=js(t,r);return e.jsx("button",{ref:y,type:p,disabled:g,"aria-busy":m?!0:void 0,className:c("inline-flex cursor-pointer items-center justify-center transition-all duration-150 select-none",a?"rounded-full":s==="xs"?"rounded":s==="xl"?"rounded-lg":"rounded-md",o?"w-full":"",ys[n],"focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none disabled:opacity-50",Tt[k]||Tt.primary,bs[s],b),...x,children:m?e.jsxs(e.Fragment,{children:[e.jsxs("svg",{className:c("animate-spin shrink-0",j),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),u?e.jsx("span",{children:u}):h?e.jsx("span",{children:h}):null]}):e.jsxs(e.Fragment,{children:[i&&e.jsx("span",{className:c("inline-flex shrink-0 items-center justify-center",j),"aria-hidden":"true",children:i}),h&&e.jsx("span",{children:h}),l&&e.jsx("span",{className:c("inline-flex shrink-0 items-center justify-center",j),"aria-hidden":"true",children:l})]})})});De.displayName="GymatraButton";const vs={sm:{box:"size-3.5",icon:"size-2.5",offset:"mt-[3px]"},md:{box:"size-4",icon:"size-3",offset:"mt-0.5"},lg:{box:"size-5",icon:"size-3.5",offset:"mt-0"}};function ws({className:t}){return e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3.5",strokeLinecap:"round",strokeLinejoin:"round",className:t,"aria-hidden":"true",children:e.jsx("path",{d:"M20 6 9 17l-5-5"})})}function Ns({className:t}){return e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3.5",strokeLinecap:"round","aria-hidden":"true",className:t,children:e.jsx("path",{d:"M5 12h14"})})}const ot=f.forwardRef(({label:t,description:r,size:s="md",invalid:n=!1,indeterminate:a=!1,disabled:o=!1,onChange:i,onCheckedChange:l,className:m,wrapperClassName:u,...d},h)=>{const b=vs[s],p=e.jsx(Je.Checkbox.Root,{ref:h,indeterminate:a,disabled:o,"aria-invalid":n||void 0,onCheckedChange:(x,y)=>{l==null||l(x,y),i==null||i(x)},className:c("inline-flex shrink-0 cursor-pointer items-center justify-center rounded-sm border border-border-strong bg-white text-white outline-none transition-colors motion-reduce:transition-none","hover:border-text-subtle","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary","data-[checked]:border-primary data-[checked]:bg-primary data-[indeterminate]:border-primary data-[indeterminate]:bg-primary","aria-[invalid=true]:border-danger aria-[invalid=true]:focus-visible:outline-danger","data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 data-[disabled]:hover:border-border-strong",b.box,!!(t||r)&&b.offset,m),...d,children:e.jsx(Je.Checkbox.Indicator,{className:"flex items-center justify-center",keepMounted:!1,children:a?e.jsx(Ns,{className:b.icon}):e.jsx(ws,{className:b.icon})})});return!t&&!r?p:e.jsxs("label",{className:c("inline-flex select-none items-start gap-2.5",o?"cursor-not-allowed":"cursor-pointer",u),children:[p,e.jsxs("span",{className:"flex min-w-0 flex-col",children:[t&&e.jsx("span",{className:c("text-sm font-medium leading-5",o?"text-text-subtle":"text-text"),children:t}),r&&e.jsx("span",{className:"text-xs leading-normal text-text-muted",children:r})]})]})});ot.displayName="GymatraCheckbox";const ks=F.Combobox.Root,Gs=F.Combobox.Trigger,Cs=F.Combobox.Portal,Ss=F.Combobox.Positioner,zs=F.Combobox.List,Ps=F.Combobox.Group,Ms=F.Combobox.Separator,Is=F.Combobox.Clear,Ts=F.Combobox.Chips,Ls=F.Combobox.Chip,Rs=F.Combobox.ChipRemove,sr=f.forwardRef(({className:t,startIcon:r,error:s,disabled:n,...a},o)=>e.jsxs("div",{className:c("relative flex items-center w-full h-10 rounded-md border bg-white transition-colors",n?"border-border bg-surface-muted opacity-50 cursor-not-allowed":s?"border-danger focus-within:border-danger focus-within:ring-1 focus-within:ring-danger":"border-border hover:border-text-subtle focus-within:border-primary focus-within:ring-1 focus-within:ring-primary"),children:[r&&e.jsx("span",{className:"shrink-0 pl-3 text-text-subtle pointer-events-none flex items-center justify-center",children:r}),e.jsx(F.Combobox.Input,{ref:o,disabled:n,className:c("h-full w-full bg-transparent px-3.5 py-2 text-sm text-text placeholder:text-text-subtle outline-none border-0 ring-0 shadow-none focus:outline-none focus:ring-0 focus:border-0",t),...a}),e.jsx("span",{className:"shrink-0 pr-3 text-text-subtle pointer-events-none flex items-center justify-center",children:e.jsx("svg",{className:"size-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m6 9 6 6 6-6"})})})]}));sr.displayName="GymatraComboboxInput";const it=f.forwardRef(({className:t,children:r,...s},n)=>e.jsx(F.Combobox.Popup,{ref:n,className:c("z-50 min-w-[var(--anchor-width)] max-h-64 overflow-y-auto rounded-lg border border-border bg-white p-1 text-sm text-text outline-none shadow-none",t),...s,children:r}));it.displayName="GymatraComboboxPopup";function Bs({className:t="size-3.5"}){return e.jsx("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})})}const Fe=f.forwardRef(({className:t,children:r,icon:s,description:n,...a},o)=>e.jsxs(F.Combobox.Item,{ref:o,className:c("group relative flex w-full cursor-pointer select-none items-center justify-between gap-2 rounded-md px-2.5 py-1.5 text-sm text-text outline-none transition-colors","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","data-[highlighted]:bg-surface-muted data-[highlighted]:text-text","data-[selected]:font-medium data-[selected]:text-primary",t),...a,children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s&&e.jsx("span",{className:"shrink-0 size-4 text-text-muted flex items-center justify-center",children:s}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate",children:r}),n&&e.jsx("div",{className:"text-xs text-text-muted truncate",children:n})]})]}),e.jsx(F.Combobox.ItemIndicator,{className:"shrink-0 size-4 flex items-center justify-center text-primary",children:e.jsx(Bs,{})})]}));Fe.displayName="GymatraComboboxItem";const lt=f.forwardRef(({className:t,children:r,...s},n)=>e.jsx(F.Combobox.Empty,{ref:n,className:c("px-3 py-2 text-sm text-text-muted text-center",t),...s,children:r??"Aucun résultat trouvé"}));lt.displayName="GymatraComboboxEmpty";const ct=f.forwardRef(({className:t,...r},s)=>e.jsx(F.Combobox.GroupLabel,{ref:s,className:c("px-2.5 py-1 text-xs font-semibold uppercase tracking-wider text-text-muted select-none",t),...r}));ct.displayName="GymatraComboboxGroupLabel";function As(t){return t.map(r=>typeof r=="string"?{value:r,label:r}:r)}function Ds({label:t,helperText:r,error:s,options:n,value:a,defaultValue:o,onValueChange:i,onChange:l,placeholder:m="Rechercher ou sélectionner...",emptyText:u="Aucun résultat trouvé",disabled:d=!1,required:h=!1,className:b,startIcon:p}){const x=As(n),y=x.some(v=>!!v.group),g={};y&&x.forEach(v=>{const w=v.group||"Autres";g[w]||(g[w]=[]),g[w].push(v)});const j=v=>{i==null||i(v),l==null||l(v)},k=a!==void 0?{value:a,onValueChange:j,items:x}:o!==void 0?{defaultValue:o,onValueChange:j,items:x}:{onValueChange:j,items:x};return e.jsxs("div",{className:c("w-full space-y-1.5",b),children:[t&&e.jsxs("label",{className:"block text-xs font-medium text-text-muted",children:[t,h&&e.jsx("span",{className:"text-danger ml-0.5",children:"*"})]}),e.jsxs(F.Combobox.Root,{...k,disabled:d,children:[e.jsxs("div",{className:c("relative flex items-center w-full h-10 rounded-md border bg-white transition-colors",d?"border-border bg-surface-muted opacity-50 cursor-not-allowed":s?"border-danger focus-within:border-danger focus-within:ring-1 focus-within:ring-danger":"border-border hover:border-text-subtle focus-within:border-primary focus-within:ring-1 focus-within:ring-primary"),children:[p&&e.jsx("span",{className:"shrink-0 pl-3 text-text-subtle pointer-events-none flex items-center justify-center",children:p}),e.jsx(F.Combobox.Input,{placeholder:m,disabled:d,className:"h-full w-full bg-transparent px-3.5 py-2 text-sm text-text placeholder:text-text-subtle outline-none border-0 ring-0 shadow-none focus:outline-none focus:ring-0 focus:border-0"}),e.jsx("span",{className:"shrink-0 pr-3 text-text-subtle pointer-events-none flex items-center justify-center",children:e.jsx("svg",{className:"size-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m6 9 6 6 6-6"})})})]}),e.jsx(F.Combobox.Portal,{children:e.jsx(F.Combobox.Positioner,{sideOffset:4,className:"z-[10020] outline-none",children:e.jsxs(it,{children:[e.jsx(lt,{children:u}),e.jsx(F.Combobox.List,{children:y?Object.entries(g).map(([v,w])=>e.jsxs(F.Combobox.Group,{children:[e.jsx(ct,{children:v}),w.map(C=>e.jsx(Fe,{value:C.value,disabled:C.disabled,icon:C.icon,description:C.description,children:C.label},C.value))]},v)):x.map(v=>e.jsx(Fe,{value:v.value,disabled:v.disabled,icon:v.icon,description:v.description,children:v.label},v.value))})]})})})]}),s?e.jsx("p",{className:"text-xs text-danger",children:s}):r?e.jsx("p",{className:"text-xs text-text-muted",children:r}):null]})}const nr={sm:"max-w-[420px]",md:"max-w-lg",lg:"max-w-xl",xl:"max-w-2xl"};function Fs({variant:t}){switch(t){case"danger":case"delete":return e.jsx("svg",{className:"size-12 text-danger stroke-[1.5]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})});case"warning":return e.jsx("svg",{className:"size-12 text-warning stroke-[1.5]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"})});case"success":return e.jsx("svg",{className:"size-12 text-success stroke-[1.5]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})});case"info":return e.jsx("svg",{className:"size-12 text-info stroke-[1.5]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"})});case"primary":return e.jsx("svg",{className:"size-12 text-primary stroke-[1.5]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z"})});default:return null}}function ar({open:t,defaultOpen:r,onOpenChange:s,trigger:n,variant:a="default",size:o="sm",title:i,description:l,icon:m,align:u="center",children:d,confirmLabel:h,onConfirm:b,confirmVariant:p,cancelLabel:x="Annuler",onCancel:y,loading:g=!1,confirmDisabled:j=!1,showCloseButton:k=!1,footer:v,className:w}){const C=a==="danger"||a==="delete",S=h??(b?C?"Supprimer":"Confirmer":void 0),z=m===!1?null:m!==void 0?m:e.jsx(Fs,{variant:a}),N=()=>p||(C?"danger":a==="warning"?"warning":a==="success"?"success":a==="info"?"info":"primary"),P=e.jsxs(W.Dialog.Portal,{children:[e.jsx(W.Dialog.Backdrop,{className:"fixed inset-0 z-[10010] bg-around/40 transition-opacity duration-150 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0"}),e.jsxs(W.Dialog.Popup,{className:c("fixed left-1/2 top-1/2 z-[10010] -translate-x-1/2 -translate-y-1/2","w-[calc(100%-2rem)] bg-white rounded-lg border border-border p-6 shadow-none","flex flex-col focus:outline-none transition-all duration-150","data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0",nr[o],u==="center"?"items-center text-center":"items-start text-left",w),children:[k&&e.jsx(W.Dialog.Close,{className:"size-8 inline-flex items-center justify-center absolute right-3.5 top-3.5 rounded-md text-text-muted hover:bg-surface-muted hover:text-text cursor-pointer transition-colors focus-visible:outline-primary","aria-label":"Fermer",onClick:y,children:e.jsxs("svg",{className:"size-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),z&&e.jsx("div",{className:"flex items-center justify-center mb-3 text-center",children:z}),i&&e.jsx(W.Dialog.Title,{className:c("text-lg font-semibold text-text leading-snug",u==="center"?"text-center":"text-left"),children:i}),l&&e.jsx(W.Dialog.Description,{className:c("text-sm text-text-muted mt-2 leading-relaxed",u==="center"?"text-center":"text-left"),children:l}),d&&e.jsx("div",{className:"mt-4 w-full text-left",children:d}),v!==void 0?v:(S||x)&&e.jsxs("div",{className:c("w-full mt-6",x&&S?"grid grid-cols-2 gap-3":"flex justify-end gap-3"),children:[x&&e.jsx(W.Dialog.Close,{render:e.jsx(De,{variant:"outline",size:"md",className:"w-full text-sm font-medium",onClick:y,disabled:g,children:x})}),S&&e.jsx(De,{variant:N(),size:"md",className:"w-full text-sm font-medium",onClick:b,loading:g,disabled:j||g,children:S})]})]})]});return e.jsxs(W.Dialog.Root,{open:t,defaultOpen:r,onOpenChange:s,children:[n&&e.jsx(W.Dialog.Trigger,{render:n}),P]})}const fe=Object.assign(ar,{Root:W.Dialog.Root,Trigger:W.Dialog.Trigger,Portal:W.Dialog.Portal,Backdrop:f.forwardRef(function({className:r,...s},n){return e.jsx(W.Dialog.Backdrop,{ref:n,className:c("fixed inset-0 z-[10010] bg-around/40 transition-opacity duration-150 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0",r),...s})}),Popup:f.forwardRef(function({className:r,size:s="sm",...n},a){return e.jsx(W.Dialog.Popup,{ref:a,className:c("fixed left-1/2 top-1/2 z-[10010] -translate-x-1/2 -translate-y-1/2","w-[calc(100%-2rem)] bg-white rounded-lg border border-border p-6 shadow-none","flex flex-col focus:outline-none transition-all duration-150","data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0",nr[s],r),...n})}),Title:f.forwardRef(function({className:r,...s},n){return e.jsx(W.Dialog.Title,{ref:n,className:c("text-lg font-semibold text-text leading-snug",r),...s})}),Description:f.forwardRef(function({className:r,...s},n){return e.jsx(W.Dialog.Description,{ref:n,className:c("text-sm text-text-muted mt-2 leading-relaxed",r),...s})}),Close:W.Dialog.Close}),Es=W.Dialog.Root,Ws=W.Dialog.Trigger,$s=W.Dialog.Portal,Os=fe.Backdrop,Hs=fe.Popup,qs=fe.Popup,Vs=fe.Title,Us=fe.Description,_s=W.Dialog.Close,tt={s:25,m:35,l:50,xl:70,full:100},Ks=360;function Zs(t){return typeof t=="number"?`${t}px`:`${tt[t??"m"]??tt.m}vw`}const Qs={s:"w-[25vw]",m:"w-[35vw]",l:"w-[50vw]",xl:"w-[70vw]",full:"w-screen"},Be=f.forwardRef(({size:t,animated:r,mobileLayer:s,label:n,children:a},o)=>e.jsx("div",{ref:o,role:"dialog","aria-modal":"true","aria-label":n,className:c("flex min-h-0 min-w-90 max-w-full shrink flex-col overflow-y-auto overflow-x-hidden border-s border-border bg-white shadow-none","transition-[translate,opacity] duration-300 ease-[cubic-bezier(0.16,1,0.3,1)] motion-reduce:transition-none",typeof t=="number"?void 0:Qs[t],r?"pointer-events-auto translate-x-0 opacity-100":"pointer-events-none translate-x-full opacity-0 rtl:-translate-x-full","max-[900px]:fixed max-[900px]:inset-0 max-[900px]:!w-full max-[900px]:min-w-0 max-[900px]:border-0",s),style:typeof t=="number"?{width:t}:void 0,children:a}));Be.displayName="DrawerSlot";const dt=f.createContext(void 0),or=()=>{const t=f.useContext(dt);if(!t)throw new Error("useGymatraDrawer must be used within a GymatraDrawerProvider");return t},Ys=or,Js=dt;function ir({children:t}){const[r,s]=f.useState(!1),[n,a]=f.useState(!1),[o,i]=f.useState(!1),[l,m]=f.useState("m"),[u,d]=f.useState(null),[h,b]=f.useState(null),p=f.useRef(null),x=f.useRef(null),[y,g]=f.useState(!1),[j,k]=f.useState(!1),[v,w]=f.useState(!1),[C,T]=f.useState("l"),[S,z]=f.useState(null),[N,P]=f.useState(null),E=f.useRef(null),R=f.useRef(null),[O,re]=f.useState(!1),[M,H]=f.useState(!1),[oe,B]=f.useState(!1),[$,K]=f.useState("s"),[q,Z]=f.useState(null),[Ie,ie]=f.useState(null),ye=f.useRef(null),le=f.useRef(null);f.useEffect(()=>{if(n&&r){const G=requestAnimationFrame(()=>{i(!0)});return()=>cancelAnimationFrame(G)}else i(!1)},[n,r]),f.useEffect(()=>{if(j&&y){const G=requestAnimationFrame(()=>{w(!0)});return()=>cancelAnimationFrame(G)}else w(!1)},[j,y]),f.useEffect(()=>{if(M&&O){const G=requestAnimationFrame(()=>{B(!0)});return()=>cancelAnimationFrame(G)}else B(!1)},[M,O]),f.useEffect(()=>{const G=()=>{je()};return window.addEventListener("popstate",G),()=>window.removeEventListener("popstate",G)},[]);const ge=(G,I="s",A={})=>{le.current&&clearTimeout(le.current),Z(()=>G),K(I),ie(A),H(!0),re(!0)},Q=()=>{re(!1),B(!1),le.current&&clearTimeout(le.current),le.current=setTimeout(()=>{H(!1),Z(null),ie(null)},300)},Te=(G,I="l",A={})=>{R.current&&clearTimeout(R.current),z(()=>G),T(I),P(A),k(!0),g(!0)},ue=()=>{Q(),g(!1),w(!1),R.current&&clearTimeout(R.current),R.current=setTimeout(()=>{k(!1),z(null),P(null)},300)},Ke=(G,I="m",A={})=>{x.current&&clearTimeout(x.current),d(()=>G),m(I),b(A),a(!0),s(!0)},xe=()=>{Q(),ue(),s(!1),i(!1),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{a(!1),d(null),b(null)},300)},je=()=>{xe()};f.useEffect(()=>{const G=I=>{I.key==="Escape"&&(O?Q():y?ue():r&&xe())};if(r||y||O)return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[r,y,O]);const Le=n||j||M,Ze=o||v||oe,Re=(r?1:0)+(y?1:0)+(O?1:0);return e.jsxs(dt.Provider,{value:{openDrawer:Ke,closeDrawer:xe,isOpen:r,size:l,contentProps:h,Component:u,openSecondDrawer:Te,closeSecondDrawer:ue,isSecondOpen:y,secondSize:C,secondContentProps:N,SecondComponent:S,openThirdDrawer:ge,closeThirdDrawer:Q,isThirdOpen:O,thirdSize:$,thirdContentProps:Ie,ThirdComponent:q,closeAll:je,openCount:Re},children:[t,Le&&e.jsx("div",{"aria-hidden":"true",onClick:()=>{O?Q():y?ue():r&&xe()},className:c("fixed inset-0 z-[9990] bg-around/40 cursor-pointer","transition-opacity duration-300 ease-out",Ze?"opacity-100":"opacity-0 pointer-events-none")}),Le&&e.jsxs("div",{className:"pointer-events-none fixed inset-y-0 end-0 z-[10000] flex max-w-full items-stretch justify-end gap-1.5 overflow-x-auto overflow-y-hidden max-[900px]:inset-0",children:[M&&e.jsx(Be,{ref:ye,size:$,animated:oe,mobileLayer:"max-[900px]:z-30",label:"Tiroir de niveau 3",children:q&&e.jsx(q,{...Ie||{}})}),j&&e.jsx(Be,{ref:E,size:C,animated:v,mobileLayer:"max-[900px]:z-20",label:"Tiroir de niveau 2",children:S&&e.jsx(S,{...N||{}})}),n&&e.jsx(Be,{ref:p,size:l,animated:o,mobileLayer:"max-[900px]:z-10",label:"Tiroir",children:u&&e.jsx(u,{...h||{}})})]})]})}const Xs=ir;function en({title:t,description:r,icon:s,showCloseButton:n=!0,onClose:a,footer:o,className:i,children:l,...m}){return e.jsxs("div",{className:c("flex h-full flex-col bg-white text-text min-h-0",i),...m,children:[(t||n)&&e.jsxs("div",{className:"sticky top-0 z-20 shrink-0 bg-white",children:[e.jsxs("div",{className:"flex items-center justify-between px-5 pt-4 pb-3 sm:px-6",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0 pe-3",children:[s&&e.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-primary-soft text-primary",children:s}),e.jsxs("div",{className:"min-w-0",children:[t&&e.jsx("h3",{className:"text-base font-semibold text-text truncate",children:t}),r&&e.jsx("p",{className:"text-xs text-text-muted truncate mt-0.5",children:r})]})]}),n&&e.jsx("button",{type:"button",onClick:a,"aria-label":"Fermer",className:"size-8 inline-flex shrink-0 items-center justify-center rounded-md text-text-muted hover:bg-surface-muted hover:text-text cursor-pointer transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",children:e.jsxs("svg",{className:"size-4.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsx("div",{className:"mx-5 sm:mx-6 border-b border-border"})]}),e.jsx("div",{className:"flex-1 space-y-4 overflow-y-auto p-5 text-sm text-text",children:l}),o&&e.jsx("div",{className:"flex shrink-0 items-center justify-end gap-2.5 border-t border-border bg-white px-5 py-3.5",children:o})]})}function tn(){return e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("path",{d:"M3 9l2.5-5h13L21 9"}),e.jsx("path",{d:"M3 9h5l1.5 3h5L16 9h5v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1Z"})]})}const rn={sm:{root:"gap-3 px-4 py-6",tile:"size-10 [&>svg]:size-5",title:"text-sm",description:"text-xs"},md:{root:"gap-4 px-6 py-10",tile:"size-12 [&>svg]:size-6",title:"text-base",description:"text-sm"},lg:{root:"gap-5 px-6 py-16",tile:"size-14 [&>svg]:size-7",title:"text-lg",description:"text-sm"}},sn={plain:"",bordered:"rounded-lg border border-dashed border-border-strong",muted:"rounded-lg bg-surface-muted"},nn={neutral:{plain:"bg-surface-muted text-text-muted",bordered:"bg-surface-muted text-text-muted",muted:"bg-white text-text-muted"},primary:{plain:"bg-primary-soft text-primary",bordered:"bg-primary-soft text-primary",muted:"bg-white text-primary"},danger:{plain:"bg-danger-soft text-danger",bordered:"bg-danger-soft text-danger",muted:"bg-white text-danger"}},lr=f.forwardRef(({title:t,description:r,icon:s,action:n,secondaryAction:a,size:o="md",variant:i="plain",tone:l="neutral",headingLevel:m=3,className:u,...d},h)=>{const b=rn[o],p=`h${m}`,x=s===void 0?e.jsx(tn,{}):s;return e.jsxs("div",{ref:h,className:c("flex w-full flex-col items-center justify-center text-center",b.root,sn[i],u),...d,children:[x!==null&&e.jsx("span",{"aria-hidden":"true",className:c("flex shrink-0 items-center justify-center rounded-full",b.tile,nn[l][i]),children:x}),e.jsxs("div",{className:"max-w-sm space-y-1",children:[e.jsx(p,{className:c("font-semibold text-text",b.title),children:t}),r&&e.jsx("p",{className:c("text-text-muted",b.description),children:r})]}),(n||a)&&e.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[a,n]})]})});lr.displayName="GymatraEmptyState";function an({className:t="size-3.5"}){return e.jsx("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m6 9 6 6 6-6"})})}function ut({label:t,options:r,multiple:s=!1,value:n,defaultValue:a,onChange:o,placeholder:i,bordered:l=!0,showCount:m=!0,size:u="sm",width:d,className:h,disabled:b=!1}){const[p,x]=f.useState(()=>typeof a<"u"?a:s?[]:r.length>0?r[0].value:""),[y,g]=f.useState(!1),j=f.useRef(null),k=n??p,v=s?Array.isArray(k)?k:k?[k]:[]:typeof k=="string"&&k!==""?[k]:[];let w;if(s)if(v.length===0)w=i??`All ${t}`;else if(v.length===1){const N=r.find(P=>P.value===v[0]);w=N?N.label:v[0]}else v.length===r.length?w=`All (${v.length})`:w=`${v.length} selected`;else{const N=v[0],P=r.find(E=>E.value===N);w=P?P.label:i??`All ${t}`}const C=s?v.length>0:!!(v[0]&&v[0]!=="all"&&v[0]!=="");f.useEffect(()=>{function N(P){j.current&&!j.current.contains(P.target)&&g(!1)}if(y)return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[y]),f.useEffect(()=>{function N(P){P.key==="Escape"&&g(!1)}if(y)return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[y]);function T(N){if(s){const E=v.includes(N)?v.filter(R=>R!==N):[...v,N];typeof n>"u"&&x(E),o==null||o(E)}else typeof n>"u"&&x(N),o==null||o(N),g(!1)}function S(){const N=r.filter(P=>!P.disabled).map(P=>P.value);typeof n>"u"&&x(N),o==null||o(N)}function z(){const N=[];typeof n>"u"&&x(N),o==null||o(N)}return e.jsxs("div",{ref:j,className:c("relative inline-block text-left",h),children:[e.jsxs("button",{type:"button",disabled:b,onClick:()=>g(N=>!N),"aria-haspopup":"listbox","aria-expanded":y,"aria-label":`${t}: ${w}`,className:c("inline-flex items-center justify-between gap-2 rounded-md text-text cursor-pointer transition-colors outline-none","focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary","disabled:pointer-events-none disabled:opacity-50",u==="sm"?"h-8.5 px-3 text-sm":"h-10 px-3.5 text-sm",d||(u==="sm"?"w-[165px]":"w-[185px]"),l?"border border-border bg-white hover:border-border-strong hover:bg-surface/50":"border-0 bg-transparent hover:bg-surface/50",y&&"bg-primary-soft/50 text-primary",C&&!y&&"bg-primary-soft/50 text-primary"),children:[e.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[e.jsxs("span",{className:"text-text-muted",children:[t,":"]}),e.jsx("span",{className:"truncate",children:w})]}),e.jsx("span",{className:c("text-text-subtle transition-transform duration-150 flex items-center shrink-0",y&&"rotate-180 text-primary"),"aria-hidden":"true",children:e.jsx(an,{})})]}),y&&e.jsxs("div",{role:"listbox","aria-multiselectable":s,"aria-label":t,className:"absolute left-0 z-50 mt-1 min-w-[190px] w-max max-w-[280px] rounded-lg border border-border bg-white p-1.5 shadow-none focus:outline-none",children:[s&&r.length>2&&e.jsxs("div",{className:"flex items-center justify-between border-b border-border px-2 py-1.5 mb-1 text-xs text-text-muted",children:[e.jsxs("span",{children:[v.length," of ",r.length," selected"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:S,className:"text-primary hover:underline font-medium cursor-pointer",children:"All"}),e.jsx("span",{className:"text-border","aria-hidden":"true",children:"|"}),e.jsx("button",{type:"button",onClick:z,className:"text-text-muted hover:text-text hover:underline cursor-pointer",children:"Clear"})]})]}),e.jsx("div",{className:"max-h-60 overflow-y-auto space-y-0.5",children:r.map(N=>{const P=v.includes(N.value);return e.jsxs("button",{type:"button",role:"option","aria-selected":P,disabled:N.disabled,onClick:()=>T(N.value),className:c("flex w-full items-center justify-between gap-2.5 rounded-md px-2 py-1.5 text-sm text-left cursor-pointer transition-colors outline-none","hover:bg-surface hover:text-text","focus-visible:bg-surface focus-visible:text-primary","disabled:pointer-events-none disabled:opacity-40",P?"bg-primary-soft/40 text-primary font-medium":"text-text font-normal"),children:[e.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[e.jsx("span",{"aria-hidden":"true",className:c("size-5 shrink-0 rounded-md flex items-center justify-center border transition-colors",P?"border-primary bg-primary text-white":"border-border-strong bg-white hover:border-text-subtle"),children:P&&e.jsx("svg",{"aria-hidden":"true",className:"size-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})})}),e.jsx("span",{className:"truncate",children:N.label})]}),m&&typeof N.count<"u"&&e.jsx("span",{className:c("shrink-0 rounded px-1.5 py-0.5 text-xs font-medium leading-none",P?"bg-primary text-white":"bg-surface text-text-muted"),children:N.count})]},N.value)})})]})]})}ut.displayName="GymatraFilterSelect";function on({className:t="size-4"}){return e.jsxs("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"11",cy:"11",r:"7"}),e.jsx("path",{d:"m21 21-4.35-4.35"})]})}function cr({className:t="size-3"}){return e.jsx("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})}function ln({className:t="size-3.5"}){return e.jsx("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m6 9 6 6 6-6"})})}function cn({className:t="size-3.5"}){return e.jsx("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"})})}function dr({value:t,onChange:r,onClear:s,placeholder:n="Search...",borderless:a=!0,className:o,...i}){const l=!!(t&&String(t).length>0);return e.jsxs("div",{className:c("relative flex items-center shrink-0",a?"w-[180px] min-w-[140px] max-w-[220px]":"w-60",o),children:[e.jsx("span",{className:"pointer-events-none absolute left-0.5 flex items-center text-text-subtle","aria-hidden":"true",children:e.jsx(on,{className:"size-4"})}),e.jsx("input",{type:"search",value:t,onChange:r,placeholder:n,className:c("w-full h-9 bg-transparent text-sm text-text placeholder:text-sm placeholder:text-text-subtle",a?"border-0 ring-0 outline-none shadow-none pl-6 pr-5 focus:border-0 focus:ring-0 focus:outline-none focus:shadow-none active:border-0 active:ring-0 active:outline-none":"rounded-md border border-border pl-8 pr-6 focus:border-primary focus:outline-2 focus:outline-primary/30"),...i}),l&&s&&e.jsx("button",{type:"button",onClick:s,"aria-label":"Clear search",className:"absolute right-0.5 flex size-5 items-center justify-center text-text-subtle hover:text-text cursor-pointer transition-colors",children:e.jsx(cr,{className:"size-3.5"})})]})}function dn({label:t,options:r,value:s,defaultValue:n,onChange:a,className:o,...i}){return e.jsxs("div",{className:c("relative inline-flex items-center",o),children:[e.jsx("select",{value:s,defaultValue:n,onChange:a,"aria-label":t,className:"h-8.5 rounded-md border border-border bg-surface pl-2.5 pr-7 text-sm text-text outline-none hover:border-border-strong focus-visible:border-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary cursor-pointer appearance-none transition-colors",...i,children:r.map(l=>e.jsx("option",{value:l.value,children:l.label},l.value))}),e.jsx("span",{className:"pointer-events-none absolute right-2 text-text-subtle flex items-center","aria-hidden":"true",children:e.jsx(ln,{})})]})}function ur({label:t,valueLabel:r,onRemove:s,className:n}){return e.jsxs("span",{className:c("inline-flex h-6 items-center gap-1.5 rounded border border-border bg-surface px-2 text-xs text-text",n),children:[e.jsxs("span",{className:"text-text-muted",children:[t,":"]}),e.jsx("span",{className:"font-medium text-text",children:r}),e.jsx("button",{type:"button",onClick:s,"aria-label":`Remove filter ${t}: ${r}`,className:"inline-flex size-3.5 items-center justify-center rounded-full text-text-muted hover:text-text cursor-pointer transition-colors",children:e.jsx(cr,{})})]})}function xr({searchValue:t,onSearchChange:r,searchPlaceholder:s="Search...",searchBorderless:n=!0,totalCount:a,countLabel:o="Results",actions:i,filters:l=[],activeFilters:m=[],onResetFilters:u,isFiltersOpen:d,defaultFiltersOpen:h=!1,onToggleFilters:b,filterButtonLabel:p="Filters",bottomContent:x,className:y,children:g,...j}){const[k,v]=f.useState(h),w=d??k;function C(){const z=!w;typeof d>"u"&&v(z),b==null||b(z)}const T=typeof t<"u"||typeof r<"u";l.length>0||m.length>0;const S=m.length;return e.jsxs("div",{className:c("flex flex-col w-full",y),...j,children:[e.jsxs("div",{className:"flex flex-wrap items-center min-h-12 py-1.5 ps-3.5 pe-1.5 gap-3 rounded-lg border border-border bg-surface",children:[T&&e.jsx(dr,{value:t,onChange:z=>r==null?void 0:r(z.target.value),onClear:()=>r==null?void 0:r(""),placeholder:s,borderless:n}),T&&typeof a<"u"&&e.jsx("span",{className:"h-5 w-px shrink-0 bg-border","aria-hidden":"true"}),typeof a<"u"&&e.jsxs("div",{className:"inline-flex items-center gap-1.5 whitespace-nowrap text-sm text-text-muted",children:[e.jsx("span",{className:"font-medium text-text",children:a}),e.jsx("span",{children:o})]}),g,e.jsxs("div",{className:"ms-auto flex flex-wrap items-center gap-2.5",children:[l.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"h-5 w-px shrink-0 bg-border","aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.map(z=>e.jsx(ut,{label:z.label,options:z.options,multiple:z.multiple,value:z.value,defaultValue:z.defaultValue,onChange:z.onChange},z.id)),u&&(m.length>0||!!t)&&e.jsx("button",{type:"button",onClick:u,className:"rounded px-1.5 py-0.5 text-xs font-medium text-primary hover:underline cursor-pointer transition-opacity",children:"Reset"})]})]}),i,x&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"h-5 w-px shrink-0 bg-border","aria-hidden":"true"}),e.jsxs("button",{type:"button",onClick:C,"aria-expanded":w,"aria-label":`${w?"Hide":"Show"} filters`,title:p,"data-active":w||S>0,className:"relative inline-flex size-8 shrink-0 items-center justify-center rounded-md border-0 bg-transparent text-text hover:bg-surface-muted hover:text-primary cursor-pointer transition-colors outline-none focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary data-[active=true]:bg-primary-soft data-[active=true]:text-primary",children:[e.jsx(cn,{}),S>0&&e.jsx("span",{className:"absolute -top-1 -right-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-primary px-1 text-xs font-medium leading-none text-white",children:S})]})]})]})]}),m.length>0&&e.jsx("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 px-1","aria-label":"Applied filters",children:m.map(z=>e.jsx(ur,{label:z.label,valueLabel:z.valueLabel,onRemove:z.onRemove},z.id))}),w&&x&&e.jsx("div",{className:"mt-2.5 flex flex-col gap-3 rounded-lg border border-border bg-surface p-3.5 transition-all",children:x})]})}xr.displayName="GymatraFilterBar";function D({label:t,error:r,helperText:s,required:n,disabled:a,focused:o,startAdornment:i,endAdornment:l,className:m,wrapperClassName:u,children:d,...h}){const b=!!r;return e.jsxs("div",{className:c("relative w-full pt-2.5 pb-1",a&&"opacity-60 pointer-events-none",u),...h,children:[e.jsxs("div",{className:c("group relative flex items-center w-full min-h-11 rounded-md border bg-white transition-all",b?"border-danger focus-within:border-danger focus-within:ring-1 focus-within:ring-danger":o?"border-primary ring-1 ring-primary":"border-border hover:border-text-subtle focus-within:border-primary focus-within:ring-1 focus-within:ring-primary",m),children:[t&&e.jsxs("label",{className:c("pointer-events-none absolute -top-3 start-3 z-10 px-1.5 bg-white text-sm leading-none font-medium transition-colors select-none",b?"text-danger":o?"text-primary":"text-text-muted group-focus-within:text-primary group-hover:text-text"),children:[t,n&&e.jsx("span",{className:"ms-0.5 text-danger","aria-hidden":"true",children:"*"})]}),i&&e.jsx("div",{className:"flex shrink-0 items-center ps-3 text-text-muted select-none",children:i}),e.jsx("div",{className:"flex-1 min-w-0 flex items-center",children:d}),l&&e.jsx("div",{className:"flex shrink-0 items-center pe-3 text-text-muted select-none",children:l})]}),(r||s)&&e.jsxs("p",{className:c("mt-2 text-xs flex items-center gap-1 ps-1",b?"text-danger font-medium":"text-text-muted"),children:[b&&e.jsxs("svg",{className:"size-3.5 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),e.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),e.jsx("span",{children:r||s})]})]})}const he=f.forwardRef(({label:t,error:r,helperText:s,startIcon:n,endIcon:a,prefixText:o,suffixText:i,type:l="text",placeholder:m,disabled:u,required:d,className:h,wrapperClassName:b,...p},x)=>{const y=!!(n||o),g=!!(i||a);return e.jsx(D,{label:t,error:r,helperText:s,required:d,disabled:u,wrapperClassName:b,startAdornment:y?e.jsxs("div",{className:"flex items-center gap-1.5 text-text-muted text-sm",children:[n,o&&e.jsx("span",{className:"font-medium text-text select-none",children:o})]}):void 0,endAdornment:g?e.jsxs("div",{className:"flex items-center gap-1.5 text-text-muted text-sm",children:[i&&e.jsx("span",{className:"font-medium text-text select-none",children:i}),a]}):void 0,children:e.jsx("input",{ref:x,type:l,disabled:u,placeholder:m||(typeof t=="string"?t:void 0),className:c("w-full h-11 bg-transparent text-sm text-text placeholder:text-text-subtle/80 outline-none border-0 border-none ring-0 shadow-none focus:ring-0 focus:outline-none focus:border-0",y?"ps-2.5":"ps-3.5",g?"pe-2.5":"pe-3.5","disabled:cursor-not-allowed",h),...p})})});he.displayName="GymatraTextInput";const mr=f.forwardRef(({label:t="Email",startIcon:r,...s},n)=>{const a=e.jsxs("svg",{className:"size-4 text-text-subtle",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),e.jsx("path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"})]});return e.jsx(he,{ref:n,type:"email",label:t,startIcon:r??a,autoComplete:"email",...s})});mr.displayName="GymatraEmailInput";const pr=f.forwardRef(({label:t="Mot de passe",startIcon:r,...s},n)=>{const[a,o]=f.useState(!1),i=e.jsxs("svg",{className:"size-4 text-text-subtle",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]});return e.jsx(he,{ref:n,type:a?"text":"password",label:t,startIcon:r??i,autoComplete:"current-password",endIcon:e.jsx("button",{type:"button",tabIndex:-1,onClick:()=>o(!a),className:"text-text-muted hover:text-text cursor-pointer transition-colors p-1","aria-label":a?"Masquer":"Afficher",children:a?e.jsxs("svg",{className:"size-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),e.jsx("line",{x1:"1",y1:"23",x2:"23",y2:"1"})]}):e.jsxs("svg",{className:"size-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}),...s})});pr.displayName="GymatraPasswordInput";const fr=f.forwardRef(({label:t="Rechercher",startIcon:r,value:s,onChange:n,onClear:a,...o},i)=>{const[l,m]=f.useState(""),u=s!==void 0,d=u?String(s):l,h=e.jsxs("svg",{className:"size-4 text-text-subtle",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),b=()=>{u||m(""),a==null||a()};return e.jsx(he,{ref:i,type:"search",label:t,value:s,onChange:p=>{u||m(p.target.value),n==null||n(p)},startIcon:r??h,endIcon:d?e.jsx("button",{type:"button",onClick:b,className:"text-text-muted hover:text-text cursor-pointer p-0.5 rounded-full hover:bg-surface-muted transition-colors","aria-label":"Effacer",children:e.jsxs("svg",{className:"size-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}):void 0,...o})});fr.displayName="GymatraSearchInput";const Lt=["MA","DZ","TN","FR","ES","BE","CA","US","GB","SA","AE","QA","TR"],Rt={MA:"Maroc",DZ:"Algérie",TN:"Tunisie",FR:"France",ES:"Espagne",BE:"Belgique",CA:"Canada",US:"États-Unis",GB:"Royaume-Uni",SA:"Arabie Saoudite",AE:"Émirats Arabes Unis",QA:"Qatar",TR:"Turquie",IT:"Italie",DE:"Allemagne",CH:"Suisse",NL:"Pays-Bas",PT:"Portugal",EG:"Égypte",SN:"Sénégal",CI:"Côte d'Ivoire"},hr=({name:t,label:r="Téléphone",error:s,helperText:n,value:a,defaultValue:o,onChange:i,onBlur:l,defaultCountry:m="MA",disabled:u,required:d,autoValidate:h=!1,invalidErrorMessage:b,placeholder:p,className:x,wrapperClassName:y})=>{const[g,j]=f.useState(m),[k,v]=f.useState(o),[w,C]=f.useState(!1),[T,S]=f.useState(""),z=f.useRef(null),N=f.useRef(null),P=a!==void 0?a:k,E=B=>{a===void 0&&v(B),i==null||i(B)},R=St[g],O=g?ae.getCountryCallingCode(g):"212",re=!!(h&&P&&P.trim().length>3&&!ae.isValidPhoneNumber(P)),M=s||(re?b||"Numéro de téléphone invalide pour ce pays":void 0),H=f.useMemo(()=>{const $=ae.getCountries().filter(K=>!Lt.includes(K));return[...Lt,...$]},[]),oe=f.useMemo(()=>{if(!T.trim())return H;const B=T.toLowerCase().trim();return H.filter($=>{const K=(zt[$]||Rt[$]||$).toLowerCase(),q=ae.getCountryCallingCode($);return K.includes(B)||q.includes(B)||$.toLowerCase().includes(B)})},[H,T]);return f.useEffect(()=>{const B=$=>{z.current&&!z.current.contains($.target)&&C(!1)};return w&&(document.addEventListener("mousedown",B),setTimeout(()=>{var $;return($=N.current)==null?void 0:$.focus()},50)),()=>document.removeEventListener("mousedown",B)},[w]),e.jsxs("div",{ref:z,className:"relative w-full",children:[e.jsx(D,{label:r,error:M,helperText:n,required:d,disabled:u,focused:w,wrapperClassName:y,className:x,startAdornment:e.jsxs("div",{className:"relative flex items-center pe-1 self-stretch",children:[e.jsxs("button",{type:"button",disabled:u,onClick:()=>{u||(C(!w),S(""))},className:"flex items-center gap-1.5 py-1 px-1 -ms-1 rounded hover:bg-surface-muted transition-colors cursor-pointer select-none text-sm text-text outline-none focus-visible:ring-1 focus-visible:ring-primary","aria-expanded":w,"aria-label":"Sélectionner le pays",children:[e.jsx("span",{className:"flex items-center justify-center w-5 h-3.5 rounded-xs overflow-hidden border border-border/80 shrink-0 bg-surface-muted [&>svg]:size-full [&>svg]:object-cover",children:R?e.jsx(R,{title:g}):e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-text-muted","aria-hidden":"true",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]})}),e.jsx("svg",{className:c("size-3 text-text-subtle shrink-0 transition-transform duration-200",w&&"rotate-180"),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:e.jsx("polyline",{points:"6 9 12 15 18 9"})}),e.jsxs("span",{className:"font-medium text-text text-sm ms-0.5",children:["+",O]})]}),e.jsx("span",{className:"h-4 w-px bg-border ms-1.5 me-1 shrink-0","aria-hidden":"true"})]}),children:e.jsx(Kr,{name:t,country:g,value:P,onChange:E,onBlur:l,disabled:u,placeholder:p||(g==="MA"?"06 55 12 34 56":"Numéro de téléphone"),className:c("w-full h-11 ps-1 pe-3.5 bg-transparent text-sm text-text placeholder:text-text-subtle/80 outline-none border-0 border-none ring-0 shadow-none focus:ring-0 focus:outline-none focus:border-0","disabled:cursor-not-allowed",x)})}),w&&e.jsxs("div",{className:"absolute top-[calc(100%+6px)] start-0 z-50 w-72 rounded-lg border border-border bg-white p-2 shadow-none max-h-72 flex flex-col",children:[e.jsxs("div",{className:"relative mb-2 shrink-0",children:[e.jsx("div",{className:"absolute inset-y-0 start-2.5 flex items-center pointer-events-none text-text-subtle",children:e.jsxs("svg",{className:"size-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}),e.jsx("input",{ref:N,type:"text",value:T,onChange:B=>S(B.target.value),placeholder:"Rechercher pays ou indicatif...",className:"w-full h-8 ps-8 pe-2.5 bg-surface-muted rounded text-sm text-text placeholder:text-text-subtle outline-none border border-border focus:border-primary focus:bg-white transition-colors"})]}),e.jsx("div",{className:"flex-1 overflow-y-auto space-y-0.5 pe-1",children:oe.length===0?e.jsx("div",{className:"px-3 py-4 text-sm text-center text-text-muted",children:"Aucun pays trouvé"}):oe.map(B=>{const $=St[B],K=ae.getCountryCallingCode(B),q=zt[B]||Rt[B]||B,Z=B===g;return e.jsxs("button",{type:"button",onClick:()=>{j(B),C(!1),S("")},className:c("w-full flex items-center justify-between px-2.5 py-1.5 rounded text-sm transition-colors cursor-pointer text-start",Z?"bg-primary-soft text-primary font-medium":"text-text hover:bg-surface-muted"),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"flex items-center justify-center w-5 h-3.5 rounded-xs overflow-hidden border border-border/80 shrink-0 bg-surface-muted [&>svg]:size-full [&>svg]:object-cover",children:$?e.jsx($,{title:q}):e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-text-muted","aria-hidden":"true",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]})}),e.jsx("span",{className:"truncate",children:q})]}),e.jsxs("span",{className:c("text-xs shrink-0 ms-2 font-medium",Z?"text-primary":"text-text-muted"),children:["+",K]})]},B)})})]})]})};hr.displayName="GymatraPhoneInput";const br=f.forwardRef(({label:t="Site web",prefixText:r="https://",...s},n)=>{const a=e.jsxs("svg",{className:"size-4 text-text-subtle",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),e.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]});return e.jsx(he,{ref:n,type:"url",label:t,startIcon:a,prefixText:r,placeholder:"example.com",...s})});br.displayName="GymatraUrlInput";const Pe=f.forwardRef(({label:t="Nombre",error:r,helperText:s,step:n=1,min:a,max:o,showSteppers:i=!0,prefixText:l,suffixText:m,disabled:u,required:d,className:h,value:b,defaultValue:p,onChange:x,...y},g)=>{const j=f.useRef(null),k=v=>{const w=j.current;!w||u||(v==="up"?w.stepUp():w.stepDown(),w.dispatchEvent(new Event("change",{bubbles:!0})))};return e.jsx(D,{label:t,error:r,helperText:s,required:d,disabled:u,startAdornment:l?e.jsx("span",{className:"text-xs text-text-muted font-medium select-none",children:l}):void 0,endAdornment:i?e.jsxs("div",{className:"flex flex-col border-s border-border -me-1 self-stretch my-0.5 justify-center",children:[e.jsx("button",{type:"button",tabIndex:-1,disabled:u,onClick:()=>k("up"),className:"px-1.5 py-0 text-text-muted hover:text-text hover:bg-surface-muted transition-colors cursor-pointer flex-1 flex items-center justify-center","aria-label":"Augmenter",children:e.jsx("svg",{className:"size-2.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:e.jsx("polyline",{points:"18 15 12 9 6 15"})})}),e.jsx("button",{type:"button",tabIndex:-1,disabled:u,onClick:()=>k("down"),className:"px-1.5 py-0 text-text-muted hover:text-text hover:bg-surface-muted transition-colors cursor-pointer border-t border-border flex-1 flex items-center justify-center","aria-label":"Diminuer",children:e.jsx("svg",{className:"size-2.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:e.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}):m?e.jsx("span",{className:"text-xs text-text-muted font-medium select-none",children:m}):void 0,children:e.jsx("input",{ref:v=>{j.current=v,typeof g=="function"?g(v):g&&(g.current=v)},type:"number",step:n,min:a,max:o,disabled:u,value:b,defaultValue:p,onChange:x,className:c("w-full h-11 bg-transparent text-sm text-text placeholder:text-text-subtle outline-none border-0 border-none ring-0 shadow-none focus:ring-0 focus:outline-none focus:border-0 [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",l?"ps-2.5":"ps-3.5",i||m?"pe-2.5":"pe-3.5",h),...y})})});Pe.displayName="GymatraNumberInput";const un=Pe,yr=f.forwardRef(({label:t="Montant",currency:r="DH",currencyPosition:s="end",step:n=.01,min:a=0,placeholder:o="0.00",...i},l)=>{const m=s==="start";return e.jsx(Pe,{ref:l,label:t,step:n,min:a,placeholder:o,showSteppers:!1,prefixText:m?r:void 0,suffixText:m?void 0:r,...i})});yr.displayName="GymatraCurrencyInput";const gr=f.forwardRef(({label:t="Pourcentage",min:r=0,max:s=100,step:n=1,placeholder:a="0",...o},i)=>e.jsx(Pe,{ref:i,label:t,min:r,max:s,step:n,placeholder:a,showSteppers:!1,suffixText:"%",...o}));gr.displayName="GymatraPercentageInput";const jr=f.forwardRef(({label:t="Date",error:r,helperText:s,required:n,disabled:a,className:o,...i},l)=>e.jsx(D,{label:t,error:r,helperText:s,required:n,disabled:a,endAdornment:e.jsxs("svg",{className:"size-4 text-text-subtle pointer-events-none",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),e.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),e.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),e.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]}),children:e.jsx("input",{ref:l,type:"date",disabled:a,className:c("w-full h-11 px-3 bg-transparent text-sm text-text outline-none border-0 border-none ring-0 shadow-none focus:ring-0 focus:outline-none focus:border-0 [color-scheme:light]",o),...i})}));jr.displayName="GymatraDateInput";const vr=f.forwardRef(({label:t="Heure",error:r,helperText:s,required:n,disabled:a,className:o,...i},l)=>e.jsx(D,{label:t,error:r,helperText:s,required:n,disabled:a,endAdornment:e.jsxs("svg",{className:"size-4 text-text-subtle pointer-events-none",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("polyline",{points:"12 6 12 12 16 14"})]}),children:e.jsx("input",{ref:l,type:"time",disabled:a,className:c("w-full h-11 px-3 bg-transparent text-sm text-text outline-none border-0 border-none ring-0 shadow-none focus:ring-0 focus:outline-none focus:border-0 [color-scheme:light]",o),...i})}));vr.displayName="GymatraTimeInput";const wr=f.forwardRef(({label:t="Date & Heure",error:r,helperText:s,required:n,disabled:a,className:o,...i},l)=>e.jsx(D,{label:t,error:r,helperText:s,required:n,disabled:a,endAdornment:e.jsxs("svg",{className:"size-4 text-text-subtle pointer-events-none",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),e.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),e.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),e.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]}),children:e.jsx("input",{ref:l,type:"datetime-local",disabled:a,className:c("w-full h-11 px-3 bg-transparent text-sm text-text outline-none border-0 border-none ring-0 shadow-none focus:ring-0 focus:outline-none focus:border-0 [color-scheme:light]",o),...i})}));wr.displayName="GymatraDateTimeInput";function xn({label:t="Période (Début - Fin)",startDate:r,endDate:s,onStartDateChange:n,onEndDateChange:a,error:o,helperText:i,disabled:l,required:m,className:u}){return e.jsx(D,{label:t,error:o,helperText:i,required:m,disabled:l,className:u,endAdornment:e.jsxs("svg",{className:"size-4 text-text-subtle pointer-events-none",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),e.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),e.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),e.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]}),children:e.jsxs("div",{className:"flex items-center w-full px-2",children:[e.jsx("input",{type:"date",value:r,disabled:l,onChange:d=>n==null?void 0:n(d.target.value),className:"flex-1 h-11 bg-transparent text-sm text-text outline-none border-0 border-none ring-0 shadow-none focus:ring-0 focus:outline-none focus:border-0 [color-scheme:light]"}),e.jsx("span",{className:"px-2 text-text-muted select-none",children:"→"}),e.jsx("input",{type:"date",value:s,disabled:l,onChange:d=>a==null?void 0:a(d.target.value),className:"flex-1 h-11 bg-transparent text-sm text-text outline-none border-0 border-none ring-0 shadow-none focus:ring-0 focus:outline-none focus:border-0 [color-scheme:light]"})]})})}function mn({name:t,label:r="Sélection",options:s,value:n,defaultValue:a,onChange:o,onBlur:i,placeholder:l="Sélectionner une option...",searchable:m=!1,searchPlaceholder:u="Rechercher...",clearable:d=!1,error:h,helperText:b,required:p,disabled:x,className:y,wrapperClassName:g}){const[j,k]=f.useState(a),[v,w]=f.useState(!1),[C,T]=f.useState(""),S=f.useRef(null),z=f.useRef(null),N=n!==void 0,P=N?n:j,E=s.find(M=>M.value===P);f.useEffect(()=>{const M=H=>{S.current&&!S.current.contains(H.target)&&w(!1)};if(v)return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[v]),f.useEffect(()=>{v&&m&&z.current&&z.current.focus(),v||T("")},[v,m]);const R=C.trim()?s.filter(M=>M.label.toLowerCase().includes(C.toLowerCase())||M.description&&M.description.toLowerCase().includes(C.toLowerCase())):s,O=M=>{M.disabled||(N||k(M.value),o==null||o(M.value),w(!1))},re=M=>{M.stopPropagation(),N||k(void 0),o==null||o(void 0)};return e.jsxs("div",{ref:S,className:c("relative w-full",g),children:[t&&e.jsx("input",{type:"hidden",name:t,value:P!==void 0?String(P):""}),e.jsx(D,{label:r,error:h,helperText:b,required:p,disabled:x,focused:v,endAdornment:e.jsxs("div",{className:"flex items-center gap-1",children:[d&&P!==void 0&&!x&&e.jsx("button",{type:"button",tabIndex:-1,onClick:re,className:"size-5 flex items-center justify-center rounded text-text-subtle hover:text-text hover:bg-surface-muted transition-colors cursor-pointer",title:"Effacer",children:e.jsxs("svg",{className:"size-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),e.jsx("svg",{className:c("size-4 text-text-subtle transition-transform duration-200 pointer-events-none",v&&"rotate-180"),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),children:e.jsx("button",{type:"button",disabled:x,onClick:()=>w(M=>!M),onBlur:i,className:c("w-full h-11 px-3.5 flex items-center justify-start text-start bg-transparent text-sm outline-none cursor-pointer border-0 ring-0",x&&"cursor-not-allowed text-text-subtle",y),children:E?e.jsxs("span",{className:"flex items-center gap-2 truncate text-text font-normal",children:[E.icon&&e.jsx("span",{className:"shrink-0 text-text-muted",children:E.icon}),e.jsx("span",{className:"truncate",children:E.label})]}):e.jsx("span",{className:"text-text-subtle/80 truncate",children:l})})}),v&&e.jsxs("div",{className:"absolute top-[calc(100%+4px)] start-0 z-50 w-full rounded-lg border border-border bg-white p-1.5 shadow-none max-h-72 overflow-y-auto animate-in fade-in-50 zoom-in-95",children:[m&&e.jsx("div",{className:"p-1 pb-1.5 border-b border-border mb-1",children:e.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5 bg-surface-muted rounded-md text-xs",children:[e.jsxs("svg",{className:"size-3.5 text-text-subtle shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),e.jsx("input",{ref:z,type:"text",value:C,onChange:M=>T(M.target.value),placeholder:u,className:"w-full bg-transparent text-text outline-none placeholder:text-text-subtle text-sm"}),C&&e.jsx("button",{type:"button",onClick:()=>T(""),className:"size-3.5 text-text-subtle hover:text-text cursor-pointer",children:"×"})]})}),e.jsx("div",{className:"space-y-0.5",children:R.length===0?e.jsx("div",{className:"py-4 text-center text-sm text-text-muted",children:"Aucun résultat trouvé"}):R.map(M=>{const H=M.value===P;return e.jsxs("button",{type:"button",disabled:M.disabled,onClick:()=>O(M),className:c("w-full flex items-center justify-between gap-2 px-3 py-2 rounded-md text-sm text-start transition-colors cursor-pointer",H?"bg-primary-soft text-primary font-medium":"text-text hover:bg-surface-muted",M.disabled&&"opacity-40 cursor-not-allowed hover:bg-transparent"),children:[e.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[M.icon&&e.jsx("span",{className:"shrink-0 text-text-muted",children:M.icon}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate font-medium",children:M.label}),M.description&&e.jsx("div",{className:"text-xs text-text-muted truncate mt-0.5",children:M.description})]})]}),H&&e.jsx("svg",{className:"size-4 text-primary shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})})]},String(M.value))})})]})]})}const Nr=f.forwardRef(({label:t="Sélection",options:r,error:s,helperText:n,placeholder:a="Choisir...",disabled:o,required:i,className:l,children:m,...u},d)=>e.jsx(D,{label:t,error:s,helperText:n,required:i,disabled:o,endAdornment:e.jsx("svg",{className:"size-4 text-text-subtle pointer-events-none",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("polyline",{points:"6 9 12 15 18 9"})}),children:e.jsxs("select",{ref:d,disabled:o,className:c("w-full h-11 ps-3.5 pe-8 bg-transparent text-sm text-text outline-none appearance-none cursor-pointer border-0 border-none ring-0 shadow-none focus:ring-0 focus:outline-none focus:border-0",l),...u,children:[a&&e.jsx("option",{value:"",children:a}),r.map(h=>e.jsx("option",{value:h.value,children:h.label},h.value)),m]})}));Nr.displayName="GymatraSelectField";function pn({label:t="Sélection multiple",options:r,value:s=[],onChange:n,error:a,helperText:o,placeholder:i="Sélectionner...",disabled:l,required:m}){const[u,d]=f.useState(!1),h=f.useRef(null);f.useEffect(()=>{const x=y=>{h.current&&!h.current.contains(y.target)&&d(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[]);const b=x=>{s.includes(x)?n==null||n(s.filter(y=>y!==x)):n==null||n([...s,x])},p=r.filter(x=>s.includes(x.value));return e.jsxs("div",{ref:h,className:"relative w-full",children:[e.jsx(D,{label:t,error:a,helperText:o,required:m,disabled:l,focused:u,endAdornment:e.jsx("svg",{className:c("size-4 text-text-subtle transition-transform",u&&"rotate-180"),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("polyline",{points:"6 9 12 15 18 9"})}),children:e.jsx("button",{type:"button",disabled:l,onClick:()=>d(!u),className:"w-full min-h-11 py-2 px-3.5 flex flex-wrap items-center gap-1.5 text-left text-sm text-text outline-none cursor-pointer",children:p.length===0?e.jsx("span",{className:"text-text-subtle",children:i}):p.map(x=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-surface-muted px-2 py-0.5 text-xs font-medium text-text border border-border",children:[x.label,e.jsx("span",{role:"button",tabIndex:0,onClick:y=>{y.stopPropagation(),b(x.value)},className:"text-text-muted hover:text-text cursor-pointer",children:"×"})]},x.value))})}),u&&e.jsx("div",{className:"absolute top-[calc(100%+4px)] start-0 z-50 w-full rounded-md border border-border bg-white p-1.5 shadow-none max-h-56 overflow-y-auto",children:r.map(x=>{const y=s.includes(x.value);return e.jsxs("div",{onClick:()=>b(x.value),className:c("flex items-center justify-between px-2.5 py-1.5 rounded text-sm cursor-pointer transition-colors",y?"bg-primary-soft text-primary font-medium":"text-text hover:bg-surface-muted"),children:[e.jsx("span",{children:x.label}),y&&e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"size-4 text-primary","aria-hidden":"true",children:e.jsx("path",{d:"M20 6 9 17l-5-5"})})]},x.value)})})]})}function fn({label:t="Autocomplétion",suggestions:r,value:s="",onChange:n,placeholder:a="Commencez à taper...",error:o,helperText:i}){const[l,m]=f.useState(!1),[u,d]=f.useState(s),h=f.useRef(null),b=s!==void 0?s:u,p=r.filter(x=>x.toLowerCase().includes(b.toLowerCase())&&x.toLowerCase()!==b.toLowerCase());return f.useEffect(()=>{const x=y=>{h.current&&!h.current.contains(y.target)&&m(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[]),e.jsxs("div",{ref:h,className:"relative w-full",children:[e.jsx(D,{label:t,error:o,helperText:i,focused:l&&p.length>0,children:e.jsx("input",{type:"text",value:b,placeholder:a,onFocus:()=>m(!0),onChange:x=>{const y=x.target.value;d(y),n==null||n(y),m(!0)},className:"w-full h-11 px-3.5 bg-transparent text-sm text-text placeholder:text-text-subtle outline-none border-0 border-none ring-0 shadow-none focus:ring-0 focus:outline-none focus:border-0"})}),l&&p.length>0&&e.jsx("div",{className:"absolute top-[calc(100%+4px)] start-0 z-50 w-full rounded-md border border-border bg-white p-1 shadow-none max-h-48 overflow-y-auto",children:p.map((x,y)=>e.jsx("div",{onClick:()=>{d(x),n==null||n(x),m(!1)},className:"px-3 py-2 rounded text-sm text-text hover:bg-surface-muted cursor-pointer transition-colors",children:x},y))})]})}const hn=ke.Switch.Root,bn=ke.Switch.Thumb;function yn(t="md"){switch(t){case"sm":return{track:"h-5 w-9 p-0.5",thumb:"size-4 data-[checked]:translate-x-4 rtl:data-[checked]:-translate-x-4"};case"lg":return{track:"h-7 w-13 p-0.5",thumb:"size-6 data-[checked]:translate-x-6 rtl:data-[checked]:-translate-x-6"};case"md":default:return{track:"h-6 w-11 p-0.5",thumb:"size-5 data-[checked]:translate-x-5 rtl:data-[checked]:-translate-x-5"}}}function gn(t="primary"){switch(t){case"success":return"data-[checked]:bg-success focus-visible:outline-success";case"danger":return"data-[checked]:bg-danger focus-visible:outline-danger";case"warning":return"data-[checked]:bg-warning focus-visible:outline-warning";case"primary":default:return"data-[checked]:bg-primary focus-visible:outline-primary"}}const xt=f.forwardRef(({size:t="md",variant:r="primary",label:s,description:n,labelPosition:a="right",onCheckedChange:o,onChange:i,disabled:l=!1,className:m,wrapperClassName:u,...d},h)=>{const b=yn(t),p=gn(r),x=(g,j)=>{o==null||o(g,j),i==null||i(g)},y=e.jsx(ke.Switch.Root,{ref:h,disabled:l,onCheckedChange:x,className:c("relative inline-flex shrink-0 cursor-pointer items-center rounded-full border-0 bg-text-subtle transition-colors duration-200 outline-none select-none shadow-none motion-reduce:transition-none","focus-visible:outline-2 focus-visible:outline-offset-2","data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50",b.track,p,m),...d,children:e.jsx(ke.Switch.Thumb,{className:c("pointer-events-none block rounded-full bg-white transition-transform duration-200 shadow-none translate-x-0 motion-reduce:transition-none",b.thumb)})});return!s&&!n?y:a==="left"?e.jsxs("label",{className:c("flex cursor-pointer select-none items-center justify-between gap-4 w-full",l&&"cursor-not-allowed",u),children:[e.jsxs("span",{className:"flex min-w-0 flex-col",children:[s&&e.jsx("span",{className:c("text-sm font-medium leading-tight",l?"text-text-subtle":"text-text"),children:s}),n&&e.jsx("span",{className:"mt-0.5 text-xs leading-normal text-text-muted",children:n})]}),y]}):e.jsxs("label",{className:c("inline-flex cursor-pointer select-none items-center gap-3",l&&"cursor-not-allowed",u),children:[y,e.jsxs("span",{className:"flex min-w-0 flex-col",children:[s&&e.jsx("span",{className:c("text-sm font-medium leading-tight",l?"text-text-subtle":"text-text"),children:s}),n&&e.jsx("span",{className:"mt-0.5 text-xs leading-normal text-text-muted",children:n})]})]})});xt.displayName="GymatraSwitch";function jn({label:t,boxLabel:r,description:s,error:n,helperText:a,disabled:o,className:i,...l}){return e.jsx(D,{label:t,error:n,helperText:a,disabled:o,className:i,children:e.jsx(ot,{label:r,description:s,disabled:o,invalid:!!n,wrapperClassName:"flex w-full p-3",...l})})}function vn({label:t="Options",name:r,options:s,value:n,defaultValue:a,onChange:o,direction:i="horizontal",error:l,helperText:m,disabled:u}){return e.jsx(D,{label:t,error:l,helperText:m,disabled:u,children:e.jsx("div",{className:c("p-3 w-full flex flex-wrap gap-4",i==="vertical"&&"flex-col gap-2.5"),children:s.map(d=>e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[e.jsx("input",{type:"radio",name:r,value:d.value,checked:n!==void 0?n===d.value:void 0,defaultChecked:a===d.value,onChange:()=>o==null?void 0:o(d.value),disabled:u,className:"size-4 accent-primary"}),e.jsx("span",{className:"text-sm font-medium text-text",children:d.label})]},d.value))})})}function wn({label:t,switchLabel:r,description:s,checked:n,defaultChecked:a,onChange:o,error:i,helperText:l,disabled:m}){return e.jsx(D,{label:t,error:i,helperText:l,disabled:m,children:e.jsx(xt,{label:r,description:s,labelPosition:"left",checked:n,defaultChecked:a,onChange:o,disabled:m,"aria-invalid":i?!0:void 0,wrapperClassName:"p-3"})})}function Nn({label:t,options:r,value:s,onChange:n,error:a,helperText:o}){return e.jsx(D,{label:t,error:a,helperText:o,children:e.jsx("div",{className:"flex items-center p-1.5 w-full gap-1",children:r.map(i=>e.jsx("button",{type:"button",onClick:()=>n(i.value),className:c("flex-1 h-8 rounded text-sm font-medium transition-colors cursor-pointer",s===i.value?"bg-primary text-white shadow-none":"bg-surface-muted text-text-muted hover:bg-border/60 hover:text-text"),children:i.label},i.value))})})}const kr=f.forwardRef(({label:t="Description",error:r,helperText:s,required:n,disabled:a,className:o,placeholder:i,rows:l=3,...m},u)=>e.jsx(D,{label:t,error:r,helperText:s,required:n,disabled:a,children:e.jsx("textarea",{ref:u,rows:l,disabled:a,placeholder:i||(typeof t=="string"?t:void 0),className:c("w-full p-3 bg-transparent text-sm text-text placeholder:text-text-subtle/80 outline-none resize-none",o),...m})}));kr.displayName="GymatraTextareaField";function kn({label:t="Contenu enrichi",value:r,defaultValue:s="",onChange:n,placeholder:a="Rédigez votre texte...",error:o,helperText:i,disabled:l}){const[m,u]=f.useState(s),d=r!==void 0?r:m,h=b=>{const p=`${d} [${b}]`;r===void 0&&u(p),n==null||n(p)};return e.jsx(D,{label:t,error:o,helperText:i,disabled:l,children:e.jsxs("div",{className:"flex flex-col w-full",children:[e.jsxs("div",{className:"flex items-center gap-1 border-b border-border p-2 bg-surface-muted/50",children:[e.jsx("button",{type:"button",onClick:()=>h("b"),className:"size-7 rounded text-sm font-semibold text-text hover:bg-white transition-colors",title:"Gras",children:"B"}),e.jsx("button",{type:"button",onClick:()=>h("i"),className:"size-7 rounded text-sm italic font-serif text-text hover:bg-white transition-colors",title:"Italique",children:"I"}),e.jsx("button",{type:"button",onClick:()=>h("u"),className:"size-7 rounded text-sm underline text-text hover:bg-white transition-colors",title:"Souligné",children:"U"}),e.jsx("span",{className:"h-4 w-px bg-border mx-1"}),e.jsx("button",{type:"button",onClick:()=>h("ul"),className:"size-7 rounded text-sm text-text hover:bg-white transition-colors flex items-center justify-center",title:"Liste à puces",children:e.jsxs("svg",{className:"size-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("line",{x1:"8",y1:"6",x2:"21",y2:"6"}),e.jsx("line",{x1:"8",y1:"12",x2:"21",y2:"12"}),e.jsx("line",{x1:"8",y1:"18",x2:"21",y2:"18"}),e.jsx("line",{x1:"3",y1:"6",x2:"3.01",y2:"6"}),e.jsx("line",{x1:"3",y1:"12",x2:"3.01",y2:"12"}),e.jsx("line",{x1:"3",y1:"18",x2:"3.01",y2:"18"})]})}),e.jsx("button",{type:"button",onClick:()=>h("link"),className:"size-7 rounded text-sm text-text hover:bg-white transition-colors flex items-center justify-center",title:"Lien",children:e.jsxs("svg",{className:"size-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),e.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})})]}),e.jsx("textarea",{rows:4,value:d,disabled:l,placeholder:a,onChange:b=>{r===void 0&&u(b.target.value),n==null||n(b.target.value)},className:"w-full p-3 bg-transparent text-sm text-text placeholder:text-text-subtle/80 outline-none resize-none"})]})})}function Gn({label:t="Fichiers joints",accept:r,multiple:s=!1,onFilesSelected:n,error:a,helperText:o,disabled:i}){const[l,m]=f.useState([]),u=f.useId(),d=h=>{if(!h||h.length===0)return;const b=Array.from(h);m(b.map(p=>p.name)),n==null||n(b)};return e.jsx(D,{label:t,error:a,helperText:o,disabled:i,children:e.jsxs("div",{className:"flex flex-col w-full p-3.5",children:[e.jsx("input",{id:u,type:"file",accept:r,multiple:s,disabled:i,onChange:h=>d(h.target.files),className:"hidden"}),e.jsxs("label",{htmlFor:u,className:"flex flex-col items-center justify-center border-2 border-dashed border-border rounded-md p-4 bg-surface-muted/30 hover:bg-surface-muted cursor-pointer transition-colors text-center",children:[e.jsxs("svg",{className:"size-6 text-text-subtle mb-1.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[e.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),e.jsx("polyline",{points:"17 8 12 3 7 8"}),e.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),e.jsx("span",{className:"text-sm font-medium text-primary",children:"Cliquez pour parcourir"}),e.jsx("span",{className:"text-xs text-text-muted mt-0.5",children:"ou glissez-déposez vos fichiers ici"})]}),l.length>0&&e.jsx("div",{className:"mt-2.5 flex flex-wrap gap-1.5",children:l.map((h,b)=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-surface-muted px-2 py-0.5 text-xs text-text border border-border",children:["📄 ",h]},b))})]})})}function Cn({label:t="Téléverser une image",onImageSelected:r,error:s,helperText:n,disabled:a}){const[o,i]=f.useState(null),l=f.useId(),m=u=>{const d=u==null?void 0:u[0];d&&(i(URL.createObjectURL(d)),r==null||r(d))};return e.jsx(D,{label:t,error:s,helperText:n,disabled:a,children:e.jsxs("div",{className:"flex items-center justify-between w-full p-3.5 gap-3",children:[e.jsx("input",{id:l,type:"file",accept:"image/*",disabled:a,onChange:u=>m(u.target.files),className:"hidden"}),o?e.jsxs("div",{className:"flex items-center gap-3 w-full",children:[e.jsx("img",{src:o,alt:"Aperçu",className:"size-14 rounded-md object-cover border border-border shrink-0"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("label",{htmlFor:l,className:"text-xs font-medium text-primary hover:underline cursor-pointer block",children:"Changer l'image"}),e.jsx("button",{type:"button",onClick:()=>i(null),className:"mt-1 text-xs text-danger hover:underline cursor-pointer",children:"Supprimer"})]})]}):e.jsxs("label",{htmlFor:l,className:"flex items-center gap-3 w-full cursor-pointer",children:[e.jsx("div",{className:"size-12 rounded-md bg-surface-muted border border-border flex items-center justify-center text-text-subtle shrink-0",children:e.jsxs("svg",{className:"size-6",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),e.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),e.jsx("polyline",{points:"21 15 16 10 5 21"})]})}),e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-text block",children:"Sélectionner une photo"}),e.jsx("span",{className:"text-xs text-text-muted",children:"PNG, JPG, WebP jusqu'à 5MB"})]})]})]})})}function Sn({label:t="Photo de profil",initialSrc:r,onAvatarChange:s,error:n,helperText:a,disabled:o}){const[i,l]=f.useState(r??null),m=f.useId(),u=d=>{const h=d==null?void 0:d[0];h&&(l(URL.createObjectURL(h)),s==null||s(h))};return e.jsx(D,{label:t,error:n,helperText:a,disabled:o,children:e.jsxs("div",{className:"flex items-center gap-3.5 w-full p-3.5",children:[e.jsx("input",{id:m,type:"file",accept:"image/*",disabled:o,onChange:d=>u(d.target.files),className:"hidden"}),e.jsx("div",{className:"size-12 rounded-full border border-border bg-surface-muted overflow-hidden flex items-center justify-center shrink-0",children:i?e.jsx("img",{src:i,alt:"Avatar",className:"size-full object-cover"}):e.jsx("svg",{className:"size-6 text-text-subtle",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:e.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"})})}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:m,className:"inline-flex h-8 items-center justify-center rounded-md border border-border bg-surface px-3 text-xs font-medium text-text hover:bg-surface-muted cursor-pointer transition-colors",children:"Téléverser une photo"}),e.jsx("span",{className:"text-xs text-text-muted block mt-0.5",children:"Format carré recommandé"})]})]})})}const zn=["#224086","#10B981","#EF4444","#F59E0B","#8B5CF6","#06B6D4","#1E293B"];function Gr({name:t,label:r="Couleur",value:s,defaultValue:n="#224086",onChange:a,onBlur:o,presets:i=zn,showPresets:l=!0,error:m,helperText:u,disabled:d,required:h,className:b,wrapperClassName:p}){const[x,y]=f.useState(n),g=s!==void 0?s:x,j=v=>{s===void 0&&y(v),a==null||a(v)},k=g.startsWith("#")?g.slice(1):g;return e.jsx(D,{label:r,error:m,helperText:u,required:h,disabled:d,wrapperClassName:p,className:b,startAdornment:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"relative size-6 rounded border border-border overflow-hidden cursor-pointer shrink-0 shadow-none hover:border-text-subtle transition-colors",children:[e.jsx("div",{className:"w-full h-full",style:{backgroundColor:g||"#224086"}}),e.jsx("input",{type:"color",value:g.startsWith("#")&&g.length===7?g:"#224086",disabled:d,onChange:v=>j(v.target.value.toUpperCase()),className:"absolute inset-0 opacity-0 w-full h-full cursor-pointer disabled:cursor-not-allowed","aria-label":"Choisir la couleur"})]}),e.jsx("span",{className:"text-text-muted font-mono text-sm select-none",children:"#"})]}),endAdornment:l&&i.length>0?e.jsx("div",{className:"flex items-center gap-1.5 pe-1",children:i.slice(0,7).map(v=>{const w=g.toLowerCase()===v.toLowerCase();return e.jsx("button",{type:"button",disabled:d,onClick:()=>j(v),className:c("size-4 rounded-full border transition-all cursor-pointer hover:scale-115 shrink-0",w?"ring-2 ring-primary ring-offset-1 border-white scale-110":"border-border/60 hover:border-text-subtle"),style:{backgroundColor:v},title:v,"aria-label":`Couleur ${v}`},v)})}):void 0,children:e.jsx("input",{name:t,type:"text",value:k.toUpperCase(),disabled:d,maxLength:6,onChange:v=>{const w=v.target.value.replace(/[^0-9A-Fa-f]/g,"");w.length<=6&&j(`#${w}`)},onBlur:o,placeholder:"224086",className:c("w-full h-11 ps-1 pe-2 bg-transparent text-sm font-mono text-text placeholder:text-text-subtle/80 uppercase outline-none border-0 border-none ring-0 shadow-none focus:ring-0 focus:outline-none focus:border-0","disabled:cursor-not-allowed")})})}const Pn=Gr;function Mn({label:t="Intensité",min:r=0,max:s=100,step:n=1,value:a,defaultValue:o=50,unit:i="%",onChange:l,error:m,helperText:u,disabled:d}){const[h,b]=f.useState(o),p=a!==void 0?a:h;return e.jsx(D,{label:t,error:m,helperText:u,disabled:d,children:e.jsxs("div",{className:"flex items-center gap-3 w-full p-3",children:[e.jsx("input",{type:"range",min:r,max:s,step:n,value:p,disabled:d,onChange:x=>{const y=Number(x.target.value);a===void 0&&b(y),l==null||l(y)},className:"flex-1 accent-primary cursor-pointer"}),e.jsxs("span",{className:"min-w-10 text-right text-sm font-medium text-text font-mono tabular-nums",children:[p,i]})]})})}function In({label:t="Fourchette",min:r=0,max:s=1e3,minValue:n=100,maxValue:a=600,unit:o="€",onRangeChange:i,error:l,helperText:m}){const[u,d]=f.useState(n),[h,b]=f.useState(a);return e.jsx(D,{label:t,error:l,helperText:m,children:e.jsxs("div",{className:"flex items-center justify-between w-full p-3 gap-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5 flex-1",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Min:"}),e.jsx("input",{type:"number",min:r,max:h,value:u,onChange:p=>{const x=Number(p.target.value);d(x),i==null||i(x,h)},className:"w-full h-8 px-2 rounded border border-border text-sm text-text outline-none focus:border-primary"}),e.jsx("span",{className:"text-xs text-text-muted",children:o})]}),e.jsx("span",{className:"text-text-muted",children:"—"}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-1",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Max:"}),e.jsx("input",{type:"number",min:u,max:s,value:h,onChange:p=>{const x=Number(p.target.value);b(x),i==null||i(u,x)},className:"w-full h-8 px-2 rounded border border-border text-sm text-text outline-none focus:border-primary"}),e.jsx("span",{className:"text-xs text-text-muted",children:o})]})]})})}function Tn({label:t="Code de validation (OTP)",length:r=6,value:s,onChange:n,error:a,helperText:o,disabled:i}){const l=f.useId(),[m,u]=f.useState(""),d=s!==void 0?s:m,h=(p,x)=>{x.length>1&&(x=x.slice(-1));const y=d.padEnd(r," ").split("");y[p]=x||" ";const g=y.join("").trimEnd();if(s===void 0&&u(g),n==null||n(g),x&&p<r-1){const j=document.getElementById(`${l}-otp-${p+1}`);j==null||j.focus()}},b=(p,x)=>{if(x.key==="Backspace"&&!d[p]&&p>0){const y=document.getElementById(`${l}-otp-${p-1}`);y==null||y.focus()}};return e.jsx(D,{label:t,error:a,helperText:o,disabled:i,children:e.jsx("div",{className:"flex items-center justify-between w-full p-3 gap-2",children:Array.from({length:r}).map((p,x)=>e.jsx("input",{id:`${l}-otp-${x}`,"aria-label":`Chiffre ${x+1} sur ${r}`,type:"text",inputMode:"numeric",maxLength:1,disabled:i,value:d[x]&&d[x]!==" "?d[x]:"",onChange:y=>h(x,y.target.value),onKeyDown:y=>b(x,y),className:"size-10 rounded-md border border-border bg-surface-muted text-center text-base font-semibold text-text focus:border-primary focus:bg-white focus:outline-none"},x))})})}function Me({label:t,error:r,helperText:s,required:n,disabled:a,startAdornment:o,endAdornment:i,focused:l,hasValue:m,className:u,children:d,...h}){const b=!!r;return e.jsxs("div",{className:c("relative w-full pt-2.5 pb-1",a&&"opacity-60 pointer-events-none",u),...h,children:[e.jsxs("div",{className:c("group relative flex items-center w-full min-h-11 rounded-md border bg-white transition-all",b?"border-danger focus-within:border-danger focus-within:ring-1 focus-within:ring-danger":l?"border-primary ring-1 ring-primary":"border-border hover:border-text-subtle focus-within:border-primary focus-within:ring-1 focus-within:ring-primary"),children:[e.jsxs("label",{className:c("pointer-events-none absolute -top-3 start-3 z-10 px-1.5 bg-white text-sm leading-none font-medium transition-colors select-none",b?"text-danger":l?"text-primary":"text-text-muted group-focus-within:text-primary group-hover:text-text"),children:[t,n&&e.jsx("span",{className:"ms-0.5 text-danger",children:"*"})]}),o&&e.jsx("div",{className:"flex shrink-0 items-center ps-3 text-text-muted select-none",children:o}),e.jsx("div",{className:"flex-1 min-w-0 flex items-center",children:d}),i&&e.jsx("div",{className:"flex shrink-0 items-center pe-3 text-text-muted select-none",children:i})]}),(r||s)&&e.jsx("p",{className:c("mt-1 text-xs leading-none ps-1",b?"text-danger":"text-text-muted"),children:r||s})]})}const Cr=f.forwardRef(({label:t,error:r,helperText:s,startIcon:n,endIcon:a,prefixText:o,suffixText:i,type:l="text",value:m,defaultValue:u,onChange:d,disabled:h,required:b,className:p,placeholder:x,...y},g)=>{const[j,k]=f.useState(!1),[v,w]=f.useState(u??""),C=m!==void 0,T=l==="password",S=T?j?"text":"password":l;return e.jsx(Me,{label:t,error:r,helperText:s,required:b,disabled:h,className:p,startAdornment:n||o?e.jsxs("div",{className:"flex items-center gap-1.5 text-text-muted text-sm",children:[n,o&&e.jsx("span",{className:"font-medium text-text",children:o})]}):void 0,endAdornment:T?e.jsx("button",{type:"button",tabIndex:-1,onClick:()=>k(!j),className:"text-text-muted hover:text-text cursor-pointer transition-colors","aria-label":j?"Hide password":"Show password",children:j?e.jsxs("svg",{className:"size-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),e.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}):e.jsxs("svg",{className:"size-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}):i||a?e.jsxs("div",{className:"flex items-center gap-1.5 text-text-muted text-sm",children:[i&&e.jsx("span",{className:"font-medium text-text",children:i}),a]}):void 0,children:e.jsx("input",{ref:g,type:S,value:m,defaultValue:u,onChange:z=>{C||w(z.target.value),d==null||d(z)},disabled:h,placeholder:x||(typeof t=="string"?t:void 0),className:c("w-full h-11 px-3.5 bg-transparent text-sm text-text placeholder:text-text-subtle/80 outline-none border-0 border-none ring-0 shadow-none focus:ring-0 focus:outline-none focus:border-0","disabled:cursor-not-allowed"),...y})})});Cr.displayName="GymatraTextField";const Sr=f.forwardRef(({label:t,error:r,helperText:s,required:n,disabled:a,className:o,placeholder:i,rows:l=3,...m},u)=>e.jsx(Me,{label:t,error:r,helperText:s,required:n,disabled:a,className:o,children:e.jsx("textarea",{ref:u,rows:l,disabled:a,placeholder:i||(typeof t=="string"?t:void 0),className:"w-full p-3 bg-transparent text-sm text-text placeholder:text-text-subtle/80 outline-none resize-none",...m})}));Sr.displayName="GymatraFloatingTextarea";const zr=f.forwardRef(({label:t,error:r,helperText:s,required:n,disabled:a,options:o,className:i,children:l,...m},u)=>e.jsx(Me,{label:t,error:r,helperText:s,required:n,disabled:a,className:i,endAdornment:e.jsx("svg",{className:"size-4 text-text-subtle pointer-events-none",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("polyline",{points:"6 9 12 15 18 9"})}),children:e.jsxs("select",{ref:u,disabled:a,className:"w-full h-11 ps-3.5 pe-8 bg-transparent text-sm text-text outline-none appearance-none cursor-pointer border-0 border-none ring-0 shadow-none focus:ring-0 focus:outline-none focus:border-0",...m,children:[o.map(d=>e.jsx("option",{value:d.value,children:d.label},d.value)),l]})}));zr.displayName="GymatraFloatingSelect";function Ln({length:t=6,value:r="",onChange:s,label:n="Code OTP / PIN",error:a,disabled:o}){const[i,l]=f.useState(r),m=r!==void 0?r:i,u=(h,b)=>{b.length>1&&(b=b.slice(-1));const p=m.padEnd(t," ").split("");p[h]=b||" ";const x=p.join("").trimEnd();if(r===void 0&&l(x),s==null||s(x),b&&h<t-1){const y=document.getElementById(`otp-digit-${h+1}`);y==null||y.focus()}},d=(h,b)=>{if(b.key==="Backspace"&&!m[h]&&h>0){const p=document.getElementById(`otp-digit-${h-1}`);p==null||p.focus()}};return e.jsx("div",{className:"relative",children:e.jsx(Me,{label:n,error:a,disabled:o,children:e.jsx("div",{className:"flex items-center justify-between w-full p-2.5 gap-2",children:Array.from({length:t}).map((h,b)=>e.jsx("input",{id:`otp-digit-${b}`,type:"text",inputMode:"numeric",maxLength:1,disabled:o,value:m[b]&&m[b]!==" "?m[b]:"",onChange:p=>u(b,p.target.value),onKeyDown:p=>d(b,p),className:"size-10 rounded-md border border-border bg-surface-muted text-center text-base font-semibold text-text focus:border-primary focus:bg-white focus:outline-none"},b))})})})}function Rn({label:t="Photo de profil",src:r,onChange:s,disabled:n}){const[a,o]=f.useState(r),i=f.useId(),l=m=>{var d;const u=(d=m.target.files)==null?void 0:d[0];if(u){const h=URL.createObjectURL(u);o(h),s==null||s(u)}};return e.jsxs("div",{className:"relative rounded-md border border-border p-3.5 bg-white",children:[e.jsx("label",{className:"absolute -top-2.5 start-2.5 px-1 bg-white text-xs font-medium text-text-muted",children:t}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"relative size-12 shrink-0 rounded-full border border-border overflow-hidden bg-surface-muted flex items-center justify-center text-text-muted",children:a?e.jsx("img",{src:a,alt:"Avatar preview",className:"size-full object-cover"}):e.jsx("svg",{className:"size-6",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",children:e.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"})})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("input",{id:i,type:"file",accept:"image/*",disabled:n,onChange:l,className:"hidden"}),e.jsx("label",{htmlFor:i,className:"inline-flex h-8 items-center justify-center rounded-md border border-border bg-surface px-3 text-xs font-medium text-text hover:bg-surface-muted cursor-pointer transition-colors",children:"Téléverser une image"}),e.jsx("p",{className:"mt-1 text-xs text-text-muted",children:"PNG, JPG jusqu'à 2MB"})]})]})]})}const Pr="grid min-w-0 gap-1.5 text-text",Mr="text-xs font-medium text-text-muted",Ir="ms-1 text-primary",Tr="text-xs text-text-muted",Ae="text-xs text-danger",mt="flex min-h-10 w-full items-center rounded-md border border-border bg-white px-3 text-sm text-text placeholder:text-text-subtle outline-none transition-colors hover:border-border-strong focus-visible:border-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary/30 aria-[invalid=true]:border-danger data-[invalid]:border-danger disabled:cursor-not-allowed disabled:bg-surface-muted disabled:text-text-subtle";function Bn({className:t,...r}){return e.jsx(Dt.Form,{...r,className:typeof t=="function"?s=>c("flex flex-col gap-6",t(s)):c("flex flex-col gap-6",t)})}function An({name:t,label:r,description:s,error:n,required:a,disabled:o,validate:i,validationMode:l,className:m,children:u}){return e.jsxs(V.Field.Root,{name:t,invalid:!!n,disabled:o,validate:i,validationMode:l,className:c(Pr,m),children:[e.jsxs(V.Field.Label,{className:Mr,children:[r,a&&e.jsx("span",{className:Ir,"aria-hidden":"true",children:"*"})]}),u,s&&e.jsx(V.Field.Description,{className:Tr,children:s}),n?e.jsx(V.Field.Error,{match:!0,className:Ae,children:n}):e.jsx(V.Field.Error,{match:"valueMissing",className:Ae,children:"This field is required."}),!n&&e.jsx(V.Field.Error,{match:"typeMismatch",className:Ae,children:"Enter a valid value."})]})}const Lr=f.forwardRef(({className:t,...r},s)=>e.jsx(V.Field.Control,{ref:s,render:e.jsx(Ft.Input,{}),...r,className:c(mt,t)}));Lr.displayName="GymatraInput";function Dn({rows:t=4,className:r,...s}){return e.jsx(V.Field.Control,{...s,render:e.jsx("textarea",{rows:t}),className:c(mt,"min-h-24 resize-y py-2.5",r)})}function Fn({name:t,label:r,description:s,error:n,options:a,value:o,defaultValue:i,onValueChange:l,placeholder:m="Choose an option",required:u,disabled:d,className:h}){const b=f.useId(),p=s?`${b}-description`:void 0,x=`${b}-error`;return e.jsxs(V.Field.Root,{name:t,invalid:!!n,disabled:d,className:c(Pr,h),children:[e.jsxs(V.Field.Label,{htmlFor:b,className:Mr,children:[r,u&&e.jsx("span",{className:Ir,"aria-hidden":"true",children:"*"})]}),e.jsxs(_.Select.Root,{name:t,id:b,items:a,value:o,defaultValue:i,onValueChange:l,required:u,disabled:d,children:[e.jsxs(_.Select.Trigger,{"aria-describedby":[p,x].filter(Boolean).join(" "),"aria-invalid":n?!0:void 0,className:c(mt,"cursor-pointer justify-between gap-3 text-start data-[popup-open]:border-primary"),children:[e.jsx(_.Select.Value,{placeholder:m}),e.jsx(_.Select.Icon,{"aria-hidden":"true",className:"flex text-text-muted",children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"size-4",children:e.jsx("path",{d:"m6 9 6 6 6-6"})})})]}),e.jsx(_.Select.Portal,{children:e.jsx(_.Select.Positioner,{sideOffset:4,className:"z-[10020] outline-none",children:e.jsx(_.Select.Popup,{className:"min-w-[var(--anchor-width)] overflow-hidden rounded-md border border-border bg-white p-1 text-text shadow-none outline-none",children:e.jsx(_.Select.List,{children:a.map(y=>e.jsxs(_.Select.Item,{value:y.value,className:"flex min-h-9 cursor-default items-center justify-between gap-2 rounded-sm px-2.5 text-sm text-text outline-none data-[highlighted]:bg-primary-soft data-[highlighted]:text-primary data-[selected]:font-semibold data-[selected]:text-primary",children:[e.jsx(_.Select.ItemText,{children:y.label}),e.jsx(_.Select.ItemIndicator,{className:"flex text-primary",children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"size-4","aria-hidden":"true",children:e.jsx("path",{d:"M20 6 9 17l-5-5"})})})]},y.value))})})})})]}),s&&e.jsx(V.Field.Description,{id:p,className:Tr,children:s}),e.jsx(V.Field.Error,{id:x,match:n?!0:"valueMissing",className:Ae,children:n??"Choose an option."})]})}const En=L.Menu.Root,Wn=L.Menu.Trigger,$n=L.Menu.Portal,On=L.Menu.Positioner,Rr=L.Menu.Group,Hn=L.Menu.RadioGroup,qn=L.Menu.SubmenuRoot,be=f.forwardRef(({className:t,children:r,...s},n)=>e.jsx(L.Menu.Popup,{ref:n,className:c("z-50 min-w-48 rounded-lg border border-border bg-white p-1 text-sm text-text outline-none shadow-none",t),...s,children:r}));be.displayName="GymatraMenuPopup";const $e=f.forwardRef(({variant:t="default",startIcon:r,endIcon:s,shortcut:n,className:a,children:o,...i},l)=>e.jsxs(L.Menu.Item,{ref:l,className:c("group relative flex w-full cursor-pointer select-none items-center gap-2 rounded-md px-2.5 py-1.5 text-sm outline-none transition-colors","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t==="danger"?"text-danger data-[highlighted]:bg-danger-soft data-[highlighted]:text-danger font-medium":t==="primary"?"text-primary data-[highlighted]:bg-primary-soft data-[highlighted]:text-primary font-medium":"text-text data-[highlighted]:bg-surface-muted data-[highlighted]:text-text",a),...i,children:[r&&e.jsx("span",{className:"shrink-0 size-4 text-text-muted group-data-[highlighted]:text-current flex items-center justify-center",children:r}),e.jsx("span",{className:"flex-1 truncate",children:o}),n&&e.jsx("kbd",{className:"ml-auto pl-3 font-mono text-xs text-text-muted",children:n}),s&&e.jsx("span",{className:"shrink-0 size-4 text-text-muted group-data-[highlighted]:text-current flex items-center justify-center ml-auto",children:s})]}));$e.displayName="GymatraMenuItem";const Oe=f.forwardRef(({className:t,...r},s)=>e.jsx(L.Menu.Separator,{ref:s,className:c("my-1 h-px bg-border -mx-1",t),...r}));Oe.displayName="GymatraMenuSeparator";const He=f.forwardRef(({className:t,...r},s)=>e.jsx(L.Menu.GroupLabel,{ref:s,className:c("px-2.5 py-1 text-xs font-semibold uppercase tracking-wider text-text-muted select-none",t),...r}));He.displayName="GymatraMenuGroupLabel";function Vn({className:t="size-3.5"}){return e.jsx("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})})}function Un({className:t="size-3.5"}){return e.jsx("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m9 18 6-6-6-6"})})}const qe=f.forwardRef(({className:t,children:r,shortcut:s,...n},a)=>e.jsxs(L.Menu.CheckboxItem,{ref:a,className:c("group relative flex w-full cursor-pointer select-none items-center gap-2 rounded-md px-2.5 py-1.5 text-sm text-text outline-none transition-colors","data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-surface-muted",t),...n,children:[e.jsx("span",{className:"shrink-0 size-4 flex items-center justify-center text-primary",children:e.jsx(L.Menu.CheckboxItemIndicator,{children:e.jsx(Vn,{})})}),e.jsx("span",{className:"flex-1 truncate",children:r}),s&&e.jsx("kbd",{className:"ml-auto pl-3 font-mono text-xs text-text-muted",children:s})]}));qe.displayName="GymatraMenuCheckboxItem";const Ve=f.forwardRef(({className:t,children:r,...s},n)=>e.jsxs(L.Menu.RadioItem,{ref:n,className:c("group relative flex w-full cursor-pointer select-none items-center gap-2 rounded-md px-2.5 py-1.5 text-sm text-text outline-none transition-colors","data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-surface-muted",t),...s,children:[e.jsx("span",{className:"shrink-0 size-4 flex items-center justify-center text-primary",children:e.jsx(L.Menu.RadioItemIndicator,{children:e.jsx("span",{className:"size-2 rounded-full bg-primary"})})}),e.jsx("span",{className:"flex-1 truncate",children:r})]}));Ve.displayName="GymatraMenuRadioItem";const Ue=f.forwardRef(({startIcon:t,className:r,children:s,...n},a)=>e.jsxs(L.Menu.SubmenuTrigger,{ref:a,className:c("group relative flex w-full cursor-pointer select-none items-center justify-between gap-2 rounded-md px-2.5 py-1.5 text-sm text-text outline-none transition-colors","data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-surface-muted",r),...n,children:[e.jsxs("div",{className:"flex items-center gap-2 truncate",children:[t&&e.jsx("span",{className:"shrink-0 size-4 text-text-muted group-data-[highlighted]:text-current flex items-center justify-center",children:t}),e.jsx("span",{className:"truncate",children:s})]}),e.jsx(Un,{className:"size-3.5 text-text-muted shrink-0"})]}));Ue.displayName="GymatraMenuSubmenuTrigger";function _e(t){const r=[];let s=0;for(;s<t.length;){const n=t[s];if(n.type!=="label"){r.push(Bt(n,s)),s++;continue}const a=s,o=[];for(s++;s<t.length&&t[s].type!=="label"&&t[s].type!=="separator";)o.push(Bt(t[s],s)),s++;r.push(e.jsxs(Rr,{children:[e.jsx(He,{children:n.label}),o]},n.key??`menu-group-${a}`))}return r}function Bt(t,r){const s=t.key??`menu-item-${r}`;return t.type==="separator"?e.jsx(Oe,{},s):t.type==="checkbox"?e.jsx(qe,{checked:t.checked,onCheckedChange:t.onCheckedChange,shortcut:t.shortcut,disabled:t.disabled,children:t.label},s):t.type==="radio"?e.jsx(Ve,{value:t.value??String(s),disabled:t.disabled,children:t.label},s):t.items&&t.items.length>0?e.jsxs(L.Menu.SubmenuRoot,{children:[e.jsx(Ue,{startIcon:t.startIcon??t.icon,disabled:t.disabled,children:t.label}),e.jsx(L.Menu.Portal,{children:e.jsx(L.Menu.Positioner,{sideOffset:4,align:"start",className:"z-[10020] outline-none",children:e.jsx(be,{children:_e(t.items)})})})]},s):e.jsx($e,{variant:t.variant,startIcon:t.startIcon??t.icon,endIcon:t.endIcon,shortcut:t.shortcut,disabled:t.disabled,onClick:t.onClick,children:t.label},s)}function _n({trigger:t,items:r,open:s,defaultOpen:n,onOpenChange:a,side:o="bottom",align:i="start",sideOffset:l=6,width:m="min-w-[200px]",popupClassName:u,children:d}){const h=s!==void 0?{open:s,onOpenChange:a}:n!==void 0?{defaultOpen:n,onOpenChange:a}:{onOpenChange:a};return e.jsxs(L.Menu.Root,{...h,children:[e.jsx(L.Menu.Trigger,{render:f.isValidElement(t)?t:e.jsx("button",{type:"button",children:t})}),e.jsx(L.Menu.Portal,{children:e.jsx(L.Menu.Positioner,{side:o,align:i,sideOffset:l,className:"z-[10020] outline-none",children:e.jsx(be,{className:c(m,u),children:r&&r.length>0?_e(r):d})})})]})}const Kn=Et.Menubar,Zn=L.Menu.Root,Qn=L.Menu.Portal,Yn=L.Menu.Positioner,Jn=L.Menu.Group,Xn=L.Menu.RadioGroup,ea=L.Menu.SubmenuRoot,ta=be,ra=$e,sa=Oe,na=He,aa=qe,oa=Ve,ia=Ue,pt=f.forwardRef(({className:t,startIcon:r,children:s,...n},a)=>e.jsxs(L.Menu.Trigger,{ref:a,className:c("flex cursor-pointer select-none items-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium text-text outline-none transition-colors","hover:bg-surface-muted hover:text-text","data-[popup-open]:bg-primary-soft data-[popup-open]:text-primary","focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary","data-[disabled]:opacity-50 data-[disabled]:pointer-events-none",t),...n,children:[r&&e.jsx("span",{className:"shrink-0 size-4 text-text-muted flex items-center justify-center",children:r}),e.jsx("span",{children:s})]}));pt.displayName="GymatraMenubarTrigger";const Br=f.forwardRef(({menus:t,bordered:r=!0,className:s,children:n,...a},o)=>e.jsx(Et.Menubar,{ref:o,className:c("flex items-center gap-0.5 text-sm text-text select-none",r?"rounded-md border border-border bg-white p-1 shadow-none":"bg-transparent p-0.5",s),...a,children:t&&t.length>0?t.map((i,l)=>{const m=i.key??`menubar-menu-${l}`;return e.jsxs(L.Menu.Root,{disabled:i.disabled,children:[e.jsx(pt,{startIcon:i.startIcon,disabled:i.disabled,children:i.trigger}),e.jsx(L.Menu.Portal,{children:e.jsx(L.Menu.Positioner,{side:i.side??"bottom",align:i.align??"start",sideOffset:i.sideOffset??6,className:"z-[10020] outline-none",children:e.jsx(be,{className:c(i.width??"min-w-52",i.popupClassName),children:_e(i.items)})})})]},m)}):n}));Br.displayName="GymatraMenubar";function la({className:t="size-3.5"}){return e.jsx("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m15 18-6-6 6-6"})})}function ca({className:t="size-3.5"}){return e.jsx("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m9 18 6-6-6-6"})})}function da({className:t="size-3"}){return e.jsx("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m6 9 6 6 6-6"})})}function ua({className:t="size-3"}){return e.jsx("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})})}function ft({page:t,total:r,pageSize:s,onPageChange:n,pageSizeOptions:a,onPageSizeChange:o,showSummary:i=!0,className:l,...m}){const u=Math.max(1,Math.ceil(r/s)),d=Math.min(Math.max(1,t),u),h=r===0?0:(d-1)*s+1,b=Math.min(d*s,r),[p,x]=f.useState(!1),y=f.useRef(null);f.useEffect(()=>{function k(v){y.current&&!y.current.contains(v.target)&&x(!1)}if(p)return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[p]);function g(){return u<=7?Array.from({length:u},(k,v)=>v+1):d<=4?[1,2,3,4,5,"ellipsis",u]:d>=u-3?[1,"ellipsis",u-4,u-3,u-2,u-1,u]:[1,"ellipsis",d-1,d,d+1,"ellipsis",u]}const j=g();return e.jsxs("div",{className:c("flex flex-wrap items-center justify-between gap-3 pt-3 px-1 text-sm text-text-muted",l),...m,children:[e.jsxs("div",{className:"flex items-center gap-2 text-text-muted text-sm",children:[i&&e.jsxs("span",{children:["Display ",h," to ",b," of ",r]}),a&&a.length>0&&o&&e.jsxs("div",{ref:y,className:"relative inline-block text-left",children:[e.jsxs("button",{type:"button",onClick:()=>x(k=>!k),"aria-haspopup":"listbox","aria-expanded":p,"aria-label":`Rows per page: ${s}`,className:c("inline-flex h-7 items-center justify-between gap-2 rounded-md border border-border bg-white px-2.5 text-sm text-text cursor-pointer transition-colors outline-none","hover:border-border-strong hover:bg-surface/50","focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary",p&&"border-primary bg-primary-soft/30 text-primary"),children:[e.jsx("span",{children:s}),e.jsx("span",{className:c("text-text-subtle transition-transform duration-150 flex items-center",p&&"rotate-180 text-primary"),"aria-hidden":"true",children:e.jsx(da,{})})]}),p&&e.jsx("div",{role:"listbox","aria-label":"Rows per page",className:"absolute left-0 bottom-full z-50 mb-1 min-w-[75px] rounded-lg border border-border bg-white p-1 shadow-none focus:outline-none",children:a.map(k=>{const v=k===s;return e.jsxs("button",{type:"button",role:"option","aria-selected":v,onClick:()=>{o(k),x(!1)},className:c("flex w-full items-center justify-between rounded px-2 py-1 text-sm text-left cursor-pointer transition-colors outline-none","hover:bg-surface hover:text-text",v?"bg-primary-soft/40 text-primary font-medium":"text-text font-normal"),children:[e.jsx("span",{children:k}),v&&e.jsx("span",{className:"text-primary","aria-hidden":"true",children:e.jsx(ua,{})})]},k)})})]})]}),e.jsxs("div",{className:"flex items-center gap-1 ms-auto",children:[e.jsx("button",{type:"button",disabled:d<=1,onClick:()=>n(d-1),"aria-label":"Previous page",className:"flex size-7 items-center justify-center rounded-full text-text-muted hover:text-text hover:bg-surface disabled:pointer-events-none disabled:opacity-30 cursor-pointer transition-colors",children:e.jsx(la,{})}),j.map((k,v)=>{if(k==="ellipsis")return e.jsx("span",{className:"flex size-7 items-center justify-center text-text-subtle select-none",children:"…"},`ellipsis-${v}`);const w=k===d;return e.jsx("button",{type:"button",onClick:()=>n(k),"aria-current":w?"page":void 0,className:c("flex size-7 items-center justify-center rounded-full text-sm font-medium cursor-pointer transition-colors",w?"bg-primary text-white":"text-text hover:bg-surface"),children:k},k)}),e.jsx("button",{type:"button",disabled:d>=u,onClick:()=>n(d+1),"aria-label":"Next page",className:"flex size-7 items-center justify-center rounded-full text-text-muted hover:text-text hover:bg-surface disabled:pointer-events-none disabled:opacity-30 cursor-pointer transition-colors",children:e.jsx(ca,{})})]})]})}ft.displayName="GymatraPagination";const xa=U.Popover.Root,ma=U.Popover.Trigger,pa=U.Popover.Portal,fa=U.Popover.Positioner,ht=f.forwardRef(({className:t,children:r,...s},n)=>e.jsx(U.Popover.Popup,{ref:n,className:c("relative z-50 rounded-lg border border-border bg-white p-4 text-text outline-none shadow-none",t),...s,children:r}));ht.displayName="GymatraPopoverPopup";const bt=f.forwardRef(({className:t,...r},s)=>e.jsx(U.Popover.Title,{ref:s,className:c("text-sm font-semibold text-text",t),...r}));bt.displayName="GymatraPopoverTitle";const yt=f.forwardRef(({className:t,...r},s)=>e.jsx(U.Popover.Description,{ref:s,className:c("mt-1 text-xs leading-relaxed text-text-muted",t),...r}));yt.displayName="GymatraPopoverDescription";function ha({className:t="size-3.5"}){return e.jsx("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})}const gt=f.forwardRef(({className:t,children:r,...s},n)=>e.jsx(U.Popover.Close,{ref:n,className:c("absolute top-3 right-3 rounded-md p-1 text-text-muted hover:bg-surface-muted hover:text-text cursor-pointer transition-colors outline-none focus-visible:outline-2 focus-visible:outline-primary",t),"aria-label":"Fermer",...s,children:r??e.jsx(ha,{})}));gt.displayName="GymatraPopoverClose";const Ar=f.forwardRef(({className:t,...r},s)=>e.jsx(U.Popover.Arrow,{ref:s,className:c("fill-white stroke-border stroke-1",t),...r}));Ar.displayName="GymatraPopoverArrow";function ba({trigger:t,title:r,description:s,content:n,children:a,footer:o,side:i="bottom",align:l="center",sideOffset:m=8,width:u="w-80",showCloseButton:d=!0,open:h,defaultOpen:b,onOpenChange:p,modal:x=!1,popupClassName:y}){const g=h!==void 0?{open:h,onOpenChange:p,modal:x}:b!==void 0?{defaultOpen:b,onOpenChange:p,modal:x}:{onOpenChange:p,modal:x};return e.jsxs(U.Popover.Root,{...g,children:[e.jsx(U.Popover.Trigger,{render:f.isValidElement(t)?t:e.jsx("button",{type:"button",children:t})}),e.jsx(U.Popover.Portal,{children:e.jsx(U.Popover.Positioner,{side:i,align:l,sideOffset:m,className:"z-[10020] outline-none",children:e.jsxs(ht,{className:c(u,y),children:[d&&e.jsx(gt,{}),(r||s)&&e.jsxs("div",{className:c("space-y-1",d?"pr-6":void 0),children:[r&&e.jsx(bt,{children:r}),s&&e.jsx(yt,{children:s})]}),(n||a)&&e.jsx("div",{className:c(r||s?"mt-3":void 0),children:n??a}),o&&e.jsx("div",{className:"mt-4 pt-3 border-t border-border flex items-center justify-end gap-2",children:o})]})})})]})}const ya=ee.Progress.Root,ga=ee.Progress.Track,ja=ee.Progress.Indicator,va=ee.Progress.Label,wa=ee.Progress.Value,Na={primary:"bg-primary",success:"bg-success",warning:"bg-warning",danger:"bg-danger",info:"bg-info"},ka={xs:"h-1",sm:"h-1.5",md:"h-2",lg:"h-3"},Ga={pill:"rounded-full",rounded:"rounded-md",square:"rounded-none"};function Ca({value:t,min:r=0,max:s=100,label:n,description:a,showValue:o=!0,formatValue:i,variant:l="primary",size:m="md",shape:u="pill",className:d,trackClassName:h,indicatorClassName:b}){const p=t===null,x=Ga[u],y=t!==null?Math.round((t-r)/(s-r)*100):0;return e.jsxs(ee.Progress.Root,{value:t,min:r,max:s,className:c("w-full space-y-1.5",d),children:[(n||o)&&e.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs font-medium",children:[e.jsxs("div",{className:"space-y-0.5 min-w-0",children:[n&&e.jsx(ee.Progress.Label,{className:"text-text font-medium truncate",children:n}),a&&e.jsx("p",{className:"text-xs text-text-muted",children:a})]}),o&&!p&&e.jsx("span",{className:"text-text-muted font-mono font-medium shrink-0 ml-auto",children:i?i(t):`${y}%`})]}),e.jsx(ee.Progress.Track,{className:c("relative w-full overflow-hidden bg-surface-muted",ka[m],x,h),children:e.jsx(ee.Progress.Indicator,{className:c("h-full transition-all duration-300 ease-out",Na[l],x,p&&"w-1/3 animate-[indeterminate_1.5s_infinite_ease-in-out]",b)})})]})}const Sa={primary:"text-primary",success:"text-success",warning:"text-warning",danger:"text-danger",info:"text-info"};function za({value:t,size:r=80,strokeWidth:s=8,variant:n="primary",children:a,className:o,showValue:i=!0}){const l=Math.min(100,Math.max(0,t)),m=(r-s)/2,u=2*Math.PI*m,d=u-l/100*u;return e.jsxs("div",{className:c("relative inline-flex items-center justify-center shrink-0",o),style:{width:r,height:r},role:"progressbar","aria-valuenow":l,"aria-valuemin":0,"aria-valuemax":100,children:[e.jsxs("svg",{className:"-rotate-90 origin-center",width:r,height:r,viewBox:`0 0 ${r} ${r}`,children:[e.jsx("circle",{className:"text-surface-muted",strokeWidth:s,stroke:"currentColor",fill:"transparent",r:m,cx:r/2,cy:r/2}),e.jsx("circle",{className:c(Sa[n],"transition-all duration-500 ease-out"),strokeWidth:s,strokeDasharray:u,strokeDashoffset:d,strokeLinecap:"round",stroke:"currentColor",fill:"transparent",r:m,cx:r/2,cy:r/2})]}),e.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-center p-1",children:a??(i&&e.jsxs("span",{className:"text-xs font-medium font-mono tabular-nums text-text",children:[Math.round(l),"%"]}))})]})}const Pa=Wt.Separator,Dr=f.forwardRef(({orientation:t="horizontal",variant:r="default",decorative:s=!0,label:n,children:a,labelPosition:o="center",className:i,...l},m)=>{const u=t==="horizontal",d=n??a,h=()=>{switch(r){case"subtle":return u?"h-px w-full bg-border/50":"w-px h-full min-h-[1rem] bg-border/50 self-stretch";case"primary":return u?"h-px w-full bg-primary/40":"w-px h-full min-h-[1rem] bg-primary/40 self-stretch";case"dashed":return u?"h-0 w-full border-t border-dashed border-border":"w-0 h-full min-h-[1rem] border-s border-dashed border-border self-stretch";case"dotted":return u?"h-0 w-full border-t border-dotted border-border":"w-0 h-full min-h-[1rem] border-s border-dotted border-border self-stretch";case"default":default:return u?"h-px w-full bg-border":"w-px h-full min-h-[1rem] bg-border self-stretch"}};if(u&&d){const b=h();return e.jsxs("div",{ref:m,role:s?"none":"separator","aria-orientation":"horizontal",className:c("flex w-full items-center select-none text-xs font-medium text-text-muted",i),...l,children:[e.jsx("div",{className:c(o==="start"?"w-6 shrink-0":"flex-1",b)}),e.jsx("span",{className:"px-3 shrink-0 flex items-center gap-1.5",children:d}),e.jsx("div",{className:c(o==="end"?"w-6 shrink-0":"flex-1",b)})]})}return e.jsx(Wt.Separator,{ref:m,orientation:t,role:s?"none":"separator",className:c("shrink-0",h(),i),...l})});Dr.displayName="GymatraSeparator";const Ma={primary:"bg-primary-soft text-primary",success:"bg-success-soft text-success",warning:"bg-warning-soft text-warning",danger:"bg-danger-soft text-danger",info:"bg-info-soft text-info",neutral:"bg-surface-muted text-text-muted"},Ia={primary:"text-primary",success:"text-success",warning:"text-warning",danger:"text-danger",info:"text-info",neutral:"text-text-muted"},Ta={outline:"border border-border bg-white",soft:"bg-surface-muted"},Ye={good:"text-success",bad:"text-danger",flat:"text-text-muted"},At={up:"En hausse",down:"En baisse",flat:"Stable"};function Fr({direction:t,className:r}){return e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",className:r,"aria-hidden":"true",children:[t==="up"&&e.jsx("path",{d:"M7 17 17 7M9 7h8v8"}),t==="down"&&e.jsx("path",{d:"M7 7l10 10M17 9v8H9"}),t==="flat"&&e.jsx("path",{d:"M6 12h12"})]})}function La({direction:t}){return t==="flat"?e.jsx(Fr,{direction:"flat",className:"size-3"}):e.jsx("svg",{viewBox:"0 0 10 10",className:"size-2",fill:"currentColor","aria-hidden":"true",children:t==="up"?e.jsx("path",{d:"M5 1 9.5 9h-9z"}):e.jsx("path",{d:"M5 9 .5 1h9z"})})}function Ra({progress:t}){const s=2*Math.PI*6.5,n=Math.max(0,Math.min(100,t));return e.jsxs("svg",{viewBox:"0 0 16 16",className:"size-4 -rotate-90","aria-hidden":"true",children:[e.jsx("circle",{cx:"8",cy:"8",r:6.5,fill:"none",strokeWidth:"2",className:"stroke-border"}),e.jsx("circle",{cx:"8",cy:"8",r:6.5,fill:"none",strokeWidth:"2",strokeLinecap:"round",className:"stroke-primary",strokeDasharray:`${n/100*s} ${s}`})]})}const Er=Ge.forwardRef(({label:t,unit:r,description:s,icon:n,tone:a="primary",value:o,caption:i,trend:l,trendPlacement:m="below",chart:u,secondary:d,action:h,variant:b="outline",loading:p=!1,className:x,...y},g)=>{const j=l?l.direction==="flat"?"flat":l.direction===(l.positive??"up")?"good":"bad":"flat",k=l&&m==="inline"&&e.jsxs("span",{className:c("inline-flex items-center gap-1 text-xs font-medium tabular-nums",Ye[j]),children:[e.jsx(La,{direction:l.direction}),e.jsxs("span",{className:"sr-only",children:[At[l.direction]," :"]}),l.value]}),v=l&&m==="below"&&e.jsxs("p",{className:"mt-2 flex items-center gap-1.5 text-xs text-text-muted",children:[e.jsx("span",{className:c("flex size-4 shrink-0 items-center justify-center rounded-sm border border-current",Ye[j]),children:e.jsx(Fr,{direction:l.direction,className:"size-2.5"})}),e.jsxs("span",{className:"sr-only",children:[At[l.direction]," :"]}),e.jsx("span",{className:c("font-medium tabular-nums",Ye[j]),children:l.value}),l.label&&e.jsx("span",{className:"truncate",children:l.label})]});return e.jsxs("div",{ref:g,"aria-busy":p||void 0,className:c("flex min-w-0 flex-col gap-3 rounded-lg px-4 py-3.5",Ta[b],x),...y,children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[n&&e.jsx("span",{"aria-hidden":"true",className:c("flex size-10 shrink-0 items-center justify-center rounded-lg [&>img]:size-6 [&>svg]:size-5",Ma[a]),children:n}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("p",{className:"truncate text-sm font-medium text-text",children:[t,r&&e.jsxs("span",{className:"font-normal text-text-muted",children:[" ",r]})]}),s&&e.jsx("p",{className:"truncate text-xs text-text-muted",children:s})]})]}),h&&e.jsx("div",{className:"shrink-0 text-xs",children:h})]}),e.jsxs("div",{className:"flex items-end justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[p?e.jsx("span",{className:"block h-8 w-24 animate-pulse rounded-md bg-border/60 motion-reduce:animate-none"}):e.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-1",children:[e.jsx("p",{className:"text-2xl font-semibold tabular-nums text-text",children:o}),k]}),i&&e.jsx("p",{className:"mt-1 truncate text-xs text-text-muted",children:i}),!p&&v]}),u&&!p&&e.jsx("div",{className:c("h-12 w-28 shrink-0",Ia[a]),children:u}),d&&!p&&e.jsxs("div",{className:"shrink-0 text-end",children:[e.jsxs("p",{className:"flex items-center justify-end gap-1.5 text-sm font-medium tabular-nums text-text",children:[typeof d.progress=="number"&&e.jsx(Ra,{progress:d.progress}),d.value]}),e.jsx("p",{className:"mt-1 text-xs text-text-muted",children:d.label})]})]})]})});Er.displayName="GymatraStatCard";function Ba({data:t,highlightIndex:r,highlightLabel:s,label:n,className:a,...o}){const m=s?18:4,u=45,d=t.length>=2?t:[t[0]??0,t[0]??0],h=Math.min(...d),p=Math.max(...d)-h||1,x=d.map((v,w)=>({x:w/(d.length-1)*108+2,y:u-(v-h)/p*(u-m)}));let y=`M ${x[0].x} ${x[0].y}`;for(let v=1;v<x.length;v++){const w=x[v-1],C=x[v],T=(w.x+C.x)/2;y+=` Q ${w.x} ${w.y} ${T} ${(w.y+C.y)/2} T ${C.x} ${C.y}`}const g=`${y} L ${x[x.length-1].x} 48 L ${x[0].x} 48 Z`,j=r===void 0?x.length-1:r,k=j!==null&&x[j]?x[j]:null;return e.jsxs("svg",{viewBox:"0 0 112 48",className:c("size-full overflow-visible",a),role:n?"img":void 0,"aria-label":n,"aria-hidden":n?void 0:!0,...o,children:[e.jsx("path",{d:g,fill:"currentColor",fillOpacity:"0.08",stroke:"none"}),e.jsx("path",{d:y,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"}),k&&e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:k.x,x2:k.x,y1:k.y,y2:48,stroke:"currentColor",strokeOpacity:"0.25",strokeWidth:"1",vectorEffect:"non-scaling-stroke"}),e.jsx("circle",{cx:k.x,cy:k.y,r:"3.5",fill:"currentColor",stroke:"white",strokeWidth:"2"}),s&&e.jsx("text",{x:k.x,y:k.y-7,textAnchor:"middle",className:"fill-text text-xs font-medium",children:s})]})]})}const me=f.createContext(null);function Wr(){const t=f.useContext(me);if(!t)throw new Error("useGymatraStepper must be used within a GymatraStepper");return t}function $r({className:t}){return e.jsx("svg",{className:c("size-3.5",t),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})})}function Aa({className:t}){return e.jsxs("svg",{className:c("size-3.5",t),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),e.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})}function Da({steps:t,currentStep:r,activeStep:s,orientation:n="horizontal",variant:a="numbered",layout:o="inline",size:i="md",clickable:l=!1,allowStepAdvance:m=!1,onStepClick:u,className:d,children:h,...b}){const p=r??s??0,x=t?t.length:f.Children.count(h),y={currentStep:p,orientation:n,variant:a,size:i,layout:o,clickable:l,allowStepAdvance:m,onStepClick:u,totalSteps:x};return n==="vertical"?e.jsx(me.Provider,{value:y,children:e.jsx("div",{role:"navigation","aria-label":"Progress Stepper",className:c("w-full flex flex-col",d),...b,children:t?t.map((g,j)=>{const k=j===t.length-1,v=g.status??(j<p?"complete":j===p?"current":"upcoming");return e.jsx(Or,{stepIndex:j,status:v,title:g.title,description:g.description,icon:g.icon,completedIcon:g.completedIcon,errorIcon:g.errorIcon,optional:g.optional,disabled:g.disabled,badge:g.badge,isLast:k},g.id??j)}):h})}):t&&a==="pills"&&n==="horizontal"?e.jsx(me.Provider,{value:y,children:e.jsx("nav",{role:"navigation","aria-label":"Progress Stepper",className:c("w-full text-text",d),...b,children:e.jsx("ol",{className:"flex flex-wrap items-center gap-2 sm:gap-2.5 w-full",children:t.map((g,j)=>{const k=j===t.length-1,v=g.status??(j<p?"complete":j===p?"current":"upcoming"),w=v==="complete",C=v==="current",T=v==="error",S=l&&!g.disabled&&(m||w||C),z=()=>{S&&u&&u(j,g)};return e.jsxs("li",{className:"inline-flex items-center gap-2",children:[e.jsxs("button",{type:"button",disabled:!S||g.disabled,onClick:z,"aria-current":C?"step":void 0,className:c("inline-flex items-center gap-2 px-3 py-1.5 rounded-full text-xs transition-all outline-none",C?"bg-primary text-white font-medium ring-2 ring-primary/25":w?"bg-primary-soft text-primary font-medium hover:bg-primary-soft/80":T?"bg-danger-soft text-danger border border-danger/30 font-medium":"bg-surface-muted text-text-muted font-normal hover:text-text",S&&"cursor-pointer focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2",!S&&"cursor-default",g.disabled&&"opacity-50 pointer-events-none"),children:[e.jsx("span",{className:c("flex size-4 items-center justify-center rounded-full text-xs font-medium shrink-0",C?"bg-white/20 text-white":w?"bg-primary text-white":T?"bg-danger text-white":"bg-border text-text-muted"),children:w?e.jsx($r,{className:"size-2.5"}):j+1}),e.jsx("span",{className:"truncate",children:g.title})]}),!k&&e.jsx("span",{className:"text-text-subtle text-xs select-none","aria-hidden":"true",children:"/"})]},g.id??j)})})})}):t&&n==="horizontal"&&o==="centered"?e.jsx(me.Provider,{value:y,children:e.jsx("nav",{role:"navigation","aria-label":"Progress Stepper",className:c("w-full text-text",d),...b,children:e.jsx("ol",{className:"flex items-start justify-between w-full",children:t.map((g,j)=>{const k=j===0,v=j===t.length-1,w=g.status??(j<p?"complete":j===p?"current":"upcoming"),C=w==="complete",T=w==="current",S=l&&!g.disabled&&(m||C||T),z=()=>{S&&u&&u(j,g)},N=P=>{S&&(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),z())};return e.jsxs("li",{className:"relative flex-1 flex flex-col items-center text-center group",children:[!k&&e.jsx("div",{"aria-hidden":"true",className:"absolute top-4 -translate-y-1/2 left-0 right-1/2 h-0.5 bg-border -z-0",children:e.jsx("div",{className:c("h-full transition-all duration-300",j<=p?"bg-primary":"bg-transparent")})}),!v&&e.jsx("div",{"aria-hidden":"true",className:"absolute top-4 -translate-y-1/2 left-1/2 right-0 h-0.5 bg-border -z-0",children:e.jsx("div",{className:c("h-full transition-all duration-300",j<p?"bg-primary":"bg-transparent")})}),e.jsxs("div",{role:S?"button":void 0,tabIndex:S?0:void 0,onClick:S?z:void 0,onKeyDown:S?N:void 0,"aria-current":T?"step":void 0,className:c("relative z-10 flex flex-col items-center outline-none group rounded-lg p-1 transition-colors",S&&"cursor-pointer hover:bg-surface-muted/40 focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2",g.disabled&&"opacity-50 pointer-events-none"),children:[e.jsx("div",{className:"bg-white rounded-full p-0.5 ring-4 ring-white",children:e.jsx(Se,{stepIndex:j,status:w,icon:g.icon,completedIcon:g.completedIcon,errorIcon:g.errorIcon,variant:a,size:i})}),e.jsxs("div",{className:"mt-2 flex flex-col items-center max-w-[140px]",children:[e.jsx("span",{className:c("text-xs leading-tight transition-colors",T?"text-primary font-medium":C?"text-text font-medium":w==="error"?"text-danger font-medium":"text-text-muted"),children:g.title}),g.description&&e.jsx("span",{className:"text-xs text-text-muted mt-0.5 hidden sm:block truncate w-full",children:g.description}),g.badge&&e.jsx("span",{className:"mt-1",children:g.badge})]})]})]},g.id??j)})})})}):t&&n==="horizontal"?e.jsx(me.Provider,{value:y,children:e.jsx("nav",{role:"navigation","aria-label":"Progress Stepper",className:c("w-full text-text",d),...b,children:e.jsx("ol",{className:"flex items-center w-full",children:t.map((g,j)=>{const k=j===t.length-1,v=g.status??(j<p?"complete":j===p?"current":"upcoming"),w=v==="complete",C=v==="current",T=v==="error",S=l&&!g.disabled&&(m||w||C),z=()=>{S&&u&&u(j,g)},N=P=>{S&&(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),z())};return e.jsxs("li",{className:c("flex items-center min-w-0",k?"flex-none":"flex-1"),children:[e.jsxs("div",{role:S?"button":void 0,tabIndex:S?0:void 0,onClick:S?z:void 0,onKeyDown:S?N:void 0,"aria-current":C?"step":void 0,className:c("flex items-center gap-2.5 sm:gap-3 shrink-0 rounded-lg outline-none transition-colors p-1 -m-1",S&&"cursor-pointer hover:bg-surface-muted/50 focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2",g.disabled&&"opacity-50 pointer-events-none"),children:[e.jsx(Se,{stepIndex:j,status:v,icon:g.icon,completedIcon:g.completedIcon,errorIcon:g.errorIcon,variant:a,size:i}),e.jsxs("div",{className:"flex flex-col text-start min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.jsx("span",{className:c("leading-tight truncate transition-colors",i==="sm"?"text-xs":i==="lg"?"text-base":"text-sm",C?"text-primary font-medium":w?"text-text font-medium":T?"text-danger font-medium":"text-text-muted font-normal"),children:g.title}),g.optional&&e.jsx("span",{className:"text-xs text-text-muted font-normal",children:"(Facultatif)"}),g.badge&&e.jsx("span",{children:g.badge})]}),g.description&&e.jsx("span",{className:"text-text-muted leading-tight mt-0.5 truncate hidden md:inline-block text-xs",children:g.description})]})]}),!k&&e.jsx("div",{"aria-hidden":"true",className:"flex-1 mx-2 sm:mx-4 h-0.5 min-w-3 sm:min-w-6 bg-border relative overflow-hidden rounded-full shrink",children:e.jsx("div",{className:c("h-full w-full transition-all duration-300",j<p?"bg-primary":"bg-transparent")})})]},g.id??j)})})})}):e.jsx(me.Provider,{value:y,children:e.jsx("div",{role:"navigation","aria-label":"Progress Stepper",className:c("w-full text-text",n==="horizontal"?"flex flex-row items-start justify-between":"flex flex-col space-y-0",d),...b,children:h})})}function Or({stepIndex:t=0,status:r,title:s,description:n,icon:a,completedIcon:o,errorIcon:i,optional:l,disabled:m,badge:u,isLast:d=!1,className:h,children:b,...p}){const{currentStep:x,orientation:y,variant:g,size:j,clickable:k,allowStepAdvance:v,onStepClick:w}=Wr(),C=r??(t<x?"complete":t===x?"current":"upcoming"),T=C==="complete",S=C==="current",z=C==="error",N=k&&!m&&(v||T||S),P=()=>{N&&w&&w(t)},E=R=>{N&&(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),P())};return y==="vertical"?e.jsxs("div",{className:c("relative flex items-stretch gap-3.5 group",m&&"opacity-50 pointer-events-none",h),...p,children:[e.jsxs("div",{className:"flex flex-col items-center shrink-0",children:[e.jsx("div",{role:N?"button":void 0,tabIndex:N?0:void 0,onClick:N?P:void 0,onKeyDown:N?E:void 0,"aria-current":S?"step":void 0,className:c("rounded-full outline-none transition-transform",N&&"cursor-pointer hover:scale-105 focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2"),children:e.jsx(Se,{stepIndex:t,status:C,icon:a,completedIcon:o,errorIcon:i,variant:g,size:j})}),!d&&e.jsx("div",{className:c("w-0.5 flex-1 my-1.5 transition-colors duration-200 min-h-7",T?"bg-primary":"bg-border"),"aria-hidden":"true"})]}),e.jsxs("div",{className:c("flex-1 min-w-0 pb-6",d&&"pb-1"),children:[e.jsxs("div",{role:N?"button":void 0,tabIndex:N?0:void 0,onClick:N?P:void 0,onKeyDown:N?E:void 0,className:c("flex flex-col outline-none rounded-md",N&&"cursor-pointer"),children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:c("leading-tight transition-colors",j==="sm"?"text-xs":j==="lg"?"text-base":"text-sm",S?"text-primary font-medium":T?"text-text font-medium":z?"text-danger font-medium":"text-text-muted font-normal"),children:s}),l&&e.jsx("span",{className:"text-xs text-text-muted font-normal",children:"(Facultatif)"}),u&&e.jsx("span",{children:u})]}),n&&e.jsx("p",{className:"text-xs text-text-muted mt-0.5 leading-relaxed",children:n})]}),b&&e.jsx("div",{className:"mt-2.5",children:b})]})]}):e.jsx("div",{className:c("group relative flex flex-col items-center flex-1 text-center sm:flex-row sm:items-start sm:text-start",m&&"opacity-50 pointer-events-none",h),...p,children:e.jsxs("div",{role:N?"button":void 0,tabIndex:N?0:void 0,onClick:N?P:void 0,onKeyDown:N?E:void 0,"aria-current":S?"step":void 0,className:c("flex items-start gap-3 rounded-lg transition-colors outline-none flex-col sm:flex-row items-center sm:items-start",N&&"cursor-pointer p-1.5 -m-1.5 rounded-md hover:bg-surface-muted/70 focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2"),children:[e.jsx(Se,{stepIndex:t,status:C,icon:a,completedIcon:o,errorIcon:i,variant:g,size:j}),(s||n||b)&&e.jsxs("div",{className:"min-w-0 flex flex-col items-center sm:items-start",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s&&e.jsx("span",{className:c("leading-tight truncate transition-colors",j==="sm"?"text-xs":j==="lg"?"text-base":"text-sm",S?"text-primary font-medium":T?"text-text font-medium":z?"text-danger font-medium":"text-text-muted font-normal"),children:s}),l&&e.jsx("span",{className:"text-xs text-text-muted font-normal",children:"(Facultatif)"}),u&&e.jsx("span",{children:u})]}),n&&e.jsx("p",{className:"text-text-muted leading-relaxed mt-0.5 text-xs",children:n}),b]})]})})}function Se({stepIndex:t,status:r,icon:s,completedIcon:n,errorIcon:a,variant:o="numbered",size:i="md"}){const l=r==="complete",m=r==="current",u=r==="error";if(o==="dots"){const h=i==="sm"?"size-2.5":i==="lg"?"size-4":"size-3";return e.jsx("span",{"aria-hidden":"true",className:c("rounded-full shrink-0 transition-all duration-200 mt-1.5",h,l?"bg-primary":m?"bg-primary ring-4 ring-primary/25 scale-125":u?"bg-danger ring-2 ring-danger/20":"bg-border")})}const d=i==="sm"?"size-6 text-xs":i==="lg"?"size-10 text-sm":"size-8 text-xs font-medium";return e.jsx("span",{className:c("relative flex shrink-0 items-center justify-center rounded-full transition-all duration-200 select-none",d,l?"bg-primary text-white border border-primary shadow-none":m?"bg-primary text-white border border-primary ring-4 ring-primary/20 font-medium":u?"bg-danger-soft text-danger border-2 border-danger font-medium":"bg-surface-muted text-text-muted border border-border"),"aria-hidden":"true",children:l?n??e.jsx($r,{}):u?a??e.jsx(Aa,{}):o==="icons"&&s?s:e.jsx("span",{children:t+1})})}function Fa({status:t="upcoming",className:r}){const s=t==="complete";return e.jsx("div",{"aria-hidden":"true",className:c("flex-1 hidden sm:flex items-center self-start mt-4 px-2",r),children:e.jsx("div",{className:c("h-0.5 w-full transition-colors duration-200",s?"bg-primary":"bg-border")})})}function Ea({active:t=!0,className:r,children:s,...n}){return t?e.jsx("div",{className:c("text-xs text-text",r),...n,children:s}):null}function Wa({direction:t}){return e.jsxs("svg",{"aria-hidden":"true",className:"size-3.5 shrink-0",viewBox:"0 0 16 16",fill:"currentColor",children:[e.jsx("path",{d:"M5 12V4M5 4L2.5 6.5M5 4L7.5 6.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",className:t==="asc"?"text-primary opacity-100":"opacity-35"}),e.jsx("path",{d:"M11 4V12M11 12L8.5 9.5M11 12L13.5 9.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",className:t==="desc"?"text-primary opacity-100":"opacity-35"})]})}function $a({className:t="size-3.5"}){return e.jsx("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m6 9 6 6 6-6"})})}function Hr({variant:t="cards",className:r,...s}){return e.jsx("div",{className:"w-full overflow-x-auto",children:e.jsx("table",{className:c("w-full text-left text-sm",t==="cards"?"border-separate border-spacing-y-2":"border-collapse border border-border rounded-lg bg-white overflow-hidden",r),...s})})}Hr.displayName="GymatraTable";function jt({className:t,...r}){return e.jsx("thead",{className:c("text-xs font-semibold uppercase tracking-wider text-text-muted",t),...r})}jt.displayName="GymatraTableHeader";function vt({className:t,...r}){return e.jsx("tbody",{className:c("space-y-2",t),...r})}vt.displayName="GymatraTableBody";function wt({className:t,selected:r,variant:s="cards",...n}){return e.jsx("tr",{"data-selected":r,className:c("group transition-all bg-white hover:bg-surface/60","data-[selected=true]:bg-primary-soft/30",s==="cards"?"[&>td:first-child]:rounded-s-lg [&>td:last-child]:rounded-e-lg [&>td]:border-y [&>td]:border-border [&>td:first-child]:border-s [&>td:last-child]:border-e [&>td]:shadow-none":"border-b border-border last:border-b-0",t),...n})}wt.displayName="GymatraTableRow";function we({className:t,align:r="left",density:s="normal",...n}){const a=s==="compact"?"py-1.5 px-3 text-xs":s==="relaxed"?"py-3.5 px-4 text-xs":"py-2.5 px-3.5 text-xs";return e.jsx("th",{className:c("font-semibold uppercase tracking-wider text-text-muted align-middle whitespace-nowrap",a,r==="center"&&"text-center",r==="right"&&"text-right",t),...n})}we.displayName="GymatraTableHead";function Ne({className:t,align:r="left",density:s="normal",...n}){const a=s==="compact"?"py-2 px-3 text-sm":s==="relaxed"?"py-4 px-4 text-sm":"py-3 px-3.5 text-sm";return e.jsx("td",{className:c("align-middle text-text bg-inherit",a,r==="center"&&"text-center",r==="right"&&"text-right",t),...n})}Ne.displayName="GymatraTableCell";function Nt({children:t,direction:r,onSort:s,align:n="left",density:a="normal",className:o,...i}){const l=!!r,m=a==="compact"?"py-1.5 px-3 text-xs":a==="relaxed"?"py-3.5 px-4 text-xs":"py-2.5 px-3.5 text-xs";return e.jsx("th",{className:c("font-semibold uppercase tracking-wider align-middle whitespace-nowrap",m,n==="center"&&"text-center",n==="right"&&"text-right",o),...i,children:e.jsxs("button",{type:"button",onClick:s,className:c("inline-flex items-center gap-1.5 cursor-pointer transition-colors outline-none","focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary",l?"text-primary font-semibold":"text-text-muted hover:text-text"),children:[e.jsx("span",{children:t}),e.jsx(Wa,{direction:r})]})})}Nt.displayName="GymatraTableSortHead";function Ee({checked:t=!1,onChange:r,indeterminate:s=!1,"aria-label":n}){return e.jsxs("button",{type:"button",role:"checkbox","aria-checked":s?"mixed":t,"aria-label":n,onClick:()=>r==null?void 0:r(!t),className:c("size-5 shrink-0 rounded-md flex items-center justify-center border cursor-pointer transition-colors outline-none","focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary",t||s?"border-primary bg-primary text-white":"border-border-strong bg-white hover:border-text-subtle"),children:[t&&!s&&e.jsx("svg",{"aria-hidden":"true",className:"size-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})}),s&&e.jsx("span",{className:"h-0.5 w-3 bg-white rounded-full"})]})}Ee.displayName="GymatraTableCheckbox";function kt({columnsCount:t,hasCheckbox:r=!1,hasExpand:s=!1,density:n="normal",variant:a="cards"}){const o=n==="compact"?"py-2 px-3":n==="relaxed"?"py-4 px-4":"py-3 px-3.5";return e.jsxs("tr",{className:c("bg-white transition-opacity",a==="cards"?"[&>td:first-child]:rounded-s-lg [&>td:last-child]:rounded-e-lg [&>td]:border-y [&>td]:border-border [&>td:first-child]:border-s [&>td:last-child]:border-e":"border-b border-border last:border-b-0"),children:[s&&e.jsx("td",{className:c("w-8 text-center align-middle",o),children:e.jsx("div",{className:"size-4 mx-auto rounded bg-surface-muted animate-pulse"})}),r&&e.jsx("td",{className:c("w-8 align-middle",o),children:e.jsx("div",{className:"size-5 rounded-md bg-surface-muted animate-pulse"})}),Array.from({length:t}).map((i,l)=>e.jsx("td",{className:c("align-middle",o),children:l===0?e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"size-8 shrink-0 rounded-full bg-surface-muted animate-pulse"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"h-3.5 w-28 rounded bg-surface-muted animate-pulse"}),e.jsx("div",{className:"h-2.5 w-20 rounded bg-surface-muted/70 animate-pulse"})]})]}):e.jsx("div",{className:c("h-3.5 rounded bg-surface-muted animate-pulse",l===1?"w-24":l===t-1?"w-16":"w-20")})},l))]})}kt.displayName="GymatraTableSkeletonRow";function Gt({rowCount:t=5,columnsCount:r,hasCheckbox:s=!1,hasExpand:n=!1,density:a="normal",variant:o="cards"}){return e.jsx(e.Fragment,{children:Array.from({length:t}).map((i,l)=>e.jsx(kt,{columnsCount:r,hasCheckbox:s,hasExpand:n,density:a,variant:o},l))})}Gt.displayName="GymatraTableSkeleton";function qr({columns:t,data:r,rowKey:s=(S,z)=>S.id??z,sort:n,defaultSort:a,onSortChange:o,selectable:i=!1,selectedIds:l,onSelectionChange:m,selectionActions:u,pagination:d,emptyTitle:h="No data found",emptyDescription:b="There are no records matching your criteria.",loading:p=!1,skeletonRowCount:x=5,density:y="normal",variant:g="cards",onRowClick:j,expandedRowRender:k,expandedRowKeys:v,onExpandedRowsChange:w,className:C,...T}){const[S,z]=f.useState(a),N=n??S,[P,E]=f.useState([]),R=l??P,[O,re]=f.useState([]),M=v??O,[H,oe]=f.useState((d==null?void 0:d.page)??1),[B,$]=f.useState((d==null?void 0:d.pageSize)??10),K=(d==null?void 0:d.page)??H,q=(d==null?void 0:d.pageSize)??B,Z=!!k;function Ie(G){let I;(N==null?void 0:N.key)!==G?I={key:G,direction:"asc"}:N.direction==="asc"?I={key:G,direction:"desc"}:I=void 0,typeof n>"u"&&z(I),o==null||o(I)}const ie=f.useMemo(()=>N?[...r].sort((G,I)=>{const A=G[N.key],se=I[N.key];if(A===se)return 0;if(A==null)return 1;if(se==null)return-1;const ce=String(A).localeCompare(String(se),void 0,{numeric:!0});return N.direction==="asc"?ce:-ce}):r,[r,N]),ye=typeof(d==null?void 0:d.total)<"u",le=ye?d.total:ie.length,ge=f.useMemo(()=>{if(!d||ye)return ie;const G=(K-1)*q;return ie.slice(G,G+q)},[ie,d,ye,K,q]),Q=ge.map((G,I)=>s(G,I)),Te=Q.length>0&&Q.every(G=>R.includes(G)),ue=Q.some(G=>R.includes(G))&&!Te;function Ke(G){let I;if(G){const A=new Set([...R,...Q]);I=Array.from(A)}else I=R.filter(A=>!Q.includes(A));typeof l>"u"&&E(I),m==null||m(I)}function xe(G,I){let A;I?A=[...R,G]:A=R.filter(se=>se!==G),typeof l>"u"&&E(A),m==null||m(A)}function je(){typeof l>"u"&&E([]),m==null||m([])}function Le(G){let I;M.includes(G)?I=M.filter(A=>A!==G):I=[...M,G],typeof v>"u"&&re(I),w==null||w(I)}const Ze=R.length>0,Re=t.length+(i?1:0)+(Z?1:0);return e.jsxs("div",{className:c("flex flex-col w-full relative",C),...T,children:[e.jsx("div",{className:c("fixed bottom-6 left-1/2 -translate-x-1/2 z-50 transition-all duration-200 ease-out","w-[calc(100%-2rem)] max-w-lg sm:w-auto",Ze&&u?"translate-y-0 opacity-100 pointer-events-auto":"translate-y-4 opacity-0 pointer-events-none"),children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between sm:justify-start gap-3 rounded-lg border border-border bg-white px-4 py-2 text-sm shadow-none",children:[e.jsx("span",{className:"font-medium text-text",children:R.length===1?"1 item selected":`${R.length} items selected`}),e.jsx("span",{className:"hidden sm:inline-block h-4 w-px bg-border","aria-hidden":"true"}),e.jsx("div",{className:"flex items-center gap-1.5 ms-auto sm:ms-0",children:typeof u=="function"?u(R,je):u}),e.jsx("span",{className:"hidden sm:inline-block h-4 w-px bg-border","aria-hidden":"true"}),e.jsx("button",{type:"button",onClick:je,"aria-label":"Cancel selection",title:"Cancel selection",className:"flex size-6 items-center justify-center rounded-full text-text-muted hover:bg-surface hover:text-text cursor-pointer transition-colors outline-none focus-visible:outline-2 focus-visible:outline-primary",children:e.jsx("svg",{"aria-hidden":"true",className:"size-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})})]})}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:c("w-full text-left text-sm",g==="cards"?"border-separate border-spacing-y-2":"border-collapse border border-border rounded-lg bg-white overflow-hidden"),children:[e.jsx(jt,{children:e.jsxs("tr",{children:[Z&&e.jsx(we,{density:y,className:"w-8 px-2"}),i&&e.jsx(we,{density:y,className:"w-8 px-3",children:e.jsx(Ee,{checked:Te,indeterminate:ue,onChange:Ke,"aria-label":"Select all rows on current page"})}),t.map(G=>G.sortable?e.jsx(Nt,{direction:(N==null?void 0:N.key)===G.key?N.direction:void 0,onSort:()=>Ie(G.key),align:G.align,density:y,className:G.width,children:G.header},G.key):e.jsx(we,{align:G.align,density:y,className:G.width,children:G.header},G.key))]})}),e.jsx(vt,{children:p?e.jsx(Gt,{rowCount:x,columnsCount:t.length,hasCheckbox:i,hasExpand:Z,density:y,variant:g}):ge.length>0?ge.map((G,I)=>{const A=s(G,I),se=R.includes(A),ce=M.includes(A);return e.jsxs(f.Fragment,{children:[e.jsxs(wt,{selected:se,variant:g,onClick:Y=>{const Qe=Y.target;Qe.closest("button")||Qe.closest("input")||Qe.closest("a")||j==null||j(G,I)},className:c(j&&"cursor-pointer hover:border-primary/40"),children:[Z&&e.jsx(Ne,{density:y,className:"w-8 px-2 text-center",children:e.jsx("button",{type:"button",onClick:Y=>{Y.stopPropagation(),Le(A)},"aria-expanded":ce,"aria-label":ce?"Collapse row":"Expand row",className:"size-6 inline-flex items-center justify-center rounded text-text-muted hover:text-text hover:bg-surface-muted transition-transform cursor-pointer outline-none focus-visible:outline-2 focus-visible:outline-primary",children:e.jsx("span",{className:c("inline-block transition-transform duration-150",ce&&"rotate-180"),children:e.jsx($a,{})})})}),i&&e.jsx(Ne,{density:y,className:"w-8 px-3",children:e.jsx(Ee,{checked:se,onChange:Y=>xe(A,Y),"aria-label":`Select row ${A}`})}),t.map(Y=>e.jsx(Ne,{align:Y.align,density:y,children:Y.render?Y.render(G,I):G[Y.key]},Y.key))]}),Z&&ce&&e.jsx("tr",{className:c(g==="cards"?"bg-surface-muted/30":"bg-surface-muted/40 border-b border-border"),children:e.jsx("td",{colSpan:Re,className:c("px-5 py-4 text-sm text-text",g==="cards"&&"rounded-lg border border-border border-dashed my-1"),children:k==null?void 0:k(G,I)})})]},A)}):e.jsx("tr",{children:e.jsxs("td",{colSpan:Re,className:"rounded-lg border border-border bg-white px-4 py-12 text-center text-text-muted",children:[e.jsx("p",{className:"font-semibold text-text",children:h}),e.jsx("p",{className:"mt-1 text-sm text-text-muted",children:b})]})})})]})}),d&&!p&&e.jsx(ft,{page:K,pageSize:q,total:le,onPageChange:G=>{var I;typeof d.page>"u"&&oe(G),(I=d.onPageChange)==null||I.call(d,G)},pageSizeOptions:d.pageSizeOptions,onPageSizeChange:G=>{var I;typeof d.pageSize>"u"&&$(G),(I=d.onPageSizeChange)==null||I.call(d,G)},showSummary:d.showSummary})]})}qr.displayName="GymatraDataTable";const Oa=te.Tabs.Root,Ha=te.Tabs.List,qa=te.Tabs.Tab,Va=te.Tabs.Panel,Ua=te.Tabs.Indicator,_a={sm:"h-8 px-2.5 text-sm gap-1.5",md:"h-9 px-3.5 text-sm gap-2",lg:"h-11 px-4 text-base gap-2.5"};function Ka(t,r,s,n="horizontal"){const a="inline-flex items-center justify-center font-medium transition-colors select-none outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary disabled:pointer-events-none disabled:opacity-50 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 cursor-pointer",o=_a[r],i=s?"flex-1":"";switch(t){case"line":return n==="vertical"?c(a,o,i,"justify-start border-r-2 -mr-px border-transparent text-text-muted hover:text-text hover:border-border","data-[active]:border-primary aria-selected:border-primary data-[active]:text-primary aria-selected:text-primary"):c(a,o,i,"border-b-2 -mb-px border-transparent text-text-muted hover:text-text hover:border-border","data-[active]:border-primary aria-selected:border-primary data-[active]:text-primary aria-selected:text-primary");case"pills":return c(a,o,i,"rounded-md border border-transparent text-text-muted hover:text-text hover:bg-surface-muted/60","data-[active]:bg-white aria-selected:bg-white data-[active]:text-primary aria-selected:text-primary data-[active]:border-border aria-selected:border-border");case"enclosed":return c(a,o,i,"rounded-t-md border-t border-x -mb-px border-transparent text-text-muted hover:text-text hover:bg-surface-muted/40","data-[active]:border-border aria-selected:border-border data-[active]:bg-white aria-selected:bg-white data-[active]:text-primary aria-selected:text-primary data-[active]:border-b-transparent aria-selected:border-b-transparent");case"soft":default:return c(a,o,i,"rounded-md text-text-muted hover:bg-surface-muted hover:text-text","data-[active]:bg-primary-soft aria-selected:bg-primary-soft data-[active]:text-primary aria-selected:text-primary")}}function Za(t,r="horizontal",s){if(r==="vertical")return t==="line"?"flex flex-col border-r border-border gap-1":t==="pills"?"flex flex-col rounded-lg border border-border bg-surface-muted/60 p-1 gap-1":"flex flex-col gap-1";const n=s?"w-full":"";switch(t){case"line":return c("flex items-center border-b border-border gap-2 sm:gap-6",n);case"pills":return c("inline-flex items-center rounded-lg border border-border bg-surface-muted/60 p-1 gap-1",n);case"enclosed":return c("flex items-center border-b border-border gap-1",n);case"soft":default:return c("flex items-center gap-1.5",n)}}function Qa({value:t,defaultValue:r,onValueChange:s,variant:n="line",size:a="md",orientation:o="horizontal",fullWidth:i=!1,items:l,children:m,className:u,listClassName:d,panelClassName:h}){const b=r??(l&&l.length>0?l[0].value:void 0),p=t!==void 0?{value:t}:b!==void 0?{defaultValue:b}:{};return e.jsx(te.Tabs.Root,{...p,onValueChange:x=>{typeof x=="string"&&(s==null||s(x))},orientation:o,className:c(o==="vertical"?"flex gap-6 items-start":"flex flex-col",u),children:l&&l.length>0?e.jsxs(e.Fragment,{children:[e.jsx(te.Tabs.List,{className:c(Za(n,o,i),d),children:l.map(x=>{const y=x.startIcon??x.icon;return e.jsxs(te.Tabs.Tab,{value:x.value,disabled:x.disabled,className:c(Ka(n,a,i,o)),children:[y&&e.jsx("span",{className:"shrink-0 size-4 flex items-center justify-center",children:y}),e.jsx("span",{children:x.label}),x.badge!==void 0&&e.jsx(st,{variant:x.badgeVariant??"default",size:"sm",pill:!0,className:"ml-1 text-xs px-1.5 py-0 h-4 min-w-4",children:x.badge}),x.endIcon&&e.jsx("span",{className:"shrink-0 size-4 flex items-center justify-center",children:x.endIcon})]},x.value)})}),l.map(x=>x.content?e.jsx(te.Tabs.Panel,{value:x.value,className:c("pt-4 focus-visible:outline-none",h),children:x.content},x.value):null)]}):m})}const Ya=$t.Toggle,Ja=Ot.ToggleGroup;function Vr(t="default"){switch(t){case"outline":return c("border border-border bg-white text-text","hover:bg-surface-muted hover:border-text-subtle","data-[pressed]:border-primary data-[pressed]:bg-primary-soft data-[pressed]:text-primary data-[pressed]:font-medium");case"solid":return c("bg-surface-muted text-text","hover:bg-surface-muted/80","data-[pressed]:bg-primary data-[pressed]:text-white data-[pressed]:font-medium");case"ghost":return c("bg-transparent text-text-muted","hover:bg-surface-muted hover:text-text","data-[pressed]:bg-surface-muted data-[pressed]:text-primary data-[pressed]:font-medium");case"default":default:return c("bg-surface-muted text-text","hover:bg-surface-muted/80 hover:text-text","data-[pressed]:bg-primary-soft data-[pressed]:text-primary data-[pressed]:font-medium")}}function Ur(t="md"){switch(t){case"sm":return"h-8 px-2.5 text-sm gap-1.5 rounded-md";case"lg":return"h-11 px-4 text-base gap-2.5 rounded-md";case"md":default:return"h-9.5 px-3 text-sm gap-2 rounded-md"}}const Ct=f.forwardRef(({variant:t="default",size:r="md",startIcon:s,endIcon:n,className:a,children:o,...i},l)=>e.jsxs($t.Toggle,{ref:l,className:c("inline-flex items-center justify-center select-none outline-none transition-colors shadow-none font-medium","focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary","data-[disabled]:opacity-50 data-[disabled]:pointer-events-none",Ur(r),Vr(t),a),...i,children:[s&&e.jsx("span",{className:"shrink-0 size-4 flex items-center justify-center",children:s}),o&&e.jsx("span",{children:o}),n&&e.jsx("span",{className:"shrink-0 size-4 flex items-center justify-center",children:n})]}));Ct.displayName="GymatraToggle";const Xa=f.forwardRef(({options:t,value:r,defaultValue:s,onValueChange:n,size:a="md",variant:o="default",bordered:i=!0,multiple:l=!1,orientation:m="horizontal",className:u,children:d,...h},b)=>{const p=r!==void 0?Array.isArray(r)?r:[r]:void 0,x=s!==void 0?Array.isArray(s)?s:[s]:void 0,y=j=>{n&&n(l?j:j[0]??"")},g=m==="vertical";return e.jsx(Ot.ToggleGroup,{ref:b,value:p,defaultValue:x,onValueChange:y,multiple:l,orientation:m,className:c("inline-flex select-none",g?"flex-col items-stretch gap-1":"flex-row items-center gap-1",i?"rounded-md border border-border bg-white p-1 shadow-none":"bg-transparent p-0.5",u),...h,children:t&&t.length>0?t.map(j=>e.jsx(Ct,{value:j.value,size:a,variant:o,disabled:j.disabled,"aria-label":j.ariaLabel||(typeof j.label=="string"?j.label:void 0),startIcon:j.startIcon??j.icon,endIcon:j.endIcon,children:j.label},j.value)):d})}),eo=ne.Tooltip.Provider,to={dark:"bg-text text-white",light:"border border-border bg-white text-text"},ro={dark:"bg-text",light:c("border-border bg-white","data-[side=top]:border-b data-[side=top]:border-r","data-[side=bottom]:border-t data-[side=bottom]:border-l","data-[side=left]:border-t data-[side=left]:border-r","data-[side=right]:border-b data-[side=right]:border-l")},so={dark:"bg-white/15 text-white",light:"bg-surface-muted text-text-muted"};function _r({content:t,shortcut:r,children:s,side:n="top",align:a="center",sideOffset:o=8,delay:i=300,closeDelay:l=0,showArrow:m=!0,disabled:u=!1,open:d,defaultOpen:h,onOpenChange:b,className:p,variant:x="dark"}){return e.jsx(ne.Tooltip.Provider,{delay:i,closeDelay:l,children:e.jsxs(ne.Tooltip.Root,{open:d,defaultOpen:h,onOpenChange:b,disabled:u,children:[e.jsx(ne.Tooltip.Trigger,{render:s}),e.jsx(ne.Tooltip.Portal,{children:e.jsx(ne.Tooltip.Positioner,{side:n,align:a,sideOffset:o,className:"z-[10030] outline-none",children:e.jsxs(ne.Tooltip.Popup,{className:c("relative flex max-w-xs items-center gap-2 rounded-md px-2.5 py-1.5 text-xs font-medium leading-snug outline-none","origin-[var(--transform-origin)] transition-[opacity,scale] duration-150 motion-reduce:transition-none","data-[starting-style]:scale-95 data-[starting-style]:opacity-0 data-[ending-style]:scale-95 data-[ending-style]:opacity-0",to[x],p),children:[m&&e.jsx(ne.Tooltip.Arrow,{className:c("size-2 rotate-45","data-[side=top]:-bottom-1 data-[side=bottom]:-top-1 data-[side=left]:-right-1 data-[side=right]:-left-1",ro[x])}),e.jsx("span",{className:"min-w-0",children:t}),r&&e.jsx("kbd",{className:c("shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-xs font-normal",so[x]),children:r})]})})})]})})}_r.displayName="GymatraTooltip";Object.defineProperty(exports,"BaseUICheckbox",{enumerable:!0,get:()=>Je.Checkbox});Object.defineProperty(exports,"BaseUIField",{enumerable:!0,get:()=>V.Field});Object.defineProperty(exports,"BaseUIForm",{enumerable:!0,get:()=>Dt.Form});Object.defineProperty(exports,"BaseUIInput",{enumerable:!0,get:()=>Ft.Input});Object.defineProperty(exports,"BaseUISelect",{enumerable:!0,get:()=>_.Select});Object.defineProperty(exports,"BaseUISwitch",{enumerable:!0,get:()=>ke.Switch});Object.defineProperty(exports,"formatPhoneNumber",{enumerable:!0,get:()=>ae.formatPhoneNumber});Object.defineProperty(exports,"formatPhoneNumberIntl",{enumerable:!0,get:()=>ae.formatPhoneNumberIntl});Object.defineProperty(exports,"isValidPhoneNumber",{enumerable:!0,get:()=>ae.isValidPhoneNumber});exports.DRAWER_MIN_WIDTH=Ks;exports.DRAWER_SIZES=tt;exports.GYMATRA_CHART_PALETTE=Ce;exports.GymatraAccordion=Xr;exports.GymatraAccordionHeader=rs;exports.GymatraAccordionItemPrimitive=ts;exports.GymatraAccordionPanel=ns;exports.GymatraAccordionRoot=es;exports.GymatraAccordionTrigger=ss;exports.GymatraAlert=Ht;exports.GymatraAutocomplete=fn;exports.GymatraAvatar=ze;exports.GymatraAvatarGroup=Vt;exports.GymatraAvatarUpload=Rn;exports.GymatraAvatarUploadField=Sn;exports.GymatraBadge=st;exports.GymatraBarChart=fs;exports.GymatraBreadcrumb=Ut;exports.GymatraBreadcrumbEllipsis=Jt;exports.GymatraBreadcrumbItem=Kt;exports.GymatraBreadcrumbLink=Zt;exports.GymatraBreadcrumbList=_t;exports.GymatraBreadcrumbPage=Qt;exports.GymatraBreadcrumbSeparator=Yt;exports.GymatraButton=De;exports.GymatraChartCard=rr;exports.GymatraCheckbox=ot;exports.GymatraCheckboxField=jn;exports.GymatraCircularProgress=za;exports.GymatraColorPicker=Pn;exports.GymatraColorPickerField=Gr;exports.GymatraCombobox=Ds;exports.GymatraComboboxChip=Ls;exports.GymatraComboboxChipRemove=Rs;exports.GymatraComboboxChips=Ts;exports.GymatraComboboxClear=Is;exports.GymatraComboboxEmpty=lt;exports.GymatraComboboxGroup=Ps;exports.GymatraComboboxGroupLabel=ct;exports.GymatraComboboxInput=sr;exports.GymatraComboboxItem=Fe;exports.GymatraComboboxList=zs;exports.GymatraComboboxPopup=it;exports.GymatraComboboxPortal=Cs;exports.GymatraComboboxPositioner=Ss;exports.GymatraComboboxRoot=ks;exports.GymatraComboboxSeparator=Ms;exports.GymatraComboboxTrigger=Gs;exports.GymatraCurrencyInput=yr;exports.GymatraCustomSelect=mn;exports.GymatraDataTable=qr;exports.GymatraDateInput=jr;exports.GymatraDateRangeInput=xn;exports.GymatraDateTimeInput=wr;exports.GymatraDialog=fe;exports.GymatraDialogBackdrop=Os;exports.GymatraDialogClose=_s;exports.GymatraDialogComponent=ar;exports.GymatraDialogContent=qs;exports.GymatraDialogDescription=Us;exports.GymatraDialogPopup=Hs;exports.GymatraDialogPortal=$s;exports.GymatraDialogRoot=Es;exports.GymatraDialogTitle=Vs;exports.GymatraDialogTrigger=Ws;exports.GymatraDoughnutChart=hs;exports.GymatraDrawerPanel=en;exports.GymatraDrawerProvider=ir;exports.GymatraEmailInput=mr;exports.GymatraEmptyState=lr;exports.GymatraField=An;exports.GymatraFieldContainer=D;exports.GymatraFileUploadField=Gn;exports.GymatraFilterBar=xr;exports.GymatraFilterBarChip=ur;exports.GymatraFilterBarSearch=dr;exports.GymatraFilterBarSelect=dn;exports.GymatraFilterSelect=ut;exports.GymatraFloatingField=Me;exports.GymatraFloatingSelect=zr;exports.GymatraFloatingTextarea=Sr;exports.GymatraForm=Bn;exports.GymatraImageUploadField=Cn;exports.GymatraInput=Lr;exports.GymatraLineChart=ps;exports.GymatraMenu=_n;exports.GymatraMenuCheckboxItem=qe;exports.GymatraMenuGroup=Rr;exports.GymatraMenuGroupLabel=He;exports.GymatraMenuItem=$e;exports.GymatraMenuPopup=be;exports.GymatraMenuPortal=$n;exports.GymatraMenuPositioner=On;exports.GymatraMenuRadioGroup=Hn;exports.GymatraMenuRadioItem=Ve;exports.GymatraMenuRoot=En;exports.GymatraMenuSeparator=Oe;exports.GymatraMenuSubmenuRoot=qn;exports.GymatraMenuSubmenuTrigger=Ue;exports.GymatraMenuTrigger=Wn;exports.GymatraMenubar=Br;exports.GymatraMenubarCheckboxItem=aa;exports.GymatraMenubarGroup=Jn;exports.GymatraMenubarGroupLabel=na;exports.GymatraMenubarItem=ra;exports.GymatraMenubarMenu=Zn;exports.GymatraMenubarPopup=ta;exports.GymatraMenubarPortal=Qn;exports.GymatraMenubarPositioner=Yn;exports.GymatraMenubarRadioGroup=Xn;exports.GymatraMenubarRadioItem=oa;exports.GymatraMenubarRoot=Kn;exports.GymatraMenubarSeparator=sa;exports.GymatraMenubarSubmenuRoot=ea;exports.GymatraMenubarSubmenuTrigger=ia;exports.GymatraMenubarTrigger=pt;exports.GymatraMultiSelect=pn;exports.GymatraNumberInput=Pe;exports.GymatraNumericField=un;exports.GymatraOtpField=Tn;exports.GymatraOtpInput=Ln;exports.GymatraPagination=ft;exports.GymatraPasswordInput=pr;exports.GymatraPercentageInput=gr;exports.GymatraPhoneInput=hr;exports.GymatraPopover=ba;exports.GymatraPopoverArrow=Ar;exports.GymatraPopoverClose=gt;exports.GymatraPopoverDescription=yt;exports.GymatraPopoverPopup=ht;exports.GymatraPopoverPortal=pa;exports.GymatraPopoverPositioner=fa;exports.GymatraPopoverRoot=xa;exports.GymatraPopoverTitle=bt;exports.GymatraPopoverTrigger=ma;exports.GymatraProgress=Ca;exports.GymatraProgressIndicator=ja;exports.GymatraProgressLabel=va;exports.GymatraProgressRoot=ya;exports.GymatraProgressTrack=ga;exports.GymatraProgressValue=wa;exports.GymatraRadioGroupField=vn;exports.GymatraRangeField=In;exports.GymatraRichTextEditor=kn;exports.GymatraSearchInput=fr;exports.GymatraSelect=Fn;exports.GymatraSelectField=Nr;exports.GymatraSeparator=Dr;exports.GymatraSeparatorRoot=Pa;exports.GymatraSliderField=Mn;exports.GymatraSparkline=Ba;exports.GymatraStatCard=Er;exports.GymatraStep=Or;exports.GymatraStepConnector=Fa;exports.GymatraStepContent=Ea;exports.GymatraStepIndicator=Se;exports.GymatraStepper=Da;exports.GymatraSwitch=xt;exports.GymatraSwitchField=wn;exports.GymatraSwitchRoot=hn;exports.GymatraSwitchThumb=bn;exports.GymatraTab=qa;exports.GymatraTable=Hr;exports.GymatraTableBody=vt;exports.GymatraTableCell=Ne;exports.GymatraTableCheckbox=Ee;exports.GymatraTableHead=we;exports.GymatraTableHeader=jt;exports.GymatraTableRow=wt;exports.GymatraTableSkeleton=Gt;exports.GymatraTableSkeletonRow=kt;exports.GymatraTableSortHead=Nt;exports.GymatraTabs=Qa;exports.GymatraTabsIndicator=Ua;exports.GymatraTabsList=Ha;exports.GymatraTabsPanel=Va;exports.GymatraTabsRoot=Oa;exports.GymatraTextField=Cr;exports.GymatraTextInput=he;exports.GymatraTextarea=Dn;exports.GymatraTextareaField=kr;exports.GymatraTimeInput=vr;exports.GymatraToggle=Ct;exports.GymatraToggleField=Nn;exports.GymatraToggleGroup=Xa;exports.GymatraToggleGroupRoot=Ja;exports.GymatraToggleRoot=Ya;exports.GymatraTooltip=_r;exports.GymatraTooltipProvider=eo;exports.GymatraUrlInput=br;exports.SidebarContext=Js;exports.SidebarProvider=Xs;exports.cn=c;exports.getDrawerWidth=Zs;exports.getToggleSizeClasses=Ur;exports.getToggleVariantClasses=Vr;exports.gymatraAlpha=Xt;exports.renderMenuItems=_e;exports.useGymatraChartTheme=We;exports.useGymatraDrawer=or;exports.useGymatraStepper=Wr;exports.useSidebar=Ys;