@ssplib/react-components 0.0.320 → 0.0.321

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js CHANGED
@@ -1,3 +1,3 @@
1
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 m,SvgIcon as p,useTheme as f,useMediaQuery as h,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 S,Menu as E,MenuItem as Y,Skeleton as O,IconButton as M,Collapse as D,PaginationItem as V,Alert as I,FormControl as A,Select as T,AppBar as $,Avatar as j}from"@mui/material";import{FileDownload as N,ReportProblemRounded as R,PendingRounded as P,FilterAlt as F,KeyboardArrowDown as z,ExpandLess as L,ExpandMore as B,Refresh as W,KeyboardArrowUp as _}from"@mui/icons-material";import*as q from"react";import U,{createContext as K,useContext as X,useCallback as G,useState as H,useEffect as J,useMemo as Z,useRef as Q}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 me from"@emotion/styled";import{ThemeContext as pe}from"@emotion/react";import fe from"@mui/icons-material/CameraAlt";import he from"@mui/icons-material/Delete";import ge from"@mui/icons-material/Done";import ye from"@mui/icons-material/InsertDriveFile";import be from"@mui/icons-material/PictureAsPdf";import ve from"@mui/material/InputLabel";import{IMaskInput as xe}from"react-imask";import{useQuery as Ce}from"react-query";import we from"@mui/icons-material/KeyboardArrowLeft";import ke from"@mui/icons-material/KeyboardArrowRight";import Se from"@mui/icons-material/Save";import{LoadingButton as Ee}from"@mui/lab";import{toast as Ye,ToastContainer as Oe}from"react-toastify";import Me from"@mui/icons-material/ContentPasteOutlined";import De from"@mui/icons-material/Clear";import Ve from"@mui/icons-material/FileDownload";import Ie from"@mui/icons-material/NavigateNextRounded";import Ae from"@mui/icons-material/Search";import Te from"@mui/material/Grid";import $e from"@mui/material/Pagination";import je from"@mui/material/TextField";import Ne from"jszip";import Re from"@mui/icons-material/CloseRounded";import Pe from"tinycolor2";import Fe from"lodash.clonedeep";import*as ze from"xlsx";import Le from"next/dynamic";import Be from"@mui/icons-material/KeyboardArrowDown";import We from"@mui/icons-material/LogoutOutlined";import _e from"@mui/icons-material/Menu";import qe from"@mui/icons-material/Person";import Ue from"@mui/material/LinearProgress";import Ke from"next/image";import Xe from"next/link";import{useRouter as Ge}from"next/router";import He from"keycloak-js";import{getCookie as Je,deleteCookie as Ze,setCookie as Qe}from"cookies-next";import et from"jwt-decode";function tt({title:r}){return e(n,{paddingY:1,item:!0,marginTop:1,marginBottom:3,xs:12,children:[t(o,{textTransform:"uppercase",fontWeight:600,children:r}),t(i,{sx:{backgroundColor:"#94A3B8",height:6,borderRadius:1}})]})}function rt({name:r,title:l,tag:s,xs:c=12,md:d,lg:u}){let m=s&&"Distrital"===s?"#BFDBFE":"Estadual"===s?"#BBF7D0":"Federal"===s?"#FEF08A":"Internacional"===s?"#FED7AA":"Não"===s?"#FECACA":"#BBF7D0";return t(n,{paddingBottom:3,item:!0,xs:c,md:d,lg:u,paddingRight:2,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:m,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 nt({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,item:!0,xs:i,md:s,lg:c,paddingRight:2,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 ot=/*#__PURE__*/K({});function it({title:r,name:i,md:s,fileURL:c,fileExt:d="pdf"}){const{user:u}=X(ot);return t(n,{paddingBottom:3,paddingRight:3,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(N,{sx:{fill:"red"}}),t(o,{children:i})]}),t(a,{alignItems:"center",children:t(l,{variant:"outlined",color:"error",size:"small",endIcon:t(N,{}),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 at=/*#__PURE__*/K(null);function lt({name:e,title:r,defaultValue:o=!1,xs:i=12,sm:a,md:l,onChange:d}){const u=X(at),m=G(t=>{u?.formSetValue(e,!u?.formGetValues(e))},[u,e]);return t(n,{item:!0,xs:i,sm:a,md:l,children:t(s,{control:t(c,{size:"small",defaultChecked:o}),label:r,...u?.formRegister(e),onChange:d,onClick:m})})}function st(e){let t=[];return e.forEach(e=>{if(e.props){if(e.props.children){const r=st(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 ct({customText:r="Selecione pelo menos 1 opção",...o}){const[i,a]=H(!1),[l,s]=H(!0),c=X(at),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=st(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,{item:!0,xs:12,children:i&&l&&o.content})]})}function dt({name:r,title:o,customWarning:i,defaultValue:a=!1,xs:l=12,sm:u,md:m}){const p=X(at);return e(n,{item:!0,xs:l,sm:u,md:m,children:[t(s,{control:t(c,{size:"small",...p.formRegister(r),defaultChecked:a}),label:o}),p.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 ut(e){let t=[];return e.forEach(e=>{if(e.props){if(e.props.children){const r=ut(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",...i}){const a=X(at);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=ut(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,{item:!0,xs:12,children:t(o,{sx:{color:"#a51c30",fontSize:16,paddingLeft:1},children:te(a.errors,i.name)?.message})})]})}function pt({name:i,required:a=!1,title:l,xs:s=12,sm:c,md:d,minDt:p,defaultValue:f,persistValue:h,maxDt:g,...y}){const b=X(at),[v,x]=H(void 0!==f?ae(f,"DD/MM/YYYY"):void 0);return J(()=>{void 0!==v&&b.formSetValue(i,v?v.format("DD/MM/YYYY"):v)},[v]),J(()=>{if(!h)return()=>{b.formUnregister(i)}},[]),t(r,{children:e(n,{item:!0,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(p,"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(m,{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":!p||ae(p,"DD/MM/YYYY").isSame(ae(e,"DD/MM/YYYY"))||ae(p,"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 ${p} e antes de ${g}`),shouldUnregister:!0}),fullWidth:!0})}),t(o,{sx:{color:"#a51c30",fontSize:14,paddingLeft:1},children:te(b.errors,i)?.message})]})]})})}function ft({name:i,required:a=!1,title:l,xs:s=12,sm:c,md:d,minDt:p,defaultValue:f,persistValue:h,maxDt:g,...y}){const b=se(),[v,x]=H(void 0!==f?ae(f,"DD/MM/YYYY"):void 0);return J(()=>{void 0!==v&&b.setValue(i,v?v.format("DD/MM/YYYY"):v)},[v]),J(()=>{if(!h)return()=>{b.unregister(i)}},[]),t(r,{children:e(n,{item:!0,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(p,"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(m,{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":!p||ae(p,"DD/MM/YYYY").isSame(ae(e,"DD/MM/YYYY"))||ae(p,"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 ${p} 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 ht({name:r,required:i=!1,title:a,defaultValue:l="",xs:s=12,sm:c,md:d}){const p=X(at),[f,h]=H(l?ae(l,"HH:mm"):null);return J(()=>{p.formSetValue(r,f?f.format("HH:mm"):f)},[f]),J(()=>()=>{p.formUnregister(r)},[]),e(n,{item:!0,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:f,ampm:!1,onChange:e=>{h(e)},sx:{outline:te(p.errors,r)?"1px solid #a51c30":"",backgroundColor:"white",width:"100%",div:{input:{paddingX:2,paddingY:1.05}}},inputRef:e=>t(m,{size:"small",...e,...p?.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(p.errors,r)?.message})]})]})}function gt(){return gt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gt.apply(null,arguments)}function yt(e){return null!==e&&"object"==typeof e&&e.constructor===Object}function bt(e){if(!yt(e))return e;const t={};return Object.keys(e).forEach(r=>{t[r]=bt(e[r])}),t}function vt(e,t,r={clone:!0}){const n=r.clone?gt({},e):e;return yt(e)&&yt(t)&&Object.keys(t).forEach(o=>{"__proto__"!==o&&(n[o]=yt(t[o])&&o in e&&yt(e[o])?vt(e[o],t[o],r):r.clone&&yt(t[o])?bt(t[o]):t[o])}),n}function xt(e){var t={exports:{}};return e(t,t.exports),t.exports}var Ct="function"==typeof Symbol&&Symbol.for,wt=Ct?Symbol.for("react.element"):60103,kt=Ct?Symbol.for("react.portal"):60106,St=Ct?Symbol.for("react.fragment"):60107,Et=Ct?Symbol.for("react.strict_mode"):60108,Yt=Ct?Symbol.for("react.profiler"):60114,Ot=Ct?Symbol.for("react.provider"):60109,Mt=Ct?Symbol.for("react.context"):60110,Dt=Ct?Symbol.for("react.async_mode"):60111,Vt=Ct?Symbol.for("react.concurrent_mode"):60111,It=Ct?Symbol.for("react.forward_ref"):60112,At=Ct?Symbol.for("react.suspense"):60113,Tt=Ct?Symbol.for("react.suspense_list"):60120,$t=Ct?Symbol.for("react.memo"):60115,jt=Ct?Symbol.for("react.lazy"):60116,Nt=Ct?Symbol.for("react.block"):60121,Rt=Ct?Symbol.for("react.fundamental"):60117,Pt=Ct?Symbol.for("react.responder"):60118,Ft=Ct?Symbol.for("react.scope"):60119;function zt(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case wt:switch(e=e.type){case Dt:case Vt:case St:case Yt:case Et:case At:return e;default:switch(e=e&&e.$$typeof){case Mt:case It:case jt:case $t:case Ot:return e;default:return t}}case kt:return t}}}function Lt(e){return zt(e)===Vt}var Bt={AsyncMode:Dt,ConcurrentMode:Vt,ContextConsumer:Mt,ContextProvider:Ot,Element:wt,ForwardRef:It,Fragment:St,Lazy:jt,Memo:$t,Portal:kt,Profiler:Yt,StrictMode:Et,Suspense:At,isAsyncMode:function(e){return Lt(e)||zt(e)===Dt},isConcurrentMode:Lt,isContextConsumer:function(e){return zt(e)===Mt},isContextProvider:function(e){return zt(e)===Ot},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===wt},isForwardRef:function(e){return zt(e)===It},isFragment:function(e){return zt(e)===St},isLazy:function(e){return zt(e)===jt},isMemo:function(e){return zt(e)===$t},isPortal:function(e){return zt(e)===kt},isProfiler:function(e){return zt(e)===Yt},isStrictMode:function(e){return zt(e)===Et},isSuspense:function(e){return zt(e)===At},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===St||e===Vt||e===Yt||e===Et||e===At||e===Tt||"object"==typeof e&&null!==e&&(e.$$typeof===jt||e.$$typeof===$t||e.$$typeof===Ot||e.$$typeof===Mt||e.$$typeof===It||e.$$typeof===Rt||e.$$typeof===Pt||e.$$typeof===Ft||e.$$typeof===Nt)},typeOf:zt},Wt=xt(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,r=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,d=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,f=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:var p=e.type;switch(p){case c:case d:case o:case a:case i:case m:return p;default:var g=p&&p.$$typeof;switch(g){case s:case u:case h:case f:case l:return g;default:return t}}case n:return t}}}var C=d,w=s,k=l,S=r,E=u,Y=o,O=h,M=f,D=n,V=a,I=i,A=m,T=!1;function $(e){return x(e)===d}t.AsyncMode=c,t.ConcurrentMode=C,t.ContextConsumer=w,t.ContextProvider=k,t.Element=S,t.ForwardRef=E,t.Fragment=Y,t.Lazy=O,t.Memo=M,t.Portal=D,t.Profiler=V,t.StrictMode=I,t.Suspense=A,t.isAsyncMode=function(e){return T||(T=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),$(e)||x(e)===c},t.isConcurrentMode=$,t.isContextConsumer=function(e){return x(e)===s},t.isContextProvider=function(e){return x(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return x(e)===u},t.isFragment=function(e){return x(e)===o},t.isLazy=function(e){return x(e)===h},t.isMemo=function(e){return x(e)===f},t.isPortal=function(e){return x(e)===n},t.isProfiler=function(e){return x(e)===a},t.isStrictMode=function(e){return x(e)===i},t.isSuspense=function(e){return x(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===d||e===a||e===i||e===m||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===f||e.$$typeof===l||e.$$typeof===s||e.$$typeof===u||e.$$typeof===y||e.$$typeof===b||e.$$typeof===v||e.$$typeof===g)},t.typeOf=x}()}),_t=xt(function(e){e.exports="production"===process.env.NODE_ENV?Bt:Wt}),qt=Object.getOwnPropertySymbols,Ut=Object.prototype.hasOwnProperty,Kt=Object.prototype.propertyIsEnumerable,Xt=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;var n=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==n.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).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]))Ut.call(r,a)&&(o[a]=r[a]);if(qt){n=qt(r);for(var l=0;l<n.length;l++)Kt.call(r,n[l])&&(o[n[l]]=r[n[l]])}}return o},Gt=Function.call.bind(Object.prototype.hasOwnProperty),Ht="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Jt=Gt,Zt=function(){};if("production"!==process.env.NODE_ENV){var Qt=Ht,er={},tr=Jt;Zt=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function rr(e,t,r,n,o){if("production"!==process.env.NODE_ENV)for(var i in e)if(tr(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,Qt)}catch(e){a=e}if(!a||a instanceof Error||Zt((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 er)){er[a.message]=!0;var s=o?o():"";Zt("Failed "+r+" type: "+a.message+(null!=s?s:""))}}}rr.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(er={})};var nr=rr,or=function(){};function ir(){return null}function ar(){}function lr(){}"production"!==process.env.NODE_ENV&&(or=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),lr.resetWarningCache=ar;var sr,cr=xt(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(ir),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+"]",Ht);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 _t.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(Jt(l,c)){var u=e(l,c,n,o,a+"."+c,Ht);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&&or(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."),ir)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&or("Invalid argument supplied to oneOfType, expected an instance of array."),ir;for(var t=0;t<e.length;t++){var r=e[t];if("function"!=typeof r)return or("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+m(r)+" at index "+t+"."),ir}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,Ht);if(null==c)return null;c.data&&Jt(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 m in e){var p=e[m];if("function"!=typeof p)return s(n,o,a,m,u(p));var f=p(l,m,n,o,a+"."+m,Ht);if(f)return f}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 m=Xt({},t[r],e);for(var p in m){var f=e[p];if(Jt(e,p)&&"function"!=typeof f)return s(n,o,a,p,u(f));if(!f)return new i("Invalid "+o+" `"+a+"` key `"+p+"` supplied to `"+n+"`.\nBad object: "+JSON.stringify(t[r],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var h=f(l,p,n,o,a+"."+p,Ht);if(h)return h}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!==Ht){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 m(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=nr,n.resetWarningCache=nr.resetWarningCache,n.PropTypes=n,n}(_t.isElement):function(){function e(e,t,r,n,o,i){if(i!==Ht){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:lr,resetWarningCache:ar};return r.PropTypes=r,r}()}),dr=Symbol.for("react.element"),ur=Symbol.for("react.portal"),mr=Symbol.for("react.fragment"),pr=Symbol.for("react.strict_mode"),fr=Symbol.for("react.profiler"),hr=Symbol.for("react.provider"),gr=Symbol.for("react.context"),yr=Symbol.for("react.server_context"),br=Symbol.for("react.forward_ref"),vr=Symbol.for("react.suspense"),xr=Symbol.for("react.suspense_list"),Cr=Symbol.for("react.memo"),wr=Symbol.for("react.lazy"),kr=Symbol.for("react.offscreen");function Sr(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case dr:switch(e=e.type){case mr:case fr:case pr:case vr:case xr:return e;default:switch(e=e&&e.$$typeof){case yr:case gr:case br:case wr:case Cr:case hr:return e;default:return t}}case ur:return t}}}sr=Symbol.for("react.module.reference");var Er={ContextConsumer:gr,ContextProvider:hr,Element:dr,ForwardRef:br,Fragment:mr,Lazy:wr,Memo:Cr,Portal:ur,Profiler:fr,StrictMode:pr,Suspense:vr,SuspenseList:xr,isAsyncMode:function(){return!1},isConcurrentMode:function(){return!1},isContextConsumer:function(e){return Sr(e)===gr},isContextProvider:function(e){return Sr(e)===hr},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===dr},isForwardRef:function(e){return Sr(e)===br},isFragment:function(e){return Sr(e)===mr},isLazy:function(e){return Sr(e)===wr},isMemo:function(e){return Sr(e)===Cr},isPortal:function(e){return Sr(e)===ur},isProfiler:function(e){return Sr(e)===fr},isStrictMode:function(e){return Sr(e)===pr},isSuspense:function(e){return Sr(e)===vr},isSuspenseList:function(e){return Sr(e)===xr},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===mr||e===fr||e===pr||e===vr||e===xr||e===kr||"object"==typeof e&&null!==e&&(e.$$typeof===wr||e.$$typeof===Cr||e.$$typeof===hr||e.$$typeof===gr||e.$$typeof===br||e.$$typeof===sr||void 0!==e.getModuleId)},typeOf:Sr},Yr=xt(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e,r=Symbol.for("react.element"),n=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),s=Symbol.for("react.context"),c=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen");function g(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:var h=e.type;switch(h){case o:case a:case i:case u:case m:return h;default:var g=h&&h.$$typeof;switch(g){case c:case s:case d:case f:case p:case l:return g;default:return t}}case n:return t}}}e=Symbol.for("react.module.reference");var y=l,b=r,v=d,x=o,C=f,w=p,k=n,S=a,E=i,Y=u,O=m,M=!1,D=!1;t.ContextConsumer=s,t.ContextProvider=y,t.Element=b,t.ForwardRef=v,t.Fragment=x,t.Lazy=C,t.Memo=w,t.Portal=k,t.Profiler=S,t.StrictMode=E,t.Suspense=Y,t.SuspenseList=O,t.isAsyncMode=function(e){return M||(M=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1},t.isConcurrentMode=function(e){return D||(D=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1},t.isContextConsumer=function(e){return g(e)===s},t.isContextProvider=function(e){return g(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return g(e)===d},t.isFragment=function(e){return g(e)===o},t.isLazy=function(e){return g(e)===f},t.isMemo=function(e){return g(e)===p},t.isPortal=function(e){return g(e)===n},t.isProfiler=function(e){return g(e)===a},t.isStrictMode=function(e){return g(e)===i},t.isSuspense=function(e){return g(e)===u},t.isSuspenseList=function(e){return g(e)===m},t.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===o||t===a||t===i||t===u||t===m||t===h||"object"==typeof t&&null!==t&&(t.$$typeof===f||t.$$typeof===p||t.$$typeof===l||t.$$typeof===s||t.$$typeof===d||t.$$typeof===e||void 0!==t.getModuleId)},t.typeOf=g}()}),Or=xt(function(e){e.exports="production"===process.env.NODE_ENV?Er:Yr});const Mr=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function Dr(e,t=""){return e.displayName||e.name||function(e){const t=`${e}`.match(Mr);return t&&t[1]||""}(e)||t}function Vr(e,t,r){const n=Dr(t);return e.displayName||(""!==n?`${r}(${n})`:r)}function Ir(e){if("string"!=typeof e)throw new Error("production"!==process.env.NODE_ENV?"MUI: `capitalize(string)` expects a string argument.":function(e){let t="https://mui.com/production-error/?code="+e;for(let e=1;e<arguments.length;e+=1)t+="&args[]="+encodeURIComponent(arguments[e]);return"Minified MUI error #"+e+"; visit "+t+" for the full message."}(7));return e.charAt(0).toUpperCase()+e.slice(1)}function Ar(e,t){const r=gt({},t);return Object.keys(e).forEach(n=>{if(n.toString().match(/^(components|slots)$/))r[n]=gt({},e[n],r[n]);else if(n.toString().match(/^(componentsProps|slotProps)$/)){const o=e[n]||{},i=t[n];r[n]={},i&&Object.keys(i)?o&&Object.keys(o)?(r[n]=gt({},i),Object.keys(o).forEach(e=>{r[n][e]=Ar(o[e],i[e])})):r[n]=i:r[n]=o}else void 0===r[n]&&(r[n]=e[n])}),r}const Tr=e=>e;var $r=(()=>{let e=Tr;return{configure(t){e=t},generate:t=>e(t),reset(){e=Tr}}})();const jr={active:"active",checked:"checked",completed:"completed",disabled:"disabled",readOnly:"readOnly",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",required:"required",selected:"selected"};function Nr(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}const Rr=["values","unit","step"];var Pr={borderRadius:4},Fr="production"!==process.env.NODE_ENV?cr.oneOfType([cr.number,cr.string,cr.object,cr.array]):{};function zr(e,t){return t?vt(e,t,{clone:!1}):e}const Lr={xs:0,sm:600,md:900,lg:1200,xl:1536},Br={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${Lr[e]}px)`};function Wr(e,t,r){const n=e.theme||{};if(Array.isArray(t)){const e=n.breakpoints||Br;return t.reduce((n,o,i)=>(n[e.up(e.keys[i])]=r(t[i]),n),{})}if("object"==typeof t){const e=n.breakpoints||Br;return Object.keys(t).reduce((n,o)=>(-1!==Object.keys(e.values||Lr).indexOf(o)?n[e.up(o)]=r(t[o],o):n[o]=t[o],n),{})}return r(t)}function _r(e={}){var t;return(null==(t=e.keys)?void 0:t.reduce((t,r)=>(t[e.up(r)]={},t),{}))||{}}function qr(e,t){return e.reduce((e,t)=>{const r=e[t];return(!r||0===Object.keys(r).length)&&delete e[t],e},t)}function Ur({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 Kr(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 Xr(e,t,r,n=r){let o;return o="function"==typeof e?e(r):Array.isArray(e)?e[r]||n:Kr(e,r)||n,t&&(o=t(o,n,e)),o}function Gr(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=Kr(e.theme,n)||{};return Wr(e,i,e=>{let n=Xr(a,o,e);return e===n&&"string"==typeof e&&(n=Xr(a,o,`${t}${"default"===e?"":Ir(e)}`,e)),!1===r?n:{[r]:n}})};return i.propTypes="production"!==process.env.NODE_ENV?{[t]:Fr}:{},i.filterProps=[t],i}const Hr={m:"margin",p:"padding"},Jr={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Zr={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},Qr=function(){const e={};return t=>(void 0===e[t]&&(e[t]=(e=>{if(e.length>2){if(!Zr[e])return[e];e=Zr[e]}const[t,r]=e.split(""),n=Hr[t],o=Jr[r]||"";return Array.isArray(o)?o.map(e=>n+e):[n+o]})(t)),e[t])}(),en=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],tn=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],rn=[...en,...tn];function nn(e,t,r,n){var o;const i=null!=(o=Kr(e,t,!1))?o:r;return"number"==typeof i?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}.`),i*e):Array.isArray(i)?e=>"string"==typeof e?e:("production"!==process.env.NODE_ENV&&(Number.isInteger(e)?e>i.length-1&&console.error([`MUI: The value provided (${e}) overflows.`,`The supported values are: ${JSON.stringify(i)}.`,`${e} > ${i.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"))),i[e]):"function"==typeof i?i:("production"!==process.env.NODE_ENV&&console.error([`MUI: The \`theme.${t}\` value (${i}) is invalid.`,"It should be a number, an array or a function."].join("\n")),()=>{})}function on(e){return nn(e,"spacing",8,"spacing")}function an(e,t){if("string"==typeof t||null==t)return t;const r=e(Math.abs(t));return t>=0?r:"number"==typeof r?-r:`-${r}`}function ln(e,t){const r=on(e.theme);return Object.keys(e).map(n=>function(e,t,r,n){if(-1===t.indexOf(r))return null;const o=function(e,t){return r=>e.reduce((e,n)=>(e[n]=an(t,r),e),{})}(Qr(r),n);return Wr(e,e[r],o)}(e,t,n,r)).reduce(zr,{})}function sn(e){return ln(e,en)}function cn(e){return ln(e,tn)}function dn(...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]?zr(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 un(e){return"number"!=typeof e?e:`${e}px solid`}sn.propTypes="production"!==process.env.NODE_ENV?en.reduce((e,t)=>(e[t]=Fr,e),{}):{},sn.filterProps=en,cn.propTypes="production"!==process.env.NODE_ENV?tn.reduce((e,t)=>(e[t]=Fr,e),{}):{},cn.filterProps=tn,"production"===process.env.NODE_ENV||rn.reduce((e,t)=>(e[t]=Fr,e),{});const mn=Gr({prop:"border",themeKey:"borders",transform:un}),pn=Gr({prop:"borderTop",themeKey:"borders",transform:un}),fn=Gr({prop:"borderRight",themeKey:"borders",transform:un}),hn=Gr({prop:"borderBottom",themeKey:"borders",transform:un}),gn=Gr({prop:"borderLeft",themeKey:"borders",transform:un}),yn=Gr({prop:"borderColor",themeKey:"palette"}),bn=Gr({prop:"borderTopColor",themeKey:"palette"}),vn=Gr({prop:"borderRightColor",themeKey:"palette"}),xn=Gr({prop:"borderBottomColor",themeKey:"palette"}),Cn=Gr({prop:"borderLeftColor",themeKey:"palette"}),wn=e=>{if(null!=e.borderRadius){const t=nn(e.theme,"shape.borderRadius",4,"borderRadius");return Wr(e,e.borderRadius,e=>({borderRadius:an(t,e)}))}return null};wn.propTypes="production"!==process.env.NODE_ENV?{borderRadius:Fr}:{},wn.filterProps=["borderRadius"],dn(mn,pn,fn,hn,gn,yn,bn,vn,xn,Cn,wn);const kn=e=>{if(null!=e.gap){const t=nn(e.theme,"spacing",8,"gap");return Wr(e,e.gap,e=>({gap:an(t,e)}))}return null};kn.propTypes="production"!==process.env.NODE_ENV?{gap:Fr}:{},kn.filterProps=["gap"];const Sn=e=>{if(null!=e.columnGap){const t=nn(e.theme,"spacing",8,"columnGap");return Wr(e,e.columnGap,e=>({columnGap:an(t,e)}))}return null};Sn.propTypes="production"!==process.env.NODE_ENV?{columnGap:Fr}:{},Sn.filterProps=["columnGap"];const En=e=>{if(null!=e.rowGap){const t=nn(e.theme,"spacing",8,"rowGap");return Wr(e,e.rowGap,e=>({rowGap:an(t,e)}))}return null};function Yn(e,t){return"grey"===t?t:e}function On(e){return e<=1&&0!==e?100*e+"%":e}En.propTypes="production"!==process.env.NODE_ENV?{rowGap:Fr}:{},En.filterProps=["rowGap"],dn(kn,Sn,En,Gr({prop:"gridColumn"}),Gr({prop:"gridRow"}),Gr({prop:"gridAutoFlow"}),Gr({prop:"gridAutoColumns"}),Gr({prop:"gridAutoRows"}),Gr({prop:"gridTemplateColumns"}),Gr({prop:"gridTemplateRows"}),Gr({prop:"gridTemplateAreas"}),Gr({prop:"gridArea"})),dn(Gr({prop:"color",themeKey:"palette",transform:Yn}),Gr({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Yn}),Gr({prop:"backgroundColor",themeKey:"palette",transform:Yn}));const Mn=Gr({prop:"width",transform:On}),Dn=e=>null!=e.maxWidth?Wr(e,e.maxWidth,t=>{var r,n,o;return{maxWidth:(null==(r=e.theme)||null==(n=r.breakpoints)||null==(o=n.values)?void 0:o[t])||Lr[t]||On(t)}}):null;Dn.filterProps=["maxWidth"];const Vn=Gr({prop:"minWidth",transform:On}),In=Gr({prop:"height",transform:On}),An=Gr({prop:"maxHeight",transform:On}),Tn=Gr({prop:"minHeight",transform:On});Gr({prop:"size",cssProperty:"width",transform:On}),Gr({prop:"size",cssProperty:"height",transform:On}),dn(Mn,Dn,Vn,In,An,Tn,Gr({prop:"boxSizing"}));var $n={border:{themeKey:"borders",transform:un},borderTop:{themeKey:"borders",transform:un},borderRight:{themeKey:"borders",transform:un},borderBottom:{themeKey:"borders",transform:un},borderLeft:{themeKey:"borders",transform:un},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:wn},color:{themeKey:"palette",transform:Yn},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Yn},backgroundColor:{themeKey:"palette",transform:Yn},p:{style:cn},pt:{style:cn},pr:{style:cn},pb:{style:cn},pl:{style:cn},px:{style:cn},py:{style:cn},padding:{style:cn},paddingTop:{style:cn},paddingRight:{style:cn},paddingBottom:{style:cn},paddingLeft:{style:cn},paddingX:{style:cn},paddingY:{style:cn},paddingInline:{style:cn},paddingInlineStart:{style:cn},paddingInlineEnd:{style:cn},paddingBlock:{style:cn},paddingBlockStart:{style:cn},paddingBlockEnd:{style:cn},m:{style:sn},mt:{style:sn},mr:{style:sn},mb:{style:sn},ml:{style:sn},mx:{style:sn},my:{style:sn},margin:{style:sn},marginTop:{style:sn},marginRight:{style:sn},marginBottom:{style:sn},marginLeft:{style:sn},marginX:{style:sn},marginY:{style:sn},marginInline:{style:sn},marginInlineStart:{style:sn},marginInlineEnd:{style:sn},marginBlock:{style:sn},marginBlockStart:{style:sn},marginBlockEnd:{style:sn},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:kn},rowGap:{style:En},columnGap:{style:Sn},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:On},maxWidth:{style:Dn},minWidth:{transform:On},height:{transform:On},maxHeight:{transform:On},minHeight:{transform:On},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};const jn=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=Kr(r,l)||{};return c?c(o):Wr(o,t,t=>{let r=Xr(d,s,t);return t===r&&"string"==typeof t&&(r=Xr(d,s,`${e}${"default"===t?"":Ir(t)}`,t)),!1===a?r:{[a]:r}})}return function t(r){var n;const{sx:o,theme:i={}}=r||{};if(!o)return null;const a=null!=(n=i.unstable_sxConfig)?n:$n;function l(r){let n=r;if("function"==typeof r)n=r(i);else if("object"!=typeof r)return r;if(!n)return null;const o=_r(i.breakpoints),l=Object.keys(o);let s=o;return Object.keys(n).forEach(r=>{const o="function"==typeof(l=n[r])?l(i):l;var l;if(null!=o)if("object"==typeof o)if(a[r])s=zr(s,e(r,o,i,a));else{const e=Wr({theme:i},o,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,o)?s=zr(s,e):s[r]=t({sx:o,theme:i})}else s=zr(s,e(r,o,i,a))}),qr(l,s)}return Array.isArray(o)?o.map(l):l(o)}}();jn.filterProps=["sx"];var Nn=jn;const Rn=["breakpoints","palette","spacing","shape"];function Pn(e={},...t){const{breakpoints:r={},palette:n={},spacing:o,shape:i={}}=e,a=Nr(e,Rn),l=function(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:n=5}=e,o=Nr(e,Rr),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)=>gt({},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 gt({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){if(e.mui)return e;const t=on({spacing:e}),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=vt({breakpoints:l,direction:"ltr",components:{},palette:gt({mode:"light"},n),spacing:s,shape:gt({},Pr,i)},a);return c=t.reduce((e,t)=>vt(e,t),c),c.unstable_sxConfig=gt({},$n,null==a?void 0:a.unstable_sxConfig),c.unstable_sx=function(e){return Nn({sx:e,theme:this})},c}const Fn=Pn(),zn=["sx"];function Ln(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=Ln(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function Bn(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=Ln(e))&&(n&&(n+=" "),n+=t);return n}const Wn=["variant"];function _n(e){return 0===e.length}function qn(e){const{variant:t}=e,r=Nr(e,Wn);let n=t||"";return Object.keys(r).sort().forEach(t=>{n+="color"===t?_n(n)?e[t]:Ir(e[t]):`${_n(n)?t:Ir(t)}${Ir(e[t].toString())}`}),n}const Un=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function Kn(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}const Xn=Pn();function Gn({defaultTheme:e,theme:t,themeId:r}){return 0===Object.keys(t).length?e:t[r]||t}const Hn=function(e={}){const{themeId:t,defaultTheme:r=Xn,rootShouldForwardProp:n=Kn,slotShouldForwardProp:o=Kn}=e,i=e=>Nn(gt({},e,{theme:Gn(gt({},e,{defaultTheme:r,themeId:t}))}));return i.__mui_systemSx=!0,(e,a={})=>{(e=>{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=e.__emotion_styles.filter(e=>!(null!=e&&e.__mui_systemSx)))})(e);const{name:l,slot:s,skipVariantsResolver:c,skipSx:d,overridesResolver:u}=a,m=Nr(a,Un),p=void 0!==c?c:s&&"Root"!==s||!1,f=d||!1;let h;var g;"production"!==process.env.NODE_ENV&&l&&(h=`${l}-${g=s||"Root",g.charAt(0).toLowerCase()+g.slice(1)}`);let y=Kn;"Root"===s?y=n:s?y=o:function(e){return"string"==typeof e&&e.charCodeAt(0)>96}(e)&&(y=void 0);const b=function(e,t){const r=me(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,gt({shouldForwardProp:y,label:h},m)),v=(n,...o)=>{const a=o?o.map(e=>"function"==typeof e&&e.__emotion_real!==e?n=>e(gt({},n,{theme:Gn(gt({},n,{defaultTheme:r,themeId:t}))})):e):[];let c=n;l&&u&&a.push(e=>{const n=Gn(gt({},e,{defaultTheme:r,themeId:t})),o=((e,t)=>t.components&&t.components[e]&&t.components[e].styleOverrides?t.components[e].styleOverrides:null)(l,n);if(o){const t={};return Object.entries(o).forEach(([r,o])=>{t[r]="function"==typeof o?o(gt({},e,{theme:n})):o}),u(e,t)}return null}),l&&!p&&a.push(e=>{const n=Gn(gt({},e,{defaultTheme:r,themeId:t}));return((e,t,r,n)=>{var o,i;const{ownerState:a={}}=e,l=[],s=null==r||null==(o=r.components)||null==(i=o[n])?void 0:i.variants;return s&&s.forEach(r=>{let n=!0;Object.keys(r.props).forEach(t=>{a[t]!==r.props[t]&&e[t]!==r.props[t]&&(n=!1)}),n&&l.push(t[qn(r.props)])}),l})(e,((e,t)=>{let r=[];t&&t.components&&t.components[e]&&t.components[e].variants&&(r=t.components[e].variants);const n={};return r.forEach(e=>{const t=qn(e.props);n[t]=e.style}),n})(l,n),n,l)}),f||a.push(i);const d=a.length-o.length;if(Array.isArray(n)&&d>0){const e=new Array(d).fill("");c=[...n,...e],c.raw=[...n.raw,...e]}else"function"==typeof n&&n.__emotion_real!==n&&(c=e=>n(gt({},e,{theme:Gn(gt({},e,{defaultTheme:r,themeId:t}))})));const m=b(c,...a);if("production"!==process.env.NODE_ENV){let t;l&&(t=`${l}${s||""}`),void 0===t&&(t=`Styled(${function(e){if(null!=e){if("string"==typeof e)return e;if("function"==typeof e)return Dr(e,"Component");if("object"==typeof e)switch(e.$$typeof){case Or.ForwardRef:return Vr(e,e.render,"ForwardRef");case Or.Memo:return Vr(e,e.type,"memo");default:return}}}(e)})`),m.displayName=t}return e.muiName&&(m.muiName=e.muiName),m};return b.withConfig&&(v.withConfig=b.withConfig),v}}();var Jn=Hn;function Zn(e){const{theme:t,name:r,props:n}=e;return t&&t.components&&t.components[r]&&t.components[r].defaultProps?Ar(t.components[r].defaultProps,n):n}const Qn=["component","direction","spacing","divider","children","className","useFlexGap"],eo=Pn(),to=Jn("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root});function ro(e){return function({props:e,name:t,defaultTheme:r,themeId:n}){let o=function(e=Fn){return function(e=null){const t=q.useContext(pe);return t&&0!==Object.keys(t).length?t:e}(e)}(r);return n&&(o=o[n]||o),Zn({theme:o,name:t,props:e})}({props:e,name:"MuiStack",defaultTheme:eo})}function no(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 oo=({ownerState:e,theme:t})=>{let r=gt({display:"flex",flexDirection:"column"},Wr({theme:t},Ur({values:e.direction,breakpoints:t.breakpoints.values}),e=>({flexDirection:e})));if(e.spacing){const n=on(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=Ur({values:e.direction,base:o}),a=Ur({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=vt(r,Wr({theme:t},a,(t,r)=>{return e.useFlexGap?{gap:an(n,t)}:{"& > :not(style) + :not(style)":{margin:0,[`margin${o=r?i[r]:e.direction,{row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"}[o]}`]:an(n,t)}};var o}))}return r=function(e,...t){const r=_r(e),n=[r,...t].reduce((e,t)=>vt(e,t),{});return qr(Object.keys(r),n)}(t.breakpoints,r),r},io=function(e={}){const{createStyledComponent:r=to,useThemeProps:n=ro,componentName:o="MuiStack"}=e,i=r(oo),a=/*#__PURE__*/q.forwardRef(function(e,r){const a=function(e){const{sx:t}=e,r=Nr(e,zn),{systemProps:n,otherProps:o}=(e=>{var t,r;const n={systemProps:{},otherProps:{}},o=null!=(t=null==e||null==(r=e.theme)?void 0:r.unstable_sxConfig)?t:$n;return Object.keys(e).forEach(t=>{o[t]?n.systemProps[t]=e[t]:n.otherProps[t]=e[t]}),n})(r);let i;return i=Array.isArray(t)?[n,...t]:"function"==typeof t?(...e)=>{const r=t(...e);return yt(r)?gt({},n,r):n}:gt({},n,t),gt({},o,{sx:i})}(n(e)),{component:l="div",direction:s="column",spacing:c=0,divider:d,children:u,className:m,useFlexGap:p=!1}=a,f=Nr(a,Qn),h={direction:s,spacing:c,useFlexGap:p},g=function(e,t,r){const n={};return Object.keys(e).forEach(t=>{n[t]=e[t].reduce((e,t)=>{if(t){const n=(e=>function(e,t,r="Mui"){const n=jr[t];return n?`${r}-${n}`:`${$r.generate(e)}-${t}`}(o,e))(t);""!==n&&e.push(n),r&&r[t]&&e.push(r[t])}return e},[]).join(" ")}),n}({root:["root"]},0,{});/*#__PURE__*/
2
- return t(i,gt({as:l,ownerState:h,ref:r,className:Bn(g.root,m)},f,{children:d?no(u,d):u}))});return"production"!==process.env.NODE_ENV&&(a.propTypes={children:cr.node,direction:cr.oneOfType([cr.oneOf(["column-reverse","column","row-reverse","row"]),cr.arrayOf(cr.oneOf(["column-reverse","column","row-reverse","row"])),cr.object]),divider:cr.node,spacing:cr.oneOfType([cr.arrayOf(cr.oneOfType([cr.number,cr.string])),cr.number,cr.object,cr.string]),sx:cr.oneOfType([cr.arrayOf(cr.oneOfType([cr.func,cr.object,cr.bool])),cr.func,cr.object])}),a}();"production"!==process.env.NODE_ENV&&(io.propTypes={children:cr.node,component:cr.elementType,direction:cr.oneOfType([cr.oneOf(["column-reverse","column","row-reverse","row"]),cr.arrayOf(cr.oneOf(["column-reverse","column","row-reverse","row"])),cr.object]),divider:cr.node,spacing:cr.oneOfType([cr.arrayOf(cr.oneOfType([cr.number,cr.string])),cr.number,cr.object,cr.string]),sx:cr.oneOfType([cr.arrayOf(cr.oneOfType([cr.func,cr.object,cr.bool])),cr.func,cr.object]),useFlexGap:cr.bool});var ao=io;function lo(r){return t(p,{...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 so(r){return t(p,{...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 co(e){const t=1048576;return e<t?`${(e/1024).toFixed(1)}KB`:`${(e/t).toFixed(1)}MB`}function uo({name:a,tipoArquivo:s,title:c,required:d=!1,multiple:m=!1,apiURL:p,sizeLimit:y=4,xs:b=12,sm:v,md:x,route:C="",tstToken:w="",dropZoneOptions:k}){const{getRootProps:S,getInputProps:E}=ue({multiple:m,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(p,n,{onUploadProgress:t=>{const n=Math.round(100*t.loaded/t.total);V(n),n>=100&&A(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)}]),$(e=>[...e,r]);const n={};n[r]=t,N(e=>({...e,...n}))}else V(-1),F(r)}).catch(e=>{console.log(e),V(-1),F(r)})})},...k||{}}),Y=X(at),{user:O}=X(ot),M=f();h(M.breakpoints.only("xs"));const[D,V]=H(-1),[I,A]=H([]),[T,$]=H([]),[j,N]=H({}),[R,P]=H(""),F=(e,t,r)=>{A(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,{item:!0,xs:b,sm:v,md:x,sx:{width:"100%"},children:e(i,{bgcolor:"white",p:2,borderRadius:"8px",color:"#1E293B",children:[t(u,{required:d,sx:{marginBottom:2,textTransform:"capitalize"},children:c}),e(ao,{...S({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",{...E(),...Y.formRegister(a,{validate:(e,t)=>{if((e.length&&T.length)<=0&&d)return"O campo de arquivo é obrigatório"}})}),e(ao,{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(ao,{width:"100%",marginTop:1,spacing:1,children:[I.map(r=>e(ao,{direction:"row",justifyContent:"space-between",border:"solid 1px #E2E8F0",borderRadius:2,p:1,children:[e(ao,{direction:"row",children:[t(ao,{direction:"row",justifyContent:"center",alignItems:"center",minWidth:30,pr:1.5,children:t(lo,{sx:{filter:"invert(42%) sepia(86%) saturate(2412%) hue-rotate(326deg) brightness(86%) contrast(102%)",transform:"scale(1.5)",width:30}})}),e(ao,{children:[t(o,{fontWeight:600,children:r.name}),t(o,{fontSize:14,children:co(r.size)})]})]}),t(l,{size:"small",startIcon:t(so,{}),variant:"contained",onClick:e=>{return t=r.id,void(Object.keys(j).includes(t.toString())&&fetch(`${p}/${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"})]})),D>0&&D<100&&t(g,{value:D,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 mo({name:a,tipoArquivo:s,title:c,required:d=!1,multiple:m=!1,apiURL:p,route:g="",sizeLimit:x=4,xs:C=12,sm:w,md:k}){const S=X(at),{user:E}=X(ot),Y=f(),O=h(Y.breakpoints.only("xs")),[M,D]=H([]),[V,I]=H([]),[A,T]=H({}),[$,j]=H(""),N=G(e=>{const t=e.target.files,r=Object.keys(t).map(e=>t[e]);D([...M,...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(p,{method:"POST",body:n,headers:{Authorization:`Bearer ${E?E.token:""}`}}).then(e=>{e.ok?e.json().then(e=>{if(e.status&&200===e.status.status){const t=te(e,g,e)[0].coSeqArquivo;S.setFilesUid(e=>[...e,{CO_SEQ_ARQUIVO:t,CO_TIPO_ARQUIVO:parseInt(s)}]),I(e=>[...e,r]);const n={};n[r]=t,T(e=>({...e,...n}))}else R(r)}):R(r)}).catch(e=>{R(r)}),{id:r,name:e.name,loading:!0,error:!1,file:e}})])},[M,S]),R=(e,t,r)=>{D(M.filter(t=>t.id!==e)),r&&S.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;M.forEach(t=>{e.items.add(t.file)}),S?.formSetValue(a,e.files)},[M,S,a]),J(()=>()=>{S.setFilesUid(e=>e.filter(e=>e.CO_TIPO_ARQUIVO!==parseInt(s)))},[]),e(n,{item:!0,xs:C,sm:w,md:k,sx:{width:"100%"},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:m,...S?.formRegister(a,{validate:(e,t)=>{if((e.length&&V.length)<=0&&d)return"O campo de arquivo é obrigatório"}}),onChange:N,accept:".pdf",style:{display:"none"}}),t("input",{id:a+"foto",type:"file",capture:"environment",multiple:m,...S?.formRegister(a,{validate:(e,t)=>{if((e.length&&V.length)<=0&&d)return"O campo de arquivo é obrigatório"}}),onChange:N,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:!m&&M.length>=1?t(l,{disabled:!0,variant:"contained",disableElevation:!0,startIcon:t(ye,{}),component:"span",sx:{textTransform:"none"},fullWidth:!0,children:"Escolher Documento"}):t("label",{htmlFor:a,children:t(l,{variant:"contained",disableElevation:!0,startIcon:t(ye,{}),component:"span",sx:{textTransform:"none"},fullWidth:!0,children:"Escolher Documento"})})}),t(i,{sx:{width:"100%"},children:!m&&M.length>=1?t(l,{disabled:!0,variant:"contained",disableElevation:!0,startIcon:t(fe,{}),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(fe,{}),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 ",M.length," arquivo",M.length>1&&"s"]}),M.length>0&&t(y,{component:b,children:t(ao,{direction:"column",children:M.map(r=>e(ao,{direction:"row",justifyContent:"space-between",padding:.5,children:[t(i,{children:e(ao,{direction:"row",spacing:2,children:[V.includes(r.id)?t(ge,{sx:{fill:"#06d6a0"}}):t(v,{size:22,sx:{color:"black"}}),t(be,{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(A).includes(t.toString())&&fetch(`${p}/${A[t]}`,{method:"DELETE",headers:{Authorization:`Bearer ${E?.token}`}}).then(e=>{e.ok||R(t,!0,A[t]),200===e.status&&R(t,!0,A[t])}).catch(e=>console.log(e)));var t},startIcon:t(he,{}),children:"Remover"})})]},r.name))})}),$&&e(r,{children:[t(o,{variant:"caption",color:"#e53935",fontWeight:600,fontSize:14,paddingTop:2,children:$}),t("br",{})]}),te(S?.errors,a)&&t(o,{variant:"caption",color:"#e53935",fontWeight:600,fontSize:14,children:"* O campo de arquivo é obrigatório"})]})]})}function po({defaultChecked:r=!1,...n}){const i=X(at);J(()=>{i?.formSetValue(n.name,r)},[]);const l=Z(()=>n.overrideYes||"Sim",[n.overrideYes]),c=Z(()=>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 fo=/*#__PURE__*/U.memo(po);function ho({invert:e=!1,hasCheckValue:n=!1,...o}){const i=X(at);return J(()=>()=>{(n?e:i.formWatch(o.switchId)===e)&&o.unregisterNameList.forEach(e=>i.formUnregister(e))},[o.unregisterNameList]),t(r,{})}function go({invert:n=!1,checkValue:o,...i}){const a=X(at);return t(r,{children:(o?a?.formWatch(i.switchId)===o!==n:a?.formWatch(i.switchId)!==n)&&e(r,{children:[t(ho,{switchId:i.switchId,unregisterNameList:i.unregisterNameList,hasCheckValue:!!o,invert:o?a?.formWatch(i.switchId)===o!==n:n}),i.children]})})}const yo=/*#__PURE__*/U.forwardRef(function(e,r){const{onChange:n,onMask:o,maskValue:i,setMaskValue:a,watchValue:l,imaskConfig:s,...c}=e,[d,u]=H(s.mask);delete c.value;const m=Q(null),[p,f]=H(""),h=X(at);return J(()=>{l&&f(l)},[l]),J(()=>{h.formSetValue(c.name,m.current.element.value)},[p]),delete c.watchValue,t(xe,{...c,mask:d,value:p,ref:m,inputRef:r,onChange:e=>{},onAccept:(e,t)=>{f(e),t.updateValue(),o&&o(e,u)},...s})});function bo(e){const n=X(at),[o,i]=H("");return t(r,{children:t(m,{...e.formConfig,onInput:t=>{n.formSetValue(e.formConfig.name,t.target.value)},InputProps:{inputComponent:yo,inputProps:{onMask:e.onMask,maskValue:o,setMaskValue:i,watchValue:e.watchValue,imaskConfig:e.imaskConfig}},disabled:e.disabled,fullWidth:!0})})}function vo({type:r="input",numberMask:o="000000000000000",xs:i=12,sm:a,inputMinLength:l=1,inputMaxLength:s=255,defaultValue:c="",md:d,disabled:p=!1,watchValue:f,...h}){const g=X(at);return J(()=>{void 0!==f&&g.formSetValue(h.name,f)},[f]),e(n,{item:!0,xs:i,sm:a,md:d,children:[h.title&&t(u,{htmlFor:"campo",required:h.required,children:h.title}),(()=>{const e={fullWidth:!0,size:"small",placeholder:h.customPlaceholder?h.customPlaceholder:h.title},n=h.name,i=te(g?.errors,h.name),a=i?.message,d=!!i,u={...g?.formRegister(n,{validate:(e,t)=>{const n=e??"";if(n.length<=0&&h.required)return"Este campo é obrigatório";if(h.customValidate){const e=h.customValidate(n,t);if(e)return e}if("cnpj"===r){if(n.length<18&&h.required)return"O CNPJ precisa ter no mínimo 14 dígitos"}else if("cpf"===r){if(n.length<14&&h.required)return"O CPF precisa ter no mínimo 11 dígitos"}else if("sei"===r){if(n.length<22&&h.required)return"O Número SEI precisa ter no mínimo 19 dígitos"}else if("cep"===r){if(n.length<9&&h.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&&h.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)&&h.required)return"O e-mail inserido não é valido"}else if("cpf_cnpj"===r){if((n.length<14||n.length>14&&n.length<18)&&h.required)return"O CPF/CNPJ precisa ter no mínimo 11/14 dígitos"}else if("phone"===r&&n.length<14&&h.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(m,{...u,defaultValue:c,disabled:p});case"password":return t(m,{...u,type:"password",disabled:p});case"number":return t(bo,{formConfig:u,defaultValue:c,imaskConfig:{mask:o},watchValue:f,disabled:p});case"cep":return t(bo,{formConfig:u,defaultValue:c,imaskConfig:{mask:"00000-000"},watchValue:f,disabled:p});case"phone":return t(bo,{formConfig:u,defaultValue:c,imaskConfig:{mask:"(00) [9]0000-0000"},watchValue:f,disabled:p});case"sei":return t(bo,{formConfig:u,defaultValue:c,imaskConfig:{mask:"00000-00000000/0000-00"},watchValue:f,disabled:p});case"cpf_cnpj":return t(bo,{formConfig:u,defaultValue:c,imaskConfig:{mask:"000.000.000-00[0]"},onMask:(e,t)=>{t(e.length>14?"00.000.000/0000-00":"000.000.000-00[0]")},watchValue:f,disabled:p});case"cpf":return t(bo,{formConfig:u,defaultValue:c,imaskConfig:{mask:"000.000.000-00"},watchValue:f,disabled:p});case"cnpj":return t(bo,{formConfig:u,defaultValue:c,imaskConfig:{mask:"00.000.000/0000-00"},watchValue:f,disabled:p});case"rg":return t(bo,{formConfig:u,defaultValue:c,imaskConfig:{mask:"00000[000000]"},watchValue:f,disabled:p})}})()]})}var xo=/*#__PURE__*/U.memo(vo);function Co({name:r,required:o=!1,title:i,defaultChecked:l=!1,xs:s=12,unregisterNameList:c,sm:d,md:u,...m}){const p=`${r}-switch`;return e(n,{item:!0,xs:s,sm:d,md:u,children:[i&&t(ve,{required:o,sx:{textTransform:"capitalize"},children:i}),e(a,{direction:"row",children:[t(fo,{name:p,defaultChecked:l}),t(go,{switchId:p,unregisterNameList:c,children:t(vo,{name:"ddd",type:"input"})})]})]})}function wo({name:r,required:o=!1,title:i,customPlaceholder:a,url:l,xs:s=12,sm:c,md:d,dataPath:u=""}){const p=X(at),{user:f}=X(ot),[h,g]=H([]);Ce(`autocomplete-${r}`,()=>fetch(l,{headers:{Authorization:`Bearer ${f?f.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)=>{p?.formSetValue(r,t?t.id:""),p?.formTrigger(r)},[p,r]);return e(n,{item:!0,xs:s,sm:c,md:d,children:[i&&t(ve,{required:o,children:i}),t("input",{type:"text",...p?.formRegister(r,{validate:(e,t)=>{if(e.length<=0&&o)return"Este campo é obrigatório"}}),hidden:!0}),t(C,{options:h,isOptionEqualToValue:(e,t)=>e.id===t.id,onChange:b,renderInput:e=>t(m,{...e,placeholder:a,size:"small",error:!!te(p?.errors,r),helperText:te(p?.errors,r)?.message})})]})}let ko=!0;function So({name:r,url:o,title:i,customLoadingText:a,shouldRefetch:l=!0,required:s=!1,defaultValue:c,route:d="",onChange:p=()=>{},xs:f=12,sm:h,watchValue:g,md:y,disabled:b=!1}){const v=X(at),[x,w]=H(!0),[k,S]=H([]),[E,Y]=H("Carregando..."),[O,M]=H(null),[D,V]=H(null),[I,A]=H(null),{user:T}=X(ot),$=function(e,t,n=!1){try{return Promise.resolve(function(o,i){try{var a=(A(null),Promise.resolve(fetch(e,{method:"GET",headers:{Authorization:`Bearer ${T?.token}`}})).then(function(e){if(!e.ok){const t=401===e.status?"Sessão expirada. Faça login novamente.":403===e.status?"Acesso negado. Verifique suas permissões.":e.status>=500?"Erro interno do servidor. Tente novamente mais tarde.":"Erro ao carregar dados";return A(t),Y(t),void w(!1)}return Promise.resolve(e.json()).then(function(e){const o=te(e,t,e);if(n){const e=o.filter(e=>e.id===c);e.length>0?(S(o),w(!1),v.formSetValue(r,c),M(e[0])):(A("Valor padrão inválido"),Y("Erro ao carregar dados. Valor inválido"),w(!1))}else S(o),w(!1)})}))}catch(e){return i(e)}return a&&a.then?a.then(void 0,i):a}(0,function(e){console.error("Network error:",e),A("Erro de conexão. Verifique sua internet e tente novamente."),Y("Erro de conexão. Verifique sua internet e tente novamente."),w(!1)}))}catch(e){return Promise.reject(e)}};function j(){(c||!l)&&k.length>0||(w(!0),S([]),a&&Y(a),$(o,d,!1))}return J(()=>{c&&$(o,d,!0)},[]),J(()=>{g&&ko&&(V(g),v.formSetValue(r,g.id),p(g.id))},[g]),c&&k.length<=0&&!O?t(n,{item:!0,xs:f,sm:h,md:y,children:t(m,{size:"small",fullWidth:!0,placeholder:E,disabled:!0})}):e(n,{item:!0,xs:f,sm:h,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:D,loading:x,loadingText:E,options:k,defaultValue:O,getOptionDisabled:e=>e?.disabled??!1,isOptionEqualToValue:(e,t)=>e.id===t.id,onChange:(e,t)=>function(e){if(ko=!1,e)return V(e),v.formSetValue(r,e.id),void p(e.id);V(null),v.formSetValue(r,""),p(void 0)}(t),renderInput:e=>t(m,{...e,size:"small",fullWidth:!0,placeholder:i,onFocus:j,error:!!te(v?.errors,r)||!!I,helperText:te(v?.errors,r)?.message||I}),sx:{bgcolor:"white"},size:"small",fullWidth:!0,disabled:b})]})}let Eo=!0;function Yo({name:r,title:o,required:i=!1,list:a,defaultValue:l,onChange:s=()=>{},xs:c=12,sm:d,watchValue:p,forceUpdate:f=!1,md:h}){const g=X(at),[y,b]=H(null);return J(()=>{l&&g?.formSetValue(r,l.id)},[]),J(()=>{p&&(Eo||f)?(b(p),g.formSetValue(r,p.id),s(p.id)):void 0===p&&(Eo||f)&&(b(null),g.formSetValue(r,void 0),s(void 0))},[p]),e(n,{item:!0,xs:c,sm:d,md:h,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(Eo=!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(m,{...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 Oo=!0;function Mo({name:r,url:o,title:i,customLoadingText:a,shouldRefetch:l=!0,required:s=!1,defaultValue:c,route:d="",onChange:p=()=>{},xs:f=12,sm:h,watchValue:g,md:y,disabled:b=!1}){const v=se(),[x,w]=H(!0),[k,S]=H([]),[E,Y]=H("Carregando..."),[O,M]=H(null),[D,V]=H(null),{user:I}=X(ot);function A(){(c||!l)&&k.length>0||(w(!0),S([]),a&&Y(a),fetch(o,{method:"GET",headers:{Authorization:`Bearer ${I?.token}`}}).then(e=>{e.ok?e.json().then(e=>{S(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?(S(te(e,d,e)),w(!1),v.setValue(r,c),M(t[0])):Y("Erro ao carregar dados. Valor inválido")})):Y("Erro ao carregar dados")})},[]),J(()=>{g&&Oo&&(V(g),v.setValue(r,g.id),p(g.id))},[g]),c&&k.length<=0&&!O?t(n,{item:!0,xs:f,sm:h,md:y,children:t(m,{size:"small",fullWidth:!0,placeholder:E,disabled:!0})}):e(n,{item:!0,xs:f,sm:h,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:D,loading:x,loadingText:E,options:k,defaultValue:O,getOptionDisabled:e=>e?.disabled??!1,isOptionEqualToValue:(e,t)=>e.id===t.id,onChange:(e,t)=>function(e){if(Oo=!1,e)return V(e),v.setValue(r,e.id),void p(e.id);V(null),v.setValue(r,""),p(void 0)}(t),renderInput:e=>t(m,{...e,size:"small",fullWidth:!0,placeholder:i,onFocus:A,error:!!te(v.formState.errors,r),helperText:te(v.formState.errors,r)?.message}),sx:{bgcolor:"white"},size:"small",fullWidth:!0,disabled:b})]})}const Do=/*#__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 m=Q(null),[p,f]=H(""),h=se();return J(()=>{s&&f(s)},[s]),J(()=>{h.setValue(c.name,m.current.element.value)},[p]),delete c.watchValue,t(xe,{...c,...o,mask:d,value:p,ref:m,inputRef:r,onChange:e=>{},onAccept:(e,t)=>{f(e),t.updateValue(),i&&i(e,u)}})});function Vo(e){const n=X(at),[o,i]=H("");return t(r,{children:t(m,{...e.formConfig,onInput:t=>{n.formSetValue(e.formConfig.name,t.target.value)},InputProps:{inputComponent:Do,inputProps:{maskProps:e.maskProps,onMask:e.onMask,maskValue:o,setMaskValue:i,watchValue:e.watchValue}},disabled:e.disabled,fullWidth:!0})})}function Io({type:r="input",numberMask:o="000000000000000",xs:i=12,sm:a,inputMinLength:l=1,inputMaxLength:s=255,defaultValue:c="",md:d,disabled:p=!1,watchValue:f,...h}){const g=se();return J(()=>{void 0!==f&&g.setValue(h.name,f)},[f]),e(n,{item:!0,xs:i,sm:a,md:d,children:[h.title&&t(u,{htmlFor:"campo",required:h.required,children:h.title}),(()=>{const e={fullWidth:!0,size:"small",placeholder:h.customPlaceholder?h.customPlaceholder:h.title},n=h.name,i=te(g?.formState.errors,h.name),a=i?.message,d=!!i,u={...g?.register(n,{validate:(e,t)=>{const n=e??"";if(n.length<=0&&h.required)return"Este campo é obrigatório";if("cnpj"===r){if(n.length<18&&h.required)return"O CNPJ precisa ter no mínimo 14 dígitos"}else if("cpf"===r){if(n.length<14&&h.required)return"O CPF precisa ter no mínimo 11 dígitos"}else if("sei"===r){if(n.length<22&&h.required)return"O Número SEI precisa ter no mínimo 19 dígitos"}else if("cep"===r){if(n.length<9&&h.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&&h.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)&&h.required)return"O e-mail inserido não é valido"}else if("cpf_cnpj"===r){if((n.length<14||n.length>14&&n.length<18)&&h.required)return"O CPF/CNPJ precisa ter no mínimo 11/14 dígitos"}else if("phone"===r&&n.length<14&&h.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(m,{...u,defaultValue:c,disabled:p});case"password":return t(m,{...u,type:"password",disabled:p});case"number":return t(Vo,{formConfig:u,defaultValue:c,maskProps:{mask:o},watchValue:f,disabled:p});case"cep":return t(Vo,{formConfig:u,defaultValue:c,maskProps:{mask:"00000-000"},watchValue:f,disabled:p});case"phone":return t(Vo,{formConfig:u,defaultValue:c,maskProps:{mask:"(00) [#]0000-0000",definitions:{"#":/^9$/}},watchValue:f,disabled:p});case"sei":return t(Vo,{formConfig:u,defaultValue:c,maskProps:{mask:"00000-00000000/0000-00"},watchValue:f,disabled:p});case"cpf_cnpj":return t(Vo,{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:f,disabled:p});case"cpf":return t(Vo,{formConfig:u,defaultValue:c,maskProps:{mask:"000.000.000-00"},watchValue:f,disabled:p});case"cnpj":return t(Vo,{formConfig:u,defaultValue:c,maskProps:{mask:"00.000.000/0000-00"},watchValue:f,disabled:p});case"rg":return t(Vo,{formConfig:u,defaultValue:c,maskProps:{mask:"00000[000000]"},watchValue:f,disabled:p})}})()]})}var Ao=/*#__PURE__*/U.memo(Io);function To({name:r,required:o=!1,title:i,customPlaceholder:a,defaultValue:l="",xs:s=12,sm:c,watchValue:d="",inputMinLength:u=3,inputMaxLength:p=255,md:f,...h}){const g=se();return J(()=>{g.setValue(r,d)},[d]),e(n,{item:!0,xs:s,sm:c,md:f,children:[i&&t(ve,{required:o,sx:{textTransform:"capitalize"},children:i}),t(m,{multiline:!0,fullWidth:!0,minRows:3,defaultValue:l,...g.register(r,{validate:(e,t)=>o&&e.length<=0?"Este campo é obrigatório":e.length>p?`Limite máximo de ${p} 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 $o({name:r,required:o=!1,title:i,customPlaceholder:a,defaultValue:l="",xs:s=12,sm:c,watchValue:d="",inputMinLength:u=3,inputMaxLength:p=255,md:f,...h}){const g=X(at);return J(()=>{g.formSetValue(r,d)},[d]),e(n,{item:!0,xs:s,sm:c,md:f,children:[i&&t(ve,{required:o,sx:{textTransform:"capitalize"},children:i}),t(m,{multiline:!0,fullWidth:!0,minRows:3,defaultValue:l,...g.formRegister(r,{validate:(e,t)=>o&&e.length<=0?"Este campo é obrigatório":e.length>p?`Limite máximo de ${p} 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 jo({name:r,required:o=!1,xs:l=12,sm:s,md:d}){const u=X(at),p=`switch-${r}`;return J(()=>{u.formWatch(p)||u.formSetValue(r,void 0)},[u]),t(n,{item:!0,xs:l,sm:s,md:d,children:e(a,{direction:"row",children:[t(i,{children:t(c,{size:"small",...u.formRegister(p),sx:{paddingLeft:0,margin:0}})}),u.formWatch(p)?t(m,{size:"small",...u.formRegister(r,{validate:(e,t)=>{if(!0===u.formWatch(p)&&(!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(m,{size:"small",disabled:!0,placeholder:"Outro"})]})})}const No=(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 Ro({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=X(at),m=Q(null),p=f(),[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(()=>{m.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:h(p.breakpoints.only("xs"))?"bottom":"static",activeStep:g,sx:{paddingTop:2,paddingBottom:4,paddingX:0},backButton:t(l,{variant:"contained",startIcon:t(we,{}),onClick:()=>{y(e=>e-1)},disabled:0===g,sx:{textTransform:"none"},children:"Voltar"}),nextButton:g<v-1?t(l,{variant:"contained",endIcon:t(ke,{}),onClick:function(){try{return r&&console.log(u.formGetValues()),Promise.resolve(u.formTrigger(No(u.formGetValues(),g))).then(function(e){e?y(e=>e+1):Ye("Formulário incompleto! Verifique os campos marcados e tente novamente.",{type:"warning",theme:"light"})})}catch(e){return Promise.reject(e)}},sx:{textTransform:"none"},ref:m,children:"Próximo"}):t(i,{children:t(Ee,{variant:"contained",type:"submit",loading:u.submiting,loadingPosition:"start",startIcon:t(Se,{}),onClick:e=>function(e){try{return Promise.resolve(u.formTrigger(No(u.formGetValues(),g))).then(function(t){t||(e.preventDefault(),Ye("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 Po=/*#__PURE__*/U.memo(Ro);function Fo(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(Fo(n,t,r+(o+1)))}),o=e}else o=Fo(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 zo({optional:o=!1,title:l,prefix:s=0,optionalMessage:c,defaultChecked:d,...u}){const m=X(at),p=`switch-${s}`,f=(Array.isArray(u.children)?u.children:[u.children]).map((e,t)=>e&&Fo(e,s,t));return e(i,{children:[t(n,{item:!0,xs: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(fo,{name:p,defaultChecked:!o||d,overrideNo:u.overrideSwitchNo,overrideYes:u.overrideSwitchYes})})]})}),t(a,{spacing:2,children:o?m.formWatch(p)?t(n,{container:!0,spacing:1,children:f}):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:f})})]})}var Lo=/*#__PURE__*/U.memo(zo);let Bo={open:()=>{},close:()=>{},openReparented:()=>{},reparent:()=>t(r,{})};function Wo(){const[n,l]=H(!1),[s,c]=H(null),d=()=>l(!1);Q(null);const u=f(),m=h(u.breakpoints.up("sm")),[p,g]=H({}),[y,b]=H(-1321465654);return J(()=>{Bo.open=e=>{e&&c(e),b(-1321465654),l(!0)},Bo.reparent=(e,n)=>(g(o=>({...o,[n]:t(r,{children:e})})),t(r,{})),Bo.openReparented=e=>{b(e),c(null),l(!0)},Bo.close=d},[l]),t(r,{children:m?t(S,{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(Re,{sx:{transform:"scale(.9)"}})}),e(i,{overflow:"auto",maxHeight:"90vh",p:2,marginTop:4,borderTop:"solid 1px gray",bgcolor:"#F9F9F9",borderRadius:2,children:[s,p[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,p[y]]})]})})}function _o({customColor:e="#383838",customFontColor:r="white",...n}){const o=Pe(e);return t(l,{...n,sx:{bgcolor:o.toHexString(),color:Pe(r).toHexString(),":hover":{bgcolor:o.darken(10).toHexString()},boxShadow:"none",borderRadius:3,textTransform:"capitalize",paddingX:2},size:"small",children:n.children})}function qo({data:n=[],...o}){const[i,a]=U.useState(null),l=Boolean(i),s=()=>{a(null)};return e(r,{children:[t(_o,{...o.btProps,onClick:e=>{a(e.currentTarget)},children:o.children}),t(E,{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 Uo(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/g,"")}function Ko(e){return("string"!=typeof e?e.toString():e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim()}let Xo=[],Go=!1,Ho="",Jo=!1,Zo={},Qo="";function ei({mediaQueryLG:n,columns:o,emptyMsg:s={user:"Nenhum dado encontrado",public:"Nenhum dado encontrado"},dataPath:c="",tableName:d="Dados",csv:u,columnSize:m,action:p,useKC:y=!0,statusKeyName:v="",csvExcludeKeys:x=[],csvExcludeKeysCSV:C=[],csvExcludeKeysAll:w=[],csvCustomKeyNames:k={},csvExcludeValidate:S=(e,t)=>!1,csvButtonTitle:E="Salvar .CSV",csvNoZipText:Y="Salvar .CSV",csvAllButtonTitle:I="Salvar todos em CSV",removeQuotes:A=!1,normalize:T=!1,csvShowAllButton:$=!1,csvWithoutZip:j=!1,itemCount:N=10,csvUpper:W=!1,csvZipFileNamesKey:q="",generateCsvZip:U=!1,hideTitleCSV:K=!1,csvExcludeUpper:Z=[],multipleDataPath:re="",expandTextMaxLength:ne=50,collapsedSize:oe=53,customMargin:ie=4,customMarginMobile:le=0,filtersFunc:se,filters:ce=[],orderBy:de=[],customErrorMsg:ue,customTableStyle:me={},id:pe,initialData:fe=null,isLoading:he,alwaysExpanded:ge=!1}){const[ye,be]=H(null),[ve,xe]=H(fe),{user:Ce,userLoaded:we}=X(ot),[ke,Se]=H([]),[Ee,Ye]=H([]),[Oe,Me]=H(N),[Re,Pe]=H(0),[Fe,ze]=H(1),[Le,Be]=H(1);H("");const[We,_e]=H({}),[qe,Ue]=H({}),[Ke,Xe]=H({}),[Ge,He]=H("filterKey"),Je=f(),Ze=h(Je.breakpoints.only("xs")),Qe=Q(null),et=h(Je.breakpoints.up(2e3));Ho=`tableFilter_${pe}`,Qo=`tableFilterCache_${pe}`,Zo=se??{},localStorage.getItem(Qo)||localStorage.setItem(Qo,JSON.stringify(ce)),localStorage.getItem(Qo)!==JSON.stringify(ce)&&(localStorage.setItem(Qo,JSON.stringify(ce)),localStorage.removeItem(Ho));const tt=G(e=>{if(e.length<=0)return 1;let t=e.length/Oe;return t=t<1?1:t,Math.ceil(t)},[Oe]),rt=G(e=>Array.isArray(e)?e:"object"==typeof e?te(e,c):void 0,[]);J(()=>{if(ye||!rt(ve))return;const e=rt(ve);Se(e),Ye(e),ze(tt(e)),localStorage.getItem(Ho)&&dt(JSON.parse(localStorage.getItem(Ho)))},[Oe,ve,tt,ye]),J(()=>{Pe(Le-1)},[Le]);const nt=G((e,t)=>{Be(t)},[]),it=G(()=>{const e=Re*Oe;return ke.slice(e,e+Oe)},[ke,Oe,Re]),at=G((e,t=!1)=>{if(e.preventDefault(),ke.length<=0)return;const r=Object.keys(ke[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 Ne,i={};ke.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=>{S(e,t[e])&&(n=!1)}),n){const r=e.map(e=>{if("string"==typeof t[e]){let r=W?t[e].toUpperCase():t[e];return r=T?r.normalize("NFD").replace(/[\u0300-\u036f]/g,""):r,A?`${r}`:`"${r}"`}if("object"==typeof t[e]&&!Array.isArray(t[e])&&null!==t[e]){let r=lt(t[e]).slice(1,-1),n=W&&!Z.includes(e)?r.toUpperCase():r;return n=T?n.normalize("NFD").replace(/[\u0300-\u036f]/g,""):n,A?`${n}`:`"${n}"`}return t[e]}).join(",");a.push(r)}});const l=K?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=[];ke.forEach(t=>{let n=!0;if(r.forEach(e=>{S(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=W&&!Z.includes(e)?t[e].toUpperCase():t[e];return r=T?r.normalize("NFD").replace(/[\u0300-\u036f]/g,""):r,A?`${r}`:`"${r}"`}if("object"==typeof t[e]&&!Array.isArray(t[e])&&null!==t[e]){let r=lt(t[e]).slice(1,-1),n=W&&!Z.includes(e)?r.toUpperCase():r;return n=T?n.normalize("NFD").replace(/[\u0300-\u036f]/g,""):n,A?`${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()}},[ke]);function lt(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+": "+lt(n));return"["+t.join(" - ")+"]"}const st=G(e=>{if(e.preventDefault(),ke.length<=0)return;const t=Object.keys(ke[0]).filter(e=>!w.includes(e)),r=t.join(",")+"\n",n=ke.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=W&&!Z.includes(t)?e[t].toUpperCase():e[t];return r=T?r.normalize("NFD").replace(/[\u0300-\u036f]/g,""):r,A?`${r}`:`"${r}"`}if("object"==typeof e[t]&&!Array.isArray(e[t])&&null!==e[t]){let r=lt(e[t]).slice(1,-1),n=W&&!Z.includes(t)?r.toUpperCase():r;return n=T?n.normalize("NFD").replace(/[\u0300-\u036f]/g,""):n,A?`${n}`:`"${n}"`}return e[t]}).join(",")).join("\n"),o=r+n;var i=window.document.createElement("a");i.setAttribute("href","data:text/csv;charset=utf-8,%EF%BB%BF"+encodeURI(o)),i.setAttribute("download",`${u?.fileName}.csv`),i.click()},[ke]);function ct(){Se(Xo),Ye(Xo),ze(tt(Xo)),Pe(0),Be(1),localStorage.removeItem(Ho),He((new Date).getTime().toString())}function dt(e){if(!Xo)return;let t=JSON.parse(JSON.stringify(Xo));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?Ko(n)===Ko(e.value.id)&&r.push(t):Ko(n)===Ko(e.value)&&r.push(t)});break;case"contem":t.forEach(t=>{const n=te(t,e.keyName,"");n&&(e.useList?Ko(n).includes(Ko(e.value.id))&&r.push(t):Ko(n).includes(Ko(e.value))&&r.push(t))});break;case"tem um dos":t.forEach(t=>{const n=te(t,e.keyName,"");n&&e.value.map(e=>Ko(e.id)).includes(Ko(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=Zo[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=Zo[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=>{(Zo[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=Zo[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}),Se(t),ze(tt(t)),Pe(0),Be(1),localStorage.setItem(Ho,JSON.stringify(e)),Ye(t)}return J(()=>{const e=Re*Oe,t=ke.slice(e,e+Oe);let r={};t.forEach((e,t)=>{o.forEach(n=>{r[t]=!0===r[t]||(te(e,n?.keyName,"")??"Não Informado").toString().length>=ne})}),Ue(r)},[ke,Oe,Re]),J(()=>{console.log(Qe.current)},[Qe.current]),ye?t(i,{bgcolor:"#fff2c8",color:"#3e3129",padding:2,marginX:2,borderRadius:4,children:e(ee,{fontSize:24,textAlign:"center",fontFamily:"Inter",children:[403===ye.status&&"Acesso negado",500===ye.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"})]})})]})]})}):he?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})]}))}))]})}):!we&&y?t(g,{}):e(r,{children:[e(i,{marginX:Ze?le:ie,bgcolor:"white",p:2,borderRadius:6,...me,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(je,{InputProps:{startAdornment:t(Ae,{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 Se(Ee),void ze(tt(rt(ke)));const r=rt(ke),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))}Uo(e.toLowerCase()).includes(Uo(t.toLowerCase()))&&(o=!0)}),o&&n.push(e)}),Se(n),ze(tt(n)),Pe(0),Be(1)},fullWidth:!0,placeholder:`Pesquisar ${d}`}),ce.length>0&&t(l,{startIcon:t(F,{}),variant:"contained",onClick:e=>Bo.open(t(ti,{reset:ct,filtrar:dt,baseFilters:[...ce],filters:localStorage.getItem(Ho)?JSON.parse(localStorage.getItem(Ho)):[...ce]},Ge)),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(qo,{data:de.map(e=>({name:e.label,onClick:()=>function(e){let t=[...ke];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(Jo){if(n<o)return-1;if(n>o)return 1}else{if(n>o)return-1;if(n<o)return 1}return 0}),Jo=!Jo,Se(t)}(e)})),btProps:{startIcon:t(z,{}),fullWidth:!0},children:"Ordenar"}),t(l,{variant:"contained",fullWidth:!0,startIcon:t(Go?_:z,{}),sx:{backgroundColor:"#637082",":hover":{backgroundColor:"#3c4757"},textTransform:"capitalize",borderRadius:3,padding:{md:"0px 8px"}},onClick:function(){let e={};for(let t=0;t<N;t++)e[t]=!Go;Xe(e),_e(e),Go=!Go},children:Go?"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 ",Re*Oe+1,"-",Re*Oe+1+it().length-1," de ",ke.length]})})]})]}),localStorage.getItem(Ho)&&t(i,{display:"inline-flex",flexWrap:"wrap",padding:.5,borderRadius:4,marginBottom:1,children:JSON.parse(localStorage.getItem(Ho)??"[]").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(M,{onClick:e=>{let t=JSON.parse(localStorage.getItem(Ho)??"[]");t=t.map(e=>e.label===r.label?{...e,value:"",...e.value2?{value2:""}:{}}:e),dt(t)},size:"small",sx:{padding:0},children:t(De,{sx:{fill:"white"}})})]}))}),t(a,{spacing:.2,children:it().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:Ce?s.user:s.public})}):it().map((s,c)=>t(b,{sx:{padding:.5,backgroundColor:c%2==0?"#F8FAFC":"white",paddingTop:2,paddingBottom:ge?2:.5,borderTop:"solid 1.5px #E2E8F0",position:"relative"},elevation:0,children:e(Te,{container:!0,spacing:Ze?2:0,paddingX:2,rowSpacing:2,children:[o.map(o=>e(Te,{item:!0,xs:12,md:et?12/m*(o.size?o.size:1):n?n.all:12/m*(o.size?o.size:1),sx:{overflow:"hidden"},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(D,{in:ge||!0===We[c],collapsedSize:ge?"auto":oe,onExited:e=>Xe(e=>({...e,[c]:!1})),children:t(i,{sx:{wordWrap:"break-word",color:"#1E293B",fontSize:16},fontFamily:"Inter",children:o.customComponent?o.customComponent(te(s,o.keyName),s):e(r,{children:[t(i,{color:"transparent",sx:{pointerEvents:"none",userSelect:"none"},children:te(s,o.keyName,"")}),t(i,{position:"absolute",top:0,children:ge||Ke[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(Te,{item:!0,xs:12,md:et?12/m:n?n.action:12/m,children:t(a,{direction:"row",alignItems:"center",justifyContent:Ze?"start":"flex-end",sx:{height:"100%",paddingBottom:Ze?2:0},children:p(s)})}),qe[c]&&!ge&&t(a,{direction:"row",justifyContent:"flex-end",bottom:0,width:"100%",children:t(l,{onClick:e=>{_e(e=>({...e,[c]:!e[c]})),Xe(e=>({...e,[c]:!0}))},sx:{padding:0,color:"#637082",textTransform:"capitalize"},startIcon:t(We[c]?L:B,{}),children:We[c]?"Ver Menos":"Ver Mais"})})]})},c))}),it().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(Ve,{}),variant:"contained",size:"small",onClick:at,sx:{backgroundColor:"#5a88b0",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:Y}),$&&t(l,{startIcon:t(Ve,{}),variant:"contained",size:"small",onClick:st,sx:{backgroundColor:"#64748B",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:I}),t(l,{startIcon:t(Ve,{}),variant:"contained",size:"small",onClick:e=>at(e,!0),sx:{backgroundColor:"#22C55E",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:E})]})})]}),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=>Be(e=>e>1?e-1:1),sx:{bgcolor:"white",borderRadius:"50px",height:"40px",width:"40px",minWidth:0,border:"solid 1px #E2E8F0"},children:t(Ie,{sx:{transform:"scale(1.5) scaleX(-1)"}})}),t($e,{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:Fe,siblingCount:Ze?0:6,size:"large",onChange:nt,page:Le,shape:"circular",variant:"outlined",sx:{".MuiPagination-ul":{backgroundColor:"white",border:"solid 1px #E2E8F0",borderRadius:"50px",paddingX:.25,paddingY:.5}}}),t(l,{onClick:e=>Be(e=>e<Fe?e+1:Fe),sx:{bgcolor:"white",borderRadius:"50px",height:"40px",width:"40px",minWidth:0,border:"solid 1px #E2E8F0"},children:t(Ie,{sx:{transform:"scale(1.5)"}})})]})})]})}function ti({filters:r,baseFilters:n,filtrar:o,reset:s}){const[c,d]=H(r),[u,m]=H(!1),[p,f]=U.useState(null),h=Boolean(p);return e(i,{width:{xs:"inherit",md:850},children:[t(E,{open:h,onClose:()=>{f(null)},anchorEl:p,children:n.map(e=>t(Y,{onClick:t=>{var r;r=e,d(e=>[...e,r]),f(null)},children:e.label}))}),e(a,{direction:"row",justifyContent:"space-between",children:[t(ee,{fontWeight:700,fontSize:18,children:"Filtrar"}),t(l,{startIcon:t(W,{}),sx:{textTransform:"capitalize"},onClick:e=>{s(),Bo.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(ri,{filterValue:e,setReset:m,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(ri,{filterValue:e,setReset:m,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(Ae,{}),sx:{textTransform:"capitalize"},onClick:e=>{o(c),Bo.close()},children:"Filtrar"})})]})}function ri({filterValue:r,setDt:n,idx:o}){const[i,l]=H(r.operator),[s,c]=H(r),d=f(),u=h(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(A,{sx:{width:"100%"},children:[u&&t(ee,{children:r.label}),t(T,{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(ni,{filterValue:r,operator:s.operator,onChange:(e,t="value")=>{c(r=>({...r,[t]:e}))}})]})}function ni({filterValue:n,operator:o,onChange:a}){switch(n.type){case"number":return t(je,{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(je,{...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(je,{...e,size:"small",placeholder:"Escolha um valor",fullWidth:!0,sx:{bgcolor:"white"}}),fullWidth:!0})})}return t(je,{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(je,{...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(je,{...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(je,{...e,size:"small",fullWidth:!0})})]})}}return t(r,{})}var oi=/*#__PURE__*/U.memo(ei);function ii({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 ai({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 li=(e,t)=>{if(e.length<=0)return 1;let r=e.length/t;return r=r<1?1:r,Math.ceil(r)};function si(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/g,"")}function ci(e){return("string"!=typeof e?e.toString():e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim()}function di({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?ci(n)===ci(e.value.id)&&t.push(r):ci(n)===ci(e.value)&&t.push(r)});break;case"contem":d.forEach(r=>{const n=te(r,e.keyName,"");n&&(e.useList?ci(n).includes(ci(e.value.id))&&t.push(r):ci(n).includes(ci(e.value))&&t.push(r))});break;case"tem um dos":d.forEach(r=>{const n=te(r,e.keyName,"");n&&e.value.map(e=>ci(e.id)).includes(ci(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=>{const o=(r[e.customFunc](te(n,e.keyName,""))??[]).filter(e=>void 0!==e&&""!==e);o.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(li(d,c)),o(0),l(1),localStorage.setItem(n,JSON.stringify(e)),a(d)}function ui({order:e,list:t,orderAsc:r=!1}){const n=Fe(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});return n}function mi({filters:r,baseFilters:n,filtrar:o,reset:s}){const[c,d]=H(r),[u,m]=H(!1),[p,f]=U.useState(null),h=Boolean(p);return e(i,{width:{xs:"inherit",md:850},children:[t(E,{open:h,onClose:()=>{f(null)},anchorEl:p,children:n.map(e=>t(Y,{onClick:t=>{var r;r=e,d(e=>[...e,r]),f(null)},children:e.label}))}),e(a,{direction:"row",justifyContent:"space-between",children:[t(ee,{fontWeight:700,fontSize:18,children:"Filtrar"}),t(l,{startIcon:t(W,{}),sx:{textTransform:"capitalize"},onClick:e=>{s(),Bo.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(pi,{filterValue:e,setReset:m,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(pi,{filterValue:e,setReset:m,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(Ae,{}),sx:{textTransform:"capitalize"},onClick:e=>{o(c),Bo.close()},children:"Filtrar"})})]})}function pi({filterValue:r,setDt:n,idx:o}){const[i,l]=H(r.operator),[s,c]=H(r),d=f(),u=h(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(A,{sx:{width:"100%"},children:[u&&t(ee,{children:r.label}),t(T,{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(fi,{filterValue:r,operator:s.operator,onChange:(e,t="value")=>{c(r=>({...r,[t]:e}))}})]})}function fi({filterValue:n,operator:o,onChange:a}){switch(n.type){case"number":return t(je,{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(je,{...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(je,{...e,size:"small",placeholder:"Escolha um valor",fullWidth:!0,sx:{bgcolor:"white"}}),fullWidth:!0})})}return t(je,{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(je,{...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(je,{...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(je,{...e,size:"small",fullWidth:!0})})]})}}return t(r,{})}let hi=!1,gi="",yi={},bi="";function vi({mediaQueryLG:n,columns:o,csvConfig:s,fetchFunc:c,emptyMsg:d={user:"Nenhum dado encontrado",public:"Nenhum dado encontrado"},dataPath:u="",tableName:m="Dado",columnSize:p,action:y,useKC:v=!0,itemCount:x=10,expandTextMaxLength:C=50,collapsedSize:w=53,customMargin:k=4,customMarginMobile:S=0,filtersFunc:E,filters:Y=[],orderBy:O=[],customErrorMsg:I,customTableStyle:A={},id:T,initialData:$=null,isExpandable:j=!0,alwaysExpanded:N=!1}){const[R,P]=H(!1),[W,q]=H(null),[U,K]=H($),{user:Z,userLoaded:re}=X(ot),[ne,oe]=H([]),[ie,ae]=H([]),[le,se]=H(x),[ce,de]=H(0),[ue,me]=H(1),[pe,fe]=H(1),[he,ge]=H({}),[ye,be]=H({}),[ve,xe]=H({}),[Ce,we]=H("filterKey"),ke=f(),Se=h(ke.breakpoints.only("xs")),Ee=Q(U),Ye=Q("true"===localStorage.getItem(`order-${T}`)||!1),Oe=h(ke.breakpoints.up(2e3));gi=`tableFilter_${T}`,bi=`tableFilterCache_${T}`,yi=E??{},localStorage.getItem(bi)||localStorage.setItem(bi,JSON.stringify(Y)),localStorage.getItem(bi)!==JSON.stringify(Y)&&(localStorage.setItem(bi,JSON.stringify(Y)),localStorage.removeItem(gi)),J(()=>{q(null),c&&(!re&&v||(P(!0),c().then(e=>e.ok?e.json().then(e=>{if(204===e.statusCode)K({body:{data:[]}}),Ee.current=[];else if(403===e.statusCode)q({status:e.statusCode});else{let t=u?te(e,u):e;if(t&&Array.isArray(t)){let e=t;if(localStorage.getItem(`order-data-${T}`))try{e=ui({order:JSON.parse(localStorage.getItem(`order-data-${T}`)),list:t,orderAsc:Ye.current})}catch(e){console.log(e)}else O.length>0&&(e=ui({order:O[0],list:t,orderAsc:Ye.current}));K(e),Ee.current=JSON.parse(JSON.stringify(e))}else K({body:{data:[]}}),Ee.current=[]}P(!1)}):(q({status:500}),void P(!1))).catch(e=>{q({status:500})})))},[re,c]);const Me=G(e=>Array.isArray(e)?e:"object"==typeof e?te(e,u):void 0,[]);J(()=>{if(R||W||!Me(U))return;let e=Me(U);oe(e),ae(e),me(li(e,le)),localStorage.getItem(gi)&&di({filterData:JSON.parse(localStorage.getItem(gi)),filtersFuncData:yi,localTableName:gi,setCurrentPage:de,setList:oe,setListClone:ae,setListPage:fe,setPagCount:me,startData:Ee.current,itemsCount:le})},[le,R,U,W]),J(()=>{de(pe-1)},[pe]);const Ne=G((e,t)=>{fe(t)},[]),Re=G(()=>{const e=ce*le;return ne.slice(e,e+le)},[ne,le,ce]);function Pe(){oe(Ee.current),ae(Ee.current),me(li(Ee.current,le)),de(0),fe(1),localStorage.removeItem(gi),we((new Date).getTime().toString())}J(()=>{const e=ce*le,t=ne.slice(e,e+le);let r={};t.forEach((e,t)=>{o.forEach(n=>{r[t]=!0===r[t]||(te(e,n.keyName,"")??"Não Informado").toString().length>=C})}),be(r)},[ne,le,ce]);const Fe=(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=ze.utils.json_to_sheet(n),i=ze.utils.book_new();return ze.utils.book_append_sheet(i,o,t.fileName),ze.writeFile(i,`${t.fileName}.xlsx`),Promise.resolve()}catch(e){return Promise.reject(e)}}(e,{...s,...t?{downloadAll:!0}:{}},JSON.parse(localStorage.getItem(gi)??"[]")||[])},Le=e=>{di({filterData:e,filtersFuncData:yi,localTableName:gi,setCurrentPage:de,setList:oe,setListClone:ae,setListPage:fe,setPagCount:me,startData:Ee.current,itemsCount:le})};return W?t(ii,{customErrorMsg:I,error:W}):R?t(ai,{tableName:m}):!re&&v?t(g,{}):e(r,{children:[e(i,{marginX:Se?S:k,bgcolor:"white",p:2,borderRadius:6,...A,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(je,{InputProps:{startAdornment:t(Ae,{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 oe(ie),void me(li(Me(ne),le));const r=[];ie.forEach(e=>{const n=[];if(Object.keys(e).map(t=>{let r=te(e,t,"")??"";"number"==typeof r&&(r=r.toString()),"string"==typeof r&&n.push(r)}),n.length<=0)return;let o=!1;n.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))}si(e.toLowerCase()).includes(si(t.toLowerCase()))&&(o=!0)}),o&&r.push(e)}),oe(r),me(li(r,le)),de(0),fe(1)},fullWidth:!0,placeholder:`Pesquisar ${m}`}),t(l,{startIcon:t(F,{}),variant:"contained",onClick:e=>Bo.open(t(mi,{reset:Pe,filtrar:e=>Le(e),baseFilters:[...Y],filters:localStorage.getItem(gi)?JSON.parse(localStorage.getItem(gi)):[...Y]},Ce)),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(qo,{data:O.map(e=>({name:e.label,onClick:()=>(e=>{Ye.current=!Ye.current;const t=ui({order:e,list:ne,orderAsc:Ye.current});localStorage.setItem(`order-${T}`,Ye.current.toString()),localStorage.setItem(`order-data-${T}`,JSON.stringify(e)),oe(t)})(e)})),btProps:{startIcon:t(z,{}),fullWidth:!0},children:"Ordenar"}),j&&!N&&t(l,{variant:"contained",fullWidth:!0,startIcon:t(hi?_:z,{}),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]=!hi;xe(e),ge(e),hi=!hi},children:hi?"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 ",m,"s"]}),t(a,{justifyContent:"center",children:e(ee,{children:["Exibindo ",ce*le+1,"-",ce*le+1+Re().length-1," de ",ne.length]})})]})]}),localStorage.getItem(gi)&&t(i,{display:"inline-flex",flexWrap:"wrap",padding:.5,borderRadius:4,marginBottom:1,children:JSON.parse(localStorage.getItem(gi)??"[]").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(M,{onClick:e=>{let t=JSON.parse(localStorage.getItem(gi)??"[]");t=t.map(e=>e.label===r.label?{...e,value:"",...e.value2?{value2:""}:{}}:e),Le(t)},size:"small",sx:{padding:0},children:t(De,{sx:{fill:"white"}})})]}))}),t(a,{spacing:.2,children:Re().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:Z?d.user:d.public})}):Re().map((s,c)=>t(b,{sx:{padding:.5,backgroundColor:c%2==0?"#F8FAFC":"white",paddingTop:2,paddingBottom:N?2:.5,borderTop:"solid 1.5px #E2E8F0",position:"relative"},elevation:0,children:e(Te,{container:!0,spacing:Se?2:0,paddingX:2,rowSpacing:2,children:[o.map(o=>e(Te,{item:!0,xs:12,md:Oe?12/p*(o.size?o.size:1):n?n.all:12/p*(o.size?o.size:1),sx:{overflow:"hidden"},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(D,{in:N||!0===he[c],collapsedSize:N?"auto":w,onExited:e=>xe(e=>({...e,[c]:!1})),children:t(i,{sx:{wordWrap:"break-word",color:"#1E293B",fontSize:16},fontFamily:"Inter",children:o.customComponent?o.customComponent(te(s,o.keyName),s):e(r,{children:[t(i,{color:"transparent",sx:{pointerEvents:"none",userSelect:"none"},children:te(s,o.keyName,"")}),t(i,{position:"absolute",top:0,children:N||ve[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(Te,{item:!0,xs:12,md:Oe?12/p:n?n.action:12/p,children:t(a,{direction:"row",alignItems:"center",justifyContent:Se?"start":"flex-end",sx:{height:"100%",paddingBottom:Se?2:0},children:y(s)})}),ye[c]&&!N&&t(a,{direction:"row",justifyContent:"flex-end",bottom:0,width:"100%",children:t(l,{onClick:e=>{ge(e=>({...e,[c]:!e[c]})),xe(e=>({...e,[c]:!0}))},sx:{padding:0,color:"#637082",textTransform:"capitalize"},startIcon:t(he[c]?L:B,{}),children:he[c]?"Ver Menos":"Ver Mais"})})]})},c))}),Re().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(gi)??"[]").filter(e=>e.value||"entre"===e.operator&&(e.value||e.value2)).length>0&&t(l,{startIcon:t(Ve,{}),variant:"contained",size:"small",onClick:e=>Fe(ne),sx:{backgroundColor:"#a5a5a5",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:"Baixar Filtrados"}),t(l,{startIcon:t(Ve,{}),variant:"contained",size:"small",onClick:e=>Fe(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=>fe(e=>e>1?e-1:1),sx:{bgcolor:"white",borderRadius:"50px",height:"40px",width:"40px",minWidth:0,border:"solid 1px #E2E8F0"},children:t(Ie,{sx:{transform:"scale(1.5) scaleX(-1)"}})}),t($e,{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:ue,siblingCount:Se?0:6,size:"large",onChange:Ne,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=>fe(e=>e<ue?e+1:ue),sx:{bgcolor:"white",borderRadius:"50px",height:"40px",width:"40px",minWidth:0,border:"solid 1px #E2E8F0"},children:t(Ie,{sx:{transform:"scale(1.5)"}})})]})})]})}var xi=/*#__PURE__*/U.memo(vi);const Ci=Le(()=>import("./Map-31d95a26.js").then(e=>e.Map),{ssr:!1});function wi({links:n,title:s,img:c,pos:d="fixed",next:u=!0,el:m,menuItems:p,paddingBottom:f=0,logoutMsg:h="Sair",logoutFunc:g,...y}){let b;u&&(b=Ge());const{user:v,login:x,logout:C,type:w}=X(ot),[k,S]=H(null),[O,D]=H(null),V=Boolean(k),I=Boolean(O),[A,T]=H(!1),N=G(e=>{S(e.currentTarget)},[]),R=G(()=>{S(null)},[]),P=G((e,t)=>{T(!0),S(null),b?b.push({pathname:t}).finally(()=>T(!1)):T(!1)},[b]);return e(r,{children:[e(i,{position:d,sx:{width:"100%",zIndex:100},children:[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(Xe,{href:"/",children:u?t(Ke,{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(M,{onClick:N,children:t(_e,{})}),t(E,{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,T(!0),void(b?b.push({pathname:r}).finally(()=>T(!1)):T(!1));var r},sx:{textTransform:"capitalize"},children:e.name})},`navigation${e.path}`))}),e(a,{direction:"row",spacing:2,children:[t(i,{children:m}),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(E,{open:I,onClose:e=>D(null),anchorEl:O,disableScrollLock:!0,transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"},sx:{".MuiMenu-paper":{borderRadius:4}},children:[p,t(Y,{onClick:function(e){try{function t(){C()}D(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(We,{sx:{fill:"#545454"}}),t(o,{textTransform:"capitalize",children:h})]})})]})]}),e(a,{direction:"row",spacing:.4,alignItems:"center",onClick:e=>D(e.currentTarget),sx:{userSelect:"none"},children:[t(o,{children:"Olá,"}),t(o,{fontWeight:600,children:v?.given_name}),t(Be,{})]})]}):t(l,"govbr"===w?{variant:"contained",size:"small",startIcon:t(qe,{}),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(qe,{}),onClick:x,sx:{color:"white",textTransform:"inherit",borderRadius:50,paddingX:2},children:t(o,{fontWeight:600,fontSize:15,padding:.4,children:"Entrar"})})]})]})]})}),A&&t(Ue,{})]}),t(i,{paddingBottom:f})]})}function ki(e,t){return"/"===t?e===t:e.startsWith(t)}function Si({links:n,title:s,img:c,pos:d="fixed",next:u=!0,el:m,menuItems:p,color:f="blue",route:h="/teste/89",paddingBottom:g=0,logoutMsg:y="Sair",logoutFunc:b,...v}){let x;u&&(x=Ge());const{user:C,login:w,logout:k,type:S}=X(ot),[O,D]=H(null),[V,I]=H(null),A=Boolean(O),T=Boolean(V),[N,R]=H(!1),P=G(e=>{D(e.currentTarget)},[]),F=G(()=>{D(null)},[]),z=G((e,t)=>{R(!0),D(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($,{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(Xe,{href:"/",children:u?t(Ke,{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?ki(x?.pathname??"",e.path)?`solid 4px ${f}`:"":ki(h,e.path)?`solid 4px ${f}`:"",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(M,{onClick:P,children:t(_e,{})}),t(E,{open:A,onClose:F,anchorEl:O,children:n.map((e,r)=>t(Y,{onClick:t=>z(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:m}),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(E,{open:T,onClose:e=>I(null),anchorEl:V,disableScrollLock:!0,transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"},sx:{".MuiMenu-paper":{borderRadius:4}},children:[p,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(We,{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(Be,{})]})]}):t(l,"govbr"===S?{variant:"contained",size:"small",startIcon:t(qe,{}),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(qe,{}),onClick:w,sx:{color:"white",textTransform:"inherit",borderRadius:50,paddingX:2},children:t(o,{fontWeight:600,fontSize:15,padding:.4,children:"Entrar"})})]})})]})}),N&&t(Ue,{})]}),t(i,{paddingBottom:g})]})}function Ei({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:m,unregister:p,getValues:f}=ce(),[h,g]=H([]);return t(at.Provider,{value:{formRegister:i,formWatch:d,formReset:c,formControl:l,formSetValue:m,formTrigger:u,formUnregister:p,formGetValues:f,formHandleSubmit:a,setFilesUid:g,formState:s,errors:s?.errors,submiting:o},children:t("form",{method:n,onSubmit:a(e=>r(e,h),()=>Ye("Formulário incompleto! Verifique os campos marcados e tente novamente.",{type:"warning",position:"top-right",theme:"colored"})),children:e})})}function Yi({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),[m,p]=H(null),f=Ge(),h=!!s;return J(()=>{const t=new He({url:e,realm:r,clientId:n});p(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=f.query.status;o&&"success"===o&&window.history.replaceState(null,"","/")},[]),t(ot.Provider,{value:{user:s,isAuth:h,userLoaded:d,login:function(){console.log("Tentando logar..."),console.log("KC: ",{instancia:m,logado:m?.authenticated,client_id:m?.clientId}),m?.login({redirectUri:l})},logout:function(){u(!1),m?.logout(),c(null),localStorage.removeItem("user-data.img")},saveUserData:()=>{},type:i},children:o})}const Oi="nextauth.token",Mi="user-data.img";function Di({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(),[m,p]=H(!1),f=Ge(),h=!!d;function g(){p(!1),f.replace(s).finally(()=>{u(null),Ze(Oi),localStorage.removeItem(Mi),p(!0)})}return J(()=>{const e=Je(Oi);e?fetch(`${r}${i}`,{method:"POST",headers:{Authorization:`Bearer ${e}`}}).then(t=>{if(t.ok){const t=et(e),r=localStorage.getItem(Mi);u({name:t.given_name,image:r??"",roles:t.roles.map(e=>e.code),token:e}),p(!0)}else g()}):p(!0)},[]),t(ot.Provider,{value:{user:d,isAuth:h,userLoaded:m,login:function(){if(!location||"localhost"!==location.hostname&&location.hostname!==l)p(!1),f.replace(c);else{const e=a;Qe(Oi,e),u({name:"Teste",image:"",roles:[1],token:e}),f.replace(o).finally(()=>p(!0))}},logout:g,saveUserData:function(e){try{const t=e.ssp_token;Qe(Oi,t);const r=et(t),n=et(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(Mi,e),u({name:r.name,image:e,roles:r.roles.map(e=>e.code),token:t}),f.replace(o).finally(()=>p(!0))}}),u({name:r.name,image:"",roles:r.roles.map(e=>e.code),token:t}),f.replace(o).finally(()=>p(!0))})).then(function(){f.replace(o).finally(()=>p(!0))})}catch(e){return Promise.reject(e)}},type:"govbr"},children:e})}function Vi(n){return e(r,{children:[t(Wo,{}),n.children,t(Oe,{position:"bottom-right",theme:"colored"})]})}export{Oi as AUTH_COOKIE_NAME,Co as ActiveInput,ot as AuthContext,wo as AutoComplete,_o as Button,tt as Category,lt as CheckBox,ct as CheckBoxAdditional,dt as CheckBoxWarning,pt as DatePicker,uo as DropFileUpload,So as FetchAutoComplete,rt as Field,nt as FieldLabel,it as File,mo as FileUpload,Yo as FixedAutoComplete,at as FormContext,Ei as FormProvider,ft as GenericDatePicker,Mo as GenericFetchAutoComplete,Ao as GenericInput,Vo as GenericMaskInput,To as GenericMultInput,oi as GenericTable,xo as Input,Yi as KeycloakAuthProvider,Bo as MODAL,Ci as Map,bo as MaskInput,qo as Menu,$o as MultInput,wi as NavBar,Di as OAuthProvider,jo as OtherCheckBox,mt as RequiredCheckBoxGroup,Vi as SspComponentsProvider,Po as Stepper,Lo as StepperBlock,fo as Switch,go as SwitchWatch,Si as TabNavBar,xi as Table,ht as TimePicker,ho as ToggleVisibility};
2
+ return t(i,gt({as:l,ownerState:h,ref:r,className:Bn(g.root,m)},f,{children:d?no(u,d):u}))});return"production"!==process.env.NODE_ENV&&(a.propTypes={children:cr.node,direction:cr.oneOfType([cr.oneOf(["column-reverse","column","row-reverse","row"]),cr.arrayOf(cr.oneOf(["column-reverse","column","row-reverse","row"])),cr.object]),divider:cr.node,spacing:cr.oneOfType([cr.arrayOf(cr.oneOfType([cr.number,cr.string])),cr.number,cr.object,cr.string]),sx:cr.oneOfType([cr.arrayOf(cr.oneOfType([cr.func,cr.object,cr.bool])),cr.func,cr.object])}),a}();"production"!==process.env.NODE_ENV&&(io.propTypes={children:cr.node,component:cr.elementType,direction:cr.oneOfType([cr.oneOf(["column-reverse","column","row-reverse","row"]),cr.arrayOf(cr.oneOf(["column-reverse","column","row-reverse","row"])),cr.object]),divider:cr.node,spacing:cr.oneOfType([cr.arrayOf(cr.oneOfType([cr.number,cr.string])),cr.number,cr.object,cr.string]),sx:cr.oneOfType([cr.arrayOf(cr.oneOfType([cr.func,cr.object,cr.bool])),cr.func,cr.object]),useFlexGap:cr.bool});var ao=io;function lo(r){return t(p,{...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 so(r){return t(p,{...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 co(e){const t=1048576;return e<t?`${(e/1024).toFixed(1)}KB`:`${(e/t).toFixed(1)}MB`}function uo({name:a,tipoArquivo:s,title:c,required:d=!1,multiple:m=!1,apiURL:p,sizeLimit:y=4,xs:b=12,sm:v,md:x,route:C="",tstToken:w="",dropZoneOptions:k}){const{getRootProps:S,getInputProps:E}=ue({multiple:m,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(p,n,{onUploadProgress:t=>{const n=Math.round(100*t.loaded/t.total);V(n),n>=100&&A(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)}]),$(e=>[...e,r]);const n={};n[r]=t,N(e=>({...e,...n}))}else V(-1),F(r)}).catch(e=>{console.log(e),V(-1),F(r)})})},...k||{}}),Y=X(at),{user:O}=X(ot),M=f();h(M.breakpoints.only("xs"));const[D,V]=H(-1),[I,A]=H([]),[T,$]=H([]),[j,N]=H({}),[R,P]=H(""),F=(e,t,r)=>{A(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,{item:!0,xs:b,sm:v,md:x,sx:{width:"100%"},children:e(i,{bgcolor:"white",p:2,borderRadius:"8px",color:"#1E293B",children:[t(u,{required:d,sx:{marginBottom:2,textTransform:"capitalize"},children:c}),e(ao,{...S({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",{...E(),...Y.formRegister(a,{validate:(e,t)=>{if((e.length&&T.length)<=0&&d)return"O campo de arquivo é obrigatório"}})}),e(ao,{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(ao,{width:"100%",marginTop:1,spacing:1,children:[I.map(r=>e(ao,{direction:"row",justifyContent:"space-between",border:"solid 1px #E2E8F0",borderRadius:2,p:1,children:[e(ao,{direction:"row",children:[t(ao,{direction:"row",justifyContent:"center",alignItems:"center",minWidth:30,pr:1.5,children:t(lo,{sx:{filter:"invert(42%) sepia(86%) saturate(2412%) hue-rotate(326deg) brightness(86%) contrast(102%)",transform:"scale(1.5)",width:30}})}),e(ao,{children:[t(o,{fontWeight:600,children:r.name}),t(o,{fontSize:14,children:co(r.size)})]})]}),t(l,{size:"small",startIcon:t(so,{}),variant:"contained",onClick:e=>{return t=r.id,void(Object.keys(j).includes(t.toString())&&fetch(`${p}/${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"})]})),D>0&&D<100&&t(g,{value:D,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 mo({name:a,tipoArquivo:s,title:c,required:d=!1,multiple:m=!1,apiURL:p,route:g="",sizeLimit:x=4,xs:C=12,sm:w,md:k}){const S=X(at),{user:E}=X(ot),Y=f(),O=h(Y.breakpoints.only("xs")),[M,D]=H([]),[V,I]=H([]),[A,T]=H({}),[$,j]=H(""),N=G(e=>{const t=e.target.files,r=Object.keys(t).map(e=>t[e]);D([...M,...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(p,{method:"POST",body:n,headers:{Authorization:`Bearer ${E?E.token:""}`}}).then(e=>{e.ok?e.json().then(e=>{if(e.status&&200===e.status.status){const t=te(e,g,e)[0].coSeqArquivo;S.setFilesUid(e=>[...e,{CO_SEQ_ARQUIVO:t,CO_TIPO_ARQUIVO:parseInt(s)}]),I(e=>[...e,r]);const n={};n[r]=t,T(e=>({...e,...n}))}else R(r)}):R(r)}).catch(e=>{R(r)}),{id:r,name:e.name,loading:!0,error:!1,file:e}})])},[M,S]),R=(e,t,r)=>{D(M.filter(t=>t.id!==e)),r&&S.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;M.forEach(t=>{e.items.add(t.file)}),S?.formSetValue(a,e.files)},[M,S,a]),J(()=>()=>{S.setFilesUid(e=>e.filter(e=>e.CO_TIPO_ARQUIVO!==parseInt(s)))},[]),e(n,{item:!0,xs:C,sm:w,md:k,sx:{width:"100%"},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:m,...S?.formRegister(a,{validate:(e,t)=>{if((e.length&&V.length)<=0&&d)return"O campo de arquivo é obrigatório"}}),onChange:N,accept:".pdf",style:{display:"none"}}),t("input",{id:a+"foto",type:"file",capture:"environment",multiple:m,...S?.formRegister(a,{validate:(e,t)=>{if((e.length&&V.length)<=0&&d)return"O campo de arquivo é obrigatório"}}),onChange:N,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:!m&&M.length>=1?t(l,{disabled:!0,variant:"contained",disableElevation:!0,startIcon:t(ye,{}),component:"span",sx:{textTransform:"none"},fullWidth:!0,children:"Escolher Documento"}):t("label",{htmlFor:a,children:t(l,{variant:"contained",disableElevation:!0,startIcon:t(ye,{}),component:"span",sx:{textTransform:"none"},fullWidth:!0,children:"Escolher Documento"})})}),t(i,{sx:{width:"100%"},children:!m&&M.length>=1?t(l,{disabled:!0,variant:"contained",disableElevation:!0,startIcon:t(fe,{}),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(fe,{}),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 ",M.length," arquivo",M.length>1&&"s"]}),M.length>0&&t(y,{component:b,children:t(ao,{direction:"column",children:M.map(r=>e(ao,{direction:"row",justifyContent:"space-between",padding:.5,children:[t(i,{children:e(ao,{direction:"row",spacing:2,children:[V.includes(r.id)?t(ge,{sx:{fill:"#06d6a0"}}):t(v,{size:22,sx:{color:"black"}}),t(be,{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(A).includes(t.toString())&&fetch(`${p}/${A[t]}`,{method:"DELETE",headers:{Authorization:`Bearer ${E?.token}`}}).then(e=>{e.ok||R(t,!0,A[t]),200===e.status&&R(t,!0,A[t])}).catch(e=>console.log(e)));var t},startIcon:t(he,{}),children:"Remover"})})]},r.name))})}),$&&e(r,{children:[t(o,{variant:"caption",color:"#e53935",fontWeight:600,fontSize:14,paddingTop:2,children:$}),t("br",{})]}),te(S?.errors,a)&&t(o,{variant:"caption",color:"#e53935",fontWeight:600,fontSize:14,children:"* O campo de arquivo é obrigatório"})]})]})}function po({defaultChecked:r=!1,...n}){const i=X(at);J(()=>{i?.formSetValue(n.name,r)},[]);const l=Z(()=>n.overrideYes||"Sim",[n.overrideYes]),c=Z(()=>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 fo=/*#__PURE__*/U.memo(po);function ho({invert:e=!1,hasCheckValue:n=!1,...o}){const i=X(at);return J(()=>()=>{(n?e:i.formWatch(o.switchId)===e)&&o.unregisterNameList.forEach(e=>i.formUnregister(e))},[o.unregisterNameList]),t(r,{})}function go({invert:n=!1,checkValue:o,...i}){const a=X(at);return t(r,{children:(o?a?.formWatch(i.switchId)===o!==n:a?.formWatch(i.switchId)!==n)&&e(r,{children:[t(ho,{switchId:i.switchId,unregisterNameList:i.unregisterNameList,hasCheckValue:!!o,invert:o?a?.formWatch(i.switchId)===o!==n:n}),i.children]})})}const yo=/*#__PURE__*/U.forwardRef(function(e,r){const{onChange:n,onMask:o,maskValue:i,setMaskValue:a,watchValue:l,imaskConfig:s,...c}=e,[d,u]=H(s.mask);delete c.value;const m=Q(null),[p,f]=H(""),h=X(at);return J(()=>{l&&f(l)},[l]),J(()=>{h.formSetValue(c.name,m.current.element.value)},[p]),delete c.watchValue,t(xe,{...c,mask:d,value:p,ref:m,inputRef:r,onChange:e=>{},onAccept:(e,t)=>{f(e),t.updateValue(),o&&o(e,u)},...s})});function bo(e){const n=X(at),[o,i]=H("");return t(r,{children:t(m,{...e.formConfig,onInput:t=>{n.formSetValue(e.formConfig.name,t.target.value)},InputProps:{inputComponent:yo,inputProps:{onMask:e.onMask,maskValue:o,setMaskValue:i,watchValue:e.watchValue,imaskConfig:e.imaskConfig}},disabled:e.disabled,fullWidth:!0})})}function vo({type:r="input",numberMask:o="000000000000000",xs:i=12,sm:a,inputMinLength:l=1,inputMaxLength:s=255,defaultValue:c="",md:d,disabled:p=!1,watchValue:f,...h}){const g=X(at);return J(()=>{void 0!==f&&g.formSetValue(h.name,f)},[f]),e(n,{item:!0,xs:i,sm:a,md:d,children:[h.title&&t(u,{htmlFor:"campo",required:h.required,children:h.title}),(()=>{const e={fullWidth:!0,size:"small",placeholder:h.customPlaceholder?h.customPlaceholder:h.title},n=h.name,i=te(g?.errors,h.name),a=i?.message,d=!!i,u={...g?.formRegister(n,{validate:(e,t)=>{const n=e??"";if(n.length<=0&&h.required)return"Este campo é obrigatório";if(h.customValidate){const e=h.customValidate(n,t);if(e)return e}if("cnpj"===r){if(n.length<18&&h.required)return"O CNPJ precisa ter no mínimo 14 dígitos"}else if("cpf"===r){if(n.length<14&&h.required)return"O CPF precisa ter no mínimo 11 dígitos"}else if("sei"===r){if(n.length<22&&h.required)return"O Número SEI precisa ter no mínimo 19 dígitos"}else if("cep"===r){if(n.length<9&&h.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&&h.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)&&h.required)return"O e-mail inserido não é valido"}else if("cpf_cnpj"===r){if((n.length<14||n.length>14&&n.length<18)&&h.required)return"O CPF/CNPJ precisa ter no mínimo 11/14 dígitos"}else if("phone"===r&&n.length<14&&h.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(m,{...u,defaultValue:c,disabled:p});case"password":return t(m,{...u,type:"password",disabled:p});case"number":return t(bo,{formConfig:u,defaultValue:c,imaskConfig:{mask:o},watchValue:f,disabled:p});case"cep":return t(bo,{formConfig:u,defaultValue:c,imaskConfig:{mask:"00000-000"},watchValue:f,disabled:p});case"phone":return t(bo,{formConfig:u,defaultValue:c,imaskConfig:{mask:"(00) [9]0000-0000"},watchValue:f,disabled:p});case"sei":return t(bo,{formConfig:u,defaultValue:c,imaskConfig:{mask:"00000-00000000/0000-00"},watchValue:f,disabled:p});case"cpf_cnpj":return t(bo,{formConfig:u,defaultValue:c,imaskConfig:{mask:[{mask:"000.000.000-00"},{mask:"00.000.000/0000-00"}],dispatch:(e,t)=>(t.value+e).replace(/\D/g,"").length>11?t.compiledMasks[1]:t.compiledMasks[0]},watchValue:f,disabled:p});case"cpf":return t(bo,{formConfig:u,defaultValue:c,imaskConfig:{mask:"000.000.000-00"},watchValue:f,disabled:p});case"cnpj":return t(bo,{formConfig:u,defaultValue:c,imaskConfig:{mask:"00.000.000/0000-00"},watchValue:f,disabled:p});case"rg":return t(bo,{formConfig:u,defaultValue:c,imaskConfig:{mask:"00000[000000]"},watchValue:f,disabled:p})}})()]})}var xo=/*#__PURE__*/U.memo(vo);function Co({name:r,required:o=!1,title:i,defaultChecked:l=!1,xs:s=12,unregisterNameList:c,sm:d,md:u,...m}){const p=`${r}-switch`;return e(n,{item:!0,xs:s,sm:d,md:u,children:[i&&t(ve,{required:o,sx:{textTransform:"capitalize"},children:i}),e(a,{direction:"row",children:[t(fo,{name:p,defaultChecked:l}),t(go,{switchId:p,unregisterNameList:c,children:t(vo,{name:"ddd",type:"input"})})]})]})}function wo({name:r,required:o=!1,title:i,customPlaceholder:a,url:l,xs:s=12,sm:c,md:d,dataPath:u=""}){const p=X(at),{user:f}=X(ot),[h,g]=H([]);Ce(`autocomplete-${r}`,()=>fetch(l,{headers:{Authorization:`Bearer ${f?f.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)=>{p?.formSetValue(r,t?t.id:""),p?.formTrigger(r)},[p,r]);return e(n,{item:!0,xs:s,sm:c,md:d,children:[i&&t(ve,{required:o,children:i}),t("input",{type:"text",...p?.formRegister(r,{validate:(e,t)=>{if(e.length<=0&&o)return"Este campo é obrigatório"}}),hidden:!0}),t(C,{options:h,isOptionEqualToValue:(e,t)=>e.id===t.id,onChange:b,renderInput:e=>t(m,{...e,placeholder:a,size:"small",error:!!te(p?.errors,r),helperText:te(p?.errors,r)?.message})})]})}let ko=!0;function So({name:r,url:o,title:i,customLoadingText:a,shouldRefetch:l=!0,required:s=!1,defaultValue:c,route:d="",onChange:p=()=>{},xs:f=12,sm:h,watchValue:g,md:y,disabled:b=!1}){const v=X(at),[x,w]=H(!0),[k,S]=H([]),[E,Y]=H("Carregando..."),[O,M]=H(null),[D,V]=H(null),[I,A]=H(null),{user:T}=X(ot),$=function(e,t,n=!1){try{return Promise.resolve(function(o,i){try{var a=(A(null),Promise.resolve(fetch(e,{method:"GET",headers:{Authorization:`Bearer ${T?.token}`}})).then(function(e){if(!e.ok){const t=401===e.status?"Sessão expirada. Faça login novamente.":403===e.status?"Acesso negado. Verifique suas permissões.":e.status>=500?"Erro interno do servidor. Tente novamente mais tarde.":"Erro ao carregar dados";return A(t),Y(t),void w(!1)}return Promise.resolve(e.json()).then(function(e){const o=te(e,t,e);if(n){const e=o.filter(e=>e.id===c);e.length>0?(S(o),w(!1),v.formSetValue(r,c),M(e[0])):(A("Valor padrão inválido"),Y("Erro ao carregar dados. Valor inválido"),w(!1))}else S(o),w(!1)})}))}catch(e){return i(e)}return a&&a.then?a.then(void 0,i):a}(0,function(e){console.error("Network error:",e),A("Erro de conexão. Verifique sua internet e tente novamente."),Y("Erro de conexão. Verifique sua internet e tente novamente."),w(!1)}))}catch(e){return Promise.reject(e)}};function j(){(c||!l)&&k.length>0||(w(!0),S([]),a&&Y(a),$(o,d,!1))}return J(()=>{c&&$(o,d,!0)},[]),J(()=>{g&&ko&&(V(g),v.formSetValue(r,g.id),p(g.id))},[g]),c&&k.length<=0&&!O?t(n,{item:!0,xs:f,sm:h,md:y,children:t(m,{size:"small",fullWidth:!0,placeholder:E,disabled:!0})}):e(n,{item:!0,xs:f,sm:h,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:D,loading:x,loadingText:E,options:k,defaultValue:O,getOptionDisabled:e=>e?.disabled??!1,isOptionEqualToValue:(e,t)=>e.id===t.id,onChange:(e,t)=>function(e){if(ko=!1,e)return V(e),v.formSetValue(r,e.id),void p(e.id);V(null),v.formSetValue(r,""),p(void 0)}(t),renderInput:e=>t(m,{...e,size:"small",fullWidth:!0,placeholder:i,onFocus:j,error:!!te(v?.errors,r)||!!I,helperText:te(v?.errors,r)?.message||I}),sx:{bgcolor:"white"},size:"small",fullWidth:!0,disabled:b})]})}let Eo=!0;function Yo({name:r,title:o,required:i=!1,list:a,defaultValue:l,onChange:s=()=>{},xs:c=12,sm:d,watchValue:p,forceUpdate:f=!1,md:h}){const g=X(at),[y,b]=H(null);return J(()=>{l&&g?.formSetValue(r,l.id)},[]),J(()=>{p&&(Eo||f)?(b(p),g.formSetValue(r,p.id),s(p.id)):void 0===p&&(Eo||f)&&(b(null),g.formSetValue(r,void 0),s(void 0))},[p]),e(n,{item:!0,xs:c,sm:d,md:h,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(Eo=!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(m,{...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 Oo=!0;function Mo({name:r,url:o,title:i,customLoadingText:a,shouldRefetch:l=!0,required:s=!1,defaultValue:c,route:d="",onChange:p=()=>{},xs:f=12,sm:h,watchValue:g,md:y,disabled:b=!1}){const v=se(),[x,w]=H(!0),[k,S]=H([]),[E,Y]=H("Carregando..."),[O,M]=H(null),[D,V]=H(null),{user:I}=X(ot);function A(){(c||!l)&&k.length>0||(w(!0),S([]),a&&Y(a),fetch(o,{method:"GET",headers:{Authorization:`Bearer ${I?.token}`}}).then(e=>{e.ok?e.json().then(e=>{S(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?(S(te(e,d,e)),w(!1),v.setValue(r,c),M(t[0])):Y("Erro ao carregar dados. Valor inválido")})):Y("Erro ao carregar dados")})},[]),J(()=>{g&&Oo&&(V(g),v.setValue(r,g.id),p(g.id))},[g]),c&&k.length<=0&&!O?t(n,{item:!0,xs:f,sm:h,md:y,children:t(m,{size:"small",fullWidth:!0,placeholder:E,disabled:!0})}):e(n,{item:!0,xs:f,sm:h,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:D,loading:x,loadingText:E,options:k,defaultValue:O,getOptionDisabled:e=>e?.disabled??!1,isOptionEqualToValue:(e,t)=>e.id===t.id,onChange:(e,t)=>function(e){if(Oo=!1,e)return V(e),v.setValue(r,e.id),void p(e.id);V(null),v.setValue(r,""),p(void 0)}(t),renderInput:e=>t(m,{...e,size:"small",fullWidth:!0,placeholder:i,onFocus:A,error:!!te(v.formState.errors,r),helperText:te(v.formState.errors,r)?.message}),sx:{bgcolor:"white"},size:"small",fullWidth:!0,disabled:b})]})}const Do=/*#__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 m=Q(null),[p,f]=H(""),h=se();return J(()=>{s&&f(s)},[s]),J(()=>{h.setValue(c.name,m.current.element.value)},[p]),delete c.watchValue,t(xe,{...c,...o,mask:d,value:p,ref:m,inputRef:r,onChange:e=>{},onAccept:(e,t)=>{f(e),t.updateValue(),i&&i(e,u)}})});function Vo(e){const n=X(at),[o,i]=H("");return t(r,{children:t(m,{...e.formConfig,onInput:t=>{n.formSetValue(e.formConfig.name,t.target.value)},InputProps:{inputComponent:Do,inputProps:{maskProps:e.maskProps,onMask:e.onMask,maskValue:o,setMaskValue:i,watchValue:e.watchValue}},disabled:e.disabled,fullWidth:!0})})}function Io({type:r="input",numberMask:o="000000000000000",xs:i=12,sm:a,inputMinLength:l=1,inputMaxLength:s=255,defaultValue:c="",md:d,disabled:p=!1,watchValue:f,...h}){const g=se();return J(()=>{void 0!==f&&g.setValue(h.name,f)},[f]),e(n,{item:!0,xs:i,sm:a,md:d,children:[h.title&&t(u,{htmlFor:"campo",required:h.required,children:h.title}),(()=>{const e={fullWidth:!0,size:"small",placeholder:h.customPlaceholder?h.customPlaceholder:h.title},n=h.name,i=te(g?.formState.errors,h.name),a=i?.message,d=!!i,u={...g?.register(n,{validate:(e,t)=>{const n=e??"";if(n.length<=0&&h.required)return"Este campo é obrigatório";if("cnpj"===r){if(n.length<18&&h.required)return"O CNPJ precisa ter no mínimo 14 dígitos"}else if("cpf"===r){if(n.length<14&&h.required)return"O CPF precisa ter no mínimo 11 dígitos"}else if("sei"===r){if(n.length<22&&h.required)return"O Número SEI precisa ter no mínimo 19 dígitos"}else if("cep"===r){if(n.length<9&&h.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&&h.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)&&h.required)return"O e-mail inserido não é valido"}else if("cpf_cnpj"===r){if((n.length<14||n.length>14&&n.length<18)&&h.required)return"O CPF/CNPJ precisa ter no mínimo 11/14 dígitos"}else if("phone"===r&&n.length<14&&h.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(m,{...u,defaultValue:c,disabled:p});case"password":return t(m,{...u,type:"password",disabled:p});case"number":return t(Vo,{formConfig:u,defaultValue:c,maskProps:{mask:o},watchValue:f,disabled:p});case"cep":return t(Vo,{formConfig:u,defaultValue:c,maskProps:{mask:"00000-000"},watchValue:f,disabled:p});case"phone":return t(Vo,{formConfig:u,defaultValue:c,maskProps:{mask:"(00) [#]0000-0000",definitions:{"#":/^9$/}},watchValue:f,disabled:p});case"sei":return t(Vo,{formConfig:u,defaultValue:c,maskProps:{mask:"00000-00000000/0000-00"},watchValue:f,disabled:p});case"cpf_cnpj":return t(Vo,{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:f,disabled:p});case"cpf":return t(Vo,{formConfig:u,defaultValue:c,maskProps:{mask:"000.000.000-00"},watchValue:f,disabled:p});case"cnpj":return t(Vo,{formConfig:u,defaultValue:c,maskProps:{mask:"00.000.000/0000-00"},watchValue:f,disabled:p});case"rg":return t(Vo,{formConfig:u,defaultValue:c,maskProps:{mask:"00000[000000]"},watchValue:f,disabled:p})}})()]})}var Ao=/*#__PURE__*/U.memo(Io);function To({name:r,required:o=!1,title:i,customPlaceholder:a,defaultValue:l="",xs:s=12,sm:c,watchValue:d="",inputMinLength:u=3,inputMaxLength:p=255,md:f,...h}){const g=se();return J(()=>{g.setValue(r,d)},[d]),e(n,{item:!0,xs:s,sm:c,md:f,children:[i&&t(ve,{required:o,sx:{textTransform:"capitalize"},children:i}),t(m,{multiline:!0,fullWidth:!0,minRows:3,defaultValue:l,...g.register(r,{validate:(e,t)=>o&&e.length<=0?"Este campo é obrigatório":e.length>p?`Limite máximo de ${p} 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 $o({name:r,required:o=!1,title:i,customPlaceholder:a,defaultValue:l="",xs:s=12,sm:c,watchValue:d="",inputMinLength:u=3,inputMaxLength:p=255,md:f,...h}){const g=X(at);return J(()=>{g.formSetValue(r,d)},[d]),e(n,{item:!0,xs:s,sm:c,md:f,children:[i&&t(ve,{required:o,sx:{textTransform:"capitalize"},children:i}),t(m,{multiline:!0,fullWidth:!0,minRows:3,defaultValue:l,...g.formRegister(r,{validate:(e,t)=>o&&e.length<=0?"Este campo é obrigatório":e.length>p?`Limite máximo de ${p} 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 jo({name:r,required:o=!1,xs:l=12,sm:s,md:d}){const u=X(at),p=`switch-${r}`;return J(()=>{u.formWatch(p)||u.formSetValue(r,void 0)},[u]),t(n,{item:!0,xs:l,sm:s,md:d,children:e(a,{direction:"row",children:[t(i,{children:t(c,{size:"small",...u.formRegister(p),sx:{paddingLeft:0,margin:0}})}),u.formWatch(p)?t(m,{size:"small",...u.formRegister(r,{validate:(e,t)=>{if(!0===u.formWatch(p)&&(!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(m,{size:"small",disabled:!0,placeholder:"Outro"})]})})}const No=(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 Ro({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=X(at),m=Q(null),p=f(),[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(()=>{m.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:h(p.breakpoints.only("xs"))?"bottom":"static",activeStep:g,sx:{paddingTop:2,paddingBottom:4,paddingX:0},backButton:t(l,{variant:"contained",startIcon:t(we,{}),onClick:()=>{y(e=>e-1)},disabled:0===g,sx:{textTransform:"none"},children:"Voltar"}),nextButton:g<v-1?t(l,{variant:"contained",endIcon:t(ke,{}),onClick:function(){try{return r&&console.log(u.formGetValues()),Promise.resolve(u.formTrigger(No(u.formGetValues(),g))).then(function(e){e?y(e=>e+1):Ye("Formulário incompleto! Verifique os campos marcados e tente novamente.",{type:"warning",theme:"light"})})}catch(e){return Promise.reject(e)}},sx:{textTransform:"none"},ref:m,children:"Próximo"}):t(i,{children:t(Ee,{variant:"contained",type:"submit",loading:u.submiting,loadingPosition:"start",startIcon:t(Se,{}),onClick:e=>function(e){try{return Promise.resolve(u.formTrigger(No(u.formGetValues(),g))).then(function(t){t||(e.preventDefault(),Ye("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 Po=/*#__PURE__*/U.memo(Ro);function Fo(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(Fo(n,t,r+(o+1)))}),o=e}else o=Fo(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 zo({optional:o=!1,title:l,prefix:s=0,optionalMessage:c,defaultChecked:d,...u}){const m=X(at),p=`switch-${s}`,f=(Array.isArray(u.children)?u.children:[u.children]).map((e,t)=>e&&Fo(e,s,t));return e(i,{children:[t(n,{item:!0,xs: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(fo,{name:p,defaultChecked:!o||d,overrideNo:u.overrideSwitchNo,overrideYes:u.overrideSwitchYes})})]})}),t(a,{spacing:2,children:o?m.formWatch(p)?t(n,{container:!0,spacing:1,children:f}):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:f})})]})}var Lo=/*#__PURE__*/U.memo(zo);let Bo={open:()=>{},close:()=>{},openReparented:()=>{},reparent:()=>t(r,{})};function Wo(){const[n,l]=H(!1),[s,c]=H(null),d=()=>l(!1);Q(null);const u=f(),m=h(u.breakpoints.up("sm")),[p,g]=H({}),[y,b]=H(-1321465654);return J(()=>{Bo.open=e=>{e&&c(e),b(-1321465654),l(!0)},Bo.reparent=(e,n)=>(g(o=>({...o,[n]:t(r,{children:e})})),t(r,{})),Bo.openReparented=e=>{b(e),c(null),l(!0)},Bo.close=d},[l]),t(r,{children:m?t(S,{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(Re,{sx:{transform:"scale(.9)"}})}),e(i,{overflow:"auto",maxHeight:"90vh",p:2,marginTop:4,borderTop:"solid 1px gray",bgcolor:"#F9F9F9",borderRadius:2,children:[s,p[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,p[y]]})]})})}function _o({customColor:e="#383838",customFontColor:r="white",...n}){const o=Pe(e);return t(l,{...n,sx:{bgcolor:o.toHexString(),color:Pe(r).toHexString(),":hover":{bgcolor:o.darken(10).toHexString()},boxShadow:"none",borderRadius:3,textTransform:"capitalize",paddingX:2},size:"small",children:n.children})}function qo({data:n=[],...o}){const[i,a]=U.useState(null),l=Boolean(i),s=()=>{a(null)};return e(r,{children:[t(_o,{...o.btProps,onClick:e=>{a(e.currentTarget)},children:o.children}),t(E,{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 Uo(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/g,"")}function Ko(e){return("string"!=typeof e?e.toString():e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim()}let Xo=[],Go=!1,Ho="",Jo=!1,Zo={},Qo="";function ei({mediaQueryLG:n,columns:o,emptyMsg:s={user:"Nenhum dado encontrado",public:"Nenhum dado encontrado"},dataPath:c="",tableName:d="Dados",csv:u,columnSize:m,action:p,useKC:y=!0,statusKeyName:v="",csvExcludeKeys:x=[],csvExcludeKeysCSV:C=[],csvExcludeKeysAll:w=[],csvCustomKeyNames:k={},csvExcludeValidate:S=(e,t)=>!1,csvButtonTitle:E="Salvar .CSV",csvNoZipText:Y="Salvar .CSV",csvAllButtonTitle:I="Salvar todos em CSV",removeQuotes:A=!1,normalize:T=!1,csvShowAllButton:$=!1,csvWithoutZip:j=!1,itemCount:N=10,csvUpper:W=!1,csvZipFileNamesKey:q="",generateCsvZip:U=!1,hideTitleCSV:K=!1,csvExcludeUpper:Z=[],multipleDataPath:re="",expandTextMaxLength:ne=50,collapsedSize:oe=53,customMargin:ie=4,customMarginMobile:le=0,filtersFunc:se,filters:ce=[],orderBy:de=[],customErrorMsg:ue,customTableStyle:me={},id:pe,initialData:fe=null,isLoading:he,alwaysExpanded:ge=!1}){const[ye,be]=H(null),[ve,xe]=H(fe),{user:Ce,userLoaded:we}=X(ot),[ke,Se]=H([]),[Ee,Ye]=H([]),[Oe,Me]=H(N),[Re,Pe]=H(0),[Fe,ze]=H(1),[Le,Be]=H(1);H("");const[We,_e]=H({}),[qe,Ue]=H({}),[Ke,Xe]=H({}),[Ge,He]=H("filterKey"),Je=f(),Ze=h(Je.breakpoints.only("xs")),Qe=Q(null),et=h(Je.breakpoints.up(2e3));Ho=`tableFilter_${pe}`,Qo=`tableFilterCache_${pe}`,Zo=se??{},localStorage.getItem(Qo)||localStorage.setItem(Qo,JSON.stringify(ce)),localStorage.getItem(Qo)!==JSON.stringify(ce)&&(localStorage.setItem(Qo,JSON.stringify(ce)),localStorage.removeItem(Ho));const tt=G(e=>{if(e.length<=0)return 1;let t=e.length/Oe;return t=t<1?1:t,Math.ceil(t)},[Oe]),rt=G(e=>Array.isArray(e)?e:"object"==typeof e?te(e,c):void 0,[]);J(()=>{if(ye||!rt(ve))return;const e=rt(ve);Se(e),Ye(e),ze(tt(e)),localStorage.getItem(Ho)&&dt(JSON.parse(localStorage.getItem(Ho)))},[Oe,ve,tt,ye]),J(()=>{Pe(Le-1)},[Le]);const nt=G((e,t)=>{Be(t)},[]),it=G(()=>{const e=Re*Oe;return ke.slice(e,e+Oe)},[ke,Oe,Re]),at=G((e,t=!1)=>{if(e.preventDefault(),ke.length<=0)return;const r=Object.keys(ke[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 Ne,i={};ke.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=>{S(e,t[e])&&(n=!1)}),n){const r=e.map(e=>{if("string"==typeof t[e]){let r=W?t[e].toUpperCase():t[e];return r=T?r.normalize("NFD").replace(/[\u0300-\u036f]/g,""):r,A?`${r}`:`"${r}"`}if("object"==typeof t[e]&&!Array.isArray(t[e])&&null!==t[e]){let r=lt(t[e]).slice(1,-1),n=W&&!Z.includes(e)?r.toUpperCase():r;return n=T?n.normalize("NFD").replace(/[\u0300-\u036f]/g,""):n,A?`${n}`:`"${n}"`}return t[e]}).join(",");a.push(r)}});const l=K?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=[];ke.forEach(t=>{let n=!0;if(r.forEach(e=>{S(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=W&&!Z.includes(e)?t[e].toUpperCase():t[e];return r=T?r.normalize("NFD").replace(/[\u0300-\u036f]/g,""):r,A?`${r}`:`"${r}"`}if("object"==typeof t[e]&&!Array.isArray(t[e])&&null!==t[e]){let r=lt(t[e]).slice(1,-1),n=W&&!Z.includes(e)?r.toUpperCase():r;return n=T?n.normalize("NFD").replace(/[\u0300-\u036f]/g,""):n,A?`${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()}},[ke]);function lt(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+": "+lt(n));return"["+t.join(" - ")+"]"}const st=G(e=>{if(e.preventDefault(),ke.length<=0)return;const t=Object.keys(ke[0]).filter(e=>!w.includes(e)),r=t.join(",")+"\n",n=ke.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=W&&!Z.includes(t)?e[t].toUpperCase():e[t];return r=T?r.normalize("NFD").replace(/[\u0300-\u036f]/g,""):r,A?`${r}`:`"${r}"`}if("object"==typeof e[t]&&!Array.isArray(e[t])&&null!==e[t]){let r=lt(e[t]).slice(1,-1),n=W&&!Z.includes(t)?r.toUpperCase():r;return n=T?n.normalize("NFD").replace(/[\u0300-\u036f]/g,""):n,A?`${n}`:`"${n}"`}return e[t]}).join(",")).join("\n"),o=r+n;var i=window.document.createElement("a");i.setAttribute("href","data:text/csv;charset=utf-8,%EF%BB%BF"+encodeURI(o)),i.setAttribute("download",`${u?.fileName}.csv`),i.click()},[ke]);function ct(){Se(Xo),Ye(Xo),ze(tt(Xo)),Pe(0),Be(1),localStorage.removeItem(Ho),He((new Date).getTime().toString())}function dt(e){if(!Xo)return;let t=JSON.parse(JSON.stringify(Xo));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?Ko(n)===Ko(e.value.id)&&r.push(t):Ko(n)===Ko(e.value)&&r.push(t)});break;case"contem":t.forEach(t=>{const n=te(t,e.keyName,"");n&&(e.useList?Ko(n).includes(Ko(e.value.id))&&r.push(t):Ko(n).includes(Ko(e.value))&&r.push(t))});break;case"tem um dos":t.forEach(t=>{const n=te(t,e.keyName,"");n&&e.value.map(e=>Ko(e.id)).includes(Ko(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=Zo[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=Zo[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=>{(Zo[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=Zo[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}),Se(t),ze(tt(t)),Pe(0),Be(1),localStorage.setItem(Ho,JSON.stringify(e)),Ye(t)}return J(()=>{const e=Re*Oe,t=ke.slice(e,e+Oe);let r={};t.forEach((e,t)=>{o.forEach(n=>{r[t]=!0===r[t]||(te(e,n?.keyName,"")??"Não Informado").toString().length>=ne})}),Ue(r)},[ke,Oe,Re]),J(()=>{console.log(Qe.current)},[Qe.current]),ye?t(i,{bgcolor:"#fff2c8",color:"#3e3129",padding:2,marginX:2,borderRadius:4,children:e(ee,{fontSize:24,textAlign:"center",fontFamily:"Inter",children:[403===ye.status&&"Acesso negado",500===ye.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"})]})})]})]})}):he?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})]}))}))]})}):!we&&y?t(g,{}):e(r,{children:[e(i,{marginX:Ze?le:ie,bgcolor:"white",p:2,borderRadius:6,...me,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(je,{InputProps:{startAdornment:t(Ae,{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 Se(Ee),void ze(tt(rt(ke)));const r=rt(ke),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))}Uo(e.toLowerCase()).includes(Uo(t.toLowerCase()))&&(o=!0)}),o&&n.push(e)}),Se(n),ze(tt(n)),Pe(0),Be(1)},fullWidth:!0,placeholder:`Pesquisar ${d}`}),ce.length>0&&t(l,{startIcon:t(F,{}),variant:"contained",onClick:e=>Bo.open(t(ti,{reset:ct,filtrar:dt,baseFilters:[...ce],filters:localStorage.getItem(Ho)?JSON.parse(localStorage.getItem(Ho)):[...ce]},Ge)),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(qo,{data:de.map(e=>({name:e.label,onClick:()=>function(e){let t=[...ke];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(Jo){if(n<o)return-1;if(n>o)return 1}else{if(n>o)return-1;if(n<o)return 1}return 0}),Jo=!Jo,Se(t)}(e)})),btProps:{startIcon:t(z,{}),fullWidth:!0},children:"Ordenar"}),t(l,{variant:"contained",fullWidth:!0,startIcon:t(Go?_:z,{}),sx:{backgroundColor:"#637082",":hover":{backgroundColor:"#3c4757"},textTransform:"capitalize",borderRadius:3,padding:{md:"0px 8px"}},onClick:function(){let e={};for(let t=0;t<N;t++)e[t]=!Go;Xe(e),_e(e),Go=!Go},children:Go?"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 ",Re*Oe+1,"-",Re*Oe+1+it().length-1," de ",ke.length]})})]})]}),localStorage.getItem(Ho)&&t(i,{display:"inline-flex",flexWrap:"wrap",padding:.5,borderRadius:4,marginBottom:1,children:JSON.parse(localStorage.getItem(Ho)??"[]").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(M,{onClick:e=>{let t=JSON.parse(localStorage.getItem(Ho)??"[]");t=t.map(e=>e.label===r.label?{...e,value:"",...e.value2?{value2:""}:{}}:e),dt(t)},size:"small",sx:{padding:0},children:t(De,{sx:{fill:"white"}})})]}))}),t(a,{spacing:.2,children:it().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:Ce?s.user:s.public})}):it().map((s,c)=>t(b,{sx:{padding:.5,backgroundColor:c%2==0?"#F8FAFC":"white",paddingTop:2,paddingBottom:ge?2:.5,borderTop:"solid 1.5px #E2E8F0",position:"relative"},elevation:0,children:e(Te,{container:!0,spacing:Ze?2:0,paddingX:2,rowSpacing:2,children:[o.map(o=>e(Te,{item:!0,xs:12,md:et?12/m*(o.size?o.size:1):n?n.all:12/m*(o.size?o.size:1),sx:{overflow:"hidden"},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(D,{in:ge||!0===We[c],collapsedSize:ge?"auto":oe,onExited:e=>Xe(e=>({...e,[c]:!1})),children:t(i,{sx:{wordWrap:"break-word",color:"#1E293B",fontSize:16},fontFamily:"Inter",children:o.customComponent?o.customComponent(te(s,o.keyName),s):e(r,{children:[t(i,{color:"transparent",sx:{pointerEvents:"none",userSelect:"none"},children:te(s,o.keyName,"")}),t(i,{position:"absolute",top:0,children:ge||Ke[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(Te,{item:!0,xs:12,md:et?12/m:n?n.action:12/m,children:t(a,{direction:"row",alignItems:"center",justifyContent:Ze?"start":"flex-end",sx:{height:"100%",paddingBottom:Ze?2:0},children:p(s)})}),qe[c]&&!ge&&t(a,{direction:"row",justifyContent:"flex-end",bottom:0,width:"100%",children:t(l,{onClick:e=>{_e(e=>({...e,[c]:!e[c]})),Xe(e=>({...e,[c]:!0}))},sx:{padding:0,color:"#637082",textTransform:"capitalize"},startIcon:t(We[c]?L:B,{}),children:We[c]?"Ver Menos":"Ver Mais"})})]})},c))}),it().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(Ve,{}),variant:"contained",size:"small",onClick:at,sx:{backgroundColor:"#5a88b0",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:Y}),$&&t(l,{startIcon:t(Ve,{}),variant:"contained",size:"small",onClick:st,sx:{backgroundColor:"#64748B",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:I}),t(l,{startIcon:t(Ve,{}),variant:"contained",size:"small",onClick:e=>at(e,!0),sx:{backgroundColor:"#22C55E",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:E})]})})]}),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=>Be(e=>e>1?e-1:1),sx:{bgcolor:"white",borderRadius:"50px",height:"40px",width:"40px",minWidth:0,border:"solid 1px #E2E8F0"},children:t(Ie,{sx:{transform:"scale(1.5) scaleX(-1)"}})}),t($e,{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:Fe,siblingCount:Ze?0:6,size:"large",onChange:nt,page:Le,shape:"circular",variant:"outlined",sx:{".MuiPagination-ul":{backgroundColor:"white",border:"solid 1px #E2E8F0",borderRadius:"50px",paddingX:.25,paddingY:.5}}}),t(l,{onClick:e=>Be(e=>e<Fe?e+1:Fe),sx:{bgcolor:"white",borderRadius:"50px",height:"40px",width:"40px",minWidth:0,border:"solid 1px #E2E8F0"},children:t(Ie,{sx:{transform:"scale(1.5)"}})})]})})]})}function ti({filters:r,baseFilters:n,filtrar:o,reset:s}){const[c,d]=H(r),[u,m]=H(!1),[p,f]=U.useState(null),h=Boolean(p);return e(i,{width:{xs:"inherit",md:850},children:[t(E,{open:h,onClose:()=>{f(null)},anchorEl:p,children:n.map(e=>t(Y,{onClick:t=>{var r;r=e,d(e=>[...e,r]),f(null)},children:e.label}))}),e(a,{direction:"row",justifyContent:"space-between",children:[t(ee,{fontWeight:700,fontSize:18,children:"Filtrar"}),t(l,{startIcon:t(W,{}),sx:{textTransform:"capitalize"},onClick:e=>{s(),Bo.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(ri,{filterValue:e,setReset:m,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(ri,{filterValue:e,setReset:m,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(Ae,{}),sx:{textTransform:"capitalize"},onClick:e=>{o(c),Bo.close()},children:"Filtrar"})})]})}function ri({filterValue:r,setDt:n,idx:o}){const[i,l]=H(r.operator),[s,c]=H(r),d=f(),u=h(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(A,{sx:{width:"100%"},children:[u&&t(ee,{children:r.label}),t(T,{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(ni,{filterValue:r,operator:s.operator,onChange:(e,t="value")=>{c(r=>({...r,[t]:e}))}})]})}function ni({filterValue:n,operator:o,onChange:a}){switch(n.type){case"number":return t(je,{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(je,{...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(je,{...e,size:"small",placeholder:"Escolha um valor",fullWidth:!0,sx:{bgcolor:"white"}}),fullWidth:!0})})}return t(je,{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(je,{...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(je,{...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(je,{...e,size:"small",fullWidth:!0})})]})}}return t(r,{})}var oi=/*#__PURE__*/U.memo(ei);function ii({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 ai({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 li=(e,t)=>{if(e.length<=0)return 1;let r=e.length/t;return r=r<1?1:r,Math.ceil(r)};function si(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/g,"")}function ci(e){return("string"!=typeof e?e.toString():e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim()}function di({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?ci(n)===ci(e.value.id)&&t.push(r):ci(n)===ci(e.value)&&t.push(r)});break;case"contem":d.forEach(r=>{const n=te(r,e.keyName,"");n&&(e.useList?ci(n).includes(ci(e.value.id))&&t.push(r):ci(n).includes(ci(e.value))&&t.push(r))});break;case"tem um dos":d.forEach(r=>{const n=te(r,e.keyName,"");n&&e.value.map(e=>ci(e.id)).includes(ci(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=>{const o=(r[e.customFunc](te(n,e.keyName,""))??[]).filter(e=>void 0!==e&&""!==e);o.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(li(d,c)),o(0),l(1),localStorage.setItem(n,JSON.stringify(e)),a(d)}function ui({order:e,list:t,orderAsc:r=!1}){const n=Fe(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});return n}function mi({filters:r,baseFilters:n,filtrar:o,reset:s}){const[c,d]=H(r),[u,m]=H(!1),[p,f]=U.useState(null),h=Boolean(p);return e(i,{width:{xs:"inherit",md:850},children:[t(E,{open:h,onClose:()=>{f(null)},anchorEl:p,children:n.map(e=>t(Y,{onClick:t=>{var r;r=e,d(e=>[...e,r]),f(null)},children:e.label}))}),e(a,{direction:"row",justifyContent:"space-between",children:[t(ee,{fontWeight:700,fontSize:18,children:"Filtrar"}),t(l,{startIcon:t(W,{}),sx:{textTransform:"capitalize"},onClick:e=>{s(),Bo.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(pi,{filterValue:e,setReset:m,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(pi,{filterValue:e,setReset:m,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(Ae,{}),sx:{textTransform:"capitalize"},onClick:e=>{o(c),Bo.close()},children:"Filtrar"})})]})}function pi({filterValue:r,setDt:n,idx:o}){const[i,l]=H(r.operator),[s,c]=H(r),d=f(),u=h(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(A,{sx:{width:"100%"},children:[u&&t(ee,{children:r.label}),t(T,{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(fi,{filterValue:r,operator:s.operator,onChange:(e,t="value")=>{c(r=>({...r,[t]:e}))}})]})}function fi({filterValue:n,operator:o,onChange:a}){switch(n.type){case"number":return t(je,{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(je,{...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(je,{...e,size:"small",placeholder:"Escolha um valor",fullWidth:!0,sx:{bgcolor:"white"}}),fullWidth:!0})})}return t(je,{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(je,{...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(je,{...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(je,{...e,size:"small",fullWidth:!0})})]})}}return t(r,{})}let hi=!1,gi="",yi={},bi="";function vi({mediaQueryLG:n,columns:o,csvConfig:s,fetchFunc:c,emptyMsg:d={user:"Nenhum dado encontrado",public:"Nenhum dado encontrado"},dataPath:u="",tableName:m="Dado",columnSize:p,action:y,useKC:v=!0,itemCount:x=10,expandTextMaxLength:C=50,collapsedSize:w=53,customMargin:k=4,customMarginMobile:S=0,filtersFunc:E,filters:Y=[],orderBy:O=[],customErrorMsg:I,customTableStyle:A={},id:T,initialData:$=null,isExpandable:j=!0,alwaysExpanded:N=!1}){const[R,P]=H(!1),[W,q]=H(null),[U,K]=H($),{user:Z,userLoaded:re}=X(ot),[ne,oe]=H([]),[ie,ae]=H([]),[le,se]=H(x),[ce,de]=H(0),[ue,me]=H(1),[pe,fe]=H(1),[he,ge]=H({}),[ye,be]=H({}),[ve,xe]=H({}),[Ce,we]=H("filterKey"),ke=f(),Se=h(ke.breakpoints.only("xs")),Ee=Q(U),Ye=Q("true"===localStorage.getItem(`order-${T}`)||!1),Oe=h(ke.breakpoints.up(2e3));gi=`tableFilter_${T}`,bi=`tableFilterCache_${T}`,yi=E??{},localStorage.getItem(bi)||localStorage.setItem(bi,JSON.stringify(Y)),localStorage.getItem(bi)!==JSON.stringify(Y)&&(localStorage.setItem(bi,JSON.stringify(Y)),localStorage.removeItem(gi)),J(()=>{q(null),c&&(!re&&v||(P(!0),c().then(e=>e.ok?e.json().then(e=>{if(204===e.statusCode)K({body:{data:[]}}),Ee.current=[];else if(403===e.statusCode)q({status:e.statusCode});else{let t=u?te(e,u):e;if(t&&Array.isArray(t)){let e=t;if(localStorage.getItem(`order-data-${T}`))try{e=ui({order:JSON.parse(localStorage.getItem(`order-data-${T}`)),list:t,orderAsc:Ye.current})}catch(e){console.log(e)}else O.length>0&&(e=ui({order:O[0],list:t,orderAsc:Ye.current}));K(e),Ee.current=JSON.parse(JSON.stringify(e))}else K({body:{data:[]}}),Ee.current=[]}P(!1)}):(q({status:500}),void P(!1))).catch(e=>{q({status:500})})))},[re,c]);const Me=G(e=>Array.isArray(e)?e:"object"==typeof e?te(e,u):void 0,[]);J(()=>{if(R||W||!Me(U))return;let e=Me(U);oe(e),ae(e),me(li(e,le)),localStorage.getItem(gi)&&di({filterData:JSON.parse(localStorage.getItem(gi)),filtersFuncData:yi,localTableName:gi,setCurrentPage:de,setList:oe,setListClone:ae,setListPage:fe,setPagCount:me,startData:Ee.current,itemsCount:le})},[le,R,U,W]),J(()=>{de(pe-1)},[pe]);const Ne=G((e,t)=>{fe(t)},[]),Re=G(()=>{const e=ce*le;return ne.slice(e,e+le)},[ne,le,ce]);function Pe(){oe(Ee.current),ae(Ee.current),me(li(Ee.current,le)),de(0),fe(1),localStorage.removeItem(gi),we((new Date).getTime().toString())}J(()=>{const e=ce*le,t=ne.slice(e,e+le);let r={};t.forEach((e,t)=>{o.forEach(n=>{r[t]=!0===r[t]||(te(e,n.keyName,"")??"Não Informado").toString().length>=C})}),be(r)},[ne,le,ce]);const Fe=(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=ze.utils.json_to_sheet(n),i=ze.utils.book_new();return ze.utils.book_append_sheet(i,o,t.fileName),ze.writeFile(i,`${t.fileName}.xlsx`),Promise.resolve()}catch(e){return Promise.reject(e)}}(e,{...s,...t?{downloadAll:!0}:{}},JSON.parse(localStorage.getItem(gi)??"[]")||[])},Le=e=>{di({filterData:e,filtersFuncData:yi,localTableName:gi,setCurrentPage:de,setList:oe,setListClone:ae,setListPage:fe,setPagCount:me,startData:Ee.current,itemsCount:le})};return W?t(ii,{customErrorMsg:I,error:W}):R?t(ai,{tableName:m}):!re&&v?t(g,{}):e(r,{children:[e(i,{marginX:Se?S:k,bgcolor:"white",p:2,borderRadius:6,...A,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(je,{InputProps:{startAdornment:t(Ae,{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 oe(ie),void me(li(Me(ne),le));const r=[];ie.forEach(e=>{const n=[];if(Object.keys(e).map(t=>{let r=te(e,t,"")??"";"number"==typeof r&&(r=r.toString()),"string"==typeof r&&n.push(r)}),n.length<=0)return;let o=!1;n.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))}si(e.toLowerCase()).includes(si(t.toLowerCase()))&&(o=!0)}),o&&r.push(e)}),oe(r),me(li(r,le)),de(0),fe(1)},fullWidth:!0,placeholder:`Pesquisar ${m}`}),t(l,{startIcon:t(F,{}),variant:"contained",onClick:e=>Bo.open(t(mi,{reset:Pe,filtrar:e=>Le(e),baseFilters:[...Y],filters:localStorage.getItem(gi)?JSON.parse(localStorage.getItem(gi)):[...Y]},Ce)),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(qo,{data:O.map(e=>({name:e.label,onClick:()=>(e=>{Ye.current=!Ye.current;const t=ui({order:e,list:ne,orderAsc:Ye.current});localStorage.setItem(`order-${T}`,Ye.current.toString()),localStorage.setItem(`order-data-${T}`,JSON.stringify(e)),oe(t)})(e)})),btProps:{startIcon:t(z,{}),fullWidth:!0},children:"Ordenar"}),j&&!N&&t(l,{variant:"contained",fullWidth:!0,startIcon:t(hi?_:z,{}),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]=!hi;xe(e),ge(e),hi=!hi},children:hi?"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 ",m,"s"]}),t(a,{justifyContent:"center",children:e(ee,{children:["Exibindo ",ce*le+1,"-",ce*le+1+Re().length-1," de ",ne.length]})})]})]}),localStorage.getItem(gi)&&t(i,{display:"inline-flex",flexWrap:"wrap",padding:.5,borderRadius:4,marginBottom:1,children:JSON.parse(localStorage.getItem(gi)??"[]").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(M,{onClick:e=>{let t=JSON.parse(localStorage.getItem(gi)??"[]");t=t.map(e=>e.label===r.label?{...e,value:"",...e.value2?{value2:""}:{}}:e),Le(t)},size:"small",sx:{padding:0},children:t(De,{sx:{fill:"white"}})})]}))}),t(a,{spacing:.2,children:Re().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:Z?d.user:d.public})}):Re().map((s,c)=>t(b,{sx:{padding:.5,backgroundColor:c%2==0?"#F8FAFC":"white",paddingTop:2,paddingBottom:N?2:.5,borderTop:"solid 1.5px #E2E8F0",position:"relative"},elevation:0,children:e(Te,{container:!0,spacing:Se?2:0,paddingX:2,rowSpacing:2,children:[o.map(o=>e(Te,{item:!0,xs:12,md:Oe?12/p*(o.size?o.size:1):n?n.all:12/p*(o.size?o.size:1),sx:{overflow:"hidden"},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(D,{in:N||!0===he[c],collapsedSize:N?"auto":w,onExited:e=>xe(e=>({...e,[c]:!1})),children:t(i,{sx:{wordWrap:"break-word",color:"#1E293B",fontSize:16},fontFamily:"Inter",children:o.customComponent?o.customComponent(te(s,o.keyName),s):e(r,{children:[t(i,{color:"transparent",sx:{pointerEvents:"none",userSelect:"none"},children:te(s,o.keyName,"")}),t(i,{position:"absolute",top:0,children:N||ve[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(Te,{item:!0,xs:12,md:Oe?12/p:n?n.action:12/p,children:t(a,{direction:"row",alignItems:"center",justifyContent:Se?"start":"flex-end",sx:{height:"100%",paddingBottom:Se?2:0},children:y(s)})}),ye[c]&&!N&&t(a,{direction:"row",justifyContent:"flex-end",bottom:0,width:"100%",children:t(l,{onClick:e=>{ge(e=>({...e,[c]:!e[c]})),xe(e=>({...e,[c]:!0}))},sx:{padding:0,color:"#637082",textTransform:"capitalize"},startIcon:t(he[c]?L:B,{}),children:he[c]?"Ver Menos":"Ver Mais"})})]})},c))}),Re().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(gi)??"[]").filter(e=>e.value||"entre"===e.operator&&(e.value||e.value2)).length>0&&t(l,{startIcon:t(Ve,{}),variant:"contained",size:"small",onClick:e=>Fe(ne),sx:{backgroundColor:"#a5a5a5",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:"Baixar Filtrados"}),t(l,{startIcon:t(Ve,{}),variant:"contained",size:"small",onClick:e=>Fe(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=>fe(e=>e>1?e-1:1),sx:{bgcolor:"white",borderRadius:"50px",height:"40px",width:"40px",minWidth:0,border:"solid 1px #E2E8F0"},children:t(Ie,{sx:{transform:"scale(1.5) scaleX(-1)"}})}),t($e,{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:ue,siblingCount:Se?0:6,size:"large",onChange:Ne,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=>fe(e=>e<ue?e+1:ue),sx:{bgcolor:"white",borderRadius:"50px",height:"40px",width:"40px",minWidth:0,border:"solid 1px #E2E8F0"},children:t(Ie,{sx:{transform:"scale(1.5)"}})})]})})]})}var xi=/*#__PURE__*/U.memo(vi);const Ci=Le(()=>import("./Map-31d95a26.js").then(e=>e.Map),{ssr:!1});function wi({links:n,title:s,img:c,pos:d="fixed",next:u=!0,el:m,menuItems:p,paddingBottom:f=0,logoutMsg:h="Sair",logoutFunc:g,...y}){let b;u&&(b=Ge());const{user:v,login:x,logout:C,type:w}=X(ot),[k,S]=H(null),[O,D]=H(null),V=Boolean(k),I=Boolean(O),[A,T]=H(!1),N=G(e=>{S(e.currentTarget)},[]),R=G(()=>{S(null)},[]),P=G((e,t)=>{T(!0),S(null),b?b.push({pathname:t}).finally(()=>T(!1)):T(!1)},[b]);return e(r,{children:[e(i,{position:d,sx:{width:"100%",zIndex:100},children:[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(Xe,{href:"/",children:u?t(Ke,{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(M,{onClick:N,children:t(_e,{})}),t(E,{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,T(!0),void(b?b.push({pathname:r}).finally(()=>T(!1)):T(!1));var r},sx:{textTransform:"capitalize"},children:e.name})},`navigation${e.path}`))}),e(a,{direction:"row",spacing:2,children:[t(i,{children:m}),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(E,{open:I,onClose:e=>D(null),anchorEl:O,disableScrollLock:!0,transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"},sx:{".MuiMenu-paper":{borderRadius:4}},children:[p,t(Y,{onClick:function(e){try{function t(){C()}D(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(We,{sx:{fill:"#545454"}}),t(o,{textTransform:"capitalize",children:h})]})})]})]}),e(a,{direction:"row",spacing:.4,alignItems:"center",onClick:e=>D(e.currentTarget),sx:{userSelect:"none"},children:[t(o,{children:"Olá,"}),t(o,{fontWeight:600,children:v?.given_name}),t(Be,{})]})]}):t(l,"govbr"===w?{variant:"contained",size:"small",startIcon:t(qe,{}),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(qe,{}),onClick:x,sx:{color:"white",textTransform:"inherit",borderRadius:50,paddingX:2},children:t(o,{fontWeight:600,fontSize:15,padding:.4,children:"Entrar"})})]})]})]})}),A&&t(Ue,{})]}),t(i,{paddingBottom:f})]})}function ki(e,t){return"/"===t?e===t:e.startsWith(t)}function Si({links:n,title:s,img:c,pos:d="fixed",next:u=!0,el:m,menuItems:p,color:f="blue",route:h="/teste/89",paddingBottom:g=0,logoutMsg:y="Sair",logoutFunc:b,...v}){let x;u&&(x=Ge());const{user:C,login:w,logout:k,type:S}=X(ot),[O,D]=H(null),[V,I]=H(null),A=Boolean(O),T=Boolean(V),[N,R]=H(!1),P=G(e=>{D(e.currentTarget)},[]),F=G(()=>{D(null)},[]),z=G((e,t)=>{R(!0),D(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($,{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(Xe,{href:"/",children:u?t(Ke,{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?ki(x?.pathname??"",e.path)?`solid 4px ${f}`:"":ki(h,e.path)?`solid 4px ${f}`:"",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(M,{onClick:P,children:t(_e,{})}),t(E,{open:A,onClose:F,anchorEl:O,children:n.map((e,r)=>t(Y,{onClick:t=>z(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:m}),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(E,{open:T,onClose:e=>I(null),anchorEl:V,disableScrollLock:!0,transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"},sx:{".MuiMenu-paper":{borderRadius:4}},children:[p,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(We,{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(Be,{})]})]}):t(l,"govbr"===S?{variant:"contained",size:"small",startIcon:t(qe,{}),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(qe,{}),onClick:w,sx:{color:"white",textTransform:"inherit",borderRadius:50,paddingX:2},children:t(o,{fontWeight:600,fontSize:15,padding:.4,children:"Entrar"})})]})})]})}),N&&t(Ue,{})]}),t(i,{paddingBottom:g})]})}function Ei({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:m,unregister:p,getValues:f}=ce(),[h,g]=H([]);return t(at.Provider,{value:{formRegister:i,formWatch:d,formReset:c,formControl:l,formSetValue:m,formTrigger:u,formUnregister:p,formGetValues:f,formHandleSubmit:a,setFilesUid:g,formState:s,errors:s?.errors,submiting:o},children:t("form",{method:n,onSubmit:a(e=>r(e,h),()=>Ye("Formulário incompleto! Verifique os campos marcados e tente novamente.",{type:"warning",position:"top-right",theme:"colored"})),children:e})})}function Yi({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),[m,p]=H(null),f=Ge(),h=!!s;return J(()=>{const t=new He({url:e,realm:r,clientId:n});p(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=f.query.status;o&&"success"===o&&window.history.replaceState(null,"","/")},[]),t(ot.Provider,{value:{user:s,isAuth:h,userLoaded:d,login:function(){console.log("Tentando logar..."),console.log("KC: ",{instancia:m,logado:m?.authenticated,client_id:m?.clientId}),m?.login({redirectUri:l})},logout:function(){u(!1),m?.logout(),c(null),localStorage.removeItem("user-data.img")},saveUserData:()=>{},type:i},children:o})}const Oi="nextauth.token",Mi="user-data.img";function Di({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(),[m,p]=H(!1),f=Ge(),h=!!d;function g(){p(!1),f.replace(s).finally(()=>{u(null),Ze(Oi),localStorage.removeItem(Mi),p(!0)})}return J(()=>{const e=Je(Oi);e?fetch(`${r}${i}`,{method:"POST",headers:{Authorization:`Bearer ${e}`}}).then(t=>{if(t.ok){const t=et(e),r=localStorage.getItem(Mi);u({name:t.given_name,image:r??"",roles:t.roles.map(e=>e.code),token:e}),p(!0)}else g()}):p(!0)},[]),t(ot.Provider,{value:{user:d,isAuth:h,userLoaded:m,login:function(){if(!location||"localhost"!==location.hostname&&location.hostname!==l)p(!1),f.replace(c);else{const e=a;Qe(Oi,e),u({name:"Teste",image:"",roles:[1],token:e}),f.replace(o).finally(()=>p(!0))}},logout:g,saveUserData:function(e){try{const t=e.ssp_token;Qe(Oi,t);const r=et(t),n=et(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(Mi,e),u({name:r.name,image:e,roles:r.roles.map(e=>e.code),token:t}),f.replace(o).finally(()=>p(!0))}}),u({name:r.name,image:"",roles:r.roles.map(e=>e.code),token:t}),f.replace(o).finally(()=>p(!0))})).then(function(){f.replace(o).finally(()=>p(!0))})}catch(e){return Promise.reject(e)}},type:"govbr"},children:e})}function Vi(n){return e(r,{children:[t(Wo,{}),n.children,t(Oe,{position:"bottom-right",theme:"colored"})]})}export{Oi as AUTH_COOKIE_NAME,Co as ActiveInput,ot as AuthContext,wo as AutoComplete,_o as Button,tt as Category,lt as CheckBox,ct as CheckBoxAdditional,dt as CheckBoxWarning,pt as DatePicker,uo as DropFileUpload,So as FetchAutoComplete,rt as Field,nt as FieldLabel,it as File,mo as FileUpload,Yo as FixedAutoComplete,at as FormContext,Ei as FormProvider,ft as GenericDatePicker,Mo as GenericFetchAutoComplete,Ao as GenericInput,Vo as GenericMaskInput,To as GenericMultInput,oi as GenericTable,xo as Input,Yi as KeycloakAuthProvider,Bo as MODAL,Ci as Map,bo as MaskInput,qo as Menu,$o as MultInput,wi as NavBar,Di as OAuthProvider,jo as OtherCheckBox,mt as RequiredCheckBoxGroup,Vi as SspComponentsProvider,Po as Stepper,Lo as StepperBlock,fo as Switch,go as SwitchWatch,Si as TabNavBar,xi as Table,ht as TimePicker,ho as ToggleVisibility};
3
3
  //# sourceMappingURL=index.esm.js.map