@mvr-ui/components 1.0.93 → 1.0.94

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/page.js CHANGED
@@ -1,45 +1,61 @@
1
1
  'use strict';
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
- var Jt = require('react');
5
- var Lr = require('clsx');
4
+ var Xt = require('react');
5
+ var wr = require('clsx');
6
6
  var tailwindMerge = require('tailwind-merge');
7
7
 
8
8
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
9
9
 
10
- var Jt__default = /*#__PURE__*/_interopDefault(Jt);
11
- var Lr__default = /*#__PURE__*/_interopDefault(Lr);
10
+ var Xt__default = /*#__PURE__*/_interopDefault(Xt);
11
+ var wr__default = /*#__PURE__*/_interopDefault(wr);
12
12
 
13
- var Re=({title:e="Ocorreu um erro",message:t,description:r="Algo deu errado ao carregar esta p\xE1gina.",badge:n="Erro",actions:o})=>jsxRuntime.jsx("div",{className:"flex min-h-screen w-full items-center justify-center bg-linear-to-br from-red-50 via-rose-50 to-red-100 px-4 dark:from-red-950 dark:via-zinc-950 dark:to-red-900/30",children:jsxRuntime.jsxs("div",{className:"relative w-full max-w-md rounded-2xl bg-white/90 p-8 text-center shadow-2xl backdrop-blur animate-in fade-in zoom-in-95 dark:bg-zinc-900/90",children:[jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-2xl ring-1 ring-red-200 dark:ring-red-800"}),n&&jsxRuntime.jsx("span",{className:"mb-6 inline-block rounded-full bg-red-100 px-4 py-1 text-xs font-semibold text-red-700 dark:bg-red-900/40 dark:text-red-300",children:n}),jsxRuntime.jsx("div",{className:"mx-auto mb-6 flex h-20 w-20 items-center justify-center rounded-full bg-linear-to-tr from-red-200 to-red-100 text-red-600 shadow-inner dark:from-red-900/40 dark:to-red-800/40 dark:text-red-400",children:jsxRuntime.jsxs("svg",{className:"h-9 w-9 animate-pulse",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("path",{d:"M12 9v4"}),jsxRuntime.jsx("path",{d:"M12 17h.01"}),jsxRuntime.jsx("path",{d:"M5.07 19h13.86c1.54 0 2.5-1.67 1.73-3L13.73 4c-.77-1.33-2.69-1.33-3.46 0L3.34 16c-.77 1.33.19 3 1.73 3z"})]})}),jsxRuntime.jsx("h1",{className:"mb-2 text-2xl font-extrabold text-zinc-900 dark:text-zinc-100",children:e}),jsxRuntime.jsx("p",{className:"mb-2 text-sm font-medium text-red-600 dark:text-red-400",children:t}),r&&jsxRuntime.jsx("p",{className:"mb-6 text-sm text-zinc-600 dark:text-zinc-400",children:r}),o&&o.length>0&&jsxRuntime.jsx("div",{className:"flex flex-col gap-3",children:o.map((i,a)=>{let l=i.variant!=="secondary";return jsxRuntime.jsx("button",{onClick:i.onClick,className:l?"rounded-xl bg-linear-to-r from-red-600 to-red-700 px-5 py-2.5 text-sm font-semibold text-white shadow-lg transition hover:scale-[1.02] hover:shadow-red-600/40 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 dark:focus:ring-offset-zinc-900":"rounded-xl border border-zinc-200 px-5 py-2.5 text-sm font-semibold text-zinc-700 transition hover:bg-zinc-100 dark:border-zinc-700 dark:text-zinc-300 dark:hover:bg-zinc-800",children:i.label},a)})})]})});var Ne=Jt.createContext(void 0),$t=({children:e,licenseKey:t})=>{let[r,n]=Jt.useState(!1),[o,i]=Jt.useState(null),[a,l]=Jt.useState(!0),s=b=>{if(i(null),!b)throw new Error("\u{1F512} Chave de licen\xE7a \xE9 obrigat\xF3ria");let c="chave-secreta-123";if(b!==c)throw new Error("\u274C Chave de licen\xE7a inv\xE1lida");n(!0);};return Jt.useEffect(()=>{if(t){l(!0);try{s(t);}catch(b){i(b instanceof Error?b.message:"Erro desconhecido na valida\xE7\xE3o da licen\xE7a");}finally{l(!1);}}else i("\u{1F512} Licen\xE7a n\xE3o informada"),l(!1);},[t]),a?null:jsxRuntime.jsx(Ne.Provider,{value:{isLicenseValid:r,validateLicense:s,licenseError:o},children:r?e:jsxRuntime.jsx(Re,{badge:"Licen\xE7a necess\xE1ria",title:"Erro de Licen\xE7a",message:o||"Licen\xE7a inv\xE1lida",description:"Sua aplica\xE7\xE3o precisa de uma licen\xE7a v\xE1lida para continuar.",actions:[{label:"Tentar novamente",onClick:()=>window.location.reload()},{label:"Falar com suporte",variant:"secondary",onClick:()=>{window.open("mailto:marcos.vinicius.engsof@gmail.com");}}]})})},Ee=()=>{let e=Jt.useContext(Ne);if(!e)throw new Error("useLicense deve ser usado dentro de um LicenseProvider");return e};var Ve=({message:e="Component locked - Please validate your license"})=>jsxRuntime.jsxs("div",{className:"flex items-start p-4 bg-red-50 border border-red-500 text-red-700 rounded-md gap-2",children:[jsxRuntime.jsx("span",{children:" \u274C Component locked - Please validate your license"}),jsxRuntime.jsx("span",{children:e})]});var g=({children:e})=>{let{isLicenseValid:t}=Ee();return t?jsxRuntime.jsx(jsxRuntime.Fragment,{children:e}):jsxRuntime.jsx(Ve,{})};var Fe=({items:e,type:t="single",defaultValue:r,value:n,onValueChange:o,className:i=""})=>{let a=c=>c===void 0?[]:Array.isArray(c)?c:[c],[l,s]=Jt.useState(a(n??r));Jt.useEffect(()=>{n!==void 0&&s(a(n));},[n]);let b=Jt.useCallback(c=>{s(v=>{let f;return t==="single"?f=v.includes(c)?[]:[c]:f=v.includes(c)?v.filter(d=>d!==c):[...v,c],o?.(t==="single"?f[0]??"":f),f});},[t,o]);return jsxRuntime.jsx("div",{className:`space-y-2 ${i}`,children:e.map(c=>jsxRuntime.jsx(zt,{...c,isOpen:l.includes(c.id),onToggle:()=>b(c.id)},c.id))})},zt=({title:e,content:t,disabled:r=!1,isOpen:n,onToggle:o})=>jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"border border-border rounded-md overflow-hidden",children:[jsxRuntime.jsx("button",{onClick:o,disabled:r,className:`w-full px-4 py-3 text-left font-medium transition-colors
13
+ var Re=({title:e="Ocorreu um erro",message:t,description:r="Algo deu errado ao carregar esta p\xE1gina.",badge:n="Erro",actions:o})=>jsxRuntime.jsx("div",{className:"flex min-h-screen w-full items-center justify-center bg-linear-to-br from-red-50 via-rose-50 to-red-100 px-4 dark:from-red-950 dark:via-zinc-950 dark:to-red-900/30",children:jsxRuntime.jsxs("div",{className:"relative w-full max-w-md rounded-2xl bg-white/90 p-8 text-center shadow-2xl backdrop-blur animate-in fade-in zoom-in-95 dark:bg-zinc-900/90",children:[jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-2xl ring-1 ring-red-200 dark:ring-red-800"}),n&&jsxRuntime.jsx("span",{className:"mb-6 inline-block rounded-full bg-red-100 px-4 py-1 text-xs font-semibold text-red-700 dark:bg-red-900/40 dark:text-red-300",children:n}),jsxRuntime.jsx("div",{className:"mx-auto mb-6 flex h-20 w-20 items-center justify-center rounded-full bg-linear-to-tr from-red-200 to-red-100 text-red-600 shadow-inner dark:from-red-900/40 dark:to-red-800/40 dark:text-red-400",children:jsxRuntime.jsxs("svg",{className:"h-9 w-9 animate-pulse",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("path",{d:"M12 9v4"}),jsxRuntime.jsx("path",{d:"M12 17h.01"}),jsxRuntime.jsx("path",{d:"M5.07 19h13.86c1.54 0 2.5-1.67 1.73-3L13.73 4c-.77-1.33-2.69-1.33-3.46 0L3.34 16c-.77 1.33.19 3 1.73 3z"})]})}),jsxRuntime.jsx("h1",{className:"mb-2 text-2xl font-extrabold text-zinc-900 dark:text-zinc-100",children:e}),jsxRuntime.jsx("p",{className:"mb-2 text-sm font-medium text-red-600 dark:text-red-400",children:t}),r&&jsxRuntime.jsx("p",{className:"mb-6 text-sm text-zinc-600 dark:text-zinc-400",children:r}),o&&o.length>0&&jsxRuntime.jsx("div",{className:"flex flex-col gap-3",children:o.map((i,a)=>{let l=i.variant!=="secondary";return jsxRuntime.jsx("button",{onClick:i.onClick,className:l?"rounded-xl bg-linear-to-r from-red-600 to-red-700 px-5 py-2.5 text-sm font-semibold text-white shadow-lg transition hover:scale-[1.02] hover:shadow-red-600/40 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 dark:focus:ring-offset-zinc-900":"rounded-xl border border-zinc-200 px-5 py-2.5 text-sm font-semibold text-zinc-700 transition hover:bg-zinc-100 dark:border-zinc-700 dark:text-zinc-300 dark:hover:bg-zinc-800",children:i.label},a)})})]})});var ke=(e,t)=>{let r="Problema com licen\xE7a da aplica\xE7\xE3o",n=`
14
+ Ol\xE1,
15
+
16
+ Estou enfrentando um problema com a licen\xE7a da aplica\xE7\xE3o.
17
+
18
+ Erro:
19
+ ${t??"Licen\xE7a inv\xE1lida"}
20
+
21
+ Aguardo retorno.
22
+ `,o=`mailto:${e}?subject=${encodeURIComponent(r)}&body=${encodeURIComponent(n)}`;window.location.href=o;};var Ee=(e,t)=>{let r=`
23
+ Ol\xE1! Estou com um problema de licen\xE7a na aplica\xE7\xE3o.
24
+
25
+ Erro:
26
+ ${t??"Licen\xE7a inv\xE1lida"}
27
+
28
+ Pode me ajudar?
29
+ `,n=`https://wa.me/${e}?text=${encodeURIComponent(r)}`;window.open(n,"_blank");};var Me=Xt.createContext(void 0),Ot=({children:e,licenseKey:t})=>{let[r,n]=Xt.useState(!1),[o,i]=Xt.useState(null),[a,l]=Xt.useState(!0),s=b=>{if(i(null),!b)throw new Error("\u{1F512} Chave de licen\xE7a \xE9 obrigat\xF3ria");let c="chave-secreta-123";if(b!==c)throw new Error("\u274C Chave de licen\xE7a inv\xE1lida");n(!0);};return Xt.useEffect(()=>{if(t){l(!0);try{s(t);}catch(b){i(b instanceof Error?b.message:"Erro desconhecido na valida\xE7\xE3o da licen\xE7a");}finally{l(!1);}}else i("\u{1F512} Licen\xE7a n\xE3o informada"),l(!1);},[t]),a?null:jsxRuntime.jsx(Me.Provider,{value:{isLicenseValid:r,validateLicense:s,licenseError:o},children:r?e:jsxRuntime.jsx(Re,{badge:"Licen\xE7a necess\xE1ria",title:"Erro de Licen\xE7a",message:o||"Licen\xE7a inv\xE1lida",description:"Sua aplica\xE7\xE3o precisa de uma licen\xE7a v\xE1lida para continuar.",actions:[{label:"Tentar novamente",onClick:()=>window.location.reload()},{label:"Falar no WhatsApp",variant:"secondary",onClick:()=>Ee("5544998204407",o)},{label:"Enviar e-mail",variant:"secondary",onClick:()=>ke("marcos.vinicius.engsof@gmail.com",o)}]})})},Ve=()=>{let e=Xt.useContext(Me);if(!e)throw new Error("useLicense deve ser usado dentro de um LicenseProvider");return e};var He=({message:e="Component locked - Please validate your license"})=>jsxRuntime.jsxs("div",{className:"flex items-start p-4 bg-red-50 border border-red-500 text-red-700 rounded-md gap-2",children:[jsxRuntime.jsx("span",{children:" \u274C Component locked - Please validate your license"}),jsxRuntime.jsx("span",{children:e})]});var g=({children:e})=>{let{isLicenseValid:t}=Ve();return t?jsxRuntime.jsx(jsxRuntime.Fragment,{children:e}):jsxRuntime.jsx(He,{})};var Ae=({items:e,type:t="single",defaultValue:r,value:n,onValueChange:o,className:i=""})=>{let a=c=>c===void 0?[]:Array.isArray(c)?c:[c],[l,s]=Xt.useState(a(n??r));Xt.useEffect(()=>{n!==void 0&&s(a(n));},[n]);let b=Xt.useCallback(c=>{s(v=>{let f;return t==="single"?f=v.includes(c)?[]:[c]:f=v.includes(c)?v.filter(d=>d!==c):[...v,c],o?.(t==="single"?f[0]??"":f),f});},[t,o]);return jsxRuntime.jsx("div",{className:`space-y-2 ${i}`,children:e.map(c=>jsxRuntime.jsx(Wt,{...c,isOpen:l.includes(c.id),onToggle:()=>b(c.id)},c.id))})},Wt=({title:e,content:t,disabled:r=!1,isOpen:n,onToggle:o})=>jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"border border-border rounded-md overflow-hidden",children:[jsxRuntime.jsx("button",{onClick:o,disabled:r,className:`w-full px-4 py-3 text-left font-medium transition-colors
14
30
  ${r?"opacity-50 cursor-not-allowed":"hover:bg-accent hover:text-accent-foreground"}
15
31
  ${n?"bg-accent text-accent-foreground":"bg-background text-foreground"}
16
- `,children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{children:e}),jsxRuntime.jsx("svg",{className:`w-5 h-5 transition-transform ${n?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})}),n&&jsxRuntime.jsx("div",{className:"px-4 py-3 bg-background border-t border-border",children:t})]})});Fe.displayName="Accordion";var vn=Fe;function u(...e){return tailwindMerge.twMerge(Lr.clsx(e))}var Se=Jt__default.default.forwardRef(({className:e,overrideClassName:t,variant:r="primary",size:n="md",href:o,children:i,loading:a=!1,loadingContent:l,...s},b)=>{let c="inline-flex items-center justify-center rounded-lg font-medium cursor-pointer active:translate-y-1 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",v={primary:"bg-blue-600 text-white hover:bg-blue-700 shadow-md focus-visible:ring-blue-500",secondary:"bg-gray-600 text-white hover:bg-gray-700 shadow-sm focus-visible:ring-gray-500",tertiary:"bg-purple-600 text-white hover:bg-purple-700 shadow-sm focus-visible:ring-purple-500",destructive:"bg-red-600 text-white hover:bg-red-700 shadow-sm focus-visible:ring-red-500",success:"bg-green-600 text-white hover:bg-green-700 shadow-sm focus-visible:ring-green-500",warning:"bg-amber-500 text-white hover:bg-amber-600 shadow-sm focus-visible:ring-amber-500",info:"bg-cyan-600 text-white hover:bg-cyan-700 shadow-sm focus-visible:ring-cyan-500",accent:"bg-violet-600 text-white hover:bg-violet-700 shadow-sm focus-visible:ring-violet-500",outline:"border border-gray-300 bg-transparent text-gray-700 hover:bg-gray-50 shadow-sm focus-visible:ring-gray-500",ghost:"bg-transparent text-gray-700 hover:bg-gray-100 focus-visible:ring-gray-500",link:"text-blue-600 underline-offset-4 hover:underline bg-transparent p-0 h-auto shadow-none",gradient:"bg-gradient-to-r from-blue-600 to-purple-600 text-white hover:from-blue-700 hover:to-purple-700 shadow-md focus-visible:ring-blue-500",glass:"bg-white/10 backdrop-blur-md border border-white/20 text-black hover:bg-white/20 shadow-sm focus-visible:ring-white/50",soft:"bg-blue-100 text-blue-700 hover:bg-blue-200 shadow-sm focus-visible:ring-blue-500",dark:"bg-gray-900 text-white hover:bg-gray-800 shadow-md focus-visible:ring-gray-500",light:"bg-gray-100 text-gray-900 hover:bg-gray-200 shadow-sm focus-visible:ring-gray-500",obsidian:"bg-black text-white hover:bg-gray-900 shadow-md border border-gray-800 focus-visible:ring-gray-700",polar:"bg-white text-gray-900 hover:bg-gray-50 shadow-md border border-gray-300 focus-visible:ring-gray-400"},f={xs:"h-7 px-2 text-xs min-w-16",sm:"h-9 px-3 text-sm min-w-20",md:"h-10 px-4 py-2 text-base min-w-24",lg:"h-11 px-6 text-lg min-w-28",xl:"h-12 px-8 text-xl min-w-32"},d=t?e:u(c,v[r],f[n],e);return o?jsxRuntime.jsx(g,{children:jsxRuntime.jsx("a",{href:o,className:d,ref:b,children:a&&l?l:i})}):jsxRuntime.jsx(g,{children:jsxRuntime.jsx("button",{className:d,ref:b,...s,children:a&&l?l:i})})});Se.displayName="Button";var Rn=Se;var De=Jt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(g,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:u("rounded-lg border bg-card text-card-foreground shadow-sm",e),...n,children:r})}));De.displayName="Card";var Ae=Jt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(g,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:u("flex flex-col space-y-1.5 p-6",e),...n,children:r})}));Ae.displayName="CardHeader";var $e=Jt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(g,{children:jsxRuntime.jsx("h3",{ref:o,className:t?e:u("text-2xl font-semibold leading-none tracking-tight",e),...n,children:r})}));$e.displayName="CardTitle";var Be=Jt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(g,{children:jsxRuntime.jsx("p",{ref:o,className:t?e:u("text-sm text-muted-foreground",e),...n,children:r})}));Be.displayName="CardDescription";var Oe=Jt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(g,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:u("p-6 pt-0",e),...n,children:r})}));Oe.displayName="CardContent";var Ge=Jt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(g,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:u("flex items-center p-6 pt-0",e),...n,children:r})}));Ge.displayName="CardFooter";var Hn=De,Fn=Ae,Sn=$e,Dn=Be,An=Oe,$n=Ge;var ae=Jt.createContext(void 0),qe=Jt.forwardRef(({children:e,className:t,...r},n)=>{let[o,i]=Jt.useState(!1);return jsxRuntime.jsx(g,{children:jsxRuntime.jsx(ae.Provider,{value:{isOpen:o,setIsOpen:i},children:jsxRuntime.jsx("div",{ref:n,className:u("relative inline-block",t),...r,children:e})})})});qe.displayName="DropdownMenu";var ze=({children:e,asChild:t})=>{let r=Jt.useContext(ae);if(!r)throw new Error("DropdownMenuTrigger must be used within DropdownMenu");let n=()=>r.setIsOpen(!r.isOpen);if(t){let o=e;return Jt.cloneElement(o,{onClick:i=>{o.props.onClick?.(i),n();}})}return jsxRuntime.jsx(g,{children:jsxRuntime.jsx("button",{onClick:n,children:e})})};ze.displayName="DropdownMenuTrigger";var Ue=Jt.forwardRef(({children:e,align:t="end",className:r,...n},o)=>{let i=Jt.useContext(ae),a=Jt.useRef(null);return Jt.useEffect(()=>{o&&(typeof o=="function"?o(a.current):o.current=a.current);},[o]),Jt.useEffect(()=>{let s=b=>{a.current&&!a.current.contains(b.target)&&i?.setIsOpen(!1);};return i?.isOpen&&document.addEventListener("mousedown",s),()=>{document.removeEventListener("mousedown",s);}},[i?.isOpen]),i?.isOpen?jsxRuntime.jsx(g,{children:jsxRuntime.jsx("div",{ref:a,className:u("absolute z-50 mt-2 min-w-32 overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md",{start:"left-0",center:"left-1/2 -translate-x-1/2",end:"right-0"}[t],r),...n,children:e})}):null});Ue.displayName="DropdownMenuContent";var We=Jt.forwardRef(({children:e,onClick:t,destructive:r,className:n,...o},i)=>{let a=Jt.useContext(ae);return jsxRuntime.jsx(g,{children:jsxRuntime.jsx("button",{ref:i,onClick:s=>{t?.(s),a?.setIsOpen(!1);},className:u("w-full text-left px-4 py-2 text-sm hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none",r&&"text-red-600 hover:bg-red-50 hover:text-red-700 focus:bg-red-50 focus:text-red-700",n),...o,children:e})})});We.displayName="DropdownMenuItem";var Je=Jt.forwardRef(({className:e,...t},r)=>jsxRuntime.jsx(g,{children:jsxRuntime.jsx("div",{ref:r,className:u("-mx-1 my-1 h-px bg-border",e),...t})}));Je.displayName="DropdownMenuSeparator";var _e=Jt.forwardRef(({children:e,className:t,...r},n)=>jsxRuntime.jsx(g,{children:jsxRuntime.jsx("div",{ref:n,className:u("px-2 py-1.5 text-sm font-semibold",t),...r,children:e})}));_e.displayName="DropdownMenuLabel";var Un=qe,Wn=ze,Jn=Ue,_n=We,Xn=Je,Zn=_e;var Yt=({children:e,className:t,overrideClassName:r})=>{if(e)return jsxRuntime.jsx(g,{children:jsxRuntime.jsx("p",{className:r?t:u("text-sm text-muted-foreground",t),children:e})})},V=Yt;var Qt=({children:e,required:t,className:r,overrideClassName:n=!1,...o})=>jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("label",{...o,className:n?r:u("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),children:e}),t&&jsxRuntime.jsx("span",{className:"text-red-600",children:"*"})]})}),T=Qt;var tr=({children:e,className:t,overrideClassName:r})=>{if(e)return jsxRuntime.jsx(g,{children:jsxRuntime.jsx("p",{className:r?t:u("text-sm text-red-600 dark:text-red-400",t),children:e})})},I=tr;var je=Jt.forwardRef(({label:e,required:t,option:r,description:n,icon:o,orientation:i="left",className:a,overrideClassName:l=!1,helperText:s,error:b,...c},v)=>{let f=Jt.useId(),d=u("h-4 w-4 rounded border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",b&&"border-destructive",a);return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"space-y-2 w-fit",children:[e&&jsxRuntime.jsx(T,{required:t,children:e}),jsxRuntime.jsxs("div",{className:`flex items-center ${i=="left"?"flex-row":"flex-row-reverse"} w-fit gap-2`,children:[jsxRuntime.jsx("input",{id:f,type:"checkbox",className:l?a:d,ref:v,...c}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{children:o&&o}),jsxRuntime.jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[r&&jsxRuntime.jsx(T,{htmlFor:f,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r}),n&&jsxRuntime.jsx(T,{id:`${f}-description`,htmlFor:f,className:"text-xs text-muted-foreground",children:n})]})]})]}),b&&jsxRuntime.jsx(I,{children:b}),!b&&s&&jsxRuntime.jsx(V,{children:s})]})})});je.displayName="CheckBox";var xo=je;function ir(e,t){let{typeSet:r="field",multiCheck:n=!1,value:o,onChange:i,labelKey:a,valueKey:l,options:s,alignment:b="vertical",className:c,overrideClassName:v=!1,helperText:f,error:d,label:w,name:R,required:h,...y}=e,N=Jt.useId(),L=Jt.useMemo(()=>new Map(s.map(x=>[String(x[l]),x])),[s,l]),M=Jt.useMemo(()=>o==null?[]:r==="field"?n?o.map(x=>String(x)):[String(o)]:n?o.map(x=>String(x[l])):[String(o[l])],[o,r,n,l]),S=(x,P)=>{if(!i)return;let m;if(r==="field")if(n)m=x.map(C=>{let k=L.get(C);return k?k[l]:C});else {let p=x[0];if(!p)m=void 0;else {let C=L.get(p);m=C?C[l]:p;}}else n?m=x.map(C=>L.get(C)).filter(C=>C!==void 0):m=L.get(x[0]??"")??void 0;i({target:{name:R,value:m,type:"checkboxgroup",checked:P}});},H=x=>{let P;n?P=M.includes(x)?M.filter(m=>m!==x):[...M,x]:P=M[0]===x?[]:[x],S(P,P.includes(x));},E=b==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",F=u("h-4 w-4 rounded border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",d&&"border-destructive");return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:u("flex flex-col gap-3",c),children:[w&&jsxRuntime.jsx(T,{required:h,children:w}),jsxRuntime.jsx("div",{className:E,children:s.map((x,P)=>{let m=String(x[l]),p=M.includes(m),C=`${N}-${m}-${P}`;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{...y,id:C,ref:t,type:"checkbox",name:R,checked:p,onChange:()=>H(m),className:v?c:F}),jsxRuntime.jsx(T,{htmlFor:C,children:String(x[a])})]},C)})}),!!d&&jsxRuntime.jsx(I,{children:String(d)}),!d&&f&&jsxRuntime.jsx(V,{children:f})]})})}function sr(){let e=Jt.forwardRef(ir);return e.displayName="CheckBoxGroup",e}var lr=sr(),Eo=lr;var cr=({...e})=>jsxRuntime.jsx("svg",{...e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),se=cr;var mr=(e,t)=>{Jt.useEffect(()=>{let r=n=>{e.current&&!e.current.contains(n.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},tt=mr;function fe({options:e,labelKey:t,valueKey:r,multiple:n,onChange:o,setSearchTerm:i,typeSet:a,name:l}){let[s,b]=Jt.useState([]),c=Jt.useMemo(()=>new Map(e.map(h=>[String(h[r]),h])),[e,r]),v=Jt.useCallback(()=>s.map(h=>c.get(h)).filter(h=>!!h),[s,c]),f=Jt.useCallback(h=>{if(!o)return;let y;if(a==="field"?n?y=h:y=h[0]??void 0:n?y=h.map(L=>c.get(L)).filter(L=>L!==void 0):y=c.get(h[0]??"")??void 0,i&&!n){let N=c.get(h[0]??"");N&&i(String(N[t]));}o({target:{name:l,value:y,type:"combobox"}});},[n,o,c,l,a,i,t]),d=Jt.useCallback(h=>{let y=String(h[r]),N=n?s.includes(y)?s.filter(L=>L!==y):[...s,y]:[y];b(N),f(N);},[n,s,f,r]),w=Jt.useCallback(h=>{let y=s.filter(N=>N!==h);b(y),f(y);},[s,f]),R=Jt.useCallback(()=>{b([]),i?.("");let h;a==="field"?h=n?[]:"":h=n?[]:void 0,o?.({target:{name:l,value:h,type:"combobox"}});},[n,o,l,i,a]);return {selectedValues:s,handleSelect:d,handleRemove:w,handleClear:R,getSelectedOptions:v}}function ge(e,t,r){return Jt.useMemo(()=>r?e.filter(o=>String(o[t]).toLowerCase().includes(r.toLowerCase())):e,[e,r,t])}var nt=({isOpen:e,setIsOpen:t,multiple:r,searchTerm:n,setSearchTerm:o,selectedValues:i,filteredOptions:a,highlightedIndex:l,setHighlightedIndex:s,handleSelect:b,handleRemove:c})=>{let v=Jt.useCallback(d=>{if(a.length===0){s(-1);return}s(w=>w<0?d>0?0:a.length-1:(w+d+a.length)%a.length);},[a,s]);return Jt.useCallback(d=>{if(!e){if(d.key==="Enter"||d.key==="ArrowDown"){t(!0),s(0),d.preventDefault();return}r&&d.key==="Backspace"&&n===""&&i.length>0&&(d.preventDefault(),c(i[i.length-1]));return}switch(d.key){case"ArrowDown":d.preventDefault(),v(1);break;case"ArrowUp":d.preventDefault(),v(-1);break;case"Enter":d.preventDefault();let w=l>=0?l:0,R=a[w];R&&b(R),r&&o&&o(""),r||(t(!1),s(-1));break;case"Escape":d.preventDefault(),t(!1),s(-1),r||o("");break;case"Tab":t(!1),s(-1);break;case"Home":d.preventDefault(),a.length>0&&s(0);break;case"End":d.preventDefault(),a.length>0&&s(a.length-1);break;case"Backspace":r&&n===""&&i.length>0&&(d.preventDefault(),c(i[i.length-1]));break}},[e,r,n,i,a,l,t,o,s,b,c,v])};function ot({option:e,labelKey:t,valueKey:r,onRemove:n}){let o=String(e[t]),i=String(e[r]);return jsxRuntime.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded",children:[o,jsxRuntime.jsx("button",{type:"button",onMouseDown:a=>a.preventDefault(),onClick:()=>n(i),className:"hover:bg-blue-200 dark:hover:bg-blue-800 rounded-full p-0.5 transition-colors","aria-label":`Remover ${o}`,children:"\u2715"})]},i)}function Cr(e,t){let{label:r,required:n=!1,name:o,placeholder:i="Buscar...",labelKey:a,valueKey:l,options:s,value:b,onChange:c,mode:v="single",typeSet:f="field",disabled:d=!1,ClearEnabled:w=!0,helperText:R,error:h=!1,className:y="",...N}=e,L=v==="multiple",[M,S]=Jt.useState(!1),[H,E]=Jt.useState(""),F=Jt.useRef(null),x=Jt.useRef(null),P=Jt.useRef(null);Jt.useImperativeHandle(t,()=>P.current),tt(x,()=>S(!1));let m=ge(s,a,H),[p,C]=Jt.useState(-1),{selectedValues:k,handleSelect:Y,handleRemove:Le,handleClear:Mt,getSelectedOptions:Pe}=fe({options:s,labelKey:a,valueKey:l,value:b,multiple:L,onChange:c,typeSet:f,name:o,setSearchTerm:E}),Vt=nt({isOpen:M,setIsOpen:S,multiple:L,searchTerm:H,setSearchTerm:E,selectedValues:k,filteredOptions:m,highlightedIndex:p,setHighlightedIndex:C,handleSelect:Y,handleRemove:Le}),Q=Jt.useId(),It="w-full bg-transparent outline-none placeholder:text-gray-500 dark:placeholder:text-gray-400 text-gray-900 dark:text-gray-100",Ht=u("relative w-full min-h-[40px] px-3 py-2 border rounded-md bg-white dark:bg-gray-800",h?"border-red-500":"border-gray-300 dark:border-gray-600",d?"opacity-50 cursor-not-allowed":"cursor-text","focus-within:ring-2 focus-within:ring-blue-500 focus-within:border-blue-500");return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:`space-y-2 ${y}`,children:[r&&jsxRuntime.jsx(T,{htmlFor:Q,required:n,children:r}),jsxRuntime.jsxs("div",{ref:F,className:"relative",children:[jsxRuntime.jsxs("div",{className:Ht,children:[L&&Pe().length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:Pe().map(($,G)=>jsxRuntime.jsx(ot,{option:$,labelKey:a,valueKey:l,onRemove:Le},String($[l]??G)))}),jsxRuntime.jsx("input",{ref:P,...N,name:o,type:"text",placeholder:i,value:H,onChange:$=>{let G=$.target.value;E(G),!M&&G.trim()!==""&&S(!0);},onKeyDown:Vt,onMouseDown:$=>{document.activeElement===P.current&&($.preventDefault(),S(G=>{let ee=!G;return ee&&C(0),ee}));},onFocus:()=>{S(!0),C(0);},disabled:d,className:It,role:"combobox","aria-expanded":M,"aria-controls":Q,"aria-activedescendant":p>=0?`${Q}-opt-${p}`:void 0}),w&&!!k.length&&jsxRuntime.jsx("button",{type:"button",onMouseDown:$=>$.preventDefault(),onClick:Mt,className:"absolute right-2 top-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 p-1 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700",title:"Limpar sele\xE7\xE3o",children:jsxRuntime.jsx(se,{width:12,height:12})})]}),M&&jsxRuntime.jsx("div",{ref:x,id:Q,className:"absolute z-50 w-full mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-auto",role:"listbox","aria-multiselectable":L||void 0,children:m.length===0?jsxRuntime.jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400",children:"Nenhum resultado encontrado"}):m.map(($,G)=>{let ee=String($[l]),ce=k.includes(ee),de=G===p;return jsxRuntime.jsx("button",{id:`${Q}-opt-${G}`,"data-index":G,role:"option","aria-selected":ce,type:"button",onMouseDown:Ft=>Ft.preventDefault(),onClick:()=>Y($),className:u("w-full px-3 py-2 text-left text-sm transition-colors",de&&"bg-blue-100 dark:bg-blue-800 text-blue-900 dark:text-white",!de&&ce&&"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300",!ce&&!de&&"text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),children:jsxRuntime.jsx("span",{children:String($[a])})},ee)})})]}),h&&jsxRuntime.jsx(I,{children:h}),!h&&R&&jsxRuntime.jsx(V,{children:R})]})})}function Tr(){let e=Jt.forwardRef(Cr);return e.displayName="ComboBox",e}var yr=Tr(),oa=yr;var Pr=({children:e,before:t,after:r,className:n})=>{let i=Lr__default.default("flex justify-center items-center",{"rounded-l-lg":t,"rounded-r-lg":r},n);return jsxRuntime.jsx("div",{className:i,children:jsxRuntime.jsx("span",{children:e})})},he=Pr;var wr=({children:e})=>jsxRuntime.jsx("div",{className:"absolute px-2",children:jsxRuntime.jsx("span",{children:e})}),st=wr;var Rr=({children:e})=>jsxRuntime.jsx("div",{className:"absolute right-0 px-2",children:jsxRuntime.jsx("span",{children:e})}),ct=Rr;function dt(e){e.currentTarget.maxLength=9;let t=e.currentTarget.value;return t=t.replace(/\D/g,""),t=t.replace(/^(\d{5})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function mt(e){let t=e.currentTarget.value;t=t.replace(/\D/g,""),t=t.padStart(3,"0");let r=t.slice(0,-2),n=t.slice(-2),a=`${(r.replace(/^0+/,"")||"0").replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1.")},${n}`;return e.currentTarget.value=a,e}function pt(e){e.currentTarget.maxLength=14;let t=e.currentTarget.value;return t.match(/^(\d{3}).(\d{3}).(\d{3})-(\d{2})$/)||(t=t.replace(/\D/g,""),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{2})$/,"$1-$2"),e.currentTarget.value=t),e}function ut(e){e.currentTarget.maxLength=15;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"($1) $2"),t=t.replace(/(\d{5})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function ft(e){e.currentTarget.maxLength=14;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"($1) $2"),t=t.replace(/(\d{4})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function gt(e){let t=e.currentTarget.value.replace(/\D/g,"");return t.length<=11?(e.currentTarget.maxLength=14,t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{2})$/,"$1-$2")):(e.currentTarget.maxLength=18,t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2")),e.currentTarget.value=t,e}function bt(e){e.currentTarget.maxLength=12;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{1})$/,"$1-$2"),e.currentTarget.value=t,e}function vt(e){e.currentTarget.maxLength=18;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2"),e.currentTarget.value=t,e}var kr=({e,mask:t})=>{switch(t){case"money":return mt(e);case"mobile":return ut(e);case"phone":return ft(e);case"cpfCnpj":return gt(e);case"cpf":return pt(e);case"rg":return bt(e);case"cnpj":return vt(e);case"cep":return dt(e);default:return e}},xt=kr;var Mr=({mask:e,initialValue:t=""})=>{let[r,n]=Jt.useState(t);Jt.useEffect(()=>{t!==r&&n(t);},[t]);let o=Jt.useCallback(a=>{let s=xt({e:a,mask:e})?.currentTarget?.value??a.currentTarget.value;n(s);},[e]),i=Jt.useCallback(()=>n(""),[]);return {value:r,setValue:n,handleChange:o,handleClear:i}},Ct=Mr;var Tt=Jt.forwardRef(({label:e,required:t=!1,mask:r,name:n,prefix:o,suffix:i,addonBefore:a,addonBeforeClassName:l,addonAfter:s,addonAfterClassName:b,ClearEnabled:c=!0,className:v,overrideClassName:f=!1,error:d,helperText:w,value:R=void 0,onChange:h,...y},N)=>{let L=Jt.useId(),{handleChange:M,handleClear:S,setValue:H}=Ct({mask:r,initialValue:R}),E=u("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",d&&"border-destructive focus-visible:ring-destructive",!o&&!i&&"px-3",o&&!i&&"pl-10 pr-3",i&&!o&&"pl-3 pr-10",o&&i&&"pl-10 pr-10",a&&"rounded-l-none border-l-0",s&&"rounded-r-none border-r-0",v),F=P=>{M(P),h?.(P);},x=()=>{S(),H(""),h?.({target:{name:n||"",value:""}});};return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsxRuntime.jsx(T,{htmlFor:L,required:t,children:e}),jsxRuntime.jsxs("div",{className:"relative flex",children:[a&&jsxRuntime.jsx(he,{before:!0,className:l,children:a}),jsxRuntime.jsxs("div",{className:"relative flex items-center w-full",children:[o&&jsxRuntime.jsx(st,{children:o}),jsxRuntime.jsx("input",{id:L,ref:N,name:n,onChange:F,className:f?v:E,...y}),c&&R&&jsxRuntime.jsx(se,{onClick:x,width:12,height:12,className:u("absolute right-2 cursor-pointer",i&&"right-8")}),i&&jsxRuntime.jsx(ct,{children:i})]}),s&&jsxRuntime.jsx(he,{after:!0,className:b,children:s})]}),d&&jsxRuntime.jsx(I,{children:d}),!d&&w&&jsxRuntime.jsx(V,{children:w})]})})});Tt.displayName="Input";var Va=Tt;var Lt=Jt.forwardRef(({length:e=6,groupBy:t,value:r,name:n,label:o,required:i=!1,helperText:a,error:l,onChange:s,onBlur:b,className:c,charType:v="numeric",customPattern:f,caseMode:d="none",...w},R)=>{let h=Jt.useId(),y=Jt.useRef([]),N=m=>{switch(d){case"upper":return m.toUpperCase();case"lower":case"visual-upper":return m.toLowerCase();case"visual-lower":return m.toUpperCase();default:return m}},L=m=>{if(!m)return "";let p=m.slice(0,1);switch(p=N(p),v){case"numeric":return /\d/.test(p)?p:"";case"alpha":return /[A-Za-z]/.test(p)?p:"";case"alphanumeric":return /[A-Za-z0-9]/.test(p)?p:"";case"custom":return f?.test(p)?p:"";default:return p}},M=()=>(r!=null?String(r):"").split("").map(L).slice(0,e),S=M().concat(Array(e).fill(" ")).slice(0,e),H=m=>{let p=m.split("").map(L).join("").slice(0,e),C=p===""?void 0:typeof r=="number"?Number(p):p;s?.({target:{name:n,value:C}});},E=(m,p)=>{let C=L(p),k=M();if(C===""){k[m]="",H(k.join(""));return}if(p.length>1){let Y=p.split("").map(L).join("").slice(0,e);H(Y),y.current[Math.min(Y.length-1,e-1)]?.focus();return}C&&(k[m]=C,H(k.join("")),m<e-1&&y.current[m+1]?.focus());},F=m=>{let p=M();!p[m]&&m>0?p[m-1]="":p[m]="",H(p.join("")),m>0&&y.current[m-1]?.focus();},x=m=>{m.preventDefault();let C=m.clipboardData.getData("text").split("").map(L).join("").slice(0,e);C&&(H(C),y.current[Math.min(C.length-1,e-1)]?.focus());},P=m=>{switch(d){case"upper":case"visual-upper":return m.toUpperCase();case"lower":case"visual-lower":return m.toLowerCase();default:return m}};return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[o&&jsxRuntime.jsx(T,{htmlFor:h,required:i,children:o}),jsxRuntime.jsx("div",{className:u("flex gap-3 items-center",l&&"text-red-500",c),...w,children:S.map((m,p)=>{let C=t&&p>0&&p%t===0;return jsxRuntime.jsxs(Jt__default.default.Fragment,{children:[C&&jsxRuntime.jsx("span",{className:"flex items-center justify-center text-xl font-bold select-none",children:"-"}),jsxRuntime.jsx("input",{id:h,type:"text",maxLength:1,inputMode:v==="numeric"?"numeric":"text",value:P(m).trim(),ref:k=>{y.current[p]=k,p===0&&R&&(typeof R=="function"?R(k):typeof R=="object"&&(R.current=k));},onPaste:x,onChange:k=>E(p,k.target.value),onKeyDown:k=>k.key==="Backspace"&&F(p),onBlur:b,className:u("h-14 w-12 text-center text-2xl rounded-md border border-input bg-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",l&&"border-red-500")})]},p)})}),l&&jsxRuntime.jsx(I,{children:l}),!l&&a&&jsxRuntime.jsx(V,{children:a})]})})});Lt.displayName="OtpInput";var Oa=Lt;var Pt=Jt.forwardRef(({label:e,required:t,option:r,description:n,icon:o,className:i,overrideClassName:a,helperText:l,error:s,...b},c)=>{let v=Jt.useId(),f=u("h-4 w-4 border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s&&"border-destructive",i);return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"space-y-3",children:[e&&jsxRuntime.jsx(T,{required:t,children:e}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{id:v,type:"radio",className:a?i:f,ref:c,...b}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{children:o&&o}),jsxRuntime.jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[r&&jsxRuntime.jsx(T,{htmlFor:v,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r}),n&&jsxRuntime.jsx(T,{id:`${v}-description`,htmlFor:v,className:"text-xs text-muted-foreground",children:n})]})]})]}),s&&jsxRuntime.jsx(I,{children:s}),!s&&l&&jsxRuntime.jsx(V,{children:l})]})})});Pt.displayName="Radio";var Xa=Pt;function Gr(e,t){let{label:r,required:n,name:o,labelKey:i,valueKey:a,options:l,alignment:s="vertical",className:b,overrideClassName:c=!1,helperText:v,error:f,typeSet:d="field",value:w,onChange:R,...h}=e,y=Jt.useId(),N=Jt.useMemo(()=>new Map(l.map(E=>[String(E[a]),E])),[l,a]),L=Jt.useMemo(()=>w==null?"":String(d==="field"?w:w[a]),[w,d,a]),M=E=>{if(!R)return;let F;if(d==="field"){let x=N.get(E);if(x)F=x[a];else {let P=Number(E);F=Number.isNaN(P)?E:P;}}else F=N.get(E)??void 0;R({target:{name:o,value:F,type:"radiogroup",checked:!0}});},S=s==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",H=u("h-4 w-4 rounded-full border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",f&&"border-destructive");return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:u("flex flex-col gap-3",b),children:[r&&jsxRuntime.jsx(T,{required:n,children:r}),jsxRuntime.jsx("div",{className:S,children:l.map((E,F)=>{let x=String(E[a]),P=`${y}-${x}-${F}`;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{...h,id:P,ref:t,name:o,type:"radio",checked:L===x,onChange:()=>M(x),className:c?b:H}),jsxRuntime.jsx(T,{htmlFor:P,children:String(E[i])})]},P)})}),f&&jsxRuntime.jsx(I,{children:String(f)}),!f&&v&&jsxRuntime.jsx(V,{children:v})]})})}function Kr(){let e=Jt.forwardRef(Gr);return e.displayName="RadioGroup",e}var qr=Kr(),ii=qr;function Wr({label:e,required:t=!1,options:r,labelKey:n,valueKey:o,placeholder:i,error:a,helperText:l,className:s,...b},c){let v=Jt.useId(),f=u("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",s);return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(T,{htmlFor:v,required:t,children:e}),jsxRuntime.jsxs("select",{id:v,ref:c,className:f,...b,children:[i&&jsxRuntime.jsx("option",{value:"",disabled:!0,children:i}),r.map((d,w)=>jsxRuntime.jsx("option",{value:String(d[o]),children:String(d[n])},w))]}),a&&jsxRuntime.jsx(I,{children:a}),!a&&l&&jsxRuntime.jsx(V,{children:l})]})})}function Jr(){let e=Jt.forwardRef(Wr);return e.displayName="Select",e}var _r=Jr(),vi=_r;var Nt=Jt.forwardRef(({label:e,required:t,option:r,description:n,icon:o,checked:i=!1,className:a,overrideClassName:l,error:s,name:b,...c},v)=>{let f=Jt.useId();return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"flex flex-col gap-2",children:[e&&jsxRuntime.jsx(T,{required:t,children:e}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:f,name:b,checked:i,className:"peer sr-only",ref:v,...c}),jsxRuntime.jsx("label",{htmlFor:f,className:u("relative flex items-center h-6 w-11 cursor-pointer rounded-full bg-input transition-colors duration-200","peer-checked:bg-primary peer-focus:ring-2 peer-focus:ring-ring peer-focus:ring-offset-2 peer-focus:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50",a),children:jsxRuntime.jsx("span",{className:u("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",i?"translate-x-5":"translate-x-1")})}),jsxRuntime.jsx("span",{children:o&&o}),(r||n)&&jsxRuntime.jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[e&&jsxRuntime.jsx(T,{id:`${f}-label`,htmlFor:f,className:"text-sm font-medium leading-none",children:r}),n&&jsxRuntime.jsx(T,{id:`${f}-description`,htmlFor:f,className:"text-xs text-muted-foreground",children:n})]})]})]})})});Nt.displayName="Switch";var wi=Nt;var Et=Jt__default.default.forwardRef(({label:e,required:t,showCount:r,maxLength:n,className:o,overrideClassName:i=!1,error:a,helperText:l,...s},b)=>{let c=Jt.useId(),[v,f]=Jt.useState(0),d=u("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",o);return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(T,{htmlFor:c,required:t,children:e}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("textarea",{id:c,className:i?o:d,maxLength:n,onInput:w=>f(w.currentTarget.textLength),ref:b,...s}),r&&jsxRuntime.jsxs("span",{className:"absolute bottom-2 right-3 text-xs text-muted-foreground",children:[v,n?` / ${n}`:""]})]}),a&&jsxRuntime.jsx(I,{children:a}),!a&&l&&jsxRuntime.jsx(V,{children:l})]})})});Et.displayName="TextArea";var Fi=Et;
17
-
18
- exports.AccordionPrimitive = vn;
19
- exports.ButtonPrimitive = Rn;
20
- exports.CardContentPrimitive = An;
21
- exports.CardDescriptionPrimitive = Dn;
22
- exports.CardFooterPrimitive = $n;
23
- exports.CardHeaderPrimitive = Fn;
24
- exports.CardPrimitive = Hn;
25
- exports.CardTitlePrimitive = Sn;
26
- exports.CheckBoxGroupPrimitive = Eo;
27
- exports.CheckBoxPrimitive = xo;
28
- exports.ComboBoxPrimitive = oa;
29
- exports.DropdownMenuContentPrimitive = Jn;
30
- exports.DropdownMenuItemPrimitive = _n;
31
- exports.DropdownMenuLabelPrimitive = Zn;
32
- exports.DropdownMenuPrimitive = Un;
33
- exports.DropdownMenuSeparatorPrimitive = Xn;
34
- exports.DropdownMenuTriggerPrimitive = Wn;
32
+ `,children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{children:e}),jsxRuntime.jsx("svg",{className:`w-5 h-5 transition-transform ${n?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})}),n&&jsxRuntime.jsx("div",{className:"px-4 py-3 bg-background border-t border-border",children:t})]})});Ae.displayName="Accordion";var Ln=Ae;function u(...e){return tailwindMerge.twMerge(wr.clsx(e))}var De=Xt__default.default.forwardRef(({className:e,overrideClassName:t,variant:r="primary",size:n="md",href:o,children:i,loading:a=!1,loadingContent:l,...s},b)=>{let c="inline-flex items-center justify-center rounded-lg font-medium cursor-pointer active:translate-y-1 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",v={primary:"bg-blue-600 text-white hover:bg-blue-700 shadow-md focus-visible:ring-blue-500",secondary:"bg-gray-600 text-white hover:bg-gray-700 shadow-sm focus-visible:ring-gray-500",tertiary:"bg-purple-600 text-white hover:bg-purple-700 shadow-sm focus-visible:ring-purple-500",destructive:"bg-red-600 text-white hover:bg-red-700 shadow-sm focus-visible:ring-red-500",success:"bg-green-600 text-white hover:bg-green-700 shadow-sm focus-visible:ring-green-500",warning:"bg-amber-500 text-white hover:bg-amber-600 shadow-sm focus-visible:ring-amber-500",info:"bg-cyan-600 text-white hover:bg-cyan-700 shadow-sm focus-visible:ring-cyan-500",accent:"bg-violet-600 text-white hover:bg-violet-700 shadow-sm focus-visible:ring-violet-500",outline:"border border-gray-300 bg-transparent text-gray-700 hover:bg-gray-50 shadow-sm focus-visible:ring-gray-500",ghost:"bg-transparent text-gray-700 hover:bg-gray-100 focus-visible:ring-gray-500",link:"text-blue-600 underline-offset-4 hover:underline bg-transparent p-0 h-auto shadow-none",gradient:"bg-gradient-to-r from-blue-600 to-purple-600 text-white hover:from-blue-700 hover:to-purple-700 shadow-md focus-visible:ring-blue-500",glass:"bg-white/10 backdrop-blur-md border border-white/20 text-black hover:bg-white/20 shadow-sm focus-visible:ring-white/50",soft:"bg-blue-100 text-blue-700 hover:bg-blue-200 shadow-sm focus-visible:ring-blue-500",dark:"bg-gray-900 text-white hover:bg-gray-800 shadow-md focus-visible:ring-gray-500",light:"bg-gray-100 text-gray-900 hover:bg-gray-200 shadow-sm focus-visible:ring-gray-500",obsidian:"bg-black text-white hover:bg-gray-900 shadow-md border border-gray-800 focus-visible:ring-gray-700",polar:"bg-white text-gray-900 hover:bg-gray-50 shadow-md border border-gray-300 focus-visible:ring-gray-400"},f={xs:"h-7 px-2 text-xs min-w-16",sm:"h-9 px-3 text-sm min-w-20",md:"h-10 px-4 py-2 text-base min-w-24",lg:"h-11 px-6 text-lg min-w-28",xl:"h-12 px-8 text-xl min-w-32"},d=t?e:u(c,v[r],f[n],e);return o?jsxRuntime.jsx(g,{children:jsxRuntime.jsx("a",{href:o,className:d,ref:b,children:a&&l?l:i})}):jsxRuntime.jsx(g,{children:jsxRuntime.jsx("button",{className:d,ref:b,...s,children:a&&l?l:i})})});De.displayName="Button";var In=De;var $e=Xt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(g,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:u("rounded-lg border bg-card text-card-foreground shadow-sm",e),...n,children:r})}));$e.displayName="Card";var Be=Xt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(g,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:u("flex flex-col space-y-1.5 p-6",e),...n,children:r})}));Be.displayName="CardHeader";var Oe=Xt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(g,{children:jsxRuntime.jsx("h3",{ref:o,className:t?e:u("text-2xl font-semibold leading-none tracking-tight",e),...n,children:r})}));Oe.displayName="CardTitle";var Ge=Xt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(g,{children:jsxRuntime.jsx("p",{ref:o,className:t?e:u("text-sm text-muted-foreground",e),...n,children:r})}));Ge.displayName="CardDescription";var Ke=Xt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(g,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:u("p-6 pt-0",e),...n,children:r})}));Ke.displayName="CardContent";var Ue=Xt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(g,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:u("flex items-center p-6 pt-0",e),...n,children:r})}));Ue.displayName="CardFooter";var Bn=$e,On=Be,Gn=Oe,Kn=Ge,Un=Ke,qn=Ue;var ae=Xt.createContext(void 0),ze=Xt.forwardRef(({children:e,className:t,...r},n)=>{let[o,i]=Xt.useState(!1);return jsxRuntime.jsx(g,{children:jsxRuntime.jsx(ae.Provider,{value:{isOpen:o,setIsOpen:i},children:jsxRuntime.jsx("div",{ref:n,className:u("relative inline-block",t),...r,children:e})})})});ze.displayName="DropdownMenu";var We=({children:e,asChild:t})=>{let r=Xt.useContext(ae);if(!r)throw new Error("DropdownMenuTrigger must be used within DropdownMenu");let n=()=>r.setIsOpen(!r.isOpen);if(t){let o=e;return Xt.cloneElement(o,{onClick:i=>{o.props.onClick?.(i),n();}})}return jsxRuntime.jsx(g,{children:jsxRuntime.jsx("button",{onClick:n,children:e})})};We.displayName="DropdownMenuTrigger";var _e=Xt.forwardRef(({children:e,align:t="end",className:r,...n},o)=>{let i=Xt.useContext(ae),a=Xt.useRef(null);return Xt.useEffect(()=>{o&&(typeof o=="function"?o(a.current):o.current=a.current);},[o]),Xt.useEffect(()=>{let s=b=>{a.current&&!a.current.contains(b.target)&&i?.setIsOpen(!1);};return i?.isOpen&&document.addEventListener("mousedown",s),()=>{document.removeEventListener("mousedown",s);}},[i?.isOpen]),i?.isOpen?jsxRuntime.jsx(g,{children:jsxRuntime.jsx("div",{ref:a,className:u("absolute z-50 mt-2 min-w-32 overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md",{start:"left-0",center:"left-1/2 -translate-x-1/2",end:"right-0"}[t],r),...n,children:e})}):null});_e.displayName="DropdownMenuContent";var Je=Xt.forwardRef(({children:e,onClick:t,destructive:r,className:n,...o},i)=>{let a=Xt.useContext(ae);return jsxRuntime.jsx(g,{children:jsxRuntime.jsx("button",{ref:i,onClick:s=>{t?.(s),a?.setIsOpen(!1);},className:u("w-full text-left px-4 py-2 text-sm hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none",r&&"text-red-600 hover:bg-red-50 hover:text-red-700 focus:bg-red-50 focus:text-red-700",n),...o,children:e})})});Je.displayName="DropdownMenuItem";var Xe=Xt.forwardRef(({className:e,...t},r)=>jsxRuntime.jsx(g,{children:jsxRuntime.jsx("div",{ref:r,className:u("-mx-1 my-1 h-px bg-border",e),...t})}));Xe.displayName="DropdownMenuSeparator";var je=Xt.forwardRef(({children:e,className:t,...r},n)=>jsxRuntime.jsx(g,{children:jsxRuntime.jsx("div",{ref:n,className:u("px-2 py-1.5 text-sm font-semibold",t),...r,children:e})}));je.displayName="DropdownMenuLabel";var Zn=ze,Yn=We,Qn=_e,eo=Je,to=Xe,ro=je;var er=({children:e,className:t,overrideClassName:r})=>{if(e)return jsxRuntime.jsx(g,{children:jsxRuntime.jsx("p",{className:r?t:u("text-sm text-muted-foreground",t),children:e})})},V=er;var tr=({children:e,required:t,className:r,overrideClassName:n=!1,...o})=>jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("label",{...o,className:n?r:u("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),children:e}),t&&jsxRuntime.jsx("span",{className:"text-red-600",children:"*"})]})}),y=tr;var nr=({children:e,className:t,overrideClassName:r})=>{if(e)return jsxRuntime.jsx(g,{children:jsxRuntime.jsx("p",{className:r?t:u("text-sm text-red-600 dark:text-red-400",t),children:e})})},I=nr;var Qe=Xt.forwardRef(({label:e,required:t,option:r,description:n,icon:o,orientation:i="left",className:a,overrideClassName:l=!1,helperText:s,error:b,...c},v)=>{let f=Xt.useId(),d=u("h-4 w-4 rounded border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",b&&"border-destructive",a);return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"space-y-2 w-fit",children:[e&&jsxRuntime.jsx(y,{required:t,children:e}),jsxRuntime.jsxs("div",{className:`flex items-center ${i=="left"?"flex-row":"flex-row-reverse"} w-fit gap-2`,children:[jsxRuntime.jsx("input",{id:f,type:"checkbox",className:l?a:d,ref:v,...c}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{children:o&&o}),jsxRuntime.jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[r&&jsxRuntime.jsx(y,{htmlFor:f,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r}),n&&jsxRuntime.jsx(y,{id:`${f}-description`,htmlFor:f,className:"text-xs text-muted-foreground",children:n})]})]})]}),b&&jsxRuntime.jsx(I,{children:b}),!b&&s&&jsxRuntime.jsx(V,{children:s})]})})});Qe.displayName="CheckBox";var Po=Qe;function lr(e,t){let{typeSet:r="field",multiCheck:n=!1,value:o,onChange:i,labelKey:a,valueKey:l,options:s,alignment:b="vertical",className:c,overrideClassName:v=!1,helperText:f,error:d,label:w,name:R,required:h,...T}=e,E=Xt.useId(),L=Xt.useMemo(()=>new Map(s.map(x=>[String(x[l]),x])),[s,l]),M=Xt.useMemo(()=>o==null?[]:r==="field"?n?o.map(x=>String(x)):[String(o)]:n?o.map(x=>String(x[l])):[String(o[l])],[o,r,n,l]),S=(x,P)=>{if(!i)return;let m;if(r==="field")if(n)m=x.map(C=>{let k=L.get(C);return k?k[l]:C});else {let p=x[0];if(!p)m=void 0;else {let C=L.get(p);m=C?C[l]:p;}}else n?m=x.map(C=>L.get(C)).filter(C=>C!==void 0):m=L.get(x[0]??"")??void 0;i({target:{name:R,value:m,type:"checkboxgroup",checked:P}});},H=x=>{let P;n?P=M.includes(x)?M.filter(m=>m!==x):[...M,x]:P=M[0]===x?[]:[x],S(P,P.includes(x));},N=b==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",F=u("h-4 w-4 rounded border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",d&&"border-destructive");return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:u("flex flex-col gap-3",c),children:[w&&jsxRuntime.jsx(y,{required:h,children:w}),jsxRuntime.jsx("div",{className:N,children:s.map((x,P)=>{let m=String(x[l]),p=M.includes(m),C=`${E}-${m}-${P}`;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{...T,id:C,ref:t,type:"checkbox",name:R,checked:p,onChange:()=>H(m),className:v?c:F}),jsxRuntime.jsx(y,{htmlFor:C,children:String(x[a])})]},C)})}),!!d&&jsxRuntime.jsx(I,{children:String(d)}),!d&&f&&jsxRuntime.jsx(V,{children:f})]})})}function cr(){let e=Xt.forwardRef(lr);return e.displayName="CheckBoxGroup",e}var dr=cr(),So=dr;var mr=({...e})=>jsxRuntime.jsx("svg",{...e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),se=mr;var ur=(e,t)=>{Xt.useEffect(()=>{let r=n=>{e.current&&!e.current.contains(n.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},nt=ur;function fe({options:e,labelKey:t,valueKey:r,multiple:n,onChange:o,setSearchTerm:i,typeSet:a,name:l}){let[s,b]=Xt.useState([]),c=Xt.useMemo(()=>new Map(e.map(h=>[String(h[r]),h])),[e,r]),v=Xt.useCallback(()=>s.map(h=>c.get(h)).filter(h=>!!h),[s,c]),f=Xt.useCallback(h=>{if(!o)return;let T;if(a==="field"?n?T=h:T=h[0]??void 0:n?T=h.map(L=>c.get(L)).filter(L=>L!==void 0):T=c.get(h[0]??"")??void 0,i&&!n){let E=c.get(h[0]??"");E&&i(String(E[t]));}o({target:{name:l,value:T,type:"combobox"}});},[n,o,c,l,a,i,t]),d=Xt.useCallback(h=>{let T=String(h[r]),E=n?s.includes(T)?s.filter(L=>L!==T):[...s,T]:[T];b(E),f(E);},[n,s,f,r]),w=Xt.useCallback(h=>{let T=s.filter(E=>E!==h);b(T),f(T);},[s,f]),R=Xt.useCallback(()=>{b([]),i?.("");let h;a==="field"?h=n?[]:"":h=n?[]:void 0,o?.({target:{name:l,value:h,type:"combobox"}});},[n,o,l,i,a]);return {selectedValues:s,handleSelect:d,handleRemove:w,handleClear:R,getSelectedOptions:v}}function ge(e,t,r){return Xt.useMemo(()=>r?e.filter(o=>String(o[t]).toLowerCase().includes(r.toLowerCase())):e,[e,r,t])}var at=({isOpen:e,setIsOpen:t,multiple:r,searchTerm:n,setSearchTerm:o,selectedValues:i,filteredOptions:a,highlightedIndex:l,setHighlightedIndex:s,handleSelect:b,handleRemove:c})=>{let v=Xt.useCallback(d=>{if(a.length===0){s(-1);return}s(w=>w<0?d>0?0:a.length-1:(w+d+a.length)%a.length);},[a,s]);return Xt.useCallback(d=>{if(!e){if(d.key==="Enter"||d.key==="ArrowDown"){t(!0),s(0),d.preventDefault();return}r&&d.key==="Backspace"&&n===""&&i.length>0&&(d.preventDefault(),c(i[i.length-1]));return}switch(d.key){case"ArrowDown":d.preventDefault(),v(1);break;case"ArrowUp":d.preventDefault(),v(-1);break;case"Enter":d.preventDefault();let w=l>=0?l:0,R=a[w];R&&b(R),r&&o&&o(""),r||(t(!1),s(-1));break;case"Escape":d.preventDefault(),t(!1),s(-1),r||o("");break;case"Tab":t(!1),s(-1);break;case"Home":d.preventDefault(),a.length>0&&s(0);break;case"End":d.preventDefault(),a.length>0&&s(a.length-1);break;case"Backspace":r&&n===""&&i.length>0&&(d.preventDefault(),c(i[i.length-1]));break}},[e,r,n,i,a,l,t,o,s,b,c,v])};function it({option:e,labelKey:t,valueKey:r,onRemove:n}){let o=String(e[t]),i=String(e[r]);return jsxRuntime.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded",children:[o,jsxRuntime.jsx("button",{type:"button",onMouseDown:a=>a.preventDefault(),onClick:()=>n(i),className:"hover:bg-blue-200 dark:hover:bg-blue-800 rounded-full p-0.5 transition-colors","aria-label":`Remover ${o}`,children:"\u2715"})]},i)}function Tr(e,t){let{label:r,required:n=!1,name:o,placeholder:i="Buscar...",labelKey:a,valueKey:l,options:s,value:b,onChange:c,mode:v="single",typeSet:f="field",disabled:d=!1,ClearEnabled:w=!0,helperText:R,error:h=!1,className:T="",...E}=e,L=v==="multiple",[M,S]=Xt.useState(!1),[H,N]=Xt.useState(""),F=Xt.useRef(null),x=Xt.useRef(null),P=Xt.useRef(null);Xt.useImperativeHandle(t,()=>P.current),nt(x,()=>S(!1));let m=ge(s,a,H),[p,C]=Xt.useState(-1),{selectedValues:k,handleSelect:Y,handleRemove:Le,handleClear:It,getSelectedOptions:Pe}=fe({options:s,labelKey:a,valueKey:l,value:b,multiple:L,onChange:c,typeSet:f,name:o,setSearchTerm:N}),Ht=at({isOpen:M,setIsOpen:S,multiple:L,searchTerm:H,setSearchTerm:N,selectedValues:k,filteredOptions:m,highlightedIndex:p,setHighlightedIndex:C,handleSelect:Y,handleRemove:Le}),Q=Xt.useId(),Ft="w-full bg-transparent outline-none placeholder:text-gray-500 dark:placeholder:text-gray-400 text-gray-900 dark:text-gray-100",St=u("relative w-full min-h-[40px] px-3 py-2 border rounded-md bg-white dark:bg-gray-800",h?"border-red-500":"border-gray-300 dark:border-gray-600",d?"opacity-50 cursor-not-allowed":"cursor-text","focus-within:ring-2 focus-within:ring-blue-500 focus-within:border-blue-500");return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:`space-y-2 ${T}`,children:[r&&jsxRuntime.jsx(y,{htmlFor:Q,required:n,children:r}),jsxRuntime.jsxs("div",{ref:F,className:"relative",children:[jsxRuntime.jsxs("div",{className:St,children:[L&&Pe().length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:Pe().map(($,G)=>jsxRuntime.jsx(it,{option:$,labelKey:a,valueKey:l,onRemove:Le},String($[l]??G)))}),jsxRuntime.jsx("input",{ref:P,...E,name:o,type:"text",placeholder:i,value:H,onChange:$=>{let G=$.target.value;N(G),!M&&G.trim()!==""&&S(!0);},onKeyDown:Ht,onMouseDown:$=>{document.activeElement===P.current&&($.preventDefault(),S(G=>{let ee=!G;return ee&&C(0),ee}));},onFocus:()=>{S(!0),C(0);},disabled:d,className:Ft,role:"combobox","aria-expanded":M,"aria-controls":Q,"aria-activedescendant":p>=0?`${Q}-opt-${p}`:void 0}),w&&!!k.length&&jsxRuntime.jsx("button",{type:"button",onMouseDown:$=>$.preventDefault(),onClick:It,className:"absolute right-2 top-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 p-1 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700",title:"Limpar sele\xE7\xE3o",children:jsxRuntime.jsx(se,{width:12,height:12})})]}),M&&jsxRuntime.jsx("div",{ref:x,id:Q,className:"absolute z-50 w-full mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-auto",role:"listbox","aria-multiselectable":L||void 0,children:m.length===0?jsxRuntime.jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400",children:"Nenhum resultado encontrado"}):m.map(($,G)=>{let ee=String($[l]),ce=k.includes(ee),de=G===p;return jsxRuntime.jsx("button",{id:`${Q}-opt-${G}`,"data-index":G,role:"option","aria-selected":ce,type:"button",onMouseDown:At=>At.preventDefault(),onClick:()=>Y($),className:u("w-full px-3 py-2 text-left text-sm transition-colors",de&&"bg-blue-100 dark:bg-blue-800 text-blue-900 dark:text-white",!de&&ce&&"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300",!ce&&!de&&"text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),children:jsxRuntime.jsx("span",{children:String($[a])})},ee)})})]}),h&&jsxRuntime.jsx(I,{children:h}),!h&&R&&jsxRuntime.jsx(V,{children:R})]})})}function Lr(){let e=Xt.forwardRef(Tr);return e.displayName="ComboBox",e}var Pr=Lr(),da=Pr;var Rr=({children:e,before:t,after:r,className:n})=>{let i=wr__default.default("flex justify-center items-center",{"rounded-l-lg":t,"rounded-r-lg":r},n);return jsxRuntime.jsx("div",{className:i,children:jsxRuntime.jsx("span",{children:e})})},he=Rr;var kr=({children:e})=>jsxRuntime.jsx("div",{className:"absolute px-2",children:jsxRuntime.jsx("span",{children:e})}),ct=kr;var Er=({children:e})=>jsxRuntime.jsx("div",{className:"absolute right-0 px-2",children:jsxRuntime.jsx("span",{children:e})}),mt=Er;function pt(e){e.currentTarget.maxLength=9;let t=e.currentTarget.value;return t=t.replace(/\D/g,""),t=t.replace(/^(\d{5})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function ut(e){let t=e.currentTarget.value;t=t.replace(/\D/g,""),t=t.padStart(3,"0");let r=t.slice(0,-2),n=t.slice(-2),a=`${(r.replace(/^0+/,"")||"0").replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1.")},${n}`;return e.currentTarget.value=a,e}function ft(e){e.currentTarget.maxLength=14;let t=e.currentTarget.value;return t.match(/^(\d{3}).(\d{3}).(\d{3})-(\d{2})$/)||(t=t.replace(/\D/g,""),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{2})$/,"$1-$2"),e.currentTarget.value=t),e}function gt(e){e.currentTarget.maxLength=15;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"($1) $2"),t=t.replace(/(\d{5})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function bt(e){e.currentTarget.maxLength=14;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"($1) $2"),t=t.replace(/(\d{4})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function vt(e){let t=e.currentTarget.value.replace(/\D/g,"");return t.length<=11?(e.currentTarget.maxLength=14,t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{2})$/,"$1-$2")):(e.currentTarget.maxLength=18,t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2")),e.currentTarget.value=t,e}function xt(e){e.currentTarget.maxLength=12;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{1})$/,"$1-$2"),e.currentTarget.value=t,e}function ht(e){e.currentTarget.maxLength=18;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2"),e.currentTarget.value=t,e}var Nr=({e,mask:t})=>{switch(t){case"money":return ut(e);case"mobile":return gt(e);case"phone":return bt(e);case"cpfCnpj":return vt(e);case"cpf":return ft(e);case"rg":return xt(e);case"cnpj":return ht(e);case"cep":return pt(e);default:return e}},Ct=Nr;var Ir=({mask:e,initialValue:t=""})=>{let[r,n]=Xt.useState(t);Xt.useEffect(()=>{t!==r&&n(t);},[t]);let o=Xt.useCallback(a=>{let s=Ct({e:a,mask:e})?.currentTarget?.value??a.currentTarget.value;n(s);},[e]),i=Xt.useCallback(()=>n(""),[]);return {value:r,setValue:n,handleChange:o,handleClear:i}},Tt=Ir;var Lt=Xt.forwardRef(({label:e,required:t=!1,mask:r,name:n,prefix:o,suffix:i,addonBefore:a,addonBeforeClassName:l,addonAfter:s,addonAfterClassName:b,ClearEnabled:c=!0,className:v,overrideClassName:f=!1,error:d,helperText:w,value:R=void 0,onChange:h,...T},E)=>{let L=Xt.useId(),{handleChange:M,handleClear:S,setValue:H}=Tt({mask:r,initialValue:R}),N=u("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",d&&"border-destructive focus-visible:ring-destructive",!o&&!i&&"px-3",o&&!i&&"pl-10 pr-3",i&&!o&&"pl-3 pr-10",o&&i&&"pl-10 pr-10",a&&"rounded-l-none border-l-0",s&&"rounded-r-none border-r-0",v),F=P=>{M(P),h?.(P);},x=()=>{S(),H(""),h?.({target:{name:n||"",value:""}});};return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsxRuntime.jsx(y,{htmlFor:L,required:t,children:e}),jsxRuntime.jsxs("div",{className:"relative flex",children:[a&&jsxRuntime.jsx(he,{before:!0,className:l,children:a}),jsxRuntime.jsxs("div",{className:"relative flex items-center w-full",children:[o&&jsxRuntime.jsx(ct,{children:o}),jsxRuntime.jsx("input",{id:L,ref:E,name:n,onChange:F,className:f?v:N,...T}),c&&R&&jsxRuntime.jsx(se,{onClick:x,width:12,height:12,className:u("absolute right-2 cursor-pointer",i&&"right-8")}),i&&jsxRuntime.jsx(mt,{children:i})]}),s&&jsxRuntime.jsx(he,{after:!0,className:b,children:s})]}),d&&jsxRuntime.jsx(I,{children:d}),!d&&w&&jsxRuntime.jsx(V,{children:w})]})})});Lt.displayName="Input";var Da=Lt;var wt=Xt.forwardRef(({length:e=6,groupBy:t,value:r,name:n,label:o,required:i=!1,helperText:a,error:l,onChange:s,onBlur:b,className:c,charType:v="numeric",customPattern:f,caseMode:d="none",...w},R)=>{let h=Xt.useId(),T=Xt.useRef([]),E=m=>{switch(d){case"upper":return m.toUpperCase();case"lower":case"visual-upper":return m.toLowerCase();case"visual-lower":return m.toUpperCase();default:return m}},L=m=>{if(!m)return "";let p=m.slice(0,1);switch(p=E(p),v){case"numeric":return /\d/.test(p)?p:"";case"alpha":return /[A-Za-z]/.test(p)?p:"";case"alphanumeric":return /[A-Za-z0-9]/.test(p)?p:"";case"custom":return f?.test(p)?p:"";default:return p}},M=()=>(r!=null?String(r):"").split("").map(L).slice(0,e),S=M().concat(Array(e).fill(" ")).slice(0,e),H=m=>{let p=m.split("").map(L).join("").slice(0,e),C=p===""?void 0:typeof r=="number"?Number(p):p;s?.({target:{name:n,value:C}});},N=(m,p)=>{let C=L(p),k=M();if(C===""){k[m]="",H(k.join(""));return}if(p.length>1){let Y=p.split("").map(L).join("").slice(0,e);H(Y),T.current[Math.min(Y.length-1,e-1)]?.focus();return}C&&(k[m]=C,H(k.join("")),m<e-1&&T.current[m+1]?.focus());},F=m=>{let p=M();!p[m]&&m>0?p[m-1]="":p[m]="",H(p.join("")),m>0&&T.current[m-1]?.focus();},x=m=>{m.preventDefault();let C=m.clipboardData.getData("text").split("").map(L).join("").slice(0,e);C&&(H(C),T.current[Math.min(C.length-1,e-1)]?.focus());},P=m=>{switch(d){case"upper":case"visual-upper":return m.toUpperCase();case"lower":case"visual-lower":return m.toLowerCase();default:return m}};return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[o&&jsxRuntime.jsx(y,{htmlFor:h,required:i,children:o}),jsxRuntime.jsx("div",{className:u("flex gap-3 items-center",l&&"text-red-500",c),...w,children:S.map((m,p)=>{let C=t&&p>0&&p%t===0;return jsxRuntime.jsxs(Xt__default.default.Fragment,{children:[C&&jsxRuntime.jsx("span",{className:"flex items-center justify-center text-xl font-bold select-none",children:"-"}),jsxRuntime.jsx("input",{id:h,type:"text",maxLength:1,inputMode:v==="numeric"?"numeric":"text",value:P(m).trim(),ref:k=>{T.current[p]=k,p===0&&R&&(typeof R=="function"?R(k):typeof R=="object"&&(R.current=k));},onPaste:x,onChange:k=>N(p,k.target.value),onKeyDown:k=>k.key==="Backspace"&&F(p),onBlur:b,className:u("h-14 w-12 text-center text-2xl rounded-md border border-input bg-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",l&&"border-red-500")})]},p)})}),l&&jsxRuntime.jsx(I,{children:l}),!l&&a&&jsxRuntime.jsx(V,{children:a})]})})});wt.displayName="OtpInput";var Wa=wt;var Rt=Xt.forwardRef(({label:e,required:t,option:r,description:n,icon:o,className:i,overrideClassName:a,helperText:l,error:s,...b},c)=>{let v=Xt.useId(),f=u("h-4 w-4 border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s&&"border-destructive",i);return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"space-y-3",children:[e&&jsxRuntime.jsx(y,{required:t,children:e}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{id:v,type:"radio",className:a?i:f,ref:c,...b}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{children:o&&o}),jsxRuntime.jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[r&&jsxRuntime.jsx(y,{htmlFor:v,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r}),n&&jsxRuntime.jsx(y,{id:`${v}-description`,htmlFor:v,className:"text-xs text-muted-foreground",children:n})]})]})]}),s&&jsxRuntime.jsx(I,{children:s}),!s&&l&&jsxRuntime.jsx(V,{children:l})]})})});Rt.displayName="Radio";var ti=Rt;function Ur(e,t){let{label:r,required:n,name:o,labelKey:i,valueKey:a,options:l,alignment:s="vertical",className:b,overrideClassName:c=!1,helperText:v,error:f,typeSet:d="field",value:w,onChange:R,...h}=e,T=Xt.useId(),E=Xt.useMemo(()=>new Map(l.map(N=>[String(N[a]),N])),[l,a]),L=Xt.useMemo(()=>w==null?"":String(d==="field"?w:w[a]),[w,d,a]),M=N=>{if(!R)return;let F;if(d==="field"){let x=E.get(N);if(x)F=x[a];else {let P=Number(N);F=Number.isNaN(P)?N:P;}}else F=E.get(N)??void 0;R({target:{name:o,value:F,type:"radiogroup",checked:!0}});},S=s==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",H=u("h-4 w-4 rounded-full border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",f&&"border-destructive");return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:u("flex flex-col gap-3",b),children:[r&&jsxRuntime.jsx(y,{required:n,children:r}),jsxRuntime.jsx("div",{className:S,children:l.map((N,F)=>{let x=String(N[a]),P=`${T}-${x}-${F}`;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{...h,id:P,ref:t,name:o,type:"radio",checked:L===x,onChange:()=>M(x),className:c?b:H}),jsxRuntime.jsx(y,{htmlFor:P,children:String(N[i])})]},P)})}),f&&jsxRuntime.jsx(I,{children:String(f)}),!f&&v&&jsxRuntime.jsx(V,{children:v})]})})}function qr(){let e=Xt.forwardRef(Ur);return e.displayName="RadioGroup",e}var zr=qr(),pi=zr;function Jr({label:e,required:t=!1,options:r,labelKey:n,valueKey:o,placeholder:i,error:a,helperText:l,className:s,...b},c){let v=Xt.useId(),f=u("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",s);return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(y,{htmlFor:v,required:t,children:e}),jsxRuntime.jsxs("select",{id:v,ref:c,className:f,...b,children:[i&&jsxRuntime.jsx("option",{value:"",disabled:!0,children:i}),r.map((d,w)=>jsxRuntime.jsx("option",{value:String(d[o]),children:String(d[n])},w))]}),a&&jsxRuntime.jsx(I,{children:a}),!a&&l&&jsxRuntime.jsx(V,{children:l})]})})}function Xr(){let e=Xt.forwardRef(Jr);return e.displayName="Select",e}var jr=Xr(),Li=jr;var Mt=Xt.forwardRef(({label:e,required:t,option:r,description:n,icon:o,checked:i=!1,className:a,overrideClassName:l,error:s,name:b,...c},v)=>{let f=Xt.useId();return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"flex flex-col gap-2",children:[e&&jsxRuntime.jsx(y,{required:t,children:e}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:f,name:b,checked:i,className:"peer sr-only",ref:v,...c}),jsxRuntime.jsx("label",{htmlFor:f,className:u("relative flex items-center h-6 w-11 cursor-pointer rounded-full bg-input transition-colors duration-200","peer-checked:bg-primary peer-focus:ring-2 peer-focus:ring-ring peer-focus:ring-offset-2 peer-focus:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50",a),children:jsxRuntime.jsx("span",{className:u("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",i?"translate-x-5":"translate-x-1")})}),jsxRuntime.jsx("span",{children:o&&o}),(r||n)&&jsxRuntime.jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[e&&jsxRuntime.jsx(y,{id:`${f}-label`,htmlFor:f,className:"text-sm font-medium leading-none",children:r}),n&&jsxRuntime.jsx(y,{id:`${f}-description`,htmlFor:f,className:"text-xs text-muted-foreground",children:n})]})]})]})})});Mt.displayName="Switch";var Vi=Mt;var Vt=Xt__default.default.forwardRef(({label:e,required:t,showCount:r,maxLength:n,className:o,overrideClassName:i=!1,error:a,helperText:l,...s},b)=>{let c=Xt.useId(),[v,f]=Xt.useState(0),d=u("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",o);return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(y,{htmlFor:c,required:t,children:e}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("textarea",{id:c,className:i?o:d,maxLength:n,onInput:w=>f(w.currentTarget.textLength),ref:b,...s}),r&&jsxRuntime.jsxs("span",{className:"absolute bottom-2 right-3 text-xs text-muted-foreground",children:[v,n?` / ${n}`:""]})]}),a&&jsxRuntime.jsx(I,{children:a}),!a&&l&&jsxRuntime.jsx(V,{children:l})]})})});Vt.displayName="TextArea";var Oi=Vt;
33
+
34
+ exports.AccordionPrimitive = Ln;
35
+ exports.ButtonPrimitive = In;
36
+ exports.CardContentPrimitive = Un;
37
+ exports.CardDescriptionPrimitive = Kn;
38
+ exports.CardFooterPrimitive = qn;
39
+ exports.CardHeaderPrimitive = On;
40
+ exports.CardPrimitive = Bn;
41
+ exports.CardTitlePrimitive = Gn;
42
+ exports.CheckBoxGroupPrimitive = So;
43
+ exports.CheckBoxPrimitive = Po;
44
+ exports.ComboBoxPrimitive = da;
45
+ exports.DropdownMenuContentPrimitive = Qn;
46
+ exports.DropdownMenuItemPrimitive = eo;
47
+ exports.DropdownMenuLabelPrimitive = ro;
48
+ exports.DropdownMenuPrimitive = Zn;
49
+ exports.DropdownMenuSeparatorPrimitive = to;
50
+ exports.DropdownMenuTriggerPrimitive = Yn;
35
51
  exports.HelperFieldPrimitive = V;
36
- exports.InputPrimitive = Va;
37
- exports.LabelPrimitive = T;
38
- exports.LicenseProvider = $t;
39
- exports.OtpInputPrimitive = Oa;
40
- exports.RadioGroupPrimitive = ii;
41
- exports.RadioPrimitive = Xa;
42
- exports.SelectPrimitive = vi;
43
- exports.SwitchPrimitive = wi;
44
- exports.TextAreaPrimitive = Fi;
52
+ exports.InputPrimitive = Da;
53
+ exports.LabelPrimitive = y;
54
+ exports.LicenseProvider = Ot;
55
+ exports.OtpInputPrimitive = Wa;
56
+ exports.RadioGroupPrimitive = pi;
57
+ exports.RadioPrimitive = ti;
58
+ exports.SelectPrimitive = Li;
59
+ exports.SwitchPrimitive = Vi;
60
+ exports.TextAreaPrimitive = Oi;
45
61
  exports.ValidateFieldPrimitive = I;
package/dist/page.mjs CHANGED
@@ -1,11 +1,27 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import Jt, { createContext, forwardRef, useState, useContext, useRef, useEffect, useId, useCallback, cloneElement, useMemo, useImperativeHandle } from 'react';
3
- import Lr, { clsx } from 'clsx';
2
+ import Xt, { createContext, forwardRef, useState, useContext, useRef, useEffect, useId, useCallback, cloneElement, useMemo, useImperativeHandle } from 'react';
3
+ import wr, { clsx } from 'clsx';
4
4
  import { twMerge } from 'tailwind-merge';
5
5
 
6
- var Re=({title:e="Ocorreu um erro",message:t,description:r="Algo deu errado ao carregar esta p\xE1gina.",badge:n="Erro",actions:o})=>jsx("div",{className:"flex min-h-screen w-full items-center justify-center bg-linear-to-br from-red-50 via-rose-50 to-red-100 px-4 dark:from-red-950 dark:via-zinc-950 dark:to-red-900/30",children:jsxs("div",{className:"relative w-full max-w-md rounded-2xl bg-white/90 p-8 text-center shadow-2xl backdrop-blur animate-in fade-in zoom-in-95 dark:bg-zinc-900/90",children:[jsx("div",{className:"pointer-events-none absolute inset-0 rounded-2xl ring-1 ring-red-200 dark:ring-red-800"}),n&&jsx("span",{className:"mb-6 inline-block rounded-full bg-red-100 px-4 py-1 text-xs font-semibold text-red-700 dark:bg-red-900/40 dark:text-red-300",children:n}),jsx("div",{className:"mx-auto mb-6 flex h-20 w-20 items-center justify-center rounded-full bg-linear-to-tr from-red-200 to-red-100 text-red-600 shadow-inner dark:from-red-900/40 dark:to-red-800/40 dark:text-red-400",children:jsxs("svg",{className:"h-9 w-9 animate-pulse",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("path",{d:"M12 9v4"}),jsx("path",{d:"M12 17h.01"}),jsx("path",{d:"M5.07 19h13.86c1.54 0 2.5-1.67 1.73-3L13.73 4c-.77-1.33-2.69-1.33-3.46 0L3.34 16c-.77 1.33.19 3 1.73 3z"})]})}),jsx("h1",{className:"mb-2 text-2xl font-extrabold text-zinc-900 dark:text-zinc-100",children:e}),jsx("p",{className:"mb-2 text-sm font-medium text-red-600 dark:text-red-400",children:t}),r&&jsx("p",{className:"mb-6 text-sm text-zinc-600 dark:text-zinc-400",children:r}),o&&o.length>0&&jsx("div",{className:"flex flex-col gap-3",children:o.map((i,a)=>{let l=i.variant!=="secondary";return jsx("button",{onClick:i.onClick,className:l?"rounded-xl bg-linear-to-r from-red-600 to-red-700 px-5 py-2.5 text-sm font-semibold text-white shadow-lg transition hover:scale-[1.02] hover:shadow-red-600/40 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 dark:focus:ring-offset-zinc-900":"rounded-xl border border-zinc-200 px-5 py-2.5 text-sm font-semibold text-zinc-700 transition hover:bg-zinc-100 dark:border-zinc-700 dark:text-zinc-300 dark:hover:bg-zinc-800",children:i.label},a)})})]})});var Ne=createContext(void 0),$t=({children:e,licenseKey:t})=>{let[r,n]=useState(!1),[o,i]=useState(null),[a,l]=useState(!0),s=b=>{if(i(null),!b)throw new Error("\u{1F512} Chave de licen\xE7a \xE9 obrigat\xF3ria");let c="chave-secreta-123";if(b!==c)throw new Error("\u274C Chave de licen\xE7a inv\xE1lida");n(!0);};return useEffect(()=>{if(t){l(!0);try{s(t);}catch(b){i(b instanceof Error?b.message:"Erro desconhecido na valida\xE7\xE3o da licen\xE7a");}finally{l(!1);}}else i("\u{1F512} Licen\xE7a n\xE3o informada"),l(!1);},[t]),a?null:jsx(Ne.Provider,{value:{isLicenseValid:r,validateLicense:s,licenseError:o},children:r?e:jsx(Re,{badge:"Licen\xE7a necess\xE1ria",title:"Erro de Licen\xE7a",message:o||"Licen\xE7a inv\xE1lida",description:"Sua aplica\xE7\xE3o precisa de uma licen\xE7a v\xE1lida para continuar.",actions:[{label:"Tentar novamente",onClick:()=>window.location.reload()},{label:"Falar com suporte",variant:"secondary",onClick:()=>{window.open("mailto:marcos.vinicius.engsof@gmail.com");}}]})})},Ee=()=>{let e=useContext(Ne);if(!e)throw new Error("useLicense deve ser usado dentro de um LicenseProvider");return e};var Ve=({message:e="Component locked - Please validate your license"})=>jsxs("div",{className:"flex items-start p-4 bg-red-50 border border-red-500 text-red-700 rounded-md gap-2",children:[jsx("span",{children:" \u274C Component locked - Please validate your license"}),jsx("span",{children:e})]});var g=({children:e})=>{let{isLicenseValid:t}=Ee();return t?jsx(Fragment,{children:e}):jsx(Ve,{})};var Fe=({items:e,type:t="single",defaultValue:r,value:n,onValueChange:o,className:i=""})=>{let a=c=>c===void 0?[]:Array.isArray(c)?c:[c],[l,s]=useState(a(n??r));useEffect(()=>{n!==void 0&&s(a(n));},[n]);let b=useCallback(c=>{s(v=>{let f;return t==="single"?f=v.includes(c)?[]:[c]:f=v.includes(c)?v.filter(d=>d!==c):[...v,c],o?.(t==="single"?f[0]??"":f),f});},[t,o]);return jsx("div",{className:`space-y-2 ${i}`,children:e.map(c=>jsx(zt,{...c,isOpen:l.includes(c.id),onToggle:()=>b(c.id)},c.id))})},zt=({title:e,content:t,disabled:r=!1,isOpen:n,onToggle:o})=>jsx(g,{children:jsxs("div",{className:"border border-border rounded-md overflow-hidden",children:[jsx("button",{onClick:o,disabled:r,className:`w-full px-4 py-3 text-left font-medium transition-colors
6
+ var Re=({title:e="Ocorreu um erro",message:t,description:r="Algo deu errado ao carregar esta p\xE1gina.",badge:n="Erro",actions:o})=>jsx("div",{className:"flex min-h-screen w-full items-center justify-center bg-linear-to-br from-red-50 via-rose-50 to-red-100 px-4 dark:from-red-950 dark:via-zinc-950 dark:to-red-900/30",children:jsxs("div",{className:"relative w-full max-w-md rounded-2xl bg-white/90 p-8 text-center shadow-2xl backdrop-blur animate-in fade-in zoom-in-95 dark:bg-zinc-900/90",children:[jsx("div",{className:"pointer-events-none absolute inset-0 rounded-2xl ring-1 ring-red-200 dark:ring-red-800"}),n&&jsx("span",{className:"mb-6 inline-block rounded-full bg-red-100 px-4 py-1 text-xs font-semibold text-red-700 dark:bg-red-900/40 dark:text-red-300",children:n}),jsx("div",{className:"mx-auto mb-6 flex h-20 w-20 items-center justify-center rounded-full bg-linear-to-tr from-red-200 to-red-100 text-red-600 shadow-inner dark:from-red-900/40 dark:to-red-800/40 dark:text-red-400",children:jsxs("svg",{className:"h-9 w-9 animate-pulse",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("path",{d:"M12 9v4"}),jsx("path",{d:"M12 17h.01"}),jsx("path",{d:"M5.07 19h13.86c1.54 0 2.5-1.67 1.73-3L13.73 4c-.77-1.33-2.69-1.33-3.46 0L3.34 16c-.77 1.33.19 3 1.73 3z"})]})}),jsx("h1",{className:"mb-2 text-2xl font-extrabold text-zinc-900 dark:text-zinc-100",children:e}),jsx("p",{className:"mb-2 text-sm font-medium text-red-600 dark:text-red-400",children:t}),r&&jsx("p",{className:"mb-6 text-sm text-zinc-600 dark:text-zinc-400",children:r}),o&&o.length>0&&jsx("div",{className:"flex flex-col gap-3",children:o.map((i,a)=>{let l=i.variant!=="secondary";return jsx("button",{onClick:i.onClick,className:l?"rounded-xl bg-linear-to-r from-red-600 to-red-700 px-5 py-2.5 text-sm font-semibold text-white shadow-lg transition hover:scale-[1.02] hover:shadow-red-600/40 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 dark:focus:ring-offset-zinc-900":"rounded-xl border border-zinc-200 px-5 py-2.5 text-sm font-semibold text-zinc-700 transition hover:bg-zinc-100 dark:border-zinc-700 dark:text-zinc-300 dark:hover:bg-zinc-800",children:i.label},a)})})]})});var ke=(e,t)=>{let r="Problema com licen\xE7a da aplica\xE7\xE3o",n=`
7
+ Ol\xE1,
8
+
9
+ Estou enfrentando um problema com a licen\xE7a da aplica\xE7\xE3o.
10
+
11
+ Erro:
12
+ ${t??"Licen\xE7a inv\xE1lida"}
13
+
14
+ Aguardo retorno.
15
+ `,o=`mailto:${e}?subject=${encodeURIComponent(r)}&body=${encodeURIComponent(n)}`;window.location.href=o;};var Ee=(e,t)=>{let r=`
16
+ Ol\xE1! Estou com um problema de licen\xE7a na aplica\xE7\xE3o.
17
+
18
+ Erro:
19
+ ${t??"Licen\xE7a inv\xE1lida"}
20
+
21
+ Pode me ajudar?
22
+ `,n=`https://wa.me/${e}?text=${encodeURIComponent(r)}`;window.open(n,"_blank");};var Me=createContext(void 0),Ot=({children:e,licenseKey:t})=>{let[r,n]=useState(!1),[o,i]=useState(null),[a,l]=useState(!0),s=b=>{if(i(null),!b)throw new Error("\u{1F512} Chave de licen\xE7a \xE9 obrigat\xF3ria");let c="chave-secreta-123";if(b!==c)throw new Error("\u274C Chave de licen\xE7a inv\xE1lida");n(!0);};return useEffect(()=>{if(t){l(!0);try{s(t);}catch(b){i(b instanceof Error?b.message:"Erro desconhecido na valida\xE7\xE3o da licen\xE7a");}finally{l(!1);}}else i("\u{1F512} Licen\xE7a n\xE3o informada"),l(!1);},[t]),a?null:jsx(Me.Provider,{value:{isLicenseValid:r,validateLicense:s,licenseError:o},children:r?e:jsx(Re,{badge:"Licen\xE7a necess\xE1ria",title:"Erro de Licen\xE7a",message:o||"Licen\xE7a inv\xE1lida",description:"Sua aplica\xE7\xE3o precisa de uma licen\xE7a v\xE1lida para continuar.",actions:[{label:"Tentar novamente",onClick:()=>window.location.reload()},{label:"Falar no WhatsApp",variant:"secondary",onClick:()=>Ee("5544998204407",o)},{label:"Enviar e-mail",variant:"secondary",onClick:()=>ke("marcos.vinicius.engsof@gmail.com",o)}]})})},Ve=()=>{let e=useContext(Me);if(!e)throw new Error("useLicense deve ser usado dentro de um LicenseProvider");return e};var He=({message:e="Component locked - Please validate your license"})=>jsxs("div",{className:"flex items-start p-4 bg-red-50 border border-red-500 text-red-700 rounded-md gap-2",children:[jsx("span",{children:" \u274C Component locked - Please validate your license"}),jsx("span",{children:e})]});var g=({children:e})=>{let{isLicenseValid:t}=Ve();return t?jsx(Fragment,{children:e}):jsx(He,{})};var Ae=({items:e,type:t="single",defaultValue:r,value:n,onValueChange:o,className:i=""})=>{let a=c=>c===void 0?[]:Array.isArray(c)?c:[c],[l,s]=useState(a(n??r));useEffect(()=>{n!==void 0&&s(a(n));},[n]);let b=useCallback(c=>{s(v=>{let f;return t==="single"?f=v.includes(c)?[]:[c]:f=v.includes(c)?v.filter(d=>d!==c):[...v,c],o?.(t==="single"?f[0]??"":f),f});},[t,o]);return jsx("div",{className:`space-y-2 ${i}`,children:e.map(c=>jsx(Wt,{...c,isOpen:l.includes(c.id),onToggle:()=>b(c.id)},c.id))})},Wt=({title:e,content:t,disabled:r=!1,isOpen:n,onToggle:o})=>jsx(g,{children:jsxs("div",{className:"border border-border rounded-md overflow-hidden",children:[jsx("button",{onClick:o,disabled:r,className:`w-full px-4 py-3 text-left font-medium transition-colors
7
23
  ${r?"opacity-50 cursor-not-allowed":"hover:bg-accent hover:text-accent-foreground"}
8
24
  ${n?"bg-accent text-accent-foreground":"bg-background text-foreground"}
9
- `,children:jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{children:e}),jsx("svg",{className:`w-5 h-5 transition-transform ${n?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})}),n&&jsx("div",{className:"px-4 py-3 bg-background border-t border-border",children:t})]})});Fe.displayName="Accordion";var vn=Fe;function u(...e){return twMerge(clsx(e))}var Se=Jt.forwardRef(({className:e,overrideClassName:t,variant:r="primary",size:n="md",href:o,children:i,loading:a=!1,loadingContent:l,...s},b)=>{let c="inline-flex items-center justify-center rounded-lg font-medium cursor-pointer active:translate-y-1 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",v={primary:"bg-blue-600 text-white hover:bg-blue-700 shadow-md focus-visible:ring-blue-500",secondary:"bg-gray-600 text-white hover:bg-gray-700 shadow-sm focus-visible:ring-gray-500",tertiary:"bg-purple-600 text-white hover:bg-purple-700 shadow-sm focus-visible:ring-purple-500",destructive:"bg-red-600 text-white hover:bg-red-700 shadow-sm focus-visible:ring-red-500",success:"bg-green-600 text-white hover:bg-green-700 shadow-sm focus-visible:ring-green-500",warning:"bg-amber-500 text-white hover:bg-amber-600 shadow-sm focus-visible:ring-amber-500",info:"bg-cyan-600 text-white hover:bg-cyan-700 shadow-sm focus-visible:ring-cyan-500",accent:"bg-violet-600 text-white hover:bg-violet-700 shadow-sm focus-visible:ring-violet-500",outline:"border border-gray-300 bg-transparent text-gray-700 hover:bg-gray-50 shadow-sm focus-visible:ring-gray-500",ghost:"bg-transparent text-gray-700 hover:bg-gray-100 focus-visible:ring-gray-500",link:"text-blue-600 underline-offset-4 hover:underline bg-transparent p-0 h-auto shadow-none",gradient:"bg-gradient-to-r from-blue-600 to-purple-600 text-white hover:from-blue-700 hover:to-purple-700 shadow-md focus-visible:ring-blue-500",glass:"bg-white/10 backdrop-blur-md border border-white/20 text-black hover:bg-white/20 shadow-sm focus-visible:ring-white/50",soft:"bg-blue-100 text-blue-700 hover:bg-blue-200 shadow-sm focus-visible:ring-blue-500",dark:"bg-gray-900 text-white hover:bg-gray-800 shadow-md focus-visible:ring-gray-500",light:"bg-gray-100 text-gray-900 hover:bg-gray-200 shadow-sm focus-visible:ring-gray-500",obsidian:"bg-black text-white hover:bg-gray-900 shadow-md border border-gray-800 focus-visible:ring-gray-700",polar:"bg-white text-gray-900 hover:bg-gray-50 shadow-md border border-gray-300 focus-visible:ring-gray-400"},f={xs:"h-7 px-2 text-xs min-w-16",sm:"h-9 px-3 text-sm min-w-20",md:"h-10 px-4 py-2 text-base min-w-24",lg:"h-11 px-6 text-lg min-w-28",xl:"h-12 px-8 text-xl min-w-32"},d=t?e:u(c,v[r],f[n],e);return o?jsx(g,{children:jsx("a",{href:o,className:d,ref:b,children:a&&l?l:i})}):jsx(g,{children:jsx("button",{className:d,ref:b,...s,children:a&&l?l:i})})});Se.displayName="Button";var Rn=Se;var De=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(g,{children:jsx("div",{ref:o,className:t?e:u("rounded-lg border bg-card text-card-foreground shadow-sm",e),...n,children:r})}));De.displayName="Card";var Ae=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(g,{children:jsx("div",{ref:o,className:t?e:u("flex flex-col space-y-1.5 p-6",e),...n,children:r})}));Ae.displayName="CardHeader";var $e=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(g,{children:jsx("h3",{ref:o,className:t?e:u("text-2xl font-semibold leading-none tracking-tight",e),...n,children:r})}));$e.displayName="CardTitle";var Be=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(g,{children:jsx("p",{ref:o,className:t?e:u("text-sm text-muted-foreground",e),...n,children:r})}));Be.displayName="CardDescription";var Oe=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(g,{children:jsx("div",{ref:o,className:t?e:u("p-6 pt-0",e),...n,children:r})}));Oe.displayName="CardContent";var Ge=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(g,{children:jsx("div",{ref:o,className:t?e:u("flex items-center p-6 pt-0",e),...n,children:r})}));Ge.displayName="CardFooter";var Hn=De,Fn=Ae,Sn=$e,Dn=Be,An=Oe,$n=Ge;var ae=createContext(void 0),qe=forwardRef(({children:e,className:t,...r},n)=>{let[o,i]=useState(!1);return jsx(g,{children:jsx(ae.Provider,{value:{isOpen:o,setIsOpen:i},children:jsx("div",{ref:n,className:u("relative inline-block",t),...r,children:e})})})});qe.displayName="DropdownMenu";var ze=({children:e,asChild:t})=>{let r=useContext(ae);if(!r)throw new Error("DropdownMenuTrigger must be used within DropdownMenu");let n=()=>r.setIsOpen(!r.isOpen);if(t){let o=e;return cloneElement(o,{onClick:i=>{o.props.onClick?.(i),n();}})}return jsx(g,{children:jsx("button",{onClick:n,children:e})})};ze.displayName="DropdownMenuTrigger";var Ue=forwardRef(({children:e,align:t="end",className:r,...n},o)=>{let i=useContext(ae),a=useRef(null);return useEffect(()=>{o&&(typeof o=="function"?o(a.current):o.current=a.current);},[o]),useEffect(()=>{let s=b=>{a.current&&!a.current.contains(b.target)&&i?.setIsOpen(!1);};return i?.isOpen&&document.addEventListener("mousedown",s),()=>{document.removeEventListener("mousedown",s);}},[i?.isOpen]),i?.isOpen?jsx(g,{children:jsx("div",{ref:a,className:u("absolute z-50 mt-2 min-w-32 overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md",{start:"left-0",center:"left-1/2 -translate-x-1/2",end:"right-0"}[t],r),...n,children:e})}):null});Ue.displayName="DropdownMenuContent";var We=forwardRef(({children:e,onClick:t,destructive:r,className:n,...o},i)=>{let a=useContext(ae);return jsx(g,{children:jsx("button",{ref:i,onClick:s=>{t?.(s),a?.setIsOpen(!1);},className:u("w-full text-left px-4 py-2 text-sm hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none",r&&"text-red-600 hover:bg-red-50 hover:text-red-700 focus:bg-red-50 focus:text-red-700",n),...o,children:e})})});We.displayName="DropdownMenuItem";var Je=forwardRef(({className:e,...t},r)=>jsx(g,{children:jsx("div",{ref:r,className:u("-mx-1 my-1 h-px bg-border",e),...t})}));Je.displayName="DropdownMenuSeparator";var _e=forwardRef(({children:e,className:t,...r},n)=>jsx(g,{children:jsx("div",{ref:n,className:u("px-2 py-1.5 text-sm font-semibold",t),...r,children:e})}));_e.displayName="DropdownMenuLabel";var Un=qe,Wn=ze,Jn=Ue,_n=We,Xn=Je,Zn=_e;var Yt=({children:e,className:t,overrideClassName:r})=>{if(e)return jsx(g,{children:jsx("p",{className:r?t:u("text-sm text-muted-foreground",t),children:e})})},V=Yt;var Qt=({children:e,required:t,className:r,overrideClassName:n=!1,...o})=>jsx(g,{children:jsxs("div",{className:"flex items-center gap-1",children:[jsx("label",{...o,className:n?r:u("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),children:e}),t&&jsx("span",{className:"text-red-600",children:"*"})]})}),T=Qt;var tr=({children:e,className:t,overrideClassName:r})=>{if(e)return jsx(g,{children:jsx("p",{className:r?t:u("text-sm text-red-600 dark:text-red-400",t),children:e})})},I=tr;var je=forwardRef(({label:e,required:t,option:r,description:n,icon:o,orientation:i="left",className:a,overrideClassName:l=!1,helperText:s,error:b,...c},v)=>{let f=useId(),d=u("h-4 w-4 rounded border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",b&&"border-destructive",a);return jsx(g,{children:jsxs("div",{className:"space-y-2 w-fit",children:[e&&jsx(T,{required:t,children:e}),jsxs("div",{className:`flex items-center ${i=="left"?"flex-row":"flex-row-reverse"} w-fit gap-2`,children:[jsx("input",{id:f,type:"checkbox",className:l?a:d,ref:v,...c}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{children:o&&o}),jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[r&&jsx(T,{htmlFor:f,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r}),n&&jsx(T,{id:`${f}-description`,htmlFor:f,className:"text-xs text-muted-foreground",children:n})]})]})]}),b&&jsx(I,{children:b}),!b&&s&&jsx(V,{children:s})]})})});je.displayName="CheckBox";var xo=je;function ir(e,t){let{typeSet:r="field",multiCheck:n=!1,value:o,onChange:i,labelKey:a,valueKey:l,options:s,alignment:b="vertical",className:c,overrideClassName:v=!1,helperText:f,error:d,label:w,name:R,required:h,...y}=e,N=useId(),L=useMemo(()=>new Map(s.map(x=>[String(x[l]),x])),[s,l]),M=useMemo(()=>o==null?[]:r==="field"?n?o.map(x=>String(x)):[String(o)]:n?o.map(x=>String(x[l])):[String(o[l])],[o,r,n,l]),S=(x,P)=>{if(!i)return;let m;if(r==="field")if(n)m=x.map(C=>{let k=L.get(C);return k?k[l]:C});else {let p=x[0];if(!p)m=void 0;else {let C=L.get(p);m=C?C[l]:p;}}else n?m=x.map(C=>L.get(C)).filter(C=>C!==void 0):m=L.get(x[0]??"")??void 0;i({target:{name:R,value:m,type:"checkboxgroup",checked:P}});},H=x=>{let P;n?P=M.includes(x)?M.filter(m=>m!==x):[...M,x]:P=M[0]===x?[]:[x],S(P,P.includes(x));},E=b==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",F=u("h-4 w-4 rounded border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",d&&"border-destructive");return jsx(g,{children:jsxs("div",{className:u("flex flex-col gap-3",c),children:[w&&jsx(T,{required:h,children:w}),jsx("div",{className:E,children:s.map((x,P)=>{let m=String(x[l]),p=M.includes(m),C=`${N}-${m}-${P}`;return jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{...y,id:C,ref:t,type:"checkbox",name:R,checked:p,onChange:()=>H(m),className:v?c:F}),jsx(T,{htmlFor:C,children:String(x[a])})]},C)})}),!!d&&jsx(I,{children:String(d)}),!d&&f&&jsx(V,{children:f})]})})}function sr(){let e=forwardRef(ir);return e.displayName="CheckBoxGroup",e}var lr=sr(),Eo=lr;var cr=({...e})=>jsx("svg",{...e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),se=cr;var mr=(e,t)=>{useEffect(()=>{let r=n=>{e.current&&!e.current.contains(n.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},tt=mr;function fe({options:e,labelKey:t,valueKey:r,multiple:n,onChange:o,setSearchTerm:i,typeSet:a,name:l}){let[s,b]=useState([]),c=useMemo(()=>new Map(e.map(h=>[String(h[r]),h])),[e,r]),v=useCallback(()=>s.map(h=>c.get(h)).filter(h=>!!h),[s,c]),f=useCallback(h=>{if(!o)return;let y;if(a==="field"?n?y=h:y=h[0]??void 0:n?y=h.map(L=>c.get(L)).filter(L=>L!==void 0):y=c.get(h[0]??"")??void 0,i&&!n){let N=c.get(h[0]??"");N&&i(String(N[t]));}o({target:{name:l,value:y,type:"combobox"}});},[n,o,c,l,a,i,t]),d=useCallback(h=>{let y=String(h[r]),N=n?s.includes(y)?s.filter(L=>L!==y):[...s,y]:[y];b(N),f(N);},[n,s,f,r]),w=useCallback(h=>{let y=s.filter(N=>N!==h);b(y),f(y);},[s,f]),R=useCallback(()=>{b([]),i?.("");let h;a==="field"?h=n?[]:"":h=n?[]:void 0,o?.({target:{name:l,value:h,type:"combobox"}});},[n,o,l,i,a]);return {selectedValues:s,handleSelect:d,handleRemove:w,handleClear:R,getSelectedOptions:v}}function ge(e,t,r){return useMemo(()=>r?e.filter(o=>String(o[t]).toLowerCase().includes(r.toLowerCase())):e,[e,r,t])}var nt=({isOpen:e,setIsOpen:t,multiple:r,searchTerm:n,setSearchTerm:o,selectedValues:i,filteredOptions:a,highlightedIndex:l,setHighlightedIndex:s,handleSelect:b,handleRemove:c})=>{let v=useCallback(d=>{if(a.length===0){s(-1);return}s(w=>w<0?d>0?0:a.length-1:(w+d+a.length)%a.length);},[a,s]);return useCallback(d=>{if(!e){if(d.key==="Enter"||d.key==="ArrowDown"){t(!0),s(0),d.preventDefault();return}r&&d.key==="Backspace"&&n===""&&i.length>0&&(d.preventDefault(),c(i[i.length-1]));return}switch(d.key){case"ArrowDown":d.preventDefault(),v(1);break;case"ArrowUp":d.preventDefault(),v(-1);break;case"Enter":d.preventDefault();let w=l>=0?l:0,R=a[w];R&&b(R),r&&o&&o(""),r||(t(!1),s(-1));break;case"Escape":d.preventDefault(),t(!1),s(-1),r||o("");break;case"Tab":t(!1),s(-1);break;case"Home":d.preventDefault(),a.length>0&&s(0);break;case"End":d.preventDefault(),a.length>0&&s(a.length-1);break;case"Backspace":r&&n===""&&i.length>0&&(d.preventDefault(),c(i[i.length-1]));break}},[e,r,n,i,a,l,t,o,s,b,c,v])};function ot({option:e,labelKey:t,valueKey:r,onRemove:n}){let o=String(e[t]),i=String(e[r]);return jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded",children:[o,jsx("button",{type:"button",onMouseDown:a=>a.preventDefault(),onClick:()=>n(i),className:"hover:bg-blue-200 dark:hover:bg-blue-800 rounded-full p-0.5 transition-colors","aria-label":`Remover ${o}`,children:"\u2715"})]},i)}function Cr(e,t){let{label:r,required:n=!1,name:o,placeholder:i="Buscar...",labelKey:a,valueKey:l,options:s,value:b,onChange:c,mode:v="single",typeSet:f="field",disabled:d=!1,ClearEnabled:w=!0,helperText:R,error:h=!1,className:y="",...N}=e,L=v==="multiple",[M,S]=useState(!1),[H,E]=useState(""),F=useRef(null),x=useRef(null),P=useRef(null);useImperativeHandle(t,()=>P.current),tt(x,()=>S(!1));let m=ge(s,a,H),[p,C]=useState(-1),{selectedValues:k,handleSelect:Y,handleRemove:Le,handleClear:Mt,getSelectedOptions:Pe}=fe({options:s,labelKey:a,valueKey:l,value:b,multiple:L,onChange:c,typeSet:f,name:o,setSearchTerm:E}),Vt=nt({isOpen:M,setIsOpen:S,multiple:L,searchTerm:H,setSearchTerm:E,selectedValues:k,filteredOptions:m,highlightedIndex:p,setHighlightedIndex:C,handleSelect:Y,handleRemove:Le}),Q=useId(),It="w-full bg-transparent outline-none placeholder:text-gray-500 dark:placeholder:text-gray-400 text-gray-900 dark:text-gray-100",Ht=u("relative w-full min-h-[40px] px-3 py-2 border rounded-md bg-white dark:bg-gray-800",h?"border-red-500":"border-gray-300 dark:border-gray-600",d?"opacity-50 cursor-not-allowed":"cursor-text","focus-within:ring-2 focus-within:ring-blue-500 focus-within:border-blue-500");return jsx(g,{children:jsxs("div",{className:`space-y-2 ${y}`,children:[r&&jsx(T,{htmlFor:Q,required:n,children:r}),jsxs("div",{ref:F,className:"relative",children:[jsxs("div",{className:Ht,children:[L&&Pe().length>0&&jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:Pe().map(($,G)=>jsx(ot,{option:$,labelKey:a,valueKey:l,onRemove:Le},String($[l]??G)))}),jsx("input",{ref:P,...N,name:o,type:"text",placeholder:i,value:H,onChange:$=>{let G=$.target.value;E(G),!M&&G.trim()!==""&&S(!0);},onKeyDown:Vt,onMouseDown:$=>{document.activeElement===P.current&&($.preventDefault(),S(G=>{let ee=!G;return ee&&C(0),ee}));},onFocus:()=>{S(!0),C(0);},disabled:d,className:It,role:"combobox","aria-expanded":M,"aria-controls":Q,"aria-activedescendant":p>=0?`${Q}-opt-${p}`:void 0}),w&&!!k.length&&jsx("button",{type:"button",onMouseDown:$=>$.preventDefault(),onClick:Mt,className:"absolute right-2 top-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 p-1 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700",title:"Limpar sele\xE7\xE3o",children:jsx(se,{width:12,height:12})})]}),M&&jsx("div",{ref:x,id:Q,className:"absolute z-50 w-full mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-auto",role:"listbox","aria-multiselectable":L||void 0,children:m.length===0?jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400",children:"Nenhum resultado encontrado"}):m.map(($,G)=>{let ee=String($[l]),ce=k.includes(ee),de=G===p;return jsx("button",{id:`${Q}-opt-${G}`,"data-index":G,role:"option","aria-selected":ce,type:"button",onMouseDown:Ft=>Ft.preventDefault(),onClick:()=>Y($),className:u("w-full px-3 py-2 text-left text-sm transition-colors",de&&"bg-blue-100 dark:bg-blue-800 text-blue-900 dark:text-white",!de&&ce&&"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300",!ce&&!de&&"text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),children:jsx("span",{children:String($[a])})},ee)})})]}),h&&jsx(I,{children:h}),!h&&R&&jsx(V,{children:R})]})})}function Tr(){let e=forwardRef(Cr);return e.displayName="ComboBox",e}var yr=Tr(),oa=yr;var Pr=({children:e,before:t,after:r,className:n})=>{let i=Lr("flex justify-center items-center",{"rounded-l-lg":t,"rounded-r-lg":r},n);return jsx("div",{className:i,children:jsx("span",{children:e})})},he=Pr;var wr=({children:e})=>jsx("div",{className:"absolute px-2",children:jsx("span",{children:e})}),st=wr;var Rr=({children:e})=>jsx("div",{className:"absolute right-0 px-2",children:jsx("span",{children:e})}),ct=Rr;function dt(e){e.currentTarget.maxLength=9;let t=e.currentTarget.value;return t=t.replace(/\D/g,""),t=t.replace(/^(\d{5})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function mt(e){let t=e.currentTarget.value;t=t.replace(/\D/g,""),t=t.padStart(3,"0");let r=t.slice(0,-2),n=t.slice(-2),a=`${(r.replace(/^0+/,"")||"0").replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1.")},${n}`;return e.currentTarget.value=a,e}function pt(e){e.currentTarget.maxLength=14;let t=e.currentTarget.value;return t.match(/^(\d{3}).(\d{3}).(\d{3})-(\d{2})$/)||(t=t.replace(/\D/g,""),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{2})$/,"$1-$2"),e.currentTarget.value=t),e}function ut(e){e.currentTarget.maxLength=15;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"($1) $2"),t=t.replace(/(\d{5})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function ft(e){e.currentTarget.maxLength=14;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"($1) $2"),t=t.replace(/(\d{4})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function gt(e){let t=e.currentTarget.value.replace(/\D/g,"");return t.length<=11?(e.currentTarget.maxLength=14,t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{2})$/,"$1-$2")):(e.currentTarget.maxLength=18,t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2")),e.currentTarget.value=t,e}function bt(e){e.currentTarget.maxLength=12;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{1})$/,"$1-$2"),e.currentTarget.value=t,e}function vt(e){e.currentTarget.maxLength=18;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2"),e.currentTarget.value=t,e}var kr=({e,mask:t})=>{switch(t){case"money":return mt(e);case"mobile":return ut(e);case"phone":return ft(e);case"cpfCnpj":return gt(e);case"cpf":return pt(e);case"rg":return bt(e);case"cnpj":return vt(e);case"cep":return dt(e);default:return e}},xt=kr;var Mr=({mask:e,initialValue:t=""})=>{let[r,n]=useState(t);useEffect(()=>{t!==r&&n(t);},[t]);let o=useCallback(a=>{let s=xt({e:a,mask:e})?.currentTarget?.value??a.currentTarget.value;n(s);},[e]),i=useCallback(()=>n(""),[]);return {value:r,setValue:n,handleChange:o,handleClear:i}},Ct=Mr;var Tt=forwardRef(({label:e,required:t=!1,mask:r,name:n,prefix:o,suffix:i,addonBefore:a,addonBeforeClassName:l,addonAfter:s,addonAfterClassName:b,ClearEnabled:c=!0,className:v,overrideClassName:f=!1,error:d,helperText:w,value:R=void 0,onChange:h,...y},N)=>{let L=useId(),{handleChange:M,handleClear:S,setValue:H}=Ct({mask:r,initialValue:R}),E=u("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",d&&"border-destructive focus-visible:ring-destructive",!o&&!i&&"px-3",o&&!i&&"pl-10 pr-3",i&&!o&&"pl-3 pr-10",o&&i&&"pl-10 pr-10",a&&"rounded-l-none border-l-0",s&&"rounded-r-none border-r-0",v),F=P=>{M(P),h?.(P);},x=()=>{S(),H(""),h?.({target:{name:n||"",value:""}});};return jsx(g,{children:jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsx(T,{htmlFor:L,required:t,children:e}),jsxs("div",{className:"relative flex",children:[a&&jsx(he,{before:!0,className:l,children:a}),jsxs("div",{className:"relative flex items-center w-full",children:[o&&jsx(st,{children:o}),jsx("input",{id:L,ref:N,name:n,onChange:F,className:f?v:E,...y}),c&&R&&jsx(se,{onClick:x,width:12,height:12,className:u("absolute right-2 cursor-pointer",i&&"right-8")}),i&&jsx(ct,{children:i})]}),s&&jsx(he,{after:!0,className:b,children:s})]}),d&&jsx(I,{children:d}),!d&&w&&jsx(V,{children:w})]})})});Tt.displayName="Input";var Va=Tt;var Lt=forwardRef(({length:e=6,groupBy:t,value:r,name:n,label:o,required:i=!1,helperText:a,error:l,onChange:s,onBlur:b,className:c,charType:v="numeric",customPattern:f,caseMode:d="none",...w},R)=>{let h=useId(),y=useRef([]),N=m=>{switch(d){case"upper":return m.toUpperCase();case"lower":case"visual-upper":return m.toLowerCase();case"visual-lower":return m.toUpperCase();default:return m}},L=m=>{if(!m)return "";let p=m.slice(0,1);switch(p=N(p),v){case"numeric":return /\d/.test(p)?p:"";case"alpha":return /[A-Za-z]/.test(p)?p:"";case"alphanumeric":return /[A-Za-z0-9]/.test(p)?p:"";case"custom":return f?.test(p)?p:"";default:return p}},M=()=>(r!=null?String(r):"").split("").map(L).slice(0,e),S=M().concat(Array(e).fill(" ")).slice(0,e),H=m=>{let p=m.split("").map(L).join("").slice(0,e),C=p===""?void 0:typeof r=="number"?Number(p):p;s?.({target:{name:n,value:C}});},E=(m,p)=>{let C=L(p),k=M();if(C===""){k[m]="",H(k.join(""));return}if(p.length>1){let Y=p.split("").map(L).join("").slice(0,e);H(Y),y.current[Math.min(Y.length-1,e-1)]?.focus();return}C&&(k[m]=C,H(k.join("")),m<e-1&&y.current[m+1]?.focus());},F=m=>{let p=M();!p[m]&&m>0?p[m-1]="":p[m]="",H(p.join("")),m>0&&y.current[m-1]?.focus();},x=m=>{m.preventDefault();let C=m.clipboardData.getData("text").split("").map(L).join("").slice(0,e);C&&(H(C),y.current[Math.min(C.length-1,e-1)]?.focus());},P=m=>{switch(d){case"upper":case"visual-upper":return m.toUpperCase();case"lower":case"visual-lower":return m.toLowerCase();default:return m}};return jsx(g,{children:jsxs("div",{className:"flex flex-col gap-2 w-full",children:[o&&jsx(T,{htmlFor:h,required:i,children:o}),jsx("div",{className:u("flex gap-3 items-center",l&&"text-red-500",c),...w,children:S.map((m,p)=>{let C=t&&p>0&&p%t===0;return jsxs(Jt.Fragment,{children:[C&&jsx("span",{className:"flex items-center justify-center text-xl font-bold select-none",children:"-"}),jsx("input",{id:h,type:"text",maxLength:1,inputMode:v==="numeric"?"numeric":"text",value:P(m).trim(),ref:k=>{y.current[p]=k,p===0&&R&&(typeof R=="function"?R(k):typeof R=="object"&&(R.current=k));},onPaste:x,onChange:k=>E(p,k.target.value),onKeyDown:k=>k.key==="Backspace"&&F(p),onBlur:b,className:u("h-14 w-12 text-center text-2xl rounded-md border border-input bg-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",l&&"border-red-500")})]},p)})}),l&&jsx(I,{children:l}),!l&&a&&jsx(V,{children:a})]})})});Lt.displayName="OtpInput";var Oa=Lt;var Pt=forwardRef(({label:e,required:t,option:r,description:n,icon:o,className:i,overrideClassName:a,helperText:l,error:s,...b},c)=>{let v=useId(),f=u("h-4 w-4 border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s&&"border-destructive",i);return jsx(g,{children:jsxs("div",{className:"space-y-3",children:[e&&jsx(T,{required:t,children:e}),jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{id:v,type:"radio",className:a?i:f,ref:c,...b}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{children:o&&o}),jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[r&&jsx(T,{htmlFor:v,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r}),n&&jsx(T,{id:`${v}-description`,htmlFor:v,className:"text-xs text-muted-foreground",children:n})]})]})]}),s&&jsx(I,{children:s}),!s&&l&&jsx(V,{children:l})]})})});Pt.displayName="Radio";var Xa=Pt;function Gr(e,t){let{label:r,required:n,name:o,labelKey:i,valueKey:a,options:l,alignment:s="vertical",className:b,overrideClassName:c=!1,helperText:v,error:f,typeSet:d="field",value:w,onChange:R,...h}=e,y=useId(),N=useMemo(()=>new Map(l.map(E=>[String(E[a]),E])),[l,a]),L=useMemo(()=>w==null?"":String(d==="field"?w:w[a]),[w,d,a]),M=E=>{if(!R)return;let F;if(d==="field"){let x=N.get(E);if(x)F=x[a];else {let P=Number(E);F=Number.isNaN(P)?E:P;}}else F=N.get(E)??void 0;R({target:{name:o,value:F,type:"radiogroup",checked:!0}});},S=s==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",H=u("h-4 w-4 rounded-full border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",f&&"border-destructive");return jsx(g,{children:jsxs("div",{className:u("flex flex-col gap-3",b),children:[r&&jsx(T,{required:n,children:r}),jsx("div",{className:S,children:l.map((E,F)=>{let x=String(E[a]),P=`${y}-${x}-${F}`;return jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{...h,id:P,ref:t,name:o,type:"radio",checked:L===x,onChange:()=>M(x),className:c?b:H}),jsx(T,{htmlFor:P,children:String(E[i])})]},P)})}),f&&jsx(I,{children:String(f)}),!f&&v&&jsx(V,{children:v})]})})}function Kr(){let e=forwardRef(Gr);return e.displayName="RadioGroup",e}var qr=Kr(),ii=qr;function Wr({label:e,required:t=!1,options:r,labelKey:n,valueKey:o,placeholder:i,error:a,helperText:l,className:s,...b},c){let v=useId(),f=u("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",s);return jsx(g,{children:jsxs("div",{className:"space-y-2",children:[e&&jsx(T,{htmlFor:v,required:t,children:e}),jsxs("select",{id:v,ref:c,className:f,...b,children:[i&&jsx("option",{value:"",disabled:!0,children:i}),r.map((d,w)=>jsx("option",{value:String(d[o]),children:String(d[n])},w))]}),a&&jsx(I,{children:a}),!a&&l&&jsx(V,{children:l})]})})}function Jr(){let e=forwardRef(Wr);return e.displayName="Select",e}var _r=Jr(),vi=_r;var Nt=forwardRef(({label:e,required:t,option:r,description:n,icon:o,checked:i=!1,className:a,overrideClassName:l,error:s,name:b,...c},v)=>{let f=useId();return jsx(g,{children:jsxs("div",{className:"flex flex-col gap-2",children:[e&&jsx(T,{required:t,children:e}),jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",id:f,name:b,checked:i,className:"peer sr-only",ref:v,...c}),jsx("label",{htmlFor:f,className:u("relative flex items-center h-6 w-11 cursor-pointer rounded-full bg-input transition-colors duration-200","peer-checked:bg-primary peer-focus:ring-2 peer-focus:ring-ring peer-focus:ring-offset-2 peer-focus:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50",a),children:jsx("span",{className:u("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",i?"translate-x-5":"translate-x-1")})}),jsx("span",{children:o&&o}),(r||n)&&jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[e&&jsx(T,{id:`${f}-label`,htmlFor:f,className:"text-sm font-medium leading-none",children:r}),n&&jsx(T,{id:`${f}-description`,htmlFor:f,className:"text-xs text-muted-foreground",children:n})]})]})]})})});Nt.displayName="Switch";var wi=Nt;var Et=Jt.forwardRef(({label:e,required:t,showCount:r,maxLength:n,className:o,overrideClassName:i=!1,error:a,helperText:l,...s},b)=>{let c=useId(),[v,f]=useState(0),d=u("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",o);return jsx(g,{children:jsxs("div",{className:"space-y-2",children:[e&&jsx(T,{htmlFor:c,required:t,children:e}),jsxs("div",{className:"relative",children:[jsx("textarea",{id:c,className:i?o:d,maxLength:n,onInput:w=>f(w.currentTarget.textLength),ref:b,...s}),r&&jsxs("span",{className:"absolute bottom-2 right-3 text-xs text-muted-foreground",children:[v,n?` / ${n}`:""]})]}),a&&jsx(I,{children:a}),!a&&l&&jsx(V,{children:l})]})})});Et.displayName="TextArea";var Fi=Et;
25
+ `,children:jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{children:e}),jsx("svg",{className:`w-5 h-5 transition-transform ${n?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})}),n&&jsx("div",{className:"px-4 py-3 bg-background border-t border-border",children:t})]})});Ae.displayName="Accordion";var Ln=Ae;function u(...e){return twMerge(clsx(e))}var De=Xt.forwardRef(({className:e,overrideClassName:t,variant:r="primary",size:n="md",href:o,children:i,loading:a=!1,loadingContent:l,...s},b)=>{let c="inline-flex items-center justify-center rounded-lg font-medium cursor-pointer active:translate-y-1 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",v={primary:"bg-blue-600 text-white hover:bg-blue-700 shadow-md focus-visible:ring-blue-500",secondary:"bg-gray-600 text-white hover:bg-gray-700 shadow-sm focus-visible:ring-gray-500",tertiary:"bg-purple-600 text-white hover:bg-purple-700 shadow-sm focus-visible:ring-purple-500",destructive:"bg-red-600 text-white hover:bg-red-700 shadow-sm focus-visible:ring-red-500",success:"bg-green-600 text-white hover:bg-green-700 shadow-sm focus-visible:ring-green-500",warning:"bg-amber-500 text-white hover:bg-amber-600 shadow-sm focus-visible:ring-amber-500",info:"bg-cyan-600 text-white hover:bg-cyan-700 shadow-sm focus-visible:ring-cyan-500",accent:"bg-violet-600 text-white hover:bg-violet-700 shadow-sm focus-visible:ring-violet-500",outline:"border border-gray-300 bg-transparent text-gray-700 hover:bg-gray-50 shadow-sm focus-visible:ring-gray-500",ghost:"bg-transparent text-gray-700 hover:bg-gray-100 focus-visible:ring-gray-500",link:"text-blue-600 underline-offset-4 hover:underline bg-transparent p-0 h-auto shadow-none",gradient:"bg-gradient-to-r from-blue-600 to-purple-600 text-white hover:from-blue-700 hover:to-purple-700 shadow-md focus-visible:ring-blue-500",glass:"bg-white/10 backdrop-blur-md border border-white/20 text-black hover:bg-white/20 shadow-sm focus-visible:ring-white/50",soft:"bg-blue-100 text-blue-700 hover:bg-blue-200 shadow-sm focus-visible:ring-blue-500",dark:"bg-gray-900 text-white hover:bg-gray-800 shadow-md focus-visible:ring-gray-500",light:"bg-gray-100 text-gray-900 hover:bg-gray-200 shadow-sm focus-visible:ring-gray-500",obsidian:"bg-black text-white hover:bg-gray-900 shadow-md border border-gray-800 focus-visible:ring-gray-700",polar:"bg-white text-gray-900 hover:bg-gray-50 shadow-md border border-gray-300 focus-visible:ring-gray-400"},f={xs:"h-7 px-2 text-xs min-w-16",sm:"h-9 px-3 text-sm min-w-20",md:"h-10 px-4 py-2 text-base min-w-24",lg:"h-11 px-6 text-lg min-w-28",xl:"h-12 px-8 text-xl min-w-32"},d=t?e:u(c,v[r],f[n],e);return o?jsx(g,{children:jsx("a",{href:o,className:d,ref:b,children:a&&l?l:i})}):jsx(g,{children:jsx("button",{className:d,ref:b,...s,children:a&&l?l:i})})});De.displayName="Button";var In=De;var $e=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(g,{children:jsx("div",{ref:o,className:t?e:u("rounded-lg border bg-card text-card-foreground shadow-sm",e),...n,children:r})}));$e.displayName="Card";var Be=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(g,{children:jsx("div",{ref:o,className:t?e:u("flex flex-col space-y-1.5 p-6",e),...n,children:r})}));Be.displayName="CardHeader";var Oe=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(g,{children:jsx("h3",{ref:o,className:t?e:u("text-2xl font-semibold leading-none tracking-tight",e),...n,children:r})}));Oe.displayName="CardTitle";var Ge=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(g,{children:jsx("p",{ref:o,className:t?e:u("text-sm text-muted-foreground",e),...n,children:r})}));Ge.displayName="CardDescription";var Ke=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(g,{children:jsx("div",{ref:o,className:t?e:u("p-6 pt-0",e),...n,children:r})}));Ke.displayName="CardContent";var Ue=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(g,{children:jsx("div",{ref:o,className:t?e:u("flex items-center p-6 pt-0",e),...n,children:r})}));Ue.displayName="CardFooter";var Bn=$e,On=Be,Gn=Oe,Kn=Ge,Un=Ke,qn=Ue;var ae=createContext(void 0),ze=forwardRef(({children:e,className:t,...r},n)=>{let[o,i]=useState(!1);return jsx(g,{children:jsx(ae.Provider,{value:{isOpen:o,setIsOpen:i},children:jsx("div",{ref:n,className:u("relative inline-block",t),...r,children:e})})})});ze.displayName="DropdownMenu";var We=({children:e,asChild:t})=>{let r=useContext(ae);if(!r)throw new Error("DropdownMenuTrigger must be used within DropdownMenu");let n=()=>r.setIsOpen(!r.isOpen);if(t){let o=e;return cloneElement(o,{onClick:i=>{o.props.onClick?.(i),n();}})}return jsx(g,{children:jsx("button",{onClick:n,children:e})})};We.displayName="DropdownMenuTrigger";var _e=forwardRef(({children:e,align:t="end",className:r,...n},o)=>{let i=useContext(ae),a=useRef(null);return useEffect(()=>{o&&(typeof o=="function"?o(a.current):o.current=a.current);},[o]),useEffect(()=>{let s=b=>{a.current&&!a.current.contains(b.target)&&i?.setIsOpen(!1);};return i?.isOpen&&document.addEventListener("mousedown",s),()=>{document.removeEventListener("mousedown",s);}},[i?.isOpen]),i?.isOpen?jsx(g,{children:jsx("div",{ref:a,className:u("absolute z-50 mt-2 min-w-32 overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md",{start:"left-0",center:"left-1/2 -translate-x-1/2",end:"right-0"}[t],r),...n,children:e})}):null});_e.displayName="DropdownMenuContent";var Je=forwardRef(({children:e,onClick:t,destructive:r,className:n,...o},i)=>{let a=useContext(ae);return jsx(g,{children:jsx("button",{ref:i,onClick:s=>{t?.(s),a?.setIsOpen(!1);},className:u("w-full text-left px-4 py-2 text-sm hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none",r&&"text-red-600 hover:bg-red-50 hover:text-red-700 focus:bg-red-50 focus:text-red-700",n),...o,children:e})})});Je.displayName="DropdownMenuItem";var Xe=forwardRef(({className:e,...t},r)=>jsx(g,{children:jsx("div",{ref:r,className:u("-mx-1 my-1 h-px bg-border",e),...t})}));Xe.displayName="DropdownMenuSeparator";var je=forwardRef(({children:e,className:t,...r},n)=>jsx(g,{children:jsx("div",{ref:n,className:u("px-2 py-1.5 text-sm font-semibold",t),...r,children:e})}));je.displayName="DropdownMenuLabel";var Zn=ze,Yn=We,Qn=_e,eo=Je,to=Xe,ro=je;var er=({children:e,className:t,overrideClassName:r})=>{if(e)return jsx(g,{children:jsx("p",{className:r?t:u("text-sm text-muted-foreground",t),children:e})})},V=er;var tr=({children:e,required:t,className:r,overrideClassName:n=!1,...o})=>jsx(g,{children:jsxs("div",{className:"flex items-center gap-1",children:[jsx("label",{...o,className:n?r:u("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),children:e}),t&&jsx("span",{className:"text-red-600",children:"*"})]})}),y=tr;var nr=({children:e,className:t,overrideClassName:r})=>{if(e)return jsx(g,{children:jsx("p",{className:r?t:u("text-sm text-red-600 dark:text-red-400",t),children:e})})},I=nr;var Qe=forwardRef(({label:e,required:t,option:r,description:n,icon:o,orientation:i="left",className:a,overrideClassName:l=!1,helperText:s,error:b,...c},v)=>{let f=useId(),d=u("h-4 w-4 rounded border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",b&&"border-destructive",a);return jsx(g,{children:jsxs("div",{className:"space-y-2 w-fit",children:[e&&jsx(y,{required:t,children:e}),jsxs("div",{className:`flex items-center ${i=="left"?"flex-row":"flex-row-reverse"} w-fit gap-2`,children:[jsx("input",{id:f,type:"checkbox",className:l?a:d,ref:v,...c}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{children:o&&o}),jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[r&&jsx(y,{htmlFor:f,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r}),n&&jsx(y,{id:`${f}-description`,htmlFor:f,className:"text-xs text-muted-foreground",children:n})]})]})]}),b&&jsx(I,{children:b}),!b&&s&&jsx(V,{children:s})]})})});Qe.displayName="CheckBox";var Po=Qe;function lr(e,t){let{typeSet:r="field",multiCheck:n=!1,value:o,onChange:i,labelKey:a,valueKey:l,options:s,alignment:b="vertical",className:c,overrideClassName:v=!1,helperText:f,error:d,label:w,name:R,required:h,...T}=e,E=useId(),L=useMemo(()=>new Map(s.map(x=>[String(x[l]),x])),[s,l]),M=useMemo(()=>o==null?[]:r==="field"?n?o.map(x=>String(x)):[String(o)]:n?o.map(x=>String(x[l])):[String(o[l])],[o,r,n,l]),S=(x,P)=>{if(!i)return;let m;if(r==="field")if(n)m=x.map(C=>{let k=L.get(C);return k?k[l]:C});else {let p=x[0];if(!p)m=void 0;else {let C=L.get(p);m=C?C[l]:p;}}else n?m=x.map(C=>L.get(C)).filter(C=>C!==void 0):m=L.get(x[0]??"")??void 0;i({target:{name:R,value:m,type:"checkboxgroup",checked:P}});},H=x=>{let P;n?P=M.includes(x)?M.filter(m=>m!==x):[...M,x]:P=M[0]===x?[]:[x],S(P,P.includes(x));},N=b==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",F=u("h-4 w-4 rounded border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",d&&"border-destructive");return jsx(g,{children:jsxs("div",{className:u("flex flex-col gap-3",c),children:[w&&jsx(y,{required:h,children:w}),jsx("div",{className:N,children:s.map((x,P)=>{let m=String(x[l]),p=M.includes(m),C=`${E}-${m}-${P}`;return jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{...T,id:C,ref:t,type:"checkbox",name:R,checked:p,onChange:()=>H(m),className:v?c:F}),jsx(y,{htmlFor:C,children:String(x[a])})]},C)})}),!!d&&jsx(I,{children:String(d)}),!d&&f&&jsx(V,{children:f})]})})}function cr(){let e=forwardRef(lr);return e.displayName="CheckBoxGroup",e}var dr=cr(),So=dr;var mr=({...e})=>jsx("svg",{...e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),se=mr;var ur=(e,t)=>{useEffect(()=>{let r=n=>{e.current&&!e.current.contains(n.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},nt=ur;function fe({options:e,labelKey:t,valueKey:r,multiple:n,onChange:o,setSearchTerm:i,typeSet:a,name:l}){let[s,b]=useState([]),c=useMemo(()=>new Map(e.map(h=>[String(h[r]),h])),[e,r]),v=useCallback(()=>s.map(h=>c.get(h)).filter(h=>!!h),[s,c]),f=useCallback(h=>{if(!o)return;let T;if(a==="field"?n?T=h:T=h[0]??void 0:n?T=h.map(L=>c.get(L)).filter(L=>L!==void 0):T=c.get(h[0]??"")??void 0,i&&!n){let E=c.get(h[0]??"");E&&i(String(E[t]));}o({target:{name:l,value:T,type:"combobox"}});},[n,o,c,l,a,i,t]),d=useCallback(h=>{let T=String(h[r]),E=n?s.includes(T)?s.filter(L=>L!==T):[...s,T]:[T];b(E),f(E);},[n,s,f,r]),w=useCallback(h=>{let T=s.filter(E=>E!==h);b(T),f(T);},[s,f]),R=useCallback(()=>{b([]),i?.("");let h;a==="field"?h=n?[]:"":h=n?[]:void 0,o?.({target:{name:l,value:h,type:"combobox"}});},[n,o,l,i,a]);return {selectedValues:s,handleSelect:d,handleRemove:w,handleClear:R,getSelectedOptions:v}}function ge(e,t,r){return useMemo(()=>r?e.filter(o=>String(o[t]).toLowerCase().includes(r.toLowerCase())):e,[e,r,t])}var at=({isOpen:e,setIsOpen:t,multiple:r,searchTerm:n,setSearchTerm:o,selectedValues:i,filteredOptions:a,highlightedIndex:l,setHighlightedIndex:s,handleSelect:b,handleRemove:c})=>{let v=useCallback(d=>{if(a.length===0){s(-1);return}s(w=>w<0?d>0?0:a.length-1:(w+d+a.length)%a.length);},[a,s]);return useCallback(d=>{if(!e){if(d.key==="Enter"||d.key==="ArrowDown"){t(!0),s(0),d.preventDefault();return}r&&d.key==="Backspace"&&n===""&&i.length>0&&(d.preventDefault(),c(i[i.length-1]));return}switch(d.key){case"ArrowDown":d.preventDefault(),v(1);break;case"ArrowUp":d.preventDefault(),v(-1);break;case"Enter":d.preventDefault();let w=l>=0?l:0,R=a[w];R&&b(R),r&&o&&o(""),r||(t(!1),s(-1));break;case"Escape":d.preventDefault(),t(!1),s(-1),r||o("");break;case"Tab":t(!1),s(-1);break;case"Home":d.preventDefault(),a.length>0&&s(0);break;case"End":d.preventDefault(),a.length>0&&s(a.length-1);break;case"Backspace":r&&n===""&&i.length>0&&(d.preventDefault(),c(i[i.length-1]));break}},[e,r,n,i,a,l,t,o,s,b,c,v])};function it({option:e,labelKey:t,valueKey:r,onRemove:n}){let o=String(e[t]),i=String(e[r]);return jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded",children:[o,jsx("button",{type:"button",onMouseDown:a=>a.preventDefault(),onClick:()=>n(i),className:"hover:bg-blue-200 dark:hover:bg-blue-800 rounded-full p-0.5 transition-colors","aria-label":`Remover ${o}`,children:"\u2715"})]},i)}function Tr(e,t){let{label:r,required:n=!1,name:o,placeholder:i="Buscar...",labelKey:a,valueKey:l,options:s,value:b,onChange:c,mode:v="single",typeSet:f="field",disabled:d=!1,ClearEnabled:w=!0,helperText:R,error:h=!1,className:T="",...E}=e,L=v==="multiple",[M,S]=useState(!1),[H,N]=useState(""),F=useRef(null),x=useRef(null),P=useRef(null);useImperativeHandle(t,()=>P.current),nt(x,()=>S(!1));let m=ge(s,a,H),[p,C]=useState(-1),{selectedValues:k,handleSelect:Y,handleRemove:Le,handleClear:It,getSelectedOptions:Pe}=fe({options:s,labelKey:a,valueKey:l,value:b,multiple:L,onChange:c,typeSet:f,name:o,setSearchTerm:N}),Ht=at({isOpen:M,setIsOpen:S,multiple:L,searchTerm:H,setSearchTerm:N,selectedValues:k,filteredOptions:m,highlightedIndex:p,setHighlightedIndex:C,handleSelect:Y,handleRemove:Le}),Q=useId(),Ft="w-full bg-transparent outline-none placeholder:text-gray-500 dark:placeholder:text-gray-400 text-gray-900 dark:text-gray-100",St=u("relative w-full min-h-[40px] px-3 py-2 border rounded-md bg-white dark:bg-gray-800",h?"border-red-500":"border-gray-300 dark:border-gray-600",d?"opacity-50 cursor-not-allowed":"cursor-text","focus-within:ring-2 focus-within:ring-blue-500 focus-within:border-blue-500");return jsx(g,{children:jsxs("div",{className:`space-y-2 ${T}`,children:[r&&jsx(y,{htmlFor:Q,required:n,children:r}),jsxs("div",{ref:F,className:"relative",children:[jsxs("div",{className:St,children:[L&&Pe().length>0&&jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:Pe().map(($,G)=>jsx(it,{option:$,labelKey:a,valueKey:l,onRemove:Le},String($[l]??G)))}),jsx("input",{ref:P,...E,name:o,type:"text",placeholder:i,value:H,onChange:$=>{let G=$.target.value;N(G),!M&&G.trim()!==""&&S(!0);},onKeyDown:Ht,onMouseDown:$=>{document.activeElement===P.current&&($.preventDefault(),S(G=>{let ee=!G;return ee&&C(0),ee}));},onFocus:()=>{S(!0),C(0);},disabled:d,className:Ft,role:"combobox","aria-expanded":M,"aria-controls":Q,"aria-activedescendant":p>=0?`${Q}-opt-${p}`:void 0}),w&&!!k.length&&jsx("button",{type:"button",onMouseDown:$=>$.preventDefault(),onClick:It,className:"absolute right-2 top-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 p-1 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700",title:"Limpar sele\xE7\xE3o",children:jsx(se,{width:12,height:12})})]}),M&&jsx("div",{ref:x,id:Q,className:"absolute z-50 w-full mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-auto",role:"listbox","aria-multiselectable":L||void 0,children:m.length===0?jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400",children:"Nenhum resultado encontrado"}):m.map(($,G)=>{let ee=String($[l]),ce=k.includes(ee),de=G===p;return jsx("button",{id:`${Q}-opt-${G}`,"data-index":G,role:"option","aria-selected":ce,type:"button",onMouseDown:At=>At.preventDefault(),onClick:()=>Y($),className:u("w-full px-3 py-2 text-left text-sm transition-colors",de&&"bg-blue-100 dark:bg-blue-800 text-blue-900 dark:text-white",!de&&ce&&"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300",!ce&&!de&&"text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),children:jsx("span",{children:String($[a])})},ee)})})]}),h&&jsx(I,{children:h}),!h&&R&&jsx(V,{children:R})]})})}function Lr(){let e=forwardRef(Tr);return e.displayName="ComboBox",e}var Pr=Lr(),da=Pr;var Rr=({children:e,before:t,after:r,className:n})=>{let i=wr("flex justify-center items-center",{"rounded-l-lg":t,"rounded-r-lg":r},n);return jsx("div",{className:i,children:jsx("span",{children:e})})},he=Rr;var kr=({children:e})=>jsx("div",{className:"absolute px-2",children:jsx("span",{children:e})}),ct=kr;var Er=({children:e})=>jsx("div",{className:"absolute right-0 px-2",children:jsx("span",{children:e})}),mt=Er;function pt(e){e.currentTarget.maxLength=9;let t=e.currentTarget.value;return t=t.replace(/\D/g,""),t=t.replace(/^(\d{5})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function ut(e){let t=e.currentTarget.value;t=t.replace(/\D/g,""),t=t.padStart(3,"0");let r=t.slice(0,-2),n=t.slice(-2),a=`${(r.replace(/^0+/,"")||"0").replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1.")},${n}`;return e.currentTarget.value=a,e}function ft(e){e.currentTarget.maxLength=14;let t=e.currentTarget.value;return t.match(/^(\d{3}).(\d{3}).(\d{3})-(\d{2})$/)||(t=t.replace(/\D/g,""),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{2})$/,"$1-$2"),e.currentTarget.value=t),e}function gt(e){e.currentTarget.maxLength=15;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"($1) $2"),t=t.replace(/(\d{5})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function bt(e){e.currentTarget.maxLength=14;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"($1) $2"),t=t.replace(/(\d{4})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function vt(e){let t=e.currentTarget.value.replace(/\D/g,"");return t.length<=11?(e.currentTarget.maxLength=14,t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{2})$/,"$1-$2")):(e.currentTarget.maxLength=18,t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2")),e.currentTarget.value=t,e}function xt(e){e.currentTarget.maxLength=12;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{1})$/,"$1-$2"),e.currentTarget.value=t,e}function ht(e){e.currentTarget.maxLength=18;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2"),e.currentTarget.value=t,e}var Nr=({e,mask:t})=>{switch(t){case"money":return ut(e);case"mobile":return gt(e);case"phone":return bt(e);case"cpfCnpj":return vt(e);case"cpf":return ft(e);case"rg":return xt(e);case"cnpj":return ht(e);case"cep":return pt(e);default:return e}},Ct=Nr;var Ir=({mask:e,initialValue:t=""})=>{let[r,n]=useState(t);useEffect(()=>{t!==r&&n(t);},[t]);let o=useCallback(a=>{let s=Ct({e:a,mask:e})?.currentTarget?.value??a.currentTarget.value;n(s);},[e]),i=useCallback(()=>n(""),[]);return {value:r,setValue:n,handleChange:o,handleClear:i}},Tt=Ir;var Lt=forwardRef(({label:e,required:t=!1,mask:r,name:n,prefix:o,suffix:i,addonBefore:a,addonBeforeClassName:l,addonAfter:s,addonAfterClassName:b,ClearEnabled:c=!0,className:v,overrideClassName:f=!1,error:d,helperText:w,value:R=void 0,onChange:h,...T},E)=>{let L=useId(),{handleChange:M,handleClear:S,setValue:H}=Tt({mask:r,initialValue:R}),N=u("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",d&&"border-destructive focus-visible:ring-destructive",!o&&!i&&"px-3",o&&!i&&"pl-10 pr-3",i&&!o&&"pl-3 pr-10",o&&i&&"pl-10 pr-10",a&&"rounded-l-none border-l-0",s&&"rounded-r-none border-r-0",v),F=P=>{M(P),h?.(P);},x=()=>{S(),H(""),h?.({target:{name:n||"",value:""}});};return jsx(g,{children:jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsx(y,{htmlFor:L,required:t,children:e}),jsxs("div",{className:"relative flex",children:[a&&jsx(he,{before:!0,className:l,children:a}),jsxs("div",{className:"relative flex items-center w-full",children:[o&&jsx(ct,{children:o}),jsx("input",{id:L,ref:E,name:n,onChange:F,className:f?v:N,...T}),c&&R&&jsx(se,{onClick:x,width:12,height:12,className:u("absolute right-2 cursor-pointer",i&&"right-8")}),i&&jsx(mt,{children:i})]}),s&&jsx(he,{after:!0,className:b,children:s})]}),d&&jsx(I,{children:d}),!d&&w&&jsx(V,{children:w})]})})});Lt.displayName="Input";var Da=Lt;var wt=forwardRef(({length:e=6,groupBy:t,value:r,name:n,label:o,required:i=!1,helperText:a,error:l,onChange:s,onBlur:b,className:c,charType:v="numeric",customPattern:f,caseMode:d="none",...w},R)=>{let h=useId(),T=useRef([]),E=m=>{switch(d){case"upper":return m.toUpperCase();case"lower":case"visual-upper":return m.toLowerCase();case"visual-lower":return m.toUpperCase();default:return m}},L=m=>{if(!m)return "";let p=m.slice(0,1);switch(p=E(p),v){case"numeric":return /\d/.test(p)?p:"";case"alpha":return /[A-Za-z]/.test(p)?p:"";case"alphanumeric":return /[A-Za-z0-9]/.test(p)?p:"";case"custom":return f?.test(p)?p:"";default:return p}},M=()=>(r!=null?String(r):"").split("").map(L).slice(0,e),S=M().concat(Array(e).fill(" ")).slice(0,e),H=m=>{let p=m.split("").map(L).join("").slice(0,e),C=p===""?void 0:typeof r=="number"?Number(p):p;s?.({target:{name:n,value:C}});},N=(m,p)=>{let C=L(p),k=M();if(C===""){k[m]="",H(k.join(""));return}if(p.length>1){let Y=p.split("").map(L).join("").slice(0,e);H(Y),T.current[Math.min(Y.length-1,e-1)]?.focus();return}C&&(k[m]=C,H(k.join("")),m<e-1&&T.current[m+1]?.focus());},F=m=>{let p=M();!p[m]&&m>0?p[m-1]="":p[m]="",H(p.join("")),m>0&&T.current[m-1]?.focus();},x=m=>{m.preventDefault();let C=m.clipboardData.getData("text").split("").map(L).join("").slice(0,e);C&&(H(C),T.current[Math.min(C.length-1,e-1)]?.focus());},P=m=>{switch(d){case"upper":case"visual-upper":return m.toUpperCase();case"lower":case"visual-lower":return m.toLowerCase();default:return m}};return jsx(g,{children:jsxs("div",{className:"flex flex-col gap-2 w-full",children:[o&&jsx(y,{htmlFor:h,required:i,children:o}),jsx("div",{className:u("flex gap-3 items-center",l&&"text-red-500",c),...w,children:S.map((m,p)=>{let C=t&&p>0&&p%t===0;return jsxs(Xt.Fragment,{children:[C&&jsx("span",{className:"flex items-center justify-center text-xl font-bold select-none",children:"-"}),jsx("input",{id:h,type:"text",maxLength:1,inputMode:v==="numeric"?"numeric":"text",value:P(m).trim(),ref:k=>{T.current[p]=k,p===0&&R&&(typeof R=="function"?R(k):typeof R=="object"&&(R.current=k));},onPaste:x,onChange:k=>N(p,k.target.value),onKeyDown:k=>k.key==="Backspace"&&F(p),onBlur:b,className:u("h-14 w-12 text-center text-2xl rounded-md border border-input bg-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",l&&"border-red-500")})]},p)})}),l&&jsx(I,{children:l}),!l&&a&&jsx(V,{children:a})]})})});wt.displayName="OtpInput";var Wa=wt;var Rt=forwardRef(({label:e,required:t,option:r,description:n,icon:o,className:i,overrideClassName:a,helperText:l,error:s,...b},c)=>{let v=useId(),f=u("h-4 w-4 border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s&&"border-destructive",i);return jsx(g,{children:jsxs("div",{className:"space-y-3",children:[e&&jsx(y,{required:t,children:e}),jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{id:v,type:"radio",className:a?i:f,ref:c,...b}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{children:o&&o}),jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[r&&jsx(y,{htmlFor:v,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r}),n&&jsx(y,{id:`${v}-description`,htmlFor:v,className:"text-xs text-muted-foreground",children:n})]})]})]}),s&&jsx(I,{children:s}),!s&&l&&jsx(V,{children:l})]})})});Rt.displayName="Radio";var ti=Rt;function Ur(e,t){let{label:r,required:n,name:o,labelKey:i,valueKey:a,options:l,alignment:s="vertical",className:b,overrideClassName:c=!1,helperText:v,error:f,typeSet:d="field",value:w,onChange:R,...h}=e,T=useId(),E=useMemo(()=>new Map(l.map(N=>[String(N[a]),N])),[l,a]),L=useMemo(()=>w==null?"":String(d==="field"?w:w[a]),[w,d,a]),M=N=>{if(!R)return;let F;if(d==="field"){let x=E.get(N);if(x)F=x[a];else {let P=Number(N);F=Number.isNaN(P)?N:P;}}else F=E.get(N)??void 0;R({target:{name:o,value:F,type:"radiogroup",checked:!0}});},S=s==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",H=u("h-4 w-4 rounded-full border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",f&&"border-destructive");return jsx(g,{children:jsxs("div",{className:u("flex flex-col gap-3",b),children:[r&&jsx(y,{required:n,children:r}),jsx("div",{className:S,children:l.map((N,F)=>{let x=String(N[a]),P=`${T}-${x}-${F}`;return jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{...h,id:P,ref:t,name:o,type:"radio",checked:L===x,onChange:()=>M(x),className:c?b:H}),jsx(y,{htmlFor:P,children:String(N[i])})]},P)})}),f&&jsx(I,{children:String(f)}),!f&&v&&jsx(V,{children:v})]})})}function qr(){let e=forwardRef(Ur);return e.displayName="RadioGroup",e}var zr=qr(),pi=zr;function Jr({label:e,required:t=!1,options:r,labelKey:n,valueKey:o,placeholder:i,error:a,helperText:l,className:s,...b},c){let v=useId(),f=u("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",s);return jsx(g,{children:jsxs("div",{className:"space-y-2",children:[e&&jsx(y,{htmlFor:v,required:t,children:e}),jsxs("select",{id:v,ref:c,className:f,...b,children:[i&&jsx("option",{value:"",disabled:!0,children:i}),r.map((d,w)=>jsx("option",{value:String(d[o]),children:String(d[n])},w))]}),a&&jsx(I,{children:a}),!a&&l&&jsx(V,{children:l})]})})}function Xr(){let e=forwardRef(Jr);return e.displayName="Select",e}var jr=Xr(),Li=jr;var Mt=forwardRef(({label:e,required:t,option:r,description:n,icon:o,checked:i=!1,className:a,overrideClassName:l,error:s,name:b,...c},v)=>{let f=useId();return jsx(g,{children:jsxs("div",{className:"flex flex-col gap-2",children:[e&&jsx(y,{required:t,children:e}),jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",id:f,name:b,checked:i,className:"peer sr-only",ref:v,...c}),jsx("label",{htmlFor:f,className:u("relative flex items-center h-6 w-11 cursor-pointer rounded-full bg-input transition-colors duration-200","peer-checked:bg-primary peer-focus:ring-2 peer-focus:ring-ring peer-focus:ring-offset-2 peer-focus:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50",a),children:jsx("span",{className:u("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",i?"translate-x-5":"translate-x-1")})}),jsx("span",{children:o&&o}),(r||n)&&jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[e&&jsx(y,{id:`${f}-label`,htmlFor:f,className:"text-sm font-medium leading-none",children:r}),n&&jsx(y,{id:`${f}-description`,htmlFor:f,className:"text-xs text-muted-foreground",children:n})]})]})]})})});Mt.displayName="Switch";var Vi=Mt;var Vt=Xt.forwardRef(({label:e,required:t,showCount:r,maxLength:n,className:o,overrideClassName:i=!1,error:a,helperText:l,...s},b)=>{let c=useId(),[v,f]=useState(0),d=u("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",o);return jsx(g,{children:jsxs("div",{className:"space-y-2",children:[e&&jsx(y,{htmlFor:c,required:t,children:e}),jsxs("div",{className:"relative",children:[jsx("textarea",{id:c,className:i?o:d,maxLength:n,onInput:w=>f(w.currentTarget.textLength),ref:b,...s}),r&&jsxs("span",{className:"absolute bottom-2 right-3 text-xs text-muted-foreground",children:[v,n?` / ${n}`:""]})]}),a&&jsx(I,{children:a}),!a&&l&&jsx(V,{children:l})]})})});Vt.displayName="TextArea";var Oi=Vt;
10
26
 
11
- export { vn as AccordionPrimitive, Rn as ButtonPrimitive, An as CardContentPrimitive, Dn as CardDescriptionPrimitive, $n as CardFooterPrimitive, Fn as CardHeaderPrimitive, Hn as CardPrimitive, Sn as CardTitlePrimitive, Eo as CheckBoxGroupPrimitive, xo as CheckBoxPrimitive, oa as ComboBoxPrimitive, Jn as DropdownMenuContentPrimitive, _n as DropdownMenuItemPrimitive, Zn as DropdownMenuLabelPrimitive, Un as DropdownMenuPrimitive, Xn as DropdownMenuSeparatorPrimitive, Wn as DropdownMenuTriggerPrimitive, V as HelperFieldPrimitive, Va as InputPrimitive, T as LabelPrimitive, $t as LicenseProvider, Oa as OtpInputPrimitive, ii as RadioGroupPrimitive, Xa as RadioPrimitive, vi as SelectPrimitive, wi as SwitchPrimitive, Fi as TextAreaPrimitive, I as ValidateFieldPrimitive };
27
+ export { Ln as AccordionPrimitive, In as ButtonPrimitive, Un as CardContentPrimitive, Kn as CardDescriptionPrimitive, qn as CardFooterPrimitive, On as CardHeaderPrimitive, Bn as CardPrimitive, Gn as CardTitlePrimitive, So as CheckBoxGroupPrimitive, Po as CheckBoxPrimitive, da as ComboBoxPrimitive, Qn as DropdownMenuContentPrimitive, eo as DropdownMenuItemPrimitive, ro as DropdownMenuLabelPrimitive, Zn as DropdownMenuPrimitive, to as DropdownMenuSeparatorPrimitive, Yn as DropdownMenuTriggerPrimitive, V as HelperFieldPrimitive, Da as InputPrimitive, y as LabelPrimitive, Ot as LicenseProvider, Wa as OtpInputPrimitive, pi as RadioGroupPrimitive, ti as RadioPrimitive, Li as SelectPrimitive, Vi as SwitchPrimitive, Oi as TextAreaPrimitive, I as ValidateFieldPrimitive };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mvr-ui/components",
3
- "version": "1.0.93",
3
+ "version": "1.0.94",
4
4
  "sideEffects": false,
5
5
  "main": "dist/page.cjs",
6
6
  "module": "dist/page.js",