@mvr-ui/components 1.0.103 → 1.0.105

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,16 +1,16 @@
1
1
  'use strict';
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
- var jr = require('react');
5
- var zn = require('clsx');
4
+ var Wn = require('react');
5
+ var Go = 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 jr__default = /*#__PURE__*/_interopDefault(jr);
11
- var zn__default = /*#__PURE__*/_interopDefault(zn);
10
+ var Wn__default = /*#__PURE__*/_interopDefault(Wn);
11
+ var Go__default = /*#__PURE__*/_interopDefault(Go);
12
12
 
13
- var ot=({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 at=(e,t)=>{let r="Problema com licen\xE7a da aplica\xE7\xE3o",n=`
13
+ var kt=({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 Nt=(e,t)=>{let r="Problema com licen\xE7a da aplica\xE7\xE3o",n=`
14
14
  Ol\xE1,
15
15
 
16
16
  Estou enfrentando um problema com a licen\xE7a da aplica\xE7\xE3o.
@@ -19,68 +19,95 @@ Erro:
19
19
  ${t??"Licen\xE7a inv\xE1lida"}
20
20
 
21
21
  Aguardo retorno.
22
- `,o=`mailto:${e}?subject=${encodeURIComponent(r)}&body=${encodeURIComponent(n)}`;window.location.href=o;};var it=(e,t)=>{let r=`
22
+ `,o=`mailto:${e}?subject=${encodeURIComponent(r)}&body=${encodeURIComponent(n)}`;window.location.href=o;};var Pt=(e,t)=>{let r=`
23
23
  Ol\xE1! Estou com um problema de licen\xE7a na aplica\xE7\xE3o.
24
24
 
25
25
  Erro:
26
26
  ${t??"Licen\xE7a inv\xE1lida"}
27
27
 
28
28
  Pode me ajudar?
29
- `,n=`https://wa.me/${e}?text=${encodeURIComponent(r)}`;window.open(n,"_blank");};var lt=jr.createContext(void 0),Gr=({children:e,licenseKey:t})=>{let[r,n]=jr.useState(!1),[o,i]=jr.useState(null),[a,l]=jr.useState(!0),s=p=>{if(i(null),!p)throw new Error("\u{1F512} Chave de licen\xE7a \xE9 obrigat\xF3ria");let d="chave-secreta-123";if(p!==d)throw new Error("\u274C Chave de licen\xE7a inv\xE1lida");n(!0);};return jr.useEffect(()=>{if(t){l(!0);try{s(t);}catch(p){i(p instanceof Error?p.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(lt.Provider,{value:{isLicenseValid:r,validateLicense:s,licenseError:o},children:r?e:jsxRuntime.jsx(ot,{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:()=>it("5544998204407",o)},{label:"Enviar e-mail",variant:"secondary",onClick:()=>at("marcos.vinicius.engsof@gmail.com",o)}]})})},ct=()=>{let e=jr.useContext(lt);if(!e)throw new Error("useLicense deve ser usado dentro de um LicenseProvider");return e};var ut=({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 v=({children:e})=>{let{isLicenseValid:t}=ct();return t?jsxRuntime.jsx(jsxRuntime.Fragment,{children:e}):jsxRuntime.jsx(ut,{})};var ft=({items:e,type:t="single",defaultValue:r,value:n,onValueChange:o,className:i=""})=>{let a=d=>d===void 0?[]:Array.isArray(d)?d:[d],[l,s]=jr.useState(a(n??r));jr.useEffect(()=>{n!==void 0&&s(a(n));},[n]);let p=jr.useCallback(d=>{s(c=>{let u;return t==="single"?u=c.includes(d)?[]:[d]:u=c.includes(d)?c.filter(m=>m!==d):[...c,d],o?.(t==="single"?u[0]??"":u),u});},[t,o]);return jsxRuntime.jsx("div",{className:`space-y-2 ${i}`,children:e.map(d=>jsxRuntime.jsx(Kr,{...d,isOpen:l.includes(d.id),onToggle:()=>p(d.id)},d.id))})},Kr=({title:e,content:t,disabled:r=!1,isOpen:n,onToggle:o})=>jsxRuntime.jsx(v,{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
29
+ `,n=`https://wa.me/${e}?text=${encodeURIComponent(r)}`;window.open(n,"_blank");};var Lt=Wn.createContext(void 0),Sn=({children:e,licenseKey:t})=>{let[r,n]=Wn.useState(!1),[o,i]=Wn.useState(null),[a,l]=Wn.useState(!0),s=m=>{if(i(null),!m)throw new Error("\u{1F512} Chave de licen\xE7a \xE9 obrigat\xF3ria");let u="chave-secreta-123";if(m!==u)throw new Error("\u274C Chave de licen\xE7a inv\xE1lida");n(!0);};return Wn.useEffect(()=>{if(t){l(!0);try{s(t);}catch(m){i(m instanceof Error?m.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(Lt.Provider,{value:{isLicenseValid:r,validateLicense:s,licenseError:o},children:r?e:jsxRuntime.jsx(kt,{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:()=>Pt("5544998204407",o)},{label:"Enviar e-mail",variant:"secondary",onClick:()=>Nt("marcos.vinicius.engsof@gmail.com",o)}]})})},Rt=()=>{let e=Wn.useContext(Lt);if(!e)throw new Error("useLicense deve ser usado dentro de um LicenseProvider");return e};var Mt=({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 f=({children:e})=>{let{isLicenseValid:t}=Rt();return t?jsxRuntime.jsx(jsxRuntime.Fragment,{children:e}):jsxRuntime.jsx(Mt,{})};var St=({items:e,type:t="single",defaultValue:r,value:n,onValueChange:o,className:i=""})=>{let a=u=>u===void 0?[]:Array.isArray(u)?u:[u],[l,s]=Wn.useState(a(n??r));Wn.useEffect(()=>{n!==void 0&&s(a(n));},[n]);let m=Wn.useCallback(u=>{s(c=>{let d;return t==="single"?d=c.includes(u)?[]:[u]:d=c.includes(u)?c.filter(p=>p!==u):[...c,u],o?.(t==="single"?d[0]??"":d),d});},[t,o]);return jsxRuntime.jsx("div",{className:`space-y-2 ${i}`,children:e.map(u=>jsxRuntime.jsx(Bn,{...u,isOpen:l.includes(u.id),onToggle:()=>m(u.id)},u.id))})},Bn=({title:e,content:t,disabled:r=!1,isOpen:n,onToggle:o})=>jsxRuntime.jsx(f,{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
30
30
  ${r?"opacity-50 cursor-not-allowed":"hover:bg-accent hover:text-accent-foreground"}
31
31
  ${n?"bg-accent text-accent-foreground":"bg-background text-foreground"}
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})]})});ft.displayName="Accordion";var ea=ft;function x(...e){return tailwindMerge.twMerge(zn.clsx(e))}var bt=jr.forwardRef(({className:e,overrideClassName:t=!1,variant:r="default",children:n,...o},i)=>jsxRuntime.jsx(v,{children:jsxRuntime.jsx("div",{ref:i,className:t?e:x("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{default:"bg-primary text-primary-foreground hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"bg-red-500 text-white hover:bg-red-600",outline:"text-foreground border border-input",ghost:"bg-transparent text-foreground hover:bg-muted",link:"text-primary underline-offset-4 hover:underline",success:"bg-green-500 text-white hover:bg-green-600",warning:"bg-yellow-500 text-black hover:bg-yellow-600",info:"bg-blue-500 text-white hover:bg-blue-600",subtle:"bg-muted text-muted-foreground hover:bg-muted/80",dark:"bg-zinc-900 text-white hover:bg-zinc-800",light:"bg-zinc-100 text-zinc-900 hover:bg-zinc-200"}[r],e),...o,children:n})}));bt.displayName="Badge";var da=bt;var vt=jr__default.default.forwardRef(({className:e,overrideClassName:t,variant:r="primary",size:n="md",href:o,children:i,loading:a=!1,loadingContent:l,...s},p)=>{let d="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",c={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"},u={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"},m=t?e:x(d,c[r],u[n],e);return o?jsxRuntime.jsx(v,{children:jsxRuntime.jsx("a",{href:o,className:m,ref:p,children:a&&l?l:i})}):jsxRuntime.jsx(v,{children:jsxRuntime.jsx("button",{className:m,ref:p,...s,children:a&&l?l:i})})});vt.displayName="Button";var ba=vt;var ht=jr.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(v,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:x("rounded-lg border bg-card text-card-foreground shadow-sm",e),...n,children:r})}));ht.displayName="Card";var xt=jr.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(v,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:x("flex flex-col space-y-1.5 p-6",e),...n,children:r})}));xt.displayName="CardHeader";var yt=jr.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(v,{children:jsxRuntime.jsx("h3",{ref:o,className:t?e:x("text-2xl font-semibold leading-none tracking-tight",e),...n,children:r})}));yt.displayName="CardTitle";var Ct=jr.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(v,{children:jsxRuntime.jsx("p",{ref:o,className:t?e:x("text-sm text-muted-foreground",e),...n,children:r})}));Ct.displayName="CardDescription";var wt=jr.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(v,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:x("p-6 pt-0",e),...n,children:r})}));wt.displayName="CardContent";var kt=jr.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(v,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:x("flex items-center p-6 pt-0",e),...n,children:r})}));kt.displayName="CardFooter";var ka=ht,Pa=xt,Ta=yt,La=Ct,Na=wt,Ra=kt;var Re=jr.createContext(void 0),Tt=jr.forwardRef(({children:e,className:t,...r},n)=>{let[o,i]=jr.useState(!1);return jsxRuntime.jsx(v,{children:jsxRuntime.jsx(Re.Provider,{value:{isOpen:o,setIsOpen:i},children:jsxRuntime.jsx("div",{ref:n,className:x("relative inline-block",t),...r,children:e})})})});Tt.displayName="DropdownMenu";var Lt=({children:e,asChild:t})=>{let r=jr.useContext(Re);if(!r)throw new Error("DropdownMenuTrigger must be used within DropdownMenu");let n=()=>r.setIsOpen(!r.isOpen);if(t){let o=e;return jr.cloneElement(o,{onClick:i=>{o.props.onClick?.(i),n();}})}return jsxRuntime.jsx(v,{children:jsxRuntime.jsx("button",{onClick:n,children:e})})};Lt.displayName="DropdownMenuTrigger";var Nt=jr.forwardRef(({children:e,align:t="end",className:r,...n},o)=>{let i=jr.useContext(Re),a=jr.useRef(null);return jr.useEffect(()=>{o&&(typeof o=="function"?o(a.current):o.current=a.current);},[o]),jr.useEffect(()=>{let s=p=>{a.current&&!a.current.contains(p.target)&&i?.setIsOpen(!1);};return i?.isOpen&&document.addEventListener("mousedown",s),()=>{document.removeEventListener("mousedown",s);}},[i?.isOpen]),i?.isOpen?jsxRuntime.jsx(v,{children:jsxRuntime.jsx("div",{ref:a,className:x("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});Nt.displayName="DropdownMenuContent";var Rt=jr.forwardRef(({children:e,onClick:t,destructive:r,className:n,...o},i)=>{let a=jr.useContext(Re);return jsxRuntime.jsx(v,{children:jsxRuntime.jsx("button",{ref:i,onClick:s=>{t?.(s),a?.setIsOpen(!1);},className:x("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})})});Rt.displayName="DropdownMenuItem";var Dt=jr.forwardRef(({className:e,...t},r)=>jsxRuntime.jsx(v,{children:jsxRuntime.jsx("div",{ref:r,className:x("-mx-1 my-1 h-px bg-border",e),...t})}));Dt.displayName="DropdownMenuSeparator";var Mt=jr.forwardRef(({children:e,className:t,...r},n)=>jsxRuntime.jsx(v,{children:jsxRuntime.jsx("div",{ref:n,className:x("px-2 py-1.5 text-sm font-semibold",t),...r,children:e})}));Mt.displayName="DropdownMenuLabel";var Va=Tt,Ha=Lt,Aa=Nt,$a=Rt,Oa=Dt,Ba=Mt;var rn=({children:e,className:t,overrideClassName:r})=>{if(e)return jsxRuntime.jsx(v,{children:jsxRuntime.jsx("p",{className:r?t:x("text-sm text-muted-foreground",t),children:e})})},$=rn;var nn=({children:e,required:t,className:r,overrideClassName:n=!1,...o})=>jsxRuntime.jsx(v,{children:jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("label",{...o,className:n?r:x("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:"*"})]})}),D=nn;var an=({children:e,className:t,overrideClassName:r})=>{if(e)return jsxRuntime.jsx(v,{children:jsxRuntime.jsx("p",{className:r?t:x("text-sm text-red-600 dark:text-red-400",t),children:e})})},O=an;var It=jr.forwardRef(({label:e,required:t,option:r,description:n,icon:o,orientation:i="left",className:a,overrideClassName:l=!1,helperText:s,error:p,...d},c)=>{let u=jr.useId(),m=x("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",p&&"border-destructive",a);return jsxRuntime.jsx(v,{children:jsxRuntime.jsxs("div",{className:"space-y-2 w-fit",children:[e&&jsxRuntime.jsx(D,{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:u,type:"checkbox",className:l?a:m,ref:c,...d}),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(D,{htmlFor:u,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r}),n&&jsxRuntime.jsx(D,{id:`${u}-description`,htmlFor:u,className:"text-xs text-muted-foreground",children:n})]})]})]}),p&&jsxRuntime.jsx(O,{children:p}),!p&&s&&jsxRuntime.jsx($,{children:s})]})})});It.displayName="CheckBox";var si=It;function un(e,t){let{typeSet:r="field",multiCheck:n=!1,value:o,onChange:i,labelKey:a,valueKey:l,options:s,alignment:p="vertical",className:d,overrideClassName:c=!1,helperText:u,error:m,label:L,name:y,required:b,...h}=e,M=jr.useId(),R=jr.useMemo(()=>new Map(s.map(P=>[String(P[l]),P])),[s,l]),F=jr.useMemo(()=>o==null?[]:r==="field"?n?o.map(P=>String(P)):[String(o)]:n?o.map(P=>String(P[l])):[String(o[l])],[o,r,n,l]),I=(P,T)=>{if(!i)return;let f;if(r==="field")if(n)f=P.map(N=>{let E=R.get(N);return E?E[l]:N});else {let g=P[0];if(!g)f=void 0;else {let N=R.get(g);f=N?N[l]:g;}}else n?f=P.map(N=>R.get(N)).filter(N=>N!==void 0):f=R.get(P[0]??"")??void 0;i({target:{name:y,value:f,type:"checkboxgroup",checked:T}});},A=P=>{let T;n?T=F.includes(P)?F.filter(f=>f!==P):[...F,P]:T=F[0]===P?[]:[P],I(T,T.includes(P));},S=p==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",B=x("h-4 w-4 rounded border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",m&&"border-destructive");return jsxRuntime.jsx(v,{children:jsxRuntime.jsxs("div",{className:x("flex flex-col gap-3",d),children:[L&&jsxRuntime.jsx(D,{required:b,children:L}),jsxRuntime.jsx("div",{className:S,children:s.map((P,T)=>{let f=String(P[l]),g=F.includes(f),N=`${M}-${f}-${T}`;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{...h,id:N,ref:t,type:"checkbox",name:y,checked:g,onChange:()=>A(f),className:c?d:B}),jsxRuntime.jsx(D,{htmlFor:N,children:String(P[a])})]},N)})}),!!m&&jsxRuntime.jsx(O,{children:String(m)}),!m&&u&&jsxRuntime.jsx($,{children:u})]})})}function mn(){let e=jr.forwardRef(un);return e.displayName="CheckBoxGroup",e}var pn=mn(),hi=pn;var vn=["#000000","#ffffff","#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ffa500","#800080","#ffc0cb","#a52a2a","#808080","#000080","#008000"],At=jr__default.default.forwardRef(({label:e,required:t,onChange:r,disabled:n=!1,presetColors:o=vn,showPresets:i=!0,className:a,error:l,helperText:s,name:p},d)=>{let c=jr.useId(),u=jr.useRef(null),[m,L]=jr.useState(!1),[y,b]=jr.useState("COLOR"),[h,M]=jr.useState("HEX"),[R,F]=jr.useState("#000000"),[I,A]=jr.useState(0),[S,B]=jr.useState(0),[P,T]=jr.useState(0),[f,g]=jr.useState(1),[N,E]=jr.useState("#000000"),[V,J]=jr.useState("#ffffff"),[te,he]=jr.useState(90),[k,C]=jr.useState("linear-gradient(90deg, #000000, #ffffff)"),G=(w,U,we)=>Math.min(we,Math.max(U,w)),K=w=>{let U=w.replace("#","");return {r:parseInt(U.slice(0,2),16),g:parseInt(U.slice(2,4),16),b:parseInt(U.slice(4,6),16)}},z=w=>{r?.({target:{value:w,name:p}});};jr.useEffect(()=>{let w=U=>{u.current&&!u.current.contains(U.target)&&L(!1);};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[]),jr.useEffect(()=>{if(/^#[0-9A-F]{6}$/i.test(R)){let w=K(R);A(w.r),B(w.g),T(w.b);}},[R]),jr.useEffect(()=>{let w=`linear-gradient(${te}deg, ${N}, ${V})`;C(w),y==="GRADIENT"&&z(w);},[N,V,te]);let q=()=>{if(f>=1){if(h==="HEX")return R;if(h==="RGB")return `rgb(${I}, ${S}, ${P})`}return `rgba(${I}, ${S}, ${P}, ${Number(f.toFixed(2))})`},j=y==="GRADIENT"?k:q();return jsxRuntime.jsx(v,{children:jsxRuntime.jsxs("div",{className:`space-y-2 ${a??""}`,children:[e&&jsxRuntime.jsx(D,{htmlFor:c,required:t,children:e}),jsxRuntime.jsxs("div",{ref:u,className:"relative",children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>!n&&L(!m),className:"flex items-center gap-2 px-3 py-2 border rounded-md bg-background w-full",children:[jsxRuntime.jsx("div",{className:"w-6 h-6 rounded border",style:{background:j}}),jsxRuntime.jsx("span",{className:"text-xs font-mono truncate",children:j})]}),m&&jsxRuntime.jsxs("div",{className:"absolute z-50 mt-1 w-85 bg-popover border rounded-md p-4 space-y-3 shadow-lg",children:[jsxRuntime.jsx("div",{className:"flex gap-2",children:["COLOR","GRADIENT"].map(w=>jsxRuntime.jsx("button",{type:"button",onClick:()=>b(w),className:`px-2 py-1 text-xs rounded ${y===w?"bg-primary text-white":"border"}`,children:w==="COLOR"?"Cor":"Gradiente"},w))}),jsxRuntime.jsx("div",{className:"w-full h-10 rounded border",style:{background:j}}),y==="COLOR"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("input",{ref:d,type:"color",value:R,onChange:w=>{F(w.target.value.toUpperCase()),z(q());},className:"w-full h-10 rounded"}),jsxRuntime.jsxs("div",{className:"flex gap-2 items-center",children:[jsxRuntime.jsxs("select",{value:h,onChange:w=>M(w.target.value),className:"px-2 py-1 text-xs border rounded",children:[jsxRuntime.jsx("option",{value:"HEX",children:"HEX"}),jsxRuntime.jsx("option",{value:"RGB",children:"RGB"}),jsxRuntime.jsx("option",{value:"RGBA",children:"RGBA"})]}),h==="HEX"&&jsxRuntime.jsx("input",{value:R,onChange:w=>{let U=w.target.value.toUpperCase().replace(/[^0-9A-F#]/g,"");U.startsWith("#")||(U="#"+U),U="#"+U.slice(1,7),F(U),/^#[0-9A-F]{6}$/.test(U)&&z(U);},className:"flex-1 px-2 py-1 text-xs font-mono border rounded",placeholder:"#000000"}),(h==="RGB"||h==="RGBA")&&jsxRuntime.jsx("div",{className:"flex gap-2",children:[{l:"R",v:I,s:A},{l:"G",v:S,s:B},{l:"B",v:P,s:T}].map(({l:w,v:U,s:we})=>jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("span",{className:"text-xs font-semibold",children:w}),jsxRuntime.jsx("input",{type:"number",min:0,max:255,value:U,onChange:Ar=>{we(G(+Ar.target.value,0,255)),z(q());},className:"w-14 px-1 py-1 text-xs border rounded"})]},w))})]}),h==="RGBA"&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs font-semibold",children:"A"}),jsxRuntime.jsx("input",{type:"range",min:0,max:1,step:.01,value:f,onChange:w=>{g(+w.target.value),z(q());},className:"flex-1"}),jsxRuntime.jsxs("span",{className:"text-xs w-10 text-right",children:[Math.round(f*100),"%"]})]}),i&&jsxRuntime.jsx("div",{className:"grid grid-cols-5 gap-1",children:o.map(w=>jsxRuntime.jsx("button",{type:"button",onClick:()=>{F(w),g(1),z(w);},className:"w-8 h-8 rounded border",style:{background:w}},w))})]}),y==="GRADIENT"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex gap-2 items-center",children:[jsxRuntime.jsx("input",{type:"color",value:N,onChange:w=>E(w.target.value)}),jsxRuntime.jsx("span",{className:"text-xs",children:"\u2192"}),jsxRuntime.jsx("input",{type:"color",value:V,onChange:w=>J(w.target.value)})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs",children:"\xC2ngulo"}),jsxRuntime.jsx("input",{type:"range",min:0,max:360,value:te,onChange:w=>he(+w.target.value),className:"flex-1"}),jsxRuntime.jsxs("span",{className:"text-xs w-10 text-right",children:[te,"\xB0"]})]})]})]})]}),l&&jsxRuntime.jsx(O,{children:l}),!l&&s&&jsxRuntime.jsx($,{children:s})]})})});At.displayName="ColorPicker";var Li=At;var hn=({...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"})}),Me=hn;var yn=(e,t)=>{jr.useEffect(()=>{let r=n=>{e.current&&!e.current.contains(n.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},Ot=yn;function Oe({options:e,labelKey:t,valueKey:r,multiple:n,onChange:o,setSearchTerm:i,typeSet:a,name:l}){let[s,p]=jr.useState([]),d=jr.useMemo(()=>new Map(e.map(b=>[String(b[r]),b])),[e,r]),c=jr.useCallback(()=>s.map(b=>d.get(b)).filter(b=>!!b),[s,d]),u=jr.useCallback(b=>{if(!o)return;let h;if(a==="field"?n?h=b:h=b[0]??void 0:n?h=b.map(R=>d.get(R)).filter(R=>R!==void 0):h=d.get(b[0]??"")??void 0,i&&!n){let M=d.get(b[0]??"");M&&i(String(M[t]));}o({target:{name:l,value:h,type:"combobox"}});},[n,o,d,l,a,i,t]),m=jr.useCallback(b=>{let h=String(b[r]),M=n?s.includes(h)?s.filter(R=>R!==h):[...s,h]:[h];p(M),u(M);},[n,s,u,r]),L=jr.useCallback(b=>{let h=s.filter(M=>M!==b);p(h),u(h);},[s,u]),y=jr.useCallback(()=>{p([]),i?.("");let b;a==="field"?b=n?[]:"":b=n?[]:void 0,o?.({target:{name:l,value:b,type:"combobox"}});},[n,o,l,i,a]);return {selectedValues:s,handleSelect:m,handleRemove:L,handleClear:y,getSelectedOptions:c}}function Be(e,t,r){return jr.useMemo(()=>r?e.filter(o=>String(o[t]).toLowerCase().includes(r.toLowerCase())):e,[e,r,t])}var Gt=({isOpen:e,setIsOpen:t,multiple:r,searchTerm:n,setSearchTerm:o,selectedValues:i,filteredOptions:a,highlightedIndex:l,setHighlightedIndex:s,handleSelect:p,handleRemove:d})=>{let c=jr.useCallback(m=>{if(a.length===0){s(-1);return}s(L=>L<0?m>0?0:a.length-1:(L+m+a.length)%a.length);},[a,s]);return jr.useCallback(m=>{if(!e){if(m.key==="Enter"||m.key==="ArrowDown"){t(!0),s(0),m.preventDefault();return}r&&m.key==="Backspace"&&n===""&&i.length>0&&(m.preventDefault(),d(i[i.length-1]));return}switch(m.key){case"ArrowDown":m.preventDefault(),c(1);break;case"ArrowUp":m.preventDefault(),c(-1);break;case"Enter":m.preventDefault();let L=l>=0?l:0,y=a[L];y&&p(y),r&&o&&o(""),r||(t(!1),s(-1));break;case"Escape":m.preventDefault(),t(!1),s(-1),r||o("");break;case"Tab":t(!1),s(-1);break;case"Home":m.preventDefault(),a.length>0&&s(0);break;case"End":m.preventDefault(),a.length>0&&s(a.length-1);break;case"Backspace":r&&n===""&&i.length>0&&(m.preventDefault(),d(i[i.length-1]));break}},[e,r,n,i,a,l,t,o,s,p,d,c])};function Ut({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 Dn(e,t){let{label:r,required:n=!1,name:o,placeholder:i="Buscar...",labelKey:a,valueKey:l,options:s,value:p,onChange:d,mode:c="single",typeSet:u="field",disabled:m=!1,ClearEnabled:L=!0,helperText:y,error:b=!1,className:h="",...M}=e,R=c==="multiple",[F,I]=jr.useState(!1),[A,S]=jr.useState(""),B=jr.useRef(null),P=jr.useRef(null),T=jr.useRef(null);jr.useImperativeHandle(t,()=>T.current),Ot(P,()=>I(!1));let f=Be(s,a,A),[g,N]=jr.useState(-1),{selectedValues:E,handleSelect:V,handleRemove:J,handleClear:te,getSelectedOptions:he}=Oe({options:s,labelKey:a,valueKey:l,value:p,multiple:R,onChange:d,typeSet:u,name:o,setSearchTerm:S}),k=Gt({isOpen:F,setIsOpen:I,multiple:R,searchTerm:A,setSearchTerm:S,selectedValues:E,filteredOptions:f,highlightedIndex:g,setHighlightedIndex:N,handleSelect:V,handleRemove:J}),C=jr.useId(),G="w-full bg-transparent outline-none placeholder:text-gray-500 dark:placeholder:text-gray-400 text-gray-900 dark:text-gray-100",K=x("relative w-full min-h-[40px] px-3 py-2 border rounded-md bg-white dark:bg-gray-800",b?"border-red-500":"border-gray-300 dark:border-gray-600",m?"opacity-50 cursor-not-allowed":"cursor-text","focus-within:ring-2 focus-within:ring-blue-500 focus-within:border-blue-500");return jsxRuntime.jsx(v,{children:jsxRuntime.jsxs("div",{className:`space-y-2 ${h}`,children:[r&&jsxRuntime.jsx(D,{htmlFor:C,required:n,children:r}),jsxRuntime.jsxs("div",{ref:B,className:"relative",children:[jsxRuntime.jsxs("div",{className:K,children:[R&&he().length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:he().map((z,q)=>jsxRuntime.jsx(Ut,{option:z,labelKey:a,valueKey:l,onRemove:J},String(z[l]??q)))}),jsxRuntime.jsx("input",{ref:T,...M,name:o,type:"text",placeholder:i,value:A,onChange:z=>{let q=z.target.value;S(q),!F&&q.trim()!==""&&I(!0);},onKeyDown:k,onMouseDown:z=>{document.activeElement===T.current&&(z.preventDefault(),I(q=>{let j=!q;return j&&N(0),j}));},onFocus:()=>{I(!0),N(0);},disabled:m,className:G,role:"combobox","aria-expanded":F,"aria-controls":C,"aria-activedescendant":g>=0?`${C}-opt-${g}`:void 0}),L&&!!E.length&&jsxRuntime.jsx("button",{type:"button",onMouseDown:z=>z.preventDefault(),onClick:te,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(Me,{width:12,height:12})})]}),F&&jsxRuntime.jsx("div",{ref:P,id:C,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":R||void 0,children:f.length===0?jsxRuntime.jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400",children:"Nenhum resultado encontrado"}):f.map((z,q)=>{let j=String(z[l]),w=E.includes(j),U=q===g;return jsxRuntime.jsx("button",{id:`${C}-opt-${q}`,"data-index":q,role:"option","aria-selected":w,type:"button",onMouseDown:we=>we.preventDefault(),onClick:()=>V(z),className:x("w-full px-3 py-2 text-left text-sm transition-colors",U&&"bg-blue-100 dark:bg-blue-800 text-blue-900 dark:text-white",!U&&w&&"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300",!w&&!U&&"text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),children:jsxRuntime.jsx("span",{children:String(z[a])})},j)})})]}),b&&jsxRuntime.jsx(O,{children:b}),!b&&y&&jsxRuntime.jsx($,{children:y})]})})}function Mn(){let e=jr.forwardRef(Dn);return e.displayName="ComboBox",e}var En=Mn(),ts=En;var Fn=({...e})=>jsxRuntime.jsx("svg",{...e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),qt=Fn;var In=({...e})=>jsxRuntime.jsx("svg",{...e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})}),ie=In;var Sn=({...e})=>jsxRuntime.jsx("svg",{...e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),se=Sn;var me=["Janeiro","Fevereiro","Mar\xE7o","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"];var Kt=["Dom","Seg","Ter","Qua","Qui","Sex","S\xE1b"];var We=({type:e,currentMonth:t,selectedDate:r,onChange:n,onNavigate:o,onMonthClick:i,onYearClick:a})=>{let l=s=>{let p=s.getFullYear(),d=s.getMonth(),c=new Date(p,d,1),m=new Date(p,d+1,0).getDate(),L=c.getDay(),y=[];for(let b=L-1;b>=0;b--)y.push({date:new Date(p,d,-b),isCurrentMonth:!1});for(let b=1;b<=m;b++)y.push({date:new Date(p,d,b),isCurrentMonth:!0});for(;y.length<42;)y.push({date:new Date(p,d+1,y.length-m+1),isCurrentMonth:!1});return y};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>o("prev"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsxRuntime.jsx(ie,{width:16,height:16})}),jsxRuntime.jsxs("div",{className:"font-medium flex gap-1",children:[jsxRuntime.jsx("span",{className:"cursor-pointer hover:underline",onClick:i,children:me[t.getMonth()]}),jsxRuntime.jsx("span",{className:"cursor-pointer hover:underline",onClick:a,children:t.getFullYear()})]}),jsxRuntime.jsx("button",{type:"button",onClick:()=>o("next"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsxRuntime.jsx(se,{width:16,height:16})})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:Kt.map(s=>jsxRuntime.jsx("div",{className:"text-center text-xs font-medium text-muted-foreground p-2",children:s},s))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1",children:l(t).map((s,p)=>{let c=r&&s.date.toDateString()===r.toDateString(),u=s.date.toDateString()===new Date().toDateString();return jsxRuntime.jsx("button",{type:"button",onClick:()=>{if(e==="datetime-local"){let m=r??new Date,L=new Date(s.date.getFullYear(),s.date.getMonth(),s.date.getDate(),m.getHours(),m.getMinutes(),m.getSeconds());n(L);}else n(s.date);},className:`
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})]})});St.displayName="Accordion";var mi=St;function g(...e){return tailwindMerge.twMerge(Go.clsx(e))}var Vt=Wn.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("h5",{ref:o,className:t?e:g("mb-1 font-medium leading-none tracking-tight",e),...n,children:r})}));Vt.displayName="AlertTitle";var It=Wn.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:g("text-sm [&_p]:leading-relaxed",e),...n,children:r})}));It.displayName="AlertDescription";var Ht=Wn.forwardRef(({className:e,overrideClassName:t=!1,variant:r="default",children:n,...o},i)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:i,role:"alert",className:t?e:g("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:-translate-y-0.75 [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{default:"bg-background text-foreground border-border",destructive:"border-red-500/50 text-red-700 dark:text-red-400 bg-red-50 dark:bg-red-950/50 [&>svg]:text-red-600 dark:[&>svg]:text-red-400",warning:"border-yellow-500/50 text-yellow-700 dark:text-yellow-400 bg-yellow-50 dark:bg-yellow-950/50 [&>svg]:text-yellow-600 dark:[&>svg]:text-yellow-400",success:"border-green-500/50 text-green-700 dark:text-green-400 bg-green-50 dark:bg-green-950/50 [&>svg]:text-green-600 dark:[&>svg]:text-green-400"}[r],e),...o,children:n})}));Ht.displayName="Alert";var Ci=Ht,ki=Vt,Ni=It;var At=Wn.forwardRef(({className:e,overrideClassName:t=!1,variant:r="default",children:n,...o},i)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:i,className:t?e:g("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{default:"bg-primary text-primary-foreground hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"bg-red-500 text-white hover:bg-red-600",outline:"text-foreground border border-input",ghost:"bg-transparent text-foreground hover:bg-muted",link:"text-primary underline-offset-4 hover:underline",success:"bg-green-500 text-white hover:bg-green-600",warning:"bg-yellow-500 text-black hover:bg-yellow-600",info:"bg-blue-500 text-white hover:bg-blue-600",subtle:"bg-muted text-muted-foreground hover:bg-muted/80",dark:"bg-zinc-900 text-white hover:bg-zinc-800",light:"bg-zinc-100 text-zinc-900 hover:bg-zinc-200"}[r],e),...o,children:n})}));At.displayName="Badge";var Ei=At;var Bt=({items:e,separator:t="/",overrideClassName:r,className:n})=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("nav",{"aria-label":"Breadcrumb",className:r?n:g("flex",n),children:jsxRuntime.jsx("ol",{className:"flex items-center space-x-2",children:e.map((o,i)=>jsxRuntime.jsxs("li",{className:"flex items-center",children:[i>0&&jsxRuntime.jsx("span",{className:"mx-2 text-muted-foreground",children:t}),o.href&&!o.current?jsxRuntime.jsx("a",{href:o.href,className:"text-sm font-medium text-muted-foreground hover:text-foreground transition-colors",children:o.label}):jsxRuntime.jsx("span",{className:g("text-sm font-medium",o.current?"text-foreground":"text-muted-foreground"),"aria-current":o.current?"page":void 0,children:o.label})]},i))})})});Bt.displayName="Breadcrumb";var Hi=Bt;var Ot=Wn__default.default.forwardRef(({className:e,overrideClassName:t,variant:r="primary",size:n="md",href:o,children:i,loading:a=!1,loadingContent:l,...s},m)=>{let u="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",c={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"},d={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"},p=t?e:g(u,c[r],d[n],e);return o?jsxRuntime.jsx(f,{children:jsxRuntime.jsx("a",{href:o,className:p,ref:m,children:a&&l?l:i})}):jsxRuntime.jsx(f,{children:jsxRuntime.jsx("button",{className:p,ref:m,...s,children:a&&l?l:i})})});Ot.displayName="Button";var zi=Ot;var Gt=Wn.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:g("rounded-lg border bg-card text-card-foreground shadow-sm",e),...n,children:r})}));Gt.displayName="Card";var zt=Wn.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:g("flex flex-col space-y-1.5 p-6",e),...n,children:r})}));zt.displayName="CardHeader";var Ut=Wn.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("h3",{ref:o,className:t?e:g("text-2xl font-semibold leading-none tracking-tight",e),...n,children:r})}));Ut.displayName="CardTitle";var Wt=Wn.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("p",{ref:o,className:t?e:g("text-sm text-muted-foreground",e),...n,children:r})}));Wt.displayName="CardDescription";var qt=Wn.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:g("p-6 pt-0",e),...n,children:r})}));qt.displayName="CardContent";var Yt=Wn.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:g("flex items-center p-6 pt-0",e),...n,children:r})}));Yt.displayName="CardFooter";var Xi=Gt,Ji=zt,ji=Ut,Zi=Wt,Qi=qt,es=Yt;var _t=Wn.forwardRef(({children:e,isOpen:t,onClose:r,size:n="md",className:o,overrideClassName:i=!1,...a},l)=>(Wn.useEffect(()=>(t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset";}),[t]),Wn.useEffect(()=>{let m=u=>{u.key==="Escape"&&r();};return t&&document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[t,r]),t?jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{ref:l,className:"fixed inset-0 z-50 flex items-center justify-center",...a,children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:r}),jsxRuntime.jsx("div",{className:i?o:g("relative bg-background border border-border rounded-lg shadow-lg w-full mx-4",{sm:"max-w-md",md:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl"}[n],o),children:e})]})}):null));_t.displayName="Dialog";var Xt=Wn.forwardRef(({children:e,className:t,overrideClassName:r=!1,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:o,className:r?t:g("px-6 py-4 border-b border-border",t),...n,children:e})}));Xt.displayName="DialogHeader";var Jt=Wn.forwardRef(({children:e,className:t,overrideClassName:r=!1,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("h2",{ref:o,className:r?t:g("text-lg font-semibold text-foreground",t),...n,children:e})}));Jt.displayName="DialogTitle";var jt=Wn.forwardRef(({children:e,className:t,overrideClassName:r=!1,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:o,className:r?t:g("px-6 py-4",t),...n,children:e})}));jt.displayName="DialogContent";var Zt=Wn.forwardRef(({children:e,className:t,overrideClassName:r=!1,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:o,className:r?t:g("px-6 py-4 border-t border-border flex justify-end space-x-2",t),...n,children:e})}));Zt.displayName="DialogFooter";var ss=_t,ls=Xt,cs=Jt,ds=jt,us=Zt;var Ae=Wn.createContext(void 0),er=Wn.forwardRef(({children:e,className:t,...r},n)=>{let[o,i]=Wn.useState(!1);return jsxRuntime.jsx(f,{children:jsxRuntime.jsx(Ae.Provider,{value:{isOpen:o,setIsOpen:i},children:jsxRuntime.jsx("div",{ref:n,className:g("relative inline-block",t),...r,children:e})})})});er.displayName="DropdownMenu";var tr=({children:e,asChild:t})=>{let r=Wn.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 Wn.cloneElement(o,{onClick:i=>{o.props.onClick?.(i),n();}})}return jsxRuntime.jsx(f,{children:jsxRuntime.jsx("button",{onClick:n,children:e})})};tr.displayName="DropdownMenuTrigger";var rr=Wn.forwardRef(({children:e,align:t="end",className:r,...n},o)=>{let i=Wn.useContext(Ae),a=Wn.useRef(null);return Wn.useEffect(()=>{o&&(typeof o=="function"?o(a.current):o.current=a.current);},[o]),Wn.useEffect(()=>{let s=m=>{a.current&&!a.current.contains(m.target)&&i?.setIsOpen(!1);};return i?.isOpen&&document.addEventListener("mousedown",s),()=>{document.removeEventListener("mousedown",s);}},[i?.isOpen]),i?.isOpen?jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:a,className:g("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});rr.displayName="DropdownMenuContent";var nr=Wn.forwardRef(({children:e,onClick:t,destructive:r,className:n,...o},i)=>{let a=Wn.useContext(Ae);return jsxRuntime.jsx(f,{children:jsxRuntime.jsx("button",{ref:i,onClick:s=>{t?.(s),a?.setIsOpen(!1);},className:g("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})})});nr.displayName="DropdownMenuItem";var or=Wn.forwardRef(({className:e,...t},r)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:r,className:g("-mx-1 my-1 h-px bg-border",e),...t})}));or.displayName="DropdownMenuSeparator";var ar=Wn.forwardRef(({children:e,className:t,...r},n)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:n,className:g("px-2 py-1.5 text-sm font-semibold",t),...r,children:e})}));ar.displayName="DropdownMenuLabel";var xs=er,hs=tr,ys=rr,ws=nr,Cs=or,ks=ar;var Ms=({src:e,alt:t="",fallback:r,size:n="md",className:o})=>{let[i,a]=Wn.useState(!1),l={sm:"h-8 w-8 text-xs",md:"h-10 w-10 text-sm",lg:"h-12 w-12 text-base",xl:"h-16 w-16 text-lg"},s=m=>m.split(" ").map(u=>u.charAt(0)).join("").toUpperCase().slice(0,2);return jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{className:g("relative flex shrink-0 overflow-hidden rounded-full bg-muted",l[n],o),children:e&&!i?jsxRuntime.jsx("img",{src:e||"/placeholder.svg",alt:t,className:"aspect-square h-full w-full object-cover",onError:()=>a(!0)}):jsxRuntime.jsx("div",{className:"flex h-full w-full items-center justify-center bg-muted font-medium text-muted-foreground",children:r?s(r):"?"})})})};var jn=({children:e,className:t,overrideClassName:r})=>{if(e)return jsxRuntime.jsx(f,{children:jsxRuntime.jsx("p",{className:r?t:g("text-sm text-muted-foreground",t),children:e})})},O=jn;var Zn=({children:e,required:t,className:r,overrideClassName:n=!1,...o})=>jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("label",{...o,className:n?r:g("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:"*"})]})}),F=Zn;var eo=({children:e,className:t,overrideClassName:r})=>{if(e)return jsxRuntime.jsx(f,{children:jsxRuntime.jsx("p",{className:r?t:g("text-sm text-red-600 dark:text-red-400",t),children:e})})},G=eo;var lr=Wn.forwardRef(({label:e,required:t,option:r,description:n,icon:o,orientation:i="left",className:a,overrideClassName:l=!1,helperText:s,error:m,...u},c)=>{let d=Wn.useId(),p=g("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",m&&"border-destructive",a);return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:"space-y-2 w-fit",children:[e&&jsxRuntime.jsx(F,{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:d,type:"checkbox",className:l?a:p,ref:c,...u}),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(F,{htmlFor:d,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r}),n&&jsxRuntime.jsx(F,{id:`${d}-description`,htmlFor:d,className:"text-xs text-muted-foreground",children:n})]})]})]}),m&&jsxRuntime.jsx(G,{children:m}),!m&&s&&jsxRuntime.jsx(O,{children:s})]})})});lr.displayName="CheckBox";var js=lr;function ao(e,t){let{typeSet:r="field",multiCheck:n=!1,value:o,onChange:i,labelKey:a,valueKey:l,options:s,alignment:m="vertical",className:u,overrideClassName:c=!1,helperText:d,error:p,label:w,name:y,required:b,...v}=e,E=Wn.useId(),D=Wn.useMemo(()=>new Map(s.map(k=>[String(k[l]),k])),[s,l]),V=Wn.useMemo(()=>o==null?[]:r==="field"?n?o.map(k=>String(k)):[String(o)]:n?o.map(k=>String(k[l])):[String(o[l])],[o,r,n,l]),P=(k,N)=>{if(!i)return;let x;if(r==="field")if(n)x=k.map(M=>{let H=D.get(M);return H?H[l]:M});else {let h=k[0];if(!h)x=void 0;else {let M=D.get(h);x=M?M[l]:h;}}else n?x=k.map(M=>D.get(M)).filter(M=>M!==void 0):x=D.get(k[0]??"")??void 0;i({target:{name:y,value:x,type:"checkboxgroup",checked:N}});},$=k=>{let N;n?N=V.includes(k)?V.filter(x=>x!==k):[...V,k]:N=V[0]===k?[]:[k],P(N,N.includes(k));},I=m==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",S=g("h-4 w-4 rounded border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",p&&"border-destructive");return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:g("flex flex-col gap-3",u),children:[w&&jsxRuntime.jsx(F,{required:b,children:w}),jsxRuntime.jsx("div",{className:I,children:s.map((k,N)=>{let x=String(k[l]),h=V.includes(x),M=`${E}-${x}-${N}`;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{...v,id:M,ref:t,type:"checkbox",name:y,checked:h,onChange:()=>$(x),className:c?u:S}),jsxRuntime.jsx(F,{htmlFor:M,children:String(k[a])})]},M)})}),!!p&&jsxRuntime.jsx(G,{children:String(p)}),!p&&d&&jsxRuntime.jsx(O,{children:d})]})})}function io(){let e=Wn.forwardRef(ao);return e.displayName="CheckBoxGroup",e}var so=io(),ll=so;var mo=["#000000","#ffffff","#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ffa500","#800080","#ffc0cb","#a52a2a","#808080","#000080","#008000"],mr=Wn__default.default.forwardRef(({label:e,required:t,onChange:r,disabled:n=!1,presetColors:o=mo,showPresets:i=!0,className:a,error:l,helperText:s,name:m},u)=>{let c=Wn.useId(),d=Wn.useRef(null),[p,w]=Wn.useState(!1),[y,b]=Wn.useState("COLOR"),[v,E]=Wn.useState("HEX"),[D,V]=Wn.useState("#000000"),[P,$]=Wn.useState(0),[I,S]=Wn.useState(0),[k,N]=Wn.useState(0),[x,h]=Wn.useState(1),[M,H]=Wn.useState("#000000"),[A,j]=Wn.useState("#ffffff"),[re,Ce]=Wn.useState(90),[R,T]=Wn.useState("linear-gradient(90deg, #000000, #ffffff)"),z=(L,U,De)=>Math.min(De,Math.max(U,L)),_=L=>{let U=L.replace("#","");return {r:parseInt(U.slice(0,2),16),g:parseInt(U.slice(2,4),16),b:parseInt(U.slice(4,6),16)}},W=L=>{r?.({target:{value:L,name:m}});};Wn.useEffect(()=>{let L=U=>{d.current&&!d.current.contains(U.target)&&w(!1);};return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[]),Wn.useEffect(()=>{if(/^#[0-9A-F]{6}$/i.test(D)){let L=_(D);$(L.r),S(L.g),N(L.b);}},[D]),Wn.useEffect(()=>{let L=`linear-gradient(${re}deg, ${M}, ${A})`;T(L),y==="GRADIENT"&&W(L);},[M,A,re]);let q=()=>{if(x>=1){if(v==="HEX")return D;if(v==="RGB")return `rgb(${P}, ${I}, ${k})`}return `rgba(${P}, ${I}, ${k}, ${Number(x.toFixed(2))})`},Z=y==="GRADIENT"?R:q();return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:`space-y-2 ${a??""}`,children:[e&&jsxRuntime.jsx(F,{htmlFor:c,required:t,children:e}),jsxRuntime.jsxs("div",{ref:d,className:"relative",children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>!n&&w(!p),className:"flex items-center gap-2 px-3 py-2 border rounded-md bg-background w-full",children:[jsxRuntime.jsx("div",{className:"w-6 h-6 rounded border",style:{background:Z}}),jsxRuntime.jsx("span",{className:"text-xs font-mono truncate",children:Z})]}),p&&jsxRuntime.jsxs("div",{className:"absolute z-50 mt-1 w-85 bg-popover border rounded-md p-4 space-y-3 shadow-lg",children:[jsxRuntime.jsx("div",{className:"flex gap-2",children:["COLOR","GRADIENT"].map(L=>jsxRuntime.jsx("button",{type:"button",onClick:()=>b(L),className:`px-2 py-1 text-xs rounded ${y===L?"bg-primary text-white":"border"}`,children:L==="COLOR"?"Cor":"Gradiente"},L))}),jsxRuntime.jsx("div",{className:"w-full h-10 rounded border",style:{background:Z}}),y==="COLOR"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("input",{ref:u,type:"color",value:D,onChange:L=>{V(L.target.value.toUpperCase()),W(q());},className:"w-full h-10 rounded"}),jsxRuntime.jsxs("div",{className:"flex gap-2 items-center",children:[jsxRuntime.jsxs("select",{value:v,onChange:L=>E(L.target.value),className:"px-2 py-1 text-xs border rounded",children:[jsxRuntime.jsx("option",{value:"HEX",children:"HEX"}),jsxRuntime.jsx("option",{value:"RGB",children:"RGB"}),jsxRuntime.jsx("option",{value:"RGBA",children:"RGBA"})]}),v==="HEX"&&jsxRuntime.jsx("input",{value:D,onChange:L=>{let U=L.target.value.toUpperCase().replace(/[^0-9A-F#]/g,"");U.startsWith("#")||(U="#"+U),U="#"+U.slice(1,7),V(U),/^#[0-9A-F]{6}$/.test(U)&&W(U);},className:"flex-1 px-2 py-1 text-xs font-mono border rounded",placeholder:"#000000"}),(v==="RGB"||v==="RGBA")&&jsxRuntime.jsx("div",{className:"flex gap-2",children:[{l:"R",v:P,s:$},{l:"G",v:I,s:S},{l:"B",v:k,s:N}].map(({l:L,v:U,s:De})=>jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("span",{className:"text-xs font-semibold",children:L}),jsxRuntime.jsx("input",{type:"number",min:0,max:255,value:U,onChange:Dn=>{De(z(+Dn.target.value,0,255)),W(q());},className:"w-14 px-1 py-1 text-xs border rounded"})]},L))})]}),v==="RGBA"&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs font-semibold",children:"A"}),jsxRuntime.jsx("input",{type:"range",min:0,max:1,step:.01,value:x,onChange:L=>{h(+L.target.value),W(q());},className:"flex-1"}),jsxRuntime.jsxs("span",{className:"text-xs w-10 text-right",children:[Math.round(x*100),"%"]})]}),i&&jsxRuntime.jsx("div",{className:"grid grid-cols-5 gap-1",children:o.map(L=>jsxRuntime.jsx("button",{type:"button",onClick:()=>{V(L),h(1),W(L);},className:"w-8 h-8 rounded border",style:{background:L}},L))})]}),y==="GRADIENT"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex gap-2 items-center",children:[jsxRuntime.jsx("input",{type:"color",value:M,onChange:L=>H(L.target.value)}),jsxRuntime.jsx("span",{className:"text-xs",children:"\u2192"}),jsxRuntime.jsx("input",{type:"color",value:A,onChange:L=>j(L.target.value)})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs",children:"\xC2ngulo"}),jsxRuntime.jsx("input",{type:"range",min:0,max:360,value:re,onChange:L=>Ce(+L.target.value),className:"flex-1"}),jsxRuntime.jsxs("span",{className:"text-xs w-10 text-right",children:[re,"\xB0"]})]})]})]})]}),l&&jsxRuntime.jsx(G,{children:l}),!l&&s&&jsxRuntime.jsx(O,{children:s})]})})});mr.displayName="ColorPicker";var bl=mr;var po=({...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"})}),Ge=po;var go=(e,t)=>{Wn.useEffect(()=>{let r=n=>{e.current&&!e.current.contains(n.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},fr=go;function tt({options:e,labelKey:t,valueKey:r,multiple:n,onChange:o,setSearchTerm:i,typeSet:a,name:l}){let[s,m]=Wn.useState([]),u=Wn.useMemo(()=>new Map(e.map(b=>[String(b[r]),b])),[e,r]),c=Wn.useCallback(()=>s.map(b=>u.get(b)).filter(b=>!!b),[s,u]),d=Wn.useCallback(b=>{if(!o)return;let v;if(a==="field"?n?v=b:v=b[0]??void 0:n?v=b.map(D=>u.get(D)).filter(D=>D!==void 0):v=u.get(b[0]??"")??void 0,i&&!n){let E=u.get(b[0]??"");E&&i(String(E[t]));}o({target:{name:l,value:v,type:"combobox"}});},[n,o,u,l,a,i,t]),p=Wn.useCallback(b=>{let v=String(b[r]),E=n?s.includes(v)?s.filter(D=>D!==v):[...s,v]:[v];m(E),d(E);},[n,s,d,r]),w=Wn.useCallback(b=>{let v=s.filter(E=>E!==b);m(v),d(v);},[s,d]),y=Wn.useCallback(()=>{m([]),i?.("");let b;a==="field"?b=n?[]:"":b=n?[]:void 0,o?.({target:{name:l,value:b,type:"combobox"}});},[n,o,l,i,a]);return {selectedValues:s,handleSelect:p,handleRemove:w,handleClear:y,getSelectedOptions:c}}function rt(e,t,r){return Wn.useMemo(()=>r?e.filter(o=>String(o[t]).toLowerCase().includes(r.toLowerCase())):e,[e,r,t])}var br=({isOpen:e,setIsOpen:t,multiple:r,searchTerm:n,setSearchTerm:o,selectedValues:i,filteredOptions:a,highlightedIndex:l,setHighlightedIndex:s,handleSelect:m,handleRemove:u})=>{let c=Wn.useCallback(p=>{if(a.length===0){s(-1);return}s(w=>w<0?p>0?0:a.length-1:(w+p+a.length)%a.length);},[a,s]);return Wn.useCallback(p=>{if(!e){if(p.key==="Enter"||p.key==="ArrowDown"){t(!0),s(0),p.preventDefault();return}r&&p.key==="Backspace"&&n===""&&i.length>0&&(p.preventDefault(),u(i[i.length-1]));return}switch(p.key){case"ArrowDown":p.preventDefault(),c(1);break;case"ArrowUp":p.preventDefault(),c(-1);break;case"Enter":p.preventDefault();let w=l>=0?l:0,y=a[w];y&&m(y),r&&o&&o(""),r||(t(!1),s(-1));break;case"Escape":p.preventDefault(),t(!1),s(-1),r||o("");break;case"Tab":t(!1),s(-1);break;case"Home":p.preventDefault(),a.length>0&&s(0);break;case"End":p.preventDefault(),a.length>0&&s(a.length-1);break;case"Backspace":r&&n===""&&i.length>0&&(p.preventDefault(),u(i[i.length-1]));break}},[e,r,n,i,a,l,t,o,s,m,u,c])};function vr({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 No(e,t){let{label:r,required:n=!1,name:o,placeholder:i="Buscar...",labelKey:a,valueKey:l,options:s,value:m,onChange:u,mode:c="single",typeSet:d="field",disabled:p=!1,ClearEnabled:w=!0,helperText:y,error:b=!1,className:v="",...E}=e,D=c==="multiple",[V,P]=Wn.useState(!1),[$,I]=Wn.useState(""),S=Wn.useRef(null),k=Wn.useRef(null),N=Wn.useRef(null);Wn.useImperativeHandle(t,()=>N.current),fr(k,()=>P(!1));let x=rt(s,a,$),[h,M]=Wn.useState(-1),{selectedValues:H,handleSelect:A,handleRemove:j,handleClear:re,getSelectedOptions:Ce}=tt({options:s,labelKey:a,valueKey:l,value:m,multiple:D,onChange:u,typeSet:d,name:o,setSearchTerm:I}),R=br({isOpen:V,setIsOpen:P,multiple:D,searchTerm:$,setSearchTerm:I,selectedValues:H,filteredOptions:x,highlightedIndex:h,setHighlightedIndex:M,handleSelect:A,handleRemove:j}),T=Wn.useId(),z="w-full bg-transparent outline-none placeholder:text-gray-500 dark:placeholder:text-gray-400 text-gray-900 dark:text-gray-100",_=g("relative w-full min-h-[40px] px-3 py-2 border rounded-md bg-white dark:bg-gray-800",b?"border-red-500":"border-gray-300 dark:border-gray-600",p?"opacity-50 cursor-not-allowed":"cursor-text","focus-within:ring-2 focus-within:ring-blue-500 focus-within:border-blue-500");return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:`space-y-2 ${v}`,children:[r&&jsxRuntime.jsx(F,{htmlFor:T,required:n,children:r}),jsxRuntime.jsxs("div",{ref:S,className:"relative",children:[jsxRuntime.jsxs("div",{className:_,children:[D&&Ce().length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:Ce().map((W,q)=>jsxRuntime.jsx(vr,{option:W,labelKey:a,valueKey:l,onRemove:j},String(W[l]??q)))}),jsxRuntime.jsx("input",{ref:N,...E,name:o,type:"text",placeholder:i,value:$,onChange:W=>{let q=W.target.value;I(q),!V&&q.trim()!==""&&P(!0);},onKeyDown:R,onMouseDown:W=>{document.activeElement===N.current&&(W.preventDefault(),P(q=>{let Z=!q;return Z&&M(0),Z}));},onFocus:()=>{P(!0),M(0);},disabled:p,className:z,role:"combobox","aria-expanded":V,"aria-controls":T,"aria-activedescendant":h>=0?`${T}-opt-${h}`:void 0}),w&&!!H.length&&jsxRuntime.jsx("button",{type:"button",onMouseDown:W=>W.preventDefault(),onClick:re,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(Ge,{width:12,height:12})})]}),V&&jsxRuntime.jsx("div",{ref:k,id:T,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":D||void 0,children:x.length===0?jsxRuntime.jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400",children:"Nenhum resultado encontrado"}):x.map((W,q)=>{let Z=String(W[l]),L=H.includes(Z),U=q===h;return jsxRuntime.jsx("button",{id:`${T}-opt-${q}`,"data-index":q,role:"option","aria-selected":L,type:"button",onMouseDown:De=>De.preventDefault(),onClick:()=>A(W),className:g("w-full px-3 py-2 text-left text-sm transition-colors",U&&"bg-blue-100 dark:bg-blue-800 text-blue-900 dark:text-white",!U&&L&&"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300",!L&&!U&&"text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),children:jsxRuntime.jsx("span",{children:String(W[a])})},Z)})})]}),b&&jsxRuntime.jsx(G,{children:b}),!b&&y&&jsxRuntime.jsx(O,{children:y})]})})}function Po(){let e=Wn.forwardRef(No);return e.displayName="ComboBox",e}var To=Po(),ql=To;var Lo=({...e})=>jsxRuntime.jsx("svg",{...e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),hr=Lo;var Ro=({...e})=>jsxRuntime.jsx("svg",{...e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})}),de=Ro;var Do=({...e})=>jsxRuntime.jsx("svg",{...e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),ue=Do;var be=["Janeiro","Fevereiro","Mar\xE7o","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"];var Cr=["Dom","Seg","Ter","Qua","Qui","Sex","S\xE1b"];var st=({type:e,currentMonth:t,selectedDate:r,onChange:n,onNavigate:o,onMonthClick:i,onYearClick:a})=>{let l=s=>{let m=s.getFullYear(),u=s.getMonth(),c=new Date(m,u,1),p=new Date(m,u+1,0).getDate(),w=c.getDay(),y=[];for(let b=w-1;b>=0;b--)y.push({date:new Date(m,u,-b),isCurrentMonth:!1});for(let b=1;b<=p;b++)y.push({date:new Date(m,u,b),isCurrentMonth:!0});for(;y.length<42;)y.push({date:new Date(m,u+1,y.length-p+1),isCurrentMonth:!1});return y};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>o("prev"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsxRuntime.jsx(de,{width:16,height:16})}),jsxRuntime.jsxs("div",{className:"font-medium flex gap-1",children:[jsxRuntime.jsx("span",{className:"cursor-pointer hover:underline",onClick:i,children:be[t.getMonth()]}),jsxRuntime.jsx("span",{className:"cursor-pointer hover:underline",onClick:a,children:t.getFullYear()})]}),jsxRuntime.jsx("button",{type:"button",onClick:()=>o("next"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsxRuntime.jsx(ue,{width:16,height:16})})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:Cr.map(s=>jsxRuntime.jsx("div",{className:"text-center text-xs font-medium text-muted-foreground p-2",children:s},s))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1",children:l(t).map((s,m)=>{let c=r&&s.date.toDateString()===r.toDateString(),d=s.date.toDateString()===new Date().toDateString();return jsxRuntime.jsx("button",{type:"button",onClick:()=>{if(e==="datetime-local"){let p=r??new Date,w=new Date(s.date.getFullYear(),s.date.getMonth(),s.date.getDate(),p.getHours(),p.getMinutes(),p.getSeconds());n(w);}else n(s.date);},className:`
33
33
  p-2 cursor-pointer text-sm rounded hover:bg-accent
34
34
  ${s.isCurrentMonth?"text-foreground":"text-muted-foreground"}
35
35
  ${c?"bg-primary text-primary-foreground hover:bg-primary":""}
36
- ${u&&!c?"bg-accent font-medium":""}
37
- `,children:s.date.getDate()},p)})})]})};var _t=(e,t)=>{let r=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),o=String(e.getDate()).padStart(2,"0"),i=String(e.getHours()).padStart(2,"0"),a=String(e.getMinutes()).padStart(2,"0"),l=String(e.getSeconds()).padStart(2,"0");switch(t){case"date":return `${r}-${n}-${o}`;case"datetime-local":return `${r}-${n}-${o}T${i}:${a}:${l}`;case"year":return `${r}`;case"month":return `${r}-${n}`;case"week":{let s=new Date(e);s.setHours(0,0,0,0),s.setDate(s.getDate()+3-(s.getDay()+6)%7);let p=new Date(s.getFullYear(),0,4),d=1+Math.round(((s.getTime()-p.getTime())/864e5-3+(p.getDay()+6)%7)/7);return `${s.getFullYear()}-W${String(d).padStart(2,"0")}`}}};var Ye=(e,t,r="pt-BR")=>{switch(t){case"date":return e.toLocaleDateString(r);case"datetime-local":return e.toLocaleString(r);case"year":return `${e.getFullYear()}`;case"month":return me?`${me[e.getMonth()]} ${e.getFullYear()}`:e.toLocaleDateString(r,{month:"long",year:"numeric"});case"week":{let n=new Date(e);n.setHours(0,0,0,0),n.setDate(n.getDate()+3-(n.getDay()+6)%7);let o=new Date(n.getFullYear(),0,4);return `Semana ${1+Math.round(((n.getTime()-o.getTime())/864e5-3+(o.getDay()+6)%7)/7)} \u2022 ${n.getFullYear()}`}}};var An=(e,t)=>{jr.useEffect(()=>{let r=n=>{e.current&&!e.current.contains(n.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},Xt=An;var jt=({onChange:e,currentMonth:t,selectedDate:r,setIsOpen:n,onNavigate:o,onHeaderClick:i,closeOnSelect:a})=>{let l=t.getFullYear();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>o("prev"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsxRuntime.jsx(ie,{width:16,height:16})}),jsxRuntime.jsx("h3",{className:"font-medium cursor-pointer hover:underline",onClick:i,children:l}),jsxRuntime.jsx("button",{type:"button",onClick:()=>o("next"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsxRuntime.jsx(se,{width:16,height:16})})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-2",children:me.map((s,p)=>{let d=r,c=d&&d.getFullYear()===l&&d.getMonth()===p;return jsxRuntime.jsx("button",{type:"button",onClick:()=>{e(new Date(l,p,1)),a&&n(!1);},className:`p-2 cursor-pointer text-sm rounded hover:bg-accent ${c?"bg-primary text-primary-foreground hover:bg-primary":""}`,children:s},s)})})]})};var Zt=({selectedDate:e,onChange:t})=>{let r=e??new Date,n=r.getHours(),o=r.getMinutes(),i=r.getSeconds(),a=`
36
+ ${d&&!c?"bg-accent font-medium":""}
37
+ `,children:s.date.getDate()},m)})})]})};var kr=(e,t)=>{let r=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),o=String(e.getDate()).padStart(2,"0"),i=String(e.getHours()).padStart(2,"0"),a=String(e.getMinutes()).padStart(2,"0"),l=String(e.getSeconds()).padStart(2,"0");switch(t){case"date":return `${r}-${n}-${o}`;case"datetime-local":return `${r}-${n}-${o}T${i}:${a}:${l}`;case"year":return `${r}`;case"month":return `${r}-${n}`;case"week":{let s=new Date(e);s.setHours(0,0,0,0),s.setDate(s.getDate()+3-(s.getDay()+6)%7);let m=new Date(s.getFullYear(),0,4),u=1+Math.round(((s.getTime()-m.getTime())/864e5-3+(m.getDay()+6)%7)/7);return `${s.getFullYear()}-W${String(u).padStart(2,"0")}`}}};var lt=(e,t,r="pt-BR")=>{switch(t){case"date":return e.toLocaleDateString(r);case"datetime-local":return e.toLocaleString(r);case"year":return `${e.getFullYear()}`;case"month":return be?`${be[e.getMonth()]} ${e.getFullYear()}`:e.toLocaleDateString(r,{month:"long",year:"numeric"});case"week":{let n=new Date(e);n.setHours(0,0,0,0),n.setDate(n.getDate()+3-(n.getDay()+6)%7);let o=new Date(n.getFullYear(),0,4);return `Semana ${1+Math.round(((n.getTime()-o.getTime())/864e5-3+(o.getDay()+6)%7)/7)} \u2022 ${n.getFullYear()}`}}};var Fo=(e,t)=>{Wn.useEffect(()=>{let r=n=>{e.current&&!e.current.contains(n.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},Nr=Fo;var Tr=({onChange:e,currentMonth:t,selectedDate:r,setIsOpen:n,onNavigate:o,onHeaderClick:i,closeOnSelect:a})=>{let l=t.getFullYear();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>o("prev"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsxRuntime.jsx(de,{width:16,height:16})}),jsxRuntime.jsx("h3",{className:"font-medium cursor-pointer hover:underline",onClick:i,children:l}),jsxRuntime.jsx("button",{type:"button",onClick:()=>o("next"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsxRuntime.jsx(ue,{width:16,height:16})})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-2",children:be.map((s,m)=>{let u=r,c=u&&u.getFullYear()===l&&u.getMonth()===m;return jsxRuntime.jsx("button",{type:"button",onClick:()=>{e(new Date(l,m,1)),a&&n(!1);},className:`p-2 cursor-pointer text-sm rounded hover:bg-accent ${c?"bg-primary text-primary-foreground hover:bg-primary":""}`,children:s},s)})})]})};var Lr=({selectedDate:e,onChange:t})=>{let r=e??new Date,n=r.getHours(),o=r.getMinutes(),i=r.getSeconds(),a=`
38
38
  ${String(n).padStart(2,"0")}:
39
39
  ${String(o).padStart(2,"0")}:
40
40
  ${String(i).padStart(2,"0")}
41
- `,l=Array.from({length:24},(c,u)=>u),s=Array.from({length:60},(c,u)=>u),p=Array.from({length:60},(c,u)=>u),d=(c,u,m)=>{let L=new Date(r.getFullYear(),r.getMonth(),r.getDate(),c,u,m);t(L);};return jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs(D,{className:"flex items-center gap-2",children:["Hora",jsxRuntime.jsx("span",{className:"text-sm font-normal text-muted-foreground",children:a})]}),jsxRuntime.jsxs("div",{className:"flex h-full max-h-72 gap-2",children:[jsxRuntime.jsx("div",{className:"w-16 overflow-y-auto border rounded-md scrollbar-thin",children:l.map(c=>jsxRuntime.jsx("button",{type:"button",onClick:()=>d(c,o,i),className:`w-full px-2 py-1 text-sm text-center cursor-pointer hover:bg-accent ${c===n?"bg-primary text-primary-foreground hover:bg-primary":""}`,children:String(c).padStart(2,"0")},c))}),jsxRuntime.jsx("div",{className:"w-16 overflow-y-auto border rounded-md scrollbar-thin",children:s.map(c=>jsxRuntime.jsx("button",{type:"button",onClick:()=>d(n,c,i),className:`w-full px-2 py-1 text-sm text-center cursor-pointer hover:bg-accent ${c===o?"bg-primary text-primary-foreground hover:bg-primary":""}`,children:String(c).padStart(2,"0")},c))}),jsxRuntime.jsx("div",{className:"w-16 overflow-y-auto border rounded-md scrollbar-thin",children:p.map(c=>jsxRuntime.jsx("button",{type:"button",onClick:()=>d(n,o,c),className:`w-full px-2 py-1 text-sm text-center cursor-pointer hover:bg-accent ${c===i?"bg-primary text-primary-foreground hover:bg-primary":""}`,children:String(c).padStart(2,"0")},c))})]})]})};var Qt=({selectedDate:e,currentMonth:t,onChange:r,onNavigate:n,onHeaderClick:o,setIsOpen:i})=>{let a=t.getFullYear(),l=Array.from({length:52},(c,u)=>u+1),s=e,p=c=>{let u=new Date(a,0,1+(c-1)*7);r(u),i(!1);},d=(()=>{if(!s)return null;let c=new Date(s);c.setHours(0,0,0,0),c.setDate(c.getDate()+3-(c.getDay()+6)%7);let u=new Date(c.getFullYear(),0,4),m=1+Math.round(((c.getTime()-u.getTime())/864e5-3+(u.getDay()+6)%7)/7);return {year:c.getFullYear(),week:m}})();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>n("prev"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsxRuntime.jsx(ie,{width:16,height:16})}),jsxRuntime.jsx("h3",{className:"font-medium cursor-pointer hover:underline",onClick:o,children:a}),jsxRuntime.jsx("button",{type:"button",onClick:()=>n("next"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsxRuntime.jsx(se,{width:16,height:16})})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-4 gap-2",children:l.map(c=>{let u=d&&d.year===a&&d.week===c;return jsxRuntime.jsxs("button",{type:"button",onClick:()=>p(c),className:`p-2 text-sm rounded cursor-pointer hover:bg-accent ${u?"bg-primary text-primary-foreground hover:bg-primary":""}`,children:["Semana ",c]},c)})})]})};var tr=({currentYear:e,selectedDate:t,onPick:r,onNavigate:n})=>{let o=e-6,i=Array.from({length:12},(a,l)=>o+l);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>n("prev"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsxRuntime.jsx(ie,{width:16,height:16})}),jsxRuntime.jsx("h3",{className:"font-medium",children:e}),jsxRuntime.jsx("button",{type:"button",onClick:()=>n("next"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsxRuntime.jsx(se,{width:16,height:16})})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-2",children:i.map(a=>{let l=t?.getFullYear()===a;return jsxRuntime.jsx("button",{type:"button",onClick:()=>r(a),className:`p-2 text-sm rounded hover:bg-accent ${l?"bg-primary text-primary-foreground":""}`,children:a},a)})})]})};var nr=jr.forwardRef(({label:e,required:t,value:r,name:n,onChange:o,placeholder:i="Selecione uma data",type:a="date",locale:l="pt-BR",disabled:s=!1,error:p=!1,helperText:d,className:c,...u},m)=>{let L=jr.useId(),y=jr.useRef(null),b=jr.useRef(null),[h,M]=jr.useState(!1),[R,F]=jr.useState(0),[I,A]=jr.useState(r),[S,B]=jr.useState(()=>r?Ye(r,a,l):""),[P,T]=jr.useState(()=>a==="month"?"month":a==="week"?"week":a==="year"?"year":"day");Xt(y,()=>M(!1));let f=I??new Date,g=new Date(f.getFullYear(),f.getMonth()+R,1),N=k=>{b.current=k,typeof m=="function"?m(k):m&&(m.current=k);},E=k=>{A(k);let C=_t(k,a),G=Ye(k,a,l);B(G),b.current&&(b.current.value=C,o?.({target:{name:b.current.name,value:C},type:"change"}),F(0));},V=(k,C,G)=>{let K=new Date(k,C+1,0).getDate();return Math.min(G,K)},J=k=>{let C=k.replace(/\D/g,"").slice(0,8),G=[];return C.length>=2&&G.push(C.slice(0,2)),C.length>=4&&G.push(C.slice(2,4)),C.length>4&&G.push(C.slice(4)),G.join("/")},te=k=>{let C=k.target.value,G=J(C);if(B(G),G.length===10){let[K,z,q]=G.split("/").map(Number),j=new Date(q,z-1,K);isNaN(j.getTime())||E(j);}},he=()=>{switch(P){case"year":return jsxRuntime.jsx(tr,{currentYear:g.getFullYear(),selectedDate:I,onNavigate:k=>F(C=>C+(k==="next"?12:-12)),onPick:k=>{let C=I??new Date,G=V(k,C.getMonth(),C.getDate()),K=new Date(k,C.getMonth(),G,C.getHours(),C.getMinutes(),C.getSeconds());A(K),a==="year"?(E(K),M(!1)):T(a==="month"?"month":a==="week"?"week":"month");}});case"month":return jsxRuntime.jsx(jt,{currentMonth:g,selectedDate:I,setIsOpen:M,onNavigate:k=>F(C=>C+(k==="next"?12:-12)),onHeaderClick:()=>T("year"),closeOnSelect:a==="month",onChange:k=>{let C=I??new Date,G=V(k.getFullYear(),k.getMonth(),C.getDate()),K=new Date(k.getFullYear(),k.getMonth(),G,C.getHours(),C.getMinutes(),C.getSeconds());A(K),a==="month"?(E(K),M(!1)):T("day");}});case"week":return jsxRuntime.jsx(Qt,{currentMonth:g,selectedDate:I,setIsOpen:M,onNavigate:k=>F(C=>C+(k==="next"?12:-12)),onHeaderClick:()=>T("year"),onChange:k=>{E(k),M(!1);}});case"day":default:return a==="datetime-local"?jsxRuntime.jsxs("div",{className:"flex h-fit gap-4",children:[jsxRuntime.jsx("div",{className:"flex-1",children:jsxRuntime.jsx(We,{type:a,currentMonth:g,selectedDate:I,onNavigate:k=>F(C=>C+(k==="next"?1:-1)),onMonthClick:()=>T("month"),onYearClick:()=>T("year"),onChange:k=>{let C=I??new Date,G=new Date(k.getFullYear(),k.getMonth(),k.getDate(),C.getHours(),C.getMinutes(),C.getSeconds());E(G);}})}),jsxRuntime.jsx("div",{className:"w-fit",children:jsxRuntime.jsx(Zt,{selectedDate:I,onChange:k=>E(k)})})]}):jsxRuntime.jsx(We,{type:a,currentMonth:g,selectedDate:I,onNavigate:k=>F(C=>C+(k==="next"?1:-1)),onMonthClick:()=>T("month"),onYearClick:()=>T("year"),onChange:k=>{E(k),M(!1);}})}};return jsxRuntime.jsx(v,{children:jsxRuntime.jsxs("div",{className:`space-y-2 ${c}`,children:[e&&jsxRuntime.jsx(D,{htmlFor:L,required:t,children:e}),jsxRuntime.jsx("input",{ref:N,id:L,name:n,type:"text",className:"sr-only",disabled:s,...u}),jsxRuntime.jsxs("div",{ref:y,className:"relative",children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:"text",value:S,onChange:te,onFocus:()=>!s&&M(!0),placeholder:i,disabled:s,className:`
41
+ `,l=Array.from({length:24},(c,d)=>d),s=Array.from({length:60},(c,d)=>d),m=Array.from({length:60},(c,d)=>d),u=(c,d,p)=>{let w=new Date(r.getFullYear(),r.getMonth(),r.getDate(),c,d,p);t(w);};return jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs(F,{className:"flex items-center gap-2",children:["Hora",jsxRuntime.jsx("span",{className:"text-sm font-normal text-muted-foreground",children:a})]}),jsxRuntime.jsxs("div",{className:"flex h-full max-h-72 gap-2",children:[jsxRuntime.jsx("div",{className:"w-16 overflow-y-auto border rounded-md scrollbar-thin",children:l.map(c=>jsxRuntime.jsx("button",{type:"button",onClick:()=>u(c,o,i),className:`w-full px-2 py-1 text-sm text-center cursor-pointer hover:bg-accent ${c===n?"bg-primary text-primary-foreground hover:bg-primary":""}`,children:String(c).padStart(2,"0")},c))}),jsxRuntime.jsx("div",{className:"w-16 overflow-y-auto border rounded-md scrollbar-thin",children:s.map(c=>jsxRuntime.jsx("button",{type:"button",onClick:()=>u(n,c,i),className:`w-full px-2 py-1 text-sm text-center cursor-pointer hover:bg-accent ${c===o?"bg-primary text-primary-foreground hover:bg-primary":""}`,children:String(c).padStart(2,"0")},c))}),jsxRuntime.jsx("div",{className:"w-16 overflow-y-auto border rounded-md scrollbar-thin",children:m.map(c=>jsxRuntime.jsx("button",{type:"button",onClick:()=>u(n,o,c),className:`w-full px-2 py-1 text-sm text-center cursor-pointer hover:bg-accent ${c===i?"bg-primary text-primary-foreground hover:bg-primary":""}`,children:String(c).padStart(2,"0")},c))})]})]})};var Rr=({selectedDate:e,currentMonth:t,onChange:r,onNavigate:n,onHeaderClick:o,setIsOpen:i})=>{let a=t.getFullYear(),l=Array.from({length:52},(c,d)=>d+1),s=e,m=c=>{let d=new Date(a,0,1+(c-1)*7);r(d),i(!1);},u=(()=>{if(!s)return null;let c=new Date(s);c.setHours(0,0,0,0),c.setDate(c.getDate()+3-(c.getDay()+6)%7);let d=new Date(c.getFullYear(),0,4),p=1+Math.round(((c.getTime()-d.getTime())/864e5-3+(d.getDay()+6)%7)/7);return {year:c.getFullYear(),week:p}})();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>n("prev"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsxRuntime.jsx(de,{width:16,height:16})}),jsxRuntime.jsx("h3",{className:"font-medium cursor-pointer hover:underline",onClick:o,children:a}),jsxRuntime.jsx("button",{type:"button",onClick:()=>n("next"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsxRuntime.jsx(ue,{width:16,height:16})})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-4 gap-2",children:l.map(c=>{let d=u&&u.year===a&&u.week===c;return jsxRuntime.jsxs("button",{type:"button",onClick:()=>m(c),className:`p-2 text-sm rounded cursor-pointer hover:bg-accent ${d?"bg-primary text-primary-foreground hover:bg-primary":""}`,children:["Semana ",c]},c)})})]})};var Mr=({currentYear:e,selectedDate:t,onPick:r,onNavigate:n})=>{let o=e-6,i=Array.from({length:12},(a,l)=>o+l);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>n("prev"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsxRuntime.jsx(de,{width:16,height:16})}),jsxRuntime.jsx("h3",{className:"font-medium",children:e}),jsxRuntime.jsx("button",{type:"button",onClick:()=>n("next"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsxRuntime.jsx(ue,{width:16,height:16})})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-2",children:i.map(a=>{let l=t?.getFullYear()===a;return jsxRuntime.jsx("button",{type:"button",onClick:()=>r(a),className:`p-2 text-sm rounded hover:bg-accent ${l?"bg-primary text-primary-foreground":""}`,children:a},a)})})]})};var Fr=Wn.forwardRef(({label:e,required:t,value:r,name:n,onChange:o,placeholder:i="Selecione uma data",type:a="date",locale:l="pt-BR",disabled:s=!1,error:m=!1,helperText:u,className:c,...d},p)=>{let w=Wn.useId(),y=Wn.useRef(null),b=Wn.useRef(null),[v,E]=Wn.useState(!1),[D,V]=Wn.useState(0),[P,$]=Wn.useState(r),[I,S]=Wn.useState(()=>r?lt(r,a,l):""),[k,N]=Wn.useState(()=>a==="month"?"month":a==="week"?"week":a==="year"?"year":"day");Nr(y,()=>E(!1));let x=P??new Date,h=new Date(x.getFullYear(),x.getMonth()+D,1),M=R=>{b.current=R,typeof p=="function"?p(R):p&&(p.current=R);},H=R=>{$(R);let T=kr(R,a),z=lt(R,a,l);S(z),b.current&&(b.current.value=T,o?.({target:{name:b.current.name,value:T},type:"change"}),V(0));},A=(R,T,z)=>{let _=new Date(R,T+1,0).getDate();return Math.min(z,_)},j=R=>{let T=R.replace(/\D/g,"").slice(0,8),z=[];return T.length>=2&&z.push(T.slice(0,2)),T.length>=4&&z.push(T.slice(2,4)),T.length>4&&z.push(T.slice(4)),z.join("/")},re=R=>{let T=R.target.value,z=j(T);if(S(z),z.length===10){let[_,W,q]=z.split("/").map(Number),Z=new Date(q,W-1,_);isNaN(Z.getTime())||H(Z);}},Ce=()=>{switch(k){case"year":return jsxRuntime.jsx(Mr,{currentYear:h.getFullYear(),selectedDate:P,onNavigate:R=>V(T=>T+(R==="next"?12:-12)),onPick:R=>{let T=P??new Date,z=A(R,T.getMonth(),T.getDate()),_=new Date(R,T.getMonth(),z,T.getHours(),T.getMinutes(),T.getSeconds());$(_),a==="year"?(H(_),E(!1)):N(a==="month"?"month":a==="week"?"week":"month");}});case"month":return jsxRuntime.jsx(Tr,{currentMonth:h,selectedDate:P,setIsOpen:E,onNavigate:R=>V(T=>T+(R==="next"?12:-12)),onHeaderClick:()=>N("year"),closeOnSelect:a==="month",onChange:R=>{let T=P??new Date,z=A(R.getFullYear(),R.getMonth(),T.getDate()),_=new Date(R.getFullYear(),R.getMonth(),z,T.getHours(),T.getMinutes(),T.getSeconds());$(_),a==="month"?(H(_),E(!1)):N("day");}});case"week":return jsxRuntime.jsx(Rr,{currentMonth:h,selectedDate:P,setIsOpen:E,onNavigate:R=>V(T=>T+(R==="next"?12:-12)),onHeaderClick:()=>N("year"),onChange:R=>{H(R),E(!1);}});case"day":default:return a==="datetime-local"?jsxRuntime.jsxs("div",{className:"flex h-fit gap-4",children:[jsxRuntime.jsx("div",{className:"flex-1",children:jsxRuntime.jsx(st,{type:a,currentMonth:h,selectedDate:P,onNavigate:R=>V(T=>T+(R==="next"?1:-1)),onMonthClick:()=>N("month"),onYearClick:()=>N("year"),onChange:R=>{let T=P??new Date,z=new Date(R.getFullYear(),R.getMonth(),R.getDate(),T.getHours(),T.getMinutes(),T.getSeconds());H(z);}})}),jsxRuntime.jsx("div",{className:"w-fit",children:jsxRuntime.jsx(Lr,{selectedDate:P,onChange:R=>H(R)})})]}):jsxRuntime.jsx(st,{type:a,currentMonth:h,selectedDate:P,onNavigate:R=>V(T=>T+(R==="next"?1:-1)),onMonthClick:()=>N("month"),onYearClick:()=>N("year"),onChange:R=>{H(R),E(!1);}})}};return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:`space-y-2 ${c}`,children:[e&&jsxRuntime.jsx(F,{htmlFor:w,required:t,children:e}),jsxRuntime.jsx("input",{ref:M,id:w,name:n,type:"text",className:"sr-only",disabled:s,...d}),jsxRuntime.jsxs("div",{ref:y,className:"relative",children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:"text",value:I,onChange:re,onFocus:()=>!s&&E(!0),placeholder:i,disabled:s,className:`
42
42
  w-full px-3 py-2 pr-9 border rounded-md bg-background
43
- ${p?"border-red-500":"border-input"}
43
+ ${m?"border-red-500":"border-input"}
44
44
  ${s?"opacity-50 cursor-not-allowed":"hover:border-ring"}
45
45
  focus:ring-2 focus:ring-ring focus:ring-offset-2
46
- `}),jsxRuntime.jsx(qt,{width:16,height:16,className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"})]}),h&&jsxRuntime.jsx("div",{className:"absolute z-50 mt-1 bg-popover border border-border rounded-md shadow-lg p-4 min-w-70",children:he()})]}),p&&jsxRuntime.jsx(O,{children:p}),!p&&d&&jsxRuntime.jsx($,{children:d})]})})});nr.displayName="DatePicker";var el=nr;var qn=({children:e,before:t,after:r,className:n})=>{let i=zn__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})})},Xe=qn;var Wn=({children:e})=>jsxRuntime.jsx("div",{className:"absolute px-2",children:jsxRuntime.jsx("span",{children:e})}),ir=Wn;var Yn=({children:e})=>jsxRuntime.jsx("div",{className:"absolute right-0 px-2",children:jsxRuntime.jsx("span",{children:e})}),lr=Yn;function cr(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 dr(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 ur(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 mr(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 pr(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 fr(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 gr(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 br(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 Kn=({e,mask:t})=>{switch(t){case"money":return dr(e);case"mobile":return mr(e);case"phone":return pr(e);case"cpfCnpj":return fr(e);case"cpf":return ur(e);case"rg":return gr(e);case"cnpj":return br(e);case"cep":return cr(e);default:return e}},vr=Kn;var Jn=({mask:e,initialValue:t=""})=>{let[r,n]=jr.useState(t);jr.useEffect(()=>{t!==r&&n(t);},[t]);let o=jr.useCallback(a=>{let s=vr({e:a,mask:e})?.currentTarget?.value??a.currentTarget.value;n(s);},[e]),i=jr.useCallback(()=>n(""),[]);return {value:r,setValue:n,handleChange:o,handleClear:i}},xr=Jn;var yr=jr.forwardRef(({label:e,required:t=!1,mask:r,name:n,prefix:o,suffix:i,addonBefore:a,addonBeforeClassName:l,addonAfter:s,addonAfterClassName:p,ClearEnabled:d=!0,className:c,overrideClassName:u=!1,error:m,helperText:L,value:y=void 0,onChange:b,...h},M)=>{let R=jr.useId(),{handleChange:F,handleClear:I,setValue:A}=xr({mask:r,initialValue:y}),S=x("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",m&&"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",c),B=T=>{F(T),b?.(T);},P=()=>{I(),A(""),b?.({target:{name:n||"",value:""}});};return jsxRuntime.jsx(v,{children:jsxRuntime.jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsxRuntime.jsx(D,{htmlFor:R,required:t,children:e}),jsxRuntime.jsxs("div",{className:"relative flex",children:[a&&jsxRuntime.jsx(Xe,{before:!0,className:l,children:a}),jsxRuntime.jsxs("div",{className:"relative flex items-center w-full",children:[o&&jsxRuntime.jsx(ir,{children:o}),jsxRuntime.jsx("input",{id:R,ref:M,name:n,onChange:B,className:u?c:S,...h}),d&&y&&jsxRuntime.jsx(Me,{onClick:P,width:12,height:12,className:x("absolute right-2 cursor-pointer",i&&"right-8")}),i&&jsxRuntime.jsx(lr,{children:i})]}),s&&jsxRuntime.jsx(Xe,{after:!0,className:p,children:s})]}),m&&jsxRuntime.jsx(O,{children:m}),!m&&L&&jsxRuntime.jsx($,{children:L})]})})});yr.displayName="Input";var Nl=yr;var wr=jr.forwardRef(({length:e=6,groupBy:t,value:r,name:n,label:o,required:i=!1,helperText:a,error:l,onChange:s,onBlur:p,className:d,charType:c="numeric",customPattern:u,caseMode:m="none",...L},y)=>{let b=jr.useId(),h=jr.useRef([]),M=f=>{switch(m){case"upper":return f.toUpperCase();case"lower":case"visual-upper":return f.toLowerCase();case"visual-lower":return f.toUpperCase();default:return f}},R=f=>{if(!f)return "";let g=f.slice(0,1);switch(g=M(g),c){case"numeric":return /\d/.test(g)?g:"";case"alpha":return /[A-Za-z]/.test(g)?g:"";case"alphanumeric":return /[A-Za-z0-9]/.test(g)?g:"";case"custom":return u?.test(g)?g:"";default:return g}},F=()=>(r!=null?String(r):"").split("").map(R).slice(0,e),I=F().concat(Array(e).fill(" ")).slice(0,e),A=f=>{let g=f.split("").map(R).join("").slice(0,e),N=g===""?void 0:typeof r=="number"?Number(g):g;s?.({target:{name:n,value:N}});},S=(f,g)=>{let N=R(g),E=F();if(N===""){E[f]="",A(E.join(""));return}if(g.length>1){let V=g.split("").map(R).join("").slice(0,e);A(V),h.current[Math.min(V.length-1,e-1)]?.focus();return}N&&(E[f]=N,A(E.join("")),f<e-1&&h.current[f+1]?.focus());},B=f=>{let g=F();!g[f]&&f>0?g[f-1]="":g[f]="",A(g.join("")),f>0&&h.current[f-1]?.focus();},P=f=>{f.preventDefault();let N=f.clipboardData.getData("text").split("").map(R).join("").slice(0,e);N&&(A(N),h.current[Math.min(N.length-1,e-1)]?.focus());},T=f=>{switch(m){case"upper":case"visual-upper":return f.toUpperCase();case"lower":case"visual-lower":return f.toLowerCase();default:return f}};return jsxRuntime.jsx(v,{children:jsxRuntime.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[o&&jsxRuntime.jsx(D,{htmlFor:b,required:i,children:o}),jsxRuntime.jsx("div",{className:x("flex gap-3 items-center",l&&"text-red-500",d),...L,children:I.map((f,g)=>{let N=t&&g>0&&g%t===0;return jsxRuntime.jsxs(jr__default.default.Fragment,{children:[N&&jsxRuntime.jsx("span",{className:"flex items-center justify-center text-xl font-bold select-none",children:"-"}),jsxRuntime.jsx("input",{id:b,type:"text",maxLength:1,inputMode:c==="numeric"?"numeric":"text",value:T(f).trim(),ref:E=>{h.current[g]=E,g===0&&y&&(typeof y=="function"?y(E):typeof y=="object"&&(y.current=E));},onPaste:P,onChange:E=>S(g,E.target.value),onKeyDown:E=>E.key==="Backspace"&&B(g),onBlur:p,className:x("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")})]},g)})}),l&&jsxRuntime.jsx(O,{children:l}),!l&&a&&jsxRuntime.jsx($,{children:a})]})})});wr.displayName="OtpInput";var Hl=wr;var kr=jr.forwardRef(({label:e,required:t,option:r,description:n,icon:o,className:i,overrideClassName:a,helperText:l,error:s,...p},d)=>{let c=jr.useId(),u=x("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(v,{children:jsxRuntime.jsxs("div",{className:"space-y-3",children:[e&&jsxRuntime.jsx(D,{required:t,children:e}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{id:c,type:"radio",className:a?i:u,ref:d,...p}),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(D,{htmlFor:c,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r}),n&&jsxRuntime.jsx(D,{id:`${c}-description`,htmlFor:c,className:"text-xs text-muted-foreground",children:n})]})]})]}),s&&jsxRuntime.jsx(O,{children:s}),!s&&l&&jsxRuntime.jsx($,{children:l})]})})});kr.displayName="Radio";var Wl=kr;function so(e,t){let{label:r,required:n,name:o,labelKey:i,valueKey:a,options:l,alignment:s="vertical",className:p,overrideClassName:d=!1,helperText:c,error:u,typeSet:m="field",value:L,onChange:y,...b}=e,h=jr.useId(),M=jr.useMemo(()=>new Map(l.map(S=>[String(S[a]),S])),[l,a]),R=jr.useMemo(()=>L==null?"":String(m==="field"?L:L[a]),[L,m,a]),F=S=>{if(!y)return;let B;if(m==="field"){let P=M.get(S);if(P)B=P[a];else {let T=Number(S);B=Number.isNaN(T)?S:T;}}else B=M.get(S)??void 0;y({target:{name:o,value:B,type:"radiogroup",checked:!0}});},I=s==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",A=x("h-4 w-4 rounded-full border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",u&&"border-destructive");return jsxRuntime.jsx(v,{children:jsxRuntime.jsxs("div",{className:x("flex flex-col gap-3",p),children:[r&&jsxRuntime.jsx(D,{required:n,children:r}),jsxRuntime.jsx("div",{className:I,children:l.map((S,B)=>{let P=String(S[a]),T=`${h}-${P}-${B}`;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{...b,id:T,ref:t,name:o,type:"radio",checked:R===P,onChange:()=>F(P),className:d?p:A}),jsxRuntime.jsx(D,{htmlFor:T,children:String(S[i])})]},T)})}),u&&jsxRuntime.jsx(O,{children:String(u)}),!u&&c&&jsxRuntime.jsx($,{children:c})]})})}function lo(){let e=jr.forwardRef(so);return e.displayName="RadioGroup",e}var co=lo(),rc=co;function po({label:e,required:t=!1,options:r,labelKey:n,valueKey:o,placeholder:i,error:a,helperText:l,className:s,...p},d){let c=jr.useId(),u=x("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(v,{children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(D,{htmlFor:c,required:t,children:e}),jsxRuntime.jsxs("select",{id:c,ref:d,className:u,...p,children:[i&&jsxRuntime.jsx("option",{value:"",disabled:!0,children:i}),r.map((m,L)=>jsxRuntime.jsx("option",{value:String(m[o]),children:String(m[n])},L))]}),a&&jsxRuntime.jsx(O,{children:a}),!a&&l&&jsxRuntime.jsx($,{children:l})]})})}function fo(){let e=jr.forwardRef(po);return e.displayName="Select",e}var go=fo(),pc=go;var Nr=jr.forwardRef(({label:e,required:t,option:r,description:n,icon:o,checked:i=!1,className:a,overrideClassName:l,error:s,name:p,...d},c)=>{let u=jr.useId();return jsxRuntime.jsx(v,{children:jsxRuntime.jsxs("div",{className:"flex flex-col gap-2",children:[e&&jsxRuntime.jsx(D,{required:t,children:e}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:u,name:p,checked:i,className:"peer sr-only",ref:c,...d}),jsxRuntime.jsx("label",{htmlFor:u,className:x("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:x("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(D,{id:`${u}-label`,htmlFor:u,className:"text-sm font-medium leading-none",children:r}),n&&jsxRuntime.jsx(D,{id:`${u}-description`,htmlFor:u,className:"text-xs text-muted-foreground",children:n})]})]})]})})});Nr.displayName="Switch";var Cc=Nr;var Rr=jr__default.default.forwardRef(({label:e,required:t,showCount:r,maxLength:n,className:o,overrideClassName:i=!1,error:a,helperText:l,...s},p)=>{let d=jr.useId(),[c,u]=jr.useState(0),m=x("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(v,{children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(D,{htmlFor:d,required:t,children:e}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("textarea",{id:d,className:i?o:m,maxLength:n,onInput:L=>u(L.currentTarget.textLength),ref:p,...s}),r&&jsxRuntime.jsxs("span",{className:"absolute bottom-2 right-3 text-xs text-muted-foreground",children:[c,n?` / ${n}`:""]})]}),a&&jsxRuntime.jsx(O,{children:a}),!a&&l&&jsxRuntime.jsx($,{children:l})]})})});Rr.displayName="TextArea";var Mc=Rr;var Co=({files:e,removeFile:t})=>jsxRuntime.jsx("div",{className:"space-y-2",children:e?.length>0&&e?.map((r,n)=>jsxRuntime.jsxs("div",{className:"flex items-center justify-between p-2 bg-secondary rounded",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm truncate",children:r.name}),jsxRuntime.jsxs("p",{className:"text-xs text-muted-foreground",children:[(r?.size/1024).toFixed(1)," KB"]})]}),jsxRuntime.jsx("button",{type:"button",onClick:o=>{o.stopPropagation(),t(n);},className:"ml-2 p-1 hover:bg-destructive/20 rounded",children:"\u2715"})]},`${r?.name}-${n}`))}),Dr=Co;var wo=({accept:e,maxSize:t})=>jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("svg",{className:"w-8 h-8 mx-auto text-muted-foreground",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm text-foreground",children:"Clique para selecionar ou arraste arquivos aqui"}),jsxRuntime.jsxs("p",{className:"text-xs text-muted-foreground",children:[e&&`Tipos aceitos: ${e}`,t&&` \u2022 Tamanho m\xE1ximo: ${t}MB`]})]})]}),Mr=wo;var Er=({files:e,setFiles:t,multiple:r=!1,disabled:n=!1,filterFiles:o=i=>i})=>{let i=jr.useRef(null),[a,l]=jr.useState(!1),s=jr.useCallback(u=>{u.preventDefault(),!n&&l(!0);},[n]),p=jr.useCallback(()=>{l(!1);},[]),d=jr.useCallback(u=>{if(u.preventDefault(),n||!i.current)return;l(!1);let m=Array.from(u.dataTransfer.files);if(!r&&!e||!r&&m.length>1)return;let L=o(m),y=r?L:L.slice(0,1);t(y);let b=new DataTransfer;y.forEach(h=>b.items.add(h)),i.current.files=b.files,i.current.dispatchEvent(new Event("change",{bubbles:!0}));},[n,r,e,o]),c=jr.useCallback(()=>{t([]),i.current&&(i.current.value="");},[]);return {files:e,setFiles:t,clearFiles:c,inputRef:i,isDragOver:a,setIsDragOver:l,handleDrop:d,handleDragOver:s,handleDragLeave:p}};var Fr=({files:e,setFiles:t,inputRef:r})=>({removeFile:jr.useCallback(o=>{if(!r.current)return;let i=e?.filter((l,s)=>s!==o);t(i);let a=new DataTransfer;i?.forEach(l=>a.items.add(l)),r.current.files=a.files,r.current.dispatchEvent(new Event("change",{bubbles:!0}));},[e,t,r])});var No=({previews:e,onRemove:t})=>{let[r,n]=jr.useState(0),o=()=>n(a=>a===0?e?.length-1:a-1),i=()=>n(a=>a===e?.length-1?0:a+1);return jsxRuntime.jsxs("div",{className:"relative w-full h-56 rounded-lg overflow-hidden bg-black/5",children:[jsxRuntime.jsx("img",{src:e[r]?.url,alt:e[r]?.file?.name,className:"w-full h-full object-cover"}),e.length>1&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",onClick:o,className:"absolute left-2 top-1/2 -translate-y-1/2 bg-black/50 text-white px-2 py-1 rounded",children:"\u2039"}),jsxRuntime.jsx("button",{type:"button",onClick:i,className:"absolute right-2 top-1/2 -translate-y-1/2 bg-black/50 text-white px-2 py-1 rounded",children:"\u203A"})]}),jsxRuntime.jsx("button",{type:"button",onClick:()=>t(r),className:"absolute top-2 right-2 bg-red-500 text-white rounded px-2 py-1",children:"\u2715"})]})},Sr=No;var Hr=jr.forwardRef(({label:e,required:t,accept:r,renderFiles:n,preview:o=!1,multiple:i=!1,maxSize:a=10,disabled:l=!1,error:s=!1,helperText:p,className:d,name:c,onChange:u,onBlur:m,...L},y)=>{let b=jr.useId(),[h,M]=jr.useState([]),R=1024*1024,F=V=>V.filter(J=>(!a||J.size<=a*R)&&(!r||J.type.match(r))),{inputRef:I,isDragOver:A,handleDrop:S,handleDragOver:B,handleDragLeave:P}=Er({files:h,setFiles:M,multiple:i,filterFiles:F}),{removeFile:T}=Fr({files:h,setFiles:M,inputRef:I}),f=V=>{I.current=V,typeof y=="function"?y(V):y&&(y.current=V);},g=V=>{let J=Array.from(V.target.files??[]);if(!J.length)return;let te=F(J);M(i?te:te.slice(0,1)),u?.(V);},N=jr.useMemo(()=>!o||!h||!h.length?[]:h.filter(V=>V.type.startsWith("image/")).map(V=>({file:V,url:URL.createObjectURL(V)})),[h,o]);jr.useEffect(()=>()=>N.forEach(V=>URL.revokeObjectURL(V.url)),[N]);let E=o&&N.length>0;return jsxRuntime.jsx(v,{children:jsxRuntime.jsxs("div",{className:`space-y-2 ${d}`,children:[e&&jsxRuntime.jsx(D,{htmlFor:b,required:t,children:e}),jsxRuntime.jsxs("div",{onDrop:S,onDragOver:B,onDragLeave:P,onClick:()=>{!l&&!E&&I.current?.click();},className:`
46
+ `}),jsxRuntime.jsx(hr,{width:16,height:16,className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"})]}),v&&jsxRuntime.jsx("div",{className:"absolute z-50 mt-1 bg-popover border border-border rounded-md shadow-lg p-4 min-w-70",children:Ce()})]}),m&&jsxRuntime.jsx(G,{children:m}),!m&&u&&jsxRuntime.jsx(O,{children:u})]})})});Fr.displayName="DatePicker";var Wc=Fr;var Ue=({size:e="md",variant:t="default",color:r="primary",className:n="",speed:o="normal",text:i,textPosition:a="bottom",overlay:l=!1,progress:s})=>{let[m,u]=Wn.useState(s||0);Wn.useEffect(()=>{s!==void 0&&u(Math.min(Math.max(s,0),100));},[s]);let c=()=>{switch(e){case"xs":return "w-3 h-3";case"sm":return "w-4 h-4";case"lg":return "w-8 h-8";case"xl":return "w-12 h-12";case"xxl":return "w-16 h-16";default:return "w-6 h-6"}},d=()=>{switch(r){case"secondary":return "text-gray-500 dark:text-gray-400";case"muted":return "text-gray-400 dark:text-gray-500";case"success":return "text-green-600 dark:text-green-400";case"danger":return "text-red-600 dark:text-red-400";case"warning":return "text-yellow-600 dark:text-yellow-400";case"info":return "text-blue-400 dark:text-blue-300";case"white":return "text-white dark:text-gray-200";default:return "text-blue-600 dark:text-blue-400"}},p=()=>{switch(o){case"slow":return "animate-[spin_2s_linear_infinite]";case"fast":return "animate-[spin_0.5s_linear_infinite]";default:return "animate-spin"}},w=()=>{switch(o){case"slow":return "animate-pulseSlow";case"fast":return "animate-pulseFast";default:return "animate-pulse"}},y=()=>{switch(o){case"slow":return "animate-bounceSlow";case"fast":return "animate-bounceFast";default:return "animate-bounce"}},b=()=>{switch(e){case"xs":return "w-1 h-1";case"sm":return "w-1.5 h-1.5";case"lg":return "w-3 h-3";case"xl":return "w-4 h-4";case"xxl":return "w-5 h-5";default:return "w-2 h-2"}},v=()=>{switch(e){case"xs":return "w-0.5 h-3";case"sm":return "w-0.5 h-4";case"lg":return "w-1 h-8";case"xl":return "w-1.5 h-12";case"xxl":return "w-2 h-16";default:return "w-1 h-6"}},E=()=>{switch(e){case"xs":return "w-0.5";case"sm":return "w-1";case"lg":return "w-1.5";case"xl":return "w-2";case"xxl":return "w-2.5";default:return "w-1"}},D=()=>{switch(e){case"xs":return "w-1 h-1";case"sm":return "w-1.5 h-1.5";case"lg":return "w-2 h-2";case"xl":return "w-3 h-3";case"xxl":return "w-4 h-4";default:return "w-1.5 h-1.5"}},V=()=>t==="dots"?jsxRuntime.jsx("div",{className:"flex space-x-1",children:[0,1,2].map(S=>jsxRuntime.jsx("div",{className:`${b()} ${d()} bg-current rounded-full ${w()}`,style:{animationDelay:`${S*.2}s`}},S))}):t==="bars"?jsxRuntime.jsx("div",{className:"flex items-end space-x-1",children:[0,1,2,3].map(S=>jsxRuntime.jsx("div",{className:`${v()} ${d()} bg-current ${w()}`,style:{animationDelay:`${S*.15}s`}},S))}):t==="ring"?jsxRuntime.jsx("div",{className:c(),children:jsxRuntime.jsx("div",{className:`w-full h-full border-2 border-gray-200 dark:border-gray-700 border-t-current rounded-full ${p()} ${d()}`})}):t==="pulse"?jsxRuntime.jsx("div",{className:`${c()} ${d()}`,children:jsxRuntime.jsx("div",{className:`w-full h-full bg-current rounded-full ${w()}`})}):t==="wave"?jsxRuntime.jsx("div",{className:"flex items-end space-x-1",children:[0,1,2,3,4].map(S=>jsxRuntime.jsx("div",{className:`${E()} ${d()} bg-current rounded animate-wave`,style:{animationDelay:`${S*.15}s`,height:e==="xs"?"8px":e==="sm"?"10px":e==="lg"?"16px":e==="xl"?"20px":e==="xxl"?"24px":"12px"}},S))}):t==="bounce"?jsxRuntime.jsx("div",{className:"flex space-x-1",children:[0,1,2].map(S=>jsxRuntime.jsx("div",{className:`${b()} ${d()} bg-current rounded-full ${y()}`,style:{animationDelay:`${S*.2}s`}},S))}):t==="grid"?jsxRuntime.jsx("div",{className:`${c()} ${d()} grid grid-cols-3 gap-0.5`,children:[...Array(9)].map((S,k)=>jsxRuntime.jsx("div",{className:`${D()} bg-current rounded-full ${w()}`,style:{animationDelay:`${k*.1}s`}},k))}):t==="clock"?jsxRuntime.jsxs("div",{className:`${c()} relative ${d()}`,children:[jsxRuntime.jsx("div",{className:"w-full h-full border-2 border-current rounded-full"}),jsxRuntime.jsx("div",{className:"absolute top-1/2 left-1/2 w-1/2 h-0.5 bg-current origin-left -translate-y-1/2 animate-clock"}),jsxRuntime.jsx("div",{className:"absolute top-1/2 left-1/2 w-2/5 h-0.5 bg-current origin-left -translate-y-1/2 animate-clock",style:{animationDelay:"-4s"}})]}):t==="orbit"?jsxRuntime.jsxs("div",{className:`${c()} relative`,children:[jsxRuntime.jsx("div",{className:`w-full h-full border-2 border-gray-200 dark:border-gray-700 rounded-full ${d()}`}),jsxRuntime.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2",children:jsxRuntime.jsx("div",{className:`${b()} ${d()} bg-current rounded-full animate-orbit`})})]}):t==="cube"?jsxRuntime.jsxs("div",{className:`${c()} ${d()} relative transform-style-3d animate-rotateCube`,children:[jsxRuntime.jsx("div",{className:"absolute w-full h-full bg-current opacity-25"}),jsxRuntime.jsx("div",{className:"absolute w-full h-full bg-current opacity-25 transform-rotateY(90deg)"}),jsxRuntime.jsx("div",{className:"absolute w-full h-full bg-current opacity-25 transform-rotateX(90deg)"})]}):t==="circle-dots"?jsxRuntime.jsx("div",{className:`${c()} relative ${d()}`,children:[...Array(8)].map((S,k)=>jsxRuntime.jsx("div",{className:"absolute w-full h-full animate-circleDots",style:{transform:`rotate(${k*45}deg)`},children:jsxRuntime.jsx("div",{className:`${b()} bg-current rounded-full absolute top-0 left-1/2 -translate-x-1/2 animate-fadePulse`,style:{animationDelay:`${k*.1}s`}})},k))}):t==="infinity"?jsxRuntime.jsx("div",{className:`${c()} ${d()}`,children:jsxRuntime.jsxs("svg",{viewBox:"0 0 120 30",className:"w-full h-full",children:[jsxRuntime.jsx("circle",{cx:"15",cy:"15",r:"12",className:"animate-infinity1"}),jsxRuntime.jsx("circle",{cx:"60",cy:"15",r:"12",className:"animate-infinity2"}),jsxRuntime.jsx("circle",{cx:"105",cy:"15",r:"12",className:"animate-infinity3"})]})}):t==="progress"?jsxRuntime.jsxs("div",{className:`${c()} relative ${d()}`,children:[jsxRuntime.jsxs("svg",{className:"w-full h-full",viewBox:"0 0 36 36",children:[jsxRuntime.jsx("path",{className:"text-gray-200 dark:text-gray-700",stroke:"currentColor",strokeWidth:"3",fill:"transparent",d:`M18 2.0845\r
47
+ a 15.9155 15.9155 0 0 1 0 31.831\r
48
+ a 15.9155 15.9155 0 0 1 0 -31.831`}),jsxRuntime.jsx("path",{className:"transition-all duration-300",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",fill:"transparent",strokeDasharray:"100, 100",strokeDashoffset:100-m,d:`M18 2.0845\r
49
+ a 15.9155 15.9155 0 0 1 0 31.831\r
50
+ a 15.9155 15.9155 0 0 1 0 -31.831`})]}),e!=="xs"&&e!=="sm"&&jsxRuntime.jsxs("div",{className:"absolute inset-0 flex items-center justify-center text-xs font-medium",children:[m,"%"]})]}):jsxRuntime.jsx("div",{className:c(),children:jsxRuntime.jsxs("svg",{className:`${p()} ${d()}`,fill:"none",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"m4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),P=()=>{switch(a){case"top":return "flex-col-reverse";case"left":return "flex-row-reverse";case"right":return "flex-row";default:return "flex-col"}},$=()=>{switch(e){case"xs":case"sm":return "text-xs";case"lg":return "text-base";case"xl":case"xxl":return "text-lg";default:return "text-sm"}},I=jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:`inline-flex ${i?`items-center ${P()} space-y-1 space-x-0 ${a==="left"||a==="right"?"space-y-0 space-x-2":""}`:""}`,children:[V(),i&&jsxRuntime.jsx("span",{className:`${$()} text-gray-500 dark:text-gray-400`,children:i})]})});return l?jsxRuntime.jsx("div",{className:"fixed inset-0 bg-white/80 dark:bg-gray-900/80 backdrop-blur-sm flex items-center justify-center z-50",children:I}):jsxRuntime.jsx("div",{className:n,children:I})};Ue.displayName="Spinner";var Sr=Ue,Vr=({text:e="Carregando...",size:t="md",variant:r="default",color:n="primary",className:o="",textPosition:i="right"})=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{className:o,children:jsxRuntime.jsx(Ue,{size:t,variant:r,color:n,text:e,textPosition:i})})});Vr.displayName="LoadingSpinner";var Xc=Vr,Ir=({isVisible:e,text:t="Carregando...",variant:r="default",size:n="lg",className:o=""})=>e?jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{className:`fixed inset-0 bg-white/80 dark:bg-gray-900/80 backdrop-blur-sm flex items-center justify-center z-50 ${o}`,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[jsxRuntime.jsx(Ue,{size:n,variant:r}),jsxRuntime.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:t})]})})}):null;Ir.displayName="LoadingOverlay";var Jc=Ir,Hr=({size:e="sm",color:t="primary"})=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{className:`${(()=>{switch(e){case"xs":return "w-3 h-3";case"md":return "w-5 h-5";default:return "w-4 h-4"}})()} ${t==="white"?"text-white":"text-current"}`,children:jsxRuntime.jsxs("svg",{className:"animate-spin",fill:"none",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"m4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})})});Hr.displayName="ButtonSpinner";var jc=Hr,$r=({lines:e=3,className:t=""})=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{className:`space-y-3 ${t}`,children:[...Array(e)].map((r,n)=>jsxRuntime.jsx("div",{className:"h-4 bg-gray-200 dark:bg-gray-700 rounded animate-pulse",style:{width:n===e-1?"60%":"100%"}},n))})});$r.displayName="ContentLoader";var Zc=$r,Ar=({width:e="100%",height:t="1rem",circle:r=!1,className:n=""})=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{className:`bg-gray-200 dark:bg-gray-700 animate-pulse ${r?"rounded-full":"rounded"} ${n}`,style:{width:e,height:t}})});Ar.displayName="Skeleton";var Qc=Ar;var Br=({children:e,type:t,className:r,overrideClassName:n=!1})=>{if(e)switch(t){case"loading":return jsxRuntime.jsxs("p",{className:n?r:g("text-sm text-muted-foreground flex items-center gap-2",r),children:[jsxRuntime.jsx(Sr,{size:"xs"}),e]});case"error":return jsxRuntime.jsx("p",{className:n?r:g("text-sm text-red-600 dark:text-red-400",r),children:e});case"warning":return jsxRuntime.jsx("p",{className:n?r:g("text-sm text-yellow-600 dark:text-yellow-400",r),children:e});case"success":return jsxRuntime.jsx("p",{className:n?r:g("text-sm text-green-600 dark:text-green-400",r),children:e});case"info":return jsxRuntime.jsx("p",{className:n?r:g("text-sm text-blue-600 dark:text-blue-400",r),children:e});case"helper":return jsxRuntime.jsx("p",{className:n?r:g("text-sm text-muted-foreground",r),children:e});default:return null}};Br.displayName="FieldFeedback";var We=Br;var zo=({children:e,before:t,after:r,className:n})=>{let i=Go__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})})},ut=zo;var Uo=({children:e})=>jsxRuntime.jsx("div",{className:"absolute px-2",children:jsxRuntime.jsx("span",{children:e})}),zr=Uo;var Wo=({children:e})=>jsxRuntime.jsx("div",{className:"absolute right-0 px-2",children:jsxRuntime.jsx("span",{children:e})}),Wr=Wo;function qr(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 Yr(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 Kr(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 _r(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 Xr(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 Jr(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 jr(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 Zr(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 qo=({e,mask:t})=>{switch(t){case"money":return Yr(e);case"mobile":return _r(e);case"phone":return Xr(e);case"cpfCnpj":return Jr(e);case"cpf":return Kr(e);case"rg":return jr(e);case"cnpj":return Zr(e);case"cep":return qr(e);default:return e}},Qr=qo;var _o=({mask:e,initialValue:t=""})=>{let[r,n]=Wn.useState(t);Wn.useEffect(()=>{t!==r&&n(t);},[t]);let o=Wn.useCallback(a=>{let s=Qr({e:a,mask:e})?.currentTarget?.value??a.currentTarget.value;n(s);},[e]),i=Wn.useCallback(()=>n(""),[]);return {value:r,setValue:n,handleChange:o,handleClear:i}},tn=_o;var rn=Wn.forwardRef(({label:e,required:t=!1,mask:r,name:n,prefix:o,suffix:i,addonBefore:a,addonBeforeClassName:l,addonAfter:s,addonAfterClassName:m,ClearEnabled:u=!0,className:c,overrideClassName:d=!1,error:p,helperText:w,value:y=void 0,onChange:b,...v},E)=>{let D=Wn.useId(),{handleChange:V,handleClear:P,setValue:$}=tn({mask:r,initialValue:y}),I=g("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",p&&"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",c),S=N=>{V(N),b?.(N);},k=()=>{P(),$(""),b?.({target:{name:n||"",value:""}});};return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsxRuntime.jsx(F,{htmlFor:D,required:t,children:e}),jsxRuntime.jsxs("div",{className:"relative flex",children:[a&&jsxRuntime.jsx(ut,{before:!0,className:l,children:a}),jsxRuntime.jsxs("div",{className:"relative flex items-center w-full",children:[o&&jsxRuntime.jsx(zr,{children:o}),jsxRuntime.jsx("input",{id:D,ref:E,name:n,onChange:S,className:d?c:I,...v}),u&&y&&jsxRuntime.jsx(Ge,{onClick:k,width:12,height:12,className:g("absolute right-2 cursor-pointer",i&&"right-8")}),i&&jsxRuntime.jsx(Wr,{children:i})]}),s&&jsxRuntime.jsx(ut,{after:!0,className:m,children:s})]}),p&&jsxRuntime.jsx(G,{children:p}),!p&&w&&jsxRuntime.jsx(O,{children:w})]})})});rn.displayName="Input";var Md=rn;var on=Wn.forwardRef(({length:e=6,groupBy:t,value:r,name:n,label:o,required:i=!1,helperText:a,error:l,onChange:s,onBlur:m,className:u,charType:c="numeric",customPattern:d,caseMode:p="none",...w},y)=>{let b=Wn.useId(),v=Wn.useRef([]),E=x=>{switch(p){case"upper":return x.toUpperCase();case"lower":case"visual-upper":return x.toLowerCase();case"visual-lower":return x.toUpperCase();default:return x}},D=x=>{if(!x)return "";let h=x.slice(0,1);switch(h=E(h),c){case"numeric":return /\d/.test(h)?h:"";case"alpha":return /[A-Za-z]/.test(h)?h:"";case"alphanumeric":return /[A-Za-z0-9]/.test(h)?h:"";case"custom":return d?.test(h)?h:"";default:return h}},V=()=>(r!=null?String(r):"").split("").map(D).slice(0,e),P=V().concat(Array(e).fill(" ")).slice(0,e),$=x=>{let h=x.split("").map(D).join("").slice(0,e),M=h===""?void 0:typeof r=="number"?Number(h):h;s?.({target:{name:n,value:M}});},I=(x,h)=>{let M=D(h),H=V();if(M===""){H[x]="",$(H.join(""));return}if(h.length>1){let A=h.split("").map(D).join("").slice(0,e);$(A),v.current[Math.min(A.length-1,e-1)]?.focus();return}M&&(H[x]=M,$(H.join("")),x<e-1&&v.current[x+1]?.focus());},S=x=>{let h=V();!h[x]&&x>0?h[x-1]="":h[x]="",$(h.join("")),x>0&&v.current[x-1]?.focus();},k=x=>{x.preventDefault();let M=x.clipboardData.getData("text").split("").map(D).join("").slice(0,e);M&&($(M),v.current[Math.min(M.length-1,e-1)]?.focus());},N=x=>{switch(p){case"upper":case"visual-upper":return x.toUpperCase();case"lower":case"visual-lower":return x.toLowerCase();default:return x}};return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[o&&jsxRuntime.jsx(F,{htmlFor:b,required:i,children:o}),jsxRuntime.jsx("div",{className:g("flex gap-3 items-center",l&&"text-red-500",u),...w,children:P.map((x,h)=>{let M=t&&h>0&&h%t===0;return jsxRuntime.jsxs(Wn__default.default.Fragment,{children:[M&&jsxRuntime.jsx("span",{className:"flex items-center justify-center text-xl font-bold select-none",children:"-"}),jsxRuntime.jsx("input",{id:b,type:"text",maxLength:1,inputMode:c==="numeric"?"numeric":"text",value:N(x).trim(),ref:H=>{v.current[h]=H,h===0&&y&&(typeof y=="function"?y(H):typeof y=="object"&&(y.current=H));},onPaste:k,onChange:H=>I(h,H.target.value),onKeyDown:H=>H.key==="Backspace"&&S(h),onBlur:m,className:g("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")})]},h)})}),l&&jsxRuntime.jsx(G,{children:l}),!l&&a&&jsxRuntime.jsx(O,{children:a})]})})});on.displayName="OtpInput";var Bd=on;var an=Wn.forwardRef(({label:e,required:t,option:r,description:n,icon:o,className:i,overrideClassName:a,helperText:l,error:s,...m},u)=>{let c=Wn.useId(),d=g("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(f,{children:jsxRuntime.jsxs("div",{className:"space-y-3",children:[e&&jsxRuntime.jsx(F,{required:t,children:e}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{id:c,type:"radio",className:a?i:d,ref:u,...m}),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(F,{htmlFor:c,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r}),n&&jsxRuntime.jsx(F,{id:`${c}-description`,htmlFor:c,className:"text-xs text-muted-foreground",children:n})]})]})]}),s&&jsxRuntime.jsx(G,{children:s}),!s&&l&&jsxRuntime.jsx(O,{children:l})]})})});an.displayName="Radio";var _d=an;function aa(e,t){let{label:r,required:n,name:o,labelKey:i,valueKey:a,options:l,alignment:s="vertical",className:m,overrideClassName:u=!1,helperText:c,error:d,typeSet:p="field",value:w,onChange:y,...b}=e,v=Wn.useId(),E=Wn.useMemo(()=>new Map(l.map(I=>[String(I[a]),I])),[l,a]),D=Wn.useMemo(()=>w==null?"":String(p==="field"?w:w[a]),[w,p,a]),V=I=>{if(!y)return;let S;if(p==="field"){let k=E.get(I);if(k)S=k[a];else {let N=Number(I);S=Number.isNaN(N)?I:N;}}else S=E.get(I)??void 0;y({target:{name:o,value:S,type:"radiogroup",checked:!0}});},P=s==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",$=g("h-4 w-4 rounded-full border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",d&&"border-destructive");return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:g("flex flex-col gap-3",m),children:[r&&jsxRuntime.jsx(F,{required:n,children:r}),jsxRuntime.jsx("div",{className:P,children:l.map((I,S)=>{let k=String(I[a]),N=`${v}-${k}-${S}`;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{...b,id:N,ref:t,name:o,type:"radio",checked:D===k,onChange:()=>V(k),className:u?m:$}),jsxRuntime.jsx(F,{htmlFor:N,children:String(I[i])})]},N)})}),d&&jsxRuntime.jsx(G,{children:String(d)}),!d&&c&&jsxRuntime.jsx(O,{children:c})]})})}function ia(){let e=Wn.forwardRef(aa);return e.displayName="RadioGroup",e}var sa=ia(),au=sa;var la=["loading","error","warning","success","info","helper"],Ye=e=>{if(!e)return null;let t=la.find(r=>e[r]);return t?{type:t,message:e[t]}:null};var cn=Wn.forwardRef(({label:e,required:t,className:r,showValue:n=!1,min:o=0,max:i=100,step:a=1,value:l,overrideClassName:s,feedback:m,...u},c)=>{let d=Wn.useId(),p=(Number(l)-Number(o))/(Number(i)-Number(o))*100,w=Ye(m),y=g("w-full h-2 bg-secondary rounded-lg appearance-none cursor-pointer slider","focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",r);return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[(e||n)&&jsxRuntime.jsxs("div",{className:"flex justify-between items-center",children:[e&&jsxRuntime.jsx(F,{htmlFor:d,required:t,children:e}),n&&jsxRuntime.jsx("span",{className:"text-sm text-muted-foreground",children:l})]}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:"range",id:d,ref:c,min:o,max:i,step:a,value:l,className:s?r:y,style:{background:`linear-gradient(to right, hsl(var(--primary)) 0%, hsl(var(--primary)) ${p}%, hsl(var(--secondary)) ${p}%, hsl(var(--secondary)) 100%)`},...u}),w&&jsxRuntime.jsx(We,{type:w.type,children:w.message})]})]})})});cn.displayName="Range";var bu=cn;var ma=({value:e,defaultValue:t,onChange:r})=>{let[n,o]=Wn.useState(t),i=e!==void 0;return [i?e:n??t,s=>{i||o(s),r?.(s);}]},dn=ma;var mn=Wn.forwardRef(({min:e=0,max:t=100,step:r=1,value:n,defaultValue:o=[e,t],onChange:i,disabled:a,label:l,showValues:s=!0,className:m="",feedback:u,required:c},d)=>{let p=Wn.useId(),w=Wn.useRef(null),y=Wn.useRef(null),b=Ye(u),[v,E]=dn({value:n,defaultValue:o,onChange:P=>i?.({target:{value:P}})}),D=P=>(P-e)/(t-e)*100,V=Wn.useCallback(P=>{if(!w.current||!y.current||a)return;let $=w.current.getBoundingClientRect(),I=Math.min(100,Math.max(0,(P-$.left)/$.width*100)),S=e+I/100*(t-e),k=Math.round(S/r)*r,N=[...v];y.current==="min"?N[0]=Math.min(k,v[1]):N[1]=Math.max(k,v[0]),E(N);},[v,e,t,r,E,a]);return Wn.useEffect(()=>{let P=I=>V(I.clientX),$=()=>y.current=null;return document.addEventListener("mousemove",P),document.addEventListener("mouseup",$),()=>{document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",$);}},[V]),jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{ref:d,className:`space-y-2 ${m}`,children:[l&&jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx(F,{htmlFor:p,required:c,children:l}),s&&jsxRuntime.jsxs("span",{className:"text-sm text-muted-foreground",children:[v[0]," \u2013 ",v[1]]})]}),jsxRuntime.jsxs("div",{ref:w,className:"relative h-2 bg-secondary rounded-full",children:[jsxRuntime.jsx("div",{className:"absolute h-2 bg-primary rounded-full",style:{left:`${D(v[0])}%`,width:`${D(v[1])-D(v[0])}%`}}),["min","max"].map(P=>jsxRuntime.jsx("div",{onMouseDown:()=>y.current=P,className:`absolute w-5 h-5 bg-background border-2 border-primary rounded-full\r
51
+ top-1/2 -translate-y-1/2 -translate-x-1/2 cursor-pointer`,style:{left:`${D(P==="min"?v[0]:v[1])}%`}},P))]}),b&&jsxRuntime.jsx(We,{type:b.type,children:b.message})]})})});mn.displayName="RangeSlider";var Lu=mn;function ha({label:e,required:t=!1,options:r,labelKey:n,valueKey:o,placeholder:i,error:a,helperText:l,className:s,...m},u){let c=Wn.useId(),d=g("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(f,{children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(F,{htmlFor:c,required:t,children:e}),jsxRuntime.jsxs("select",{id:c,ref:u,className:d,...m,children:[i&&jsxRuntime.jsx("option",{value:"",disabled:!0,children:i}),r.map((p,w)=>jsxRuntime.jsx("option",{value:String(p[o]),children:String(p[n])},w))]}),a&&jsxRuntime.jsx(G,{children:a}),!a&&l&&jsxRuntime.jsx(O,{children:l})]})})}function ya(){let e=Wn.forwardRef(ha);return e.displayName="Select",e}var wa=ya(),Au=wa;var fn=Wn.forwardRef(({label:e,required:t,option:r,description:n,icon:o,checked:i=!1,className:a,overrideClassName:l,error:s,name:m,...u},c)=>{let d=Wn.useId();return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:"flex flex-col gap-2",children:[e&&jsxRuntime.jsx(F,{required:t,children:e}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:d,name:m,checked:i,className:"peer sr-only",ref:c,...u}),jsxRuntime.jsx("label",{htmlFor:d,className:g("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:g("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(F,{id:`${d}-label`,htmlFor:d,className:"text-sm font-medium leading-none",children:r}),n&&jsxRuntime.jsx(F,{id:`${d}-description`,htmlFor:d,className:"text-xs text-muted-foreground",children:n})]})]})]})})});fn.displayName="Switch";var Yu=fn;var gn=Wn__default.default.forwardRef(({label:e,required:t,showCount:r,maxLength:n,className:o,overrideClassName:i=!1,error:a,helperText:l,...s},m)=>{let u=Wn.useId(),[c,d]=Wn.useState(0),p=g("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(f,{children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(F,{htmlFor:u,required:t,children:e}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("textarea",{id:u,className:i?o:p,maxLength:n,onInput:w=>d(w.currentTarget.textLength),ref:m,...s}),r&&jsxRuntime.jsxs("span",{className:"absolute bottom-2 right-3 text-xs text-muted-foreground",children:[c,n?` / ${n}`:""]})]}),a&&jsxRuntime.jsx(G,{children:a}),!a&&l&&jsxRuntime.jsx(O,{children:l})]})})});gn.displayName="TextArea";var tm=gn;var vn=Wn.createContext(void 0),sm=()=>{let e=Wn.useContext(vn);if(!e)throw new Error("useToast must be used within a ToastProvider");return e},lm=({children:e})=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx(Ea,{children:e})}),Ea=({children:e})=>{let[t,r]=Wn.useState([]),n=Wn.useCallback(a=>{r(l=>l.filter(s=>s.id!==a));},[]),o=Wn.useCallback(a=>{let l=crypto.randomUUID(),s={...a,id:l};r(m=>[...m,s]),a.duration!==0&&setTimeout(()=>{n(l);},a.duration??5e3);},[n]),i=Wn.useMemo(()=>({toasts:t,addToast:o,removeToast:n}),[t,o,n]);return jsxRuntime.jsxs(vn.Provider,{value:i,children:[e,jsxRuntime.jsx(Fa,{toasts:t,onRemove:n})]})},Fa=({toasts:e,onRemove:t})=>jsxRuntime.jsx("div",{className:"fixed top-4 right-4 z-50 flex flex-col gap-2",children:e.map(r=>jsxRuntime.jsx(xn,{toast:r,onRemove:t},r.id))}),xn=({toast:e,onRemove:t})=>jsxRuntime.jsx("div",{className:`min-w-80 max-w-md p-4 border rounded-md shadow-lg animate-in slide-in-from-right-full ${{default:"bg-white border-gray-200 text-gray-900 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-100",success:"bg-green-50 border-green-200 text-green-800 dark:bg-green-900/20 dark:border-green-800 dark:text-green-200",warning:"bg-yellow-50 border-yellow-200 text-yellow-800 dark:bg-yellow-900/20 dark:border-yellow-800 dark:text-yellow-200",destructive:"bg-red-50 border-red-200 text-red-800 dark:bg-red-900/20 dark:border-red-800 dark:text-red-200"}[e.variant??"default"]}`,children:jsxRuntime.jsxs("div",{className:"flex items-start justify-between",children:[jsxRuntime.jsxs("div",{className:"flex-1",children:[e.title&&jsxRuntime.jsx("h4",{className:"font-medium mb-1",children:e.title}),jsxRuntime.jsx("p",{className:"text-sm",children:e.description})]}),jsxRuntime.jsx("button",{onClick:()=>t(e.id),className:"ml-2 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:jsxRuntime.jsx("svg",{className:"w-4 h-4",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"})})})]})});xn.displayName="ToastItem";var yn=({children:e,content:t,position:r="top",className:n,overrideClassName:o=!1})=>{let i={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"},a={top:"top-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-b-transparent border-t-gray-900",bottom:"bottom-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-t-transparent border-b-gray-900",left:"left-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-r-transparent border-l-gray-900",right:"right-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-l-transparent border-r-gray-900"};return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:"relative inline-block group",children:[jsxRuntime.jsx("div",{children:e}),jsxRuntime.jsxs("div",{className:o?n:g("absolute z-50 px-2 py-1 text-xs text-white bg-gray-900 rounded shadow-lg whitespace-nowrap","opacity-0 scale-95 pointer-events-none transition-all duration-150","group-hover:opacity-100 group-hover:scale-100 group-hover:pointer-events-auto","group-focus-within:opacity-100 group-focus-within:scale-100 group-focus-within:pointer-events-auto",i[r],n),children:[t,jsxRuntime.jsx("div",{className:g("absolute w-0 h-0 border-4",a[r])})]})]})})};yn.displayName="Tooltip";var pm=yn;var Sa=({files:e,removeFile:t})=>jsxRuntime.jsx("div",{className:"space-y-2",children:e?.length>0&&e?.map((r,n)=>jsxRuntime.jsxs("div",{className:"flex items-center justify-between p-2 bg-secondary rounded",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm truncate",children:r.name}),jsxRuntime.jsxs("p",{className:"text-xs text-muted-foreground",children:[(r?.size/1024).toFixed(1)," KB"]})]}),jsxRuntime.jsx("button",{type:"button",onClick:o=>{o.stopPropagation(),t(n);},className:"ml-2 p-1 hover:bg-destructive/20 rounded",children:"\u2715"})]},`${r?.name}-${n}`))}),wn=Sa;var Va=({accept:e,maxSize:t})=>jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("svg",{className:"w-8 h-8 mx-auto text-muted-foreground",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm text-foreground",children:"Clique para selecionar ou arraste arquivos aqui"}),jsxRuntime.jsxs("p",{className:"text-xs text-muted-foreground",children:[e&&`Tipos aceitos: ${e}`,t&&` \u2022 Tamanho m\xE1ximo: ${t}MB`]})]})]}),Cn=Va;var kn=({files:e,setFiles:t,multiple:r=!1,disabled:n=!1,filterFiles:o=i=>i})=>{let i=Wn.useRef(null),[a,l]=Wn.useState(!1),s=Wn.useCallback(d=>{d.preventDefault(),!n&&l(!0);},[n]),m=Wn.useCallback(()=>{l(!1);},[]),u=Wn.useCallback(d=>{if(d.preventDefault(),n||!i.current)return;l(!1);let p=Array.from(d.dataTransfer.files);if(!r&&!e||!r&&p.length>1)return;let w=o(p),y=r?w:w.slice(0,1);t(y);let b=new DataTransfer;y.forEach(v=>b.items.add(v)),i.current.files=b.files,i.current.dispatchEvent(new Event("change",{bubbles:!0}));},[n,r,e,o]),c=Wn.useCallback(()=>{t([]),i.current&&(i.current.value="");},[]);return {files:e,setFiles:t,clearFiles:c,inputRef:i,isDragOver:a,setIsDragOver:l,handleDrop:u,handleDragOver:s,handleDragLeave:m}};var Nn=({files:e,setFiles:t,inputRef:r})=>({removeFile:Wn.useCallback(o=>{if(!r.current)return;let i=e?.filter((l,s)=>s!==o);t(i);let a=new DataTransfer;i?.forEach(l=>a.items.add(l)),r.current.files=a.files,r.current.dispatchEvent(new Event("change",{bubbles:!0}));},[e,t,r])});var Ba=({previews:e,onRemove:t})=>{let[r,n]=Wn.useState(0),o=()=>n(a=>a===0?e?.length-1:a-1),i=()=>n(a=>a===e?.length-1?0:a+1);return jsxRuntime.jsxs("div",{className:"relative w-full h-56 rounded-lg overflow-hidden bg-black/5",children:[jsxRuntime.jsx("img",{src:e[r]?.url,alt:e[r]?.file?.name,className:"w-full h-full object-cover"}),e.length>1&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",onClick:o,className:"absolute left-2 top-1/2 -translate-y-1/2 bg-black/50 text-white px-2 py-1 rounded",children:"\u2039"}),jsxRuntime.jsx("button",{type:"button",onClick:i,className:"absolute right-2 top-1/2 -translate-y-1/2 bg-black/50 text-white px-2 py-1 rounded",children:"\u203A"})]}),jsxRuntime.jsx("button",{type:"button",onClick:()=>t(r),className:"absolute top-2 right-2 bg-red-500 text-white rounded px-2 py-1",children:"\u2715"})]})},Tn=Ba;var Rn=Wn.forwardRef(({label:e,required:t,accept:r,renderFiles:n,preview:o=!1,multiple:i=!1,maxSize:a=10,disabled:l=!1,error:s=!1,helperText:m,className:u,name:c,onChange:d,onBlur:p,...w},y)=>{let b=Wn.useId(),[v,E]=Wn.useState([]),D=1024*1024,V=A=>A.filter(j=>(!a||j.size<=a*D)&&(!r||j.type.match(r))),{inputRef:P,isDragOver:$,handleDrop:I,handleDragOver:S,handleDragLeave:k}=kn({files:v,setFiles:E,multiple:i,filterFiles:V}),{removeFile:N}=Nn({files:v,setFiles:E,inputRef:P}),x=A=>{P.current=A,typeof y=="function"?y(A):y&&(y.current=A);},h=A=>{let j=Array.from(A.target.files??[]);if(!j.length)return;let re=V(j);E(i?re:re.slice(0,1)),d?.(A);},M=Wn.useMemo(()=>!o||!v||!v.length?[]:v.filter(A=>A.type.startsWith("image/")).map(A=>({file:A,url:URL.createObjectURL(A)})),[v,o]);Wn.useEffect(()=>()=>M.forEach(A=>URL.revokeObjectURL(A.url)),[M]);let H=o&&M.length>0;return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:`space-y-2 ${u}`,children:[e&&jsxRuntime.jsx(F,{htmlFor:b,required:t,children:e}),jsxRuntime.jsxs("div",{onDrop:I,onDragOver:S,onDragLeave:k,onClick:()=>{!l&&!H&&P.current?.click();},className:`
47
52
  border-2 border-dashed rounded-lg p-6 text-center cursor-pointer
48
53
  transition-colors
49
- ${A?"border-primary bg-primary/5":"border-border"}
54
+ ${$?"border-primary bg-primary/5":"border-border"}
50
55
  ${s?"border-red-500":""}
51
56
  ${l?"opacity-50 cursor-not-allowed":"hover:border-primary"}
52
- `,children:[jsxRuntime.jsx("input",{ref:f,id:b,name:c,type:"file",accept:r,multiple:i,disabled:l,onChange:g,onBlur:m,className:"hidden",...L}),o&&N.length>0?jsxRuntime.jsx(Sr,{previews:N,onRemove:T}):jsxRuntime.jsx(Mr,{accept:r,maxSize:a})]}),n?n({files:h,removeFile:T}):h&&h.length>0&&jsxRuntime.jsx(Dr,{files:h,removeFile:T}),s&&jsxRuntime.jsx(O,{children:s}),!s&&p&&jsxRuntime.jsx($,{children:p})]})})});Hr.displayName="UploadFile";var rd=Hr;
57
+ `,children:[jsxRuntime.jsx("input",{ref:x,id:b,name:c,type:"file",accept:r,multiple:i,disabled:l,onChange:h,onBlur:p,className:"hidden",...w}),o&&M.length>0?jsxRuntime.jsx(Tn,{previews:M,onRemove:N}):jsxRuntime.jsx(Cn,{accept:r,maxSize:a})]}),n?n({files:v,removeFile:N}):v&&v.length>0&&jsxRuntime.jsx(wn,{files:v,removeFile:N}),s&&jsxRuntime.jsx(G,{children:s}),!s&&m&&jsxRuntime.jsx(O,{children:m})]})})});Rn.displayName="UploadFile";var Bm=Rn;
53
58
 
54
- exports.AccordionPrimitive = ea;
55
- exports.BadgePrimitive = da;
56
- exports.ButtonPrimitive = ba;
57
- exports.CardContentPrimitive = Na;
58
- exports.CardDescriptionPrimitive = La;
59
- exports.CardFooterPrimitive = Ra;
60
- exports.CardHeaderPrimitive = Pa;
61
- exports.CardPrimitive = ka;
62
- exports.CardTitlePrimitive = Ta;
63
- exports.CheckBoxGroupPrimitive = hi;
64
- exports.CheckBoxPrimitive = si;
65
- exports.ColorPicker = At;
66
- exports.ColorPickerPrimitive = Li;
67
- exports.ComboBoxPrimitive = ts;
68
- exports.DatePickerPrimitive = el;
69
- exports.DropdownMenuContentPrimitive = Aa;
70
- exports.DropdownMenuItemPrimitive = $a;
71
- exports.DropdownMenuLabelPrimitive = Ba;
72
- exports.DropdownMenuPrimitive = Va;
73
- exports.DropdownMenuSeparatorPrimitive = Oa;
74
- exports.DropdownMenuTriggerPrimitive = Ha;
75
- exports.HelperFieldPrimitive = $;
76
- exports.InputPrimitive = Nl;
77
- exports.LabelPrimitive = D;
78
- exports.LicenseProvider = Gr;
79
- exports.OtpInputPrimitive = Hl;
80
- exports.RadioGroupPrimitive = rc;
81
- exports.RadioPrimitive = Wl;
82
- exports.SelectPrimitive = pc;
83
- exports.SwitchPrimitive = Cc;
84
- exports.TextAreaPrimitive = Mc;
85
- exports.UploadFilePrimitive = rd;
86
- exports.ValidateFieldPrimitive = O;
59
+ exports.AccordionPrimitive = mi;
60
+ exports.AlertDescriptionPrimitive = Ni;
61
+ exports.AlertPrimitive = Ci;
62
+ exports.AlertTitlePrimitive = ki;
63
+ exports.Avatar = Ms;
64
+ exports.BadgePrimitive = Ei;
65
+ exports.BreadcrumbPrimitive = Hi;
66
+ exports.ButtonPrimitive = zi;
67
+ exports.ButtonSpinnerPrimitive = jc;
68
+ exports.CardContentPrimitive = Qi;
69
+ exports.CardDescriptionPrimitive = Zi;
70
+ exports.CardFooterPrimitive = es;
71
+ exports.CardHeaderPrimitive = Ji;
72
+ exports.CardPrimitive = Xi;
73
+ exports.CardTitlePrimitive = ji;
74
+ exports.CheckBoxGroupPrimitive = ll;
75
+ exports.CheckBoxPrimitive = js;
76
+ exports.ColorPicker = mr;
77
+ exports.ColorPickerPrimitive = bl;
78
+ exports.ComboBoxPrimitive = ql;
79
+ exports.ContentLoaderPrimitive = Zc;
80
+ exports.DatePickerPrimitive = Wc;
81
+ exports.DialogContentPrimitive = ds;
82
+ exports.DialogFooterPrimitive = us;
83
+ exports.DialogHeaderPrimitive = ls;
84
+ exports.DialogPrimitive = ss;
85
+ exports.DialogTitlePrimitive = cs;
86
+ exports.DropdownMenuContentPrimitive = ys;
87
+ exports.DropdownMenuItemPrimitive = ws;
88
+ exports.DropdownMenuLabelPrimitive = ks;
89
+ exports.DropdownMenuPrimitive = xs;
90
+ exports.DropdownMenuSeparatorPrimitive = Cs;
91
+ exports.DropdownMenuTriggerPrimitive = hs;
92
+ exports.FieldFeedbackPrimitive = We;
93
+ exports.HelperFieldPrimitive = O;
94
+ exports.InputPrimitive = Md;
95
+ exports.LabelPrimitive = F;
96
+ exports.LicenseProvider = Sn;
97
+ exports.LoadingOverlayPrimitive = Jc;
98
+ exports.LoadingSpinnerPrimitive = Xc;
99
+ exports.OtpInputPrimitive = Bd;
100
+ exports.RadioGroupPrimitive = au;
101
+ exports.RadioPrimitive = _d;
102
+ exports.RangePrimitive = bu;
103
+ exports.RangeSliderPrimitive = Lu;
104
+ exports.SelectPrimitive = Au;
105
+ exports.SkeletonPrimitive = Qc;
106
+ exports.SpinnerPrimitive = Sr;
107
+ exports.SwitchPrimitive = Yu;
108
+ exports.TextAreaPrimitive = tm;
109
+ exports.ToastProvider = lm;
110
+ exports.TooltipPrimitive = pm;
111
+ exports.UploadFilePrimitive = Bm;
112
+ exports.ValidateFieldPrimitive = G;
113
+ exports.useToast = sm;