biblio-react 1.7.10 → 1.7.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("react"),r=e(require("@material-ui/icons/Lock")),n=e(require("@material-ui/icons/VpnLock")),a=require("react-admin"),o=require("react-redux"),i=require("prop-types"),l=e(i),c=require("@material-ui/core"),s=e(require("@material-ui/core/Dialog")),u=e(require("@material-ui/core/DialogActions")),d=e(require("@material-ui/core/DialogContent")),m=e(require("@material-ui/core/DialogContentText")),p=e(require("@material-ui/core/DialogTitle")),f=e(require("@material-ui/core/Paper")),g=require("@material-ui/core/styles"),h=e(require("@material-ui/core/Typography")),b=require("@material-ui/data-grid"),v=e(require("@material-ui/icons/Add")),E=e(require("@material-ui/icons/Cancel")),C=e(require("@material-ui/icons/Delete")),y=e(require("@material-ui/icons/Edit")),x=e(require("@material-ui/core/TableContainer")),k=require("react-final-form"),S=e(require("@material-ui/core/Divider")),T=e(require("@material-ui/core/Tab")),F=e(require("@material-ui/core/Tabs")),N=e(require("@material-ui/core/styles/makeStyles")),R=e(require("@material-ui/icons/ChevronLeft")),P=e(require("date-fns/locale/en-US")),I=e(require("date-fns/locale/es")),w=e(require("moment")),q=e(require("@material-ui/core/IconButton")),M=require("@material-ui/core/styles/colorManipulator"),B=e(require("@material-ui/core/Tooltip")),D=e(require("classnames")),L=e(require("@material-ui/core/Button")),O=e(require("@material-ui/icons/Settings")),_=e(require("@material-ui/core/Collapse")),A=e(require("@material-ui/core/List")),V=e(require("@material-ui/core/ListItemIcon")),W=e(require("@material-ui/core/MenuItem")),G=e(require("@material-ui/icons/ExpandMore")),z=e(require("@material-ui/core/Avatar")),j=e(require("@material-ui/core/Card")),H=e(require("@material-ui/core/CardActions")),U=e(require("@material-ui/core/CircularProgress")),J=e(require("@material-ui/core/TextField")),Q=require("@material-ui/styles"),Z=require("react-router-dom"),K=e(require("@material-ui/core/Menu")),Y=e(require("ra-language-english")),X=e(require("@blackbox-vision/ra-language-spanish")),$=e(require("@material-ui/icons/Check")),ee=e(require("@material-ui/icons/RemoveCircleOutline")),te=e(require("@material-ui/icons/Search")),re=e(require("@material-ui/icons/CheckCircle")),ne=e(require("@material-ui/icons/ErrorOutline")),ae=e(require("react-draggable")),oe=require("devextreme-react"),ie=require("react-admin-date-inputs");function le(){return(le=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function ce(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)t.indexOf(r=o[n])>=0||(a[r]=e[r]);return a}var se=t.forwardRef(function(e,i){var l=a.useTranslate(),c=o.useSelector(function(e){return[e.admin.resources.form_275?1:0,e.admin.resources.form_59?1:0]}),s=c[1];return[c[0]?t.createElement(a.MenuItemLink,{ref:i,key:"/form_275",to:"/form_275",primaryText:l("pos.change_pin"),leftIcon:t.createElement(r,null),onClick:e.onClick}):null,s?t.createElement(a.MenuItemLink,{ref:i,key:"/form_59",to:"/form_59",primaryText:l("pos.change_password"),leftIcon:t.createElement(n,null),onClick:e.onClick}):null]}),ue=function(e){return t.createElement(a.UserMenu,e,t.createElement(se,null))},de=function(e){return t.createElement(a.AppBar,le({},e,{elevation:1,userMenu:t.createElement(ue,null)}))},me=function(e,t){return a.useGetOne(e,"-1",t)},pe=g.makeStyles(function(e){return{root:{"& .MuiDataGrid-columnsContainer":{backgroundColor:"light"===e.palette.type?"#fafafa":"#1d1d1d"},"& .MuiDataGrid-iconSeparator":{display:"none"}},header:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.light},rootPaper:{width:"100%",height:"40vh",borderRadius:0,marginTop:e.spacing(1)},rootOverlay:{flexDirection:"column","& .ant-empty-img-1":{fill:"light"===e.palette.type?"#aeb8c2":"#262626"},"& .ant-empty-img-2":{fill:"light"===e.palette.type?"#f5f5f7":"#595959"},"& .ant-empty-img-3":{fill:"light"===e.palette.type?"#dce0e6":"#434343"},"& .ant-empty-img-4":{fill:"light"===e.palette.type?"#ffffff":"#1c1c1c"},"& .ant-empty-img-5":{fillOpacity:"light"===e.palette.type?"0.8":"0.08",fill:"light"===e.palette.type?"#f5f5f5":"#ffffff"}},label:{marginTop:e.spacing(1)},deleteButton:{color:e.palette.error.main,"&:hover":{backgroundColor:c.alpha(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}},{name:"GE"}),fe=function(){var e=pe();return t.createElement(b.GridOverlay,{className:e.rootOverlay},t.createElement("svg",{width:"120",height:"100",viewBox:"0 0 184 152","aria-hidden":!0,focusable:"false"},t.createElement("g",{fill:"none",fillRule:"evenodd"},t.createElement("g",{transform:"translate(24 31.67)"},t.createElement("ellipse",{className:"ant-empty-img-5",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),t.createElement("path",{className:"ant-empty-img-1",d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z"}),t.createElement("path",{className:"ant-empty-img-2",d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z"}),t.createElement("path",{className:"ant-empty-img-3",d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z"})),t.createElement("path",{className:"ant-empty-img-3",d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z"}),t.createElement("g",{className:"ant-empty-img-4",transform:"translate(149.65 15.383)"},t.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),t.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"})))),t.createElement("div",{className:e.label},"No hay registros"))},ge=function(e,t,r){return a.useMutation({type:"deleteEtrRow",resource:e,payload:{params:t}},r)},he=function(e,t,r,n){return a.useMutation({type:e,resource:t,payload:{params:r}},n)},be=["api","basePath","classes","className","confirmTitle","confirmContent","icon","record","redirect","onSuccess","onFailure","source","camposClaveFila"],ve=["filterBy","claves","sortModel","columns","reference","allowAdd","allowRemove","etrResource","enableLoad"],Ee=g.makeStyles(function(e){return{root:{"& .MuiDataGrid-columnsContainer":{backgroundColor:"light"===e.palette.type?"#fafafa":"#1d1d1d"},"& .MuiDataGrid-iconSeparator":{display:"none"}},header:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.light},rootPaper:{width:"100%",height:"40vh",borderRadius:0,marginTop:e.spacing(1)},rootOverlay:{flexDirection:"column","& .ant-empty-img-1":{fill:"light"===e.palette.type?"#aeb8c2":"#262626"},"& .ant-empty-img-2":{fill:"light"===e.palette.type?"#f5f5f7":"#595959"},"& .ant-empty-img-3":{fill:"light"===e.palette.type?"#dce0e6":"#434343"},"& .ant-empty-img-4":{fill:"light"===e.palette.type?"#ffffff":"#1c1c1c"},"& .ant-empty-img-5":{fillOpacity:"light"===e.palette.type?"0.8":"0.08",fill:"light"===e.palette.type?"#f5f5f5":"#ffffff"}},label:{marginTop:e.spacing(1)},deleteButton:{color:e.palette.error.main,"&:hover":{backgroundColor:c.alpha(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}},{name:"EtrGrid"}),Ce={marginLeft:"1.6rem",fontWeight:"bold"},ye=t.createElement(C,null),xe=function(e){var r=e.basePath,n=e.confirmTitle,o=void 0===n?"ra.message.delete_title":n,i=e.confirmContent,l=void 0===i?"ra.message.delete_content":i,c=e.icon,s=void 0===c?ye:c,u=e.record,d=e.redirect,m=void 0!==d&&d,p=e.onSuccess,f=e.onFailure,g=e.source,h=e.camposClaveFila,b=ce(e,be),v=Ee(e),E=a.useNotify(),C=a.useDeleteWithConfirmController({record:u,redirect:m,basePath:r,onSuccess:p,onFailure:f}),y=C.open,x=C.loading,k=C.handleDialogOpen,S=C.handleDialogClose,T=ge(e.resource,{},{refresh:!0,onSuccess:function(e){if(e.error)throw new Error(e.error);E("ra.notification.deleted","info",{smart_count:1})},onFailure:function(e){E(e.message,"warning")}})[0],F=Object.keys(u).filter(function(e){return h.split(",").includes(e)}).reduce(function(e,t){return e[t]=u[t],e},{}),N=t.useCallback(function(e){T({payload:{ge:g,clavesFila:F}})},[u]);return t.createElement(t.Fragment,null,t.createElement(a.Button,le({key:"button",onClick:k,className:v.deleteButton},b),s),t.createElement(a.Confirm,{isOpen:y,loading:x,title:o,content:l,onConfirm:N,onClose:S}))},ke=function(e){return t.createElement(s,{open:e.open,onClose:e.onClose,fullWidth:!0},t.createElement(p,null,e.labelEstado+" "+e.label),t.createElement(m,null,t.createElement(h,{component:"span",display:"block",variant:"subtitle1",style:le({},Ce)},e.msgTitle),e.msgDesc),t.createElement(a.FormWithRedirect,{resource:e.resource,save:e.save,render:e.render,initialValues:e.initialValues}))};ke.propTypes={label:i.string,onClick:i.func,icon:i.any,open:i.bool,onClose:i.func,labelEstado:i.string,msgTitle:i.any,msgDesc:i.any,resource:i.any,save:i.func,render:i.func};var Se=function(e){return t.createElement(xe,{api:!0,confirmTitle:"ra.action.delete",source:e.source,record:e.row,resource:e.resource,camposClaveFila:e.camposClaveFila})},Te=function(e){var r=e.editors,n=e.record,o=e.clavesFila,i=e.camposClaveFila,l=e.resource,c=e.label,s=e.source,m=e.etrResource,p=a.useSafeSetState(!1),f=p[0],g=p[1],h=me(m,{enabled:f}).data,b=he("createEtrRow",l,{},{refresh:!0,onSuccess:function(e){if(e.error)throw new Error(e.error);g(!1),x("ra.notification.created","info")},onFailure:function(e){x(e.message,"warning")}}),C=b[0],y=b[1].loading,x=a.useNotify(),k=a.useTranslate()("ra.action.create"),S=function(e){C({payload:{data:le({},e,o),ge:s,camposClaveFila:i,estado:"N"}})},T=t.useMemo(function(){return{save:S,setOnFailure:function(e){return console.log(e)}}},[S]);return t.createElement(t.Fragment,null,t.createElement(a.Button,{onClick:function(e){g(!0),e.stopPropagation()}},t.createElement(v,null)),t.createElement(a.SaveContextProvider,{value:T},t.createElement(ke,{open:f,onClose:function(e){g(!1),e.stopPropagation()},labelEstado:k,label:c,msgTitle:e.msgTitle,msgDesc:e.msgDesc,resource:l,save:S,initialValues:h,render:function(e){var o=e.handleSubmitWithRedirect,i=e.pristine,c=e.saving;return t.createElement(t.Fragment,null,t.createElement(d,null,t.Children.map(r,function(e,r){return t.cloneElement(e,{resource:l,estado:"N",initialValue:n[e.props.source],fullWidth:!0,disabled:void 0!==e.props.disabled&&e.props.disabled,InputLabelProps:{shrink:!0}})})),t.createElement(u,null,t.createElement(a.SaveButton,{handleSubmitWithRedirect:o,pristine:i,saving:c,disabled:y}),t.createElement(a.Button,{label:"ra.action.cancel",onClick:function(e){g(!1),e.stopPropagation()},disabled:y},t.createElement(E,null))))}})))},Fe=function(e){var r=e.editors,n=e.clavesFila,o=e.camposClaveFila,i=e.resource,l=e.label,c=e.source,s=e.row,m=a.useNotify(),p=a.useTranslate(),f=a.useSafeSetState(!1),g=f[0],h=f[1],b=he("updateEtrRow",i,{},{refresh:!0,onSuccess:function(e){if(e.error)throw new Error(e.error);h(!1),m("ra.notification.updated","info",{smart_count:1})},onFailure:function(e){m(e.message,"warning")}}),v=b[0],C=b[1].loading,x=p("ra.action.edit");return t.createElement(t.Fragment,null,t.createElement(a.Button,{onClick:function(e){h(!0),e.stopPropagation()}},t.createElement(y,null)),t.createElement(ke,{open:g,onClose:function(e){h(!1),e.stopPropagation()},labelEstado:x,label:l,msgTitle:e.msgTitle,msgDesc:e.msgDesc,resource:i,save:function(e){v({payload:{data:le({},n,e),ge:c,camposClaveFila:o,estado:"M"}})},render:function(e){var n=e.handleSubmitWithRedirect,l=e.pristine,c=e.saving;return t.createElement(t.Fragment,null,t.createElement(d,null,t.Children.map(r,function(e,r){return t.cloneElement(e,{resource:i,estado:"M",initialValue:s[e.props.source],fullWidth:!0,disabled:-1!=o.indexOf(e.props.source),InputLabelProps:{shrink:!0}})})),t.createElement(u,null,t.createElement(a.SaveButton,{handleSubmitWithRedirect:n,pristine:l,saving:c,disabled:C}),t.createElement(a.Button,{label:"ra.action.cancel",onClick:function(e){h(!1),e.stopPropagation()},disabled:C},t.createElement(E,null))))}}))},Ne=c.createTheme({},b.esES),Re=["filterBy","sortModel","columns","reference","filter","enableLoad"],Pe=c.createTheme({},b.esES),Ie=t.createContext(),we=function(e){var r=e.children,n=t.useState(!1),a=n[0],o=n[1],i=t.useMemo(function(){return{open:a,show:function(){return o(!0)},hide:function(){return o(!1)}}},[a]);return t.createElement(Ie.Provider,{value:i},r)},qe=function(){return t.useContext(Ie)},Me=function(e,t,r,n){return{type:"RELOAD_CB",payload:{id:e,method:t,params:r,callback:n}}},Be=function(e,t){return{type:"RELOAD_CB_SUCCESS",payload:{id:e,callback:t}}},De=function(e,t){return{type:"HIDE_INPUT",payload:{id:e,hidden:t}}},Le=function(e,t){return{type:"DISABLE_INPUT",payload:{id:e,disabled:t}}},Oe=function(e,t){return{type:"REQUIRE_INPUT",payload:{id:e,required:t}}},_e=function(){var e=o.useDispatch();return t.useCallback(function(t,r,n,a){e(Me(t,r,n,a))},[e])},Ae=function(){var e=o.useDispatch();return t.useCallback(function(t,r){e(De(t,r))},[e])},Ve=function(){var e=o.useDispatch();return t.useCallback(function(t,r){e(Le(t,r))},[e])},We=function(){var e=o.useDispatch();return t.useCallback(function(t,r){e(Oe(t,r))},[e])},Ge=function(e,t,r,n){return a.useMutation({type:"getJson",resource:e,payload:{method:t,params:r}},n)},ze=function(e){var r=Ge(e),n=r[0],a=r[1].loading;return[t.useCallback(function(e,t,r){return n({payload:{params:t,method:e}},{returnPromise:!0,onSuccess:r,onFailure:r})},[]),a]},je=function(e){return{}},He=function(e){var t=a.useListContext(e),r=a.useNotify(),n=a.useRedirect(),o=a.useRefresh(),i=a.useUnselectAll(e.resource);return{ajax:ze(e.resource)[0],data:t,notify:r,redirect:n,refresh:o,unselectAll:i}},Ue=function(e){var t=_e(),r=Ae(),n=Ve(),o=We(),i=qe(),l=a.useNotify(),c=a.useRedirect();return{ajax:ze(e.resource)[0],notify:l,redirect:c,recargarComboBox:t,progress:i,setHidden:r,setDisable:n,setRequire:o}},Je=function(e){var t=_e(),r=Ae(),n=Ve(),o=We(),i=qe(),l=a.useNotify(),c=a.useRedirect();return{form:k.useForm(),ajax:ze(e.resource)[0],notify:l,redirect:c,recargarComboBox:t,progress:i,setHidden:r,setDisable:n,setRequire:o}},Qe=["isRowEditable"],Ze=["isRowEditable","primaryText","secondaryText","desktopSize","onRenderGrilla","onLoadGrilla","hasEdit"],Ke=g.makeStyles(function(e){return{container:{maxHeight:"70vh"},rowOdd:{backgroundColor:e.palette.action.hover}}},{name:"GrillaEtriek"}),Ye=function(e,t){return void 0===t||"function"==typeof t&&t(e)},Xe=function(e){var r=e.isRowEditable,n=ce(e,Qe);return Ye(e.record,r)?t.createElement(a.EditButton,n):null},$e=function(e){!function(e){var r=e.onRenderGrilla,n=e.onLoadGrilla,o=a.useVersion(),i=He(e);t.useEffect(function(){r&&r(i)},[]),t.useEffect(function(){n&&n(i)},[o])}(e);var r=c.useMediaQuery(function(e){return e.breakpoints.down("sm")}),n=Ke(e),o=a.useResourceDefinition(e).hasEdit,i=e.isRowEditable,l=e.primaryText,s=e.secondaryText,u=e.desktopSize,d=void 0!==u&&u,m=ce(e,Ze),p=e.children,f=t.Children.count(e.children),g=l,h=s;return l||(f>=4||f>=3||f>=2?g=function(e){return e[p[0].props.source]+" - "+e[p[1].props.source]}:1==f&&(g=function(e){return e[p[0].props.source]})),s||(f>=4?h=function(e){return e[p[2].props.source]+" - "+e[p[3].props.source]}:f>=3?h=function(e){return e[p[2].props.source]}:f>=2?g=function(e){return e[p[0].props.source]+" - "+e[p[1].props.source]}:1==f&&(g=function(e){return e[p[0].props.source]})),r&&!1===d?t.createElement(a.SimpleList,{linkType:function(e){return!(!o||!Ye(e,i))&&"edit"},primaryText:g,secondaryText:h}):t.createElement(x,{className:n.container},t.createElement(a.Datagrid,le({stickyHeader:!0},m),t.Children.map(p,function(e){return e.props.hidden?null:e}),o&&t.createElement(Xe,{isRowEditable:i})))},et=["ids"],tt=["filterValues","setFilters","tabs","GridComponent"],rt=["useFormulario"],nt=function(e){var t=e.useFormulario;return{fichaProps:(void 0===t?je:t)(ce(e,rt))}},at=["basePath","className","record","hasEdit","hasShow","hasList","resource","totalPages","showFilter","setSort","setPerPage","perPage","defaultTitle","setPage","setFilters","selectedIds","onUnselectItems","onToggleItem","loaded","loading","exporter","hideFilter","hasCreate","filterValues","displayedFilters","currentSort"],ot=["children","basePath","className","data","hasShow","hasList"],it=function(e){return e.split("_")[1]},lt=N(function(e){var t;return{form:{maxHeight:"70vh",overflow:"auto"},tab:{display:"block",maxHeight:"65vh",overflow:"auto"},contenido:(t={},t[e.breakpoints.up("md")]={width:"20vw"},t)}}),ct=a.required(),st=[ct,a.minValue(1)],ut=t.createContext({}),dt=["useFormulario","enableLoad"],mt=function(e){var r=e.enableLoad,n=void 0===r||r,o=ce(e,dt),i=a.useResourceContext(e),l=me(i,{enabled:n}),c=l.data,s=l.loading,u=nt(e).fichaProps,d=t.useMemo(function(){return{estado:"N",initialValues:c,loading:s,fichaProps:u}},[c,s,u]);return t.createElement(we,null,t.createElement(ut.Provider,{value:d},t.createElement(a.Create,le({},o,null==u?void 0:u.panel))))};mt.propTypes={useFormulario:l.func};var pt=["basePath","classes","filterValues","handleSubmit","handleSubmitWithRedirect","invalid","label","pristine","resource","saving","selectedIds","submitOnEnter","redirect"],ft=["resource","record","basePath","redirect","className","icon","label"],gt=g.makeStyles(function(e){return{deleteButton:{color:e.palette.error.main,"&:hover":{backgroundColor:M.alpha(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}}),ht=function(e){var r=gt(e),n=a.useTranslate(),o=e.resource,i=e.record,l=e.className,c=e.icon,s=e.label,u=void 0===s?"ra.action.delete":s,d=ce(e,ft),m=a.useDelete(o,i.id),p=m[0],f=m[1].loading;return t.createElement(B,{title:n("ra.action.delete")},t.createElement(q,le({disabled:f,onClick:p,label:u,className:D("ra-delete-button",r.deleteButton,l),key:"button"},ce(d,pt)),c))};ht.defaultProps={redirect:"list",icon:t.createElement(C,null)};var bt=["useFormulario"],vt=g.makeStyles(function(e){return{snackbarContent:{whiteSpace:"pre-wrap"}}}),Et=function(e){var r=vt(e);return t.createElement(a.Notification,le({},e,{className:r.snackbarContent}))},Ct=N(function(e){return{button:{margin:e.spacing(1)},input:{display:"none"}}}),yt=t.forwardRef(function(e,r){var n=e.isOpen,a=e.onConfirm,o=e.onClose,i=e.title,l=e.dialogText,c=e.children,f=e.hasAccept,g=void 0===f||f,h=e.hasCancel,b=void 0===h||h,v=e.loading,E=void 0!==v&&v,C=Ct(e),y=function(e){o&&o(e)};return t.createElement(s,{ref:r,open:n,fullWidth:!0,onClose:y,"aria-labelledby":"form-dialog-title"},t.createElement(p,{id:"form-dialog-title"},i),t.createElement(d,null,t.createElement(m,null,l),c),(g||b)&&t.createElement(u,null,b&&t.createElement(L,{onClick:y,variant:"contained",color:"secondary",className:C.button,disabled:E},"Cancelar"),g&&t.createElement(L,{onClick:function(e){a&&a(e)},variant:"contained",color:"primary",className:C.button,disabled:E},"Ok")))}),xt=g.makeStyles(function(e){return{block:{pointerEvents:"none",backgroundColor:"#ffffff",opacity:.6,position:"relative"},progress:{position:"absolute",left:"50%",top:"50%"}}}),kt=function(e){var r=xt(e),n=qe(),o=a.useResourceContext(e),i=t.useContext(ut),l=i.estado,s=i.loading,u=i.fichaProps,d=Je({resource:o});return t.useEffect(function(){u.onRenderFicha&&u.onRenderFicha(d,l)},[]),t.useEffect(function(){s||u.onLoadFicha&&u.onLoadFicha(d,l)},[s]),t.createElement(a.CardContentInner,{className:n.open?r.block:""},n.open&&t.createElement(c.CircularProgress,{className:r.progress,thickness:4,size:50}),e.children)},St=function(e){return t.createElement(kt,e)},Tt=["mutators"],Ft={setError:function(e,t){t.fields[e[0]].data=e[1]}},Nt=function(e){var r=t.useContext(ut),n=r.initialValues,o=r.fichaProps,i=o.onBeforeSubmitFicha,l=o.config,c=(l=void 0===l?{}:l).mutators,s=void 0===c?{}:c,u=ce(l,Tt),d=s===Ft?s:le({},Ft,s),m=Ue(e),p=a.useNotify(),f=t.useCallback(function(t,r,n){var a=i&&i(le({form:{values:t}},m),"N");return"string"==typeof a?void p(a,"warning"):void 0===a||a?e.save(t,r,n):void 0},[i,m]);return t.createElement(a.FormWithRedirect,le({},e,u,{save:f,mutators:d,initialValues:n,render:function(e){return t.createElement(a.SimpleFormView,le({component:St},e))}}))};Nt.propTypes=le({},a.SimpleForm.propTypes),Nt.defaultProps={margin:"normal",variant:"outlined"};var Rt=g.makeStyles(function(e){return{icon:{minWidth:e.spacing(5)},sidebarIsOpen:{paddingLeft:25,transition:"padding-left 195ms cubic-bezier(0.4, 0, 0.6, 1) 0ms"},sidebarIsClosed:{paddingLeft:0,transition:"padding-left 195ms cubic-bezier(0.4, 0, 0.6, 1) 0ms"}}}),Pt=function(e){var r=e.handleToggle,n=e.sidebarIsOpen,o=e.isOpen,i=e.name,l=e.icon,c=e.children,s=e.dense,u=a.useTranslate(),d=Rt(),m=t.createElement(W,{dense:s,button:!0,onClick:r},t.createElement(V,{className:d.icon},o?t.createElement(G,null):l),t.createElement(h,{variant:"inherit",color:"textSecondary"},u(i)));return t.createElement(t.Fragment,null,n||o?m:t.createElement(B,{title:u(i),placement:"right"},m),t.createElement(_,{in:o,timeout:"auto",unmountOnExit:!0},t.createElement(A,{dense:s,component:"div",disablePadding:!0,className:n?d.sidebarIsOpen:d.sidebarIsClosed},c),t.createElement(S,null)))},It=["items","translate"],wt={marginTop:"1.5em"},qt=function(e){var r=e.onMenuClick,n=e.dense,i=e.logout,l=a.useTranslate(),s=t.useState({mnuPrueba:!1}),u=s[0],d=s[1],m=c.useMediaQuery(function(e){return e.breakpoints.down("sm")}),p=c.useMediaQuery(function(e){return e.breakpoints.down("xs")}),f=o.useSelector(function(e){return e.admin.ui.sidebarOpen}),g=function e(r){var n=r.items,o=r.translate,i=ce(r,It),l=i.state,c=i.onMenuClick,s=i.handleToggle,u=i.dense,d=i.open;return n&&t.createElement(t.Fragment,null,n.map(function(r){var n=r.name,m=r.menu,p=r.label;return m?t.createElement(Pt,{key:n,name:p,handleToggle:function(){return s(n)},isOpen:l[n],sidebarIsOpen:d,icon:t.createElement(O,null),dense:u},e(le({items:m,translate:o},i))):t.createElement(a.MenuItemLink,{key:n,to:"/"+n,primaryText:o("resources."+n+".name",{_:p}),onClick:c,sidebarIsOpen:d,dense:u,leftIcon:t.createElement(O,null)})}))}({items:JSON.parse(localStorage.getItem("menus")),handleToggle:function(e){d(function(t){var r;return le({},t,((r={})[e]=!t[e],r))})},state:u,activeClassName:"",iconClass:"",className:"",open:f,dense:n,onMenuClick:r,translate:l});return t.createElement(a.Menu,{style:wt},t.createElement(a.DashboardMenuItem,{primaryText:l("ra.page.dashboard"),onClick:r,sidebarIsOpen:f}),g,p&&t.createElement(a.MenuItemLink,{to:"/configuration",primaryText:l("pos.configuration"),leftIcon:t.createElement(O,null),onClick:r,sidebarIsOpen:f,dense:n}),p&&i,!p&&m&&i)},Mt=le({},a.defaultTheme);Mt.palette.type="dark",Mt.overrides.RaSidebar={drawerPaper:{position:"sticky"}},Mt.overrides.RaRichTextInput={"@global":{".ra-rich-text-input":{"& .ql-editor":{"& p:not(:last-child)":{marginBottom:"0"}}}}};var Bt=le({},a.defaultTheme);Bt.palette.type="light",Bt.overrides.RaSidebar={drawerPaper:{position:"sticky"}},Bt.overrides.RaRichTextInput={"@global":{".ra-rich-text-input":{"& .ql-editor":{"& p:not(:last-child)":{marginBottom:"0"}}}}};var Dt={__proto__:null,lightTheme:Bt,darkTheme:Mt},Lt=["apiFolder"],Ot=function(e){return t.createElement(a.Sidebar,e)},_t=["className","exporter","filters","children","jsBotonGrilla"],At=["meta","input","render"],Vt=g.makeStyles(function(e){return{main:{display:"flex",flexDirection:"column",minHeight:"100vh",alignItems:"center",justifyContent:"flex-start",backgroundImage:function(e){return e.loginBackgroundImage},backgroundRepeat:"no-repeat",backgroundSize:"cover"},card:{minWidth:300,marginTop:"6em"},avatar:{margin:"1em",display:"flex",justifyContent:"center"},avatarIcon:{backgroundColor:e.palette.secondary.main},icon:function(t){return{position:"absolute",left:e.spacing(14-Math.ceil(t.textLength/2)-1)}},hint:{marginTop:"1em",display:"flex",justifyContent:"center",color:e.palette.grey[500]},form:{padding:"0 1em 1em 1em"},input:{marginTop:"1em"},actions:{padding:"0 1em 1em 1em"}}}),Wt=function(e){var r=e.meta,n=(r=void 0===r?{touched:!1,error:void 0}:r).touched,a=r.error,o=le({},e.input),i=ce(e,At);return t.createElement(J,le({error:!(!n||!a),helperText:n&&a},o,i,{fullWidth:!0}))},Gt=function(e){var n=e.loginBackgroundImage,o=e.nameSource,i=void 0===o?"username":o,l=e.passwordSource,c=void 0===l?"password":l,s=t.useState(!1),u=s[0],d=s[1],m=a.useTranslate(),p=m("ra.auth.sign_in"),f=Vt({loginBackgroundImage:n,textLength:p.length}),g=a.useNotify(),h=a.useLogin(),b=Z.useLocation();return t.createElement(k.Form,{onSubmit:function(e){d(!0),h(e,b.state?b.state.nextPathname:"/").catch(function(e){d(!1),g("string"==typeof e?e:void 0!==e&&e.message?e.message:"ra.auth.sign_in_error","warning")})},validate:function(e){var t={};return e[i]||(t[i]=m("ra.validation.required")),e[c]||(t[c]=m("ra.validation.required")),t},render:function(e){return t.createElement("form",{onSubmit:e.handleSubmit},t.createElement("div",{className:f.main},t.createElement(j,{className:f.card},t.createElement("div",{className:f.avatar},t.createElement(z,{className:f.avatarIcon},t.createElement(r,null))),t.createElement("div",{className:f.hint},"Inicio de Sesión"),t.createElement("div",{className:f.form},t.createElement("div",{className:f.input},t.createElement(k.Field,{autoFocus:!0,name:i,component:Wt,label:m("ra.auth.username"),disabled:u})),t.createElement("div",{className:f.input},t.createElement(k.Field,{name:c,component:Wt,label:m("ra.auth.password"),type:"password",disabled:u}))),t.createElement(H,{className:f.actions},t.createElement(L,{variant:"contained",type:"submit",color:"primary",disabled:u,fullWidth:!0},u&&t.createElement(U,{className:f.icon,size:18,thickness:2}),p))),t.createElement(a.Notification,null)))}})},zt=["displayedFilters","filterValues","showFilter"],jt=["className","options","icon"],Ht=g.makeStyles({root:{display:"inline-block"},paddingRight:{paddingRight:4}}),Ut=["fields","className","basePath","record","textAlign","sortable"],Jt=["useFormulario"],Qt=["basePath","children","className","classes","component","form","handleSubmit","handleSubmitWithRedirect","invalid","mutationMode","pristine","record","redirect","resource","saving","submitOnEnter","syncWithLocation","tabs","toolbar","undoable","variant","margin"],Zt=["active","dirty","dirtyFields","dirtyFieldsSinceLastSubmit","dirtySinceLastSubmit","error","errors","hasSubmitErrors","hasValidationErrors","initialValues","modified","modifiedSinceLastSubmit","save","submitError","submitErrors","submitFailed","submitSucceeded","submitting","touched","valid","validating","values","visited","__versions"],Kt=["mutators"],Yt=function(e){var r=e.basePath,n=e.children,o=e.className,i=e.component,l=e.handleSubmit,s=e.handleSubmitWithRedirect,u=e.invalid,d=e.mutationMode,m=e.pristine,p=e.record,f=e.redirect,g=e.resource,h=e.saving,b=e.submitOnEnter,v=e.syncWithLocation,E=void 0===v||v,C=e.tabs,y=e.toolbar,x=e.undoable,k=e.variant,S=e.margin,T=ce(e,Qt),F=Xt(e),N=Z.useRouteMatch(),R=Z.useLocation(),P=N?N.url:R.pathname,I=t.useState(0),w=I[0],q=I[1];return t.createElement("form",le({className:D("tabbed-form",o)},$t(T)),t.cloneElement(C,{classes:F,url:P,syncWithLocation:E,onChange:function(e,t){E||q(t)},value:w},n),t.createElement(c.Divider,null),t.createElement(i,{className:F.content},t.Children.map(n,function(e,n){if(e){var o=a.getTabFullPath(e,n,P);return t.createElement(Z.Route,{exact:!0,path:a.escapePath(o)},function(a){return t.isValidElement(e)?t.cloneElement(e,{intent:"content",classes:F,resource:g,record:p,basePath:r,hidden:E?!a.match:w!==n,variant:e.props.variant||k,margin:e.props.margin||S,value:E?o:n}):null})}})),y&&t.cloneElement(y,{basePath:r,className:"toolbar",handleSubmitWithRedirect:s,handleSubmit:l,invalid:u,mutationMode:d,pristine:m,record:p,redirect:f,resource:g,saving:h,submitOnEnter:b,undoable:x}))},Xt=g.makeStyles(function(e){return{errorTabButton:{color:e.palette.error.main},content:{paddingTop:e.spacing(1),paddingLeft:e.spacing(2),paddingRight:e.spacing(2)}}},{name:"RaTabbedForm"});Yt.defaultProps={submitOnEnter:!0,tabs:t.createElement(a.TabbedFormTabs,null),toolbar:t.createElement(a.Toolbar,null),component:function(e){return t.createElement("div",{className:e.className},e.children)}};var $t=function(e){return ce(e,Zt)},er={setError:function(e,t){t.fields[e[0]].data=e[1]}},tr=function(e){var r=t.useContext(ut),n=r.initialValues,o=r.fichaProps,i=o.onBeforeSubmitFicha,l=o.config,c=(l=void 0===l?{}:l).mutators,s=void 0===c?{}:c,u=ce(l,Kt),d=s===er?s:le({},er,s),m=Ue(e),p=a.useNotify(),f=t.useCallback(function(t,r,n){var a=i&&i(le({form:{values:t}},m),"N");return"string"==typeof a?void p(a,"warning"):void 0===a||a?e.save(t,r,n):void 0},[i,m]);return t.createElement(a.FormWithRedirect,le({},e,u,{save:f,mutators:d,initialValues:n,render:function(e){return t.createElement(Yt,le({component:St},e))}}))};tr.defaultProps={margin:"normal",variant:"outlined",syncWithLocation:!1},Y.ra.page.empty="No records yet";var rr=le({},Y,{login:{id:"ID",hint:"Login",required:"Insert Username or ID",send:"Send",email:"Enter your email address",check_email:"Check your email inbox, we just send you a verification code!",must_enter_credentials:"You must first enter Username or ID",restore_password:"Restore Password",punch_in:"Punch In"},pos:{search:"Search",change_pin:"Change Pin",change_password:"Change Password",configuration:"Configuration",language:"Language",theme:{name:"Theme",light:"Light",dark:"Dark"},dashboard:{welcome:{title:"Welcome",subtitle:"Employee Management",aor_button:"Metiri WebSite"}}},validation:{greater_or_equal:"Must be greater than or equal to %{menor}"}});X.ra.notification.created="Datos guardados correctamente",X.ra.action.bulk_actions="1 seleccionado |||| %{smart_count} seleccionados",X.ra.page.dashboard="Inicio",X.ra.page.empty="Sin registros todavía",X.ra.page.invite="¿Quiere agregar uno?",X.ra.page.list="%{name}",X.ra.page.edit="Editar %{name}",X.ra.action.back="Volver";var nr=le({},X,{login:{id:"Cédula",hint:"Inicio de Sesión",required:"Ingrese Usuario o Cédula",email:"Ingrese su email aquí",send:"Enviar",check_email:"Revisa tu correo electrónico, te enviaremos un código de verificación!",must_enter_credentials:"Debe ingresar Nº de Usuario o Cédula y Contraseña primero",restore_password:"Restablecer Contraseña",punch_in:"Generar Marcas"},pos:{search:"Búsqueda",change_pin:"Cambiar Pin",change_password:"Cambiar Contraseña",configuration:"Configuración",language:"Lenguaje",theme:{name:"Tema Visual",light:"Light",dark:"Dark"},dashboard:{welcome:{title:"Bienvenid@",subtitle:"Gestión de Funcionarios",aor_button:"Sitio de Metiri"}}},validation:{greater_or_equal:"Debe ser mayor o igual a %{menor}"}}),ar=["hidden"],or=["hidden","useContenido"],ir=["hidden"],lr=function(e){var r=t.useContext(ut),n=r.estado,a=r.loading,o=r.fichaProps,i=(void 0===o?{}:o)[e.source],l=void 0===i?{}:i,c=e.hidden,s=void 0!==c&&c,u=ce(e,ar),d=l.hidden,m=l.useContenido,p=void 0===m?je:m,f=ce(l,or),g=void 0!==d?d:s,h=p(le({},u,{estado:n,hidden:g,loading:a},f)),b=h.hidden,v=ce(h,ir);if(void 0===h)throw new Error("useContenido está devolviendo undefined para el contenido "+e.source+"\n Asegúrese de incluir una instrucción return al final de la función");return{propsContenido:le({},u,f,v),hidden:void 0!==b?b:g}},cr=["onFocus","onChange","onBlur","hidden","disabled","validate"],sr=["onFocus","onBlur","onChange","hidden","disabled","useContenido","validate"],ur=["hidden","disabled","onFocus","onChnage","onBlur","validate"],dr=function(e,t,r){return"string"==typeof(null==r?void 0:r.data)?r.data:void 0},mr=function(e){var r=t.useContext(ut),n=r.estado,i=r.loading,l=r.fichaProps,c=void 0===l?{}:l,s=o.useSelector(function(t){var r=t.configInputs?t.configInputs.filter(function(t){return t.id===e.source}):[];return r[0]?r[0]:null})||{},u=s.disabled,d=s.hidden,m=!0===s.required?ct:void 0,p=c[e.source],f=void 0===p?{}:p,g=e.onFocus,h=e.onChange,b=e.onBlur,v=e.hidden,E=void 0!==v&&v,C=e.disabled,y=void 0!==C&&C,x=e.validate,k=ce(e,cr),S=a.useInput({source:e.source}).input,T=f.onFocus,F=f.onBlur,N=f.onChange,R=f.hidden,P=f.disabled,I=f.useContenido,w=void 0===I?je:I,q=f.validate,M=ce(f,sr),B=void 0!==R?R:E,D=void 0!==P?P:y,L=void 0!==T?T:g,O=void 0!==F?F:b,_=void 0!==N?N:h,A=Je(e),V=w(le({},k,{estado:n,hidden:B,loading:i,utils:A},M)),W=t.useRef(S.value);if(void 0===V)throw new Error("useContenido está devolviendo undefined para el contenido "+e.source+"\n Asegúrese de incluir una instrucción return al final de la función");var G=V.hidden,z=V.disabled,j=V.onFocus,H=V.onChnage,U=V.onBlur,J=V.validate,Q=ce(V,ur),Z=j||L,K=U||O,Y=H||_,X=le({},A,{prev:W.current}),$=Array.isArray(x)?x:[x],ee=Array.isArray(q)?q:[q],te=Array.isArray(J)?J:[J];return{propsContenido:le({onFocus:function(e){Z&&L(A,n,e),W.current=e.target.value},onBlur:function(e){return K&&K(X,n,e)},onChange:function(e){return Y&&Y(X,n,e)},helperText:!1,validate:[].concat($,ee,te,[dr,m]).filter(function(e){return void 0!==e})},k,M,Q,{disabled:void 0!==u?u:void 0!==z?z:D}),hidden:void 0!==d?d:void 0!==G?G:B}},pr=["callback"],fr=["helperText"],gr=["callback"],hr=function(e){var r=e.callback,n=ce(e,pr),o=a.useListContext(n),i=o.loading,l=o.data;return t.useEffect(function(){i||"function"==typeof r&&r(Object.values(l))},[i]),t.createElement(a.SelectInput,n)},br=["helperText"],vr=["helperText"],Er=g.makeStyles(function(e){return{confirmPrimary:{color:e.palette.primary.main},confirmWarning:{color:e.palette.error.main,"&:hover":{backgroundColor:M.alpha(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}},iconPaddingStyle:{paddingRight:"0.5em"}}},{name:"RaConfirm"}),Cr=function(e){return t.createElement(ae,{handle:"#draggable-dialog-title",cancel:'[class*="MuiDialogContent-root"]'},t.createElement(c.Paper,e))},yr={cursor:"move"},xr=function(e){var r,n=e.isOpen,i=e.loading,l=e.title,c=e.content,m=e.cancel,f=e.confirmColor,g=e.ConfirmIcon,h=e.CancelIcon,b=e.onClose,v=e.onConfirm,E=e.contentResource,C=e.translateOptions,y=void 0===C?{}:C,x=Er(e),k=a.useTranslate(),S=o.useSelector(function(e){return e.admin.resources[E].list.selectedIds}),T=t.useCallback(function(e,t){e.stopPropagation(),v(e,S)},[S,v]),F=t.useCallback(function(e){e.stopPropagation()},[]);return t.createElement(s,{open:n,onClose:b,onClick:F,fullWidth:!0,maxWidth:"lg",PaperComponent:Cr,"aria-labelledby":"draggable-dialog-title"},t.createElement(p,{style:yr,id:"draggable-dialog-title"},k(l,le({_:l},y))),t.createElement(d,{dividers:!0},c),t.createElement(u,null,t.createElement(L,{disabled:i,onClick:b},t.createElement(h,{className:x.iconPaddingStyle}),k(m,{_:m})),t.createElement(L,{disabled:i,onClick:function(e){return T(e,"yes")},className:D("ra-confirm",(r={},r[x.confirmWarning]="warning"===f,r[x.confirmPrimary]="primary"===f,r)),autoFocus:!0},t.createElement(g,{className:x.iconPaddingStyle}),k("ra.action.confirm"))))};xr.propTypes={cancel:l.string,classes:l.object,confirm:l.string,confirmColor:l.string,ConfirmIcon:l.elementType,CancelIcon:l.elementType,content:l.node.isRequired,isOpen:l.bool,loading:l.bool,onClose:l.func.isRequired,onConfirm:l.func.isRequired,title:l.string.isRequired},xr.defaultProps={cancel:"ra.action.cancel",classes:{},confirmColor:"primary",ConfirmIcon:re,CancelIcon:ne,isOpen:!1};var kr=["disabled","asistant","asistantResource","label","source"],Sr=function(){return t.createElement(t.Fragment,null)},Tr={seleccion:[],all:!0,none:!1},Fr=function(e){return!e||null!=e&&e.all?"Todos":null!=e&&e.none||0===e.seleccion.length?"Ninguno":"Selección ("+e.seleccion.length+")"},Nr=function(e){return e},Rr=function(e){return t.createElement(a.List,le({},e,{hasCreate:!1,exporter:!1,perPage:25,title:" ",bulkActionButtons:t.createElement("span",null)}),t.createElement(a.Datagrid,null,t.createElement(a.TextField,{source:"funced",sortable:!0,label:"Cédula"}),t.createElement(a.TextField,{source:"funpriape",sortable:!0,label:"Apellido"}),t.createElement(a.TextField,{source:"funprinom",sortable:!0,label:"Nombre"})))},Pr={fillista:"empcod=-1"},Ir=function(e){var r=t.useState(Pr),n=r[0],o=r[1],i=a.useDataProvider(),l=t.useCallback(function(e){o({fillista:e.node.key})},[o]),s=t.useCallback(function(e){return i.getChildNodes("form_224",{parentId:e?e.itemData.id:""}).then(function(e){return e.data}).catch(function(){throw new Error("Data Loading Error")})},[i]);return t.createElement(c.Box,{display:"flex",flex:1,alignItems:"flex-start",height:"20em"},t.createElement(c.Box,{flexGrow:1},t.createElement(oe.TreeView,{id:"funcionarios-treeview",dataStructure:"plain",rootValue:"",onItemClick:l,createChildren:s})),t.createElement(c.Box,{flexGrow:2},t.createElement(Rr,{resource:"form_224",basePath:"/form_224",filter:n})))},wr=g.makeStyles(function(e){return{confirmPrimary:{color:e.palette.primary.main},confirmWarning:{color:e.palette.error.main,"&:hover":{backgroundColor:M.alpha(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}},iconPaddingStyle:{paddingRight:"0.5em"}}},{name:"RaConfirm"}),qr=function(e){return t.createElement(ae,{handle:"#draggable-dialog-title",cancel:'[class*="MuiDialogContent-root"]'},t.createElement(c.Paper,e))},Mr={cursor:"move"},Br=function(e){var r,n=e.isOpen,o=e.loading,i=e.title,l=e.cancel,c=e.confirmColor,m=e.ConfirmIcon,f=e.CancelIcon,g=e.onClose,h=e.onConfirm,b=e.translateOptions,v=void 0===b?{}:b,E=wr(e),C=a.useTranslate(),y=t.useCallback(function(e,t){e.stopPropagation(),h(e,t)},[h]),x=t.useCallback(function(e){e.stopPropagation()},[]);return t.createElement(s,{open:n,onClose:g,onClick:x,fullWidth:!0,maxWidth:"lg",PaperComponent:qr,"aria-labelledby":"draggable-dialog-title"},t.createElement(p,{style:Mr,id:"draggable-dialog-title"},C(i,le({_:i},v))),t.createElement(d,{dividers:!0},t.createElement(Ir,null)),t.createElement(u,null,t.createElement(L,{disabled:o,onClick:g},t.createElement(f,{className:E.iconPaddingStyle}),C(l,{_:l})),t.createElement(L,{disabled:o,onClick:function(e){return y(e,"yes")},className:D("ra-confirm",(r={},r[E.confirmWarning]="warning"===c,r[E.confirmPrimary]="primary"===c,r)),autoFocus:!0},t.createElement(m,{className:E.iconPaddingStyle}),C("ra.action.confirm"))))};Br.propTypes={cancel:l.string,classes:l.object,confirm:l.string,confirmColor:l.string,ConfirmIcon:l.elementType,CancelIcon:l.elementType,isOpen:l.bool,loading:l.bool,onClose:l.func.isRequired,onConfirm:l.func.isRequired,title:l.string.isRequired},Br.defaultProps={cancel:"ra.action.cancel",classes:{},confirmColor:"primary",ConfirmIcon:re,CancelIcon:ne,isOpen:!1};var Dr=["disabled","asistant","asistantResource","label","source"],Lr={seleccion:[],all:!0,none:!1},Or=function(e){return!e||null!=e&&e.all?"Todos":null!=e&&e.none||0===e.seleccion.length?"Ninguno":"Selección ("+e.seleccion.length+")"},_r=function(e){return e},Ar=["tipo"],Vr=["tipo","value"];exports.AppBar=de,exports.BooleanField=function(e){var r=lr(e),n=r.propsContenido,o=r.hidden,i=JSON.parse(JSON.stringify(e.record)),l=i[e.source];return i[e.source]=""!=l&&"0"!=l,!o&&t.createElement(a.BooleanField,le({},n,{record:i}))},exports.Camino=function(e){var r=mr(e);return!r.hidden&&t.createElement(a.FileInput,le({accept:"",maxSize:5e6},r.propsContenido),t.createElement(a.ImageField,{source:"src"}))},exports.CheckBox=function(e){var r=mr(e);return!r.hidden&&t.createElement(a.BooleanInput,r.propsContenido)},exports.ComboBox=function(e){var r,n,i=mr(e),l=i.propsContenido,c=i.hidden,s=t.useRef(!1),u=o.useDispatch(),d=a.useVersion(),m=l.helperText,p=ce(l,fr),f=o.useSelector(function(t){var r=t.reload_cb?t.reload_cb.filter(function(t){return t.id===e.source}):[];return r[0]?r[0]:null}),g=t.useRef(f),h=null===f&&g.current?g.current:f;return h&&(r=h.callback,n=ce(h,gr)),t.useEffect(function(){null!==f&&(g.current=f,u(Be(e.source)))},[JSON.stringify(f)]),t.useEffect(function(){s.current=!0},[d]),s.current?!c&&t.createElement(a.ReferenceInput,le({},p,{perPage:250,filter:n}),t.createElement(hr,{callback:r,helperText:m,optionText:"etiqueta",optionValue:e.source})):t.createElement(a.Labeled,{id:e.id,label:e.label,source:e.source,resource:e.resource,className:e.className,isRequired:e.isRequired,meta:e.meta,input:e.input,margin:e.margin},t.createElement(a.LinearProgress,{timeout:1}))},exports.ComboBoxManual=function(e){var r=mr(e);return!r.hidden&&t.createElement(a.SelectInput,r.propsContenido)},exports.CreateEtriek=mt,exports.DeleteButtonNoWarning=ht,exports.EditEtriek=function(e){var r=ce(e,bt),n=a.useEditController(r),o=n.record,i=n.loading,l=nt(e).fichaProps,c=t.useMemo(function(){return{estado:"M",initialValues:o,loading:i,fichaProps:l}},[o,i,l]);return t.createElement(we,null,t.createElement(ut.Provider,{value:c},t.createElement(a.Edit,le({},r,null==l?void 0:l.panel))))},exports.EtrGrid=function(e){var r=e.filterBy,n=void 0===r?"":r,o=e.claves,i=e.sortModel,l=e.columns,s=e.reference,u=e.allowAdd,d=void 0===u||u,m=e.allowRemove,p=void 0===m||m,g=e.etrResource,h=e.enableLoad,v=void 0===h||h,E=ce(e,ve),C=e.record,y=t.useRef(!1),x=Ee(e),k=a.useVersion(),S=t.useState(i)[1],T=i[0],F=T.field,N=T.sort;t.useEffect(function(){y.current=!0},[k]);var R=Object.keys(C).filter(function(e){return o.split(",").includes(e)}).reduce(function(e,t){return e[t]=C[t],e},{}),P={};n.split(",").forEach(function(e){e&&(P[e]=[{type:"string",comparison:"eq",value:C[e],field:e}])});var I=a.useGetList(s,{page:1,perPage:200},{field:F,order:N},P,{enabled:v&&y.current}),w=I.data,q=I.ids,M=I.loading,B=t.useMemo(function(){return q.map(function(e){return w[e]})},[q,w]),D=[d?{field:"BTN",headerName:"",sortable:!1,renderHeader:function(e){return t.createElement(Te,le({},E,{etrResource:g,camposClaveFila:o,clavesFila:R,api:e.api}))}}:{}].concat(l,[{field:" ",width:80,headerName:"",headerAlign:"center",sortable:!1,disableClickEventBubbling:!0,renderCell:function(e){return t.createElement(Fe,le({},E,{camposClaveFila:o,clavesFila:R,api:e.api,row:e.row}))}},p?{field:" ",headerName:"",headerAlign:"center",sortable:!1,disableClickEventBubbling:!0,renderCell:function(e){return t.createElement(Se,le({},E,{camposClaveFila:o,api:e.api,row:e.row}))}}:{}]),L=t.useMemo(function(){return D},[JSON.stringify(D)]);return M?t.createElement(a.Loading,null):t.createElement(f,{className:x.rootPaper},t.createElement(c.ThemeProvider,{theme:Ne},t.createElement(b.DataGrid,le({className:x.root,disableSelectionOnClick:!0,pageSize:50,hideFooter:!0,sortModel:i,rows:B,columns:L,onSortModelChange:function(e){return S(e)},components:{NoRowsOverlay:fe}},E))))},exports.EtriekNotification=Et,exports.FichaActions=function(e){var r=e.children,n=e.basePath,o=e.className,i=e.data,l=e.hasShow,c=e.hasList,s=void 0===c||c,u=ce(e,ot);return t.createElement(a.TopToolbar,le({className:o},ce(u,at)),r,s&&t.createElement(a.ListButton,{label:"ra.action.back",basePath:n,icon:t.createElement(R,null)}),l&&t.createElement(a.ShowButton,{basePath:n,record:i}))},exports.FichaContext=ut,exports.FormDialog=yt,exports.FormEtriek=Nt,exports.GE=function(e){var r=e.filterBy,n=void 0===r?"":r,o=e.sortModel,i=e.columns,l=e.reference,s=e.filter,u=void 0===s?[]:s,d=e.enableLoad,m=void 0===d||d,p=ce(e,Re),g=e.record,h=t.useRef(!1),v=pe(e),E=a.useVersion(),C=t.useState(o),y=C[0],x=C[1],k=o[0],S=k.field,T=k.sort,F=t.useMemo(function(){return[].concat(i)},[JSON.stringify(i)]);t.useEffect(function(){h.current=!0},[E]);var N=[];n.split(",").forEach(function(e){e&&N.push({type:"string",comparison:"eq",value:g[e],field:e})});var R=le({},N.concat(u)),P=a.useGetList(l,{page:1,perPage:200},{field:S,order:T},R,{enabled:m&&h.current}),I=P.data,w=P.ids,q=P.loading,M=t.useMemo(function(){return w.map(function(e){return I[e]})},[w,I]);return q?t.createElement(a.Loading,null):t.createElement(f,{className:v.rootPaper},t.createElement(c.ThemeProvider,{theme:Pe},t.createElement(b.DataGrid,le({className:v.root,disableSelectionOnClick:!0,pageSize:50,hideFooter:!0,rows:M,columns:F,sortModel:y,onSortModelChange:function(e){return x(e)},components:{NoRowsOverlay:fe}},p))))},exports.GrillaEtriek=$e,exports.ImageField=function(e){var r=e.title,n=e.source,o=e.src,i=a.useRecordContext(e);return t.createElement(z,{title:r,src:o+"/"+i[n]})},exports.Layout=function(e){var r=ce(e,Lt),n=o.useSelector(function(e){return"dark"===e.theme?Mt:Bt});return t.createElement(a.Layout,le({},r,{appBar:de,sidebar:Ot,menu:qt,theme:n,notification:Et}))},exports.ListActionsEtriek=function(e){var r=e.className,n=e.exporter,o=e.filters,i=e.children,l=e.jsBotonGrilla,c=ce(e,_t),s=He(e).utils,u=a.useListContext(e),d=a.useResourceContext(c),m=a.useResourceDefinition(c).hasCreate,p=u.currentSort,f=u.displayedFilters,g=u.filterValues,h=u.basePath,b=u.selectedIds,v=u.showFilter,E=u.total,C=le({},s,u);return t.useMemo(function(){return t.createElement(a.TopToolbar,le({className:r},a.sanitizeListRestProps(c)),o&&t.cloneElement(o,{resource:d,showFilter:v,displayedFilters:f,filterValues:g,context:"button"}),m&&t.createElement(a.CreateButton,{basePath:h}),!1!==n&&t.createElement(a.ExportButton,{disabled:0===E,resource:d,sort:p,filterValues:g}),t.Children.map(i,function(e,r){return t.cloneElement(e,{onClick:e.props.options?null:function(t){return l(C,e.key)},options:e.props.options?e.props.options.map(function(e){return le({},e,{onClick:function(t){return l(C,e.key)}})}):null})}))},[d,f,g,b,o,E])},exports.ListCheck=function(e){var r=mr(e),n=r.propsContenido,o=r.hidden,i=t.useRef(!1),l=a.useVersion(),c=n.helperText,s=ce(n,br);return t.useEffect(function(){i.current=!0},[l]),i.current?!o&&t.createElement(a.ReferenceArrayInput,s,t.createElement(a.SelectArrayInput,{helperText:c,optionText:"etiqueta",optionValue:e.source})):t.createElement(a.Labeled,{id:e.id,label:e.label,source:e.source,resource:e.resource,className:e.className,isRequired:e.isRequired,meta:e.meta,input:e.input,margin:e.margin},t.createElement(a.LinearProgress,{timeout:1}))},exports.Login=function(e){return t.createElement(Q.ThemeProvider,{theme:g.createTheme(Bt)},t.createElement(Gt,e))},exports.Menu=qt,exports.MenuButton=function(e){var r,n=e.className,o=e.options,i=void 0===o?[]:o,l=e.icon,c=ce(e,jt),s=t.useState(!1),u=s[0],d=s[1],m=t.useRef(),p=t.useState(0),f=p[0],g=p[1],h=Ht(e),b=a.useResourceContext(e);return t.createElement("div",le({className:D(h.root,n)},ce(c,zt)),t.createElement(a.Button,{className:"add-filter",onClick:function(e){e.preventDefault(),d(!0),m.current=e.currentTarget},title:i[f].label},(null===(r=i[f])||void 0===r?void 0:r.icon)||l),t.createElement(K,{open:u,anchorEl:m.current,onClose:function(e){m.current&&m.current.contains(e.target)||d(!1)}},i.map(function(e,r){return t.createElement(W,{key:e.label,disabled:e.disabled,selected:r===f,onClick:function(t){!function(e,t){g(t),d(!1)}(0,r),e.onClick&&e.onClick(t,r)},resource:b,title:e.label},e.icon,t.createElement("span",{className:h.paddingRight}),t.createElement(a.FieldTitle,{label:e.label,resource:b}))})))},exports.MultiTextField=function(e){var r=e.fields,n=e.className,a=e.record,o=ce(e,Ut),i=r.separador,l=void 0===i?"":i,c=r.secundario,s=void 0===c?[]:c,u=r.hasSecundario,d=r.campos.map(function(e){return void 0!==a[e]?a[e]:e}).join(""+l);return t.createElement(h,le({noWrap:!0,variant:"inherit",className:n},o),d,u&&t.createElement(h,{component:"span",display:"block",color:"textSecondary",variant:"caption"},s.map(function(e){return(e.etiqueta||"---")+": "+(a[e.campo]||"---")}).join(" ")))},exports.Password=function(e){var r=mr(e);return!r.hidden&&t.createElement(a.PasswordInput,r.propsContenido)},exports.RadioButton=function(e){var r=mr(e),n=r.propsContenido,o=r.hidden,i=t.useRef(!1),l=a.useVersion(),c=n.helperText,s=ce(n,vr);return t.useEffect(function(){i.current=!0},[l]),i.current?!o&&t.createElement(a.ReferenceInput,s,t.createElement(a.RadioButtonGroupInput,{helperText:c,optionText:"etiqueta",optionValue:e.source})):t.createElement(a.Labeled,{id:e.id,label:e.label,source:e.source,resource:e.resource,className:e.className,isRequired:e.isRequired,meta:e.meta,input:e.input},t.createElement(a.LinearProgress,null))},exports.RadioButtonManual=function(e){var r=mr(e);return!r.hidden&&t.createElement(a.RadioButtonGroupInput,r.propsContenido)},exports.Separador=function(e){return t.createElement(h,{variant:"h6",gutterBottom:!0},e.children)},exports.ShowEtriek=function(e){var r=ce(e,Jt),n=a.useShowController(r),o=n.record,i=n.loading,l=nt(e).fichaProps,c=t.useMemo(function(){return{estado:"M",initialValues:o,loading:i,fichaProps:l}},[o,i,l]);return t.createElement(we,null,t.createElement(ut.Provider,{value:c},t.createElement(a.Show,le({},r,n,null==l?void 0:l.panel))))},exports.SubMenu=Pt,exports.TBSF=function(e){var r=e.disabled,n=e.label,i=void 0===n?"Funcionarios":n,l=e.source,c=ce(e,Dr),s=o.useSelector(function(e){return e.admin.resources.form_224.list.selectedIds}),u=t.useState(!1),d=u[0],m=u[1],p=k.useForm(),f=t.useCallback(function(){m(!1)},[m]);return t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",alignItems:"center"}},t.createElement(a.TextInput,le({initialValue:Lr},c,{source:l,label:i,disabled:!0,parse:_r,format:Or,helperText:!1,InputProps:{endAdornment:t.createElement(t.Fragment,null,t.createElement(q,{onClick:function(e){p.change(l,{seleccion:[],all:!1,none:!0})},disabled:r,"aria-label":"Ninguno",size:"small",title:"Ninguno"},t.createElement(ee,null)),t.createElement(q,{onClick:function(e){p.change(l,{seleccion:[],all:!0,none:!1})},disabled:r,"aria-label":"Todos",size:"small",title:"Todos"},t.createElement($,null)),t.createElement(q,{onClick:function(e){return m(!0)},disabled:r,"aria-label":"Selección",size:"small",title:"Selección"},t.createElement(te,null)))}}))),t.createElement(Br,{isOpen:d,title:"Selección de "+i,onConfirm:function(e,t){m(!1),p.change(l,{seleccion:s,all:!1,none:!1})},onClose:f}))},exports.TabbedFormEtriek=tr,exports.TabbedGrillaEtriek=function(e){var r=e.filterValues,n=e.setFilters,a=e.tabs,o=a.ids,i=ce(a,et),l=e.GridComponent,c=void 0===l?$e:l,s=ce(e,tt),u=r.id;return t.createElement(t.Fragment,null,t.createElement(F,{value:u,indicatorColor:"primary",onChange:function(e,t){n(le({},r,{id:t}))}},o.map(function(e){return t.createElement(T,{key:e,label:e.charAt(0).toUpperCase()+e.slice(1),value:e})})),t.createElement(S,null),t.createElement(c,le({},s,i[u])))},exports.TextArea=function(e){var r=mr(e);return!r.hidden&&t.createElement(a.TextInput,le({multiline:!0},r.propsContenido))},exports.TextBox=function(e){var r=e.tipo,n=ce(e,Ar),o=mr(n),i=o.propsContenido,l=o.hidden,c=k.useForm(),s=a.useInput({source:e.source}),u=s.input,d=s.meta,m="F"===r||"Z"===r;t.useEffect(function(){i.value&&(c.change(e.source,i.value),e.disabled&&c.blur(e.source))}),t.useEffect(function(){m&&""!=u.value&&d.valid&&d.modified&&!d.active&&i.onBlur()},[u.value]);var p=le({},i);return!l&&("N"===r||"D"===r?t.createElement(a.NumberInput,p):"F"===r?t.createElement(ie.KeyboardDateInput,p):"Z"===r?t.createElement(ie.KeyboardDateTimeInput,p):t.createElement(a.TextInput,"H"===r?le({},p,{type:"time"}):p))},exports.TextBoxSelection=function(e){var r=e.disabled,n=e.asistant,o=e.asistantResource,i=e.label,l=e.source,c=ce(e,kr),s=t.useState(!1),u=s[0],d=s[1],m=k.useForm(),p=t.useCallback(function(){d(!1)},[d]);return t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",alignItems:"center"}},t.createElement(a.TextInput,le({initialValue:Tr},c,{source:l,label:i,disabled:!0,parse:Nr,format:Fr,helperText:!1,InputProps:{endAdornment:t.createElement(t.Fragment,null,t.createElement(q,{onClick:function(e){m.change(l,{seleccion:[],all:!1,none:!0})},disabled:r,"aria-label":"Ninguno",size:"small",title:"Ninguno"},t.createElement(ee,null)),t.createElement(q,{onClick:function(e){m.change(l,{seleccion:[],all:!0,none:!1})},disabled:r,"aria-label":"Todos",size:"small",title:"Todos"},t.createElement($,null)),t.createElement(q,{onClick:function(e){return d(!0)},disabled:r,"aria-label":"Selección",size:"small",title:"Selección"},t.createElement(te,null)))}}))),t.createElement(xr,{isOpen:u,title:"Selección de "+i,contentResource:o,content:t.createElement(n,{bulkActionButtons:t.createElement(Sr,null),hasCreate:!1,exporter:!1,resource:o,basePath:"/"+o}),onConfirm:function(e,t){d(!1),m.change(l,{seleccion:t,all:!1,none:!1})},onClose:p}))},exports.TextField=function(e){var r=e.tipo,n=ce(e,Vr),o=lr(n),i=o.hidden,l=le({},o.propsContenido);return!i&&("N"===r||"D"===r?t.createElement(a.NumberField,l):"F"===r?t.createElement(a.DateField,l):"Z"===r?t.createElement(a.DateField,le({},l,{showTime:!0})):t.createElement(a.TextField,l))},exports.choicesEstado=[{id:"1",name:"Aprobado"},{id:"2",name:"Rechazado"},{id:"3",name:"Pendiente"}],exports.dateFormat=function(e,t){if(!e)return"";if(e instanceof Date)return e.toString();if(-1!==e.indexOf("/")){var r=e.split("/");return new Date(parseInt(r[2],10),parseInt(r[1],10)-1,parseInt(r[0],10)).toString()}var n=/(\d{4})-(\d{2})-(\d{2})/.exec(e);if(null!==n){var a=new Date(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10));if(!isNaN(a))return a.toString()}},exports.dateFormatOptions={format:"dd/MM/yyyy"},exports.dateParser=function(e,t){if(!e)return"";var r=e.split(" "),n="";switch(r[1]){case"Jan":n="01";break;case"Feb":n="02";break;case"Mar":n="03";break;case"Apr":n="04";break;case"May":n="05";break;case"Jun":n="06";break;case"Jul":n="07";break;case"Aug":n="08";break;case"Sep":n="09";break;case"Oct":n="10";break;case"Nov":n="11";break;case"Dec":n="12"}return r[2]+"/"+n+"/"+r[3]},exports.dateTimeFormat=function(e){if(!e)return"";if(e instanceof Date)return e.toString();if(-1!==e.indexOf("/")){var t=e.split("/");return new Date(parseInt(t[2].substr(0,4),10),parseInt(t[1],10)-1,parseInt(t[0],10),t[2].substr(5,2),t[2].substr(8,2)).toString()}var r=/(\d{4})-(\d{2})-(\d{2})\s(\d{2}):(\d{2})/.exec(e);if(null!==r){var n=new Date(parseInt(r[1],10),parseInt(r[2],10)-1,parseInt(r[3],10),r[4],r[5]);if(!isNaN(n))return n.toString()}},exports.dateTimeParser=function(e,t){if(!e)return"";var r=e.split(" "),n="";switch(r[1]){case"Jan":n="01";break;case"Feb":n="02";break;case"Mar":n="03";break;case"Apr":n="04";break;case"May":n="05";break;case"Jun":n="06";break;case"Jul":n="07";break;case"Aug":n="08";break;case"Sep":n="09";break;case"Oct":n="10";break;case"Nov":n="11";break;case"Dec":n="12"}return r[2]+"/"+n+"/"+r[3]+" "+r[4].substr(0,5)},exports.deleteRecargarComboBox=Be,exports.descargarLink=function(e,t){var r=document.createElement("a");r.style.display="none",document.body.appendChild(r),r.setAttribute("href",e),r.setAttribute("download",t),r.click()},exports.enMessages=rr,exports.esMessages=nr,exports.etrFechaMayorQue=function(e){return function(t,r){var n=r[e];if(t&&n){var a=n.split("/").reverse().join("/"),o=t.split("/").reverse().join("/");if(w(a).isAfter(o))return{message:"validation.greater_or_equal",args:{menor:n}}}}},exports.etrRequerido=ct,exports.etrRequeridoNumerico=st,exports.getFormcodFromResource=it,exports.localeOptions=function(e){return void 0===e&&(e="es"),{locale:"en"==e?P:I}},exports.recargarComboBox=Me,exports.setDisableAction=Le,exports.setHiddenAction=De,exports.setRequireAction=Oe,exports.themes=Dt,exports.timeFormat=function(e){if(!e)return"";if(e instanceof Date)return e.toString();if(-1!==e.indexOf(":")){var t=e.split(":"),r=new Date;return r.setHours(t[0]),r.setMinutes(t[1]),r.toString()}var n=/(\d{2}):(\d{2})/.exec(e);if(null!==n){var a=new Date;return a.setHours(n[0]),a.setMinutes(n[1]),a.toString()}},exports.timeParser=function(e,t){return e?e.split(" ")[4].substr(0,5):""},exports.useAjax=ze,exports.useContenidoController=mr,exports.useDeleteRowEtrGrid=ge,exports.useFieldController=lr,exports.useFormProgress=qe,exports.useGetJson=Ge,exports.useInitFicha=nt,exports.useNuevo=me,exports.useReferenceLabel=function(e,t){var r=a.useResourceContext();return o.useSelector(function(n){var a;return(null===(a=n.admin.resources["cb_"+it(r)+"_"+e].data[t])||void 0===a?void 0:a.etiqueta)||""})},exports.useSaveRowEtrGrid=he,exports.useStylesContenidos=lt,exports.useUtils=Je,exports.useUtilsGrilla=He,exports.useUtilsSubmit=Ue;
1
+ function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("react"),r=e(require("@material-ui/icons/Lock")),n=e(require("@material-ui/icons/VpnLock")),a=require("react-admin"),o=require("react-redux"),i=require("prop-types"),l=e(i),s=require("@material-ui/core"),c=e(require("@material-ui/core/Dialog")),u=e(require("@material-ui/core/DialogActions")),d=e(require("@material-ui/core/DialogContent")),m=e(require("@material-ui/core/DialogContentText")),p=e(require("@material-ui/core/DialogTitle")),f=e(require("@material-ui/core/Paper")),g=require("@material-ui/core/styles"),h=e(require("@material-ui/core/Typography")),b=require("@material-ui/data-grid"),v=e(require("@material-ui/icons/Add")),E=e(require("@material-ui/icons/Cancel")),C=e(require("@material-ui/icons/Delete")),y=e(require("@material-ui/icons/Edit")),x=e(require("@material-ui/core/TableContainer")),k=require("react-final-form"),S=e(require("@material-ui/core/Divider")),T=e(require("@material-ui/core/Tab")),F=e(require("@material-ui/core/Tabs")),N=e(require("@material-ui/core/styles/makeStyles")),R=e(require("@material-ui/icons/ChevronLeft")),P=e(require("date-fns/locale/en-US")),I=e(require("date-fns/locale/es")),w=e(require("moment")),q=e(require("@material-ui/core/IconButton")),M=require("@material-ui/core/styles/colorManipulator"),B=e(require("@material-ui/core/Tooltip")),D=e(require("classnames")),L=e(require("@material-ui/core/Button")),O=e(require("@material-ui/icons/Settings")),_=e(require("@material-ui/core/Collapse")),V=e(require("@material-ui/core/List")),A=e(require("@material-ui/core/ListItemIcon")),W=e(require("@material-ui/core/MenuItem")),G=e(require("@material-ui/icons/ExpandMore")),z=e(require("@material-ui/core/Avatar")),j=e(require("@material-ui/core/Card")),H=e(require("@material-ui/core/CardActions")),U=e(require("@material-ui/core/CircularProgress")),J=e(require("@material-ui/core/TextField")),Q=require("@material-ui/styles"),Z=require("react-router-dom"),K=e(require("@material-ui/core/Menu")),Y=e(require("ra-language-english")),X=e(require("@blackbox-vision/ra-language-spanish")),$=e(require("@material-ui/icons/Check")),ee=e(require("@material-ui/icons/RemoveCircleOutline")),te=e(require("@material-ui/icons/Search")),re=e(require("@material-ui/icons/CheckCircle")),ne=e(require("@material-ui/icons/ErrorOutline")),ae=e(require("react-draggable")),oe=require("devextreme-react"),ie=require("react-admin-date-inputs");function le(){return(le=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function se(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)t.indexOf(r=o[n])>=0||(a[r]=e[r]);return a}var ce=t.forwardRef(function(e,i){var l=a.useTranslate(),s=o.useSelector(function(e){return[e.admin.resources.form_275?1:0,e.admin.resources.form_59?1:0]}),c=s[1];return[s[0]?t.createElement(a.MenuItemLink,{ref:i,key:"/form_275",to:"/form_275",primaryText:l("pos.change_pin"),leftIcon:t.createElement(r,null),onClick:e.onClick}):null,c?t.createElement(a.MenuItemLink,{ref:i,key:"/form_59",to:"/form_59",primaryText:l("pos.change_password"),leftIcon:t.createElement(n,null),onClick:e.onClick}):null]}),ue=function(e){return t.createElement(a.UserMenu,e,t.createElement(ce,null))},de=function(e){return t.createElement(a.AppBar,le({},e,{elevation:1,userMenu:t.createElement(ue,null)}))},me=function(e,t){return a.useGetOne(e,"-1",t)},pe=g.makeStyles(function(e){return{root:{"& .MuiDataGrid-columnsContainer":{backgroundColor:"light"===e.palette.type?"#fafafa":"#1d1d1d"},"& .MuiDataGrid-iconSeparator":{display:"none"}},header:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.light},rootPaper:{width:"100%",height:"40vh",borderRadius:0,marginTop:e.spacing(1)},rootOverlay:{flexDirection:"column","& .ant-empty-img-1":{fill:"light"===e.palette.type?"#aeb8c2":"#262626"},"& .ant-empty-img-2":{fill:"light"===e.palette.type?"#f5f5f7":"#595959"},"& .ant-empty-img-3":{fill:"light"===e.palette.type?"#dce0e6":"#434343"},"& .ant-empty-img-4":{fill:"light"===e.palette.type?"#ffffff":"#1c1c1c"},"& .ant-empty-img-5":{fillOpacity:"light"===e.palette.type?"0.8":"0.08",fill:"light"===e.palette.type?"#f5f5f5":"#ffffff"}},label:{marginTop:e.spacing(1)},deleteButton:{color:e.palette.error.main,"&:hover":{backgroundColor:s.alpha(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}},{name:"GE"}),fe=function(){var e=pe();return t.createElement(b.GridOverlay,{className:e.rootOverlay},t.createElement("svg",{width:"120",height:"100",viewBox:"0 0 184 152","aria-hidden":!0,focusable:"false"},t.createElement("g",{fill:"none",fillRule:"evenodd"},t.createElement("g",{transform:"translate(24 31.67)"},t.createElement("ellipse",{className:"ant-empty-img-5",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),t.createElement("path",{className:"ant-empty-img-1",d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z"}),t.createElement("path",{className:"ant-empty-img-2",d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z"}),t.createElement("path",{className:"ant-empty-img-3",d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z"})),t.createElement("path",{className:"ant-empty-img-3",d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z"}),t.createElement("g",{className:"ant-empty-img-4",transform:"translate(149.65 15.383)"},t.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),t.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"})))),t.createElement("div",{className:e.label},"No hay registros"))},ge=function(e,t,r){return a.useMutation({type:"deleteEtrRow",resource:e,payload:{params:t}},r)},he=function(e,t,r,n){return a.useMutation({type:e,resource:t,payload:{params:r}},n)},be=["api","basePath","classes","className","confirmTitle","confirmContent","icon","record","redirect","onSuccess","onFailure","source","camposClaveFila"],ve=["filterBy","claves","sortModel","columns","reference","allowAdd","allowRemove","etrResource","enableLoad"],Ee=g.makeStyles(function(e){return{root:{"& .MuiDataGrid-columnsContainer":{backgroundColor:"light"===e.palette.type?"#fafafa":"#1d1d1d"},"& .MuiDataGrid-iconSeparator":{display:"none"}},header:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.light},rootPaper:{width:"100%",height:"40vh",borderRadius:0,marginTop:e.spacing(1)},rootOverlay:{flexDirection:"column","& .ant-empty-img-1":{fill:"light"===e.palette.type?"#aeb8c2":"#262626"},"& .ant-empty-img-2":{fill:"light"===e.palette.type?"#f5f5f7":"#595959"},"& .ant-empty-img-3":{fill:"light"===e.palette.type?"#dce0e6":"#434343"},"& .ant-empty-img-4":{fill:"light"===e.palette.type?"#ffffff":"#1c1c1c"},"& .ant-empty-img-5":{fillOpacity:"light"===e.palette.type?"0.8":"0.08",fill:"light"===e.palette.type?"#f5f5f5":"#ffffff"}},label:{marginTop:e.spacing(1)},deleteButton:{color:e.palette.error.main,"&:hover":{backgroundColor:s.alpha(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}},{name:"EtrGrid"}),Ce={marginLeft:"1.6rem",fontWeight:"bold"},ye=t.createElement(C,null),xe=function(e){var r=e.basePath,n=e.confirmTitle,o=void 0===n?"ra.message.delete_title":n,i=e.confirmContent,l=void 0===i?"ra.message.delete_content":i,s=e.icon,c=void 0===s?ye:s,u=e.record,d=e.redirect,m=void 0!==d&&d,p=e.onSuccess,f=e.onFailure,g=e.source,h=e.camposClaveFila,b=se(e,be),v=Ee(e),E=a.useNotify(),C=a.useDeleteWithConfirmController({record:u,redirect:m,basePath:r,onSuccess:p,onFailure:f}),y=C.open,x=C.loading,k=C.handleDialogOpen,S=C.handleDialogClose,T=ge(e.resource,{},{refresh:!0,onSuccess:function(e){if(e.error)throw new Error(e.error);E("ra.notification.deleted","info",{smart_count:1})},onFailure:function(e){E(e.message,"warning")}})[0],F=Object.keys(u).filter(function(e){return h.split(",").includes(e)}).reduce(function(e,t){return e[t]=u[t],e},{}),N=t.useCallback(function(e){T({payload:{ge:g,clavesFila:F}})},[u]);return t.createElement(t.Fragment,null,t.createElement(a.Button,le({key:"button",onClick:k,className:v.deleteButton},b),c),t.createElement(a.Confirm,{isOpen:y,loading:x,title:o,content:l,onConfirm:N,onClose:S}))},ke=function(e){return t.createElement(c,{open:e.open,onClose:e.onClose,fullWidth:!0},t.createElement(p,null,e.labelEstado+" "+e.label),t.createElement(m,null,t.createElement(h,{component:"span",display:"block",variant:"subtitle1",style:le({},Ce)},e.msgTitle),e.msgDesc),t.createElement(a.FormWithRedirect,{resource:e.resource,save:e.save,render:e.render,initialValues:e.initialValues}))};ke.propTypes={label:i.string,onClick:i.func,icon:i.any,open:i.bool,onClose:i.func,labelEstado:i.string,msgTitle:i.any,msgDesc:i.any,resource:i.any,save:i.func,render:i.func};var Se=function(e){return t.createElement(xe,{api:!0,confirmTitle:"ra.action.delete",source:e.source,record:e.row,resource:e.resource,camposClaveFila:e.camposClaveFila})},Te=function(e){var r=e.editors,n=e.record,o=e.clavesFila,i=e.camposClaveFila,l=e.resource,s=e.label,c=e.source,m=e.etrResource,p=a.useSafeSetState(!1),f=p[0],g=p[1],h=me(m,{enabled:f}).data,b=he("createEtrRow",l,{},{refresh:!0,onSuccess:function(e){if(e.error)throw new Error(e.error);g(!1),x("ra.notification.created","info")},onFailure:function(e){x(e.message,"warning")}}),C=b[0],y=b[1].loading,x=a.useNotify(),k=a.useTranslate()("ra.action.create"),S=function(e){C({payload:{data:le({},e,o),ge:c,camposClaveFila:i,estado:"N"}})},T=t.useMemo(function(){return{save:S,setOnFailure:function(e){return console.log(e)}}},[S]);return t.createElement(t.Fragment,null,t.createElement(a.Button,{onClick:function(e){g(!0),e.stopPropagation()}},t.createElement(v,null)),t.createElement(a.SaveContextProvider,{value:T},t.createElement(ke,{open:f,onClose:function(e){g(!1),e.stopPropagation()},labelEstado:k,label:s,msgTitle:e.msgTitle,msgDesc:e.msgDesc,resource:l,save:S,initialValues:h,render:function(e){var o=e.handleSubmitWithRedirect,i=e.pristine,s=e.saving;return t.createElement(t.Fragment,null,t.createElement(d,null,t.Children.map(r,function(e,r){return t.cloneElement(e,{resource:l,estado:"N",initialValue:n[e.props.source],fullWidth:!0,disabled:void 0!==e.props.disabled&&e.props.disabled,InputLabelProps:{shrink:!0}})})),t.createElement(u,null,t.createElement(a.SaveButton,{handleSubmitWithRedirect:o,pristine:i,saving:s,disabled:y}),t.createElement(a.Button,{label:"ra.action.cancel",onClick:function(e){g(!1),e.stopPropagation()},disabled:y},t.createElement(E,null))))}})))},Fe=function(e){var r=e.editors,n=e.clavesFila,o=e.camposClaveFila,i=e.resource,l=e.label,s=e.source,c=e.row,m=a.useNotify(),p=a.useTranslate(),f=a.useSafeSetState(!1),g=f[0],h=f[1],b=he("updateEtrRow",i,{},{refresh:!0,onSuccess:function(e){if(e.error)throw new Error(e.error);h(!1),m("ra.notification.updated","info",{smart_count:1})},onFailure:function(e){m(e.message,"warning")}}),v=b[0],C=b[1].loading,x=p("ra.action.edit");return t.createElement(t.Fragment,null,t.createElement(a.Button,{onClick:function(e){h(!0),e.stopPropagation()}},t.createElement(y,null)),t.createElement(ke,{open:g,onClose:function(e){h(!1),e.stopPropagation()},labelEstado:x,label:l,msgTitle:e.msgTitle,msgDesc:e.msgDesc,resource:i,save:function(e){v({payload:{data:le({},n,e),ge:s,camposClaveFila:o,estado:"M"}})},render:function(e){var n=e.handleSubmitWithRedirect,l=e.pristine,s=e.saving;return t.createElement(t.Fragment,null,t.createElement(d,null,t.Children.map(r,function(e,r){return t.cloneElement(e,{resource:i,estado:"M",initialValue:c[e.props.source],fullWidth:!0,disabled:-1!=o.indexOf(e.props.source),InputLabelProps:{shrink:!0}})})),t.createElement(u,null,t.createElement(a.SaveButton,{handleSubmitWithRedirect:n,pristine:l,saving:s,disabled:C}),t.createElement(a.Button,{label:"ra.action.cancel",onClick:function(e){h(!1),e.stopPropagation()},disabled:C},t.createElement(E,null))))}}))},Ne=s.createTheme({},b.esES),Re=["filterBy","sortModel","columns","reference","filter","enableLoad"],Pe=s.createTheme({},b.esES),Ie=t.createContext(),we=function(e){var r=e.children,n=t.useState(!1),a=n[0],o=n[1],i=t.useMemo(function(){return{open:a,show:function(){return o(!0)},hide:function(){return o(!1)}}},[a]);return t.createElement(Ie.Provider,{value:i},r)},qe=function(){return t.useContext(Ie)},Me=function(e,t,r,n){return{type:"RELOAD_CB",payload:{id:e,method:t,params:r,callback:n}}},Be=function(e,t){return{type:"RELOAD_CB_SUCCESS",payload:{id:e,callback:t}}},De=function(e,t){return{type:"HIDE_INPUT",payload:{id:e,hidden:t}}},Le=function(e,t){return{type:"DISABLE_INPUT",payload:{id:e,disabled:t}}},Oe=function(e,t){return{type:"REQUIRE_INPUT",payload:{id:e,required:t}}},_e=function(){var e=o.useDispatch();return t.useCallback(function(t,r,n,a){e(Me(t,r,n,a))},[e])},Ve=function(){var e=o.useDispatch();return t.useCallback(function(t,r){e(De(t,r))},[e])},Ae=function(){var e=o.useDispatch();return t.useCallback(function(t,r){e(Le(t,r))},[e])},We=function(){var e=o.useDispatch();return t.useCallback(function(t,r){e(Oe(t,r))},[e])},Ge=function(e,t,r,n){return a.useMutation({type:"getJson",resource:e,payload:{method:t,params:r}},n)},ze=function(e){var r=Ge(e),n=r[0],a=r[1].loading;return[t.useCallback(function(e,t,r){return n({payload:{params:t,method:e}},{returnPromise:!0,onSuccess:r,onFailure:r})},[]),a]},je=function(e){return{}},He=function(e){var t=a.useListContext(e),r=a.useNotify(),n=a.useRedirect(),o=a.useRefresh(),i=a.useUnselectAll(e.resource);return{ajax:ze(e.resource)[0],data:t,notify:r,redirect:n,refresh:o,unselectAll:i}},Ue=function(e){var t=_e(),r=Ve(),n=Ae(),o=We(),i=qe(),l=a.useNotify(),s=a.useRedirect();return{ajax:ze(e.resource)[0],notify:l,redirect:s,recargarComboBox:t,progress:i,setHidden:r,setDisable:n,setRequire:o}},Je=function(e){var t=_e(),r=Ve(),n=Ae(),o=We(),i=qe(),l=a.useNotify(),s=a.useRedirect();return{form:k.useForm(),ajax:ze(e.resource)[0],notify:l,redirect:s,recargarComboBox:t,progress:i,setHidden:r,setDisable:n,setRequire:o}},Qe=["isRowEditable"],Ze=["isRowEditable","primaryText","secondaryText","desktopSize","onRenderGrilla","onLoadGrilla","hasEdit"],Ke=g.makeStyles(function(e){return{container:{maxHeight:"70vh"},rowOdd:{backgroundColor:e.palette.action.hover}}},{name:"GrillaEtriek"}),Ye=function(e,t){return void 0===t||"function"==typeof t&&t(e)},Xe=function(e){var r=e.isRowEditable,n=se(e,Qe);return Ye(e.record,r)?t.createElement(a.EditButton,n):null},$e=function(e){!function(e){var r=e.onRenderGrilla,n=e.onLoadGrilla,o=a.useVersion(),i=He(e);t.useEffect(function(){r&&r(i)},[]),t.useEffect(function(){n&&n(i)},[o])}(e);var r=s.useMediaQuery(function(e){return e.breakpoints.down("sm")}),n=Ke(e),o=a.useResourceDefinition(e).hasEdit,i=e.isRowEditable,l=e.primaryText,c=e.secondaryText,u=e.desktopSize,d=void 0!==u&&u,m=se(e,Ze),p=e.children,f=t.Children.count(e.children),g=l,h=c;return l||(f>=4||f>=3||f>=2?g=function(e){return e[p[0].props.source]+" - "+e[p[1].props.source]}:1==f&&(g=function(e){return e[p[0].props.source]})),c||(f>=4?h=function(e){return e[p[2].props.source]+" - "+e[p[3].props.source]}:f>=3?h=function(e){return e[p[2].props.source]}:f>=2?g=function(e){return e[p[0].props.source]+" - "+e[p[1].props.source]}:1==f&&(g=function(e){return e[p[0].props.source]})),r&&!1===d?t.createElement(a.SimpleList,{linkType:function(e){return!(!o||!Ye(e,i))&&"edit"},primaryText:g,secondaryText:h}):t.createElement(x,{className:n.container},t.createElement(a.Datagrid,le({stickyHeader:!0},m),t.Children.map(p,function(e){return e.props.hidden?null:e}),o&&t.createElement(Xe,{isRowEditable:i})))},et=["ids"],tt=["filterValues","setFilters","tabs","GridComponent"],rt=["useFormulario"],nt=function(e){var t=e.useFormulario;return{fichaProps:(void 0===t?je:t)(se(e,rt))}},at=["basePath","className","record","hasEdit","hasShow","hasList","resource","totalPages","showFilter","setSort","setPerPage","perPage","defaultTitle","setPage","setFilters","selectedIds","onUnselectItems","onToggleItem","loaded","loading","exporter","hideFilter","hasCreate","filterValues","displayedFilters","currentSort"],ot=["children","basePath","className","data","hasShow","hasList"],it=function(e){return e.split("_")[1]},lt=N(function(e){var t;return{form:{maxHeight:"70vh",overflow:"auto"},tab:{display:"block",maxHeight:"65vh",overflow:"auto"},contenido:(t={},t[e.breakpoints.up("md")]={width:"20vw"},t)}}),st=a.required(),ct=[st,a.minValue(1)],ut=t.createContext({}),dt=["useFormulario","enableLoad"],mt=function(e){var r=e.enableLoad,n=void 0===r||r,o=se(e,dt),i=a.useResourceContext(e),l=me(i,{enabled:n}),s=l.data,c=l.loading,u=nt(e).fichaProps,d=t.useMemo(function(){return{estado:"N",initialValues:s,loading:c,fichaProps:u}},[s,c,u]);return t.createElement(we,null,t.createElement(ut.Provider,{value:d},t.createElement(a.Create,le({},o,null==u?void 0:u.panel))))};mt.propTypes={useFormulario:l.func};var pt=["basePath","classes","filterValues","handleSubmit","handleSubmitWithRedirect","invalid","label","pristine","resource","saving","selectedIds","submitOnEnter","redirect"],ft=["resource","record","basePath","redirect","className","icon","label"],gt=g.makeStyles(function(e){return{deleteButton:{color:e.palette.error.main,"&:hover":{backgroundColor:M.alpha(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}}),ht=function(e){var r=gt(e),n=a.useTranslate(),o=e.resource,i=e.record,l=e.className,s=e.icon,c=e.label,u=void 0===c?"ra.action.delete":c,d=se(e,ft),m=a.useDelete(o,i.id),p=m[0],f=m[1].loading;return t.createElement(B,{title:n("ra.action.delete")},t.createElement(q,le({disabled:f,onClick:p,label:u,className:D("ra-delete-button",r.deleteButton,l),key:"button"},se(d,pt)),s))};ht.defaultProps={redirect:"list",icon:t.createElement(C,null)};var bt=["useFormulario"],vt=g.makeStyles(function(e){return{snackbarContent:{whiteSpace:"pre-wrap"}}}),Et=function(e){var r=vt(e);return t.createElement(a.Notification,le({},e,{className:r.snackbarContent}))},Ct=N(function(e){return{button:{margin:e.spacing(1)},input:{display:"none"}}}),yt=t.forwardRef(function(e,r){var n=e.isOpen,a=e.onConfirm,o=e.onClose,i=e.title,l=e.dialogText,s=e.children,f=e.hasAccept,g=void 0===f||f,h=e.hasCancel,b=void 0===h||h,v=e.loading,E=void 0!==v&&v,C=Ct(e),y=function(e){o&&o(e)};return t.createElement(c,{ref:r,open:n,fullWidth:!0,onClose:y,"aria-labelledby":"form-dialog-title"},t.createElement(p,{id:"form-dialog-title"},i),t.createElement(d,null,t.createElement(m,null,l),s),(g||b)&&t.createElement(u,null,b&&t.createElement(L,{onClick:y,variant:"contained",color:"secondary",className:C.button,disabled:E},"Cancelar"),g&&t.createElement(L,{onClick:function(e){a&&a(e)},variant:"contained",color:"primary",className:C.button,disabled:E},"Ok")))}),xt=g.makeStyles(function(e){return{block:{pointerEvents:"none",backgroundColor:"#ffffff",opacity:.6,position:"relative"},progress:{position:"absolute",left:"50%",top:"50%"}}}),kt=function(e){var r=xt(e),n=qe(),o=a.useResourceContext(e),i=t.useContext(ut),l=i.estado,c=i.loading,u=i.initialValues,d=i.fichaProps,m=Je({resource:o});return t.useEffect(function(){d.onRenderFicha&&d.onRenderFicha(m,l)},[]),t.useEffect(function(){c||d.onLoadFicha&&d.onLoadFicha(m,l,u)},[c]),t.createElement(a.CardContentInner,{className:n.open?r.block:""},n.open&&t.createElement(s.CircularProgress,{className:r.progress,thickness:4,size:50}),e.children)},St=function(e){return t.createElement(kt,e)},Tt=["mutators"],Ft={setError:function(e,t){t.fields[e[0]].data=e[1]}},Nt=function(e){var r=t.useContext(ut),n=r.initialValues,o=r.fichaProps,i=o.onBeforeSubmitFicha,l=o.config,s=(l=void 0===l?{}:l).mutators,c=void 0===s?{}:s,u=se(l,Tt),d=c===Ft?c:le({},Ft,c),m=Ue(e),p=a.useNotify(),f=t.useCallback(function(t,r,n){var a=i&&i(le({form:{values:t}},m),"N");return"string"==typeof a?void p(a,"warning"):void 0===a||a?e.save(t,r,n):void 0},[i,m]);return t.createElement(a.FormWithRedirect,le({},e,u,{save:f,mutators:d,initialValues:n,render:function(e){return t.createElement(a.SimpleFormView,le({component:St},e))}}))};Nt.propTypes=le({},a.SimpleForm.propTypes),Nt.defaultProps={margin:"normal",variant:"outlined"};var Rt=g.makeStyles(function(e){return{icon:{minWidth:e.spacing(5)},sidebarIsOpen:{paddingLeft:25,transition:"padding-left 195ms cubic-bezier(0.4, 0, 0.6, 1) 0ms"},sidebarIsClosed:{paddingLeft:0,transition:"padding-left 195ms cubic-bezier(0.4, 0, 0.6, 1) 0ms"}}}),Pt=function(e){var r=e.handleToggle,n=e.sidebarIsOpen,o=e.isOpen,i=e.name,l=e.icon,s=e.children,c=e.dense,u=a.useTranslate(),d=Rt(),m=t.createElement(W,{dense:c,button:!0,onClick:r},t.createElement(A,{className:d.icon},o?t.createElement(G,null):l),t.createElement(h,{variant:"inherit",color:"textSecondary"},u(i)));return t.createElement(t.Fragment,null,n||o?m:t.createElement(B,{title:u(i),placement:"right"},m),t.createElement(_,{in:o,timeout:"auto",unmountOnExit:!0},t.createElement(V,{dense:c,component:"div",disablePadding:!0,className:n?d.sidebarIsOpen:d.sidebarIsClosed},s),t.createElement(S,null)))},It=["items","translate"],wt={marginTop:"1.5em"},qt=function(e){var r=e.onMenuClick,n=e.dense,i=e.logout,l=a.useTranslate(),c=t.useState({mnuPrueba:!1}),u=c[0],d=c[1],m=s.useMediaQuery(function(e){return e.breakpoints.down("sm")}),p=s.useMediaQuery(function(e){return e.breakpoints.down("xs")}),f=o.useSelector(function(e){return e.admin.ui.sidebarOpen}),g=function e(r){var n=r.items,o=r.translate,i=se(r,It),l=i.state,s=i.onMenuClick,c=i.handleToggle,u=i.dense,d=i.open;return n&&t.createElement(t.Fragment,null,n.map(function(r){var n=r.name,m=r.menu,p=r.label;return m?t.createElement(Pt,{key:n,name:p,handleToggle:function(){return c(n)},isOpen:l[n],sidebarIsOpen:d,icon:t.createElement(O,null),dense:u},e(le({items:m,translate:o},i))):t.createElement(a.MenuItemLink,{key:n,to:"/"+n,primaryText:o("resources."+n+".name",{_:p}),onClick:s,sidebarIsOpen:d,dense:u,leftIcon:t.createElement(O,null)})}))}({items:JSON.parse(localStorage.getItem("menus")),handleToggle:function(e){d(function(t){var r;return le({},t,((r={})[e]=!t[e],r))})},state:u,activeClassName:"",iconClass:"",className:"",open:f,dense:n,onMenuClick:r,translate:l});return t.createElement(a.Menu,{style:wt},t.createElement(a.DashboardMenuItem,{primaryText:l("ra.page.dashboard"),onClick:r,sidebarIsOpen:f}),g,p&&t.createElement(a.MenuItemLink,{to:"/configuration",primaryText:l("pos.configuration"),leftIcon:t.createElement(O,null),onClick:r,sidebarIsOpen:f,dense:n}),p&&i,!p&&m&&i)},Mt=le({},a.defaultTheme);Mt.palette.type="dark",Mt.overrides.RaSidebar={drawerPaper:{position:"sticky"}},Mt.overrides.RaRichTextInput={"@global":{".ra-rich-text-input":{"& .ql-editor":{"& p:not(:last-child)":{marginBottom:"0"}}}}};var Bt=le({},a.defaultTheme);Bt.palette.type="light",Bt.overrides.RaSidebar={drawerPaper:{position:"sticky"}},Bt.overrides.RaRichTextInput={"@global":{".ra-rich-text-input":{"& .ql-editor":{"& p:not(:last-child)":{marginBottom:"0"}}}}};var Dt={__proto__:null,lightTheme:Bt,darkTheme:Mt},Lt=["apiFolder"],Ot=function(e){return t.createElement(a.Sidebar,e)},_t=["className","exporter","filters","children","jsBotonGrilla"],Vt=["meta","input","render"],At=g.makeStyles(function(e){return{main:{display:"flex",flexDirection:"column",minHeight:"100vh",alignItems:"center",justifyContent:"flex-start",backgroundImage:function(e){return e.loginBackgroundImage},backgroundRepeat:"no-repeat",backgroundSize:"cover"},card:{minWidth:300,marginTop:"6em"},avatar:{margin:"1em",display:"flex",justifyContent:"center"},avatarIcon:{backgroundColor:e.palette.secondary.main},icon:function(t){return{position:"absolute",left:e.spacing(14-Math.ceil(t.textLength/2)-1)}},hint:{marginTop:"1em",display:"flex",justifyContent:"center",color:e.palette.grey[500]},form:{padding:"0 1em 1em 1em"},input:{marginTop:"1em"},actions:{padding:"0 1em 1em 1em"}}}),Wt=function(e){var r=e.meta,n=(r=void 0===r?{touched:!1,error:void 0}:r).touched,a=r.error,o=le({},e.input),i=se(e,Vt);return t.createElement(J,le({error:!(!n||!a),helperText:n&&a},o,i,{fullWidth:!0}))},Gt=function(e){var n=e.loginBackgroundImage,o=e.nameSource,i=void 0===o?"username":o,l=e.passwordSource,s=void 0===l?"password":l,c=t.useState(!1),u=c[0],d=c[1],m=a.useTranslate(),p=m("ra.auth.sign_in"),f=At({loginBackgroundImage:n,textLength:p.length}),g=a.useNotify(),h=a.useLogin(),b=Z.useLocation();return t.createElement(k.Form,{onSubmit:function(e){d(!0),h(e,b.state?b.state.nextPathname:"/").catch(function(e){d(!1),g("string"==typeof e?e:void 0!==e&&e.message?e.message:"ra.auth.sign_in_error","warning")})},validate:function(e){var t={};return e[i]||(t[i]=m("ra.validation.required")),e[s]||(t[s]=m("ra.validation.required")),t},render:function(e){return t.createElement("form",{onSubmit:e.handleSubmit},t.createElement("div",{className:f.main},t.createElement(j,{className:f.card},t.createElement("div",{className:f.avatar},t.createElement(z,{className:f.avatarIcon},t.createElement(r,null))),t.createElement("div",{className:f.hint},"Inicio de Sesión"),t.createElement("div",{className:f.form},t.createElement("div",{className:f.input},t.createElement(k.Field,{autoFocus:!0,name:i,component:Wt,label:m("ra.auth.username"),disabled:u})),t.createElement("div",{className:f.input},t.createElement(k.Field,{name:s,component:Wt,label:m("ra.auth.password"),type:"password",disabled:u}))),t.createElement(H,{className:f.actions},t.createElement(L,{variant:"contained",type:"submit",color:"primary",disabled:u,fullWidth:!0},u&&t.createElement(U,{className:f.icon,size:18,thickness:2}),p))),t.createElement(a.Notification,null)))}})},zt=["displayedFilters","filterValues","showFilter"],jt=["className","options","icon","label"],Ht=g.makeStyles({root:{display:"inline-block"},paddingRight:{paddingRight:4}}),Ut=["fields","className","basePath","record","textAlign","sortable"],Jt=["useFormulario"],Qt=["basePath","children","className","classes","component","form","handleSubmit","handleSubmitWithRedirect","invalid","mutationMode","pristine","record","redirect","resource","saving","submitOnEnter","syncWithLocation","tabs","toolbar","undoable","variant","margin"],Zt=["active","dirty","dirtyFields","dirtyFieldsSinceLastSubmit","dirtySinceLastSubmit","error","errors","hasSubmitErrors","hasValidationErrors","initialValues","modified","modifiedSinceLastSubmit","save","submitError","submitErrors","submitFailed","submitSucceeded","submitting","touched","valid","validating","values","visited","__versions"],Kt=["mutators"],Yt=function(e){var r=e.basePath,n=e.children,o=e.className,i=e.component,l=e.handleSubmit,c=e.handleSubmitWithRedirect,u=e.invalid,d=e.mutationMode,m=e.pristine,p=e.record,f=e.redirect,g=e.resource,h=e.saving,b=e.submitOnEnter,v=e.syncWithLocation,E=void 0===v||v,C=e.tabs,y=e.toolbar,x=e.undoable,k=e.variant,S=e.margin,T=se(e,Qt),F=Xt(e),N=Z.useRouteMatch(),R=Z.useLocation(),P=N?N.url:R.pathname,I=t.useState(0),w=I[0],q=I[1];return t.createElement("form",le({className:D("tabbed-form",o)},$t(T)),t.cloneElement(C,{classes:F,url:P,syncWithLocation:E,onChange:function(e,t){E||q(t)},value:w},n),t.createElement(s.Divider,null),t.createElement(i,{className:F.content},t.Children.map(n,function(e,n){if(e){var o=a.getTabFullPath(e,n,P);return t.createElement(Z.Route,{exact:!0,path:a.escapePath(o)},function(a){return t.isValidElement(e)?t.cloneElement(e,{intent:"content",classes:F,resource:g,record:p,basePath:r,hidden:E?!a.match:w!==n,variant:e.props.variant||k,margin:e.props.margin||S,value:E?o:n}):null})}})),y&&t.cloneElement(y,{basePath:r,className:"toolbar",handleSubmitWithRedirect:c,handleSubmit:l,invalid:u,mutationMode:d,pristine:m,record:p,redirect:f,resource:g,saving:h,submitOnEnter:b,undoable:x}))},Xt=g.makeStyles(function(e){return{errorTabButton:{color:e.palette.error.main},content:{paddingTop:e.spacing(1),paddingLeft:e.spacing(2),paddingRight:e.spacing(2)}}},{name:"RaTabbedForm"});Yt.defaultProps={submitOnEnter:!0,tabs:t.createElement(a.TabbedFormTabs,null),toolbar:t.createElement(a.Toolbar,null),component:function(e){return t.createElement("div",{className:e.className},e.children)}};var $t=function(e){return se(e,Zt)},er={setError:function(e,t){t.fields[e[0]].data=e[1]}},tr=function(e){var r=t.useContext(ut),n=r.initialValues,o=r.fichaProps,i=o.onBeforeSubmitFicha,l=o.config,s=(l=void 0===l?{}:l).mutators,c=void 0===s?{}:s,u=se(l,Kt),d=c===er?c:le({},er,c),m=Ue(e),p=a.useNotify(),f=t.useCallback(function(t,r,n){var a=i&&i(le({form:{values:t}},m),"N");return"string"==typeof a?void p(a,"warning"):void 0===a||a?e.save(t,r,n):void 0},[i,m]);return t.createElement(a.FormWithRedirect,le({},e,u,{save:f,mutators:d,initialValues:n,render:function(e){return t.createElement(Yt,le({component:St},e))}}))};tr.defaultProps={margin:"normal",variant:"outlined",syncWithLocation:!1},Y.ra.page.empty="No records yet";var rr=le({},Y,{login:{id:"ID",hint:"Login",required:"Insert Username or ID",send:"Send",email:"Enter your email address",check_email:"Check your email inbox, we just send you a verification code!",must_enter_credentials:"You must first enter Username or ID",restore_password:"Restore Password",punch_in:"Punch In"},pos:{search:"Search",change_pin:"Change Pin",change_password:"Change Password",configuration:"Configuration",language:"Language",theme:{name:"Theme",light:"Light",dark:"Dark"},dashboard:{welcome:{title:"Welcome",subtitle:"Employee Management",aor_button:"Metiri WebSite"}}},validation:{greater_or_equal:"Must be greater than or equal to %{menor}"}});X.ra.notification.created="Datos guardados correctamente",X.ra.action.bulk_actions="1 seleccionado |||| %{smart_count} seleccionados",X.ra.page.dashboard="Inicio",X.ra.page.empty="Sin registros todavía",X.ra.page.invite="¿Quiere agregar uno?",X.ra.page.list="%{name}",X.ra.page.edit="Editar %{name}",X.ra.action.back="Volver";var nr=le({},X,{login:{id:"Cédula",hint:"Inicio de Sesión",required:"Ingrese Usuario o Cédula",email:"Ingrese su email aquí",send:"Enviar",check_email:"Revisa tu correo electrónico, te enviaremos un código de verificación!",must_enter_credentials:"Debe ingresar Nº de Usuario o Cédula y Contraseña primero",restore_password:"Restablecer Contraseña",punch_in:"Generar Marcas"},pos:{search:"Búsqueda",change_pin:"Cambiar Pin",change_password:"Cambiar Contraseña",configuration:"Configuración",language:"Lenguaje",theme:{name:"Tema Visual",light:"Light",dark:"Dark"},dashboard:{welcome:{title:"Bienvenid@",subtitle:"Gestión de Funcionarios",aor_button:"Sitio de Metiri"}}},validation:{greater_or_equal:"Debe ser mayor o igual a %{menor}"}}),ar=["hidden"],or=["hidden","useContenido"],ir=["hidden"],lr=function(e){var r=t.useContext(ut),n=r.estado,a=r.loading,o=r.fichaProps,i=(void 0===o?{}:o)[e.source],l=void 0===i?{}:i,s=e.hidden,c=void 0!==s&&s,u=se(e,ar),d=l.hidden,m=l.useContenido,p=void 0===m?je:m,f=se(l,or),g=void 0!==d?d:c,h=p(le({},u,{estado:n,hidden:g,loading:a},f)),b=h.hidden,v=se(h,ir);if(void 0===h)throw new Error("useContenido está devolviendo undefined para el contenido "+e.source+"\n Asegúrese de incluir una instrucción return al final de la función");return{propsContenido:le({},u,f,v),hidden:void 0!==b?b:g}},sr=["onFocus","onChange","onBlur","hidden","disabled","validate"],cr=["onFocus","onBlur","onChange","hidden","disabled","useContenido","validate"],ur=["hidden","disabled","onFocus","onChnage","onBlur","validate"],dr=function(e,t,r){return"string"==typeof(null==r?void 0:r.data)?r.data:void 0},mr=function(e){var r=t.useContext(ut),n=r.estado,i=r.loading,l=r.fichaProps,s=void 0===l?{}:l,c=o.useSelector(function(t){var r=t.configInputs?t.configInputs.filter(function(t){return t.id===e.source}):[];return r[0]?r[0]:null})||{},u=c.disabled,d=c.hidden,m=!0===c.required?st:void 0,p=s[e.source],f=void 0===p?{}:p,g=e.onFocus,h=e.onChange,b=e.onBlur,v=e.hidden,E=void 0!==v&&v,C=e.disabled,y=void 0!==C&&C,x=e.validate,k=se(e,sr),S=a.useInput({source:e.source}).input,T=f.onFocus,F=f.onBlur,N=f.onChange,R=f.hidden,P=f.disabled,I=f.useContenido,w=void 0===I?je:I,q=f.validate,M=se(f,cr),B=void 0!==R?R:E,D=void 0!==P?P:y,L=void 0!==T?T:g,O=void 0!==F?F:b,_=void 0!==N?N:h,V=Je(e),A=w(le({},k,{estado:n,hidden:B,loading:i,utils:V},M)),W=t.useRef(S.value);if(void 0===A)throw new Error("useContenido está devolviendo undefined para el contenido "+e.source+"\n Asegúrese de incluir una instrucción return al final de la función");var G=A.hidden,z=A.disabled,j=A.onFocus,H=A.onChnage,U=A.onBlur,J=A.validate,Q=se(A,ur),Z=j||L,K=U||O,Y=H||_,X=le({},V,{prev:W.current}),$=Array.isArray(x)?x:[x],ee=Array.isArray(q)?q:[q],te=Array.isArray(J)?J:[J];return{propsContenido:le({onFocus:function(e){Z&&L(V,n,e),W.current=e.target.value},onBlur:function(e){return K&&K(X,n,e)},onChange:function(e){return Y&&Y(X,n,e)},helperText:!1,validate:[].concat($,ee,te,[dr,m]).filter(function(e){return void 0!==e})},k,M,Q,{disabled:void 0!==u?u:void 0!==z?z:D}),hidden:void 0!==d?d:void 0!==G?G:B}},pr=["callback"],fr=["helperText"],gr=["callback"],hr=function(e){var r=e.callback,n=se(e,pr),o=a.useListContext(n),i=o.data,l=o.loading;return t.useEffect(function(){l||"function"==typeof r&&r(Object.values(i))},[i]),t.createElement(a.SelectInput,n)},br=["helperText"],vr=["helperText"],Er=g.makeStyles(function(e){return{confirmPrimary:{color:e.palette.primary.main},confirmWarning:{color:e.palette.error.main,"&:hover":{backgroundColor:M.alpha(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}},iconPaddingStyle:{paddingRight:"0.5em"}}},{name:"RaConfirm"}),Cr=function(e){return t.createElement(ae,{handle:"#draggable-dialog-title",cancel:'[class*="MuiDialogContent-root"]'},t.createElement(s.Paper,e))},yr={cursor:"move"},xr=function(e){var r,n=e.isOpen,i=e.loading,l=e.title,s=e.content,m=e.cancel,f=e.confirmColor,g=e.ConfirmIcon,h=e.CancelIcon,b=e.onClose,v=e.onConfirm,E=e.contentResource,C=e.translateOptions,y=void 0===C?{}:C,x=Er(e),k=a.useTranslate(),S=o.useSelector(function(e){return e.admin.resources[E].list.selectedIds}),T=t.useCallback(function(e,t){e.stopPropagation(),v(e,S)},[S,v]),F=t.useCallback(function(e){e.stopPropagation()},[]);return t.createElement(c,{open:n,onClose:b,onClick:F,fullWidth:!0,maxWidth:"lg",PaperComponent:Cr,"aria-labelledby":"draggable-dialog-title"},t.createElement(p,{style:yr,id:"draggable-dialog-title"},k(l,le({_:l},y))),t.createElement(d,{dividers:!0},s),t.createElement(u,null,t.createElement(L,{disabled:i,onClick:b},t.createElement(h,{className:x.iconPaddingStyle}),k(m,{_:m})),t.createElement(L,{disabled:i,onClick:function(e){return T(e,"yes")},className:D("ra-confirm",(r={},r[x.confirmWarning]="warning"===f,r[x.confirmPrimary]="primary"===f,r)),autoFocus:!0},t.createElement(g,{className:x.iconPaddingStyle}),k("ra.action.confirm"))))};xr.propTypes={cancel:l.string,classes:l.object,confirm:l.string,confirmColor:l.string,ConfirmIcon:l.elementType,CancelIcon:l.elementType,content:l.node.isRequired,isOpen:l.bool,loading:l.bool,onClose:l.func.isRequired,onConfirm:l.func.isRequired,title:l.string.isRequired},xr.defaultProps={cancel:"ra.action.cancel",classes:{},confirmColor:"primary",ConfirmIcon:re,CancelIcon:ne,isOpen:!1};var kr=["disabled","asistant","asistantResource","label","source"],Sr=function(){return t.createElement(t.Fragment,null)},Tr={seleccion:[],all:!0,none:!1},Fr=function(e){return!e||null!=e&&e.all?"Todos":null!=e&&e.none||0===e.seleccion.length?"Ninguno":"Selección ("+e.seleccion.length+")"},Nr=function(e){return e},Rr=function(e){return t.createElement(a.List,le({},e,{hasCreate:!1,exporter:!1,perPage:25,title:" ",bulkActionButtons:t.createElement("span",null)}),t.createElement(a.Datagrid,null,t.createElement(a.TextField,{source:"funced",sortable:!0,label:"Cédula"}),t.createElement(a.TextField,{source:"funpriape",sortable:!0,label:"Apellido"}),t.createElement(a.TextField,{source:"funprinom",sortable:!0,label:"Nombre"})))},Pr={fillista:"empcod=-1"},Ir=function(e){var r=t.useState(Pr),n=r[0],o=r[1],i=a.useDataProvider(),l=t.useCallback(function(e){o({fillista:e.node.key})},[o]),c=t.useCallback(function(e){return i.getChildNodes("form_224",{parentId:e?e.itemData.id:""}).then(function(e){return e.data}).catch(function(){throw new Error("Data Loading Error")})},[i]);return t.createElement(s.Box,{display:"flex",flex:1,alignItems:"flex-start",height:"20em"},t.createElement(s.Box,{flexGrow:1},t.createElement(oe.TreeView,{id:"funcionarios-treeview",dataStructure:"plain",rootValue:"",onItemClick:l,createChildren:c})),t.createElement(s.Box,{flexGrow:2},t.createElement(Rr,{resource:"form_224",basePath:"/form_224",filter:n})))},wr=g.makeStyles(function(e){return{confirmPrimary:{color:e.palette.primary.main},confirmWarning:{color:e.palette.error.main,"&:hover":{backgroundColor:M.alpha(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}},iconPaddingStyle:{paddingRight:"0.5em"}}},{name:"RaConfirm"}),qr=function(e){return t.createElement(ae,{handle:"#draggable-dialog-title",cancel:'[class*="MuiDialogContent-root"]'},t.createElement(s.Paper,e))},Mr={cursor:"move"},Br=function(e){var r,n=e.isOpen,o=e.loading,i=e.title,l=e.cancel,s=e.confirmColor,m=e.ConfirmIcon,f=e.CancelIcon,g=e.onClose,h=e.onConfirm,b=e.translateOptions,v=void 0===b?{}:b,E=wr(e),C=a.useTranslate(),y=t.useCallback(function(e,t){e.stopPropagation(),h(e,t)},[h]),x=t.useCallback(function(e){e.stopPropagation()},[]);return t.createElement(c,{open:n,onClose:g,onClick:x,fullWidth:!0,maxWidth:"lg",PaperComponent:qr,"aria-labelledby":"draggable-dialog-title"},t.createElement(p,{style:Mr,id:"draggable-dialog-title"},C(i,le({_:i},v))),t.createElement(d,{dividers:!0},t.createElement(Ir,null)),t.createElement(u,null,t.createElement(L,{disabled:o,onClick:g},t.createElement(f,{className:E.iconPaddingStyle}),C(l,{_:l})),t.createElement(L,{disabled:o,onClick:function(e){return y(e,"yes")},className:D("ra-confirm",(r={},r[E.confirmWarning]="warning"===s,r[E.confirmPrimary]="primary"===s,r)),autoFocus:!0},t.createElement(m,{className:E.iconPaddingStyle}),C("ra.action.confirm"))))};Br.propTypes={cancel:l.string,classes:l.object,confirm:l.string,confirmColor:l.string,ConfirmIcon:l.elementType,CancelIcon:l.elementType,isOpen:l.bool,loading:l.bool,onClose:l.func.isRequired,onConfirm:l.func.isRequired,title:l.string.isRequired},Br.defaultProps={cancel:"ra.action.cancel",classes:{},confirmColor:"primary",ConfirmIcon:re,CancelIcon:ne,isOpen:!1};var Dr=["disabled","asistant","asistantResource","label","source"],Lr={seleccion:[],all:!0,none:!1},Or=function(e){return!e||null!=e&&e.all?"Todos":null!=e&&e.none||0===e.seleccion.length?"Ninguno":"Selección ("+e.seleccion.length+")"},_r=function(e){return e},Vr=["tipo"],Ar=["tipo","value"];exports.AppBar=de,exports.BooleanField=function(e){var r=lr(e),n=r.propsContenido,o=r.hidden,i=JSON.parse(JSON.stringify(e.record)),l=i[e.source];return i[e.source]=""!=l&&"0"!=l,!o&&t.createElement(a.BooleanField,le({},n,{record:i}))},exports.Camino=function(e){var r=mr(e);return!r.hidden&&t.createElement(a.FileInput,le({accept:"",maxSize:5e6},r.propsContenido),t.createElement(a.ImageField,{source:"src"}))},exports.CheckBox=function(e){var r=mr(e);return!r.hidden&&t.createElement(a.BooleanInput,r.propsContenido)},exports.ComboBox=function(e){var r,n,i=mr(e),l=i.propsContenido,s=i.hidden,c=t.useRef(!1),u=o.useDispatch(),d=a.useVersion(),m=l.helperText,p=se(l,fr),f=o.useSelector(function(t){var r=t.reload_cb?t.reload_cb.filter(function(t){return t.id===e.source}):[];return r[0]?r[0]:null}),g=t.useRef(f),h=null===f&&g.current?g.current:f;return h&&(r=h.callback,n=se(h,gr)),t.useEffect(function(){null!==f&&(g.current=f,u(Be(e.source)))},[JSON.stringify(f)]),t.useEffect(function(){c.current=!0},[d]),c.current?!s&&t.createElement(a.ReferenceInput,le({},p,{perPage:250,filter:n}),t.createElement(hr,{callback:r,helperText:m,optionText:"etiqueta",optionValue:e.source})):t.createElement(a.Labeled,{id:e.id,label:e.label,source:e.source,resource:e.resource,className:e.className,isRequired:e.isRequired,meta:e.meta,input:e.input,margin:e.margin},t.createElement(a.LinearProgress,{timeout:1}))},exports.ComboBoxManual=function(e){var r=mr(e);return!r.hidden&&t.createElement(a.SelectInput,r.propsContenido)},exports.CreateEtriek=mt,exports.DeleteButtonNoWarning=ht,exports.EditEtriek=function(e){var r=se(e,bt),n=a.useEditController(r),o=n.record,i=n.loading,l=nt(e).fichaProps,s=t.useMemo(function(){return{estado:"M",initialValues:o,loading:i,fichaProps:l}},[o,i,l]);return t.createElement(we,null,t.createElement(ut.Provider,{value:s},t.createElement(a.Edit,le({},r,null==l?void 0:l.panel))))},exports.EtrGrid=function(e){var r=e.filterBy,n=void 0===r?"":r,o=e.claves,i=e.sortModel,l=e.columns,c=e.reference,u=e.allowAdd,d=void 0===u||u,m=e.allowRemove,p=void 0===m||m,g=e.etrResource,h=e.enableLoad,v=void 0===h||h,E=se(e,ve),C=e.record,y=t.useRef(!1),x=Ee(e),k=a.useVersion(),S=t.useState(i)[1],T=i[0],F=T.field,N=T.sort;t.useEffect(function(){y.current=!0},[k]);var R=Object.keys(C).filter(function(e){return o.split(",").includes(e)}).reduce(function(e,t){return e[t]=C[t],e},{}),P={};n.split(",").forEach(function(e){e&&(P[e]=[{type:"string",comparison:"eq",value:C[e],field:e}])});var I=a.useGetList(c,{page:1,perPage:200},{field:F,order:N},P,{enabled:v&&y.current}),w=I.data,q=I.ids,M=I.loading,B=t.useMemo(function(){return q.map(function(e){return w[e]})},[q,w]),D=[d?{field:"BTN",headerName:"",sortable:!1,renderHeader:function(e){return t.createElement(Te,le({},E,{etrResource:g,camposClaveFila:o,clavesFila:R,api:e.api}))}}:{}].concat(l,[{field:" ",width:80,headerName:"",headerAlign:"center",sortable:!1,disableClickEventBubbling:!0,renderCell:function(e){return t.createElement(Fe,le({},E,{camposClaveFila:o,clavesFila:R,api:e.api,row:e.row}))}},p?{field:" ",headerName:"",headerAlign:"center",sortable:!1,disableClickEventBubbling:!0,renderCell:function(e){return t.createElement(Se,le({},E,{camposClaveFila:o,api:e.api,row:e.row}))}}:{}]),L=t.useMemo(function(){return D},[JSON.stringify(D)]);return M?t.createElement(a.Loading,null):t.createElement(f,{className:x.rootPaper},t.createElement(s.ThemeProvider,{theme:Ne},t.createElement(b.DataGrid,le({className:x.root,disableSelectionOnClick:!0,pageSize:50,hideFooter:!0,sortModel:i,rows:B,columns:L,onSortModelChange:function(e){return S(e)},components:{NoRowsOverlay:fe}},E))))},exports.EtriekNotification=Et,exports.FichaActions=function(e){var r=e.children,n=e.basePath,o=e.className,i=e.data,l=e.hasShow,s=e.hasList,c=void 0===s||s,u=se(e,ot);return t.createElement(a.TopToolbar,le({className:o},se(u,at)),r,c&&t.createElement(a.ListButton,{label:"ra.action.back",basePath:n,icon:t.createElement(R,null)}),l&&t.createElement(a.ShowButton,{basePath:n,record:i}))},exports.FichaContext=ut,exports.FormDialog=yt,exports.FormEtriek=Nt,exports.GE=function(e){var r=e.filterBy,n=void 0===r?"":r,o=e.sortModel,i=e.columns,l=e.reference,c=e.filter,u=void 0===c?[]:c,d=e.enableLoad,m=void 0===d||d,p=se(e,Re),g=e.record,h=t.useRef(!1),v=pe(e),E=a.useVersion(),C=t.useState(o),y=C[0],x=C[1],k=o[0],S=k.field,T=k.sort,F=t.useMemo(function(){return[].concat(i)},[JSON.stringify(i)]);t.useEffect(function(){h.current=!0},[E]);var N=[];n.split(",").forEach(function(e){e&&N.push({type:"string",comparison:"eq",value:g[e],field:e})});var R=le({},N.concat(u)),P=a.useGetList(l,{page:1,perPage:200},{field:S,order:T},R,{enabled:m&&h.current}),I=P.data,w=P.ids,q=P.loading,M=t.useMemo(function(){return w.map(function(e){return I[e]})},[w,I]);return q?t.createElement(a.Loading,null):t.createElement(f,{className:v.rootPaper},t.createElement(s.ThemeProvider,{theme:Pe},t.createElement(b.DataGrid,le({className:v.root,disableSelectionOnClick:!0,pageSize:50,hideFooter:!0,rows:M,columns:F,sortModel:y,onSortModelChange:function(e){return x(e)},components:{NoRowsOverlay:fe}},p))))},exports.GrillaEtriek=$e,exports.ImageField=function(e){var r=e.title,n=e.source,o=e.src,i=a.useRecordContext(e);return t.createElement(z,{title:r,src:o+"/"+i[n]})},exports.Layout=function(e){var r=se(e,Lt),n=o.useSelector(function(e){return"dark"===e.theme?Mt:Bt});return t.createElement(a.Layout,le({},r,{appBar:de,sidebar:Ot,menu:qt,theme:n,notification:Et}))},exports.ListActionsEtriek=function(e){var r=e.className,n=e.exporter,o=e.filters,i=e.children,l=e.jsBotonGrilla,s=se(e,_t),c=He(e).utils,u=a.useListContext(e),d=a.useResourceContext(s),m=a.useResourceDefinition(s).hasCreate,p=u.currentSort,f=u.displayedFilters,g=u.filterValues,h=u.basePath,b=u.selectedIds,v=u.showFilter,E=u.total,C=le({},c,u);return t.useMemo(function(){return t.createElement(a.TopToolbar,le({className:r},a.sanitizeListRestProps(s)),o&&t.cloneElement(o,{resource:d,showFilter:v,displayedFilters:f,filterValues:g,context:"button"}),m&&t.createElement(a.CreateButton,{basePath:h}),!1!==n&&t.createElement(a.ExportButton,{disabled:0===E,resource:d,sort:p,filterValues:g}),t.Children.map(i,function(e,r){return t.cloneElement(e,{onClick:e.props.options?null:function(t){return l(C,e.key)},options:e.props.options?e.props.options.map(function(e){return le({},e,{onClick:function(t){return l(C,e.key)}})}):null})}))},[d,f,g,b,o,E])},exports.ListCheck=function(e){var r=mr(e),n=r.propsContenido,o=r.hidden,i=t.useRef(!1),l=a.useVersion(),s=n.helperText,c=se(n,br);return t.useEffect(function(){i.current=!0},[l]),i.current?!o&&t.createElement(a.ReferenceArrayInput,c,t.createElement(a.SelectArrayInput,{helperText:s,optionText:"etiqueta",optionValue:e.source})):t.createElement(a.Labeled,{id:e.id,label:e.label,source:e.source,resource:e.resource,className:e.className,isRequired:e.isRequired,meta:e.meta,input:e.input,margin:e.margin},t.createElement(a.LinearProgress,{timeout:1}))},exports.Login=function(e){return t.createElement(Q.ThemeProvider,{theme:g.createTheme(Bt)},t.createElement(Gt,e))},exports.Menu=qt,exports.MenuButton=function(e){var r,n=e.className,o=e.options,i=void 0===o?[]:o,l=e.icon,s=e.label,c=se(e,jt),u=t.useState(!1),d=u[0],m=u[1],p=t.useRef(),f=t.useState(0),g=f[0],h=f[1],b=Ht(e),v=a.useResourceContext(e);return t.createElement("div",le({className:D(b.root,n)},se(c,zt)),t.createElement(a.Button,{className:"add-filter",label:s,onClick:function(e){e.preventDefault(),m(!0),p.current=e.currentTarget},title:i[g].label},(null===(r=i[g])||void 0===r?void 0:r.icon)||l),t.createElement(K,{open:d,anchorEl:p.current,onClose:function(e){p.current&&p.current.contains(e.target)||m(!1)}},i.map(function(e,r){return t.createElement(W,{key:e.label,disabled:e.disabled,selected:r===g,onClick:function(t){!function(e,t){h(t),m(!1)}(0,r),e.onClick&&e.onClick(t,r)},resource:v,title:e.label},e.icon,t.createElement("span",{className:b.paddingRight}),t.createElement(a.FieldTitle,{label:e.label,resource:v}))})))},exports.MultiTextField=function(e){var r=e.fields,n=e.className,a=e.record,o=se(e,Ut),i=r.separador,l=void 0===i?"":i,s=r.secundario,c=void 0===s?[]:s,u=r.hasSecundario,d=r.campos.map(function(e){return void 0!==a[e]?a[e]:e}).join(""+l);return t.createElement(h,le({noWrap:!0,variant:"inherit",className:n},o),d,u&&t.createElement(h,{component:"span",display:"block",color:"textSecondary",variant:"caption"},c.map(function(e){return(e.etiqueta||"---")+": "+(a[e.campo]||"---")}).join(" ")))},exports.Password=function(e){var r=mr(e);return!r.hidden&&t.createElement(a.PasswordInput,r.propsContenido)},exports.RadioButton=function(e){var r=mr(e),n=r.propsContenido,o=r.hidden,i=t.useRef(!1),l=a.useVersion(),s=n.helperText,c=se(n,vr);return t.useEffect(function(){i.current=!0},[l]),i.current?!o&&t.createElement(a.ReferenceInput,c,t.createElement(a.RadioButtonGroupInput,{helperText:s,optionText:"etiqueta",optionValue:e.source})):t.createElement(a.Labeled,{id:e.id,label:e.label,source:e.source,resource:e.resource,className:e.className,isRequired:e.isRequired,meta:e.meta,input:e.input},t.createElement(a.LinearProgress,null))},exports.RadioButtonManual=function(e){var r=mr(e);return!r.hidden&&t.createElement(a.RadioButtonGroupInput,r.propsContenido)},exports.Separador=function(e){return t.createElement(h,{variant:"h6",gutterBottom:!0},e.children)},exports.ShowEtriek=function(e){var r=se(e,Jt),n=a.useShowController(r),o=n.record,i=n.loading,l=nt(e).fichaProps,s=t.useMemo(function(){return{estado:"M",initialValues:o,loading:i,fichaProps:l}},[o,i,l]);return t.createElement(we,null,t.createElement(ut.Provider,{value:s},t.createElement(a.Show,le({},r,n,null==l?void 0:l.panel))))},exports.SubMenu=Pt,exports.TBSF=function(e){var r=e.disabled,n=e.label,i=void 0===n?"Funcionarios":n,l=e.source,s=se(e,Dr),c=o.useSelector(function(e){return e.admin.resources.form_224.list.selectedIds}),u=t.useState(!1),d=u[0],m=u[1],p=k.useForm(),f=t.useCallback(function(){m(!1)},[m]);return t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",alignItems:"center"}},t.createElement(a.TextInput,le({initialValue:Lr},s,{source:l,label:i,disabled:!0,parse:_r,format:Or,helperText:!1,InputProps:{endAdornment:t.createElement(t.Fragment,null,t.createElement(q,{onClick:function(e){p.change(l,{seleccion:[],all:!1,none:!0})},disabled:r,"aria-label":"Ninguno",size:"small",title:"Ninguno"},t.createElement(ee,null)),t.createElement(q,{onClick:function(e){p.change(l,{seleccion:[],all:!0,none:!1})},disabled:r,"aria-label":"Todos",size:"small",title:"Todos"},t.createElement($,null)),t.createElement(q,{onClick:function(e){return m(!0)},disabled:r,"aria-label":"Selección",size:"small",title:"Selección"},t.createElement(te,null)))}}))),t.createElement(Br,{isOpen:d,title:"Selección de "+i,onConfirm:function(e,t){m(!1),p.change(l,{seleccion:c,all:!1,none:!1})},onClose:f}))},exports.TabbedFormEtriek=tr,exports.TabbedGrillaEtriek=function(e){var r=e.filterValues,n=e.setFilters,a=e.tabs,o=a.ids,i=se(a,et),l=e.GridComponent,s=void 0===l?$e:l,c=se(e,tt),u=r.id;return t.createElement(t.Fragment,null,t.createElement(F,{value:u,indicatorColor:"primary",onChange:function(e,t){n(le({},r,{id:t}))}},o.map(function(e){return t.createElement(T,{key:e,label:e.charAt(0).toUpperCase()+e.slice(1),value:e})})),t.createElement(S,null),t.createElement(s,le({},c,i[u])))},exports.TextArea=function(e){var r=mr(e);return!r.hidden&&t.createElement(a.TextInput,le({multiline:!0},r.propsContenido))},exports.TextBox=function(e){var r=e.tipo,n=se(e,Vr),o=mr(n),i=o.propsContenido,l=o.hidden,s=k.useForm(),c=a.useInput({source:e.source}),u=c.input,d=c.meta,m="F"===r||"Z"===r;t.useEffect(function(){i.value&&(s.change(e.source,i.value),e.disabled&&s.blur(e.source))}),t.useEffect(function(){m&&""!=u.value&&d.valid&&d.modified&&!d.active&&i.onBlur()},[u.value]);var p=le({},i);return!l&&("N"===r||"D"===r?t.createElement(a.NumberInput,p):"F"===r?t.createElement(ie.KeyboardDateInput,p):"Z"===r?t.createElement(ie.KeyboardDateTimeInput,p):t.createElement(a.TextInput,"H"===r?le({},p,{type:"time"}):p))},exports.TextBoxSelection=function(e){var r=e.disabled,n=e.asistant,o=e.asistantResource,i=e.label,l=e.source,s=se(e,kr),c=t.useState(!1),u=c[0],d=c[1],m=k.useForm(),p=t.useCallback(function(){d(!1)},[d]);return t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",alignItems:"center"}},t.createElement(a.TextInput,le({initialValue:Tr},s,{source:l,label:i,disabled:!0,parse:Nr,format:Fr,helperText:!1,InputProps:{endAdornment:t.createElement(t.Fragment,null,t.createElement(q,{onClick:function(e){m.change(l,{seleccion:[],all:!1,none:!0})},disabled:r,"aria-label":"Ninguno",size:"small",title:"Ninguno"},t.createElement(ee,null)),t.createElement(q,{onClick:function(e){m.change(l,{seleccion:[],all:!0,none:!1})},disabled:r,"aria-label":"Todos",size:"small",title:"Todos"},t.createElement($,null)),t.createElement(q,{onClick:function(e){return d(!0)},disabled:r,"aria-label":"Selección",size:"small",title:"Selección"},t.createElement(te,null)))}}))),t.createElement(xr,{isOpen:u,title:"Selección de "+i,contentResource:o,content:t.createElement(n,{bulkActionButtons:t.createElement(Sr,null),hasCreate:!1,exporter:!1,resource:o,basePath:"/"+o}),onConfirm:function(e,t){d(!1),m.change(l,{seleccion:t,all:!1,none:!1})},onClose:p}))},exports.TextField=function(e){var r=e.tipo,n=se(e,Ar),o=lr(n),i=o.hidden,l=le({},o.propsContenido);return!i&&("N"===r||"D"===r?t.createElement(a.NumberField,l):"F"===r?t.createElement(a.DateField,l):"Z"===r?t.createElement(a.DateField,le({},l,{showTime:!0})):t.createElement(a.TextField,l))},exports.choicesEstado=[{id:"1",name:"Aprobado"},{id:"2",name:"Rechazado"},{id:"3",name:"Pendiente"}],exports.dateFormat=function(e,t){if(!e)return"";if(e instanceof Date)return e.toString();if(-1!==e.indexOf("/")){var r=e.split("/");return new Date(parseInt(r[2],10),parseInt(r[1],10)-1,parseInt(r[0],10)).toString()}var n=/(\d{4})-(\d{2})-(\d{2})/.exec(e);if(null!==n){var a=new Date(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10));if(!isNaN(a))return a.toString()}},exports.dateFormatOptions={format:"dd/MM/yyyy"},exports.dateParser=function(e,t){if(!e)return"";var r=e.split(" "),n="";switch(r[1]){case"Jan":n="01";break;case"Feb":n="02";break;case"Mar":n="03";break;case"Apr":n="04";break;case"May":n="05";break;case"Jun":n="06";break;case"Jul":n="07";break;case"Aug":n="08";break;case"Sep":n="09";break;case"Oct":n="10";break;case"Nov":n="11";break;case"Dec":n="12"}return r[2]+"/"+n+"/"+r[3]},exports.dateTimeFormat=function(e){if(!e)return"";if(e instanceof Date)return e.toString();if(-1!==e.indexOf("/")){var t=e.split("/");return new Date(parseInt(t[2].substr(0,4),10),parseInt(t[1],10)-1,parseInt(t[0],10),t[2].substr(5,2),t[2].substr(8,2)).toString()}var r=/(\d{4})-(\d{2})-(\d{2})\s(\d{2}):(\d{2})/.exec(e);if(null!==r){var n=new Date(parseInt(r[1],10),parseInt(r[2],10)-1,parseInt(r[3],10),r[4],r[5]);if(!isNaN(n))return n.toString()}},exports.dateTimeParser=function(e,t){if(!e)return"";var r=e.split(" "),n="";switch(r[1]){case"Jan":n="01";break;case"Feb":n="02";break;case"Mar":n="03";break;case"Apr":n="04";break;case"May":n="05";break;case"Jun":n="06";break;case"Jul":n="07";break;case"Aug":n="08";break;case"Sep":n="09";break;case"Oct":n="10";break;case"Nov":n="11";break;case"Dec":n="12"}return r[2]+"/"+n+"/"+r[3]+" "+r[4].substr(0,5)},exports.deleteRecargarComboBox=Be,exports.descargarLink=function(e,t){var r=document.createElement("a");r.style.display="none",document.body.appendChild(r),r.setAttribute("href",e),r.setAttribute("download",t),r.click()},exports.enMessages=rr,exports.esMessages=nr,exports.etrFechaMayorQue=function(e){return function(t,r){var n=r[e];if(t&&n){var a=n.split("/").reverse().join("/"),o=t.split("/").reverse().join("/");if(w(a).isAfter(o))return{message:"validation.greater_or_equal",args:{menor:n}}}}},exports.etrRequerido=st,exports.etrRequeridoNumerico=ct,exports.getFormcodFromResource=it,exports.localeOptions=function(e){return void 0===e&&(e="es"),{locale:"en"==e?P:I}},exports.recargarComboBox=Me,exports.setDisableAction=Le,exports.setHiddenAction=De,exports.setRequireAction=Oe,exports.themes=Dt,exports.timeFormat=function(e){if(!e)return"";if(e instanceof Date)return e.toString();if(-1!==e.indexOf(":")){var t=e.split(":"),r=new Date;return r.setHours(t[0]),r.setMinutes(t[1]),r.toString()}var n=/(\d{2}):(\d{2})/.exec(e);if(null!==n){var a=new Date;return a.setHours(n[0]),a.setMinutes(n[1]),a.toString()}},exports.timeParser=function(e,t){return e?e.split(" ")[4].substr(0,5):""},exports.useAjax=ze,exports.useContenidoController=mr,exports.useDeleteRowEtrGrid=ge,exports.useFieldController=lr,exports.useFormProgress=qe,exports.useGetJson=Ge,exports.useInitFicha=nt,exports.useNuevo=me,exports.useReferenceLabel=function(e,t){var r=a.useResourceContext();return o.useSelector(function(n){var a;return(null===(a=n.admin.resources["cb_"+it(r)+"_"+e].data[t])||void 0===a?void 0:a.etiqueta)||""})},exports.useSaveRowEtrGrid=he,exports.useStylesContenidos=lt,exports.useUtils=Je,exports.useUtilsGrilla=He,exports.useUtilsSubmit=Ue;
@@ -1 +1 @@
1
- import{forwardRef as e,createElement as n,useRef as r,useState as t,useEffect as a,useMemo as o,Fragment as i,Children as l,cloneElement as s,useCallback as c,createContext as u,useContext as d,isValidElement as m}from"react";import p from"@material-ui/icons/Lock";import f from"@material-ui/icons/VpnLock";import{useTranslate as g,MenuItemLink as h,AppBar as v,UserMenu as b,useGetOne as y,useMutation as C,useVersion as k,useGetList as N,Loading as S,useSafeSetState as P,useNotify as x,Button as T,SaveContextProvider as w,SaveButton as I,useDeleteWithConfirmController as R,Confirm as F,FormWithRedirect as O,useListContext as _,useRedirect as E,useRefresh as D,useUnselectAll as M,useResourceDefinition as L,SimpleList as B,Datagrid as V,EditButton as A,TopToolbar as q,ListButton as W,ShowButton as z,required as j,minValue as G,useResourceContext as H,Create as J,useDelete as U,useEditController as Z,Edit as Q,Notification as Y,CardContentInner as K,SimpleFormView as X,SimpleForm as $,Menu as ee,DashboardMenuItem as ne,defaultTheme as re,Layout as te,Sidebar as ae,sanitizeListRestProps as oe,CreateButton as ie,ExportButton as le,useLogin as se,FieldTitle as ce,useShowController as ue,Show as de,getTabFullPath as me,escapePath as pe,TabbedFormTabs as fe,Toolbar as ge,BooleanField as he,useInput as ve,FileInput as be,ImageField as ye,BooleanInput as Ce,ReferenceInput as ke,Labeled as Ne,LinearProgress as Se,SelectInput as Pe,useRecordContext as xe,ReferenceArrayInput as Te,SelectArrayInput as we,PasswordInput as Ie,RadioButtonGroupInput as Re,TextInput as Fe,useDataProvider as Oe,List as _e,TextField as Ee,NumberInput as De,NumberField as Me,DateField as Le}from"react-admin";import{useSelector as Be,useDispatch as Ve}from"react-redux";import Ae,{string as qe,func as We,any as ze,bool as je}from"prop-types";import{alpha as Ge,createTheme as He,ThemeProvider as Je,useMediaQuery as Ue,CircularProgress as Ze,Divider as Qe,Paper as Ye,Box as Ke}from"@material-ui/core";import Xe from"@material-ui/core/Dialog";import $e from"@material-ui/core/DialogActions";import en from"@material-ui/core/DialogContent";import nn from"@material-ui/core/DialogContentText";import rn from"@material-ui/core/DialogTitle";import tn from"@material-ui/core/Paper";import{makeStyles as an,createTheme as on}from"@material-ui/core/styles";import ln from"@material-ui/core/Typography";import{GridOverlay as sn,esES as cn,DataGrid as un}from"@material-ui/data-grid";import dn from"@material-ui/icons/Add";import mn from"@material-ui/icons/Cancel";import pn from"@material-ui/icons/Delete";import fn from"@material-ui/icons/Edit";import gn from"@material-ui/core/TableContainer";import{useForm as hn,Form as vn,Field as bn}from"react-final-form";import yn from"@material-ui/core/Divider";import Cn from"@material-ui/core/Tab";import kn from"@material-ui/core/Tabs";import Nn from"@material-ui/core/styles/makeStyles";import Sn from"@material-ui/icons/ChevronLeft";import Pn from"date-fns/locale/en-US";import xn from"date-fns/locale/es";import Tn from"moment";import wn from"@material-ui/core/IconButton";import{alpha as In}from"@material-ui/core/styles/colorManipulator";import Rn from"@material-ui/core/Tooltip";import Fn from"classnames";import On from"@material-ui/core/Button";import _n from"@material-ui/icons/Settings";import En from"@material-ui/core/Collapse";import Dn from"@material-ui/core/List";import Mn from"@material-ui/core/ListItemIcon";import Ln from"@material-ui/core/MenuItem";import Bn from"@material-ui/icons/ExpandMore";import Vn from"@material-ui/core/Avatar";import An from"@material-ui/core/Card";import qn from"@material-ui/core/CardActions";import Wn from"@material-ui/core/CircularProgress";import zn from"@material-ui/core/TextField";import{ThemeProvider as jn}from"@material-ui/styles";import{useLocation as Gn,useRouteMatch as Hn,Route as Jn}from"react-router-dom";import Un from"@material-ui/core/Menu";import Zn from"ra-language-english";import Qn from"@blackbox-vision/ra-language-spanish";import Yn from"@material-ui/icons/Check";import Kn from"@material-ui/icons/RemoveCircleOutline";import Xn from"@material-ui/icons/Search";import $n from"@material-ui/icons/CheckCircle";import er from"@material-ui/icons/ErrorOutline";import nr from"react-draggable";import{TreeView as rr}from"devextreme-react";import{KeyboardDateInput as tr,KeyboardDateTimeInput as ar}from"react-admin-date-inputs";function or(){return(or=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e}).apply(this,arguments)}function ir(e,n){if(null==e)return{};var r,t,a={},o=Object.keys(e);for(t=0;t<o.length;t++)n.indexOf(r=o[t])>=0||(a[r]=e[r]);return a}var lr=e(function(e,r){var t=g(),a=Be(function(e){return[e.admin.resources.form_275?1:0,e.admin.resources.form_59?1:0]}),o=a[1];return[a[0]?n(h,{ref:r,key:"/form_275",to:"/form_275",primaryText:t("pos.change_pin"),leftIcon:n(p,null),onClick:e.onClick}):null,o?n(h,{ref:r,key:"/form_59",to:"/form_59",primaryText:t("pos.change_password"),leftIcon:n(f,null),onClick:e.onClick}):null]}),sr=function(e){return n(b,e,n(lr,null))},cr=function(e){return n(v,or({},e,{elevation:1,userMenu:n(sr,null)}))},ur=function(e,n){return y(e,"-1",n)},dr=an(function(e){return{root:{"& .MuiDataGrid-columnsContainer":{backgroundColor:"light"===e.palette.type?"#fafafa":"#1d1d1d"},"& .MuiDataGrid-iconSeparator":{display:"none"}},header:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.light},rootPaper:{width:"100%",height:"40vh",borderRadius:0,marginTop:e.spacing(1)},rootOverlay:{flexDirection:"column","& .ant-empty-img-1":{fill:"light"===e.palette.type?"#aeb8c2":"#262626"},"& .ant-empty-img-2":{fill:"light"===e.palette.type?"#f5f5f7":"#595959"},"& .ant-empty-img-3":{fill:"light"===e.palette.type?"#dce0e6":"#434343"},"& .ant-empty-img-4":{fill:"light"===e.palette.type?"#ffffff":"#1c1c1c"},"& .ant-empty-img-5":{fillOpacity:"light"===e.palette.type?"0.8":"0.08",fill:"light"===e.palette.type?"#f5f5f5":"#ffffff"}},label:{marginTop:e.spacing(1)},deleteButton:{color:e.palette.error.main,"&:hover":{backgroundColor:Ge(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}},{name:"GE"}),mr=function(){var e=dr();return n(sn,{className:e.rootOverlay},n("svg",{width:"120",height:"100",viewBox:"0 0 184 152","aria-hidden":!0,focusable:"false"},n("g",{fill:"none",fillRule:"evenodd"},n("g",{transform:"translate(24 31.67)"},n("ellipse",{className:"ant-empty-img-5",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),n("path",{className:"ant-empty-img-1",d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z"}),n("path",{className:"ant-empty-img-2",d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z"}),n("path",{className:"ant-empty-img-3",d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z"})),n("path",{className:"ant-empty-img-3",d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z"}),n("g",{className:"ant-empty-img-4",transform:"translate(149.65 15.383)"},n("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),n("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"})))),n("div",{className:e.label},"No hay registros"))},pr=function(e,n,r){return C({type:"deleteEtrRow",resource:e,payload:{params:n}},r)},fr=function(e,n,r,t){return C({type:e,resource:n,payload:{params:r}},t)},gr=["api","basePath","classes","className","confirmTitle","confirmContent","icon","record","redirect","onSuccess","onFailure","source","camposClaveFila"],hr=["filterBy","claves","sortModel","columns","reference","allowAdd","allowRemove","etrResource","enableLoad"],vr=an(function(e){return{root:{"& .MuiDataGrid-columnsContainer":{backgroundColor:"light"===e.palette.type?"#fafafa":"#1d1d1d"},"& .MuiDataGrid-iconSeparator":{display:"none"}},header:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.light},rootPaper:{width:"100%",height:"40vh",borderRadius:0,marginTop:e.spacing(1)},rootOverlay:{flexDirection:"column","& .ant-empty-img-1":{fill:"light"===e.palette.type?"#aeb8c2":"#262626"},"& .ant-empty-img-2":{fill:"light"===e.palette.type?"#f5f5f7":"#595959"},"& .ant-empty-img-3":{fill:"light"===e.palette.type?"#dce0e6":"#434343"},"& .ant-empty-img-4":{fill:"light"===e.palette.type?"#ffffff":"#1c1c1c"},"& .ant-empty-img-5":{fillOpacity:"light"===e.palette.type?"0.8":"0.08",fill:"light"===e.palette.type?"#f5f5f5":"#ffffff"}},label:{marginTop:e.spacing(1)},deleteButton:{color:e.palette.error.main,"&:hover":{backgroundColor:Ge(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}},{name:"EtrGrid"}),br={marginLeft:"1.6rem",fontWeight:"bold"},yr=n(pn,null),Cr=function(e){var r=e.basePath,t=e.confirmTitle,a=void 0===t?"ra.message.delete_title":t,o=e.confirmContent,l=void 0===o?"ra.message.delete_content":o,s=e.icon,u=void 0===s?yr:s,d=e.record,m=e.redirect,p=void 0!==m&&m,f=e.onSuccess,g=e.onFailure,h=e.source,v=e.camposClaveFila,b=ir(e,gr),y=vr(e),C=x(),k=R({record:d,redirect:p,basePath:r,onSuccess:f,onFailure:g}),N=k.open,S=k.loading,P=k.handleDialogOpen,w=k.handleDialogClose,I=pr(e.resource,{},{refresh:!0,onSuccess:function(e){if(e.error)throw new Error(e.error);C("ra.notification.deleted","info",{smart_count:1})},onFailure:function(e){C(e.message,"warning")}})[0],O=Object.keys(d).filter(function(e){return v.split(",").includes(e)}).reduce(function(e,n){return e[n]=d[n],e},{}),_=c(function(e){I({payload:{ge:h,clavesFila:O}})},[d]);return n(i,null,n(T,or({key:"button",onClick:P,className:y.deleteButton},b),u),n(F,{isOpen:N,loading:S,title:a,content:l,onConfirm:_,onClose:w}))},kr=function(e){return n(Xe,{open:e.open,onClose:e.onClose,fullWidth:!0},n(rn,null,e.labelEstado+" "+e.label),n(nn,null,n(ln,{component:"span",display:"block",variant:"subtitle1",style:or({},br)},e.msgTitle),e.msgDesc),n(O,{resource:e.resource,save:e.save,render:e.render,initialValues:e.initialValues}))};kr.propTypes={label:qe,onClick:We,icon:ze,open:je,onClose:We,labelEstado:qe,msgTitle:ze,msgDesc:ze,resource:ze,save:We,render:We};var Nr=function(e){return n(Cr,{api:!0,confirmTitle:"ra.action.delete",source:e.source,record:e.row,resource:e.resource,camposClaveFila:e.camposClaveFila})},Sr=function(e){var r=e.editors,t=e.record,a=e.clavesFila,c=e.camposClaveFila,u=e.resource,d=e.label,m=e.source,p=e.etrResource,f=P(!1),h=f[0],v=f[1],b=ur(p,{enabled:h}).data,y=fr("createEtrRow",u,{},{refresh:!0,onSuccess:function(e){if(e.error)throw new Error(e.error);v(!1),N("ra.notification.created","info")},onFailure:function(e){N(e.message,"warning")}}),C=y[0],k=y[1].loading,N=x(),S=g()("ra.action.create"),R=function(e){C({payload:{data:or({},e,a),ge:m,camposClaveFila:c,estado:"N"}})},F=o(function(){return{save:R,setOnFailure:function(e){return console.log(e)}}},[R]);return n(i,null,n(T,{onClick:function(e){v(!0),e.stopPropagation()}},n(dn,null)),n(w,{value:F},n(kr,{open:h,onClose:function(e){v(!1),e.stopPropagation()},labelEstado:S,label:d,msgTitle:e.msgTitle,msgDesc:e.msgDesc,resource:u,save:R,initialValues:b,render:function(e){var a=e.handleSubmitWithRedirect,o=e.pristine,c=e.saving;return n(i,null,n(en,null,l.map(r,function(e,n){return s(e,{resource:u,estado:"N",initialValue:t[e.props.source],fullWidth:!0,disabled:void 0!==e.props.disabled&&e.props.disabled,InputLabelProps:{shrink:!0}})})),n($e,null,n(I,{handleSubmitWithRedirect:a,pristine:o,saving:c,disabled:k}),n(T,{label:"ra.action.cancel",onClick:function(e){v(!1),e.stopPropagation()},disabled:k},n(mn,null))))}})))},Pr=function(e){var r=e.editors,t=e.clavesFila,a=e.camposClaveFila,o=e.resource,c=e.label,u=e.source,d=e.row,m=x(),p=g(),f=P(!1),h=f[0],v=f[1],b=fr("updateEtrRow",o,{},{refresh:!0,onSuccess:function(e){if(e.error)throw new Error(e.error);v(!1),m("ra.notification.updated","info",{smart_count:1})},onFailure:function(e){m(e.message,"warning")}}),y=b[0],C=b[1].loading,k=p("ra.action.edit");return n(i,null,n(T,{onClick:function(e){v(!0),e.stopPropagation()}},n(fn,null)),n(kr,{open:h,onClose:function(e){v(!1),e.stopPropagation()},labelEstado:k,label:c,msgTitle:e.msgTitle,msgDesc:e.msgDesc,resource:o,save:function(e){y({payload:{data:or({},t,e),ge:u,camposClaveFila:a,estado:"M"}})},render:function(e){var t=e.handleSubmitWithRedirect,c=e.pristine,u=e.saving;return n(i,null,n(en,null,l.map(r,function(e,n){return s(e,{resource:o,estado:"M",initialValue:d[e.props.source],fullWidth:!0,disabled:-1!=a.indexOf(e.props.source),InputLabelProps:{shrink:!0}})})),n($e,null,n(I,{handleSubmitWithRedirect:t,pristine:c,saving:u,disabled:C}),n(T,{label:"ra.action.cancel",onClick:function(e){v(!1),e.stopPropagation()},disabled:C},n(mn,null))))}}))},xr=He({},cn),Tr=function(e){var i=e.filterBy,l=void 0===i?"":i,s=e.claves,c=e.sortModel,u=e.columns,d=e.reference,m=e.allowAdd,p=void 0===m||m,f=e.allowRemove,g=void 0===f||f,h=e.etrResource,v=e.enableLoad,b=void 0===v||v,y=ir(e,hr),C=e.record,P=r(!1),x=vr(e),T=k(),w=t(c)[1],I=c[0],R=I.field,F=I.sort;a(function(){P.current=!0},[T]);var O=Object.keys(C).filter(function(e){return s.split(",").includes(e)}).reduce(function(e,n){return e[n]=C[n],e},{}),_={};l.split(",").forEach(function(e){e&&(_[e]=[{type:"string",comparison:"eq",value:C[e],field:e}])});var E=N(d,{page:1,perPage:200},{field:R,order:F},_,{enabled:b&&P.current}),D=E.data,M=E.ids,L=E.loading,B=o(function(){return M.map(function(e){return D[e]})},[M,D]),V=[p?{field:"BTN",headerName:"",sortable:!1,renderHeader:function(e){return n(Sr,or({},y,{etrResource:h,camposClaveFila:s,clavesFila:O,api:e.api}))}}:{}].concat(u,[{field:" ",width:80,headerName:"",headerAlign:"center",sortable:!1,disableClickEventBubbling:!0,renderCell:function(e){return n(Pr,or({},y,{camposClaveFila:s,clavesFila:O,api:e.api,row:e.row}))}},g?{field:" ",headerName:"",headerAlign:"center",sortable:!1,disableClickEventBubbling:!0,renderCell:function(e){return n(Nr,or({},y,{camposClaveFila:s,api:e.api,row:e.row}))}}:{}]),A=o(function(){return V},[JSON.stringify(V)]);return L?n(S,null):n(tn,{className:x.rootPaper},n(Je,{theme:xr},n(un,or({className:x.root,disableSelectionOnClick:!0,pageSize:50,hideFooter:!0,sortModel:c,rows:B,columns:A,onSortModelChange:function(e){return w(e)},components:{NoRowsOverlay:mr}},y))))},wr=["filterBy","sortModel","columns","reference","filter","enableLoad"],Ir=He({},cn),Rr=function(e){var i=e.filterBy,l=void 0===i?"":i,s=e.sortModel,c=e.columns,u=e.reference,d=e.filter,m=void 0===d?[]:d,p=e.enableLoad,f=void 0===p||p,g=ir(e,wr),h=e.record,v=r(!1),b=dr(e),y=k(),C=t(s),P=C[0],x=C[1],T=s[0],w=T.field,I=T.sort,R=o(function(){return[].concat(c)},[JSON.stringify(c)]);a(function(){v.current=!0},[y]);var F=[];l.split(",").forEach(function(e){e&&F.push({type:"string",comparison:"eq",value:h[e],field:e})});var O=or({},F.concat(m)),_=N(u,{page:1,perPage:200},{field:w,order:I},O,{enabled:f&&v.current}),E=_.data,D=_.ids,M=_.loading,L=o(function(){return D.map(function(e){return E[e]})},[D,E]);return M?n(S,null):n(tn,{className:b.rootPaper},n(Je,{theme:Ir},n(un,or({className:b.root,disableSelectionOnClick:!0,pageSize:50,hideFooter:!0,rows:L,columns:R,sortModel:P,onSortModelChange:function(e){return x(e)},components:{NoRowsOverlay:mr}},g))))},Fr=u(),Or=function(e){var r=e.children,a=t(!1),i=a[0],l=a[1],s=o(function(){return{open:i,show:function(){return l(!0)},hide:function(){return l(!1)}}},[i]);return n(Fr.Provider,{value:s},r)},_r=function(){return d(Fr)},Er=function(e,n,r,t){return{type:"RELOAD_CB",payload:{id:e,method:n,params:r,callback:t}}},Dr=function(e,n){return{type:"RELOAD_CB_SUCCESS",payload:{id:e,callback:n}}},Mr=function(e,n){return{type:"HIDE_INPUT",payload:{id:e,hidden:n}}},Lr=function(e,n){return{type:"DISABLE_INPUT",payload:{id:e,disabled:n}}},Br=function(e,n){return{type:"REQUIRE_INPUT",payload:{id:e,required:n}}},Vr=function(){var e=Ve();return c(function(n,r,t,a){e(Er(n,r,t,a))},[e])},Ar=function(){var e=Ve();return c(function(n,r){e(Mr(n,r))},[e])},qr=function(){var e=Ve();return c(function(n,r){e(Lr(n,r))},[e])},Wr=function(){var e=Ve();return c(function(n,r){e(Br(n,r))},[e])},zr=function(e,n,r,t){return C({type:"getJson",resource:e,payload:{method:n,params:r}},t)},jr=function(e){var n=zr(e),r=n[0],t=n[1].loading;return[c(function(e,n,t){return r({payload:{params:n,method:e}},{returnPromise:!0,onSuccess:t,onFailure:t})},[]),t]},Gr=function(e){return{}},Hr=function(e){var n=_(e),r=x(),t=E(),a=D(),o=M(e.resource);return{ajax:jr(e.resource)[0],data:n,notify:r,redirect:t,refresh:a,unselectAll:o}},Jr=function(e){var n=Vr(),r=Ar(),t=qr(),a=Wr(),o=_r(),i=x(),l=E();return{ajax:jr(e.resource)[0],notify:i,redirect:l,recargarComboBox:n,progress:o,setHidden:r,setDisable:t,setRequire:a}},Ur=function(e){var n=Vr(),r=Ar(),t=qr(),a=Wr(),o=_r(),i=x(),l=E();return{form:hn(),ajax:jr(e.resource)[0],notify:i,redirect:l,recargarComboBox:n,progress:o,setHidden:r,setDisable:t,setRequire:a}},Zr=["isRowEditable"],Qr=["isRowEditable","primaryText","secondaryText","desktopSize","onRenderGrilla","onLoadGrilla","hasEdit"],Yr=an(function(e){return{container:{maxHeight:"70vh"},rowOdd:{backgroundColor:e.palette.action.hover}}},{name:"GrillaEtriek"}),Kr=function(e,n){return void 0===n||"function"==typeof n&&n(e)},Xr=function(e){var r=e.isRowEditable,t=ir(e,Zr);return Kr(e.record,r)?n(A,t):null},$r=function(e){!function(e){var n=e.onRenderGrilla,r=e.onLoadGrilla,t=k(),o=Hr(e);a(function(){n&&n(o)},[]),a(function(){r&&r(o)},[t])}(e);var r=Ue(function(e){return e.breakpoints.down("sm")}),t=Yr(e),o=L(e).hasEdit,i=e.isRowEditable,s=e.primaryText,c=e.secondaryText,u=e.desktopSize,d=void 0!==u&&u,m=ir(e,Qr),p=e.children,f=l.count(e.children),g=s,h=c;return s||(f>=4||f>=3||f>=2?g=function(e){return e[p[0].props.source]+" - "+e[p[1].props.source]}:1==f&&(g=function(e){return e[p[0].props.source]})),c||(f>=4?h=function(e){return e[p[2].props.source]+" - "+e[p[3].props.source]}:f>=3?h=function(e){return e[p[2].props.source]}:f>=2?g=function(e){return e[p[0].props.source]+" - "+e[p[1].props.source]}:1==f&&(g=function(e){return e[p[0].props.source]})),r&&!1===d?n(B,{linkType:function(e){return!(!o||!Kr(e,i))&&"edit"},primaryText:g,secondaryText:h}):n(gn,{className:t.container},n(V,or({stickyHeader:!0},m),l.map(p,function(e){return e.props.hidden?null:e}),o&&n(Xr,{isRowEditable:i})))},et=["ids"],nt=["filterValues","setFilters","tabs","GridComponent"],rt=function(e){var r=e.filterValues,t=e.setFilters,a=e.tabs,o=a.ids,l=ir(a,et),s=e.GridComponent,c=void 0===s?$r:s,u=ir(e,nt),d=r.id;return n(i,null,n(kn,{value:d,indicatorColor:"primary",onChange:function(e,n){t(or({},r,{id:n}))}},o.map(function(e){return n(Cn,{key:e,label:e.charAt(0).toUpperCase()+e.slice(1),value:e})})),n(yn,null),n(c,or({},u,l[d])))},tt=["useFormulario"],at=function(e){var n=e.useFormulario;return{fichaProps:(void 0===n?Gr:n)(ir(e,tt))}},ot=["basePath","className","record","hasEdit","hasShow","hasList","resource","totalPages","showFilter","setSort","setPerPage","perPage","defaultTitle","setPage","setFilters","selectedIds","onUnselectItems","onToggleItem","loaded","loading","exporter","hideFilter","hasCreate","filterValues","displayedFilters","currentSort"],it=["children","basePath","className","data","hasShow","hasList"],lt=function(e){return e.split("_")[1]},st=Nn(function(e){var n;return{form:{maxHeight:"70vh",overflow:"auto"},tab:{display:"block",maxHeight:"65vh",overflow:"auto"},contenido:(n={},n[e.breakpoints.up("md")]={width:"20vw"},n)}}),ct=function(e,n){if(!e)return"";if(e instanceof Date)return e.toString();if(-1!==e.indexOf("/")){var r=e.split("/");return new Date(parseInt(r[2],10),parseInt(r[1],10)-1,parseInt(r[0],10)).toString()}var t=/(\d{4})-(\d{2})-(\d{2})/.exec(e);if(null!==t){var a=new Date(parseInt(t[1],10),parseInt(t[2],10)-1,parseInt(t[3],10));if(!isNaN(a))return a.toString()}},ut=function(e,n){if(!e)return"";var r=e.split(" "),t="";switch(r[1]){case"Jan":t="01";break;case"Feb":t="02";break;case"Mar":t="03";break;case"Apr":t="04";break;case"May":t="05";break;case"Jun":t="06";break;case"Jul":t="07";break;case"Aug":t="08";break;case"Sep":t="09";break;case"Oct":t="10";break;case"Nov":t="11";break;case"Dec":t="12"}return r[2]+"/"+t+"/"+r[3]},dt=function(e){if(!e)return"";if(e instanceof Date)return e.toString();if(-1!==e.indexOf("/")){var n=e.split("/");return new Date(parseInt(n[2].substr(0,4),10),parseInt(n[1],10)-1,parseInt(n[0],10),n[2].substr(5,2),n[2].substr(8,2)).toString()}var r=/(\d{4})-(\d{2})-(\d{2})\s(\d{2}):(\d{2})/.exec(e);if(null!==r){var t=new Date(parseInt(r[1],10),parseInt(r[2],10)-1,parseInt(r[3],10),r[4],r[5]);if(!isNaN(t))return t.toString()}},mt=function(e,n){if(!e)return"";var r=e.split(" "),t="";switch(r[1]){case"Jan":t="01";break;case"Feb":t="02";break;case"Mar":t="03";break;case"Apr":t="04";break;case"May":t="05";break;case"Jun":t="06";break;case"Jul":t="07";break;case"Aug":t="08";break;case"Sep":t="09";break;case"Oct":t="10";break;case"Nov":t="11";break;case"Dec":t="12"}return r[2]+"/"+t+"/"+r[3]+" "+r[4].substr(0,5)},pt=function(e){if(!e)return"";if(e instanceof Date)return e.toString();if(-1!==e.indexOf(":")){var n=e.split(":"),r=new Date;return r.setHours(n[0]),r.setMinutes(n[1]),r.toString()}var t=/(\d{2}):(\d{2})/.exec(e);if(null!==t){var a=new Date;return a.setHours(t[0]),a.setMinutes(t[1]),a.toString()}},ft=function(e,n){return e?e.split(" ")[4].substr(0,5):""},gt=function(e){return n(ln,{variant:"h6",gutterBottom:!0},e.children)},ht=function(e){var r=e.children,t=e.basePath,a=e.className,o=e.data,i=e.hasShow,l=e.hasList,s=void 0===l||l,c=ir(e,it);return n(q,or({className:a},ir(c,ot)),r,s&&n(W,{label:"ra.action.back",basePath:t,icon:n(Sn,null)}),i&&n(z,{basePath:t,record:o}))},vt=j(),bt=[vt,G(1)],yt={format:"dd/MM/yyyy"},Ct=function(e){return function(n,r){var t=r[e];if(n&&t){var a=t.split("/").reverse().join("/"),o=n.split("/").reverse().join("/");if(Tn(a).isAfter(o))return{message:"validation.greater_or_equal",args:{menor:t}}}}},kt=function(e){return void 0===e&&(e="es"),{locale:"en"==e?Pn:xn}},Nt=[{id:"1",name:"Aprobado"},{id:"2",name:"Rechazado"},{id:"3",name:"Pendiente"}],St=function(e,n){var r=document.createElement("a");r.style.display="none",document.body.appendChild(r),r.setAttribute("href",e),r.setAttribute("download",n),r.click()},Pt=function(e,n){var r=H();return Be(function(t){var a;return(null===(a=t.admin.resources["cb_"+lt(r)+"_"+e].data[n])||void 0===a?void 0:a.etiqueta)||""})},xt=u({}),Tt=["useFormulario","enableLoad"],wt=function(e){var r=e.enableLoad,t=void 0===r||r,a=ir(e,Tt),i=H(e),l=ur(i,{enabled:t}),s=l.data,c=l.loading,u=at(e).fichaProps,d=o(function(){return{estado:"N",initialValues:s,loading:c,fichaProps:u}},[s,c,u]);return n(Or,null,n(xt.Provider,{value:d},n(J,or({},a,null==u?void 0:u.panel))))};wt.propTypes={useFormulario:Ae.func};var It=["basePath","classes","filterValues","handleSubmit","handleSubmitWithRedirect","invalid","label","pristine","resource","saving","selectedIds","submitOnEnter","redirect"],Rt=["resource","record","basePath","redirect","className","icon","label"],Ft=an(function(e){return{deleteButton:{color:e.palette.error.main,"&:hover":{backgroundColor:In(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}}),Ot=function(e){var r=Ft(e),t=g(),a=e.resource,o=e.record,i=e.className,l=e.icon,s=e.label,c=void 0===s?"ra.action.delete":s,u=ir(e,Rt),d=U(a,o.id),m=d[0],p=d[1].loading;return n(Rn,{title:t("ra.action.delete")},n(wn,or({disabled:p,onClick:m,label:c,className:Fn("ra-delete-button",r.deleteButton,i),key:"button"},ir(u,It)),l))};Ot.defaultProps={redirect:"list",icon:n(pn,null)};var _t=["useFormulario"],Et=function(e){var r=ir(e,_t),t=Z(r),a=t.record,i=t.loading,l=at(e).fichaProps,s=o(function(){return{estado:"M",initialValues:a,loading:i,fichaProps:l}},[a,i,l]);return n(Or,null,n(xt.Provider,{value:s},n(Q,or({},r,null==l?void 0:l.panel))))},Dt=an(function(e){return{snackbarContent:{whiteSpace:"pre-wrap"}}}),Mt=function(e){var r=Dt(e);return n(Y,or({},e,{className:r.snackbarContent}))},Lt=Nn(function(e){return{button:{margin:e.spacing(1)},input:{display:"none"}}}),Bt=e(function(e,r){var t=e.isOpen,a=e.onConfirm,o=e.onClose,i=e.title,l=e.dialogText,s=e.children,c=e.hasAccept,u=void 0===c||c,d=e.hasCancel,m=void 0===d||d,p=e.loading,f=void 0!==p&&p,g=Lt(e),h=function(e){o&&o(e)};return n(Xe,{ref:r,open:t,fullWidth:!0,onClose:h,"aria-labelledby":"form-dialog-title"},n(rn,{id:"form-dialog-title"},i),n(en,null,n(nn,null,l),s),(u||m)&&n($e,null,m&&n(On,{onClick:h,variant:"contained",color:"secondary",className:g.button,disabled:f},"Cancelar"),u&&n(On,{onClick:function(e){a&&a(e)},variant:"contained",color:"primary",className:g.button,disabled:f},"Ok")))}),Vt=an(function(e){return{block:{pointerEvents:"none",backgroundColor:"#ffffff",opacity:.6,position:"relative"},progress:{position:"absolute",left:"50%",top:"50%"}}}),At=function(e){var r=Vt(e),t=_r(),o=H(e),i=d(xt),l=i.estado,s=i.loading,c=i.fichaProps,u=Ur({resource:o});return a(function(){c.onRenderFicha&&c.onRenderFicha(u,l)},[]),a(function(){s||c.onLoadFicha&&c.onLoadFicha(u,l)},[s]),n(K,{className:t.open?r.block:""},t.open&&n(Ze,{className:r.progress,thickness:4,size:50}),e.children)},qt=function(e){return n(At,e)},Wt=["mutators"],zt={setError:function(e,n){n.fields[e[0]].data=e[1]}},jt=function(e){var r=d(xt),t=r.initialValues,a=r.fichaProps,o=a.onBeforeSubmitFicha,i=a.config,l=(i=void 0===i?{}:i).mutators,s=void 0===l?{}:l,u=ir(i,Wt),m=s===zt?s:or({},zt,s),p=Jr(e),f=x(),g=c(function(n,r,t){var a=o&&o(or({form:{values:n}},p),"N");return"string"==typeof a?void f(a,"warning"):void 0===a||a?e.save(n,r,t):void 0},[o,p]);return n(O,or({},e,u,{save:g,mutators:m,initialValues:t,render:function(e){return n(X,or({component:qt},e))}}))};jt.propTypes=or({},$.propTypes),jt.defaultProps={margin:"normal",variant:"outlined"};var Gt=an(function(e){return{icon:{minWidth:e.spacing(5)},sidebarIsOpen:{paddingLeft:25,transition:"padding-left 195ms cubic-bezier(0.4, 0, 0.6, 1) 0ms"},sidebarIsClosed:{paddingLeft:0,transition:"padding-left 195ms cubic-bezier(0.4, 0, 0.6, 1) 0ms"}}}),Ht=function(e){var r=e.handleToggle,t=e.sidebarIsOpen,a=e.isOpen,o=e.name,l=e.icon,s=e.children,c=e.dense,u=g(),d=Gt(),m=n(Ln,{dense:c,button:!0,onClick:r},n(Mn,{className:d.icon},a?n(Bn,null):l),n(ln,{variant:"inherit",color:"textSecondary"},u(o)));return n(i,null,t||a?m:n(Rn,{title:u(o),placement:"right"},m),n(En,{in:a,timeout:"auto",unmountOnExit:!0},n(Dn,{dense:c,component:"div",disablePadding:!0,className:t?d.sidebarIsOpen:d.sidebarIsClosed},s),n(yn,null)))},Jt=["items","translate"],Ut={marginTop:"1.5em"},Zt=function(e){var r=e.onMenuClick,a=e.dense,o=e.logout,l=g(),s=t({mnuPrueba:!1}),c=s[0],u=s[1],d=Ue(function(e){return e.breakpoints.down("sm")}),m=Ue(function(e){return e.breakpoints.down("xs")}),p=Be(function(e){return e.admin.ui.sidebarOpen}),f=function e(r){var t=r.items,a=r.translate,o=ir(r,Jt),l=o.state,s=o.onMenuClick,c=o.handleToggle,u=o.dense,d=o.open;return t&&n(i,null,t.map(function(r){var t=r.name,i=r.menu,m=r.label;return i?n(Ht,{key:t,name:m,handleToggle:function(){return c(t)},isOpen:l[t],sidebarIsOpen:d,icon:n(_n,null),dense:u},e(or({items:i,translate:a},o))):n(h,{key:t,to:"/"+t,primaryText:a("resources."+t+".name",{_:m}),onClick:s,sidebarIsOpen:d,dense:u,leftIcon:n(_n,null)})}))}({items:JSON.parse(localStorage.getItem("menus")),handleToggle:function(e){u(function(n){var r;return or({},n,((r={})[e]=!n[e],r))})},state:c,activeClassName:"",iconClass:"",className:"",open:p,dense:a,onMenuClick:r,translate:l});return n(ee,{style:Ut},n(ne,{primaryText:l("ra.page.dashboard"),onClick:r,sidebarIsOpen:p}),f,m&&n(h,{to:"/configuration",primaryText:l("pos.configuration"),leftIcon:n(_n,null),onClick:r,sidebarIsOpen:p,dense:a}),m&&o,!m&&d&&o)},Qt=or({},re);Qt.palette.type="dark",Qt.overrides.RaSidebar={drawerPaper:{position:"sticky"}},Qt.overrides.RaRichTextInput={"@global":{".ra-rich-text-input":{"& .ql-editor":{"& p:not(:last-child)":{marginBottom:"0"}}}}};var Yt=or({},re);Yt.palette.type="light",Yt.overrides.RaSidebar={drawerPaper:{position:"sticky"}},Yt.overrides.RaRichTextInput={"@global":{".ra-rich-text-input":{"& .ql-editor":{"& p:not(:last-child)":{marginBottom:"0"}}}}};var Kt={__proto__:null,lightTheme:Yt,darkTheme:Qt},Xt=["apiFolder"],$t=function(e){return n(ae,e)},ea=function(e){var r=ir(e,Xt),t=Be(function(e){return"dark"===e.theme?Qt:Yt});return n(te,or({},r,{appBar:cr,sidebar:$t,menu:Zt,theme:t,notification:Mt}))},na=["className","exporter","filters","children","jsBotonGrilla"],ra=function(e){var r=e.className,t=e.exporter,a=e.filters,i=e.children,c=e.jsBotonGrilla,u=ir(e,na),d=Hr(e).utils,m=_(e),p=H(u),f=L(u).hasCreate,g=m.currentSort,h=m.displayedFilters,v=m.filterValues,b=m.basePath,y=m.selectedIds,C=m.showFilter,k=m.total,N=or({},d,m);return o(function(){return n(q,or({className:r},oe(u)),a&&s(a,{resource:p,showFilter:C,displayedFilters:h,filterValues:v,context:"button"}),f&&n(ie,{basePath:b}),!1!==t&&n(le,{disabled:0===k,resource:p,sort:g,filterValues:v}),l.map(i,function(e,n){return s(e,{onClick:e.props.options?null:function(n){return c(N,e.key)},options:e.props.options?e.props.options.map(function(e){return or({},e,{onClick:function(n){return c(N,e.key)}})}):null})}))},[p,h,v,y,a,k])},ta=["meta","input","render"],aa=an(function(e){return{main:{display:"flex",flexDirection:"column",minHeight:"100vh",alignItems:"center",justifyContent:"flex-start",backgroundImage:function(e){return e.loginBackgroundImage},backgroundRepeat:"no-repeat",backgroundSize:"cover"},card:{minWidth:300,marginTop:"6em"},avatar:{margin:"1em",display:"flex",justifyContent:"center"},avatarIcon:{backgroundColor:e.palette.secondary.main},icon:function(n){return{position:"absolute",left:e.spacing(14-Math.ceil(n.textLength/2)-1)}},hint:{marginTop:"1em",display:"flex",justifyContent:"center",color:e.palette.grey[500]},form:{padding:"0 1em 1em 1em"},input:{marginTop:"1em"},actions:{padding:"0 1em 1em 1em"}}}),oa=function(e){var r=e.meta,t=(r=void 0===r?{touched:!1,error:void 0}:r).touched,a=r.error,o=or({},e.input),i=ir(e,ta);return n(zn,or({error:!(!t||!a),helperText:t&&a},o,i,{fullWidth:!0}))},ia=function(e){var r=e.loginBackgroundImage,a=e.nameSource,o=void 0===a?"username":a,i=e.passwordSource,l=void 0===i?"password":i,s=t(!1),c=s[0],u=s[1],d=g(),m=d("ra.auth.sign_in"),f=aa({loginBackgroundImage:r,textLength:m.length}),h=x(),v=se(),b=Gn();return n(vn,{onSubmit:function(e){u(!0),v(e,b.state?b.state.nextPathname:"/").catch(function(e){u(!1),h("string"==typeof e?e:void 0!==e&&e.message?e.message:"ra.auth.sign_in_error","warning")})},validate:function(e){var n={};return e[o]||(n[o]=d("ra.validation.required")),e[l]||(n[l]=d("ra.validation.required")),n},render:function(e){return n("form",{onSubmit:e.handleSubmit},n("div",{className:f.main},n(An,{className:f.card},n("div",{className:f.avatar},n(Vn,{className:f.avatarIcon},n(p,null))),n("div",{className:f.hint},"Inicio de Sesión"),n("div",{className:f.form},n("div",{className:f.input},n(bn,{autoFocus:!0,name:o,component:oa,label:d("ra.auth.username"),disabled:c})),n("div",{className:f.input},n(bn,{name:l,component:oa,label:d("ra.auth.password"),type:"password",disabled:c}))),n(qn,{className:f.actions},n(On,{variant:"contained",type:"submit",color:"primary",disabled:c,fullWidth:!0},c&&n(Wn,{className:f.icon,size:18,thickness:2}),m))),n(Y,null)))}})},la=function(e){return n(jn,{theme:on(Yt)},n(ia,e))},sa=["displayedFilters","filterValues","showFilter"],ca=["className","options","icon"],ua=an({root:{display:"inline-block"},paddingRight:{paddingRight:4}}),da=function(e){var a,o=e.className,i=e.options,l=void 0===i?[]:i,s=e.icon,c=ir(e,ca),u=t(!1),d=u[0],m=u[1],p=r(),f=t(0),g=f[0],h=f[1],v=ua(e),b=H(e);return n("div",or({className:Fn(v.root,o)},ir(c,sa)),n(T,{className:"add-filter",onClick:function(e){e.preventDefault(),m(!0),p.current=e.currentTarget},title:l[g].label},(null===(a=l[g])||void 0===a?void 0:a.icon)||s),n(Un,{open:d,anchorEl:p.current,onClose:function(e){p.current&&p.current.contains(e.target)||m(!1)}},l.map(function(e,r){return n(Ln,{key:e.label,disabled:e.disabled,selected:r===g,onClick:function(n){!function(e,n){h(n),m(!1)}(0,r),e.onClick&&e.onClick(n,r)},resource:b,title:e.label},e.icon,n("span",{className:v.paddingRight}),n(ce,{label:e.label,resource:b}))})))},ma=["fields","className","basePath","record","textAlign","sortable"],pa=function(e){var r=e.fields,t=e.className,a=e.record,o=ir(e,ma),i=r.separador,l=void 0===i?"":i,s=r.secundario,c=void 0===s?[]:s,u=r.hasSecundario,d=r.campos.map(function(e){return void 0!==a[e]?a[e]:e}).join(""+l);return n(ln,or({noWrap:!0,variant:"inherit",className:t},o),d,u&&n(ln,{component:"span",display:"block",color:"textSecondary",variant:"caption"},c.map(function(e){return(e.etiqueta||"---")+": "+(a[e.campo]||"---")}).join(" ")))},fa=["useFormulario"],ga=function(e){var r=ir(e,fa),t=ue(r),a=t.record,i=t.loading,l=at(e).fichaProps,s=o(function(){return{estado:"M",initialValues:a,loading:i,fichaProps:l}},[a,i,l]);return n(Or,null,n(xt.Provider,{value:s},n(de,or({},r,t,null==l?void 0:l.panel))))},ha=["basePath","children","className","classes","component","form","handleSubmit","handleSubmitWithRedirect","invalid","mutationMode","pristine","record","redirect","resource","saving","submitOnEnter","syncWithLocation","tabs","toolbar","undoable","variant","margin"],va=["active","dirty","dirtyFields","dirtyFieldsSinceLastSubmit","dirtySinceLastSubmit","error","errors","hasSubmitErrors","hasValidationErrors","initialValues","modified","modifiedSinceLastSubmit","save","submitError","submitErrors","submitFailed","submitSucceeded","submitting","touched","valid","validating","values","visited","__versions"],ba=["mutators"],ya=function(e){var r=e.basePath,a=e.children,o=e.className,i=e.component,c=e.handleSubmit,u=e.handleSubmitWithRedirect,d=e.invalid,p=e.mutationMode,f=e.pristine,g=e.record,h=e.redirect,v=e.resource,b=e.saving,y=e.submitOnEnter,C=e.syncWithLocation,k=void 0===C||C,N=e.tabs,S=e.toolbar,P=e.undoable,x=e.variant,T=e.margin,w=ir(e,ha),I=Ca(e),R=Hn(),F=Gn(),O=R?R.url:F.pathname,_=t(0),E=_[0],D=_[1];return n("form",or({className:Fn("tabbed-form",o)},ka(w)),s(N,{classes:I,url:O,syncWithLocation:k,onChange:function(e,n){k||D(n)},value:E},a),n(Qe,null),n(i,{className:I.content},l.map(a,function(e,t){if(e){var a=me(e,t,O);return n(Jn,{exact:!0,path:pe(a)},function(n){return m(e)?s(e,{intent:"content",classes:I,resource:v,record:g,basePath:r,hidden:k?!n.match:E!==t,variant:e.props.variant||x,margin:e.props.margin||T,value:k?a:t}):null})}})),S&&s(S,{basePath:r,className:"toolbar",handleSubmitWithRedirect:u,handleSubmit:c,invalid:d,mutationMode:p,pristine:f,record:g,redirect:h,resource:v,saving:b,submitOnEnter:y,undoable:P}))},Ca=an(function(e){return{errorTabButton:{color:e.palette.error.main},content:{paddingTop:e.spacing(1),paddingLeft:e.spacing(2),paddingRight:e.spacing(2)}}},{name:"RaTabbedForm"});ya.defaultProps={submitOnEnter:!0,tabs:n(fe,null),toolbar:n(ge,null),component:function(e){return n("div",{className:e.className},e.children)}};var ka=function(e){return ir(e,va)},Na={setError:function(e,n){n.fields[e[0]].data=e[1]}},Sa=function(e){var r=d(xt),t=r.initialValues,a=r.fichaProps,o=a.onBeforeSubmitFicha,i=a.config,l=(i=void 0===i?{}:i).mutators,s=void 0===l?{}:l,u=ir(i,ba),m=s===Na?s:or({},Na,s),p=Jr(e),f=x(),g=c(function(n,r,t){var a=o&&o(or({form:{values:n}},p),"N");return"string"==typeof a?void f(a,"warning"):void 0===a||a?e.save(n,r,t):void 0},[o,p]);return n(O,or({},e,u,{save:g,mutators:m,initialValues:t,render:function(e){return n(ya,or({component:qt},e))}}))};Sa.defaultProps={margin:"normal",variant:"outlined",syncWithLocation:!1},Zn.ra.page.empty="No records yet";var Pa=or({},Zn,{login:{id:"ID",hint:"Login",required:"Insert Username or ID",send:"Send",email:"Enter your email address",check_email:"Check your email inbox, we just send you a verification code!",must_enter_credentials:"You must first enter Username or ID",restore_password:"Restore Password",punch_in:"Punch In"},pos:{search:"Search",change_pin:"Change Pin",change_password:"Change Password",configuration:"Configuration",language:"Language",theme:{name:"Theme",light:"Light",dark:"Dark"},dashboard:{welcome:{title:"Welcome",subtitle:"Employee Management",aor_button:"Metiri WebSite"}}},validation:{greater_or_equal:"Must be greater than or equal to %{menor}"}});Qn.ra.notification.created="Datos guardados correctamente",Qn.ra.action.bulk_actions="1 seleccionado |||| %{smart_count} seleccionados",Qn.ra.page.dashboard="Inicio",Qn.ra.page.empty="Sin registros todavía",Qn.ra.page.invite="¿Quiere agregar uno?",Qn.ra.page.list="%{name}",Qn.ra.page.edit="Editar %{name}",Qn.ra.action.back="Volver";var xa=or({},Qn,{login:{id:"Cédula",hint:"Inicio de Sesión",required:"Ingrese Usuario o Cédula",email:"Ingrese su email aquí",send:"Enviar",check_email:"Revisa tu correo electrónico, te enviaremos un código de verificación!",must_enter_credentials:"Debe ingresar Nº de Usuario o Cédula y Contraseña primero",restore_password:"Restablecer Contraseña",punch_in:"Generar Marcas"},pos:{search:"Búsqueda",change_pin:"Cambiar Pin",change_password:"Cambiar Contraseña",configuration:"Configuración",language:"Lenguaje",theme:{name:"Tema Visual",light:"Light",dark:"Dark"},dashboard:{welcome:{title:"Bienvenid@",subtitle:"Gestión de Funcionarios",aor_button:"Sitio de Metiri"}}},validation:{greater_or_equal:"Debe ser mayor o igual a %{menor}"}}),Ta=["hidden"],wa=["hidden","useContenido"],Ia=["hidden"],Ra=function(e){var n=d(xt),r=n.estado,t=n.loading,a=n.fichaProps,o=(void 0===a?{}:a)[e.source],i=void 0===o?{}:o,l=e.hidden,s=void 0!==l&&l,c=ir(e,Ta),u=i.hidden,m=i.useContenido,p=void 0===m?Gr:m,f=ir(i,wa),g=void 0!==u?u:s,h=p(or({},c,{estado:r,hidden:g,loading:t},f)),v=h.hidden,b=ir(h,Ia);if(void 0===h)throw new Error("useContenido está devolviendo undefined para el contenido "+e.source+"\n Asegúrese de incluir una instrucción return al final de la función");return{propsContenido:or({},c,f,b),hidden:void 0!==v?v:g}},Fa=function(e){var r=Ra(e),t=r.propsContenido,a=r.hidden,o=JSON.parse(JSON.stringify(e.record)),i=o[e.source];return o[e.source]=""!=i&&"0"!=i,!a&&n(he,or({},t,{record:o}))},Oa=["onFocus","onChange","onBlur","hidden","disabled","validate"],_a=["onFocus","onBlur","onChange","hidden","disabled","useContenido","validate"],Ea=["hidden","disabled","onFocus","onChnage","onBlur","validate"],Da=function(e,n,r){return"string"==typeof(null==r?void 0:r.data)?r.data:void 0},Ma=function(e){var n=d(xt),t=n.estado,a=n.loading,o=n.fichaProps,i=void 0===o?{}:o,l=Be(function(n){var r=n.configInputs?n.configInputs.filter(function(n){return n.id===e.source}):[];return r[0]?r[0]:null})||{},s=l.disabled,c=l.hidden,u=!0===l.required?vt:void 0,m=i[e.source],p=void 0===m?{}:m,f=e.onFocus,g=e.onChange,h=e.onBlur,v=e.hidden,b=void 0!==v&&v,y=e.disabled,C=void 0!==y&&y,k=e.validate,N=ir(e,Oa),S=ve({source:e.source}).input,P=p.onFocus,x=p.onBlur,T=p.onChange,w=p.hidden,I=p.disabled,R=p.useContenido,F=void 0===R?Gr:R,O=p.validate,_=ir(p,_a),E=void 0!==w?w:b,D=void 0!==I?I:C,M=void 0!==P?P:f,L=void 0!==x?x:h,B=void 0!==T?T:g,V=Ur(e),A=F(or({},N,{estado:t,hidden:E,loading:a,utils:V},_)),q=r(S.value);if(void 0===A)throw new Error("useContenido está devolviendo undefined para el contenido "+e.source+"\n Asegúrese de incluir una instrucción return al final de la función");var W=A.hidden,z=A.disabled,j=A.onFocus,G=A.onChnage,H=A.onBlur,J=A.validate,U=ir(A,Ea),Z=j||M,Q=H||L,Y=G||B,K=or({},V,{prev:q.current}),X=Array.isArray(k)?k:[k],$=Array.isArray(O)?O:[O],ee=Array.isArray(J)?J:[J];return{propsContenido:or({onFocus:function(e){Z&&M(V,t,e),q.current=e.target.value},onBlur:function(e){return Q&&Q(K,t,e)},onChange:function(e){return Y&&Y(K,t,e)},helperText:!1,validate:[].concat(X,$,ee,[Da,u]).filter(function(e){return void 0!==e})},N,_,U,{disabled:void 0!==s?s:void 0!==z?z:D}),hidden:void 0!==c?c:void 0!==W?W:E}},La=function(e){var r=Ma(e);return!r.hidden&&n(be,or({accept:"",maxSize:5e6},r.propsContenido),n(ye,{source:"src"}))},Ba=function(e){var r=Ma(e);return!r.hidden&&n(Ce,r.propsContenido)},Va=["callback"],Aa=["helperText"],qa=["callback"],Wa=function(e){var r=e.callback,t=ir(e,Va),o=_(t),i=o.loading,l=o.data;return a(function(){i||"function"==typeof r&&r(Object.values(l))},[i]),n(Pe,t)},za=function(e){var t,o,i=Ma(e),l=i.propsContenido,s=i.hidden,c=r(!1),u=Ve(),d=k(),m=l.helperText,p=ir(l,Aa),f=Be(function(n){var r=n.reload_cb?n.reload_cb.filter(function(n){return n.id===e.source}):[];return r[0]?r[0]:null}),g=r(f),h=null===f&&g.current?g.current:f;return h&&(t=h.callback,o=ir(h,qa)),a(function(){null!==f&&(g.current=f,u(Dr(e.source)))},[JSON.stringify(f)]),a(function(){c.current=!0},[d]),c.current?!s&&n(ke,or({},p,{perPage:250,filter:o}),n(Wa,{callback:t,helperText:m,optionText:"etiqueta",optionValue:e.source})):n(Ne,{id:e.id,label:e.label,source:e.source,resource:e.resource,className:e.className,isRequired:e.isRequired,meta:e.meta,input:e.input,margin:e.margin},n(Se,{timeout:1}))},ja=function(e){var r=Ma(e);return!r.hidden&&n(Pe,r.propsContenido)},Ga=function(e){var r=e.title,t=e.source,a=e.src,o=xe(e);return n(Vn,{title:r,src:a+"/"+o[t]})},Ha=["helperText"],Ja=function(e){var t=Ma(e),o=t.propsContenido,i=t.hidden,l=r(!1),s=k(),c=o.helperText,u=ir(o,Ha);return a(function(){l.current=!0},[s]),l.current?!i&&n(Te,u,n(we,{helperText:c,optionText:"etiqueta",optionValue:e.source})):n(Ne,{id:e.id,label:e.label,source:e.source,resource:e.resource,className:e.className,isRequired:e.isRequired,meta:e.meta,input:e.input,margin:e.margin},n(Se,{timeout:1}))},Ua=function(e){var r=Ma(e);return!r.hidden&&n(Ie,r.propsContenido)},Za=["helperText"],Qa=function(e){var t=Ma(e),o=t.propsContenido,i=t.hidden,l=r(!1),s=k(),c=o.helperText,u=ir(o,Za);return a(function(){l.current=!0},[s]),l.current?!i&&n(ke,u,n(Re,{helperText:c,optionText:"etiqueta",optionValue:e.source})):n(Ne,{id:e.id,label:e.label,source:e.source,resource:e.resource,className:e.className,isRequired:e.isRequired,meta:e.meta,input:e.input},n(Se,null))},Ya=function(e){var r=Ma(e);return!r.hidden&&n(Re,r.propsContenido)},Ka=an(function(e){return{confirmPrimary:{color:e.palette.primary.main},confirmWarning:{color:e.palette.error.main,"&:hover":{backgroundColor:In(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}},iconPaddingStyle:{paddingRight:"0.5em"}}},{name:"RaConfirm"}),Xa=function(e){return n(nr,{handle:"#draggable-dialog-title",cancel:'[class*="MuiDialogContent-root"]'},n(Ye,e))},$a={cursor:"move"},eo=function(e){var r,t=e.isOpen,a=e.loading,o=e.title,i=e.content,l=e.cancel,s=e.confirmColor,u=e.ConfirmIcon,d=e.CancelIcon,m=e.onClose,p=e.onConfirm,f=e.contentResource,h=e.translateOptions,v=void 0===h?{}:h,b=Ka(e),y=g(),C=Be(function(e){return e.admin.resources[f].list.selectedIds}),k=c(function(e,n){e.stopPropagation(),p(e,C)},[C,p]),N=c(function(e){e.stopPropagation()},[]);return n(Xe,{open:t,onClose:m,onClick:N,fullWidth:!0,maxWidth:"lg",PaperComponent:Xa,"aria-labelledby":"draggable-dialog-title"},n(rn,{style:$a,id:"draggable-dialog-title"},y(o,or({_:o},v))),n(en,{dividers:!0},i),n($e,null,n(On,{disabled:a,onClick:m},n(d,{className:b.iconPaddingStyle}),y(l,{_:l})),n(On,{disabled:a,onClick:function(e){return k(e,"yes")},className:Fn("ra-confirm",(r={},r[b.confirmWarning]="warning"===s,r[b.confirmPrimary]="primary"===s,r)),autoFocus:!0},n(u,{className:b.iconPaddingStyle}),y("ra.action.confirm"))))};eo.propTypes={cancel:Ae.string,classes:Ae.object,confirm:Ae.string,confirmColor:Ae.string,ConfirmIcon:Ae.elementType,CancelIcon:Ae.elementType,content:Ae.node.isRequired,isOpen:Ae.bool,loading:Ae.bool,onClose:Ae.func.isRequired,onConfirm:Ae.func.isRequired,title:Ae.string.isRequired},eo.defaultProps={cancel:"ra.action.cancel",classes:{},confirmColor:"primary",ConfirmIcon:$n,CancelIcon:er,isOpen:!1};var no=["disabled","asistant","asistantResource","label","source"],ro=function(){return n(i,null)},to={seleccion:[],all:!0,none:!1},ao=function(e){return!e||null!=e&&e.all?"Todos":null!=e&&e.none||0===e.seleccion.length?"Ninguno":"Selección ("+e.seleccion.length+")"},oo=function(e){return e},io=function(e){var r=e.disabled,a=e.asistant,o=e.asistantResource,l=e.label,s=e.source,u=ir(e,no),d=t(!1),m=d[0],p=d[1],f=hn(),g=c(function(){p(!1)},[p]);return n(i,null,n("div",{style:{display:"flex",alignItems:"center"}},n(Fe,or({initialValue:to},u,{source:s,label:l,disabled:!0,parse:oo,format:ao,helperText:!1,InputProps:{endAdornment:n(i,null,n(wn,{onClick:function(e){f.change(s,{seleccion:[],all:!1,none:!0})},disabled:r,"aria-label":"Ninguno",size:"small",title:"Ninguno"},n(Kn,null)),n(wn,{onClick:function(e){f.change(s,{seleccion:[],all:!0,none:!1})},disabled:r,"aria-label":"Todos",size:"small",title:"Todos"},n(Yn,null)),n(wn,{onClick:function(e){return p(!0)},disabled:r,"aria-label":"Selección",size:"small",title:"Selección"},n(Xn,null)))}}))),n(eo,{isOpen:m,title:"Selección de "+l,contentResource:o,content:n(a,{bulkActionButtons:n(ro,null),hasCreate:!1,exporter:!1,resource:o,basePath:"/"+o}),onConfirm:function(e,n){p(!1),f.change(s,{seleccion:n,all:!1,none:!1})},onClose:g}))},lo=function(e){return n(_e,or({},e,{hasCreate:!1,exporter:!1,perPage:25,title:" ",bulkActionButtons:n("span",null)}),n(V,null,n(Ee,{source:"funced",sortable:!0,label:"Cédula"}),n(Ee,{source:"funpriape",sortable:!0,label:"Apellido"}),n(Ee,{source:"funprinom",sortable:!0,label:"Nombre"})))},so={fillista:"empcod=-1"},co=function(e){var r=t(so),a=r[0],o=r[1],i=Oe(),l=c(function(e){o({fillista:e.node.key})},[o]),s=c(function(e){return i.getChildNodes("form_224",{parentId:e?e.itemData.id:""}).then(function(e){return e.data}).catch(function(){throw new Error("Data Loading Error")})},[i]);return n(Ke,{display:"flex",flex:1,alignItems:"flex-start",height:"20em"},n(Ke,{flexGrow:1},n(rr,{id:"funcionarios-treeview",dataStructure:"plain",rootValue:"",onItemClick:l,createChildren:s})),n(Ke,{flexGrow:2},n(lo,{resource:"form_224",basePath:"/form_224",filter:a})))},uo=an(function(e){return{confirmPrimary:{color:e.palette.primary.main},confirmWarning:{color:e.palette.error.main,"&:hover":{backgroundColor:In(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}},iconPaddingStyle:{paddingRight:"0.5em"}}},{name:"RaConfirm"}),mo=function(e){return n(nr,{handle:"#draggable-dialog-title",cancel:'[class*="MuiDialogContent-root"]'},n(Ye,e))},po={cursor:"move"},fo=function(e){var r,t=e.isOpen,a=e.loading,o=e.title,i=e.cancel,l=e.confirmColor,s=e.ConfirmIcon,u=e.CancelIcon,d=e.onClose,m=e.onConfirm,p=e.translateOptions,f=void 0===p?{}:p,h=uo(e),v=g(),b=c(function(e,n){e.stopPropagation(),m(e,n)},[m]),y=c(function(e){e.stopPropagation()},[]);return n(Xe,{open:t,onClose:d,onClick:y,fullWidth:!0,maxWidth:"lg",PaperComponent:mo,"aria-labelledby":"draggable-dialog-title"},n(rn,{style:po,id:"draggable-dialog-title"},v(o,or({_:o},f))),n(en,{dividers:!0},n(co,null)),n($e,null,n(On,{disabled:a,onClick:d},n(u,{className:h.iconPaddingStyle}),v(i,{_:i})),n(On,{disabled:a,onClick:function(e){return b(e,"yes")},className:Fn("ra-confirm",(r={},r[h.confirmWarning]="warning"===l,r[h.confirmPrimary]="primary"===l,r)),autoFocus:!0},n(s,{className:h.iconPaddingStyle}),v("ra.action.confirm"))))};fo.propTypes={cancel:Ae.string,classes:Ae.object,confirm:Ae.string,confirmColor:Ae.string,ConfirmIcon:Ae.elementType,CancelIcon:Ae.elementType,isOpen:Ae.bool,loading:Ae.bool,onClose:Ae.func.isRequired,onConfirm:Ae.func.isRequired,title:Ae.string.isRequired},fo.defaultProps={cancel:"ra.action.cancel",classes:{},confirmColor:"primary",ConfirmIcon:$n,CancelIcon:er,isOpen:!1};var go=["disabled","asistant","asistantResource","label","source"],ho={seleccion:[],all:!0,none:!1},vo=function(e){return!e||null!=e&&e.all?"Todos":null!=e&&e.none||0===e.seleccion.length?"Ninguno":"Selección ("+e.seleccion.length+")"},bo=function(e){return e},yo=function(e){var r=e.disabled,a=e.label,o=void 0===a?"Funcionarios":a,l=e.source,s=ir(e,go),u=Be(function(e){return e.admin.resources.form_224.list.selectedIds}),d=t(!1),m=d[0],p=d[1],f=hn(),g=c(function(){p(!1)},[p]);return n(i,null,n("div",{style:{display:"flex",alignItems:"center"}},n(Fe,or({initialValue:ho},s,{source:l,label:o,disabled:!0,parse:bo,format:vo,helperText:!1,InputProps:{endAdornment:n(i,null,n(wn,{onClick:function(e){f.change(l,{seleccion:[],all:!1,none:!0})},disabled:r,"aria-label":"Ninguno",size:"small",title:"Ninguno"},n(Kn,null)),n(wn,{onClick:function(e){f.change(l,{seleccion:[],all:!0,none:!1})},disabled:r,"aria-label":"Todos",size:"small",title:"Todos"},n(Yn,null)),n(wn,{onClick:function(e){return p(!0)},disabled:r,"aria-label":"Selección",size:"small",title:"Selección"},n(Xn,null)))}}))),n(fo,{isOpen:m,title:"Selección de "+o,onConfirm:function(e,n){p(!1),f.change(l,{seleccion:u,all:!1,none:!1})},onClose:g}))},Co=function(e){var r=Ma(e);return!r.hidden&&n(Fe,or({multiline:!0},r.propsContenido))},ko=["tipo"],No=function(e){var r=e.tipo,t=ir(e,ko),o=Ma(t),i=o.propsContenido,l=o.hidden,s=hn(),c=ve({source:e.source}),u=c.input,d=c.meta,m="F"===r||"Z"===r;a(function(){i.value&&(s.change(e.source,i.value),e.disabled&&s.blur(e.source))}),a(function(){m&&""!=u.value&&d.valid&&d.modified&&!d.active&&i.onBlur()},[u.value]);var p=or({},i);return!l&&("N"===r||"D"===r?n(De,p):"F"===r?n(tr,p):"Z"===r?n(ar,p):n(Fe,"H"===r?or({},p,{type:"time"}):p))},So=["tipo","value"],Po=function(e){var r=e.tipo,t=ir(e,So),a=Ra(t),o=a.hidden,i=or({},a.propsContenido);return!o&&("N"===r||"D"===r?n(Me,i):"F"===r?n(Le,i):"Z"===r?n(Le,or({},i,{showTime:!0})):n(Ee,i))};export{cr as AppBar,Fa as BooleanField,La as Camino,Ba as CheckBox,za as ComboBox,ja as ComboBoxManual,wt as CreateEtriek,Ot as DeleteButtonNoWarning,Et as EditEtriek,Tr as EtrGrid,Mt as EtriekNotification,ht as FichaActions,xt as FichaContext,Bt as FormDialog,jt as FormEtriek,Rr as GE,$r as GrillaEtriek,Ga as ImageField,ea as Layout,ra as ListActionsEtriek,Ja as ListCheck,la as Login,Zt as Menu,da as MenuButton,pa as MultiTextField,Ua as Password,Qa as RadioButton,Ya as RadioButtonManual,gt as Separador,ga as ShowEtriek,Ht as SubMenu,yo as TBSF,Sa as TabbedFormEtriek,rt as TabbedGrillaEtriek,Co as TextArea,No as TextBox,io as TextBoxSelection,Po as TextField,Nt as choicesEstado,ct as dateFormat,yt as dateFormatOptions,ut as dateParser,dt as dateTimeFormat,mt as dateTimeParser,Dr as deleteRecargarComboBox,St as descargarLink,Pa as enMessages,xa as esMessages,Ct as etrFechaMayorQue,vt as etrRequerido,bt as etrRequeridoNumerico,lt as getFormcodFromResource,kt as localeOptions,Er as recargarComboBox,Lr as setDisableAction,Mr as setHiddenAction,Br as setRequireAction,Kt as themes,pt as timeFormat,ft as timeParser,jr as useAjax,Ma as useContenidoController,pr as useDeleteRowEtrGrid,Ra as useFieldController,_r as useFormProgress,zr as useGetJson,at as useInitFicha,ur as useNuevo,Pt as useReferenceLabel,fr as useSaveRowEtrGrid,st as useStylesContenidos,Ur as useUtils,Hr as useUtilsGrilla,Jr as useUtilsSubmit};
1
+ import{forwardRef as e,createElement as n,useRef as r,useState as a,useEffect as t,useMemo as o,Fragment as i,Children as l,cloneElement as s,useCallback as c,createContext as u,useContext as d,isValidElement as m}from"react";import p from"@material-ui/icons/Lock";import f from"@material-ui/icons/VpnLock";import{useTranslate as g,MenuItemLink as h,AppBar as v,UserMenu as b,useGetOne as y,useMutation as C,useVersion as k,useGetList as N,Loading as S,useSafeSetState as P,useNotify as x,Button as T,SaveContextProvider as w,SaveButton as I,useDeleteWithConfirmController as R,Confirm as F,FormWithRedirect as O,useListContext as _,useRedirect as E,useRefresh as D,useUnselectAll as M,useResourceDefinition as L,SimpleList as B,Datagrid as V,EditButton as A,TopToolbar as q,ListButton as W,ShowButton as z,required as j,minValue as G,useResourceContext as H,Create as J,useDelete as U,useEditController as Z,Edit as Q,Notification as Y,CardContentInner as K,SimpleFormView as X,SimpleForm as $,Menu as ee,DashboardMenuItem as ne,defaultTheme as re,Layout as ae,Sidebar as te,sanitizeListRestProps as oe,CreateButton as ie,ExportButton as le,useLogin as se,FieldTitle as ce,useShowController as ue,Show as de,getTabFullPath as me,escapePath as pe,TabbedFormTabs as fe,Toolbar as ge,BooleanField as he,useInput as ve,FileInput as be,ImageField as ye,BooleanInput as Ce,ReferenceInput as ke,Labeled as Ne,LinearProgress as Se,SelectInput as Pe,useRecordContext as xe,ReferenceArrayInput as Te,SelectArrayInput as we,PasswordInput as Ie,RadioButtonGroupInput as Re,TextInput as Fe,useDataProvider as Oe,List as _e,TextField as Ee,NumberInput as De,NumberField as Me,DateField as Le}from"react-admin";import{useSelector as Be,useDispatch as Ve}from"react-redux";import Ae,{string as qe,func as We,any as ze,bool as je}from"prop-types";import{alpha as Ge,createTheme as He,ThemeProvider as Je,useMediaQuery as Ue,CircularProgress as Ze,Divider as Qe,Paper as Ye,Box as Ke}from"@material-ui/core";import Xe from"@material-ui/core/Dialog";import $e from"@material-ui/core/DialogActions";import en from"@material-ui/core/DialogContent";import nn from"@material-ui/core/DialogContentText";import rn from"@material-ui/core/DialogTitle";import an from"@material-ui/core/Paper";import{makeStyles as tn,createTheme as on}from"@material-ui/core/styles";import ln from"@material-ui/core/Typography";import{GridOverlay as sn,esES as cn,DataGrid as un}from"@material-ui/data-grid";import dn from"@material-ui/icons/Add";import mn from"@material-ui/icons/Cancel";import pn from"@material-ui/icons/Delete";import fn from"@material-ui/icons/Edit";import gn from"@material-ui/core/TableContainer";import{useForm as hn,Form as vn,Field as bn}from"react-final-form";import yn from"@material-ui/core/Divider";import Cn from"@material-ui/core/Tab";import kn from"@material-ui/core/Tabs";import Nn from"@material-ui/core/styles/makeStyles";import Sn from"@material-ui/icons/ChevronLeft";import Pn from"date-fns/locale/en-US";import xn from"date-fns/locale/es";import Tn from"moment";import wn from"@material-ui/core/IconButton";import{alpha as In}from"@material-ui/core/styles/colorManipulator";import Rn from"@material-ui/core/Tooltip";import Fn from"classnames";import On from"@material-ui/core/Button";import _n from"@material-ui/icons/Settings";import En from"@material-ui/core/Collapse";import Dn from"@material-ui/core/List";import Mn from"@material-ui/core/ListItemIcon";import Ln from"@material-ui/core/MenuItem";import Bn from"@material-ui/icons/ExpandMore";import Vn from"@material-ui/core/Avatar";import An from"@material-ui/core/Card";import qn from"@material-ui/core/CardActions";import Wn from"@material-ui/core/CircularProgress";import zn from"@material-ui/core/TextField";import{ThemeProvider as jn}from"@material-ui/styles";import{useLocation as Gn,useRouteMatch as Hn,Route as Jn}from"react-router-dom";import Un from"@material-ui/core/Menu";import Zn from"ra-language-english";import Qn from"@blackbox-vision/ra-language-spanish";import Yn from"@material-ui/icons/Check";import Kn from"@material-ui/icons/RemoveCircleOutline";import Xn from"@material-ui/icons/Search";import $n from"@material-ui/icons/CheckCircle";import er from"@material-ui/icons/ErrorOutline";import nr from"react-draggable";import{TreeView as rr}from"devextreme-react";import{KeyboardDateInput as ar,KeyboardDateTimeInput as tr}from"react-admin-date-inputs";function or(){return(or=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}function ir(e,n){if(null==e)return{};var r,a,t={},o=Object.keys(e);for(a=0;a<o.length;a++)n.indexOf(r=o[a])>=0||(t[r]=e[r]);return t}var lr=e(function(e,r){var a=g(),t=Be(function(e){return[e.admin.resources.form_275?1:0,e.admin.resources.form_59?1:0]}),o=t[1];return[t[0]?n(h,{ref:r,key:"/form_275",to:"/form_275",primaryText:a("pos.change_pin"),leftIcon:n(p,null),onClick:e.onClick}):null,o?n(h,{ref:r,key:"/form_59",to:"/form_59",primaryText:a("pos.change_password"),leftIcon:n(f,null),onClick:e.onClick}):null]}),sr=function(e){return n(b,e,n(lr,null))},cr=function(e){return n(v,or({},e,{elevation:1,userMenu:n(sr,null)}))},ur=function(e,n){return y(e,"-1",n)},dr=tn(function(e){return{root:{"& .MuiDataGrid-columnsContainer":{backgroundColor:"light"===e.palette.type?"#fafafa":"#1d1d1d"},"& .MuiDataGrid-iconSeparator":{display:"none"}},header:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.light},rootPaper:{width:"100%",height:"40vh",borderRadius:0,marginTop:e.spacing(1)},rootOverlay:{flexDirection:"column","& .ant-empty-img-1":{fill:"light"===e.palette.type?"#aeb8c2":"#262626"},"& .ant-empty-img-2":{fill:"light"===e.palette.type?"#f5f5f7":"#595959"},"& .ant-empty-img-3":{fill:"light"===e.palette.type?"#dce0e6":"#434343"},"& .ant-empty-img-4":{fill:"light"===e.palette.type?"#ffffff":"#1c1c1c"},"& .ant-empty-img-5":{fillOpacity:"light"===e.palette.type?"0.8":"0.08",fill:"light"===e.palette.type?"#f5f5f5":"#ffffff"}},label:{marginTop:e.spacing(1)},deleteButton:{color:e.palette.error.main,"&:hover":{backgroundColor:Ge(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}},{name:"GE"}),mr=function(){var e=dr();return n(sn,{className:e.rootOverlay},n("svg",{width:"120",height:"100",viewBox:"0 0 184 152","aria-hidden":!0,focusable:"false"},n("g",{fill:"none",fillRule:"evenodd"},n("g",{transform:"translate(24 31.67)"},n("ellipse",{className:"ant-empty-img-5",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),n("path",{className:"ant-empty-img-1",d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z"}),n("path",{className:"ant-empty-img-2",d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z"}),n("path",{className:"ant-empty-img-3",d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z"})),n("path",{className:"ant-empty-img-3",d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z"}),n("g",{className:"ant-empty-img-4",transform:"translate(149.65 15.383)"},n("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),n("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"})))),n("div",{className:e.label},"No hay registros"))},pr=function(e,n,r){return C({type:"deleteEtrRow",resource:e,payload:{params:n}},r)},fr=function(e,n,r,a){return C({type:e,resource:n,payload:{params:r}},a)},gr=["api","basePath","classes","className","confirmTitle","confirmContent","icon","record","redirect","onSuccess","onFailure","source","camposClaveFila"],hr=["filterBy","claves","sortModel","columns","reference","allowAdd","allowRemove","etrResource","enableLoad"],vr=tn(function(e){return{root:{"& .MuiDataGrid-columnsContainer":{backgroundColor:"light"===e.palette.type?"#fafafa":"#1d1d1d"},"& .MuiDataGrid-iconSeparator":{display:"none"}},header:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.light},rootPaper:{width:"100%",height:"40vh",borderRadius:0,marginTop:e.spacing(1)},rootOverlay:{flexDirection:"column","& .ant-empty-img-1":{fill:"light"===e.palette.type?"#aeb8c2":"#262626"},"& .ant-empty-img-2":{fill:"light"===e.palette.type?"#f5f5f7":"#595959"},"& .ant-empty-img-3":{fill:"light"===e.palette.type?"#dce0e6":"#434343"},"& .ant-empty-img-4":{fill:"light"===e.palette.type?"#ffffff":"#1c1c1c"},"& .ant-empty-img-5":{fillOpacity:"light"===e.palette.type?"0.8":"0.08",fill:"light"===e.palette.type?"#f5f5f5":"#ffffff"}},label:{marginTop:e.spacing(1)},deleteButton:{color:e.palette.error.main,"&:hover":{backgroundColor:Ge(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}},{name:"EtrGrid"}),br={marginLeft:"1.6rem",fontWeight:"bold"},yr=n(pn,null),Cr=function(e){var r=e.basePath,a=e.confirmTitle,t=void 0===a?"ra.message.delete_title":a,o=e.confirmContent,l=void 0===o?"ra.message.delete_content":o,s=e.icon,u=void 0===s?yr:s,d=e.record,m=e.redirect,p=void 0!==m&&m,f=e.onSuccess,g=e.onFailure,h=e.source,v=e.camposClaveFila,b=ir(e,gr),y=vr(e),C=x(),k=R({record:d,redirect:p,basePath:r,onSuccess:f,onFailure:g}),N=k.open,S=k.loading,P=k.handleDialogOpen,w=k.handleDialogClose,I=pr(e.resource,{},{refresh:!0,onSuccess:function(e){if(e.error)throw new Error(e.error);C("ra.notification.deleted","info",{smart_count:1})},onFailure:function(e){C(e.message,"warning")}})[0],O=Object.keys(d).filter(function(e){return v.split(",").includes(e)}).reduce(function(e,n){return e[n]=d[n],e},{}),_=c(function(e){I({payload:{ge:h,clavesFila:O}})},[d]);return n(i,null,n(T,or({key:"button",onClick:P,className:y.deleteButton},b),u),n(F,{isOpen:N,loading:S,title:t,content:l,onConfirm:_,onClose:w}))},kr=function(e){return n(Xe,{open:e.open,onClose:e.onClose,fullWidth:!0},n(rn,null,e.labelEstado+" "+e.label),n(nn,null,n(ln,{component:"span",display:"block",variant:"subtitle1",style:or({},br)},e.msgTitle),e.msgDesc),n(O,{resource:e.resource,save:e.save,render:e.render,initialValues:e.initialValues}))};kr.propTypes={label:qe,onClick:We,icon:ze,open:je,onClose:We,labelEstado:qe,msgTitle:ze,msgDesc:ze,resource:ze,save:We,render:We};var Nr=function(e){return n(Cr,{api:!0,confirmTitle:"ra.action.delete",source:e.source,record:e.row,resource:e.resource,camposClaveFila:e.camposClaveFila})},Sr=function(e){var r=e.editors,a=e.record,t=e.clavesFila,c=e.camposClaveFila,u=e.resource,d=e.label,m=e.source,p=e.etrResource,f=P(!1),h=f[0],v=f[1],b=ur(p,{enabled:h}).data,y=fr("createEtrRow",u,{},{refresh:!0,onSuccess:function(e){if(e.error)throw new Error(e.error);v(!1),N("ra.notification.created","info")},onFailure:function(e){N(e.message,"warning")}}),C=y[0],k=y[1].loading,N=x(),S=g()("ra.action.create"),R=function(e){C({payload:{data:or({},e,t),ge:m,camposClaveFila:c,estado:"N"}})},F=o(function(){return{save:R,setOnFailure:function(e){return console.log(e)}}},[R]);return n(i,null,n(T,{onClick:function(e){v(!0),e.stopPropagation()}},n(dn,null)),n(w,{value:F},n(kr,{open:h,onClose:function(e){v(!1),e.stopPropagation()},labelEstado:S,label:d,msgTitle:e.msgTitle,msgDesc:e.msgDesc,resource:u,save:R,initialValues:b,render:function(e){var t=e.handleSubmitWithRedirect,o=e.pristine,c=e.saving;return n(i,null,n(en,null,l.map(r,function(e,n){return s(e,{resource:u,estado:"N",initialValue:a[e.props.source],fullWidth:!0,disabled:void 0!==e.props.disabled&&e.props.disabled,InputLabelProps:{shrink:!0}})})),n($e,null,n(I,{handleSubmitWithRedirect:t,pristine:o,saving:c,disabled:k}),n(T,{label:"ra.action.cancel",onClick:function(e){v(!1),e.stopPropagation()},disabled:k},n(mn,null))))}})))},Pr=function(e){var r=e.editors,a=e.clavesFila,t=e.camposClaveFila,o=e.resource,c=e.label,u=e.source,d=e.row,m=x(),p=g(),f=P(!1),h=f[0],v=f[1],b=fr("updateEtrRow",o,{},{refresh:!0,onSuccess:function(e){if(e.error)throw new Error(e.error);v(!1),m("ra.notification.updated","info",{smart_count:1})},onFailure:function(e){m(e.message,"warning")}}),y=b[0],C=b[1].loading,k=p("ra.action.edit");return n(i,null,n(T,{onClick:function(e){v(!0),e.stopPropagation()}},n(fn,null)),n(kr,{open:h,onClose:function(e){v(!1),e.stopPropagation()},labelEstado:k,label:c,msgTitle:e.msgTitle,msgDesc:e.msgDesc,resource:o,save:function(e){y({payload:{data:or({},a,e),ge:u,camposClaveFila:t,estado:"M"}})},render:function(e){var a=e.handleSubmitWithRedirect,c=e.pristine,u=e.saving;return n(i,null,n(en,null,l.map(r,function(e,n){return s(e,{resource:o,estado:"M",initialValue:d[e.props.source],fullWidth:!0,disabled:-1!=t.indexOf(e.props.source),InputLabelProps:{shrink:!0}})})),n($e,null,n(I,{handleSubmitWithRedirect:a,pristine:c,saving:u,disabled:C}),n(T,{label:"ra.action.cancel",onClick:function(e){v(!1),e.stopPropagation()},disabled:C},n(mn,null))))}}))},xr=He({},cn),Tr=function(e){var i=e.filterBy,l=void 0===i?"":i,s=e.claves,c=e.sortModel,u=e.columns,d=e.reference,m=e.allowAdd,p=void 0===m||m,f=e.allowRemove,g=void 0===f||f,h=e.etrResource,v=e.enableLoad,b=void 0===v||v,y=ir(e,hr),C=e.record,P=r(!1),x=vr(e),T=k(),w=a(c)[1],I=c[0],R=I.field,F=I.sort;t(function(){P.current=!0},[T]);var O=Object.keys(C).filter(function(e){return s.split(",").includes(e)}).reduce(function(e,n){return e[n]=C[n],e},{}),_={};l.split(",").forEach(function(e){e&&(_[e]=[{type:"string",comparison:"eq",value:C[e],field:e}])});var E=N(d,{page:1,perPage:200},{field:R,order:F},_,{enabled:b&&P.current}),D=E.data,M=E.ids,L=E.loading,B=o(function(){return M.map(function(e){return D[e]})},[M,D]),V=[p?{field:"BTN",headerName:"",sortable:!1,renderHeader:function(e){return n(Sr,or({},y,{etrResource:h,camposClaveFila:s,clavesFila:O,api:e.api}))}}:{}].concat(u,[{field:" ",width:80,headerName:"",headerAlign:"center",sortable:!1,disableClickEventBubbling:!0,renderCell:function(e){return n(Pr,or({},y,{camposClaveFila:s,clavesFila:O,api:e.api,row:e.row}))}},g?{field:" ",headerName:"",headerAlign:"center",sortable:!1,disableClickEventBubbling:!0,renderCell:function(e){return n(Nr,or({},y,{camposClaveFila:s,api:e.api,row:e.row}))}}:{}]),A=o(function(){return V},[JSON.stringify(V)]);return L?n(S,null):n(an,{className:x.rootPaper},n(Je,{theme:xr},n(un,or({className:x.root,disableSelectionOnClick:!0,pageSize:50,hideFooter:!0,sortModel:c,rows:B,columns:A,onSortModelChange:function(e){return w(e)},components:{NoRowsOverlay:mr}},y))))},wr=["filterBy","sortModel","columns","reference","filter","enableLoad"],Ir=He({},cn),Rr=function(e){var i=e.filterBy,l=void 0===i?"":i,s=e.sortModel,c=e.columns,u=e.reference,d=e.filter,m=void 0===d?[]:d,p=e.enableLoad,f=void 0===p||p,g=ir(e,wr),h=e.record,v=r(!1),b=dr(e),y=k(),C=a(s),P=C[0],x=C[1],T=s[0],w=T.field,I=T.sort,R=o(function(){return[].concat(c)},[JSON.stringify(c)]);t(function(){v.current=!0},[y]);var F=[];l.split(",").forEach(function(e){e&&F.push({type:"string",comparison:"eq",value:h[e],field:e})});var O=or({},F.concat(m)),_=N(u,{page:1,perPage:200},{field:w,order:I},O,{enabled:f&&v.current}),E=_.data,D=_.ids,M=_.loading,L=o(function(){return D.map(function(e){return E[e]})},[D,E]);return M?n(S,null):n(an,{className:b.rootPaper},n(Je,{theme:Ir},n(un,or({className:b.root,disableSelectionOnClick:!0,pageSize:50,hideFooter:!0,rows:L,columns:R,sortModel:P,onSortModelChange:function(e){return x(e)},components:{NoRowsOverlay:mr}},g))))},Fr=u(),Or=function(e){var r=e.children,t=a(!1),i=t[0],l=t[1],s=o(function(){return{open:i,show:function(){return l(!0)},hide:function(){return l(!1)}}},[i]);return n(Fr.Provider,{value:s},r)},_r=function(){return d(Fr)},Er=function(e,n,r,a){return{type:"RELOAD_CB",payload:{id:e,method:n,params:r,callback:a}}},Dr=function(e,n){return{type:"RELOAD_CB_SUCCESS",payload:{id:e,callback:n}}},Mr=function(e,n){return{type:"HIDE_INPUT",payload:{id:e,hidden:n}}},Lr=function(e,n){return{type:"DISABLE_INPUT",payload:{id:e,disabled:n}}},Br=function(e,n){return{type:"REQUIRE_INPUT",payload:{id:e,required:n}}},Vr=function(){var e=Ve();return c(function(n,r,a,t){e(Er(n,r,a,t))},[e])},Ar=function(){var e=Ve();return c(function(n,r){e(Mr(n,r))},[e])},qr=function(){var e=Ve();return c(function(n,r){e(Lr(n,r))},[e])},Wr=function(){var e=Ve();return c(function(n,r){e(Br(n,r))},[e])},zr=function(e,n,r,a){return C({type:"getJson",resource:e,payload:{method:n,params:r}},a)},jr=function(e){var n=zr(e),r=n[0],a=n[1].loading;return[c(function(e,n,a){return r({payload:{params:n,method:e}},{returnPromise:!0,onSuccess:a,onFailure:a})},[]),a]},Gr=function(e){return{}},Hr=function(e){var n=_(e),r=x(),a=E(),t=D(),o=M(e.resource);return{ajax:jr(e.resource)[0],data:n,notify:r,redirect:a,refresh:t,unselectAll:o}},Jr=function(e){var n=Vr(),r=Ar(),a=qr(),t=Wr(),o=_r(),i=x(),l=E();return{ajax:jr(e.resource)[0],notify:i,redirect:l,recargarComboBox:n,progress:o,setHidden:r,setDisable:a,setRequire:t}},Ur=function(e){var n=Vr(),r=Ar(),a=qr(),t=Wr(),o=_r(),i=x(),l=E();return{form:hn(),ajax:jr(e.resource)[0],notify:i,redirect:l,recargarComboBox:n,progress:o,setHidden:r,setDisable:a,setRequire:t}},Zr=["isRowEditable"],Qr=["isRowEditable","primaryText","secondaryText","desktopSize","onRenderGrilla","onLoadGrilla","hasEdit"],Yr=tn(function(e){return{container:{maxHeight:"70vh"},rowOdd:{backgroundColor:e.palette.action.hover}}},{name:"GrillaEtriek"}),Kr=function(e,n){return void 0===n||"function"==typeof n&&n(e)},Xr=function(e){var r=e.isRowEditable,a=ir(e,Zr);return Kr(e.record,r)?n(A,a):null},$r=function(e){!function(e){var n=e.onRenderGrilla,r=e.onLoadGrilla,a=k(),o=Hr(e);t(function(){n&&n(o)},[]),t(function(){r&&r(o)},[a])}(e);var r=Ue(function(e){return e.breakpoints.down("sm")}),a=Yr(e),o=L(e).hasEdit,i=e.isRowEditable,s=e.primaryText,c=e.secondaryText,u=e.desktopSize,d=void 0!==u&&u,m=ir(e,Qr),p=e.children,f=l.count(e.children),g=s,h=c;return s||(f>=4||f>=3||f>=2?g=function(e){return e[p[0].props.source]+" - "+e[p[1].props.source]}:1==f&&(g=function(e){return e[p[0].props.source]})),c||(f>=4?h=function(e){return e[p[2].props.source]+" - "+e[p[3].props.source]}:f>=3?h=function(e){return e[p[2].props.source]}:f>=2?g=function(e){return e[p[0].props.source]+" - "+e[p[1].props.source]}:1==f&&(g=function(e){return e[p[0].props.source]})),r&&!1===d?n(B,{linkType:function(e){return!(!o||!Kr(e,i))&&"edit"},primaryText:g,secondaryText:h}):n(gn,{className:a.container},n(V,or({stickyHeader:!0},m),l.map(p,function(e){return e.props.hidden?null:e}),o&&n(Xr,{isRowEditable:i})))},ea=["ids"],na=["filterValues","setFilters","tabs","GridComponent"],ra=function(e){var r=e.filterValues,a=e.setFilters,t=e.tabs,o=t.ids,l=ir(t,ea),s=e.GridComponent,c=void 0===s?$r:s,u=ir(e,na),d=r.id;return n(i,null,n(kn,{value:d,indicatorColor:"primary",onChange:function(e,n){a(or({},r,{id:n}))}},o.map(function(e){return n(Cn,{key:e,label:e.charAt(0).toUpperCase()+e.slice(1),value:e})})),n(yn,null),n(c,or({},u,l[d])))},aa=["useFormulario"],ta=function(e){var n=e.useFormulario;return{fichaProps:(void 0===n?Gr:n)(ir(e,aa))}},oa=["basePath","className","record","hasEdit","hasShow","hasList","resource","totalPages","showFilter","setSort","setPerPage","perPage","defaultTitle","setPage","setFilters","selectedIds","onUnselectItems","onToggleItem","loaded","loading","exporter","hideFilter","hasCreate","filterValues","displayedFilters","currentSort"],ia=["children","basePath","className","data","hasShow","hasList"],la=function(e){return e.split("_")[1]},sa=Nn(function(e){var n;return{form:{maxHeight:"70vh",overflow:"auto"},tab:{display:"block",maxHeight:"65vh",overflow:"auto"},contenido:(n={},n[e.breakpoints.up("md")]={width:"20vw"},n)}}),ca=function(e,n){if(!e)return"";if(e instanceof Date)return e.toString();if(-1!==e.indexOf("/")){var r=e.split("/");return new Date(parseInt(r[2],10),parseInt(r[1],10)-1,parseInt(r[0],10)).toString()}var a=/(\d{4})-(\d{2})-(\d{2})/.exec(e);if(null!==a){var t=new Date(parseInt(a[1],10),parseInt(a[2],10)-1,parseInt(a[3],10));if(!isNaN(t))return t.toString()}},ua=function(e,n){if(!e)return"";var r=e.split(" "),a="";switch(r[1]){case"Jan":a="01";break;case"Feb":a="02";break;case"Mar":a="03";break;case"Apr":a="04";break;case"May":a="05";break;case"Jun":a="06";break;case"Jul":a="07";break;case"Aug":a="08";break;case"Sep":a="09";break;case"Oct":a="10";break;case"Nov":a="11";break;case"Dec":a="12"}return r[2]+"/"+a+"/"+r[3]},da=function(e){if(!e)return"";if(e instanceof Date)return e.toString();if(-1!==e.indexOf("/")){var n=e.split("/");return new Date(parseInt(n[2].substr(0,4),10),parseInt(n[1],10)-1,parseInt(n[0],10),n[2].substr(5,2),n[2].substr(8,2)).toString()}var r=/(\d{4})-(\d{2})-(\d{2})\s(\d{2}):(\d{2})/.exec(e);if(null!==r){var a=new Date(parseInt(r[1],10),parseInt(r[2],10)-1,parseInt(r[3],10),r[4],r[5]);if(!isNaN(a))return a.toString()}},ma=function(e,n){if(!e)return"";var r=e.split(" "),a="";switch(r[1]){case"Jan":a="01";break;case"Feb":a="02";break;case"Mar":a="03";break;case"Apr":a="04";break;case"May":a="05";break;case"Jun":a="06";break;case"Jul":a="07";break;case"Aug":a="08";break;case"Sep":a="09";break;case"Oct":a="10";break;case"Nov":a="11";break;case"Dec":a="12"}return r[2]+"/"+a+"/"+r[3]+" "+r[4].substr(0,5)},pa=function(e){if(!e)return"";if(e instanceof Date)return e.toString();if(-1!==e.indexOf(":")){var n=e.split(":"),r=new Date;return r.setHours(n[0]),r.setMinutes(n[1]),r.toString()}var a=/(\d{2}):(\d{2})/.exec(e);if(null!==a){var t=new Date;return t.setHours(a[0]),t.setMinutes(a[1]),t.toString()}},fa=function(e,n){return e?e.split(" ")[4].substr(0,5):""},ga=function(e){return n(ln,{variant:"h6",gutterBottom:!0},e.children)},ha=function(e){var r=e.children,a=e.basePath,t=e.className,o=e.data,i=e.hasShow,l=e.hasList,s=void 0===l||l,c=ir(e,ia);return n(q,or({className:t},ir(c,oa)),r,s&&n(W,{label:"ra.action.back",basePath:a,icon:n(Sn,null)}),i&&n(z,{basePath:a,record:o}))},va=j(),ba=[va,G(1)],ya={format:"dd/MM/yyyy"},Ca=function(e){return function(n,r){var a=r[e];if(n&&a){var t=a.split("/").reverse().join("/"),o=n.split("/").reverse().join("/");if(Tn(t).isAfter(o))return{message:"validation.greater_or_equal",args:{menor:a}}}}},ka=function(e){return void 0===e&&(e="es"),{locale:"en"==e?Pn:xn}},Na=[{id:"1",name:"Aprobado"},{id:"2",name:"Rechazado"},{id:"3",name:"Pendiente"}],Sa=function(e,n){var r=document.createElement("a");r.style.display="none",document.body.appendChild(r),r.setAttribute("href",e),r.setAttribute("download",n),r.click()},Pa=function(e,n){var r=H();return Be(function(a){var t;return(null===(t=a.admin.resources["cb_"+la(r)+"_"+e].data[n])||void 0===t?void 0:t.etiqueta)||""})},xa=u({}),Ta=["useFormulario","enableLoad"],wa=function(e){var r=e.enableLoad,a=void 0===r||r,t=ir(e,Ta),i=H(e),l=ur(i,{enabled:a}),s=l.data,c=l.loading,u=ta(e).fichaProps,d=o(function(){return{estado:"N",initialValues:s,loading:c,fichaProps:u}},[s,c,u]);return n(Or,null,n(xa.Provider,{value:d},n(J,or({},t,null==u?void 0:u.panel))))};wa.propTypes={useFormulario:Ae.func};var Ia=["basePath","classes","filterValues","handleSubmit","handleSubmitWithRedirect","invalid","label","pristine","resource","saving","selectedIds","submitOnEnter","redirect"],Ra=["resource","record","basePath","redirect","className","icon","label"],Fa=tn(function(e){return{deleteButton:{color:e.palette.error.main,"&:hover":{backgroundColor:In(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}}),Oa=function(e){var r=Fa(e),a=g(),t=e.resource,o=e.record,i=e.className,l=e.icon,s=e.label,c=void 0===s?"ra.action.delete":s,u=ir(e,Ra),d=U(t,o.id),m=d[0],p=d[1].loading;return n(Rn,{title:a("ra.action.delete")},n(wn,or({disabled:p,onClick:m,label:c,className:Fn("ra-delete-button",r.deleteButton,i),key:"button"},ir(u,Ia)),l))};Oa.defaultProps={redirect:"list",icon:n(pn,null)};var _a=["useFormulario"],Ea=function(e){var r=ir(e,_a),a=Z(r),t=a.record,i=a.loading,l=ta(e).fichaProps,s=o(function(){return{estado:"M",initialValues:t,loading:i,fichaProps:l}},[t,i,l]);return n(Or,null,n(xa.Provider,{value:s},n(Q,or({},r,null==l?void 0:l.panel))))},Da=tn(function(e){return{snackbarContent:{whiteSpace:"pre-wrap"}}}),Ma=function(e){var r=Da(e);return n(Y,or({},e,{className:r.snackbarContent}))},La=Nn(function(e){return{button:{margin:e.spacing(1)},input:{display:"none"}}}),Ba=e(function(e,r){var a=e.isOpen,t=e.onConfirm,o=e.onClose,i=e.title,l=e.dialogText,s=e.children,c=e.hasAccept,u=void 0===c||c,d=e.hasCancel,m=void 0===d||d,p=e.loading,f=void 0!==p&&p,g=La(e),h=function(e){o&&o(e)};return n(Xe,{ref:r,open:a,fullWidth:!0,onClose:h,"aria-labelledby":"form-dialog-title"},n(rn,{id:"form-dialog-title"},i),n(en,null,n(nn,null,l),s),(u||m)&&n($e,null,m&&n(On,{onClick:h,variant:"contained",color:"secondary",className:g.button,disabled:f},"Cancelar"),u&&n(On,{onClick:function(e){t&&t(e)},variant:"contained",color:"primary",className:g.button,disabled:f},"Ok")))}),Va=tn(function(e){return{block:{pointerEvents:"none",backgroundColor:"#ffffff",opacity:.6,position:"relative"},progress:{position:"absolute",left:"50%",top:"50%"}}}),Aa=function(e){var r=Va(e),a=_r(),o=H(e),i=d(xa),l=i.estado,s=i.loading,c=i.initialValues,u=i.fichaProps,m=Ur({resource:o});return t(function(){u.onRenderFicha&&u.onRenderFicha(m,l)},[]),t(function(){s||u.onLoadFicha&&u.onLoadFicha(m,l,c)},[s]),n(K,{className:a.open?r.block:""},a.open&&n(Ze,{className:r.progress,thickness:4,size:50}),e.children)},qa=function(e){return n(Aa,e)},Wa=["mutators"],za={setError:function(e,n){n.fields[e[0]].data=e[1]}},ja=function(e){var r=d(xa),a=r.initialValues,t=r.fichaProps,o=t.onBeforeSubmitFicha,i=t.config,l=(i=void 0===i?{}:i).mutators,s=void 0===l?{}:l,u=ir(i,Wa),m=s===za?s:or({},za,s),p=Jr(e),f=x(),g=c(function(n,r,a){var t=o&&o(or({form:{values:n}},p),"N");return"string"==typeof t?void f(t,"warning"):void 0===t||t?e.save(n,r,a):void 0},[o,p]);return n(O,or({},e,u,{save:g,mutators:m,initialValues:a,render:function(e){return n(X,or({component:qa},e))}}))};ja.propTypes=or({},$.propTypes),ja.defaultProps={margin:"normal",variant:"outlined"};var Ga=tn(function(e){return{icon:{minWidth:e.spacing(5)},sidebarIsOpen:{paddingLeft:25,transition:"padding-left 195ms cubic-bezier(0.4, 0, 0.6, 1) 0ms"},sidebarIsClosed:{paddingLeft:0,transition:"padding-left 195ms cubic-bezier(0.4, 0, 0.6, 1) 0ms"}}}),Ha=function(e){var r=e.handleToggle,a=e.sidebarIsOpen,t=e.isOpen,o=e.name,l=e.icon,s=e.children,c=e.dense,u=g(),d=Ga(),m=n(Ln,{dense:c,button:!0,onClick:r},n(Mn,{className:d.icon},t?n(Bn,null):l),n(ln,{variant:"inherit",color:"textSecondary"},u(o)));return n(i,null,a||t?m:n(Rn,{title:u(o),placement:"right"},m),n(En,{in:t,timeout:"auto",unmountOnExit:!0},n(Dn,{dense:c,component:"div",disablePadding:!0,className:a?d.sidebarIsOpen:d.sidebarIsClosed},s),n(yn,null)))},Ja=["items","translate"],Ua={marginTop:"1.5em"},Za=function(e){var r=e.onMenuClick,t=e.dense,o=e.logout,l=g(),s=a({mnuPrueba:!1}),c=s[0],u=s[1],d=Ue(function(e){return e.breakpoints.down("sm")}),m=Ue(function(e){return e.breakpoints.down("xs")}),p=Be(function(e){return e.admin.ui.sidebarOpen}),f=function e(r){var a=r.items,t=r.translate,o=ir(r,Ja),l=o.state,s=o.onMenuClick,c=o.handleToggle,u=o.dense,d=o.open;return a&&n(i,null,a.map(function(r){var a=r.name,i=r.menu,m=r.label;return i?n(Ha,{key:a,name:m,handleToggle:function(){return c(a)},isOpen:l[a],sidebarIsOpen:d,icon:n(_n,null),dense:u},e(or({items:i,translate:t},o))):n(h,{key:a,to:"/"+a,primaryText:t("resources."+a+".name",{_:m}),onClick:s,sidebarIsOpen:d,dense:u,leftIcon:n(_n,null)})}))}({items:JSON.parse(localStorage.getItem("menus")),handleToggle:function(e){u(function(n){var r;return or({},n,((r={})[e]=!n[e],r))})},state:c,activeClassName:"",iconClass:"",className:"",open:p,dense:t,onMenuClick:r,translate:l});return n(ee,{style:Ua},n(ne,{primaryText:l("ra.page.dashboard"),onClick:r,sidebarIsOpen:p}),f,m&&n(h,{to:"/configuration",primaryText:l("pos.configuration"),leftIcon:n(_n,null),onClick:r,sidebarIsOpen:p,dense:t}),m&&o,!m&&d&&o)},Qa=or({},re);Qa.palette.type="dark",Qa.overrides.RaSidebar={drawerPaper:{position:"sticky"}},Qa.overrides.RaRichTextInput={"@global":{".ra-rich-text-input":{"& .ql-editor":{"& p:not(:last-child)":{marginBottom:"0"}}}}};var Ya=or({},re);Ya.palette.type="light",Ya.overrides.RaSidebar={drawerPaper:{position:"sticky"}},Ya.overrides.RaRichTextInput={"@global":{".ra-rich-text-input":{"& .ql-editor":{"& p:not(:last-child)":{marginBottom:"0"}}}}};var Ka={__proto__:null,lightTheme:Ya,darkTheme:Qa},Xa=["apiFolder"],$a=function(e){return n(te,e)},et=function(e){var r=ir(e,Xa),a=Be(function(e){return"dark"===e.theme?Qa:Ya});return n(ae,or({},r,{appBar:cr,sidebar:$a,menu:Za,theme:a,notification:Ma}))},nt=["className","exporter","filters","children","jsBotonGrilla"],rt=function(e){var r=e.className,a=e.exporter,t=e.filters,i=e.children,c=e.jsBotonGrilla,u=ir(e,nt),d=Hr(e).utils,m=_(e),p=H(u),f=L(u).hasCreate,g=m.currentSort,h=m.displayedFilters,v=m.filterValues,b=m.basePath,y=m.selectedIds,C=m.showFilter,k=m.total,N=or({},d,m);return o(function(){return n(q,or({className:r},oe(u)),t&&s(t,{resource:p,showFilter:C,displayedFilters:h,filterValues:v,context:"button"}),f&&n(ie,{basePath:b}),!1!==a&&n(le,{disabled:0===k,resource:p,sort:g,filterValues:v}),l.map(i,function(e,n){return s(e,{onClick:e.props.options?null:function(n){return c(N,e.key)},options:e.props.options?e.props.options.map(function(e){return or({},e,{onClick:function(n){return c(N,e.key)}})}):null})}))},[p,h,v,y,t,k])},at=["meta","input","render"],tt=tn(function(e){return{main:{display:"flex",flexDirection:"column",minHeight:"100vh",alignItems:"center",justifyContent:"flex-start",backgroundImage:function(e){return e.loginBackgroundImage},backgroundRepeat:"no-repeat",backgroundSize:"cover"},card:{minWidth:300,marginTop:"6em"},avatar:{margin:"1em",display:"flex",justifyContent:"center"},avatarIcon:{backgroundColor:e.palette.secondary.main},icon:function(n){return{position:"absolute",left:e.spacing(14-Math.ceil(n.textLength/2)-1)}},hint:{marginTop:"1em",display:"flex",justifyContent:"center",color:e.palette.grey[500]},form:{padding:"0 1em 1em 1em"},input:{marginTop:"1em"},actions:{padding:"0 1em 1em 1em"}}}),ot=function(e){var r=e.meta,a=(r=void 0===r?{touched:!1,error:void 0}:r).touched,t=r.error,o=or({},e.input),i=ir(e,at);return n(zn,or({error:!(!a||!t),helperText:a&&t},o,i,{fullWidth:!0}))},it=function(e){var r=e.loginBackgroundImage,t=e.nameSource,o=void 0===t?"username":t,i=e.passwordSource,l=void 0===i?"password":i,s=a(!1),c=s[0],u=s[1],d=g(),m=d("ra.auth.sign_in"),f=tt({loginBackgroundImage:r,textLength:m.length}),h=x(),v=se(),b=Gn();return n(vn,{onSubmit:function(e){u(!0),v(e,b.state?b.state.nextPathname:"/").catch(function(e){u(!1),h("string"==typeof e?e:void 0!==e&&e.message?e.message:"ra.auth.sign_in_error","warning")})},validate:function(e){var n={};return e[o]||(n[o]=d("ra.validation.required")),e[l]||(n[l]=d("ra.validation.required")),n},render:function(e){return n("form",{onSubmit:e.handleSubmit},n("div",{className:f.main},n(An,{className:f.card},n("div",{className:f.avatar},n(Vn,{className:f.avatarIcon},n(p,null))),n("div",{className:f.hint},"Inicio de Sesión"),n("div",{className:f.form},n("div",{className:f.input},n(bn,{autoFocus:!0,name:o,component:ot,label:d("ra.auth.username"),disabled:c})),n("div",{className:f.input},n(bn,{name:l,component:ot,label:d("ra.auth.password"),type:"password",disabled:c}))),n(qn,{className:f.actions},n(On,{variant:"contained",type:"submit",color:"primary",disabled:c,fullWidth:!0},c&&n(Wn,{className:f.icon,size:18,thickness:2}),m))),n(Y,null)))}})},lt=function(e){return n(jn,{theme:on(Ya)},n(it,e))},st=["displayedFilters","filterValues","showFilter"],ct=["className","options","icon","label"],ut=tn({root:{display:"inline-block"},paddingRight:{paddingRight:4}}),dt=function(e){var t,o=e.className,i=e.options,l=void 0===i?[]:i,s=e.icon,c=e.label,u=ir(e,ct),d=a(!1),m=d[0],p=d[1],f=r(),g=a(0),h=g[0],v=g[1],b=ut(e),y=H(e);return n("div",or({className:Fn(b.root,o)},ir(u,st)),n(T,{className:"add-filter",label:c,onClick:function(e){e.preventDefault(),p(!0),f.current=e.currentTarget},title:l[h].label},(null===(t=l[h])||void 0===t?void 0:t.icon)||s),n(Un,{open:m,anchorEl:f.current,onClose:function(e){f.current&&f.current.contains(e.target)||p(!1)}},l.map(function(e,r){return n(Ln,{key:e.label,disabled:e.disabled,selected:r===h,onClick:function(n){!function(e,n){v(n),p(!1)}(0,r),e.onClick&&e.onClick(n,r)},resource:y,title:e.label},e.icon,n("span",{className:b.paddingRight}),n(ce,{label:e.label,resource:y}))})))},mt=["fields","className","basePath","record","textAlign","sortable"],pt=function(e){var r=e.fields,a=e.className,t=e.record,o=ir(e,mt),i=r.separador,l=void 0===i?"":i,s=r.secundario,c=void 0===s?[]:s,u=r.hasSecundario,d=r.campos.map(function(e){return void 0!==t[e]?t[e]:e}).join(""+l);return n(ln,or({noWrap:!0,variant:"inherit",className:a},o),d,u&&n(ln,{component:"span",display:"block",color:"textSecondary",variant:"caption"},c.map(function(e){return(e.etiqueta||"---")+": "+(t[e.campo]||"---")}).join(" ")))},ft=["useFormulario"],gt=function(e){var r=ir(e,ft),a=ue(r),t=a.record,i=a.loading,l=ta(e).fichaProps,s=o(function(){return{estado:"M",initialValues:t,loading:i,fichaProps:l}},[t,i,l]);return n(Or,null,n(xa.Provider,{value:s},n(de,or({},r,a,null==l?void 0:l.panel))))},ht=["basePath","children","className","classes","component","form","handleSubmit","handleSubmitWithRedirect","invalid","mutationMode","pristine","record","redirect","resource","saving","submitOnEnter","syncWithLocation","tabs","toolbar","undoable","variant","margin"],vt=["active","dirty","dirtyFields","dirtyFieldsSinceLastSubmit","dirtySinceLastSubmit","error","errors","hasSubmitErrors","hasValidationErrors","initialValues","modified","modifiedSinceLastSubmit","save","submitError","submitErrors","submitFailed","submitSucceeded","submitting","touched","valid","validating","values","visited","__versions"],bt=["mutators"],yt=function(e){var r=e.basePath,t=e.children,o=e.className,i=e.component,c=e.handleSubmit,u=e.handleSubmitWithRedirect,d=e.invalid,p=e.mutationMode,f=e.pristine,g=e.record,h=e.redirect,v=e.resource,b=e.saving,y=e.submitOnEnter,C=e.syncWithLocation,k=void 0===C||C,N=e.tabs,S=e.toolbar,P=e.undoable,x=e.variant,T=e.margin,w=ir(e,ht),I=Ct(e),R=Hn(),F=Gn(),O=R?R.url:F.pathname,_=a(0),E=_[0],D=_[1];return n("form",or({className:Fn("tabbed-form",o)},kt(w)),s(N,{classes:I,url:O,syncWithLocation:k,onChange:function(e,n){k||D(n)},value:E},t),n(Qe,null),n(i,{className:I.content},l.map(t,function(e,a){if(e){var t=me(e,a,O);return n(Jn,{exact:!0,path:pe(t)},function(n){return m(e)?s(e,{intent:"content",classes:I,resource:v,record:g,basePath:r,hidden:k?!n.match:E!==a,variant:e.props.variant||x,margin:e.props.margin||T,value:k?t:a}):null})}})),S&&s(S,{basePath:r,className:"toolbar",handleSubmitWithRedirect:u,handleSubmit:c,invalid:d,mutationMode:p,pristine:f,record:g,redirect:h,resource:v,saving:b,submitOnEnter:y,undoable:P}))},Ct=tn(function(e){return{errorTabButton:{color:e.palette.error.main},content:{paddingTop:e.spacing(1),paddingLeft:e.spacing(2),paddingRight:e.spacing(2)}}},{name:"RaTabbedForm"});yt.defaultProps={submitOnEnter:!0,tabs:n(fe,null),toolbar:n(ge,null),component:function(e){return n("div",{className:e.className},e.children)}};var kt=function(e){return ir(e,vt)},Nt={setError:function(e,n){n.fields[e[0]].data=e[1]}},St=function(e){var r=d(xa),a=r.initialValues,t=r.fichaProps,o=t.onBeforeSubmitFicha,i=t.config,l=(i=void 0===i?{}:i).mutators,s=void 0===l?{}:l,u=ir(i,bt),m=s===Nt?s:or({},Nt,s),p=Jr(e),f=x(),g=c(function(n,r,a){var t=o&&o(or({form:{values:n}},p),"N");return"string"==typeof t?void f(t,"warning"):void 0===t||t?e.save(n,r,a):void 0},[o,p]);return n(O,or({},e,u,{save:g,mutators:m,initialValues:a,render:function(e){return n(yt,or({component:qa},e))}}))};St.defaultProps={margin:"normal",variant:"outlined",syncWithLocation:!1},Zn.ra.page.empty="No records yet";var Pt=or({},Zn,{login:{id:"ID",hint:"Login",required:"Insert Username or ID",send:"Send",email:"Enter your email address",check_email:"Check your email inbox, we just send you a verification code!",must_enter_credentials:"You must first enter Username or ID",restore_password:"Restore Password",punch_in:"Punch In"},pos:{search:"Search",change_pin:"Change Pin",change_password:"Change Password",configuration:"Configuration",language:"Language",theme:{name:"Theme",light:"Light",dark:"Dark"},dashboard:{welcome:{title:"Welcome",subtitle:"Employee Management",aor_button:"Metiri WebSite"}}},validation:{greater_or_equal:"Must be greater than or equal to %{menor}"}});Qn.ra.notification.created="Datos guardados correctamente",Qn.ra.action.bulk_actions="1 seleccionado |||| %{smart_count} seleccionados",Qn.ra.page.dashboard="Inicio",Qn.ra.page.empty="Sin registros todavía",Qn.ra.page.invite="¿Quiere agregar uno?",Qn.ra.page.list="%{name}",Qn.ra.page.edit="Editar %{name}",Qn.ra.action.back="Volver";var xt=or({},Qn,{login:{id:"Cédula",hint:"Inicio de Sesión",required:"Ingrese Usuario o Cédula",email:"Ingrese su email aquí",send:"Enviar",check_email:"Revisa tu correo electrónico, te enviaremos un código de verificación!",must_enter_credentials:"Debe ingresar Nº de Usuario o Cédula y Contraseña primero",restore_password:"Restablecer Contraseña",punch_in:"Generar Marcas"},pos:{search:"Búsqueda",change_pin:"Cambiar Pin",change_password:"Cambiar Contraseña",configuration:"Configuración",language:"Lenguaje",theme:{name:"Tema Visual",light:"Light",dark:"Dark"},dashboard:{welcome:{title:"Bienvenid@",subtitle:"Gestión de Funcionarios",aor_button:"Sitio de Metiri"}}},validation:{greater_or_equal:"Debe ser mayor o igual a %{menor}"}}),Tt=["hidden"],wt=["hidden","useContenido"],It=["hidden"],Rt=function(e){var n=d(xa),r=n.estado,a=n.loading,t=n.fichaProps,o=(void 0===t?{}:t)[e.source],i=void 0===o?{}:o,l=e.hidden,s=void 0!==l&&l,c=ir(e,Tt),u=i.hidden,m=i.useContenido,p=void 0===m?Gr:m,f=ir(i,wt),g=void 0!==u?u:s,h=p(or({},c,{estado:r,hidden:g,loading:a},f)),v=h.hidden,b=ir(h,It);if(void 0===h)throw new Error("useContenido está devolviendo undefined para el contenido "+e.source+"\n Asegúrese de incluir una instrucción return al final de la función");return{propsContenido:or({},c,f,b),hidden:void 0!==v?v:g}},Ft=function(e){var r=Rt(e),a=r.propsContenido,t=r.hidden,o=JSON.parse(JSON.stringify(e.record)),i=o[e.source];return o[e.source]=""!=i&&"0"!=i,!t&&n(he,or({},a,{record:o}))},Ot=["onFocus","onChange","onBlur","hidden","disabled","validate"],_t=["onFocus","onBlur","onChange","hidden","disabled","useContenido","validate"],Et=["hidden","disabled","onFocus","onChnage","onBlur","validate"],Dt=function(e,n,r){return"string"==typeof(null==r?void 0:r.data)?r.data:void 0},Mt=function(e){var n=d(xa),a=n.estado,t=n.loading,o=n.fichaProps,i=void 0===o?{}:o,l=Be(function(n){var r=n.configInputs?n.configInputs.filter(function(n){return n.id===e.source}):[];return r[0]?r[0]:null})||{},s=l.disabled,c=l.hidden,u=!0===l.required?va:void 0,m=i[e.source],p=void 0===m?{}:m,f=e.onFocus,g=e.onChange,h=e.onBlur,v=e.hidden,b=void 0!==v&&v,y=e.disabled,C=void 0!==y&&y,k=e.validate,N=ir(e,Ot),S=ve({source:e.source}).input,P=p.onFocus,x=p.onBlur,T=p.onChange,w=p.hidden,I=p.disabled,R=p.useContenido,F=void 0===R?Gr:R,O=p.validate,_=ir(p,_t),E=void 0!==w?w:b,D=void 0!==I?I:C,M=void 0!==P?P:f,L=void 0!==x?x:h,B=void 0!==T?T:g,V=Ur(e),A=F(or({},N,{estado:a,hidden:E,loading:t,utils:V},_)),q=r(S.value);if(void 0===A)throw new Error("useContenido está devolviendo undefined para el contenido "+e.source+"\n Asegúrese de incluir una instrucción return al final de la función");var W=A.hidden,z=A.disabled,j=A.onFocus,G=A.onChnage,H=A.onBlur,J=A.validate,U=ir(A,Et),Z=j||M,Q=H||L,Y=G||B,K=or({},V,{prev:q.current}),X=Array.isArray(k)?k:[k],$=Array.isArray(O)?O:[O],ee=Array.isArray(J)?J:[J];return{propsContenido:or({onFocus:function(e){Z&&M(V,a,e),q.current=e.target.value},onBlur:function(e){return Q&&Q(K,a,e)},onChange:function(e){return Y&&Y(K,a,e)},helperText:!1,validate:[].concat(X,$,ee,[Dt,u]).filter(function(e){return void 0!==e})},N,_,U,{disabled:void 0!==s?s:void 0!==z?z:D}),hidden:void 0!==c?c:void 0!==W?W:E}},Lt=function(e){var r=Mt(e);return!r.hidden&&n(be,or({accept:"",maxSize:5e6},r.propsContenido),n(ye,{source:"src"}))},Bt=function(e){var r=Mt(e);return!r.hidden&&n(Ce,r.propsContenido)},Vt=["callback"],At=["helperText"],qt=["callback"],Wt=function(e){var r=e.callback,a=ir(e,Vt),o=_(a),i=o.data,l=o.loading;return t(function(){l||"function"==typeof r&&r(Object.values(i))},[i]),n(Pe,a)},zt=function(e){var a,o,i=Mt(e),l=i.propsContenido,s=i.hidden,c=r(!1),u=Ve(),d=k(),m=l.helperText,p=ir(l,At),f=Be(function(n){var r=n.reload_cb?n.reload_cb.filter(function(n){return n.id===e.source}):[];return r[0]?r[0]:null}),g=r(f),h=null===f&&g.current?g.current:f;return h&&(a=h.callback,o=ir(h,qt)),t(function(){null!==f&&(g.current=f,u(Dr(e.source)))},[JSON.stringify(f)]),t(function(){c.current=!0},[d]),c.current?!s&&n(ke,or({},p,{perPage:250,filter:o}),n(Wt,{callback:a,helperText:m,optionText:"etiqueta",optionValue:e.source})):n(Ne,{id:e.id,label:e.label,source:e.source,resource:e.resource,className:e.className,isRequired:e.isRequired,meta:e.meta,input:e.input,margin:e.margin},n(Se,{timeout:1}))},jt=function(e){var r=Mt(e);return!r.hidden&&n(Pe,r.propsContenido)},Gt=function(e){var r=e.title,a=e.source,t=e.src,o=xe(e);return n(Vn,{title:r,src:t+"/"+o[a]})},Ht=["helperText"],Jt=function(e){var a=Mt(e),o=a.propsContenido,i=a.hidden,l=r(!1),s=k(),c=o.helperText,u=ir(o,Ht);return t(function(){l.current=!0},[s]),l.current?!i&&n(Te,u,n(we,{helperText:c,optionText:"etiqueta",optionValue:e.source})):n(Ne,{id:e.id,label:e.label,source:e.source,resource:e.resource,className:e.className,isRequired:e.isRequired,meta:e.meta,input:e.input,margin:e.margin},n(Se,{timeout:1}))},Ut=function(e){var r=Mt(e);return!r.hidden&&n(Ie,r.propsContenido)},Zt=["helperText"],Qt=function(e){var a=Mt(e),o=a.propsContenido,i=a.hidden,l=r(!1),s=k(),c=o.helperText,u=ir(o,Zt);return t(function(){l.current=!0},[s]),l.current?!i&&n(ke,u,n(Re,{helperText:c,optionText:"etiqueta",optionValue:e.source})):n(Ne,{id:e.id,label:e.label,source:e.source,resource:e.resource,className:e.className,isRequired:e.isRequired,meta:e.meta,input:e.input},n(Se,null))},Yt=function(e){var r=Mt(e);return!r.hidden&&n(Re,r.propsContenido)},Kt=tn(function(e){return{confirmPrimary:{color:e.palette.primary.main},confirmWarning:{color:e.palette.error.main,"&:hover":{backgroundColor:In(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}},iconPaddingStyle:{paddingRight:"0.5em"}}},{name:"RaConfirm"}),Xt=function(e){return n(nr,{handle:"#draggable-dialog-title",cancel:'[class*="MuiDialogContent-root"]'},n(Ye,e))},$t={cursor:"move"},eo=function(e){var r,a=e.isOpen,t=e.loading,o=e.title,i=e.content,l=e.cancel,s=e.confirmColor,u=e.ConfirmIcon,d=e.CancelIcon,m=e.onClose,p=e.onConfirm,f=e.contentResource,h=e.translateOptions,v=void 0===h?{}:h,b=Kt(e),y=g(),C=Be(function(e){return e.admin.resources[f].list.selectedIds}),k=c(function(e,n){e.stopPropagation(),p(e,C)},[C,p]),N=c(function(e){e.stopPropagation()},[]);return n(Xe,{open:a,onClose:m,onClick:N,fullWidth:!0,maxWidth:"lg",PaperComponent:Xt,"aria-labelledby":"draggable-dialog-title"},n(rn,{style:$t,id:"draggable-dialog-title"},y(o,or({_:o},v))),n(en,{dividers:!0},i),n($e,null,n(On,{disabled:t,onClick:m},n(d,{className:b.iconPaddingStyle}),y(l,{_:l})),n(On,{disabled:t,onClick:function(e){return k(e,"yes")},className:Fn("ra-confirm",(r={},r[b.confirmWarning]="warning"===s,r[b.confirmPrimary]="primary"===s,r)),autoFocus:!0},n(u,{className:b.iconPaddingStyle}),y("ra.action.confirm"))))};eo.propTypes={cancel:Ae.string,classes:Ae.object,confirm:Ae.string,confirmColor:Ae.string,ConfirmIcon:Ae.elementType,CancelIcon:Ae.elementType,content:Ae.node.isRequired,isOpen:Ae.bool,loading:Ae.bool,onClose:Ae.func.isRequired,onConfirm:Ae.func.isRequired,title:Ae.string.isRequired},eo.defaultProps={cancel:"ra.action.cancel",classes:{},confirmColor:"primary",ConfirmIcon:$n,CancelIcon:er,isOpen:!1};var no=["disabled","asistant","asistantResource","label","source"],ro=function(){return n(i,null)},ao={seleccion:[],all:!0,none:!1},to=function(e){return!e||null!=e&&e.all?"Todos":null!=e&&e.none||0===e.seleccion.length?"Ninguno":"Selección ("+e.seleccion.length+")"},oo=function(e){return e},io=function(e){var r=e.disabled,t=e.asistant,o=e.asistantResource,l=e.label,s=e.source,u=ir(e,no),d=a(!1),m=d[0],p=d[1],f=hn(),g=c(function(){p(!1)},[p]);return n(i,null,n("div",{style:{display:"flex",alignItems:"center"}},n(Fe,or({initialValue:ao},u,{source:s,label:l,disabled:!0,parse:oo,format:to,helperText:!1,InputProps:{endAdornment:n(i,null,n(wn,{onClick:function(e){f.change(s,{seleccion:[],all:!1,none:!0})},disabled:r,"aria-label":"Ninguno",size:"small",title:"Ninguno"},n(Kn,null)),n(wn,{onClick:function(e){f.change(s,{seleccion:[],all:!0,none:!1})},disabled:r,"aria-label":"Todos",size:"small",title:"Todos"},n(Yn,null)),n(wn,{onClick:function(e){return p(!0)},disabled:r,"aria-label":"Selección",size:"small",title:"Selección"},n(Xn,null)))}}))),n(eo,{isOpen:m,title:"Selección de "+l,contentResource:o,content:n(t,{bulkActionButtons:n(ro,null),hasCreate:!1,exporter:!1,resource:o,basePath:"/"+o}),onConfirm:function(e,n){p(!1),f.change(s,{seleccion:n,all:!1,none:!1})},onClose:g}))},lo=function(e){return n(_e,or({},e,{hasCreate:!1,exporter:!1,perPage:25,title:" ",bulkActionButtons:n("span",null)}),n(V,null,n(Ee,{source:"funced",sortable:!0,label:"Cédula"}),n(Ee,{source:"funpriape",sortable:!0,label:"Apellido"}),n(Ee,{source:"funprinom",sortable:!0,label:"Nombre"})))},so={fillista:"empcod=-1"},co=function(e){var r=a(so),t=r[0],o=r[1],i=Oe(),l=c(function(e){o({fillista:e.node.key})},[o]),s=c(function(e){return i.getChildNodes("form_224",{parentId:e?e.itemData.id:""}).then(function(e){return e.data}).catch(function(){throw new Error("Data Loading Error")})},[i]);return n(Ke,{display:"flex",flex:1,alignItems:"flex-start",height:"20em"},n(Ke,{flexGrow:1},n(rr,{id:"funcionarios-treeview",dataStructure:"plain",rootValue:"",onItemClick:l,createChildren:s})),n(Ke,{flexGrow:2},n(lo,{resource:"form_224",basePath:"/form_224",filter:t})))},uo=tn(function(e){return{confirmPrimary:{color:e.palette.primary.main},confirmWarning:{color:e.palette.error.main,"&:hover":{backgroundColor:In(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}},iconPaddingStyle:{paddingRight:"0.5em"}}},{name:"RaConfirm"}),mo=function(e){return n(nr,{handle:"#draggable-dialog-title",cancel:'[class*="MuiDialogContent-root"]'},n(Ye,e))},po={cursor:"move"},fo=function(e){var r,a=e.isOpen,t=e.loading,o=e.title,i=e.cancel,l=e.confirmColor,s=e.ConfirmIcon,u=e.CancelIcon,d=e.onClose,m=e.onConfirm,p=e.translateOptions,f=void 0===p?{}:p,h=uo(e),v=g(),b=c(function(e,n){e.stopPropagation(),m(e,n)},[m]),y=c(function(e){e.stopPropagation()},[]);return n(Xe,{open:a,onClose:d,onClick:y,fullWidth:!0,maxWidth:"lg",PaperComponent:mo,"aria-labelledby":"draggable-dialog-title"},n(rn,{style:po,id:"draggable-dialog-title"},v(o,or({_:o},f))),n(en,{dividers:!0},n(co,null)),n($e,null,n(On,{disabled:t,onClick:d},n(u,{className:h.iconPaddingStyle}),v(i,{_:i})),n(On,{disabled:t,onClick:function(e){return b(e,"yes")},className:Fn("ra-confirm",(r={},r[h.confirmWarning]="warning"===l,r[h.confirmPrimary]="primary"===l,r)),autoFocus:!0},n(s,{className:h.iconPaddingStyle}),v("ra.action.confirm"))))};fo.propTypes={cancel:Ae.string,classes:Ae.object,confirm:Ae.string,confirmColor:Ae.string,ConfirmIcon:Ae.elementType,CancelIcon:Ae.elementType,isOpen:Ae.bool,loading:Ae.bool,onClose:Ae.func.isRequired,onConfirm:Ae.func.isRequired,title:Ae.string.isRequired},fo.defaultProps={cancel:"ra.action.cancel",classes:{},confirmColor:"primary",ConfirmIcon:$n,CancelIcon:er,isOpen:!1};var go=["disabled","asistant","asistantResource","label","source"],ho={seleccion:[],all:!0,none:!1},vo=function(e){return!e||null!=e&&e.all?"Todos":null!=e&&e.none||0===e.seleccion.length?"Ninguno":"Selección ("+e.seleccion.length+")"},bo=function(e){return e},yo=function(e){var r=e.disabled,t=e.label,o=void 0===t?"Funcionarios":t,l=e.source,s=ir(e,go),u=Be(function(e){return e.admin.resources.form_224.list.selectedIds}),d=a(!1),m=d[0],p=d[1],f=hn(),g=c(function(){p(!1)},[p]);return n(i,null,n("div",{style:{display:"flex",alignItems:"center"}},n(Fe,or({initialValue:ho},s,{source:l,label:o,disabled:!0,parse:bo,format:vo,helperText:!1,InputProps:{endAdornment:n(i,null,n(wn,{onClick:function(e){f.change(l,{seleccion:[],all:!1,none:!0})},disabled:r,"aria-label":"Ninguno",size:"small",title:"Ninguno"},n(Kn,null)),n(wn,{onClick:function(e){f.change(l,{seleccion:[],all:!0,none:!1})},disabled:r,"aria-label":"Todos",size:"small",title:"Todos"},n(Yn,null)),n(wn,{onClick:function(e){return p(!0)},disabled:r,"aria-label":"Selección",size:"small",title:"Selección"},n(Xn,null)))}}))),n(fo,{isOpen:m,title:"Selección de "+o,onConfirm:function(e,n){p(!1),f.change(l,{seleccion:u,all:!1,none:!1})},onClose:g}))},Co=function(e){var r=Mt(e);return!r.hidden&&n(Fe,or({multiline:!0},r.propsContenido))},ko=["tipo"],No=function(e){var r=e.tipo,a=ir(e,ko),o=Mt(a),i=o.propsContenido,l=o.hidden,s=hn(),c=ve({source:e.source}),u=c.input,d=c.meta,m="F"===r||"Z"===r;t(function(){i.value&&(s.change(e.source,i.value),e.disabled&&s.blur(e.source))}),t(function(){m&&""!=u.value&&d.valid&&d.modified&&!d.active&&i.onBlur()},[u.value]);var p=or({},i);return!l&&("N"===r||"D"===r?n(De,p):"F"===r?n(ar,p):"Z"===r?n(tr,p):n(Fe,"H"===r?or({},p,{type:"time"}):p))},So=["tipo","value"],Po=function(e){var r=e.tipo,a=ir(e,So),t=Rt(a),o=t.hidden,i=or({},t.propsContenido);return!o&&("N"===r||"D"===r?n(Me,i):"F"===r?n(Le,i):"Z"===r?n(Le,or({},i,{showTime:!0})):n(Ee,i))};export{cr as AppBar,Ft as BooleanField,Lt as Camino,Bt as CheckBox,zt as ComboBox,jt as ComboBoxManual,wa as CreateEtriek,Oa as DeleteButtonNoWarning,Ea as EditEtriek,Tr as EtrGrid,Ma as EtriekNotification,ha as FichaActions,xa as FichaContext,Ba as FormDialog,ja as FormEtriek,Rr as GE,$r as GrillaEtriek,Gt as ImageField,et as Layout,rt as ListActionsEtriek,Jt as ListCheck,lt as Login,Za as Menu,dt as MenuButton,pt as MultiTextField,Ut as Password,Qt as RadioButton,Yt as RadioButtonManual,ga as Separador,gt as ShowEtriek,Ha as SubMenu,yo as TBSF,St as TabbedFormEtriek,ra as TabbedGrillaEtriek,Co as TextArea,No as TextBox,io as TextBoxSelection,Po as TextField,Na as choicesEstado,ca as dateFormat,ya as dateFormatOptions,ua as dateParser,da as dateTimeFormat,ma as dateTimeParser,Dr as deleteRecargarComboBox,Sa as descargarLink,Pt as enMessages,xt as esMessages,Ca as etrFechaMayorQue,va as etrRequerido,ba as etrRequeridoNumerico,la as getFormcodFromResource,ka as localeOptions,Er as recargarComboBox,Lr as setDisableAction,Mr as setHiddenAction,Br as setRequireAction,Ka as themes,pa as timeFormat,fa as timeParser,jr as useAjax,Mt as useContenidoController,pr as useDeleteRowEtrGrid,Rt as useFieldController,_r as useFormProgress,zr as useGetJson,ta as useInitFicha,ur as useNuevo,Pa as useReferenceLabel,fr as useSaveRowEtrGrid,sa as useStylesContenidos,Ur as useUtils,Hr as useUtilsGrilla,Jr as useUtilsSubmit};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biblio-react",
3
- "version": "1.7.10",
3
+ "version": "1.7.13",
4
4
  "description": "Framework de Metiri hecho en React",
5
5
  "author": "WiXSL",
6
6
  "license": "MIT",