@zydon/common 2.5.12 → 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.
- package/dist/chunk-2FXBVVBD.js +7 -0
- package/dist/chunk-2FXXN6VA.js +8 -0
- package/dist/chunk-2QUYG4AQ.js +8 -0
- package/dist/chunk-427TWOPH.js +10 -0
- package/dist/chunk-6O66AMF6.js +17 -0
- package/dist/{chunk-4VAXJ4XM.js → chunk-7WCRRQEW.js} +2 -2
- package/dist/{chunk-HZJAUQ3O.js → chunk-AJW3AGOS.js} +1 -1
- package/dist/chunk-DXACBPEV.js +9 -0
- package/dist/chunk-GJGUIHOL.js +17 -0
- package/dist/{chunk-DI3IT446.js → chunk-GVJPNJEL.js} +1 -1
- package/dist/{chunk-E4HZJEPW.js → chunk-MZ5WXXHN.js} +1 -1
- package/dist/chunk-NV2X5CYP.js +7 -0
- package/dist/{chunk-B3PCCRUQ.js → chunk-OYK7T66A.js} +2 -2
- package/dist/{chunk-FOOP2WUM.js → chunk-PBNDY7OR.js} +1 -1
- package/dist/{chunk-2NMLQNWC.js → chunk-TF3JCVT7.js} +1 -1
- package/dist/{chunk-JEAVENIM.js → chunk-X6R4YXWP.js} +1 -1
- package/dist/components/Autocomplete/index.js +1 -1
- package/dist/components/AutocompleteDetailed/index.js +1 -1
- package/dist/components/ColorPickerInput/index.js +1 -1
- package/dist/components/DataView/index.js +1 -1
- package/dist/components/DatePicker/index.d.ts +2 -1
- package/dist/components/DatePicker/index.js +3 -3
- package/dist/components/DateRangePicker/index.d.ts +2 -1
- package/dist/components/DateRangePicker/index.js +2 -2
- package/dist/components/DateTimePicker/index.d.ts +2 -1
- package/dist/components/DateTimePicker/index.js +3 -3
- package/dist/components/DragButton/index.js +1 -1
- package/dist/components/DragContainer/index.js +3 -3
- package/dist/components/FileUpload/index.js +3 -3
- package/dist/components/Incrementer/index.js +2 -2
- package/dist/components/InfoCircle/index.js +1 -1
- package/dist/components/MaskedInput/index.js +1 -1
- package/dist/components/NumberInput/index.js +1 -1
- package/dist/components/SearchInput/index.js +1 -1
- package/dist/components/SelectableCards/index.js +2 -2
- package/dist/components/SwapList/index.js +1 -1
- package/dist/components/TimePicker/index.d.ts +2 -1
- package/dist/components/TimePicker/index.js +2 -2
- package/dist/components/Tooltip/index.d.ts +1 -1
- package/dist/components/Tooltip/index.js +1 -1
- package/dist/components/form/Address/index.js +5 -5
- package/dist/components/form/Autocomplete/index.js +2 -2
- package/dist/components/form/AutocompleteDetailed/index.js +1 -1
- package/dist/components/form/Codes/index.js +2 -2
- package/dist/components/form/ColorPicker/index.js +1 -1
- package/dist/components/form/DatePicker/index.js +3 -3
- package/dist/components/form/DateRangePicker/index.js +5 -5
- package/dist/components/form/DateTimePicker/index.js +3 -3
- package/dist/components/form/Field/index.js +1 -1
- package/dist/components/form/Incrementer/index.js +2 -2
- package/dist/components/form/InputTags/index.js +4 -4
- package/dist/components/form/MaskedInput/index.js +2 -2
- package/dist/components/form/MultiChipField/index.js +4 -4
- package/dist/components/form/NumberInput/index.js +1 -1
- package/dist/components/form/Password/index.js +1 -1
- package/dist/components/form/SelectableCards/index.js +2 -2
- package/dist/components/form/TimePicker/index.js +2 -2
- package/dist/components/form/UploadAvatarWithCrop/index.js +2 -2
- package/dist/components/form/UploadWithCrop/index.js +3 -3
- package/dist/components/form/Webhook/index.js +3 -3
- package/dist/components/upload/index.js +5 -5
- package/dist/theme/styles/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunk-5J3V35EQ.js +0 -10
- package/dist/chunk-7BK54YIS.js +0 -8
- package/dist/chunk-7F56LFN2.js +0 -17
- package/dist/chunk-B42VMENU.js +0 -9
- package/dist/chunk-IPOTBSM7.js +0 -6
- package/dist/chunk-LLMDC6IE.js +0 -17
- package/dist/chunk-ORLVNXTG.js +0 -8
- package/dist/chunk-YNOYR4WX.js +0 -7
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { cloneElement } from 'react';
|
|
2
|
+
import p from '@mui/material/Tooltip';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
var i=({children:t,...e})=>{let o=t;return jsx(p,{...e,children:cloneElement(o,{style:{userSelect:"none",...o.props.style}})})},T=i;
|
|
6
|
+
|
|
7
|
+
export { T as a };
|
|
@@ -0,0 +1,8 @@
|
|
|
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:s=0,fixedDecimalScale:m=!0,prefix:d,allowNegative:I,minValue:u,maxValue:n=1/0,maxLength:N,value:T,inputProps:b,InputProps:g,size:y,disabled:S,name:t,helperText:h,error:x,fullWidth:R,label:v,required:w,onChange:r,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(!r)return;e.current&&clearTimeout(e.current);let p=()=>{let{floatValue:a}=z,f=a||0;if(u!==void 0&&u>f){r({target:{name:t,value:u},event:o}),i();return}if(a!==void 0&&n<f){r({target:{name:t,value:n},event:o}),i();return}r({target:{name:t,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:s,fixedDecimalScale:m,autoComplete:"off",allowNegative:I,maxLength:N,onValueChange:q,customInput:A,InputProps:{...g},inputProps:{...b,name:t,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 };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { forwardRef, useState } from 'react';
|
|
2
|
+
import { IMaskMixin } from 'react-imask';
|
|
3
|
+
import f from '@mui/material/TextField';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var k=IMaskMixin(t=>{let{inputRef:e,"data-value":n,defaultValue:u,tabIndex:p,name:s,...a}=t;return jsx(f,{inputRef:e,fullWidth:!0,...a,inputProps:{...a.inputProps,name:s,tabIndex:p},value:n,"data-testid":"masked-input-wrapper"})}),d=forwardRef(({onChange:t,name:e,...n},u)=>{let[p,s]=useState("");return jsx(k,{inputRef:u,name:e,"data-value":p,...n,onAccept:(a,o)=>{s(a),t({target:{name:e,value:o._unmaskedValue}});}})});d.displayName="MaskedInput";var P=d;
|
|
7
|
+
|
|
8
|
+
export { P as a };
|
|
@@ -0,0 +1,10 @@
|
|
|
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 g from '@mui/material/TextField';
|
|
6
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
var h=({onSearch:n,onChange:m,trigger:l="click",iconPosition:r="end",tabIndex:d,InputProps:e,iconButtonAriaLabel:I="Buscar",...o})=>{let u=useRef(null),i=jsx(A,{color:"inherit",onClick:()=>{n(u.current?.value);},"aria-label":I,children:jsx(a,{icon:"SEARCH_MAGNIFYING_GLASS",width:20,height:20})});return jsx(g,{inputRef:u,InputProps:{...e,onKeyDown:t=>{t.key==="Enter"&&n(u.current?.value);},...r==="start"?{startAdornment:jsxs(c,{position:r,children:[i,e?.startAdornment]})}:{endAdornment:jsxs(c,{position:r,children:[i,e?.endAdornment]})}},inputProps:{tabIndex:d,name:o.name,...o.inputProps},onChange:t=>{if(l==="change"){n(t.target.value);return}t.target.value===""&&n(""),m&&m(t);},...o})},G=h;
|
|
9
|
+
|
|
10
|
+
export { G as a };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { a } from './chunk-NF42ENKE.js';
|
|
2
|
+
import { b } from './chunk-ILHUUK4X.js';
|
|
3
|
+
import O, { forwardRef, useState, useMemo, useEffect } from 'react';
|
|
4
|
+
import be, { autocompleteClasses } from '@mui/material/Autocomplete';
|
|
5
|
+
import ge from '@mui/material/CircularProgress';
|
|
6
|
+
import he from '@mui/material/TextField';
|
|
7
|
+
import { VariableSizeList } from 'react-window';
|
|
8
|
+
import W from '@mui/material/Typography';
|
|
9
|
+
import oe from '@mui/material/Divider';
|
|
10
|
+
import L from '@mui/material/Stack';
|
|
11
|
+
import re from '@mui/material/Popper';
|
|
12
|
+
import { styled } from '@mui/material/styles';
|
|
13
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
14
|
+
|
|
15
|
+
var H=styled(re)({[`& .${autocompleteClasses.listbox}`]:{boxSizing:"border-box","& ul":{padding:0,margin:0}}}),D=styled(L)(({theme:e})=>({flex:1,width:"100%",gap:6,[e.breakpoints.down("md")]:{flexDirection:"column"},[e.breakpoints.up("md")]:{flexDirection:"row"}})),T=styled(L)(({theme:e})=>({flex:1,maxWidth:"100%",gap:6,[e.breakpoints.up("md")]:{flex:"1 1 calc(50% - 8px)",width:"calc(50% - 8px)",minWidth:"calc(50% - 8px)",maxWidth:"calc(50% - 8px)"}})),R=styled(L)(({theme:e})=>({position:"relative",alignItems:"center",justifyContent:"center",width:68,height:68,borderRadius:8,overflow:"hidden",img:{position:"absolute",width:"100%",height:"100%",objectFit:"cover"},[e.breakpoints.down("sm")]:{display:"none"}}));var ne=({option:e})=>{let t=Object.keys(e).filter(i=>i.startsWith("field")).map((i,s)=>{let a=e[i];if(a&&typeof a=="object"){let m="label"in a?a.label:null,u="value"in a?a.value:null;return jsxs(W,{component:"span",variant:"body2",color:"textPrimary",noWrap:!0,children:[m,": ",u]},`${i}:${s}`)}}),l=e.image?jsx("img",{alt:"Imagem",src:e.image}):jsx(a,{alt:e.label||e.value.toString(),name:e.label||e.value.toString(),sx:{width:68,height:68,borderRadius:1}});return jsxs(Fragment,{children:[jsxs(L,{direction:"row",gap:2,margin:2,children:[jsx(R,{children:l}),jsxs(L,{flex:1,overflow:"hidden",children:[jsxs(W,{variant:"subtitle2",color:"textPrimary",noWrap:!0,flex:1,children:[e.value," - ",e.label]}),t.length>0&&jsxs(D,{width:1,children:[jsxs(T,{children:[t[0]?t[0]:void 0,t[1]?t[1]:void 0]}),(t[2]||t[3])&&jsxs(T,{children:[t[2]?t[2]:void 0,t[3]?t[3]:void 0]})]})]})]}),jsx(oe,{className:"border",sx:{borderStyle:"dashed",position:"absolute",bottom:0,width:1}})]})},S=ne;var N=8,me=e=>{let{data:t,index:l,style:i}=e,s=t[l],a={...i,top:i.top+N,paddingTop:8,display:"block"};return jsx(W,{component:"li",...s.props,noWrap:!0,style:a,children:jsx(S,{...s?.props?.children?.props})})},X=O.createContext({}),B=forwardRef((e,t)=>{let l=O.useContext(X);return jsx("div",{ref:t,...e,...l})});B.displayName="OuterElementType";var pe=e=>{let t=O.useRef(null);return useEffect(()=>{t.current!=null&&t.current.resetAfterIndex(0,!0);},[e]),t},de=forwardRef(function(t,l){let{children:i,"data-item-height":s,...a}=t,m=[];i.forEach(p=>{m.push(p),m.push(...p.children||[]);});let u=m.length,h=s>112?s:112,y=p=>Object.prototype.hasOwnProperty.call(p,"group")?48:h,b=()=>u>8?8*h:m.map(y).reduce((p,c)=>p+c,0),C=pe(u);return jsx("div",{ref:l,children:jsx(X.Provider,{value:a,children:jsx(VariableSizeList,{itemData:m,height:b()+2*N,width:"100%",ref:C,outerElementType:B,innerElementType:"ul",itemSize:p=>y(m[p]),overscanCount:5,itemCount:u,children:me})})})}),J=de;var j=forwardRef(({name:e,label:t,value:l,options:i=[],loading:s,noOptionsText:a="Nenhum resultado encontrado.",loadingText:m="Carregando op\xE7\xF5es...",error:u,helperText:h,placeholder:y,onChange:b$1,groupBy:C,disabled:p,multiple:c,required:G,renderOption:U,tabIndex:V,onSearch:P,onInputChange:w,..._},F)=>{let[q,I]=useState(),K=b("down","md"),Q=o=>o&&typeof o=="object"?o.value.toString():o.toString(),Y=useMemo(()=>c?(Array.isArray(l)?l:[]).reduce((r,A)=>{let E=i.find(ee=>ee.value.toString()===A.toString());return E?[...r,E]:[...r]},[]):i.find(n=>n.value.toString()===l?.toString())||null,[i,l,c]),Z=K&&i[0]?Object.keys(i[0]).length*24:void 0;return jsx(be,{ref:F,value:q||Y,onInputChange:(o,n,r)=>{if(w&&w(o,n,r),r==="input"){P&&P(n),I(n);return}I(void 0);},options:i,loading:s,noOptionsText:a,loadingText:m,disabled:s||p,disableListWrap:!0,PopperComponent:H,ListboxProps:{"data-item-height":Z},ListboxComponent:U?void 0:J,filterOptions:(o,n)=>o.filter(r=>`${r.field1?.value} ${r.field1?.label} ${r.field2?.label} ${r.field2?.value} ${r.field3?.label} ${r.field3?.value} ${r.field4?.label} ${r.field4?.value} ${r.field5?.label} ${r.field5?.value} ${r.label}${r.value}`.toLocaleUpperCase().includes(n.inputValue.toLocaleUpperCase())),onChange:(o,n)=>{if(!n){b$1(c?[]:null);return}if(Array.isArray(n)){b$1(n.map(Q));return}b$1(typeof n=="string"?n.toString():n.value.toString());},renderOption:({key:o,...n},r)=>jsx("li",{...n,style:{display:"block"},children:jsx(S,{option:r})},o),renderGroup:o=>o,groupBy:C,multiple:c,renderInput:o=>jsx(he,{...o,name:e,placeholder:y,fullWidth:!0,error:!!u,helperText:h,label:t,required:G,InputProps:{...o.InputProps,endAdornment:jsxs(Fragment,{children:[s?jsx(ge,{color:"primary",size:20}):null,o.InputProps.endAdornment]})},inputProps:{...o.inputProps,name:e,tabIndex:V}}),..._})});j.displayName="Autocomplete";var Ke=j;
|
|
16
|
+
|
|
17
|
+
export { Ke as a };
|
|
@@ -6,10 +6,10 @@ import z from '@mui/material/Typography';
|
|
|
6
6
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
7
|
import E from '@mui/material/CircularProgress';
|
|
8
8
|
import i from '@mui/material/IconButton';
|
|
9
|
-
import
|
|
9
|
+
import l from '@mui/material/Stack';
|
|
10
10
|
import { styled, alpha } from '@mui/material/styles';
|
|
11
11
|
import { m } from 'framer-motion';
|
|
12
12
|
|
|
13
|
-
var y=["pdf"],f=["txt"],h=["psd"],I=["doc","docx"],k=["xls","xlsx"],v=["zip","rar","iso"],w=["ai","esp"],C=["ppt","pptx"],F=["wav","aif","mp3","aac"],R=["jpg","jpeg","gif","bmp","png","svg","webp"],T=["m4v","avi","mpg","mp4","webm"];function O(o){let e,t=s(o);switch(o.includes(t)){case f.includes(t):e="txt";break;case v.includes(t):e="zip";break;case F.includes(t):e="audio";break;case R.includes(t):e="image";break;case T.includes(t):e="video";break;case I.includes(t):e="word";break;case k.includes(t):e="excel";break;case C.includes(t):e="powerpoint";break;case y.includes(t):e="pdf";break;case h.includes(t):e="photoshop";break;case w.includes(t):e="illustrator";break;case o?.startsWith("http"):e="image";break;default:e=s(o);}return e}function B(o){let e;switch(O(o)){case"folder":e="IC_FOLDER";break;case"txt":e="IC_TXT";break;case"zip":e="IC_ZIP";break;case"audio":e="IC_AUDIO";break;case"video":e="IC_VIDEO";break;case"word":e="IC_WORD";break;case"excel":e="IC_EXCEL";break;case"powerpoint":e="IC_POWER_POINT";break;case"pdf":e="IC_PDF";break;case"photoshop":e="IC_PTS";break;case"illustrator":e="IC_AI";break;case"image":e="IC_IMG";break;default:e="IC_FILE";}return e}function s(o){return o&&o.split(".").pop()||""}function _(o){return o.split("/").pop()}function g(o){return typeof o=="string"?{key:o,preview:o,name:_(o),type:s(o),size:void 0,path:o,lastModified:void 0,lastModifiedDate:void 0}:{key:`key:${o.name}`,name:o.name,size:o.size,path:o.path,type:o.type,preview:o.preview,lastModified:o.lastModified,lastModifiedDate:o.lastModifiedDate}}function U({files:o}){return o.length?jsx(D,{variant:"outlined",sx:{py:1,px:2,mt:3,textAlign:"left",borderStyle:"dashed",borderColor:"error.main",bgcolor:e=>i$1(e.vars.palette.error.mainChannel,.08)},children:o.map(({file:e$1,errors:t})=>{let{path:n,size:
|
|
13
|
+
var y=["pdf"],f=["txt"],h=["psd"],I=["doc","docx"],k=["xls","xlsx"],v=["zip","rar","iso"],w=["ai","esp"],C=["ppt","pptx"],F=["wav","aif","mp3","aac"],R=["jpg","jpeg","gif","bmp","png","svg","webp"],T=["m4v","avi","mpg","mp4","webm"];function O(o){let e,t=s(o);switch(o.includes(t)){case f.includes(t):e="txt";break;case v.includes(t):e="zip";break;case F.includes(t):e="audio";break;case R.includes(t):e="image";break;case T.includes(t):e="video";break;case I.includes(t):e="word";break;case k.includes(t):e="excel";break;case C.includes(t):e="powerpoint";break;case y.includes(t):e="pdf";break;case h.includes(t):e="photoshop";break;case w.includes(t):e="illustrator";break;case o?.startsWith("http"):e="image";break;default:e=s(o);}return e}function B(o){let e;switch(O(o)){case"folder":e="IC_FOLDER";break;case"txt":e="IC_TXT";break;case"zip":e="IC_ZIP";break;case"audio":e="IC_AUDIO";break;case"video":e="IC_VIDEO";break;case"word":e="IC_WORD";break;case"excel":e="IC_EXCEL";break;case"powerpoint":e="IC_POWER_POINT";break;case"pdf":e="IC_PDF";break;case"photoshop":e="IC_PTS";break;case"illustrator":e="IC_AI";break;case"image":e="IC_IMG";break;default:e="IC_FILE";}return e}function s(o){return o&&o.split(".").pop()||""}function _(o){return o.split("/").pop()}function g(o){return typeof o=="string"?{key:o,preview:o,name:_(o),type:s(o),size:void 0,path:o,lastModified:void 0,lastModifiedDate:void 0}:{key:`key:${o.name}`,name:o.name,size:o.size,path:o.path,type:o.type,preview:o.preview,lastModified:o.lastModified,lastModifiedDate:o.lastModifiedDate}}function U({files:o}){return o.length?jsx(D,{variant:"outlined",sx:{py:1,px:2,mt:3,textAlign:"left",borderStyle:"dashed",borderColor:"error.main",bgcolor:e=>i$1(e.vars.palette.error.mainChannel,.08)},children:o.map(({file:e$1,errors:t})=>{let{path:n,size:d}=g(e$1),m=d?e(d):"";return jsxs(x,{sx:{my:1},children:[jsxs(z,{variant:"subtitle2",noWrap:!0,children:[n," - ",m," "]}),t.map(c=>jsxs(x,{component:"span",sx:{typography:"caption"},children:["- ",c.message]},c.code))]},n)})}):null}var Y=styled(l)({position:"relative",width:"100%",borderRadius:8,overflow:"hidden","&:hover .actions":{display:"flex"}}),oo=styled(l)(({theme:o})=>({display:"none",position:"absolute",alignItems:"center",justifyContent:"center",flexDirection:"row",gap:12,width:"100%",height:"100%",backgroundColor:alpha(o.palette.primary.main,.9),zIndex:999,button:{"&, &:hover, &:focus":{backgroundColor:"#fff"}}})),eo=styled(E)({position:"absolute",width:"100%",height:"100%",zIndex:99,backgroundColor:"#fff",borderRadius:"50%"}),to=styled(i)(({theme:o})=>({position:"relative",zIndex:999,pointerEvents:"auto",bgcolor:alpha(o.palette.grey[900],.72),"&:hover":{backgroundColor:alpha(o.palette.grey[900],.48)}})),ro=styled("div")({position:"relative",zIndex:1,userSelect:"none","&:hover":{zIndex:2}}),ao=styled(l)(({theme:o,width:e,isDragging:t})=>({width:e,height:80,alignItems:"center",display:"inline-flex",justifyContent:"center",margin:o.spacing(.5),padding:o.spacing(2,1,2,1),borderRadius:o.spacing(1.25),overflow:"hidden",position:"relative",border:`solid 1px ${o.palette.divider}`,backgroundColor:o.palette.common.white,zIndex:1,transition:"box-shadow 150ms ease-in-out",boxShadow:t?`0 0 0 2px ${o.palette.primary.main}, ${o.customShadows.z8}, inset 0 0 0 1000px ${alpha(o.palette.primary.main,.06)}`:"0px 0px 0px 0px rgba(0, 0, 0, 0)"})),io=styled(m.div)(({theme:o,width:e,isDragging:t})=>({width:e,height:60,alignItems:"center",display:"inline-flex",justifyContent:"center",margin:o.spacing(.5),padding:o.spacing(2),borderRadius:o.spacing(1.25),overflow:"hidden",position:"relative",border:`solid 1px ${o.palette.divider}`,backgroundColor:o.palette.common.white,zIndex:1,transition:"box-shadow 150ms ease-in-out",boxShadow:t?`0 0 0 2px ${o.palette.primary.main}, ${o.customShadows.z8}, inset 0 0 0 1000px ${alpha(o.palette.primary.main,.06)}`:"0px 0px 0px 0px rgba(0, 0, 0, 0)"})),no=styled(i)(({theme:o})=>({width:36,height:36,position:"absolute",top:10,right:10,borderRadius:0,zIndex:1,opacity:0,transition:"opacity 50ms ease-in-out",color:o.palette.error.main,backgroundColor:alpha(o.palette.common.white,.8),"&:hover":{backgroundColor:alpha(o.palette.common.white,.8),opacity:1}})),so=styled(i)(({theme:o})=>({width:24,height:24,position:"absolute",top:18,right:8,borderRadius:12,opacity:1,zIndex:1,transition:"opacity 50ms ease-in-out",color:o.palette.grey[500],backgroundColor:o.palette.common.white,"&:hover":{backgroundColor:o.palette.common.white}})),po=styled(i,{shouldForwardProp:o=>o!=="isMainImage"})(({theme:o,isMainImage:e})=>({color:e?o.palette.secondary.main:o.palette.action.disabled,backgroundColor:o.palette.common.white," &:hover":{backgroundColor:o.palette.common.white},top:4,left:8,padding:o.spacing(.5),border:"1px solid",borderColor:e?o.palette.secondary.main:o.palette.divider})),lo=styled(i)(({theme:o})=>({top:16,right:16,zIndex:9,position:"absolute",color:alpha(o.palette.common.white,.8),bgcolor:alpha(o.palette.grey[900],.72),"&:hover":{bgcolor:alpha(o.palette.grey[900],.48)}})),co=styled(x,{shouldForwardProp:o=>o!=="isDragActive"&&o!=="disabled"&&o!=="hasError"})(({theme:o,isDragActive:e,disabled:t,hasError:n})=>({width:64,height:64,flexShrink:0,display:"flex",borderRadius:1,cursor:"pointer",alignItems:"center",color:o.palette.text.disabled,justifyContent:"center",bgcolor:alpha(o.palette.grey[500],.08),border:`dashed 1px ${alpha(o.palette.grey[500],.16)}`,...e&&{opacity:.72},...t&&{opacity:.48,pointerEvents:"none"},...n&&{color:o.palette.error.main,borderColor:o.palette.error.main,bgcolor:alpha(o.palette.error.main,.08)},"&:hover":{opacity:.72}}));
|
|
14
14
|
|
|
15
15
|
export { O as a, B as b, g as c, Y as d, oo as e, eo as f, to as g, ro as h, ao as i, io as j, no as k, so as l, po as m, lo as n, co as o, U as p };
|
|
@@ -9,6 +9,6 @@ import { ChromePicker } from 'react-color';
|
|
|
9
9
|
import { styled } from '@mui/material/styles';
|
|
10
10
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
11
11
|
|
|
12
|
-
var a=styled(ChromePicker)({fontFamily:"inherit",boxShadow:"none"});var b=({value:m,onChangeColor:c,tabIndex:h,...t})=>{let[u,i]=useState(),p=u||m,n=p?"#"+p.replaceAll("#",""):"",e=a$1(),l=(o="")=>{(/^#[0-9a-fA-F]*$/.test(o)||o===""||o==="#")&&c("#"+o.replaceAll("#","")),i(void 0);};return jsxs(Fragment,{children:[jsx(I,{...t,value:n,onChange:o=>l(o.target.value),InputProps:{
|
|
12
|
+
var a=styled(ChromePicker)({fontFamily:"inherit",boxShadow:"none"});var b=({value:m,onChangeColor:c,tabIndex:h,...t})=>{let[u,i]=useState(),p=u||m,n=p?"#"+p.replaceAll("#",""):"",e=a$1(),l=(o="")=>{(/^#[0-9a-fA-F]*$/.test(o)||o===""||o==="#")&&c("#"+o.replaceAll("#","")),i(void 0);};return jsxs(Fragment,{children:[jsx(I,{...t,value:n,onChange:o=>l(o.target.value),InputProps:{...t.InputProps,startAdornment:jsx(x,{position:"start",sx:{ml:2},children:jsx(P,{edge:"start","aria-label":"Escolher cor",onClick:e.onOpen,children:jsx(g,{sx:{minWidth:24,minHeight:24,backgroundColor:n,borderRadius:.5}})})})},inputProps:{...t.inputProps,maxLength:7,tabIndex:h}}),jsx(k,{className:"popover-color-picker",open:!!e.open,anchorEl:e.open,onClose:e.onClose,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"center",horizontal:"center"},slotProps:{paper:{style:{borderRadius:8}}},children:jsx(a,{color:n,onChange:({hex:o})=>i(o),onChangeComplete:({hex:o})=>l(o),styles:{default:{picker:{fontFamily:"inherit",boxShadow:"none"}}},disableAlpha:!0})})]})},N=b;
|
|
13
13
|
|
|
14
14
|
export { N as a };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { a as a$1 } from './chunk-MAK4JF5M.js';
|
|
2
|
+
import l from '@mui/material/IconButton';
|
|
3
|
+
import p from '@mui/material/Stack';
|
|
4
|
+
import { styled } from '@mui/material/styles';
|
|
5
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
var e=styled(l)(({theme:t})=>({position:"absolute",top:0,left:-2,zIndex:1,color:t.palette.grey[500],padding:"22px 5px",userSelect:"none",cursor:"grab","&:active":{cursor:"grabbing"}})),a=styled(p)({flexDirection:"row",alignItems:"center",justifyContent:"center",width:16,height:16,overflow:"hidden",transform:"scale(0.8)"});var s=({disableDrag:t,...i})=>t?null:jsx(e,{className:"dragIcon",disableRipple:!0,"aria-label":"Arrastar para ordenar",...i,children:jsxs(a,{children:[jsx(a$1,{sx:{marginLeft:0},icon:"MORE_BOLD",width:16}),jsx(a$1,{sx:{marginLeft:"-10px"},icon:"MORE_BOLD",width:16})]})}),D=s;
|
|
8
|
+
|
|
9
|
+
export { D as a };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { a } from './chunk-MAK4JF5M.js';
|
|
2
|
+
import { createContext, forwardRef, useContext, useState, useMemo, useRef, useEffect } from 'react';
|
|
3
|
+
import le, { autocompleteClasses } from '@mui/material/Autocomplete';
|
|
4
|
+
import ae from '@mui/material/CircularProgress';
|
|
5
|
+
import ce from '@mui/material/TextField';
|
|
6
|
+
import { VariableSizeList } from 'react-window';
|
|
7
|
+
import K from '@mui/material/ListSubheader';
|
|
8
|
+
import Y from '@mui/material/Stack';
|
|
9
|
+
import { useTheme, styled } from '@mui/material/styles';
|
|
10
|
+
import I from '@mui/material/Typography';
|
|
11
|
+
import ee from '@mui/material/useMediaQuery';
|
|
12
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
13
|
+
import ie from '@mui/material/Popper';
|
|
14
|
+
|
|
15
|
+
var k=8,te=u=>{let{data:o,index:n,style:m}=u,r=o[n],{showValueInLabel:i,key:d,...y}=r[0],l={...m,top:m.top+k,paddingTop:8};return Object.prototype.hasOwnProperty.call(r,"group")?jsx(K,{component:"div",style:l,children:r.group},`list-box-item-group-${d}`):jsx(I,{component:"li",...y,noWrap:!0,style:l,children:jsxs(Y,{component:"div",direction:"row",flex:1,gap:1,justifyContent:"start",children:[r[1].icon&&jsx(a,{icon:r[1].icon}),r[1].label,i&&jsxs(I,{variant:"inherit",color:"grey.400",children:["(",r[1].value,")"]})]})},`list-box-item-${d}`)},z=createContext({}),M=forwardRef((u,o)=>{let n=useContext(z);return jsx("div",{ref:o,...u,...n})});M.displayName="OuterElementType";var re=u=>{let o=useRef(null);return useEffect(()=>{o.current!=null&&o.current.resetAfterIndex(0,!0);},[u]),o},oe=forwardRef(function(o,n){let{children:m,...r}=o,i=[];m.forEach(s=>{i.push(s),i.push(...s.children||[]);});let d=useTheme(),y=ee(d.breakpoints.up("sm")),l=i.length,b=y?36:48,f=s=>Object.prototype.hasOwnProperty.call(s,"group")?48:b,L=()=>l>8?8*b:i.map(f).reduce((s,a)=>s+a,0),P=re(l);return jsx("div",{ref:n,children:jsx(z.Provider,{value:r,children:jsx(VariableSizeList,{itemData:i,height:L()+2*k,width:"100%",ref:P,outerElementType:M,innerElementType:"ul",itemSize:s=>f(i[s]),overscanCount:5,itemCount:l,children:te})})})}),N=oe;var D=styled(ie)({[`& .${autocompleteClasses.listbox}`]:{boxSizing:"border-box","& ul":{padding:0,margin:0}}});var H=forwardRef(({name:u,label:o,value:n,options:m=[],loading:r,noOptionsText:i="Nenhum resultado encontrado.",loadingText:d="Carregando op\xE7\xF5es...",error:y,helperText:l,placeholder:b,onChange:f,groupBy:L,showValueInLabel:P,disabled:s,multiple:a$1,required:X,renderOption:x,tabIndex:J,onInputChange:A,onSearch:v,onBlur:E,InputLabelProps:$,...V},U)=>{let[W,T]=useState(),j=e=>e&&typeof e=="object"?e.value.toString():e.toString(),g=useMemo(()=>a$1?(Array.isArray(n)?n:[]).reduce((p,h)=>{let O=m.find(B=>B.value.toString()===h.toString());return O?[...p,O]:[...p]},[]):m.find(t=>t.value.toString()===n?.toString())||null,[m,n,a$1]);return jsx(le,{ref:U,value:W||g,onInputChange:(e,t,p)=>{if(A&&A(e,t,p),p==="input"){v&&(v(t),T(t));return}T(void 0);},options:m,loading:r,noOptionsText:i,loadingText:d,disabled:r||s,disableListWrap:!0,PopperComponent:D,ListboxComponent:x?void 0:N,filterOptions:(e,t)=>e.filter(p=>`${p.value} ${p.label}`.toLocaleUpperCase().includes(t.inputValue.toLocaleUpperCase())),onChange:(e,t)=>{if(!t){f(a$1?[]:null);return}if(Array.isArray(t)){f(t.map(j));return}f(typeof t=="string"?t.toString():t.value.toString());},onBlur:e=>{E&&E(e),T(void 0);},renderOption:(e,t,p,h)=>x?x(e,t,p,h):[{...e,showValueInLabel:P},t],renderGroup:e=>e,groupBy:L,multiple:a$1,renderInput:e=>jsx(ce,{...e,name:u,placeholder:b,fullWidth:!0,error:!!y,helperText:l,label:o,required:X,InputProps:{...e.InputProps,...!a$1&&{startAdornment:g&&!Array.isArray(g)&&g.icon?jsx(a,{icon:g.icon}):void 0},endAdornment:jsxs(Fragment,{children:[r?jsx(ae,{color:"primary",size:20}):null,e.InputProps.endAdornment]})},inputProps:{...e.inputProps,name:u,tabIndex:J},InputLabelProps:$}),...V})});H.displayName="Autocomplete";var Je=H;
|
|
16
|
+
|
|
17
|
+
export { Je as a };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as a$4 } from './chunk-4ZBE3RNR.js';
|
|
2
|
-
import { a as a$1 } from './chunk-
|
|
2
|
+
import { a as a$1 } from './chunk-427TWOPH.js';
|
|
3
3
|
import { a as a$3 } from './chunk-TWGGHTU5.js';
|
|
4
4
|
import { a as a$2 } from './chunk-26GV7WKC.js';
|
|
5
5
|
import { a as a$5 } from './chunk-MAK4JF5M.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { useFormContext, Controller } from 'react-hook-form';
|
|
2
|
+
import g from '@mui/material/TextField';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
var C=({name:l,helperText:t,rules:n,onChange:r,tabIndex:u,className:d,id:p,forceShowHelperText:f,...e})=>{let{control:m}=useFormContext();return jsx(Controller,{name:l,control:m,rules:n,render:({field:{ref:F,value:P,...s},fieldState:{error:o}})=>jsx(g,{...s,value:P??"",onChange:a=>{s.onChange(a),r&&r(a);},inputRef:F,fullWidth:!0,error:!!o,helperText:f?t||o?.message:o?.message||t,"data-intercom-target":l,...e,InputLabelProps:{...e.InputLabelProps,htmlFor:p},inputProps:{...e.inputProps,name:l,tabIndex:u,"aria-label":e.label,id:p},className:`field-${l} ${d}`})})},L=C;
|
|
6
|
+
|
|
7
|
+
export { L as a };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { c, g, p, n, d, e as e$1, a as a$6, b, h, i as i$1, l, m as m$1, j as j$1, k } from './chunk-
|
|
1
|
+
import { c, g, p, n, d, e as e$1, a as a$6, b, h, i as i$1, l, m as m$1, j as j$1, k } from './chunk-7WCRRQEW.js';
|
|
2
2
|
import { a as a$5 } from './chunk-2E4HVMRH.js';
|
|
3
3
|
import { a as a$1 } from './chunk-H5L4ARDB.js';
|
|
4
4
|
import { e } from './chunk-ANAHA3L6.js';
|
|
5
|
-
import { a as a$7 } from './chunk-
|
|
5
|
+
import { a as a$7 } from './chunk-DXACBPEV.js';
|
|
6
6
|
import { x } from './chunk-2P4CXK3O.js';
|
|
7
7
|
import { a as a$4 } from './chunk-FK7DDO5L.js';
|
|
8
8
|
import { i, o } from './chunk-D27ND54J.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { a as default } from '../../chunk-
|
|
1
|
+
export { a as default } from '../../chunk-AJW3AGOS.js';
|
|
2
2
|
import '../../chunk-ORYAES3Q.js';
|
|
@@ -4,6 +4,7 @@ import { DatePickerProps as DatePickerProps$1 } from '@mui/x-date-pickers-pro';
|
|
|
4
4
|
import { Dayjs } from 'dayjs';
|
|
5
5
|
|
|
6
6
|
type DatePickerProps = Omit<DatePickerProps$1<Dayjs>, 'value' | 'onChange'> & {
|
|
7
|
+
name?: string;
|
|
7
8
|
tabIndex?: number;
|
|
8
9
|
helperText?: ReactNode;
|
|
9
10
|
required?: boolean;
|
|
@@ -11,6 +12,6 @@ type DatePickerProps = Omit<DatePickerProps$1<Dayjs>, 'value' | 'onChange'> & {
|
|
|
11
12
|
onChange(value: Date | null | undefined): void;
|
|
12
13
|
};
|
|
13
14
|
|
|
14
|
-
declare const DatePicker: ({ value, onChange, tabIndex, helperText, required, ...other }: DatePickerProps) => react_jsx_runtime.JSX.Element;
|
|
15
|
+
declare const DatePicker: ({ name, value, onChange, tabIndex, helperText, required, ...other }: DatePickerProps) => react_jsx_runtime.JSX.Element;
|
|
15
16
|
|
|
16
17
|
export { DatePicker as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DatePicker } from '@mui/x-date-pickers-pro';
|
|
2
|
-
import
|
|
2
|
+
import P from 'dayjs';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var f=({name:r,value:e,onChange:l,tabIndex:a,helperText:i,required:p,...t})=>jsx(DatePicker,{...t,format:"DD/MM/YYYY",value:e?P(e):null,onChange:o=>l(o?o.toDate():null),slotProps:{textField:{...t.slotProps?.textField,name:r,required:p,helperText:i,autoComplete:"off",spellCheck:"false",fullWidth:!0},openPickerButton:{tabIndex:a}}}),k=f;
|
|
6
6
|
|
|
7
|
-
export {
|
|
7
|
+
export { k as default };
|
|
@@ -8,6 +8,7 @@ type DateRange = {
|
|
|
8
8
|
endDate?: Date | null | undefined;
|
|
9
9
|
};
|
|
10
10
|
type DateRangePickerProps = Omit<DateRangePickerProps$1<Dayjs>, 'value' | 'onChange'> & {
|
|
11
|
+
name?: string;
|
|
11
12
|
value?: DateRange;
|
|
12
13
|
onChange(value?: DateRange): void;
|
|
13
14
|
tabIndex?: number;
|
|
@@ -15,6 +16,6 @@ type DateRangePickerProps = Omit<DateRangePickerProps$1<Dayjs>, 'value' | 'onCha
|
|
|
15
16
|
required?: boolean;
|
|
16
17
|
};
|
|
17
18
|
|
|
18
|
-
declare const DateRangePicker: ({ label, value, onChange, tabIndex, helperText, required, ...other }: DateRangePickerProps) => react_jsx_runtime.JSX.Element;
|
|
19
|
+
declare const DateRangePicker: ({ name, label, value, onChange, tabIndex, helperText, required, ...other }: DateRangePickerProps) => react_jsx_runtime.JSX.Element;
|
|
19
20
|
|
|
20
21
|
export { DateRangePicker as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DateRangePicker } from '@mui/x-date-pickers-pro';
|
|
2
|
-
import
|
|
2
|
+
import o from 'dayjs';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var d=({name:a,label:l,value:e,onChange:n,tabIndex:f,helperText:s,required:D,...r})=>jsx(DateRangePicker,{format:"DD/MM/YYYY",value:[e?.startDate?o(e.startDate):null,e?.endDate?o(e.endDate):null],onChange:t=>n({startDate:t[0]?t[0].toDate():null,endDate:t[1]?t[1].toDate():null}),...r,slotProps:{textField:({position:t})=>({...r.slotProps?.textField,required:D,helperText:s,autoComplete:"off",spellCheck:"false",fullWidth:!0,label:l,name:t==="start"?`${a}Start`:`${a}End`})},sx:{width:1}}),u=d;
|
|
6
6
|
|
|
7
7
|
export { u as default };
|
|
@@ -4,6 +4,7 @@ import { DateTimePickerProps as DateTimePickerProps$1 } from '@mui/x-date-picker
|
|
|
4
4
|
import { Dayjs } from 'dayjs';
|
|
5
5
|
|
|
6
6
|
type DateTimePickerProps = Omit<DateTimePickerProps$1<Dayjs>, 'value' | 'onChange'> & {
|
|
7
|
+
name?: string;
|
|
7
8
|
tabIndex?: number;
|
|
8
9
|
helperText?: ReactNode;
|
|
9
10
|
required?: boolean;
|
|
@@ -11,6 +12,6 @@ type DateTimePickerProps = Omit<DateTimePickerProps$1<Dayjs>, 'value' | 'onChang
|
|
|
11
12
|
onChange(value: Date | null | undefined): void;
|
|
12
13
|
};
|
|
13
14
|
|
|
14
|
-
declare const DateTimePicker: ({ value, onChange, tabIndex, helperText, required, ...other }: DateTimePickerProps) => react_jsx_runtime.JSX.Element;
|
|
15
|
+
declare const DateTimePicker: ({ name, value, onChange, tabIndex, helperText, required, ...other }: DateTimePickerProps) => react_jsx_runtime.JSX.Element;
|
|
15
16
|
|
|
16
17
|
export { DateTimePicker as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DateTimePicker } from '@mui/x-date-pickers-pro';
|
|
2
|
-
import
|
|
2
|
+
import s from 'dayjs';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var P=({name:r,value:e,onChange:i,tabIndex:l,helperText:m,required:a,...t})=>jsx(DateTimePicker,{...t,format:"DD/MM/YYYY HH:mm",value:e?s(e):null,onChange:o=>i(o?o.toDate():null),slotProps:{textField:{...t.slotProps?.textField,name:r,required:a,helperText:m,autoComplete:"off",spellCheck:"false",fullWidth:!0},openPickerButton:{tabIndex:l}}}),c=P;
|
|
6
6
|
|
|
7
|
-
export {
|
|
7
|
+
export { c as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { x } from '../../chunk-2P4CXK3O.js';
|
|
2
|
-
import
|
|
2
|
+
import i from '@mui/material/Box';
|
|
3
3
|
import { styled, alpha } from '@mui/material/styles';
|
|
4
4
|
|
|
5
|
-
var a=styled(
|
|
5
|
+
var a=styled(i,{shouldForwardProp:r=>r!=="transform"&&r!=="transition"&&r!=="isDragging"})(({theme:r,transform:e=null,transition:n="",isDragging:o=!1})=>({transform:x.Transform.toString(e),transition:n,boxShadow:o?`0 0 0 2px ${r.palette.primary.main}, ${r.customShadows.z8}, inset 0 0 0 1000px ${alpha(r.palette.primary.main,.06)}`:void 0,background:r.palette.background.paper,borderRadius:8,userSelect:"none",zIndex:o?1200:0}));var b=a;
|
|
6
6
|
|
|
7
|
-
export {
|
|
7
|
+
export { b as default };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { a as a$4 } from '../../chunk-H5L4ARDB.js';
|
|
2
|
-
import { a as a$3 } from '../../chunk-
|
|
2
|
+
import { a as a$3 } from '../../chunk-2FXBVVBD.js';
|
|
3
3
|
import { a as a$5 } from '../../chunk-COTMNI3C.js';
|
|
4
4
|
import '../../chunk-7TFD7ZIP.js';
|
|
5
5
|
import '../../chunk-5NOG7L7I.js';
|
|
6
6
|
import { e } from '../../chunk-ANAHA3L6.js';
|
|
7
7
|
import { a } from '../../chunk-YXH2ZKVS.js';
|
|
8
8
|
import { f } from '../../chunk-EUL6EPCK.js';
|
|
9
|
-
import { a as a$2 } from '../../chunk-
|
|
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-
|
|
2
|
-
import '../../chunk-
|
|
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 +1 @@
|
|
|
1
|
-
export { a as default } from '../../chunk-
|
|
1
|
+
export { a as default } from '../../chunk-2QUYG4AQ.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { a as default } from '../../chunk-
|
|
1
|
+
export { a as default } from '../../chunk-2FXXN6VA.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { a as default } from '../../chunk-
|
|
1
|
+
export { a as default } from '../../chunk-MZ5WXXHN.js';
|
|
2
2
|
import '../../chunk-4ZBE3RNR.js';
|
|
3
|
-
import '../../chunk-
|
|
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-
|
|
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
|
|
2
|
+
import P from 'dayjs';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
|
-
var
|
|
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-
|
|
1
|
+
export { a as default } from '../../chunk-2FXBVVBD.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as a$2 } from '../../../chunk-
|
|
2
|
-
import { a as a$1 } from '../../../chunk-
|
|
3
|
-
import { a as a$3 } from '../../../chunk-
|
|
4
|
-
import '../../../chunk-
|
|
5
|
-
import '../../../chunk-
|
|
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-
|
|
2
|
-
import '../../../chunk-
|
|
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';
|
|
@@ -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:
|
|
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 {
|
|
11
|
+
export { V as default };
|
|
@@ -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
|
|
3
|
+
import k from 'dayjs';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
|
-
var
|
|
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 {
|
|
8
|
+
export { h as default };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useFormContext, Controller } from 'react-hook-form';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
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
|
|
5
|
+
import i from 'dayjs';
|
|
6
6
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
|
-
var
|
|
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 {
|
|
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
|
|
3
|
+
import k from 'dayjs';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
|
-
var
|
|
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 {
|
|
8
|
+
export { Y as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { a as default } from '../../../chunk-
|
|
1
|
+
export { a as default } from '../../../chunk-NV2X5CYP.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a } from '../../../chunk-
|
|
2
|
-
import '../../../chunk-
|
|
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
|
|
3
|
-
import
|
|
4
|
-
import
|
|
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
|
|
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-
|
|
2
|
-
import '../../../chunk-
|
|
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
|
|
3
|
-
import
|
|
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
|
|
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 {
|
|
8
|
+
export { M as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a } from '../../../chunk-
|
|
1
|
+
import { a } from '../../../chunk-MZ5WXXHN.js';
|
|
2
2
|
import '../../../chunk-4ZBE3RNR.js';
|
|
3
|
-
import '../../../chunk-
|
|
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
|
|
3
|
+
import C from 'dayjs';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
|
-
var T=({name:
|
|
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,5 +1,5 @@
|
|
|
1
|
-
import { b } from '../../../chunk-
|
|
2
|
-
import '../../../chunk-
|
|
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
5
|
import '../../../chunk-5NOG7L7I.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { e } from '../../../chunk-
|
|
2
|
-
import '../../../chunk-
|
|
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
6
|
import '../../../chunk-5NOG7L7I.js';
|
|
7
7
|
import '../../../chunk-ANAHA3L6.js';
|
|
8
|
-
import '../../../chunk-
|
|
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-
|
|
2
|
-
import { a as a$2 } from '../../../chunk-
|
|
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-
|
|
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-
|
|
2
|
-
export { c as DeleteButton, a as MultiFilePreview, b as SingleFilePreview, d as Upload, e as UploadWithCrop } from '../../chunk-
|
|
3
|
-
import { o } from '../../chunk-
|
|
4
|
-
export { p as RejectionFiles } from '../../chunk-
|
|
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
8
|
import '../../chunk-5NOG7L7I.js';
|
|
9
9
|
import '../../chunk-ANAHA3L6.js';
|
|
10
|
-
import '../../chunk-
|
|
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"
|
|
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
package/dist/chunk-5J3V35EQ.js
DELETED
|
@@ -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 };
|
package/dist/chunk-7BK54YIS.js
DELETED
|
@@ -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 };
|
package/dist/chunk-7F56LFN2.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { a } from './chunk-NF42ENKE.js';
|
|
2
|
-
import { b } from './chunk-ILHUUK4X.js';
|
|
3
|
-
import O, { forwardRef, useState, useMemo, useEffect } from 'react';
|
|
4
|
-
import fe, { autocompleteClasses } from '@mui/material/Autocomplete';
|
|
5
|
-
import be from '@mui/material/CircularProgress';
|
|
6
|
-
import ge from '@mui/material/TextField';
|
|
7
|
-
import { VariableSizeList } from 'react-window';
|
|
8
|
-
import W from '@mui/material/Typography';
|
|
9
|
-
import re from '@mui/material/Divider';
|
|
10
|
-
import L from '@mui/material/Stack';
|
|
11
|
-
import te from '@mui/material/Popper';
|
|
12
|
-
import { styled } from '@mui/material/styles';
|
|
13
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
14
|
-
|
|
15
|
-
var H=styled(te)({[`& .${autocompleteClasses.listbox}`]:{boxSizing:"border-box","& ul":{padding:0,margin:0}}}),D=styled(L)(({theme:e})=>({flex:1,width:"100%",gap:6,[e.breakpoints.down("md")]:{flexDirection:"column"},[e.breakpoints.up("md")]:{flexDirection:"row"}})),T=styled(L)(({theme:e})=>({flex:1,maxWidth:"100%",gap:6,[e.breakpoints.up("md")]:{flex:"1 1 calc(50% - 8px)",width:"calc(50% - 8px)",minWidth:"calc(50% - 8px)",maxWidth:"calc(50% - 8px)"}})),R=styled(L)(({theme:e})=>({position:"relative",alignItems:"center",justifyContent:"center",width:68,height:68,borderRadius:8,overflow:"hidden",img:{position:"absolute",width:"100%",height:"100%",objectFit:"cover"},[e.breakpoints.down("sm")]:{display:"none"}}));var oe=({option:e})=>{let t=Object.keys(e).filter(l=>l.startsWith("field")).map((l,p)=>{let s=e[l];if(s&&typeof s=="object"){let m="label"in s?s.label:null,u="value"in s?s.value:null;return jsxs(W,{component:"span",variant:"body2",color:"textPrimary",noWrap:!0,children:[m,": ",u]},`${l}:${p}`)}}),i=e.image?jsx("img",{alt:"Imagem",src:e.image}):jsx(a,{alt:e.label||e.value.toString(),name:e.label||e.value.toString(),sx:{width:68,height:68,borderRadius:1}});return jsxs(Fragment,{children:[jsxs(L,{direction:"row",gap:2,margin:2,children:[jsx(R,{children:i}),jsxs(L,{flex:1,overflow:"hidden",children:[jsxs(W,{variant:"subtitle2",color:"textPrimary",noWrap:!0,flex:1,children:[e.value," - ",e.label]}),t.length>0&&jsxs(D,{width:1,children:[jsxs(T,{children:[t[0]?t[0]:void 0,t[1]?t[1]:void 0]}),(t[2]||t[3])&&jsxs(T,{children:[t[2]?t[2]:void 0,t[3]?t[3]:void 0]})]})]})]}),jsx(re,{className:"border",sx:{borderStyle:"dashed",position:"absolute",bottom:0,width:1}})]})},x=oe;var N=8,se=e=>{let{data:t,index:i,style:l}=e,p=t[i],s={...l,top:l.top+N,paddingTop:8,display:"block"};return jsx(W,{component:"li",...p.props,noWrap:!0,style:s,children:jsx(x,{...p?.props?.children?.props})})},X=O.createContext({}),B=forwardRef((e,t)=>{let i=O.useContext(X);return jsx("div",{ref:t,...e,...i})});B.displayName="OuterElementType";var me=e=>{let t=O.useRef(null);return useEffect(()=>{t.current!=null&&t.current.resetAfterIndex(0,!0);},[e]),t},pe=forwardRef(function(t,i){let{children:l,"data-item-height":p,...s}=t,m=[];l.forEach(a=>{m.push(a),m.push(...a.children||[]);});let u=m.length,g=p>112?p:112,c=a=>Object.prototype.hasOwnProperty.call(a,"group")?48:g,v=()=>u>8?8*g:m.map(c).reduce((a,C)=>a+C,0),S=me(u);return jsx("div",{ref:i,children:jsx(X.Provider,{value:s,children:jsx(VariableSizeList,{itemData:m,height:v()+2*N,width:"100%",ref:S,outerElementType:B,innerElementType:"ul",itemSize:a=>c(m[a]),overscanCount:5,itemCount:u,children:se})})})}),J=pe;var j=forwardRef(({label:e,value:t,options:i=[],loading:l,noOptionsText:p="Nenhum resultado encontrado.",loadingText:s="Carregando op\xE7\xF5es...",error:m,helperText:u,placeholder:g,onChange:c,groupBy:v,disabled:S,multiple:a,required:C,renderOption:G,tabIndex:U,onSearch:P,onInputChange:w,...V},_)=>{let[F,I]=useState(),q=b("down","md"),K=o=>o&&typeof o=="object"?o.value.toString():o.toString(),Q=useMemo(()=>a?(Array.isArray(t)?t:[]).reduce((r,A)=>{let E=i.find(Z=>Z.value.toString()===A.toString());return E?[...r,E]:[...r]},[]):i.find(n=>n.value.toString()===t?.toString())||null,[i,t,a]),Y=q&&i[0]?Object.keys(i[0]).length*24:void 0;return jsx(fe,{ref:_,value:F||Q,onInputChange:(o,n,r)=>{if(w&&w(o,n,r),r==="input"){P&&P(n),I(n);return}I(void 0);},options:i,loading:l,noOptionsText:p,loadingText:s,disabled:l||S,disableListWrap:!0,PopperComponent:H,ListboxProps:{"data-item-height":Y},ListboxComponent:G?void 0:J,filterOptions:(o,n)=>o.filter(r=>`${r.field1?.value} ${r.field1?.label} ${r.field2?.label} ${r.field2?.value} ${r.field3?.label} ${r.field3?.value} ${r.field4?.label} ${r.field4?.value} ${r.field5?.label} ${r.field5?.value} ${r.label}${r.value}`.toLocaleUpperCase().includes(n.inputValue.toLocaleUpperCase())),onChange:(o,n)=>{if(!n){c(a?[]:null);return}if(Array.isArray(n)){c(n.map(K));return}c(typeof n=="string"?n.toString():n.value.toString());},renderOption:({key:o,...n},r)=>jsx("li",{...n,style:{display:"block"},children:jsx(x,{option:r})},o),renderGroup:o=>o,groupBy:v,multiple:a,renderInput:o=>jsx(ge,{...o,placeholder:g,fullWidth:!0,error:!!m,helperText:u,label:e,required:C,InputProps:{...o.InputProps,endAdornment:jsxs(Fragment,{children:[l?jsx(be,{color:"primary",size:20}):null,o.InputProps.endAdornment]})},inputProps:{...o.inputProps,tabIndex:U}}),...V})});j.displayName="Autocomplete";var qe=j;
|
|
16
|
-
|
|
17
|
-
export { qe as a };
|
package/dist/chunk-B42VMENU.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { a as a$1 } from './chunk-MAK4JF5M.js';
|
|
2
|
-
import l from '@mui/material/IconButton';
|
|
3
|
-
import p from '@mui/material/Stack';
|
|
4
|
-
import { styled } from '@mui/material/styles';
|
|
5
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
|
-
|
|
7
|
-
var e=styled(l)(({theme:t})=>({position:"absolute",top:0,left:-2,zIndex:1,color:t.palette.grey[500],padding:"22px 5px",cursor:"grab","&:active":{cursor:"grabbing"}})),a=styled(p)({flexDirection:"row",alignItems:"center",justifyContent:"center",width:16,height:16,overflow:"hidden",transform:"scale(0.8)"});var s=({disableDrag:t,...i})=>t?null:jsx(e,{className:"dragIcon",disableRipple:!0,"aria-label":"Arrastar para ordenar",...i,children:jsxs(a,{children:[jsx(a$1,{sx:{marginLeft:0},icon:"MORE_BOLD",width:16}),jsx(a$1,{sx:{marginLeft:"-10px"},icon:"MORE_BOLD",width:16})]})}),D=s;
|
|
8
|
-
|
|
9
|
-
export { D as a };
|
package/dist/chunk-IPOTBSM7.js
DELETED
package/dist/chunk-LLMDC6IE.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { a } from './chunk-MAK4JF5M.js';
|
|
2
|
-
import { createContext, forwardRef, useContext, useState, useMemo, useRef, useEffect } from 'react';
|
|
3
|
-
import me, { autocompleteClasses } from '@mui/material/Autocomplete';
|
|
4
|
-
import le from '@mui/material/CircularProgress';
|
|
5
|
-
import ae from '@mui/material/TextField';
|
|
6
|
-
import { VariableSizeList } from 'react-window';
|
|
7
|
-
import Q from '@mui/material/ListSubheader';
|
|
8
|
-
import K from '@mui/material/Stack';
|
|
9
|
-
import { useTheme, styled } from '@mui/material/styles';
|
|
10
|
-
import I from '@mui/material/Typography';
|
|
11
|
-
import Z from '@mui/material/useMediaQuery';
|
|
12
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
13
|
-
import ne from '@mui/material/Popper';
|
|
14
|
-
|
|
15
|
-
var k=8,ee=u=>{let{data:r,index:i,style:m}=u,n=r[i],{showValueInLabel:s,key:c,...f}=n[0],l={...m,top:m.top+k,paddingTop:8};return Object.prototype.hasOwnProperty.call(n,"group")?jsx(Q,{component:"div",style:l,children:n.group},`list-box-item-group-${c}`):jsx(I,{component:"li",...f,noWrap:!0,style:l,children:jsxs(K,{component:"div",direction:"row",flex:1,gap:1,justifyContent:"start",children:[n[1].icon&&jsx(a,{icon:n[1].icon}),n[1].label,s&&jsxs(I,{variant:"inherit",color:"grey.400",children:["(",n[1].value,")"]})]})},`list-box-item-${c}`)},z=createContext({}),M=forwardRef((u,r)=>{let i=useContext(z);return jsx("div",{ref:r,...u,...i})});M.displayName="OuterElementType";var te=u=>{let r=useRef(null);return useEffect(()=>{r.current!=null&&r.current.resetAfterIndex(0,!0);},[u]),r},re=forwardRef(function(r,i){let{children:m,...n}=r,s=[];m.forEach(o=>{s.push(o),s.push(...o.children||[]);});let c=useTheme(),f=Z(c.breakpoints.up("sm")),l=s.length,d=f?36:48,g=o=>Object.prototype.hasOwnProperty.call(o,"group")?48:d,C=()=>l>8?8*d:s.map(g).reduce((o,P)=>o+P,0),L=te(l);return jsx("div",{ref:i,children:jsx(z.Provider,{value:n,children:jsx(VariableSizeList,{itemData:s,height:C()+2*k,width:"100%",ref:L,outerElementType:M,innerElementType:"ul",itemSize:o=>g(s[o]),overscanCount:5,itemCount:l,children:ee})})})}),N=re;var D=styled(ne)({[`& .${autocompleteClasses.listbox}`]:{boxSizing:"border-box","& ul":{padding:0,margin:0}}});var H=forwardRef(({label:u,value:r,options:i=[],loading:m,noOptionsText:n="Nenhum resultado encontrado.",loadingText:s="Carregando op\xE7\xF5es...",error:c,helperText:f,placeholder:l,onChange:d,groupBy:g,showValueInLabel:C,disabled:L,multiple:o,required:P,renderOption:x,tabIndex:X,onInputChange:A,onSearch:v,onBlur:E,InputLabelProps:J,...$},V)=>{let[U,T]=useState(),W=e=>e&&typeof e=="object"?e.value.toString():e.toString(),y=useMemo(()=>o?(Array.isArray(r)?r:[]).reduce((p,b)=>{let O=i.find(j=>j.value.toString()===b.toString());return O?[...p,O]:[...p]},[]):i.find(t=>t.value.toString()===r?.toString())||null,[i,r,o]);return jsx(me,{ref:V,value:U||y,onInputChange:(e,t,p)=>{if(A&&A(e,t,p),p==="input"){v&&(v(t),T(t));return}T(void 0);},options:i,loading:m,noOptionsText:n,loadingText:s,disabled:m||L,disableListWrap:!0,PopperComponent:D,ListboxComponent:x?void 0:N,filterOptions:(e,t)=>e.filter(p=>`${p.value} ${p.label}`.toLocaleUpperCase().includes(t.inputValue.toLocaleUpperCase())),onChange:(e,t)=>{if(!t){d(o?[]:null);return}if(Array.isArray(t)){d(t.map(W));return}d(typeof t=="string"?t.toString():t.value.toString());},onBlur:e=>{E&&E(e),T(void 0);},renderOption:(e,t,p,b)=>x?x(e,t,p,b):[{...e,showValueInLabel:C},t],renderGroup:e=>e,groupBy:g,multiple:o,renderInput:e=>jsx(ae,{...e,placeholder:l,fullWidth:!0,error:!!c,helperText:f,label:u,required:P,InputProps:{...e.InputProps,...!o&&{startAdornment:y&&!Array.isArray(y)&&y.icon?jsx(a,{icon:y.icon}):void 0},endAdornment:jsxs(Fragment,{children:[m?jsx(le,{color:"primary",size:20}):null,e.InputProps.endAdornment]})},inputProps:{...e.inputProps,tabIndex:X},InputLabelProps:J}),...$})});H.displayName="Autocomplete";var Xe=H;
|
|
16
|
-
|
|
17
|
-
export { Xe as a };
|
package/dist/chunk-ORLVNXTG.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { forwardRef, useState } from 'react';
|
|
2
|
-
import { IMaskMixin } from 'react-imask';
|
|
3
|
-
import m from '@mui/material/TextField';
|
|
4
|
-
import { jsx } from 'react/jsx-runtime';
|
|
5
|
-
|
|
6
|
-
var k=IMaskMixin(a=>{let{inputRef:e,"data-value":p,defaultValue:u,tabIndex:s,...t}=a;return jsx(m,{inputRef:e,fullWidth:!0,...t,inputProps:{...t.inputProps,tabIndex:s},value:p,"data-testid":"masked-input-wrapper"})}),n=forwardRef(({onChange:a,name:e,...p},u)=>{let[s,t]=useState("");return jsx(k,{inputRef:u,name:e,"data-value":s,...p,onAccept:(r,o)=>{t(r),a({target:{name:e,value:o._unmaskedValue}});}})});n.displayName="MaskedInput";var P=n;
|
|
7
|
-
|
|
8
|
-
export { P as a };
|
package/dist/chunk-YNOYR4WX.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { useFormContext, Controller } from 'react-hook-form';
|
|
2
|
-
import g from '@mui/material/TextField';
|
|
3
|
-
import { jsx } from 'react/jsx-runtime';
|
|
4
|
-
|
|
5
|
-
var C=({name:l,helperText:t,rules:n,onChange:r,tabIndex:m,className:u,id:a,forceShowHelperText:d,...e})=>{let{control:f}=useFormContext();return jsx(Controller,{name:l,control:f,rules:n,render:({field:{ref:F,value:P,...p},fieldState:{error:o}})=>jsx(g,{...p,value:P??"",onChange:s=>{p.onChange(s),r&&r(s);},inputRef:F,fullWidth:!0,error:!!o,helperText:d?t||o?.message:o?.message||t,"data-intercom-target":l,...e,InputLabelProps:{...e.InputLabelProps,htmlFor:a},inputProps:{...e.inputProps,tabIndex:m,"aria-label":e.label,id:a},className:`field-${l} ${u}`})})},L=C;
|
|
6
|
-
|
|
7
|
-
export { L as a };
|