@moondreamsdev/dreamer-ui 1.7.6-test.0 → 1.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components.cjs.js +1 -1
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.esm.js +124 -118
- package/dist/components.esm.js.map +1 -1
- package/dist/hooks.cjs.js +1 -1
- package/dist/providers.cjs.js +1 -1
- package/dist/providers.esm.js +1 -1
- package/dist/src/components/accordion/AccordionItem.d.ts +0 -1
- package/dist/src/components/clickable/Clickable.d.ts +0 -1
- package/dist/src/components/radiogroup/RadioGroupItem.d.ts +0 -1
- package/dist/src/components/tooltip/Tooltip.d.ts +0 -2
- package/dist/src/components/tooltip/hooks.d.ts +3 -1
- package/dist/src/hooks/useActionModal.d.ts +0 -1
- package/dist/{styles-BqvnMUW1.cjs → styles-Bxzm1DQb.cjs} +2 -2
- package/dist/styles-Bxzm1DQb.cjs.map +1 -0
- package/dist/{styles-DUXNGn3s.js → styles-eVzajhIX.js} +31 -31
- package/dist/styles-eVzajhIX.js.map +1 -0
- package/dist/useActionModal-CqT8y2he.cjs +2 -0
- package/dist/{useActionModal-BXwArRwi.cjs.map → useActionModal-CqT8y2he.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/styles-BqvnMUW1.cjs.map +0 -1
- package/dist/styles-DUXNGn3s.js.map +0 -1
- package/dist/useActionModal-BXwArRwi.cjs +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const i=require("react/jsx-runtime"),o=require("react"),B=require("react-dom");function f(...e){return e.filter(t=>typeof t=="string"&&t).join(" ").trim()||void 0}function M({size:e=15,color:t="currentColor"}){return i.jsx("svg",{width:e,height:e,className:"inline",viewBox:"0 0 15 15",xmlns:"http://www.w3.org/2000/svg",children:i.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:t,fillRule:"evenodd",clipRule:"evenodd"})})}function
|
|
2
|
-
//# sourceMappingURL=styles-
|
|
1
|
+
"use strict";const i=require("react/jsx-runtime"),o=require("react"),B=require("react-dom");function f(...e){return e.filter(t=>typeof t=="string"&&t).join(" ").trim()||void 0}function M({size:e=15,color:t="currentColor"}){return i.jsx("svg",{width:e,height:e,className:"inline",viewBox:"0 0 15 15",xmlns:"http://www.w3.org/2000/svg",children:i.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:t,fillRule:"evenodd",clipRule:"evenodd"})})}function y(...e){return e.filter(t=>typeof t=="string"&&t).join(" ").trim()||void 0}o.createContext(void 0);function O(){const[e,t]=o.useState(0);return o.useEffect(()=>{const n=setInterval(()=>{t(r=>(r+1)%3)},500);return()=>clearInterval(n)},[]),i.jsx("div",{className:"absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle",children:[0,1,2].map(n=>i.jsx("div",{className:f("rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current",e===n&&"transform -translate-y-1")},n))})}const R={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"},T={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"},q={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},x={variant:"primary",size:"md",rounded:"md"};function I({variant:e=x.variant,size:t,rounded:n=x.rounded,loading:r,linkTo:l,linkProps:a,type:u="button",className:c,...s}){let d;e==="link"&&!t?d="fitted":d=t||x.size;const m=f("appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",R[e],T[d],q[n],r&&"relative pointer-events-none",l&&"relative",c);return i.jsxs("button",{...s,role:l?"link":s.role,"aria-label":s["aria-label"]||(a==null?void 0:a["aria-label"]),"aria-description":s["aria-description"]||(a==null?void 0:a["aria-description"]),"aria-disabled":s.disabled||r,"aria-busy":r,type:u,className:m,children:[r&&i.jsx(O,{}),i.jsx("span",{className:f(r&&"invisible"),children:s.children}),l&&!s.disabled&&i.jsx("a",{...a,"aria-hidden":!0,href:l,rel:(a==null?void 0:a.rel)||"noreferrer",className:"absolute inset-0"})]})}function S(e){const[t,n]=o.useState(!1),[r,l]=o.useState(!1);return o.useEffect(()=>{e?(l(!0),setTimeout(()=>n(!0),10)):(n(!1),setTimeout(()=>l(!1),150))},[e]),{show:t,shouldRender:r}}function H(e,t){o.useEffect(()=>{const n=r=>{r.key==="Escape"&&e&&t()};return document.addEventListener("keydown",n),e&&(document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",n),document.body.style.overflow="auto"}},[e,t])}function $(e,t){const n=o.useRef(null),r=o.useCallback(()=>{const l=document.getElementById(e);if(!l)return;const a=l.querySelectorAll('[data-modal-action="true"]');if(a.length>0){a[0].focus();return}const u=l.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(u.length>0){const c=Array.from(u).filter(s=>!(s instanceof HTMLButtonElement&&s.getAttribute("data-modal-close-button")==="true"));if(c.length>0){c[0].focus();return}u[0].focus();return}l.focus()},[e]);o.useEffect(()=>(t&&(n.current=document.activeElement,r()),()=>{document.body.style.overflow="auto",n.current instanceof HTMLElement&&n.current.focus()}),[t,r])}function D({id:e,isOpen:t,onClose:n,title:r,children:l,contentOnly:a=!1,className:u,overlayClassName:c,hideCloseButton:s=!1,actions:d=[],disableCloseOnOverlayClick:m=!1,ariaLabelledBy:h,ariaDescribedBy:j}){const p=o.useId(),v=e||`modal-${p}`,g=e?`${e}-title`:`modal-title-${p}`,{show:w,shouldRender:b}=S(t);if($(v,b),H(b,n),!b)return null;const N=()=>r?o.isValidElement(r)?i.jsx("div",{className:"mb-4",children:r}):i.jsx("h2",{className:"mb-4 text-xl font-semibold",id:g,children:r}):null,C=()=>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((k,L)=>{const{label:E,className:z,...A}=k;return i.jsx(I,{className:z,type:"button",...A,"data-modal-action":"true",children:E},L)})});return i.jsx(i.Fragment,{children:B.createPortal(i.jsx("div",{"aria-labelledby":h??r?g:void 0,"aria-describedby":j,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:y("fixed inset-0 bg-black/20 transition-all",c),onClick:()=>{m||n()}}),a&&i.jsx("div",{className:y("relative w-fit",u),children:l}),!a&&i.jsxs("div",{id:v,tabIndex:-1,className:y("relative w-full max-w-xl transform rounded-lg shadow-xl transition-all p-6 bg-inherit focus:ring ease-in duration-75",w?"opacity-100 scale-100":"opacity-0 scale-90",u),children:[!s&&i.jsx("button",{type:"button",onClick:n,"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(M,{size:18})}),N(),l,C()]})]})}),document.body)})}function F({type:e,message:t,cancelText:n,confirmText:r,onConfirm:l,onClose:a,destructive:u=!1,title:c,...s}){const d=o.useMemo(()=>e==="confirm"?{confirm:r||"Confirm",cancel:n||"Cancel",defaultTitle:c||"Confirm Action"}:{confirm:r||"OK",cancel:null,defaultTitle:c||"Alert"},[e,r,c,n]),m=o.useMemo(()=>[...d.cancel?[{label:d.cancel,variant:"secondary",onClick:a}]:[],{label:d.confirm,variant:u?"destructive":"primary",onClick:()=>{l==null||l(),a()}}],[d,u,l,a]);return i.jsx(D,{...s,title:c||d.defaultTitle,onClose:a,actions:m,disableCloseOnOverlayClick:e==="confirm",hideCloseButton:e==="confirm",children:typeof t=="string"?i.jsx("p",{className:"text-sm",children:t}):t})}exports.ActionModal=F;exports.n=f;
|
|
2
|
+
//# sourceMappingURL=styles-Bxzm1DQb.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles-Bxzm1DQb.cjs","sources":["utils.esm.js","QuestionMarkCircled-JRFAPLtT.js","styles-DUXNGn3s.js","components.esm.js","../src/components/actionmodal/ActionModal.tsx"],"sourcesContent":["function n(...t) {\n return t.filter((s) => typeof s == \"string\" && s).join(\" \").trim() || void 0;\n}\nexport {\n n as join\n};\n//# sourceMappingURL=utils.esm.js.map\n","import { jsx as e } from \"react/jsx-runtime\";\nfunction i({ size: C = 15, color: l = \"currentColor\" }) {\n return /* @__PURE__ */ e(\"svg\", { width: C, height: C, className: \"inline\", viewBox: \"0 0 15 15\", xmlns: \"http://www.w3.org/2000/svg\", children: /* @__PURE__ */ e(\n \"path\",\n {\n d: \"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z\",\n fill: l,\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n ) });\n}\nfunction t({ size: C = 15 }) {\n return /* @__PURE__ */ e(\"svg\", { width: C, height: C, className: \"inline\", viewBox: \"0 0 15 15\", xmlns: \"http://www.w3.org/2000/svg\", children: /* @__PURE__ */ e(\n \"path\",\n {\n d: \"M7.49991 0.877045C3.84222 0.877045 0.877075 3.84219 0.877075 7.49988C0.877075 11.1575 3.84222 14.1227 7.49991 14.1227C11.1576 14.1227 14.1227 11.1575 14.1227 7.49988C14.1227 3.84219 11.1576 0.877045 7.49991 0.877045ZM1.82708 7.49988C1.82708 4.36686 4.36689 1.82704 7.49991 1.82704C10.6329 1.82704 13.1727 4.36686 13.1727 7.49988C13.1727 10.6329 10.6329 13.1727 7.49991 13.1727C4.36689 13.1727 1.82708 10.6329 1.82708 7.49988ZM10.1589 5.53774C10.3178 5.31191 10.2636 5.00001 10.0378 4.84109C9.81194 4.68217 9.50004 4.73642 9.34112 4.96225L6.51977 8.97154L5.35681 7.78706C5.16334 7.59002 4.84677 7.58711 4.64973 7.78058C4.45268 7.97404 4.44978 8.29061 4.64325 8.48765L6.22658 10.1003C6.33054 10.2062 6.47617 10.2604 6.62407 10.2483C6.77197 10.2363 6.90686 10.1591 6.99226 10.0377L10.1589 5.53774Z\",\n fill: \"currentColor\",\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n ) });\n}\nfunction o({ size: C = 15, color: l = \"currentColor\" }) {\n return /* @__PURE__ */ e(\"svg\", { width: C, height: C, className: \"inline\", viewBox: \"0 0 15 15\", xmlns: \"http://www.w3.org/2000/svg\", children: /* @__PURE__ */ e(\n \"path\",\n {\n d: \"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z\",\n fill: l,\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n ) });\n}\nfunction r({ size: C = 15 }) {\n return /* @__PURE__ */ e(\"svg\", { width: C, height: C, className: \"inline\", viewBox: \"0 0 15 15\", xmlns: \"http://www.w3.org/2000/svg\", children: /* @__PURE__ */ e(\n \"path\",\n {\n d: \"M8.4449 0.608765C8.0183 -0.107015 6.9817 -0.107015 6.55509 0.608766L0.161178 11.3368C-0.275824 12.07 0.252503 13 1.10608 13H13.8939C14.7475 13 15.2758 12.07 14.8388 11.3368L8.4449 0.608765ZM7.4141 1.12073C7.45288 1.05566 7.54712 1.05566 7.5859 1.12073L13.9798 11.8488C14.0196 11.9154 13.9715 12 13.8939 12H1.10608C1.02849 12 0.980454 11.9154 1.02018 11.8488L7.4141 1.12073ZM6.8269 4.48611C6.81221 4.10423 7.11783 3.78663 7.5 3.78663C7.88217 3.78663 8.18778 4.10423 8.1731 4.48612L8.01921 8.48701C8.00848 8.766 7.7792 8.98664 7.5 8.98664C7.2208 8.98664 6.99151 8.766 6.98078 8.48701L6.8269 4.48611ZM8.24989 10.476C8.24989 10.8902 7.9141 11.226 7.49989 11.226C7.08567 11.226 6.74989 10.8902 6.74989 10.476C6.74989 10.0618 7.08567 9.72599 7.49989 9.72599C7.9141 9.72599 8.24989 10.0618 8.24989 10.476Z\",\n fill: \"currentColor\",\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n ) });\n}\nfunction d({ size: C = 15 }) {\n return /* @__PURE__ */ e(\"svg\", { width: C, height: C, className: \"inline\", viewBox: \"0 0 15 15\", xmlns: \"http://www.w3.org/2000/svg\", children: /* @__PURE__ */ e(\n \"path\",\n {\n d: \"M14.7649 6.07596C14.9991 6.22231 15.0703 6.53079 14.9239 6.76495C14.4849 7.46743 13.9632 8.10645 13.3702 8.66305L14.5712 9.86406C14.7664 10.0593 14.7664 10.3759 14.5712 10.5712C14.3759 10.7664 14.0593 10.7664 13.8641 10.5712L12.6011 9.30817C11.805 9.90283 10.9089 10.3621 9.93375 10.651L10.383 12.3277C10.4544 12.5944 10.2961 12.8685 10.0294 12.94C9.76267 13.0115 9.4885 12.8532 9.41704 12.5865L8.95917 10.8775C8.48743 10.958 8.00036 10.9999 7.50001 10.9999C6.99965 10.9999 6.51257 10.958 6.04082 10.8775L5.58299 12.5864C5.51153 12.8532 5.23737 13.0115 4.97064 12.94C4.7039 12.8686 4.5456 12.5944 4.61706 12.3277L5.06625 10.651C4.09111 10.3621 3.19503 9.90282 2.3989 9.30815L1.1359 10.5712C0.940638 10.7664 0.624058 10.7664 0.428798 10.5712C0.233537 10.3759 0.233537 10.0593 0.428798 9.86405L1.62982 8.66303C1.03682 8.10643 0.515113 7.46742 0.0760677 6.76495C-0.0702867 6.53079 0.000898544 6.22231 0.235065 6.07596C0.469231 5.9296 0.777703 6.00079 0.924058 6.23496C1.40354 7.00213 1.989 7.68057 2.66233 8.2427C2.67315 8.25096 2.6837 8.25972 2.69397 8.26898C4.00897 9.35527 5.65537 9.99991 7.50001 9.99991C10.3078 9.99991 12.6564 8.5063 14.076 6.23495C14.2223 6.00079 14.5308 5.9296 14.7649 6.07596Z\",\n fill: \"currentColor\",\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n ) });\n}\nfunction h({ size: C = 15 }) {\n return /* @__PURE__ */ e(\"svg\", { width: C, height: C, className: \"inline\", viewBox: \"0 0 15 15\", xmlns: \"http://www.w3.org/2000/svg\", children: /* @__PURE__ */ e(\n \"path\",\n {\n d: \"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z\",\n fill: \"currentColor\",\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n ) });\n}\nfunction w({ size: C = 15, color: l = \"currentColor\" }) {\n return /* @__PURE__ */ e(\"svg\", { width: C, height: C, className: \"inline\", viewBox: \"0 0 15 15\", xmlns: \"http://www.w3.org/2000/svg\", children: /* @__PURE__ */ e(\n \"path\",\n {\n d: \"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z\",\n fill: l,\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n ) });\n}\nfunction c({ size: C = 15, color: l = \"currentColor\" }) {\n return /* @__PURE__ */ e(\"svg\", { width: C, height: C, className: \"inline\", viewBox: \"0 0 15 15\", xmlns: \"http://www.w3.org/2000/svg\", children: /* @__PURE__ */ e(\n \"path\",\n {\n d: \"M0.877075 7.49972C0.877075 3.84204 3.84222 0.876892 7.49991 0.876892C11.1576 0.876892 14.1227 3.84204 14.1227 7.49972C14.1227 11.1574 11.1576 14.1226 7.49991 14.1226C3.84222 14.1226 0.877075 11.1574 0.877075 7.49972ZM7.49991 1.82689C4.36689 1.82689 1.82708 4.36671 1.82708 7.49972C1.82708 10.6327 4.36689 13.1726 7.49991 13.1726C10.6329 13.1726 13.1727 10.6327 13.1727 7.49972C13.1727 4.36671 10.6329 1.82689 7.49991 1.82689ZM8.24993 10.5C8.24993 10.9142 7.91414 11.25 7.49993 11.25C7.08571 11.25 6.74993 10.9142 6.74993 10.5C6.74993 10.0858 7.08571 9.75 7.49993 9.75C7.91414 9.75 8.24993 10.0858 8.24993 10.5ZM6.05003 6.25C6.05003 5.57211 6.63511 4.925 7.50003 4.925C8.36496 4.925 8.95003 5.57211 8.95003 6.25C8.95003 6.74118 8.68002 6.99212 8.21447 7.27494C8.16251 7.30651 8.10258 7.34131 8.03847 7.37854L8.03841 7.37858C7.85521 7.48497 7.63788 7.61119 7.47449 7.73849C7.23214 7.92732 6.95003 8.23198 6.95003 8.7C6.95004 9.00376 7.19628 9.25 7.50004 9.25C7.8024 9.25 8.04778 9.00601 8.05002 8.70417L8.05056 8.7033C8.05924 8.6896 8.08493 8.65735 8.15058 8.6062C8.25207 8.52712 8.36508 8.46163 8.51567 8.37436L8.51571 8.37433C8.59422 8.32883 8.68296 8.27741 8.78559 8.21506C9.32004 7.89038 10.05 7.35382 10.05 6.25C10.05 4.92789 8.93511 3.825 7.50003 3.825C6.06496 3.825 4.95003 4.92789 4.95003 6.25C4.95003 6.55376 5.19628 6.8 5.50003 6.8C5.80379 6.8 6.05003 6.55376 6.05003 6.25Z\",\n fill: l,\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n ) });\n}\nexport {\n i as C,\n r as E,\n c as Q,\n w as X,\n t as a,\n o as b,\n d as c,\n h as d\n};\n//# sourceMappingURL=QuestionMarkCircled-JRFAPLtT.js.map\n","import { jsx as l, Fragment as R, jsxs as y } from \"react/jsx-runtime\";\nimport I, { createContext as M, useId as q, useState as v, useEffect as m, useRef as H, useCallback as S, useMemo as N } from \"react\";\nimport { createPortal as K } from \"react-dom\";\nfunction g(...e) {\n return e.filter((t) => typeof t == \"string\" && t).join(\" \").trim() || void 0;\n}\nfunction P({ size: e = 15, color: t = \"currentColor\" }) {\n return /* @__PURE__ */ l(\"svg\", { width: e, height: e, className: \"inline\", viewBox: \"0 0 15 15\", xmlns: \"http://www.w3.org/2000/svg\", children: /* @__PURE__ */ l(\n \"path\",\n {\n d: \"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z\",\n fill: t,\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n ) });\n}\nfunction b(...e) {\n return e.filter((t) => typeof t == \"string\" && t).join(\" \").trim() || void 0;\n}\nM(void 0);\nfunction D() {\n const [e, t] = v(0);\n return m(() => {\n const n = setInterval(() => {\n t((r) => (r + 1) % 3);\n }, 500);\n return () => clearInterval(n);\n }, []), /* @__PURE__ */ l(\"div\", { className: \"absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle\", children: [0, 1, 2].map((n) => /* @__PURE__ */ l(\n \"div\",\n {\n className: g(\n \"rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current\",\n e === n && \"transform -translate-y-1\"\n )\n },\n n\n )) });\n}\nconst F = {\n base: \"\",\n primary: \"bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80\",\n tertiary: \"text-primary hover:text-primary-foreground disabled:text-muted\",\n outline: \"border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted\",\n link: \"underline-offset-4 hover:underline disabled:underline disabled:text-muted\",\n destructive: \"bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground\"\n}, V = {\n stripped: \"\",\n fitted: \"size-fit\",\n sm: \"px-2 py-1 text-sm\",\n md: \"px-4 py-2 text-base\",\n lg: \"px-6 py-3 text-lg\",\n icon: \"p-1 w-fit aspect-square\",\n full: \"p-2 w-full\"\n}, Z = {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"rounded-full\"\n}, p = {\n variant: \"primary\",\n size: \"md\",\n rounded: \"md\"\n};\nfunction G({\n variant: e = p.variant,\n size: t,\n rounded: n = p.rounded,\n loading: r,\n linkTo: i,\n linkProps: a,\n type: s = \"button\",\n className: c,\n ...o\n}) {\n let d;\n e === \"link\" && !t ? d = \"fitted\" : d = t || p.size;\n const u = g(\n \"appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all\",\n F[e],\n V[d],\n Z[n],\n r && \"relative pointer-events-none\",\n i && \"relative\",\n c\n );\n return /* @__PURE__ */ y(\n \"button\",\n {\n ...o,\n role: i ? \"link\" : o.role,\n \"aria-label\": o[\"aria-label\"] || (a == null ? void 0 : a[\"aria-label\"]),\n \"aria-description\": o[\"aria-description\"] || (a == null ? void 0 : a[\"aria-description\"]),\n \"aria-disabled\": o.disabled || r,\n \"aria-busy\": r,\n type: s,\n className: u,\n children: [\n r && /* @__PURE__ */ l(D, {}),\n /* @__PURE__ */ l(\"span\", { className: g(r && \"invisible\"), children: o.children }),\n i && !o.disabled && /* @__PURE__ */ l(\n \"a\",\n {\n ...a,\n \"aria-hidden\": !0,\n href: i,\n rel: (a == null ? void 0 : a.rel) || \"noreferrer\",\n className: \"absolute inset-0\"\n }\n )\n ]\n }\n );\n}\nfunction J(e) {\n const [t, n] = v(!1), [r, i] = v(!1);\n return m(() => {\n e ? (i(!0), setTimeout(() => n(!0), 10)) : (n(!1), setTimeout(() => i(!1), 150));\n }, [e]), { show: t, shouldRender: r };\n}\nfunction Q(e, t) {\n m(() => {\n const n = (r) => {\n r.key === \"Escape\" && e && t();\n };\n return document.addEventListener(\"keydown\", n), e && (document.body.style.overflow = \"hidden\"), () => {\n document.removeEventListener(\"keydown\", n), document.body.style.overflow = \"auto\";\n };\n }, [e, t]);\n}\nfunction U(e, t) {\n const n = H(null), r = S(() => {\n const i = document.getElementById(e);\n if (!i) return;\n const a = i.querySelectorAll('[data-modal-action=\"true\"]');\n if (a.length > 0) {\n a[0].focus();\n return;\n }\n const s = i.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n );\n if (s.length > 0) {\n const c = Array.from(s).filter((o) => !(o instanceof HTMLButtonElement && o.getAttribute(\"data-modal-close-button\") === \"true\"));\n if (c.length > 0) {\n c[0].focus();\n return;\n }\n s[0].focus();\n return;\n }\n i.focus();\n }, [e]);\n m(() => (t && (n.current = document.activeElement, r()), () => {\n document.body.style.overflow = \"auto\", n.current instanceof HTMLElement && n.current.focus();\n }), [t, r]);\n}\nfunction W({\n id: e,\n isOpen: t,\n onClose: n,\n title: r,\n children: i,\n contentOnly: a = !1,\n className: s,\n overlayClassName: c,\n hideCloseButton: o = !1,\n actions: d = [],\n disableCloseOnOverlayClick: u = !1,\n ariaLabelledBy: k,\n ariaDescribedBy: C\n}) {\n const h = q(), x = e || `modal-${h}`, w = e ? `${e}-title` : `modal-title-${h}`, { show: L, shouldRender: f } = J(t);\n if (U(x, f), Q(f, n), !f) return null;\n const z = () => r ? I.isValidElement(r) ? /* @__PURE__ */ l(\"div\", { className: \"mb-4\", children: r }) : /* @__PURE__ */ l(\"h2\", { className: \"mb-4 text-xl font-semibold\", id: w, children: r }) : null, E = () => d.length === 0 ? null : /* @__PURE__ */ l(\"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((A, j) => {\n const { label: B, className: O, ...T } = A;\n return /* @__PURE__ */ l(G, { className: O, type: \"button\", ...T, \"data-modal-action\": \"true\", children: B }, j);\n }) });\n return /* @__PURE__ */ l(R, { children: K(\n /* @__PURE__ */ l(\n \"div\",\n {\n \"aria-labelledby\": k ?? r ? w : void 0,\n \"aria-describedby\": C,\n role: \"dialog\",\n \"aria-modal\": \"true\",\n className: \"fixed inset-0 z-[100] overflow-y-auto\",\n children: /* @__PURE__ */ y(\"div\", { className: \"flex min-h-screen items-center justify-center p-4\", children: [\n /* @__PURE__ */ l(\n \"div\",\n {\n className: b(\"fixed inset-0 bg-black/20 transition-all\", c),\n onClick: () => {\n u || n();\n }\n }\n ),\n a && /* @__PURE__ */ l(\"div\", { className: b(\"relative w-fit\", s), children: i }),\n !a && /* @__PURE__ */ y(\n \"div\",\n {\n id: x,\n tabIndex: -1,\n className: b(\n \"relative w-full max-w-xl transform rounded-lg shadow-xl transition-all p-6 bg-inherit focus:ring ease-in duration-75\",\n L ? \"opacity-100 scale-100\" : \"opacity-0 scale-90\",\n s\n ),\n children: [\n !o && /* @__PURE__ */ l(\n \"button\",\n {\n type: \"button\",\n onClick: n,\n \"data-modal-close-button\": \"true\",\n 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\",\n children: /* @__PURE__ */ l(P, { size: 18 })\n }\n ),\n z(),\n i,\n E()\n ]\n }\n )\n ] })\n }\n ),\n document.body\n ) });\n}\nfunction $({\n type: e,\n message: t,\n cancelText: n,\n confirmText: r,\n onConfirm: i,\n onClose: a,\n destructive: s = !1,\n title: c,\n ...o\n}) {\n const d = N(() => e === \"confirm\" ? {\n confirm: r || \"Confirm\",\n cancel: n || \"Cancel\",\n defaultTitle: c || \"Confirm Action\"\n } : {\n confirm: r || \"OK\",\n cancel: null,\n defaultTitle: c || \"Alert\"\n }, [e, r, c, n]), u = N(\n () => [\n ...d.cancel ? [\n {\n label: d.cancel,\n variant: \"secondary\",\n onClick: a\n }\n ] : [],\n {\n label: d.confirm,\n variant: s ? \"destructive\" : \"primary\",\n onClick: () => {\n i == null || i(), a();\n }\n }\n ],\n [d, s, i, a]\n );\n return /* @__PURE__ */ l(\n W,\n {\n ...o,\n title: c || d.defaultTitle,\n onClose: a,\n actions: u,\n disableCloseOnOverlayClick: e === \"confirm\",\n hideCloseButton: e === \"confirm\",\n children: typeof t == \"string\" ? /* @__PURE__ */ l(\"p\", { className: \"text-sm\", children: t }) : t\n }\n );\n}\nexport {\n $ as A,\n g as n\n};\n//# sourceMappingURL=styles-DUXNGn3s.js.map\n","import { jsxs as N, jsx as c, Fragment as _ } from \"react/jsx-runtime\";\nimport T, { useId as $, useState as x, createElement as X, useEffect as E, useCallback as A, useMemo as Z, useRef as z, isValidElement as M, cloneElement as O } from \"react\";\nimport { join as w } from \"./utils.esm.js\";\nimport { b as P, C as ee, E as te, a as re, d as oe, c as ne, Q as ae, X as se } from \"./QuestionMarkCircled-JRFAPLtT.js\";\nimport { n as H } from \"./styles-DUXNGn3s.js\";\nimport { A as Qe } from \"./styles-DUXNGn3s.js\";\nimport { createPortal as J } from \"react-dom\";\nfunction q({\n id: n,\n title: a,\n content: e,\n children: o,\n className: t = \"\",\n disabled: r = !1,\n isOpen: s = !1,\n onToggle: l,\n triggerClassName: d = \"\",\n bodyClassName: u = \"\"\n}) {\n const f = $(), i = n || `accordion-item-${f}`, g = `${i}-header`, b = `${i}-panel`, m = () => {\n !r && l && l();\n }, v = (h) => {\n (h.key === \"Enter\" || h.key === \" \") && (h.preventDefault(), m());\n };\n return /* @__PURE__ */ N(\"div\", { className: w(\"border-b border-gray-200\", r && \"opacity-60 cursor-not-allowed\", t), children: [\n /* @__PURE__ */ N(\n \"button\",\n {\n id: g,\n type: \"button\",\n className: w(\n \"w-full text-left py-3 px-4 flex justify-between items-center focus:outline focus:outline-secondary\",\n r ? \"cursor-not-allowed\" : \"hover:bg-gray-50/10 cursor-pointer\",\n d\n ),\n \"aria-expanded\": s,\n \"aria-controls\": b,\n disabled: r,\n onClick: m,\n onKeyDown: v,\n children: [\n /* @__PURE__ */ c(\"span\", { children: a }),\n /* @__PURE__ */ c(\n \"span\",\n {\n className: w(\n \"transform transition-transform duration-300 ease-linear\",\n s ? \"rotate-180\" : \"rotate-0\"\n ),\n \"aria-hidden\": \"true\",\n children: /* @__PURE__ */ c(P, { size: 18 })\n }\n )\n ]\n }\n ),\n /* @__PURE__ */ c(\n \"div\",\n {\n id: b,\n role: \"region\",\n \"aria-labelledby\": g,\n className: w(\n \"transition-all duration-300 ease-linear px-4\",\n s ? \"max-h-96 opacity-100 overflow-auto py-3\" : \"max-h-0 opacity-0 overflow-hidden\",\n u\n ),\n children: s && (o || e)\n }\n )\n ] });\n}\nfunction ze({\n id: n,\n items: a = [],\n children: e,\n className: o = \"\",\n itemClassName: t = \"\",\n allowMultiple: r = !1,\n defaultOpenItems: s = [],\n triggersClassName: l = \"\",\n bodiesClassName: d = \"\"\n}) {\n const u = $(), f = n || `accordion-group-${u}`, [i, g] = x(new Set(s)), b = (h) => {\n g((y) => {\n const p = new Set(y);\n return p.has(h) ? p.delete(h) : (r || p.clear(), p.add(h)), p;\n });\n }, m = (h) => `${u}-item-${h}`, v = (h) => i.has(h);\n return /* @__PURE__ */ N(\"div\", { id: f, className: o, children: [\n a.length > 0 && a.map((h, y) => {\n const p = h.id || m(y);\n return /* @__PURE__ */ c(\n q,\n {\n id: p,\n title: h.title,\n content: h.content,\n disabled: h.disabled,\n isOpen: v(p),\n onToggle: () => b(p),\n className: t,\n triggerClassName: l,\n bodyClassName: d\n },\n p\n );\n }),\n a.length === 0 && e && T.Children.map(e, (h, y) => {\n if (T.isValidElement(h) && h.type === q) {\n const p = h.props.id || m(y);\n return /* @__PURE__ */ X(\n q,\n {\n ...h.props,\n key: p,\n id: p,\n className: w(t, h.props.className),\n isOpen: v(p),\n onToggle: () => b(p),\n triggerClassName: w(l, h.props.triggerClassName),\n bodyClassName: w(d, h.props.bodyClassName)\n }\n );\n }\n return null;\n })\n ] });\n}\nfunction ie() {\n const [n, a] = x(0);\n return E(() => {\n const e = setInterval(() => {\n a((o) => (o + 1) % 3);\n }, 500);\n return () => clearInterval(e);\n }, []), /* @__PURE__ */ c(\"div\", { className: \"absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle\", children: [0, 1, 2].map((e) => /* @__PURE__ */ c(\n \"div\",\n {\n className: w(\n \"rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current\",\n n === e && \"transform -translate-y-1\"\n )\n },\n e\n )) });\n}\nconst le = {\n base: \"\",\n primary: \"bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80\",\n tertiary: \"text-primary hover:text-primary-foreground disabled:text-muted\",\n outline: \"border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted\",\n link: \"underline-offset-4 hover:underline disabled:underline disabled:text-muted\",\n destructive: \"bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground\"\n}, de = {\n stripped: \"\",\n fitted: \"size-fit\",\n sm: \"px-2 py-1 text-sm\",\n md: \"px-4 py-2 text-base\",\n lg: \"px-6 py-3 text-lg\",\n icon: \"p-1 w-fit aspect-square\",\n full: \"p-2 w-full\"\n}, ue = {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"rounded-full\"\n}, K = {\n variant: \"primary\",\n size: \"md\",\n rounded: \"md\"\n};\nfunction ce({\n variant: n = K.variant,\n size: a,\n rounded: e = K.rounded,\n loading: o,\n linkTo: t,\n linkProps: r,\n type: s = \"button\",\n className: l,\n ...d\n}) {\n let u;\n n === \"link\" && !a ? u = \"fitted\" : u = a || K.size;\n const i = w(\n \"appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all\",\n le[n],\n de[u],\n ue[e],\n o && \"relative pointer-events-none\",\n t && \"relative\",\n l\n );\n return /* @__PURE__ */ N(\n \"button\",\n {\n ...d,\n role: t ? \"link\" : d.role,\n \"aria-label\": d[\"aria-label\"] || (r == null ? void 0 : r[\"aria-label\"]),\n \"aria-description\": d[\"aria-description\"] || (r == null ? void 0 : r[\"aria-description\"]),\n \"aria-disabled\": d.disabled || o,\n \"aria-busy\": o,\n type: s,\n className: i,\n children: [\n o && /* @__PURE__ */ c(ie, {}),\n /* @__PURE__ */ c(\"span\", { className: w(o && \"invisible\"), children: d.children }),\n t && !d.disabled && /* @__PURE__ */ c(\n \"a\",\n {\n ...r,\n \"aria-hidden\": !0,\n href: t,\n rel: (r == null ? void 0 : r.rel) || \"noreferrer\",\n className: \"absolute inset-0\"\n }\n )\n ]\n }\n );\n}\nfunction fe(n) {\n const [a, e] = x(\"\"), o = A((t) => {\n let r = t, s = \"\";\n for (; r && !s; ) {\n const l = window.getComputedStyle(r).backgroundColor;\n l && l !== \"transparent\" && l !== \"rgba(0, 0, 0, 0)\" && (s = l), r = r.parentElement;\n }\n return s || \"transparent\";\n }, []);\n return E(() => {\n const t = document.getElementById(n);\n if (t) {\n const r = o(t.parentElement);\n e(r);\n }\n }, [n, o]), a;\n}\nfunction Be({\n ref: n,\n id: a,\n size: e = 20,\n color: o,\n filled: t = !1,\n rounded: r = !0,\n checked: s = !1,\n onCheckedChange: l,\n disabled: d,\n className: u = \"\",\n ...f\n}) {\n const i = $(), g = Z(() => a || `checkbox-${i}`, [a, i]), b = fe(g), [m, v] = x(s);\n E(() => {\n v(s);\n }, [s]);\n const h = () => {\n d || (v(!m), l == null || l(!m));\n }, y = (C) => {\n C.key === \" \" && (C.preventDefault(), h());\n }, p = w(\n \"flex items-center justify-center border outline outline-transparent focus:outline-current focus:outline-offset-2\",\n r && \"rounded\",\n d && \"opacity-40 cursor-not-allowed\",\n !d && \"cursor-pointer\",\n u\n );\n return /* @__PURE__ */ c(\n \"button\",\n {\n id: g,\n type: \"button\",\n ref: n,\n tabIndex: 0,\n role: \"checkbox\",\n onClick: h,\n \"aria-checked\": m,\n \"aria-disabled\": d,\n onKeyDownCapture: y,\n style: {\n width: e,\n height: e,\n color: o,\n backgroundColor: m && t ? \"currentcolor\" : \"transparent\"\n },\n className: p,\n ...f,\n children: m && /* @__PURE__ */ c(ee, { size: e, color: t ? b : void 0 })\n }\n );\n}\nfunction je({\n children: n,\n className: a,\n linkTo: e,\n linkProps: o,\n onButtonClick: t,\n buttonProps: r,\n ...s\n}) {\n return e && t && console.warn('Clickable: Both \"linkTo\" and \"onButtonClick\" props are provided. Only \"linkTo\" will be used.'), /* @__PURE__ */ N(\"div\", { className: w(\"relative w-fit\", a), ...s, children: [\n n,\n e && /* @__PURE__ */ c(\n \"a\",\n {\n ...o,\n rel: (o == null ? void 0 : o.rel) || \"noreferrer\",\n href: e,\n className: w(\"absolute inset-0\", o == null ? void 0 : o.className)\n }\n ),\n !e && t && /* @__PURE__ */ c(\n \"button\",\n {\n ...r,\n type: \"button\",\n onClick: t,\n className: w(\"absolute inset-0 cursor-pointer\", r == null ? void 0 : r.className)\n }\n )\n ] });\n}\nfunction B({ elementId: n, type: a, message: e }) {\n return E(() => {\n const o = document.getElementById(n);\n if (o) {\n if (!e && a === \"error\") {\n o.removeAttribute(\"data-error\");\n return;\n }\n if (!e && a === \"success\") {\n o.removeAttribute(\"data-success\");\n return;\n }\n return o.setAttribute(\"aria-describedby\", `${n}-${a}-message`), o.setAttribute(\"aria-invalid\", a === \"error\" ? \"true\" : \"false\"), a === \"error\" && o.setAttribute(\"data-error\", \"true\"), a === \"success\" && o.setAttribute(\"data-success\", \"true\"), () => {\n o.removeAttribute(\"aria-describedby\"), o.removeAttribute(\"aria-invalid\"), o.removeAttribute(\"data-error\"), o.removeAttribute(\"data-success\");\n };\n }\n }, [n, a, e]), e ? /* @__PURE__ */ N(\n \"small\",\n {\n className: w(\n \"mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-start\",\n a === \"error\" && \"text-destructive\",\n a === \"success\" && \"text-success\"\n ),\n role: \"status\",\n children: [\n a === \"error\" ? /* @__PURE__ */ c(te, {}) : /* @__PURE__ */ c(re, {}),\n /* @__PURE__ */ c(\"span\", { id: `${n}-${a}-message`, children: e })\n ]\n }\n ) : null;\n}\nconst me = {\n base: \"\",\n default: \"ring ring-transparent focus:ring-primary-foreground not-disabled:data-error:ring-destructive not-disabled:data-success:ring-success\",\n 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\",\n outline: \"border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success\"\n}, be = {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"px-3 rounded-full\"\n}, W = {\n variant: \"default\",\n rounded: \"none\"\n};\nfunction Fe({\n variant: n = W.variant,\n rounded: a,\n displayOnlyMode: e = !1,\n errorMessage: o,\n successMessage: t,\n type: r = \"text\",\n className: s,\n ...l\n}) {\n const d = $(), [u, f] = x(!1);\n let i = a;\n n === \"outline\" && !a && (i = \"md\"), i = i || W.rounded;\n const m = w(\n \"appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all\",\n \"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\",\n !e && me[n],\n !e && be[i],\n r === \"password\" && \"pr-10\",\n !e && \"px-2 py-1\",\n e && \"pointer-events-none\",\n s\n );\n return /* @__PURE__ */ N(\"div\", { className: w(e && \"cursor-text\"), style: { height: l.height, width: l.width }, children: [\n /* @__PURE__ */ N(\"div\", { className: w(r === \"password\" && \"relative\"), children: [\n /* @__PURE__ */ c(\n \"input\",\n {\n ...l,\n id: d,\n type: r === \"password\" && u ? \"text\" : r,\n \"aria-disabled\": l.disabled,\n readOnly: e,\n \"aria-readonly\": e || l[\"aria-readonly\"],\n \"data-error\": o ? !0 : void 0,\n \"data-success\": t ? !0 : void 0,\n className: m\n }\n ),\n r === \"password\" && /* @__PURE__ */ c(\n \"button\",\n {\n onClick: () => f(!u),\n className: \"absolute inset-y-0 right-0 px-2 hover:cursor-pointer\",\n \"aria-label\": \"Toggle password visibility\",\n \"data-state\": u ? \"visible\" : \"hidden\",\n children: u ? /* @__PURE__ */ c(oe, { size: 20 }) : /* @__PURE__ */ c(ne, { size: 20 })\n }\n )\n ] }),\n !e && /* @__PURE__ */ c(B, { elementId: d, type: \"error\", message: o }),\n !e && /* @__PURE__ */ c(B, { elementId: d, type: \"success\", message: t })\n ] });\n}\nfunction Se({\n display: n = \"inline\",\n width: a = \"fit-content\",\n className: e = \"\",\n required: o,\n helpMessage: t,\n suffix: r,\n htmlFor: s,\n children: l,\n ...d\n}) {\n const u = $(), f = w(\"font-medium\", n, e), i = t ? `${s ?? u}-help` : void 0;\n return /* @__PURE__ */ N(\"div\", { style: { display: n === \"inline\" ? \"inline-flex\" : \"flex\", width: a }, className: \"relative\", children: [\n /* @__PURE__ */ N(\"label\", { className: f, htmlFor: s, ...d, children: [\n l,\n o && /* @__PURE__ */ c(\"span\", { className: \"text-red-500 font-medium ml-1\", \"aria-label\": \"required\", children: \"*\" })\n ] }),\n t && /* @__PURE__ */ c(\n \"span\",\n {\n className: \"text-gray-500 ml-1 size-fit -translate-y-1/3\",\n \"aria-describedby\": i,\n \"aria-label\": \"Help information\",\n title: t,\n children: /* @__PURE__ */ c(ae, {})\n }\n ),\n t && /* @__PURE__ */ c(\"div\", { id: i, className: \"sr-only\", children: t }),\n r && /* @__PURE__ */ c(\"span\", { className: \"ml-1\", children: r })\n ] });\n}\nfunction he(n) {\n const [a, e] = x(!1), [o, t] = x(!1);\n return E(() => {\n n ? (t(!0), setTimeout(() => e(!0), 10)) : (e(!1), setTimeout(() => t(!1), 150));\n }, [n]), { show: a, shouldRender: o };\n}\nfunction pe(n, a) {\n E(() => {\n const e = (o) => {\n o.key === \"Escape\" && n && a();\n };\n return document.addEventListener(\"keydown\", e), n && (document.body.style.overflow = \"hidden\"), () => {\n document.removeEventListener(\"keydown\", e), document.body.style.overflow = \"auto\";\n };\n }, [n, a]);\n}\nfunction ge(n, a) {\n const e = z(null), o = A(() => {\n const t = document.getElementById(n);\n if (!t) return;\n const r = t.querySelectorAll('[data-modal-action=\"true\"]');\n if (r.length > 0) {\n r[0].focus();\n return;\n }\n const s = t.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n );\n if (s.length > 0) {\n const l = Array.from(s).filter((d) => !(d instanceof HTMLButtonElement && d.getAttribute(\"data-modal-close-button\") === \"true\"));\n if (l.length > 0) {\n l[0].focus();\n return;\n }\n s[0].focus();\n return;\n }\n t.focus();\n }, [n]);\n E(() => (a && (e.current = document.activeElement, o()), () => {\n document.body.style.overflow = \"auto\", e.current instanceof HTMLElement && e.current.focus();\n }), [a, o]);\n}\nfunction He({\n id: n,\n isOpen: a,\n onClose: e,\n title: o,\n children: t,\n contentOnly: r = !1,\n className: s,\n overlayClassName: l,\n hideCloseButton: d = !1,\n actions: u = [],\n disableCloseOnOverlayClick: f = !1,\n ariaLabelledBy: i,\n ariaDescribedBy: g\n}) {\n const b = $(), m = n || `modal-${b}`, v = n ? `${n}-title` : `modal-title-${b}`, { show: h, shouldRender: y } = he(a);\n if (ge(m, y), pe(y, e), !y) return null;\n const p = () => o ? T.isValidElement(o) ? /* @__PURE__ */ c(\"div\", { className: \"mb-4\", children: o }) : /* @__PURE__ */ c(\"h2\", { className: \"mb-4 text-xl font-semibold\", id: v, children: o }) : null, C = () => u.length === 0 ? null : /* @__PURE__ */ c(\"div\", { className: \"mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3\", children: u.map((D, j) => {\n const { label: F, className: L, ...R } = D;\n return /* @__PURE__ */ c(ce, { className: L, type: \"button\", ...R, \"data-modal-action\": \"true\", children: F }, j);\n }) });\n return /* @__PURE__ */ c(_, { children: J(\n /* @__PURE__ */ c(\n \"div\",\n {\n \"aria-labelledby\": i ?? o ? v : void 0,\n \"aria-describedby\": g,\n role: \"dialog\",\n \"aria-modal\": \"true\",\n className: \"fixed inset-0 z-[100] overflow-y-auto\",\n children: /* @__PURE__ */ N(\"div\", { className: \"flex min-h-screen items-center justify-center p-4\", children: [\n /* @__PURE__ */ c(\n \"div\",\n {\n className: H(\"fixed inset-0 bg-black/20 transition-all\", l),\n onClick: () => {\n f || e();\n }\n }\n ),\n r && /* @__PURE__ */ c(\"div\", { className: H(\"relative w-fit\", s), children: t }),\n !r && /* @__PURE__ */ N(\n \"div\",\n {\n id: m,\n tabIndex: -1,\n className: H(\n \"relative w-full max-w-xl transform rounded-lg shadow-xl transition-all p-6 bg-inherit focus:ring ease-in duration-75\",\n h ? \"opacity-100 scale-100\" : \"opacity-0 scale-90\",\n s\n ),\n children: [\n !d && /* @__PURE__ */ c(\n \"button\",\n {\n type: \"button\",\n onClick: e,\n \"data-modal-close-button\": \"true\",\n 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\",\n children: /* @__PURE__ */ c(se, { size: 18 })\n }\n ),\n p(),\n t,\n C()\n ]\n }\n )\n ] })\n }\n ),\n document.body\n ) });\n}\nfunction ve({ itemId: n, checked: a, onChange: e, name: o, disabled: t = !1, className: r = \"\" }) {\n const s = \"relative inline-flex items-center justify-center rounded-full\", l = () => {\n t || e();\n }, d = w(\n s,\n !a && \"hover:border-current/60\",\n !t && \"border-current cursor-pointer\",\n t && \"border-muted/60 cursor-not-allowed\",\n r\n );\n return /* @__PURE__ */ c(\n \"div\",\n {\n id: n,\n role: \"radio\",\n tabIndex: -1,\n \"aria-checked\": a,\n \"aria-disabled\": t,\n \"aria-description\": `Radio button for ${o}`,\n \"aria-labelledby\": `${n}-label`,\n onClick: l,\n className: d,\n style: {\n width: \"1em\",\n height: \"1em\",\n padding: \"0.1em\",\n borderWidth: \"0.06em\"\n },\n children: a && /* @__PURE__ */ c(\n \"div\",\n {\n className: w(\"size-full aspect-square rounded-full\", t && \"bg-muted/60\", !t && \"bg-current\")\n }\n )\n }\n );\n}\nfunction V({\n value: n,\n children: a,\n className: e = \"\",\n isSelected: o = !1,\n onChange: t,\n disabled: r = !1,\n hideInput: s = !1,\n description: l,\n name: d\n}) {\n const f = `radio-${$()}-${n}`, i = () => {\n r || t == null || t(n);\n };\n return /* @__PURE__ */ N(\n \"div\",\n {\n title: l,\n className: w(\n \"relative flex items-center\",\n e,\n // Uses text color for borders\n s && `p-2 border-2 focus-within:border-dashed focus-within:${r ? \"border-current/50\" : \"border-current/80\"}`,\n s && !o && `border-transparent ${r ? \"\" : \"not-focus-within:hover:border-border/60\"}`,\n s && o && \"border-border\",\n r && \"opacity-60 cursor-not-allowed\"\n ),\n style: {\n gap: \"0.5em\"\n },\n children: [\n !s && /* @__PURE__ */ c(\n ve,\n {\n itemId: f,\n name: d || \"\",\n checked: o,\n onChange: i,\n disabled: r,\n className: w(s && \"\")\n }\n ),\n /* @__PURE__ */ c(\n \"div\",\n {\n id: s ? f : void 0,\n tabIndex: s ? -1 : void 0,\n role: s ? \"radio\" : void 0,\n onClick: s ? i : void 0,\n \"aria-checked\": s ? o ? \"true\" : \"false\" : void 0,\n \"aria-disabled\": s ? r : void 0,\n \"aria-description\": s ? l || `Radio button for ${d}` : void 0,\n \"aria-labelledby\": s ? `${f}-label` : void 0,\n className: w(s && \"size-full\", typeof a == \"object\" && \"grow focus:outline-none\"),\n children: /* @__PURE__ */ c(\n \"label\",\n {\n id: `${f}-label`,\n onClick: s ? void 0 : i,\n className: w(r && \"cursor-not-allowed\", !r && \"cursor-pointer\"),\n children: a\n }\n )\n }\n )\n ]\n }\n );\n}\nfunction we(n, a) {\n const [e, o] = x(a), [t, r] = x(-1), [s, l] = x(!1), d = A((b, m) => {\n var y;\n const v = b[m];\n v.hasAttribute(\"disabled\") || v.getAttribute(\"aria-disabled\") === \"true\" || ((y = b[m]) == null || y.click(), r(m));\n }, []), u = A(\n (b, m) => {\n var h;\n if (b.preventDefault(), s || !m.length) return;\n const v = a !== -1 ? a : 0;\n (h = m[v]) == null || h.focus(), o(v), a !== -1 && d(m, v);\n },\n [a, s, d]\n ), f = A(\n (b) => {\n var y;\n if (!b.shiftKey)\n return;\n b.preventDefault();\n const m = Array.from(\n document.querySelectorAll(\n 'a, button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"])'\n )\n ).filter((p) => !p.hasAttribute(\"disabled\") && p.tabIndex >= 0), v = m.findIndex((p) => p.id === n), h = v > 0 ? v - 1 : m.length - 1;\n (y = m[h]) == null || y.focus();\n },\n [n]\n ), i = A(\n (b, m) => {\n var C;\n if (!m.length) return;\n const v = b.target;\n if (!m.some((D) => D.id === v.id)) return;\n const y = e !== -1 ? e : 0;\n let p = y;\n switch (b.key) {\n case \"ArrowUp\":\n case \"ArrowLeft\":\n b.preventDefault(), p = y > 0 ? y - 1 : m.length - 1;\n break;\n case \"ArrowDown\":\n case \"ArrowRight\":\n b.preventDefault(), p = (y + 1) % m.length;\n break;\n // Select the option when the space key is pressed\n case \" \":\n b.preventDefault(), d(m, y);\n return;\n case \"Tab\":\n f(b);\n return;\n default:\n return;\n }\n (C = m[p]) == null || C.focus(), o(p), t !== -1 && d(m, p);\n },\n [e, t, f, d]\n ), g = A(() => {\n const b = document.querySelector(`[id=\"${n}\"][role=\"radiogroup\"]`);\n return b ? Array.from(b.querySelectorAll('[role=\"radio\"]')) : [];\n }, [n]);\n E(() => {\n const b = document.querySelector(`[id=\"${n}\"][role=\"radiogroup\"]`);\n if (!b) return;\n const m = g(), v = (C) => u(C, m), h = (C) => i(C, m), y = () => l(!0), p = () => l(!1);\n return document.addEventListener(\"keydown\", h), b.addEventListener(\"focus\", v), b.addEventListener(\"mousedown\", y), document.addEventListener(\"mouseup\", p), () => {\n document.removeEventListener(\"keydown\", h), b.removeEventListener(\"focus\", v), b.removeEventListener(\"mousedown\", y), document.removeEventListener(\"mouseup\", p);\n };\n }, [n, g, u, i]);\n}\nfunction qe({\n options: n = [],\n value: a,\n onChange: e,\n id: o,\n children: t,\n className: r = \"\",\n childrenClassName: s = \"\",\n hideInputs: l = !1\n}) {\n const d = $(), u = o || `radio-group-${d}`;\n we(\n u,\n n.findIndex((i) => i === a)\n );\n const f = Z(() => n.reduce((i, g) => (typeof g == \"string\" ? i.some((b) => b.value === g) || i.push({ label: g, value: g }) : i.push(g), i), []), [n]);\n return /* @__PURE__ */ N(\"div\", { id: u, role: \"radiogroup\", tabIndex: 0, className: w(r, \"focus:outline-none\"), children: [\n f.length > 0 && f.map((i, g) => /* @__PURE__ */ c(\n V,\n {\n value: i.value,\n isSelected: a === i.value,\n onChange: e,\n name: u,\n disabled: i.disabled,\n description: i.description,\n hideInput: l,\n className: s,\n children: i.label\n },\n `${i.value}-${g}`\n )),\n f.length === 0 && t && T.Children.map(t, (i) => T.isValidElement(i) && i.type === V ? /* @__PURE__ */ c(\n V,\n {\n ...i.props,\n className: w(s, i.props.className),\n hideInput: i.props.hideInput || l,\n isSelected: a === i.props.value,\n onChange: e,\n name: u,\n children: i.props.children\n }\n ) : null)\n ] });\n}\nfunction Ke({ children: n, ref: a, ...e }) {\n if (M(n)) {\n let o = { ...e };\n return n.props && (o = { ...o, ...n.props }), O(n, {\n ...o,\n ref: (t) => {\n typeof a == \"function\" ? a(t) : a && (a.current = t);\n }\n });\n }\n return X(\"div\", { ...e, ref: a }, n);\n}\nfunction ye({ elementId: n, maxLength: a }) {\n const [e, o] = x(0);\n return E(() => {\n const t = document.getElementById(n);\n if (!t)\n return;\n const r = () => {\n const s = t.value.length;\n o(s);\n const l = s >= a;\n t.setAttribute(\"aria-describedby\", `${n}-character-count`), t.setAttribute(\"aria-invalid\", l ? \"true\" : \"false\"), l ? t.setAttribute(\"data-error\", \"true\") : t.removeAttribute(\"data-error\");\n };\n return r(), t.addEventListener(\"input\", r), t.setAttribute(\"maxlength\", String(a)), () => {\n t.removeEventListener(\"input\", r), t.removeAttribute(\"maxlength\"), t.removeAttribute(\"aria-describedby\"), t.removeAttribute(\"aria-invalid\"), t.removeAttribute(\"data-error\");\n };\n }, [n, a]), /* @__PURE__ */ c(\n \"small\",\n {\n className: w(\n \"mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-end\",\n e >= a && \"text-destructive\",\n e < a && \"text-current\"\n ),\n role: \"status\",\n children: /* @__PURE__ */ N(\"span\", { id: `${n}-character-count`, children: [\n e,\n \" / \",\n a,\n \" characters\"\n ] })\n }\n );\n}\nfunction xe(n, a) {\n E(() => {\n const e = document.getElementById(n);\n if (!e)\n return;\n if (!a) {\n e.style.height = \"auto\";\n return;\n }\n const o = () => {\n e.style.height = \"auto\", e.style.height = `${e.scrollHeight}px`;\n };\n return o(), e.addEventListener(\"input\", o), e.addEventListener(\"resize\", o), window.addEventListener(\"resize\", o), () => {\n e.removeEventListener(\"input\", o), e.removeEventListener(\"resize\", o), window.removeEventListener(\"resize\", o);\n };\n }, [n, a]);\n}\nconst Ne = {\n base: \"\",\n \"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\",\n outline: \"border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success\"\n}, Ce = {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"px-3 rounded-full\"\n}, Q = {\n variant: \"outline\",\n rounded: \"none\"\n};\nfunction Ve({\n variant: n = Q.variant,\n rounded: a,\n displayOnlyMode: e = !1,\n errorMessage: o,\n successMessage: t,\n hideResizeHandle: r = !1,\n autoExpand: s = !1,\n characterLimit: l = 0,\n className: d,\n ...u\n}) {\n const f = $();\n xe(f, s || e);\n let i = a;\n n === \"outline\" && !a && (i = \"md\"), i = i || Q.rounded;\n let g = r;\n (e || n === \"left-line\" && !r) && (g = !0);\n const m = w(\n \"appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all\",\n !e && Ne[n],\n !e && Ce[i],\n !e && \"px-2 py-1\",\n e && \"pointer-events-none\",\n g && \"no-resize-handle\",\n d\n );\n return /* @__PURE__ */ N(\"div\", { className: w(\"-space-y-1.5\", e && \"cursor-text\"), children: [\n /* @__PURE__ */ c(\n \"textarea\",\n {\n ...u,\n id: f,\n \"aria-disabled\": u.disabled,\n readOnly: e,\n \"aria-readonly\": e || u[\"aria-readonly\"],\n style: {\n resize: s ? \"none\" : void 0\n },\n className: m\n }\n ),\n l > 0 && /* @__PURE__ */ c(ye, { elementId: f, maxLength: l }),\n !e && /* @__PURE__ */ c(B, { elementId: f, type: \"error\", message: o }),\n !e && /* @__PURE__ */ c(B, { elementId: f, type: \"success\", message: t })\n ] });\n}\nfunction Ee(n) {\n return { calculatePosition: A(\n (e, o) => {\n const t = e.getBoundingClientRect(), r = o.getBoundingClientRect(), s = {\n width: window.innerWidth,\n height: window.innerHeight\n }, l = (g, b, m, v) => g < 0 || b < 0 || g + m > s.width || b + v > s.height, d = {\n top: {\n x: t.left + t.width / 2 - r.width / 2,\n y: t.top - r.height - k,\n arrow: {\n x: r.width / 2 - I,\n y: r.height\n }\n },\n bottom: {\n x: t.left + t.width / 2 - r.width / 2,\n y: t.bottom + k,\n arrow: {\n x: r.width / 2 - I,\n y: -6\n }\n },\n left: {\n x: t.left - r.width - k,\n y: t.top + t.height / 2 - r.height / 2,\n arrow: {\n x: r.width,\n y: r.height / 2 - I\n }\n },\n right: {\n x: t.right + k,\n y: t.top + t.height / 2 - r.height / 2,\n arrow: {\n x: -6,\n y: r.height / 2 - I\n }\n }\n };\n let u = n, f = d[n];\n if (l(f.x, f.y, r.width, r.height)) {\n const g = {\n top: \"bottom\",\n bottom: \"top\",\n left: \"right\",\n right: \"left\"\n }, b = d[g[n]];\n if (!l(b.x, b.y, r.width, r.height))\n u = g[n], f = b;\n else {\n const m = [\"top\", \"bottom\", \"left\", \"right\"].filter(\n (v) => v !== n && v !== g[n]\n );\n for (const v of m) {\n const h = d[v];\n if (!l(h.x, h.y, r.width, r.height)) {\n u = v, f = h;\n break;\n }\n }\n }\n }\n f.x = Math.max(8, Math.min(f.x, s.width - r.width - 8)), f.y = Math.max(8, Math.min(f.y, s.height - r.height - 8));\n const i = {\n x: t.left + t.width / 2,\n y: t.top + t.height / 2\n };\n return u === \"top\" || u === \"bottom\" ? f.arrow.x = Math.max(\n I,\n Math.min(i.x - f.x - I, r.width - I * 2)\n ) : f.arrow.y = Math.max(\n I,\n Math.min(i.y - f.y - I, r.height - I * 2)\n ), {\n ...f,\n placement: u\n };\n },\n [n]\n ) };\n}\nfunction Ae(n, a, e) {\n const o = z(null), t = z(null), r = A(() => {\n if (!o.current || !t.current) return;\n const s = n(o.current, t.current);\n e(s);\n }, [n, e]);\n return E(() => {\n if (!a) return;\n const s = () => r();\n return window.addEventListener(\"resize\", s), () => {\n window.removeEventListener(\"resize\", s);\n };\n }, [a, r]), {\n triggerRef: o,\n tooltipRef: t,\n updatePosition: r\n };\n}\nfunction Ie(n, a, e, o, t, r, s, l, d) {\n const u = z(null), f = A(() => {\n n || (u.current && clearTimeout(u.current), u.current = window.setTimeout(() => {\n e(!0), requestAnimationFrame(() => {\n t(), o(!0);\n });\n }, a));\n }, [n, a, e, t, o]), i = A(\n (g = !1) => {\n if (u.current && clearTimeout(u.current), g) {\n o(!1), setTimeout(() => e(!1), 150);\n return;\n }\n u.current = window.setTimeout(() => {\n o(!1), setTimeout(() => e(!1), 150);\n }, 100);\n },\n [o, e]\n );\n return E(() => {\n !r && !s && !l && d && i();\n }, [r, s, l, d, i]), E(() => () => {\n u.current && clearTimeout(u.current);\n }, []), {\n showTooltip: f,\n hideTooltip: i,\n timeoutRef: u\n };\n}\nconst k = 4, I = 6;\nfunction Ge({\n id: n,\n children: a,\n message: e,\n placement: o = \"top\",\n disabled: t = !1,\n delay: r = 200,\n className: s\n}) {\n const [l, d] = x(!1), [u, f] = x(!1), [i, g] = x(null), [b, m] = x(!1), [v, h] = x(!1), [y, p] = x(!1), { calculatePosition: C } = Ee(o), { triggerRef: D, tooltipRef: j, updatePosition: F } = Ae(C, u, g), { showTooltip: L, hideTooltip: R, timeoutRef: G } = Ie(\n t,\n r,\n f,\n d,\n F,\n b,\n v,\n y,\n l\n ), Y = $(), U = n ?? Y;\n return /* @__PURE__ */ N(_, { children: [\n T.cloneElement(a, {\n ref: (S) => {\n D.current = S;\n },\n onMouseEnter: () => {\n m(!0), L();\n },\n onMouseLeave: () => {\n m(!1);\n },\n onFocus: () => {\n p(!0), L();\n },\n onBlur: () => {\n p(!1), R(!0);\n },\n onKeyDown: (S) => {\n S.key === \"Escape\" && R(!0);\n },\n \"aria-describedby\": t ? void 0 : U\n }),\n u && J(\n /* @__PURE__ */ c(\n \"div\",\n {\n ref: j,\n id: U,\n role: \"tooltip\",\n className: w(\n \"fixed z-50 px-2 py-1 text-sm rounded shadow-lg pointer-events-auto transition-all duration-150 ease-out\",\n l ? \"opacity-100\" : \"opacity-0\",\n s\n ),\n style: i ? { left: i.x, top: i.y } : { opacity: 0 },\n onMouseEnter: () => {\n h(!0), G.current && clearTimeout(G.current);\n },\n onMouseLeave: () => {\n h(!1);\n },\n children: e\n }\n ),\n document.body\n )\n ] });\n}\nexport {\n ze as Accordion,\n q as AccordionItem,\n Qe as ActionModal,\n ce as Button,\n ie as ButtonLoadingDots,\n Be as Checkbox,\n je as Clickable,\n Fe as Input,\n Se as Label,\n He as Modal,\n qe as RadioGroup,\n V as RadioGroupItem,\n ve as RadioInput,\n Ke as Slot,\n Ve as Textarea,\n Ge as Tooltip\n};\n//# sourceMappingURL=components.esm.js.map\n","import { Modal, ModalProps } from '@moondreamsdev/dreamer-ui/components';\nimport React, { useMemo } from 'react';\n\ninterface BaseActionModalProps extends Omit<ModalProps, 'children' | 'actions'> {\n message: React.ReactNode;\n destructive?: boolean;\n}\n\ninterface AlertModalProps extends BaseActionModalProps {\n type: 'alert';\n confirmText?: string;\n onConfirm?: () => void;\n // Cancel-related props are not allowed for alerts\n cancelText?: never;\n}\n\ninterface ConfirmModalProps extends BaseActionModalProps {\n type: 'confirm';\n confirmText?: string;\n cancelText?: string;\n onConfirm?: () => void;\n}\n\nexport type ActionModalProps = AlertModalProps | ConfirmModalProps;\n\nexport function ActionModal({\n type,\n message,\n cancelText,\n confirmText,\n onConfirm,\n onClose,\n destructive = false,\n title,\n ...modalProps\n}: ActionModalProps) {\n const defaultTexts = useMemo(() => {\n if (type === 'confirm') {\n return {\n confirm: confirmText || 'Confirm',\n cancel: cancelText || 'Cancel',\n defaultTitle: title || 'Confirm Action',\n };\n }\n return {\n confirm: confirmText || 'OK',\n cancel: null,\n defaultTitle: title || 'Alert',\n };\n }, [type, confirmText, title, cancelText]);\n\n const actions: ModalProps['actions'] = useMemo(\n () => [\n ...(defaultTexts.cancel\n ? [\n {\n label: defaultTexts.cancel,\n variant: 'secondary' as const,\n onClick: onClose,\n },\n ]\n : []),\n {\n label: defaultTexts.confirm,\n variant: destructive ? 'destructive' : 'primary',\n onClick: () => {\n onConfirm?.();\n onClose();\n },\n },\n ],\n [defaultTexts, destructive, onConfirm, onClose]\n );\n\n return (\n <Modal\n {...modalProps}\n title={title || defaultTexts.defaultTitle}\n onClose={onClose}\n actions={actions}\n disableCloseOnOverlayClick={type === 'confirm'}\n hideCloseButton={type === 'confirm'}\n >\n {typeof message === 'string' ? <p className='text-sm'>{message}</p> : message}\n </Modal>\n );\n}\n"],"names":["n","t","s","w","C","l","e","g","M","ie","a","x","E","o","c","le","de","ue","K","ce","r","d","u","i","N","he","pe","ge","z","A","He","f","b","$","m","v","h","y","p","T","D","j","F","L","R","_","J","H","se","ActionModal","type","message","cancelText","confirmText","onConfirm","onClose","destructive","title","modalProps","defaultTexts","useMemo","actions","jsx","Modal"],"mappings":"4FAAA,SAASA,KAAKC,EAAG,CACf,OAAOA,EAAE,OAAQC,GAAM,OAAOA,GAAK,UAAYA,CAAC,EAAE,KAAK,GAAG,EAAE,KAAM,GAAI,MACxE,CCiEA,SAASC,EAAE,CAAE,KAAMC,EAAI,GAAI,MAAOC,EAAI,gBAAkB,CACtD,OAAuBC,EAAAA,IAAE,MAAO,CAAE,MAAOF,EAAG,OAAQA,EAAG,UAAW,SAAU,QAAS,YAAa,MAAO,6BAA8B,SAA0BE,EAAC,IAChK,OACA,CACE,EAAG,0gBACH,KAAMD,EACN,SAAU,UACV,SAAU,SAChB,CACA,EAAK,CACL,CC1EA,SAASE,KAAK,EAAG,CACf,OAAO,EAAE,OAAQ,GAAM,OAAO,GAAK,UAAY,CAAC,EAAE,KAAK,GAAG,EAAE,KAAM,GAAI,MACxE,CAeAC,EAAC,cAAC,MAAM,EC6GR,SAASC,GAAK,CACZ,KAAM,CAACT,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X,SAA0BQ,EAAAA,IAAEkC,EAAI,CAAE,KAAM,EAAI,CAAA,CAChE,CACiB,EACDV,EAAG,EACHrC,EACA,EAAC,CACjB,CACA,CACA,CACA,CAAW,CAAA,CACX,CACK,EACD,SAAS,IACb,EAAK,CACL,CCniBO,SAASgD,EAAY,CAC1B,KAAAC,EACA,QAAAC,EACA,WAAAC,EACA,YAAAC,EACA,UAAAC,EACA,QAAAC,EACA,YAAAC,EAAc,GACd,MAAAC,EACA,GAAGC,CACL,EAAqB,CACb,MAAAC,EAAeC,EAAAA,QAAQ,IACvBV,IAAS,UACJ,CACL,QAASG,GAAe,UACxB,OAAQD,GAAc,SACtB,aAAcK,GAAS,gBACzB,EAEK,CACL,QAASJ,GAAe,KACxB,OAAQ,KACR,aAAcI,GAAS,OACzB,EACC,CAACP,EAAMG,EAAaI,EAAOL,CAAU,CAAC,EAEnCS,EAAiCD,EAAA,QACrC,IAAM,CACJ,GAAID,EAAa,OACb,CACE,CACE,MAAOA,EAAa,OACpB,QAAS,YACT,QAASJ,CAAA,CACX,EAEF,CAAC,EACL,CACE,MAAOI,EAAa,QACpB,QAASH,EAAc,cAAgB,UACvC,QAAS,IAAM,CACDF,GAAA,MAAAA,IACJC,EAAA,CAAA,CACV,CAEJ,EACA,CAACI,EAAcH,EAAaF,EAAWC,CAAO,CAChD,EAGE,OAAAO,EAAA,IAACC,EAAA,CACE,GAAGL,EACJ,MAAOD,GAASE,EAAa,aAC7B,QAAAJ,EACA,QAAAM,EACA,2BAA4BX,IAAS,UACrC,gBAAiBA,IAAS,UAEzB,SAAA,OAAOC,GAAY,SAAWW,MAAC,KAAE,UAAU,UAAW,UAAQ,CAAA,EAAOX,CAAA,CACxE,CAEJ"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as l, Fragment as R, jsxs as y } from "react/jsx-runtime";
|
|
2
2
|
import I, { createContext as M, useId as q, useState as v, useEffect as m, useRef as H, useCallback as S, useMemo as N } from "react";
|
|
3
|
-
import { createPortal as
|
|
3
|
+
import { createPortal as $ } from "react-dom";
|
|
4
4
|
function g(...e) {
|
|
5
5
|
return e.filter((t) => typeof t == "string" && t).join(" ").trim() || void 0;
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function F({ size: e = 15, color: t = "currentColor" }) {
|
|
8
8
|
return /* @__PURE__ */ l("svg", { width: e, height: e, className: "inline", viewBox: "0 0 15 15", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ l(
|
|
9
9
|
"path",
|
|
10
10
|
{
|
|
@@ -19,7 +19,7 @@ function b(...e) {
|
|
|
19
19
|
return e.filter((t) => typeof t == "string" && t).join(" ").trim() || void 0;
|
|
20
20
|
}
|
|
21
21
|
M(void 0);
|
|
22
|
-
function
|
|
22
|
+
function K() {
|
|
23
23
|
const [e, t] = v(0);
|
|
24
24
|
return m(() => {
|
|
25
25
|
const n = setInterval(() => {
|
|
@@ -37,7 +37,7 @@ function D() {
|
|
|
37
37
|
n
|
|
38
38
|
)) });
|
|
39
39
|
}
|
|
40
|
-
const
|
|
40
|
+
const P = {
|
|
41
41
|
base: "",
|
|
42
42
|
primary: "bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground",
|
|
43
43
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80",
|
|
@@ -45,7 +45,7 @@ const F = {
|
|
|
45
45
|
outline: "border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted",
|
|
46
46
|
link: "underline-offset-4 hover:underline disabled:underline disabled:text-muted",
|
|
47
47
|
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground"
|
|
48
|
-
},
|
|
48
|
+
}, D = {
|
|
49
49
|
stripped: "",
|
|
50
50
|
fitted: "size-fit",
|
|
51
51
|
sm: "px-2 py-1 text-sm",
|
|
@@ -53,7 +53,7 @@ const F = {
|
|
|
53
53
|
lg: "px-6 py-3 text-lg",
|
|
54
54
|
icon: "p-1 w-fit aspect-square",
|
|
55
55
|
full: "p-2 w-full"
|
|
56
|
-
},
|
|
56
|
+
}, V = {
|
|
57
57
|
none: "rounded-none",
|
|
58
58
|
sm: "rounded-sm",
|
|
59
59
|
md: "rounded-md",
|
|
@@ -64,7 +64,7 @@ const F = {
|
|
|
64
64
|
size: "md",
|
|
65
65
|
rounded: "md"
|
|
66
66
|
};
|
|
67
|
-
function
|
|
67
|
+
function Z({
|
|
68
68
|
variant: e = p.variant,
|
|
69
69
|
size: t,
|
|
70
70
|
rounded: n = p.rounded,
|
|
@@ -79,9 +79,9 @@ function G({
|
|
|
79
79
|
e === "link" && !t ? d = "fitted" : d = t || p.size;
|
|
80
80
|
const u = g(
|
|
81
81
|
"appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
P[e],
|
|
83
|
+
D[d],
|
|
84
|
+
V[n],
|
|
85
85
|
r && "relative pointer-events-none",
|
|
86
86
|
i && "relative",
|
|
87
87
|
c
|
|
@@ -98,7 +98,7 @@ function G({
|
|
|
98
98
|
type: s,
|
|
99
99
|
className: u,
|
|
100
100
|
children: [
|
|
101
|
-
r && /* @__PURE__ */ l(
|
|
101
|
+
r && /* @__PURE__ */ l(K, {}),
|
|
102
102
|
/* @__PURE__ */ l("span", { className: g(r && "invisible"), children: o.children }),
|
|
103
103
|
i && !o.disabled && /* @__PURE__ */ l(
|
|
104
104
|
"a",
|
|
@@ -114,13 +114,13 @@ function G({
|
|
|
114
114
|
}
|
|
115
115
|
);
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function G(e) {
|
|
118
118
|
const [t, n] = v(!1), [r, i] = v(!1);
|
|
119
119
|
return m(() => {
|
|
120
120
|
e ? (i(!0), setTimeout(() => n(!0), 10)) : (n(!1), setTimeout(() => i(!1), 150));
|
|
121
121
|
}, [e]), { show: t, shouldRender: r };
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function J(e, t) {
|
|
124
124
|
m(() => {
|
|
125
125
|
const n = (r) => {
|
|
126
126
|
r.key === "Escape" && e && t();
|
|
@@ -130,7 +130,7 @@ function Q(e, t) {
|
|
|
130
130
|
};
|
|
131
131
|
}, [e, t]);
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function Q(e, t) {
|
|
134
134
|
const n = H(null), r = S(() => {
|
|
135
135
|
const i = document.getElementById(e);
|
|
136
136
|
if (!i) return;
|
|
@@ -157,7 +157,7 @@ function U(e, t) {
|
|
|
157
157
|
document.body.style.overflow = "auto", n.current instanceof HTMLElement && n.current.focus();
|
|
158
158
|
}), [t, r]);
|
|
159
159
|
}
|
|
160
|
-
function
|
|
160
|
+
function U({
|
|
161
161
|
id: e,
|
|
162
162
|
isOpen: t,
|
|
163
163
|
onClose: n,
|
|
@@ -169,21 +169,21 @@ function W({
|
|
|
169
169
|
hideCloseButton: o = !1,
|
|
170
170
|
actions: d = [],
|
|
171
171
|
disableCloseOnOverlayClick: u = !1,
|
|
172
|
-
ariaLabelledBy:
|
|
173
|
-
ariaDescribedBy:
|
|
172
|
+
ariaLabelledBy: C,
|
|
173
|
+
ariaDescribedBy: k
|
|
174
174
|
}) {
|
|
175
|
-
const h = q(), x = e || `modal-${h}`, w = e ? `${e}-title` : `modal-title-${h}`, { show: L, shouldRender: f } =
|
|
176
|
-
if (
|
|
177
|
-
const
|
|
175
|
+
const h = q(), x = e || `modal-${h}`, w = e ? `${e}-title` : `modal-title-${h}`, { show: L, shouldRender: f } = G(t);
|
|
176
|
+
if (Q(x, f), J(f, n), !f) return null;
|
|
177
|
+
const E = () => r ? I.isValidElement(r) ? /* @__PURE__ */ l("div", { className: "mb-4", children: r }) : /* @__PURE__ */ l("h2", { className: "mb-4 text-xl font-semibold", id: w, children: r }) : null, z = () => d.length === 0 ? null : /* @__PURE__ */ l("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((A, j) => {
|
|
178
178
|
const { label: B, className: O, ...T } = A;
|
|
179
|
-
return /* @__PURE__ */ l(
|
|
179
|
+
return /* @__PURE__ */ l(Z, { className: O, type: "button", ...T, "data-modal-action": "true", children: B }, j);
|
|
180
180
|
}) });
|
|
181
|
-
return /* @__PURE__ */ l(R, { children:
|
|
181
|
+
return /* @__PURE__ */ l(R, { children: $(
|
|
182
182
|
/* @__PURE__ */ l(
|
|
183
183
|
"div",
|
|
184
184
|
{
|
|
185
|
-
"aria-labelledby":
|
|
186
|
-
"aria-describedby":
|
|
185
|
+
"aria-labelledby": C ?? r ? w : void 0,
|
|
186
|
+
"aria-describedby": k,
|
|
187
187
|
role: "dialog",
|
|
188
188
|
"aria-modal": "true",
|
|
189
189
|
className: "fixed inset-0 z-[100] overflow-y-auto",
|
|
@@ -216,12 +216,12 @@ function W({
|
|
|
216
216
|
onClick: n,
|
|
217
217
|
"data-modal-close-button": "true",
|
|
218
218
|
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",
|
|
219
|
-
children: /* @__PURE__ */ l(
|
|
219
|
+
children: /* @__PURE__ */ l(F, { size: 18 })
|
|
220
220
|
}
|
|
221
221
|
),
|
|
222
|
-
|
|
222
|
+
E(),
|
|
223
223
|
i,
|
|
224
|
-
|
|
224
|
+
z()
|
|
225
225
|
]
|
|
226
226
|
}
|
|
227
227
|
)
|
|
@@ -231,7 +231,7 @@ function W({
|
|
|
231
231
|
document.body
|
|
232
232
|
) });
|
|
233
233
|
}
|
|
234
|
-
function
|
|
234
|
+
function _({
|
|
235
235
|
type: e,
|
|
236
236
|
message: t,
|
|
237
237
|
cancelText: n,
|
|
@@ -270,7 +270,7 @@ function $({
|
|
|
270
270
|
[d, s, i, a]
|
|
271
271
|
);
|
|
272
272
|
return /* @__PURE__ */ l(
|
|
273
|
-
|
|
273
|
+
U,
|
|
274
274
|
{
|
|
275
275
|
...o,
|
|
276
276
|
title: c || d.defaultTitle,
|
|
@@ -283,7 +283,7 @@ function $({
|
|
|
283
283
|
);
|
|
284
284
|
}
|
|
285
285
|
export {
|
|
286
|
-
|
|
286
|
+
_ as A,
|
|
287
287
|
g as n
|
|
288
288
|
};
|
|
289
|
-
//# sourceMappingURL=styles-
|
|
289
|
+
//# sourceMappingURL=styles-eVzajhIX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles-eVzajhIX.js","sources":["utils.esm.js","QuestionMarkCircled-JRFAPLtT.js","styles-DUXNGn3s.js","components.esm.js","../src/components/actionmodal/ActionModal.tsx"],"sourcesContent":["function n(...t) {\n return t.filter((s) => typeof s == \"string\" && s).join(\" \").trim() || void 0;\n}\nexport {\n n as join\n};\n//# sourceMappingURL=utils.esm.js.map\n","import { jsx as e } from \"react/jsx-runtime\";\nfunction i({ size: C = 15, color: l = \"currentColor\" }) {\n return /* @__PURE__ */ e(\"svg\", { width: C, height: C, className: \"inline\", viewBox: \"0 0 15 15\", xmlns: \"http://www.w3.org/2000/svg\", children: /* @__PURE__ */ e(\n \"path\",\n {\n d: \"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z\",\n fill: l,\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n ) });\n}\nfunction t({ size: C = 15 }) {\n return /* @__PURE__ */ e(\"svg\", { width: C, height: C, className: \"inline\", viewBox: \"0 0 15 15\", xmlns: \"http://www.w3.org/2000/svg\", children: /* @__PURE__ */ e(\n \"path\",\n {\n d: \"M7.49991 0.877045C3.84222 0.877045 0.877075 3.84219 0.877075 7.49988C0.877075 11.1575 3.84222 14.1227 7.49991 14.1227C11.1576 14.1227 14.1227 11.1575 14.1227 7.49988C14.1227 3.84219 11.1576 0.877045 7.49991 0.877045ZM1.82708 7.49988C1.82708 4.36686 4.36689 1.82704 7.49991 1.82704C10.6329 1.82704 13.1727 4.36686 13.1727 7.49988C13.1727 10.6329 10.6329 13.1727 7.49991 13.1727C4.36689 13.1727 1.82708 10.6329 1.82708 7.49988ZM10.1589 5.53774C10.3178 5.31191 10.2636 5.00001 10.0378 4.84109C9.81194 4.68217 9.50004 4.73642 9.34112 4.96225L6.51977 8.97154L5.35681 7.78706C5.16334 7.59002 4.84677 7.58711 4.64973 7.78058C4.45268 7.97404 4.44978 8.29061 4.64325 8.48765L6.22658 10.1003C6.33054 10.2062 6.47617 10.2604 6.62407 10.2483C6.77197 10.2363 6.90686 10.1591 6.99226 10.0377L10.1589 5.53774Z\",\n fill: \"currentColor\",\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n ) });\n}\nfunction o({ size: C = 15, color: l = \"currentColor\" }) {\n return /* @__PURE__ */ e(\"svg\", { width: C, height: C, className: \"inline\", viewBox: \"0 0 15 15\", xmlns: \"http://www.w3.org/2000/svg\", children: /* @__PURE__ */ e(\n \"path\",\n {\n d: \"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z\",\n fill: l,\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n ) });\n}\nfunction r({ size: C = 15 }) {\n return /* @__PURE__ */ e(\"svg\", { width: C, height: C, className: \"inline\", viewBox: \"0 0 15 15\", xmlns: \"http://www.w3.org/2000/svg\", children: /* @__PURE__ */ e(\n \"path\",\n {\n d: \"M8.4449 0.608765C8.0183 -0.107015 6.9817 -0.107015 6.55509 0.608766L0.161178 11.3368C-0.275824 12.07 0.252503 13 1.10608 13H13.8939C14.7475 13 15.2758 12.07 14.8388 11.3368L8.4449 0.608765ZM7.4141 1.12073C7.45288 1.05566 7.54712 1.05566 7.5859 1.12073L13.9798 11.8488C14.0196 11.9154 13.9715 12 13.8939 12H1.10608C1.02849 12 0.980454 11.9154 1.02018 11.8488L7.4141 1.12073ZM6.8269 4.48611C6.81221 4.10423 7.11783 3.78663 7.5 3.78663C7.88217 3.78663 8.18778 4.10423 8.1731 4.48612L8.01921 8.48701C8.00848 8.766 7.7792 8.98664 7.5 8.98664C7.2208 8.98664 6.99151 8.766 6.98078 8.48701L6.8269 4.48611ZM8.24989 10.476C8.24989 10.8902 7.9141 11.226 7.49989 11.226C7.08567 11.226 6.74989 10.8902 6.74989 10.476C6.74989 10.0618 7.08567 9.72599 7.49989 9.72599C7.9141 9.72599 8.24989 10.0618 8.24989 10.476Z\",\n fill: \"currentColor\",\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n ) });\n}\nfunction d({ size: C = 15 }) {\n return /* @__PURE__ */ e(\"svg\", { width: C, height: C, className: \"inline\", viewBox: \"0 0 15 15\", xmlns: \"http://www.w3.org/2000/svg\", children: /* @__PURE__ */ e(\n \"path\",\n {\n d: \"M14.7649 6.07596C14.9991 6.22231 15.0703 6.53079 14.9239 6.76495C14.4849 7.46743 13.9632 8.10645 13.3702 8.66305L14.5712 9.86406C14.7664 10.0593 14.7664 10.3759 14.5712 10.5712C14.3759 10.7664 14.0593 10.7664 13.8641 10.5712L12.6011 9.30817C11.805 9.90283 10.9089 10.3621 9.93375 10.651L10.383 12.3277C10.4544 12.5944 10.2961 12.8685 10.0294 12.94C9.76267 13.0115 9.4885 12.8532 9.41704 12.5865L8.95917 10.8775C8.48743 10.958 8.00036 10.9999 7.50001 10.9999C6.99965 10.9999 6.51257 10.958 6.04082 10.8775L5.58299 12.5864C5.51153 12.8532 5.23737 13.0115 4.97064 12.94C4.7039 12.8686 4.5456 12.5944 4.61706 12.3277L5.06625 10.651C4.09111 10.3621 3.19503 9.90282 2.3989 9.30815L1.1359 10.5712C0.940638 10.7664 0.624058 10.7664 0.428798 10.5712C0.233537 10.3759 0.233537 10.0593 0.428798 9.86405L1.62982 8.66303C1.03682 8.10643 0.515113 7.46742 0.0760677 6.76495C-0.0702867 6.53079 0.000898544 6.22231 0.235065 6.07596C0.469231 5.9296 0.777703 6.00079 0.924058 6.23496C1.40354 7.00213 1.989 7.68057 2.66233 8.2427C2.67315 8.25096 2.6837 8.25972 2.69397 8.26898C4.00897 9.35527 5.65537 9.99991 7.50001 9.99991C10.3078 9.99991 12.6564 8.5063 14.076 6.23495C14.2223 6.00079 14.5308 5.9296 14.7649 6.07596Z\",\n fill: \"currentColor\",\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n ) });\n}\nfunction h({ size: C = 15 }) {\n return /* @__PURE__ */ e(\"svg\", { width: C, height: C, className: \"inline\", viewBox: \"0 0 15 15\", xmlns: \"http://www.w3.org/2000/svg\", children: /* @__PURE__ */ e(\n \"path\",\n {\n d: \"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z\",\n fill: \"currentColor\",\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n ) });\n}\nfunction w({ size: C = 15, color: l = \"currentColor\" }) {\n return /* @__PURE__ */ e(\"svg\", { width: C, height: C, className: \"inline\", viewBox: \"0 0 15 15\", xmlns: \"http://www.w3.org/2000/svg\", children: /* @__PURE__ */ e(\n \"path\",\n {\n d: \"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z\",\n fill: l,\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n ) });\n}\nfunction c({ size: C = 15, color: l = \"currentColor\" }) {\n return /* @__PURE__ */ e(\"svg\", { width: C, height: C, className: \"inline\", viewBox: \"0 0 15 15\", xmlns: \"http://www.w3.org/2000/svg\", children: /* @__PURE__ */ e(\n \"path\",\n {\n d: \"M0.877075 7.49972C0.877075 3.84204 3.84222 0.876892 7.49991 0.876892C11.1576 0.876892 14.1227 3.84204 14.1227 7.49972C14.1227 11.1574 11.1576 14.1226 7.49991 14.1226C3.84222 14.1226 0.877075 11.1574 0.877075 7.49972ZM7.49991 1.82689C4.36689 1.82689 1.82708 4.36671 1.82708 7.49972C1.82708 10.6327 4.36689 13.1726 7.49991 13.1726C10.6329 13.1726 13.1727 10.6327 13.1727 7.49972C13.1727 4.36671 10.6329 1.82689 7.49991 1.82689ZM8.24993 10.5C8.24993 10.9142 7.91414 11.25 7.49993 11.25C7.08571 11.25 6.74993 10.9142 6.74993 10.5C6.74993 10.0858 7.08571 9.75 7.49993 9.75C7.91414 9.75 8.24993 10.0858 8.24993 10.5ZM6.05003 6.25C6.05003 5.57211 6.63511 4.925 7.50003 4.925C8.36496 4.925 8.95003 5.57211 8.95003 6.25C8.95003 6.74118 8.68002 6.99212 8.21447 7.27494C8.16251 7.30651 8.10258 7.34131 8.03847 7.37854L8.03841 7.37858C7.85521 7.48497 7.63788 7.61119 7.47449 7.73849C7.23214 7.92732 6.95003 8.23198 6.95003 8.7C6.95004 9.00376 7.19628 9.25 7.50004 9.25C7.8024 9.25 8.04778 9.00601 8.05002 8.70417L8.05056 8.7033C8.05924 8.6896 8.08493 8.65735 8.15058 8.6062C8.25207 8.52712 8.36508 8.46163 8.51567 8.37436L8.51571 8.37433C8.59422 8.32883 8.68296 8.27741 8.78559 8.21506C9.32004 7.89038 10.05 7.35382 10.05 6.25C10.05 4.92789 8.93511 3.825 7.50003 3.825C6.06496 3.825 4.95003 4.92789 4.95003 6.25C4.95003 6.55376 5.19628 6.8 5.50003 6.8C5.80379 6.8 6.05003 6.55376 6.05003 6.25Z\",\n fill: l,\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n ) });\n}\nexport {\n i as C,\n r as E,\n c as Q,\n w as X,\n t as a,\n o as b,\n d as c,\n h as d\n};\n//# sourceMappingURL=QuestionMarkCircled-JRFAPLtT.js.map\n","import { jsx as l, Fragment as R, jsxs as y } from \"react/jsx-runtime\";\nimport I, { createContext as M, useId as q, useState as v, useEffect as m, useRef as H, useCallback as S, useMemo as N } from \"react\";\nimport { createPortal as K } from \"react-dom\";\nfunction g(...e) {\n return e.filter((t) => typeof t == \"string\" && t).join(\" \").trim() || void 0;\n}\nfunction P({ size: e = 15, color: t = \"currentColor\" }) {\n return /* @__PURE__ */ l(\"svg\", { width: e, height: e, className: \"inline\", viewBox: \"0 0 15 15\", xmlns: \"http://www.w3.org/2000/svg\", children: /* @__PURE__ */ l(\n \"path\",\n {\n d: \"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z\",\n fill: t,\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n ) });\n}\nfunction b(...e) {\n return e.filter((t) => typeof t == \"string\" && t).join(\" \").trim() || void 0;\n}\nM(void 0);\nfunction D() {\n const [e, t] = v(0);\n return m(() => {\n const n = setInterval(() => {\n t((r) => (r + 1) % 3);\n }, 500);\n return () => clearInterval(n);\n }, []), /* @__PURE__ */ l(\"div\", { className: \"absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle\", children: [0, 1, 2].map((n) => /* @__PURE__ */ l(\n \"div\",\n {\n className: g(\n \"rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current\",\n e === n && \"transform -translate-y-1\"\n )\n },\n n\n )) });\n}\nconst F = {\n base: \"\",\n primary: \"bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80\",\n tertiary: \"text-primary hover:text-primary-foreground disabled:text-muted\",\n outline: \"border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted\",\n link: \"underline-offset-4 hover:underline disabled:underline disabled:text-muted\",\n destructive: \"bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground\"\n}, V = {\n stripped: \"\",\n fitted: \"size-fit\",\n sm: \"px-2 py-1 text-sm\",\n md: \"px-4 py-2 text-base\",\n lg: \"px-6 py-3 text-lg\",\n icon: \"p-1 w-fit aspect-square\",\n full: \"p-2 w-full\"\n}, Z = {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"rounded-full\"\n}, p = {\n variant: \"primary\",\n size: \"md\",\n rounded: \"md\"\n};\nfunction G({\n variant: e = p.variant,\n size: t,\n rounded: n = p.rounded,\n loading: r,\n linkTo: i,\n linkProps: a,\n type: s = \"button\",\n className: c,\n ...o\n}) {\n let d;\n e === \"link\" && !t ? d = \"fitted\" : d = t || p.size;\n const u = g(\n \"appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all\",\n F[e],\n V[d],\n Z[n],\n r && \"relative pointer-events-none\",\n i && \"relative\",\n c\n );\n return /* @__PURE__ */ y(\n \"button\",\n {\n ...o,\n role: i ? \"link\" : o.role,\n \"aria-label\": o[\"aria-label\"] || (a == null ? void 0 : a[\"aria-label\"]),\n \"aria-description\": o[\"aria-description\"] || (a == null ? void 0 : a[\"aria-description\"]),\n \"aria-disabled\": o.disabled || r,\n \"aria-busy\": r,\n type: s,\n className: u,\n children: [\n r && /* @__PURE__ */ l(D, {}),\n /* @__PURE__ */ l(\"span\", { className: g(r && \"invisible\"), children: o.children }),\n i && !o.disabled && /* @__PURE__ */ l(\n \"a\",\n {\n ...a,\n \"aria-hidden\": !0,\n href: i,\n rel: (a == null ? void 0 : a.rel) || \"noreferrer\",\n className: \"absolute inset-0\"\n }\n )\n ]\n }\n );\n}\nfunction J(e) {\n const [t, n] = v(!1), [r, i] = v(!1);\n return m(() => {\n e ? (i(!0), setTimeout(() => n(!0), 10)) : (n(!1), setTimeout(() => i(!1), 150));\n }, [e]), { show: t, shouldRender: r };\n}\nfunction Q(e, t) {\n m(() => {\n const n = (r) => {\n r.key === \"Escape\" && e && t();\n };\n return document.addEventListener(\"keydown\", n), e && (document.body.style.overflow = \"hidden\"), () => {\n document.removeEventListener(\"keydown\", n), document.body.style.overflow = \"auto\";\n };\n }, [e, t]);\n}\nfunction U(e, t) {\n const n = H(null), r = S(() => {\n const i = document.getElementById(e);\n if (!i) return;\n const a = i.querySelectorAll('[data-modal-action=\"true\"]');\n if (a.length > 0) {\n a[0].focus();\n return;\n }\n const s = i.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n );\n if (s.length > 0) {\n const c = Array.from(s).filter((o) => !(o instanceof HTMLButtonElement && o.getAttribute(\"data-modal-close-button\") === \"true\"));\n if (c.length > 0) {\n c[0].focus();\n return;\n }\n s[0].focus();\n return;\n }\n i.focus();\n }, [e]);\n m(() => (t && (n.current = document.activeElement, r()), () => {\n document.body.style.overflow = \"auto\", n.current instanceof HTMLElement && n.current.focus();\n }), [t, r]);\n}\nfunction W({\n id: e,\n isOpen: t,\n onClose: n,\n title: r,\n children: i,\n contentOnly: a = !1,\n className: s,\n overlayClassName: c,\n hideCloseButton: o = !1,\n actions: d = [],\n disableCloseOnOverlayClick: u = !1,\n ariaLabelledBy: k,\n ariaDescribedBy: C\n}) {\n const h = q(), x = e || `modal-${h}`, w = e ? `${e}-title` : `modal-title-${h}`, { show: L, shouldRender: f } = J(t);\n if (U(x, f), Q(f, n), !f) return null;\n const z = () => r ? I.isValidElement(r) ? /* @__PURE__ */ l(\"div\", { className: \"mb-4\", children: r }) : /* @__PURE__ */ l(\"h2\", { className: \"mb-4 text-xl font-semibold\", id: w, children: r }) : null, E = () => d.length === 0 ? null : /* @__PURE__ */ l(\"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((A, j) => {\n const { label: B, className: O, ...T } = A;\n return /* @__PURE__ */ l(G, { className: O, type: \"button\", ...T, \"data-modal-action\": \"true\", children: B }, j);\n }) });\n return /* @__PURE__ */ l(R, { children: K(\n /* @__PURE__ */ l(\n \"div\",\n {\n \"aria-labelledby\": k ?? r ? w : void 0,\n \"aria-describedby\": C,\n role: \"dialog\",\n \"aria-modal\": \"true\",\n className: \"fixed inset-0 z-[100] overflow-y-auto\",\n children: /* @__PURE__ */ y(\"div\", { className: \"flex min-h-screen items-center justify-center p-4\", children: [\n /* @__PURE__ */ l(\n \"div\",\n {\n className: b(\"fixed inset-0 bg-black/20 transition-all\", c),\n onClick: () => {\n u || n();\n }\n }\n ),\n a && /* @__PURE__ */ l(\"div\", { className: b(\"relative w-fit\", s), children: i }),\n !a && /* @__PURE__ */ y(\n \"div\",\n {\n id: x,\n tabIndex: -1,\n className: b(\n \"relative w-full max-w-xl transform rounded-lg shadow-xl transition-all p-6 bg-inherit focus:ring ease-in duration-75\",\n L ? \"opacity-100 scale-100\" : \"opacity-0 scale-90\",\n s\n ),\n children: [\n !o && /* @__PURE__ */ l(\n \"button\",\n {\n type: \"button\",\n onClick: n,\n \"data-modal-close-button\": \"true\",\n 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\",\n children: /* @__PURE__ */ l(P, { size: 18 })\n }\n ),\n z(),\n i,\n E()\n ]\n }\n )\n ] })\n }\n ),\n document.body\n ) });\n}\nfunction $({\n type: e,\n message: t,\n cancelText: n,\n confirmText: r,\n onConfirm: i,\n onClose: a,\n destructive: s = !1,\n title: c,\n ...o\n}) {\n const d = N(() => e === \"confirm\" ? {\n confirm: r || \"Confirm\",\n cancel: n || \"Cancel\",\n defaultTitle: c || \"Confirm Action\"\n } : {\n confirm: r || \"OK\",\n cancel: null,\n defaultTitle: c || \"Alert\"\n }, [e, r, c, n]), u = N(\n () => [\n ...d.cancel ? [\n {\n label: d.cancel,\n variant: \"secondary\",\n onClick: a\n }\n ] : [],\n {\n label: d.confirm,\n variant: s ? \"destructive\" : \"primary\",\n onClick: () => {\n i == null || i(), a();\n }\n }\n ],\n [d, s, i, a]\n );\n return /* @__PURE__ */ l(\n W,\n {\n ...o,\n title: c || d.defaultTitle,\n onClose: a,\n actions: u,\n disableCloseOnOverlayClick: e === \"confirm\",\n hideCloseButton: e === \"confirm\",\n children: typeof t == \"string\" ? /* @__PURE__ */ l(\"p\", { className: \"text-sm\", children: t }) : t\n }\n );\n}\nexport {\n $ as A,\n g as n\n};\n//# sourceMappingURL=styles-DUXNGn3s.js.map\n","import { jsxs as N, jsx as c, Fragment as _ } from \"react/jsx-runtime\";\nimport T, { useId as $, useState as x, createElement as X, useEffect as E, useCallback as A, useMemo as Z, useRef as z, isValidElement as M, cloneElement as O } from \"react\";\nimport { join as w } from \"./utils.esm.js\";\nimport { b as P, C as ee, E as te, a as re, d as oe, c as ne, Q as ae, X as se } from \"./QuestionMarkCircled-JRFAPLtT.js\";\nimport { n as H } from \"./styles-DUXNGn3s.js\";\nimport { A as Qe } from \"./styles-DUXNGn3s.js\";\nimport { createPortal as J } from \"react-dom\";\nfunction q({\n id: n,\n title: a,\n content: e,\n children: o,\n className: t = \"\",\n disabled: r = !1,\n isOpen: s = !1,\n onToggle: l,\n triggerClassName: d = \"\",\n bodyClassName: u = \"\"\n}) {\n const f = $(), i = n || `accordion-item-${f}`, g = `${i}-header`, b = `${i}-panel`, m = () => {\n !r && l && l();\n }, v = (h) => {\n (h.key === \"Enter\" || h.key === \" \") && (h.preventDefault(), m());\n };\n return /* @__PURE__ */ N(\"div\", { className: w(\"border-b border-gray-200\", r && \"opacity-60 cursor-not-allowed\", t), children: [\n /* @__PURE__ */ N(\n \"button\",\n {\n id: g,\n type: \"button\",\n className: w(\n \"w-full text-left py-3 px-4 flex justify-between items-center focus:outline focus:outline-secondary\",\n r ? \"cursor-not-allowed\" : \"hover:bg-gray-50/10 cursor-pointer\",\n d\n ),\n \"aria-expanded\": s,\n \"aria-controls\": b,\n disabled: r,\n onClick: m,\n onKeyDown: v,\n children: [\n /* @__PURE__ */ c(\"span\", { children: a }),\n /* @__PURE__ */ c(\n \"span\",\n {\n className: w(\n \"transform transition-transform duration-300 ease-linear\",\n s ? \"rotate-180\" : \"rotate-0\"\n ),\n \"aria-hidden\": \"true\",\n children: /* @__PURE__ */ c(P, { size: 18 })\n }\n )\n ]\n }\n ),\n /* @__PURE__ */ c(\n \"div\",\n {\n id: b,\n role: \"region\",\n \"aria-labelledby\": g,\n className: w(\n \"transition-all duration-300 ease-linear px-4\",\n s ? \"max-h-96 opacity-100 overflow-auto py-3\" : \"max-h-0 opacity-0 overflow-hidden\",\n u\n ),\n children: s && (o || e)\n }\n )\n ] });\n}\nfunction ze({\n id: n,\n items: a = [],\n children: e,\n className: o = \"\",\n itemClassName: t = \"\",\n allowMultiple: r = !1,\n defaultOpenItems: s = [],\n triggersClassName: l = \"\",\n bodiesClassName: d = \"\"\n}) {\n const u = $(), f = n || `accordion-group-${u}`, [i, g] = x(new Set(s)), b = (h) => {\n g((y) => {\n const p = new Set(y);\n return p.has(h) ? p.delete(h) : (r || p.clear(), p.add(h)), p;\n });\n }, m = (h) => `${u}-item-${h}`, v = (h) => i.has(h);\n return /* @__PURE__ */ N(\"div\", { id: f, className: o, children: [\n a.length > 0 && a.map((h, y) => {\n const p = h.id || m(y);\n return /* @__PURE__ */ c(\n q,\n {\n id: p,\n title: h.title,\n content: h.content,\n disabled: h.disabled,\n isOpen: v(p),\n onToggle: () => b(p),\n className: t,\n triggerClassName: l,\n bodyClassName: d\n },\n p\n );\n }),\n a.length === 0 && e && T.Children.map(e, (h, y) => {\n if (T.isValidElement(h) && h.type === q) {\n const p = h.props.id || m(y);\n return /* @__PURE__ */ X(\n q,\n {\n ...h.props,\n key: p,\n id: p,\n className: w(t, h.props.className),\n isOpen: v(p),\n onToggle: () => b(p),\n triggerClassName: w(l, h.props.triggerClassName),\n bodyClassName: w(d, h.props.bodyClassName)\n }\n );\n }\n return null;\n })\n ] });\n}\nfunction ie() {\n const [n, a] = x(0);\n return E(() => {\n const e = setInterval(() => {\n a((o) => (o + 1) % 3);\n }, 500);\n return () => clearInterval(e);\n }, []), /* @__PURE__ */ c(\"div\", { className: \"absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle\", children: [0, 1, 2].map((e) => /* @__PURE__ */ c(\n \"div\",\n {\n className: w(\n \"rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current\",\n n === e && \"transform -translate-y-1\"\n )\n },\n e\n )) });\n}\nconst le = {\n base: \"\",\n primary: \"bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80\",\n tertiary: \"text-primary hover:text-primary-foreground disabled:text-muted\",\n outline: \"border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted\",\n link: \"underline-offset-4 hover:underline disabled:underline disabled:text-muted\",\n destructive: \"bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground\"\n}, de = {\n stripped: \"\",\n fitted: \"size-fit\",\n sm: \"px-2 py-1 text-sm\",\n md: \"px-4 py-2 text-base\",\n lg: \"px-6 py-3 text-lg\",\n icon: \"p-1 w-fit aspect-square\",\n full: \"p-2 w-full\"\n}, ue = {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"rounded-full\"\n}, K = {\n variant: \"primary\",\n size: \"md\",\n rounded: \"md\"\n};\nfunction ce({\n variant: n = K.variant,\n size: a,\n rounded: e = K.rounded,\n loading: o,\n linkTo: t,\n linkProps: r,\n type: s = \"button\",\n className: l,\n ...d\n}) {\n let u;\n n === \"link\" && !a ? u = \"fitted\" : u = a || K.size;\n const i = w(\n \"appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all\",\n le[n],\n de[u],\n ue[e],\n o && \"relative pointer-events-none\",\n t && \"relative\",\n l\n );\n return /* @__PURE__ */ N(\n \"button\",\n {\n ...d,\n role: t ? \"link\" : d.role,\n \"aria-label\": d[\"aria-label\"] || (r == null ? void 0 : r[\"aria-label\"]),\n \"aria-description\": d[\"aria-description\"] || (r == null ? void 0 : r[\"aria-description\"]),\n \"aria-disabled\": d.disabled || o,\n \"aria-busy\": o,\n type: s,\n className: i,\n children: [\n o && /* @__PURE__ */ c(ie, {}),\n /* @__PURE__ */ c(\"span\", { className: w(o && \"invisible\"), children: d.children }),\n t && !d.disabled && /* @__PURE__ */ c(\n \"a\",\n {\n ...r,\n \"aria-hidden\": !0,\n href: t,\n rel: (r == null ? void 0 : r.rel) || \"noreferrer\",\n className: \"absolute inset-0\"\n }\n )\n ]\n }\n );\n}\nfunction fe(n) {\n const [a, e] = x(\"\"), o = A((t) => {\n let r = t, s = \"\";\n for (; r && !s; ) {\n const l = window.getComputedStyle(r).backgroundColor;\n l && l !== \"transparent\" && l !== \"rgba(0, 0, 0, 0)\" && (s = l), r = r.parentElement;\n }\n return s || \"transparent\";\n }, []);\n return E(() => {\n const t = document.getElementById(n);\n if (t) {\n const r = o(t.parentElement);\n e(r);\n }\n }, [n, o]), a;\n}\nfunction Be({\n ref: n,\n id: a,\n size: e = 20,\n color: o,\n filled: t = !1,\n rounded: r = !0,\n checked: s = !1,\n onCheckedChange: l,\n disabled: d,\n className: u = \"\",\n ...f\n}) {\n const i = $(), g = Z(() => a || `checkbox-${i}`, [a, i]), b = fe(g), [m, v] = x(s);\n E(() => {\n v(s);\n }, [s]);\n const h = () => {\n d || (v(!m), l == null || l(!m));\n }, y = (C) => {\n C.key === \" \" && (C.preventDefault(), h());\n }, p = w(\n \"flex items-center justify-center border outline outline-transparent focus:outline-current focus:outline-offset-2\",\n r && \"rounded\",\n d && \"opacity-40 cursor-not-allowed\",\n !d && \"cursor-pointer\",\n u\n );\n return /* @__PURE__ */ c(\n \"button\",\n {\n id: g,\n type: \"button\",\n ref: n,\n tabIndex: 0,\n role: \"checkbox\",\n onClick: h,\n \"aria-checked\": m,\n \"aria-disabled\": d,\n onKeyDownCapture: y,\n style: {\n width: e,\n height: e,\n color: o,\n backgroundColor: m && t ? \"currentcolor\" : \"transparent\"\n },\n className: p,\n ...f,\n children: m && /* @__PURE__ */ c(ee, { size: e, color: t ? b : void 0 })\n }\n );\n}\nfunction je({\n children: n,\n className: a,\n linkTo: e,\n linkProps: o,\n onButtonClick: t,\n buttonProps: r,\n ...s\n}) {\n return e && t && console.warn('Clickable: Both \"linkTo\" and \"onButtonClick\" props are provided. Only \"linkTo\" will be used.'), /* @__PURE__ */ N(\"div\", { className: w(\"relative w-fit\", a), ...s, children: [\n n,\n e && /* @__PURE__ */ c(\n \"a\",\n {\n ...o,\n rel: (o == null ? void 0 : o.rel) || \"noreferrer\",\n href: e,\n className: w(\"absolute inset-0\", o == null ? void 0 : o.className)\n }\n ),\n !e && t && /* @__PURE__ */ c(\n \"button\",\n {\n ...r,\n type: \"button\",\n onClick: t,\n className: w(\"absolute inset-0 cursor-pointer\", r == null ? void 0 : r.className)\n }\n )\n ] });\n}\nfunction B({ elementId: n, type: a, message: e }) {\n return E(() => {\n const o = document.getElementById(n);\n if (o) {\n if (!e && a === \"error\") {\n o.removeAttribute(\"data-error\");\n return;\n }\n if (!e && a === \"success\") {\n o.removeAttribute(\"data-success\");\n return;\n }\n return o.setAttribute(\"aria-describedby\", `${n}-${a}-message`), o.setAttribute(\"aria-invalid\", a === \"error\" ? \"true\" : \"false\"), a === \"error\" && o.setAttribute(\"data-error\", \"true\"), a === \"success\" && o.setAttribute(\"data-success\", \"true\"), () => {\n o.removeAttribute(\"aria-describedby\"), o.removeAttribute(\"aria-invalid\"), o.removeAttribute(\"data-error\"), o.removeAttribute(\"data-success\");\n };\n }\n }, [n, a, e]), e ? /* @__PURE__ */ N(\n \"small\",\n {\n className: w(\n \"mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-start\",\n a === \"error\" && \"text-destructive\",\n a === \"success\" && \"text-success\"\n ),\n role: \"status\",\n children: [\n a === \"error\" ? /* @__PURE__ */ c(te, {}) : /* @__PURE__ */ c(re, {}),\n /* @__PURE__ */ c(\"span\", { id: `${n}-${a}-message`, children: e })\n ]\n }\n ) : null;\n}\nconst me = {\n base: \"\",\n default: \"ring ring-transparent focus:ring-primary-foreground not-disabled:data-error:ring-destructive not-disabled:data-success:ring-success\",\n 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\",\n outline: \"border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success\"\n}, be = {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"px-3 rounded-full\"\n}, W = {\n variant: \"default\",\n rounded: \"none\"\n};\nfunction Fe({\n variant: n = W.variant,\n rounded: a,\n displayOnlyMode: e = !1,\n errorMessage: o,\n successMessage: t,\n type: r = \"text\",\n className: s,\n ...l\n}) {\n const d = $(), [u, f] = x(!1);\n let i = a;\n n === \"outline\" && !a && (i = \"md\"), i = i || W.rounded;\n const m = w(\n \"appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all\",\n \"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\",\n !e && me[n],\n !e && be[i],\n r === \"password\" && \"pr-10\",\n !e && \"px-2 py-1\",\n e && \"pointer-events-none\",\n s\n );\n return /* @__PURE__ */ N(\"div\", { className: w(e && \"cursor-text\"), style: { height: l.height, width: l.width }, children: [\n /* @__PURE__ */ N(\"div\", { className: w(r === \"password\" && \"relative\"), children: [\n /* @__PURE__ */ c(\n \"input\",\n {\n ...l,\n id: d,\n type: r === \"password\" && u ? \"text\" : r,\n \"aria-disabled\": l.disabled,\n readOnly: e,\n \"aria-readonly\": e || l[\"aria-readonly\"],\n \"data-error\": o ? !0 : void 0,\n \"data-success\": t ? !0 : void 0,\n className: m\n }\n ),\n r === \"password\" && /* @__PURE__ */ c(\n \"button\",\n {\n onClick: () => f(!u),\n className: \"absolute inset-y-0 right-0 px-2 hover:cursor-pointer\",\n \"aria-label\": \"Toggle password visibility\",\n \"data-state\": u ? \"visible\" : \"hidden\",\n children: u ? /* @__PURE__ */ c(oe, { size: 20 }) : /* @__PURE__ */ c(ne, { size: 20 })\n }\n )\n ] }),\n !e && /* @__PURE__ */ c(B, { elementId: d, type: \"error\", message: o }),\n !e && /* @__PURE__ */ c(B, { elementId: d, type: \"success\", message: t })\n ] });\n}\nfunction Se({\n display: n = \"inline\",\n width: a = \"fit-content\",\n className: e = \"\",\n required: o,\n helpMessage: t,\n suffix: r,\n htmlFor: s,\n children: l,\n ...d\n}) {\n const u = $(), f = w(\"font-medium\", n, e), i = t ? `${s ?? u}-help` : void 0;\n return /* @__PURE__ */ N(\"div\", { style: { display: n === \"inline\" ? \"inline-flex\" : \"flex\", width: a }, className: \"relative\", children: [\n /* @__PURE__ */ N(\"label\", { className: f, htmlFor: s, ...d, children: [\n l,\n o && /* @__PURE__ */ c(\"span\", { className: \"text-red-500 font-medium ml-1\", \"aria-label\": \"required\", children: \"*\" })\n ] }),\n t && /* @__PURE__ */ c(\n \"span\",\n {\n className: \"text-gray-500 ml-1 size-fit -translate-y-1/3\",\n \"aria-describedby\": i,\n \"aria-label\": \"Help information\",\n title: t,\n children: /* @__PURE__ */ c(ae, {})\n }\n ),\n t && /* @__PURE__ */ c(\"div\", { id: i, className: \"sr-only\", children: t }),\n r && /* @__PURE__ */ c(\"span\", { className: \"ml-1\", children: r })\n ] });\n}\nfunction he(n) {\n const [a, e] = x(!1), [o, t] = x(!1);\n return E(() => {\n n ? (t(!0), setTimeout(() => e(!0), 10)) : (e(!1), setTimeout(() => t(!1), 150));\n }, [n]), { show: a, shouldRender: o };\n}\nfunction pe(n, a) {\n E(() => {\n const e = (o) => {\n o.key === \"Escape\" && n && a();\n };\n return document.addEventListener(\"keydown\", e), n && (document.body.style.overflow = \"hidden\"), () => {\n document.removeEventListener(\"keydown\", e), document.body.style.overflow = \"auto\";\n };\n }, [n, a]);\n}\nfunction ge(n, a) {\n const e = z(null), o = A(() => {\n const t = document.getElementById(n);\n if (!t) return;\n const r = t.querySelectorAll('[data-modal-action=\"true\"]');\n if (r.length > 0) {\n r[0].focus();\n return;\n }\n const s = t.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n );\n if (s.length > 0) {\n const l = Array.from(s).filter((d) => !(d instanceof HTMLButtonElement && d.getAttribute(\"data-modal-close-button\") === \"true\"));\n if (l.length > 0) {\n l[0].focus();\n return;\n }\n s[0].focus();\n return;\n }\n t.focus();\n }, [n]);\n E(() => (a && (e.current = document.activeElement, o()), () => {\n document.body.style.overflow = \"auto\", e.current instanceof HTMLElement && e.current.focus();\n }), [a, o]);\n}\nfunction He({\n id: n,\n isOpen: a,\n onClose: e,\n title: o,\n children: t,\n contentOnly: r = !1,\n className: s,\n overlayClassName: l,\n hideCloseButton: d = !1,\n actions: u = [],\n disableCloseOnOverlayClick: f = !1,\n ariaLabelledBy: i,\n ariaDescribedBy: g\n}) {\n const b = $(), m = n || `modal-${b}`, v = n ? `${n}-title` : `modal-title-${b}`, { show: h, shouldRender: y } = he(a);\n if (ge(m, y), pe(y, e), !y) return null;\n const p = () => o ? T.isValidElement(o) ? /* @__PURE__ */ c(\"div\", { className: \"mb-4\", children: o }) : /* @__PURE__ */ c(\"h2\", { className: \"mb-4 text-xl font-semibold\", id: v, children: o }) : null, C = () => u.length === 0 ? null : /* @__PURE__ */ c(\"div\", { className: \"mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3\", children: u.map((D, j) => {\n const { label: F, className: L, ...R } = D;\n return /* @__PURE__ */ c(ce, { className: L, type: \"button\", ...R, \"data-modal-action\": \"true\", children: F }, j);\n }) });\n return /* @__PURE__ */ c(_, { children: J(\n /* @__PURE__ */ c(\n \"div\",\n {\n \"aria-labelledby\": i ?? o ? v : void 0,\n \"aria-describedby\": g,\n role: \"dialog\",\n \"aria-modal\": \"true\",\n className: \"fixed inset-0 z-[100] overflow-y-auto\",\n children: /* @__PURE__ */ N(\"div\", { className: \"flex min-h-screen items-center justify-center p-4\", children: [\n /* @__PURE__ */ c(\n \"div\",\n {\n className: H(\"fixed inset-0 bg-black/20 transition-all\", l),\n onClick: () => {\n f || e();\n }\n }\n ),\n r && /* @__PURE__ */ c(\"div\", { className: H(\"relative w-fit\", s), children: t }),\n !r && /* @__PURE__ */ N(\n \"div\",\n {\n id: m,\n tabIndex: -1,\n className: H(\n \"relative w-full max-w-xl transform rounded-lg shadow-xl transition-all p-6 bg-inherit focus:ring ease-in duration-75\",\n h ? \"opacity-100 scale-100\" : \"opacity-0 scale-90\",\n s\n ),\n children: [\n !d && /* @__PURE__ */ c(\n \"button\",\n {\n type: \"button\",\n onClick: e,\n \"data-modal-close-button\": \"true\",\n 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\",\n children: /* @__PURE__ */ c(se, { size: 18 })\n }\n ),\n p(),\n t,\n C()\n ]\n }\n )\n ] })\n }\n ),\n document.body\n ) });\n}\nfunction ve({ itemId: n, checked: a, onChange: e, name: o, disabled: t = !1, className: r = \"\" }) {\n const s = \"relative inline-flex items-center justify-center rounded-full\", l = () => {\n t || e();\n }, d = w(\n s,\n !a && \"hover:border-current/60\",\n !t && \"border-current cursor-pointer\",\n t && \"border-muted/60 cursor-not-allowed\",\n r\n );\n return /* @__PURE__ */ c(\n \"div\",\n {\n id: n,\n role: \"radio\",\n tabIndex: -1,\n \"aria-checked\": a,\n \"aria-disabled\": t,\n \"aria-description\": `Radio button for ${o}`,\n \"aria-labelledby\": `${n}-label`,\n onClick: l,\n className: d,\n style: {\n width: \"1em\",\n height: \"1em\",\n padding: \"0.1em\",\n borderWidth: \"0.06em\"\n },\n children: a && /* @__PURE__ */ c(\n \"div\",\n {\n className: w(\"size-full aspect-square rounded-full\", t && \"bg-muted/60\", !t && \"bg-current\")\n }\n )\n }\n );\n}\nfunction V({\n value: n,\n children: a,\n className: e = \"\",\n isSelected: o = !1,\n onChange: t,\n disabled: r = !1,\n hideInput: s = !1,\n description: l,\n name: d\n}) {\n const f = `radio-${$()}-${n}`, i = () => {\n r || t == null || t(n);\n };\n return /* @__PURE__ */ N(\n \"div\",\n {\n title: l,\n className: w(\n \"relative flex items-center\",\n e,\n // Uses text color for borders\n s && `p-2 border-2 focus-within:border-dashed focus-within:${r ? \"border-current/50\" : \"border-current/80\"}`,\n s && !o && `border-transparent ${r ? \"\" : \"not-focus-within:hover:border-border/60\"}`,\n s && o && \"border-border\",\n r && \"opacity-60 cursor-not-allowed\"\n ),\n style: {\n gap: \"0.5em\"\n },\n children: [\n !s && /* @__PURE__ */ c(\n ve,\n {\n itemId: f,\n name: d || \"\",\n checked: o,\n onChange: i,\n disabled: r,\n className: w(s && \"\")\n }\n ),\n /* @__PURE__ */ c(\n \"div\",\n {\n id: s ? f : void 0,\n tabIndex: s ? -1 : void 0,\n role: s ? \"radio\" : void 0,\n onClick: s ? i : void 0,\n \"aria-checked\": s ? o ? \"true\" : \"false\" : void 0,\n \"aria-disabled\": s ? r : void 0,\n \"aria-description\": s ? l || `Radio button for ${d}` : void 0,\n \"aria-labelledby\": s ? `${f}-label` : void 0,\n className: w(s && \"size-full\", typeof a == \"object\" && \"grow focus:outline-none\"),\n children: /* @__PURE__ */ c(\n \"label\",\n {\n id: `${f}-label`,\n onClick: s ? void 0 : i,\n className: w(r && \"cursor-not-allowed\", !r && \"cursor-pointer\"),\n children: a\n }\n )\n }\n )\n ]\n }\n );\n}\nfunction we(n, a) {\n const [e, o] = x(a), [t, r] = x(-1), [s, l] = x(!1), d = A((b, m) => {\n var y;\n const v = b[m];\n v.hasAttribute(\"disabled\") || v.getAttribute(\"aria-disabled\") === \"true\" || ((y = b[m]) == null || y.click(), r(m));\n }, []), u = A(\n (b, m) => {\n var h;\n if (b.preventDefault(), s || !m.length) return;\n const v = a !== -1 ? a : 0;\n (h = m[v]) == null || h.focus(), o(v), a !== -1 && d(m, v);\n },\n [a, s, d]\n ), f = A(\n (b) => {\n var y;\n if (!b.shiftKey)\n return;\n b.preventDefault();\n const m = Array.from(\n document.querySelectorAll(\n 'a, button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"])'\n )\n ).filter((p) => !p.hasAttribute(\"disabled\") && p.tabIndex >= 0), v = m.findIndex((p) => p.id === n), h = v > 0 ? v - 1 : m.length - 1;\n (y = m[h]) == null || y.focus();\n },\n [n]\n ), i = A(\n (b, m) => {\n var C;\n if (!m.length) return;\n const v = b.target;\n if (!m.some((D) => D.id === v.id)) return;\n const y = e !== -1 ? e : 0;\n let p = y;\n switch (b.key) {\n case \"ArrowUp\":\n case \"ArrowLeft\":\n b.preventDefault(), p = y > 0 ? y - 1 : m.length - 1;\n break;\n case \"ArrowDown\":\n case \"ArrowRight\":\n b.preventDefault(), p = (y + 1) % m.length;\n break;\n // Select the option when the space key is pressed\n case \" \":\n b.preventDefault(), d(m, y);\n return;\n case \"Tab\":\n f(b);\n return;\n default:\n return;\n }\n (C = m[p]) == null || C.focus(), o(p), t !== -1 && d(m, p);\n },\n [e, t, f, d]\n ), g = A(() => {\n const b = document.querySelector(`[id=\"${n}\"][role=\"radiogroup\"]`);\n return b ? Array.from(b.querySelectorAll('[role=\"radio\"]')) : [];\n }, [n]);\n E(() => {\n const b = document.querySelector(`[id=\"${n}\"][role=\"radiogroup\"]`);\n if (!b) return;\n const m = g(), v = (C) => u(C, m), h = (C) => i(C, m), y = () => l(!0), p = () => l(!1);\n return document.addEventListener(\"keydown\", h), b.addEventListener(\"focus\", v), b.addEventListener(\"mousedown\", y), document.addEventListener(\"mouseup\", p), () => {\n document.removeEventListener(\"keydown\", h), b.removeEventListener(\"focus\", v), b.removeEventListener(\"mousedown\", y), document.removeEventListener(\"mouseup\", p);\n };\n }, [n, g, u, i]);\n}\nfunction qe({\n options: n = [],\n value: a,\n onChange: e,\n id: o,\n children: t,\n className: r = \"\",\n childrenClassName: s = \"\",\n hideInputs: l = !1\n}) {\n const d = $(), u = o || `radio-group-${d}`;\n we(\n u,\n n.findIndex((i) => i === a)\n );\n const f = Z(() => n.reduce((i, g) => (typeof g == \"string\" ? i.some((b) => b.value === g) || i.push({ label: g, value: g }) : i.push(g), i), []), [n]);\n return /* @__PURE__ */ N(\"div\", { id: u, role: \"radiogroup\", tabIndex: 0, className: w(r, \"focus:outline-none\"), children: [\n f.length > 0 && f.map((i, g) => /* @__PURE__ */ c(\n V,\n {\n value: i.value,\n isSelected: a === i.value,\n onChange: e,\n name: u,\n disabled: i.disabled,\n description: i.description,\n hideInput: l,\n className: s,\n children: i.label\n },\n `${i.value}-${g}`\n )),\n f.length === 0 && t && T.Children.map(t, (i) => T.isValidElement(i) && i.type === V ? /* @__PURE__ */ c(\n V,\n {\n ...i.props,\n className: w(s, i.props.className),\n hideInput: i.props.hideInput || l,\n isSelected: a === i.props.value,\n onChange: e,\n name: u,\n children: i.props.children\n }\n ) : null)\n ] });\n}\nfunction Ke({ children: n, ref: a, ...e }) {\n if (M(n)) {\n let o = { ...e };\n return n.props && (o = { ...o, ...n.props }), O(n, {\n ...o,\n ref: (t) => {\n typeof a == \"function\" ? a(t) : a && (a.current = t);\n }\n });\n }\n return X(\"div\", { ...e, ref: a }, n);\n}\nfunction ye({ elementId: n, maxLength: a }) {\n const [e, o] = x(0);\n return E(() => {\n const t = document.getElementById(n);\n if (!t)\n return;\n const r = () => {\n const s = t.value.length;\n o(s);\n const l = s >= a;\n t.setAttribute(\"aria-describedby\", `${n}-character-count`), t.setAttribute(\"aria-invalid\", l ? \"true\" : \"false\"), l ? t.setAttribute(\"data-error\", \"true\") : t.removeAttribute(\"data-error\");\n };\n return r(), t.addEventListener(\"input\", r), t.setAttribute(\"maxlength\", String(a)), () => {\n t.removeEventListener(\"input\", r), t.removeAttribute(\"maxlength\"), t.removeAttribute(\"aria-describedby\"), t.removeAttribute(\"aria-invalid\"), t.removeAttribute(\"data-error\");\n };\n }, [n, a]), /* @__PURE__ */ c(\n \"small\",\n {\n className: w(\n \"mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-end\",\n e >= a && \"text-destructive\",\n e < a && \"text-current\"\n ),\n role: \"status\",\n children: /* @__PURE__ */ N(\"span\", { id: `${n}-character-count`, children: [\n e,\n \" / \",\n a,\n \" characters\"\n ] })\n }\n );\n}\nfunction xe(n, a) {\n E(() => {\n const e = document.getElementById(n);\n if (!e)\n return;\n if (!a) {\n e.style.height = \"auto\";\n return;\n }\n const o = () => {\n e.style.height = \"auto\", e.style.height = `${e.scrollHeight}px`;\n };\n return o(), e.addEventListener(\"input\", o), e.addEventListener(\"resize\", o), window.addEventListener(\"resize\", o), () => {\n e.removeEventListener(\"input\", o), e.removeEventListener(\"resize\", o), window.removeEventListener(\"resize\", o);\n };\n }, [n, a]);\n}\nconst Ne = {\n base: \"\",\n \"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\",\n outline: \"border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success\"\n}, Ce = {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"px-3 rounded-full\"\n}, Q = {\n variant: \"outline\",\n rounded: \"none\"\n};\nfunction Ve({\n variant: n = Q.variant,\n rounded: a,\n displayOnlyMode: e = !1,\n errorMessage: o,\n successMessage: t,\n hideResizeHandle: r = !1,\n autoExpand: s = !1,\n characterLimit: l = 0,\n className: d,\n ...u\n}) {\n const f = $();\n xe(f, s || e);\n let i = a;\n n === \"outline\" && !a && (i = \"md\"), i = i || Q.rounded;\n let g = r;\n (e || n === \"left-line\" && !r) && (g = !0);\n const m = w(\n \"appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all\",\n !e && Ne[n],\n !e && Ce[i],\n !e && \"px-2 py-1\",\n e && \"pointer-events-none\",\n g && \"no-resize-handle\",\n d\n );\n return /* @__PURE__ */ N(\"div\", { className: w(\"-space-y-1.5\", e && \"cursor-text\"), children: [\n /* @__PURE__ */ c(\n \"textarea\",\n {\n ...u,\n id: f,\n \"aria-disabled\": u.disabled,\n readOnly: e,\n \"aria-readonly\": e || u[\"aria-readonly\"],\n style: {\n resize: s ? \"none\" : void 0\n },\n className: m\n }\n ),\n l > 0 && /* @__PURE__ */ c(ye, { elementId: f, maxLength: l }),\n !e && /* @__PURE__ */ c(B, { elementId: f, type: \"error\", message: o }),\n !e && /* @__PURE__ */ c(B, { elementId: f, type: \"success\", message: t })\n ] });\n}\nfunction Ee(n) {\n return { calculatePosition: A(\n (e, o) => {\n const t = e.getBoundingClientRect(), r = o.getBoundingClientRect(), s = {\n width: window.innerWidth,\n height: window.innerHeight\n }, l = (g, b, m, v) => g < 0 || b < 0 || g + m > s.width || b + v > s.height, d = {\n top: {\n x: t.left + t.width / 2 - r.width / 2,\n y: t.top - r.height - k,\n arrow: {\n x: r.width / 2 - I,\n y: r.height\n }\n },\n bottom: {\n x: t.left + t.width / 2 - r.width / 2,\n y: t.bottom + k,\n arrow: {\n x: r.width / 2 - I,\n y: -6\n }\n },\n left: {\n x: t.left - r.width - k,\n y: t.top + t.height / 2 - r.height / 2,\n arrow: {\n x: r.width,\n y: r.height / 2 - I\n }\n },\n right: {\n x: t.right + k,\n y: t.top + t.height / 2 - r.height / 2,\n arrow: {\n x: -6,\n y: r.height / 2 - I\n }\n }\n };\n let u = n, f = d[n];\n if (l(f.x, f.y, r.width, r.height)) {\n const g = {\n top: \"bottom\",\n bottom: \"top\",\n left: \"right\",\n right: \"left\"\n }, b = d[g[n]];\n if (!l(b.x, b.y, r.width, r.height))\n u = g[n], f = b;\n else {\n const m = [\"top\", \"bottom\", \"left\", \"right\"].filter(\n (v) => v !== n && v !== g[n]\n );\n for (const v of m) {\n const h = d[v];\n if (!l(h.x, h.y, r.width, r.height)) {\n u = v, f = h;\n break;\n }\n }\n }\n }\n f.x = Math.max(8, Math.min(f.x, s.width - r.width - 8)), f.y = Math.max(8, Math.min(f.y, s.height - r.height - 8));\n const i = {\n x: t.left + t.width / 2,\n y: t.top + t.height / 2\n };\n return u === \"top\" || u === \"bottom\" ? f.arrow.x = Math.max(\n I,\n Math.min(i.x - f.x - I, r.width - I * 2)\n ) : f.arrow.y = Math.max(\n I,\n Math.min(i.y - f.y - I, r.height - I * 2)\n ), {\n ...f,\n placement: u\n };\n },\n [n]\n ) };\n}\nfunction Ae(n, a, e) {\n const o = z(null), t = z(null), r = A(() => {\n if (!o.current || !t.current) return;\n const s = n(o.current, t.current);\n e(s);\n }, [n, e]);\n return E(() => {\n if (!a) return;\n const s = () => r();\n return window.addEventListener(\"resize\", s), () => {\n window.removeEventListener(\"resize\", s);\n };\n }, [a, r]), {\n triggerRef: o,\n tooltipRef: t,\n updatePosition: r\n };\n}\nfunction Ie(n, a, e, o, t, r, s, l, d) {\n const u = z(null), f = A(() => {\n n || (u.current && clearTimeout(u.current), u.current = window.setTimeout(() => {\n e(!0), requestAnimationFrame(() => {\n t(), o(!0);\n });\n }, a));\n }, [n, a, e, t, o]), i = A(\n (g = !1) => {\n if (u.current && clearTimeout(u.current), g) {\n o(!1), setTimeout(() => e(!1), 150);\n return;\n }\n u.current = window.setTimeout(() => {\n o(!1), setTimeout(() => e(!1), 150);\n }, 100);\n },\n [o, e]\n );\n return E(() => {\n !r && !s && !l && d && i();\n }, [r, s, l, d, i]), E(() => () => {\n u.current && clearTimeout(u.current);\n }, []), {\n showTooltip: f,\n hideTooltip: i,\n timeoutRef: u\n };\n}\nconst k = 4, I = 6;\nfunction Ge({\n id: n,\n children: a,\n message: e,\n placement: o = \"top\",\n disabled: t = !1,\n delay: r = 200,\n className: s\n}) {\n const [l, d] = x(!1), [u, f] = x(!1), [i, g] = x(null), [b, m] = x(!1), [v, h] = x(!1), [y, p] = x(!1), { calculatePosition: C } = Ee(o), { triggerRef: D, tooltipRef: j, updatePosition: F } = Ae(C, u, g), { showTooltip: L, hideTooltip: R, timeoutRef: G } = Ie(\n t,\n r,\n f,\n d,\n F,\n b,\n v,\n y,\n l\n ), Y = $(), U = n ?? Y;\n return /* @__PURE__ */ N(_, { children: [\n T.cloneElement(a, {\n ref: (S) => {\n D.current = S;\n },\n onMouseEnter: () => {\n m(!0), L();\n },\n onMouseLeave: () => {\n m(!1);\n },\n onFocus: () => {\n p(!0), L();\n },\n onBlur: () => {\n p(!1), R(!0);\n },\n onKeyDown: (S) => {\n S.key === \"Escape\" && R(!0);\n },\n \"aria-describedby\": t ? void 0 : U\n }),\n u && J(\n /* @__PURE__ */ c(\n \"div\",\n {\n ref: j,\n id: U,\n role: \"tooltip\",\n className: w(\n \"fixed z-50 px-2 py-1 text-sm rounded shadow-lg pointer-events-auto transition-all duration-150 ease-out\",\n l ? \"opacity-100\" : \"opacity-0\",\n s\n ),\n style: i ? { left: i.x, top: i.y } : { opacity: 0 },\n onMouseEnter: () => {\n h(!0), G.current && clearTimeout(G.current);\n },\n onMouseLeave: () => {\n h(!1);\n },\n children: e\n }\n ),\n document.body\n )\n ] });\n}\nexport {\n ze as Accordion,\n q as AccordionItem,\n Qe as ActionModal,\n ce as Button,\n ie as ButtonLoadingDots,\n Be as Checkbox,\n je as Clickable,\n Fe as Input,\n Se as Label,\n He as Modal,\n qe as RadioGroup,\n V as RadioGroupItem,\n ve as RadioInput,\n Ke as Slot,\n Ve as Textarea,\n Ge as Tooltip\n};\n//# sourceMappingURL=components.esm.js.map\n","import { Modal, ModalProps } from '@moondreamsdev/dreamer-ui/components';\nimport React, { useMemo } from 'react';\n\ninterface BaseActionModalProps extends Omit<ModalProps, 'children' | 'actions'> {\n message: React.ReactNode;\n destructive?: boolean;\n}\n\ninterface AlertModalProps extends BaseActionModalProps {\n type: 'alert';\n confirmText?: string;\n onConfirm?: () => void;\n // Cancel-related props are not allowed for alerts\n cancelText?: never;\n}\n\ninterface ConfirmModalProps extends BaseActionModalProps {\n type: 'confirm';\n confirmText?: string;\n cancelText?: string;\n onConfirm?: () => void;\n}\n\nexport type ActionModalProps = AlertModalProps | ConfirmModalProps;\n\nexport function ActionModal({\n type,\n message,\n cancelText,\n confirmText,\n onConfirm,\n onClose,\n destructive = false,\n title,\n ...modalProps\n}: ActionModalProps) {\n const defaultTexts = useMemo(() => {\n if (type === 'confirm') {\n return {\n confirm: confirmText || 'Confirm',\n cancel: cancelText || 'Cancel',\n defaultTitle: title || 'Confirm Action',\n };\n }\n return {\n confirm: confirmText || 'OK',\n cancel: null,\n defaultTitle: title || 'Alert',\n };\n }, [type, confirmText, title, cancelText]);\n\n const actions: ModalProps['actions'] = useMemo(\n () => [\n ...(defaultTexts.cancel\n ? [\n {\n label: defaultTexts.cancel,\n variant: 'secondary' as const,\n onClick: onClose,\n },\n ]\n : []),\n {\n label: defaultTexts.confirm,\n variant: destructive ? 'destructive' : 'primary',\n onClick: () => {\n onConfirm?.();\n onClose();\n },\n },\n ],\n [defaultTexts, destructive, onConfirm, onClose]\n );\n\n return (\n <Modal\n {...modalProps}\n title={title || defaultTexts.defaultTitle}\n onClose={onClose}\n actions={actions}\n disableCloseOnOverlayClick={type === 'confirm'}\n hideCloseButton={type === 'confirm'}\n >\n {typeof message === 'string' ? <p className='text-sm'>{message}</p> : message}\n </Modal>\n );\n}\n"],"names":["n","t","s","w","C","l","e","g","M","ie","a","x","E","o","c","le","de","ue","K","ce","r","d","u","i","N","he","pe","ge","z","A","He","f","b","$","m","v","h","y","p","T","D","F","L","R","_","J","H","se","ActionModal","type","message","cancelText","confirmText","onConfirm","onClose","destructive","title","modalProps","defaultTexts","useMemo","actions","jsx","Modal"],"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AAc,gBAAgB;AAAA,QACvC,SAAS,MAAM;AACD,UAAAF,KAAA,QAAAA,KACJC,EAAA;AAAA,QAAA;AAAA,MACV;AAAA,IAEJ;AAAA,IACA,CAACI,GAAcH,GAAaF,GAAWC,CAAO;AAAA,EAChD;AAGE,SAAA,gBAAAO;AAAA,IAACC;AAAAA,IAAA;AAAA,MACE,GAAGL;AAAA,MACJ,OAAOD,KAASE,EAAa;AAAA,MAC7B,SAAAJ;AAAA,MACA,SAAAM;AAAA,MACA,4BAA4BX,MAAS;AAAA,MACrC,iBAAiBA,MAAS;AAAA,MAEzB,UAAA,OAAOC,KAAY,WAAW,gBAAAW,EAAC,OAAE,WAAU,WAAW,YAAQ,CAAA,IAAOX;AAAA,IAAA;AAAA,EACxE;AAEJ;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const o=require("react"),n=o.createContext(void 0);function e(){const t=o.useContext(n);if(!t)throw new Error("useActionModal must be used within an ActionModalProvider");return t}exports.ActionModalContext=n;exports.useActionModal=e;
|
|
2
|
+
//# sourceMappingURL=useActionModal-CqT8y2he.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useActionModal-
|
|
1
|
+
{"version":3,"file":"useActionModal-CqT8y2he.cjs","sources":["../src/hooks/useActionModal.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\nimport { ActionModalContextValue } from '../providers';\n\nexport const ActionModalContext = createContext<ActionModalContextValue | undefined>(undefined);\n\nexport function useActionModal(): ActionModalContextValue {\n const context = useContext(ActionModalContext);\n if (!context) {\n throw new Error('useActionModal must be used within an ActionModalProvider');\n }\n return context;\n}\n"],"names":["ActionModalContext","createContext","useActionModal","context","useContext"],"mappings":"sCAGaA,EAAqBC,gBAAmD,MAAS,EAEvF,SAASC,GAA0C,CAClD,MAAAC,EAAUC,aAAWJ,CAAkB,EAC7C,GAAI,CAACG,EACG,MAAA,IAAI,MAAM,2DAA2D,EAEtE,OAAAA,CACT"}
|