@moondreamsdev/dreamer-ui 1.7.7-test.9 → 1.7.8

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 (98) hide show
  1. package/dist/{QuestionMarkCircled-BVBF3skB.js → QuestionMarkCircled-CY81euqP.js} +119 -7
  2. package/dist/QuestionMarkCircled-CY81euqP.js.map +1 -0
  3. package/dist/QuestionMarkCircled-D3gPieJ7.cjs +2 -0
  4. package/dist/QuestionMarkCircled-D3gPieJ7.cjs.map +1 -0
  5. package/dist/{Toast-CZ-yb83h.js → Toast-B83cGTb3.js} +100 -80
  6. package/dist/Toast-B83cGTb3.js.map +1 -0
  7. package/dist/Toast-BDQ9mOuz.cjs +2 -0
  8. package/dist/Toast-BDQ9mOuz.cjs.map +1 -0
  9. package/dist/X-CIoyLewf.js.map +1 -1
  10. package/dist/X-CgjeP2OI.cjs.map +1 -1
  11. package/dist/components.cjs.js +1 -1
  12. package/dist/components.cjs.js.map +1 -1
  13. package/dist/components.esm.js +1711 -707
  14. package/dist/components.esm.js.map +1 -1
  15. package/dist/providers.cjs.js +1 -1
  16. package/dist/providers.esm.js +1 -1
  17. package/dist/src/components/accordion/AccordionItem.d.ts +1 -0
  18. package/dist/src/components/accordion/index.d.ts +2 -4
  19. package/dist/src/components/actionmodal/index.d.ts +1 -2
  20. package/dist/src/components/button/Button.d.ts +1 -1
  21. package/dist/src/components/button/LoadingDots.d.ts +1 -1
  22. package/dist/src/components/button/index.d.ts +2 -4
  23. package/dist/src/components/carousel/Carousel.d.ts +46 -0
  24. package/dist/src/components/carousel/hooks.d.ts +21 -0
  25. package/dist/src/components/carousel/index.d.ts +1 -0
  26. package/dist/src/components/carousel/useScreenSize.d.ts +15 -0
  27. package/dist/src/components/carousel/variants.d.ts +36 -0
  28. package/dist/src/components/checkbox/Checkbox.d.ts +1 -1
  29. package/dist/src/components/checkbox/index.d.ts +1 -1
  30. package/dist/src/components/clickable/Clickable.d.ts +3 -3
  31. package/dist/src/components/clickable/index.d.ts +1 -1
  32. package/dist/src/components/index.d.ts +5 -0
  33. package/dist/src/components/input/Input.d.ts +2 -3
  34. package/dist/src/components/input/index.d.ts +1 -1
  35. package/dist/src/components/label/Label.d.ts +2 -1
  36. package/dist/src/components/pagination/Pagination.d.ts +23 -0
  37. package/dist/src/components/pagination/index.d.ts +1 -0
  38. package/dist/src/components/pagination/variants.d.ts +15 -0
  39. package/dist/src/components/panel/Panel.d.ts +1 -1
  40. package/dist/src/components/panel/index.d.ts +1 -3
  41. package/dist/src/components/radiogroup/RadioGroupItem.d.ts +1 -0
  42. package/dist/src/components/scroll-area/ScrollArea.d.ts +20 -0
  43. package/dist/src/components/scroll-area/hooks.d.ts +13 -0
  44. package/dist/src/components/scroll-area/index.d.ts +1 -0
  45. package/dist/src/components/select/Select.d.ts +22 -0
  46. package/dist/src/components/select/hooks.d.ts +35 -0
  47. package/dist/src/components/select/index.d.ts +1 -0
  48. package/dist/src/components/select/variants.d.ts +15 -0
  49. package/dist/src/components/separator/Separator.d.ts +1 -1
  50. package/dist/src/components/separator/index.d.ts +1 -2
  51. package/dist/src/components/skeleton/Skeleton.d.ts +1 -1
  52. package/dist/src/components/skeleton/index.d.ts +1 -1
  53. package/dist/src/components/slider/Slider.d.ts +1 -1
  54. package/dist/src/components/slider/index.d.ts +1 -2
  55. package/dist/src/components/tabs/Tabs.d.ts +26 -0
  56. package/dist/src/components/tabs/TabsContent.d.ts +11 -0
  57. package/dist/src/components/tabs/TabsContext.d.ts +12 -0
  58. package/dist/src/components/tabs/TabsList.d.ts +8 -0
  59. package/dist/src/components/tabs/TabsTrigger.d.ts +16 -0
  60. package/dist/src/components/tabs/hooks.d.ts +9 -0
  61. package/dist/src/components/tabs/index.d.ts +4 -0
  62. package/dist/src/components/tabs/variants.d.ts +18 -0
  63. package/dist/src/components/textarea/Textarea.d.ts +2 -3
  64. package/dist/src/components/textarea/index.d.ts +1 -1
  65. package/dist/src/components/toast/Toast.d.ts +1 -0
  66. package/dist/src/components/toast/index.d.ts +1 -2
  67. package/dist/src/components/toggle/Toggle.d.ts +1 -1
  68. package/dist/src/components/toggle/index.d.ts +1 -2
  69. package/dist/src/components/tooltip/hooks.d.ts +1 -0
  70. package/dist/src/components/tooltip/index.d.ts +1 -2
  71. package/dist/src/hooks/useActionModal.d.ts +1 -0
  72. package/dist/src/hooks/useToast.d.ts +1 -0
  73. package/dist/src/symbols/Check.d.ts +2 -2
  74. package/dist/src/symbols/CheckCircled.d.ts +2 -2
  75. package/dist/src/symbols/ChevronDoubleLeft.d.ts +2 -0
  76. package/dist/src/symbols/ChevronDoubleRight.d.ts +2 -0
  77. package/dist/src/symbols/ChevronDown.d.ts +2 -2
  78. package/dist/src/symbols/ChevronLeft.d.ts +2 -0
  79. package/dist/src/symbols/ChevronRight.d.ts +2 -0
  80. package/dist/src/symbols/CrossCircled.d.ts +2 -2
  81. package/dist/src/symbols/ExclamationTriangle.d.ts +2 -2
  82. package/dist/src/symbols/EyeClosed.d.ts +2 -2
  83. package/dist/src/symbols/EyeOpened.d.ts +2 -2
  84. package/dist/src/symbols/InfoCircled.d.ts +2 -2
  85. package/dist/src/symbols/QuestionMarkCircled.d.ts +2 -2
  86. package/dist/src/symbols/X.d.ts +2 -2
  87. package/dist/src/symbols/index.d.ts +15 -14
  88. package/dist/src/symbols/props.d.ts +5 -0
  89. package/dist/symbols.cjs.js +1 -1
  90. package/dist/symbols.esm.js +14 -10
  91. package/dist/theme.css +1 -0
  92. package/package.json +4 -4
  93. package/dist/QuestionMarkCircled-BVBF3skB.js.map +0 -1
  94. package/dist/QuestionMarkCircled-D5cHmQp1.cjs +0 -2
  95. package/dist/QuestionMarkCircled-D5cHmQp1.cjs.map +0 -1
  96. package/dist/Toast-CZ-yb83h.js.map +0 -1
  97. package/dist/Toast-DS9J8w1E.cjs +0 -2
  98. package/dist/Toast-DS9J8w1E.cjs.map +0 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),l=require("react"),y=require("./utils.cjs.js"),B=require("./QuestionMarkCircled-D5cHmQp1.cjs"),k=require("./Toast-DS9J8w1E.cjs"),_=require("./X-CgjeP2OI.cjs"),Q=require("react-dom");function G({id:o,title:s,content:t,children:n,className:e="",disabled:r=!1,isOpen:a=!1,onToggle:u,triggerClassName:f="",bodyClassName:d=""}){const h=l.useId(),c=o||`accordion-item-${h}`,v=`${c}-header`,m=`${c}-panel`,b=()=>{!r&&u&&u()},g=p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),b())};return i.jsxs("div",{className:y.join("border-b border-gray-200",r&&"opacity-60 cursor-not-allowed",e),children:[i.jsxs("button",{id:v,type:"button",className:y.join("w-full text-left py-3 px-4 flex justify-between items-center focus:outline focus:outline-secondary",r?"cursor-not-allowed":"hover:bg-gray-50/10 cursor-pointer",f),"aria-expanded":a,"aria-controls":m,disabled:r,onClick:b,onKeyDown:g,children:[i.jsx("span",{children:s}),i.jsx("span",{className:y.join("transform transition-transform duration-300 ease-linear",a?"rotate-180":"rotate-0"),"aria-hidden":"true",children:i.jsx(B.ChevronDown,{size:18})})]}),i.jsx("div",{id:m,role:"region","aria-labelledby":v,className:y.join("transition-all duration-300 ease-linear px-4",a?"max-h-96 opacity-100 overflow-auto py-3":"max-h-0 opacity-0 overflow-hidden",d),children:a&&(n||t)})]})}function oe({id:o,items:s=[],children:t,className:n="",itemClassName:e="",allowMultiple:r=!1,defaultOpenItems:a=[],triggersClassName:u="",bodiesClassName:f=""}){const d=l.useId(),h=o||`accordion-group-${d}`,[c,v]=l.useState(new Set(a)),m=p=>{v(w=>{const x=new Set(w);return x.has(p)?x.delete(p):(r||x.clear(),x.add(p)),x})},b=p=>`${d}-item-${p}`,g=p=>c.has(p);return i.jsxs("div",{id:h,className:n,children:[s.length>0&&s.map((p,w)=>{const x=p.id||b(w);return i.jsx(G,{id:x,title:p.title,content:p.content,disabled:p.disabled,isOpen:g(x),onToggle:()=>m(x),className:e,triggerClassName:u,bodyClassName:f},x)}),s.length===0&&t&&l.Children.map(t,(p,w)=>{if(l.isValidElement(p)&&p.type===G){const x=p.props.id||b(w);return l.createElement(G,{...p.props,key:x,id:x,className:y.join(e,p.props.className),isOpen:g(x),onToggle:()=>m(x),triggerClassName:y.join(u,p.props.triggerClassName),bodyClassName:y.join(f,p.props.bodyClassName)})}return null})]})}function ee(){const[o,s]=l.useState(0);return l.useEffect(()=>{const t=setInterval(()=>{s(n=>(n+1)%3)},500);return()=>clearInterval(t)},[]),i.jsx("div",{className:"absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle",children:[0,1,2].map(t=>i.jsx("div",{className:y.join("rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current",o===t&&"transform -translate-y-1")},t))})}const se={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"},ae={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"},ie={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},W={variant:"primary",size:"md",rounded:"md"};function te({variant:o=W.variant,size:s,rounded:t=W.rounded,loading:n,linkTo:e,linkProps:r,type:a="button",className:u,...f}){let d;o==="link"&&!s?d="fitted":d=s||W.size;const c=y.join("appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",se[o],ae[d],ie[t],n&&"relative pointer-events-none",e&&"relative",u);return i.jsxs("button",{...f,role:e?"link":f.role,"aria-label":f["aria-label"]||(r==null?void 0:r["aria-label"]),"aria-description":f["aria-description"]||(r==null?void 0:r["aria-description"]),"aria-disabled":f.disabled||n,"aria-busy":n,type:a,className:c,children:[n&&i.jsx(ee,{}),i.jsx("span",{className:y.join(n&&"invisible"),children:f.children}),e&&!f.disabled&&i.jsx("a",{...r,"aria-hidden":!0,href:e,rel:(r==null?void 0:r.rel)||"noreferrer",className:"absolute inset-0"})]})}function le(o){const[s,t]=l.useState(""),n=l.useCallback(e=>{let r=e,a="";for(;r&&!a;){const u=window.getComputedStyle(r).backgroundColor;u&&u!=="transparent"&&u!=="rgba(0, 0, 0, 0)"&&(a=u),r=r.parentElement}return a||"transparent"},[]);return l.useEffect(()=>{const e=document.getElementById(o);if(e){const r=n(e.parentElement);t(r)}},[o,n]),s}function ue({ref:o,id:s,size:t=20,color:n,filled:e=!1,rounded:r=!0,checked:a=!1,onCheckedChange:u,disabled:f,className:d="",...h}){const c=l.useId(),v=l.useMemo(()=>s||`checkbox-${c}`,[s,c]),m=le(v),[b,g]=l.useState(a);l.useEffect(()=>{g(a)},[a]);const p=()=>{f||(g(!b),u==null||u(!b))},w=j=>{j.key===" "&&(j.preventDefault(),p())},x=y.join("flex items-center justify-center border outline outline-transparent focus:outline-current focus:outline-offset-2",r&&"rounded",f&&"opacity-40 cursor-not-allowed",!f&&"cursor-pointer",d);return i.jsx("button",{id:v,type:"button",ref:o,tabIndex:0,role:"checkbox",onClick:p,"aria-checked":b,"aria-disabled":f,onKeyDownCapture:w,style:{width:t,height:t,color:n,backgroundColor:b&&e?"currentcolor":"transparent"},className:x,...h,children:b&&i.jsx(B.Check,{size:t,color:e?m:void 0})})}function ce({children:o,className:s,linkTo:t,linkProps:n,onButtonClick:e,buttonProps:r,...a}){return t&&e&&console.warn('Clickable: Both "linkTo" and "onButtonClick" props are provided. Only "linkTo" will be used.'),i.jsxs("div",{className:y.join("relative w-fit",s),...a,children:[o,t&&i.jsx("a",{...n,rel:(n==null?void 0:n.rel)||"noreferrer",href:t,className:y.join("absolute inset-0",n==null?void 0:n.className)}),!t&&e&&i.jsx("button",{...r,type:"button",onClick:e,className:y.join("absolute inset-0 cursor-pointer",r==null?void 0:r.className)})]})}function U({elementId:o,type:s,message:t}){return l.useEffect(()=>{const n=document.getElementById(o);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",`${o}-${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")}}},[o,s,t]),t?i.jsxs("small",{className:y.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"?i.jsx(_.ExclamationTriangle,{}):i.jsx(B.CheckCircled,{}),i.jsx("span",{id:`${o}-${s}-message`,children:t})]}):null}const de={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"},fe={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"px-3 rounded-full"},Z={variant:"default",rounded:"none"};function me({variant:o=Z.variant,rounded:s,displayOnlyMode:t=!1,errorMessage:n,successMessage:e,type:r="text",className:a,...u}){const f=l.useId(),[d,h]=l.useState(!1);let c=s;o==="outline"&&!s&&(c="md"),c=c||Z.rounded;const b=y.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&&de[o],!t&&fe[c],r==="password"&&"pr-10",!t&&"px-2 py-1",t&&"pointer-events-none",a);return i.jsxs("div",{className:y.join(t&&"cursor-text"),style:{height:u.height,width:u.width},children:[i.jsxs("div",{className:y.join(r==="password"&&"relative"),children:[i.jsx("input",{...u,id:f,type:r==="password"&&d?"text":r,"aria-disabled":u.disabled,readOnly:t,"aria-readonly":t||u["aria-readonly"],"data-error":n?!0:void 0,"data-success":e?!0:void 0,className:b}),r==="password"&&i.jsx("button",{onClick:()=>h(!d),className:"absolute inset-y-0 right-0 px-2 hover:cursor-pointer","aria-label":"Toggle password visibility","data-state":d?"visible":"hidden",children:d?i.jsx(B.EyeClosed$1,{size:20}):i.jsx(B.EyeClosed,{size:20})})]}),!t&&i.jsx(U,{elementId:f,type:"error",message:n}),!t&&i.jsx(U,{elementId:f,type:"success",message:e})]})}function be({display:o="inline",width:s="fit-content",className:t="",required:n,helpMessage:e,suffix:r,htmlFor:a,children:u,...f}){const d=l.useId(),h=y.join("font-medium",o,t),c=e?`${a??d}-help`:void 0;return i.jsxs("div",{style:{display:o==="inline"?"inline-flex":"flex",width:s},className:"relative",children:[i.jsxs("label",{className:h,htmlFor:a,...f,children:[u,n&&i.jsx("span",{className:"text-red-500 font-medium ml-1","aria-label":"required",children:"*"})]}),e&&i.jsx("span",{className:"text-gray-500 ml-1 size-fit -translate-y-1/3","aria-describedby":c,"aria-label":"Help information",title:e,children:i.jsx(B.QuestionMarkCircled,{})}),e&&i.jsx("div",{id:c,className:"sr-only",children:e}),r&&i.jsx("span",{className:"ml-1",children:r})]})}function he(o){const[s,t]=l.useState(!1),[n,e]=l.useState(!1);return l.useEffect(()=>{o?(e(!0),setTimeout(()=>t(!0),10)):(t(!1),setTimeout(()=>e(!1),150))},[o]),{show:s,shouldRender:n}}function pe(o,s){l.useEffect(()=>{const t=n=>{n.key==="Escape"&&o&&s()};return document.addEventListener("keydown",t),o&&(document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",t),document.body.style.overflow="auto"}},[o,s])}function xe(o,s){const t=l.useRef(null),n=l.useCallback(()=>{const e=document.getElementById(o);if(!e)return;const r=e.querySelectorAll('[data-modal-action="true"]');if(r.length>0){r[0].focus();return}const a=e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(a.length>0){const u=Array.from(a).filter(f=>!(f instanceof HTMLButtonElement&&f.getAttribute("data-modal-close-button")==="true"));if(u.length>0){u[0].focus();return}a[0].focus();return}e.focus()},[o]);l.useEffect(()=>(s&&(t.current=document.activeElement,n()),()=>{document.body.style.overflow="auto",t.current instanceof HTMLElement&&t.current.focus()}),[s,n])}function ge({id:o,isOpen:s,onClose:t,title:n,children:e,contentOnly:r=!1,className:a,overlayClassName:u,hideCloseButton:f=!1,actions:d=[],disableCloseOnOverlayClick:h=!1,ariaLabelledBy:c,ariaDescribedBy:v}){const m=l.useId(),b=o||`modal-${m}`,g=o?`${o}-title`:`modal-title-${m}`,{show:p,shouldRender:w}=he(s);if(xe(b,w),pe(w,t),!w)return null;const x=()=>n?l.isValidElement(n)?i.jsx("div",{className:"mb-4",children:n}):i.jsx("h2",{className:"mb-4 text-xl font-semibold",id:g,children:n}):null,j=()=>d.length===0?null:i.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:d.map((I,E)=>{const{label:R,className:A,...D}=I;return i.jsx(te,{className:A,type:"button",...D,"data-modal-action":"true",children:R},E)})});return i.jsx(i.Fragment,{children:Q.createPortal(i.jsx("div",{"aria-labelledby":c??n?g:void 0,"aria-describedby":v,role:"dialog","aria-modal":"true",className:"fixed inset-0 z-[100] overflow-y-auto",children:i.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[i.jsx("div",{className:k.n("fixed inset-0 bg-black/20 transition-all",u),onClick:()=>{h||t()}}),r&&i.jsx("div",{className:k.n("relative w-fit",a),children:e}),!r&&i.jsxs("div",{id:b,tabIndex:-1,className:k.n("relative w-full max-w-xl transform rounded-lg shadow-xl bg-popover transition-all p-6 focus:ring ease-in duration-75",p?"opacity-100 scale-100":"opacity-0 scale-90",a),children:[!f&&i.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:i.jsx(_.X,{size:18})}),x(),e,j()]})]})}),document.body)})}function ve(o){const[s,t]=l.useState(!1),[n,e]=l.useState(!1);return l.useEffect(()=>{o?(e(!0),setTimeout(()=>t(!0),10)):(t(!1),setTimeout(()=>e(!1),300))},[o]),{show:s,shouldRender:n}}function we(o,s){l.useEffect(()=>{const t=n=>{n.key==="Escape"&&o&&s()};return document.addEventListener("keydown",t),o&&(document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",t),document.body.style.overflow="auto"}},[o,s])}function ye(o,s){const t=l.useRef(null),n=l.useCallback(()=>{const e=document.getElementById(o);if(!e)return;const r=e.querySelectorAll('[data-panel-action="true"]');if(r.length>0){r[0].focus();return}const a=e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(a.length>0){const u=Array.from(a).filter(f=>!(f instanceof HTMLButtonElement&&f.getAttribute("data-panel-close-button")==="true"));if(u.length>0){u[0].focus();return}a[0].focus();return}e.focus()},[o]);l.useEffect(()=>(s&&(t.current=document.activeElement,n()),()=>{document.body.style.overflow="auto",t.current instanceof HTMLElement&&t.current.focus()}),[s,n])}const je={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 Ee({ref:o,id:s,isOpen:t,onClose:n,title:e,children:r,footer:a,size:u="md",className:f,overlayClassName:d,hideCloseButton:h=!1,disableCloseOnOverlayClick:c=!1,ariaLabelledBy:v,ariaDescribedBy:m}){const b=l.useId(),g=s||`panel-${b}`,p=s?`${s}-title`:`panel-title-${b}`,{show:w,shouldRender:x}=ve(t);if(ye(g,x),we(x,n),!x)return null;const j=()=>e?l.isValidElement(e)?i.jsx("div",{children:e}):i.jsx("h2",{className:"text-2xl font-semibold",id:p,children:e}):null,I=()=>{if(!a)return null;if(l.isValidElement(a)){const E=a,R=E.props.className||"";return l.cloneElement(E,{className:k.n("px-6 py-4",R)})}return i.jsx("div",{className:"px-6 py-4",children:a})};return i.jsx(i.Fragment,{children:Q.createPortal(i.jsxs("div",{"aria-labelledby":v??e?p:void 0,"aria-describedby":m,role:"dialog","aria-modal":"true",className:"fixed inset-0 z-[100] overflow-hidden","data-panel-open":t,children:[i.jsx("div",{className:k.n("fixed inset-0 bg-black/40 transition-opacity duration-300",w?"opacity-100":"opacity-0",d),onClick:()=>{c||n()}}),i.jsx("div",{className:"fixed inset-y-0 right-0 flex max-w-full",children:i.jsx("div",{id:g,ref:o,tabIndex:-1,className:k.n("relative h-full transform shadow-xl bg-popover transition-transform duration-300 ease-in-out",u!=="screen"&&"border-l border-border",je.size[u],w?"translate-x-0":"translate-x-full",f),"data-panel-size":u,children:i.jsxs("div",{className:"flex h-full flex-col",children:[e&&i.jsx("div",{className:"px-6 pt-6",children:j()}),!h&&i.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:i.jsx(_.X,{size:18})}),i.jsx("div",{className:k.n("flex-1 overflow-y-auto px-6 pb-6",e?"pt-6":"pt-10"),children:r}),I()]})})})]}),document.body)})}function re({itemId:o,checked:s,onChange:t,name:n,disabled:e=!1,className:r=""}){const a="relative inline-flex items-center justify-center rounded-full",u=()=>{e||t()},f=y.join(a,!s&&"hover:border-current/60",!e&&"border-current cursor-pointer",e&&"border-muted/60 cursor-not-allowed",r);return i.jsx("div",{id:o,role:"radio",tabIndex:-1,"aria-checked":s,"aria-disabled":e,"aria-description":`Radio button for ${n}`,"aria-labelledby":`${o}-label`,onClick:u,className:f,style:{width:"1em",height:"1em",padding:"0.1em",borderWidth:"0.06em"},children:s&&i.jsx("div",{className:y.join("size-full aspect-square rounded-full",e&&"bg-muted/60",!e&&"bg-current")})})}function P({value:o,children:s,className:t="",isSelected:n=!1,onChange:e,disabled:r=!1,hideInput:a=!1,description:u,name:f}){const h=`radio-${l.useId()}-${o}`,c=()=>{r||e==null||e(o)};return i.jsxs("div",{title:u,className:y.join("relative flex items-center",t,a&&`p-2 border-2 focus-within:border-dashed focus-within:${r?"border-current/50":"border-current/80"}`,a&&!n&&`border-transparent ${r?"":"not-focus-within:hover:border-border/60"}`,a&&n&&"border-border",r&&"opacity-60 cursor-not-allowed"),style:{gap:"0.5em"},children:[!a&&i.jsx(re,{itemId:h,name:f||"",checked:n,onChange:c,disabled:r,className:y.join(a&&"")}),i.jsx("div",{id:a?h:void 0,tabIndex:a?-1:void 0,role:a?"radio":void 0,onClick:a?c:void 0,"aria-checked":a?n?"true":"false":void 0,"aria-disabled":a?r:void 0,"aria-description":a?u||`Radio button for ${f}`:void 0,"aria-labelledby":a?`${h}-label`:void 0,className:y.join(a&&"size-full",typeof s=="object"&&"grow focus:outline-none"),children:i.jsx("label",{id:`${h}-label`,onClick:a?void 0:c,className:y.join(r&&"cursor-not-allowed",!r&&"cursor-pointer"),children:s})})]})}function Ne(o,s){const[t,n]=l.useState(s),[e,r]=l.useState(-1),[a,u]=l.useState(!1),f=l.useCallback((m,b)=>{var w;const g=m[b];g.hasAttribute("disabled")||g.getAttribute("aria-disabled")==="true"||((w=m[b])==null||w.click(),r(b))},[]),d=l.useCallback((m,b)=>{var p;if(m.preventDefault(),a||!b.length)return;const g=s!==-1?s:0;(p=b[g])==null||p.focus(),n(g),s!==-1&&f(b,g)},[s,a,f]),h=l.useCallback(m=>{var w;if(!m.shiftKey)return;m.preventDefault();const b=Array.from(document.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')).filter(x=>!x.hasAttribute("disabled")&&x.tabIndex>=0),g=b.findIndex(x=>x.id===o),p=g>0?g-1:b.length-1;(w=b[p])==null||w.focus()},[o]),c=l.useCallback((m,b)=>{var j;if(!b.length)return;const g=m.target;if(!b.some(I=>I.id===g.id))return;const w=t!==-1?t:0;let x=w;switch(m.key){case"ArrowUp":case"ArrowLeft":m.preventDefault(),x=w>0?w-1:b.length-1;break;case"ArrowDown":case"ArrowRight":m.preventDefault(),x=(w+1)%b.length;break;case" ":m.preventDefault(),f(b,w);return;case"Tab":h(m);return;default:return}(j=b[x])==null||j.focus(),n(x),e!==-1&&f(b,x)},[t,e,h,f]),v=l.useCallback(()=>{const m=document.querySelector(`[id="${o}"][role="radiogroup"]`);return m?Array.from(m.querySelectorAll('[role="radio"]')):[]},[o]);l.useEffect(()=>{const m=document.querySelector(`[id="${o}"][role="radiogroup"]`);if(!m)return;const b=v(),g=j=>d(j,b),p=j=>c(j,b),w=()=>u(!0),x=()=>u(!1);return document.addEventListener("keydown",p),m.addEventListener("focus",g),m.addEventListener("mousedown",w),document.addEventListener("mouseup",x),()=>{document.removeEventListener("keydown",p),m.removeEventListener("focus",g),m.removeEventListener("mousedown",w),document.removeEventListener("mouseup",x)}},[o,v,d,c])}function Ce({options:o=[],value:s,onChange:t,id:n,children:e,className:r="",childrenClassName:a="",hideInputs:u=!1}){const f=l.useId(),d=n||`radio-group-${f}`;Ne(d,o.findIndex(c=>c===s));const h=l.useMemo(()=>o.reduce((c,v)=>(typeof v=="string"?c.some(m=>m.value===v)||c.push({label:v,value:v}):c.push(v),c),[]),[o]);return i.jsxs("div",{id:d,role:"radiogroup",tabIndex:0,className:y.join(r,"focus:outline-none"),children:[h.length>0&&h.map((c,v)=>i.jsx(P,{value:c.value,isSelected:s===c.value,onChange:t,name:d,disabled:c.disabled,description:c.description,hideInput:u,className:a,children:c.label},`${c.value}-${v}`)),h.length===0&&e&&l.Children.map(e,c=>l.isValidElement(c)&&c.type===P?i.jsx(P,{...c.props,className:y.join(a,c.props.className),hideInput:c.props.hideInput||u,isSelected:s===c.props.value,onChange:t,name:d,children:c.props.children}):null)]})}const Ie={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"}},ke={horizontal:"w-full",vertical:"min-h-4 h-full"};function Ae({orientation:o="horizontal",decorative:s=!1,thickness:t="thin",className:n,...e}){const r=y.join("shrink-0 bg-border",ke[o],Ie[t][o],n);return i.jsx("div",{...e,className:r,role:s?"presentation":"separator","aria-orientation":s?void 0:o,"aria-hidden":s,"data-orientation":o,"data-thickness":t})}const J={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 Se({shape:o="rectangle",lineSpacing:s="sm",className:t,lines:n=1,animate:e=!0,ref:r,...a}){const u=y.join("bg-muted/70",e&&"animate-pulse",J.shape[o],t);return n>1?i.jsx("div",{ref:r,className:J.lineSpacing[s],role:"presentation","aria-hidden":"true","data-testid":"skeleton-container","data-lines":n,"data-shape":o,"data-animate":e,...a,children:Array.from({length:n},(f,d)=>i.jsx("div",{className:y.join(u,d===n-1&&"w-3/4"),role:"presentation","aria-hidden":"true","data-testid":"skeleton-line","data-line-index":d},d))}):i.jsx("div",{ref:r,className:u,role:"presentation","aria-hidden":"true","data-testid":"skeleton","data-shape":o,"data-animate":e,...a})}function Te({id:o,value:s,defaultValue:t=0,onValueChange:n,min:e=0,max:r=100,step:a=1,disabled:u=!1,trackClassName:f,rangeClassName:d,thumbClassName:h,className:c,ref:v,ariaLabel:m,ariaLabelledBy:b,...g}){const[p,w]=l.useState(t),x=s!==void 0,j=x?s:p,I=l.useRef(null),E=l.useRef(!1),R=l.useRef(0),A=l.useCallback(N=>{const C=Math.max(e,Math.min(r,N)),S=Math.round(C/a)*a;x||w(S),n==null||n(S)},[e,r,a,x,n]),D=l.useCallback((N,C=!1)=>{var V;const S=(V=I.current)==null?void 0:V.getBoundingClientRect();if(!S)return j;let z=N.clientX;C&&(z=z-R.current);const H=Math.max(0,Math.min(1,(z-S.left)/S.width));return e+(r-e)*H},[e,r,j]),q=l.useCallback(N=>{if(u||N.target!==N.currentTarget)return;const C=D(N);A(C)},[u,D,A]),X=l.useCallback(N=>{var V;if(u)return;N.stopPropagation(),E.current=!0;const C=(V=I.current)==null?void 0:V.getBoundingClientRect(),S=N.currentTarget.getBoundingClientRect();if(C&&S){const L=S.left+S.width/2;R.current=N.clientX-L}N.currentTarget.setPointerCapture(N.pointerId);const z=L=>{if(!E.current)return;const ne=D(L,!0);A(ne)},H=L=>{if(L.pointerId===N.pointerId){E.current=!1,R.current=0;try{N.currentTarget.releasePointerCapture(L.pointerId)}catch{}document.removeEventListener("pointermove",z),document.removeEventListener("pointerup",H)}};document.addEventListener("pointermove",z),document.addEventListener("pointerup",H)},[u,D,A]),F=l.useCallback(N=>{if(u)return;let C=j;switch(N.key){case"ArrowRight":case"ArrowUp":C=j+a;break;case"ArrowLeft":case"ArrowDown":C=j-a;break;case"Home":C=e;break;case"End":C=r;break;case"PageUp":C=j+a*10;break;case"PageDown":C=j-a*10;break;default:return}N.preventDefault(),A(C)},[u,j,a,e,r,A]),$=r===e?0:(j-e)/(r-e)*100;return i.jsx("div",{id:o,ref:v,className:k.n("relative flex items-center w-full touch-none select-none",u&&"opacity-50 cursor-not-allowed",c),"data-disabled":u,"data-value":j,"data-min":e,"data-max":r,"data-step":a,...g,children:i.jsxs("div",{ref:I,className:k.n("relative h-1.5 w-full rounded-full bg-muted cursor-pointer",u&&"cursor-not-allowed",f),onPointerDown:q,children:[i.jsx("div",{className:k.n("absolute h-full rounded-full pointer-events-none",!E.current&&"transition-all",d),style:{width:`${$}%`}}),i.jsx("div",{className:k.n("absolute size-5 -top-2 rounded-full shadow-md cursor-grab",u&&"cursor-not-allowed",!u&&"cursor-grab focus:outline-none focus:ring-2",E.current?"cursor-grabbing scale-110":"transition-all",h),style:{left:`calc(${$}% - 10px)`},tabIndex:u?-1:0,role:"slider","aria-valuemin":e,"aria-valuemax":r,"aria-valuenow":j,"aria-label":m,"aria-labelledby":b,"aria-disabled":u,onKeyDown:F,onPointerDown:X})]})})}function Re({children:o,ref:s,...t}){if(l.isValidElement(o)){let n={...t};return o.props&&(n={...n,...o.props}),l.cloneElement(o,{...n,ref:e=>{typeof s=="function"?s(e):s&&(s.current=e)}})}return l.createElement("div",{...t,ref:s},o)}function De({elementId:o,maxLength:s}){const[t,n]=l.useState(0);return l.useEffect(()=>{const e=document.getElementById(o);if(!e)return;const r=()=>{const a=e.value.length;n(a);const u=a>=s;e.setAttribute("aria-describedby",`${o}-character-count`),e.setAttribute("aria-invalid",u?"true":"false"),u?e.setAttribute("data-error","true"):e.removeAttribute("data-error")};return r(),e.addEventListener("input",r),e.setAttribute("maxlength",String(s)),()=>{e.removeEventListener("input",r),e.removeAttribute("maxlength"),e.removeAttribute("aria-describedby"),e.removeAttribute("aria-invalid"),e.removeAttribute("data-error")}},[o,s]),i.jsx("small",{className:y.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:i.jsxs("span",{id:`${o}-character-count`,children:[t," / ",s," characters"]})})}function $e(o,s){l.useEffect(()=>{const t=document.getElementById(o);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)}},[o,s])}const ze={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"},Le={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"px-3 rounded-full"},Y={variant:"outline",rounded:"none"};function Be({variant:o=Y.variant,rounded:s,displayOnlyMode:t=!1,errorMessage:n,successMessage:e,hideResizeHandle:r=!1,autoExpand:a=!1,characterLimit:u=0,className:f,...d}){const h=l.useId();$e(h,a||t);let c=s;o==="outline"&&!s&&(c="md"),c=c||Y.rounded;let v=r;(t||o==="left-line"&&!r)&&(v=!0);const b=y.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&&ze[o],!t&&Le[c],!t&&"px-2 py-1",t&&"pointer-events-none",v&&"no-resize-handle",f);return i.jsxs("div",{className:y.join("-space-y-1.5",t&&"cursor-text"),children:[i.jsx("textarea",{...d,id:h,"aria-disabled":d.disabled,readOnly:t,"aria-readonly":t||d["aria-readonly"],style:{resize:a?"none":void 0},className:b}),u>0&&i.jsx(De,{elementId:h,maxLength:u}),!t&&i.jsx(U,{elementId:h,type:"error",message:n}),!t&&i.jsx(U,{elementId:h,type:"success",message:e})]})}const Ve={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"}},qe={default:{unchecked:"bg-muted",checked:"bg-primary"},success:{unchecked:"bg-muted",checked:"bg-success"},destructive:{unchecked:"bg-muted",checked:"bg-destructive"}},O={variant:"default",size:"md"};function Fe({ref:o,id:s,size:t=O.size,variant:n=O.variant,checked:e,onCheckedChange:r,disabled:a=!1,className:u,thumbClassName:f,backgroundClassNames:d,...h}){const c=l.useId(),v=l.useMemo(()=>s||`toggle-${c}`,[s,c]),[m,b]=l.useState(e);l.useEffect(()=>{b(e)},[e]);const g=()=>{if(!a){const E=!m;e===void 0&&b(E),r==null||r(E)}},p=E=>{(E.key===" "||E.key==="Enter")&&(E.preventDefault(),g())},w=Ve[t],x=qe[n],j=y.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,m?(d==null?void 0:d.checked)||x.checked:(d==null?void 0:d.unchecked)||x.unchecked,a&&"opacity-50 cursor-not-allowed",!a&&"cursor-pointer",u),I=y.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,m&&w.translate,f);return i.jsxs("button",{ref:o,id:v,type:"button",role:"switch",tabIndex:0,"aria-checked":m,"aria-disabled":a,disabled:a,onClick:g,onKeyDown:p,className:j,...h,children:[i.jsx("span",{className:I}),i.jsx("span",{className:"sr-only",children:m?"Enabled":"Disabled"})]})}const M=8,K=4,T=6;function He(o){return{calculatePosition:l.useCallback((t,n)=>{const e=t.getBoundingClientRect(),r=n.getBoundingClientRect(),a={width:window.innerWidth,height:window.innerHeight},u=(v,m,b,g)=>v<0||m<0||v+b>a.width||m+g>a.height,f={top:{x:e.left+e.width/2-r.width/2,y:e.top-r.height-K,arrow:{x:r.width/2-T,y:r.height}},bottom:{x:e.left+e.width/2-r.width/2,y:e.bottom+K,arrow:{x:r.width/2-T,y:-6}},left:{x:e.left-r.width-K,y:e.top+e.height/2-r.height/2,arrow:{x:r.width,y:r.height/2-T}},right:{x:e.right+K,y:e.top+e.height/2-r.height/2,arrow:{x:-6,y:r.height/2-T}}};let d=o,h=f[o];if(u(h.x,h.y,r.width,r.height)){const v={top:"bottom",bottom:"top",left:"right",right:"left"},m=f[v[o]];if(!u(m.x,m.y,r.width,r.height))d=v[o],h=m;else{const b=["top","bottom","left","right"].filter(g=>g!==o&&g!==v[o]);for(const g of b){const p=f[g];if(!u(p.x,p.y,r.width,r.height)){d=g,h=p;break}}}}h.x=Math.max(M,Math.min(h.x,a.width-r.width-M)),h.y=Math.max(M,Math.min(h.y,a.height-r.height-M));const c={x:e.left+e.width/2,y:e.top+e.height/2};return d==="top"||d==="bottom"?h.arrow.x=Math.max(T,Math.min(c.x-h.x-T,r.width-T*2)):h.arrow.y=Math.max(T,Math.min(c.y-h.y-T,r.height-T*2)),{...h,placement:d}},[o])}}function Me(o,s,t){const n=l.useRef(null),e=l.useRef(null),r=l.useCallback(()=>{if(!n.current||!e.current)return;const a=o(n.current,e.current);t(a)},[o,t]);return l.useEffect(()=>{if(!s)return;const a=()=>r();return window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a)}},[s,r]),{triggerRef:n,tooltipRef:e,updatePosition:r}}function Ke(o,s,t,n,e,r,a,u,f){const d=l.useRef(null),h=l.useCallback(()=>{o||(d.current&&clearTimeout(d.current),d.current=window.setTimeout(()=>{t(!0),requestAnimationFrame(()=>{e(),n(!0)})},s))},[o,s,t,e,n]),c=l.useCallback((v=!1)=>{if(d.current&&clearTimeout(d.current),v){n(!1),setTimeout(()=>t(!1),150);return}d.current=window.setTimeout(()=>{n(!1),setTimeout(()=>t(!1),150)},100)},[n,t]);return l.useEffect(()=>{!r&&!a&&!u&&f&&c()},[r,a,u,f,c]),l.useEffect(()=>()=>{d.current&&clearTimeout(d.current)},[]),{showTooltip:h,hideTooltip:c,timeoutRef:d}}function Ge({id:o,children:s,message:t,placement:n="top",disabled:e=!1,delay:r=200,className:a}){const[u,f]=l.useState(!1),[d,h]=l.useState(!1),[c,v]=l.useState(null),[m,b]=l.useState(!1),[g,p]=l.useState(!1),[w,x]=l.useState(!1),{calculatePosition:j}=He(n),{triggerRef:I,tooltipRef:E,updatePosition:R}=Me(j,d,v),{showTooltip:A,hideTooltip:D,timeoutRef:q}=Ke(e,r,h,f,R,m,g,w,u),X=l.useId(),F=o??X;return i.jsxs(i.Fragment,{children:[l.cloneElement(s,{ref:$=>{I.current=$},onMouseEnter:()=>{b(!0),A()},onMouseLeave:()=>{b(!1)},onFocus:()=>{x(!0),A()},onBlur:()=>{x(!1),D(!0)},onKeyDown:$=>{$.key==="Escape"&&D(!0)},"aria-describedby":e?void 0:F}),d&&Q.createPortal(i.jsx("div",{ref:E,id:F,role:"tooltip",className:y.join("fixed z-50 px-2 py-1 text-sm rounded shadow-lg bg-popover pointer-events-auto transition-all duration-150 ease-out",u?"opacity-100":"opacity-0",a),style:c?{left:c.x,top:c.y}:{opacity:0},onMouseEnter:()=>{p(!0),q.current&&clearTimeout(q.current)},onMouseLeave:()=>{p(!1)},children:t}),document.body)]})}exports.ActionModal=k.ActionModal;exports.Toast=k.Toast;exports.Accordion=oe;exports.AccordionItem=G;exports.Button=te;exports.ButtonLoadingDots=ee;exports.Checkbox=ue;exports.Clickable=ce;exports.Input=me;exports.Label=be;exports.Modal=ge;exports.Panel=Ee;exports.RadioGroup=Ce;exports.RadioGroupItem=P;exports.RadioInput=re;exports.Separator=Ae;exports.Skeleton=Se;exports.Slider=Te;exports.Slot=Re;exports.Textarea=Be;exports.Toggle=Fe;exports.Tooltip=Ge;
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