@mvr-ui/components 1.0.78 → 1.0.79
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/README.md +211 -211
- package/dist/mvr-ui.css +1 -1
- package/dist/page.d.mts +42 -2
- package/dist/page.d.ts +42 -2
- package/dist/page.js +36 -26
- package/dist/page.mjs +7 -4
- package/package.json +69 -69
package/dist/page.d.ts
CHANGED
|
@@ -7,6 +7,22 @@ declare const LicenseProvider: React__default.FC<{
|
|
|
7
7
|
licenseKey: string;
|
|
8
8
|
}>;
|
|
9
9
|
|
|
10
|
+
interface AccordionItemData {
|
|
11
|
+
id: string;
|
|
12
|
+
title: string;
|
|
13
|
+
content: React__default.ReactNode;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
}
|
|
16
|
+
interface AccordionProps {
|
|
17
|
+
items: AccordionItemData[];
|
|
18
|
+
type?: "single" | "multiple";
|
|
19
|
+
defaultValue?: string | string[];
|
|
20
|
+
value?: string | string[];
|
|
21
|
+
onValueChange?: (value: string | string[]) => void;
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
declare const AccordionPrimitive: (props: AccordionProps) => react_jsx_runtime.JSX.Element;
|
|
25
|
+
|
|
10
26
|
interface ButtonProps extends React__default.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
11
27
|
variant?: "primary" | "secondary" | "tertiary" | "outline" | "ghost" | "destructive" | "success" | "warning" | "info" | "link" | "gradient" | "glass" | "soft" | "dark" | "light" | "accent" | "obsidian" | "polar";
|
|
12
28
|
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
@@ -49,6 +65,31 @@ declare const CardDescriptionPrimitive: (props: CardDescriptionProps & React__de
|
|
|
49
65
|
declare const CardContentPrimitive: (props: CardContentProps & React__default.RefAttributes<HTMLDivElement>) => react_jsx_runtime.JSX.Element;
|
|
50
66
|
declare const CardFooterPrimitive: (props: CardFooterProps & React__default.RefAttributes<HTMLDivElement>) => react_jsx_runtime.JSX.Element;
|
|
51
67
|
|
|
68
|
+
interface DropdownMenuProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
69
|
+
children: React__default.ReactNode;
|
|
70
|
+
}
|
|
71
|
+
interface DropdownMenuTriggerProps {
|
|
72
|
+
children: React__default.ReactNode;
|
|
73
|
+
asChild?: boolean;
|
|
74
|
+
}
|
|
75
|
+
interface DropdownMenuContentProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
76
|
+
children: React__default.ReactNode;
|
|
77
|
+
align?: "start" | "center" | "end";
|
|
78
|
+
}
|
|
79
|
+
interface DropdownMenuItemProps extends React__default.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
80
|
+
destructive?: boolean;
|
|
81
|
+
}
|
|
82
|
+
interface DropdownMenuSeparatorProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
83
|
+
}
|
|
84
|
+
interface DropdownMenuLabelProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
85
|
+
}
|
|
86
|
+
declare const DropdownMenuPrimitive: (props: DropdownMenuProps & React__default.RefAttributes<HTMLDivElement>) => react_jsx_runtime.JSX.Element;
|
|
87
|
+
declare const DropdownMenuTriggerPrimitive: (props: DropdownMenuTriggerProps) => react_jsx_runtime.JSX.Element;
|
|
88
|
+
declare const DropdownMenuContentPrimitive: (props: DropdownMenuContentProps & React__default.RefAttributes<HTMLDivElement>) => react_jsx_runtime.JSX.Element;
|
|
89
|
+
declare const DropdownMenuItemPrimitive: (props: DropdownMenuItemProps & React__default.RefAttributes<HTMLButtonElement>) => react_jsx_runtime.JSX.Element;
|
|
90
|
+
declare const DropdownMenuSeparatorPrimitive: (props: DropdownMenuSeparatorProps & React__default.RefAttributes<HTMLDivElement>) => react_jsx_runtime.JSX.Element;
|
|
91
|
+
declare const DropdownMenuLabelPrimitive: (props: DropdownMenuLabelProps & React__default.RefAttributes<HTMLDivElement>) => react_jsx_runtime.JSX.Element;
|
|
92
|
+
|
|
52
93
|
interface CheckBoxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
53
94
|
label?: string;
|
|
54
95
|
required?: boolean;
|
|
@@ -261,7 +302,6 @@ declare const SelectPrimitive: typeof Select;
|
|
|
261
302
|
interface SwitchProps extends Omit<React__default.InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
262
303
|
label?: string;
|
|
263
304
|
description?: string;
|
|
264
|
-
checked?: boolean;
|
|
265
305
|
className?: string;
|
|
266
306
|
overrideClassName?: boolean;
|
|
267
307
|
error?: string;
|
|
@@ -287,4 +327,4 @@ interface ValidateFieldProps {
|
|
|
287
327
|
}
|
|
288
328
|
declare const ValidateFieldPrimitive: (props: ValidateFieldProps) => react_jsx_runtime.JSX.Element;
|
|
289
329
|
|
|
290
|
-
export { ButtonPrimitive, ButtonProps, CardContentPrimitive, CardContentProps, CardDescriptionPrimitive, CardDescriptionProps, CardFooterPrimitive, CardFooterProps, CardHeaderPrimitive, CardHeaderProps, CardPrimitive, CardProps, CardTitlePrimitive, CardTitleProps, CheckBoxGroupPrimitive, CheckBoxPrimitive, CheckBoxProps, ComboBoxPrimitive, HelperFieldPrimitive, HelperFieldProps, InputPrimitive, InputProps, LabelPrimitive, LabelProps, LicenseProvider, OtpInputPrimitive, OtpInputProps, RadioGroupPrimitive, RadioPrimitive, RadioProps, SelectPrimitive, SelectProps, SwitchPrimitive, SwitchProps, TextareaPrimitive, TextareaProps, ValidateFieldPrimitive, ValidateFieldProps };
|
|
330
|
+
export { AccordionItemData, AccordionPrimitive, AccordionProps, ButtonPrimitive, ButtonProps, CardContentPrimitive, CardContentProps, CardDescriptionPrimitive, CardDescriptionProps, CardFooterPrimitive, CardFooterProps, CardHeaderPrimitive, CardHeaderProps, CardPrimitive, CardProps, CardTitlePrimitive, CardTitleProps, CheckBoxGroupPrimitive, CheckBoxPrimitive, CheckBoxProps, ComboBoxPrimitive, DropdownMenuContentPrimitive, DropdownMenuContentProps, DropdownMenuItemPrimitive, DropdownMenuItemProps, DropdownMenuLabelPrimitive, DropdownMenuLabelProps, DropdownMenuPrimitive, DropdownMenuProps, DropdownMenuSeparatorPrimitive, DropdownMenuSeparatorProps, DropdownMenuTriggerPrimitive, DropdownMenuTriggerProps, HelperFieldPrimitive, HelperFieldProps, InputPrimitive, InputProps, LabelPrimitive, LabelProps, LicenseProvider, OtpInputPrimitive, OtpInputProps, RadioGroupPrimitive, RadioPrimitive, RadioProps, SelectPrimitive, SelectProps, SwitchPrimitive, SwitchProps, TextareaPrimitive, TextareaProps, ValidateFieldPrimitive, ValidateFieldProps };
|
package/dist/page.js
CHANGED
|
@@ -1,35 +1,45 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var Ut = require('react');
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
-
var
|
|
5
|
+
var Tr = 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
|
|
11
|
-
var
|
|
10
|
+
var Ut__default = /*#__PURE__*/_interopDefault(Ut);
|
|
11
|
+
var Tr__default = /*#__PURE__*/_interopDefault(Tr);
|
|
12
12
|
|
|
13
|
-
var be=Rt.createContext(void 0),Ct=({message:e})=>jsxRuntime.jsx("div",{className:"flex justify-center items-center h-screen min-w-full bg-red-50 dark:bg-red-900/10 text-red-800 dark:text-red-200 text-xl text-center p-8 transition-colors duration-300",children:jsxRuntime.jsxs("div",{className:"max-w-md animate-[fadeIn_0.5s_ease-in-out]",children:[jsxRuntime.jsxs("h1",{className:"text-3xl font-bold mb-4 flex items-center justify-center gap-2",children:[jsxRuntime.jsx("span",{className:"animate-[bounce_1s_infinite]",children:"\u26A0\uFE0F"}),"Erro de Licen\xE7a"]}),jsxRuntime.jsx("p",{className:"mb-4 text-red-600 dark:text-red-300",children:e}),jsxRuntime.jsx("p",{className:"text-lg text-red-600 dark:text-red-400",children:"Por favor, entre em contato com o suporte."}),jsxRuntime.jsx("button",{onClick:()=>window.location.reload(),className:"mt-6 px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700 transition-colors",children:"Tentar novamente"})]})}),yt=({children:e,licenseKey:t})=>{let[r,n]=Rt.useState(!1),[o,s]=Rt.useState(null),[a,i]=Rt.useState(!0),l=p=>{if(s(null),!p)throw new Error("\u{1F512} Chave de licen\xE7a \xE9 obrigat\xF3ria");let f="chave-secreta-123";if(p!==f)throw new Error("\u274C Chave de licen\xE7a inv\xE1lida");n(!0);};return Rt.useEffect(()=>{if(t){i(!0);try{l(t);}catch(p){s(p instanceof Error?p.message:"Erro desconhecido na valida\xE7\xE3o da licen\xE7a");}finally{i(!1);}}else s("\u{1F512} Licen\xE7a n\xE3o informada"),i(!1);},[t]),a?null:jsxRuntime.jsx(be.Provider,{value:{isLicenseValid:r,validateLicense:l,licenseError:o},children:r?e:jsxRuntime.jsx(Ct,{message:o||"Licen\xE7a inv\xE1lida"})})},ve=()=>{let e=Rt.useContext(be);if(!e)throw new Error("useLicense deve ser usado dentro de um LicenseProvider");return e};var he=({message:e="Component locked - Please validate your license"})=>jsxRuntime.jsxs("div",{className:"flex items-start p-4 bg-red-50 border border-red-500 text-red-700 rounded-md gap-2",children:[jsxRuntime.jsx("span",{children:" \u274C Component locked - Please validate your license"}),jsxRuntime.jsx("span",{children:e})]});var v=e=>t=>{let{isLicenseValid:r}=ve();return r?jsxRuntime.jsx(e,{...t}):jsxRuntime.jsx(he,{})};function u(...e){return tailwindMerge.twMerge(Qt.clsx(e))}var Te=Rt__default.default.forwardRef(({className:e,overrideClassName:t,variant:r="primary",size:n="md",href:o,children:s,loading:a=!1,loadingContent:i,...l},p)=>{let f="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",h={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"},P={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:u(f,h[r],P[n],e);return o?jsxRuntime.jsx("a",{href:o,className:m,ref:p,children:a&&i?i:s}):jsxRuntime.jsx("button",{className:m,ref:p,...l,children:a&&i?i:s})});Te.displayName="Button";var Wr=v(Te);var Pe=Rt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx("div",{ref:o,className:t?e:u("rounded-lg border bg-card text-card-foreground shadow-sm",e),...n,children:r}));Pe.displayName="Card";var we=Rt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx("div",{ref:o,className:t?e:u("flex flex-col space-y-1.5 p-6",e),...n,children:r}));we.displayName="CardHeader";var Re=Rt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx("h3",{ref:o,className:t?e:u("text-2xl font-semibold leading-none tracking-tight",e),...n,children:r}));Re.displayName="CardTitle";var Le=Rt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx("p",{ref:o,className:t?e:u("text-sm text-muted-foreground",e),...n,children:r}));Le.displayName="CardDescription";var ke=Rt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx("div",{ref:o,className:t?e:u("p-6 pt-0",e),...n,children:r}));ke.displayName="CardContent";var Ee=Rt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx("div",{ref:o,className:t?e:u("flex items-center p-6 pt-0",e),...n,children:r}));Ee.displayName="CardFooter";var Qr=v(Pe),en=v(we),tn=v(Re),rn=v(Le),nn=v(ke),on=v(Ee);var Lt=({children:e,className:t,overrideClassName:r})=>{if(e)return jsxRuntime.jsx("p",{className:r?t:u("text-sm text-muted-foreground",t),children:e})},V=v(Lt);var Et=({children:e,required:t,className:r,overrideClassName:n=!1,...o})=>jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("label",{...o,className:n?r:u("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),children:e}),t&&jsxRuntime.jsx("span",{className:"text-red-600",children:"*"})]}),R=v(Et);var It=({children:e,className:t,overrideClassName:r})=>{if(e)return jsxRuntime.jsx("p",{className:r?t:u("text-sm text-red-600 dark:text-red-400",t),children:e})},M=v(It);var Ve=Rt.forwardRef(({label:e,required:t,option:r,orientation:n="left",className:o,overrideClassName:s=!1,helperText:a,error:i,...l},p)=>{let f=Rt.useId(),h=u("h-4 w-4 rounded border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",i&&"border-destructive",o);return jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(R,{required:t,children:e}),jsxRuntime.jsxs("div",{className:`flex ${n=="left"?"flex-row":"flex-row-reverse"} w-fit gap-2`,children:[jsxRuntime.jsx("input",{id:f,type:"checkbox",className:s?o:h,ref:p,...l}),r&&jsxRuntime.jsx(R,{htmlFor:f,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r})]}),i&&jsxRuntime.jsx(M,{children:i}),!i&&a&&jsxRuntime.jsx(V,{children:a})]})});Ve.displayName="CheckBox";var Ln=v(Ve);function At(e,t){let{typeSet:r="field",multiCheck:n=!1,value:o,onChange:s,labelKey:a,valueKey:i,options:l,alignment:p="vertical",className:f,overrideClassName:h=!1,helperText:P,error:m,label:w,name:L,required:b,...C}=e,E=Rt.useId(),y=Rt.useMemo(()=>new Map(l.map(g=>[String(g[i]),g])),[l,i]),I=Rt.useMemo(()=>o==null?[]:r==="field"?n?o.map(g=>String(g)):[String(o)]:n?o.map(g=>String(g[i])):[String(o[i])],[o,r,n,i]),S=(g,T)=>{if(!s)return;let c;if(r==="field")if(n)c=g.map(x=>{let k=y.get(x);return k?k[i]:x});else {let d=g[0];if(!d)c=void 0;else {let x=y.get(d);c=x?x[i]:d;}}else n?c=g.map(x=>y.get(x)).filter(x=>x!==void 0):c=y.get(g[0]??"")??void 0;s({target:{name:L,value:c,type:"checkboxgroup",checked:T}});},F=g=>{let T;n?T=I.includes(g)?I.filter(c=>c!==g):[...I,g]:T=I[0]===g?[]:[g],S(T,T.includes(g));},N=p==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",H=u("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.jsxs("div",{className:u("flex flex-col gap-3",f),children:[w&&jsxRuntime.jsx(R,{required:b,children:w}),jsxRuntime.jsx("div",{className:N,children:l.map((g,T)=>{let c=String(g[i]),d=I.includes(c),x=`${E}-${c}-${T}`;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{...C,id:x,ref:t,type:"checkbox",name:L,checked:d,onChange:()=>F(c),className:h?f:H}),jsxRuntime.jsx(R,{htmlFor:x,children:String(g[a])})]},x)})}),!!m&&jsxRuntime.jsx(M,{children:String(m)}),!m&&P&&jsxRuntime.jsx(V,{children:P})]})}function $t(){let e=Rt.forwardRef(At);return e.displayName="CheckBoxGroup",e}var Dt=$t(),$n=v(Dt);var Bt=({...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"})}),ee=Bt;var Ot=(e,t)=>{Rt.useEffect(()=>{let r=n=>{e.current&&!e.current.contains(n.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},Se=Ot;function ae({options:e,labelKey:t,valueKey:r,multiple:n,onChange:o,setSearchTerm:s,typeSet:a,name:i}){let[l,p]=Rt.useState([]),f=Rt.useMemo(()=>new Map(e.map(b=>[String(b[r]),b])),[e,r]),h=Rt.useCallback(()=>l.map(b=>f.get(b)).filter(b=>!!b),[l,f]),P=Rt.useCallback(b=>{if(!o)return;let C;if(a==="field"?n?C=b:C=b[0]??void 0:n?C=b.map(y=>f.get(y)).filter(y=>y!==void 0):C=f.get(b[0]??"")??void 0,s&&!n){let E=f.get(b[0]??"");E&&s(String(E[t]));}o({target:{name:i,value:C,type:"combobox"}});},[n,o,f,i,a,s,t]),m=Rt.useCallback(b=>{let C=String(b[r]),E=n?l.includes(C)?l.filter(y=>y!==C):[...l,C]:[C];p(E),P(E);},[n,l,P,r]),w=Rt.useCallback(b=>{let C=l.filter(E=>E!==b);p(C),P(C);},[l,P]),L=Rt.useCallback(()=>{p([]),s?.("");let b;a==="field"?b=n?[]:"":b=n?[]:void 0,o?.({target:{name:i,value:b,type:"combobox"}});},[n,o,i,s,a]);return {selectedValues:l,handleSelect:m,handleRemove:w,handleClear:L,getSelectedOptions:h}}function ie(e,t,r){return Rt.useMemo(()=>r?e.filter(o=>String(o[t]).toLowerCase().includes(r.toLowerCase())):e,[e,r,t])}var $e=({isOpen:e,setIsOpen:t,multiple:r,searchTerm:n,setSearchTerm:o,selectedValues:s,filteredOptions:a,highlightedIndex:i,setHighlightedIndex:l,handleSelect:p,handleRemove:f})=>{let h=Rt.useCallback(m=>{if(a.length===0){l(-1);return}l(w=>w<0?m>0?0:a.length-1:(w+m+a.length)%a.length);},[a,l]);return Rt.useCallback(m=>{if(!e){if(m.key==="Enter"||m.key==="ArrowDown"){t(!0),l(0),m.preventDefault();return}r&&m.key==="Backspace"&&n===""&&s.length>0&&(m.preventDefault(),f(s[s.length-1]));return}switch(m.key){case"ArrowDown":m.preventDefault(),h(1);break;case"ArrowUp":m.preventDefault(),h(-1);break;case"Enter":m.preventDefault();let w=i>=0?i:0,L=a[w];L&&p(L),r&&o&&o(""),r||(t(!1),l(-1));break;case"Escape":m.preventDefault(),t(!1),l(-1),r||o("");break;case"Tab":t(!1),l(-1);break;case"Home":m.preventDefault(),a.length>0&&l(0);break;case"End":m.preventDefault(),a.length>0&&l(a.length-1);break;case"Backspace":r&&n===""&&s.length>0&&(m.preventDefault(),f(s[s.length-1]));break}},[e,r,n,s,a,i,t,o,l,p,f,h])};function De({option:e,labelKey:t,valueKey:r,onRemove:n}){let o=String(e[t]),s=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(s),className:"hover:bg-blue-200 dark:hover:bg-blue-800 rounded-full p-0.5 transition-colors","aria-label":`Remover ${o}`,children:"\u2715"})]},s)}function Zt(e,t){let{label:r,required:n=!1,name:o,placeholder:s="Buscar...",labelKey:a,valueKey:i,options:l,value:p,onChange:f,mode:h="single",typeSet:P="field",disabled:m=!1,ClearEnabled:w=!0,helperText:L,error:b=!1,className:C="",...E}=e,y=h==="multiple",[I,S]=Rt.useState(!1),[F,N]=Rt.useState(""),H=Rt.useRef(null),g=Rt.useRef(null),T=Rt.useRef(null);Rt.useImperativeHandle(t,()=>T.current),Se(g,()=>S(!1));let c=ie(l,a,F),[d,x]=Rt.useState(-1),{selectedValues:k,handleSelect:W,handleRemove:ue,handleClear:pt,getSelectedOptions:fe}=ae({options:l,labelKey:a,valueKey:i,value:p,multiple:y,onChange:f,typeSet:P,name:o,setSearchTerm:N}),ut=$e({isOpen:I,setIsOpen:S,multiple:y,searchTerm:F,setSearchTerm:N,selectedValues:k,filteredOptions:c,highlightedIndex:d,setHighlightedIndex:x,handleSelect:W,handleRemove:ue}),J=Rt.useId(),ft="w-full bg-transparent outline-none placeholder:text-gray-500 dark:placeholder:text-gray-400 text-gray-900 dark:text-gray-100",gt=u("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.jsxs("div",{className:`space-y-2 ${C}`,children:[r&&jsxRuntime.jsx(R,{htmlFor:J,required:n,children:r}),jsxRuntime.jsxs("div",{ref:H,className:"relative",children:[jsxRuntime.jsxs("div",{className:gt,children:[y&&fe().length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:fe().map((A,D)=>jsxRuntime.jsx(De,{option:A,labelKey:a,valueKey:i,onRemove:ue},String(A[i]??D)))}),jsxRuntime.jsx("input",{ref:T,...E,name:o,type:"text",placeholder:s,value:F,onChange:A=>{let D=A.target.value;N(D),!I&&D.trim()!==""&&S(!0);},onKeyDown:ut,onMouseDown:A=>{document.activeElement===T.current&&(A.preventDefault(),S(D=>{let X=!D;return X&&x(0),X}));},onFocus:()=>{S(!0),x(0);},disabled:m,className:ft,role:"combobox","aria-expanded":I,"aria-controls":J,"aria-activedescendant":d>=0?`${J}-opt-${d}`:void 0}),w&&!!k.length&&jsxRuntime.jsx("button",{type:"button",onMouseDown:A=>A.preventDefault(),onClick:pt,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(ee,{width:12,height:12})})]}),I&&jsxRuntime.jsx("div",{ref:g,id:J,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":y||void 0,children:c.length===0?jsxRuntime.jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400",children:"Nenhum resultado encontrado"}):c.map((A,D)=>{let X=String(A[i]),re=k.includes(X),ne=D===d;return jsxRuntime.jsx("button",{id:`${J}-opt-${D}`,"data-index":D,role:"option","aria-selected":re,type:"button",onMouseDown:bt=>bt.preventDefault(),onClick:()=>W(A),className:u("w-full px-3 py-2 text-left text-sm transition-colors",ne&&"bg-blue-100 dark:bg-blue-800 text-blue-900 dark:text-white",!ne&&re&&"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300",!re&&!ne&&"text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),children:jsxRuntime.jsx("span",{children:String(A[a])})},X)})})]}),b&&jsxRuntime.jsx(M,{children:b}),!b&&L&&jsxRuntime.jsx(V,{children:L})]})}function jt(){let e=Rt.forwardRef(Zt);return e.displayName="ComboBox",e}var Yt=jt(),uo=v(Yt);var er=({children:e,before:t,after:r,className:n})=>{let s=Qt__default.default("flex justify-center items-center",{"rounded-l-lg":t,"rounded-r-lg":r},n);return jsxRuntime.jsx("div",{className:s,children:jsxRuntime.jsx("span",{children:e})})},de=er;var tr=({children:e})=>jsxRuntime.jsx("div",{className:"absolute px-2",children:jsxRuntime.jsx("span",{children:e})}),Oe=tr;var rr=({children:e})=>jsxRuntime.jsx("div",{className:"absolute right-0 px-2",children:jsxRuntime.jsx("span",{children:e})}),Ue=rr;function qe(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 _e(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 We(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 Je(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 Xe(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 ze(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 Ze(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 je(e){e.currentTarget.maxLength=18;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2"),e.currentTarget.value=t,e}var nr=({e,mask:t})=>{switch(t){case"money":return _e(e);case"mobile":return Je(e);case"phone":return Xe(e);case"cpfCnpj":return ze(e);case"cpf":return We(e);case"rg":return Ze(e);case"cnpj":return je(e);case"cep":return qe(e);default:return e}},Ye=nr;var ir=({mask:e,initialValue:t=""})=>{let[r,n]=Rt.useState(t);Rt.useEffect(()=>{t!==r&&n(t);},[t]);let o=Rt.useCallback(a=>{let l=Ye({e:a,mask:e})?.currentTarget?.value??a.currentTarget.value;n(l);},[e]),s=Rt.useCallback(()=>n(""),[]);return {value:r,setValue:n,handleChange:o,handleClear:s}},et=ir;var tt=Rt.forwardRef(({label:e,required:t=!1,mask:r,name:n,prefix:o,suffix:s,addonBefore:a,addonBeforeClassName:i,addonAfter:l,addonAfterClassName:p,ClearEnabled:f=!0,className:h,overrideClassName:P=!1,error:m,helperText:w,value:L=void 0,onChange:b,...C},E)=>{let y=Rt.useId(),{handleChange:I,handleClear:S,setValue:F}=et({mask:r,initialValue:L}),N=u("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",m&&"border-destructive focus-visible:ring-destructive",!o&&!s&&"px-3",o&&!s&&"pl-10 pr-3",s&&!o&&"pl-3 pr-10",o&&s&&"pl-10 pr-10",a&&"rounded-l-none border-l-0",l&&"rounded-r-none border-r-0",h),H=T=>{I(T),b?.(T);},g=()=>{S(),F(""),b?.({target:{name:n||"",value:""}});};return jsxRuntime.jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsxRuntime.jsx(R,{htmlFor:y,required:t,children:e}),jsxRuntime.jsxs("div",{className:"relative flex",children:[a&&jsxRuntime.jsx(de,{before:!0,className:i,children:a}),jsxRuntime.jsxs("div",{className:"relative flex items-center w-full",children:[o&&jsxRuntime.jsx(Oe,{children:o}),jsxRuntime.jsx("input",{id:y,ref:E,name:n,onChange:H,className:P?h:N,...C}),f&&L&&jsxRuntime.jsx(ee,{onClick:g,width:12,height:12,className:u("absolute right-2 cursor-pointer",s&&"right-8")}),s&&jsxRuntime.jsx(Ue,{children:s})]}),l&&jsxRuntime.jsx(de,{after:!0,className:p,children:l})]}),m&&jsxRuntime.jsx(M,{children:m}),!m&&w&&jsxRuntime.jsx(V,{children:w})]})});tt.displayName="Input";var Go=v(tt);var nt=Rt.forwardRef(({length:e=6,groupBy:t,value:r,name:n,label:o,required:s=!1,helperText:a,error:i,onChange:l,onBlur:p,className:f,charType:h="numeric",customPattern:P,caseMode:m="none",...w},L)=>{let b=Rt.useId(),C=Rt.useRef([]),E=c=>{switch(m){case"upper":return c.toUpperCase();case"lower":case"visual-upper":return c.toLowerCase();case"visual-lower":return c.toUpperCase();default:return c}},y=c=>{if(!c)return "";let d=c.slice(0,1);switch(d=E(d),h){case"numeric":return /\d/.test(d)?d:"";case"alpha":return /[A-Za-z]/.test(d)?d:"";case"alphanumeric":return /[A-Za-z0-9]/.test(d)?d:"";case"custom":return P?.test(d)?d:"";default:return d}},I=()=>(r!=null?String(r):"").split("").map(y).slice(0,e),S=I().concat(Array(e).fill(" ")).slice(0,e),F=c=>{let d=c.split("").map(y).join("").slice(0,e),x=d===""?void 0:typeof r=="number"?Number(d):d;l?.({target:{name:n,value:x}});},N=(c,d)=>{let x=y(d),k=I();if(x===""){k[c]="",F(k.join(""));return}if(d.length>1){let W=d.split("").map(y).join("").slice(0,e);F(W),C.current[Math.min(W.length-1,e-1)]?.focus();return}x&&(k[c]=x,F(k.join("")),c<e-1&&C.current[c+1]?.focus());},H=c=>{let d=I();!d[c]&&c>0?d[c-1]="":d[c]="",F(d.join("")),c>0&&C.current[c-1]?.focus();},g=c=>{c.preventDefault();let x=c.clipboardData.getData("text").split("").map(y).join("").slice(0,e);x&&(F(x),C.current[Math.min(x.length-1,e-1)]?.focus());},T=c=>{switch(m){case"upper":case"visual-upper":return c.toUpperCase();case"lower":case"visual-lower":return c.toLowerCase();default:return c}};return jsxRuntime.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[o&&jsxRuntime.jsx(R,{htmlFor:b,required:s,children:o}),jsxRuntime.jsx("div",{className:u("flex gap-3 items-center",i&&"text-red-500",f),...w,children:S.map((c,d)=>{let x=t&&d>0&&d%t===0;return jsxRuntime.jsxs(Rt__default.default.Fragment,{children:[x&&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:h==="numeric"?"numeric":"text",value:T(c).trim(),ref:k=>{C.current[d]=k,d===0&&L&&(typeof L=="function"?L(k):typeof L=="object"&&(L.current=k));},onPaste:g,onChange:k=>N(d,k.target.value),onKeyDown:k=>k.key==="Backspace"&&H(d),onBlur:p,className:u("h-14 w-12 text-center text-2xl rounded-md border border-input bg-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",i&&"border-red-500")})]},d)})}),i&&jsxRuntime.jsx(M,{children:i}),!i&&a&&jsxRuntime.jsx(V,{children:a})]})});nt.displayName="OtpInput";var zo=v(nt);var at=Rt.forwardRef(({label:e,required:t,option:r,className:n,overrideClassName:o,helperText:s,error:a,...i},l)=>{let p=Rt.useId(),f=u("h-4 w-4 border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a&&"border-destructive",n);return jsxRuntime.jsxs("div",{className:"space-y-3",children:[e&&jsxRuntime.jsx(R,{required:t,children:e}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{id:p,type:"radio",className:o?n:f,ref:l,...i}),r&&jsxRuntime.jsx(R,{htmlFor:p,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r})]}),a&&jsxRuntime.jsx(M,{children:a}),!a&&s&&jsxRuntime.jsx(V,{children:s})]})});at.displayName="Radio";var oa=v(at);function vr(e,t){let{label:r,required:n,name:o,labelKey:s,valueKey:a,options:i,alignment:l="vertical",className:p,overrideClassName:f=!1,helperText:h,error:P,typeSet:m="field",value:w,onChange:L,...b}=e,C=Rt.useId(),E=Rt.useMemo(()=>new Map(i.map(N=>[String(N[a]),N])),[i,a]),y=Rt.useMemo(()=>w==null?"":String(m==="field"?w:w[a]),[w,m,a]),I=N=>{if(!L)return;let H;if(m==="field"){let g=E.get(N);if(g)H=g[a];else {let T=Number(N);H=Number.isNaN(T)?N:T;}}else H=E.get(N)??void 0;L({target:{name:o,value:H,type:"radiogroup",checked:!0}});},S=l==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",F=u("h-4 w-4 rounded-full border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",P&&"border-destructive");return jsxRuntime.jsxs("div",{className:u("flex flex-col gap-3",p),children:[r&&jsxRuntime.jsx(R,{required:n,children:r}),jsxRuntime.jsx("div",{className:S,children:i.map((N,H)=>{let g=String(N[a]),T=`${C}-${g}-${H}`;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{...b,id:T,ref:t,name:o,type:"radio",checked:y===g,onChange:()=>I(g),className:f?p:F}),jsxRuntime.jsx(R,{htmlFor:T,children:String(N[s])})]},T)})}),P&&jsxRuntime.jsx(M,{children:String(P)}),!P&&h&&jsxRuntime.jsx(V,{children:h})]})}function xr(){let e=Rt.forwardRef(vr);return e.displayName="RadioGroup",e}var hr=xr(),ga=v(hr);function Tr({label:e,required:t=!1,options:r,labelKey:n,valueKey:o,placeholder:s,error:a,helperText:i,className:l,...p},f){let h=Rt.useId(),P=u("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",l);return jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(R,{htmlFor:h,required:t,children:e}),jsxRuntime.jsxs("select",{id:h,ref:f,className:P,...p,children:[s&&jsxRuntime.jsx("option",{value:"",disabled:!0,children:s}),r.map((m,w)=>jsxRuntime.jsx("option",{value:String(m[o]),children:String(m[n])},w))]}),a&&jsxRuntime.jsx(M,{children:a}),!a&&i&&jsxRuntime.jsx(V,{children:i})]})}function Pr(){let e=Rt.forwardRef(Tr);return e.displayName="Select",e}var wr=Pr(),La=v(wr);var dt=Rt.forwardRef(({label:e,description:t,checked:r=!1,className:n,overrideClassName:o,error:s,name:a,...i},l)=>{let p=Rt.useId();return jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:p,name:a,checked:r,className:"peer sr-only",ref:l,...i}),jsxRuntime.jsx("label",{htmlFor:p,className:u("relative flex items-center h-6 w-11 cursor-pointer rounded-full bg-input transition-colors duration-200","peer-checked:bg-primary peer-focus:ring-2 peer-focus:ring-ring peer-focus:ring-offset-2 peer-focus:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50",n),children:jsxRuntime.jsx("span",{className:u("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",r?"translate-x-5":"translate-x-1")})}),(e||t)&&jsxRuntime.jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[e&&jsxRuntime.jsx(R,{id:`${p}-label`,htmlFor:p,className:"text-sm font-medium leading-none",children:e}),t&&jsxRuntime.jsx(R,{id:`${p}-description`,htmlFor:p,className:"text-xs text-muted-foreground",children:t})]})]})});dt.displayName="Switch";var Ha=v(dt);var mt=Rt__default.default.forwardRef(({label:e,required:t,showCount:r,maxLength:n,className:o,overrideClassName:s=!1,error:a,helperText:i,...l},p)=>{let f=Rt.useId(),[h,P]=Rt.useState(0),m=u("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",o);return jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(R,{htmlFor:f,required:t,children:e}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("textarea",{id:f,className:s?o:m,maxLength:n,onInput:w=>P(w.currentTarget.textLength),ref:p,...l}),r&&jsxRuntime.jsxs("span",{className:"absolute bottom-2 right-3 text-xs text-muted-foreground",children:[h,n?` / ${n}`:""]})]}),a&&jsxRuntime.jsx(M,{children:a}),!a&&i&&jsxRuntime.jsx(V,{children:i})]})});mt.displayName="Textarea";var Ua=v(mt);
|
|
13
|
+
var Te=Ut.createContext(void 0),Ft=({message:e})=>jsxRuntime.jsx("div",{className:"flex justify-center items-center h-screen min-w-full bg-red-50 dark:bg-red-900/10 text-red-800 dark:text-red-200 text-xl text-center p-8 transition-colors duration-300",children:jsxRuntime.jsxs("div",{className:"max-w-md animate-[fadeIn_0.5s_ease-in-out]",children:[jsxRuntime.jsxs("h1",{className:"text-3xl font-bold mb-4 flex items-center justify-center gap-2",children:[jsxRuntime.jsx("span",{className:"animate-[bounce_1s_infinite]",children:"\u26A0\uFE0F"}),"Erro de Licen\xE7a"]}),jsxRuntime.jsx("p",{className:"mb-4 text-red-600 dark:text-red-300",children:e}),jsxRuntime.jsx("p",{className:"text-lg text-red-600 dark:text-red-400",children:"Por favor, entre em contato com o suporte."}),jsxRuntime.jsx("button",{onClick:()=>window.location.reload(),className:"mt-6 px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700 transition-colors",children:"Tentar novamente"})]})}),St=({children:e,licenseKey:t})=>{let[r,n]=Ut.useState(!1),[o,i]=Ut.useState(null),[a,s]=Ut.useState(!0),l=f=>{if(i(null),!f)throw new Error("\u{1F512} Chave de licen\xE7a \xE9 obrigat\xF3ria");let c="chave-secreta-123";if(f!==c)throw new Error("\u274C Chave de licen\xE7a inv\xE1lida");n(!0);};return Ut.useEffect(()=>{if(t){s(!0);try{l(t);}catch(f){i(f instanceof Error?f.message:"Erro desconhecido na valida\xE7\xE3o da licen\xE7a");}finally{s(!1);}}else i("\u{1F512} Licen\xE7a n\xE3o informada"),s(!1);},[t]),a?null:jsxRuntime.jsx(Te.Provider,{value:{isLicenseValid:r,validateLicense:l,licenseError:o},children:r?e:jsxRuntime.jsx(Ft,{message:o||"Licen\xE7a inv\xE1lida"})})},ye=()=>{let e=Ut.useContext(Te);if(!e)throw new Error("useLicense deve ser usado dentro de um LicenseProvider");return e};var Pe=({message:e="Component locked - Please validate your license"})=>jsxRuntime.jsxs("div",{className:"flex items-start p-4 bg-red-50 border border-red-500 text-red-700 rounded-md gap-2",children:[jsxRuntime.jsx("span",{children:" \u274C Component locked - Please validate your license"}),jsxRuntime.jsx("span",{children:e})]});var g=e=>t=>{let{isLicenseValid:r}=ye();return r?jsxRuntime.jsx(e,{...t}):jsxRuntime.jsx(Pe,{})};var Ee=({items:e,type:t="single",defaultValue:r,value:n,onValueChange:o,className:i=""})=>{let a=c=>c===void 0?[]:Array.isArray(c)?c:[c],[s,l]=Ut.useState(a(n??r));Ut.useEffect(()=>{n!==void 0&&l(a(n));},[n]);let f=Ut.useCallback(c=>{l(x=>{let h;return t==="single"?h=x.includes(c)?[]:[c]:h=x.includes(c)?x.filter(d=>d!==c):[...x,c],o?.(t==="single"?h[0]??"":h),h});},[t,o]);return jsxRuntime.jsx("div",{className:`space-y-2 ${i}`,children:e.map(c=>jsxRuntime.jsx(Ot,{...c,isOpen:s.includes(c.id),onToggle:()=>f(c.id)},c.id))})},Ot=({title:e,content:t,disabled:r=!1,isOpen:n,onToggle:o})=>jsxRuntime.jsxs("div",{className:"border border-border rounded-md overflow-hidden",children:[jsxRuntime.jsx("button",{onClick:o,disabled:r,className:`w-full px-4 py-3 text-left font-medium transition-colors
|
|
14
|
+
${r?"opacity-50 cursor-not-allowed":"hover:bg-accent hover:text-accent-foreground"}
|
|
15
|
+
${n?"bg-accent text-accent-foreground":"bg-background text-foreground"}
|
|
16
|
+
`,children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{children:e}),jsxRuntime.jsx("svg",{className:`w-5 h-5 transition-transform ${n?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})}),n&&jsxRuntime.jsx("div",{className:"px-4 py-3 bg-background border-t border-border",children:t})]});Ee.displayName="Accordion";var pn=g(Ee);function u(...e){return tailwindMerge.twMerge(Tr.clsx(e))}var Ne=Ut__default.default.forwardRef(({className:e,overrideClassName:t,variant:r="primary",size:n="md",href:o,children:i,loading:a=!1,loadingContent:s,...l},f)=>{let c="inline-flex items-center justify-center rounded-lg font-medium cursor-pointer active:translate-y-1 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",x={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"},h={xs:"h-7 px-2 text-xs min-w-16",sm:"h-9 px-3 text-sm min-w-20",md:"h-10 px-4 py-2 text-base min-w-24",lg:"h-11 px-6 text-lg min-w-28",xl:"h-12 px-8 text-xl min-w-32"},d=t?e:u(c,x[r],h[n],e);return o?jsxRuntime.jsx("a",{href:o,className:d,ref:f,children:a&&s?s:i}):jsxRuntime.jsx("button",{className:d,ref:f,...l,children:a&&s?s:i})});Ne.displayName="Button";var Tn=g(Ne);var Me=Ut.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx("div",{ref:o,className:t?e:u("rounded-lg border bg-card text-card-foreground shadow-sm",e),...n,children:r}));Me.displayName="Card";var Ie=Ut.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx("div",{ref:o,className:t?e:u("flex flex-col space-y-1.5 p-6",e),...n,children:r}));Ie.displayName="CardHeader";var He=Ut.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx("h3",{ref:o,className:t?e:u("text-2xl font-semibold leading-none tracking-tight",e),...n,children:r}));He.displayName="CardTitle";var Ve=Ut.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx("p",{ref:o,className:t?e:u("text-sm text-muted-foreground",e),...n,children:r}));Ve.displayName="CardDescription";var Fe=Ut.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx("div",{ref:o,className:t?e:u("p-6 pt-0",e),...n,children:r}));Fe.displayName="CardContent";var Se=Ut.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx("div",{ref:o,className:t?e:u("flex items-center p-6 pt-0",e),...n,children:r}));Se.displayName="CardFooter";var kn=g(Me),Nn=g(Ie),Mn=g(He),In=g(Ve),Hn=g(Fe),Vn=g(Se);var ne=Ut.createContext(void 0),Ae=Ut.forwardRef(({children:e,className:t,...r},n)=>{let[o,i]=Ut.useState(!1);return jsxRuntime.jsx(ne.Provider,{value:{isOpen:o,setIsOpen:i},children:jsxRuntime.jsx("div",{ref:n,className:u("relative inline-block",t),...r,children:e})})});Ae.displayName="DropdownMenu";var $e=({children:e,asChild:t})=>{let r=Ut.useContext(ne);if(!r)throw new Error("DropdownMenuTrigger must be used within DropdownMenu");let n=()=>r.setIsOpen(!r.isOpen);if(t){let o=e;return Ut.cloneElement(o,{onClick:i=>{o.props.onClick?.(i),n();}})}return jsxRuntime.jsx("button",{onClick:n,children:e})};$e.displayName="DropdownMenuTrigger";var Be=Ut.forwardRef(({children:e,align:t="end",className:r,...n},o)=>{let i=Ut.useContext(ne),a=Ut.useRef(null);return Ut.useEffect(()=>{o&&(typeof o=="function"?o(a.current):o.current=a.current);},[o]),Ut.useEffect(()=>{let l=f=>{a.current&&!a.current.contains(f.target)&&i?.setIsOpen(!1);};return i?.isOpen&&document.addEventListener("mousedown",l),()=>{document.removeEventListener("mousedown",l);}},[i?.isOpen]),i?.isOpen?jsxRuntime.jsx("div",{ref:a,className:u("absolute z-50 mt-2 min-w-32 overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md",{start:"left-0",center:"left-1/2 -translate-x-1/2",end:"right-0"}[t],r),...n,children:e}):null});Be.displayName="DropdownMenuContent";var Oe=Ut.forwardRef(({children:e,onClick:t,destructive:r,className:n,...o},i)=>{let a=Ut.useContext(ne);return jsxRuntime.jsx("button",{ref:i,onClick:l=>{t?.(l),a?.setIsOpen(!1);},className:u("w-full text-left px-4 py-2 text-sm hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none",r&&"text-red-600 hover:bg-red-50 hover:text-red-700 focus:bg-red-50 focus:text-red-700",n),...o,children:e})});Oe.displayName="DropdownMenuItem";var Ge=Ut.forwardRef(({className:e,...t},r)=>jsxRuntime.jsx("div",{ref:r,className:u("-mx-1 my-1 h-px bg-border",e),...t}));Ge.displayName="DropdownMenuSeparator";var Ke=Ut.forwardRef(({children:e,className:t,...r},n)=>jsxRuntime.jsx("div",{ref:n,className:u("px-2 py-1.5 text-sm font-semibold",t),...r,children:e}));Ke.displayName="DropdownMenuLabel";var On=g(Ae),Gn=g($e),Kn=g(Be),Un=g(Oe),qn=g(Ge),_n=g(Ke);var zt=({children:e,className:t,overrideClassName:r})=>{if(e)return jsxRuntime.jsx("p",{className:r?t:u("text-sm text-muted-foreground",t),children:e})},I=g(zt);var Zt=({children:e,required:t,className:r,overrideClassName:n=!1,...o})=>jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("label",{...o,className:n?r:u("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),children:e}),t&&jsxRuntime.jsx("span",{className:"text-red-600",children:"*"})]}),L=g(Zt);var Yt=({children:e,className:t,overrideClassName:r})=>{if(e)return jsxRuntime.jsx("p",{className:r?t:u("text-sm text-red-600 dark:text-red-400",t),children:e})},H=g(Yt);var _e=Ut.forwardRef(({label:e,required:t,option:r,orientation:n="left",className:o,overrideClassName:i=!1,helperText:a,error:s,...l},f)=>{let c=Ut.useId(),x=u("h-4 w-4 rounded border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s&&"border-destructive",o);return jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(L,{required:t,children:e}),jsxRuntime.jsxs("div",{className:`flex ${n=="left"?"flex-row":"flex-row-reverse"} w-fit gap-2`,children:[jsxRuntime.jsx("input",{id:c,type:"checkbox",className:i?o:x,ref:f,...l}),r&&jsxRuntime.jsx(L,{htmlFor:c,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r})]}),s&&jsxRuntime.jsx(H,{children:s}),!s&&a&&jsxRuntime.jsx(I,{children:a})]})});_e.displayName="CheckBox";var uo=g(_e);function or(e,t){let{typeSet:r="field",multiCheck:n=!1,value:o,onChange:i,labelKey:a,valueKey:s,options:l,alignment:f="vertical",className:c,overrideClassName:x=!1,helperText:h,error:d,label:P,name:R,required:v,...T}=e,k=Ut.useId(),y=Ut.useMemo(()=>new Map(l.map(b=>[String(b[s]),b])),[l,s]),M=Ut.useMemo(()=>o==null?[]:r==="field"?n?o.map(b=>String(b)):[String(o)]:n?o.map(b=>String(b[s])):[String(o[s])],[o,r,n,s]),S=(b,w)=>{if(!i)return;let m;if(r==="field")if(n)m=b.map(C=>{let E=y.get(C);return E?E[s]:C});else {let p=b[0];if(!p)m=void 0;else {let C=y.get(p);m=C?C[s]:p;}}else n?m=b.map(C=>y.get(C)).filter(C=>C!==void 0):m=y.get(b[0]??"")??void 0;i({target:{name:R,value:m,type:"checkboxgroup",checked:w}});},V=b=>{let w;n?w=M.includes(b)?M.filter(m=>m!==b):[...M,b]:w=M[0]===b?[]:[b],S(w,w.includes(b));},N=f==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",F=u("h-4 w-4 rounded border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",d&&"border-destructive");return jsxRuntime.jsxs("div",{className:u("flex flex-col gap-3",c),children:[P&&jsxRuntime.jsx(L,{required:v,children:P}),jsxRuntime.jsx("div",{className:N,children:l.map((b,w)=>{let m=String(b[s]),p=M.includes(m),C=`${k}-${m}-${w}`;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{...T,id:C,ref:t,type:"checkbox",name:R,checked:p,onChange:()=>V(m),className:x?c:F}),jsxRuntime.jsx(L,{htmlFor:C,children:String(b[a])})]},C)})}),!!d&&jsxRuntime.jsx(H,{children:String(d)}),!d&&h&&jsxRuntime.jsx(I,{children:h})]})}function ar(){let e=Ut.forwardRef(or);return e.displayName="CheckBoxGroup",e}var ir=ar(),Po=g(ir);var sr=({...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"})}),oe=sr;var cr=(e,t)=>{Ut.useEffect(()=>{let r=n=>{e.current&&!e.current.contains(n.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},Xe=cr;function de({options:e,labelKey:t,valueKey:r,multiple:n,onChange:o,setSearchTerm:i,typeSet:a,name:s}){let[l,f]=Ut.useState([]),c=Ut.useMemo(()=>new Map(e.map(v=>[String(v[r]),v])),[e,r]),x=Ut.useCallback(()=>l.map(v=>c.get(v)).filter(v=>!!v),[l,c]),h=Ut.useCallback(v=>{if(!o)return;let T;if(a==="field"?n?T=v:T=v[0]??void 0:n?T=v.map(y=>c.get(y)).filter(y=>y!==void 0):T=c.get(v[0]??"")??void 0,i&&!n){let k=c.get(v[0]??"");k&&i(String(k[t]));}o({target:{name:s,value:T,type:"combobox"}});},[n,o,c,s,a,i,t]),d=Ut.useCallback(v=>{let T=String(v[r]),k=n?l.includes(T)?l.filter(y=>y!==T):[...l,T]:[T];f(k),h(k);},[n,l,h,r]),P=Ut.useCallback(v=>{let T=l.filter(k=>k!==v);f(T),h(T);},[l,h]),R=Ut.useCallback(()=>{f([]),i?.("");let v;a==="field"?v=n?[]:"":v=n?[]:void 0,o?.({target:{name:s,value:v,type:"combobox"}});},[n,o,s,i,a]);return {selectedValues:l,handleSelect:d,handleRemove:P,handleClear:R,getSelectedOptions:x}}function me(e,t,r){return Ut.useMemo(()=>r?e.filter(o=>String(o[t]).toLowerCase().includes(r.toLowerCase())):e,[e,r,t])}var je=({isOpen:e,setIsOpen:t,multiple:r,searchTerm:n,setSearchTerm:o,selectedValues:i,filteredOptions:a,highlightedIndex:s,setHighlightedIndex:l,handleSelect:f,handleRemove:c})=>{let x=Ut.useCallback(d=>{if(a.length===0){l(-1);return}l(P=>P<0?d>0?0:a.length-1:(P+d+a.length)%a.length);},[a,l]);return Ut.useCallback(d=>{if(!e){if(d.key==="Enter"||d.key==="ArrowDown"){t(!0),l(0),d.preventDefault();return}r&&d.key==="Backspace"&&n===""&&i.length>0&&(d.preventDefault(),c(i[i.length-1]));return}switch(d.key){case"ArrowDown":d.preventDefault(),x(1);break;case"ArrowUp":d.preventDefault(),x(-1);break;case"Enter":d.preventDefault();let P=s>=0?s:0,R=a[P];R&&f(R),r&&o&&o(""),r||(t(!1),l(-1));break;case"Escape":d.preventDefault(),t(!1),l(-1),r||o("");break;case"Tab":t(!1),l(-1);break;case"Home":d.preventDefault(),a.length>0&&l(0);break;case"End":d.preventDefault(),a.length>0&&l(a.length-1);break;case"Backspace":r&&n===""&&i.length>0&&(d.preventDefault(),c(i[i.length-1]));break}},[e,r,n,i,a,s,t,o,l,f,c,x])};function Ye({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 xr(e,t){let{label:r,required:n=!1,name:o,placeholder:i="Buscar...",labelKey:a,valueKey:s,options:l,value:f,onChange:c,mode:x="single",typeSet:h="field",disabled:d=!1,ClearEnabled:P=!0,helperText:R,error:v=!1,className:T="",...k}=e,y=x==="multiple",[M,S]=Ut.useState(!1),[V,N]=Ut.useState(""),F=Ut.useRef(null),b=Ut.useRef(null),w=Ut.useRef(null);Ut.useImperativeHandle(t,()=>w.current),Xe(b,()=>S(!1));let m=me(l,a,V),[p,C]=Ut.useState(-1),{selectedValues:E,handleSelect:z,handleRemove:xe,handleClear:Rt,getSelectedOptions:he}=de({options:l,labelKey:a,valueKey:s,value:f,multiple:y,onChange:c,typeSet:h,name:o,setSearchTerm:N}),Et=je({isOpen:M,setIsOpen:S,multiple:y,searchTerm:V,setSearchTerm:N,selectedValues:E,filteredOptions:m,highlightedIndex:p,setHighlightedIndex:C,handleSelect:z,handleRemove:xe}),X=Ut.useId(),kt="w-full bg-transparent outline-none placeholder:text-gray-500 dark:placeholder:text-gray-400 text-gray-900 dark:text-gray-100",Nt=u("relative w-full min-h-[40px] px-3 py-2 border rounded-md bg-white dark:bg-gray-800",v?"border-red-500":"border-gray-300 dark:border-gray-600",d?"opacity-50 cursor-not-allowed":"cursor-text","focus-within:ring-2 focus-within:ring-blue-500 focus-within:border-blue-500");return jsxRuntime.jsxs("div",{className:`space-y-2 ${T}`,children:[r&&jsxRuntime.jsx(L,{htmlFor:X,required:n,children:r}),jsxRuntime.jsxs("div",{ref:F,className:"relative",children:[jsxRuntime.jsxs("div",{className:Nt,children:[y&&he().length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:he().map((D,$)=>jsxRuntime.jsx(Ye,{option:D,labelKey:a,valueKey:s,onRemove:xe},String(D[s]??$)))}),jsxRuntime.jsx("input",{ref:w,...k,name:o,type:"text",placeholder:i,value:V,onChange:D=>{let $=D.target.value;N($),!M&&$.trim()!==""&&S(!0);},onKeyDown:Et,onMouseDown:D=>{document.activeElement===w.current&&(D.preventDefault(),S($=>{let Z=!$;return Z&&C(0),Z}));},onFocus:()=>{S(!0),C(0);},disabled:d,className:kt,role:"combobox","aria-expanded":M,"aria-controls":X,"aria-activedescendant":p>=0?`${X}-opt-${p}`:void 0}),P&&!!E.length&&jsxRuntime.jsx("button",{type:"button",onMouseDown:D=>D.preventDefault(),onClick:Rt,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(oe,{width:12,height:12})})]}),M&&jsxRuntime.jsx("div",{ref:b,id:X,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":y||void 0,children:m.length===0?jsxRuntime.jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400",children:"Nenhum resultado encontrado"}):m.map((D,$)=>{let Z=String(D[s]),ie=E.includes(Z),se=$===p;return jsxRuntime.jsx("button",{id:`${X}-opt-${$}`,"data-index":$,role:"option","aria-selected":ie,type:"button",onMouseDown:Mt=>Mt.preventDefault(),onClick:()=>z(D),className:u("w-full px-3 py-2 text-left text-sm transition-colors",se&&"bg-blue-100 dark:bg-blue-800 text-blue-900 dark:text-white",!se&&ie&&"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300",!ie&&!se&&"text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),children:jsxRuntime.jsx("span",{children:String(D[a])})},Z)})})]}),v&&jsxRuntime.jsx(H,{children:v}),!v&&R&&jsxRuntime.jsx(I,{children:R})]})}function hr(){let e=Ut.forwardRef(xr);return e.displayName="ComboBox",e}var Cr=hr(),Qo=g(Cr);var yr=({children:e,before:t,after:r,className:n})=>{let i=Tr__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})})},ge=yr;var wr=({children:e})=>jsxRuntime.jsx("div",{className:"absolute px-2",children:jsxRuntime.jsx("span",{children:e})}),tt=wr;var Pr=({children:e})=>jsxRuntime.jsx("div",{className:"absolute right-0 px-2",children:jsxRuntime.jsx("span",{children:e})}),nt=Pr;function ot(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 at(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 it(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 st(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 lt(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 ct(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 dt(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 mt(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 Lr=({e,mask:t})=>{switch(t){case"money":return at(e);case"mobile":return st(e);case"phone":return lt(e);case"cpfCnpj":return ct(e);case"cpf":return it(e);case"rg":return dt(e);case"cnpj":return mt(e);case"cep":return ot(e);default:return e}},pt=Lr;var kr=({mask:e,initialValue:t=""})=>{let[r,n]=Ut.useState(t);Ut.useEffect(()=>{t!==r&&n(t);},[t]);let o=Ut.useCallback(a=>{let l=pt({e:a,mask:e})?.currentTarget?.value??a.currentTarget.value;n(l);},[e]),i=Ut.useCallback(()=>n(""),[]);return {value:r,setValue:n,handleChange:o,handleClear:i}},ft=kr;var gt=Ut.forwardRef(({label:e,required:t=!1,mask:r,name:n,prefix:o,suffix:i,addonBefore:a,addonBeforeClassName:s,addonAfter:l,addonAfterClassName:f,ClearEnabled:c=!0,className:x,overrideClassName:h=!1,error:d,helperText:P,value:R=void 0,onChange:v,...T},k)=>{let y=Ut.useId(),{handleChange:M,handleClear:S,setValue:V}=ft({mask:r,initialValue:R}),N=u("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",d&&"border-destructive focus-visible:ring-destructive",!o&&!i&&"px-3",o&&!i&&"pl-10 pr-3",i&&!o&&"pl-3 pr-10",o&&i&&"pl-10 pr-10",a&&"rounded-l-none border-l-0",l&&"rounded-r-none border-r-0",x),F=w=>{M(w),v?.(w);},b=()=>{S(),V(""),v?.({target:{name:n||"",value:""}});};return jsxRuntime.jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsxRuntime.jsx(L,{htmlFor:y,required:t,children:e}),jsxRuntime.jsxs("div",{className:"relative flex",children:[a&&jsxRuntime.jsx(ge,{before:!0,className:s,children:a}),jsxRuntime.jsxs("div",{className:"relative flex items-center w-full",children:[o&&jsxRuntime.jsx(tt,{children:o}),jsxRuntime.jsx("input",{id:y,ref:k,name:n,onChange:F,className:h?x:N,...T}),c&&R&&jsxRuntime.jsx(oe,{onClick:b,width:12,height:12,className:u("absolute right-2 cursor-pointer",i&&"right-8")}),i&&jsxRuntime.jsx(nt,{children:i})]}),l&&jsxRuntime.jsx(ge,{after:!0,className:f,children:l})]}),d&&jsxRuntime.jsx(H,{children:d}),!d&&P&&jsxRuntime.jsx(I,{children:P})]})});gt.displayName="Input";var Ra=g(gt);var vt=Ut.forwardRef(({length:e=6,groupBy:t,value:r,name:n,label:o,required:i=!1,helperText:a,error:s,onChange:l,onBlur:f,className:c,charType:x="numeric",customPattern:h,caseMode:d="none",...P},R)=>{let v=Ut.useId(),T=Ut.useRef([]),k=m=>{switch(d){case"upper":return m.toUpperCase();case"lower":case"visual-upper":return m.toLowerCase();case"visual-lower":return m.toUpperCase();default:return m}},y=m=>{if(!m)return "";let p=m.slice(0,1);switch(p=k(p),x){case"numeric":return /\d/.test(p)?p:"";case"alpha":return /[A-Za-z]/.test(p)?p:"";case"alphanumeric":return /[A-Za-z0-9]/.test(p)?p:"";case"custom":return h?.test(p)?p:"";default:return p}},M=()=>(r!=null?String(r):"").split("").map(y).slice(0,e),S=M().concat(Array(e).fill(" ")).slice(0,e),V=m=>{let p=m.split("").map(y).join("").slice(0,e),C=p===""?void 0:typeof r=="number"?Number(p):p;l?.({target:{name:n,value:C}});},N=(m,p)=>{let C=y(p),E=M();if(C===""){E[m]="",V(E.join(""));return}if(p.length>1){let z=p.split("").map(y).join("").slice(0,e);V(z),T.current[Math.min(z.length-1,e-1)]?.focus();return}C&&(E[m]=C,V(E.join("")),m<e-1&&T.current[m+1]?.focus());},F=m=>{let p=M();!p[m]&&m>0?p[m-1]="":p[m]="",V(p.join("")),m>0&&T.current[m-1]?.focus();},b=m=>{m.preventDefault();let C=m.clipboardData.getData("text").split("").map(y).join("").slice(0,e);C&&(V(C),T.current[Math.min(C.length-1,e-1)]?.focus());},w=m=>{switch(d){case"upper":case"visual-upper":return m.toUpperCase();case"lower":case"visual-lower":return m.toLowerCase();default:return m}};return jsxRuntime.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[o&&jsxRuntime.jsx(L,{htmlFor:v,required:i,children:o}),jsxRuntime.jsx("div",{className:u("flex gap-3 items-center",s&&"text-red-500",c),...P,children:S.map((m,p)=>{let C=t&&p>0&&p%t===0;return jsxRuntime.jsxs(Ut__default.default.Fragment,{children:[C&&jsxRuntime.jsx("span",{className:"flex items-center justify-center text-xl font-bold select-none",children:"-"}),jsxRuntime.jsx("input",{id:v,type:"text",maxLength:1,inputMode:x==="numeric"?"numeric":"text",value:w(m).trim(),ref:E=>{T.current[p]=E,p===0&&R&&(typeof R=="function"?R(E):typeof R=="object"&&(R.current=E));},onPaste:b,onChange:E=>N(p,E.target.value),onKeyDown:E=>E.key==="Backspace"&&F(p),onBlur:f,className:u("h-14 w-12 text-center text-2xl rounded-md border border-input bg-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s&&"border-red-500")})]},p)})}),s&&jsxRuntime.jsx(H,{children:s}),!s&&a&&jsxRuntime.jsx(I,{children:a})]})});vt.displayName="OtpInput";var Sa=g(vt);var ht=Ut.forwardRef(({label:e,required:t,option:r,className:n,overrideClassName:o,helperText:i,error:a,...s},l)=>{let f=Ut.useId(),c=u("h-4 w-4 border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a&&"border-destructive",n);return jsxRuntime.jsxs("div",{className:"space-y-3",children:[e&&jsxRuntime.jsx(L,{required:t,children:e}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{id:f,type:"radio",className:o?n:c,ref:l,...s}),r&&jsxRuntime.jsx(L,{htmlFor:f,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r})]}),a&&jsxRuntime.jsx(H,{children:a}),!a&&i&&jsxRuntime.jsx(I,{children:i})]})});ht.displayName="Radio";var qa=g(ht);function Br(e,t){let{label:r,required:n,name:o,labelKey:i,valueKey:a,options:s,alignment:l="vertical",className:f,overrideClassName:c=!1,helperText:x,error:h,typeSet:d="field",value:P,onChange:R,...v}=e,T=Ut.useId(),k=Ut.useMemo(()=>new Map(s.map(N=>[String(N[a]),N])),[s,a]),y=Ut.useMemo(()=>P==null?"":String(d==="field"?P:P[a]),[P,d,a]),M=N=>{if(!R)return;let F;if(d==="field"){let b=k.get(N);if(b)F=b[a];else {let w=Number(N);F=Number.isNaN(w)?N:w;}}else F=k.get(N)??void 0;R({target:{name:o,value:F,type:"radiogroup",checked:!0}});},S=l==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",V=u("h-4 w-4 rounded-full border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",h&&"border-destructive");return jsxRuntime.jsxs("div",{className:u("flex flex-col gap-3",f),children:[r&&jsxRuntime.jsx(L,{required:n,children:r}),jsxRuntime.jsx("div",{className:S,children:s.map((N,F)=>{let b=String(N[a]),w=`${T}-${b}-${F}`;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{...v,id:w,ref:t,name:o,type:"radio",checked:y===b,onChange:()=>M(b),className:c?f:V}),jsxRuntime.jsx(L,{htmlFor:w,children:String(N[i])})]},w)})}),h&&jsxRuntime.jsx(H,{children:String(h)}),!h&&x&&jsxRuntime.jsx(I,{children:x})]})}function Or(){let e=Ut.forwardRef(Br);return e.displayName="RadioGroup",e}var Gr=Or(),ti=g(Gr);function qr({label:e,required:t=!1,options:r,labelKey:n,valueKey:o,placeholder:i,error:a,helperText:s,className:l,...f},c){let x=Ut.useId(),h=u("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",l);return jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(L,{htmlFor:x,required:t,children:e}),jsxRuntime.jsxs("select",{id:x,ref:c,className:h,...f,children:[i&&jsxRuntime.jsx("option",{value:"",disabled:!0,children:i}),r.map((d,P)=>jsxRuntime.jsx("option",{value:String(d[o]),children:String(d[n])},P))]}),a&&jsxRuntime.jsx(H,{children:a}),!a&&s&&jsxRuntime.jsx(I,{children:s})]})}function _r(){let e=Ut.forwardRef(qr);return e.displayName="Select",e}var Wr=_r(),pi=g(Wr);var Pt=Ut.forwardRef(({label:e,description:t,checked:r=!1,className:n,overrideClassName:o,error:i,name:a,...s},l)=>{let f=Ut.useId();return jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:f,name:a,checked:r,className:"peer sr-only",ref:l,...s}),jsxRuntime.jsx("label",{htmlFor:f,className:u("relative flex items-center h-6 w-11 cursor-pointer rounded-full bg-input transition-colors duration-200","peer-checked:bg-primary peer-focus:ring-2 peer-focus:ring-ring peer-focus:ring-offset-2 peer-focus:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50",n),children:jsxRuntime.jsx("span",{className:u("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",r?"translate-x-5":"translate-x-1")})}),(e||t)&&jsxRuntime.jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[e&&jsxRuntime.jsx(L,{id:`${f}-label`,htmlFor:f,className:"text-sm font-medium leading-none",children:e}),t&&jsxRuntime.jsx(L,{id:`${f}-description`,htmlFor:f,className:"text-xs text-muted-foreground",children:t})]})]})});Pt.displayName="Switch";var Ci=g(Pt);var Lt=Ut__default.default.forwardRef(({label:e,required:t,showCount:r,maxLength:n,className:o,overrideClassName:i=!1,error:a,helperText:s,...l},f)=>{let c=Ut.useId(),[x,h]=Ut.useState(0),d=u("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",o);return jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(L,{htmlFor:c,required:t,children:e}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("textarea",{id:c,className:i?o:d,maxLength:n,onInput:P=>h(P.currentTarget.textLength),ref:f,...l}),r&&jsxRuntime.jsxs("span",{className:"absolute bottom-2 right-3 text-xs text-muted-foreground",children:[x,n?` / ${n}`:""]})]}),a&&jsxRuntime.jsx(H,{children:a}),!a&&s&&jsxRuntime.jsx(I,{children:s})]})});Lt.displayName="Textarea";var Ni=g(Lt);
|
|
14
17
|
|
|
15
|
-
exports.
|
|
16
|
-
exports.
|
|
17
|
-
exports.
|
|
18
|
-
exports.
|
|
19
|
-
exports.
|
|
20
|
-
exports.
|
|
21
|
-
exports.
|
|
22
|
-
exports.
|
|
23
|
-
exports.
|
|
24
|
-
exports.
|
|
25
|
-
exports.
|
|
26
|
-
exports.
|
|
27
|
-
exports.
|
|
28
|
-
exports.
|
|
29
|
-
exports.
|
|
30
|
-
exports.
|
|
31
|
-
exports.
|
|
32
|
-
exports.
|
|
33
|
-
exports.
|
|
34
|
-
exports.
|
|
35
|
-
exports.
|
|
18
|
+
exports.AccordionPrimitive = pn;
|
|
19
|
+
exports.ButtonPrimitive = Tn;
|
|
20
|
+
exports.CardContentPrimitive = Hn;
|
|
21
|
+
exports.CardDescriptionPrimitive = In;
|
|
22
|
+
exports.CardFooterPrimitive = Vn;
|
|
23
|
+
exports.CardHeaderPrimitive = Nn;
|
|
24
|
+
exports.CardPrimitive = kn;
|
|
25
|
+
exports.CardTitlePrimitive = Mn;
|
|
26
|
+
exports.CheckBoxGroupPrimitive = Po;
|
|
27
|
+
exports.CheckBoxPrimitive = uo;
|
|
28
|
+
exports.ComboBoxPrimitive = Qo;
|
|
29
|
+
exports.DropdownMenuContentPrimitive = Kn;
|
|
30
|
+
exports.DropdownMenuItemPrimitive = Un;
|
|
31
|
+
exports.DropdownMenuLabelPrimitive = _n;
|
|
32
|
+
exports.DropdownMenuPrimitive = On;
|
|
33
|
+
exports.DropdownMenuSeparatorPrimitive = qn;
|
|
34
|
+
exports.DropdownMenuTriggerPrimitive = Gn;
|
|
35
|
+
exports.HelperFieldPrimitive = I;
|
|
36
|
+
exports.InputPrimitive = Ra;
|
|
37
|
+
exports.LabelPrimitive = L;
|
|
38
|
+
exports.LicenseProvider = St;
|
|
39
|
+
exports.OtpInputPrimitive = Sa;
|
|
40
|
+
exports.RadioGroupPrimitive = ti;
|
|
41
|
+
exports.RadioPrimitive = qa;
|
|
42
|
+
exports.SelectPrimitive = pi;
|
|
43
|
+
exports.SwitchPrimitive = Ci;
|
|
44
|
+
exports.TextareaPrimitive = Ni;
|
|
45
|
+
exports.ValidateFieldPrimitive = H;
|
package/dist/page.mjs
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Ut, { createContext, forwardRef, useState, useContext, useRef, useEffect, useId, useMemo, useImperativeHandle, useCallback, cloneElement } from 'react';
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
-
import
|
|
3
|
+
import Tr, { clsx } from 'clsx';
|
|
4
4
|
import { twMerge } from 'tailwind-merge';
|
|
5
5
|
|
|
6
|
-
var be=createContext(void 0),Ct=({message:e})=>jsx("div",{className:"flex justify-center items-center h-screen min-w-full bg-red-50 dark:bg-red-900/10 text-red-800 dark:text-red-200 text-xl text-center p-8 transition-colors duration-300",children:jsxs("div",{className:"max-w-md animate-[fadeIn_0.5s_ease-in-out]",children:[jsxs("h1",{className:"text-3xl font-bold mb-4 flex items-center justify-center gap-2",children:[jsx("span",{className:"animate-[bounce_1s_infinite]",children:"\u26A0\uFE0F"}),"Erro de Licen\xE7a"]}),jsx("p",{className:"mb-4 text-red-600 dark:text-red-300",children:e}),jsx("p",{className:"text-lg text-red-600 dark:text-red-400",children:"Por favor, entre em contato com o suporte."}),jsx("button",{onClick:()=>window.location.reload(),className:"mt-6 px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700 transition-colors",children:"Tentar novamente"})]})}),yt=({children:e,licenseKey:t})=>{let[r,n]=useState(!1),[o,s]=useState(null),[a,i]=useState(!0),l=p=>{if(s(null),!p)throw new Error("\u{1F512} Chave de licen\xE7a \xE9 obrigat\xF3ria");let f="chave-secreta-123";if(p!==f)throw new Error("\u274C Chave de licen\xE7a inv\xE1lida");n(!0);};return useEffect(()=>{if(t){i(!0);try{l(t);}catch(p){s(p instanceof Error?p.message:"Erro desconhecido na valida\xE7\xE3o da licen\xE7a");}finally{i(!1);}}else s("\u{1F512} Licen\xE7a n\xE3o informada"),i(!1);},[t]),a?null:jsx(be.Provider,{value:{isLicenseValid:r,validateLicense:l,licenseError:o},children:r?e:jsx(Ct,{message:o||"Licen\xE7a inv\xE1lida"})})},ve=()=>{let e=useContext(be);if(!e)throw new Error("useLicense deve ser usado dentro de um LicenseProvider");return e};var he=({message:e="Component locked - Please validate your license"})=>jsxs("div",{className:"flex items-start p-4 bg-red-50 border border-red-500 text-red-700 rounded-md gap-2",children:[jsx("span",{children:" \u274C Component locked - Please validate your license"}),jsx("span",{children:e})]});var v=e=>t=>{let{isLicenseValid:r}=ve();return r?jsx(e,{...t}):jsx(he,{})};function u(...e){return twMerge(clsx(e))}var Te=Rt.forwardRef(({className:e,overrideClassName:t,variant:r="primary",size:n="md",href:o,children:s,loading:a=!1,loadingContent:i,...l},p)=>{let f="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",h={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"},P={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:u(f,h[r],P[n],e);return o?jsx("a",{href:o,className:m,ref:p,children:a&&i?i:s}):jsx("button",{className:m,ref:p,...l,children:a&&i?i:s})});Te.displayName="Button";var Wr=v(Te);var Pe=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx("div",{ref:o,className:t?e:u("rounded-lg border bg-card text-card-foreground shadow-sm",e),...n,children:r}));Pe.displayName="Card";var we=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx("div",{ref:o,className:t?e:u("flex flex-col space-y-1.5 p-6",e),...n,children:r}));we.displayName="CardHeader";var Re=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx("h3",{ref:o,className:t?e:u("text-2xl font-semibold leading-none tracking-tight",e),...n,children:r}));Re.displayName="CardTitle";var Le=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx("p",{ref:o,className:t?e:u("text-sm text-muted-foreground",e),...n,children:r}));Le.displayName="CardDescription";var ke=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx("div",{ref:o,className:t?e:u("p-6 pt-0",e),...n,children:r}));ke.displayName="CardContent";var Ee=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx("div",{ref:o,className:t?e:u("flex items-center p-6 pt-0",e),...n,children:r}));Ee.displayName="CardFooter";var Qr=v(Pe),en=v(we),tn=v(Re),rn=v(Le),nn=v(ke),on=v(Ee);var Lt=({children:e,className:t,overrideClassName:r})=>{if(e)return jsx("p",{className:r?t:u("text-sm text-muted-foreground",t),children:e})},V=v(Lt);var Et=({children:e,required:t,className:r,overrideClassName:n=!1,...o})=>jsxs("div",{className:"flex items-center gap-1",children:[jsx("label",{...o,className:n?r:u("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),children:e}),t&&jsx("span",{className:"text-red-600",children:"*"})]}),R=v(Et);var It=({children:e,className:t,overrideClassName:r})=>{if(e)return jsx("p",{className:r?t:u("text-sm text-red-600 dark:text-red-400",t),children:e})},M=v(It);var Ve=forwardRef(({label:e,required:t,option:r,orientation:n="left",className:o,overrideClassName:s=!1,helperText:a,error:i,...l},p)=>{let f=useId(),h=u("h-4 w-4 rounded border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",i&&"border-destructive",o);return jsxs("div",{className:"space-y-2",children:[e&&jsx(R,{required:t,children:e}),jsxs("div",{className:`flex ${n=="left"?"flex-row":"flex-row-reverse"} w-fit gap-2`,children:[jsx("input",{id:f,type:"checkbox",className:s?o:h,ref:p,...l}),r&&jsx(R,{htmlFor:f,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r})]}),i&&jsx(M,{children:i}),!i&&a&&jsx(V,{children:a})]})});Ve.displayName="CheckBox";var Ln=v(Ve);function At(e,t){let{typeSet:r="field",multiCheck:n=!1,value:o,onChange:s,labelKey:a,valueKey:i,options:l,alignment:p="vertical",className:f,overrideClassName:h=!1,helperText:P,error:m,label:w,name:L,required:b,...C}=e,E=useId(),y=useMemo(()=>new Map(l.map(g=>[String(g[i]),g])),[l,i]),I=useMemo(()=>o==null?[]:r==="field"?n?o.map(g=>String(g)):[String(o)]:n?o.map(g=>String(g[i])):[String(o[i])],[o,r,n,i]),S=(g,T)=>{if(!s)return;let c;if(r==="field")if(n)c=g.map(x=>{let k=y.get(x);return k?k[i]:x});else {let d=g[0];if(!d)c=void 0;else {let x=y.get(d);c=x?x[i]:d;}}else n?c=g.map(x=>y.get(x)).filter(x=>x!==void 0):c=y.get(g[0]??"")??void 0;s({target:{name:L,value:c,type:"checkboxgroup",checked:T}});},F=g=>{let T;n?T=I.includes(g)?I.filter(c=>c!==g):[...I,g]:T=I[0]===g?[]:[g],S(T,T.includes(g));},N=p==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",H=u("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 jsxs("div",{className:u("flex flex-col gap-3",f),children:[w&&jsx(R,{required:b,children:w}),jsx("div",{className:N,children:l.map((g,T)=>{let c=String(g[i]),d=I.includes(c),x=`${E}-${c}-${T}`;return jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{...C,id:x,ref:t,type:"checkbox",name:L,checked:d,onChange:()=>F(c),className:h?f:H}),jsx(R,{htmlFor:x,children:String(g[a])})]},x)})}),!!m&&jsx(M,{children:String(m)}),!m&&P&&jsx(V,{children:P})]})}function $t(){let e=forwardRef(At);return e.displayName="CheckBoxGroup",e}var Dt=$t(),$n=v(Dt);var Bt=({...e})=>jsx("svg",{...e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),ee=Bt;var Ot=(e,t)=>{useEffect(()=>{let r=n=>{e.current&&!e.current.contains(n.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},Se=Ot;function ae({options:e,labelKey:t,valueKey:r,multiple:n,onChange:o,setSearchTerm:s,typeSet:a,name:i}){let[l,p]=useState([]),f=useMemo(()=>new Map(e.map(b=>[String(b[r]),b])),[e,r]),h=useCallback(()=>l.map(b=>f.get(b)).filter(b=>!!b),[l,f]),P=useCallback(b=>{if(!o)return;let C;if(a==="field"?n?C=b:C=b[0]??void 0:n?C=b.map(y=>f.get(y)).filter(y=>y!==void 0):C=f.get(b[0]??"")??void 0,s&&!n){let E=f.get(b[0]??"");E&&s(String(E[t]));}o({target:{name:i,value:C,type:"combobox"}});},[n,o,f,i,a,s,t]),m=useCallback(b=>{let C=String(b[r]),E=n?l.includes(C)?l.filter(y=>y!==C):[...l,C]:[C];p(E),P(E);},[n,l,P,r]),w=useCallback(b=>{let C=l.filter(E=>E!==b);p(C),P(C);},[l,P]),L=useCallback(()=>{p([]),s?.("");let b;a==="field"?b=n?[]:"":b=n?[]:void 0,o?.({target:{name:i,value:b,type:"combobox"}});},[n,o,i,s,a]);return {selectedValues:l,handleSelect:m,handleRemove:w,handleClear:L,getSelectedOptions:h}}function ie(e,t,r){return useMemo(()=>r?e.filter(o=>String(o[t]).toLowerCase().includes(r.toLowerCase())):e,[e,r,t])}var $e=({isOpen:e,setIsOpen:t,multiple:r,searchTerm:n,setSearchTerm:o,selectedValues:s,filteredOptions:a,highlightedIndex:i,setHighlightedIndex:l,handleSelect:p,handleRemove:f})=>{let h=useCallback(m=>{if(a.length===0){l(-1);return}l(w=>w<0?m>0?0:a.length-1:(w+m+a.length)%a.length);},[a,l]);return useCallback(m=>{if(!e){if(m.key==="Enter"||m.key==="ArrowDown"){t(!0),l(0),m.preventDefault();return}r&&m.key==="Backspace"&&n===""&&s.length>0&&(m.preventDefault(),f(s[s.length-1]));return}switch(m.key){case"ArrowDown":m.preventDefault(),h(1);break;case"ArrowUp":m.preventDefault(),h(-1);break;case"Enter":m.preventDefault();let w=i>=0?i:0,L=a[w];L&&p(L),r&&o&&o(""),r||(t(!1),l(-1));break;case"Escape":m.preventDefault(),t(!1),l(-1),r||o("");break;case"Tab":t(!1),l(-1);break;case"Home":m.preventDefault(),a.length>0&&l(0);break;case"End":m.preventDefault(),a.length>0&&l(a.length-1);break;case"Backspace":r&&n===""&&s.length>0&&(m.preventDefault(),f(s[s.length-1]));break}},[e,r,n,s,a,i,t,o,l,p,f,h])};function De({option:e,labelKey:t,valueKey:r,onRemove:n}){let o=String(e[t]),s=String(e[r]);return jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded",children:[o,jsx("button",{type:"button",onMouseDown:a=>a.preventDefault(),onClick:()=>n(s),className:"hover:bg-blue-200 dark:hover:bg-blue-800 rounded-full p-0.5 transition-colors","aria-label":`Remover ${o}`,children:"\u2715"})]},s)}function Zt(e,t){let{label:r,required:n=!1,name:o,placeholder:s="Buscar...",labelKey:a,valueKey:i,options:l,value:p,onChange:f,mode:h="single",typeSet:P="field",disabled:m=!1,ClearEnabled:w=!0,helperText:L,error:b=!1,className:C="",...E}=e,y=h==="multiple",[I,S]=useState(!1),[F,N]=useState(""),H=useRef(null),g=useRef(null),T=useRef(null);useImperativeHandle(t,()=>T.current),Se(g,()=>S(!1));let c=ie(l,a,F),[d,x]=useState(-1),{selectedValues:k,handleSelect:W,handleRemove:ue,handleClear:pt,getSelectedOptions:fe}=ae({options:l,labelKey:a,valueKey:i,value:p,multiple:y,onChange:f,typeSet:P,name:o,setSearchTerm:N}),ut=$e({isOpen:I,setIsOpen:S,multiple:y,searchTerm:F,setSearchTerm:N,selectedValues:k,filteredOptions:c,highlightedIndex:d,setHighlightedIndex:x,handleSelect:W,handleRemove:ue}),J=useId(),ft="w-full bg-transparent outline-none placeholder:text-gray-500 dark:placeholder:text-gray-400 text-gray-900 dark:text-gray-100",gt=u("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 jsxs("div",{className:`space-y-2 ${C}`,children:[r&&jsx(R,{htmlFor:J,required:n,children:r}),jsxs("div",{ref:H,className:"relative",children:[jsxs("div",{className:gt,children:[y&&fe().length>0&&jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:fe().map((A,D)=>jsx(De,{option:A,labelKey:a,valueKey:i,onRemove:ue},String(A[i]??D)))}),jsx("input",{ref:T,...E,name:o,type:"text",placeholder:s,value:F,onChange:A=>{let D=A.target.value;N(D),!I&&D.trim()!==""&&S(!0);},onKeyDown:ut,onMouseDown:A=>{document.activeElement===T.current&&(A.preventDefault(),S(D=>{let X=!D;return X&&x(0),X}));},onFocus:()=>{S(!0),x(0);},disabled:m,className:ft,role:"combobox","aria-expanded":I,"aria-controls":J,"aria-activedescendant":d>=0?`${J}-opt-${d}`:void 0}),w&&!!k.length&&jsx("button",{type:"button",onMouseDown:A=>A.preventDefault(),onClick:pt,className:"absolute right-2 top-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 p-1 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700",title:"Limpar sele\xE7\xE3o",children:jsx(ee,{width:12,height:12})})]}),I&&jsx("div",{ref:g,id:J,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":y||void 0,children:c.length===0?jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400",children:"Nenhum resultado encontrado"}):c.map((A,D)=>{let X=String(A[i]),re=k.includes(X),ne=D===d;return jsx("button",{id:`${J}-opt-${D}`,"data-index":D,role:"option","aria-selected":re,type:"button",onMouseDown:bt=>bt.preventDefault(),onClick:()=>W(A),className:u("w-full px-3 py-2 text-left text-sm transition-colors",ne&&"bg-blue-100 dark:bg-blue-800 text-blue-900 dark:text-white",!ne&&re&&"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300",!re&&!ne&&"text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),children:jsx("span",{children:String(A[a])})},X)})})]}),b&&jsx(M,{children:b}),!b&&L&&jsx(V,{children:L})]})}function jt(){let e=forwardRef(Zt);return e.displayName="ComboBox",e}var Yt=jt(),uo=v(Yt);var er=({children:e,before:t,after:r,className:n})=>{let s=Qt("flex justify-center items-center",{"rounded-l-lg":t,"rounded-r-lg":r},n);return jsx("div",{className:s,children:jsx("span",{children:e})})},de=er;var tr=({children:e})=>jsx("div",{className:"absolute px-2",children:jsx("span",{children:e})}),Oe=tr;var rr=({children:e})=>jsx("div",{className:"absolute right-0 px-2",children:jsx("span",{children:e})}),Ue=rr;function qe(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 _e(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 We(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 Je(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 Xe(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 ze(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 Ze(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 je(e){e.currentTarget.maxLength=18;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2"),e.currentTarget.value=t,e}var nr=({e,mask:t})=>{switch(t){case"money":return _e(e);case"mobile":return Je(e);case"phone":return Xe(e);case"cpfCnpj":return ze(e);case"cpf":return We(e);case"rg":return Ze(e);case"cnpj":return je(e);case"cep":return qe(e);default:return e}},Ye=nr;var ir=({mask:e,initialValue:t=""})=>{let[r,n]=useState(t);useEffect(()=>{t!==r&&n(t);},[t]);let o=useCallback(a=>{let l=Ye({e:a,mask:e})?.currentTarget?.value??a.currentTarget.value;n(l);},[e]),s=useCallback(()=>n(""),[]);return {value:r,setValue:n,handleChange:o,handleClear:s}},et=ir;var tt=forwardRef(({label:e,required:t=!1,mask:r,name:n,prefix:o,suffix:s,addonBefore:a,addonBeforeClassName:i,addonAfter:l,addonAfterClassName:p,ClearEnabled:f=!0,className:h,overrideClassName:P=!1,error:m,helperText:w,value:L=void 0,onChange:b,...C},E)=>{let y=useId(),{handleChange:I,handleClear:S,setValue:F}=et({mask:r,initialValue:L}),N=u("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",m&&"border-destructive focus-visible:ring-destructive",!o&&!s&&"px-3",o&&!s&&"pl-10 pr-3",s&&!o&&"pl-3 pr-10",o&&s&&"pl-10 pr-10",a&&"rounded-l-none border-l-0",l&&"rounded-r-none border-r-0",h),H=T=>{I(T),b?.(T);},g=()=>{S(),F(""),b?.({target:{name:n||"",value:""}});};return jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsx(R,{htmlFor:y,required:t,children:e}),jsxs("div",{className:"relative flex",children:[a&&jsx(de,{before:!0,className:i,children:a}),jsxs("div",{className:"relative flex items-center w-full",children:[o&&jsx(Oe,{children:o}),jsx("input",{id:y,ref:E,name:n,onChange:H,className:P?h:N,...C}),f&&L&&jsx(ee,{onClick:g,width:12,height:12,className:u("absolute right-2 cursor-pointer",s&&"right-8")}),s&&jsx(Ue,{children:s})]}),l&&jsx(de,{after:!0,className:p,children:l})]}),m&&jsx(M,{children:m}),!m&&w&&jsx(V,{children:w})]})});tt.displayName="Input";var Go=v(tt);var nt=forwardRef(({length:e=6,groupBy:t,value:r,name:n,label:o,required:s=!1,helperText:a,error:i,onChange:l,onBlur:p,className:f,charType:h="numeric",customPattern:P,caseMode:m="none",...w},L)=>{let b=useId(),C=useRef([]),E=c=>{switch(m){case"upper":return c.toUpperCase();case"lower":case"visual-upper":return c.toLowerCase();case"visual-lower":return c.toUpperCase();default:return c}},y=c=>{if(!c)return "";let d=c.slice(0,1);switch(d=E(d),h){case"numeric":return /\d/.test(d)?d:"";case"alpha":return /[A-Za-z]/.test(d)?d:"";case"alphanumeric":return /[A-Za-z0-9]/.test(d)?d:"";case"custom":return P?.test(d)?d:"";default:return d}},I=()=>(r!=null?String(r):"").split("").map(y).slice(0,e),S=I().concat(Array(e).fill(" ")).slice(0,e),F=c=>{let d=c.split("").map(y).join("").slice(0,e),x=d===""?void 0:typeof r=="number"?Number(d):d;l?.({target:{name:n,value:x}});},N=(c,d)=>{let x=y(d),k=I();if(x===""){k[c]="",F(k.join(""));return}if(d.length>1){let W=d.split("").map(y).join("").slice(0,e);F(W),C.current[Math.min(W.length-1,e-1)]?.focus();return}x&&(k[c]=x,F(k.join("")),c<e-1&&C.current[c+1]?.focus());},H=c=>{let d=I();!d[c]&&c>0?d[c-1]="":d[c]="",F(d.join("")),c>0&&C.current[c-1]?.focus();},g=c=>{c.preventDefault();let x=c.clipboardData.getData("text").split("").map(y).join("").slice(0,e);x&&(F(x),C.current[Math.min(x.length-1,e-1)]?.focus());},T=c=>{switch(m){case"upper":case"visual-upper":return c.toUpperCase();case"lower":case"visual-lower":return c.toLowerCase();default:return c}};return jsxs("div",{className:"flex flex-col gap-2 w-full",children:[o&&jsx(R,{htmlFor:b,required:s,children:o}),jsx("div",{className:u("flex gap-3 items-center",i&&"text-red-500",f),...w,children:S.map((c,d)=>{let x=t&&d>0&&d%t===0;return jsxs(Rt.Fragment,{children:[x&&jsx("span",{className:"flex items-center justify-center text-xl font-bold select-none",children:"-"}),jsx("input",{id:b,type:"text",maxLength:1,inputMode:h==="numeric"?"numeric":"text",value:T(c).trim(),ref:k=>{C.current[d]=k,d===0&&L&&(typeof L=="function"?L(k):typeof L=="object"&&(L.current=k));},onPaste:g,onChange:k=>N(d,k.target.value),onKeyDown:k=>k.key==="Backspace"&&H(d),onBlur:p,className:u("h-14 w-12 text-center text-2xl rounded-md border border-input bg-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",i&&"border-red-500")})]},d)})}),i&&jsx(M,{children:i}),!i&&a&&jsx(V,{children:a})]})});nt.displayName="OtpInput";var zo=v(nt);var at=forwardRef(({label:e,required:t,option:r,className:n,overrideClassName:o,helperText:s,error:a,...i},l)=>{let p=useId(),f=u("h-4 w-4 border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a&&"border-destructive",n);return jsxs("div",{className:"space-y-3",children:[e&&jsx(R,{required:t,children:e}),jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{id:p,type:"radio",className:o?n:f,ref:l,...i}),r&&jsx(R,{htmlFor:p,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r})]}),a&&jsx(M,{children:a}),!a&&s&&jsx(V,{children:s})]})});at.displayName="Radio";var oa=v(at);function vr(e,t){let{label:r,required:n,name:o,labelKey:s,valueKey:a,options:i,alignment:l="vertical",className:p,overrideClassName:f=!1,helperText:h,error:P,typeSet:m="field",value:w,onChange:L,...b}=e,C=useId(),E=useMemo(()=>new Map(i.map(N=>[String(N[a]),N])),[i,a]),y=useMemo(()=>w==null?"":String(m==="field"?w:w[a]),[w,m,a]),I=N=>{if(!L)return;let H;if(m==="field"){let g=E.get(N);if(g)H=g[a];else {let T=Number(N);H=Number.isNaN(T)?N:T;}}else H=E.get(N)??void 0;L({target:{name:o,value:H,type:"radiogroup",checked:!0}});},S=l==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",F=u("h-4 w-4 rounded-full border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",P&&"border-destructive");return jsxs("div",{className:u("flex flex-col gap-3",p),children:[r&&jsx(R,{required:n,children:r}),jsx("div",{className:S,children:i.map((N,H)=>{let g=String(N[a]),T=`${C}-${g}-${H}`;return jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{...b,id:T,ref:t,name:o,type:"radio",checked:y===g,onChange:()=>I(g),className:f?p:F}),jsx(R,{htmlFor:T,children:String(N[s])})]},T)})}),P&&jsx(M,{children:String(P)}),!P&&h&&jsx(V,{children:h})]})}function xr(){let e=forwardRef(vr);return e.displayName="RadioGroup",e}var hr=xr(),ga=v(hr);function Tr({label:e,required:t=!1,options:r,labelKey:n,valueKey:o,placeholder:s,error:a,helperText:i,className:l,...p},f){let h=useId(),P=u("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",l);return jsxs("div",{className:"space-y-2",children:[e&&jsx(R,{htmlFor:h,required:t,children:e}),jsxs("select",{id:h,ref:f,className:P,...p,children:[s&&jsx("option",{value:"",disabled:!0,children:s}),r.map((m,w)=>jsx("option",{value:String(m[o]),children:String(m[n])},w))]}),a&&jsx(M,{children:a}),!a&&i&&jsx(V,{children:i})]})}function Pr(){let e=forwardRef(Tr);return e.displayName="Select",e}var wr=Pr(),La=v(wr);var dt=forwardRef(({label:e,description:t,checked:r=!1,className:n,overrideClassName:o,error:s,name:a,...i},l)=>{let p=useId();return jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",id:p,name:a,checked:r,className:"peer sr-only",ref:l,...i}),jsx("label",{htmlFor:p,className:u("relative flex items-center h-6 w-11 cursor-pointer rounded-full bg-input transition-colors duration-200","peer-checked:bg-primary peer-focus:ring-2 peer-focus:ring-ring peer-focus:ring-offset-2 peer-focus:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50",n),children:jsx("span",{className:u("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",r?"translate-x-5":"translate-x-1")})}),(e||t)&&jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[e&&jsx(R,{id:`${p}-label`,htmlFor:p,className:"text-sm font-medium leading-none",children:e}),t&&jsx(R,{id:`${p}-description`,htmlFor:p,className:"text-xs text-muted-foreground",children:t})]})]})});dt.displayName="Switch";var Ha=v(dt);var mt=Rt.forwardRef(({label:e,required:t,showCount:r,maxLength:n,className:o,overrideClassName:s=!1,error:a,helperText:i,...l},p)=>{let f=useId(),[h,P]=useState(0),m=u("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",o);return jsxs("div",{className:"space-y-2",children:[e&&jsx(R,{htmlFor:f,required:t,children:e}),jsxs("div",{className:"relative",children:[jsx("textarea",{id:f,className:s?o:m,maxLength:n,onInput:w=>P(w.currentTarget.textLength),ref:p,...l}),r&&jsxs("span",{className:"absolute bottom-2 right-3 text-xs text-muted-foreground",children:[h,n?` / ${n}`:""]})]}),a&&jsx(M,{children:a}),!a&&i&&jsx(V,{children:i})]})});mt.displayName="Textarea";var Ua=v(mt);
|
|
6
|
+
var Te=createContext(void 0),Ft=({message:e})=>jsx("div",{className:"flex justify-center items-center h-screen min-w-full bg-red-50 dark:bg-red-900/10 text-red-800 dark:text-red-200 text-xl text-center p-8 transition-colors duration-300",children:jsxs("div",{className:"max-w-md animate-[fadeIn_0.5s_ease-in-out]",children:[jsxs("h1",{className:"text-3xl font-bold mb-4 flex items-center justify-center gap-2",children:[jsx("span",{className:"animate-[bounce_1s_infinite]",children:"\u26A0\uFE0F"}),"Erro de Licen\xE7a"]}),jsx("p",{className:"mb-4 text-red-600 dark:text-red-300",children:e}),jsx("p",{className:"text-lg text-red-600 dark:text-red-400",children:"Por favor, entre em contato com o suporte."}),jsx("button",{onClick:()=>window.location.reload(),className:"mt-6 px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700 transition-colors",children:"Tentar novamente"})]})}),St=({children:e,licenseKey:t})=>{let[r,n]=useState(!1),[o,i]=useState(null),[a,s]=useState(!0),l=f=>{if(i(null),!f)throw new Error("\u{1F512} Chave de licen\xE7a \xE9 obrigat\xF3ria");let c="chave-secreta-123";if(f!==c)throw new Error("\u274C Chave de licen\xE7a inv\xE1lida");n(!0);};return useEffect(()=>{if(t){s(!0);try{l(t);}catch(f){i(f instanceof Error?f.message:"Erro desconhecido na valida\xE7\xE3o da licen\xE7a");}finally{s(!1);}}else i("\u{1F512} Licen\xE7a n\xE3o informada"),s(!1);},[t]),a?null:jsx(Te.Provider,{value:{isLicenseValid:r,validateLicense:l,licenseError:o},children:r?e:jsx(Ft,{message:o||"Licen\xE7a inv\xE1lida"})})},ye=()=>{let e=useContext(Te);if(!e)throw new Error("useLicense deve ser usado dentro de um LicenseProvider");return e};var Pe=({message:e="Component locked - Please validate your license"})=>jsxs("div",{className:"flex items-start p-4 bg-red-50 border border-red-500 text-red-700 rounded-md gap-2",children:[jsx("span",{children:" \u274C Component locked - Please validate your license"}),jsx("span",{children:e})]});var g=e=>t=>{let{isLicenseValid:r}=ye();return r?jsx(e,{...t}):jsx(Pe,{})};var Ee=({items:e,type:t="single",defaultValue:r,value:n,onValueChange:o,className:i=""})=>{let a=c=>c===void 0?[]:Array.isArray(c)?c:[c],[s,l]=useState(a(n??r));useEffect(()=>{n!==void 0&&l(a(n));},[n]);let f=useCallback(c=>{l(x=>{let h;return t==="single"?h=x.includes(c)?[]:[c]:h=x.includes(c)?x.filter(d=>d!==c):[...x,c],o?.(t==="single"?h[0]??"":h),h});},[t,o]);return jsx("div",{className:`space-y-2 ${i}`,children:e.map(c=>jsx(Ot,{...c,isOpen:s.includes(c.id),onToggle:()=>f(c.id)},c.id))})},Ot=({title:e,content:t,disabled:r=!1,isOpen:n,onToggle:o})=>jsxs("div",{className:"border border-border rounded-md overflow-hidden",children:[jsx("button",{onClick:o,disabled:r,className:`w-full px-4 py-3 text-left font-medium transition-colors
|
|
7
|
+
${r?"opacity-50 cursor-not-allowed":"hover:bg-accent hover:text-accent-foreground"}
|
|
8
|
+
${n?"bg-accent text-accent-foreground":"bg-background text-foreground"}
|
|
9
|
+
`,children:jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{children:e}),jsx("svg",{className:`w-5 h-5 transition-transform ${n?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})}),n&&jsx("div",{className:"px-4 py-3 bg-background border-t border-border",children:t})]});Ee.displayName="Accordion";var pn=g(Ee);function u(...e){return twMerge(clsx(e))}var Ne=Ut.forwardRef(({className:e,overrideClassName:t,variant:r="primary",size:n="md",href:o,children:i,loading:a=!1,loadingContent:s,...l},f)=>{let c="inline-flex items-center justify-center rounded-lg font-medium cursor-pointer active:translate-y-1 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",x={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"},h={xs:"h-7 px-2 text-xs min-w-16",sm:"h-9 px-3 text-sm min-w-20",md:"h-10 px-4 py-2 text-base min-w-24",lg:"h-11 px-6 text-lg min-w-28",xl:"h-12 px-8 text-xl min-w-32"},d=t?e:u(c,x[r],h[n],e);return o?jsx("a",{href:o,className:d,ref:f,children:a&&s?s:i}):jsx("button",{className:d,ref:f,...l,children:a&&s?s:i})});Ne.displayName="Button";var Tn=g(Ne);var Me=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx("div",{ref:o,className:t?e:u("rounded-lg border bg-card text-card-foreground shadow-sm",e),...n,children:r}));Me.displayName="Card";var Ie=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx("div",{ref:o,className:t?e:u("flex flex-col space-y-1.5 p-6",e),...n,children:r}));Ie.displayName="CardHeader";var He=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx("h3",{ref:o,className:t?e:u("text-2xl font-semibold leading-none tracking-tight",e),...n,children:r}));He.displayName="CardTitle";var Ve=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx("p",{ref:o,className:t?e:u("text-sm text-muted-foreground",e),...n,children:r}));Ve.displayName="CardDescription";var Fe=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx("div",{ref:o,className:t?e:u("p-6 pt-0",e),...n,children:r}));Fe.displayName="CardContent";var Se=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx("div",{ref:o,className:t?e:u("flex items-center p-6 pt-0",e),...n,children:r}));Se.displayName="CardFooter";var kn=g(Me),Nn=g(Ie),Mn=g(He),In=g(Ve),Hn=g(Fe),Vn=g(Se);var ne=createContext(void 0),Ae=forwardRef(({children:e,className:t,...r},n)=>{let[o,i]=useState(!1);return jsx(ne.Provider,{value:{isOpen:o,setIsOpen:i},children:jsx("div",{ref:n,className:u("relative inline-block",t),...r,children:e})})});Ae.displayName="DropdownMenu";var $e=({children:e,asChild:t})=>{let r=useContext(ne);if(!r)throw new Error("DropdownMenuTrigger must be used within DropdownMenu");let n=()=>r.setIsOpen(!r.isOpen);if(t){let o=e;return cloneElement(o,{onClick:i=>{o.props.onClick?.(i),n();}})}return jsx("button",{onClick:n,children:e})};$e.displayName="DropdownMenuTrigger";var Be=forwardRef(({children:e,align:t="end",className:r,...n},o)=>{let i=useContext(ne),a=useRef(null);return useEffect(()=>{o&&(typeof o=="function"?o(a.current):o.current=a.current);},[o]),useEffect(()=>{let l=f=>{a.current&&!a.current.contains(f.target)&&i?.setIsOpen(!1);};return i?.isOpen&&document.addEventListener("mousedown",l),()=>{document.removeEventListener("mousedown",l);}},[i?.isOpen]),i?.isOpen?jsx("div",{ref:a,className:u("absolute z-50 mt-2 min-w-32 overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md",{start:"left-0",center:"left-1/2 -translate-x-1/2",end:"right-0"}[t],r),...n,children:e}):null});Be.displayName="DropdownMenuContent";var Oe=forwardRef(({children:e,onClick:t,destructive:r,className:n,...o},i)=>{let a=useContext(ne);return jsx("button",{ref:i,onClick:l=>{t?.(l),a?.setIsOpen(!1);},className:u("w-full text-left px-4 py-2 text-sm hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none",r&&"text-red-600 hover:bg-red-50 hover:text-red-700 focus:bg-red-50 focus:text-red-700",n),...o,children:e})});Oe.displayName="DropdownMenuItem";var Ge=forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,className:u("-mx-1 my-1 h-px bg-border",e),...t}));Ge.displayName="DropdownMenuSeparator";var Ke=forwardRef(({children:e,className:t,...r},n)=>jsx("div",{ref:n,className:u("px-2 py-1.5 text-sm font-semibold",t),...r,children:e}));Ke.displayName="DropdownMenuLabel";var On=g(Ae),Gn=g($e),Kn=g(Be),Un=g(Oe),qn=g(Ge),_n=g(Ke);var zt=({children:e,className:t,overrideClassName:r})=>{if(e)return jsx("p",{className:r?t:u("text-sm text-muted-foreground",t),children:e})},I=g(zt);var Zt=({children:e,required:t,className:r,overrideClassName:n=!1,...o})=>jsxs("div",{className:"flex items-center gap-1",children:[jsx("label",{...o,className:n?r:u("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),children:e}),t&&jsx("span",{className:"text-red-600",children:"*"})]}),L=g(Zt);var Yt=({children:e,className:t,overrideClassName:r})=>{if(e)return jsx("p",{className:r?t:u("text-sm text-red-600 dark:text-red-400",t),children:e})},H=g(Yt);var _e=forwardRef(({label:e,required:t,option:r,orientation:n="left",className:o,overrideClassName:i=!1,helperText:a,error:s,...l},f)=>{let c=useId(),x=u("h-4 w-4 rounded border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s&&"border-destructive",o);return jsxs("div",{className:"space-y-2",children:[e&&jsx(L,{required:t,children:e}),jsxs("div",{className:`flex ${n=="left"?"flex-row":"flex-row-reverse"} w-fit gap-2`,children:[jsx("input",{id:c,type:"checkbox",className:i?o:x,ref:f,...l}),r&&jsx(L,{htmlFor:c,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r})]}),s&&jsx(H,{children:s}),!s&&a&&jsx(I,{children:a})]})});_e.displayName="CheckBox";var uo=g(_e);function or(e,t){let{typeSet:r="field",multiCheck:n=!1,value:o,onChange:i,labelKey:a,valueKey:s,options:l,alignment:f="vertical",className:c,overrideClassName:x=!1,helperText:h,error:d,label:P,name:R,required:v,...T}=e,k=useId(),y=useMemo(()=>new Map(l.map(b=>[String(b[s]),b])),[l,s]),M=useMemo(()=>o==null?[]:r==="field"?n?o.map(b=>String(b)):[String(o)]:n?o.map(b=>String(b[s])):[String(o[s])],[o,r,n,s]),S=(b,w)=>{if(!i)return;let m;if(r==="field")if(n)m=b.map(C=>{let E=y.get(C);return E?E[s]:C});else {let p=b[0];if(!p)m=void 0;else {let C=y.get(p);m=C?C[s]:p;}}else n?m=b.map(C=>y.get(C)).filter(C=>C!==void 0):m=y.get(b[0]??"")??void 0;i({target:{name:R,value:m,type:"checkboxgroup",checked:w}});},V=b=>{let w;n?w=M.includes(b)?M.filter(m=>m!==b):[...M,b]:w=M[0]===b?[]:[b],S(w,w.includes(b));},N=f==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",F=u("h-4 w-4 rounded border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",d&&"border-destructive");return jsxs("div",{className:u("flex flex-col gap-3",c),children:[P&&jsx(L,{required:v,children:P}),jsx("div",{className:N,children:l.map((b,w)=>{let m=String(b[s]),p=M.includes(m),C=`${k}-${m}-${w}`;return jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{...T,id:C,ref:t,type:"checkbox",name:R,checked:p,onChange:()=>V(m),className:x?c:F}),jsx(L,{htmlFor:C,children:String(b[a])})]},C)})}),!!d&&jsx(H,{children:String(d)}),!d&&h&&jsx(I,{children:h})]})}function ar(){let e=forwardRef(or);return e.displayName="CheckBoxGroup",e}var ir=ar(),Po=g(ir);var sr=({...e})=>jsx("svg",{...e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),oe=sr;var cr=(e,t)=>{useEffect(()=>{let r=n=>{e.current&&!e.current.contains(n.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},Xe=cr;function de({options:e,labelKey:t,valueKey:r,multiple:n,onChange:o,setSearchTerm:i,typeSet:a,name:s}){let[l,f]=useState([]),c=useMemo(()=>new Map(e.map(v=>[String(v[r]),v])),[e,r]),x=useCallback(()=>l.map(v=>c.get(v)).filter(v=>!!v),[l,c]),h=useCallback(v=>{if(!o)return;let T;if(a==="field"?n?T=v:T=v[0]??void 0:n?T=v.map(y=>c.get(y)).filter(y=>y!==void 0):T=c.get(v[0]??"")??void 0,i&&!n){let k=c.get(v[0]??"");k&&i(String(k[t]));}o({target:{name:s,value:T,type:"combobox"}});},[n,o,c,s,a,i,t]),d=useCallback(v=>{let T=String(v[r]),k=n?l.includes(T)?l.filter(y=>y!==T):[...l,T]:[T];f(k),h(k);},[n,l,h,r]),P=useCallback(v=>{let T=l.filter(k=>k!==v);f(T),h(T);},[l,h]),R=useCallback(()=>{f([]),i?.("");let v;a==="field"?v=n?[]:"":v=n?[]:void 0,o?.({target:{name:s,value:v,type:"combobox"}});},[n,o,s,i,a]);return {selectedValues:l,handleSelect:d,handleRemove:P,handleClear:R,getSelectedOptions:x}}function me(e,t,r){return useMemo(()=>r?e.filter(o=>String(o[t]).toLowerCase().includes(r.toLowerCase())):e,[e,r,t])}var je=({isOpen:e,setIsOpen:t,multiple:r,searchTerm:n,setSearchTerm:o,selectedValues:i,filteredOptions:a,highlightedIndex:s,setHighlightedIndex:l,handleSelect:f,handleRemove:c})=>{let x=useCallback(d=>{if(a.length===0){l(-1);return}l(P=>P<0?d>0?0:a.length-1:(P+d+a.length)%a.length);},[a,l]);return useCallback(d=>{if(!e){if(d.key==="Enter"||d.key==="ArrowDown"){t(!0),l(0),d.preventDefault();return}r&&d.key==="Backspace"&&n===""&&i.length>0&&(d.preventDefault(),c(i[i.length-1]));return}switch(d.key){case"ArrowDown":d.preventDefault(),x(1);break;case"ArrowUp":d.preventDefault(),x(-1);break;case"Enter":d.preventDefault();let P=s>=0?s:0,R=a[P];R&&f(R),r&&o&&o(""),r||(t(!1),l(-1));break;case"Escape":d.preventDefault(),t(!1),l(-1),r||o("");break;case"Tab":t(!1),l(-1);break;case"Home":d.preventDefault(),a.length>0&&l(0);break;case"End":d.preventDefault(),a.length>0&&l(a.length-1);break;case"Backspace":r&&n===""&&i.length>0&&(d.preventDefault(),c(i[i.length-1]));break}},[e,r,n,i,a,s,t,o,l,f,c,x])};function Ye({option:e,labelKey:t,valueKey:r,onRemove:n}){let o=String(e[t]),i=String(e[r]);return jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded",children:[o,jsx("button",{type:"button",onMouseDown:a=>a.preventDefault(),onClick:()=>n(i),className:"hover:bg-blue-200 dark:hover:bg-blue-800 rounded-full p-0.5 transition-colors","aria-label":`Remover ${o}`,children:"\u2715"})]},i)}function xr(e,t){let{label:r,required:n=!1,name:o,placeholder:i="Buscar...",labelKey:a,valueKey:s,options:l,value:f,onChange:c,mode:x="single",typeSet:h="field",disabled:d=!1,ClearEnabled:P=!0,helperText:R,error:v=!1,className:T="",...k}=e,y=x==="multiple",[M,S]=useState(!1),[V,N]=useState(""),F=useRef(null),b=useRef(null),w=useRef(null);useImperativeHandle(t,()=>w.current),Xe(b,()=>S(!1));let m=me(l,a,V),[p,C]=useState(-1),{selectedValues:E,handleSelect:z,handleRemove:xe,handleClear:Rt,getSelectedOptions:he}=de({options:l,labelKey:a,valueKey:s,value:f,multiple:y,onChange:c,typeSet:h,name:o,setSearchTerm:N}),Et=je({isOpen:M,setIsOpen:S,multiple:y,searchTerm:V,setSearchTerm:N,selectedValues:E,filteredOptions:m,highlightedIndex:p,setHighlightedIndex:C,handleSelect:z,handleRemove:xe}),X=useId(),kt="w-full bg-transparent outline-none placeholder:text-gray-500 dark:placeholder:text-gray-400 text-gray-900 dark:text-gray-100",Nt=u("relative w-full min-h-[40px] px-3 py-2 border rounded-md bg-white dark:bg-gray-800",v?"border-red-500":"border-gray-300 dark:border-gray-600",d?"opacity-50 cursor-not-allowed":"cursor-text","focus-within:ring-2 focus-within:ring-blue-500 focus-within:border-blue-500");return jsxs("div",{className:`space-y-2 ${T}`,children:[r&&jsx(L,{htmlFor:X,required:n,children:r}),jsxs("div",{ref:F,className:"relative",children:[jsxs("div",{className:Nt,children:[y&&he().length>0&&jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:he().map((D,$)=>jsx(Ye,{option:D,labelKey:a,valueKey:s,onRemove:xe},String(D[s]??$)))}),jsx("input",{ref:w,...k,name:o,type:"text",placeholder:i,value:V,onChange:D=>{let $=D.target.value;N($),!M&&$.trim()!==""&&S(!0);},onKeyDown:Et,onMouseDown:D=>{document.activeElement===w.current&&(D.preventDefault(),S($=>{let Z=!$;return Z&&C(0),Z}));},onFocus:()=>{S(!0),C(0);},disabled:d,className:kt,role:"combobox","aria-expanded":M,"aria-controls":X,"aria-activedescendant":p>=0?`${X}-opt-${p}`:void 0}),P&&!!E.length&&jsx("button",{type:"button",onMouseDown:D=>D.preventDefault(),onClick:Rt,className:"absolute right-2 top-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 p-1 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700",title:"Limpar sele\xE7\xE3o",children:jsx(oe,{width:12,height:12})})]}),M&&jsx("div",{ref:b,id:X,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":y||void 0,children:m.length===0?jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400",children:"Nenhum resultado encontrado"}):m.map((D,$)=>{let Z=String(D[s]),ie=E.includes(Z),se=$===p;return jsx("button",{id:`${X}-opt-${$}`,"data-index":$,role:"option","aria-selected":ie,type:"button",onMouseDown:Mt=>Mt.preventDefault(),onClick:()=>z(D),className:u("w-full px-3 py-2 text-left text-sm transition-colors",se&&"bg-blue-100 dark:bg-blue-800 text-blue-900 dark:text-white",!se&&ie&&"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300",!ie&&!se&&"text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),children:jsx("span",{children:String(D[a])})},Z)})})]}),v&&jsx(H,{children:v}),!v&&R&&jsx(I,{children:R})]})}function hr(){let e=forwardRef(xr);return e.displayName="ComboBox",e}var Cr=hr(),Qo=g(Cr);var yr=({children:e,before:t,after:r,className:n})=>{let i=Tr("flex justify-center items-center",{"rounded-l-lg":t,"rounded-r-lg":r},n);return jsx("div",{className:i,children:jsx("span",{children:e})})},ge=yr;var wr=({children:e})=>jsx("div",{className:"absolute px-2",children:jsx("span",{children:e})}),tt=wr;var Pr=({children:e})=>jsx("div",{className:"absolute right-0 px-2",children:jsx("span",{children:e})}),nt=Pr;function ot(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 at(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 it(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 st(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 lt(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 ct(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 dt(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 mt(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 Lr=({e,mask:t})=>{switch(t){case"money":return at(e);case"mobile":return st(e);case"phone":return lt(e);case"cpfCnpj":return ct(e);case"cpf":return it(e);case"rg":return dt(e);case"cnpj":return mt(e);case"cep":return ot(e);default:return e}},pt=Lr;var kr=({mask:e,initialValue:t=""})=>{let[r,n]=useState(t);useEffect(()=>{t!==r&&n(t);},[t]);let o=useCallback(a=>{let l=pt({e:a,mask:e})?.currentTarget?.value??a.currentTarget.value;n(l);},[e]),i=useCallback(()=>n(""),[]);return {value:r,setValue:n,handleChange:o,handleClear:i}},ft=kr;var gt=forwardRef(({label:e,required:t=!1,mask:r,name:n,prefix:o,suffix:i,addonBefore:a,addonBeforeClassName:s,addonAfter:l,addonAfterClassName:f,ClearEnabled:c=!0,className:x,overrideClassName:h=!1,error:d,helperText:P,value:R=void 0,onChange:v,...T},k)=>{let y=useId(),{handleChange:M,handleClear:S,setValue:V}=ft({mask:r,initialValue:R}),N=u("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",d&&"border-destructive focus-visible:ring-destructive",!o&&!i&&"px-3",o&&!i&&"pl-10 pr-3",i&&!o&&"pl-3 pr-10",o&&i&&"pl-10 pr-10",a&&"rounded-l-none border-l-0",l&&"rounded-r-none border-r-0",x),F=w=>{M(w),v?.(w);},b=()=>{S(),V(""),v?.({target:{name:n||"",value:""}});};return jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsx(L,{htmlFor:y,required:t,children:e}),jsxs("div",{className:"relative flex",children:[a&&jsx(ge,{before:!0,className:s,children:a}),jsxs("div",{className:"relative flex items-center w-full",children:[o&&jsx(tt,{children:o}),jsx("input",{id:y,ref:k,name:n,onChange:F,className:h?x:N,...T}),c&&R&&jsx(oe,{onClick:b,width:12,height:12,className:u("absolute right-2 cursor-pointer",i&&"right-8")}),i&&jsx(nt,{children:i})]}),l&&jsx(ge,{after:!0,className:f,children:l})]}),d&&jsx(H,{children:d}),!d&&P&&jsx(I,{children:P})]})});gt.displayName="Input";var Ra=g(gt);var vt=forwardRef(({length:e=6,groupBy:t,value:r,name:n,label:o,required:i=!1,helperText:a,error:s,onChange:l,onBlur:f,className:c,charType:x="numeric",customPattern:h,caseMode:d="none",...P},R)=>{let v=useId(),T=useRef([]),k=m=>{switch(d){case"upper":return m.toUpperCase();case"lower":case"visual-upper":return m.toLowerCase();case"visual-lower":return m.toUpperCase();default:return m}},y=m=>{if(!m)return "";let p=m.slice(0,1);switch(p=k(p),x){case"numeric":return /\d/.test(p)?p:"";case"alpha":return /[A-Za-z]/.test(p)?p:"";case"alphanumeric":return /[A-Za-z0-9]/.test(p)?p:"";case"custom":return h?.test(p)?p:"";default:return p}},M=()=>(r!=null?String(r):"").split("").map(y).slice(0,e),S=M().concat(Array(e).fill(" ")).slice(0,e),V=m=>{let p=m.split("").map(y).join("").slice(0,e),C=p===""?void 0:typeof r=="number"?Number(p):p;l?.({target:{name:n,value:C}});},N=(m,p)=>{let C=y(p),E=M();if(C===""){E[m]="",V(E.join(""));return}if(p.length>1){let z=p.split("").map(y).join("").slice(0,e);V(z),T.current[Math.min(z.length-1,e-1)]?.focus();return}C&&(E[m]=C,V(E.join("")),m<e-1&&T.current[m+1]?.focus());},F=m=>{let p=M();!p[m]&&m>0?p[m-1]="":p[m]="",V(p.join("")),m>0&&T.current[m-1]?.focus();},b=m=>{m.preventDefault();let C=m.clipboardData.getData("text").split("").map(y).join("").slice(0,e);C&&(V(C),T.current[Math.min(C.length-1,e-1)]?.focus());},w=m=>{switch(d){case"upper":case"visual-upper":return m.toUpperCase();case"lower":case"visual-lower":return m.toLowerCase();default:return m}};return jsxs("div",{className:"flex flex-col gap-2 w-full",children:[o&&jsx(L,{htmlFor:v,required:i,children:o}),jsx("div",{className:u("flex gap-3 items-center",s&&"text-red-500",c),...P,children:S.map((m,p)=>{let C=t&&p>0&&p%t===0;return jsxs(Ut.Fragment,{children:[C&&jsx("span",{className:"flex items-center justify-center text-xl font-bold select-none",children:"-"}),jsx("input",{id:v,type:"text",maxLength:1,inputMode:x==="numeric"?"numeric":"text",value:w(m).trim(),ref:E=>{T.current[p]=E,p===0&&R&&(typeof R=="function"?R(E):typeof R=="object"&&(R.current=E));},onPaste:b,onChange:E=>N(p,E.target.value),onKeyDown:E=>E.key==="Backspace"&&F(p),onBlur:f,className:u("h-14 w-12 text-center text-2xl rounded-md border border-input bg-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s&&"border-red-500")})]},p)})}),s&&jsx(H,{children:s}),!s&&a&&jsx(I,{children:a})]})});vt.displayName="OtpInput";var Sa=g(vt);var ht=forwardRef(({label:e,required:t,option:r,className:n,overrideClassName:o,helperText:i,error:a,...s},l)=>{let f=useId(),c=u("h-4 w-4 border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a&&"border-destructive",n);return jsxs("div",{className:"space-y-3",children:[e&&jsx(L,{required:t,children:e}),jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{id:f,type:"radio",className:o?n:c,ref:l,...s}),r&&jsx(L,{htmlFor:f,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r})]}),a&&jsx(H,{children:a}),!a&&i&&jsx(I,{children:i})]})});ht.displayName="Radio";var qa=g(ht);function Br(e,t){let{label:r,required:n,name:o,labelKey:i,valueKey:a,options:s,alignment:l="vertical",className:f,overrideClassName:c=!1,helperText:x,error:h,typeSet:d="field",value:P,onChange:R,...v}=e,T=useId(),k=useMemo(()=>new Map(s.map(N=>[String(N[a]),N])),[s,a]),y=useMemo(()=>P==null?"":String(d==="field"?P:P[a]),[P,d,a]),M=N=>{if(!R)return;let F;if(d==="field"){let b=k.get(N);if(b)F=b[a];else {let w=Number(N);F=Number.isNaN(w)?N:w;}}else F=k.get(N)??void 0;R({target:{name:o,value:F,type:"radiogroup",checked:!0}});},S=l==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",V=u("h-4 w-4 rounded-full border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",h&&"border-destructive");return jsxs("div",{className:u("flex flex-col gap-3",f),children:[r&&jsx(L,{required:n,children:r}),jsx("div",{className:S,children:s.map((N,F)=>{let b=String(N[a]),w=`${T}-${b}-${F}`;return jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{...v,id:w,ref:t,name:o,type:"radio",checked:y===b,onChange:()=>M(b),className:c?f:V}),jsx(L,{htmlFor:w,children:String(N[i])})]},w)})}),h&&jsx(H,{children:String(h)}),!h&&x&&jsx(I,{children:x})]})}function Or(){let e=forwardRef(Br);return e.displayName="RadioGroup",e}var Gr=Or(),ti=g(Gr);function qr({label:e,required:t=!1,options:r,labelKey:n,valueKey:o,placeholder:i,error:a,helperText:s,className:l,...f},c){let x=useId(),h=u("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",l);return jsxs("div",{className:"space-y-2",children:[e&&jsx(L,{htmlFor:x,required:t,children:e}),jsxs("select",{id:x,ref:c,className:h,...f,children:[i&&jsx("option",{value:"",disabled:!0,children:i}),r.map((d,P)=>jsx("option",{value:String(d[o]),children:String(d[n])},P))]}),a&&jsx(H,{children:a}),!a&&s&&jsx(I,{children:s})]})}function _r(){let e=forwardRef(qr);return e.displayName="Select",e}var Wr=_r(),pi=g(Wr);var Pt=forwardRef(({label:e,description:t,checked:r=!1,className:n,overrideClassName:o,error:i,name:a,...s},l)=>{let f=useId();return jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",id:f,name:a,checked:r,className:"peer sr-only",ref:l,...s}),jsx("label",{htmlFor:f,className:u("relative flex items-center h-6 w-11 cursor-pointer rounded-full bg-input transition-colors duration-200","peer-checked:bg-primary peer-focus:ring-2 peer-focus:ring-ring peer-focus:ring-offset-2 peer-focus:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50",n),children:jsx("span",{className:u("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",r?"translate-x-5":"translate-x-1")})}),(e||t)&&jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[e&&jsx(L,{id:`${f}-label`,htmlFor:f,className:"text-sm font-medium leading-none",children:e}),t&&jsx(L,{id:`${f}-description`,htmlFor:f,className:"text-xs text-muted-foreground",children:t})]})]})});Pt.displayName="Switch";var Ci=g(Pt);var Lt=Ut.forwardRef(({label:e,required:t,showCount:r,maxLength:n,className:o,overrideClassName:i=!1,error:a,helperText:s,...l},f)=>{let c=useId(),[x,h]=useState(0),d=u("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",o);return jsxs("div",{className:"space-y-2",children:[e&&jsx(L,{htmlFor:c,required:t,children:e}),jsxs("div",{className:"relative",children:[jsx("textarea",{id:c,className:i?o:d,maxLength:n,onInput:P=>h(P.currentTarget.textLength),ref:f,...l}),r&&jsxs("span",{className:"absolute bottom-2 right-3 text-xs text-muted-foreground",children:[x,n?` / ${n}`:""]})]}),a&&jsx(H,{children:a}),!a&&s&&jsx(I,{children:s})]})});Lt.displayName="Textarea";var Ni=g(Lt);
|
|
7
10
|
|
|
8
|
-
export {
|
|
11
|
+
export { pn as AccordionPrimitive, Tn as ButtonPrimitive, Hn as CardContentPrimitive, In as CardDescriptionPrimitive, Vn as CardFooterPrimitive, Nn as CardHeaderPrimitive, kn as CardPrimitive, Mn as CardTitlePrimitive, Po as CheckBoxGroupPrimitive, uo as CheckBoxPrimitive, Qo as ComboBoxPrimitive, Kn as DropdownMenuContentPrimitive, Un as DropdownMenuItemPrimitive, _n as DropdownMenuLabelPrimitive, On as DropdownMenuPrimitive, qn as DropdownMenuSeparatorPrimitive, Gn as DropdownMenuTriggerPrimitive, I as HelperFieldPrimitive, Ra as InputPrimitive, L as LabelPrimitive, St as LicenseProvider, Sa as OtpInputPrimitive, ti as RadioGroupPrimitive, qa as RadioPrimitive, pi as SelectPrimitive, Ci as SwitchPrimitive, Ni as TextareaPrimitive, H as ValidateFieldPrimitive };
|