@moondreamsdev/dreamer-ui 1.7.7-test.21 → 1.7.7-test.23

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.
Files changed (82) hide show
  1. package/dist/QuestionMarkCircled-CY81euqP.js.map +1 -1
  2. package/dist/{QuestionMarkCircled-BaSE7iv0.cjs → QuestionMarkCircled-D3gPieJ7.cjs} +2 -2
  3. package/dist/QuestionMarkCircled-D3gPieJ7.cjs.map +1 -0
  4. package/dist/{Toast-BFQrI1bB.js → Toast-B83cGTb3.js} +46 -44
  5. package/dist/Toast-B83cGTb3.js.map +1 -0
  6. package/dist/Toast-BDQ9mOuz.cjs +2 -0
  7. package/dist/Toast-BDQ9mOuz.cjs.map +1 -0
  8. package/dist/X-CIoyLewf.js.map +1 -1
  9. package/dist/X-CgjeP2OI.cjs.map +1 -1
  10. package/dist/components.cjs.js +1 -1
  11. package/dist/components.cjs.js.map +1 -1
  12. package/dist/components.esm.js +67 -67
  13. package/dist/components.esm.js.map +1 -1
  14. package/dist/providers.cjs.js +1 -1
  15. package/dist/providers.esm.js +1 -1
  16. package/dist/src/components/accordion/AccordionItem.d.ts +1 -0
  17. package/dist/src/components/accordion/index.d.ts +2 -4
  18. package/dist/src/components/actionmodal/index.d.ts +1 -2
  19. package/dist/src/components/button/Button.d.ts +1 -1
  20. package/dist/src/components/button/LoadingDots.d.ts +1 -1
  21. package/dist/src/components/button/index.d.ts +2 -4
  22. package/dist/src/components/carousel/Carousel.d.ts +1 -1
  23. package/dist/src/components/carousel/hooks.d.ts +1 -0
  24. package/dist/src/components/carousel/index.d.ts +1 -2
  25. package/dist/src/components/checkbox/Checkbox.d.ts +1 -1
  26. package/dist/src/components/checkbox/index.d.ts +1 -1
  27. package/dist/src/components/clickable/Clickable.d.ts +3 -3
  28. package/dist/src/components/clickable/index.d.ts +1 -1
  29. package/dist/src/components/input/Input.d.ts +2 -3
  30. package/dist/src/components/input/index.d.ts +1 -1
  31. package/dist/src/components/pagination/Pagination.d.ts +2 -3
  32. package/dist/src/components/pagination/index.d.ts +1 -1
  33. package/dist/src/components/panel/Panel.d.ts +1 -1
  34. package/dist/src/components/panel/index.d.ts +1 -3
  35. package/dist/src/components/radiogroup/RadioGroupItem.d.ts +1 -0
  36. package/dist/src/components/scroll-area/ScrollArea.d.ts +1 -1
  37. package/dist/src/components/scroll-area/hooks.d.ts +1 -0
  38. package/dist/src/components/scroll-area/index.d.ts +1 -2
  39. package/dist/src/components/select/Select.d.ts +1 -1
  40. package/dist/src/components/select/index.d.ts +1 -2
  41. package/dist/src/components/separator/Separator.d.ts +1 -1
  42. package/dist/src/components/separator/index.d.ts +1 -2
  43. package/dist/src/components/skeleton/Skeleton.d.ts +1 -1
  44. package/dist/src/components/skeleton/index.d.ts +1 -1
  45. package/dist/src/components/slider/Slider.d.ts +1 -1
  46. package/dist/src/components/slider/index.d.ts +1 -2
  47. package/dist/src/components/tabs/TabsContent.d.ts +1 -0
  48. package/dist/src/components/tabs/TabsContext.d.ts +1 -0
  49. package/dist/src/components/tabs/TabsList.d.ts +1 -0
  50. package/dist/src/components/tabs/TabsTrigger.d.ts +1 -0
  51. package/dist/src/components/textarea/Textarea.d.ts +2 -3
  52. package/dist/src/components/textarea/index.d.ts +1 -1
  53. package/dist/src/components/toast/Toast.d.ts +1 -0
  54. package/dist/src/components/toast/index.d.ts +1 -2
  55. package/dist/src/components/toggle/Toggle.d.ts +1 -1
  56. package/dist/src/components/toggle/index.d.ts +1 -2
  57. package/dist/src/components/tooltip/hooks.d.ts +1 -0
  58. package/dist/src/components/tooltip/index.d.ts +1 -2
  59. package/dist/src/hooks/useActionModal.d.ts +1 -0
  60. package/dist/src/hooks/useToast.d.ts +1 -0
  61. package/dist/src/symbols/Check.d.ts +2 -2
  62. package/dist/src/symbols/CheckCircled.d.ts +2 -2
  63. package/dist/src/symbols/ChevronDoubleLeft.d.ts +2 -2
  64. package/dist/src/symbols/ChevronDoubleRight.d.ts +2 -2
  65. package/dist/src/symbols/ChevronDown.d.ts +2 -2
  66. package/dist/src/symbols/ChevronLeft.d.ts +2 -2
  67. package/dist/src/symbols/ChevronRight.d.ts +2 -2
  68. package/dist/src/symbols/CrossCircled.d.ts +2 -2
  69. package/dist/src/symbols/ExclamationTriangle.d.ts +2 -2
  70. package/dist/src/symbols/EyeClosed.d.ts +2 -2
  71. package/dist/src/symbols/EyeOpened.d.ts +2 -2
  72. package/dist/src/symbols/InfoCircled.d.ts +2 -2
  73. package/dist/src/symbols/QuestionMarkCircled.d.ts +2 -2
  74. package/dist/src/symbols/X.d.ts +2 -2
  75. package/dist/src/symbols/index.d.ts +15 -18
  76. package/dist/src/symbols/props.d.ts +5 -0
  77. package/dist/symbols.cjs.js +1 -1
  78. package/package.json +2 -2
  79. package/dist/QuestionMarkCircled-BaSE7iv0.cjs.map +0 -1
  80. package/dist/Toast-B-Zu6Kp_.cjs +0 -2
  81. package/dist/Toast-B-Zu6Kp_.cjs.map +0 -1
  82. package/dist/Toast-BFQrI1bB.js.map +0 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),i=require("react"),j=require("./utils.cjs.js"),W=require("./QuestionMarkCircled-BaSE7iv0.cjs"),S=require("./Toast-B-Zu6Kp_.cjs"),ae=require("./X-CgjeP2OI.cjs"),ce=require("react-dom");function te({id:r,title:s,content:t,children:n,className:e="",disabled:a=!1,isOpen:l=!1,onToggle:c,triggerClassName:d="",bodyClassName:m=""}){const b=i.useId(),u=r||`accordion-item-${b}`,h=`${u}-header`,f=`${u}-panel`,x=()=>{!a&&c&&c()},v=g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),x())};return o.jsxs("div",{className:j.join("border-b border-gray-200",a&&"opacity-60 cursor-not-allowed",e),children:[o.jsxs("button",{id:h,type:"button",className:j.join("w-full text-left py-3 px-4 flex justify-between items-center focus:outline focus:outline-secondary",a?"cursor-not-allowed":"hover:bg-gray-50/10 cursor-pointer",d),"aria-expanded":l,"aria-controls":f,disabled:a,onClick:x,onKeyDown:v,children:[o.jsx("span",{children:s}),o.jsx("span",{className:j.join("transform transition-transform duration-300 ease-linear",l?"rotate-180":"rotate-0"),"aria-hidden":"true",children:o.jsx(W.ChevronDown,{size:18})})]}),o.jsx("div",{id:f,role:"region","aria-labelledby":h,className:j.join("transition-all duration-300 ease-linear px-4",l?"max-h-96 opacity-100 overflow-auto py-3":"max-h-0 opacity-0 overflow-hidden",m),children:l&&(n||t)})]})}function we({id:r,items:s=[],children:t,className:n="",itemClassName:e="",allowMultiple:a=!1,defaultOpenItems:l=[],triggersClassName:c="",bodiesClassName:d=""}){const m=i.useId(),b=r||`accordion-group-${m}`,[u,h]=i.useState(new Set(l)),f=g=>{h(w=>{const p=new Set(w);return p.has(g)?p.delete(g):(a||p.clear(),p.add(g)),p})},x=g=>`${m}-item-${g}`,v=g=>u.has(g);return o.jsxs("div",{id:b,className:n,children:[s.length>0&&s.map((g,w)=>{const p=g.id||x(w);return o.jsx(te,{id:p,title:g.title,content:g.content,disabled:g.disabled,isOpen:v(p),onToggle:()=>f(p),className:e,triggerClassName:c,bodyClassName:d},p)}),s.length===0&&t&&i.Children.map(t,(g,w)=>{if(i.isValidElement(g)&&g.type===te){const p=g.props.id||x(w);return i.createElement(te,{...g.props,key:p,id:p,className:j.join(e,g.props.className),isOpen:v(p),onToggle:()=>f(p),triggerClassName:j.join(c,g.props.triggerClassName),bodyClassName:j.join(d,g.props.bodyClassName)})}return null})]})}function ve(){const[r,s]=i.useState(0);return i.useEffect(()=>{const t=setInterval(()=>{s(n=>(n+1)%3)},500);return()=>clearInterval(t)},[]),o.jsx("div",{className:"absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle",children:[0,1,2].map(t=>o.jsx("div",{className:j.join("rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current",r===t&&"transform -translate-y-1")},t))})}const je={base:"",primary:"bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80",tertiary:"text-primary hover:text-primary-foreground disabled:text-muted",outline:"border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted",link:"underline-offset-4 hover:underline disabled:underline disabled:text-muted",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground"},Ne={stripped:"",fitted:"size-fit",sm:"px-2 py-1 text-sm",md:"px-4 py-2 text-base",lg:"px-6 py-3 text-lg",icon:"p-1 w-fit aspect-square",full:"p-2 w-full"},Ee={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},le={variant:"primary",size:"md",rounded:"md"};function ge({variant:r=le.variant,size:s,rounded:t=le.rounded,loading:n,linkTo:e,linkProps:a,type:l="button",className:c,...d}){let m;r==="link"&&!s?m="fitted":m=s||le.size;const u=j.join("appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",je[r],Ne[m],Ee[t],n&&"relative pointer-events-none",e&&"relative",c);return o.jsxs("button",{...d,role:e?"link":d.role,"aria-label":d["aria-label"]||(a==null?void 0:a["aria-label"]),"aria-description":d["aria-description"]||(a==null?void 0:a["aria-description"]),"aria-disabled":d.disabled||n,"aria-busy":n,type:l,className:u,children:[n&&o.jsx(ve,{}),o.jsx("span",{className:j.join(n&&"invisible"),children:d.children}),e&&!d.disabled&&o.jsx("a",{...a,"aria-hidden":!0,href:e,rel:(a==null?void 0:a.rel)||"noreferrer",className:"absolute inset-0"})]})}function ke({totalItems:r,itemsToShow:s,infinite:t,autoScroll:n,scrollInterval:e,pauseScrollOnHover:a,currentIndex:l,onIndexChange:c}){const[d,m]=i.useState(l||0),[b,u]=i.useState(!1),h=i.useRef(null),f=Math.ceil(r/s),x=t||d>0,v=t||d<f-1,g=i.useCallback(y=>{const N=Math.max(0,Math.min(y,f-1));m(N),c==null||c(N)},[f,c]),w=i.useCallback(()=>{if(x){const y=d===0&&t?f-1:d-1;g(y)}},[d,x,t,f,g]),p=i.useCallback(()=>{if(v){const y=d===f-1&&t?0:d+1;g(y)}},[d,v,t,f,g]);return i.useEffect(()=>{l!==void 0&&l!==d&&m(l)},[l,d]),i.useEffect(()=>{if(!n)return;const y=()=>{h.current=setInterval(()=>{a&&b||p()},e)},N=()=>{h.current&&(clearInterval(h.current),h.current=null)};return!b||!a?y():N(),N},[n,e,a,b,p]),i.useEffect(()=>{m(0)},[s]),{currentSlide:d,canGoPrev:x,canGoNext:v,goToPrev:w,goToNext:p,goToSlide:g,isHovered:b,setIsHovered:u}}const _={xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function Ce(){const[r,s]=i.useState(),[t,n]=i.useState(0),e=a=>_[a];return i.useEffect(()=>{const a=c=>c>=_["2xl"]?"2xl":c>=_.xl?"xl":c>=_.lg?"lg":c>=_.md?"md":c>=_.sm?"sm":"xs";s(a(window.innerWidth)),n(window.innerWidth);const l=()=>{s(a(window.innerWidth)),n(window.innerWidth)};return window.addEventListener("resize",l),()=>{window.removeEventListener("resize",l)}},[]),{screenSize:r,screenWidth:t,getBreakpoint:e}}const J={sm:{button:"h-6 w-6 text-xs",icon:"size-3"},md:{button:"h-8 w-8 text-sm",icon:"size-4"},lg:{button:"h-10 w-10 text-lg",icon:"size-5"}},ue={default:"bg-accent text-accent-foreground hover:bg-accent-foreground hover:text-accent",outline:"border border-border bg-background hover:bg-accent hover:text-accent-foreground hover:border-accent",ghost:"hover:text-accent"},Y={aligned:{prev:"absolute top-1/2 -translate-x-1/2 -translate-y-1/2 z-10",next:"absolute right-0 top-1/2 translate-x-1/2 -translate-y-1/2 z-10"},exterior:{prev:"absolute -left-10 top-1/2 -translate-y-1/2 z-10",next:"absolute -right-10 top-1/2 -translate-y-1/2 z-10"},interior:{prev:"absolute left-2 top-1/2 -translate-y-1/2 z-10",next:"absolute right-2 top-1/2 -translate-y-1/2 z-10"}};function Se({children:r,id:s,ref:t,className:n,autoScroll:e=!1,scrollInterval:a=3e3,pauseScrollOnHover:l=!0,currentIndex:c,onIndexChange:d,hidePrevNext:m=!1,hideDots:b=!1,itemsToShow:u=1,buttonSize:h="md",buttonVariant:f="default",buttonPosition:x="exterior",infinite:v=!0,prevButton:g,nextButton:w,itemsClassName:p,containerClassName:y,dotsClassName:N,gap:E=8}){var $,Q;const A=i.useRef(null),C=i.Children.toArray(r).filter(i.isValidElement),I=C.length,{screenSize:M}=Ce(),z=i.useMemo(()=>{if(typeof u=="number")return u;if(typeof u=="object"&&u&&M){const K=["2xl","xl","lg","md","sm","xs"],V=K.indexOf(M);for(let U=V;U<K.length;U++){const Z=K[U];if(u[Z]!==void 0)return u[Z]}}return 1},[u,M]),{currentSlide:H,canGoPrev:L,canGoNext:T,goToPrev:R,goToNext:D,goToSlide:B,setIsHovered:P}=ke({totalItems:I,itemsToShow:z,infinite:v,autoScroll:e,scrollInterval:a,pauseScrollOnHover:l,currentIndex:c,onIndexChange:d}),q=i.useCallback(K=>{if(z===1)return{leftWidth:0,rightWidth:0,widthReduction:0};const V=E*(z-1)/z;return K%z===0?{leftWidth:0,rightWidth:E/2,widthReduction:V}:K%z===z-1?{leftWidth:E/2,rightWidth:0,widthReduction:V}:{leftWidth:E/2,rightWidth:E/2,widthReduction:V}},[z,E]),F=()=>{R()},X=()=>{D()},se=()=>{l&&P(!0)},oe=()=>{l&&P(!1)},ie=-(H*(100/I)*z),k=j.join("inline-flex items-center justify-center rounded-md font-medium transition-all focus-visible:outline-none focus-visible:ring focus-visible:ring-ring disabled:pointer-events-none",x==="aligned"?"disabled:opacity-90":"disabled:opacity-50");return o.jsxs("div",{className:j.join("relative",n),"data-carousel-wrapper":"true",children:[!m&&o.jsx(o.Fragment,{children:g?i.cloneElement(g,{onClick:F,disabled:!L,className:j.join((($=g.props)==null?void 0:$.className)||"",Y[x].prev),role:"button","aria-disabled":!L,"aria-label":"Previous slide","data-carousel-prev":"true"}):o.jsx("button",{type:"button",onClick:F,disabled:!L,className:j.join(k,J[h].button,ue[f],Y[x].prev),"aria-disabled":!L,"aria-label":"Previous slide","data-carousel-prev":"true",children:o.jsx(W.ChevronLeft,{className:J[h].icon})})}),o.jsxs("div",{id:s,ref:t,className:j.join("relative overflow-hidden",y),onMouseEnter:se,onMouseLeave:oe,"data-carousel":"true","data-current-index":H,"data-items-to-show":z,"data-auto-scroll":e,"data-button-position":x,children:[o.jsx("div",{ref:A,className:"flex transition-transform duration-300 ease-in-out",style:{transform:`translateX(${ie}%)`,width:`${I/z*100}%`},children:C.map((K,V)=>{const{leftWidth:U,rightWidth:Z,widthReduction:ye}=q(V);return o.jsx("div",{className:j.join("flex-shrink-0",p),style:{width:`calc(${100/I}% - ${ye}px)`,marginRight:Z>0?`${Z}px`:void 0,marginLeft:U>0?`${U}px`:void 0},"data-slide-index":V,children:K},V)})}),!b&&o.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 flex space-x-2",children:Array.from({length:Math.ceil(I/z)}).map((K,V)=>o.jsx("button",{type:"button",onClick:()=>B(V),className:j.join("w-2 h-2 rounded-full transition-colors duration-200",V===H?"bg-accent":"bg-muted hover:bg-muted-foreground/50",N),"aria-label":`Go to slide ${V+1}`,"data-carousel-dot":V},V))})]}),!m&&o.jsx(o.Fragment,{children:w?i.cloneElement(w,{onClick:X,disabled:!T,className:j.join(((Q=w.props)==null?void 0:Q.className)||"",Y[x].next),role:"button","aria-disabled":!T,"aria-label":"Next slide","data-carousel-next":"true"}):o.jsx("button",{type:"button",onClick:X,disabled:!T,className:j.join(k,J[h].button,ue[f],Y[x].next),"aria-disabled":!T,"aria-label":"Next slide","data-carousel-next":"true",children:o.jsx(W.ChevronRight,{className:J[h].icon})})})]})}function Ie(r){const[s,t]=i.useState(""),n=i.useCallback(e=>{let a=e,l="";for(;a&&!l;){const c=window.getComputedStyle(a).backgroundColor;c&&c!=="transparent"&&c!=="rgba(0, 0, 0, 0)"&&(l=c),a=a.parentElement}return l||"transparent"},[]);return i.useEffect(()=>{const e=document.getElementById(r);if(e){const a=n(e.parentElement);t(a)}},[r,n]),s}function Te({ref:r,id:s,size:t=20,color:n,filled:e=!1,rounded:a=!0,checked:l=!1,onCheckedChange:c,disabled:d,className:m="",...b}){const u=i.useId(),h=i.useMemo(()=>s||`checkbox-${u}`,[s,u]),f=Ie(h),[x,v]=i.useState(l);i.useEffect(()=>{v(l)},[l]);const g=()=>{d||(v(!x),c==null||c(!x))},w=y=>{y.key===" "&&(y.preventDefault(),g())},p=j.join("flex items-center justify-center border outline outline-transparent focus:outline-current focus:outline-offset-2",a&&"rounded",d&&"opacity-40 cursor-not-allowed",!d&&"cursor-pointer",m);return o.jsx("button",{id:h,type:"button",ref:r,tabIndex:0,role:"checkbox",onClick:g,"aria-checked":x,"aria-disabled":d,onKeyDownCapture:w,style:{width:t,height:t,color:n,backgroundColor:x&&e?"currentcolor":"transparent"},className:p,...b,children:x&&o.jsx(W.Check,{size:t,color:e?f:void 0})})}function Re({children:r,className:s,linkTo:t,linkProps:n,onButtonClick:e,buttonProps:a,...l}){return t&&e&&console.warn('Clickable: Both "linkTo" and "onButtonClick" props are provided. Only "linkTo" will be used.'),o.jsxs("div",{className:j.join("relative w-fit",s),...l,children:[r,t&&o.jsx("a",{...n,rel:(n==null?void 0:n.rel)||"noreferrer",href:t,className:j.join("absolute inset-0",n==null?void 0:n.className)}),!t&&e&&o.jsx("button",{...a,type:"button",onClick:e,className:j.join("absolute inset-0 cursor-pointer",a==null?void 0:a.className)})]})}function ne({elementId:r,type:s,message:t}){return i.useEffect(()=>{const n=document.getElementById(r);if(n){if(!t&&s==="error"){n.removeAttribute("data-error");return}if(!t&&s==="success"){n.removeAttribute("data-success");return}return n.setAttribute("aria-describedby",`${r}-${s}-message`),n.setAttribute("aria-invalid",s==="error"?"true":"false"),s==="error"&&n.setAttribute("data-error","true"),s==="success"&&n.setAttribute("data-success","true"),()=>{n.removeAttribute("aria-describedby"),n.removeAttribute("aria-invalid"),n.removeAttribute("data-error"),n.removeAttribute("data-success")}}},[r,s,t]),t?o.jsxs("small",{className:j.join("mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-start",s==="error"&&"text-destructive",s==="success"&&"text-success"),role:"status",children:[s==="error"?o.jsx(ae.ExclamationTriangle,{}):o.jsx(W.CheckCircled,{}),o.jsx("span",{id:`${r}-${s}-message`,children:t})]}):null}const Ae={base:"",default:"ring ring-transparent focus:ring-primary-foreground not-disabled:data-error:ring-destructive not-disabled:data-success:ring-success",underline:"border-b border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success",outline:"border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success"},ze={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"px-3 rounded-full"},de={variant:"default",rounded:"none"};function $e({variant:r=de.variant,rounded:s,displayOnlyMode:t=!1,errorMessage:n,successMessage:e,type:a="text",className:l,...c}){const d=i.useId(),[m,b]=i.useState(!1);let u=s;r==="outline"&&!s&&(u="md"),u=u||de.rounded;const x=j.join("appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all","file:mr-2 file:border-0 file:rounded-md file:px-1.5 file:py-1 file:bg-primary hover:file:bg-primary/85 file:text-sm file:font-medium file:text-foreground file:transition-colors",!t&&Ae[r],!t&&ze[u],a==="password"&&"pr-10",!t&&"px-2 py-1",t&&"pointer-events-none",l);return o.jsxs("div",{className:j.join(t&&"cursor-text"),style:{height:c.height,width:c.width},children:[o.jsxs("div",{className:j.join(a==="password"&&"relative"),children:[o.jsx("input",{...c,id:d,type:a==="password"&&m?"text":a,"aria-disabled":c.disabled,readOnly:t,"aria-readonly":t||c["aria-readonly"],"data-error":n?!0:void 0,"data-success":e?!0:void 0,className:x}),a==="password"&&o.jsx("button",{onClick:()=>b(!m),className:"absolute inset-y-0 right-0 px-2 hover:cursor-pointer","aria-label":"Toggle password visibility","data-state":m?"visible":"hidden",children:m?o.jsx(W.EyeClosed$1,{size:20}):o.jsx(W.EyeClosed,{size:20})})]}),!t&&o.jsx(ne,{elementId:d,type:"error",message:n}),!t&&o.jsx(ne,{elementId:d,type:"success",message:e})]})}function De({display:r="inline",width:s="fit-content",className:t="",required:n,helpMessage:e,suffix:a,htmlFor:l,children:c,description:d,...m}){var v,g;const b=i.useId(),u=(((v=e==null?void 0:e.trim())==null?void 0:v.length)||0)>0,h=(((g=d==null?void 0:d.trim())==null?void 0:g.length)||0)>0,f=u?`${l??b}-help`:void 0,x=h?`${l??b}-description`:void 0;return o.jsxs("div",{style:{display:r==="inline"?"inline-block":"block",width:s},className:j.join("mb-0.5",t),children:[o.jsxs("div",{className:"relative flex",children:[o.jsxs("label",{className:"font-medium",htmlFor:l,...m,children:[c,n&&o.jsx("span",{className:"text-red-500 font-medium ml-1","aria-label":"required",children:"*"})]}),u&&o.jsx("span",{className:"text-gray-500 ml-1 size-fit -translate-y-1/3","aria-describedby":f,"aria-label":"Help information",title:e,children:o.jsx(W.QuestionMarkCircled,{})}),u&&o.jsx("div",{id:f,className:"sr-only",children:e}),a&&o.jsx("span",{className:"ml-1",children:a})]}),h&&o.jsx("small",{id:x,className:"block opacity-80 mt-0.5",role:"note",children:d})]})}function Le(r){const[s,t]=i.useState(!1),[n,e]=i.useState(!1);return i.useEffect(()=>{r?(e(!0),setTimeout(()=>t(!0),10)):(t(!1),setTimeout(()=>e(!1),150))},[r]),{show:s,shouldRender:n}}function Ve(r,s){i.useEffect(()=>{const t=n=>{n.key==="Escape"&&r&&s()};return document.addEventListener("keydown",t),r&&(document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",t),document.body.style.overflow="auto"}},[r,s])}function Me(r,s){const t=i.useRef(null),n=i.useCallback(()=>{const e=document.getElementById(r);if(!e)return;const a=e.querySelectorAll('[data-modal-action="true"]');if(a.length>0){a[0].focus();return}const l=e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(l.length>0){const c=Array.from(l).filter(d=>!(d instanceof HTMLButtonElement&&d.getAttribute("data-modal-close-button")==="true"));if(c.length>0){c[0].focus();return}l[0].focus();return}e.focus()},[r]);i.useEffect(()=>(s&&(t.current=document.activeElement,n()),()=>{document.body.style.overflow="auto",t.current instanceof HTMLElement&&t.current.focus()}),[s,n])}function We({id:r,isOpen:s,onClose:t,title:n,children:e,contentOnly:a=!1,className:l,overlayClassName:c,hideCloseButton:d=!1,actions:m=[],disableCloseOnOverlayClick:b=!1,ariaLabelledBy:u,ariaDescribedBy:h}){const f=i.useId(),x=r||`modal-${f}`,v=r?`${r}-title`:`modal-title-${f}`,{show:g,shouldRender:w}=Le(s);if(Me(x,w),Ve(w,t),!w)return null;const p=()=>n?i.isValidElement(n)?o.jsx("div",{className:"mb-4",children:n}):o.jsx("h2",{className:"mb-4 text-xl font-semibold",id:v,children:n}):null,y=()=>m.length===0?null:o.jsx("div",{className:"mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3",children:m.map((N,E)=>{const{label:A,className:C,...I}=N;return o.jsx(ge,{className:C,type:"button",...I,"data-modal-action":"true",children:A},E)})});return o.jsx(o.Fragment,{children:ce.createPortal(o.jsx("div",{"aria-labelledby":u??n?v:void 0,"aria-describedby":h,role:"dialog","aria-modal":"true",className:"fixed inset-0 z-[100] overflow-y-auto",children:o.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[o.jsx("div",{className:S.n("fixed inset-0 bg-black/20 transition-all",c),onClick:()=>{b||t()}}),a&&o.jsx("div",{className:S.n("relative w-fit",l),children:e}),!a&&o.jsxs("div",{id:x,tabIndex:-1,className:S.n("relative w-full max-w-xl transform rounded-lg shadow-xl bg-popover transition-all p-6 focus:ring ease-in duration-75",g?"opacity-100 scale-100":"opacity-0 scale-90",l),children:[!d&&o.jsx("button",{type:"button",onClick:t,"data-modal-close-button":"true",className:"rounded-md p-0.5 top-2.5 right-2.5 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0",children:o.jsx(ae.X,{size:18})}),p(),e,y()]})]})}),document.body)})}const Be={link:"text-primary hover:text-primary-foreground hover:bg-primary/10 aria-current:text-primary-foreground aria-current:bg-primary",outline:"border border-primary text-primary hover:bg-primary hover:text-primary-foreground aria-current:bg-primary aria-current:text-primary-foreground aria-current:border-primary",filled:"bg-secondary text-secondary-foreground hover:bg-primary hover:text-primary-foreground aria-current:bg-primary aria-current:text-primary-foreground"},Fe={sm:"px-2 py-1 text-sm min-w-[32px] min-h-8",md:"px-2 py-1 text-base min-w-[40px] min-h-10"};function He({page:r,pageCount:s=5,maxVisiblePages:t=5,showFirstLast:n=!0,onPageChange:e,size:a="md",variant:l="link",className:c,ref:d,buttonsClassName:m,...b}){const u=s===1/0,f=i.useCallback(()=>{if(u)return[];const N=s,E=Math.min(t,N);if(N<=E)return Array.from({length:N},(M,z)=>z+1);const A=Math.floor(E/2);let C=Math.max(1,r-A),I=Math.min(N,C+E-1);return I-C+1<E&&(C=Math.max(1,I-E+1),I=Math.min(N,C+E-1)),Array.from({length:I-C+1},(M,z)=>C+z)},[u,t,r,s])(),x=r>1,v=u||r<s,g=n&&!u,w=n&&!u,p=N=>{N>=1&&(u||N<=s)&&e(N)},y=i.useCallback(()=>{const N=S.n("flex items-center justify-center min-w-fit","disabled:opacity-50 disabled:cursor-not-allowed",Fe[a],"rounded-md");return S.n(N,Be[l],m)},[l,a,m]);return o.jsxs("nav",{ref:d,className:S.n("flex items-center justify-center gap-1",c),role:"navigation","aria-label":"Pagination","data-page":r,"data-page-count":u?"infinite":s,...b,children:[g&&o.jsxs("button",{onClick:()=>p(1),className:y(),disabled:r===1,"aria-label":"Go to first page",children:[o.jsx(W.ChevronDoubleLeft,{size:a==="sm"?12:15}),o.jsx("span",{className:"ml-1",children:"First"})]}),o.jsxs("button",{onClick:()=>p(r-1),className:y(),disabled:!x,"aria-label":"Go to previous page",children:[o.jsx(W.ChevronLeft,{size:a==="sm"?12:15}),o.jsx("span",{className:"ml-1",children:"Previous"})]}),!u&&f.map(N=>o.jsx("button",{onClick:()=>p(N),className:S.n(y(),"aspect-square"),"aria-label":`Go to page ${N}`,"aria-current":N===r?!0:void 0,children:N},N)),o.jsxs("button",{onClick:()=>p(r+1),className:y(),disabled:!v,"aria-label":"Go to next page",children:[o.jsx("span",{className:"mr-1",children:"Next"}),o.jsx(W.ChevronRight,{size:a==="sm"?12:15})]}),w&&o.jsxs("button",{onClick:()=>p(s),className:y(),disabled:r===s,"aria-label":"Go to last page",children:[o.jsx("span",{className:"mr-1",children:"Last"}),o.jsx(W.ChevronDoubleRight,{size:a==="sm"?12:15})]})]})}function Pe(r){const[s,t]=i.useState(!1),[n,e]=i.useState(!1);return i.useEffect(()=>{r?(e(!0),setTimeout(()=>t(!0),10)):(t(!1),setTimeout(()=>e(!1),300))},[r]),{show:s,shouldRender:n}}function Ge(r,s){i.useEffect(()=>{const t=n=>{n.key==="Escape"&&r&&s()};return document.addEventListener("keydown",t),r&&(document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",t),document.body.style.overflow="auto"}},[r,s])}function qe(r,s){const t=i.useRef(null),n=i.useCallback(()=>{const e=document.getElementById(r);if(!e)return;const a=e.querySelectorAll('[data-panel-action="true"]');if(a.length>0){a[0].focus();return}const l=e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(l.length>0){const c=Array.from(l).filter(d=>!(d instanceof HTMLButtonElement&&d.getAttribute("data-panel-close-button")==="true"));if(c.length>0){c[0].focus();return}l[0].focus();return}e.focus()},[r]);i.useEffect(()=>(s&&(t.current=document.activeElement,n()),()=>{document.body.style.overflow="auto",t.current instanceof HTMLElement&&t.current.focus()}),[s,n])}const Ke={size:{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl",full:"w-full",screen:"w-screen"}};function Xe({ref:r,id:s,isOpen:t,onClose:n,title:e,children:a,footer:l,size:c="md",className:d,overlayClassName:m,hideCloseButton:b=!1,disableCloseOnOverlayClick:u=!1,ariaLabelledBy:h,ariaDescribedBy:f}){const x=i.useId(),v=s||`panel-${x}`,g=s?`${s}-title`:`panel-title-${x}`,{show:w,shouldRender:p}=Pe(t);if(qe(v,p),Ge(p,n),!p)return null;const y=()=>e?i.isValidElement(e)?o.jsx("div",{children:e}):o.jsx("h2",{className:"text-2xl font-semibold",id:g,children:e}):null,N=()=>{if(!l)return null;if(i.isValidElement(l)){const E=l,A=E.props.className||"";return i.cloneElement(E,{className:S.n("px-6 py-4",A)})}return o.jsx("div",{className:"px-6 py-4",children:l})};return o.jsx(o.Fragment,{children:ce.createPortal(o.jsxs("div",{"aria-labelledby":h??e?g:void 0,"aria-describedby":f,role:"dialog","aria-modal":"true",className:"fixed inset-0 z-[100] overflow-hidden","data-panel-open":t,children:[o.jsx("div",{className:S.n("fixed inset-0 bg-black/40 transition-opacity duration-300",w?"opacity-100":"opacity-0",m),onClick:()=>{u||n()}}),o.jsx("div",{className:"fixed inset-y-0 right-0 flex max-w-full",children:o.jsx("div",{id:v,ref:r,tabIndex:-1,className:S.n("relative h-full transform shadow-xl bg-popover transition-transform duration-300 ease-in-out",c!=="screen"&&"border-l border-border",Ke.size[c],w?"translate-x-0":"translate-x-full",d),"data-panel-size":c,children:o.jsxs("div",{className:"flex h-full flex-col",children:[e&&o.jsx("div",{className:"px-6 pt-6",children:y()}),!b&&o.jsx("button",{type:"button",onClick:n,"data-panel-close-button":"true","aria-label":"Close panel",className:"rounded-md p-0.5 top-3 right-3 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0",children:o.jsx(ae.X,{size:18})}),o.jsx("div",{className:S.n("flex-1 overflow-y-auto px-6 pb-6",e?"pt-6":"pt-10"),children:a}),N()]})})})]}),document.body)})}function pe({itemId:r,checked:s,onChange:t,name:n,disabled:e=!1,className:a=""}){const l="relative inline-flex items-center justify-center rounded-full",c=()=>{e||t()},d=j.join(l,!s&&"hover:border-current/60",!e&&"border-current cursor-pointer",e&&"border-muted/60 cursor-not-allowed",a);return o.jsx("div",{id:r,role:"radio",tabIndex:-1,"aria-checked":s,"aria-disabled":e,"aria-description":`Radio button for ${n}`,"aria-labelledby":`${r}-label`,onClick:c,className:d,style:{width:"1em",height:"1em",padding:"0.1em",borderWidth:"0.06em"},children:s&&o.jsx("div",{className:j.join("size-full aspect-square rounded-full",e&&"bg-muted/60",!e&&"bg-current")})})}function re({value:r,children:s,className:t="",isSelected:n=!1,onChange:e,disabled:a=!1,hideInput:l=!1,description:c,name:d}){const b=`radio-${i.useId()}-${r}`,u=()=>{a||e==null||e(r)};return o.jsxs("div",{title:c,className:j.join("relative flex items-center",t,l&&`p-2 border-2 focus-within:border-dashed focus-within:${a?"border-current/50":"border-current/80"}`,l&&!n&&`border-transparent ${a?"":"not-focus-within:hover:border-border/60"}`,l&&n&&"border-border",a&&"opacity-60 cursor-not-allowed"),style:{gap:"0.5em"},children:[!l&&o.jsx(pe,{itemId:b,name:d||"",checked:n,onChange:u,disabled:a,className:j.join(l&&"")}),o.jsx("div",{id:l?b:void 0,tabIndex:l?-1:void 0,role:l?"radio":void 0,onClick:l?u:void 0,"aria-checked":l?n?"true":"false":void 0,"aria-disabled":l?a:void 0,"aria-description":l?c||`Radio button for ${d}`:void 0,"aria-labelledby":l?`${b}-label`:void 0,className:j.join(l&&"size-full",typeof s=="object"&&"grow focus:outline-none"),children:o.jsx("label",{id:`${b}-label`,onClick:l?void 0:u,className:j.join(a&&"cursor-not-allowed",!a&&"cursor-pointer"),children:s})})]})}function Ue(r,s){const[t,n]=i.useState(s),[e,a]=i.useState(-1),[l,c]=i.useState(!1),d=i.useCallback((f,x)=>{var w;const v=f[x];v.hasAttribute("disabled")||v.getAttribute("aria-disabled")==="true"||((w=f[x])==null||w.click(),a(x))},[]),m=i.useCallback((f,x)=>{var g;if(f.preventDefault(),l||!x.length)return;const v=s!==-1?s:0;(g=x[v])==null||g.focus(),n(v),s!==-1&&d(x,v)},[s,l,d]),b=i.useCallback(f=>{var w;if(!f.shiftKey)return;f.preventDefault();const x=Array.from(document.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')).filter(p=>!p.hasAttribute("disabled")&&p.tabIndex>=0),v=x.findIndex(p=>p.id===r),g=v>0?v-1:x.length-1;(w=x[g])==null||w.focus()},[r]),u=i.useCallback((f,x)=>{var y;if(!x.length)return;const v=f.target;if(!x.some(N=>N.id===v.id))return;const w=t!==-1?t:0;let p=w;switch(f.key){case"ArrowUp":case"ArrowLeft":f.preventDefault(),p=w>0?w-1:x.length-1;break;case"ArrowDown":case"ArrowRight":f.preventDefault(),p=(w+1)%x.length;break;case" ":f.preventDefault(),d(x,w);return;case"Tab":b(f);return;default:return}(y=x[p])==null||y.focus(),n(p),e!==-1&&d(x,p)},[t,e,b,d]),h=i.useCallback(()=>{const f=document.querySelector(`[id="${r}"][role="radiogroup"]`);return f?Array.from(f.querySelectorAll('[role="radio"]')):[]},[r]);i.useEffect(()=>{const f=document.querySelector(`[id="${r}"][role="radiogroup"]`);if(!f)return;const x=h(),v=y=>m(y,x),g=y=>u(y,x),w=()=>c(!0),p=()=>c(!1);return document.addEventListener("keydown",g),f.addEventListener("focus",v),f.addEventListener("mousedown",w),document.addEventListener("mouseup",p),()=>{document.removeEventListener("keydown",g),f.removeEventListener("focus",v),f.removeEventListener("mousedown",w),document.removeEventListener("mouseup",p)}},[r,h,m,u])}function _e({options:r=[],value:s,onChange:t,id:n,children:e,className:a="",childrenClassName:l="",hideInputs:c=!1}){const d=i.useId(),m=n||`radio-group-${d}`;Ue(m,r.findIndex(u=>u===s));const b=i.useMemo(()=>r.reduce((u,h)=>(typeof h=="string"?u.some(f=>f.value===h)||u.push({label:h,value:h}):u.push(h),u),[]),[r]);return o.jsxs("div",{id:m,role:"radiogroup",tabIndex:0,className:j.join(a,"focus:outline-none"),children:[b.length>0&&b.map((u,h)=>o.jsx(re,{value:u.value,isSelected:s===u.value,onChange:t,name:m,disabled:u.disabled,description:u.description,hideInput:c,className:l,children:u.label},`${u.value}-${h}`)),b.length===0&&e&&i.Children.map(e,u=>i.isValidElement(u)&&u.type===re?o.jsx(re,{...u.props,className:j.join(l,u.props.className),hideInput:u.props.hideInput||c,isSelected:s===u.props.value,onChange:t,name:m,children:u.props.children}):null)]})}function Qe(r){const s=i.useRef(null),t=i.useRef(null),n=i.useRef(null),[e,a]=i.useState(!1),[l,c]=i.useState(!1),[d,m]=i.useState({vertical:!1,horizontal:!1}),b=i.useRef(null),u=i.useRef(null),h=i.useCallback(()=>{const v=s.current;if(!v)return;const g=v.scrollHeight>v.clientHeight,w=v.scrollWidth>v.clientWidth;m({vertical:g,horizontal:w})},[]),f=i.useCallback(()=>{const v=s.current,g=t.current,w=n.current;if(v){if(g&&d.vertical){const y=(d.horizontal?v.clientHeight-r:v.clientHeight)/v.scrollHeight,N=Math.max(y*100,10),E=v.scrollHeight-v.clientHeight,A=E>0?v.scrollTop/E:0,C=100-N,I=A*C;g.style.height=`${N}%`,g.style.top=`${I}%`,g.style.transform="none"}if(w&&d.horizontal){const y=(d.vertical?v.clientWidth-r:v.clientWidth)/v.scrollWidth,N=Math.max(y*100,10),E=v.scrollWidth-v.clientWidth,A=E>0?v.scrollLeft/E:0,C=100-N,I=A*C;w.style.width=`${N}%`,w.style.left=`${I}%`,w.style.transform="none"}}},[d,r]),x=i.useCallback(()=>{b.current&&clearTimeout(b.current),u.current&&clearTimeout(u.current),a(!0),c(!1),f(),b.current=setTimeout(()=>{c(!0),u.current=setTimeout(()=>{a(!1),c(!1)},300)},1e3)},[f]);return i.useEffect(()=>{const v=s.current;if(!v)return;h();const g=new ResizeObserver(h);g.observe(v);const w=new MutationObserver(h);return w.observe(v,{childList:!0,subtree:!0,attributes:!0}),()=>{g.disconnect(),w.disconnect()}},[h]),i.useEffect(()=>{f()},[d,f]),i.useEffect(()=>()=>{b.current&&clearTimeout(b.current),u.current&&clearTimeout(u.current)},[]),{viewportRef:s,verticalThumbRef:t,horizontalThumbRef:n,isScrolling:e,isFadingOut:l,scrollbarVisible:d,handleScroll:x}}function Ze({className:r,thumbClassName:s,viewportClassName:t,scrollbarClassName:n,scrollbarThickness:e=10,children:a,id:l,ref:c,...d}){const{viewportRef:m,verticalThumbRef:b,horizontalThumbRef:u,isScrolling:h,isFadingOut:f,scrollbarVisible:x,handleScroll:v}=Qe(e),g=S.n("relative flex-1 rounded-full bg-slate-400/60 hover:bg-slate-400/80 active:bg-slate-400",s);return o.jsxs("div",{ref:c,id:l,className:S.n("relative overflow-hidden",r),"data-scroll-area-root":"",...d,children:[o.jsx("div",{ref:m,className:S.n("h-full w-full overflow-auto rounded-[inherit] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",t),onScroll:v,"data-scroll-area-viewport":"",children:a}),x.vertical&&(h||f)&&o.jsx("div",{className:S.n("touch-none select-none transition-all duration-300","p-[1px]","absolute right-0 top-0",f?"opacity-0":"opacity-100",n),"data-scroll-area-scrollbar":"vertical","data-state":h?"visible":"hidden",style:{width:`${e}px`,height:x.horizontal?`calc(100% - ${e}px)`:"100%"},children:o.jsx("div",{ref:b,className:S.n("absolute rounded-full",g),"data-scroll-area-thumb":"",style:{height:"20%",top:"0%",width:"100%"}})}),x.horizontal&&(h||f)&&o.jsx("div",{className:S.n("touch-none select-none transition-all duration-300","p-[1px]","absolute bottom-0 left-0",f?"opacity-0":"opacity-100",n),"data-scroll-area-scrollbar":"horizontal","data-state":h?"visible":"hidden",style:{height:`${e}px`,width:x.vertical?`calc(100% - ${e}px)`:"100%"},children:o.jsx("div",{ref:u,className:S.n("absolute rounded-full",g),"data-scroll-area-thumb":"",style:{width:"20%",left:"0%",height:"100%"}})}),x.vertical&&x.horizontal&&o.jsx("div",{className:S.n("bg-transparent","absolute bottom-0 right-0"),"data-scroll-area-corner":"",style:{height:`${e}px`,width:`${e}px`}})]})}function Je(r){const[s,t]=i.useState(!1),[n,e]=i.useState(!1);return i.useEffect(()=>{r?(e(!0),setTimeout(()=>t(!0),10)):(t(!1),setTimeout(()=>e(!1),150))},[r]),{show:s,shouldRender:n}}function Ye({isOpen:r,setIsOpen:s,filteredOptions:t,highlightedIndex:n,setHighlightedIndex:e,onSelect:a,triggerRef:l}){return{handleKeyDown:i.useCallback(d=>{var m;switch(d.key){case"ArrowDown":if(d.preventDefault(),!r)s(!0);else{const b=n<t.length-1?n+1:0;let u=b;for(let h=0;h<t.length;h++){const f=(b+h)%t.length;if(!t[f].disabled){u=f;break}}e(u)}break;case"ArrowUp":if(d.preventDefault(),!r)s(!0);else{const b=n>0?n-1:t.length-1;let u=b;for(let h=0;h<t.length;h++){const f=(b-h+t.length)%t.length;if(!t[f].disabled){u=f;break}}e(u)}break;case"Enter":case" ":if(d.preventDefault(),!r)s(!0);else if(n>=0&&n<t.length){const b=t[n];b.disabled||a(b)}break;case"Escape":d.preventDefault(),r&&(s(!1),(m=l.current)==null||m.focus());break;case"Tab":r&&s(!1);break}},[r,s,t,n,e,a,l])}}function Oe({isOpen:r,filteredOptions:s,selectedOption:t,shouldRender:n,optionsContainerRef:e}){const[a,l]=i.useState(-1),c=i.useMemo(()=>t?s.findIndex(d=>d.value===t.value):-1,[s,t]);return i.useEffect(()=>{r&&s.length>0?l(t&&c>=0?c:0):l(-1)},[s,r,t,c]),i.useEffect(()=>{if(a>=0&&e.current&&n){const d=()=>{const m=e.current,b=m==null?void 0:m.querySelector(`[data-option-index="${a}"]`);if(b){const u=r&&t&&a===c?"auto":"smooth";b.scrollIntoView({behavior:u,block:"nearest"})}};r&&n&&t?setTimeout(d,10):d()}},[a,n,r,t,s,e,c]),{highlightedIndex:a,setHighlightedIndex:l}}const fe={sm:{trigger:"px-2 py-1 text-sm",options:"px-2 py-2 text-xs"},md:{trigger:"px-3 py-2 text-base",options:"px-3 py-2.5 text-sm"},lg:{trigger:"px-4 py-3 text-lg",options:"px-4 py-3 text-base"}};function et({options:r,value:s,placeholder:t="Select an option...",searchable:n=!1,disabled:e=!1,clearable:a=!1,size:l="md",className:c,triggerClassName:d,dropdownClassName:m,id:b,ref:u,onChange:h,onSearch:f,searchPlaceholder:x="Search options..."}){const v=i.useId(),w=`${b??v}-listbox`,p=k=>`${w}-option-${k}`,[y,N]=i.useState(!1),[E,A]=i.useState(""),C=i.useRef(null),I=i.useRef(null),M=i.useRef(null),z=i.useRef(null),{show:H,shouldRender:L}=Je(y),T=i.useMemo(()=>!n||!E?r:r.filter(k=>{var $;return k.text.toLowerCase().includes(E.toLowerCase())||(($=k.description)==null?void 0:$.toLowerCase().includes(E.toLowerCase()))}),[r,n,E]),R=i.useMemo(()=>r.find(k=>k.value===s),[r,s]),{highlightedIndex:D,setHighlightedIndex:B}=Oe({isOpen:y,filteredOptions:T,selectedOption:R,shouldRender:L,optionsContainerRef:z}),P=D>=0?p(D):void 0;i.useEffect(()=>{y&&L&&n&&I.current&&I.current.focus()},[y,n,L]);const q=i.useCallback(k=>{var $;k.disabled||(h==null||h(k.value),N(!1),A(""),($=C.current)==null||$.focus())},[h]),{handleKeyDown:F}=Ye({isOpen:y,setIsOpen:N,filteredOptions:T,highlightedIndex:D,setHighlightedIndex:B,onSelect:q,triggerRef:C});i.useEffect(()=>{if(!y)return;const k=$=>{var Q;M.current&&!M.current.contains($.target)&&!((Q=C.current)!=null&&Q.contains($.target))&&(N(!1),A(""))};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[y]);const X=()=>{e||(N(!y),y||(A(""),B(-1)))},se=k=>{k.disabled||(h==null||h(k.value),N(!1),A(""))},oe=k=>{const $=k.target.value;A($),f==null||f($),B(-1)},ie=k=>{k.preventDefault(),k.stopPropagation(),h==null||h("")};return o.jsxs("div",{className:j.join("relative",c),id:b,ref:u,"data-select":"true","data-value":s,"data-searchable":n,"data-disabled":e,"data-clearable":a,children:[o.jsxs("div",{className:"relative",children:[o.jsxs("button",{ref:C,type:"button",className:j.join("flex items-center justify-between w-full text-left bg-inherit border border-border rounded-md transition-colors","hover:border-primary focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary",e&&"opacity-50 cursor-not-allowed hover:border-border",y&&"border-primary ring-1 ring-primary",fe[l].trigger,d),onClick:X,onKeyDown:F,disabled:e,"aria-disabled":e,"aria-haspopup":"listbox","aria-expanded":y,"aria-controls":y?w:void 0,"aria-activedescendant":y&&!n?P:void 0,"aria-label":R?R.text:t,"data-select-trigger":"true",children:[o.jsx("span",{className:j.join("block truncate",!R&&"opacity-70"),children:R?R.text:t}),o.jsx("div",{className:"flex items-center ml-2",children:o.jsx(W.ChevronDown,{size:16,className:j.join("transition-transform duration-200",y&&"rotate-180")})})]}),a&&R&&o.jsx("button",{type:"button",onClick:ie,className:"absolute right-8 top-1/2 -translate-y-1/2 p-0.5 rounded hover:bg-accent/20 transition-colors group z-10","aria-label":"Clear selection","data-select-clear":"true",children:o.jsx(ae.X,{size:14,className:"opacity-70 group-hover:opacity-100 transition-opacity"})})]}),L&&o.jsxs("div",{ref:M,className:j.join("absolute z-50 w-full mt-1 bg-popover border border-border rounded-md shadow-lg transition-all duration-150",H?"opacity-100 translate-y-0":"opacity-0 -translate-y-2",m),id:w,role:"listbox","data-select-content":"true",children:[n&&o.jsx("div",{className:"border-b border-border",children:o.jsx("input",{ref:I,type:"text",value:E,onChange:oe,onKeyDown:F,placeholder:x,className:"w-full px-2 py-2 text-inherit focus:outline-none","aria-autocomplete":"list","aria-controls":w,"aria-activedescendant":P,"data-select-search":"true"})}),o.jsx("div",{ref:z,className:"max-h-60 overflow-auto",children:T.length>0?T.map((k,$)=>o.jsxs("div",{id:p($),className:j.join("flex items-center cursor-pointer transition-colors","hover:bg-accent/10 focus:bg-accent/10",fe[l].options,k.disabled&&"opacity-50 cursor-not-allowed",$===D&&"bg-accent/20",s===k.value&&"bg-accent/30"),onClick:()=>se(k),role:"option","aria-selected":s===k.value,"aria-disabled":k.disabled,"data-select-option":"true","data-value":k.value,"data-highlighted":$===D,"data-option-index":$,children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"font-medium",children:k.text}),k.description&&o.jsx("div",{className:"text-xs opacity-70 mt-0.5",children:k.description})]}),s===k.value&&o.jsx(W.Check,{size:16,className:"ml-2 text-primary flex-shrink-0"})]},k.value)):o.jsx("div",{className:"px-3 py-2 text-sm opacity-70 text-center",children:n&&E?"No results found":"No options available"})})]})]})}const tt={thin:{horizontal:"h-px",vertical:"w-px"},medium:{horizontal:"h-0.5",vertical:"w-0.5"},thick:{horizontal:"h-1",vertical:"w-1"},"extra-thick":{horizontal:"h-2",vertical:"w-2"}},rt={horizontal:"w-full",vertical:"min-h-4 h-full"};function nt({orientation:r="horizontal",decorative:s=!1,thickness:t="thin",className:n,...e}){const a=j.join("shrink-0 bg-border",rt[r],tt[t][r],n);return o.jsx("div",{...e,className:a,role:s?"presentation":"separator","aria-orientation":s?void 0:r,"aria-hidden":s,"data-orientation":r,"data-thickness":t})}const me={shape:{rectangle:"rounded-md min-h-1",circle:"rounded-full aspect-square min-h-1",text:"rounded-sm min-h-1 h-4"},lineSpacing:{xs:"space-y-1",sm:"space-y-2",md:"space-y-3",lg:"space-y-4",xl:"space-y-6"}};function at({shape:r="rectangle",lineSpacing:s="sm",className:t,lines:n=1,animate:e=!0,ref:a,...l}){const c=j.join("bg-muted/70",e&&"animate-pulse",me.shape[r],t);return n>1?o.jsx("div",{ref:a,className:me.lineSpacing[s],role:"presentation","aria-hidden":"true","data-testid":"skeleton-container","data-lines":n,"data-shape":r,"data-animate":e,...l,children:Array.from({length:n},(d,m)=>o.jsx("div",{className:j.join(c,m===n-1&&"w-3/4"),role:"presentation","aria-hidden":"true","data-testid":"skeleton-line","data-line-index":m},m))}):o.jsx("div",{ref:a,className:c,role:"presentation","aria-hidden":"true","data-testid":"skeleton","data-shape":r,"data-animate":e,...l})}function st({id:r,value:s,defaultValue:t=0,onValueChange:n,min:e=0,max:a=100,step:l=1,disabled:c=!1,trackClassName:d,rangeClassName:m,thumbClassName:b,className:u,ref:h,ariaLabel:f,ariaLabelledBy:x,...v}){const[g,w]=i.useState(t),p=s!==void 0,y=p?s:g,N=i.useRef(null),E=i.useRef(!1),A=i.useRef(0),C=i.useCallback(T=>{const R=Math.max(e,Math.min(a,T)),D=Math.round(R/l)*l;p||w(D),n==null||n(D)},[e,a,l,p,n]),I=i.useCallback((T,R=!1)=>{var q;const D=(q=N.current)==null?void 0:q.getBoundingClientRect();if(!D)return y;let B=T.clientX;R&&(B=B-A.current);const P=Math.max(0,Math.min(1,(B-D.left)/D.width));return e+(a-e)*P},[e,a,y]),M=i.useCallback(T=>{if(c||T.target!==T.currentTarget)return;const R=I(T);C(R)},[c,I,C]),z=i.useCallback(T=>{var q;if(c)return;T.stopPropagation(),E.current=!0;const R=(q=N.current)==null?void 0:q.getBoundingClientRect(),D=T.currentTarget.getBoundingClientRect();if(R&&D){const F=D.left+D.width/2;A.current=T.clientX-F}T.currentTarget.setPointerCapture(T.pointerId);const B=F=>{if(!E.current)return;const X=I(F,!0);C(X)},P=F=>{if(F.pointerId===T.pointerId){E.current=!1,A.current=0;try{T.currentTarget.releasePointerCapture(F.pointerId)}catch{}document.removeEventListener("pointermove",B),document.removeEventListener("pointerup",P)}};document.addEventListener("pointermove",B),document.addEventListener("pointerup",P)},[c,I,C]),H=i.useCallback(T=>{if(c)return;let R=y;switch(T.key){case"ArrowRight":case"ArrowUp":R=y+l;break;case"ArrowLeft":case"ArrowDown":R=y-l;break;case"Home":R=e;break;case"End":R=a;break;case"PageUp":R=y+l*10;break;case"PageDown":R=y-l*10;break;default:return}T.preventDefault(),C(R)},[c,y,l,e,a,C]),L=a===e?0:(y-e)/(a-e)*100;return o.jsx("div",{id:r,ref:h,className:S.n("relative flex items-center w-full touch-none select-none",c&&"opacity-50 cursor-not-allowed",u),"data-disabled":c,"data-value":y,"data-min":e,"data-max":a,"data-step":l,...v,children:o.jsxs("div",{ref:N,className:S.n("relative h-1.5 w-full rounded-full bg-muted cursor-pointer",c&&"cursor-not-allowed",d),onPointerDown:M,children:[o.jsx("div",{className:S.n("absolute h-full rounded-full pointer-events-none",!E.current&&"transition-all",m),style:{width:`${L}%`}}),o.jsx("div",{className:S.n("absolute size-5 -top-2 rounded-full shadow-md cursor-grab",c&&"cursor-not-allowed",!c&&"cursor-grab focus:outline-none focus:ring-2",E.current?"cursor-grabbing scale-110":"transition-all",b),style:{left:`calc(${L}% - 10px)`},tabIndex:c?-1:0,role:"slider","aria-valuemin":e,"aria-valuemax":a,"aria-valuenow":y,"aria-label":f,"aria-labelledby":x,"aria-disabled":c,onKeyDown:H,onPointerDown:z})]})})}function ot({children:r,ref:s,...t}){if(i.isValidElement(r)){let n={...t};return r.props&&(n={...n,...r.props}),i.cloneElement(r,{...n,ref:e=>{typeof s=="function"?s(e):s&&(s.current=e)}})}return i.createElement("div",{...t,ref:s},r)}const it=({defaultValue:r,value:s,onValueChange:t}={})=>{const[n,e]=i.useState(r||""),a=s!==void 0,l=a?s:n,c=i.useCallback(d=>{a||e(d),t==null||t(d)},[a,t]);return{value:l,onValueChange:c}};function lt({defaultValue:r,value:s,onValueChange:t,tabsWidth:n="fit",variant:e="underline",className:a,children:l,ref:c,id:d,triggersClassName:m,contentClassName:b}){const{value:u,onValueChange:h}=it({defaultValue:r,value:s,onValueChange:t}),f={selectedValue:u,onValueChange:h,tabsWidth:n,variant:e,triggersClassName:m,contentClassName:b};return o.jsx(S.TabsContext.Provider,{value:f,children:o.jsx("div",{id:d,ref:c,className:a,"data-tabs-width":n,"data-variant":e,children:l})})}function ct({value:r,className:s,children:t,ref:n}){const{selectedValue:e,contentClassName:a}=S.useTabsContext(),l=e===r;return l?o.jsx("div",{ref:n,role:"tabpanel",id:`tabs-content-${r}`,"aria-labelledby":`tabs-trigger-${r}`,"data-state":l?"active":"inactive","data-value":r,className:j.join("mt-4 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2",a,s),tabIndex:0,children:t}):null}const be={width:{fit:"w-fit",full:"w-full *:flex-1"},variant:{underline:"border-b border-border",pills:"",bordered:"border border-border rounded-lg p-1"}},ut={underline:"border-b-2 border-transparent data-[state=active]:border-accent data-[state=active]:text-accent hover:text-accent-foreground",pills:"rounded-md data-[state=active]:bg-accent data-[state=active]:text-accent-foreground hover:bg-accent/30",bordered:"rounded data-[state=active]:bg-accent data-[state=active]:text-accent-foreground hover:bg-accent/30"};function dt({children:r,className:s,id:t,ref:n}){const{tabsWidth:e,variant:a}=S.useTabsContext();return o.jsx("div",{id:t,ref:n,role:"tablist",className:j.join("flex",be.width[e],be.variant[a],s),"data-tabs-width":e,"data-variant":a,children:r})}function ft({value:r,disabled:s=!1,className:t,children:n,onClick:e,id:a,ref:l}){const{selectedValue:c,onValueChange:d,variant:m,triggersClassName:b}=S.useTabsContext(),u=c===r,h=x=>{s||d(r),e==null||e(x)};return o.jsx("button",{id:a,ref:l,role:"tab",type:"button","aria-selected":u,"aria-controls":`tabs-content-${r}`,"data-state":u?"active":"inactive","data-value":r,disabled:s,className:j.join("inline-flex items-center justify-center whitespace-nowrap px-3 py-2 text-sm ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",u?"font-medium":"font-light",ut[m],b,t),onClick:h,children:n})}function mt({elementId:r,maxLength:s}){const[t,n]=i.useState(0);return i.useEffect(()=>{const e=document.getElementById(r);if(!e)return;const a=()=>{const l=e.value.length;n(l);const c=l>=s;e.setAttribute("aria-describedby",`${r}-character-count`),e.setAttribute("aria-invalid",c?"true":"false"),c?e.setAttribute("data-error","true"):e.removeAttribute("data-error")};return a(),e.addEventListener("input",a),e.setAttribute("maxlength",String(s)),()=>{e.removeEventListener("input",a),e.removeAttribute("maxlength"),e.removeAttribute("aria-describedby"),e.removeAttribute("aria-invalid"),e.removeAttribute("data-error")}},[r,s]),o.jsx("small",{className:j.join("mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-end",t>=s&&"text-destructive",t<s&&"text-current"),role:"status",children:o.jsxs("span",{id:`${r}-character-count`,children:[t," / ",s," characters"]})})}function bt(r,s){i.useEffect(()=>{const t=document.getElementById(r);if(!t)return;if(!s){t.style.height="auto";return}const n=()=>{t.style.height="auto",t.style.height=`${t.scrollHeight}px`};return n(),t.addEventListener("input",n),t.addEventListener("resize",n),window.addEventListener("resize",n),()=>{t.removeEventListener("input",n),t.removeEventListener("resize",n),window.removeEventListener("resize",n)}},[r,s])}const ht={base:"","left-line":"border-l border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success",outline:"border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success"},xt={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"px-3 rounded-full"},he={variant:"outline",rounded:"none"};function vt({variant:r=he.variant,rounded:s,displayOnlyMode:t=!1,errorMessage:n,successMessage:e,hideResizeHandle:a=!1,autoExpand:l=!1,characterLimit:c=0,className:d,...m}){const b=i.useId();bt(b,l||t);let u=s;r==="outline"&&!s&&(u="md"),u=u||he.rounded;let h=a;(t||r==="left-line"&&!a)&&(h=!0);const x=j.join("appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all",!t&&ht[r],!t&&xt[u],!t&&"px-2 py-1",t&&"pointer-events-none",h&&"no-resize-handle",d);return o.jsxs("div",{className:j.join("-space-y-1.5",t&&"cursor-text"),children:[o.jsx("textarea",{...m,id:b,"aria-disabled":m.disabled,readOnly:t,"aria-readonly":t||m["aria-readonly"],style:{resize:l?"none":void 0},className:x}),c>0&&o.jsx(mt,{elementId:b,maxLength:c}),!t&&o.jsx(ne,{elementId:b,type:"error",message:n}),!t&&o.jsx(ne,{elementId:b,type:"success",message:e})]})}const gt={sm:{container:"h-5 min-w-9 w-9",thumb:"h-4 w-4",translate:"translate-x-4"},md:{container:"h-6 min-w-11 w-11",thumb:"h-5 w-5",translate:"translate-x-5"},lg:{container:"h-7 min-w-13 w-13",thumb:"h-6 w-6",translate:"translate-x-6"}},pt={default:{unchecked:"bg-muted",checked:"bg-primary"},success:{unchecked:"bg-muted",checked:"bg-success"},destructive:{unchecked:"bg-muted",checked:"bg-destructive"}},xe={variant:"default",size:"md"};function yt({ref:r,id:s,size:t=xe.size,variant:n=xe.variant,checked:e,onCheckedChange:a,disabled:l=!1,className:c,thumbClassName:d,backgroundClassNames:m,...b}){const u=i.useId(),h=i.useMemo(()=>s||`toggle-${u}`,[s,u]),[f,x]=i.useState(e);i.useEffect(()=>{x(e)},[e]);const v=()=>{if(!l){const E=!f;e===void 0&&x(E),a==null||a(E)}},g=E=>{(E.key===" "||E.key==="Enter")&&(E.preventDefault(),v())},w=gt[t],p=pt[n],y=j.join("relative inline-flex items-center rounded-full transition-all duration-200 ease-in-out","focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",w.container,f?(m==null?void 0:m.checked)||p.checked:(m==null?void 0:m.unchecked)||p.unchecked,l&&"opacity-50 cursor-not-allowed",!l&&"cursor-pointer",c),N=j.join("absolute left-0.5 top-1/2 -translate-y-1/2 rounded-full bg-white shadow-sm transition-transform duration-200 ease-in-out",w.thumb,f&&w.translate,d);return o.jsxs("button",{ref:r,id:h,type:"button",role:"switch",tabIndex:0,"aria-checked":f,"aria-disabled":l,disabled:l,onClick:v,onKeyDown:g,className:y,...b,children:[o.jsx("span",{className:N}),o.jsx("span",{className:"sr-only",children:f?"Enabled":"Disabled"})]})}const O=8,ee=4,G=6;function wt(r){return{calculatePosition:i.useCallback((t,n)=>{const e=t.getBoundingClientRect(),a=n.getBoundingClientRect(),l={width:window.innerWidth,height:window.innerHeight},c=(h,f,x,v)=>h<0||f<0||h+x>l.width||f+v>l.height,d={top:{x:e.left+e.width/2-a.width/2,y:e.top-a.height-ee,arrow:{x:a.width/2-G,y:a.height}},bottom:{x:e.left+e.width/2-a.width/2,y:e.bottom+ee,arrow:{x:a.width/2-G,y:-6}},left:{x:e.left-a.width-ee,y:e.top+e.height/2-a.height/2,arrow:{x:a.width,y:a.height/2-G}},right:{x:e.right+ee,y:e.top+e.height/2-a.height/2,arrow:{x:-6,y:a.height/2-G}}};let m=r,b=d[r];if(c(b.x,b.y,a.width,a.height)){const h={top:"bottom",bottom:"top",left:"right",right:"left"},f=d[h[r]];if(!c(f.x,f.y,a.width,a.height))m=h[r],b=f;else{const x=["top","bottom","left","right"].filter(v=>v!==r&&v!==h[r]);for(const v of x){const g=d[v];if(!c(g.x,g.y,a.width,a.height)){m=v,b=g;break}}}}b.x=Math.max(O,Math.min(b.x,l.width-a.width-O)),b.y=Math.max(O,Math.min(b.y,l.height-a.height-O));const u={x:e.left+e.width/2,y:e.top+e.height/2};return m==="top"||m==="bottom"?b.arrow.x=Math.max(G,Math.min(u.x-b.x-G,a.width-G*2)):b.arrow.y=Math.max(G,Math.min(u.y-b.y-G,a.height-G*2)),{...b,placement:m}},[r])}}function jt(r,s,t){const n=i.useRef(null),e=i.useRef(null),a=i.useCallback(()=>{if(!n.current||!e.current)return;const l=r(n.current,e.current);t(l)},[r,t]);return i.useEffect(()=>{if(!s)return;const l=()=>a();return window.addEventListener("resize",l),()=>{window.removeEventListener("resize",l)}},[s,a]),{triggerRef:n,tooltipRef:e,updatePosition:a}}function Nt(r,s,t,n,e,a,l,c,d){const m=i.useRef(null),b=i.useCallback(()=>{r||(m.current&&clearTimeout(m.current),m.current=window.setTimeout(()=>{t(!0),requestAnimationFrame(()=>{e(),n(!0)})},s))},[r,s,t,e,n]),u=i.useCallback((h=!1)=>{if(m.current&&clearTimeout(m.current),h){n(!1),setTimeout(()=>t(!1),150);return}m.current=window.setTimeout(()=>{n(!1),setTimeout(()=>t(!1),150)},100)},[n,t]);return i.useEffect(()=>{!a&&!l&&!c&&d&&u()},[a,l,c,d,u]),i.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]),{showTooltip:b,hideTooltip:u,timeoutRef:m}}function Et({id:r,children:s,message:t,placement:n="top",disabled:e=!1,delay:a=200,className:l}){const[c,d]=i.useState(!1),[m,b]=i.useState(!1),[u,h]=i.useState(null),[f,x]=i.useState(!1),[v,g]=i.useState(!1),[w,p]=i.useState(!1),{calculatePosition:y}=wt(n),{triggerRef:N,tooltipRef:E,updatePosition:A}=jt(y,m,h),{showTooltip:C,hideTooltip:I,timeoutRef:M}=Nt(e,a,b,d,A,f,v,w,c),z=i.useId(),H=r??z;return o.jsxs(o.Fragment,{children:[i.cloneElement(s,{ref:L=>{N.current=L},onMouseEnter:()=>{x(!0),C()},onMouseLeave:()=>{x(!1)},onFocus:()=>{p(!0),C()},onBlur:()=>{p(!1),I(!0)},onKeyDown:L=>{L.key==="Escape"&&I(!0)},"aria-describedby":e?void 0:H}),m&&ce.createPortal(o.jsx("div",{ref:E,id:H,role:"tooltip",className:j.join("fixed z-50 px-2 py-1 text-sm rounded shadow-lg bg-popover pointer-events-auto transition-all duration-150 ease-out",c?"opacity-100":"opacity-0",l),style:u?{left:u.x,top:u.y}:{opacity:0},onMouseEnter:()=>{g(!0),M.current&&clearTimeout(M.current)},onMouseLeave:()=>{g(!1)},children:t}),document.body)]})}exports.ActionModal=S.ActionModal;exports.Toast=S.Toast;exports.Accordion=we;exports.AccordionItem=te;exports.Button=ge;exports.ButtonLoadingDots=ve;exports.Carousel=Se;exports.Checkbox=Te;exports.Clickable=Re;exports.Input=$e;exports.Label=De;exports.Modal=We;exports.Pagination=He;exports.Panel=Xe;exports.RadioGroup=_e;exports.RadioGroupItem=re;exports.RadioInput=pe;exports.ScrollArea=Ze;exports.Select=et;exports.Separator=nt;exports.Skeleton=at;exports.Slider=st;exports.Slot=ot;exports.Tabs=lt;exports.TabsContent=ct;exports.TabsList=dt;exports.TabsTrigger=ft;exports.Textarea=vt;exports.Toggle=yt;exports.Tooltip=Et;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),i=require("react"),j=require("./utils.cjs.js"),W=require("./QuestionMarkCircled-D3gPieJ7.cjs"),S=require("./Toast-BDQ9mOuz.cjs"),ae=require("./X-CgjeP2OI.cjs"),ce=require("react-dom");function te({id:r,title:s,content:t,children:n,className:e="",disabled:a=!1,isOpen:l=!1,onToggle:c,triggerClassName:d="",bodyClassName:m=""}){const b=i.useId(),u=r||`accordion-item-${b}`,h=`${u}-header`,f=`${u}-panel`,x=()=>{!a&&c&&c()},v=g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),x())};return o.jsxs("div",{className:j.join("border-b border-gray-200",a&&"opacity-60 cursor-not-allowed",e),children:[o.jsxs("button",{id:h,type:"button",className:j.join("w-full text-left py-3 px-4 flex justify-between items-center focus:outline focus:outline-secondary",a?"cursor-not-allowed":"hover:bg-gray-50/10 cursor-pointer",d),"aria-expanded":l,"aria-controls":f,disabled:a,onClick:x,onKeyDown:v,children:[o.jsx("span",{children:s}),o.jsx("span",{className:j.join("transform transition-transform duration-300 ease-linear",l?"rotate-180":"rotate-0"),"aria-hidden":"true",children:o.jsx(W.ChevronDown,{size:18})})]}),o.jsx("div",{id:f,role:"region","aria-labelledby":h,className:j.join("transition-all duration-300 ease-linear px-4",l?"max-h-96 opacity-100 overflow-auto py-3":"max-h-0 opacity-0 overflow-hidden",m),children:l&&(n||t)})]})}function we({id:r,items:s=[],children:t,className:n="",itemClassName:e="",allowMultiple:a=!1,defaultOpenItems:l=[],triggersClassName:c="",bodiesClassName:d=""}){const m=i.useId(),b=r||`accordion-group-${m}`,[u,h]=i.useState(new Set(l)),f=g=>{h(w=>{const p=new Set(w);return p.has(g)?p.delete(g):(a||p.clear(),p.add(g)),p})},x=g=>`${m}-item-${g}`,v=g=>u.has(g);return o.jsxs("div",{id:b,className:n,children:[s.length>0&&s.map((g,w)=>{const p=g.id||x(w);return o.jsx(te,{id:p,title:g.title,content:g.content,disabled:g.disabled,isOpen:v(p),onToggle:()=>f(p),className:e,triggerClassName:c,bodyClassName:d},p)}),s.length===0&&t&&i.Children.map(t,(g,w)=>{if(i.isValidElement(g)&&g.type===te){const p=g.props.id||x(w);return i.createElement(te,{...g.props,key:p,id:p,className:j.join(e,g.props.className),isOpen:v(p),onToggle:()=>f(p),triggerClassName:j.join(c,g.props.triggerClassName),bodyClassName:j.join(d,g.props.bodyClassName)})}return null})]})}function ve(){const[r,s]=i.useState(0);return i.useEffect(()=>{const t=setInterval(()=>{s(n=>(n+1)%3)},500);return()=>clearInterval(t)},[]),o.jsx("div",{className:"absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle",children:[0,1,2].map(t=>o.jsx("div",{className:j.join("rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current",r===t&&"transform -translate-y-1")},t))})}const je={base:"",primary:"bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80",tertiary:"text-primary hover:text-primary-foreground disabled:text-muted",outline:"border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted",link:"underline-offset-4 hover:underline disabled:underline disabled:text-muted",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground"},Ne={stripped:"",fitted:"size-fit",sm:"px-2 py-1 text-sm",md:"px-4 py-2 text-base",lg:"px-6 py-3 text-lg",icon:"p-1 w-fit aspect-square",full:"p-2 w-full"},Ee={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},le={variant:"primary",size:"md",rounded:"md"};function ge({variant:r=le.variant,size:s,rounded:t=le.rounded,loading:n,linkTo:e,linkProps:a,type:l="button",className:c,...d}){let m;r==="link"&&!s?m="fitted":m=s||le.size;const u=j.join("appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",je[r],Ne[m],Ee[t],n&&"relative pointer-events-none",e&&"relative",c);return o.jsxs("button",{...d,role:e?"link":d.role,"aria-label":d["aria-label"]||(a==null?void 0:a["aria-label"]),"aria-description":d["aria-description"]||(a==null?void 0:a["aria-description"]),"aria-disabled":d.disabled||n,"aria-busy":n,type:l,className:u,children:[n&&o.jsx(ve,{}),o.jsx("span",{className:j.join(n&&"invisible"),children:d.children}),e&&!d.disabled&&o.jsx("a",{...a,"aria-hidden":!0,href:e,rel:(a==null?void 0:a.rel)||"noreferrer",className:"absolute inset-0"})]})}function ke({totalItems:r,itemsToShow:s,infinite:t,autoScroll:n,scrollInterval:e,pauseScrollOnHover:a,currentIndex:l,onIndexChange:c}){const[d,m]=i.useState(l||0),[b,u]=i.useState(!1),h=i.useRef(null),f=Math.ceil(r/s),x=t||d>0,v=t||d<f-1,g=i.useCallback(y=>{const N=Math.max(0,Math.min(y,f-1));m(N),c==null||c(N)},[f,c]),w=i.useCallback(()=>{if(x){const y=d===0&&t?f-1:d-1;g(y)}},[d,x,t,f,g]),p=i.useCallback(()=>{if(v){const y=d===f-1&&t?0:d+1;g(y)}},[d,v,t,f,g]);return i.useEffect(()=>{l!==void 0&&l!==d&&m(l)},[l,d]),i.useEffect(()=>{if(!n)return;const y=()=>{h.current=setInterval(()=>{a&&b||p()},e)},N=()=>{h.current&&(clearInterval(h.current),h.current=null)};return!b||!a?y():N(),N},[n,e,a,b,p]),i.useEffect(()=>{m(0)},[s]),{currentSlide:d,canGoPrev:x,canGoNext:v,goToPrev:w,goToNext:p,goToSlide:g,isHovered:b,setIsHovered:u}}const _={xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function Ce(){const[r,s]=i.useState(),[t,n]=i.useState(0),e=a=>_[a];return i.useEffect(()=>{const a=c=>c>=_["2xl"]?"2xl":c>=_.xl?"xl":c>=_.lg?"lg":c>=_.md?"md":c>=_.sm?"sm":"xs";s(a(window.innerWidth)),n(window.innerWidth);const l=()=>{s(a(window.innerWidth)),n(window.innerWidth)};return window.addEventListener("resize",l),()=>{window.removeEventListener("resize",l)}},[]),{screenSize:r,screenWidth:t,getBreakpoint:e}}const J={sm:{button:"h-6 w-6 text-xs",icon:"size-3"},md:{button:"h-8 w-8 text-sm",icon:"size-4"},lg:{button:"h-10 w-10 text-lg",icon:"size-5"}},ue={default:"bg-accent text-accent-foreground hover:bg-accent-foreground hover:text-accent",outline:"border border-border bg-background hover:bg-accent hover:text-accent-foreground hover:border-accent",ghost:"hover:text-accent"},Y={aligned:{prev:"absolute top-1/2 -translate-x-1/2 -translate-y-1/2 z-10",next:"absolute right-0 top-1/2 translate-x-1/2 -translate-y-1/2 z-10"},exterior:{prev:"absolute -left-10 top-1/2 -translate-y-1/2 z-10",next:"absolute -right-10 top-1/2 -translate-y-1/2 z-10"},interior:{prev:"absolute left-2 top-1/2 -translate-y-1/2 z-10",next:"absolute right-2 top-1/2 -translate-y-1/2 z-10"}};function Se({children:r,id:s,ref:t,className:n,autoScroll:e=!1,scrollInterval:a=3e3,pauseScrollOnHover:l=!0,currentIndex:c,onIndexChange:d,hidePrevNext:m=!1,hideDots:b=!1,itemsToShow:u=1,buttonSize:h="md",buttonVariant:f="default",buttonPosition:x="exterior",infinite:v=!0,prevButton:g,nextButton:w,itemsClassName:p,containerClassName:y,dotsClassName:N,gap:E=8}){var $,Q;const A=i.useRef(null),C=i.Children.toArray(r).filter(i.isValidElement),I=C.length,{screenSize:M}=Ce(),z=i.useMemo(()=>{if(typeof u=="number")return u;if(typeof u=="object"&&u&&M){const K=["2xl","xl","lg","md","sm","xs"],V=K.indexOf(M);for(let U=V;U<K.length;U++){const Z=K[U];if(u[Z]!==void 0)return u[Z]}}return 1},[u,M]),{currentSlide:H,canGoPrev:L,canGoNext:T,goToPrev:R,goToNext:D,goToSlide:B,setIsHovered:P}=ke({totalItems:I,itemsToShow:z,infinite:v,autoScroll:e,scrollInterval:a,pauseScrollOnHover:l,currentIndex:c,onIndexChange:d}),q=i.useCallback(K=>{if(z===1)return{leftWidth:0,rightWidth:0,widthReduction:0};const V=E*(z-1)/z;return K%z===0?{leftWidth:0,rightWidth:E/2,widthReduction:V}:K%z===z-1?{leftWidth:E/2,rightWidth:0,widthReduction:V}:{leftWidth:E/2,rightWidth:E/2,widthReduction:V}},[z,E]),F=()=>{R()},X=()=>{D()},se=()=>{l&&P(!0)},oe=()=>{l&&P(!1)},ie=-(H*(100/I)*z),k=j.join("inline-flex items-center justify-center rounded-md font-medium transition-all focus-visible:outline-none focus-visible:ring focus-visible:ring-ring disabled:pointer-events-none",x==="aligned"?"disabled:opacity-90":"disabled:opacity-50");return o.jsxs("div",{className:j.join("relative",n),"data-carousel-wrapper":"true",children:[!m&&o.jsx(o.Fragment,{children:g?i.cloneElement(g,{onClick:F,disabled:!L,className:j.join((($=g.props)==null?void 0:$.className)||"",Y[x].prev),role:"button","aria-disabled":!L,"aria-label":"Previous slide","data-carousel-prev":"true"}):o.jsx("button",{type:"button",onClick:F,disabled:!L,className:j.join(k,J[h].button,ue[f],Y[x].prev),"aria-disabled":!L,"aria-label":"Previous slide","data-carousel-prev":"true",children:o.jsx(W.ChevronLeft,{className:J[h].icon})})}),o.jsxs("div",{id:s,ref:t,className:j.join("relative overflow-hidden",y),onMouseEnter:se,onMouseLeave:oe,"data-carousel":"true","data-current-index":H,"data-items-to-show":z,"data-auto-scroll":e,"data-button-position":x,children:[o.jsx("div",{ref:A,className:"flex transition-transform duration-300 ease-in-out",style:{transform:`translateX(${ie}%)`,width:`${I/z*100}%`},children:C.map((K,V)=>{const{leftWidth:U,rightWidth:Z,widthReduction:ye}=q(V);return o.jsx("div",{className:j.join("flex-shrink-0",p),style:{width:`calc(${100/I}% - ${ye}px)`,marginRight:Z>0?`${Z}px`:void 0,marginLeft:U>0?`${U}px`:void 0},"data-slide-index":V,children:K},V)})}),!b&&o.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 flex space-x-2",children:Array.from({length:Math.ceil(I/z)}).map((K,V)=>o.jsx("button",{type:"button",onClick:()=>B(V),className:j.join("w-2 h-2 rounded-full transition-colors duration-200",V===H?"bg-accent":"bg-muted hover:bg-muted-foreground/50",N),"aria-label":`Go to slide ${V+1}`,"data-carousel-dot":V},V))})]}),!m&&o.jsx(o.Fragment,{children:w?i.cloneElement(w,{onClick:X,disabled:!T,className:j.join(((Q=w.props)==null?void 0:Q.className)||"",Y[x].next),role:"button","aria-disabled":!T,"aria-label":"Next slide","data-carousel-next":"true"}):o.jsx("button",{type:"button",onClick:X,disabled:!T,className:j.join(k,J[h].button,ue[f],Y[x].next),"aria-disabled":!T,"aria-label":"Next slide","data-carousel-next":"true",children:o.jsx(W.ChevronRight,{className:J[h].icon})})})]})}function Ie(r){const[s,t]=i.useState(""),n=i.useCallback(e=>{let a=e,l="";for(;a&&!l;){const c=window.getComputedStyle(a).backgroundColor;c&&c!=="transparent"&&c!=="rgba(0, 0, 0, 0)"&&(l=c),a=a.parentElement}return l||"transparent"},[]);return i.useEffect(()=>{const e=document.getElementById(r);if(e){const a=n(e.parentElement);t(a)}},[r,n]),s}function Te({ref:r,id:s,size:t=20,color:n,filled:e=!1,rounded:a=!0,checked:l=!1,onCheckedChange:c,disabled:d,className:m="",...b}){const u=i.useId(),h=i.useMemo(()=>s||`checkbox-${u}`,[s,u]),f=Ie(h),[x,v]=i.useState(l);i.useEffect(()=>{v(l)},[l]);const g=()=>{d||(v(!x),c==null||c(!x))},w=y=>{y.key===" "&&(y.preventDefault(),g())},p=j.join("flex items-center justify-center border outline outline-transparent focus:outline-current focus:outline-offset-2",a&&"rounded",d&&"opacity-40 cursor-not-allowed",!d&&"cursor-pointer",m);return o.jsx("button",{id:h,type:"button",ref:r,tabIndex:0,role:"checkbox",onClick:g,"aria-checked":x,"aria-disabled":d,onKeyDownCapture:w,style:{width:t,height:t,color:n,backgroundColor:x&&e?"currentcolor":"transparent"},className:p,...b,children:x&&o.jsx(W.Check,{size:t,color:e?f:void 0})})}function Re({children:r,className:s,linkTo:t,linkProps:n,onButtonClick:e,buttonProps:a,...l}){return t&&e&&console.warn('Clickable: Both "linkTo" and "onButtonClick" props are provided. Only "linkTo" will be used.'),o.jsxs("div",{className:j.join("relative w-fit",s),...l,children:[r,t&&o.jsx("a",{...n,rel:(n==null?void 0:n.rel)||"noreferrer",href:t,className:j.join("absolute inset-0",n==null?void 0:n.className)}),!t&&e&&o.jsx("button",{...a,type:"button",onClick:e,className:j.join("absolute inset-0 cursor-pointer",a==null?void 0:a.className)})]})}function ne({elementId:r,type:s,message:t}){return i.useEffect(()=>{const n=document.getElementById(r);if(n){if(!t&&s==="error"){n.removeAttribute("data-error");return}if(!t&&s==="success"){n.removeAttribute("data-success");return}return n.setAttribute("aria-describedby",`${r}-${s}-message`),n.setAttribute("aria-invalid",s==="error"?"true":"false"),s==="error"&&n.setAttribute("data-error","true"),s==="success"&&n.setAttribute("data-success","true"),()=>{n.removeAttribute("aria-describedby"),n.removeAttribute("aria-invalid"),n.removeAttribute("data-error"),n.removeAttribute("data-success")}}},[r,s,t]),t?o.jsxs("small",{className:j.join("mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-start",s==="error"&&"text-destructive",s==="success"&&"text-success"),role:"status",children:[s==="error"?o.jsx(ae.ExclamationTriangle,{}):o.jsx(W.CheckCircled,{}),o.jsx("span",{id:`${r}-${s}-message`,children:t})]}):null}const Ae={base:"",default:"ring ring-transparent focus:ring-primary-foreground not-disabled:data-error:ring-destructive not-disabled:data-success:ring-success",underline:"border-b border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success",outline:"border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success"},ze={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"px-3 rounded-full"},de={variant:"default",rounded:"none"};function $e({variant:r=de.variant,rounded:s,displayOnlyMode:t=!1,errorMessage:n,successMessage:e,type:a="text",className:l,...c}){const d=i.useId(),[m,b]=i.useState(!1);let u=s;r==="outline"&&!s&&(u="md"),u=u||de.rounded;const x=j.join("appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all","file:mr-2 file:border-0 file:rounded-md file:px-1.5 file:py-1 file:bg-primary hover:file:bg-primary/85 file:text-sm file:font-medium file:text-foreground file:transition-colors",!t&&Ae[r],!t&&ze[u],a==="password"&&"pr-10",!t&&"px-2 py-1",t&&"pointer-events-none",l);return o.jsxs("div",{className:j.join(t&&"cursor-text"),style:{height:c.height,width:c.width},children:[o.jsxs("div",{className:j.join(a==="password"&&"relative"),children:[o.jsx("input",{...c,id:d,type:a==="password"&&m?"text":a,"aria-disabled":c.disabled,readOnly:t,"aria-readonly":t||c["aria-readonly"],"data-error":n?!0:void 0,"data-success":e?!0:void 0,className:x}),a==="password"&&o.jsx("button",{onClick:()=>b(!m),className:"absolute inset-y-0 right-0 px-2 hover:cursor-pointer","aria-label":"Toggle password visibility","data-state":m?"visible":"hidden",children:m?o.jsx(W.EyeOpened,{size:20}):o.jsx(W.EyeClosed,{size:20})})]}),!t&&o.jsx(ne,{elementId:d,type:"error",message:n}),!t&&o.jsx(ne,{elementId:d,type:"success",message:e})]})}function De({display:r="inline",width:s="fit-content",className:t="",required:n,helpMessage:e,suffix:a,htmlFor:l,children:c,description:d,...m}){var v,g;const b=i.useId(),u=(((v=e==null?void 0:e.trim())==null?void 0:v.length)||0)>0,h=(((g=d==null?void 0:d.trim())==null?void 0:g.length)||0)>0,f=u?`${l??b}-help`:void 0,x=h?`${l??b}-description`:void 0;return o.jsxs("div",{style:{display:r==="inline"?"inline-block":"block",width:s},className:j.join("mb-0.5",t),children:[o.jsxs("div",{className:"relative flex",children:[o.jsxs("label",{className:"font-medium",htmlFor:l,...m,children:[c,n&&o.jsx("span",{className:"text-red-500 font-medium ml-1","aria-label":"required",children:"*"})]}),u&&o.jsx("span",{className:"text-gray-500 ml-1 size-fit -translate-y-1/3","aria-describedby":f,"aria-label":"Help information",title:e,children:o.jsx(W.QuestionMarkCircled,{})}),u&&o.jsx("div",{id:f,className:"sr-only",children:e}),a&&o.jsx("span",{className:"ml-1",children:a})]}),h&&o.jsx("small",{id:x,className:"block opacity-80 mt-0.5",role:"note",children:d})]})}function Le(r){const[s,t]=i.useState(!1),[n,e]=i.useState(!1);return i.useEffect(()=>{r?(e(!0),setTimeout(()=>t(!0),10)):(t(!1),setTimeout(()=>e(!1),150))},[r]),{show:s,shouldRender:n}}function Ve(r,s){i.useEffect(()=>{const t=n=>{n.key==="Escape"&&r&&s()};return document.addEventListener("keydown",t),r&&(document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",t),document.body.style.overflow="auto"}},[r,s])}function Me(r,s){const t=i.useRef(null),n=i.useCallback(()=>{const e=document.getElementById(r);if(!e)return;const a=e.querySelectorAll('[data-modal-action="true"]');if(a.length>0){a[0].focus();return}const l=e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(l.length>0){const c=Array.from(l).filter(d=>!(d instanceof HTMLButtonElement&&d.getAttribute("data-modal-close-button")==="true"));if(c.length>0){c[0].focus();return}l[0].focus();return}e.focus()},[r]);i.useEffect(()=>(s&&(t.current=document.activeElement,n()),()=>{document.body.style.overflow="auto",t.current instanceof HTMLElement&&t.current.focus()}),[s,n])}function We({id:r,isOpen:s,onClose:t,title:n,children:e,contentOnly:a=!1,className:l,overlayClassName:c,hideCloseButton:d=!1,actions:m=[],disableCloseOnOverlayClick:b=!1,ariaLabelledBy:u,ariaDescribedBy:h}){const f=i.useId(),x=r||`modal-${f}`,v=r?`${r}-title`:`modal-title-${f}`,{show:g,shouldRender:w}=Le(s);if(Me(x,w),Ve(w,t),!w)return null;const p=()=>n?i.isValidElement(n)?o.jsx("div",{className:"mb-4",children:n}):o.jsx("h2",{className:"mb-4 text-xl font-semibold",id:v,children:n}):null,y=()=>m.length===0?null:o.jsx("div",{className:"mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3",children:m.map((N,E)=>{const{label:A,className:C,...I}=N;return o.jsx(ge,{className:C,type:"button",...I,"data-modal-action":"true",children:A},E)})});return o.jsx(o.Fragment,{children:ce.createPortal(o.jsx("div",{"aria-labelledby":u??n?v:void 0,"aria-describedby":h,role:"dialog","aria-modal":"true",className:"fixed inset-0 z-[100] overflow-y-auto",children:o.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[o.jsx("div",{className:S.n("fixed inset-0 bg-black/20 transition-all",c),onClick:()=>{b||t()}}),a&&o.jsx("div",{className:S.n("relative w-fit",l),children:e}),!a&&o.jsxs("div",{id:x,tabIndex:-1,className:S.n("relative w-full max-w-xl transform rounded-lg shadow-xl bg-popover transition-all p-6 focus:ring ease-in duration-75",g?"opacity-100 scale-100":"opacity-0 scale-90",l),children:[!d&&o.jsx("button",{type:"button",onClick:t,"data-modal-close-button":"true",className:"rounded-md p-0.5 top-2.5 right-2.5 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0",children:o.jsx(ae.X,{size:18})}),p(),e,y()]})]})}),document.body)})}const Be={link:"text-primary hover:text-primary-foreground hover:bg-primary/10 aria-current:text-primary-foreground aria-current:bg-primary",outline:"border border-primary text-primary hover:bg-primary hover:text-primary-foreground aria-current:bg-primary aria-current:text-primary-foreground aria-current:border-primary",filled:"bg-secondary text-secondary-foreground hover:bg-primary hover:text-primary-foreground aria-current:bg-primary aria-current:text-primary-foreground"},Fe={sm:"px-2 py-1 text-sm min-w-[32px] min-h-8",md:"px-2 py-1 text-base min-w-[40px] min-h-10"};function He({page:r,pageCount:s=5,maxVisiblePages:t=5,showFirstLast:n=!0,onPageChange:e,size:a="md",variant:l="link",className:c,ref:d,buttonsClassName:m,...b}){const u=s===1/0,f=i.useCallback(()=>{if(u)return[];const N=s,E=Math.min(t,N);if(N<=E)return Array.from({length:N},(M,z)=>z+1);const A=Math.floor(E/2);let C=Math.max(1,r-A),I=Math.min(N,C+E-1);return I-C+1<E&&(C=Math.max(1,I-E+1),I=Math.min(N,C+E-1)),Array.from({length:I-C+1},(M,z)=>C+z)},[u,t,r,s])(),x=r>1,v=u||r<s,g=n&&!u,w=n&&!u,p=N=>{N>=1&&(u||N<=s)&&e(N)},y=i.useCallback(()=>{const N=S.n("flex items-center justify-center min-w-fit","disabled:opacity-50 disabled:cursor-not-allowed",Fe[a],"rounded-md");return S.n(N,Be[l],m)},[l,a,m]);return o.jsxs("nav",{ref:d,className:S.n("flex items-center justify-center gap-1",c),role:"navigation","aria-label":"Pagination","data-page":r,"data-page-count":u?"infinite":s,...b,children:[g&&o.jsxs("button",{onClick:()=>p(1),className:y(),disabled:r===1,"aria-label":"Go to first page",children:[o.jsx(W.ChevronDoubleLeft,{size:a==="sm"?12:15}),o.jsx("span",{className:"ml-1",children:"First"})]}),o.jsxs("button",{onClick:()=>p(r-1),className:y(),disabled:!x,"aria-label":"Go to previous page",children:[o.jsx(W.ChevronLeft,{size:a==="sm"?12:15}),o.jsx("span",{className:"ml-1",children:"Previous"})]}),!u&&f.map(N=>o.jsx("button",{onClick:()=>p(N),className:S.n(y(),"aspect-square"),"aria-label":`Go to page ${N}`,"aria-current":N===r?!0:void 0,children:N},N)),o.jsxs("button",{onClick:()=>p(r+1),className:y(),disabled:!v,"aria-label":"Go to next page",children:[o.jsx("span",{className:"mr-1",children:"Next"}),o.jsx(W.ChevronRight,{size:a==="sm"?12:15})]}),w&&o.jsxs("button",{onClick:()=>p(s),className:y(),disabled:r===s,"aria-label":"Go to last page",children:[o.jsx("span",{className:"mr-1",children:"Last"}),o.jsx(W.ChevronDoubleRight,{size:a==="sm"?12:15})]})]})}function Pe(r){const[s,t]=i.useState(!1),[n,e]=i.useState(!1);return i.useEffect(()=>{r?(e(!0),setTimeout(()=>t(!0),10)):(t(!1),setTimeout(()=>e(!1),300))},[r]),{show:s,shouldRender:n}}function Ge(r,s){i.useEffect(()=>{const t=n=>{n.key==="Escape"&&r&&s()};return document.addEventListener("keydown",t),r&&(document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",t),document.body.style.overflow="auto"}},[r,s])}function qe(r,s){const t=i.useRef(null),n=i.useCallback(()=>{const e=document.getElementById(r);if(!e)return;const a=e.querySelectorAll('[data-panel-action="true"]');if(a.length>0){a[0].focus();return}const l=e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(l.length>0){const c=Array.from(l).filter(d=>!(d instanceof HTMLButtonElement&&d.getAttribute("data-panel-close-button")==="true"));if(c.length>0){c[0].focus();return}l[0].focus();return}e.focus()},[r]);i.useEffect(()=>(s&&(t.current=document.activeElement,n()),()=>{document.body.style.overflow="auto",t.current instanceof HTMLElement&&t.current.focus()}),[s,n])}const Ke={size:{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl",full:"w-full",screen:"w-screen"}};function Xe({ref:r,id:s,isOpen:t,onClose:n,title:e,children:a,footer:l,size:c="md",className:d,overlayClassName:m,hideCloseButton:b=!1,disableCloseOnOverlayClick:u=!1,ariaLabelledBy:h,ariaDescribedBy:f}){const x=i.useId(),v=s||`panel-${x}`,g=s?`${s}-title`:`panel-title-${x}`,{show:w,shouldRender:p}=Pe(t);if(qe(v,p),Ge(p,n),!p)return null;const y=()=>e?i.isValidElement(e)?o.jsx("div",{children:e}):o.jsx("h2",{className:"text-2xl font-semibold",id:g,children:e}):null,N=()=>{if(!l)return null;if(i.isValidElement(l)){const E=l,A=E.props.className||"";return i.cloneElement(E,{className:S.n("px-6 py-4",A)})}return o.jsx("div",{className:"px-6 py-4",children:l})};return o.jsx(o.Fragment,{children:ce.createPortal(o.jsxs("div",{"aria-labelledby":h??e?g:void 0,"aria-describedby":f,role:"dialog","aria-modal":"true",className:"fixed inset-0 z-[100] overflow-hidden","data-panel-open":t,children:[o.jsx("div",{className:S.n("fixed inset-0 bg-black/40 transition-opacity duration-300",w?"opacity-100":"opacity-0",m),onClick:()=>{u||n()}}),o.jsx("div",{className:"fixed inset-y-0 right-0 flex max-w-full",children:o.jsx("div",{id:v,ref:r,tabIndex:-1,className:S.n("relative h-full transform shadow-xl bg-popover transition-transform duration-300 ease-in-out",c!=="screen"&&"border-l border-border",Ke.size[c],w?"translate-x-0":"translate-x-full",d),"data-panel-size":c,children:o.jsxs("div",{className:"flex h-full flex-col",children:[e&&o.jsx("div",{className:"px-6 pt-6",children:y()}),!b&&o.jsx("button",{type:"button",onClick:n,"data-panel-close-button":"true","aria-label":"Close panel",className:"rounded-md p-0.5 top-3 right-3 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0",children:o.jsx(ae.X,{size:18})}),o.jsx("div",{className:S.n("flex-1 overflow-y-auto px-6 pb-6",e?"pt-6":"pt-10"),children:a}),N()]})})})]}),document.body)})}function pe({itemId:r,checked:s,onChange:t,name:n,disabled:e=!1,className:a=""}){const l="relative inline-flex items-center justify-center rounded-full",c=()=>{e||t()},d=j.join(l,!s&&"hover:border-current/60",!e&&"border-current cursor-pointer",e&&"border-muted/60 cursor-not-allowed",a);return o.jsx("div",{id:r,role:"radio",tabIndex:-1,"aria-checked":s,"aria-disabled":e,"aria-description":`Radio button for ${n}`,"aria-labelledby":`${r}-label`,onClick:c,className:d,style:{width:"1em",height:"1em",padding:"0.1em",borderWidth:"0.06em"},children:s&&o.jsx("div",{className:j.join("size-full aspect-square rounded-full",e&&"bg-muted/60",!e&&"bg-current")})})}function re({value:r,children:s,className:t="",isSelected:n=!1,onChange:e,disabled:a=!1,hideInput:l=!1,description:c,name:d}){const b=`radio-${i.useId()}-${r}`,u=()=>{a||e==null||e(r)};return o.jsxs("div",{title:c,className:j.join("relative flex items-center",t,l&&`p-2 border-2 focus-within:border-dashed focus-within:${a?"border-current/50":"border-current/80"}`,l&&!n&&`border-transparent ${a?"":"not-focus-within:hover:border-border/60"}`,l&&n&&"border-border",a&&"opacity-60 cursor-not-allowed"),style:{gap:"0.5em"},children:[!l&&o.jsx(pe,{itemId:b,name:d||"",checked:n,onChange:u,disabled:a,className:j.join(l&&"")}),o.jsx("div",{id:l?b:void 0,tabIndex:l?-1:void 0,role:l?"radio":void 0,onClick:l?u:void 0,"aria-checked":l?n?"true":"false":void 0,"aria-disabled":l?a:void 0,"aria-description":l?c||`Radio button for ${d}`:void 0,"aria-labelledby":l?`${b}-label`:void 0,className:j.join(l&&"size-full",typeof s=="object"&&"grow focus:outline-none"),children:o.jsx("label",{id:`${b}-label`,onClick:l?void 0:u,className:j.join(a&&"cursor-not-allowed",!a&&"cursor-pointer"),children:s})})]})}function Ue(r,s){const[t,n]=i.useState(s),[e,a]=i.useState(-1),[l,c]=i.useState(!1),d=i.useCallback((f,x)=>{var w;const v=f[x];v.hasAttribute("disabled")||v.getAttribute("aria-disabled")==="true"||((w=f[x])==null||w.click(),a(x))},[]),m=i.useCallback((f,x)=>{var g;if(f.preventDefault(),l||!x.length)return;const v=s!==-1?s:0;(g=x[v])==null||g.focus(),n(v),s!==-1&&d(x,v)},[s,l,d]),b=i.useCallback(f=>{var w;if(!f.shiftKey)return;f.preventDefault();const x=Array.from(document.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')).filter(p=>!p.hasAttribute("disabled")&&p.tabIndex>=0),v=x.findIndex(p=>p.id===r),g=v>0?v-1:x.length-1;(w=x[g])==null||w.focus()},[r]),u=i.useCallback((f,x)=>{var y;if(!x.length)return;const v=f.target;if(!x.some(N=>N.id===v.id))return;const w=t!==-1?t:0;let p=w;switch(f.key){case"ArrowUp":case"ArrowLeft":f.preventDefault(),p=w>0?w-1:x.length-1;break;case"ArrowDown":case"ArrowRight":f.preventDefault(),p=(w+1)%x.length;break;case" ":f.preventDefault(),d(x,w);return;case"Tab":b(f);return;default:return}(y=x[p])==null||y.focus(),n(p),e!==-1&&d(x,p)},[t,e,b,d]),h=i.useCallback(()=>{const f=document.querySelector(`[id="${r}"][role="radiogroup"]`);return f?Array.from(f.querySelectorAll('[role="radio"]')):[]},[r]);i.useEffect(()=>{const f=document.querySelector(`[id="${r}"][role="radiogroup"]`);if(!f)return;const x=h(),v=y=>m(y,x),g=y=>u(y,x),w=()=>c(!0),p=()=>c(!1);return document.addEventListener("keydown",g),f.addEventListener("focus",v),f.addEventListener("mousedown",w),document.addEventListener("mouseup",p),()=>{document.removeEventListener("keydown",g),f.removeEventListener("focus",v),f.removeEventListener("mousedown",w),document.removeEventListener("mouseup",p)}},[r,h,m,u])}function _e({options:r=[],value:s,onChange:t,id:n,children:e,className:a="",childrenClassName:l="",hideInputs:c=!1}){const d=i.useId(),m=n||`radio-group-${d}`;Ue(m,r.findIndex(u=>u===s));const b=i.useMemo(()=>r.reduce((u,h)=>(typeof h=="string"?u.some(f=>f.value===h)||u.push({label:h,value:h}):u.push(h),u),[]),[r]);return o.jsxs("div",{id:m,role:"radiogroup",tabIndex:0,className:j.join(a,"focus:outline-none"),children:[b.length>0&&b.map((u,h)=>o.jsx(re,{value:u.value,isSelected:s===u.value,onChange:t,name:m,disabled:u.disabled,description:u.description,hideInput:c,className:l,children:u.label},`${u.value}-${h}`)),b.length===0&&e&&i.Children.map(e,u=>i.isValidElement(u)&&u.type===re?o.jsx(re,{...u.props,className:j.join(l,u.props.className),hideInput:u.props.hideInput||c,isSelected:s===u.props.value,onChange:t,name:m,children:u.props.children}):null)]})}function Qe(r){const s=i.useRef(null),t=i.useRef(null),n=i.useRef(null),[e,a]=i.useState(!1),[l,c]=i.useState(!1),[d,m]=i.useState({vertical:!1,horizontal:!1}),b=i.useRef(null),u=i.useRef(null),h=i.useCallback(()=>{const v=s.current;if(!v)return;const g=v.scrollHeight>v.clientHeight,w=v.scrollWidth>v.clientWidth;m({vertical:g,horizontal:w})},[]),f=i.useCallback(()=>{const v=s.current,g=t.current,w=n.current;if(v){if(g&&d.vertical){const y=(d.horizontal?v.clientHeight-r:v.clientHeight)/v.scrollHeight,N=Math.max(y*100,10),E=v.scrollHeight-v.clientHeight,A=E>0?v.scrollTop/E:0,C=100-N,I=A*C;g.style.height=`${N}%`,g.style.top=`${I}%`,g.style.transform="none"}if(w&&d.horizontal){const y=(d.vertical?v.clientWidth-r:v.clientWidth)/v.scrollWidth,N=Math.max(y*100,10),E=v.scrollWidth-v.clientWidth,A=E>0?v.scrollLeft/E:0,C=100-N,I=A*C;w.style.width=`${N}%`,w.style.left=`${I}%`,w.style.transform="none"}}},[d,r]),x=i.useCallback(()=>{b.current&&clearTimeout(b.current),u.current&&clearTimeout(u.current),a(!0),c(!1),f(),b.current=setTimeout(()=>{c(!0),u.current=setTimeout(()=>{a(!1),c(!1)},300)},1e3)},[f]);return i.useEffect(()=>{const v=s.current;if(!v)return;h();const g=new ResizeObserver(h);g.observe(v);const w=new MutationObserver(h);return w.observe(v,{childList:!0,subtree:!0,attributes:!0}),()=>{g.disconnect(),w.disconnect()}},[h]),i.useEffect(()=>{f()},[d,f]),i.useEffect(()=>()=>{b.current&&clearTimeout(b.current),u.current&&clearTimeout(u.current)},[]),{viewportRef:s,verticalThumbRef:t,horizontalThumbRef:n,isScrolling:e,isFadingOut:l,scrollbarVisible:d,handleScroll:x}}function Ze({className:r,thumbClassName:s,viewportClassName:t,scrollbarClassName:n,scrollbarThickness:e=10,children:a,id:l,ref:c,...d}){const{viewportRef:m,verticalThumbRef:b,horizontalThumbRef:u,isScrolling:h,isFadingOut:f,scrollbarVisible:x,handleScroll:v}=Qe(e),g=S.n("relative flex-1 rounded-full bg-slate-400/60 hover:bg-slate-400/80 active:bg-slate-400",s);return o.jsxs("div",{ref:c,id:l,className:S.n("relative overflow-hidden",r),"data-scroll-area-root":"",...d,children:[o.jsx("div",{ref:m,className:S.n("h-full w-full overflow-auto rounded-[inherit] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",t),onScroll:v,"data-scroll-area-viewport":"",children:a}),x.vertical&&(h||f)&&o.jsx("div",{className:S.n("touch-none select-none transition-all duration-300","p-[1px]","absolute right-0 top-0",f?"opacity-0":"opacity-100",n),"data-scroll-area-scrollbar":"vertical","data-state":h?"visible":"hidden",style:{width:`${e}px`,height:x.horizontal?`calc(100% - ${e}px)`:"100%"},children:o.jsx("div",{ref:b,className:S.n("absolute rounded-full",g),"data-scroll-area-thumb":"",style:{height:"20%",top:"0%",width:"100%"}})}),x.horizontal&&(h||f)&&o.jsx("div",{className:S.n("touch-none select-none transition-all duration-300","p-[1px]","absolute bottom-0 left-0",f?"opacity-0":"opacity-100",n),"data-scroll-area-scrollbar":"horizontal","data-state":h?"visible":"hidden",style:{height:`${e}px`,width:x.vertical?`calc(100% - ${e}px)`:"100%"},children:o.jsx("div",{ref:u,className:S.n("absolute rounded-full",g),"data-scroll-area-thumb":"",style:{width:"20%",left:"0%",height:"100%"}})}),x.vertical&&x.horizontal&&o.jsx("div",{className:S.n("bg-transparent","absolute bottom-0 right-0"),"data-scroll-area-corner":"",style:{height:`${e}px`,width:`${e}px`}})]})}function Je(r){const[s,t]=i.useState(!1),[n,e]=i.useState(!1);return i.useEffect(()=>{r?(e(!0),setTimeout(()=>t(!0),10)):(t(!1),setTimeout(()=>e(!1),150))},[r]),{show:s,shouldRender:n}}function Ye({isOpen:r,setIsOpen:s,filteredOptions:t,highlightedIndex:n,setHighlightedIndex:e,onSelect:a,triggerRef:l}){return{handleKeyDown:i.useCallback(d=>{var m;switch(d.key){case"ArrowDown":if(d.preventDefault(),!r)s(!0);else{const b=n<t.length-1?n+1:0;let u=b;for(let h=0;h<t.length;h++){const f=(b+h)%t.length;if(!t[f].disabled){u=f;break}}e(u)}break;case"ArrowUp":if(d.preventDefault(),!r)s(!0);else{const b=n>0?n-1:t.length-1;let u=b;for(let h=0;h<t.length;h++){const f=(b-h+t.length)%t.length;if(!t[f].disabled){u=f;break}}e(u)}break;case"Enter":case" ":if(d.preventDefault(),!r)s(!0);else if(n>=0&&n<t.length){const b=t[n];b.disabled||a(b)}break;case"Escape":d.preventDefault(),r&&(s(!1),(m=l.current)==null||m.focus());break;case"Tab":r&&s(!1);break}},[r,s,t,n,e,a,l])}}function Oe({isOpen:r,filteredOptions:s,selectedOption:t,shouldRender:n,optionsContainerRef:e}){const[a,l]=i.useState(-1),c=i.useMemo(()=>t?s.findIndex(d=>d.value===t.value):-1,[s,t]);return i.useEffect(()=>{r&&s.length>0?l(t&&c>=0?c:0):l(-1)},[s,r,t,c]),i.useEffect(()=>{if(a>=0&&e.current&&n){const d=()=>{const m=e.current,b=m==null?void 0:m.querySelector(`[data-option-index="${a}"]`);if(b){const u=r&&t&&a===c?"auto":"smooth";b.scrollIntoView({behavior:u,block:"nearest"})}};r&&n&&t?setTimeout(d,10):d()}},[a,n,r,t,s,e,c]),{highlightedIndex:a,setHighlightedIndex:l}}const fe={sm:{trigger:"px-2 py-1 text-sm",options:"px-2 py-2 text-xs"},md:{trigger:"px-3 py-2 text-base",options:"px-3 py-2.5 text-sm"},lg:{trigger:"px-4 py-3 text-lg",options:"px-4 py-3 text-base"}};function et({options:r,value:s,placeholder:t="Select an option...",searchable:n=!1,disabled:e=!1,clearable:a=!1,size:l="md",className:c,triggerClassName:d,dropdownClassName:m,id:b,ref:u,onChange:h,onSearch:f,searchPlaceholder:x="Search options..."}){const v=i.useId(),w=`${b??v}-listbox`,p=k=>`${w}-option-${k}`,[y,N]=i.useState(!1),[E,A]=i.useState(""),C=i.useRef(null),I=i.useRef(null),M=i.useRef(null),z=i.useRef(null),{show:H,shouldRender:L}=Je(y),T=i.useMemo(()=>!n||!E?r:r.filter(k=>{var $;return k.text.toLowerCase().includes(E.toLowerCase())||(($=k.description)==null?void 0:$.toLowerCase().includes(E.toLowerCase()))}),[r,n,E]),R=i.useMemo(()=>r.find(k=>k.value===s),[r,s]),{highlightedIndex:D,setHighlightedIndex:B}=Oe({isOpen:y,filteredOptions:T,selectedOption:R,shouldRender:L,optionsContainerRef:z}),P=D>=0?p(D):void 0;i.useEffect(()=>{y&&L&&n&&I.current&&I.current.focus()},[y,n,L]);const q=i.useCallback(k=>{var $;k.disabled||(h==null||h(k.value),N(!1),A(""),($=C.current)==null||$.focus())},[h]),{handleKeyDown:F}=Ye({isOpen:y,setIsOpen:N,filteredOptions:T,highlightedIndex:D,setHighlightedIndex:B,onSelect:q,triggerRef:C});i.useEffect(()=>{if(!y)return;const k=$=>{var Q;M.current&&!M.current.contains($.target)&&!((Q=C.current)!=null&&Q.contains($.target))&&(N(!1),A(""))};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[y]);const X=()=>{e||(N(!y),y||(A(""),B(-1)))},se=k=>{k.disabled||(h==null||h(k.value),N(!1),A(""))},oe=k=>{const $=k.target.value;A($),f==null||f($),B(-1)},ie=k=>{k.preventDefault(),k.stopPropagation(),h==null||h("")};return o.jsxs("div",{className:j.join("relative",c),id:b,ref:u,"data-select":"true","data-value":s,"data-searchable":n,"data-disabled":e,"data-clearable":a,children:[o.jsxs("div",{className:"relative",children:[o.jsxs("button",{ref:C,type:"button",className:j.join("flex items-center justify-between w-full text-left bg-inherit border border-border rounded-md transition-colors","hover:border-primary focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary",e&&"opacity-50 cursor-not-allowed hover:border-border",y&&"border-primary ring-1 ring-primary",fe[l].trigger,d),onClick:X,onKeyDown:F,disabled:e,"aria-disabled":e,"aria-haspopup":"listbox","aria-expanded":y,"aria-controls":y?w:void 0,"aria-activedescendant":y&&!n?P:void 0,"aria-label":R?R.text:t,"data-select-trigger":"true",children:[o.jsx("span",{className:j.join("block truncate",!R&&"opacity-70"),children:R?R.text:t}),o.jsx("div",{className:"flex items-center ml-2",children:o.jsx(W.ChevronDown,{size:16,className:j.join("transition-transform duration-200",y&&"rotate-180")})})]}),a&&R&&o.jsx("button",{type:"button",onClick:ie,className:"absolute right-8 top-1/2 -translate-y-1/2 p-0.5 rounded hover:bg-accent/20 transition-colors group z-10","aria-label":"Clear selection","data-select-clear":"true",children:o.jsx(ae.X,{size:14,className:"opacity-70 group-hover:opacity-100 transition-opacity"})})]}),L&&o.jsxs("div",{ref:M,className:j.join("absolute z-50 w-full mt-1 bg-popover border border-border rounded-md shadow-lg transition-all duration-150",H?"opacity-100 translate-y-0":"opacity-0 -translate-y-2",m),id:w,role:"listbox","data-select-content":"true",children:[n&&o.jsx("div",{className:"border-b border-border",children:o.jsx("input",{ref:I,type:"text",value:E,onChange:oe,onKeyDown:F,placeholder:x,className:"w-full px-2 py-2 text-inherit focus:outline-none","aria-autocomplete":"list","aria-controls":w,"aria-activedescendant":P,"data-select-search":"true"})}),o.jsx("div",{ref:z,className:"max-h-60 overflow-auto",children:T.length>0?T.map((k,$)=>o.jsxs("div",{id:p($),className:j.join("flex items-center cursor-pointer transition-colors","hover:bg-accent/10 focus:bg-accent/10",fe[l].options,k.disabled&&"opacity-50 cursor-not-allowed",$===D&&"bg-accent/20",s===k.value&&"bg-accent/30"),onClick:()=>se(k),role:"option","aria-selected":s===k.value,"aria-disabled":k.disabled,"data-select-option":"true","data-value":k.value,"data-highlighted":$===D,"data-option-index":$,children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"font-medium",children:k.text}),k.description&&o.jsx("div",{className:"text-xs opacity-70 mt-0.5",children:k.description})]}),s===k.value&&o.jsx(W.Check,{size:16,className:"ml-2 text-primary flex-shrink-0"})]},k.value)):o.jsx("div",{className:"px-3 py-2 text-sm opacity-70 text-center",children:n&&E?"No results found":"No options available"})})]})]})}const tt={thin:{horizontal:"h-px",vertical:"w-px"},medium:{horizontal:"h-0.5",vertical:"w-0.5"},thick:{horizontal:"h-1",vertical:"w-1"},"extra-thick":{horizontal:"h-2",vertical:"w-2"}},rt={horizontal:"w-full",vertical:"min-h-4 h-full"};function nt({orientation:r="horizontal",decorative:s=!1,thickness:t="thin",className:n,...e}){const a=j.join("shrink-0 bg-border",rt[r],tt[t][r],n);return o.jsx("div",{...e,className:a,role:s?"presentation":"separator","aria-orientation":s?void 0:r,"aria-hidden":s,"data-orientation":r,"data-thickness":t})}const me={shape:{rectangle:"rounded-md min-h-1",circle:"rounded-full aspect-square min-h-1",text:"rounded-sm min-h-1 h-4"},lineSpacing:{xs:"space-y-1",sm:"space-y-2",md:"space-y-3",lg:"space-y-4",xl:"space-y-6"}};function at({shape:r="rectangle",lineSpacing:s="sm",className:t,lines:n=1,animate:e=!0,ref:a,...l}){const c=j.join("bg-muted/70",e&&"animate-pulse",me.shape[r],t);return n>1?o.jsx("div",{ref:a,className:me.lineSpacing[s],role:"presentation","aria-hidden":"true","data-testid":"skeleton-container","data-lines":n,"data-shape":r,"data-animate":e,...l,children:Array.from({length:n},(d,m)=>o.jsx("div",{className:j.join(c,m===n-1&&"w-3/4"),role:"presentation","aria-hidden":"true","data-testid":"skeleton-line","data-line-index":m},m))}):o.jsx("div",{ref:a,className:c,role:"presentation","aria-hidden":"true","data-testid":"skeleton","data-shape":r,"data-animate":e,...l})}function st({id:r,value:s,defaultValue:t=0,onValueChange:n,min:e=0,max:a=100,step:l=1,disabled:c=!1,trackClassName:d,rangeClassName:m,thumbClassName:b,className:u,ref:h,ariaLabel:f,ariaLabelledBy:x,...v}){const[g,w]=i.useState(t),p=s!==void 0,y=p?s:g,N=i.useRef(null),E=i.useRef(!1),A=i.useRef(0),C=i.useCallback(T=>{const R=Math.max(e,Math.min(a,T)),D=Math.round(R/l)*l;p||w(D),n==null||n(D)},[e,a,l,p,n]),I=i.useCallback((T,R=!1)=>{var q;const D=(q=N.current)==null?void 0:q.getBoundingClientRect();if(!D)return y;let B=T.clientX;R&&(B=B-A.current);const P=Math.max(0,Math.min(1,(B-D.left)/D.width));return e+(a-e)*P},[e,a,y]),M=i.useCallback(T=>{if(c||T.target!==T.currentTarget)return;const R=I(T);C(R)},[c,I,C]),z=i.useCallback(T=>{var q;if(c)return;T.stopPropagation(),E.current=!0;const R=(q=N.current)==null?void 0:q.getBoundingClientRect(),D=T.currentTarget.getBoundingClientRect();if(R&&D){const F=D.left+D.width/2;A.current=T.clientX-F}T.currentTarget.setPointerCapture(T.pointerId);const B=F=>{if(!E.current)return;const X=I(F,!0);C(X)},P=F=>{if(F.pointerId===T.pointerId){E.current=!1,A.current=0;try{T.currentTarget.releasePointerCapture(F.pointerId)}catch{}document.removeEventListener("pointermove",B),document.removeEventListener("pointerup",P)}};document.addEventListener("pointermove",B),document.addEventListener("pointerup",P)},[c,I,C]),H=i.useCallback(T=>{if(c)return;let R=y;switch(T.key){case"ArrowRight":case"ArrowUp":R=y+l;break;case"ArrowLeft":case"ArrowDown":R=y-l;break;case"Home":R=e;break;case"End":R=a;break;case"PageUp":R=y+l*10;break;case"PageDown":R=y-l*10;break;default:return}T.preventDefault(),C(R)},[c,y,l,e,a,C]),L=a===e?0:(y-e)/(a-e)*100;return o.jsx("div",{id:r,ref:h,className:S.n("relative flex items-center w-full touch-none select-none",c&&"opacity-50 cursor-not-allowed",u),"data-disabled":c,"data-value":y,"data-min":e,"data-max":a,"data-step":l,...v,children:o.jsxs("div",{ref:N,className:S.n("relative h-1.5 w-full rounded-full bg-muted cursor-pointer",c&&"cursor-not-allowed",d),onPointerDown:M,children:[o.jsx("div",{className:S.n("absolute h-full rounded-full pointer-events-none",!E.current&&"transition-all",m),style:{width:`${L}%`}}),o.jsx("div",{className:S.n("absolute size-5 -top-2 rounded-full shadow-md cursor-grab",c&&"cursor-not-allowed",!c&&"cursor-grab focus:outline-none focus:ring-2",E.current?"cursor-grabbing scale-110":"transition-all",b),style:{left:`calc(${L}% - 10px)`},tabIndex:c?-1:0,role:"slider","aria-valuemin":e,"aria-valuemax":a,"aria-valuenow":y,"aria-label":f,"aria-labelledby":x,"aria-disabled":c,onKeyDown:H,onPointerDown:z})]})})}function ot({children:r,ref:s,...t}){if(i.isValidElement(r)){let n={...t};return r.props&&(n={...n,...r.props}),i.cloneElement(r,{...n,ref:e=>{typeof s=="function"?s(e):s&&(s.current=e)}})}return i.createElement("div",{...t,ref:s},r)}const it=({defaultValue:r,value:s,onValueChange:t}={})=>{const[n,e]=i.useState(r||""),a=s!==void 0,l=a?s:n,c=i.useCallback(d=>{a||e(d),t==null||t(d)},[a,t]);return{value:l,onValueChange:c}};function lt({defaultValue:r,value:s,onValueChange:t,tabsWidth:n="fit",variant:e="underline",className:a,children:l,ref:c,id:d,triggersClassName:m,contentClassName:b}){const{value:u,onValueChange:h}=it({defaultValue:r,value:s,onValueChange:t}),f={selectedValue:u,onValueChange:h,tabsWidth:n,variant:e,triggersClassName:m,contentClassName:b};return o.jsx(S.TabsContext.Provider,{value:f,children:o.jsx("div",{id:d,ref:c,className:a,"data-tabs-width":n,"data-variant":e,children:l})})}function ct({value:r,className:s,children:t,ref:n}){const{selectedValue:e,contentClassName:a}=S.useTabsContext(),l=e===r;return l?o.jsx("div",{ref:n,role:"tabpanel",id:`tabs-content-${r}`,"aria-labelledby":`tabs-trigger-${r}`,"data-state":l?"active":"inactive","data-value":r,className:j.join("mt-4 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2",a,s),tabIndex:0,children:t}):null}const be={width:{fit:"w-fit",full:"w-full *:flex-1"},variant:{underline:"border-b border-border",pills:"",bordered:"border border-border rounded-lg p-1"}},ut={underline:"border-b-2 border-transparent data-[state=active]:border-accent data-[state=active]:text-accent hover:text-accent-foreground",pills:"rounded-md data-[state=active]:bg-accent data-[state=active]:text-accent-foreground hover:bg-accent/30",bordered:"rounded data-[state=active]:bg-accent data-[state=active]:text-accent-foreground hover:bg-accent/30"};function dt({children:r,className:s,id:t,ref:n}){const{tabsWidth:e,variant:a}=S.useTabsContext();return o.jsx("div",{id:t,ref:n,role:"tablist",className:j.join("flex",be.width[e],be.variant[a],s),"data-tabs-width":e,"data-variant":a,children:r})}function ft({value:r,disabled:s=!1,className:t,children:n,onClick:e,id:a,ref:l}){const{selectedValue:c,onValueChange:d,variant:m,triggersClassName:b}=S.useTabsContext(),u=c===r,h=x=>{s||d(r),e==null||e(x)};return o.jsx("button",{id:a,ref:l,role:"tab",type:"button","aria-selected":u,"aria-controls":`tabs-content-${r}`,"data-state":u?"active":"inactive","data-value":r,disabled:s,className:j.join("inline-flex items-center justify-center whitespace-nowrap px-3 py-2 text-sm ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",u?"font-medium":"font-light",ut[m],b,t),onClick:h,children:n})}function mt({elementId:r,maxLength:s}){const[t,n]=i.useState(0);return i.useEffect(()=>{const e=document.getElementById(r);if(!e)return;const a=()=>{const l=e.value.length;n(l);const c=l>=s;e.setAttribute("aria-describedby",`${r}-character-count`),e.setAttribute("aria-invalid",c?"true":"false"),c?e.setAttribute("data-error","true"):e.removeAttribute("data-error")};return a(),e.addEventListener("input",a),e.setAttribute("maxlength",String(s)),()=>{e.removeEventListener("input",a),e.removeAttribute("maxlength"),e.removeAttribute("aria-describedby"),e.removeAttribute("aria-invalid"),e.removeAttribute("data-error")}},[r,s]),o.jsx("small",{className:j.join("mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-end",t>=s&&"text-destructive",t<s&&"text-current"),role:"status",children:o.jsxs("span",{id:`${r}-character-count`,children:[t," / ",s," characters"]})})}function bt(r,s){i.useEffect(()=>{const t=document.getElementById(r);if(!t)return;if(!s){t.style.height="auto";return}const n=()=>{t.style.height="auto",t.style.height=`${t.scrollHeight}px`};return n(),t.addEventListener("input",n),t.addEventListener("resize",n),window.addEventListener("resize",n),()=>{t.removeEventListener("input",n),t.removeEventListener("resize",n),window.removeEventListener("resize",n)}},[r,s])}const ht={base:"","left-line":"border-l border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success",outline:"border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success"},xt={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"px-3 rounded-full"},he={variant:"outline",rounded:"none"};function vt({variant:r=he.variant,rounded:s,displayOnlyMode:t=!1,errorMessage:n,successMessage:e,hideResizeHandle:a=!1,autoExpand:l=!1,characterLimit:c=0,className:d,...m}){const b=i.useId();bt(b,l||t);let u=s;r==="outline"&&!s&&(u="md"),u=u||he.rounded;let h=a;(t||r==="left-line"&&!a)&&(h=!0);const x=j.join("appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all",!t&&ht[r],!t&&xt[u],!t&&"px-2 py-1",t&&"pointer-events-none",h&&"no-resize-handle",d);return o.jsxs("div",{className:j.join("-space-y-1.5",t&&"cursor-text"),children:[o.jsx("textarea",{...m,id:b,"aria-disabled":m.disabled,readOnly:t,"aria-readonly":t||m["aria-readonly"],style:{resize:l?"none":void 0},className:x}),c>0&&o.jsx(mt,{elementId:b,maxLength:c}),!t&&o.jsx(ne,{elementId:b,type:"error",message:n}),!t&&o.jsx(ne,{elementId:b,type:"success",message:e})]})}const gt={sm:{container:"h-5 min-w-9 w-9",thumb:"h-4 w-4",translate:"translate-x-4"},md:{container:"h-6 min-w-11 w-11",thumb:"h-5 w-5",translate:"translate-x-5"},lg:{container:"h-7 min-w-13 w-13",thumb:"h-6 w-6",translate:"translate-x-6"}},pt={default:{unchecked:"bg-muted",checked:"bg-primary"},success:{unchecked:"bg-muted",checked:"bg-success"},destructive:{unchecked:"bg-muted",checked:"bg-destructive"}},xe={variant:"default",size:"md"};function yt({ref:r,id:s,size:t=xe.size,variant:n=xe.variant,checked:e,onCheckedChange:a,disabled:l=!1,className:c,thumbClassName:d,backgroundClassNames:m,...b}){const u=i.useId(),h=i.useMemo(()=>s||`toggle-${u}`,[s,u]),[f,x]=i.useState(e);i.useEffect(()=>{x(e)},[e]);const v=()=>{if(!l){const E=!f;e===void 0&&x(E),a==null||a(E)}},g=E=>{(E.key===" "||E.key==="Enter")&&(E.preventDefault(),v())},w=gt[t],p=pt[n],y=j.join("relative inline-flex items-center rounded-full transition-all duration-200 ease-in-out","focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",w.container,f?(m==null?void 0:m.checked)||p.checked:(m==null?void 0:m.unchecked)||p.unchecked,l&&"opacity-50 cursor-not-allowed",!l&&"cursor-pointer",c),N=j.join("absolute left-0.5 top-1/2 -translate-y-1/2 rounded-full bg-white shadow-sm transition-transform duration-200 ease-in-out",w.thumb,f&&w.translate,d);return o.jsxs("button",{ref:r,id:h,type:"button",role:"switch",tabIndex:0,"aria-checked":f,"aria-disabled":l,disabled:l,onClick:v,onKeyDown:g,className:y,...b,children:[o.jsx("span",{className:N}),o.jsx("span",{className:"sr-only",children:f?"Enabled":"Disabled"})]})}const O=8,ee=4,G=6;function wt(r){return{calculatePosition:i.useCallback((t,n)=>{const e=t.getBoundingClientRect(),a=n.getBoundingClientRect(),l={width:window.innerWidth,height:window.innerHeight},c=(h,f,x,v)=>h<0||f<0||h+x>l.width||f+v>l.height,d={top:{x:e.left+e.width/2-a.width/2,y:e.top-a.height-ee,arrow:{x:a.width/2-G,y:a.height}},bottom:{x:e.left+e.width/2-a.width/2,y:e.bottom+ee,arrow:{x:a.width/2-G,y:-6}},left:{x:e.left-a.width-ee,y:e.top+e.height/2-a.height/2,arrow:{x:a.width,y:a.height/2-G}},right:{x:e.right+ee,y:e.top+e.height/2-a.height/2,arrow:{x:-6,y:a.height/2-G}}};let m=r,b=d[r];if(c(b.x,b.y,a.width,a.height)){const h={top:"bottom",bottom:"top",left:"right",right:"left"},f=d[h[r]];if(!c(f.x,f.y,a.width,a.height))m=h[r],b=f;else{const x=["top","bottom","left","right"].filter(v=>v!==r&&v!==h[r]);for(const v of x){const g=d[v];if(!c(g.x,g.y,a.width,a.height)){m=v,b=g;break}}}}b.x=Math.max(O,Math.min(b.x,l.width-a.width-O)),b.y=Math.max(O,Math.min(b.y,l.height-a.height-O));const u={x:e.left+e.width/2,y:e.top+e.height/2};return m==="top"||m==="bottom"?b.arrow.x=Math.max(G,Math.min(u.x-b.x-G,a.width-G*2)):b.arrow.y=Math.max(G,Math.min(u.y-b.y-G,a.height-G*2)),{...b,placement:m}},[r])}}function jt(r,s,t){const n=i.useRef(null),e=i.useRef(null),a=i.useCallback(()=>{if(!n.current||!e.current)return;const l=r(n.current,e.current);t(l)},[r,t]);return i.useEffect(()=>{if(!s)return;const l=()=>a();return window.addEventListener("resize",l),()=>{window.removeEventListener("resize",l)}},[s,a]),{triggerRef:n,tooltipRef:e,updatePosition:a}}function Nt(r,s,t,n,e,a,l,c,d){const m=i.useRef(null),b=i.useCallback(()=>{r||(m.current&&clearTimeout(m.current),m.current=window.setTimeout(()=>{t(!0),requestAnimationFrame(()=>{e(),n(!0)})},s))},[r,s,t,e,n]),u=i.useCallback((h=!1)=>{if(m.current&&clearTimeout(m.current),h){n(!1),setTimeout(()=>t(!1),150);return}m.current=window.setTimeout(()=>{n(!1),setTimeout(()=>t(!1),150)},100)},[n,t]);return i.useEffect(()=>{!a&&!l&&!c&&d&&u()},[a,l,c,d,u]),i.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]),{showTooltip:b,hideTooltip:u,timeoutRef:m}}function Et({id:r,children:s,message:t,placement:n="top",disabled:e=!1,delay:a=200,className:l}){const[c,d]=i.useState(!1),[m,b]=i.useState(!1),[u,h]=i.useState(null),[f,x]=i.useState(!1),[v,g]=i.useState(!1),[w,p]=i.useState(!1),{calculatePosition:y}=wt(n),{triggerRef:N,tooltipRef:E,updatePosition:A}=jt(y,m,h),{showTooltip:C,hideTooltip:I,timeoutRef:M}=Nt(e,a,b,d,A,f,v,w,c),z=i.useId(),H=r??z;return o.jsxs(o.Fragment,{children:[i.cloneElement(s,{ref:L=>{N.current=L},onMouseEnter:()=>{x(!0),C()},onMouseLeave:()=>{x(!1)},onFocus:()=>{p(!0),C()},onBlur:()=>{p(!1),I(!0)},onKeyDown:L=>{L.key==="Escape"&&I(!0)},"aria-describedby":e?void 0:H}),m&&ce.createPortal(o.jsx("div",{ref:E,id:H,role:"tooltip",className:j.join("fixed z-50 px-2 py-1 text-sm rounded shadow-lg bg-popover pointer-events-auto transition-all duration-150 ease-out",c?"opacity-100":"opacity-0",l),style:u?{left:u.x,top:u.y}:{opacity:0},onMouseEnter:()=>{g(!0),M.current&&clearTimeout(M.current)},onMouseLeave:()=>{g(!1)},children:t}),document.body)]})}exports.ActionModal=S.ActionModal;exports.Toast=S.Toast;exports.Accordion=we;exports.AccordionItem=te;exports.Button=ge;exports.Carousel=Se;exports.Checkbox=Te;exports.Clickable=Re;exports.Input=$e;exports.Label=De;exports.LoadingDots=ve;exports.Modal=We;exports.Pagination=He;exports.Panel=Xe;exports.RadioGroup=_e;exports.RadioGroupItem=re;exports.RadioInput=pe;exports.ScrollArea=Ze;exports.Select=et;exports.Separator=nt;exports.Skeleton=at;exports.Slider=st;exports.Slot=ot;exports.Tabs=lt;exports.TabsContent=ct;exports.TabsList=dt;exports.TabsTrigger=ft;exports.Textarea=vt;exports.Toggle=yt;exports.Tooltip=Et;
2
2
  //# sourceMappingURL=components.cjs.js.map