@zydon/common 2.5.11 → 2.5.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/dist/chunk-2FXBVVBD.js +7 -0
  2. package/dist/chunk-2FXXN6VA.js +8 -0
  3. package/dist/chunk-2QUYG4AQ.js +8 -0
  4. package/dist/chunk-427TWOPH.js +10 -0
  5. package/dist/chunk-6O66AMF6.js +17 -0
  6. package/dist/{chunk-4VAXJ4XM.js → chunk-7WCRRQEW.js} +2 -2
  7. package/dist/{chunk-HZJAUQ3O.js → chunk-AJW3AGOS.js} +1 -1
  8. package/dist/chunk-DXACBPEV.js +9 -0
  9. package/dist/chunk-GJGUIHOL.js +17 -0
  10. package/dist/{chunk-DI3IT446.js → chunk-GVJPNJEL.js} +1 -1
  11. package/dist/{chunk-E4HZJEPW.js → chunk-MZ5WXXHN.js} +1 -1
  12. package/dist/chunk-NV2X5CYP.js +7 -0
  13. package/dist/{chunk-B3PCCRUQ.js → chunk-OYK7T66A.js} +2 -2
  14. package/dist/{chunk-FOOP2WUM.js → chunk-PBNDY7OR.js} +1 -1
  15. package/dist/{chunk-2NMLQNWC.js → chunk-TF3JCVT7.js} +1 -1
  16. package/dist/{chunk-JEAVENIM.js → chunk-X6R4YXWP.js} +1 -1
  17. package/dist/components/Autocomplete/index.js +1 -1
  18. package/dist/components/AutocompleteDetailed/index.js +1 -1
  19. package/dist/components/ColorPickerInput/index.js +1 -1
  20. package/dist/components/DataCards/index.js +1 -1
  21. package/dist/components/DataGrid/index.js +2 -2
  22. package/dist/components/DataView/index.js +3 -3
  23. package/dist/components/DatePicker/index.d.ts +2 -1
  24. package/dist/components/DatePicker/index.js +3 -3
  25. package/dist/components/DateRangeCalendar/index.d.ts +12 -0
  26. package/dist/components/DateRangeCalendar/index.js +7 -0
  27. package/dist/components/DateRangePicker/index.d.ts +2 -1
  28. package/dist/components/DateRangePicker/index.js +2 -2
  29. package/dist/components/DateTimePicker/index.d.ts +2 -1
  30. package/dist/components/DateTimePicker/index.js +3 -3
  31. package/dist/components/DragButton/index.js +1 -1
  32. package/dist/components/DragContainer/index.js +3 -3
  33. package/dist/components/FileUpload/index.js +6 -6
  34. package/dist/components/Incrementer/index.js +2 -2
  35. package/dist/components/InfoCircle/index.js +1 -1
  36. package/dist/components/MaskedInput/index.js +1 -1
  37. package/dist/components/NumberInput/index.js +1 -1
  38. package/dist/components/SearchInput/index.js +1 -1
  39. package/dist/components/SelectableCards/index.js +2 -2
  40. package/dist/components/SwapList/index.js +1 -1
  41. package/dist/components/TimePicker/index.d.ts +2 -1
  42. package/dist/components/TimePicker/index.js +2 -2
  43. package/dist/components/Tooltip/index.d.ts +1 -1
  44. package/dist/components/Tooltip/index.js +1 -1
  45. package/dist/components/form/Address/index.js +5 -5
  46. package/dist/components/form/Autocomplete/index.js +2 -2
  47. package/dist/components/form/AutocompleteDetailed/index.js +1 -1
  48. package/dist/components/form/Codes/index.js +2 -2
  49. package/dist/components/form/ColorPicker/index.js +1 -1
  50. package/dist/components/form/DatePicker/index.js +3 -3
  51. package/dist/components/form/DateRangePicker/index.js +5 -5
  52. package/dist/components/form/DateTimePicker/index.js +3 -3
  53. package/dist/components/form/Field/index.js +1 -1
  54. package/dist/components/form/Incrementer/index.js +2 -2
  55. package/dist/components/form/InputTags/index.js +4 -4
  56. package/dist/components/form/MaskedInput/index.js +2 -2
  57. package/dist/components/form/MultiChipField/index.js +4 -4
  58. package/dist/components/form/NumberInput/index.js +1 -1
  59. package/dist/components/form/Password/index.js +1 -1
  60. package/dist/components/form/SelectableCards/index.js +2 -2
  61. package/dist/components/form/TimePicker/index.js +2 -2
  62. package/dist/components/form/UploadAvatarWithCrop/index.js +3 -3
  63. package/dist/components/form/UploadWithCrop/index.js +4 -4
  64. package/dist/components/form/Webhook/index.js +3 -3
  65. package/dist/components/upload/index.js +6 -6
  66. package/dist/theme/styles/index.d.ts +1 -1
  67. package/package.json +1 -1
  68. package/dist/chunk-5J3V35EQ.js +0 -10
  69. package/dist/chunk-7BK54YIS.js +0 -8
  70. package/dist/chunk-7F56LFN2.js +0 -17
  71. package/dist/chunk-B42VMENU.js +0 -9
  72. package/dist/chunk-IPOTBSM7.js +0 -6
  73. package/dist/chunk-LLMDC6IE.js +0 -17
  74. package/dist/chunk-ORLVNXTG.js +0 -8
  75. package/dist/chunk-YNOYR4WX.js +0 -7
  76. package/dist/{chunk-JTD47UZZ.js → chunk-TQKNFH6W.js} +1 -1
@@ -1,12 +1,12 @@
1
1
  import { a as a$4 } from '../../chunk-H5L4ARDB.js';
2
- import { e } from '../../chunk-ANAHA3L6.js';
3
- import { a as a$3 } from '../../chunk-IPOTBSM7.js';
4
- import { a } from '../../chunk-YXH2ZKVS.js';
5
- import { f } from '../../chunk-EUL6EPCK.js';
2
+ import { a as a$3 } from '../../chunk-2FXBVVBD.js';
6
3
  import { a as a$5 } from '../../chunk-COTMNI3C.js';
7
4
  import '../../chunk-7TFD7ZIP.js';
8
5
  import '../../chunk-5NOG7L7I.js';
9
- import { a as a$2 } from '../../chunk-B42VMENU.js';
6
+ import { e } from '../../chunk-ANAHA3L6.js';
7
+ import { a } from '../../chunk-YXH2ZKVS.js';
8
+ import { f } from '../../chunk-EUL6EPCK.js';
9
+ import { a as a$2 } from '../../chunk-DXACBPEV.js';
10
10
  import { x } from '../../chunk-2P4CXK3O.js';
11
11
  import { a as a$7 } from '../../chunk-FK7DDO5L.js';
12
12
  import { j as j$1 } from '../../chunk-DMQW3LDF.js';
@@ -32,6 +32,6 @@ import Mo from '@mui/material/Badge';
32
32
  import { useDropzone } from 'react-dropzone';
33
33
  import at from '@mui/material/CircularProgress';
34
34
 
35
- var Ro=({helperText:e,disabled:o,isError:r})=>e?jsx(So,{error:r,sx:i=>({mx:"14px",color:o?i.palette.grey[500]:void 0}),children:e}):null,j=memo(Ro);var Se=styled(le)({position:"relative",width:"100%",borderRadius:8,overflow:"hidden","&:hover .actions":{display:"flex"}}),Re=styled(le)({position:"absolute",top:4,right:4,gap:.5,"& svg":{width:16,height:16}}),Xe=styled(Pe,{shouldForwardProp:e=>!["isDragActive","isError","disabled"].includes(e)})(({theme:e,isDragActive:o,isError:r,disabled:i})=>({outline:"none",cursor:"pointer",overflow:"hidden",position:"relative",padding:e.spacing(5),borderRadius:e.shape.borderRadius,transition:e.transitions.create("padding"),backgroundColor:e.palette.background.neutral,border:`1px dashed ${alpha(e.palette.grey[500],.32)}`,...o&&{opacity:.72},...r&&{color:e.palette.error.main,backgroundColor:e.palette.error.lighter,borderColor:e.palette.error.light},...i&&{opacity:.48,pointerEvents:"none"},"&:hover":{opacity:.72}}));styled(le)(({theme:e})=>({display:"none",position:"absolute",alignItems:"center",justifyContent:"center",flexDirection:"row",gap:12,width:"100%",height:"100%",backgroundColor:alpha(e.palette.primary.main,.9),zIndex:999,button:{"&, &:hover, &:focus":{backgroundColor:"#fff"}}}));var qe=styled(_o)(({theme:e})=>({position:"relative",zIndex:999,pointerEvents:"auto",color:e.palette.grey[700],backgroundColor:e.palette.grey[100],"&:hover":{color:e.palette.grey[900],backgroundColor:e.palette.grey[300]}})),Me=styled("div")({position:"relative",zIndex:1,"&:hover":{zIndex:2}}),Ve=styled(le,{shouldForwardProp:e=>!["isDragging"].includes(e)})(({theme:e,width:o,isDragging:r})=>({width:o,height:100,alignItems:"center",display:"inline-flex",justifyContent:"center",margin:e.spacing(.5),padding:e.spacing(2,1,2,1),gap:e.spacing(1),borderRadius:e.spacing(1.25),overflow:"hidden",position:"relative",border:`solid 1px ${e.palette.divider}`,backgroundColor:e.palette.common.white,zIndex:1,transition:"box-shadow 150ms ease-in-out",boxShadow:r?`0 0 0 2px ${e.palette.primary.main}, ${e.customShadows.z8}, inset 0 0 0 1000px ${alpha(e.palette.primary.main,.06)}`:"0px 0px 0px 0px rgba(0, 0, 0, 0)"})),Ke=styled(m.div)(({theme:e,width:o,isDragging:r})=>({width:o,height:60,alignItems:"center",display:"inline-flex",justifyContent:"center",margin:e.spacing(.5),padding:e.spacing(2),borderRadius:e.spacing(1.25),overflow:"hidden",position:"relative",border:`solid 1px ${e.palette.divider}`,backgroundColor:e.palette.common.white,zIndex:1,transition:"box-shadow 150ms ease-in-out",boxShadow:r?`0 0 0 2px ${e.palette.primary.main}, ${e.customShadows.z8}, inset 0 0 0 1000px ${alpha(e.palette.primary.main,.06)}`:"0px 0px 0px 0px rgba(0, 0, 0, 0)"})),Je=styled(a)(({theme:e})=>({top:16,right:16,zIndex:9,position:"absolute",color:e.palette.common.white,backgroundColor:alpha(e.palette.grey[900],.72),"&:hover":{backgroundColor:alpha(e.palette.grey[900],.48)}})),Qe=styled(Pe,{shouldForwardProp:e=>e!=="isDragActive"&&e!=="disabled"&&e!=="hasError"})(({theme:e,isDragActive:o,disabled:r,hasError:i})=>({width:64,height:64,flexShrink:0,display:"flex",borderRadius:1,cursor:"pointer",alignItems:"center",color:e.palette.text.disabled,justifyContent:"center",backgroundColor:alpha(e.palette.grey[500],.08),border:`dashed 1px ${alpha(e.palette.grey[500],.16)}`,...o&&{opacity:.72},...r&&{opacity:.48,pointerEvents:"none"},...i&&{color:e.palette.error.main,borderColor:e.palette.error.main,backgroundColor:alpha(e.palette.error.main,.08)},"&:hover":{opacity:.72}})),Ye=styled(Pe)(({theme:e})=>({padding:e.spacing(1),top:0,left:0,width:"100%",height:"100%",position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",transition:"all 0.3s ease-in-out",filter:"blur(0)","&:hover":{filter:"blur(3px)"}})),eo=styled("img",{shouldForwardProp:e=>e!=="aspectRatio"&&e!=="isLoading"&&e!=="isUploading"&&e!=="maxWidth"&&e!=="maxHeight"&&e!=="cropSize"})(({theme:e,aspectRatio:o,maxWidth:r,maxHeight:i,isLoading:t,isUploading:m})=>({borderRadius:e.shape.borderRadius,objectFit:"cover",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%) scale(1)",filter:"blur(0)",zIndex:1,maxWidth:r,maxHeight:i,backgroundColor:e.palette.background.paper,width:o>1?"calc(100% - 16px)":void 0,height:o>1?void 0:"calc(100% - 16px)",aspectRatio:o,transition:"all 0.5s ease-in-out",...t||m?{opacity:0,filter:"blur(1.5rem)",transform:"translate(-50%, -50%) scale(0.7)"}:{},"&:hover":{transition:"all 0.2s ease-in-out"}})),oo=styled("img",{shouldForwardProp:e=>e!=="isLoading"&&e!=="isUploading"})(({isLoading:e,isUploading:o})=>({width:"100%",height:"100%",objectFit:"cover",top:0,left:0,filter:"blur(1.5rem)",transform:"scale(1.1)",position:"absolute",zIndex:0,transition:"opacity 0.3s ease-in-out",...e&&{opacity:0},...o&&{opacity:.7,filter:"blur(2rem)"}})),ro=styled(le)({width:"100%",height:"100%",position:"relative",overflow:"hidden",borderRadius:"50%",justifyContent:"center",alignItems:"center"});styled(Oo)(({theme:e})=>({py:1,px:2,mt:3,textAlign:"left",borderStyle:"dashed",borderColor:"error.main",backgroundColor:alpha(e.palette.error.main,.08)}));var Te=styled(Pe,{shouldForwardProp:e=>e!=="isError"&&e!=="hasFile"})(({theme:e,isError:o,hasFile:r})=>({top:0,gap:e.spacing(1),left:0,width:"100%",height:"100%",zIndex:9,display:"flex",borderRadius:"50%",position:"absolute",alignItems:"center",color:e.palette.text.disabled,flexDirection:"column",justifyContent:"center",backgroundColor:alpha(e.palette.grey[500],.08),transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.shorter}),"&:hover":{opacity:.92},...o&&{color:e.palette.error.main},...r&&{zIndex:9,opacity:0,color:e.palette.common.white,backgroundColor:alpha(e.palette.common.black,.54)}})),to=styled(le)({top:0,left:0,right:0,bottom:0,position:"absolute",zIndex:10,alignItems:"center",justifyContent:"center",opacity:.8});styled(le)(({theme:e})=>({padding:20,justifyContent:"center",alignItems:"center",gap:4,alignSelf:"stretch",borderRadius:12,background:e.palette.grey[200],color:e.palette.text.disabled,height:160}));var io=styled(Pe,{shouldForwardProp:e=>e!=="isDragActive"&&e!=="isError"&&e!=="hasFile"})(({theme:e,isDragActive:o,disabled:r,isError:i,hasFile:t})=>({padding:e.spacing(1),margin:"auto",width:144,height:144,cursor:"pointer",overflow:"hidden",borderRadius:"50%",border:`1px dashed ${alpha(e.palette.grey[500],.2)}`,...o&&{opacity:.72},...r&&{opacity:.48,pointerEvents:"none"},...i&&{borderColor:"error.main"},...t&&{...i&&{bgcolor:alpha(e.palette.error.main,.08)},"&:hover .upload-placeholder":{opacity:1},"& img":{filter:"blur(0)"},"&:hover img":{filter:"blur(3px)"}}})),ao=styled("img")({width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover",transition:"all 0.3s ease-in-out"}),no=styled(a)(({theme:e})=>({backgroundColor:alpha(e.palette.grey[900],.72),color:e.palette.common.white,"&:hover":{backgroundColor:alpha(e.palette.grey[600],.64),color:e.palette.common.white},"& svg":{width:14,height:14}}));var To=({onRemove:e,sx:o,file:r,disableDrag:i,attributes:t,listeners:m,innerWidth:s,isDragging:p})=>{let d=r?.id||r?.url;return d?jsx(Mo,{anchorOrigin:{vertical:"top",horizontal:"left"},children:jsxs(Ke,{width:s,isDragging:p,"data-testid":`preview-multi-img-${d}`,...j$1().inUp,sx:o,children:[jsx(a$2,{disableDrag:i,...t,...m}),jsx(f,{tooltip:!0,imageView:!0,file:r}),jsx(Re,{sx:{position:"absolute",right:3,top:3,zIndex:1},children:e&&jsx(no,{size:"small",label:"Remover arquivo",onClick:()=>e(r),icon:"DELETE_MARK_BUTTON_02"})})]})},`badge-${d}`):null},so=memo(To);var Bo=({file:e$1,thumbnail:o,onRemove:r,sx:i,disableDrag:t=!1})=>{let m=e$1?.size||0,s=e$1?.name||e$1?.id||e$1?.url,p=e$1?.id||e$1?.url||e$1?.name||e$1?.index?.toString()||"",d=typeof e$1=="string",n=t?70:80,{attributes:g,listeners:f$1,setNodeRef:E,transform:u,transition:I,isDragging:O}=useSortable({id:p,disabled:t}),x$1={transform:x.Transform.toString(u),transition:I,display:"inline-block",alignItems:"center",justifyContent:"center",width:`${n+8}px`,height:"68px"};return o&&e$1?jsx(Me,{ref:E,style:x$1,children:jsx(so,{innerWidth:n,isDragging:O,sx:i,file:e$1,disableDrag:t,attributes:g,listeners:f$1,onRemove:r})}):jsx(Me,{ref:E,style:{...x$1,height:"80px",width:`${n+38}px`},children:jsxs(Ve,{width:n+30,isDragging:O,"data-testid":`preview-multi-img-${p}`,...j$1().inUp,sx:i,children:[jsx(a$2,{disableDrag:t,...g,...f$1}),e$1&&jsx(f,{file:e$1}),jsxs(le,{flexGrow:1,sx:{width:"100%"},children:[jsx(a$3,{title:s,children:jsx(ke,{variant:"subtitle2",noWrap:!0,children:s})}),jsx(ke,{variant:"caption",sx:{color:"text.secondary"},children:d?"":e(m)})]}),jsx(Re,{children:r&&jsx(a,{size:"small",label:"Remover arquivo",onClick:()=>r(e$1),icon:"DELETE_MARK_BUTTON_02"})})]})})},mo=memo(Bo);var or=({thumbnail:e,files:o,onRemove:r,onReorder:i,sx:t})=>{let m=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates})),s=useCallback(d=>{let{active:n,over:g}=d;if(!(!n||!g||n.id===g.id)&&i){let f=o.findIndex(({id:u})=>u===n.id),E=o.findIndex(({id:u})=>u===g.id);f!==-1&&E!==-1&&i(f,E,o);}},[o,i]),p=jsx(AnimatePresence,{initial:!1,children:o.map(d=>jsx(mo,{sx:t,id:`preview-file-${d.id}`,file:d,onRemove:r,thumbnail:e,disableDrag:!i},`preview-file-${d.id}`))});return i?jsx(DndContext,{sensors:m,collisionDetection:closestCenter,onDragEnd:s,modifiers:[restrictToHorizontalAxis,restrictToParentElement,restrictToWindowEdges],children:jsx(SortableContext,{items:o.map(d=>d.id),strategy:horizontalListSortingStrategy,children:p})}):p},Ie=memo(or);var go=forwardRef(({onLoading:e,aspectRatio:o,cropSize:r,...i},t)=>{let{maxWidth:m,maxHeight:s}=useMemo(()=>r&&typeof r=="object"?{maxWidth:r.width,maxHeight:r.height}:r&&typeof r=="number"?{maxWidth:r,maxHeight:r}:{maxWidth:"100%",maxHeight:"100%"},[r]);a$1(()=>{e?.(!0);}),useLayoutEffect(()=>{typeof t=="object"&&t?.current?e?.(!t.current.complete):e?.(!1);},[t,e]);function p(){e?.(!1);}return jsx(eo,{...i,maxWidth:m,maxHeight:s,ref:t,aspectRatio:o,onLoad:p,onError:p})});go.displayName="LoadingPreviewImage";var uo=go;var lr=({file:e,aspectRatio:o=1,isUploading:r,isLoading:i,onLoading:t,cropSize:m,maxWidth:s,maxHeight:p})=>{let d=useRef(null),n=e?.id||e?.url||e?.name,g=e?.name||e?.url||e?.id,f=URL.createObjectURL(e)||e?.url;return n?jsxs(Ye,{className:"single-file-preview-box",children:[jsx(uo,{className:"single-file-preview-img",aspectRatio:o,cropSize:m,isLoading:i,isUploading:r,alt:g,src:f,ref:d,loading:"lazy",onLoading:t,onLoad:()=>t?.(!1),onError:()=>t?.(!1),maxWidth:s,maxHeight:p},`image-preview-${n}`),jsx(oo,{className:"single-file-preview-bg",alt:g,src:f,isLoading:i,isUploading:r})]}):null},Ce=memo(lr);var hi=e=>e.startsWith("image/"),xo=(e,o=.8)=>new Promise((r,i)=>{let t=document.createElement("canvas"),m=t.getContext("2d"),s=new Image;s.onload=()=>{t.width=s.width,t.height=s.height,m?(m.drawImage(s,0,0),t.toBlob(p=>{if(p){let d=new File([p],e.name.replace(/\.[^/.]+$/,".webp"),{type:"image/webp",lastModified:Date.now()});r(d);}else i(new Error("Falha ao converter para WebP"));},"image/webp",o)):i(new Error("N\xE3o foi poss\xEDvel obter contexto do canvas"));},s.onerror=()=>i(new Error("Falha ao carregar imagem")),s.src=URL.createObjectURL(e);});var gr=({onFilesSelect:e$1,onFileSelect:o,onReorder:r,onRemove:i,filesPreview:t,dropzoneOptions:m,enableCrop:s=!1,customAspectRatio:p,convertToWebp:d=!0,cropSize:n,maxFiles:g})=>{let{showErrorMessage:f}=a$8(),E=useMemo(()=>p||(n&&typeof n!="number"?n.width/n.height:1),[p,n]),[u,I]=useState([]),[O,x]=useState(!1),[h,y]=useState(null),[P,D]=useState(null),[l,F]=useState(""),[S,A]=useState(!1),[b,M]=useState([]),[R,C]=useState(0),[z,q]=useState(0),Y=c=>{if(c.length<1)return;let v=c[0];y(v),C(_=>_+1);let L=new FileReader;L.onload=()=>{F(L.result),x(!0);},L.readAsDataURL(v);},ie=(c,v)=>{D(v);},ae=async()=>!h||!P?null:new Promise(c=>{let v=document.createElement("canvas"),L=v.getContext("2d"),_=new Image;_.onload=async()=>{let{width:T,height:he,x:Ao,y:wo}=P,ve=T,Ee=he;n&&(typeof n=="number"?(ve=n,Ee=n/E):(ve=n.width,Ee=n.height)),v.width=ve,v.height=Ee,L?(L.drawImage(_,Ao,wo,T,he,0,0,ve,Ee),v.toBlob(async je=>{if(je){let Ue=new File([je],h.name,{type:h.type,lastModified:Date.now()});if(d)try{Ue=await xo(Ue);}catch(Do){f(Do,"Erro ao converter para WebP");}c(Ue);}else c(null);},"image/png")):c(null);},_.src=l;}),ne=async()=>{if(!(!h||!P)){A(!0);try{let c=await ae();c&&e$1?e$1([c],I):c&&o&&o(c,I),x(!1),A(!1),F(""),y(null);let v=b.slice(1);M(v),Y(v);}catch(c){f(c,"Erro ao processar imagem");}}},N=()=>{x(!1),A(!1),F(""),y(null),M([]),C(0),q(0);},$=c=>{if(c.length===0)return;let v=Object.keys(m?.accept||{}).some(_=>_.includes("image/")),L=u.length+c.length;if(g&&L>g){f(new Error(`M\xE1ximo de ${g} arquivos`),"Erro ao fazer upload");return}if(v&&s){let _=c.filter(T=>T.type.startsWith("image/"));q(_.length),C(0),M(_),Y(_);}else if(e$1)e$1(c,I);else if(o){let _=c[0];o(_,I);}},k=c=>{if(!c.length)return;let v=c[0]?.errors[0]?.code,L=m?.maxSize||3145728;b.length,v==="file-too-large"?f(new Error(`O arquivo excede o tamanho m\xE1ximo de ${e(L)}`),"Erro ao fazer upload"):v==="file-invalid-type"?f(new Error("Formato de arquivo n\xE3o suportado"),"Erro ao fainternalFiles.length > 0zer upload"):f(c[0]?.errors[0]||new Error("Erro ao enviar arquivo"),"Erro ao fazer upload");},{getRootProps:B,getInputProps:V,isDragActive:ee,isDragReject:G,fileRejections:W}=useDropzone({onDrop:$,onDropRejected:k,...m}),K=c=>{if(!c){I([]),i?.(void 0);return}if(e$1){let v=u.filter(L=>L.id!==c.id);I(v),i?.(c);}else I([]),i?.(c);},a=(c,v,L)=>{I(_=>{let T=[..._],[he]=T.splice(c,1);return T.splice(v,0,he),r?.(c,v,L),T});};return useEffect(()=>{let c=t||[];I(v=>{let L=JSON.stringify(v?.map(T=>T.id||T.name)),_=JSON.stringify(c?.map(T=>T.id||T.name));return L===_?v:c});},[t]),{file:u?.[0],files:u,aspectRatio:E,dropzoneProps:{getRootProps:B,getInputProps:V,isDragActive:ee,isDragReject:G,fileRejections:W},cropState:{cropModalOpen:O,imagePreview:l,cropLoading:S,setCropModalOpen:x,onCropInitialized:ie,handleCropSave:ne,handleCropCancel:N,currentImageIndex:R,totalPendingImages:z},setInitialFiles:I,handleRemove:K,handleReorder:a}},Z=gr;var ze=(a=>(a.APPLICATION_OCTET_STREAM="application/octet-stream",a.IMAGE_JPEG="image/jpeg",a.IMAGE_JPG="image/jpg",a.IMAGE_PNG="image/png",a.IMAGE_GIF="image/gif",a.IMAGE_WEBP="image/webp",a.IMAGE_SVG="image/svg+xml",a.IMAGE_BMP="image/bmp",a.IMAGE_TIFF="image/tiff",a.IMAGE_ICO="image/x-icon",a.IMAGE_AVIF="image/avif",a.APPLICATION_PDF="application/pdf",a.TEXT_PLAIN="text/plain",a.TEXT_CSV="text/csv",a.APPLICATION_RTF="application/rtf",a.APPLICATION_MSWORD="application/msword",a.APPLICATION_DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",a.APPLICATION_MSEXCEL="application/vnd.ms-excel",a.APPLICATION_XLSX="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",a.APPLICATION_MSPOWERPOINT="application/vnd.ms-powerpoint",a.APPLICATION_PPTX="application/vnd.openxmlformats-officedocument.presentationml.presentation",a.APPLICATION_ODT="application/vnd.oasis.opendocument.text",a.APPLICATION_ODS="application/vnd.oasis.opendocument.spreadsheet",a.APPLICATION_ODP="application/vnd.oasis.opendocument.presentation",a.APPLICATION_XML="application/xml",a.TEXT_XML="text/xml",a.TEXT_HTML="text/html",a.TEXT_CSS="text/css",a.APPLICATION_JSON="application/json",a.TEXT_JAVASCRIPT="text/javascript",a.APPLICATION_ZIP="application/zip",a.APPLICATION_GZIP="application/gzip",a.APPLICATION_RAR="application/vnd.rar",a.APPLICATION_7Z="application/x-7z-compressed",a.AUDIO_MPEG="audio/mpeg",a.AUDIO_WAV="audio/wav",a.AUDIO_OGG="audio/ogg",a.AUDIO_WEBM="audio/webm",a.AUDIO_AAC="audio/aac",a.VIDEO_MP4="video/mp4",a.VIDEO_MPEG="video/mpeg",a.VIDEO_OGG="video/ogg",a.VIDEO_WEBM="video/webm",a.VIDEO_QUICKTIME="video/quicktime",a))(ze||{}),_e=(e=>(e["application/octet-stream"]="APPLICATION_OCTET_STREAM",e["image/jpeg"]="IMAGE_JPEG",e["image/jpg"]="IMAGE_JPG",e["image/png"]="IMAGE_PNG",e["image/gif"]="IMAGE_GIF",e["image/webp"]="IMAGE_WEBP",e["image/svg+xml"]="IMAGE_SVG",e["image/bmp"]="IMAGE_BMP",e["image/tiff"]="IMAGE_TIFF",e["image/x-icon"]="IMAGE_ICO",e["image/avif"]="IMAGE_AVIF",e["application/pdf"]="APPLICATION_PDF",e["text/plain"]="TEXT_PLAIN",e["text/csv"]="TEXT_CSV",e["application/rtf"]="APPLICATION_RTF",e["application/msword"]="APPLICATION_MSWORD",e["application/vnd.openxmlformats-officedocument.wordprocessingml.document"]="APPLICATION_DOCX",e["application/vnd.ms-excel"]="APPLICATION_MSEXCEL",e["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]="APPLICATION_XLSX",e["application/vnd.ms-powerpoint"]="APPLICATION_MSPOWERPOINT",e["application/vnd.openxmlformats-officedocument.presentationml.presentation"]="APPLICATION_PPTX",e["application/vnd.oasis.opendocument.text"]="APPLICATION_ODT",e["application/vnd.oasis.opendocument.spreadsheet"]="APPLICATION_ODS",e["application/vnd.oasis.opendocument.presentation"]="APPLICATION_ODP",e["application/xml"]="APPLICATION_XML",e["text/xml"]="TEXT_XML",e["text/html"]="TEXT_HTML",e["text/css"]="TEXT_CSS",e["application/json"]="APPLICATION_JSON",e["text/javascript"]="TEXT_JAVASCRIPT",e["application/zip"]="APPLICATION_ZIP",e["application/gzip"]="APPLICATION_GZIP",e["application/vnd.rar"]="APPLICATION_RAR",e["application/x-7z-compressed"]="APPLICATION_7Z",e["audio/mpeg"]="AUDIO_MPEG",e["audio/wav"]="AUDIO_WAV",e["audio/ogg"]="AUDIO_OGG",e["audio/webm"]="AUDIO_WEBM",e["audio/aac"]="AUDIO_AAC",e["video/mp4"]="VIDEO_MP4",e["video/mpeg"]="VIDEO_MPEG",e["video/ogg"]="VIDEO_OGG",e["video/webm"]="VIDEO_WEBM",e["video/quicktime"]="VIDEO_QUICKTIME",e))(_e||{});var br=({createFilesMutation:e,filesUrl:o})=>{let{showErrorMessage:r}=a$8(),[i,t]=useState(!1),[m,s]=useState(!1),[p,d]=useState(null),[n,g]=useState(),f=useMemo(()=>n?.[0],[n]),E=m||i,u=useCallback(async x=>{if(!x?.length){g(void 0),s(!1);return}s(!0);try{let y=(await Promise.all(x.map(async(P,D)=>{try{if(!o[D])return null;let l=await fetch(o[D]);if(!l.ok)throw new Error(l.statusText);let F=await l.blob(),S=l.headers.get("etag"),A=l.headers.get("content-disposition")||void 0,b=null;if(A){let C=A.match(/filename\*=UTF-8''([^;]+)|filename="?([^";]+)"?/i),z=C?.[1]||C?.[2];if(z)try{b=decodeURIComponent(z);}catch{b=z;}}let M=b||S,R=new File([F],M,{type:F.type});return R.id=S,R.url=o[D],R.index=D,R}catch{return null}}))).filter(P=>P!==null);g(y);}catch(h){r(h,"Erro ao carregar preview dos arquivos"),g(void 0);}finally{s(!1);}},[o,r]),I=useRef("");return useEffect(()=>{let x=JSON.stringify(o||[]);if(x===I.current)return;I.current=x;let h=!1;return (async()=>{if(o.length){let P=o.filter(Boolean);if(await u(P),h)return}else g(void 0),s(!1);})(),()=>{h=!0;}},[o,u]),{filesPreview:n,filePreview:f,uploadFiles:async(x,h)=>{if(x.filter(P=>P instanceof File)?.length){t(!0);try{let P=x[0].type||"application/octet-stream",D=_e[P];if(!D)throw new Error(`Tipo de arquivo n\xE3o suportado: ${P}`);let l=await e({files:x.map(b=>({content_type:D,name:b.name}))}).unwrap(),F=l.files.map(b=>b.id),S=[];return (await Promise.all(l.files.map((b,M)=>{let R=x[M];return R.id=b.id,R.url=URL.createObjectURL(R),S.push(R),fetch(b.url,{method:"PUT",headers:{"Content-Type":P,"Content-Disposition":`inline; filename="${R.name}"`},body:R})}))).forEach(b=>{if(!b.ok)throw new Error(`Erro no upload: ${b.statusText}`)}),h?.(S),F}catch(P){throw d(P),r(P,"Erro no upload"),P}finally{t(!1);}}},setFilesPreview:g,isUploadingFiles:i,isLoadingPreview:m,isUploadOrLoadingFiles:E,uploadFilesError:p}},Ir=br;var vr=({sx:e,id:o,name:r,tabIndex:i,uploading:t,getRootProps:m,getInputProps:s,isDragActive:p,isError:d,disabled:n,dropZoneSxProps:g,dropZoneContent:f,children:E,...u})=>jsxs(Se,{children:[t&&jsx(a$7,{"data-testid":"uploading-progress-bar",sx:{zIndex:1}}),jsxs(Pe,{sx:{width:1,position:"relative",...e},children:[jsxs(Xe,{...m(),"data-testid":"drop-zone-styled-area",isError:d,isDragActive:p,disabled:!!n,sx:g,...u,children:[jsx("input",{...s(),id:o,tabIndex:i,name:r}),f]}),E]})]}),oe=vr;var wr=({header:e,description:o,sx:r,...i})=>jsxs(le,{spacing:5,alignItems:"center",justifyContent:"center",direction:{xs:"column",md:"row"},sx:{width:1,textAlign:{xs:"center",md:"left"},...r},...i,children:[jsx(a$4,{sx:{width:220}}),jsxs("div",{children:[jsx(ke,{gutterBottom:!0,variant:"h5",children:e||"Soltar ou selecionar arquivos"}),jsx(ke,{variant:"body2",sx:{color:"text.secondary"},children:o||jsxs(Fragment,{children:["Solte os arquivos aqui ou clique",jsx(ke,{variant:"body2",component:"span",sx:{mx:.5,color:"primary.main",textDecoration:"underline"},children:"procurar"}),"na sua m\xE1quina"]})})]})]}),re=memo(wr);var yr=({onRemove:e,onReorder:o,onFilesSelect:r,id:i,disabled:t,error:m,helperText:s,files:p,thumbnail:d,dropZoneSxProps:n,uploading:g,tabIndex:f,maxFiles:E,placeholderAlt:u,placeholderProps:I,...O})=>{let{files:x,dropzoneProps:h,handleRemove:y,handleReorder:P}=Z({onFilesSelect:r,onReorder:o,onRemove:e,filesPreview:p,dropzoneOptions:{multiple:!0,disabled:t,...O},maxFiles:E}),{getRootProps:D,getInputProps:l,isDragActive:F,isDragReject:S}=h,A=!!x?.filter(M=>!!M.id).length,b=S||!!m;return jsxs(oe,{id:i,uploading:g,disabled:t,dropZoneSxProps:n,tabIndex:f,getRootProps:D,getInputProps:l,isDragActive:F,isError:b,dropZoneContent:jsx(Fragment,{children:u?jsx(le,{children:u}):jsx(re,{header:I?.header,description:I?.description})}),children:[jsx(j,{disabled:t,helperText:s,isError:b}),A&&jsx(Pe,{sx:{my:3},children:jsx(Ie,{files:x,thumbnail:!!d,onRemove:e?y:void 0,onReorder:o?P:void 0})})]})},_r=memo(yr);var zr=({onFilesSelect:e,onRemove:o,onReorder:r,id:i,disabled:t,error:m,helperText:s,files:p,dropZoneSxProps:d,placeholderProps:n,placeholderAlt:g,uploading:f,tabIndex:E,maxFiles:u,aspectRatio:I,enableCrop:O=!0,convertToWebp:x=!0,cropSize:h,name:y,label:P,...D})=>{let{files:l,dropzoneProps:F,cropState:S,aspectRatio:A,handleRemove:b,handleReorder:M}=Z({onFilesSelect:e,onReorder:r,onRemove:o,filesPreview:p,dropzoneOptions:{accept:{"image/*":[".jpeg",".jpg",".png",".gif",".webp"]},multiple:!0,disabled:t,...D},enableCrop:O,customAspectRatio:I,convertToWebp:x,maxFiles:u,cropSize:h,uploading:f}),{getRootProps:R,getInputProps:C,isDragActive:z,isDragReject:q}=F,{cropModalOpen:Y,imagePreview:ie,cropLoading:ae,onCropInitialized:ne,handleCropSave:N,handleCropCancel:$,currentImageIndex:k,totalPendingImages:B}=S,V=!!l?.filter(W=>!!W.id).length,ee=q||!!m,G=useMemo(()=>{let W=P??"Ajustar Imagem",K=B>1||k>1?` (${k} de ${B})`:"";return `${W}${K}`},[P,B,k]);return jsxs(oe,{id:i,name:y,uploading:f,disabled:t,dropZoneSxProps:d,tabIndex:E,getRootProps:R,getInputProps:C,isDragActive:z,isError:ee,dropZoneContent:jsx(Fragment,{children:g?jsx(le,{children:g}):jsx(re,{header:n?.header,description:n?.description})}),children:[jsx(j,{disabled:t,helperText:s,isError:ee}),V&&jsx(Pe,{sx:{my:3,ml:.5},children:jsx(Ie,{files:l,thumbnail:!0,onRemove:b,onReorder:r?M:void 0})}),jsx(a$5,{open:Y,onClose:$,label:G,imageSrc:ie,aspectRatio:A,onInitialized:ne,onSave:N,loading:ae,cropSize:h})]})},Nr=memo(zr);var Zr=({onFileSelect:e$1,onRemove:o,file:r,id:i,disabled:t,error:m$1,helperText:s,sx:p,dropZoneSxProps:d,uploading:n,tabIndex:g,...f$1})=>{let E=r?[r]:[],{file:u,dropzoneProps:I,handleRemove:O}=Z({onFileSelect:e$1,onRemove:o,filesPreview:E,dropzoneOptions:{multiple:!1,disabled:t,...f$1}}),{getRootProps:x,getInputProps:h,isDragActive:y,isDragReject:P}=I,D=useCallback(A=>{A.stopPropagation(),O(u||void 0);},[u,O]),l=!!u,F=typeof u=="string",S=P||!!m$1;return jsx(oe,{id:i,uploading:n,disabled:t,dropZoneSxProps:d,tabIndex:g,getRootProps:x,getInputProps:h,isDragActive:y,isError:S,dropZoneContent:jsxs(Fragment,{children:[!l&&jsx(re,{}),l&&jsxs(le,{component:m.div,...j$1().inUp,spacing:2,direction:"row",alignItems:"center",sx:{my:1,px:1,py:.75,borderRadius:.75,border:A=>`solid 1px ${A.palette.divider}`,...p},children:[jsx(f,{file:u}),jsxs(le,{flexGrow:1,sx:{minWidth:0},children:[jsx(ke,{variant:"subtitle2",noWrap:!0,children:F?u:u.name}),jsx(ke,{variant:"caption",sx:{color:"text.secondary"},children:F?"":e(u.size)})]}),o&&jsx(a$3,{title:"Remover arquivo",children:jsx(qe,{edge:"end",size:"small",disabled:t,"aria-label":"Remover arquivo",onClick:D,children:jsx(a$6,{icon:"DELETE_MARK_BUTTON_02",width:16})})})]})]}),children:jsx(j,{disabled:t,helperText:s,isError:S})})},Hr=memo(Zr);var Qr=({onRemove:e,onFileSelect:o,file:r,id:i,disabled:t,error:m,helperText:s,dropZoneSxProps:p,placeholderProps:d,placeholderAlt:n,uploading:g,tabIndex:f,aspectRatio:E,enableCrop:u=!0,convertToWebp:I=!0,name:O,label:x,cropSize:h,sx:y,maxWidth:P,maxHeight:D,...l})=>{let F=r?[r]:[],[S,A]=useState(!1),{file:b,dropzoneProps:M,cropState:R,handleRemove:C,aspectRatio:z}=Z({onFileSelect:o,onRemove:e,dropzoneOptions:{accept:{"image/*":[".jpeg",".jpg",".png",".gif",".webp"]},multiple:!1,disabled:t,...l},filesPreview:F,enableCrop:u,customAspectRatio:E,convertToWebp:I,cropSize:h}),{getRootProps:q,getInputProps:Y,isDragActive:ie,isDragReject:ae}=M,{cropModalOpen:ne,imagePreview:N,cropLoading:$,onCropInitialized:k,handleCropSave:B,handleCropCancel:V}=R,ee=useCallback(()=>{C(b||void 0);},[b,C]),G=!!b,W=ae||!!m,K=G?{opacity:0}:{opacity:1},a=p?.width;return useEffect(()=>{G||A(!1);},[G]),jsxs(Se,{sx:{...y,...a&&{width:a}},children:[(g||S)&&jsx(a$7,{}),jsxs(oe,{id:i,uploading:g,disabled:t,dropZoneSxProps:p,tabIndex:f,getRootProps:q,getInputProps:Y,isDragActive:ie,isError:W,name:O,dropZoneContent:jsxs(Fragment,{children:[n?jsx(le,{sx:K,children:n}):jsx(re,{sx:K,header:d?.title,description:d?.description}),G&&jsx(Ce,{file:b,cropSize:h,isLoading:S,isUploading:g,onLoading:A,aspectRatio:z,maxWidth:P,maxHeight:D})]}),children:[jsx(j,{disabled:t,helperText:s,isError:W}),G&&e&&jsx(Je,{size:"small",onClick:ee,disabled:t,label:"Remover arquivo",children:jsx(a$6,{icon:"DELETE_MARK_BUTTON_02",width:16})}),jsx(a$5,{open:ne,onClose:V,label:x??"Ajustar Imagem",imageSrc:N,aspectRatio:z,onInitialized:k,onSave:B,loading:$,cropSize:h})]})]})},Yr=memo(Qr);var nt=({onFileSelect:e,onRemove:o,file:r,disabled:i,label:t,id:m,tabIndex:s,error:p,helperText:d,sx:n,name:g,maxSize:f,uploading:E,aspectRatio:u=1,enableCrop:I=!0,convertToWebp:O=!0,cropSize:x,...h})=>{let[y,P]=useState(!1),D=r?[r]:[],{file:l,dropzoneProps:F,cropState:S,handleRemove:A}=Z({filesPreview:D,onFileSelect:e,onRemove:o,dropzoneOptions:{accept:{"image/*":[".jpeg",".jpg",".png",".gif",".webp"]},multiple:!1,disabled:i,maxSize:f,...h},enableCrop:I,customAspectRatio:u,convertToWebp:O,cropSize:x}),{getRootProps:b,getInputProps:M,isDragActive:R,isDragReject:C}=F,{cropModalOpen:z,imagePreview:q,cropLoading:Y,onCropInitialized:ie,handleCropSave:ae,handleCropCancel:ne}=S,N=C||!!p,$=y||E,k=!!o,B=useRef(""),V=useRef();useEffect(()=>{if(!l){B.current="",V.current=void 0;return}let W=l.id??`${l.name}-${l.size}-${l.lastModified}`;if(V.current===W)return;V.current=W,P(!0);let K=URL.createObjectURL(l);return B.current=K,()=>{URL.revokeObjectURL(K);}},[l]);let ee=()=>{P(!1);},G=useCallback(()=>k&&l?()=>A(l):b().onClick,[k,l,b,A]);return jsxs(Fragment,{children:[jsxs(le,{sx:{alignItems:"center"},children:[jsxs(io,{sx:n,isError:N,isDragActive:R,hasFile:!!l,...b(),onClick:G(),children:[jsxs(ro,{children:[$&&jsx(to,{children:jsx(at,{size:135,thickness:2,color:"primary"})}),l&&jsx(ao,{alt:"Avatar Preview",src:B.current,onLoad:ee,...$&&{sx:{filter:"blur(5px) !important",scale:1.2,opacity:.7}}}),!l&&!$&&jsxs(Te,{isError:N,hasFile:!1,children:[jsx(a$6,{icon:"ADD_IMAGE",width:32}),jsx(ke,{variant:"caption",textAlign:"center",sx:{color:N?"error.main":"text.disabled"},children:"Adicionar foto"})]}),l&&!$&&jsxs(Te,{isError:N,hasFile:!0,children:[jsx(a$6,{icon:k?"DELETE_MARK_BUTTON_02":"ADD_IMAGE",width:32}),jsx(ke,{variant:"caption",textAlign:"center",sx:{color:N?"error.main":"common.white"},children:k?"Remover foto":"Alterar foto"})]})]}),jsx("input",{name:g,id:m,tabIndex:s,...M()})]}),jsx(le,{sx:{alignItems:"center",mt:-.5},children:jsx(j,{helperText:d,disabled:i,isError:N})})]}),z&&q&&jsx(a$5,{open:z,onClose:ne,label:t??"Ajustar Imagem",imageSrc:q,aspectRatio:u,onInitialized:ie,onSave:ae,loading:Y,cropSize:x,cropShape:"round"})]})},st=memo(nt);var mt=({error:e,name:o,disabled:r,sx:i,...t})=>{let{getRootProps:m,getInputProps:s,isDragActive:p,isDragReject:d}=useDropzone({disabled:r,...t}),n=d||e;return jsxs(Qe,{...m(),isDragActive:p,hasError:!!n,disabled:!!r,sx:i,"data-testid":"upload-box",children:[jsx("input",{name:o,...s()}),"Selecionar arquivo"]})},ct=memo(mt);
35
+ var Ro=({helperText:e,disabled:o,isError:r})=>e?jsx(So,{error:r,sx:i=>({mx:"14px",color:o?i.palette.grey[500]:void 0}),children:e}):null,j=memo(Ro);var Se=styled(le)({position:"relative",width:"100%",borderRadius:8,overflow:"hidden","&:hover .actions":{display:"flex"}}),Re=styled(le)({position:"absolute",top:4,right:4,gap:.5,"& svg":{width:16,height:16}}),Xe=styled(Pe,{shouldForwardProp:e=>!["isDragActive","isError","disabled"].includes(e)})(({theme:e,isDragActive:o,isError:r,disabled:i})=>({outline:"none",cursor:"pointer",overflow:"hidden",position:"relative",padding:e.spacing(5),borderRadius:e.shape.borderRadius,transition:e.transitions.create("padding"),backgroundColor:e.palette.background.neutral,border:`1px dashed ${alpha(e.palette.grey[500],.32)}`,...o&&{opacity:.72},...r&&{color:e.palette.error.main,backgroundColor:e.palette.error.lighter,borderColor:e.palette.error.light},...i&&{opacity:.48,pointerEvents:"none"},"&:hover":{opacity:.72}}));styled(le)(({theme:e})=>({display:"none",position:"absolute",alignItems:"center",justifyContent:"center",flexDirection:"row",gap:12,width:"100%",height:"100%",backgroundColor:alpha(e.palette.primary.main,.9),zIndex:999,button:{"&, &:hover, &:focus":{backgroundColor:"#fff"}}}));var qe=styled(_o)(({theme:e})=>({position:"relative",zIndex:999,pointerEvents:"auto",color:e.palette.grey[700],backgroundColor:e.palette.grey[100],"&:hover":{color:e.palette.grey[900],backgroundColor:e.palette.grey[300]}})),Me=styled("div")({position:"relative",zIndex:1,userSelect:"none","&:hover":{zIndex:2}}),Ve=styled(le,{shouldForwardProp:e=>!["isDragging"].includes(e)})(({theme:e,width:o,isDragging:r})=>({width:o,height:100,alignItems:"center",display:"inline-flex",justifyContent:"center",margin:e.spacing(.5),padding:e.spacing(2,1,2,1),gap:e.spacing(1),borderRadius:e.spacing(1.25),overflow:"hidden",position:"relative",border:`solid 1px ${e.palette.divider}`,backgroundColor:e.palette.common.white,zIndex:1,transition:"box-shadow 150ms ease-in-out",boxShadow:r?`0 0 0 2px ${e.palette.primary.main}, ${e.customShadows.z8}, inset 0 0 0 1000px ${alpha(e.palette.primary.main,.06)}`:"0px 0px 0px 0px rgba(0, 0, 0, 0)"})),Ke=styled(m.div)(({theme:e,width:o,isDragging:r})=>({width:o,height:60,alignItems:"center",display:"inline-flex",justifyContent:"center",margin:e.spacing(.5),padding:e.spacing(2),borderRadius:e.spacing(1.25),overflow:"hidden",position:"relative",border:`solid 1px ${e.palette.divider}`,backgroundColor:e.palette.common.white,zIndex:1,transition:"box-shadow 150ms ease-in-out",boxShadow:r?`0 0 0 2px ${e.palette.primary.main}, ${e.customShadows.z8}, inset 0 0 0 1000px ${alpha(e.palette.primary.main,.06)}`:"0px 0px 0px 0px rgba(0, 0, 0, 0)"})),Je=styled(a)(({theme:e})=>({top:16,right:16,zIndex:9,position:"absolute",color:e.palette.common.white,backgroundColor:alpha(e.palette.grey[900],.72),"&:hover":{backgroundColor:alpha(e.palette.grey[900],.48)}})),Qe=styled(Pe,{shouldForwardProp:e=>e!=="isDragActive"&&e!=="disabled"&&e!=="hasError"})(({theme:e,isDragActive:o,disabled:r,hasError:i})=>({width:64,height:64,flexShrink:0,display:"flex",borderRadius:1,cursor:"pointer",alignItems:"center",color:e.palette.text.disabled,justifyContent:"center",backgroundColor:alpha(e.palette.grey[500],.08),border:`dashed 1px ${alpha(e.palette.grey[500],.16)}`,...o&&{opacity:.72},...r&&{opacity:.48,pointerEvents:"none"},...i&&{color:e.palette.error.main,borderColor:e.palette.error.main,backgroundColor:alpha(e.palette.error.main,.08)},"&:hover":{opacity:.72}})),Ye=styled(Pe)(({theme:e})=>({padding:e.spacing(1),top:0,left:0,width:"100%",height:"100%",position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",transition:"all 0.3s ease-in-out",filter:"blur(0)","&:hover":{filter:"blur(3px)"}})),eo=styled("img",{shouldForwardProp:e=>e!=="aspectRatio"&&e!=="isLoading"&&e!=="isUploading"&&e!=="maxWidth"&&e!=="maxHeight"&&e!=="cropSize"})(({theme:e,aspectRatio:o,maxWidth:r,maxHeight:i,isLoading:t,isUploading:m})=>({borderRadius:e.shape.borderRadius,objectFit:"cover",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%) scale(1)",filter:"blur(0)",zIndex:1,maxWidth:r,maxHeight:i,backgroundColor:e.palette.background.paper,width:o>1?"calc(100% - 16px)":void 0,height:o>1?void 0:"calc(100% - 16px)",aspectRatio:o,transition:"all 0.5s ease-in-out",...t||m?{opacity:0,filter:"blur(1.5rem)",transform:"translate(-50%, -50%) scale(0.7)"}:{},"&:hover":{transition:"all 0.2s ease-in-out"}})),oo=styled("img",{shouldForwardProp:e=>e!=="isLoading"&&e!=="isUploading"})(({isLoading:e,isUploading:o})=>({width:"100%",height:"100%",objectFit:"cover",top:0,left:0,filter:"blur(1.5rem)",transform:"scale(1.1)",position:"absolute",zIndex:0,transition:"opacity 0.3s ease-in-out",...e&&{opacity:0},...o&&{opacity:.7,filter:"blur(2rem)"}})),ro=styled(le)({width:"100%",height:"100%",position:"relative",overflow:"hidden",borderRadius:"50%",justifyContent:"center",alignItems:"center"});styled(Oo)(({theme:e})=>({py:1,px:2,mt:3,textAlign:"left",borderStyle:"dashed",borderColor:"error.main",backgroundColor:alpha(e.palette.error.main,.08)}));var Te=styled(Pe,{shouldForwardProp:e=>e!=="isError"&&e!=="hasFile"})(({theme:e,isError:o,hasFile:r})=>({top:0,gap:e.spacing(1),left:0,width:"100%",height:"100%",zIndex:9,display:"flex",borderRadius:"50%",position:"absolute",alignItems:"center",color:e.palette.text.disabled,flexDirection:"column",justifyContent:"center",backgroundColor:alpha(e.palette.grey[500],.08),transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.shorter}),"&:hover":{opacity:.92},...o&&{color:e.palette.error.main},...r&&{zIndex:9,opacity:0,color:e.palette.common.white,backgroundColor:alpha(e.palette.common.black,.54)}})),to=styled(le)({top:0,left:0,right:0,bottom:0,position:"absolute",zIndex:10,alignItems:"center",justifyContent:"center",opacity:.8});styled(le)(({theme:e})=>({padding:20,justifyContent:"center",alignItems:"center",gap:4,alignSelf:"stretch",borderRadius:12,background:e.palette.grey[200],color:e.palette.text.disabled,height:160}));var io=styled(Pe,{shouldForwardProp:e=>e!=="isDragActive"&&e!=="isError"&&e!=="hasFile"})(({theme:e,isDragActive:o,disabled:r,isError:i,hasFile:t})=>({padding:e.spacing(1),margin:"auto",width:144,height:144,cursor:"pointer",overflow:"hidden",borderRadius:"50%",border:`1px dashed ${alpha(e.palette.grey[500],.2)}`,...o&&{opacity:.72},...r&&{opacity:.48,pointerEvents:"none"},...i&&{borderColor:"error.main"},...t&&{...i&&{bgcolor:alpha(e.palette.error.main,.08)},"&:hover .upload-placeholder":{opacity:1},"& img":{filter:"blur(0)"},"&:hover img":{filter:"blur(3px)"}}})),ao=styled("img")({width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover",transition:"all 0.3s ease-in-out"}),no=styled(a)(({theme:e})=>({backgroundColor:alpha(e.palette.grey[900],.72),color:e.palette.common.white,"&:hover":{backgroundColor:alpha(e.palette.grey[600],.64),color:e.palette.common.white},"& svg":{width:14,height:14}}));var To=({onRemove:e,sx:o,file:r,disableDrag:i,attributes:t,listeners:m,innerWidth:s,isDragging:l})=>{let p=r?.id||r?.url;return p?jsx(Mo,{anchorOrigin:{vertical:"top",horizontal:"left"},children:jsxs(Ke,{width:s,isDragging:l,"data-testid":`preview-multi-img-${p}`,...j$1().inUp,sx:o,children:[jsx(a$2,{disableDrag:i,...t,...m}),jsx(f,{tooltip:!0,imageView:!0,file:r}),jsx(Re,{sx:{position:"absolute",right:3,top:3,zIndex:1},children:e&&jsx(no,{size:"small",label:"Remover arquivo",onClick:()=>e(r),icon:"DELETE_MARK_BUTTON_02"})})]})},`badge-${p}`):null},so=memo(To);var Bo=({file:e$1,thumbnail:o,onRemove:r,sx:i,disableDrag:t=!1})=>{let m=e$1?.size||0,s=e$1?.name||e$1?.id||e$1?.url,l=e$1?.id||e$1?.url||e$1?.name||e$1?.index?.toString()||"",p=typeof e$1=="string",n=t?70:80,{attributes:g,listeners:x$1,setNodeRef:A,transform:u,transition:h,isDragging:L}=useSortable({id:l,disabled:t}),b={transform:x.Transform.toString(u),transition:h,display:"inline-block",alignItems:"center",justifyContent:"center",width:`${n+8}px`,height:"68px"};return o&&e$1?jsx(Me,{ref:A,style:b,children:jsx(so,{innerWidth:n,isDragging:L,sx:i,file:e$1,disableDrag:t,attributes:g,listeners:x$1,onRemove:r})}):jsx(Me,{ref:A,style:{...b,height:"80px",width:`${n+38}px`},children:jsxs(Ve,{width:n+30,isDragging:L,"data-testid":`preview-multi-img-${l}`,...j$1().inUp,sx:i,children:[jsx(a$2,{disableDrag:t,...g,...x$1}),e$1&&jsx(f,{file:e$1}),jsxs(le,{flexGrow:1,sx:{width:"100%"},children:[jsx(a$3,{title:s,children:jsx(ke,{variant:"subtitle2",noWrap:!0,children:s})}),jsx(ke,{variant:"caption",sx:{color:"text.secondary"},children:p?"":e(m)})]}),jsx(Re,{children:r&&jsx(a,{size:"small",label:"Remover arquivo",onClick:()=>r(e$1),icon:"DELETE_MARK_BUTTON_02"})})]})})},mo=memo(Bo);var or=({thumbnail:e,files:o,onRemove:r,onReorder:i,sx:t})=>{let m=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates})),s=useCallback(p=>{let{active:n,over:g}=p;if(!(!n||!g||n.id===g.id)&&i){let x=o.findIndex(({id:u})=>u===n.id),A=o.findIndex(({id:u})=>u===g.id);x!==-1&&A!==-1&&i(x,A,o);}},[o,i]),l=jsx(AnimatePresence,{initial:!1,children:o.map(p=>jsx(mo,{sx:t,id:`preview-file-${p.id}`,file:p,onRemove:r,thumbnail:e,disableDrag:!i},`preview-file-${p.id}`))});return i?jsx(DndContext,{sensors:m,collisionDetection:closestCenter,onDragEnd:s,modifiers:[restrictToHorizontalAxis,restrictToParentElement,restrictToWindowEdges],children:jsx(SortableContext,{items:o.map(p=>p.id),strategy:horizontalListSortingStrategy,children:l})}):l},Ie=memo(or);var go=forwardRef(({onLoading:e,aspectRatio:o,cropSize:r,...i},t)=>{let{maxWidth:m,maxHeight:s}=useMemo(()=>r&&typeof r=="object"?{maxWidth:r.width,maxHeight:r.height}:r&&typeof r=="number"?{maxWidth:r,maxHeight:r}:{maxWidth:"100%",maxHeight:"100%"},[r]);a$1(()=>{e?.(!0);}),useLayoutEffect(()=>{typeof t=="object"&&t?.current?e?.(!t.current.complete):e?.(!1);},[t,e]);function l(){e?.(!1);}return jsx(eo,{...i,maxWidth:m,maxHeight:s,ref:t,aspectRatio:o,onLoad:l,onError:l})});go.displayName="LoadingPreviewImage";var uo=go;var lr=({file:e,aspectRatio:o=1,isUploading:r,isLoading:i,onLoading:t,cropSize:m,maxWidth:s,maxHeight:l})=>{let p=useRef(null),n=e?.id||e?.url||e?.name,g=e?.name||e?.url||e?.id,x=URL.createObjectURL(e)||e?.url;return n?jsxs(Ye,{className:"single-file-preview-box",children:[jsx(uo,{className:"single-file-preview-img",aspectRatio:o,cropSize:m,isLoading:i,isUploading:r,alt:g,src:x,ref:p,loading:"lazy",onLoading:t,onLoad:()=>t?.(!1),onError:()=>t?.(!1),maxWidth:s,maxHeight:l},`image-preview-${n}`),jsx(oo,{className:"single-file-preview-bg",alt:g,src:x,isLoading:i,isUploading:r})]}):null},Ce=memo(lr);var hi=e=>e.startsWith("image/"),xo=(e,o=.8)=>new Promise((r,i)=>{let t=document.createElement("canvas"),m=t.getContext("2d"),s=new Image;s.onload=()=>{t.width=s.width,t.height=s.height,m?(m.drawImage(s,0,0),t.toBlob(l=>{if(l){let p=new File([l],e.name.replace(/\.[^/.]+$/,".webp"),{type:"image/webp",lastModified:Date.now()});r(p);}else i(new Error("Falha ao converter para WebP"));},"image/webp",o)):i(new Error("N\xE3o foi poss\xEDvel obter contexto do canvas"));},s.onerror=()=>i(new Error("Falha ao carregar imagem")),s.src=URL.createObjectURL(e);});var gr=({onFilesSelect:e$1,onFileSelect:o,onReorder:r,onRemove:i,filesPreview:t,dropzoneOptions:m,enableCrop:s=!1,customAspectRatio:l,convertToWebp:p=!0,cropSize:n,maxFiles:g})=>{let{showErrorMessage:x}=a$8(),A=useMemo(()=>l||(n&&typeof n!="number"?n.width/n.height:1),[l,n]),[u,h]=useState([]),[L,b]=useState(!1),[v,S]=useState(null),[P,R]=useState(null),[d,D]=useState(""),[_,f]=useState(!1),[I,y]=useState([]),[T,F]=useState(0),[z,q]=useState(0),Y=c=>{if(c.length<1)return;let E=c[0];S(E),F(O=>O+1);let U=new FileReader;U.onload=()=>{D(U.result),b(!0);},U.readAsDataURL(E);},ie=(c,E)=>{R(E);},ae=async()=>!v||!P?null:new Promise(c=>{let E=document.createElement("canvas"),U=E.getContext("2d"),O=new Image;O.onload=async()=>{let{width:C,height:he,x:Ao,y:wo}=P,ve=C,Ee=he;n&&(typeof n=="number"?(ve=n,Ee=n/A):(ve=n.width,Ee=n.height)),E.width=ve,E.height=Ee,U?(U.drawImage(O,Ao,wo,C,he,0,0,ve,Ee),E.toBlob(async je=>{if(je){let Ue=new File([je],v.name,{type:v.type,lastModified:Date.now()});if(p)try{Ue=await xo(Ue);}catch(Do){x(Do,"Erro ao converter para WebP");}c(Ue);}else c(null);},"image/png")):c(null);},O.src=d;}),ne=async()=>{if(!(!v||!P)){f(!0);try{let c=await ae();c&&e$1?e$1([c],h):c&&o&&o(c,h),b(!1),f(!1),D(""),S(null);let E=I.slice(1);y(E),Y(E);}catch(c){x(c,"Erro ao processar imagem");}}},N=()=>{b(!1),f(!1),D(""),S(null),y([]),F(0),q(0);},$=c=>{if(c.length===0)return;let E=Object.keys(m?.accept||{}).some(O=>O.includes("image/")),U=u.length+c.length;if(g&&U>g){x(new Error(`M\xE1ximo de ${g} arquivos`),"Erro ao fazer upload");return}if(E&&s){let O=c.filter(C=>C.type.startsWith("image/"));q(O.length),F(0),y(O),Y(O);}else if(e$1)e$1(c,h);else if(o){let O=c[0];o(O,h);}},k=c=>{if(!c.length)return;let E=c[0]?.errors[0]?.code,U=m?.maxSize||3145728;x(E==="file-too-large"?new Error(`O arquivo excede o tamanho m\xE1ximo de ${e(U)}`):E==="file-invalid-type"?new Error("Formato de arquivo n\xE3o suportado"):c[0]?.errors[0]||new Error("Erro ao enviar arquivo"),"Erro ao fazer upload");},{getRootProps:B,getInputProps:V,isDragActive:ee,isDragReject:G,fileRejections:W}=useDropzone({onDrop:$,onDropRejected:k,...m}),K=c=>{if(!c){h([]),i?.(void 0);return}if(e$1){let E=u.filter(U=>U.id!==c.id);h(E),i?.(c);}else h([]),i?.(c);},a=(c,E,U)=>{h(O=>{let C=[...O],[he]=C.splice(c,1);return C.splice(E,0,he),r?.(c,E,U),C});};return useEffect(()=>{let c=t||[];h(E=>{let U=JSON.stringify(E?.map(C=>C.id||C.name)),O=JSON.stringify(c?.map(C=>C.id||C.name));return U===O?E:c});},[t]),{file:u?.[0],files:u,aspectRatio:A,dropzoneProps:{getRootProps:B,getInputProps:V,isDragActive:ee,isDragReject:G,fileRejections:W},cropState:{cropModalOpen:L,imagePreview:d,cropLoading:_,setCropModalOpen:b,onCropInitialized:ie,handleCropSave:ne,handleCropCancel:N,currentImageIndex:T,totalPendingImages:z},setInitialFiles:h,handleRemove:K,handleReorder:a}},Z=gr;var ze=(a=>(a.APPLICATION_OCTET_STREAM="application/octet-stream",a.IMAGE_JPEG="image/jpeg",a.IMAGE_JPG="image/jpg",a.IMAGE_PNG="image/png",a.IMAGE_GIF="image/gif",a.IMAGE_WEBP="image/webp",a.IMAGE_SVG="image/svg+xml",a.IMAGE_BMP="image/bmp",a.IMAGE_TIFF="image/tiff",a.IMAGE_ICO="image/x-icon",a.IMAGE_AVIF="image/avif",a.APPLICATION_PDF="application/pdf",a.TEXT_PLAIN="text/plain",a.TEXT_CSV="text/csv",a.APPLICATION_RTF="application/rtf",a.APPLICATION_MSWORD="application/msword",a.APPLICATION_DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",a.APPLICATION_MSEXCEL="application/vnd.ms-excel",a.APPLICATION_XLSX="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",a.APPLICATION_MSPOWERPOINT="application/vnd.ms-powerpoint",a.APPLICATION_PPTX="application/vnd.openxmlformats-officedocument.presentationml.presentation",a.APPLICATION_ODT="application/vnd.oasis.opendocument.text",a.APPLICATION_ODS="application/vnd.oasis.opendocument.spreadsheet",a.APPLICATION_ODP="application/vnd.oasis.opendocument.presentation",a.APPLICATION_XML="application/xml",a.TEXT_XML="text/xml",a.TEXT_HTML="text/html",a.TEXT_CSS="text/css",a.APPLICATION_JSON="application/json",a.TEXT_JAVASCRIPT="text/javascript",a.APPLICATION_ZIP="application/zip",a.APPLICATION_GZIP="application/gzip",a.APPLICATION_RAR="application/vnd.rar",a.APPLICATION_7Z="application/x-7z-compressed",a.AUDIO_MPEG="audio/mpeg",a.AUDIO_WAV="audio/wav",a.AUDIO_OGG="audio/ogg",a.AUDIO_WEBM="audio/webm",a.AUDIO_AAC="audio/aac",a.VIDEO_MP4="video/mp4",a.VIDEO_MPEG="video/mpeg",a.VIDEO_OGG="video/ogg",a.VIDEO_WEBM="video/webm",a.VIDEO_QUICKTIME="video/quicktime",a))(ze||{}),_e=(e=>(e["application/octet-stream"]="APPLICATION_OCTET_STREAM",e["image/jpeg"]="IMAGE_JPEG",e["image/jpg"]="IMAGE_JPG",e["image/png"]="IMAGE_PNG",e["image/gif"]="IMAGE_GIF",e["image/webp"]="IMAGE_WEBP",e["image/svg+xml"]="IMAGE_SVG",e["image/bmp"]="IMAGE_BMP",e["image/tiff"]="IMAGE_TIFF",e["image/x-icon"]="IMAGE_ICO",e["image/avif"]="IMAGE_AVIF",e["application/pdf"]="APPLICATION_PDF",e["text/plain"]="TEXT_PLAIN",e["text/csv"]="TEXT_CSV",e["application/rtf"]="APPLICATION_RTF",e["application/msword"]="APPLICATION_MSWORD",e["application/vnd.openxmlformats-officedocument.wordprocessingml.document"]="APPLICATION_DOCX",e["application/vnd.ms-excel"]="APPLICATION_MSEXCEL",e["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]="APPLICATION_XLSX",e["application/vnd.ms-powerpoint"]="APPLICATION_MSPOWERPOINT",e["application/vnd.openxmlformats-officedocument.presentationml.presentation"]="APPLICATION_PPTX",e["application/vnd.oasis.opendocument.text"]="APPLICATION_ODT",e["application/vnd.oasis.opendocument.spreadsheet"]="APPLICATION_ODS",e["application/vnd.oasis.opendocument.presentation"]="APPLICATION_ODP",e["application/xml"]="APPLICATION_XML",e["text/xml"]="TEXT_XML",e["text/html"]="TEXT_HTML",e["text/css"]="TEXT_CSS",e["application/json"]="APPLICATION_JSON",e["text/javascript"]="TEXT_JAVASCRIPT",e["application/zip"]="APPLICATION_ZIP",e["application/gzip"]="APPLICATION_GZIP",e["application/vnd.rar"]="APPLICATION_RAR",e["application/x-7z-compressed"]="APPLICATION_7Z",e["audio/mpeg"]="AUDIO_MPEG",e["audio/wav"]="AUDIO_WAV",e["audio/ogg"]="AUDIO_OGG",e["audio/webm"]="AUDIO_WEBM",e["audio/aac"]="AUDIO_AAC",e["video/mp4"]="VIDEO_MP4",e["video/mpeg"]="VIDEO_MPEG",e["video/ogg"]="VIDEO_OGG",e["video/webm"]="VIDEO_WEBM",e["video/quicktime"]="VIDEO_QUICKTIME",e))(_e||{});var br=({createFilesMutation:e,filesUrl:o})=>{let{showErrorMessage:r}=a$8(),[i,t]=useState(!1),[m,s]=useState(!1),[l,p]=useState(null),[n,g]=useState(),x=useMemo(()=>n?.[0],[n]),A=m||i,u=useCallback(async b=>{if(!b?.length){g(void 0),s(!1);return}s(!0);try{let S=(await Promise.all(b.map(async(P,R)=>{try{if(!o[R])return null;let d=await fetch(o[R]);if(!d.ok)throw new Error(d.statusText);let D=await d.blob(),_=d.headers.get("etag"),f=d.headers.get("content-disposition")||void 0,I=null;if(f){let F=f.match(/filename\*=UTF-8''([^;]+)|filename="?([^";]+)"?/i),z=F?.[1]||F?.[2];if(z)try{I=decodeURIComponent(z);}catch{I=z;}}let y=I||_,T=new File([D],y,{type:D.type});return T.id=_,T.url=o[R],T.index=R,T}catch{return null}}))).filter(P=>P!==null);g(S);}catch(v){r(v,"Erro ao carregar preview dos arquivos"),g(void 0);}finally{s(!1);}},[o,r]),h=useRef("");return useEffect(()=>{let b=JSON.stringify(o||[]);if(b===h.current)return;h.current=b;let v=!1;return (async()=>{if(o.length){let P=o.filter(Boolean);if(await u(P),v)return}else g(void 0),s(!1);})(),()=>{v=!0;}},[o,u]),{filesPreview:n,filePreview:x,uploadFiles:async(b,v)=>{let S=b.filter(P=>P instanceof File);if(S?.length){t(!0);try{let P=S.map(f=>{let I=f.type||"application/octet-stream",y=_e[I];if(!y)throw new Error(`Tipo de arquivo n\xE3o suportado: ${I}`);return {file:f,mimeType:I,contentTypeEnum:y}}),R=await e({files:P.map(({file:f,contentTypeEnum:I})=>({content_type:I,name:f.name}))}).unwrap(),d=R.files.map(f=>f.id),D=[];return (await Promise.all(R.files.map((f,I)=>{let{file:y,mimeType:T}=P[I],F=y;return F.id=f.id,F.url=URL.createObjectURL(F),D.push(F),fetch(f.url,{method:"PUT",headers:{"Content-Type":T,"Content-Disposition":`inline; filename="${F.name}"`},body:F})}))).forEach(f=>{if(!f.ok)throw new Error(`Erro no upload: ${f.statusText}`)}),v?.(D),d}catch(P){throw p(P),r(P,"Erro no upload"),P}finally{t(!1);}}},setFilesPreview:g,isUploadingFiles:i,isLoadingPreview:m,isUploadOrLoadingFiles:A,uploadFilesError:l}},Ir=br;var vr=({sx:e,id:o,name:r,tabIndex:i,uploading:t,getRootProps:m,getInputProps:s,isDragActive:l,isError:p,disabled:n,dropZoneSxProps:g,dropZoneContent:x,children:A,...u})=>jsxs(Se,{children:[t&&jsx(a$7,{"data-testid":"uploading-progress-bar",sx:{zIndex:1}}),jsxs(Pe,{sx:{width:1,position:"relative",...e},children:[jsxs(Xe,{...m(),"data-testid":"drop-zone-styled-area",isError:p,isDragActive:l,disabled:!!n,sx:g,...u,children:[jsx("input",{...s(),id:o,tabIndex:i,name:r}),x]}),A]})]}),oe=vr;var wr=({header:e,description:o,sx:r,...i})=>jsxs(le,{spacing:5,alignItems:"center",justifyContent:"center",direction:{xs:"column",md:"row"},sx:{width:1,textAlign:{xs:"center",md:"left"},...r},...i,children:[jsx(a$4,{sx:{width:220}}),jsxs("div",{children:[jsx(ke,{gutterBottom:!0,variant:"h5",children:e||"Soltar ou selecionar arquivos"}),jsx(ke,{variant:"body2",sx:{color:"text.secondary"},children:o||jsxs(Fragment,{children:["Solte os arquivos aqui ou clique",jsx(ke,{variant:"body2",component:"span",sx:{mx:.5,color:"primary.main",textDecoration:"underline"},children:"procurar"}),"na sua m\xE1quina"]})})]})]}),re=memo(wr);var yr=({onRemove:e,onReorder:o,onFilesSelect:r,id:i,disabled:t,error:m,helperText:s,files:l,thumbnail:p,dropZoneSxProps:n,uploading:g,tabIndex:x,maxFiles:A,placeholderAlt:u,placeholderProps:h,...L})=>{let{files:b,dropzoneProps:v,handleRemove:S,handleReorder:P}=Z({onFilesSelect:r,onReorder:o,onRemove:e,filesPreview:l,dropzoneOptions:{multiple:!0,disabled:t,...L},maxFiles:A}),{getRootProps:R,getInputProps:d,isDragActive:D,isDragReject:_}=v,f=!!b?.filter(y=>!!y.id).length,I=_||!!m;return jsxs(oe,{id:i,uploading:g,disabled:t,dropZoneSxProps:n,tabIndex:x,getRootProps:R,getInputProps:d,isDragActive:D,isError:I,dropZoneContent:jsx(Fragment,{children:u?jsx(le,{children:u}):jsx(re,{header:h?.header,description:h?.description})}),children:[jsx(j,{disabled:t,helperText:s,isError:I}),f&&jsx(Pe,{sx:{my:3},children:jsx(Ie,{files:b,thumbnail:!!p,onRemove:e?S:void 0,onReorder:o?P:void 0})})]})},_r=memo(yr);var zr=({onFilesSelect:e,onRemove:o,onReorder:r,id:i,disabled:t,error:m,helperText:s,files:l,dropZoneSxProps:p,placeholderProps:n,placeholderAlt:g,uploading:x,tabIndex:A,maxFiles:u,aspectRatio:h,enableCrop:L=!0,convertToWebp:b=!0,cropSize:v,name:S,label:P,...R})=>{let{files:d,dropzoneProps:D,cropState:_,aspectRatio:f,handleRemove:I,handleReorder:y}=Z({onFilesSelect:e,onReorder:r,onRemove:o,filesPreview:l,dropzoneOptions:{accept:{"image/*":[".jpeg",".jpg",".png",".gif",".webp"]},multiple:!0,disabled:t,...R},enableCrop:L,customAspectRatio:h,convertToWebp:b,maxFiles:u,cropSize:v,uploading:x}),{getRootProps:T,getInputProps:F,isDragActive:z,isDragReject:q}=D,{cropModalOpen:Y,imagePreview:ie,cropLoading:ae,onCropInitialized:ne,handleCropSave:N,handleCropCancel:$,currentImageIndex:k,totalPendingImages:B}=_,V=!!d?.filter(W=>!!W.id).length,ee=q||!!m,G=useMemo(()=>{let W=P??"Ajustar Imagem",K=B>1||k>1?` (${k} de ${B})`:"";return `${W}${K}`},[P,B,k]);return jsxs(oe,{id:i,name:S,uploading:x,disabled:t,dropZoneSxProps:p,tabIndex:A,getRootProps:T,getInputProps:F,isDragActive:z,isError:ee,dropZoneContent:jsx(Fragment,{children:g?jsx(le,{children:g}):jsx(re,{header:n?.header,description:n?.description})}),children:[jsx(j,{disabled:t,helperText:s,isError:ee}),V&&jsx(Pe,{sx:{my:3,ml:.5},children:jsx(Ie,{files:d,thumbnail:!0,onRemove:I,onReorder:r?y:void 0})}),jsx(a$5,{open:Y,onClose:$,label:G,imageSrc:ie,aspectRatio:f,onInitialized:ne,onSave:N,loading:ae,cropSize:v})]})},Nr=memo(zr);var Zr=({onFileSelect:e$1,onRemove:o,file:r,id:i,disabled:t,error:m$1,helperText:s,sx:l,dropZoneSxProps:p,uploading:n,tabIndex:g,...x})=>{let A=r?[r]:[],{file:u,dropzoneProps:h,handleRemove:L}=Z({onFileSelect:e$1,onRemove:o,filesPreview:A,dropzoneOptions:{multiple:!1,disabled:t,...x}}),{getRootProps:b,getInputProps:v,isDragActive:S,isDragReject:P}=h,R=useCallback(f=>{f.stopPropagation(),L(u||void 0);},[u,L]),d=!!u,D=typeof u=="string",_=P||!!m$1;return jsx(oe,{id:i,uploading:n,disabled:t,dropZoneSxProps:p,tabIndex:g,getRootProps:b,getInputProps:v,isDragActive:S,isError:_,dropZoneContent:jsxs(Fragment,{children:[!d&&jsx(re,{}),d&&jsxs(le,{component:m.div,...j$1().inUp,spacing:2,direction:"row",alignItems:"center",sx:{my:1,px:1,py:.75,borderRadius:.75,border:f=>`solid 1px ${f.palette.divider}`,...l},children:[jsx(f,{file:u}),jsxs(le,{flexGrow:1,sx:{minWidth:0},children:[jsx(ke,{variant:"subtitle2",noWrap:!0,children:D?u:u.name}),jsx(ke,{variant:"caption",sx:{color:"text.secondary"},children:D?"":e(u.size)})]}),o&&jsx(a$3,{title:"Remover arquivo",children:jsx(qe,{edge:"end",size:"small",disabled:t,"aria-label":"Remover arquivo",onClick:R,children:jsx(a$6,{icon:"DELETE_MARK_BUTTON_02",width:16})})})]})]}),children:jsx(j,{disabled:t,helperText:s,isError:_})})},Hr=memo(Zr);var Qr=({onRemove:e,onFileSelect:o,file:r,id:i,disabled:t,error:m,helperText:s,dropZoneSxProps:l,placeholderProps:p,placeholderAlt:n,uploading:g,tabIndex:x,aspectRatio:A,enableCrop:u=!0,convertToWebp:h=!0,name:L,label:b,cropSize:v,sx:S,maxWidth:P,maxHeight:R,...d})=>{let D=r?[r]:[],[_,f]=useState(!1),{file:I,dropzoneProps:y,cropState:T,handleRemove:F,aspectRatio:z}=Z({onFileSelect:o,onRemove:e,dropzoneOptions:{accept:{"image/*":[".jpeg",".jpg",".png",".gif",".webp"]},multiple:!1,disabled:t,...d},filesPreview:D,enableCrop:u,customAspectRatio:A,convertToWebp:h,cropSize:v}),{getRootProps:q,getInputProps:Y,isDragActive:ie,isDragReject:ae}=y,{cropModalOpen:ne,imagePreview:N,cropLoading:$,onCropInitialized:k,handleCropSave:B,handleCropCancel:V}=T,ee=useCallback(()=>{F(I||void 0);},[I,F]),G=!!I,W=ae||!!m,K=G?{opacity:0}:{opacity:1},a=l?.width;return useEffect(()=>{G||f(!1);},[G]),jsxs(Se,{sx:{...S,...a&&{width:a}},children:[(g||_)&&jsx(a$7,{}),jsxs(oe,{id:i,uploading:g,disabled:t,dropZoneSxProps:l,tabIndex:x,getRootProps:q,getInputProps:Y,isDragActive:ie,isError:W,name:L,dropZoneContent:jsxs(Fragment,{children:[n?jsx(le,{sx:K,children:n}):jsx(re,{sx:K,header:p?.title,description:p?.description}),G&&jsx(Ce,{file:I,cropSize:v,isLoading:_,isUploading:g,onLoading:f,aspectRatio:z,maxWidth:P,maxHeight:R})]}),children:[jsx(j,{disabled:t,helperText:s,isError:W}),G&&e&&jsx(Je,{size:"small",onClick:ee,disabled:t,label:"Remover arquivo",children:jsx(a$6,{icon:"DELETE_MARK_BUTTON_02",width:16})}),jsx(a$5,{open:ne,onClose:V,label:b??"Ajustar Imagem",imageSrc:N,aspectRatio:z,onInitialized:k,onSave:B,loading:$,cropSize:v})]})]})},Yr=memo(Qr);var nt=({onFileSelect:e,onRemove:o,file:r,disabled:i,label:t,id:m,tabIndex:s,error:l,helperText:p,sx:n,name:g,maxSize:x,uploading:A,aspectRatio:u=1,enableCrop:h=!0,convertToWebp:L=!0,cropSize:b,...v})=>{let[S,P]=useState(!1),R=r?[r]:[],{file:d,dropzoneProps:D,cropState:_,handleRemove:f}=Z({filesPreview:R,onFileSelect:e,onRemove:o,dropzoneOptions:{accept:{"image/*":[".jpeg",".jpg",".png",".gif",".webp"]},multiple:!1,disabled:i,maxSize:x,...v},enableCrop:h,customAspectRatio:u,convertToWebp:L,cropSize:b}),{getRootProps:I,getInputProps:y,isDragActive:T,isDragReject:F}=D,{cropModalOpen:z,imagePreview:q,cropLoading:Y,onCropInitialized:ie,handleCropSave:ae,handleCropCancel:ne}=_,N=F||!!l,$=S||A,k=!!o,B=useRef(""),V=useRef();useEffect(()=>{if(!d){B.current="",V.current=void 0;return}let W=d.id??`${d.name}-${d.size}-${d.lastModified}`;if(V.current===W)return;V.current=W,P(!0);let K=URL.createObjectURL(d);return B.current=K,()=>{URL.revokeObjectURL(K);}},[d]);let ee=()=>{P(!1);},G=useCallback(()=>k&&d?()=>f(d):I().onClick,[k,d,I,f]);return jsxs(Fragment,{children:[jsxs(le,{sx:{alignItems:"center"},children:[jsxs(io,{sx:n,isError:N,isDragActive:T,hasFile:!!d,...I(),onClick:G(),children:[jsxs(ro,{children:[$&&jsx(to,{children:jsx(at,{size:135,thickness:2,color:"primary"})}),d&&jsx(ao,{alt:"Avatar Preview",src:B.current,onLoad:ee,...$&&{sx:{filter:"blur(5px) !important",scale:1.2,opacity:.7}}}),!d&&!$&&jsxs(Te,{isError:N,hasFile:!1,children:[jsx(a$6,{icon:"ADD_IMAGE",width:32}),jsx(ke,{variant:"caption",textAlign:"center",sx:{color:N?"error.main":"text.disabled"},children:"Adicionar foto"})]}),d&&!$&&jsxs(Te,{isError:N,hasFile:!0,children:[jsx(a$6,{icon:k?"DELETE_MARK_BUTTON_02":"ADD_IMAGE",width:32}),jsx(ke,{variant:"caption",textAlign:"center",sx:{color:N?"error.main":"common.white"},children:k?"Remover foto":"Alterar foto"})]})]}),jsx("input",{name:g,id:m,tabIndex:s,...y()})]}),jsx(le,{sx:{alignItems:"center",mt:-.5},children:jsx(j,{helperText:p,disabled:i,isError:N})})]}),z&&q&&jsx(a$5,{open:z,onClose:ne,label:t??"Ajustar Imagem",imageSrc:q,aspectRatio:u,onInitialized:ie,onSave:ae,loading:Y,cropSize:b,cropShape:"round"})]})},st=memo(nt);var mt=({error:e,name:o,disabled:r,sx:i,...t})=>{let{getRootProps:m,getInputProps:s,isDragActive:l,isDragReject:p}=useDropzone({disabled:r,...t}),n=p||e;return jsxs(Qe,{...m(),isDragActive:l,hasError:!!n,disabled:!!r,sx:i,"data-testid":"upload-box",children:[jsx("input",{name:o,...s()}),"Selecionar arquivo"]})},ct=memo(mt);
36
36
 
37
37
  export { ze as ContentType, _e as FileContentType, j as HelperText, Ie as MultiFilePreview, _r as MultipleFileUpload, Nr as MultipleImageUpload, Ce as SingleFilePreview, Hr as SingleFileUpload, Yr as SingleImageUpload, st as UploadAvatar, ct as UploadSimpleBox, xo as convertToWebP, hi as isImageFile, Z as useDropzoneUploader, Ir as useFileUploadService };
@@ -1,5 +1,5 @@
1
- export { a as default } from '../../chunk-JEAVENIM.js';
2
- import '../../chunk-7BK54YIS.js';
1
+ export { a as default } from '../../chunk-X6R4YXWP.js';
2
+ import '../../chunk-2FXXN6VA.js';
3
3
  import '../../chunk-ANAHA3L6.js';
4
4
  import '../../chunk-MAK4JF5M.js';
5
5
  import '../../chunk-FUB7WQS5.js';
@@ -1,4 +1,4 @@
1
- import { a } from '../../chunk-IPOTBSM7.js';
1
+ import { a } from '../../chunk-2FXBVVBD.js';
2
2
  import { a as a$1 } from '../../chunk-MAK4JF5M.js';
3
3
  import '../../chunk-FUB7WQS5.js';
4
4
  import { jsx } from 'react/jsx-runtime';
@@ -1 +1 @@
1
- export { a as default } from '../../chunk-ORLVNXTG.js';
1
+ export { a as default } from '../../chunk-2QUYG4AQ.js';
@@ -1 +1 @@
1
- export { a as default } from '../../chunk-7BK54YIS.js';
1
+ export { a as default } from '../../chunk-2FXXN6VA.js';
@@ -1,3 +1,3 @@
1
- export { a as default } from '../../chunk-5J3V35EQ.js';
1
+ export { a as default } from '../../chunk-427TWOPH.js';
2
2
  import '../../chunk-MAK4JF5M.js';
3
3
  import '../../chunk-FUB7WQS5.js';
@@ -1,6 +1,6 @@
1
- export { a as default } from '../../chunk-E4HZJEPW.js';
1
+ export { a as default } from '../../chunk-MZ5WXXHN.js';
2
2
  import '../../chunk-4ZBE3RNR.js';
3
- import '../../chunk-5J3V35EQ.js';
3
+ import '../../chunk-427TWOPH.js';
4
4
  import '../../chunk-TWGGHTU5.js';
5
5
  import '../../chunk-U26IUEAG.js';
6
6
  import '../../chunk-26GV7WKC.js';
@@ -1,5 +1,5 @@
1
1
  import { a as a$2 } from '../../chunk-4ZBE3RNR.js';
2
- import { a } from '../../chunk-5J3V35EQ.js';
2
+ import { a } from '../../chunk-427TWOPH.js';
3
3
  import { a as a$1 } from '../../chunk-TWGGHTU5.js';
4
4
  import '../../chunk-U26IUEAG.js';
5
5
  import { a as a$3 } from '../../chunk-26GV7WKC.js';
@@ -4,6 +4,7 @@ import { TimePickerProps as TimePickerProps$1 } from '@mui/x-date-pickers-pro';
4
4
  import { Dayjs } from 'dayjs';
5
5
 
6
6
  type TimePickerProps = Omit<TimePickerProps$1<Dayjs>, 'value' | 'onChange'> & {
7
+ name?: string;
7
8
  tabIndex?: number;
8
9
  helperText?: ReactNode;
9
10
  required?: boolean;
@@ -11,6 +12,6 @@ type TimePickerProps = Omit<TimePickerProps$1<Dayjs>, 'value' | 'onChange'> & {
11
12
  onChange(value: Date | null | undefined): void;
12
13
  };
13
14
 
14
- declare const TimePicker: ({ value, onChange, tabIndex, helperText, required, ...other }: TimePickerProps) => react_jsx_runtime.JSX.Element;
15
+ declare const TimePicker: ({ name, value, onChange, tabIndex, helperText, required, ...other }: TimePickerProps) => react_jsx_runtime.JSX.Element;
15
16
 
16
17
  export { TimePicker as default };
@@ -1,7 +1,7 @@
1
1
  import { TimePicker } from '@mui/x-date-pickers-pro';
2
- import s from 'dayjs';
2
+ import P from 'dayjs';
3
3
  import { jsx } from 'react/jsx-runtime';
4
4
 
5
- var P=({value:e,onChange:i,tabIndex:o,helperText:l,required:m,...r})=>jsx(TimePicker,{...r,format:"HH:mm",value:e?s(e):null,onChange:t=>i(t?t.toDate():null),slotProps:{textField:{...r.slotProps?.textField,required:m,helperText:l,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:o}},openPickerButton:{tabIndex:o}}}),k=P;
5
+ var f=({name:r,value:e,onChange:i,tabIndex:l,helperText:m,required:p,...o})=>jsx(TimePicker,{...o,format:"HH:mm",value:e?P(e):null,onChange:t=>i(t?t.toDate():null),slotProps:{textField:{...o.slotProps?.textField,name:r,required:p,helperText:m,autoComplete:"off",spellCheck:"false",fullWidth:!0},openPickerButton:{tabIndex:l}}}),k=f;
6
6
 
7
7
  export { k as default };
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { TooltipProps } from '@mui/material/Tooltip';
3
3
 
4
- declare const Tooltip: (props: TooltipProps) => react_jsx_runtime.JSX.Element;
4
+ declare const Tooltip: ({ children, ...props }: TooltipProps) => react_jsx_runtime.JSX.Element;
5
5
 
6
6
  export { Tooltip as default };
@@ -1 +1 @@
1
- export { a as default } from '../../chunk-IPOTBSM7.js';
1
+ export { a as default } from '../../chunk-2FXBVVBD.js';
@@ -1,8 +1,8 @@
1
- import { a as a$2 } from '../../../chunk-YNOYR4WX.js';
2
- import { a as a$1 } from '../../../chunk-2NMLQNWC.js';
3
- import { a as a$3 } from '../../../chunk-FOOP2WUM.js';
4
- import '../../../chunk-ORLVNXTG.js';
5
- import '../../../chunk-LLMDC6IE.js';
1
+ import { a as a$2 } from '../../../chunk-NV2X5CYP.js';
2
+ import { a as a$1 } from '../../../chunk-TF3JCVT7.js';
3
+ import { a as a$3 } from '../../../chunk-PBNDY7OR.js';
4
+ import '../../../chunk-2QUYG4AQ.js';
5
+ import '../../../chunk-GJGUIHOL.js';
6
6
  import '../../../chunk-MAK4JF5M.js';
7
7
  import '../../../chunk-FUB7WQS5.js';
8
8
  import E from '@mui/material/CircularProgress';
@@ -1,4 +1,4 @@
1
- export { a as default } from '../../../chunk-FOOP2WUM.js';
2
- import '../../../chunk-LLMDC6IE.js';
1
+ export { a as default } from '../../../chunk-PBNDY7OR.js';
2
+ import '../../../chunk-GJGUIHOL.js';
3
3
  import '../../../chunk-MAK4JF5M.js';
4
4
  import '../../../chunk-FUB7WQS5.js';
@@ -1,4 +1,4 @@
1
- import { a } from '../../../chunk-7F56LFN2.js';
1
+ import { a } from '../../../chunk-6O66AMF6.js';
2
2
  import '../../../chunk-NF42ENKE.js';
3
3
  import '../../../chunk-ILHUUK4X.js';
4
4
  import { useFormContext, Controller } from 'react-hook-form';
@@ -6,6 +6,6 @@ import u from '@mui/material/Stack';
6
6
  import M from '@mui/material/TextField';
7
7
  import { jsxs, jsx } from 'react/jsx-runtime';
8
8
 
9
- var S=({keyName:l,inputs:s=[],rules:d,tabIndex:f,...g})=>{let m=useRef(null),{control:h,setValue:C,formState:{errors:x}}=useFormContext(),E=e=>{let n=e.clipboardData.getData("text").split("");s.map((t,o)=>C(t,n[o])),e.preventDefault();},v=(e,n)=>{let{maxLength:t,value:o,name:r}=e.target,L=r.replace(l,""),p=Number(L),i=document.querySelector(`input[name=${l}${p+1}]`);o.length>t&&(e.target.value=o[0]),o.length>=t&&p<6&&i!==null&&i.focus(),n(e);};a("paste",E,m);let T=s.some(e=>x[e]);return jsxs(u,{children:[jsx(u,{direction:"row",spacing:2,justifyContent:"center",ref:m,children:s.map((e,n)=>jsx(Controller,{name:`${l}${n+1}`,control:h,rules:d,render:({field:t,fieldState:{error:o}})=>jsx(M,{...g,...t,autoComplete:"none",error:!!o,autoFocus:n===0,placeholder:"-",onChange:r=>{v(r,t.onChange);},onFocus:r=>r.currentTarget.select(),InputProps:{sx:{width:{xs:36,sm:56},height:{xs:36,sm:56},"& input":{p:0,textAlign:"center"}}},inputProps:{maxLength:1,type:"number",tabIndex:f}})},e))}),T&&jsx(b,{error:!0,sx:{px:2},children:"C\xF3digo \xE9 obrigat\xF3rio"})]})},N=S;
9
+ var S=({keyName:a$1,inputs:s=[],rules:d,tabIndex:f,...g})=>{let m=useRef(null),{control:h,setValue:C,formState:{errors:x}}=useFormContext(),E=e=>{let t=e.clipboardData.getData("text").split("");s.map((o,n)=>C(o,t[n])),e.preventDefault();},v=(e,t)=>{let{maxLength:o,value:n,name:r}=e.target,L=r.replace(a$1,""),p=Number(L),i=document.querySelector(`input[name=${a$1}${p+1}]`);n.length>o&&(e.target.value=n[0]),n.length>=o&&p<6&&i!==null&&i.focus(),t(e);};a("paste",E,m);let T=s.some(e=>x[e]);return jsxs(u,{children:[jsx(u,{direction:"row",spacing:2,justifyContent:"center",ref:m,children:s.map((e,t)=>jsx(Controller,{name:`${a$1}${t+1}`,control:h,rules:d,render:({field:o,fieldState:{error:n}})=>jsx(M,{...g,...o,autoComplete:"none",error:!!n,autoFocus:t===0,placeholder:"-",onChange:r=>{v(r,o.onChange);},onFocus:r=>r.currentTarget.select(),InputProps:{sx:{width:{xs:36,sm:56},height:{xs:36,sm:56},"& input":{p:0,textAlign:"center"}}},inputProps:{maxLength:1,type:"number",name:`${a$1}${t+1}`,tabIndex:f}})},e))}),T&&jsx(b,{error:!0,sx:{px:2},children:"C\xF3digo \xE9 obrigat\xF3rio"})]})},V=S;
10
10
 
11
- export { N as default };
11
+ export { V as default };
@@ -1,4 +1,4 @@
1
- import { a } from '../../../chunk-HZJAUQ3O.js';
1
+ import { a } from '../../../chunk-AJW3AGOS.js';
2
2
  import '../../../chunk-ORYAES3Q.js';
3
3
  import { useFormContext, Controller } from 'react-hook-form';
4
4
  import { jsx } from 'react/jsx-runtime';
@@ -1,8 +1,8 @@
1
1
  import { useFormContext, Controller } from 'react-hook-form';
2
2
  import { DatePicker } from '@mui/x-date-pickers-pro';
3
- import C from 'dayjs';
3
+ import k from 'dayjs';
4
4
  import { jsx } from 'react/jsx-runtime';
5
5
 
6
- var d=({name:o,rules:i,tabIndex:r,helperText:p,required:u,...e})=>{let{control:c}=useFormContext();return jsx(Controller,{name:o,control:c,rules:i,render:({field:{ref:m,onChange:f,...t},fieldState:{error:l}})=>jsx(DatePicker,{inputRef:m,format:"DD/MM/YYYY",...t,"data-intercom-target":o,...e,value:t.value?C(t.value):null,onChange:a=>{let n=a?a.toDate():null;f(n),e.onChange&&e.onChange(n);},slotProps:{textField:{...e.slotProps?.textField,required:u,error:!!l,helperText:l?.message||p,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:r}},openPickerButton:{tabIndex:r}}})})},x=d;
6
+ var C=({name:t,rules:s,tabIndex:i,helperText:u,required:p,...e})=>{let{control:c}=useFormContext();return jsx(Controller,{name:t,control:c,rules:s,render:({field:{ref:f,onChange:m,...o},fieldState:{error:r}})=>jsx(DatePicker,{inputRef:f,format:"DD/MM/YYYY",...o,"data-intercom-target":t,...e,value:o.value?k(o.value):null,onChange:l=>{let a=l?l.toDate():null;m(a),e.onChange&&e.onChange(a);},slotProps:{textField:{...e.slotProps?.textField,name:t,required:p,error:!!r,helperText:r?.message||u,autoComplete:"off",spellCheck:"false",fullWidth:!0},openPickerButton:{tabIndex:i}}})})},h=C;
7
7
 
8
- export { x as default };
8
+ export { h as default };
@@ -1,10 +1,10 @@
1
1
  import { useFormContext, Controller } from 'react-hook-form';
2
- import k from '@mui/material/FormHelperText';
3
- import x from '@mui/material/Stack';
2
+ import x from '@mui/material/FormHelperText';
3
+ import P from '@mui/material/Stack';
4
4
  import { DateRangePicker } from '@mui/x-date-pickers-pro';
5
- import m from 'dayjs';
5
+ import i from 'dayjs';
6
6
  import { jsx, jsxs } from 'react/jsx-runtime';
7
7
 
8
- var F=({name:a,label:s,rules:p,tabIndex:D,helperText:l,required:d,...e})=>{let{control:f,setError:c}=useFormContext();return jsx(Controller,{name:a,control:f,rules:p,render:({field:{value:o,onChange:u},fieldState:{error:r}})=>jsxs(x,{children:[jsx(DateRangePicker,{"data-intercom-target":a,...e,format:"DD/MM/YYYY",value:[o?.startDate?m(o.startDate):null,o?.endDate?m(o.endDate):null],onChange:t=>{let i={startDate:t[0]?t[0].toDate():null,endDate:t[1]?t[1].toDate():null};u(i),e.onChange&&e.onChange(i);},onError:t=>{c(a,{message:t[0]||t[1]||void 0});},slotProps:{textField:({position:t})=>({...e.slotProps?.textField,required:d,error:!!r,autoComplete:"off",spellCheck:"false",fullWidth:!0,label:t==="start"?`${s} (Dt. In\xEDcio)`:`${s} (Dt. Fim)`,inputProps:{tabIndex:D}})},sx:{width:1}}),(r?.message||l)&&jsx(k,{error:!!r,sx:{mx:"14px"},children:r?.message||l})]})})},$=F;
8
+ var C=({name:e,label:s,rules:d,tabIndex:R,helperText:l,required:D,...r})=>{let{control:f,setError:c}=useFormContext();return jsx(Controller,{name:e,control:f,rules:d,render:({field:{value:a,onChange:p},fieldState:{error:o}})=>jsxs(P,{children:[jsx(DateRangePicker,{"data-intercom-target":e,...r,format:"DD/MM/YYYY",value:[a?.startDate?i(a.startDate):null,a?.endDate?i(a.endDate):null],onChange:t=>{let m={startDate:t[0]?t[0].toDate():null,endDate:t[1]?t[1].toDate():null};p(m),r.onChange&&r.onChange(m);},onError:t=>{c(e,{message:t[0]||t[1]||void 0});},slotProps:{textField:({position:t})=>({...r.slotProps?.textField,required:D,error:!!o,autoComplete:"off",spellCheck:"false",fullWidth:!0,label:t==="start"?`${s} (Dt. In\xEDcio)`:`${s} (Dt. Fim)`,name:t==="start"?`${e}Start`:`${e}End`})},sx:{width:1}}),(o?.message||l)&&jsx(x,{error:!!o,sx:{mx:"14px"},children:o?.message||l})]})})},E=C;
9
9
 
10
- export { $ as default };
10
+ export { E as default };
@@ -1,8 +1,8 @@
1
1
  import { useFormContext, Controller } from 'react-hook-form';
2
2
  import { DateTimePicker } from '@mui/x-date-pickers-pro';
3
- import C from 'dayjs';
3
+ import k from 'dayjs';
4
4
  import { jsx } from 'react/jsx-runtime';
5
5
 
6
- var d=({name:o,rules:m,tabIndex:r,helperText:s,required:p,...e})=>{let{control:u}=useFormContext();return jsx(Controller,{name:o,control:u,rules:m,render:({field:{ref:c,onChange:f,...t},fieldState:{error:l}})=>jsx(DateTimePicker,{format:"DD/MM/YYYY HH:mm",inputRef:c,...t,"data-intercom-target":o,...e,value:t.value?C(t.value):null,onChange:a=>{let i=a?a.toDate():null;f(i),e.onChange&&e.onChange(i);},slotProps:{textField:{...e.slotProps?.textField,required:p,error:!!l,helperText:l?.message||s,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:r}},openPickerButton:{tabIndex:r}}})})},h=d;
6
+ var C=({name:t,rules:n,tabIndex:m,helperText:s,required:u,...e})=>{let{control:p}=useFormContext();return jsx(Controller,{name:t,control:p,rules:n,render:({field:{ref:c,onChange:f,...o},fieldState:{error:r}})=>jsx(DateTimePicker,{format:"DD/MM/YYYY HH:mm",inputRef:c,...o,"data-intercom-target":t,...e,value:o.value?k(o.value):null,onChange:l=>{let a=l?l.toDate():null;f(a),e.onChange&&e.onChange(a);},slotProps:{textField:{...e.slotProps?.textField,name:t,required:u,error:!!r,helperText:r?.message||s,autoComplete:"off",spellCheck:"false",fullWidth:!0},openPickerButton:{tabIndex:m}}})})},Y=C;
7
7
 
8
- export { h as default };
8
+ export { Y as default };
@@ -1 +1 @@
1
- export { a as default } from '../../../chunk-YNOYR4WX.js';
1
+ export { a as default } from '../../../chunk-NV2X5CYP.js';
@@ -1,5 +1,5 @@
1
- import { a } from '../../../chunk-JEAVENIM.js';
2
- import '../../../chunk-7BK54YIS.js';
1
+ import { a } from '../../../chunk-X6R4YXWP.js';
2
+ import '../../../chunk-2FXXN6VA.js';
3
3
  import '../../../chunk-ANAHA3L6.js';
4
4
  import '../../../chunk-MAK4JF5M.js';
5
5
  import '../../../chunk-FUB7WQS5.js';
@@ -1,10 +1,10 @@
1
1
  import { useFormContext, Controller } from 'react-hook-form';
2
- import y from '@mui/material/Autocomplete';
3
- import C from '@mui/material/Chip';
4
- import F from '@mui/material/TextField';
2
+ import h from '@mui/material/Autocomplete';
3
+ import y from '@mui/material/Chip';
4
+ import C from '@mui/material/TextField';
5
5
  import { jsx } from 'react/jsx-runtime';
6
6
  import { createElement } from 'react';
7
7
 
8
- var I=({name:a,helperText:u,rules:i,id:m,label:s,required:f})=>{let{control:d}=useFormContext();return jsx(Controller,{name:a,control:d,rules:i,render:({field:{ref:c,value:n,onChange:g},fieldState:{error:p}})=>jsx(y,{multiple:!0,options:[],freeSolo:!0,value:Array.isArray(n)?n:[],onChange:(t,r)=>{let o=r.filter(e=>typeof e=="string"?e.trim().length>0:!0);g(o);},id:m,renderTags:(t,r)=>t.map((o,e)=>createElement(C,{...r({index:e}),key:`tag-${e}`,variant:"soft",color:"primary",label:o})),renderInput:t=>jsx(F,{...t,inputRef:c,label:s,placeholder:"| Digite e tecle enter",error:!!p,helperText:p?.message||u,required:f}),"data-intercom-target":a})})},k=I;
8
+ var F=({name:r,helperText:i,rules:a,id:m,label:s,required:f})=>{let{control:d}=useFormContext();return jsx(Controller,{name:r,control:d,rules:a,render:({field:{ref:c,value:n,onChange:g},fieldState:{error:u}})=>jsx(h,{multiple:!0,options:[],freeSolo:!0,value:Array.isArray(n)?n:[],onChange:(e,o)=>{let l=o.filter(t=>typeof t=="string"?t.trim().length>0:!0);g(l);},id:m,renderTags:(e,o)=>e.map((l,t)=>createElement(y,{...o({index:t}),key:`tag-${t}`,variant:"soft",color:"primary",label:l})),renderInput:e=>jsx(C,{...e,inputRef:c,name:r,label:s,placeholder:"| Digite e tecle enter",error:!!u,helperText:u?.message||i,required:f,inputProps:{...e.inputProps,name:r}}),"data-intercom-target":r})})},k=F;
9
9
 
10
10
  export { k as default };
@@ -1,2 +1,2 @@
1
- export { a as default } from '../../../chunk-2NMLQNWC.js';
2
- import '../../../chunk-ORLVNXTG.js';
1
+ export { a as default } from '../../../chunk-TF3JCVT7.js';
2
+ import '../../../chunk-2QUYG4AQ.js';
@@ -1,8 +1,8 @@
1
1
  import { useFormContext, Controller } from 'react-hook-form';
2
- import h from '@mui/material/Autocomplete';
3
- import c from '@mui/material/TextField';
2
+ import c from '@mui/material/Autocomplete';
3
+ import d from '@mui/material/TextField';
4
4
  import { jsx } from 'react/jsx-runtime';
5
5
 
6
- var d=({name:e,label:n="",rules:m,helperText:s,changed:r,...u})=>{let{control:C}=useFormContext();return jsx(Controller,{name:e,control:C,rules:m,render:({field:l,fieldState:{error:t}})=>jsx(h,{...l,onChange:(p,i)=>{r&&r(i),l.onChange(i);},renderInput:p=>jsx(c,{label:n,error:!!t,helperText:t?t?.message:s,...p}),"data-intercom-target":e,...u})})},F=d;
6
+ var P=({name:t,label:n="",rules:m,helperText:u,changed:p,...s})=>{let{control:C}=useFormContext();return jsx(Controller,{name:t,control:C,rules:m,render:({field:i,fieldState:{error:o}})=>jsx(c,{...i,onChange:(r,l)=>{p&&p(l),i.onChange(l);},renderInput:r=>jsx(d,{label:n,error:!!o,helperText:o?o?.message:u,...r,inputProps:{...r.inputProps,name:t}}),"data-intercom-target":t,...s})})},M=P;
7
7
 
8
- export { F as default };
8
+ export { M as default };
@@ -1,4 +1,4 @@
1
- import { a } from '../../../chunk-7BK54YIS.js';
1
+ import { a } from '../../../chunk-2FXXN6VA.js';
2
2
  import { useFormContext, Controller } from 'react-hook-form';
3
3
  import { jsx } from 'react/jsx-runtime';
4
4
 
@@ -1,4 +1,4 @@
1
- import { a } from '../../../chunk-YNOYR4WX.js';
1
+ import { a } from '../../../chunk-NV2X5CYP.js';
2
2
  import { d } from '../../../chunk-KOELUX3V.js';
3
3
  import { a as a$1 } from '../../../chunk-MAK4JF5M.js';
4
4
  import '../../../chunk-FUB7WQS5.js';
@@ -1,6 +1,6 @@
1
- import { a } from '../../../chunk-E4HZJEPW.js';
1
+ import { a } from '../../../chunk-MZ5WXXHN.js';
2
2
  import '../../../chunk-4ZBE3RNR.js';
3
- import '../../../chunk-5J3V35EQ.js';
3
+ import '../../../chunk-427TWOPH.js';
4
4
  import '../../../chunk-TWGGHTU5.js';
5
5
  import '../../../chunk-U26IUEAG.js';
6
6
  import '../../../chunk-26GV7WKC.js';
@@ -1,8 +1,8 @@
1
1
  import { useFormContext, Controller } from 'react-hook-form';
2
2
  import { TimePicker } from '@mui/x-date-pickers-pro';
3
- import d from 'dayjs';
3
+ import C from 'dayjs';
4
4
  import { jsx } from 'react/jsx-runtime';
5
5
 
6
- var T=({name:t,rules:a,tabIndex:r,helperText:s,required:p,...e})=>{let{control:u}=useFormContext();return jsx(Controller,{name:t,control:u,rules:a,render:({field:{ref:c,onChange:f,...o},fieldState:{error:l}})=>jsx(TimePicker,{ampm:!1,format:"HH:mm",inputRef:c,...o,"data-intercom-target":t,...e,value:o.value?d(o.value):null,onChange:i=>{let m=i?i.toDate():null;f(m),e.onChange&&e.onChange(m);},slotProps:{textField:{...e.slotProps?.textField,error:!!l,required:p,helperText:l?.message||s,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:r}},openPickerButton:{tabIndex:r}}})})},F=T;
6
+ var T=({name:o,rules:n,tabIndex:a,helperText:s,required:p,...e})=>{let{control:u}=useFormContext();return jsx(Controller,{name:o,control:u,rules:n,render:({field:{ref:c,onChange:f,...t},fieldState:{error:r}})=>jsx(TimePicker,{ampm:!1,format:"HH:mm",inputRef:c,...t,"data-intercom-target":o,...e,value:t.value?C(t.value):null,onChange:l=>{let i=l?l.toDate():null;f(i),e.onChange&&e.onChange(i);},slotProps:{textField:{...e.slotProps?.textField,name:o,error:!!r,required:p,helperText:r?.message||s,autoComplete:"off",spellCheck:"false",fullWidth:!0},openPickerButton:{tabIndex:a}}})})},F=T;
7
7
 
8
8
  export { F as default };
@@ -1,9 +1,9 @@
1
- import { b } from '../../../chunk-DI3IT446.js';
2
- import '../../../chunk-4VAXJ4XM.js';
1
+ import { b } from '../../../chunk-GVJPNJEL.js';
2
+ import '../../../chunk-7WCRRQEW.js';
3
3
  import '../../../chunk-2E4HVMRH.js';
4
4
  import '../../../chunk-T7I256S6.js';
5
- import '../../../chunk-ANAHA3L6.js';
6
5
  import '../../../chunk-5NOG7L7I.js';
6
+ import '../../../chunk-ANAHA3L6.js';
7
7
  import '../../../chunk-D27ND54J.js';
8
8
  import '../../../chunk-X24QANPC.js';
9
9
  import '../../../chunk-MAK4JF5M.js';
@@ -1,11 +1,11 @@
1
- import { e } from '../../../chunk-B3PCCRUQ.js';
2
- import '../../../chunk-4VAXJ4XM.js';
1
+ import { e } from '../../../chunk-OYK7T66A.js';
2
+ import '../../../chunk-7WCRRQEW.js';
3
3
  import '../../../chunk-2E4HVMRH.js';
4
4
  import '../../../chunk-T7I256S6.js';
5
5
  import '../../../chunk-H5L4ARDB.js';
6
- import '../../../chunk-ANAHA3L6.js';
7
6
  import '../../../chunk-5NOG7L7I.js';
8
- import '../../../chunk-B42VMENU.js';
7
+ import '../../../chunk-ANAHA3L6.js';
8
+ import '../../../chunk-DXACBPEV.js';
9
9
  import '../../../chunk-2P4CXK3O.js';
10
10
  import '../../../chunk-FK7DDO5L.js';
11
11
  import '../../../chunk-D27ND54J.js';
@@ -1,7 +1,7 @@
1
- import { a } from '../../../chunk-YNOYR4WX.js';
2
- import { a as a$2 } from '../../../chunk-FOOP2WUM.js';
1
+ import { a } from '../../../chunk-NV2X5CYP.js';
2
+ import { a as a$2 } from '../../../chunk-PBNDY7OR.js';
3
3
  import { a as a$3 } from '../../../chunk-4AQVF2LZ.js';
4
- import '../../../chunk-LLMDC6IE.js';
4
+ import '../../../chunk-GJGUIHOL.js';
5
5
  import { a as a$1 } from '../../../chunk-MAK4JF5M.js';
6
6
  import '../../../chunk-FUB7WQS5.js';
7
7
  import { useFormContext, useFieldArray } from 'react-hook-form';
@@ -1,13 +1,13 @@
1
- export { a as UploadAvatar, b as UploadAvatarWithCrop } from '../../chunk-DI3IT446.js';
2
- export { c as DeleteButton, a as MultiFilePreview, b as SingleFilePreview, d as Upload, e as UploadWithCrop } from '../../chunk-B3PCCRUQ.js';
3
- import { o } from '../../chunk-4VAXJ4XM.js';
4
- export { p as RejectionFiles } from '../../chunk-4VAXJ4XM.js';
1
+ export { a as UploadAvatar, b as UploadAvatarWithCrop } from '../../chunk-GVJPNJEL.js';
2
+ export { c as DeleteButton, a as MultiFilePreview, b as SingleFilePreview, d as Upload, e as UploadWithCrop } from '../../chunk-OYK7T66A.js';
3
+ import { o } from '../../chunk-7WCRRQEW.js';
4
+ export { p as RejectionFiles } from '../../chunk-7WCRRQEW.js';
5
5
  import '../../chunk-2E4HVMRH.js';
6
6
  import '../../chunk-T7I256S6.js';
7
7
  import '../../chunk-H5L4ARDB.js';
8
- import '../../chunk-ANAHA3L6.js';
9
8
  import '../../chunk-5NOG7L7I.js';
10
- import '../../chunk-B42VMENU.js';
9
+ import '../../chunk-ANAHA3L6.js';
10
+ import '../../chunk-DXACBPEV.js';
11
11
  import '../../chunk-2P4CXK3O.js';
12
12
  import '../../chunk-FK7DDO5L.js';
13
13
  import '../../chunk-D27ND54J.js';
@@ -443,7 +443,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
443
443
  wordWrap?: csstype.Property.WordWrap | readonly NonNullable<csstype.Property.WordWrap | undefined>[] | readonly csstype.Property.WordWrap[] | undefined;
444
444
  writingMode?: csstype.Property.WritingMode | readonly NonNullable<csstype.Property.WritingMode | undefined>[] | readonly csstype.Property.WritingMode[] | undefined;
445
445
  zIndex?: csstype.Property.ZIndex | readonly NonNullable<csstype.Property.ZIndex | undefined>[] | readonly ((string & {}) | csstype.Globals | "auto")[] | undefined;
446
- zoom?: csstype.Property.Zoom | readonly NonNullable<csstype.Property.Zoom | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reset")[] | undefined;
446
+ zoom?: csstype.Property.Zoom | readonly NonNullable<csstype.Property.Zoom | undefined>[] | readonly ("reset" | (string & {}) | csstype.Globals | "normal")[] | undefined;
447
447
  all?: csstype.Globals | readonly NonNullable<csstype.Globals | undefined>[] | readonly csstype.Globals[] | undefined;
448
448
  animation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reverse" | "auto" | "none" | "both" | "alternate" | "alternate-reverse" | "backwards" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
449
449
  animationRange?: csstype.Property.AnimationRange<string | number> | readonly NonNullable<csstype.Property.AnimationRange<string | number> | undefined>[] | readonly (string | (string & {}))[] | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zydon/common",
3
- "version": "2.5.11",
3
+ "version": "2.5.13",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
@@ -1,10 +0,0 @@
1
- import { a } from './chunk-MAK4JF5M.js';
2
- import { useRef } from 'react';
3
- import A from '@mui/material/IconButton';
4
- import c from '@mui/material/InputAdornment';
5
- import h from '@mui/material/TextField';
6
- import { jsx, jsxs } from 'react/jsx-runtime';
7
-
8
- var g=({onSearch:n,onChange:p,trigger:l="click",iconPosition:r="end",tabIndex:d,InputProps:e,iconButtonAriaLabel:I="Buscar",...i})=>{let o=useRef(null),m=jsx(A,{color:"inherit",onClick:()=>{n(o.current?.value);},"aria-label":I,children:jsx(a,{icon:"SEARCH_MAGNIFYING_GLASS",width:20,height:20})});return jsx(h,{inputRef:o,InputProps:{...e,onKeyDown:t=>{t.key==="Enter"&&n(o.current?.value);},...r==="start"?{startAdornment:jsxs(c,{position:r,children:[m,e?.startAdornment]})}:{endAdornment:jsxs(c,{position:r,children:[m,e?.endAdornment]})}},inputProps:{tabIndex:d,...i.inputProps},onChange:t=>{if(l==="change"){n(t.target.value);return}t.target.value===""&&n(""),p&&p(t);},...i})},G=g;
9
-
10
- export { G as a };
@@ -1,8 +0,0 @@
1
- import { forwardRef, useState, useRef, useEffect } from 'react';
2
- import { NumericFormat } from 'react-number-format';
3
- import A from '@mui/material/TextField';
4
- import { jsx } from 'react/jsx-runtime';
5
-
6
- var c=forwardRef(({decimalScale:m=0,fixedDecimalScale:s=!0,prefix:d,allowNegative:I,minValue:r,maxValue:n=1/0,maxLength:N,value:T,inputProps:b,InputProps:g,size:y,disabled:S,name:u,helperText:h,error:x,fullWidth:R,label:v,required:w,onChange:t,tabIndex:D,placeholder:F,margin:P,className:k,delay:l},E)=>{let[L,V]=useState(Date.now()),e=useRef(null),i=()=>V(Date.now()),q=(z,o)=>{if(!t)return;e.current&&clearTimeout(e.current);let p=()=>{let{floatValue:a}=z,f=a||0;if(r!==void 0&&r>f){t({target:{name:u,value:r},event:o}),i();return}if(a!==void 0&&n<f){t({target:{name:u,value:n},event:o}),i();return}t({target:{name:u,value:a},event:o});};l===0?p():e.current=setTimeout(p,l||1e3);};return useEffect(()=>()=>{e.current&&clearTimeout(e.current);},[]),jsx(NumericFormat,{getInputRef:E,value:T,prefix:d,decimalSeparator:",",thousandSeparator:".",decimalScale:m,fixedDecimalScale:s,autoComplete:"off",allowNegative:I,maxLength:N,onValueChange:q,customInput:A,InputProps:{...g},inputProps:{...b,tabIndex:D},disabled:S,size:y,helperText:h,error:x,fullWidth:R,label:v,required:w,placeholder:F,margin:P,className:k},L)});c.displayName="NumberInput";var X=c;
7
-
8
- export { X as a };