@ssplib/react-components 0.0.308 → 0.0.310

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/package.json +18 -22
  2. package/Map-31d95a26.js +0 -2
  3. package/Map-31d95a26.js.map +0 -1
  4. package/Map-644d2f90.js +0 -2
  5. package/Map-644d2f90.js.map +0 -1
  6. package/components/detalhes/Category.d.ts +0 -3
  7. package/components/detalhes/Field.d.ts +0 -8
  8. package/components/detalhes/FieldLabel.d.ts +0 -8
  9. package/components/detalhes/File.d.ts +0 -7
  10. package/components/form/checkbox/CheckBox.d.ts +0 -10
  11. package/components/form/checkbox/CheckBoxAdditional.d.ts +0 -7
  12. package/components/form/checkbox/CheckBoxWarning.d.ts +0 -10
  13. package/components/form/checkbox/RequiredCheckBoxValidator.d.ts +0 -5
  14. package/components/form/date/DatePicker.d.ts +0 -13
  15. package/components/form/date/GenericDatePicker.d.ts +0 -13
  16. package/components/form/date/TimePicker.d.ts +0 -10
  17. package/components/form/file/DropFileUpload.d.ts +0 -16
  18. package/components/form/file/FileUpload.d.ts +0 -13
  19. package/components/form/input/ActiveInput.d.ts +0 -12
  20. package/components/form/input/AutoComplete.d.ts +0 -11
  21. package/components/form/input/FetchAutoComplete.d.ts +0 -19
  22. package/components/form/input/FixedAutoComplete.d.ts +0 -18
  23. package/components/form/input/GenericFetchAutoComplete.d.ts +0 -19
  24. package/components/form/input/GenericInput.d.ts +0 -19
  25. package/components/form/input/GenericMaskInput.d.ts +0 -14
  26. package/components/form/input/GenericMultInput.d.ts +0 -13
  27. package/components/form/input/Input.d.ts +0 -19
  28. package/components/form/input/MaskInput.d.ts +0 -14
  29. package/components/form/input/MultInput.d.ts +0 -13
  30. package/components/form/input/OptionalInput.d.ts +0 -10
  31. package/components/form/input/OtherCheckBox.d.ts +0 -7
  32. package/components/form/stepper/Stepper.d.ts +0 -16
  33. package/components/form/stepper/StepperBlock.d.ts +0 -14
  34. package/components/form/switch/Switch.d.ts +0 -11
  35. package/components/form/switch/ToggleVisibility.d.ts +0 -13
  36. package/components/form/table/FilterSection.d.ts +0 -7
  37. package/components/form/table/GenericTable.d.ts +0 -8
  38. package/components/form/table/Table.d.ts +0 -5
  39. package/components/form/table/TableErrorState.d.ts +0 -9
  40. package/components/form/table/TableLoadingState.d.ts +0 -5
  41. package/components/form/table/types.d.ts +0 -212
  42. package/components/form/table/utils.d.ts +0 -29
  43. package/components/icons/icons.d.ts +0 -3
  44. package/components/loading/LinearProgress.d.ts +0 -2
  45. package/components/loading/LoadingScreen.d.ts +0 -7
  46. package/components/map/AnimatedMarker.d.ts +0 -5
  47. package/components/map/DraggableMarker.d.ts +0 -12
  48. package/components/map/Map.d.ts +0 -17
  49. package/components/map/index.d.ts +0 -1
  50. package/components/modal/Modal.d.ts +0 -7
  51. package/components/navbar/NavBar.d.ts +0 -15
  52. package/components/navbar/TabNavBar.d.ts +0 -17
  53. package/components/providers/FormProvider.d.ts +0 -11
  54. package/components/providers/GenericFormProvider.d.ts +0 -10
  55. package/components/providers/KeycloakAuthProvider.d.ts +0 -10
  56. package/components/providers/OAuthProvider.d.ts +0 -18
  57. package/components/providers/SspComponentsProvider.d.ts +0 -3
  58. package/components/teste/Teste.d.ts +0 -3
  59. package/components/utils/Bt.d.ts +0 -8
  60. package/components/utils/CustomMenu.d.ts +0 -12
  61. package/context/auth.d.ts +0 -2
  62. package/context/form.d.ts +0 -20
  63. package/decorators/FormBaseDecorator.d.ts +0 -2
  64. package/decorators/GenericFormBaseDecorator.d.ts +0 -2
  65. package/decorators/StepperDecorator.d.ts +0 -2
  66. package/index.cjs +0 -3
  67. package/index.cjs.map +0 -1
  68. package/index.d.ts +0 -44
  69. package/index.esm.js +0 -3
  70. package/index.esm.js.map +0 -1
  71. package/stories/Autocomplete.stories.d.ts +0 -6
  72. package/stories/CheckBox.stories.d.ts +0 -6
  73. package/stories/CheckBoxWarning.stories.d.ts +0 -6
  74. package/stories/DatePicker.stories.d.ts +0 -6
  75. package/stories/DetalhesCategory.stories.d.ts +0 -6
  76. package/stories/DetalhesField.stories.d.ts +0 -6
  77. package/stories/DetalhesFieldLabel.stories.d.ts +0 -6
  78. package/stories/DetalhesFile.stories.d.ts +0 -6
  79. package/stories/DropFileUpload.stories.d.ts +0 -6
  80. package/stories/ExemploAssitirValorInput.stories.d.ts +0 -7
  81. package/stories/ExemploInputs.stories.d.ts +0 -7
  82. package/stories/ExemploValoresCompartilhados.stories.d.ts +0 -7
  83. package/stories/FetchAutocomplete.stories.d.ts +0 -6
  84. package/stories/FileUpload.stories.d.ts +0 -6
  85. package/stories/FixedAutocomplete.stories.d.ts +0 -6
  86. package/stories/GenericFetchAutocomplete.stories.d.ts +0 -6
  87. package/stories/GenericInput.stories.d.ts +0 -6
  88. package/stories/GenericTable.stories.d.ts +0 -6
  89. package/stories/Input.stories.d.ts +0 -6
  90. package/stories/LinearProgress.stories.d.ts +0 -6
  91. package/stories/LoadingScreen.stories.d.ts +0 -6
  92. package/stories/Map.stories.d.ts +0 -6
  93. package/stories/MultInput.stories.d.ts +0 -6
  94. package/stories/NavBar.stories.d.ts +0 -6
  95. package/stories/OptionalInput.stories.d.ts +0 -6
  96. package/stories/OtherCheckBox.stories.d.ts +0 -6
  97. package/stories/Stepper.stories.d.ts +0 -6
  98. package/stories/StepperBlock.stories.d.ts +0 -6
  99. package/stories/Switch.stories.d.ts +0 -6
  100. package/stories/Table.stories.d.ts +0 -4
  101. package/stories/TableWithStaticData.stories.d.ts +0 -6
  102. package/stories/Teste.stories.d.ts +0 -6
  103. package/stories/TimePicker.stories.d.ts +0 -6
  104. package/types/auth.d.ts +0 -72
  105. package/types/form.d.ts +0 -64
package/index.d.ts DELETED
@@ -1,44 +0,0 @@
1
- import { Category } from './components/detalhes/Category';
2
- import { Field } from './components/detalhes/Field';
3
- import { FieldLabel } from './components/detalhes/FieldLabel';
4
- import { File } from './components/detalhes/File';
5
- import CheckBox from './components/form/checkbox/CheckBox';
6
- import CheckBoxAdditional from './components/form/checkbox/CheckBoxAdditional';
7
- import CheckBoxWarning from './components/form/checkbox/CheckBoxWarning';
8
- import RequiredCheckBoxGroup from './components/form/checkbox/RequiredCheckBoxValidator';
9
- import DatePicker from './components/form/date/DatePicker';
10
- import GenericDatePicker from './components/form/date/GenericDatePicker';
11
- import TimePicker from './components/form/date/TimePicker';
12
- import DropFileUpload from './components/form/file/DropFileUpload';
13
- import FileUpload from './components/form/file/FileUpload';
14
- import ActiveInput from './components/form/input/ActiveInput';
15
- import AutoComplete from './components/form/input/AutoComplete';
16
- import FetchAutoComplete from './components/form/input/FetchAutoComplete';
17
- import { FixedAutoComplete } from './components/form/input/FixedAutoComplete';
18
- import GenericFetchAutoComplete from './components/form/input/GenericFetchAutoComplete';
19
- import GenericInput from './components/form/input/GenericInput';
20
- import GenericMaskInput from './components/form/input/GenericMaskInput';
21
- import GenericMultInput from './components/form/input/GenericMultInput';
22
- import Input from './components/form/input/Input';
23
- import MaskInput from './components/form/input/MaskInput';
24
- import MultInput from './components/form/input/MultInput';
25
- import OtherCheckBox from './components/form/input/OtherCheckBox';
26
- import Stepper from './components/form/stepper/Stepper';
27
- import StepperBlock from './components/form/stepper/StepperBlock';
28
- import Switch from './components/form/switch/Switch';
29
- import { SwitchWatch, ToggleVisibility } from './components/form/switch/ToggleVisibility';
30
- import GenericTable from './components/form/table/GenericTable';
31
- import Table from './components/form/table/Table';
32
- import { Map } from './components/map';
33
- import { MODAL } from './components/modal/Modal';
34
- import NavBar from './components/navbar/NavBar';
35
- import TabNavBar from './components/navbar/TabNavBar';
36
- import FormProvider from './components/providers/FormProvider';
37
- import { KeycloakAuthProvider } from './components/providers/KeycloakAuthProvider';
38
- import { cookieName as AUTH_COOKIE_NAME, OAuthProvider } from './components/providers/OAuthProvider';
39
- import { SspComponentsProvider } from './components/providers/SspComponentsProvider';
40
- import Button from './components/utils/Bt';
41
- import Menu from './components/utils/CustomMenu';
42
- import { AuthContext } from './context/auth';
43
- import { FormContext } from './context/form';
44
- export { ActiveInput, AUTH_COOKIE_NAME, AuthContext, AutoComplete, Button, Category, CheckBox, CheckBoxAdditional, CheckBoxWarning, DatePicker, DropFileUpload, FetchAutoComplete, Field, FieldLabel, File, FileUpload, FixedAutoComplete, FormContext, FormProvider, GenericDatePicker, GenericFetchAutoComplete, GenericInput, GenericMaskInput, GenericMultInput, GenericTable, Input, KeycloakAuthProvider, Map, MaskInput, Menu, MODAL, MultInput, NavBar, OAuthProvider, OtherCheckBox, RequiredCheckBoxGroup, SspComponentsProvider, Stepper, StepperBlock, Switch, SwitchWatch, Table, TabNavBar, TimePicker, ToggleVisibility, };
package/index.esm.js DELETED
@@ -1,3 +0,0 @@
1
- import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{Grid as n,Typography as o,Box as i,Stack as a,Button as l,FormControlLabel as s,Checkbox as c,Card as d,InputLabel as u,TextField as p,SvgIcon as m,useTheme as h,useMediaQuery as f,LinearProgress as g,TableContainer as y,Paper as b,CircularProgress as v,Switch as x,Autocomplete as C,MobileStepper as w,SwipeableDrawer as k,Modal as E,Menu as S,MenuItem as Y,Skeleton as O,IconButton as D,Collapse as A,PaginationItem as V,Alert as I,FormControl as M,Select as N,AppBar as T,Avatar as j}from"@mui/material";import{FileDownload as z,ReportProblemRounded as R,PendingRounded as P,FilterAlt as F,KeyboardArrowDown as $,ExpandLess as W,ExpandMore as L,Refresh as B,KeyboardArrowUp as _}from"@mui/icons-material";import*as q from"react";import U,{createContext as X,useContext as K,useCallback as G,useState as H,useEffect as J,useMemo as Q,useRef as Z}from"react";import ee from"@mui/material/Typography";import te from"lodash.get";import{LocalizationProvider as re,DatePicker as ne,TimePicker as oe}from"@mui/x-date-pickers";import{AdapterDayjs as ie}from"@mui/x-date-pickers/AdapterDayjs";import ae from"dayjs";import"dayjs/locale/pt-br";import le from"lodash.hasin";import{useFormContext as se,useForm as ce}from"react-hook-form";import de from"axios";import{useDropzone as ue}from"react-dropzone";import pe,{isValidElementType as me,Memo as he,ForwardRef as fe}from"react-is";import ge from"@emotion/styled";import{ThemeContext as ye}from"@emotion/react";import be from"@mui/icons-material/CameraAlt";import ve from"@mui/icons-material/Delete";import xe from"@mui/icons-material/Done";import Ce from"@mui/icons-material/InsertDriveFile";import we from"@mui/icons-material/PictureAsPdf";import ke from"@mui/material/InputLabel";import{IMaskInput as Ee}from"react-imask";import{useQuery as Se}from"react-query";import Ye from"@mui/icons-material/KeyboardArrowLeft";import Oe from"@mui/icons-material/KeyboardArrowRight";import De from"@mui/icons-material/Save";import{LoadingButton as Ae}from"@mui/lab";import{toast as Ve,ToastContainer as Ie}from"react-toastify";import Me from"@mui/icons-material/ContentPasteOutlined";import Ne from"@mui/icons-material/Clear";import Te from"@mui/icons-material/FileDownload";import je from"@mui/icons-material/NavigateNextRounded";import ze from"@mui/icons-material/Search";import Re from"@mui/material/Grid";import Pe from"@mui/material/Pagination";import Fe from"@mui/material/TextField";import $e from"jszip";import We from"@mui/icons-material/CloseRounded";import Le from"tinycolor2";import Be from"lodash.clonedeep";import*as _e from"xlsx";import qe from"next/dynamic";import Ue from"@mui/icons-material/KeyboardArrowDown";import Xe from"@mui/icons-material/LogoutOutlined";import Ke from"@mui/icons-material/Menu";import Ge from"@mui/icons-material/Person";import He from"@mui/material/LinearProgress";import Je from"next/image";import Qe from"next/link";import{useRouter as Ze}from"next/router";import et from"keycloak-js";import{getCookie as tt,deleteCookie as rt,setCookie as nt}from"cookies-next";import ot from"jwt-decode";function it({title:r}){return e(n,{paddingY:1,marginTop:1,marginBottom:3,size:12,children:[t(o,{textTransform:"uppercase",fontWeight:600,children:r}),t(i,{sx:{backgroundColor:"#94A3B8",height:6,borderRadius:1}})]})}function at({name:r,title:l,tag:s,xs:c=12,md:d,lg:u}){let p=s&&"Distrital"===s?"#BFDBFE":"Estadual"===s?"#BBF7D0":"Federal"===s?"#FEF08A":"Internacional"===s?"#FED7AA":"Não"===s?"#FECACA":"#BBF7D0";return t(n,{paddingBottom:3,paddingRight:2,size:{xs:c,md:d,lg:u},children:e(a,{spacing:1,children:[e(a,{spacing:1,direction:"row",children:[t(o,{sx:{backgroundColor:"#E2E8F0",maxWidth:"max-content",paddingX:1,borderRadius:2,color:"#1E293B"},fontWeight:600,children:l}),s&&t(o,{sx:{backgroundColor:p,maxWidth:"max-content",paddingX:1,borderRadius:2,color:"#1E293B"},fontWeight:600,children:s})]}),r&&t(i,{children:"false"===String(r)?"Não":"true"===String(r)?"Sim":""===String(r)?"":r?String(r):"Não informado"})]})})}function lt({title:r,xs:i=12,tag:l,md:s,lg:c,paddingBottom:d=3}){let u=l&&"Não"===l?"#FECACA":"Sim"===l?"#BBF7D0":"#E2E8F0";return t(n,{paddingBottom:d,paddingRight:2,size:{xs:i,md:s,lg:c},children:e(a,{spacing:1,direction:"row",children:[t(o,{sx:{backgroundColor:"#E2E8F0",maxWidth:"max-content",paddingX:1,borderRadius:2,color:"#1E293B"},fontWeight:600,fontSize:16,children:r}),l&&t(o,{sx:{backgroundColor:u,maxWidth:"max-content",paddingX:1,borderRadius:2,color:"#1E293B"},fontWeight:600,children:l})]})})}const st=/*#__PURE__*/X({});function ct({title:r,name:i,md:s,fileURL:c,fileExt:d="pdf"}){const{user:u}=K(st);return t(n,{paddingBottom:3,paddingRight:3,size:{md:s},children:e(a,{spacing:1,sx:{backgroundColor:"#F8FAFC",paddingY:1,paddingX:3,borderRadius:2,border:1,borderColor:"#CBD5E1"},children:[t(o,{fontWeight:600,sx:{textAlign:"center"},children:r}),e(a,{direction:"row",spacing:2,alignItems:"center",children:[t(z,{sx:{fill:"red"}}),t(o,{children:i})]}),t(a,{alignItems:"center",children:t(l,{variant:"outlined",color:"error",size:"small",endIcon:t(z,{}),onClick:()=>fetch(c,{method:"GET",headers:{Authorization:`Bearer ${u?.token}`}}).then(e=>e.blob()).then(e=>{var t=window.URL.createObjectURL(e);const r=document.createElement("a");r.href=t,r.download=i.split(".")[0]+`.${d}`,r.click()}),children:"Baixar"})})]})})}const dt=/*#__PURE__*/X(null);function ut({name:e,title:r,defaultValue:o=!1,xs:i=12,sm:a,md:l,onChange:d}){const u=K(dt),p=G(t=>{u?.formSetValue(e,!u?.formGetValues(e))},[u,e]);return t(n,{size:{xs:i,sm:a,md:l},children:t(s,{control:t(c,{size:"small",defaultChecked:o}),label:r,...u?.formRegister(e),onChange:d,onClick:p})})}function pt(e){let t=[];return e.forEach(e=>{if(e.props){if(e.props.children){const r=pt(Array.isArray(e.props.children)?e.props.children:[e.props.children]);return void(t=t.concat(r))}e.props.name&&t.push(e.props.name)}}),t}function mt({customText:r="Selecione pelo menos 1 opção",...o}){const[i,a]=H(!1),[l,s]=H(!0),c=K(dt),d=/*#__PURE__*/U.cloneElement(o.children,{onChange:()=>{i&&!c.formGetValues(d.props.name)&&s(!1)}});return e(n,{container:!0,sx:{padding:1,borderRadius:2},children:[t("input",{type:"text",...c.formRegister(o.name,{validate:(e,t)=>{if(i&&l)return!0;const n=pt(Array.isArray(o.children)?o.children:[o.children]);let d=!1;return n.forEach(e=>{c.formGetValues(e)&&(d=!0)}),!!d||(a(!0),s(!0),r)}}),hidden:!0}),d,t(n,{size:12,children:i&&l&&o.content})]})}function ht({name:r,title:o,customWarning:i,defaultValue:a=!1,xs:l=12,sm:u,md:p}){const m=K(dt);return e(n,{size:{xs:l,sm:u,md:p},children:[t(s,{control:t(c,{size:"small",...m.formRegister(r),defaultChecked:a}),label:o}),m.formWatch(r)&&t(d,{sx:{bgcolor:"#FFFBF5",color:"#F59E0B",padding:1,paddingLeft:2},children:i||e(ee,{children:[t("b",{children:"Atenção"})," ",t("i",{children:o})," possui regras específicas."]})})]})}function ft(e){let t=[];return e.forEach(e=>{if(e.props){if(e.props.children){const r=ft(Array.isArray(e.props.children)?e.props.children:[e.props.children]);return void(t=t.concat(r))}e.props.name&&t.push(e.props.name)}}),t}function gt({customText:r="Selecione pelo menos 1 opção",...i}){const a=K(dt);return e(n,{container:!0,sx:{border:te(a.errors,i.name)?"2px solid #a51c30":"",padding:1,borderRadius:2},children:[t("input",{type:"text",...a.formRegister(i.name,{validate:(e,t)=>{const n=ft(Array.isArray(i.children)?i.children:[i.children]);let o=!1;return n.forEach((e,t)=>{a.formGetValues(e)&&(o=!0)}),!!o||r}}),hidden:!0},1),i.children,t(n,{size:12,children:t(o,{sx:{color:"#a51c30",fontSize:16,paddingLeft:1},children:te(a.errors,i.name)?.message})})]})}function yt({name:i,required:a=!1,title:l,xs:s=12,sm:c,md:d,minDt:m,defaultValue:h,persistValue:f,maxDt:g,...y}){const b=K(dt),[v,x]=H(void 0!==h?ae(h,"DD/MM/YYYY"):void 0);return J(()=>{void 0!==v&&b.formSetValue(i,v?v.format("DD/MM/YYYY"):v)},[v]),J(()=>{if(!f)return()=>{b.formUnregister(i)}},[]),t(r,{children:e(n,{size:{xs:s,sm:c,md:d},children:[l&&t(u,{required:a,children:l}),e(re,{adapterLocale:"pt-br",dateAdapter:ie,children:[t(ne,{minDate:ae(m,"DD/MM/YYYY"),maxDate:ae(g,"DD/MM/YYYY"),format:"DD/MM/YYYY",value:v,onChange:e=>{x(e)},disableHighlightToday:!0,sx:{outline:te(b.errors,i)?"1px solid #a51c30":"",backgroundColor:"white",width:"100%",div:{input:{paddingX:2,paddingY:1.05}}},inputRef:e=>t(p,{size:"small",...e,...b?.formRegister(i,{validate:(e,t)=>!le(t,i)||(e||(e=""),e.length<=0&&a?"Este campo é obrigatório":e.length<10&&a?"A data precisa seguir o padrão DD/MM/AAAA":!m||ae(m,"DD/MM/YYYY").isSame(ae(e,"DD/MM/YYYY"))||ae(m,"DD/MM/YYYY").isBefore(ae(e,"DD/MM/YYYY"))?!g||ae(g,"DD/MM/YYYY").isSame(ae(e,"DD/MM/YYYY"))||ae(g,"DD/MM/YYYY").isAfter(ae(e,"DD/MM/YYYY"))?void 0:"A data escolhida não é válida":`A data tem que ser depois de ${m} e antes de ${g}`),shouldUnregister:!0}),fullWidth:!0})}),t(o,{sx:{color:"#a51c30",fontSize:14,paddingLeft:1},children:te(b.errors,i)?.message})]})]})})}function bt({name:i,required:a=!1,title:l,xs:s=12,sm:c,md:d,minDt:m,defaultValue:h,persistValue:f,maxDt:g,...y}){const b=se(),[v,x]=H(void 0!==h?ae(h,"DD/MM/YYYY"):void 0);return J(()=>{void 0!==v&&b.setValue(i,v?v.format("DD/MM/YYYY"):v)},[v]),J(()=>{if(!f)return()=>{b.unregister(i)}},[]),t(r,{children:e(n,{size:{xs:s,sm:c,md:d},children:[l&&t(u,{required:a,children:l}),e(re,{adapterLocale:"pt-br",dateAdapter:ie,children:[t(ne,{minDate:ae(m,"DD/MM/YYYY"),maxDate:ae(g,"DD/MM/YYYY"),format:"DD/MM/YYYY",value:v,onChange:e=>{x(void 0)},disableHighlightToday:!0,sx:{outline:te(b.formState.errors,i)?"1px solid #a51c30":"",backgroundColor:"white",width:"100%",div:{input:{paddingX:2,paddingY:1.05}}},inputRef:e=>t(p,{size:"small",...e,...b?.register(i,{validate:(e,t)=>!le(t,i)||(e||(e=""),e.length<=0&&a?"Este campo é obrigatório":e.length<10&&a?"A data precisa seguir o padrão DD/MM/AAAA":!m||ae(m,"DD/MM/YYYY").isSame(ae(e,"DD/MM/YYYY"))||ae(m,"DD/MM/YYYY").isBefore(ae(e,"DD/MM/YYYY"))?!g||ae(g,"DD/MM/YYYY").isSame(ae(e,"DD/MM/YYYY"))||ae(g,"DD/MM/YYYY").isAfter(ae(e,"DD/MM/YYYY"))?void 0:"A data escolhida não é válida":`A data tem que ser depois de ${m} e antes de ${g}`),shouldUnregister:!0}),fullWidth:!0})}),t(o,{sx:{color:"#a51c30",fontSize:14,paddingLeft:1},children:te(b.formState.errors,i)?.message})]})]})})}function vt({name:r,required:i=!1,title:a,defaultValue:l="",xs:s=12,sm:c,md:d}){const m=K(dt),[h,f]=H(l?ae(l,"HH:mm"):null);return J(()=>{m.formSetValue(r,h?h.format("HH:mm"):h)},[h]),J(()=>()=>{m.formUnregister(r)},[]),e(n,{size:{xs:s,sm:c,md:d},children:[a&&t(u,{required:i,children:a}),e(re,{adapterLocale:"pt-br",dateAdapter:ie,children:[t(oe,{value:h,ampm:!1,onChange:e=>{f(e)},sx:{outline:te(m.errors,r)?"1px solid #a51c30":"",backgroundColor:"white",width:"100%",div:{input:{paddingX:2,paddingY:1.05}}},inputRef:e=>t(p,{size:"small",...e,...m?.formRegister(r,{validate:(e,t)=>!le(t,r)||(e||(e=""),e.length<=0&&i?"Este campo é obrigatório":e.length<5&&i?"A hora precisa seguir o padrão HH:MM":void 0),shouldUnregister:!0}),fullWidth:!0})}),t(o,{sx:{color:"#a51c30",fontSize:15,paddingLeft:1},children:te(m.errors,r)?.message})]})]})}function xt(e,...t){const r=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(e=>r.searchParams.append("args[]",e)),`Minified MUI error #${e}; visit ${r} for the full message.`}var Ct={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function wt(e){var t=Object.create(null);return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}var kt=/[A-Z]|^ms/g,Et=/_EMO_([^_]+?)_([^]*?)_EMO_/g,St=function(e){return 45===e.charCodeAt(1)},Yt=function(e){return null!=e&&"boolean"!=typeof e},Ot=/* #__PURE__ */wt(function(e){return St(e)?e:e.replace(kt,"-$&").toLowerCase()}),Dt=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Et,function(e,t,r){return Vt={name:t,styles:r,next:Vt},t})}return 1===Ct[e]||St(e)||"number"!=typeof t||0===t?t:t+"px"};function At(e,t,r){if(null==r)return"";if(void 0!==r.__emotion_styles)return r;switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return Vt={name:r.name,styles:r.styles,next:Vt},r.name;var n=r;if(void 0!==n.styles){var o=n.next;if(void 0!==o)for(;void 0!==o;)Vt={name:o.name,styles:o.styles,next:Vt},o=o.next;return n.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o++)n+=At(e,t,r[o])+";";else for(var i in r){var a=r[i];if("object"!=typeof a){var l=a;null!=t&&void 0!==t[l]?n+=i+"{"+t[l]+"}":Yt(l)&&(n+=Ot(i)+":"+Dt(i,l)+";")}else if(!Array.isArray(a)||"string"!=typeof a[0]||null!=t&&void 0!==t[a[0]]){var s=At(e,t,a);switch(i){case"animation":case"animationName":n+=Ot(i)+":"+s+";";break;default:n+=i+"{"+s+"}"}}else for(var c=0;c<a.length;c++)Yt(a[c])&&(n+=Ot(i)+":"+Dt(i,a[c])+";")}return n}(e,t,r);case"function":if(void 0!==e){var i=Vt,a=r(e);return Vt=i,At(e,t,a)}}if(null==t)return r;var l=t[r];return void 0!==l?l:r}var Vt,It=/label:\s*([^\s;{]+)\s*(;|$)/g,Mt=Object.getOwnPropertySymbols,Nt=Object.prototype.hasOwnProperty,Tt=Object.prototype.propertyIsEnumerable,jt=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,n,o=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),i=1;i<arguments.length;i++){for(var a in r=Object(arguments[i]))Nt.call(r,a)&&(o[a]=r[a]);if(Mt){n=Mt(r);for(var l=0;l<n.length;l++)Tt.call(r,n[l])&&(o[n[l]]=r[n[l]])}}return o},zt=Function.call.bind(Object.prototype.hasOwnProperty),Rt="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Pt=zt,Ft=function(){};if("production"!==process.env.NODE_ENV){var $t=Rt,Wt={},Lt=Pt;Ft=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function Bt(e,t,r,n,o){if("production"!==process.env.NODE_ENV)for(var i in e)if(Lt(e,i)){var a;try{if("function"!=typeof e[i]){var l=Error((n||"React class")+": "+r+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name="Invariant Violation",l}a=e[i](t,i,n,r,null,$t)}catch(e){a=e}if(!a||a instanceof Error||Ft((n||"React class")+": type specification of "+r+" `"+i+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof a+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),a instanceof Error&&!(a.message in Wt)){Wt[a.message]=!0;var s=o?o():"";Ft("Failed "+r+" type: "+a.message+(null!=s?s:""))}}}Bt.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(Wt={})};var _t=Bt,qt=function(){};function Ut(){return null}function Xt(){}function Kt(){}"production"!==process.env.NODE_ENV&&(qt=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),Kt.resetWarningCache=Xt;var Gt,Ht,Jt=(Gt=function(e){e.exports="production"!==process.env.NODE_ENV?function(e){var t="function"==typeof Symbol&&Symbol.iterator,r="<<anonymous>>",n={array:l("array"),bigint:l("bigint"),bool:l("boolean"),func:l("function"),number:l("number"),object:l("object"),string:l("string"),symbol:l("symbol"),any:a(Ut),arrayOf:function(e){return a(function(t,r,n,o,a){if("function"!=typeof e)return new i("Property `"+a+"` of component `"+n+"` has invalid PropType notation inside arrayOf.");var l=t[r];if(!Array.isArray(l))return new i("Invalid "+o+" `"+a+"` of type `"+d(l)+"` supplied to `"+n+"`, expected an array.");for(var s=0;s<l.length;s++){var c=e(l,s,n,o,a+"["+s+"]",Rt);if(c instanceof Error)return c}return null})},element:a(function(t,r,n,o,a){var l=t[r];return e(l)?null:new i("Invalid "+o+" `"+a+"` of type `"+d(l)+"` supplied to `"+n+"`, expected a single ReactElement.")}),elementType:a(function(e,t,r,n,o){var a=e[t];return pe.isValidElementType(a)?null:new i("Invalid "+n+" `"+o+"` of type `"+d(a)+"` supplied to `"+r+"`, expected a single ReactElement type.")}),instanceOf:function(e){return a(function(t,n,o,a,l){return t[n]instanceof e?null:new i("Invalid "+a+" `"+l+"` of type `"+((s=t[n]).constructor&&s.constructor.name?s.constructor.name:r)+"` supplied to `"+o+"`, expected instance of `"+(e.name||r)+"`.");var s})},node:a(function(e,t,r,n,o){return c(e[t])?null:new i("Invalid "+n+" `"+o+"` supplied to `"+r+"`, expected a ReactNode.")}),objectOf:function(e){return a(function(t,r,n,o,a){if("function"!=typeof e)return new i("Property `"+a+"` of component `"+n+"` has invalid PropType notation inside objectOf.");var l=t[r],s=d(l);if("object"!==s)return new i("Invalid "+o+" `"+a+"` of type `"+s+"` supplied to `"+n+"`, expected an object.");for(var c in l)if(Pt(l,c)){var u=e(l,c,n,o,a+"."+c,Rt);if(u instanceof Error)return u}return null})},oneOf:function(e){return Array.isArray(e)?a(function(t,r,n,a,l){for(var s=t[r],c=0;c<e.length;c++)if(o(s,e[c]))return null;var d=JSON.stringify(e,function(e,t){return"symbol"===u(t)?String(t):t});return new i("Invalid "+a+" `"+l+"` of value `"+String(s)+"` supplied to `"+n+"`, expected one of "+d+".")}):("production"!==process.env.NODE_ENV&&qt(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),Ut)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&qt("Invalid argument supplied to oneOfType, expected an instance of array."),Ut;for(var t=0;t<e.length;t++){var r=e[t];if("function"!=typeof r)return qt("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+p(r)+" at index "+t+"."),Ut}return a(function(t,r,n,o,a){for(var l=[],s=0;s<e.length;s++){var c=(0,e[s])(t,r,n,o,a,Rt);if(null==c)return null;c.data&&Pt(c.data,"expectedType")&&l.push(c.data.expectedType)}return new i("Invalid "+o+" `"+a+"` supplied to `"+n+"`"+(l.length>0?", expected one of type ["+l.join(", ")+"]":"")+".")})},shape:function(e){return a(function(t,r,n,o,a){var l=t[r],c=d(l);if("object"!==c)return new i("Invalid "+o+" `"+a+"` of type `"+c+"` supplied to `"+n+"`, expected `object`.");for(var p in e){var m=e[p];if("function"!=typeof m)return s(n,o,a,p,u(m));var h=m(l,p,n,o,a+"."+p,Rt);if(h)return h}return null})},exact:function(e){return a(function(t,r,n,o,a){var l=t[r],c=d(l);if("object"!==c)return new i("Invalid "+o+" `"+a+"` of type `"+c+"` supplied to `"+n+"`, expected `object`.");var p=jt({},t[r],e);for(var m in p){var h=e[m];if(Pt(e,m)&&"function"!=typeof h)return s(n,o,a,m,u(h));if(!h)return new i("Invalid "+o+" `"+a+"` key `"+m+"` supplied to `"+n+"`.\nBad object: "+JSON.stringify(t[r],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var f=h(l,m,n,o,a+"."+m,Rt);if(f)return f}return null})}};function o(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function i(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function a(e){function t(t,n,o,a,l,s,c){if(a=a||r,s=s||o,c!==Rt){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}return null==n[o]?t?new i(null===n[o]?"The "+l+" `"+s+"` is marked as required in `"+a+"`, but its value is `null`.":"The "+l+" `"+s+"` is marked as required in `"+a+"`, but its value is `undefined`."):null:e(n,o,a,l,s)}process;var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function l(e){return a(function(t,r,n,o,a,l){var s=t[r];return d(s)!==e?new i("Invalid "+o+" `"+a+"` of type `"+u(s)+"` supplied to `"+n+"`, expected `"+e+"`.",{expectedType:e}):null})}function s(e,t,r,n,o){return new i((e||"React class")+": "+t+" type `"+r+"."+n+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function c(r){switch(typeof r){case"number":case"string":case"undefined":return!0;case"boolean":return!r;case"object":if(Array.isArray(r))return r.every(c);if(null===r||e(r))return!0;var n=function(e){var r=e&&(t&&e[t]||e["@@iterator"]);if("function"==typeof r)return r}(r);if(!n)return!1;var o,i=n.call(r);if(n!==r.entries){for(;!(o=i.next()).done;)if(!c(o.value))return!1}else for(;!(o=i.next()).done;){var a=o.value;if(a&&!c(a[1]))return!1}return!0;default:return!1}}function d(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function u(e){if(null==e)return""+e;var t=d(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function p(e){var t=u(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return i.prototype=Error.prototype,n.checkPropTypes=_t,n.resetWarningCache=_t.resetWarningCache,n.PropTypes=n,n}(pe.isElement):function(){function e(e,t,r,n,o,i){if(i!==Rt){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Kt,resetWarningCache:Xt};return r.PropTypes=r,r}()},Gt(Ht={exports:{}}),Ht.exports),Qt=Jt;const Zt=[];function er(e){return Zt[0]=e,function(e,t,r){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var n=!0,o="";Vt=void 0;var i=e[0];null==i||void 0===i.raw?(n=!1,o+=At(r,t,i)):o+=i[0];for(var a=1;a<e.length;a++)o+=At(r,t,e[a]),n&&(o+=i[a]);It.lastIndex=0;for(var l,s="";null!==(l=It.exec(o));)s+="-"+l[1];var c=function(e){for(var t,r=0,n=0,o=e.length;o>=4;++n,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(o){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}(o)+s;return{name:c,styles:o,next:Vt}}(Zt)}function tr(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function rr(e){if(/*#__PURE__*/q.isValidElement(e)||me(e)||!tr(e))return e;const t={};return Object.keys(e).forEach(r=>{t[r]=rr(e[r])}),t}function nr(e,t,r={clone:!0}){const n=r.clone?{...e}:e;return tr(e)&&tr(t)&&Object.keys(t).forEach(o=>{n[o]=/*#__PURE__*/q.isValidElement(t[o])||me(t[o])?t[o]:tr(t[o])&&Object.prototype.hasOwnProperty.call(e,o)&&tr(e[o])?nr(e[o],t[o],r):r.clone&&tr(t[o])?rr(t[o]):t[o]}),n}function or(e,t){if(!e.containerQueries)return t;const r=Object.keys(t).filter(e=>e.startsWith("@container")).sort((e,t)=>{const r=/min-width:\s*([0-9.]+)/;return+(e.match(r)?.[1]||0)-+(t.match(r)?.[1]||0)});return r.length?r.reduce((e,r)=>{const n=t[r];return delete e[r],e[r]=n,e},{...t}):t}var ir={borderRadius:4},ar="production"!==process.env.NODE_ENV?Qt.oneOfType([Qt.number,Qt.string,Qt.object,Qt.array]):{};function lr(e,t){return t?nr(e,t,{clone:!1}):e}const sr={xs:0,sm:600,md:900,lg:1200,xl:1536},cr={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${sr[e]}px)`},dr={containerQueries:e=>({up:t=>{let r="number"==typeof t?t:sr[t]||t;return"number"==typeof r&&(r=`${r}px`),e?`@container ${e} (min-width:${r})`:`@container (min-width:${r})`}})};function ur(e,t,r){const n=e.theme||{};if(Array.isArray(t)){const e=n.breakpoints||cr;return t.reduce((n,o,i)=>(n[e.up(e.keys[i])]=r(t[i]),n),{})}if("object"==typeof t){const e=n.breakpoints||cr;return Object.keys(t).reduce((o,i)=>{if(a=e.keys,"@"===(l=i)||l.startsWith("@")&&(a.some(e=>l.startsWith(`@${e}`))||l.match(/^@\d/))){const e=function(e,t){const r=t.match(/^@([^/]+)?\/?(.+)?$/);if(!r){if("production"!==process.env.NODE_ENV)throw new Error("production"!==process.env.NODE_ENV?`MUI: The provided shorthand (${t}) is invalid. The format should be \`@<breakpoint | number>\` or \`@<breakpoint | number>/<container>\`.\nFor example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`:xt(18,`(${t})`));return null}const[,n,o]=r,i=Number.isNaN(+n)?n||0:+n;return e.containerQueries(o).up(i)}(n.containerQueries?n:dr,i);e&&(o[e]=r(t[i],i))}else Object.keys(e.values||sr).includes(i)?o[e.up(i)]=r(t[i],i):o[i]=t[i];var a,l;return o},{})}return r(t)}function pr(e={}){const t=e.keys?.reduce((t,r)=>(t[e.up(r)]={},t),{});return t||{}}function mr(e,t){return e.reduce((e,t)=>{const r=e[t];return(!r||0===Object.keys(r).length)&&delete e[t],e},t)}function hr({values:e,breakpoints:t,base:r}){const n=r||function(e,t){if("object"!=typeof e)return{};const r={},n=Object.keys(t);return Array.isArray(e)?n.forEach((t,n)=>{n<e.length&&(r[t]=!0)}):n.forEach(t=>{null!=e[t]&&(r[t]=!0)}),r}(e,t),o=Object.keys(n);if(0===o.length)return e;let i;return o.reduce((t,r,n)=>(Array.isArray(e)?(t[r]=null!=e[n]?e[n]:e[i],i=n):"object"==typeof e?(t[r]=null!=e[r]?e[r]:e[i],i=r):t[r]=e,t),{})}function fr(e){if("string"!=typeof e)throw new Error("production"!==process.env.NODE_ENV?"MUI: `capitalize(string)` expects a string argument.":xt(7));return e.charAt(0).toUpperCase()+e.slice(1)}function gr(e,t,r=!0){if(!t||"string"!=typeof t)return null;if(e&&e.vars&&r){const r=`vars.${t}`.split(".").reduce((e,t)=>e&&e[t]?e[t]:null,e);if(null!=r)return r}return t.split(".").reduce((e,t)=>e&&null!=e[t]?e[t]:null,e)}function yr(e,t,r,n=r){let o;return o="function"==typeof e?e(r):Array.isArray(e)?e[r]||n:gr(e,r)||n,t&&(o=t(o,n,e)),o}function br(e){const{prop:t,cssProperty:r=e.prop,themeKey:n,transform:o}=e,i=e=>{if(null==e[t])return null;const i=e[t],a=gr(e.theme,n)||{};return ur(e,i,e=>{let n=yr(a,o,e);return e===n&&"string"==typeof e&&(n=yr(a,o,`${t}${"default"===e?"":fr(e)}`,e)),!1===r?n:{[r]:n}})};return i.propTypes="production"!==process.env.NODE_ENV?{[t]:ar}:{},i.filterProps=[t],i}const vr={m:"margin",p:"padding"},xr={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Cr={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},wr=function(){const e={};return t=>(void 0===e[t]&&(e[t]=(e=>{if(e.length>2){if(!Cr[e])return[e];e=Cr[e]}const[t,r]=e.split(""),n=vr[t],o=xr[r]||"";return Array.isArray(o)?o.map(e=>n+e):[n+o]})(t)),e[t])}(),kr=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Er=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],Sr=[...kr,...Er];function Yr(e,t,r,n){const o=gr(e,t,!0)??r;return"number"==typeof o||"string"==typeof o?e=>"string"==typeof e?e:("production"!==process.env.NODE_ENV&&"number"!=typeof e&&console.error(`MUI: Expected ${n} argument to be a number or a string, got ${e}.`),"string"==typeof o?o.startsWith("var(")&&0===e?0:o.startsWith("var(")&&1===e?o:`calc(${e} * ${o})`:o*e):Array.isArray(o)?e=>{if("string"==typeof e)return e;const r=Math.abs(e);"production"!==process.env.NODE_ENV&&(Number.isInteger(r)?r>o.length-1&&console.error([`MUI: The value provided (${r}) overflows.`,`The supported values are: ${JSON.stringify(o)}.`,`${r} > ${o.length-1}, you need to add the missing values.`].join("\n")):console.error([`MUI: The \`theme.${t}\` array type cannot be combined with non integer values.You should either use an integer value that can be used as index, or define the \`theme.${t}\` as a number.`].join("\n")));const n=o[r];return e>=0?n:"number"==typeof n?-n:"string"==typeof n&&n.startsWith("var(")?`calc(-1 * ${n})`:`-${n}`}:"function"==typeof o?o:("production"!==process.env.NODE_ENV&&console.error([`MUI: The \`theme.${t}\` value (${o}) is invalid.`,"It should be a number, an array or a function."].join("\n")),()=>{})}function Or(e){return Yr(e,"spacing",8,"spacing")}function Dr(e,t){return"string"==typeof t||null==t?t:e(t)}function Ar(e,t){const r=Or(e.theme);return Object.keys(e).map(n=>function(e,t,r,n){if(!t.includes(r))return null;const o=function(e,t){return r=>e.reduce((e,n)=>(e[n]=Dr(t,r),e),{})}(wr(r),n);return ur(e,e[r],o)}(e,t,n,r)).reduce(lr,{})}function Vr(e){return Ar(e,kr)}function Ir(e){return Ar(e,Er)}function Mr(...e){const t=e.reduce((e,t)=>(t.filterProps.forEach(r=>{e[r]=t}),e),{}),r=e=>Object.keys(e).reduce((r,n)=>t[n]?lr(r,t[n](e)):r,{});return r.propTypes="production"!==process.env.NODE_ENV?e.reduce((e,t)=>Object.assign(e,t.propTypes),{}):{},r.filterProps=e.reduce((e,t)=>e.concat(t.filterProps),[]),r}function Nr(e){return"number"!=typeof e?e:`${e}px solid`}function Tr(e,t){return br({prop:e,themeKey:"borders",transform:t})}Vr.propTypes="production"!==process.env.NODE_ENV?kr.reduce((e,t)=>(e[t]=ar,e),{}):{},Vr.filterProps=kr,Ir.propTypes="production"!==process.env.NODE_ENV?Er.reduce((e,t)=>(e[t]=ar,e),{}):{},Ir.filterProps=Er,"production"===process.env.NODE_ENV||Sr.reduce((e,t)=>(e[t]=ar,e),{});const jr=Tr("border",Nr),zr=Tr("borderTop",Nr),Rr=Tr("borderRight",Nr),Pr=Tr("borderBottom",Nr),Fr=Tr("borderLeft",Nr),$r=Tr("borderColor"),Wr=Tr("borderTopColor"),Lr=Tr("borderRightColor"),Br=Tr("borderBottomColor"),_r=Tr("borderLeftColor"),qr=Tr("outline",Nr),Ur=Tr("outlineColor"),Xr=e=>{if(null!=e.borderRadius){const t=Yr(e.theme,"shape.borderRadius",4,"borderRadius");return ur(e,e.borderRadius,e=>({borderRadius:Dr(t,e)}))}return null};Xr.propTypes="production"!==process.env.NODE_ENV?{borderRadius:ar}:{},Xr.filterProps=["borderRadius"],Mr(jr,zr,Rr,Pr,Fr,$r,Wr,Lr,Br,_r,Xr,qr,Ur);const Kr=e=>{if(null!=e.gap){const t=Yr(e.theme,"spacing",8,"gap");return ur(e,e.gap,e=>({gap:Dr(t,e)}))}return null};Kr.propTypes="production"!==process.env.NODE_ENV?{gap:ar}:{},Kr.filterProps=["gap"];const Gr=e=>{if(null!=e.columnGap){const t=Yr(e.theme,"spacing",8,"columnGap");return ur(e,e.columnGap,e=>({columnGap:Dr(t,e)}))}return null};Gr.propTypes="production"!==process.env.NODE_ENV?{columnGap:ar}:{},Gr.filterProps=["columnGap"];const Hr=e=>{if(null!=e.rowGap){const t=Yr(e.theme,"spacing",8,"rowGap");return ur(e,e.rowGap,e=>({rowGap:Dr(t,e)}))}return null};function Jr(e,t){return"grey"===t?t:e}function Qr(e){return e<=1&&0!==e?100*e+"%":e}Hr.propTypes="production"!==process.env.NODE_ENV?{rowGap:ar}:{},Hr.filterProps=["rowGap"],Mr(Kr,Gr,Hr,br({prop:"gridColumn"}),br({prop:"gridRow"}),br({prop:"gridAutoFlow"}),br({prop:"gridAutoColumns"}),br({prop:"gridAutoRows"}),br({prop:"gridTemplateColumns"}),br({prop:"gridTemplateRows"}),br({prop:"gridTemplateAreas"}),br({prop:"gridArea"})),Mr(br({prop:"color",themeKey:"palette",transform:Jr}),br({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Jr}),br({prop:"backgroundColor",themeKey:"palette",transform:Jr}));const Zr=br({prop:"width",transform:Qr}),en=e=>null!=e.maxWidth?ur(e,e.maxWidth,t=>{const r=e.theme?.breakpoints?.values?.[t]||sr[t];return r?"px"!==e.theme?.breakpoints?.unit?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:Qr(t)}}):null;en.filterProps=["maxWidth"];const tn=br({prop:"minWidth",transform:Qr}),rn=br({prop:"height",transform:Qr}),nn=br({prop:"maxHeight",transform:Qr}),on=br({prop:"minHeight",transform:Qr});br({prop:"size",cssProperty:"width",transform:Qr}),br({prop:"size",cssProperty:"height",transform:Qr}),Mr(Zr,en,tn,rn,nn,on,br({prop:"boxSizing"}));var an={border:{themeKey:"borders",transform:Nr},borderTop:{themeKey:"borders",transform:Nr},borderRight:{themeKey:"borders",transform:Nr},borderBottom:{themeKey:"borders",transform:Nr},borderLeft:{themeKey:"borders",transform:Nr},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Nr},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Xr},color:{themeKey:"palette",transform:Jr},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Jr},backgroundColor:{themeKey:"palette",transform:Jr},p:{style:Ir},pt:{style:Ir},pr:{style:Ir},pb:{style:Ir},pl:{style:Ir},px:{style:Ir},py:{style:Ir},padding:{style:Ir},paddingTop:{style:Ir},paddingRight:{style:Ir},paddingBottom:{style:Ir},paddingLeft:{style:Ir},paddingX:{style:Ir},paddingY:{style:Ir},paddingInline:{style:Ir},paddingInlineStart:{style:Ir},paddingInlineEnd:{style:Ir},paddingBlock:{style:Ir},paddingBlockStart:{style:Ir},paddingBlockEnd:{style:Ir},m:{style:Vr},mt:{style:Vr},mr:{style:Vr},mb:{style:Vr},ml:{style:Vr},mx:{style:Vr},my:{style:Vr},margin:{style:Vr},marginTop:{style:Vr},marginRight:{style:Vr},marginBottom:{style:Vr},marginLeft:{style:Vr},marginX:{style:Vr},marginY:{style:Vr},marginInline:{style:Vr},marginInlineStart:{style:Vr},marginInlineEnd:{style:Vr},marginBlock:{style:Vr},marginBlockStart:{style:Vr},marginBlockEnd:{style:Vr},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Kr},rowGap:{style:Hr},columnGap:{style:Gr},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Qr},maxWidth:{style:en},minWidth:{transform:Qr},height:{transform:Qr},maxHeight:{transform:Qr},minHeight:{transform:Qr},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};const ln=function(){function e(e,t,r,n){const o={[e]:t,theme:r},i=n[e];if(!i)return{[e]:t};const{cssProperty:a=e,themeKey:l,transform:s,style:c}=i;if(null==t)return null;if("typography"===l&&"inherit"===t)return{[e]:t};const d=gr(r,l)||{};return c?c(o):ur(o,t,t=>{let r=yr(d,s,t);return t===r&&"string"==typeof t&&(r=yr(d,s,`${e}${"default"===t?"":fr(t)}`,t)),!1===a?r:{[a]:r}})}return function t(r){const{sx:n,theme:o={},nested:i}=r||{};if(!n)return null;const a=o.unstable_sxConfig??an;function l(r){let n=r;if("function"==typeof r)n=r(o);else if("object"!=typeof r)return r;if(!n)return null;const l=pr(o.breakpoints),s=Object.keys(l);let c=l;return Object.keys(n).forEach(r=>{const i="function"==typeof(l=n[r])?l(o):l;var l;if(null!=i)if("object"==typeof i)if(a[r])c=lr(c,e(r,i,o,a));else{const e=ur({theme:o},i,e=>({[r]:e}));!function(...e){const t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]),r=new Set(t);return e.every(e=>r.size===Object.keys(e).length)}(e,i)?c=lr(c,e):c[r]=t({sx:i,theme:o,nested:!0})}else c=lr(c,e(r,i,o,a))}),!i&&o.modularCssLayers?{"@layer sx":or(o,mr(s,c))}:or(o,mr(s,c))}return Array.isArray(n)?n.map(l):l(n)}}();ln.filterProps=["sx"];var sn=ln;function cn(e,t){const r=this;if(r.vars){if(!r.colorSchemes?.[e]||"function"!=typeof r.getColorSchemeSelector)return{};let n=r.getColorSchemeSelector(e);return"&"===n?t:((n.includes("data-")||n.includes("."))&&(n=`*:where(${n.replace(/\s*&$/,"")}) &`),{[n]:t})}return r.palette.mode===e?t:{}}function dn(e={},...t){const{breakpoints:r={},palette:n={},spacing:o,shape:i={},...a}=e,l=function(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:n=5,...o}=e,i=(e=>{const t=Object.keys(e).map(t=>({key:t,val:e[t]}))||[];return t.sort((e,t)=>e.val-t.val),t.reduce((e,t)=>({...e,[t.key]:t.val}),{})})(t),a=Object.keys(i);function l(e){return`@media (min-width:${"number"==typeof t[e]?t[e]:e}${r})`}function s(e){return`@media (max-width:${("number"==typeof t[e]?t[e]:e)-n/100}${r})`}function c(e,o){const i=a.indexOf(o);return`@media (min-width:${"number"==typeof t[e]?t[e]:e}${r}) and (max-width:${(-1!==i&&"number"==typeof t[a[i]]?t[a[i]]:o)-n/100}${r})`}return{keys:a,values:i,up:l,down:s,between:c,only:function(e){return a.indexOf(e)+1<a.length?c(e,a[a.indexOf(e)+1]):l(e)},not:function(e){const t=a.indexOf(e);return 0===t?l(a[1]):t===a.length-1?s(a[t]):c(e,a[a.indexOf(e)+1]).replace("@media","@media not all and")},unit:r,...o}}(r),s=function(e=8,t=Or({spacing:e})){if(e.mui)return e;const r=(...e)=>("production"!==process.env.NODE_ENV&&(e.length<=4||console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${e.length}`)),(0===e.length?[1]:e).map(e=>{const r=t(e);return"number"==typeof r?`${r}px`:r}).join(" "));return r.mui=!0,r}(o);let c=nr({breakpoints:l,direction:"ltr",components:{},palette:{mode:"light",...n},spacing:s,shape:{...ir,...i}},a);return c=function(e){const t=(e,t)=>e.replace("@media",t?`@container ${t}`:"@container");function r(r,n){r.up=(...r)=>t(e.breakpoints.up(...r),n),r.down=(...r)=>t(e.breakpoints.down(...r),n),r.between=(...r)=>t(e.breakpoints.between(...r),n),r.only=(...r)=>t(e.breakpoints.only(...r),n),r.not=(...r)=>{const o=t(e.breakpoints.not(...r),n);return o.includes("not all and")?o.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):o}}const n={},o=e=>(r(n,e),n);return r(o),{...e,containerQueries:o}}(c),c.applyStyles=cn,c=t.reduce((e,t)=>nr(e,t),c),c.unstable_sxConfig={...an,...a?.unstable_sxConfig},c.unstable_sx=function(e){return sn({sx:e,theme:this})},c}const un=dn(),pn=e=>e;var mn=(()=>{let e=pn;return{configure(t){e=t},generate:t=>e(t),reset(){e=pn}}})();function hn(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=hn(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function fn(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=hn(e))&&(n&&(n+=" "),n+=t);return n}const gn={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function yn(e,t=""){return e.displayName||e.name||t}function bn(e,t,r){const n=yn(t);return e.displayName||(""!==n?`${r}(${n})`:r)}const vn=dn();function xn(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}function Cn(e,t){return t&&e&&"object"==typeof e&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function wn(e){return e?(t,r)=>r[e]:null}function kn(e,t,r){const n="function"==typeof t?t(e):t;if(Array.isArray(n))return n.flatMap(t=>kn(e,t,r));if(Array.isArray(n?.variants)){let t;if(n.isProcessed)t=r?Cn(n.style,r):n.style;else{const{variants:e,...o}=n;t=r?Cn(er(o),r):o}return En(e,n.variants,[t],r)}return n?.isProcessed?r?Cn(er(n.style),r):n.style:r?Cn(er(n),r):n}function En(e,t,r=[],n=void 0){let o;e:for(let i=0;i<t.length;i+=1){const a=t[i];if("function"==typeof a.props){if(o??={...e,...e.ownerState,ownerState:e.ownerState},!a.props(o))continue}else for(const t in a.props)if(e[t]!==a.props[t]&&e.ownerState?.[t]!==a.props[t])continue e;"function"==typeof a.style?(o??={...e,...e.ownerState,ownerState:e.ownerState},r.push(n?Cn(er(a.style(o)),n):a.style(o))):r.push(n?Cn(er(a.style),n):a.style)}return r}function Sn(e,t){let r;return"production"!==process.env.NODE_ENV&&e&&(r=`${e}-${Yn(t||"Root")}`),r}function Yn(e){return e?e.charAt(0).toLowerCase()+e.slice(1):e}const On=function(e={}){const{themeId:t,defaultTheme:r=vn,rootShouldForwardProp:n=xn,slotShouldForwardProp:o=xn}=e;function i(e){!function(e,t,r){e.theme=function(e){for(const t in e)return!1;return!0}(e.theme)?r:e.theme[t]||e.theme}(e,t,r)}return(e,t={})=>{!function(e){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=e.__emotion_styles.filter(e=>e!==sn))}(e);const{name:r,slot:a,skipVariantsResolver:l,skipSx:s,overridesResolver:c=wn(Yn(a)),...d}=t,u=r&&r.startsWith("Mui")||a?"components":"custom",p=void 0!==l?l:a&&"Root"!==a&&"root"!==a||!1,m=s||!1;let h=xn;"Root"===a||"root"===a?h=n:a?h=o:function(e){return"string"==typeof e&&e.charCodeAt(0)>96}(e)&&(h=void 0);const f=function(e,t){const r=ge(e,t);return"production"!==process.env.NODE_ENV?(...t)=>{const n="string"==typeof e?`"${e}"`:"component";return 0===t.length?console.error([`MUI: Seems like you called \`styled(${n})()\` without a \`style\` argument.`,'You must provide a `styles` argument: `styled("div")(styleYouForgotToPass)`.'].join("\n")):t.some(e=>void 0===e)&&console.error(`MUI: the styled(${n})(...args) API requires all its args to be defined.`),r(...t)}:r}(e,{shouldForwardProp:h,label:Sn(r,a),...d}),g=e=>{if(e.__emotion_real===e)return e;if("function"==typeof e)return function(t){return kn(t,e,t.theme.modularCssLayers?u:void 0)};if(tr(e)){const t=function(e){const{variants:t,...r}=e,n={variants:t,style:er(r),isProcessed:!0};return n.style===r||t&&t.forEach(e=>{"function"!=typeof e.style&&(e.style=er(e.style))}),n}(e);return function(e){return t.variants?kn(e,t,e.theme.modularCssLayers?u:void 0):e.theme.modularCssLayers?Cn(t.style,u):t.style}}return e},y=(...t)=>{const n=[],o=t.map(g),l=[];if(n.push(i),r&&c&&l.push(function(e){const t=e.theme,n=t.components?.[r]?.styleOverrides;if(!n)return null;const o={};for(const t in n)o[t]=kn(e,n[t],e.theme.modularCssLayers?"theme":void 0);return c(e,o)}),r&&!p&&l.push(function(e){const t=e.theme,n=t?.components?.[r]?.variants;return n?En(e,n,[],e.theme.modularCssLayers?"theme":void 0):null}),m||l.push(sn),Array.isArray(o[0])){const e=o.shift(),t=new Array(n.length).fill(""),r=new Array(l.length).fill("");let i;i=[...t,...e,...r],i.raw=[...t,...e.raw,...r],n.unshift(i)}const s=[...n,...o,...l],d=f(...s);return e.muiName&&(d.muiName=e.muiName),"production"!==process.env.NODE_ENV&&(d.displayName=function(e,t,r){return e?`${e}${fr(t||"")}`:`Styled(${function(e){if(null!=e){if("string"==typeof e)return e;if("function"==typeof e)return yn(e,"Component");if("object"==typeof e)switch(e.$$typeof){case fe:return bn(e,e.render,"ForwardRef");case he:return bn(e,e.type,"memo");default:return}}}(r)})`}(r,a,e)),d};return f.withConfig&&(y.withConfig=f.withConfig),y}}();var Dn=On;function An(e,t,r=!1){const n={...t};for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)){const i=o;if("components"===i||"slots"===i)n[i]={...e[i],...n[i]};else if("componentsProps"===i||"slotProps"===i){const o=e[i],a=t[i];if(a)if(o){n[i]={...a};for(const e in o)Object.prototype.hasOwnProperty.call(o,e)&&(n[i][e]=An(o[e],a[e],r))}else n[i]=a;else n[i]=o||{}}else"className"===i&&r&&t.className?n.className=fn(e?.className,t?.className):"style"===i&&r&&t.style?n.style={...e?.style,...t?.style}:void 0===n[i]&&(n[i]=e[i])}return n}function Vn(e){const{theme:t,name:r,props:n}=e;return t&&t.components&&t.components[r]&&t.components[r].defaultProps?An(t.components[r].defaultProps,n):n}const In=dn(),Mn=Dn("div",{name:"MuiStack",slot:"Root"});function Nn(e){return function({props:e,name:t,defaultTheme:r,themeId:n}){let o=function(e=un){return function(e=null){const t=q.useContext(ye);return t&&0!==Object.keys(t).length?t:e}(e)}(r);return n&&(o=o[n]||o),Vn({theme:o,name:t,props:e})}({props:e,name:"MuiStack",defaultTheme:In})}function Tn(e,t){const r=q.Children.toArray(e).filter(Boolean);return r.reduce((e,n,o)=>(e.push(n),o<r.length-1&&e.push(/*#__PURE__*/q.cloneElement(t,{key:`separator-${o}`})),e),[])}const jn=({ownerState:e,theme:t})=>{let r={display:"flex",flexDirection:"column",...ur({theme:t},hr({values:e.direction,breakpoints:t.breakpoints.values}),e=>({flexDirection:e}))};if(e.spacing){const n=Or(t),o=Object.keys(t.breakpoints.values).reduce((t,r)=>(("object"==typeof e.spacing&&null!=e.spacing[r]||"object"==typeof e.direction&&null!=e.direction[r])&&(t[r]=!0),t),{}),i=hr({values:e.direction,base:o}),a=hr({values:e.spacing,base:o});"object"==typeof i&&Object.keys(i).forEach((e,t,r)=>{i[e]||(i[e]=t>0?i[r[t-1]]:"column")}),r=nr(r,ur({theme:t},a,(t,r)=>{return e.useFlexGap?{gap:Dr(n,t)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${o=r?i[r]:e.direction,{row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"}[o]}`]:Dr(n,t)}};var o}))}return r=function(e,...t){const r=pr(e),n=[r,...t].reduce((e,t)=>nr(e,t),{});return mr(Object.keys(r),n)}(t.breakpoints,r),r},zn=function(e={}){const{createStyledComponent:r=Mn,useThemeProps:n=Nn,componentName:o="MuiStack"}=e,i=r(jn),a=/*#__PURE__*/q.forwardRef(function(e,r){const a=function(e){const{sx:t,...r}=e,{systemProps:n,otherProps:o}=(e=>{const t={systemProps:{},otherProps:{}},r=e?.theme?.unstable_sxConfig??an;return Object.keys(e).forEach(n=>{r[n]?t.systemProps[n]=e[n]:t.otherProps[n]=e[n]}),t})(r);let i;return i=Array.isArray(t)?[n,...t]:"function"==typeof t?(...e)=>{const r=t(...e);return tr(r)?{...n,...r}:n}:{...n,...t},{...o,sx:i}}(n(e)),{component:l="div",direction:s="column",spacing:c=0,divider:d,children:u,className:p,useFlexGap:m=!1,...h}=a,f={direction:s,spacing:c,useFlexGap:m},g=function(e,t,r){const n={};for(const o in e){const i=e[o];let a="",l=!0;for(let e=0;e<i.length;e+=1){const n=i[e];n&&(a+=(!0===l?"":" ")+t(n),l=!1,r&&r[n]&&(a+=" "+r[n]))}n[o]=a}return n}({root:["root"]},e=>function(e,t,r="Mui"){const n=gn[t];return n?`${r}-${n}`:`${mn.generate(e)}-${t}`}(o,e),{});/*#__PURE__*/
2
- return t(i,{as:l,ownerState:f,ref:r,className:fn(g.root,p),...h,children:d?Tn(u,d):u})});return"production"!==process.env.NODE_ENV&&(a.propTypes={children:Qt.node,direction:Qt.oneOfType([Qt.oneOf(["column-reverse","column","row-reverse","row"]),Qt.arrayOf(Qt.oneOf(["column-reverse","column","row-reverse","row"])),Qt.object]),divider:Qt.node,spacing:Qt.oneOfType([Qt.arrayOf(Qt.oneOfType([Qt.number,Qt.string])),Qt.number,Qt.object,Qt.string]),sx:Qt.oneOfType([Qt.arrayOf(Qt.oneOfType([Qt.func,Qt.object,Qt.bool])),Qt.func,Qt.object])}),a}();"production"!==process.env.NODE_ENV&&(zn.propTypes={children:Qt.node,component:Qt.elementType,direction:Qt.oneOfType([Qt.oneOf(["column-reverse","column","row-reverse","row"]),Qt.arrayOf(Qt.oneOf(["column-reverse","column","row-reverse","row"])),Qt.object]),divider:Qt.node,spacing:Qt.oneOfType([Qt.arrayOf(Qt.oneOfType([Qt.number,Qt.string])),Qt.number,Qt.object,Qt.string]),sx:Qt.oneOfType([Qt.arrayOf(Qt.oneOfType([Qt.func,Qt.object,Qt.bool])),Qt.func,Qt.object]),useFlexGap:Qt.bool});var Rn=zn;function Pn(r){return t(m,{...r,children:e("svg",{width:"26",height:"34",viewBox:"0 0 26 50",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M24.9717 11.5L14.8333 1.36165C14.5757 1.10371 14.2262 0.958634 13.8617 0.958313H5.66667C4.32953 0.958313 3.04717 1.48949 2.10167 2.43498C1.15617 3.38048 0.625 4.66285 0.625 5.99998V28C0.625 29.3371 1.15617 30.6195 2.10167 31.565C3.04717 32.5105 4.32953 33.0416 5.66667 33.0416H20.3333C21.6705 33.0416 22.9528 32.5105 23.8983 31.565C24.8438 30.6195 25.375 29.3371 25.375 28V12.4166C25.3606 12.0713 25.2166 11.744 24.9717 11.5ZM15.2917 5.65165L20.6817 11.0416H15.2917V5.65165ZM20.3333 30.2916H5.66667C5.05888 30.2916 4.47598 30.0502 4.04621 29.6204C3.61644 29.1907 3.375 28.6078 3.375 28V5.99998C3.375 5.39219 3.61644 4.8093 4.04621 4.37953C4.47598 3.94976 5.05888 3.70831 5.66667 3.70831H12.5417V12.4166C12.5464 12.7798 12.6928 13.1268 12.9496 13.3837C13.2065 13.6405 13.5535 13.7869 13.9167 13.7916H22.625V28C22.625 28.6078 22.3836 29.1907 21.9538 29.6204C21.524 30.0502 20.9411 30.2916 20.3333 30.2916Z",fill:"#fff"}),t("path",{d:"M15.7317 22.225C14.6044 21.5176 13.756 20.4425 13.33 19.1817C13.7248 18.0021 13.8439 16.7478 13.6784 15.515C13.6255 15.2044 13.474 14.9191 13.2464 14.7013C13.0187 14.4835 12.727 14.3448 12.4144 14.3058C12.1018 14.2667 11.7849 14.3293 11.5107 14.4844C11.2364 14.6394 11.0194 14.8786 10.8917 15.1667C10.683 16.6487 10.8403 18.1594 11.35 19.5667C10.6537 21.1933 9.87664 22.7842 9.02169 24.3333C7.72002 25.0667 5.94169 26.1667 5.66669 27.4317C5.44669 28.4583 7.37169 31.0983 10.6534 25.3783C12.1126 24.8366 13.6072 24.3956 15.1267 24.0583C16.2499 24.7005 17.5029 25.0827 18.7934 25.1767C19.0897 25.1843 19.3816 25.1043 19.6325 24.9465C19.8835 24.7887 20.0822 24.5603 20.2036 24.2899C20.3251 24.0195 20.3639 23.7193 20.3152 23.4269C20.2666 23.1345 20.1325 22.8631 19.93 22.6467C19.16 21.8583 16.8684 22.0783 15.7317 22.225ZM6.96836 27.725C7.48213 26.8458 8.16063 26.0739 8.96669 25.4517C7.72002 27.4317 6.96836 27.78 6.96836 27.7433V27.725ZM12.3217 15.24C12.7984 15.24 12.7617 17.3483 12.4317 17.9167C12.1831 17.0521 12.1454 16.1405 12.3217 15.2583V15.24ZM10.7267 24.1867C11.3478 23.0533 11.887 21.877 12.34 20.6667C12.8257 21.5704 13.5012 22.3585 14.32 22.9767C13.09 23.2848 11.888 23.6956 10.7267 24.205V24.1867ZM19.3434 23.8567C19.3434 23.8567 19.0134 24.26 16.905 23.3433C19.1967 23.1967 19.5817 23.7283 19.3434 23.875V23.8567Z",fill:"#fff"})]})})}function Fn(r){return t(m,{...r,children:e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M20 8.70001H4C3.90151 8.70001 3.80398 8.68061 3.71299 8.64292C3.62199 8.60523 3.53931 8.54999 3.46967 8.48034C3.40003 8.4107 3.34478 8.32802 3.30709 8.23703C3.2694 8.14603 3.25 8.0485 3.25 7.95001C3.25 7.85152 3.2694 7.75399 3.30709 7.663C3.34478 7.57201 3.40003 7.48933 3.46967 7.41968C3.53931 7.35004 3.62199 7.29479 3.71299 7.2571C3.80398 7.21941 3.90151 7.20001 4 7.20001H20C20.1989 7.20001 20.3897 7.27903 20.5303 7.41968C20.671 7.56033 20.75 7.7511 20.75 7.95001C20.75 8.14892 20.671 8.33969 20.5303 8.48034C20.3897 8.621 20.1989 8.70001 20 8.70001Z",fill:"white"}),t("path",{d:"M16.44 20.75H7.56C7.24309 20.7717 6.92503 20.7302 6.62427 20.628C6.3235 20.5259 6.04601 20.365 5.80788 20.1548C5.56975 19.9446 5.37572 19.6891 5.23704 19.4034C5.09836 19.1176 5.01779 18.8071 5 18.49V7.99998C5 7.80107 5.07902 7.61031 5.21967 7.46965C5.36032 7.329 5.55109 7.24998 5.75 7.24998C5.94891 7.24998 6.13968 7.329 6.28033 7.46965C6.42098 7.61031 6.5 7.80107 6.5 7.99998V18.49C6.5 18.9 6.97 19.25 7.5 19.25H16.38C16.94 19.25 17.38 18.9 17.38 18.49V7.99998C17.38 7.78516 17.4653 7.57913 17.6172 7.42723C17.7691 7.27532 17.9752 7.18998 18.19 7.18998C18.4048 7.18998 18.6109 7.27532 18.7628 7.42723C18.9147 7.57913 19 7.78516 19 7.99998V18.49C18.9822 18.8071 18.9016 19.1176 18.763 19.4034C18.6243 19.6891 18.4303 19.9446 18.1921 20.1548C17.954 20.365 17.6765 20.5259 17.3757 20.628C17.075 20.7302 16.7569 20.7717 16.44 20.75ZM16.56 7.74998C16.4611 7.75133 16.363 7.73285 16.2714 7.69563C16.1798 7.65842 16.0966 7.60323 16.0267 7.53331C15.9568 7.4634 15.9016 7.38018 15.8644 7.28858C15.8271 7.19698 15.8087 7.09885 15.81 6.99998V5.50998C15.81 5.09999 15.33 4.74998 14.81 4.74998H9.22C8.67 4.74998 8.22 5.09999 8.22 5.50998V6.99998C8.22 7.1989 8.14098 7.38966 8.00033 7.53031C7.85968 7.67097 7.66891 7.74998 7.47 7.74998C7.27109 7.74998 7.08032 7.67097 6.93967 7.53031C6.79902 7.38966 6.72 7.1989 6.72 6.99998V5.50998C6.75872 4.8813 7.04203 4.29275 7.50929 3.87035C7.97655 3.44795 8.5906 3.22527 9.22 3.24998H14.78C15.4145 3.21717 16.0362 3.4362 16.51 3.85944C16.9838 4.28267 17.2713 4.87586 17.31 5.50998V6.99998C17.3113 7.09931 17.2929 7.19792 17.2558 7.29007C17.2187 7.38222 17.1637 7.46608 17.0939 7.53679C17.0241 7.6075 16.941 7.66364 16.8493 7.70195C16.7577 7.74027 16.6593 7.75999 16.56 7.75998V7.74998Z",fill:"white"}),t("path",{d:"M10.22 17C10.0219 16.9974 9.8326 16.9175 9.6925 16.7774C9.55241 16.6373 9.47256 16.4481 9.46997 16.25V11.72C9.46997 11.5211 9.54899 11.3303 9.68964 11.1896C9.83029 11.049 10.0211 10.97 10.22 10.97C10.4189 10.97 10.6096 11.049 10.7503 11.1896C10.891 11.3303 10.97 11.5211 10.97 11.72V16.24C10.9713 16.3393 10.9529 16.4379 10.9158 16.5301C10.8787 16.6222 10.8236 16.7061 10.7539 16.7768C10.6841 16.8475 10.601 16.9036 10.5093 16.9419C10.4177 16.9803 10.3193 17 10.22 17Z",fill:"white"}),t("path",{d:"M13.78 17C13.5811 17 13.3904 16.921 13.2497 16.7803C13.109 16.6396 13.03 16.4489 13.03 16.25V11.72C13.03 11.5211 13.109 11.3303 13.2497 11.1896C13.3904 11.049 13.5811 10.97 13.78 10.97C13.9789 10.97 14.1697 11.049 14.3104 11.1896C14.451 11.3303 14.53 11.5211 14.53 11.72V16.24C14.53 16.4398 14.4513 16.6316 14.311 16.7739C14.1706 16.9161 13.9799 16.9973 13.78 17Z",fill:"white"})]})})}function $n(e){const t=1048576;return e<t?`${(e/1024).toFixed(1)}KB`:`${(e/t).toFixed(1)}MB`}function Wn({name:a,tipoArquivo:s,title:c,required:d=!1,multiple:p=!1,apiURL:m,sizeLimit:y=4,xs:b=12,sm:v,md:x,route:C="",tstToken:w="",dropZoneOptions:k}){const{getRootProps:E,getInputProps:S}=ue({multiple:p,useFsAccessApi:!0,onDrop:e=>{V(-1),e.filter(e=>!(e.size/1048576>y&&(P(`Por favor, escolha um arquivo com tamanho inferior a ${y} MB`),setTimeout(()=>{P("")},3e3),1))).forEach((e,t)=>{let r=Date.now()+t;const n=new FormData;n.append("files",e),n.append("tipoArquivo",s),de.post(m,n,{onUploadProgress:t=>{const n=Math.round(100*t.loaded/t.total);V(n),n>=100&&M(t=>[...t,{id:r,name:e.name,loading:!0,error:!1,file:e,size:e.size}])},headers:{Authorization:`Bearer ${""===w?O?O.token:"":w}`}}).then(e=>{if(e.status>200){const t=te(e.data,C,e.data)[0].coSeqArquivo;Y.setFilesUid(e=>[...e,{CO_SEQ_ARQUIVO:t,CO_TIPO_ARQUIVO:parseInt(s)}]),T(e=>[...e,r]);const n={};n[r]=t,z(e=>({...e,...n}))}else V(-1),F(r)}).catch(e=>{console.log(e),V(-1),F(r)})})},...k||{}}),Y=K(dt),{user:O}=K(st),D=h();f(D.breakpoints.only("xs"));const[A,V]=H(-1),[I,M]=H([]),[N,T]=H([]),[j,z]=H({}),[R,P]=H(""),F=(e,t,r)=>{M(I.filter(t=>t.id!==e)),r&&Y.setFilesUid(e=>e.filter(e=>e.CO_SEQ_ARQUIVO!==r)),t||(P("Erro ao enviar arquivo. Verifique o formato e tente mais tarde."),setTimeout(()=>{P("")},3e3))};return J(()=>{const e=new DataTransfer;I.forEach(t=>{e.items.add(t.file)}),Y?.formSetValue(a,e.files)},[I,Y,a]),J(()=>()=>{Y.setFilesUid(e=>e.filter(e=>e.CO_TIPO_ARQUIVO!==parseInt(s)))},[]),t(n,{sx:{width:"100%"},size:{xs:b,sm:v,md:x},children:e(i,{bgcolor:"white",p:2,borderRadius:"8px",color:"#1E293B",children:[t(u,{required:d,sx:{marginBottom:2,textTransform:"capitalize"},children:c}),e(Rn,{...E({className:"dropzone"}),bgcolor:"#EFEFEF",justifyContent:"center",alignItems:"center",textAlign:"center",borderRadius:"6px",py:8,border:"solid 1.5px #989898",sx:{borderStyle:"dashed",cursor:"pointer"},children:[t("input",{...S(),...Y.formRegister(a,{validate:(e,t)=>{if((e.length&&N.length)<=0&&d)return"O campo de arquivo é obrigatório"}})}),e(Rn,{spacing:2,alignItems:"center",children:[e(i,{children:[t(o,{fontWeight:600,fontSize:18,children:"Arraste seus arquivos até aqui"}),t(o,{children:"ou selecione arquivos que estão no seu computador"})]}),t(l,{variant:"contained",sx:{backgroundColor:"#64748B",pointerEvents:"none",borderRadius:"8px",width:"fit-content"},children:"Selecionar"}),e(o,{fontWeight:300,children:["Tamanho máximo por arquivo ",y,"MB"]})]})]}),e(o,{pt:2,fontSize:16,fontWeight:600,children:["Você selecionou ",I.length," arquivo",I.length>1?"s":"","."]}),e(Rn,{width:"100%",marginTop:1,spacing:1,children:[I.map(r=>e(Rn,{direction:"row",justifyContent:"space-between",border:"solid 1px #E2E8F0",borderRadius:2,p:1,children:[e(Rn,{direction:"row",children:[t(Rn,{direction:"row",justifyContent:"center",alignItems:"center",minWidth:30,pr:1.5,children:t(Pn,{sx:{filter:"invert(42%) sepia(86%) saturate(2412%) hue-rotate(326deg) brightness(86%) contrast(102%)",transform:"scale(1.5)",width:30}})}),e(Rn,{children:[t(o,{fontWeight:600,children:r.name}),t(o,{fontSize:14,children:$n(r.size)})]})]}),t(l,{size:"small",startIcon:t(Fn,{}),variant:"contained",onClick:e=>{return t=r.id,void(Object.keys(j).includes(t.toString())&&fetch(`${m}/${j[t]}`,{method:"DELETE",headers:{Authorization:`Bearer ${""===w?O?O.token:"":w}`}}).then(e=>{e.ok||F(t,!0,j[t]),200===e.status&&F(t,!0,j[t])}).catch(e=>console.log(e)));var t},sx:{height:40,backgroundColor:"#DE3F50",borderRadius:"8px"},children:"Remover"})]})),A>0&&A<100&&t(g,{value:A,sx:{backgroundColor:"#103D6A",".MuiLinearProgress-bar":{backgroundColor:"#BDDDFA"}}})]}),R&&e(r,{children:[t(o,{variant:"caption",color:"#e53935",fontWeight:600,fontSize:14,paddingTop:2,children:R}),t("br",{})]}),te(Y?.errors,a)&&t(o,{variant:"caption",color:"#e53935",fontWeight:600,fontSize:14,children:"* O campo de arquivo é obrigatório"})]})})}function Ln({name:a,tipoArquivo:s,title:c,required:d=!1,multiple:p=!1,apiURL:m,route:g="",sizeLimit:x=4,xs:C=12,sm:w,md:k}){const E=K(dt),{user:S}=K(st),Y=h(),O=f(Y.breakpoints.only("xs")),[D,A]=H([]),[V,I]=H([]),[M,N]=H({}),[T,j]=H(""),z=G(e=>{const t=e.target.files,r=Object.keys(t).map(e=>t[e]);A([...D,...r.filter(e=>!(e.size/1048576>x&&(j(`Por favor, escolha um arquivo com tamanho inferior a ${x} MB`),setTimeout(()=>{j("")},3e3),1))).map((e,t)=>{let r=Date.now()+t;const n=new FormData;return n.append("files",e),n.append("tipoArquivo",s),fetch(m,{method:"POST",body:n,headers:{Authorization:`Bearer ${S?S.token:""}`}}).then(e=>{e.ok?e.json().then(e=>{if(e.status&&200===e.status.status){const t=te(e,g,e)[0].coSeqArquivo;E.setFilesUid(e=>[...e,{CO_SEQ_ARQUIVO:t,CO_TIPO_ARQUIVO:parseInt(s)}]),I(e=>[...e,r]);const n={};n[r]=t,N(e=>({...e,...n}))}else R(r)}):R(r)}).catch(e=>{R(r)}),{id:r,name:e.name,loading:!0,error:!1,file:e}})])},[D,E]),R=(e,t,r)=>{A(D.filter(t=>t.id!==e)),r&&E.setFilesUid(e=>e.filter(e=>e.CO_SEQ_ARQUIVO!==r)),t||(j("Erro ao enviar arquivo. Tente novamente mais tarde"),setTimeout(()=>{j("")},3e3))};return J(()=>{const e=new DataTransfer;D.forEach(t=>{e.items.add(t.file)}),E?.formSetValue(a,e.files)},[D,E,a]),J(()=>()=>{E.setFilesUid(e=>e.filter(e=>e.CO_TIPO_ARQUIVO!==parseInt(s)))},[]),e(n,{sx:{width:"100%"},size:{xs:C,sm:w,md:k},children:[t(u,{required:d,sx:{marginBottom:2,textTransform:"capitalize"},children:c}),e(i,{sx:{backgroundColor:"#e2eafc",padding:1,borderRadius:1,marginTop:1},children:[t("input",{id:a,type:"file",multiple:p,...E?.formRegister(a,{validate:(e,t)=>{if((e.length&&V.length)<=0&&d)return"O campo de arquivo é obrigatório"}}),onChange:z,accept:".pdf",style:{display:"none"}}),t("input",{id:a+"foto",type:"file",capture:"environment",multiple:p,...E?.formRegister(a,{validate:(e,t)=>{if((e.length&&V.length)<=0&&d)return"O campo de arquivo é obrigatório"}}),onChange:z,accept:".jpg, .png, .jpeg",style:{display:"none"}}),e(i,{sx:{display:{sx:"block",md:"flex"}},children:[t(i,{sx:{width:"100%",marginRight:{xs:0,md:1},marginBottom:{xs:1,md:0}},children:!p&&D.length>=1?t(l,{disabled:!0,variant:"contained",disableElevation:!0,startIcon:t(Ce,{}),component:"span",sx:{textTransform:"none"},fullWidth:!0,children:"Escolher Documento"}):t("label",{htmlFor:a,children:t(l,{variant:"contained",disableElevation:!0,startIcon:t(Ce,{}),component:"span",sx:{textTransform:"none"},fullWidth:!0,children:"Escolher Documento"})})}),t(i,{sx:{width:"100%"},children:!p&&D.length>=1?t(l,{disabled:!0,variant:"contained",disableElevation:!0,startIcon:t(be,{}),component:"span",sx:{textTransform:"none",backgroundColor:"#0096c7"},fullWidth:!0,children:O?"Tirar Foto":"Escolher Imagem"}):t("label",{htmlFor:a+"foto",children:t(l,{variant:"contained",disableElevation:!0,startIcon:t(be,{}),component:"span",sx:{textTransform:"none",backgroundColor:"#0096c7"},fullWidth:!0,children:O?"Tirar Foto":"Escolher Imagem"})})})]}),e(o,{fontWeight:600,paddingY:1,color:"black",children:["Você selecionou ",D.length," arquivo",D.length>1&&"s"]}),D.length>0&&t(y,{component:b,children:t(Rn,{direction:"column",children:D.map(r=>e(Rn,{direction:"row",justifyContent:"space-between",padding:.5,children:[t(i,{children:e(Rn,{direction:"row",spacing:2,children:[V.includes(r.id)?t(xe,{sx:{fill:"#06d6a0"}}):t(v,{size:22,sx:{color:"black"}}),t(we,{color:"error"}),t(o,{fontWeight:600,children:r.name})]})}),t(i,{children:V.includes(r.id)&&t(l,{variant:"contained",size:"small",sx:{textTransform:"none",backgroundColor:"#d1495b","&:hover":{backgroundColor:"#c1121f"}},onClick:e=>{return t=r.id,void(Object.keys(M).includes(t.toString())&&fetch(`${m}/${M[t]}`,{method:"DELETE",headers:{Authorization:`Bearer ${S?.token}`}}).then(e=>{e.ok||R(t,!0,M[t]),200===e.status&&R(t,!0,M[t])}).catch(e=>console.log(e)));var t},startIcon:t(ve,{}),children:"Remover"})})]},r.name))})}),T&&e(r,{children:[t(o,{variant:"caption",color:"#e53935",fontWeight:600,fontSize:14,paddingTop:2,children:T}),t("br",{})]}),te(E?.errors,a)&&t(o,{variant:"caption",color:"#e53935",fontWeight:600,fontSize:14,children:"* O campo de arquivo é obrigatório"})]})]})}function Bn({defaultChecked:r=!1,...n}){const i=K(dt);J(()=>{i?.formSetValue(n.name,r)},[]);const l=Q(()=>n.overrideYes||"Sim",[n.overrideYes]),c=Q(()=>n.overrideNo||"Não",[n.overrideNo]);return e(a,{sx:{alignItems:"center",justifyContent:"center"},children:[n.title&&t(u,{children:n.title}),t(s,{control:t(x,{defaultChecked:r,...i?.formRegister(n.name)}),label:t(o,{width:25,sx:{userSelect:"none",fontWeight:600},children:i?.formWatch(n.name)?l:c}),sx:{paddingLeft:1}})]})}var _n=/*#__PURE__*/U.memo(Bn);function qn({invert:e=!1,hasCheckValue:n=!1,...o}){const i=K(dt);return J(()=>()=>{(n?e:i.formWatch(o.switchId)===e)&&o.unregisterNameList.forEach(e=>i.formUnregister(e))},[o.unregisterNameList]),t(r,{})}function Un({invert:n=!1,checkValue:o,...i}){const a=K(dt);return t(r,{children:(o?a?.formWatch(i.switchId)===o!==n:a?.formWatch(i.switchId)!==n)&&e(r,{children:[t(qn,{switchId:i.switchId,unregisterNameList:i.unregisterNameList,hasCheckValue:!!o,invert:o?a?.formWatch(i.switchId)===o!==n:n}),i.children]})})}const Xn=/*#__PURE__*/U.forwardRef(function(e,r){const{onChange:n,maskProps:o,onMask:i,maskValue:a,setMaskValue:l,watchValue:s,...c}=e,[d,u]=H(o.mask);delete c.value;const p=Z(null),[m,h]=H(""),f=K(dt);return J(()=>{s&&h(s)},[s]),J(()=>{f.formSetValue(c.name,p.current.element.value)},[m]),delete c.watchValue,t(Ee,{...c,...o,mask:d,value:m,ref:p,inputRef:r,onChange:e=>{},onAccept:(e,t)=>{h(e),t.updateValue(),i&&i(e,u)}})});function Kn(e){const n=K(dt),[o,i]=H("");return t(r,{children:t(p,{...e.formConfig,onInput:t=>{n.formSetValue(e.formConfig.name,t.target.value)},InputProps:{inputComponent:Xn,inputProps:{maskProps:e.maskProps,onMask:e.onMask,maskValue:o,setMaskValue:i,watchValue:e.watchValue}},disabled:e.disabled,fullWidth:!0})})}function Gn({type:r="input",numberMask:o="000000000000000",xs:i=12,sm:a,inputMinLength:l=1,inputMaxLength:s=255,defaultValue:c="",md:d,disabled:m=!1,watchValue:h,...f}){const g=K(dt);return J(()=>{void 0!==h&&g.formSetValue(f.name,h)},[h]),e(n,{size:{xs:i,sm:a,md:d},children:[f.title&&t(u,{htmlFor:"campo",required:f.required,children:f.title}),(()=>{const e={fullWidth:!0,size:"small",placeholder:f.customPlaceholder?f.customPlaceholder:f.title},n=f.name,i=te(g?.errors,f.name),a=i?.message,d=!!i,u={...g?.formRegister(n,{validate:(e,t)=>{const n=e??"";if(n.length<=0&&f.required)return"Este campo é obrigatório";if("cnpj"===r){if(n.length<18&&f.required)return"O CNPJ precisa ter no mínimo 14 dígitos"}else if("cpf"===r){if(n.length<14&&f.required)return"O CPF precisa ter no mínimo 11 dígitos"}else if("sei"===r){if(n.length<22&&f.required)return"O Número SEI precisa ter no mínimo 19 dígitos"}else if("cep"===r){if(n.length<9&&f.required)return"O CPF precisa ter no mínimo 8 dígitos"}else if("input"===r||"password"===r||"number"===r){if(n.length>s)return`Limite máximo de ${s} caracteres`;if(n.length<l&&f.required)return`Limite mínimo de ${l} caracteres`}else if("email"===r){if(n.length>50)return"Limite máximo de 50 caracteres";if(!/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/g.test(e)&&f.required)return"O e-mail inserido não é valido"}else if("cpf_cnpj"===r){if((n.length<14||n.length>14&&n.length<18)&&f.required)return"O CPF/CNPJ precisa ter no mínimo 11/14 dígitos"}else if("phone"===r&&n.length<14&&f.required)return"O número precisa ter pelo menos 10 dígitos"}}),error:d,helperText:a,...e,sx:{backgroundColor:"white"}};switch(r){case"input":case"email":return t(p,{...u,defaultValue:c,disabled:m});case"password":return t(p,{...u,type:"password",disabled:m});case"number":return t(Kn,{formConfig:u,defaultValue:c,maskProps:{mask:o},watchValue:h,disabled:m});case"cep":return t(Kn,{formConfig:u,defaultValue:c,maskProps:{mask:"00000-000"},watchValue:h,disabled:m});case"phone":return t(Kn,{formConfig:u,defaultValue:c,maskProps:{mask:"(00) [#]0000-0000",definitions:{"#":/^9$/}},watchValue:h,disabled:m});case"sei":return t(Kn,{formConfig:u,defaultValue:c,maskProps:{mask:"00000-00000000/0000-00"},watchValue:h,disabled:m});case"cpf_cnpj":return t(Kn,{formConfig:u,defaultValue:c,maskProps:{mask:"000.000.000-00[0]"},onMask:(e,t)=>{t(e.length>14?"00.000.000/0000-00":"000.000.000-00[0]")},watchValue:h,disabled:m});case"cpf":return t(Kn,{formConfig:u,defaultValue:c,maskProps:{mask:"000.000.000-00"},watchValue:h,disabled:m});case"cnpj":return t(Kn,{formConfig:u,defaultValue:c,maskProps:{mask:"00.000.000/0000-00"},watchValue:h,disabled:m});case"rg":return t(Kn,{formConfig:u,defaultValue:c,maskProps:{mask:"00000[000000]"},watchValue:h,disabled:m})}})()]})}var Hn=/*#__PURE__*/U.memo(Gn);function Jn({name:r,required:o=!1,title:i,defaultChecked:l=!1,xs:s=12,unregisterNameList:c,sm:d,md:u,...p}){const m=`${r}-switch`;return e(n,{size:{xs:s,sm:d,md:u},children:[i&&t(ke,{required:o,sx:{textTransform:"capitalize"},children:i}),e(a,{direction:"row",children:[t(_n,{name:m,defaultChecked:l}),t(Un,{switchId:m,unregisterNameList:c,children:t(Gn,{name:"ddd",type:"input"})})]})]})}function Qn({name:r,required:o=!1,title:i,customPlaceholder:a,url:l,xs:s=12,sm:c,md:d,dataPath:u=""}){const m=K(dt),{user:h}=K(st),[f,g]=H([]);Se(`autocomplete-${r}`,()=>fetch(l,{headers:{Authorization:`Bearer ${h?h.token:""}`}}).then(e=>e.json().then(e=>g(y(e)))));const y=G(e=>Array.isArray(e)?e:"object"==typeof e?te(e,u):void 0,[]),b=G((e,t)=>{m?.formSetValue(r,t?t.id:""),m?.formTrigger(r)},[m,r]);return e(n,{size:{xs:s,sm:c,md:d},children:[i&&t(ke,{required:o,children:i}),t("input",{type:"text",...m?.formRegister(r,{validate:(e,t)=>{if(e.length<=0&&o)return"Este campo é obrigatório"}}),hidden:!0}),t(C,{options:f,isOptionEqualToValue:(e,t)=>e.id===t.id,onChange:b,renderInput:e=>t(p,{...e,placeholder:a,size:"small",error:!!te(m?.errors,r),helperText:te(m?.errors,r)?.message})})]})}let Zn=!0;function eo({name:r,url:o,title:i,customLoadingText:a,shouldRefetch:l=!0,required:s=!1,defaultValue:c,route:d="",onChange:m=()=>{},xs:h=12,sm:f,watchValue:g,md:y,disabled:b=!1}){const v=K(dt),[x,w]=H(!0),[k,E]=H([]),[S,Y]=H("Carregando..."),[O,D]=H(null),[A,V]=H(null),{user:I}=K(st);function M(){(c||!l)&&k.length>0||(w(!0),E([]),a&&Y(a),fetch(o,{method:"GET",headers:{Authorization:`Bearer ${I?.token}`}}).then(e=>{e.ok?e.json().then(e=>{E(te(e,d,e)),w(!1)}):Y("Erro ao carregar dados")}))}return J(()=>{c&&fetch(o,{method:"GET",headers:{Authorization:`Bearer ${I?.token}`}}).then(e=>{e.ok?(console.log("llll"),e.json().then(e=>{let t=te(e,d,e).filter(e=>e.id===c);t.length>0?(E(te(e,d,e)),w(!1),v.formSetValue(r,c),D(t[0])):Y("Erro ao carregar dados. Valor inválido")})):Y("Erro ao carregar dados")})},[]),J(()=>{g&&Zn&&(V(g),v.formSetValue(r,g.id),m(g.id))},[g]),c&&k.length<=0&&!O?t(n,{size:{xs:h,sm:f,md:y},children:t(p,{size:"small",fullWidth:!0,placeholder:S,disabled:!0})}):e(n,{size:{xs:h,sm:f,md:y},children:[i&&t(u,{required:s,children:i}),t("input",{type:"text",...v?.formRegister(r,{validate:(e,t)=>e?e.length<=0&&s?"Este campo é obrigatório":void 0:"Este campo é obrigatório"}),hidden:!0}),t(C,{value:A,loading:x,loadingText:S,options:k,defaultValue:O,getOptionDisabled:e=>e?.disabled??!1,isOptionEqualToValue:(e,t)=>e.id===t.id,onChange:(e,t)=>function(e){if(Zn=!1,e)return V(e),v.formSetValue(r,e.id),void m(e.id);V(null),v.formSetValue(r,""),m(void 0)}(t),renderInput:e=>t(p,{...e,size:"small",fullWidth:!0,placeholder:i,onFocus:M,error:!!te(v?.errors,r),helperText:te(v?.errors,r)?.message}),sx:{bgcolor:"white"},size:"small",fullWidth:!0,disabled:b})]})}let to=!0;function ro({name:r,title:o,required:i=!1,list:a,defaultValue:l,onChange:s=()=>{},xs:c=12,sm:d,watchValue:m,forceUpdate:h=!1,md:f}){const g=K(dt),[y,b]=H(null);return J(()=>{l&&g?.formSetValue(r,l.id)},[]),J(()=>{m&&(to||h)?(b(m),g.formSetValue(r,m.id),s(m.id)):void 0===m&&(to||h)&&(b(null),g.formSetValue(r,void 0),s(void 0))},[m]),e(n,{size:{xs:c,sm:d,md:f},children:[o&&t(u,{required:i,children:o}),t("input",{type:"text",...g?.formRegister(r,{validate:(e,t)=>e?e?.length<=0&&i?"Este campo é obrigatório":void 0:"Este campo é obrigatório"}),hidden:!0}),t(C,{value:y,options:a,defaultValue:l,getOptionLabel:e=>e.label?e.label.toString():"Não Encontrado",isOptionEqualToValue:(e,t)=>e.id===t.id,onChange:(e,t)=>function(e){if(to=!1,e)return b(e),g.formSetValue(r,e.id),void s(e.id);b(null),g.formSetValue(r,""),s(void 0)}(t),renderInput:e=>t(p,{...e,size:"small",fullWidth:!0,placeholder:o,error:!!te(g?.errors,r),helperText:te(g?.errors,r)?.message}),size:"small",sx:{bgcolor:"white"},fullWidth:!0})]})}let no=!0;function oo({name:r,url:o,title:i,customLoadingText:a,shouldRefetch:l=!0,required:s=!1,defaultValue:c,route:d="",onChange:m=()=>{},xs:h=12,sm:f,watchValue:g,md:y,disabled:b=!1}){const v=se(),[x,w]=H(!0),[k,E]=H([]),[S,Y]=H("Carregando..."),[O,D]=H(null),[A,V]=H(null),{user:I}=K(st);function M(){(c||!l)&&k.length>0||(w(!0),E([]),a&&Y(a),fetch(o,{method:"GET",headers:{Authorization:`Bearer ${I?.token}`}}).then(e=>{e.ok?e.json().then(e=>{E(te(e,d,e)),w(!1)}):Y("Erro ao carregar dados")}))}return J(()=>{c&&fetch(o,{method:"GET",headers:{Authorization:`Bearer ${I?.token}`}}).then(e=>{e.ok?(console.log("llll"),e.json().then(e=>{let t=te(e,d,e).filter(e=>e.id===c);t.length>0?(E(te(e,d,e)),w(!1),v.setValue(r,c),D(t[0])):Y("Erro ao carregar dados. Valor inválido")})):Y("Erro ao carregar dados")})},[]),J(()=>{g&&no&&(V(g),v.setValue(r,g.id),m(g.id))},[g]),c&&k.length<=0&&!O?t(n,{size:{xs:h,sm:f,md:y},children:t(p,{size:"small",fullWidth:!0,placeholder:S,disabled:!0})}):e(n,{size:{xs:h,sm:f,md:y},children:[i&&t(u,{required:s,children:i}),t("input",{type:"text",...v?.register(r,{validate:(e,t)=>{if(e.length<=0&&s)return"Este campo é obrigatório"}}),hidden:!0}),t(C,{value:A,loading:x,loadingText:S,options:k,defaultValue:O,getOptionDisabled:e=>e?.disabled??!1,isOptionEqualToValue:(e,t)=>e.id===t.id,onChange:(e,t)=>function(e){if(no=!1,e)return V(e),v.setValue(r,e.id),void m(e.id);V(null),v.setValue(r,""),m(void 0)}(t),renderInput:e=>t(p,{...e,size:"small",fullWidth:!0,placeholder:i,onFocus:M,error:!!te(v.formState.errors,r),helperText:te(v.formState.errors,r)?.message}),sx:{bgcolor:"white"},size:"small",fullWidth:!0,disabled:b})]})}function io({type:r="input",numberMask:o="000000000000000",xs:i=12,sm:a,inputMinLength:l=1,inputMaxLength:s=255,defaultValue:c="",md:d,disabled:m=!1,watchValue:h,...f}){const g=se();return J(()=>{void 0!==h&&g.setValue(f.name,h)},[h]),e(n,{size:{xs:i,sm:a,md:d},children:[f.title&&t(u,{htmlFor:"campo",required:f.required,children:f.title}),(()=>{const e={fullWidth:!0,size:"small",placeholder:f.customPlaceholder?f.customPlaceholder:f.title},n=f.name,i=te(g?.formState.errors,f.name),a=i?.message,d=!!i,u={...g?.register(n,{validate:(e,t)=>{const n=e??"";if(n.length<=0&&f.required)return"Este campo é obrigatório";if("cnpj"===r){if(n.length<18&&f.required)return"O CNPJ precisa ter no mínimo 14 dígitos"}else if("cpf"===r){if(n.length<14&&f.required)return"O CPF precisa ter no mínimo 11 dígitos"}else if("sei"===r){if(n.length<22&&f.required)return"O Número SEI precisa ter no mínimo 19 dígitos"}else if("cep"===r){if(n.length<9&&f.required)return"O CPF precisa ter no mínimo 8 dígitos"}else if("input"===r||"password"===r||"number"===r){if(n.length>s)return`Limite máximo de ${s} caracteres`;if(n.length<l&&f.required)return`Limite mínimo de ${l} caracteres`}else if("email"===r){if(n.length>50)return"Limite máximo de 50 caracteres";if(!/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/g.test(e)&&f.required)return"O e-mail inserido não é valido"}else if("cpf_cnpj"===r){if((n.length<14||n.length>14&&n.length<18)&&f.required)return"O CPF/CNPJ precisa ter no mínimo 11/14 dígitos"}else if("phone"===r&&n.length<14&&f.required)return"O número precisa ter pelo menos 10 dígitos"}}),error:d,helperText:a,...e,sx:{backgroundColor:"white"}};switch(r){case"input":case"email":return t(p,{...u,defaultValue:c,disabled:m});case"password":return t(p,{...u,type:"password",disabled:m});case"number":return t(Kn,{formConfig:u,defaultValue:c,maskProps:{mask:o},watchValue:h,disabled:m});case"cep":return t(Kn,{formConfig:u,defaultValue:c,maskProps:{mask:"00000-000"},watchValue:h,disabled:m});case"phone":return t(Kn,{formConfig:u,defaultValue:c,maskProps:{mask:"(00) [#]0000-0000",definitions:{"#":/^9$/}},watchValue:h,disabled:m});case"sei":return t(Kn,{formConfig:u,defaultValue:c,maskProps:{mask:"00000-00000000/0000-00"},watchValue:h,disabled:m});case"cpf_cnpj":return t(Kn,{formConfig:u,defaultValue:c,maskProps:{mask:"000.000.000-00[0]"},onMask:(e,t)=>{t(e.length>14?"00.000.000/0000-00":"000.000.000-00[0]")},watchValue:h,disabled:m});case"cpf":return t(Kn,{formConfig:u,defaultValue:c,maskProps:{mask:"000.000.000-00"},watchValue:h,disabled:m});case"cnpj":return t(Kn,{formConfig:u,defaultValue:c,maskProps:{mask:"00.000.000/0000-00"},watchValue:h,disabled:m});case"rg":return t(Kn,{formConfig:u,defaultValue:c,maskProps:{mask:"00000[000000]"},watchValue:h,disabled:m})}})()]})}var ao=/*#__PURE__*/U.memo(io);const lo=/*#__PURE__*/U.forwardRef(function(e,r){const{onChange:n,maskProps:o,onMask:i,maskValue:a,setMaskValue:l,watchValue:s,...c}=e,[d,u]=H(o.mask);delete c.value;const p=Z(null),[m,h]=H(""),f=se();return J(()=>{s&&h(s)},[s]),J(()=>{f.setValue(c.name,p.current.element.value)},[m]),delete c.watchValue,t(Ee,{...c,...o,mask:d,value:m,ref:p,inputRef:r,onChange:e=>{},onAccept:(e,t)=>{h(e),t.updateValue(),i&&i(e,u)}})});function so(e){const n=K(dt),[o,i]=H("");return t(r,{children:t(p,{...e.formConfig,onInput:t=>{n.formSetValue(e.formConfig.name,t.target.value)},InputProps:{inputComponent:lo,inputProps:{maskProps:e.maskProps,onMask:e.onMask,maskValue:o,setMaskValue:i,watchValue:e.watchValue}},disabled:e.disabled,fullWidth:!0})})}function co({name:r,required:o=!1,title:i,customPlaceholder:a,defaultValue:l="",xs:s=12,sm:c,watchValue:d="",inputMinLength:u=3,inputMaxLength:m=255,md:h,...f}){const g=se();return J(()=>{g.setValue(r,d)},[d]),e(n,{size:{xs:s,sm:c,md:h},children:[i&&t(ke,{required:o,sx:{textTransform:"capitalize"},children:i}),t(p,{multiline:!0,fullWidth:!0,minRows:3,defaultValue:l,...g.register(r,{validate:(e,t)=>o&&e.length<=0?"Este campo é obrigatório":e.length>m?`Limite máximo de ${m} caracteres`:e.length<u&&o?`Limite mínimo de ${u} caracteres`:void 0}),error:!!te(g.formState.errors,r),helperText:te(g.formState.errors,r)?.message,sx:{bgcolor:"white"},placeholder:a||i})]})}function uo({name:r,required:o=!1,title:i,customPlaceholder:a,defaultValue:l="",xs:s=12,sm:c,watchValue:d="",inputMinLength:u=3,inputMaxLength:m=255,md:h,...f}){const g=K(dt);return J(()=>{g.formSetValue(r,d)},[d]),e(n,{size:{xs:s,sm:c,md:h},children:[i&&t(ke,{required:o,sx:{textTransform:"capitalize"},children:i}),t(p,{multiline:!0,fullWidth:!0,minRows:3,defaultValue:l,...g.formRegister(r,{validate:(e,t)=>o&&e.length<=0?"Este campo é obrigatório":e.length>m?`Limite máximo de ${m} caracteres`:e.length<u&&o?`Limite mínimo de ${u} caracteres`:void 0}),error:!!te(g.errors,r),helperText:te(g.errors,r)?.message,sx:{bgcolor:"white"},placeholder:a||i})]})}function po({name:r,required:o=!1,xs:l=12,sm:s,md:d}){const u=K(dt),m=`switch-${r}`;return J(()=>{u.formWatch(m)||u.formSetValue(r,void 0)},[u]),t(n,{size:{xs:l,sm:s,md:d},children:e(a,{direction:"row",children:[t(i,{children:t(c,{size:"small",...u.formRegister(m),sx:{paddingLeft:0,margin:0}})}),u.formWatch(m)?t(p,{size:"small",...u.formRegister(r,{validate:(e,t)=>{if(!0===u.formWatch(m)&&(!e||e.length<=0&&o))return"Este campo não pode ser vazio"}}),required:!0,error:!!te(u.errors,r),helperText:te(u.errors,r)?.message,placeholder:"Outro"}):t(p,{size:"small",disabled:!0,placeholder:"Outro"})]})})}const mo=(e,t)=>{if(!e||Object.keys(e).length<=0)return[];if(!e[t])return[];let r=Object.keys(e[t]).map(e=>`${t}.${e}`);return e.files&&(r=[...r,...Object.keys(e.files).map(e=>`files.${e}`)]),r};function ho({debugLog:r=!1,test:n=!1,testConfig:o={},customMarginBottom:s=10,...c}){c.children=Array.isArray(c.children)?c.children.filter((e,t)=>e):c.children;const d=Array.isArray(c.children)?c.children.length:1,u=K(dt),p=Z(null),m=h(),[g,y]=H(0),b=(Array.isArray(c.children)?c.children:[c.children]).map((e,t)=>/*#__PURE__*/U.cloneElement(e,{...e.props,prefix:t})),v=d;return e(i,{children:[n&&t(a,{direction:"row",justifyContent:"end",children:t(l,{variant:"contained",color:"error",onClick:()=>{Object.keys(o).forEach((e,t)=>{const r=o[Number(e)];Object.keys(r).forEach(t=>{u.formUnregister(`${e}.${t}`),u.formSetValue(`${e}.${t}`,r[t])}),t<Object.keys(o).length-1&&new Promise(e=>setTimeout(e,100)).then(()=>{p.current?.click()})})},children:"EXCLUIR BANCO PRODUÇÃO"})}),e(a,{sx:{padding:2,marginBottom:s},children:[t(i,{children:b.map((e,r)=>t(i,{hidden:!(g===r),children:b[r]},"formsB"+r))}),t(w,{variant:"text",steps:v,position:f(m.breakpoints.only("xs"))?"bottom":"static",activeStep:g,sx:{paddingTop:2,paddingBottom:4,paddingX:0},backButton:t(l,{variant:"contained",startIcon:t(Ye,{}),onClick:()=>{y(e=>e-1)},disabled:0===g,sx:{textTransform:"none"},children:"Voltar"}),nextButton:g<v-1?t(l,{variant:"contained",endIcon:t(Oe,{}),onClick:function(){try{return r&&console.log(u.formGetValues()),Promise.resolve(u.formTrigger(mo(u.formGetValues(),g))).then(function(e){e?y(e=>e+1):Ve("Formulário incompleto! Verifique os campos marcados e tente novamente.",{type:"warning",theme:"light"})})}catch(e){return Promise.reject(e)}},sx:{textTransform:"none"},ref:p,children:"Próximo"}):t(i,{children:t(Ae,{variant:"contained",type:"submit",loading:u.submiting,loadingPosition:"start",startIcon:t(De,{}),onClick:e=>function(e){try{return Promise.resolve(u.formTrigger(mo(u.formGetValues(),g))).then(function(t){t||(e.preventDefault(),Ve("Formulário incompleto! Verifique os campos marcados e tente novamente.",{type:"warning",theme:"light"}))})}catch(e){return Promise.reject(e)}}(e),sx:{textTransform:"none",backgroundColor:"#22C55E","&:hover":{backgroundColor:"#48cf7a"}},children:t("span",{children:"Salvar"})})})})]})]})}var fo=/*#__PURE__*/U.memo(ho);function go(e,t,r){if(!e.props)return e;const n=e.props.children;if(!n)/*#__PURE__*/return U.cloneElement(e,{...e.props,name:`${t}.${e.props.name}`,key:e.props.name?`${t}.${e.props.name}`:`noListing-${r}-${t}-${e.props.name}`});let o;if(Array.isArray(n)){let e=[];n.forEach((n,o)=>{e.push(go(n,t,r+(o+1)))}),o=e}else o=go(n,t,r+1);/*#__PURE__*/return U.cloneElement(e,{...e.props,children:o,name:`${t}.${e.props.name}`,key:e.props.name?`${t}.${e.props.name}`:`noListing-${r}-${t}-${e.props.name}`})}function yo({optional:o=!1,title:l,prefix:s=0,optionalMessage:c,defaultChecked:d,...u}){const p=K(dt),m=`switch-${s}`,h=(Array.isArray(u.children)?u.children:[u.children]).map((e,t)=>e&&go(e,s,t));return e(i,{children:[t(n,{size:12,children:e(a,{direction:"row",justifyContent:"space-between",children:[e(a,{direction:"row",spacing:2,children:[t(i,{sx:{marginTop:.6},children:t(a,{sx:{backgroundColor:"#E6F8EB",borderRadius:"100%",height:"35px",width:"35px"},justifyContent:"center",alignItems:"center",children:t(Me,{sx:{height:"18px",fill:"#01BA35"}})})}),t(ee,{variant:"h6",fontWeight:600,fontSize:28,fontFamily:"Inter",sx:{color:"#1E293B",paddingBottom:4},children:l})]}),t(i,{hidden:!o,children:t(_n,{name:m,defaultChecked:!o||d,overrideNo:u.overrideSwitchNo,overrideYes:u.overrideSwitchYes})})]})}),t(a,{spacing:2,children:o?p.formWatch(m)?t(n,{container:!0,spacing:1,children:h}):t(a,{justifyContent:"center",alignItems:"center",children:t(ee,{fontFamily:"Inter",fontSize:22,paddingY:8,textAlign:"center",children:c||e(r,{children:[t("b",{children:l})," é opcional. ",t("br",{}),"Marque a opção acima caso haja necessidade."]})})}):t(n,{container:!0,spacing:1,children:h})})]})}var bo=/*#__PURE__*/U.memo(yo);let vo={open:()=>{},close:()=>{},openReparented:()=>{},reparent:()=>t(r,{})};function xo(){const[n,l]=H(!1),[s,c]=H(null),d=()=>l(!1);Z(null);const u=h(),p=f(u.breakpoints.up("sm")),[m,g]=H({}),[y,b]=H(-1321465654);return J(()=>{vo.open=e=>{e&&c(e),b(-1321465654),l(!0)},vo.reparent=(e,n)=>(g(o=>({...o,[n]:t(r,{children:e})})),t(r,{})),vo.openReparented=e=>{b(e),c(null),l(!0)},vo.close=d},[l]),t(r,{children:p?t(E,{open:n,onClose:d,children:e(i,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",borderRadius:2,bgcolor:"white",border:"1px solid #454545",boxShadow:24},children:[t(i,{onClick:d,width:"fit-content",height:"fit-content",position:"absolute",right:0,top:0,margin:.6,sx:{":hover":{transform:"scale(1.03)",transition:"all 500ms",cursor:"pointer"}},children:t(We,{sx:{transform:"scale(.9)"}})}),e(i,{overflow:"auto",maxHeight:"90vh",p:2,marginTop:4,borderTop:"solid 1px gray",bgcolor:"#F9F9F9",borderRadius:2,children:[s,m[y]]})]})}):e(k,{anchor:"bottom",open:n,onClose:d,onOpen:()=>{},PaperProps:{sx:{bgcolor:"transparent"}},children:[t(a,{direction:"row",onClick:d,maxHeight:"8vh",height:"8vh",justifyContent:"center",alignItems:"center",children:t(o,{fontWeight:600,color:"white",children:"Clique fora para fechar"})}),e(i,{p:2,maxHeight:"92vh",bgcolor:"white",overflow:"auto",children:[s,m[y]]})]})})}function Co({customColor:e="#383838",customFontColor:r="white",...n}){const o=Le(e);return t(l,{...n,sx:{bgcolor:o.toHexString(),color:Le(r).toHexString(),":hover":{bgcolor:o.darken(10).toHexString()},boxShadow:"none",borderRadius:3,textTransform:"capitalize",paddingX:2},size:"small",children:n.children})}function wo({data:n=[],...o}){const[i,a]=U.useState(null),l=Boolean(i),s=()=>{a(null)};return e(r,{children:[t(Co,{...o.btProps,onClick:e=>{a(e.currentTarget)},children:o.children}),t(S,{id:"basic-menu",anchorEl:i,open:l,onClose:s,MenuListProps:{"aria-labelledby":"basic-button"},children:n.map(e=>t(Y,{onClick:t=>{e.onClick&&e.onClick(),s()},children:e.name}))})]})}function ko(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/g,"")}function Eo(e){return("string"!=typeof e?e.toString():e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim()}let So=[],Yo=!1,Oo="",Do=!1,Ao={},Vo="";function Io({mediaQueryLG:n,columns:o,emptyMsg:s={user:"Nenhum dado encontrado",public:"Nenhum dado encontrado"},dataPath:c="",tableName:d="Dados",csv:u,columnSize:p,action:m,useKC:y=!0,statusKeyName:v="",csvExcludeKeys:x=[],csvExcludeKeysCSV:C=[],csvExcludeKeysAll:w=[],csvCustomKeyNames:k={},csvExcludeValidate:E=(e,t)=>!1,csvButtonTitle:S="Salvar .CSV",csvNoZipText:Y="Salvar .CSV",csvAllButtonTitle:I="Salvar todos em CSV",removeQuotes:M=!1,normalize:N=!1,csvShowAllButton:T=!1,csvWithoutZip:j=!1,itemCount:z=10,csvUpper:B=!1,csvZipFileNamesKey:q="",generateCsvZip:U=!1,hideTitleCSV:X=!1,csvExcludeUpper:Q=[],multipleDataPath:re="",expandTextMaxLength:ne=50,collapsedSize:oe=53,customMargin:ie=4,customMarginMobile:le=0,filtersFunc:se,filters:ce=[],orderBy:de=[],customErrorMsg:ue,customTableStyle:pe={},id:me,initialData:he=null,isLoading:fe}){const[ge,ye]=H(null),[be,ve]=H(he),{user:xe,userLoaded:Ce}=K(st),[we,ke]=H([]),[Ee,Se]=H([]),[Ye,Oe]=H(z),[De,Ae]=H(0),[Ve,Ie]=H(1),[Me,We]=H(1);H("");const[Le,Be]=H({}),[_e,qe]=H({}),[Ue,Xe]=H({}),[Ke,Ge]=H("filterKey"),He=h(),Je=f(He.breakpoints.only("xs")),Qe=Z(null),Ze=f(He.breakpoints.up(2e3));Oo=`tableFilter_${me}`,Vo=`tableFilterCache_${me}`,Ao=se??{},localStorage.getItem(Vo)||localStorage.setItem(Vo,JSON.stringify(ce)),localStorage.getItem(Vo)!==JSON.stringify(ce)&&(localStorage.setItem(Vo,JSON.stringify(ce)),localStorage.removeItem(Oo));const et=G(e=>{if(e.length<=0)return 1;let t=e.length/Ye;return t=t<1?1:t,Math.ceil(t)},[Ye]),tt=G(e=>Array.isArray(e)?e:"object"==typeof e?te(e,c):void 0,[]);J(()=>{if(ge||!tt(be))return;const e=tt(be);ke(e),Se(e),Ie(et(e)),localStorage.getItem(Oo)&&ct(JSON.parse(localStorage.getItem(Oo)))},[Ye,be,et,ge]),J(()=>{Ae(Me-1)},[Me]);const rt=G((e,t)=>{We(t)},[]),nt=G(()=>{const e=De*Ye;return we.slice(e,e+Ye)},[we,Ye,De]),ot=G((e,t=!1)=>{if(e.preventDefault(),we.length<=0)return;const r=Object.keys(we[0]);if(U&&t){const e=r.filter(e=>!x.includes(e)),t=e.map(e=>k[e]?k[e]:e).join(",")+"\n",o=new $e,i={};we.forEach(e=>{i[e[q]]||(i[e[q]]=[]),i[e[q]].push(e)}),Object.keys(i).forEach(n=>{const a=[];i[n].forEach(t=>{let n=!0;if(r.forEach(e=>{E(e,t[e])&&(n=!1)}),n){const r=e.map(e=>{if("string"==typeof t[e]){let r=B?t[e].toUpperCase():t[e];return r=N?r.normalize("NFD").replace(/[\u0300-\u036f]/g,""):r,M?`${r}`:`"${r}"`}if("object"==typeof t[e]&&!Array.isArray(t[e])&&null!==t[e]){let r=it(t[e]).slice(1,-1),n=B&&!Q.includes(e)?r.toUpperCase():r;return n=N?n.normalize("NFD").replace(/[\u0300-\u036f]/g,""):n,M?`${n}`:`"${n}"`}return t[e]}).join(",");a.push(r)}});const l=X?a.join("\n"):"\ufeff"+t+a.join("\n");a.length>0&&o.file(`${n.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}.csv`,l)});var n=window.document.createElement("a");o.generateAsync({type:"base64"}).then(e=>{n.setAttribute("href","data:application/zip;base64,"+e),n.setAttribute("download",`${u?.fileName}.zip`),n.click()})}else{let e=r.filter(e=>!C.includes(e)).map(e=>e===re?"hrTermino":e);""!==re&&(e=["dtInicio","hrInicio",...e]);const t=e.map(e=>k[e]?k[e]:e).join(",")+"\n",o=[];we.forEach(t=>{let n=!0;if(r.forEach(e=>{E(e,t[e])&&(n=!1)}),n){const r=e.map(e=>{if("dtInicio"===e)return"{dtInicio}";if("hrInicio"===e)return"{hrInicio}";if("hrTermino"===e)return"{hrTermino}";if("string"==typeof t[e]){let r=B&&!Q.includes(e)?t[e].toUpperCase():t[e];return r=N?r.normalize("NFD").replace(/[\u0300-\u036f]/g,""):r,M?`${r}`:`"${r}"`}if("object"==typeof t[e]&&!Array.isArray(t[e])&&null!==t[e]){let r=it(t[e]).slice(1,-1),n=B&&!Q.includes(e)?r.toUpperCase():r;return n=N?n.normalize("NFD").replace(/[\u0300-\u036f]/g,""):n,M?`${n}`:`"${n}"`}return t[e]}).join(",");if(""!==re){const e=t[re];e&&e.forEach(e=>{o.push(r.replace("{dtInicio}",e.dtInicio).replace("{hrInicio}",e.hrInicio).replace("{hrTermino}",e.hrTermino))})}else o.push(r)}});const i=t+o.join("\n");(n=window.document.createElement("a")).setAttribute("href","data:text/csv;charset=utf-8,%EF%BB%BF"+encodeURI(i)),n.setAttribute("download",`${u?.fileName}.csv`),n.click()}},[we]);function it(e){let t=[];if("object"==typeof e&&!Array.isArray(e)&&null!==e)for(let[r,n]of Object.entries(e))"object"!=typeof n||Array.isArray(n)||null===n?n&&t.push(r):t.push(r+": "+it(n));return"["+t.join(" - ")+"]"}const at=G(e=>{if(e.preventDefault(),we.length<=0)return;const t=Object.keys(we[0]).filter(e=>!w.includes(e)),r=t.join(",")+"\n"+we.map(e=>t.map(t=>{if("tbRa"===t)return e[t].NO_CIDADE;if("rlEventoData"===t)return`${e[t][0].DT_INICIO} - ${e[t][0].HR_INICIO}`;if("string"==typeof e[t]){let r=B&&!Q.includes(t)?e[t].toUpperCase():e[t];return r=N?r.normalize("NFD").replace(/[\u0300-\u036f]/g,""):r,M?`${r}`:`"${r}"`}if("object"==typeof e[t]&&!Array.isArray(e[t])&&null!==e[t]){let r=it(e[t]).slice(1,-1),n=B&&!Q.includes(t)?r.toUpperCase():r;return n=N?n.normalize("NFD").replace(/[\u0300-\u036f]/g,""):n,M?`${n}`:`"${n}"`}return e[t]}).join(",")).join("\n");var n=window.document.createElement("a");n.setAttribute("href","data:text/csv;charset=utf-8,%EF%BB%BF"+encodeURI(r)),n.setAttribute("download",`${u?.fileName}.csv`),n.click()},[we]);function lt(){ke(So),Se(So),Ie(et(So)),Ae(0),We(1),localStorage.removeItem(Oo),Ge((new Date).getTime().toString())}function ct(e){if(!So)return;let t=JSON.parse(JSON.stringify(So));e.filter(e=>e.value||"entre"===e.operator&&(e.value||e.value2)).forEach(e=>{let r=[];switch(e.type){case"number":switch(e.operator){case"igual":t.forEach(t=>{Number(te(t,e.keyName,""))===Number(e.value)&&r.push(t)});break;case"maior que":t.forEach(t=>{Number(te(t,e.keyName,""))>Number(e.value)&&r.push(t)});break;case"menor que":t.forEach(t=>{Number(te(t,e.keyName,""))<Number(e.value)&&r.push(t)})}break;case"string":switch(console.log("ata: ",e.operator),e.operator){case"igual":t.forEach(t=>{const n=te(t,e.keyName,"");e.useList?Eo(n)===Eo(e.value.id)&&r.push(t):Eo(n)===Eo(e.value)&&r.push(t)});break;case"contem":t.forEach(t=>{const n=te(t,e.keyName,"");n&&(e.useList?Eo(n).includes(Eo(e.value.id))&&r.push(t):Eo(n).includes(Eo(e.value))&&r.push(t))});break;case"tem um dos":t.forEach(t=>{const n=te(t,e.keyName,"");n&&e.value.map(e=>Eo(e.id)).includes(Eo(n))&&r.push(t)})}break;case"date":switch(e.operator){case"data exata":t.forEach(t=>{const n=ae(te(t,e.keyName,""),"DD/MM/YYYY");n.isValid()&&n.isSame(ae(e.value,"DD/MM/YYYY"))&&r.push(t)});break;case"entre":const n=ae(e.value?e.value:"01/01/2000","DD/MM/YYYY"),o=ae(e.value2?e.value2:"31/12/2030","DD/MM/YYYY");t.forEach(t=>{const i=ae(te(t,e.keyName,""),"DD/MM/YYYY");(i.isAfter(n)||i.isSame(n))&&(i.isBefore(o)||i.isSame(o))&&r.push(t)})}break;case"dates":switch(e.operator){case"data inicio":t.forEach(t=>{const n=Ao[e.customFunc](te(t,e.keyName,""))??[];n.length<=0||ae(n[0],"DD/MM/YYYY").isSame(ae(e.value,"DD/MM/YYYY"))&&r.push(t)});break;case"data fim":t.forEach(t=>{const n=Ao[e.customFunc](te(t,e.keyName,""))??[];n.length<=0||ae(n[n.length-1],"DD/MM/YYYY").isSame(ae(e.value,"DD/MM/YYYY"))&&r.push(t)});break;case"tem a data":t.forEach(t=>{(Ao[e.customFunc](te(t,e.keyName,""))??[]).includes(e.value)&&r.push(t)});break;case"entre":const n=ae(e.value?e.value:"01/01/2000","DD/MM/YYYY"),o=ae(e.value2?e.value2:"31/12/2030","DD/MM/YYYY");t.forEach(t=>{const i=Ao[e.customFunc](te(t,e.keyName,""))??[];let a=!1;i.forEach(e=>{if(a)return;const t=ae(e,"DD/MM/YYYY");t.isValid()&&(t.isAfter(n)||t.isSame(n))&&(t.isBefore(o)||t.isSame(o))&&(a=!0)}),a&&r.push(t)})}}t=r}),ke(t),Ie(et(t)),Ae(0),We(1),localStorage.setItem(Oo,JSON.stringify(e)),Se(t)}return J(()=>{const e=De*Ye,t=we.slice(e,e+Ye);let r={};t.forEach((e,t)=>{o.forEach(n=>{r[t]=!0===r[t]||(te(e,n?.keyName,"")??"Não Informado").toString().length>=ne})}),qe(r)},[we,Ye,De]),J(()=>{console.log(Qe.current)},[Qe.current]),ge?t(i,{bgcolor:"#fff2c8",color:"#3e3129",padding:2,marginX:2,borderRadius:4,children:e(ee,{fontSize:24,textAlign:"center",fontFamily:"Inter",children:[403===ge.status&&"Acesso negado",500===ge.status&&e(i,{fontWeight:500,textAlign:"center",children:[t(R,{sx:{transform:"scale(2)",marginY:1,fill:"#3e3129"}}),t(i,{children:ue||e(r,{children:["Não foi possível se conectar ao servidor no momento. Por favor, aguarde alguns instantes e tente de novo.",t("br",{}),t("br",{}),"Caso precise de ajuda, entre em contato pelo email: ",t("strong",{children:"cdes@ssp.df.gov.br"})]})})]})]})}):fe?t(a,{sx:{height:"100%",width:"100%"},justifyContent:"center",alignItems:"center",children:e(i,{width:"100%",children:[e(a,{direction:"row",justifyContent:"center",alignItems:"center",justifyItems:"center",spacing:2,marginY:4,children:[t(P,{sx:{fill:"#5e5e5e"}}),e(ee,{fontWeight:600,fontSize:20,textTransform:"capitalize",textAlign:"center",color:"#5e5e5e",children:["Carregando ",d]})]}),t(g,{color:"inherit"}),Array(10).fill("").map(r=>t(a,{direction:{xs:"column",md:"row"},spacing:{xs:3,md:1},justifyContent:"space-between",paddingY:8,borderBottom:"1px solid #cacaca",children:Array(7).fill(0).map(r=>e(i,{children:[t(O,{width:60}),t(O,{width:120})]}))}))]})}):!Ce&&y?t(g,{}):e(r,{children:[e(i,{marginX:Je?le:ie,bgcolor:"white",p:2,borderRadius:6,...pe,children:[e(a,{spacing:1.5,direction:{xs:"column",md:"row"},children:[e(a,{spacing:1.5,direction:{xs:"column",md:"row"},height:{md:"40px",xs:"inherit"},width:"100%",children:[t(Fe,{InputProps:{startAdornment:t(ze,{sx:{marginRight:1,fill:"#c0c0c0"}}),sx:{".MuiOutlinedInput-notchedOutline":{border:"none"}}},sx:{border:"solid 1px #CBD5E1",backgroundColor:"#F8FAFC",borderRadius:"50px",maxWidth:"600px"},size:"small",onChange:function(e){console.log(Ee);const t=e.target.value;if(""===t)return ke(Ee),void Ie(et(tt(we)));const r=tt(we),n=[];r.forEach(e=>{const r=[];if(Object.keys(e).map(t=>{let n=te(e,t,"")??"";"number"==typeof n&&(n=n.toString()),"string"==typeof n&&r.push(n)}),r.length<=0)return;let o=!1;r.forEach(e=>{if(["P","C","A","R","L","PA"].includes(e))switch(e){case"P":return void("em analise".includes(t.toLowerCase())&&(o=!0));case"C":return void("cancelado".includes(t.toLowerCase())&&(o=!0));case"A":return void("cadastrado".includes(t.toLowerCase())&&(o=!0));case"R":return void("reprovado".includes(t.toLowerCase())&&(o=!0));case"L":return void("licenciado".includes(t.toLowerCase())&&(o=!0));case"PA":return void(("pré aprovado".includes(t.toLowerCase())||"pre aprovado".includes(t.toLowerCase()))&&(o=!0));case"FP":return void("fora do prazo".includes(t.toLowerCase())&&(o=!0))}ko(e.toLowerCase()).includes(ko(t.toLowerCase()))&&(o=!0)}),o&&n.push(e)}),ke(n),Ie(et(n)),Ae(0),We(1)},fullWidth:!0,placeholder:`Pesquisar ${d}`}),ce.length>0&&t(l,{startIcon:t(F,{}),variant:"contained",onClick:e=>vo.open(t(Mo,{reset:lt,filtrar:ct,baseFilters:[...ce],filters:localStorage.getItem(Oo)?JSON.parse(localStorage.getItem(Oo)):[...ce]},Ke)),sx:{borderRadius:3,paddingX:"24px",paddingY:"8px",backgroundColor:"#208FE8",textTransform:"capitalize"},children:t(a,{direction:"row",borderRadius:5,padding:0,children:t("span",{children:"Filtrar"})})}),e(a,{direction:"row",spacing:1,children:[t(wo,{data:de.map(e=>({name:e.label,onClick:()=>function(e){let t=[...we];t.sort((t,r)=>{const n="string"===e.type?te(t,e.key,""):Number(te(t,e.key,0)),o="string"===e.type?te(r,e.key,""):Number(te(r,e.key,0));if(Do){if(n<o)return-1;if(n>o)return 1}else{if(n>o)return-1;if(n<o)return 1}return 0}),Do=!Do,ke(t)}(e)})),btProps:{startIcon:t($,{}),fullWidth:!0},children:"Ordenar"}),t(l,{variant:"contained",fullWidth:!0,startIcon:t(Yo?_:$,{}),sx:{backgroundColor:"#637082",":hover":{backgroundColor:"#3c4757"},textTransform:"capitalize",borderRadius:3,padding:{md:"0px 8px"}},onClick:function(){let e={};for(let t=0;t<z;t++)e[t]=!Yo;Xe(e),Be(e),Yo=!Yo},children:Yo?"Recolher":"Expandir"})]})]}),e(a,{alignItems:"end",width:{xs:"100%",md:"20%"},direction:{xs:"row",md:"column"},spacing:{xs:1,md:0},children:[e(ee,{fontWeight:600,textAlign:"end",children:["Registro de ",d,"s"]}),t(a,{justifyContent:"center",children:e(ee,{children:["Exibindo ",De*Ye+1,"-",De*Ye+1+nt().length-1," de ",we.length]})})]})]}),localStorage.getItem(Oo)&&t(i,{display:"inline-flex",flexWrap:"wrap",padding:.5,borderRadius:4,marginBottom:1,children:JSON.parse(localStorage.getItem(Oo)??"[]").filter(e=>e.value||"entre"===e.operator&&(e.value||e.value2)).map(r=>e(a,{direction:"row",spacing:1,bgcolor:"#4e85c1",color:"white",width:"fit-content",paddingY:.5,borderRadius:2,paddingX:1,m:.5,children:[t(ee,{fontWeight:700,children:r.label}),t(ee,{fontStyle:"italic",children:r.operator}),t(ee,{bgcolor:"white",borderRadius:2,paddingX:1,color:"black",children:Array.isArray(r.value)?r.value.map(e=>e.label).join(" - "):"object"==typeof r.value?r.value.label:"entre"===r.operator?`${r.value?r.value:"Antes"} e ${r.value2?r.value2:"Depois"}`:r.value.toString()}),t(D,{onClick:e=>{let t=JSON.parse(localStorage.getItem(Oo)??"[]");t=t.map(e=>e.label===r.label?{...e,value:"",...e.value2?{value2:""}:{}}:e),ct(t)},size:"small",sx:{padding:0},children:t(Ne,{sx:{fill:"white"}})})]}))}),t(a,{spacing:.2,children:nt().length<=0?t(a,{sx:{backgroundColor:"#E2E8F0",padding:2,marginX:{xs:2,md:0}},justifyContent:"center",alignItems:"center",children:t(ee,{fontSize:21,fontFamily:"Inter",fontWeight:600,textAlign:"center",children:xe?s.user:s.public})}):nt().map((s,c)=>t(b,{sx:{padding:.5,backgroundColor:c%2==0?"#F8FAFC":"white",paddingTop:2,borderTop:"solid 1.5px #E2E8F0",position:"relative"},elevation:0,children:e(Re,{container:!0,spacing:Je?2:0,paddingX:2,rowSpacing:2,children:[o.map(o=>e(Re,{sx:{overflow:"hidden"},size:{xs:12,md:Ze?12/p*(o.size?o.size:1):n?n.all:12/p*(o.size?o.size:1)},children:[t(i,{sx:{width:"max-content",paddingX:1},children:t(ee,{fontSize:16,fontWeight:700,color:"#1E293B",fontFamily:"Inter",children:o.title})}),t(i,{paddingLeft:1,position:"relative",children:t(A,{in:!0===Le[c],collapsedSize:oe,onExited:e=>Xe(e=>({...e,[c]:!1})),children:e(i,{sx:{wordWrap:"break-word",color:"#1E293B",fontSize:16},fontFamily:"Inter",children:[t(i,{children:o.customComponent?o.customComponent(te(s,o.keyName),s):t(i,{color:"transparent",sx:{pointerEvents:"none",userSelect:"none"},children:te(s,o.keyName,"")})}),t(i,{position:"absolute",top:0,children:o.customComponent?o.customComponent(te(s,o.keyName),s):t(r,{children:Ue[c]?te(s,o?.keyName,""):(te(s,o?.keyName,"")??"").toString().length>=ne?t(r,{children:(te(s,o?.keyName,"")??"").toString().substring(0,ne)+"..."}):te(s,o?.keyName,"")})})]})})})]},String(o?.keyName)+c)),t(Re,{size:{xs:12,md:Ze?12/p:n?n.action:12/p},children:t(a,{direction:"row",alignItems:"center",justifyContent:Je?"start":"flex-end",sx:{height:"100%",paddingBottom:Je?2:0},children:m(s)})}),_e[c]&&t(a,{direction:"row",justifyContent:"flex-end",bottom:0,width:"100%",children:t(l,{onClick:e=>{Be(e=>({...e,[c]:!e[c]})),Xe(e=>({...e,[c]:!0}))},sx:{padding:0,color:"#637082",textTransform:"capitalize"},startIcon:t(Le[c]?W:L,{}),children:Le[c]?"Ver Menos":"Ver Mais"})})]})},c))}),nt().length>0&&t(a,{padding:1,direction:{xs:"column",md:"row"},spacing:{xs:2,md:0},justifyContent:"space-between",alignItems:"center",children:u&&e(a,{direction:{xs:"column",md:"row"},justifyContent:"flex-end",spacing:1,children:[j&&t(l,{startIcon:t(Te,{}),variant:"contained",size:"small",onClick:ot,sx:{backgroundColor:"#5a88b0",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:Y}),T&&t(l,{startIcon:t(Te,{}),variant:"contained",size:"small",onClick:at,sx:{backgroundColor:"#64748B",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:I}),t(l,{startIcon:t(Te,{}),variant:"contained",size:"small",onClick:e=>ot(e,!0),sx:{backgroundColor:"#22C55E",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:S})]})})]}),t(a,{direction:"row",justifyContent:"center",paddingY:1,paddingTop:2,children:e(a,{direction:"row",justifyContent:"center",alignItems:"center",spacing:2,children:[t(l,{onClick:e=>We(e=>e>1?e-1:1),sx:{bgcolor:"white",borderRadius:"50px",height:"40px",width:"40px",minWidth:0,border:"solid 1px #E2E8F0"},children:t(je,{sx:{transform:"scale(1.5) scaleX(-1)"}})}),t(Pe,{renderItem:e=>"page"===e.type?t(l,{onClick:e.onClick,sx:{fontWeight:600,...e.selected?{bgcolor:"#33B55D",color:"white"}:{color:"#1E293B"},borderRadius:"100%",padding:0,margin:0,minWidth:0,width:"40px",height:"40px",marginX:.25},children:e.page}):["next","previous","page"].includes(e.type)?void 0:t(V,{...e}),count:Ve,siblingCount:Je?0:6,size:"large",onChange:rt,page:Me,shape:"circular",variant:"outlined",sx:{".MuiPagination-ul":{backgroundColor:"white",border:"solid 1px #E2E8F0",borderRadius:"50px",paddingX:.25,paddingY:.5}}}),t(l,{onClick:e=>We(e=>e<Ve?e+1:Ve),sx:{bgcolor:"white",borderRadius:"50px",height:"40px",width:"40px",minWidth:0,border:"solid 1px #E2E8F0"},children:t(je,{sx:{transform:"scale(1.5)"}})})]})})]})}function Mo({filters:r,baseFilters:n,filtrar:o,reset:s}){const[c,d]=H(r),[u,p]=H(!1),[m,h]=U.useState(null),f=Boolean(m);return e(i,{width:{xs:"inherit",md:850},children:[t(S,{open:f,onClose:()=>{h(null)},anchorEl:m,children:n.map(e=>t(Y,{onClick:t=>{var r;r=e,d(e=>[...e,r]),h(null)},children:e.label}))}),e(a,{direction:"row",justifyContent:"space-between",children:[t(ee,{fontWeight:700,fontSize:18,children:"Filtrar"}),t(l,{startIcon:t(B,{}),sx:{textTransform:"capitalize"},onClick:e=>{s(),vo.close()},children:"Limpar"})]}),t(i,{marginBottom:1,children:t(I,{severity:"warning",children:"Preencha apenas os campos que deseja filtrar."})}),t(a,{children:u?c.map((e,r)=>t(No,{filterValue:e,setReset:p,idx:r,setDt:e=>{d(t=>{let n=[...t];return n[r]=e,n})},removeDt:()=>{d(e=>{let t=[...e];return t.splice(r,1),t})}})):t(i,{children:c.map((e,r)=>t(No,{filterValue:e,setReset:p,idx:r,setDt:e=>{d(t=>{let n=[...t];return n[r]=e,n})},removeDt:()=>{d(e=>{let t=[...e];return t.splice(r,1),t})}}))})}),t(a,{direction:"row",justifyContent:"flex-end",marginTop:1,children:t(l,{variant:"contained",color:"success",startIcon:t(ze,{}),sx:{textTransform:"capitalize"},onClick:e=>{o(c),vo.close()},children:"Filtrar"})})]})}function No({filterValue:r,setDt:n,idx:o}){const[i,l]=H(r.operator),[s,c]=H(r),d=h(),u=f(d.breakpoints.only("xs"));return J(()=>{n(s)},[s]),e(a,{direction:"row",alignItems:"end",spacing:1,width:"100%",bgcolor:o%2==0?"#ededed":"inherit",padding:.5,borderRadius:2,children:[!u&&t(ee,{width:"100%",alignContent:"center",fontWeight:600,color:"#323232",children:r.label}),e(M,{sx:{width:"100%"},children:[u&&t(ee,{children:r.label}),t(N,{onChange:e=>{const t=e.target.value;c(e=>({...e,operator:t,value:""})),l(t)},defaultValue:i,size:"small",sx:{bgcolor:"white"},fullWidth:!0,children:r.operators.map(e=>t(Y,{value:e,children:e}))})]}),t(To,{filterValue:r,operator:s.operator,onChange:(e,t="value")=>{c(r=>({...r,[t]:e}))}})]})}function To({filterValue:n,operator:o,onChange:a}){switch(n.type){case"number":return t(Fe,{type:"number",size:"small",placeholder:"Valor",defaultValue:n.value,onChange:e=>{a(e.target.value)},sx:{bgcolor:"white"},fullWidth:!0});case"string":if(n.useList)switch(o){case"tem um dos":return t(C,{multiple:!0,id:"tags-standard",onChange:(e,t)=>{a(t.length<=0?"":t)},options:n.useList,defaultValue:Array.isArray(n.value)?n.value:[],renderInput:e=>t(Fe,{...e,variant:"standard",placeholder:"Escolha os valores",fullWidth:!0}),fullWidth:!0});case"contem":case"igual":return t(i,{width:"100%",children:t(C,{options:n.useList,onChange:(e,t)=>{a(t)},defaultValue:"object"==typeof n.value?n.value:void 0,isOptionEqualToValue:(e,t)=>e.label===t.label,renderInput:e=>t(Fe,{...e,size:"small",placeholder:"Escolha um valor",fullWidth:!0,sx:{bgcolor:"white"}}),fullWidth:!0})})}return t(Fe,{size:"small",placeholder:"Valor",defaultValue:n.value,onChange:e=>{a(e.target.value)},sx:{bgcolor:"white"},fullWidth:!0});case"date":case"dates":switch(o){case"data exata":case"data fim":case"data inicio":case"tem a data":return t(re,{adapterLocale:"pt-br",dateAdapter:ie,children:t(ne,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"")},defaultValue:n.value?ae(n.value,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>t(Fe,{...e,size:"small",fullWidth:!0})})});case"entre":return e(re,{adapterLocale:"pt-br",dateAdapter:ie,children:[t(ne,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"")},defaultValue:n.value?ae(n.value,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>t(Fe,{...e,size:"small",fullWidth:!0})}),t(ne,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"","value2")},defaultValue:n.value2?ae(n.value2,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>t(Fe,{...e,size:"small",fullWidth:!0})})]})}}return t(r,{})}var jo=/*#__PURE__*/U.memo(Io);function zo({customErrorMsg:n,error:a}){return t(i,{bgcolor:"#fff2c8",color:"#3e3129",padding:2,marginX:2,borderRadius:4,children:e(o,{fontSize:24,textAlign:"center",fontFamily:"Inter",children:[403===a.status&&"Acesso negado",500===a.status&&e(i,{fontWeight:500,textAlign:"center",children:[t(R,{sx:{transform:"scale(2)",marginY:1,fill:"#3e3129"}}),t(i,{children:n||e(r,{children:["Não foi possível se conectar ao servidor no momento. Por favor, aguarde alguns instantes e tente de novo.",t("br",{}),t("br",{}),"Caso precise de ajuda, entre em contato pelo email: ",t("strong",{children:"cdes@ssp.df.gov.br"})]})})]})]})})}function Ro({tableName:r}){return t(a,{sx:{height:"100%",width:"100%"},justifyContent:"center",alignItems:"center",children:e(i,{width:"100%",children:[e(a,{direction:"row",justifyContent:"center",alignItems:"center",justifyItems:"center",spacing:2,marginY:4,children:[t(P,{sx:{fill:"#5e5e5e"}}),e(ee,{fontWeight:600,fontSize:20,textTransform:"capitalize",textAlign:"center",color:"#5e5e5e",children:["Carregando ",r]})]}),t(g,{color:"inherit"}),Array(10).fill("").map(r=>t(a,{direction:{xs:"column",md:"row"},spacing:{xs:3,md:1},justifyContent:"space-between",paddingY:8,borderBottom:"1px solid #cacaca",children:Array(7).fill(0).map(r=>e(i,{children:[t(O,{width:60}),t(O,{width:120})]}))}))]})})}const Po=(e,t)=>{if(e.length<=0)return 1;let r=e.length/t;return r=r<1?1:r,Math.ceil(r)};function Fo(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/g,"")}function $o(e){return("string"!=typeof e?e.toString():e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim()}function Wo({filterData:e,startData:t,filtersFuncData:r={},localTableName:n="",setCurrentPage:o,setList:i,setListClone:a,setListPage:l,setPagCount:s,itemsCount:c}){if(!t)return;let d=JSON.parse(JSON.stringify(t));e.filter(e=>e.value||"entre"===e.operator&&(e.value||e.value2)).forEach(e=>{let t=[];switch(e.type){case"number":switch(e.operator){case"igual":d.forEach(r=>{Number(te(r,e.keyName,""))===Number(e.value)&&t.push(r)});break;case"maior que":d.forEach(r=>{Number(te(r,e.keyName,""))>Number(e.value)&&t.push(r)});break;case"menor que":d.forEach(r=>{Number(te(r,e.keyName,""))<Number(e.value)&&t.push(r)})}break;case"string":switch(e.operator){case"igual":d.forEach(r=>{const n=te(r,e.keyName,"");e.useList?$o(n)===$o(e.value.id)&&t.push(r):$o(n)===$o(e.value)&&t.push(r)});break;case"contem":d.forEach(r=>{const n=te(r,e.keyName,"");n&&(e.useList?$o(n).includes($o(e.value.id))&&t.push(r):$o(n).includes($o(e.value))&&t.push(r))});break;case"tem um dos":d.forEach(r=>{const n=te(r,e.keyName,"");n&&e.value.map(e=>$o(e.id)).includes($o(n))&&t.push(r)})}break;case"date":switch(e.operator){case"data exata":d.forEach(r=>{const n=ae(te(r,e.keyName,""),"DD/MM/YYYY");n.isValid()&&n.isSame(ae(e.value,"DD/MM/YYYY"))&&t.push(r)});break;case"entre":const r=ae(e.value?e.value:"01/01/2000","DD/MM/YYYY"),n=ae(e.value2?e.value2:"31/12/2030","DD/MM/YYYY");d.forEach(o=>{const i=ae(te(o,e.keyName,""),"DD/MM/YYYY");(i.isAfter(r)||i.isSame(r))&&(i.isBefore(n)||i.isSame(n))&&t.push(o)})}break;case"dates":switch(e.operator){case"data inicio":d.forEach(n=>{const o=(r[e.customFunc](te(n,e.keyName,""))??[]).filter(e=>void 0!==e&&""!==e);o.length<=0||ae(o[0],"DD/MM/YYYY").isSame(ae(e.value,"DD/MM/YYYY"))&&t.push(n)});break;case"data fim":d.forEach(n=>{const o=(r[e.customFunc](te(n,e.keyName,""))??[]).filter(e=>void 0!==e&&""!==e);o.length<=0||(console.log(o),ae(o[o.length-1],"DD/MM/YYYY").isSame(ae(e.value,"DD/MM/YYYY"))&&t.push(n))});break;case"tem a data":d.forEach(n=>{(r[e.customFunc](te(n,e.keyName,""))??[]).filter(e=>void 0!==e&&""!==e).includes(e.value)&&t.push(n)});break;case"entre":const n=ae(e.value?e.value:"01/01/2000","DD/MM/YYYY"),o=ae(e.value2?e.value2:"31/12/2030","DD/MM/YYYY");d.forEach(i=>{const a=(r[e.customFunc](te(i,e.keyName,""))??[]).filter(e=>void 0!==e&&""!==e);let l=!1;a.forEach(e=>{if(l)return;const t=ae(e,"DD/MM/YYYY");t.isValid()&&(t.isAfter(n)||t.isSame(n))&&(t.isBefore(o)||t.isSame(o))&&(l=!0)}),l&&t.push(i)})}}d=t}),i(d),s(Po(d,c)),o(0),l(1),localStorage.setItem(n,JSON.stringify(e)),a(d)}function Lo({order:e,list:t,orderAsc:r=!1}){return Be(t).sort((t,n)=>{const o="string"===e.type?te(t,e.key,""):Number(te(t,e.key,0)),i="string"===e.type?te(n,e.key,""):Number(te(n,e.key,0));if(r){if(o<i)return-1;if(o>i)return 1}else{if(o>i)return-1;if(o<i)return 1}return 0})}function Bo({filters:r,baseFilters:n,filtrar:o,reset:s}){const[c,d]=H(r),[u,p]=H(!1),[m,h]=U.useState(null),f=Boolean(m);return e(i,{width:{xs:"inherit",md:850},children:[t(S,{open:f,onClose:()=>{h(null)},anchorEl:m,children:n.map(e=>t(Y,{onClick:t=>{var r;r=e,d(e=>[...e,r]),h(null)},children:e.label}))}),e(a,{direction:"row",justifyContent:"space-between",children:[t(ee,{fontWeight:700,fontSize:18,children:"Filtrar"}),t(l,{startIcon:t(B,{}),sx:{textTransform:"capitalize"},onClick:e=>{s(),vo.close()},children:"Limpar"})]}),t(i,{marginBottom:1,children:t(I,{severity:"warning",children:"Preencha apenas os campos que deseja filtrar."})}),t(a,{children:u?c.map((e,r)=>t(_o,{filterValue:e,setReset:p,idx:r,setDt:e=>{d(t=>{let n=[...t];return n[r]=e,n})},removeDt:()=>{d(e=>{let t=[...e];return t.splice(r,1),t})}})):t(i,{children:c.map((e,r)=>t(_o,{filterValue:e,setReset:p,idx:r,setDt:e=>{d(t=>{let n=[...t];return n[r]=e,n})},removeDt:()=>{d(e=>{let t=[...e];return t.splice(r,1),t})}}))})}),t(a,{direction:"row",justifyContent:"flex-end",marginTop:1,children:t(l,{variant:"contained",color:"success",startIcon:t(ze,{}),sx:{textTransform:"capitalize"},onClick:e=>{o(c),vo.close()},children:"Filtrar"})})]})}function _o({filterValue:r,setDt:n,idx:o}){const[i,l]=H(r.operator),[s,c]=H(r),d=h(),u=f(d.breakpoints.only("xs"));return J(()=>{n(s)},[s]),e(a,{direction:"row",alignItems:"end",spacing:1,width:"100%",bgcolor:o%2==0?"#ededed":"inherit",padding:.5,borderRadius:2,children:[!u&&t(ee,{width:"100%",alignContent:"center",fontWeight:600,color:"#323232",children:r.label}),e(M,{sx:{width:"100%"},children:[u&&t(ee,{children:r.label}),t(N,{onChange:e=>{const t=e.target.value;c(e=>({...e,operator:t,value:""})),l(t)},defaultValue:i,size:"small",sx:{bgcolor:"white"},fullWidth:!0,children:r.operators.map(e=>t(Y,{value:e,children:e}))})]}),t(qo,{filterValue:r,operator:s.operator,onChange:(e,t="value")=>{c(r=>({...r,[t]:e}))}})]})}function qo({filterValue:n,operator:o,onChange:a}){switch(n.type){case"number":return t(Fe,{type:"number",size:"small",placeholder:"Valor",defaultValue:n.value,onChange:e=>{a(e.target.value)},sx:{bgcolor:"white"},fullWidth:!0});case"string":if(n.useList)switch(o){case"tem um dos":return t(C,{multiple:!0,id:"tags-standard",onChange:(e,t)=>{a(t.length<=0?"":t)},options:n.useList,defaultValue:Array.isArray(n.value)?n.value:[],renderInput:e=>t(Fe,{...e,variant:"standard",placeholder:"Escolha os valores",fullWidth:!0}),fullWidth:!0});case"contem":case"igual":return t(i,{width:"100%",children:t(C,{options:n.useList,onChange:(e,t)=>{a(t)},defaultValue:"object"==typeof n.value?n.value:void 0,isOptionEqualToValue:(e,t)=>e.label===t.label,renderInput:e=>t(Fe,{...e,size:"small",placeholder:"Escolha um valor",fullWidth:!0,sx:{bgcolor:"white"}}),fullWidth:!0})})}return t(Fe,{size:"small",placeholder:"Valor",defaultValue:n.value,onChange:e=>{a(e.target.value)},sx:{bgcolor:"white"},fullWidth:!0});case"date":case"dates":switch(o){case"data exata":case"data fim":case"data inicio":case"tem a data":return t(re,{adapterLocale:"pt-br",dateAdapter:ie,children:t(ne,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"")},defaultValue:n.value?ae(n.value,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>t(Fe,{...e,size:"small",fullWidth:!0})})});case"entre":return e(re,{adapterLocale:"pt-br",dateAdapter:ie,children:[t(ne,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"")},defaultValue:n.value?ae(n.value,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>t(Fe,{...e,size:"small",fullWidth:!0})}),t(ne,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"","value2")},defaultValue:n.value2?ae(n.value2,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>t(Fe,{...e,size:"small",fullWidth:!0})})]})}}return t(r,{})}let Uo=!1,Xo="",Ko={},Go="";function Ho({mediaQueryLG:n,columns:o,csvConfig:s,fetchFunc:c,emptyMsg:d={user:"Nenhum dado encontrado",public:"Nenhum dado encontrado"},dataPath:u="",tableName:p="Dado",columnSize:m,action:y,useKC:v=!0,itemCount:x=10,expandTextMaxLength:C=50,collapsedSize:w=53,customMargin:k=4,customMarginMobile:E=0,filtersFunc:S,filters:Y=[],orderBy:O=[],customErrorMsg:I,customTableStyle:M={},id:N,initialData:T=null,isExpandable:j=!0}){const[z,R]=H(!1),[P,B]=H(null),[q,U]=H(T),{user:X,userLoaded:Q}=K(st),[re,ne]=H([]),[oe,ie]=H([]),[ae,le]=H(x),[se,ce]=H(0),[de,ue]=H(1),[pe,me]=H(1),[he,fe]=H({}),[ge,ye]=H({}),[be,ve]=H({}),[xe,Ce]=H("filterKey"),we=h(),ke=f(we.breakpoints.only("xs")),Ee=Z(q),Se=Z("true"===localStorage.getItem(`order-${N}`)||!1),Ye=f(we.breakpoints.up(2e3));Xo=`tableFilter_${N}`,Go=`tableFilterCache_${N}`,Ko=S??{},localStorage.getItem(Go)||localStorage.setItem(Go,JSON.stringify(Y)),localStorage.getItem(Go)!==JSON.stringify(Y)&&(localStorage.setItem(Go,JSON.stringify(Y)),localStorage.removeItem(Xo)),J(()=>{B(null),c&&(!Q&&v||(R(!0),c().then(e=>e.ok?e.json().then(e=>{if(204===e.statusCode)U({body:{data:[]}}),Ee.current=[];else if(403===e.statusCode)B({status:e.statusCode});else{let t=u?te(e,u):e;if(t&&Array.isArray(t)){let e=t;if(localStorage.getItem(`order-data-${N}`))try{e=Lo({order:JSON.parse(localStorage.getItem(`order-data-${N}`)),list:t,orderAsc:Se.current})}catch(e){console.log(e)}else O.length>0&&(e=Lo({order:O[0],list:t,orderAsc:Se.current}));U(e),Ee.current=JSON.parse(JSON.stringify(e))}else U({body:{data:[]}}),Ee.current=[]}R(!1)}):(B({status:500}),void R(!1))).catch(e=>{B({status:500})})))},[Q,c]);const Oe=G(e=>Array.isArray(e)?e:"object"==typeof e?te(e,u):void 0,[]);J(()=>{if(z||P||!Oe(q))return;let e=Oe(q);ne(e),ie(e),ue(Po(e,ae)),localStorage.getItem(Xo)&&Wo({filterData:JSON.parse(localStorage.getItem(Xo)),filtersFuncData:Ko,localTableName:Xo,setCurrentPage:ce,setList:ne,setListClone:ie,setListPage:me,setPagCount:ue,startData:Ee.current,itemsCount:ae})},[ae,z,q,P]),J(()=>{ce(pe-1)},[pe]);const De=G((e,t)=>{me(t)},[]),Ae=G(()=>{const e=se*ae;return re.slice(e,e+ae)},[re,ae,se]);function Ve(){ne(Ee.current),ie(Ee.current),ue(Po(Ee.current,ae)),ce(0),me(1),localStorage.removeItem(Xo),Ce((new Date).getTime().toString())}J(()=>{const e=se*ae,t=re.slice(e,e+ae);let r={};t.forEach((e,t)=>{o.forEach(n=>{r[t]=!0===r[t]||(te(e,n.keyName,"")??"Não Informado").toString().length>=C})}),ye(r)},[re,ae,se]);const Ie=(e,t=!1)=>{s&&function(e,t,r){try{if(e.length<=0)return Promise.resolve();let n=[];t.downloadAll&&t.customAll?n=t.customAll(e,r):!t.downloadAll&&t.customFiltered?n=t.customFiltered(e,r):e.forEach(e=>{const o={};t.map.forEach(n=>{if(n.useFilterValue&&!t.downloadAll&&!n.onlyAll){const t=r.filter(e=>e.label==n.useFilterValue.label&&n.useFilterValue.operators.includes(e.operator)),i=t.length>0&&t.reduce(e=>e.value).value||void 0;return void(o[n.name]=i||te(e,n.key))}n.onlyFilter||(o[n.name]=te(e,n.key))}),n.push(o)});const o=_e.utils.json_to_sheet(n),i=_e.utils.book_new();return _e.utils.book_append_sheet(i,o,t.fileName),_e.writeFile(i,`${t.fileName}.xlsx`),Promise.resolve()}catch(e){return Promise.reject(e)}}(e,{...s,...t?{downloadAll:!0}:{}},JSON.parse(localStorage.getItem(Xo)??"[]")||[])},Me=e=>{Wo({filterData:e,filtersFuncData:Ko,localTableName:Xo,setCurrentPage:ce,setList:ne,setListClone:ie,setListPage:me,setPagCount:ue,startData:Ee.current,itemsCount:ae})};return P?t(zo,{customErrorMsg:I,error:P}):z?t(Ro,{tableName:p}):!Q&&v?t(g,{}):e(r,{children:[e(i,{marginX:ke?E:k,bgcolor:"white",p:2,borderRadius:6,...M,children:[e(a,{spacing:1.5,direction:{xs:"column",md:"row"},children:[e(a,{spacing:1.5,direction:{xs:"column",md:"row"},height:{md:"40px",xs:"inherit"},width:"100%",children:[t(Fe,{InputProps:{startAdornment:t(ze,{sx:{marginRight:1,fill:"#c0c0c0"}}),sx:{".MuiOutlinedInput-notchedOutline":{border:"none"}}},sx:{border:"solid 1px #CBD5E1",backgroundColor:"#F8FAFC",borderRadius:"50px",maxWidth:"600px"},size:"small",onChange:function(e){const t=e.target.value;if(""===t)return ne(oe),void ue(Po(Oe(re),ae));const r=Oe(re),n=[];r.forEach(e=>{const r=[];if(Object.keys(e).map(t=>{let n=te(e,t,"")??"";"number"==typeof n&&(n=n.toString()),"string"==typeof n&&r.push(n)}),r.length<=0)return;let o=!1;r.forEach(e=>{if(["P","C","A","R","L","PA"].includes(e))switch(e){case"P":return void("em analise".includes(t.toLowerCase())&&(o=!0));case"C":return void("cancelado".includes(t.toLowerCase())&&(o=!0));case"A":return void("cadastrado".includes(t.toLowerCase())&&(o=!0));case"R":return void("reprovado".includes(t.toLowerCase())&&(o=!0));case"L":return void("licenciado".includes(t.toLowerCase())&&(o=!0));case"PA":return void(("pré aprovado".includes(t.toLowerCase())||"pre aprovado".includes(t.toLowerCase()))&&(o=!0));case"FP":return void("fora do prazo".includes(t.toLowerCase())&&(o=!0))}Fo(e.toLowerCase()).includes(Fo(t.toLowerCase()))&&(o=!0)}),o&&n.push(e)}),ne(n),ue(Po(n,ae)),ce(0),me(1)},fullWidth:!0,placeholder:`Pesquisar ${p}`}),t(l,{startIcon:t(F,{}),variant:"contained",onClick:e=>vo.open(t(Bo,{reset:Ve,filtrar:e=>Me(e),baseFilters:[...Y],filters:localStorage.getItem(Xo)?JSON.parse(localStorage.getItem(Xo)):[...Y]},xe)),sx:{borderRadius:3,paddingX:"24px",paddingY:"8px",backgroundColor:"#208FE8",textTransform:"capitalize"},children:t(a,{direction:"row",borderRadius:5,padding:0,children:t("span",{children:"Filtrar"})})}),e(a,{direction:"row",spacing:1,children:[O.length>0&&t(wo,{data:O.map(e=>({name:e.label,onClick:()=>(e=>{Se.current=!Se.current;const t=Lo({order:e,list:re,orderAsc:Se.current});localStorage.setItem(`order-${N}`,Se.current.toString()),localStorage.setItem(`order-data-${N}`,JSON.stringify(e)),ne(t)})(e)})),btProps:{startIcon:t($,{}),fullWidth:!0},children:"Ordenar"}),j&&t(l,{variant:"contained",fullWidth:!0,startIcon:t(Uo?_:$,{}),sx:{backgroundColor:"#637082",":hover":{backgroundColor:"#3c4757"},textTransform:"capitalize",borderRadius:3,padding:{md:"0px 8px"}},onClick:function(){let e={};for(let t=0;t<x;t++)e[t]=!Uo;ve(e),fe(e),Uo=!Uo},children:Uo?"Recolher":"Expandir"})]})]}),e(a,{alignItems:"end",width:{xs:"100%",md:"20%"},direction:{xs:"row",md:"column"},spacing:{xs:1,md:0},children:[e(ee,{fontWeight:600,textAlign:"end",children:["Registro de ",p,"s"]}),t(a,{justifyContent:"center",children:e(ee,{children:["Exibindo ",se*ae+1,"-",se*ae+1+Ae().length-1," de ",re.length]})})]})]}),localStorage.getItem(Xo)&&t(i,{display:"inline-flex",flexWrap:"wrap",padding:.5,borderRadius:4,marginBottom:1,children:JSON.parse(localStorage.getItem(Xo)??"[]").filter(e=>e.value||"entre"===e.operator&&(e.value||e.value2)).map(r=>e(a,{direction:"row",spacing:1,bgcolor:"#4e85c1",color:"white",width:"fit-content",paddingY:.5,borderRadius:2,paddingX:1,m:.5,children:[t(ee,{fontWeight:700,children:r.label}),t(ee,{fontStyle:"italic",children:r.operator}),t(ee,{bgcolor:"white",borderRadius:2,paddingX:1,color:"black",children:Array.isArray(r.value)?r.value.map(e=>e.label).join(" - "):"object"==typeof r.value?r.value.label:"entre"===r.operator?`${r.value?r.value:"Antes"} e ${r.value2?r.value2:"Depois"}`:r.value.toString()}),t(D,{onClick:e=>{let t=JSON.parse(localStorage.getItem(Xo)??"[]");t=t.map(e=>e.label===r.label?{...e,value:"",...e.value2?{value2:""}:{}}:e),Me(t)},size:"small",sx:{padding:0},children:t(Ne,{sx:{fill:"white"}})})]}))}),t(a,{spacing:.2,children:Ae().length<=0?t(a,{sx:{backgroundColor:"#E2E8F0",padding:2,marginX:{xs:2,md:0}},justifyContent:"center",alignItems:"center",children:t(ee,{fontSize:21,fontFamily:"Inter",fontWeight:600,textAlign:"center",children:X?d.user:d.public})}):Ae().map((s,c)=>t(b,{sx:{padding:.5,backgroundColor:c%2==0?"#F8FAFC":"white",paddingTop:2,borderTop:"solid 1.5px #E2E8F0",position:"relative"},elevation:0,children:e(Re,{container:!0,spacing:ke?2:0,paddingX:2,rowSpacing:2,children:[o.map(o=>e(Re,{sx:{overflow:"hidden"},size:{xs:12,md:Ye?12/m*(o.size?o.size:1):n?n.all:12/m*(o.size?o.size:1)},children:[t(i,{sx:{width:"max-content",paddingX:1},children:t(ee,{fontSize:16,fontWeight:700,color:"#1E293B",fontFamily:"Inter",children:o.title})}),t(i,{paddingLeft:1,position:"relative",children:t(A,{in:!0===he[c],collapsedSize:w,onExited:e=>ve(e=>({...e,[c]:!1})),children:e(i,{sx:{wordWrap:"break-word",color:"#1E293B",fontSize:16},fontFamily:"Inter",children:[t(i,{children:o.customComponent?o.customComponent(te(s,o.keyName),s):t(i,{color:"transparent",sx:{pointerEvents:"none",userSelect:"none"},children:te(s,o.keyName,"")})}),t(i,{position:"absolute",top:0,children:o.customComponent?o.customComponent(te(s,o.keyName),s):t(r,{children:be[c]?te(s,o.keyName,""):(te(s,o.keyName,"")??"").toString().length>=C?t(r,{children:(te(s,o.keyName,"")??"").toString().substring(0,C)+"..."}):te(s,o.keyName,"")})})]})})})]},o.keyName+c)),t(Re,{size:{xs:12,md:Ye?12/m:n?n.action:12/m},children:t(a,{direction:"row",alignItems:"center",justifyContent:ke?"start":"flex-end",sx:{height:"100%",paddingBottom:ke?2:0},children:y(s)})}),ge[c]&&t(a,{direction:"row",justifyContent:"flex-end",bottom:0,width:"100%",children:t(l,{onClick:e=>{fe(e=>({...e,[c]:!e[c]})),ve(e=>({...e,[c]:!0}))},sx:{padding:0,color:"#637082",textTransform:"capitalize"},startIcon:t(he[c]?W:L,{}),children:he[c]?"Ver Menos":"Ver Mais"})})]})},c))}),Ae().length>0&&t(a,{padding:1,direction:{xs:"column",md:"row"},spacing:{xs:2,md:0},justifyContent:"space-between",alignItems:"center",children:s&&e(a,{direction:{xs:"column",md:"row"},justifyContent:"flex-end",spacing:1,children:[JSON.parse(localStorage.getItem(Xo)??"[]").filter(e=>e.value||"entre"===e.operator&&(e.value||e.value2)).length>0&&t(l,{startIcon:t(Te,{}),variant:"contained",size:"small",onClick:e=>Ie(re),sx:{backgroundColor:"#a5a5a5",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:"Baixar Filtrados"}),t(l,{startIcon:t(Te,{}),variant:"contained",size:"small",onClick:e=>Ie(Ee.current,!0),sx:{backgroundColor:"#22C55E",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:"Baixar Tabela"})]})})]}),t(a,{direction:"row",justifyContent:"center",paddingY:1,paddingTop:2,children:e(a,{direction:"row",justifyContent:"center",alignItems:"center",spacing:2,children:[t(l,{onClick:e=>me(e=>e>1?e-1:1),sx:{bgcolor:"white",borderRadius:"50px",height:"40px",width:"40px",minWidth:0,border:"solid 1px #E2E8F0"},children:t(je,{sx:{transform:"scale(1.5) scaleX(-1)"}})}),t(Pe,{renderItem:e=>"page"===e.type?t(l,{onClick:e.onClick,sx:{fontWeight:600,...e.selected?{bgcolor:"#33B55D",color:"white"}:{color:"#1E293B"},borderRadius:"100%",padding:0,margin:0,minWidth:0,width:"40px",height:"40px",marginX:.25},children:e.page}):["next","previous","page"].includes(e.type)?void 0:t(V,{...e}),count:de,siblingCount:ke?0:6,size:"large",onChange:De,page:pe,shape:"circular",variant:"outlined",sx:{".MuiPagination-ul":{backgroundColor:"white",border:"solid 1px #E2E8F0",borderRadius:"50px",paddingX:.25,paddingY:.5}}}),t(l,{onClick:e=>me(e=>e<de?e+1:de),sx:{bgcolor:"white",borderRadius:"50px",height:"40px",width:"40px",minWidth:0,border:"solid 1px #E2E8F0"},children:t(je,{sx:{transform:"scale(1.5)"}})})]})})]})}var Jo=/*#__PURE__*/U.memo(Ho);const Qo=qe(()=>import("./Map-31d95a26.js").then(e=>e.Map),{ssr:!1});function Zo({links:n,title:s,img:c,pos:d="fixed",next:u=!0,el:p,menuItems:m,paddingBottom:h=0,logoutMsg:f="Sair",logoutFunc:g,...y}){let b;u&&(b=Ze());const{user:v,login:x,logout:C,type:w}=K(st),[k,E]=H(null),[O,A]=H(null),V=Boolean(k),I=Boolean(O),[M,N]=H(!1),z=G(e=>{E(e.currentTarget)},[]),R=G(()=>{E(null)},[]),P=G((e,t)=>{N(!0),E(null),b?b.push({pathname:t}).finally(()=>N(!1)):N(!1)},[b]);return e(r,{children:[e(i,{position:d,sx:{width:"100%",zIndex:100},children:[t(T,{position:"relative",elevation:0,sx:{backgroundColor:"#F1F5F9",color:"black",paddingY:1,paddingX:{xs:1,md:4}},children:e(a,{direction:"row",justifyContent:"space-between",children:[e(a,{direction:"row",alignItems:"center",spacing:2,marginRight:2,sx:{display:{xs:"none",md:"flex"},width:"100%"},children:[t(Qe,{href:"/",children:u?t(Je,{src:c,alt:s,width:40,height:40}):t("img",{src:c,height:35})}),t(i,{children:t(o,{variant:"subtitle1",fontWeight:600,children:s})})]}),t(i,{sx:{display:{xs:"flex",md:"none"}},children:n.length>0&&e(r,{children:[t(D,{onClick:z,children:t(Ke,{})}),t(S,{open:V,onClose:R,anchorEl:k,children:n.map(e=>t(Y,{onClick:t=>P(t,e.path),children:t(o,{textTransform:"capitalize",children:e.name})},`navmenu${e}`))})]})}),e(a,{direction:"row",justifyContent:"flex-end",alignItems:"center",sx:{width:{md:"100%"}},children:[t(a,{direction:"row",spacing:2,sx:{display:{xs:"none",md:"flex"}},children:n.map(e=>t(i,{sx:{a:{color:"#2c7da0",textDecoration:"none",textTransform:"capitalize","&:hover":{color:"#90e0ef"}}},children:t(l,{onClick:t=>{return r=e.path,N(!0),void(b?b.push({pathname:r}).finally(()=>N(!1)):N(!1));var r},sx:{textTransform:"capitalize"},children:e.name})},`navigation${e.path}`))}),e(a,{direction:"row",spacing:2,children:[t(i,{children:p}),v?e(a,{direction:"row",spacing:1,sx:{"&:hover":{backgroundColor:"#a9def9",cursor:"pointer"},padding:.5,borderRadius:60},children:[e(i,{sx:{display:"flex",alignItems:"center"},children:[t(j,{sx:{width:30,height:30},src:v.image}),e(S,{open:I,onClose:e=>A(null),anchorEl:O,disableScrollLock:!0,transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"},sx:{".MuiMenu-paper":{borderRadius:4}},children:[m,t(Y,{onClick:function(e){try{function t(){C()}A(null);const r=function(){if(g){const e=function(e,t){try{var r=Promise.resolve(g()).then(function(){})}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}(0,function(e){console.error(e)});if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(r&&r.then?r.then(t):t())}catch(e){return Promise.reject(e)}},children:e(a,{direction:"row",spacing:1,children:[t(Xe,{sx:{fill:"#545454"}}),t(o,{textTransform:"capitalize",children:f})]})})]})]}),e(a,{direction:"row",spacing:.4,alignItems:"center",onClick:e=>A(e.currentTarget),sx:{userSelect:"none"},children:[t(o,{children:"Olá,"}),t(o,{fontWeight:600,children:v?.given_name}),t(Ue,{})]})]}):t(l,"govbr"===w?{variant:"contained",size:"small",startIcon:t(Ge,{}),onClick:x,sx:{color:"white",textTransform:"inherit",borderRadius:50,paddingX:2},children:t(o,{fontWeight:600,fontSize:15,padding:.4,children:"Entrar com o gov.br"})}:{variant:"contained",size:"small",startIcon:t(Ge,{}),onClick:x,sx:{color:"white",textTransform:"inherit",borderRadius:50,paddingX:2},children:t(o,{fontWeight:600,fontSize:15,padding:.4,children:"Entrar"})})]})]})]})}),M&&t(He,{})]}),t(i,{paddingBottom:h})]})}function ei(e,t){return"/"===t?e===t:e.startsWith(t)}function ti({links:n,title:s,img:c,pos:d="fixed",next:u=!0,el:p,menuItems:m,color:h="blue",route:f="/teste/89",paddingBottom:g=0,logoutMsg:y="Sair",logoutFunc:b,...v}){let x;u&&(x=Ze());const{user:C,login:w,logout:k,type:E}=K(st),[O,A]=H(null),[V,I]=H(null),M=Boolean(O),N=Boolean(V),[z,R]=H(!1),P=G(e=>{A(e.currentTarget)},[]),F=G(()=>{A(null)},[]),$=G((e,t)=>{R(!0),A(null),x?x.push({pathname:t}).finally(()=>R(!1)):R(!1)},[x]);return e(r,{children:[e(i,{position:d,sx:{width:"100%",zIndex:100},children:[t(T,{position:"relative",elevation:0,sx:{backgroundColor:"white",color:"black",paddingX:{xs:1,md:4}},children:e(a,{direction:"row",justifyContent:"space-between",children:[e(a,{direction:"row",alignItems:"center",spacing:2,marginRight:2,sx:{display:{xs:"none",md:"flex"},width:"100%"},children:[t(Qe,{href:"/",children:u?t(Je,{src:c,alt:s,width:40,height:40}):t("img",{src:c,height:35})}),t(i,{children:t(o,{variant:"subtitle1",fontWeight:600,children:s})})]}),t(a,{direction:"row",width:"100%",justifyContent:"center",alignItems:"center",spacing:2,sx:{display:{xs:"none",md:"flex"}},children:n.map((e,r)=>t(i,{borderBottom:u?ei(x?.pathname??"",e.path)?`solid 4px ${h}`:"":ei(f,e.path)?`solid 4px ${h}`:"",height:"100%",paddingX:2,sx:{":hover":{backgroundColor:"#fcfcfc",cursor:"pointer",userSelect:"none"}},onClick:t=>{var r;u&&console.log("pathname:",x?.pathname,":=",e.path),r=e.path,R(!0),x?x.push({pathname:r}).finally(()=>R(!1)):R(!1)},children:t(a,{height:"100%",justifyContent:"center",children:e.name})},JSON.stringify({x:e,index:r})))}),t(i,{sx:{display:{xs:"flex",md:"none"}},children:n.length>0&&e(r,{children:[t(D,{onClick:P,children:t(Ke,{})}),t(S,{open:M,onClose:F,anchorEl:O,children:n.map((e,r)=>t(Y,{onClick:t=>$(t,e.path),children:t(o,{textTransform:"capitalize",children:e.name})},JSON.stringify({x:e,index:r})))})]})}),t(a,{direction:"row",justifyContent:"flex-end",alignItems:"center",sx:{width:{md:"100%"}},paddingY:1,children:e(a,{direction:"row",spacing:2,children:[t(i,{children:p}),C?e(a,{direction:"row",spacing:1,sx:{"&:hover":{backgroundColor:"#a9def9",cursor:"pointer"},padding:.5,borderRadius:60},children:[e(i,{sx:{display:"flex",alignItems:"center"},children:[t(j,{sx:{width:30,height:30},src:C.image}),e(S,{open:N,onClose:e=>I(null),anchorEl:V,disableScrollLock:!0,transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"},sx:{".MuiMenu-paper":{borderRadius:4}},children:[m,t(Y,{onClick:function(e){try{function t(){k()}I(null);const r=function(){if(b){const e=function(e,t){try{var r=Promise.resolve(b()).then(function(){})}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}(0,function(e){console.error(e)});if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(r&&r.then?r.then(t):t())}catch(e){return Promise.reject(e)}},children:e(a,{direction:"row",spacing:1,children:[t(Xe,{sx:{fill:"#545454"}}),t(o,{textTransform:"capitalize",children:y})]})})]})]}),e(a,{direction:"row",spacing:.4,alignItems:"center",onClick:e=>I(e.currentTarget),sx:{userSelect:"none"},children:[t(o,{children:"Olá,"}),t(o,{fontWeight:600,children:C.given_name}),t(Ue,{})]})]}):t(l,"govbr"===E?{variant:"contained",size:"small",startIcon:t(Ge,{}),onClick:w,sx:{color:"white",textTransform:"inherit",borderRadius:50,paddingX:2},children:t(o,{fontWeight:600,fontSize:15,padding:.4,children:"Entrar com o gov.br"})}:{variant:"contained",size:"small",startIcon:t(Ge,{}),onClick:w,sx:{color:"white",textTransform:"inherit",borderRadius:50,paddingX:2},children:t(o,{fontWeight:600,fontSize:15,padding:.4,children:"Entrar"})})]})})]})}),z&&t(He,{})]}),t(i,{paddingBottom:g})]})}function ri({children:e,onSubmit:r,formMethod:n="GET",submiting:o=!1}){const{register:i,handleSubmit:a,control:l,formState:s,reset:c,watch:d,trigger:u,setValue:p,unregister:m,getValues:h}=ce(),[f,g]=H([]);return t(dt.Provider,{value:{formRegister:i,formWatch:d,formReset:c,formControl:l,formSetValue:p,formTrigger:u,formUnregister:m,formGetValues:h,formHandleSubmit:a,setFilesUid:g,formState:s,errors:s?.errors,submiting:o},children:t("form",{method:n,onSubmit:a(e=>r(e,f),()=>Ve("Formulário incompleto! Verifique os campos marcados e tente novamente.",{type:"warning",position:"top-right",theme:"colored"})),children:e})})}function ni({url:e,realm:r,clientId:n,children:o,type:i="ad",resource_name:a="eventos-front",redirectUri:l=""}){const[s,c]=H(),[d,u]=H(!1),[p,m]=H(null),h=Ze(),f=!!s;return J(()=>{const t=new et({url:e,realm:r,clientId:n});m(t),t.onTokenExpired=function(){try{console.log("token expired");const e=function(e,r){try{var n=Promise.resolve(t.updateToken(5)).then(function(e){e&&c(e=>({...e,token:t.token})),console.log(e?"Token was refreshed":"Token is still valid")})}catch(e){return r(e)}return n&&n.then?n.then(void 0,r):n}(0,function(e){console.log("Failed to refresh token",e)});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},t.init({onLoad:"check-sso",pkceMethod:"S256"}).then(e=>{if(u(!0),e){const e=t.tokenParsed;console.log("TOKEN-> ",e);const r={...e,token:t.token,roles:((e?.resource_access??{})[a]??[]).roles};c(r),console.info("Authenticated!!!")}else console.log("NAO AUTENTICADO")},()=>{console.error("Authenticated Failed")}).catch(e=>console.log(e));const o=h.query.status;o&&"success"===o&&window.history.replaceState(null,"","/")},[]),t(st.Provider,{value:{user:s,isAuth:f,userLoaded:d,login:function(){console.log("Tentando logar..."),console.log("KC: ",{instancia:p,logado:p?.authenticated,client_id:p?.clientId}),p?.login({redirectUri:l})},logout:function(){u(!1),p?.logout(),c(null),localStorage.removeItem("user-data.img")},saveUserData:()=>{},type:i},children:o})}const oi="nextauth.token",ii="user-data.img";function ai({children:e,AUTH_URL:r,oidcConfig:n,redirectURL:o,validateTokenRoute:i,testToken:a,testIP:l,logoutURL:s=o}){const c=n.authority+"/authorize?response_type=code&client_id="+n.client_id+"&scope="+n.scope+"&redirect_uri="+n.redirect_uri,[d,u]=H(),[p,m]=H(!1),h=Ze(),f=!!d;function g(){m(!1),h.replace(s).finally(()=>{u(null),rt(oi),localStorage.removeItem(ii),m(!0)})}return J(()=>{const e=tt(oi);e?fetch(`${r}${i}`,{method:"POST",headers:{Authorization:`Bearer ${e}`}}).then(t=>{if(t.ok){const t=ot(e),r=localStorage.getItem(ii);u({name:t.given_name,image:r??"",roles:t.roles.map(e=>e.code),token:e}),m(!0)}else g()}):m(!0)},[]),t(st.Provider,{value:{user:d,isAuth:f,userLoaded:p,login:function(){if(!location||"localhost"!==location.hostname&&location.hostname!==l)m(!1),h.replace(c);else{const e=a;nt(oi,e),u({name:"Teste",image:"",roles:[1],token:e}),h.replace(o).finally(()=>m(!0))}},logout:g,saveUserData:function(e){try{const t=e.ssp_token;nt(oi,t);const r=ot(t),n=ot(e.id_token);return Promise.resolve(fetch(n.picture,{headers:{Authorization:`Bearer ${e.access_token}`}}).then(e=>{200===e.status&&e.blob().then(e=>{const n=new FileReader;n.readAsDataURL(e),n.onload=()=>{const e=n.result;localStorage.setItem(ii,e),u({name:r.name,image:e,roles:r.roles.map(e=>e.code),token:t}),h.replace(o).finally(()=>m(!0))}}),u({name:r.name,image:"",roles:r.roles.map(e=>e.code),token:t}),h.replace(o).finally(()=>m(!0))})).then(function(){h.replace(o).finally(()=>m(!0))})}catch(e){return Promise.reject(e)}},type:"govbr"},children:e})}function li(n){return e(r,{children:[t(xo,{}),n.children,t(Ie,{position:"bottom-right",theme:"colored"})]})}export{oi as AUTH_COOKIE_NAME,Jn as ActiveInput,st as AuthContext,Qn as AutoComplete,Co as Button,it as Category,ut as CheckBox,mt as CheckBoxAdditional,ht as CheckBoxWarning,yt as DatePicker,Wn as DropFileUpload,eo as FetchAutoComplete,at as Field,lt as FieldLabel,ct as File,Ln as FileUpload,ro as FixedAutoComplete,dt as FormContext,ri as FormProvider,bt as GenericDatePicker,oo as GenericFetchAutoComplete,ao as GenericInput,so as GenericMaskInput,co as GenericMultInput,jo as GenericTable,Hn as Input,ni as KeycloakAuthProvider,vo as MODAL,Qo as Map,Kn as MaskInput,wo as Menu,uo as MultInput,Zo as NavBar,ai as OAuthProvider,po as OtherCheckBox,gt as RequiredCheckBoxGroup,li as SspComponentsProvider,fo as Stepper,bo as StepperBlock,_n as Switch,Un as SwitchWatch,ti as TabNavBar,Jo as Table,vt as TimePicker,qn as ToggleVisibility};
3
- //# sourceMappingURL=index.esm.js.map