biblio-react 2.0.0-alpha11 → 2.0.0-alpha111
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 +2 -1
- package/dist/index.js.map +1 -0
- package/dist/index.modern.js +2 -1
- package/dist/index.modern.js.map +1 -0
- package/package.json +67 -87
package/dist/index.modern.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import e,{forwardRef as r,createElement as n,useState as o,useMemo as a,Fragment as t,useCallback as i,Children as l,cloneElement as s,createContext as c,useContext as u,useEffect as d,useRef as m}from"react";import p from"@mui/icons-material/Lock";import f from"@mui/icons-material/VpnLock";import{useTranslate as g,useResourceDefinitions as v,MenuItemLink as h,AppBar as b,UserMenu as y,Logout as _,useGetOne as C,useDataProvider as k,useGetList as w,Loading as S,useSafeSetState as x,useNotify as N,Button as T,SaveContextProvider as E,useDeleteWithConfirmController as P,Confirm as L,Form as D,SaveButton as A,useListContext as I,useRedirect as R,useRefresh as O,useUnselectAll as F,useResourceDefinition as M,SimpleList as q,Datagrid as V,EditButton as B,TopToolbar as z,ListButton as j,ShowButton as G,required as U,minValue as W,useResourceContext as H,Create as J,useRecordContext as Y,useDelete as Q,useEditController as Z,Edit as K,SimpleForm as X,useSidebarState as $,Menu as ee,DashboardMenuItem as re,Layout as ne,sanitizeListRestProps as oe,CreateButton as ae,ExportButton as te,useLogin as ie,TextInput as le,PasswordInput as se,FieldTitle as ce,useShowController as ue,Show as de,TabbedFormView as me,defaultTheme as pe,BooleanField as fe,useInput as ge,FileInput as ve,ImageField as he,BooleanInput as be,ReferenceInput as ye,useChoicesContext as _e,SelectInput as Ce,ReferenceArrayInput as ke,SelectArrayInput as we,RadioButtonGroupInput as Se,useRecordSelection as xe,List as Ne,TextField as Te,NumberInput as Ee,DateInput as Pe,DateTimeInput as Le,NumberField as De,DateField as Ae}from"react-admin";import Ie,{string as Re,func as Oe,any as Fe,bool as Me}from"prop-types";import qe from"@mui/icons-material/Add";import Ve from"@mui/icons-material/Cancel";import Be from"@mui/icons-material/Delete";import ze from"@mui/icons-material/Edit";import{alpha as je,createTheme as Ge,StyledEngineProvider as Ue,useMediaQuery as We,CardContent as He,CircularProgress as Je,Stack as Ye,MenuItem as Qe,ListItemIcon as Ze,Typography as Ke,Tooltip as Xe,Collapse as $e,List as er,Paper as rr,Box as nr}from"@mui/material";import or from"@mui/material/Dialog";import ar from"@mui/material/DialogActions";import tr from"@mui/material/DialogContent";import ir from"@mui/material/DialogContentText";import lr from"@mui/material/DialogTitle";import sr from"@mui/material/Paper";import{adaptV4Theme as cr,ThemeProvider as ur,alpha as dr}from"@mui/material/styles";import mr from"@mui/material/Typography";import{makeStyles as pr}from"@mui/styles";import{GridOverlay as fr,esES as gr,DataGrid as vr}from"@mui/x-data-grid";import{useMutation as hr}from"react-query";import{useDispatch as br,useSelector as yr}from"react-redux";import _r from"@mui/material/Divider";import Cr from"@mui/material/Tab";import kr from"@mui/material/Tabs";import wr from"@mui/icons-material/ChevronLeft";import{isAfter as Sr}from"date-fns";import xr from"date-fns/locale/en-US";import Nr from"date-fns/locale/es";import Tr from"@mui/material/IconButton";import Er from"@mui/material/Tooltip";import Pr from"@mui/material/Button";import Lr from"@mui/icons-material/Settings";import Dr from"@mui/icons-material/ExpandMore";import Ar from"@mui/material/Avatar";import Ir from"@mui/material/Card";import Rr from"@mui/material/CardActions";import Or from"@mui/material/CircularProgress";import Fr from"@mui/material/Menu";import Mr from"@mui/material/MenuItem";import qr from"@mui/icons-material/Check";import Vr from"@mui/icons-material/RemoveCircleOutline";import Br from"@mui/icons-material/Search";import zr from"@mui/icons-material/CheckCircle";import jr from"@mui/icons-material/ErrorOutline";import Gr from"react-draggable";import{TreeView as Ur}from"devextreme-react";function Wr(){return(Wr=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function Hr(e,r){if(null==e)return{};var n,o,a={},t=Object.keys(e);for(o=0;o<t.length;o++)r.indexOf(n=t[o])>=0||(a[n]=e[n]);return a}var Jr=r(function(e,r){var o=g(),a=v(),t=a.form_59;return[a.form_275?n(h,{ref:r,key:"/form_275",to:"/form_275",primaryText:o("pos.change_pin"),leftIcon:n(p,null),onClick:e.onClick}):null,t?n(h,{ref:r,key:"/form_59",to:"/form_59",primaryText:o("pos.change_password"),leftIcon:n(f,null),onClick:e.onClick}):null]}),Yr=function(e){return n(y,e,n(Jr,null),n(_,null))},Qr=function(e){return n(b,Wr({},e,{elevation:1,userMenu:n(Yr,null)}))};const Zr=e.createContext(null),Kr=()=>e.useContext(Zr);var Xr=function(e,r){return C(e,{id:"-1"},r)},$r=pr(function(e){return{root:{"& .MuiDataGrid-columnsContainer":{backgroundColor:"light"===e.palette.mode?"#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.mode?"#aeb8c2":"#262626"},"& .ant-empty-img-2":{fill:"light"===e.palette.mode?"#f5f5f7":"#595959"},"& .ant-empty-img-3":{fill:"light"===e.palette.mode?"#dce0e6":"#434343"},"& .ant-empty-img-4":{fill:"light"===e.palette.mode?"#ffffff":"#1c1c1c"},"& .ant-empty-img-5":{fillOpacity:"light"===e.palette.mode?"0.8":"0.08",fill:"light"===e.palette.mode?"#f5f5f5":"#ffffff"}},label:{marginTop:e.spacing(1)},deleteButton:{color:e.palette.error.main,"&:hover":{backgroundColor:je(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}},{name:"GE"}),en=function(){var e=$r();return n(fr,{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"))},rn=function(e,r,n){var o=k(),a=hr(function(){return o.deleteEtrRow(e,{params:r})},n);return{mutate:a.mutate,isLoading:a.isLoading}},nn=function(e,r,n,o){var a=k(),t=hr(function(){return a[e](r,{params:n})},o);return{mutate:t.mutate,isLoading:t.isLoading}},on=["api","classes","className","confirmTitle","confirmContent","icon","record","redirect","onSuccess","onError","source","camposClaveFila"],an=["filterBy","claves","sortModel","columns","reference","allowAdd","allowRemove","etrResource","enableLoad"],tn=pr(function(e){return{root:{"& .MuiDataGrid-columnsContainer":{backgroundColor:"light"===e.palette.mode?"#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.mode?"#aeb8c2":"#262626"},"& .ant-empty-img-2":{fill:"light"===e.palette.mode?"#f5f5f7":"#595959"},"& .ant-empty-img-3":{fill:"light"===e.palette.mode?"#dce0e6":"#434343"},"& .ant-empty-img-4":{fill:"light"===e.palette.mode?"#ffffff":"#1c1c1c"},"& .ant-empty-img-5":{fillOpacity:"light"===e.palette.mode?"0.8":"0.08",fill:"light"===e.palette.mode?"#f5f5f5":"#ffffff"}},label:{marginTop:e.spacing(1)},deleteButton:{color:e.palette.error.main,"&:hover":{backgroundColor:je(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}},{name:"EtrGrid"}),ln={marginLeft:"1.6rem",fontWeight:"bold"},sn=n(Be,null),cn=function(e){var r=e.confirmTitle,o=void 0===r?"ra.message.delete_title":r,a=e.confirmContent,l=void 0===a?"ra.message.delete_content":a,s=e.icon,c=void 0===s?sn:s,u=e.record,d=e.redirect,m=void 0!==d&&d,p=e.onSuccess,f=e.onError,g=e.source,v=e.camposClaveFila,h=Hr(e,on),b=tn(e),y=N(),_=P({record:u,redirect:m,mutationOptions:{onSuccess:p,onError:f}}),C=_.open,k=_.isLoading,w=_.handleDialogOpen,S=_.handleDialogClose,x=rn(e.resource,{},{refresh:!0,onSuccess:function(e){if(e.error)throw new Error(e.error);y("ra.notification.deleted",{type:"info",messageArgs:{smart_count:1}})},onError:function(e){y(e.message,{type:"warning"})}}).mutate,E=Object.keys(u).filter(function(e){return v.split(",").includes(e)}).reduce(function(e,r){return e[r]=u[r],e},{}),D=i(function(e){x({payload:{ge:g,clavesFila:E}})},[u]);return n(t,null,n(T,Wr({key:"button",onClick:w,className:b.deleteButton},h),c),n(L,{isOpen:C,loading:k,title:o,content:l,onConfirm:D,onClose:S}))},un=function(e){return n(or,{open:e.open,onClose:e.onClose,fullWidth:!0},n(lr,null,e.labelEstado+" "+e.label),n(ir,null,n(mr,{component:"span",display:"block",variant:"subtitle1",style:Wr({},ln)},e.msgTitle),e.msgDesc),n(D,{resource:e.resource,onSubmit:e.onSubmit,defaultValues:e.defaultValues},e.children))};un.propTypes={label:Re,onClick:Oe,icon:Fe,open:Me,onClose:Oe,labelEstado:Re,msgTitle:Fe,msgDesc:Fe,resource:Fe,save:Oe,render:Oe};var dn=function(e){return n(cn,{api:!0,confirmTitle:"ra.action.delete",source:e.source,record:e.row,resource:e.resource,camposClaveFila:e.camposClaveFila})},mn=function(r){var o=r.resource,a=r.estado,i=r.editors,c=r.recordPadre,u=r.camposClaveFila,d=r.setOpen,m=r.isLoading,p=function(r){const n=Kr(),{control:o=n.control,disabled:a,name:t,exact:i}={},[l,s]=e.useState(o._formState),c=e.useRef({isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),u=e.useRef(t),d=e.useRef(!0);return u.current=t,function(r){const n=e.useRef(r);n.current=r,e.useEffect(()=>{const e=!r.disabled&&n.current.subject.subscribe({next:n.current.callback});return()=>(e=>{e&&e.unsubscribe()})(e)},[r.disabled])}({disabled:a,callback:e.useCallback(e=>d.current&&((e,r,n)=>{return n&&r?e===r:!e||!r||e===r||(o=e,Array.isArray(o)?o:[o]).some(e=>e&&(e.startsWith(r)||r.startsWith(e)));var o})(u.current,e.name,i)&&((e,r,n)=>{const{...o}=e;return(e=>!(e=>null==e)(e)&&!Array.isArray(e)&&(e=>"object"==typeof e)(e)&&!(e=>e instanceof Date)(e))(a=o)&&!Object.keys(a).length||Object.keys(o).length>=Object.keys(r).length||Object.keys(o).find(e=>!0===r[e]);var a})(e,c.current)&&s({...o._formState,...e}),[o,i]),subject:o._subjects.state}),e.useEffect(()=>(d.current=!0,()=>{d.current=!1}),[]),((e,r,n,o=!0)=>{const a={};for(const t in e)Object.defineProperty(a,t,{get:()=>{const a=t;return"all"!==r[a]&&(r[a]=!o||"all"),n&&(n[a]=!0),e[a]}});return a})(l,o._proxyFormState,c.current,!1)}(),f=p.isDirty,g=p.isValid;return n(t,null,n(tr,null,l.map(i,function(e,r){return s(e,{resource:o,estado:a,initialValue:c[e.props.source],fullWidth:!0,disabled:void 0!==e.props.disabled?e.props.disabled:"N"!==a&&-1!==u.indexOf(e.props.source),InputLabelProps:{shrink:!0}})})),n(ar,null,n(A,{disabled:!f||!g}),n(T,{label:"ra.action.cancel",onClick:function(e){d(!1),e.stopPropagation()},disabled:m},n(Ve,null))))},pn=function(e){var r=e.editors,o=e.record,i=e.clavesFila,l=e.camposClaveFila,s=e.resource,c=e.label,u=e.source,d=e.etrResource,m=x(!1),p=m[0],f=m[1],v=Xr(d,{enabled:p}).data,h=nn("createEtrRow",s,{},{refresh:!0,onSuccess:function(e){if(e.error)throw new Error(e.error);f(!1),_("ra.notification.created",{type:"info"})},onError:function(e){_(e.message,{type:"warning"})}}),b=h.mutate,y=h.isLoading,_=N(),C=g()("ra.action.create"),k=function(e){b({payload:{data:Wr({},e,i),ge:u,camposClaveFila:l,estado:"N"}})},w=a(function(){return{save:k,setOnFailure:function(e){return console.log(e)}}},[k]);return n(t,null,n(T,{onClick:function(e){f(!0),e.stopPropagation()}},n(qe,null)),n(E,{value:w},n(un,{open:p,onClose:function(e){f(!1),e.stopPropagation()},labelEstado:C,label:c,msgTitle:e.msgTitle,msgDesc:e.msgDesc,resource:s,onSubmit:k,defaultValues:v},n(mn,{resource:s,estado:"N",editors:r,recordPadre:o,camposClaveFila:l,isLoading:y,setOpen:function(){f(!1)}}))))},fn=function(e){var r=e.editors,o=e.clavesFila,a=e.camposClaveFila,i=e.resource,l=e.label,s=e.source,c=e.row,u=N(),d=g(),m=x(!1),p=m[0],f=m[1],v=nn("updateEtrRow",i,{},{refresh:!0,onSuccess:function(e){if(e.error)throw new Error(e.error);f(!1),u("ra.notification.updated",{type:"info",messageArgs:{smart_count:1}})},onError:function(e){u(e.message,{type:"warning"})}}),h=v.mutate,b=v.isLoading,y=d("ra.action.edit");return n(t,null,n(T,{onClick:function(e){f(!0),e.stopPropagation()}},n(ze,null)),n(un,{open:p,onClose:function(e){f(!1),e.stopPropagation()},labelEstado:y,label:l,msgTitle:e.msgTitle,msgDesc:e.msgDesc,resource:i,onSubmit:function(e){h({payload:{data:Wr({},o,e),ge:s,camposClaveFila:a,estado:"M"}})}},n(mn,{resource:i,estado:"M",editors:r,recordPadre:c,camposClaveFila:a,isLoading:b,setOpen:function(){f(!1)}})))},gn=Ge(cr({},gr)),vn=function(e){var r=e.filterBy,t=void 0===r?"":r,i=e.claves,l=e.sortModel,s=e.columns,c=e.reference,u=e.allowAdd,d=void 0===u||u,m=e.allowRemove,p=void 0===m||m,f=e.etrResource,g=e.enableLoad,v=void 0===g||g,h=Hr(e,an),b=e.record,y=tn(e),_=o(l)[1],C=l[0],k=C.field,x=C.sort,N=Object.keys(b).filter(function(e){return i.split(",").includes(e)}).reduce(function(e,r){return e[r]=b[r],e},{}),T={};t.split(",").forEach(function(e){e&&(T[e]=[{type:"string",comparison:"eq",value:b[e],field:e}])});var E=w(c,{page:1,perPage:200},{field:k,order:x},T,{enabled:v}),P=E.data,L=E.isLoading,D=a(function(){return P.map(function(e){return e.id})},[P]),A=[d?{field:"BTN",headerName:"",sortable:!1,renderHeader:function(e){return n(pn,Wr({},h,{etrResource:f,camposClaveFila:i,clavesFila:N,api:e.api}))}}:{}].concat(s,[{field:" ",width:80,headerName:"",headerAlign:"center",sortable:!1,disableClickEventBubbling:!0,renderCell:function(e){return n(fn,Wr({},h,{camposClaveFila:i,clavesFila:N,api:e.api,row:e.row}))}},p?{field:" ",headerName:"",headerAlign:"center",sortable:!1,disableClickEventBubbling:!0,renderCell:function(e){return n(dn,Wr({},h,{camposClaveFila:i,api:e.api,row:e.row}))}}:{}]),I=a(function(){return A},[JSON.stringify(A)]);return L?n(S,null):n(sr,{className:y.rootPaper},n(Ue,{injectFirst:!0},n(ur,{theme:gn},n(vr,Wr({className:y.root,disableSelectionOnClick:!0,pageSize:50,hideFooter:!0,sortModel:l,rows:D,columns:I,onSortModelChange:function(e){return _(e)},components:{NoRowsOverlay:en}},h)))))},hn=["filterBy","sortModel","columns","reference","filter","enableLoad"],bn=Ge(cr({},gr)),yn=function(e){var r=e.filterBy,t=void 0===r?"":r,i=e.sortModel,l=e.columns,s=e.reference,c=e.filter,u=void 0===c?[]:c,d=e.enableLoad,m=void 0===d||d,p=Hr(e,hn),f=e.record,g=$r(e),v=o(i),h=v[0],b=v[1],y=i[0],_=y.field,C=y.sort,k=a(function(){return[].concat(l)},[JSON.stringify(l)]),x=[];t.split(",").forEach(function(e){e&&x.push({type:"string",comparison:"eq",value:f[e],field:e})});var N=Wr({},x.concat(u)),T=w(s,{page:1,perPage:200},{field:_,order:C},N,{enabled:m}),E=T.data,P=T.isLoading,L=a(function(){return E.map(function(e){return e.id})},[E]);return P?n(S,null):n(sr,{className:g.rootPaper},n(Ue,{injectFirst:!0},n(ur,{theme:bn},n(vr,Wr({className:g.root,disableSelectionOnClick:!0,pageSize:50,hideFooter:!0,rows:L,columns:k,sortModel:h,onSortModelChange:function(e){return b(e)},components:{NoRowsOverlay:en}},p)))))},_n=c(),Cn=function(e){var r=e.children,t=o(!1),i=t[0],l=t[1],s=a(function(){return{open:i,show:function(){return l(!0)},hide:function(){return l(!1)}}},[i]);return n(_n.Provider,{value:s},r)},kn=function(){return u(_n)},wn=function(e,r,n,o){return{type:"RELOAD_CB",payload:{id:e,method:r,params:n,callback:o}}},Sn=function(e,r){return{type:"RELOAD_CB_SUCCESS",payload:{id:e,callback:r}}},xn=function(e,r){return{type:"HIDE_INPUT",payload:{id:e,hidden:r}}},Nn=function(e,r){return{type:"DISABLE_INPUT",payload:{id:e,disabled:r}}},Tn=function(e,r){return{type:"REQUIRE_INPUT",payload:{id:e,required:r}}},En=function(){var e=br();return i(function(r,n,o,a){e(wn(r,n,o,a))},[e])},Pn=function(){var e=br();return i(function(r,n){e(xn(r,n))},[e])},Ln=function(){var e=br();return i(function(r,n){e(Nn(r,n))},[e])},Dn=function(){var e=br();return i(function(r,n){e(Tn(r,n))},[e])},An=function(e,r,n,o){var a=k(),t=hr(function(){return a.getJson(e,{method:r,params:n})},o);return{mutate:t.mutate,isLoading:t.isLoading}},In=function(e){var r=An(e),n=r.mutate,o=r.isLoading;return[i(function(e,r,o){return n({payload:{params:r,method:e}},{returnPromise:!0,onSuccess:o,onError:o})},[]),o]},Rn=function(e){return{}},On=function(e){var r=I(e),n=N(),o=R(),a=O(),t=F(e.resource);return{ajax:In(e.resource)[0],data:r,notify:n,redirect:o,refresh:a,unselectAll:t}},Fn=function(e){var r=En(),n=Pn(),o=Ln(),a=Dn(),t=kn(),i=N(),l=R();return{ajax:In(e.resource)[0],notify:i,redirect:l,recargarComboBox:r,progress:t,setHidden:n,setDisable:o,setRequire:a}},Mn=function(e){var r=En(),n=Pn(),o=Ln(),a=Dn(),t=kn(),i=N(),l=R();return{form:Kr(),ajax:In(e.resource)[0],notify:i,redirect:l,recargarComboBox:r,progress:t,setHidden:n,setDisable:o,setRequire:a}},qn=["isRowEditable"],Vn=["isRowEditable","primaryText","secondaryText","desktopSize","onRenderGrilla","onLoadGrilla","hasEdit"],Bn=function(e,r){return void 0===r||"function"==typeof r&&r(e)},zn=function(e){var r=e.isRowEditable,o=Hr(e,qn);return Bn(e.record,r)?n(B,o):null},jn=function(e){!function(e){var r=e.onRenderGrilla,n=e.onLoadGrilla,o=I().isLoading,a=On(e);d(function(){r&&r(a)},[]),d(function(){o||n&&n(a)},[o])}(e);var r=We(function(e){return e.breakpoints.down("md")}),o=M(e).hasEdit,a=e.isRowEditable,t=e.primaryText,i=e.secondaryText,s=e.desktopSize,c=void 0!==s&&s,u=Hr(e,Vn),m=e.children,p=l.count(e.children),f=t,g=i;return t||(p>=4||p>=3||p>=2?f=function(e){return e[m[0].props.source]+" - "+e[m[1].props.source]}:1===p&&(f=function(e){return e[m[0].props.source]})),i||(p>=4?g=function(e){return e[m[2].props.source]+" - "+e[m[3].props.source]}:p>=3?g=function(e){return e[m[2].props.source]}:p>=2?f=function(e){return e[m[0].props.source]+" - "+e[m[1].props.source]}:1===p&&(f=function(e){return e[m[0].props.source]})),r&&!1===c?n(q,{linkType:function(e){return!(!o||!Bn(e,a))&&"edit"},primaryText:f,secondaryText:g}):n(V,u,l.map(m,function(e){return e.props.hidden?null:e}),o&&n(zn,{isRowEditable:a}))},Gn=["ids"],Un=["filterValues","setFilters","tabs","GridComponent"],Wn=function(e){var r=e.filterValues,o=e.setFilters,a=e.tabs,i=a.ids,l=Hr(a,Gn),s=e.GridComponent,c=void 0===s?jn:s,u=Hr(e,Un),d=r.id;return n(t,null,n(kr,{value:d,indicatorColor:"primary",onChange:function(e,n){o(Wr({},r,{id:n}))}},i.map(function(e){return n(Cr,{key:e,label:e.charAt(0).toUpperCase()+e.slice(1),value:e})})),n(_r,null),n(c,Wr({},u,l[d])))},Hn=["useFormulario"],Jn=function(e){var r=e.useFormulario;return{fichaProps:(void 0===r?Rn:r)(Hr(e,Hn))}},Yn=["className","record","hasEdit","hasShow","hasList","resource","totalPages","showFilter","setSort","setPerPage","perPage","defaultTitle","setPage","setFilters","selectedIds","onUnselectItems","onToggleItem","isLoading","exporter","hideFilter","hasCreate","filterValues","displayedFilters","currentSort"],Qn=["children","className","data","hasShow","hasList"],Zn=function(e){return e.split("_")[1]},Kn=pr(function(e){var r;return{form:{maxHeight:"70vh",overflow:"auto"},tab:{display:"block",maxHeight:"65vh",overflow:"auto"},contenido:(r={},r[e.breakpoints.up("md")]={width:"20vw"},r)}}),Xn=function(e,r){if(!e)return"";if(e instanceof Date)return e.toString();if(-1!==e.indexOf("/")){var n=e.split("/");return new Date(parseInt(n[2],10),parseInt(n[1],10)-1,parseInt(n[0],10)).toString()}var o=/(\d{4})-(\d{2})-(\d{2})/.exec(e);if(null!==o){var a=new Date(parseInt(o[1],10),parseInt(o[2],10)-1,parseInt(o[3],10));if(!isNaN(a))return a.toString()}},$n=function(e,r){if(!e)return"";var n=e.split(" "),o="";switch(n[1]){case"Jan":o="01";break;case"Feb":o="02";break;case"Mar":o="03";break;case"Apr":o="04";break;case"May":o="05";break;case"Jun":o="06";break;case"Jul":o="07";break;case"Aug":o="08";break;case"Sep":o="09";break;case"Oct":o="10";break;case"Nov":o="11";break;case"Dec":o="12"}return n[2]+"/"+o+"/"+n[3]},eo=function(e){if(!e)return"";if(e instanceof Date)return e.toString();if(-1!==e.indexOf("/")){var r=e.split("/");return new Date(parseInt(r[2].substr(0,4),10),parseInt(r[1],10)-1,parseInt(r[0],10),r[2].substr(5,2),r[2].substr(8,2)).toString()}var n=/(\d{4})-(\d{2})-(\d{2})\s(\d{2}):(\d{2})/.exec(e);if(null!==n){var o=new Date(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10),n[4],n[5]);if(!isNaN(o))return o.toString()}},ro=function(e,r){if(!e)return"";var n=e.split(" "),o="";switch(n[1]){case"Jan":o="01";break;case"Feb":o="02";break;case"Mar":o="03";break;case"Apr":o="04";break;case"May":o="05";break;case"Jun":o="06";break;case"Jul":o="07";break;case"Aug":o="08";break;case"Sep":o="09";break;case"Oct":o="10";break;case"Nov":o="11";break;case"Dec":o="12"}return n[2]+"/"+o+"/"+n[3]+" "+n[4].substr(0,5)},no=function(e){if(!e)return"";if(e instanceof Date)return e.toString();if(-1!==e.indexOf(":")){var r=e.split(":"),n=new Date;return n.setHours(r[0]),n.setMinutes(r[1]),n.toString()}var o=/(\d{2}):(\d{2})/.exec(e);if(null!==o){var a=new Date;return a.setHours(o[0]),a.setMinutes(o[1]),a.toString()}},oo=function(e,r){return e?e.split(" ")[4].substring(0,5):""},ao=function(e){return n(mr,{variant:"h6",gutterBottom:!0},e.children)},to=function(e){var r=e.children,o=e.className,a=e.data,t=e.hasShow,i=e.hasList,l=void 0===i||i,s=Hr(e,Qn);return n(z,Wr({className:o},Hr(s,Yn)),r,l&&n(j,{label:"ra.action.back",icon:n(wr,null)}),t&&n(G,{record:a}))},io=U(),lo=[io,W(1)],so={format:"dd/MM/yyyy"},co=function(e){return function(r,n){var o=n[e];if(r&&o){var a=new Date(o),t=new Date(r);if(Sr(a,t))return{message:"validation.greater_or_equal",args:{menor:o}}}}},uo=function(e){return void 0===e&&(e="es"),{locale:"en"===e?xr:Nr}},mo=[{id:"1",name:"Aprobado"},{id:"2",name:"Rechazado"},{id:"3",name:"Pendiente"}],po=function(e,r){var n=document.createElement("a");n.style.display="none",document.body.appendChild(n),n.setAttribute("href",e),n.setAttribute("download",r),n.click()},fo=function(e,r){var n=H(),o=C("cb_"+Zn(n)+"_"+e,{id:r}),a=o.data;return o.isLoading||o.error?"":(null==a?void 0:a.etiqueta)||""},go=c({}),vo=["useFormulario","enableLoad"],ho=function(e){var r=e.enableLoad,o=void 0===r||r,t=Hr(e,vo),i=H(e),l=Xr(i,{enabled:o}),s=l.data,c=l.isLoading,u=Jn(e).fichaProps,d=a(function(){return{estado:"N",initialValues:s,isLoading:c,fichaProps:u}},[s,c,u]);return n(Cn,null,n(go.Provider,{value:d},n(J,Wr({},t,null==u?void 0:u.panel))))};function bo(e){var r,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e))for(r=0;r<e.length;r++)e[r]&&(n=bo(e[r]))&&(o&&(o+=" "),o+=n);else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function yo(){for(var e,r,n=0,o="";n<arguments.length;)(e=arguments[n++])&&(r=bo(e))&&(o&&(o+=" "),o+=r);return o}ho.propTypes={useFormulario:Ie.func};var _o=["classes","filterValues","handleSubmit","invalid","label","pristine","resource","saving","selectedIds","redirect"],Co=["resource","redirect","className","icon","label"],ko=pr(function(e){return{deleteButton:{color:e.palette.error.main,"&:hover":{backgroundColor:dr(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}}),wo=function(e){var r=ko(e),o=g(),a=e.resource,t=e.className,i=e.icon,l=e.label,s=void 0===l?"ra.action.delete":l,c=Hr(e,Co),u=Y(),d=Q(a,{id:u.id}),m=d[0],p=d[1].isLoading;return n(Er,{title:o("ra.action.delete")},n(Tr,Wr({disabled:p,onClick:function(){return m()},label:s,className:yo("ra-delete-button",r.deleteButton,t),key:"button"},Hr(c,_o),{size:"large"}),i))};wo.defaultProps={redirect:"list",icon:n(Be,null)};var So=["useFormulario"],xo=function(e){var r=Hr(e,So),o=Z(r),t=o.record,i=o.isLoading,l=Jn(e).fichaProps,s=a(function(){return{estado:"M",initialValues:t,isLoading:i,fichaProps:l}},[t,i,l]);return n(Cn,null,n(go.Provider,{value:s},n(K,Wr({},r,null==l?void 0:l.panel))))},No=pr(function(e){return{button:{margin:e.spacing(1)},input:{display:"none"}}}),To=r(function(e,r){var o=e.isOpen,a=e.onConfirm,t=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.isLoading,f=void 0!==p&&p,g=No(e),v=function(e){t&&t(e)};return n(or,{ref:r,open:o,fullWidth:!0,onClose:v,"aria-labelledby":"form-dialog-title"},n(lr,{id:"form-dialog-title"},i),n(tr,null,n(ir,null,l),s),(u||m)&&n(ar,null,m&&n(Pr,{onClick:v,variant:"contained",color:"secondary",className:g.button,disabled:f},"Cancelar"),u&&n(Pr,{onClick:function(e){a&&a(e)},variant:"contained",color:"primary",className:g.button,disabled:f},"Ok")))}),Eo=["children","className","component","defaultValues","onSubmit","record","resource","reValidateMode","sx","toolbar","validate","resolver","warnWhenUnsavedChanges"],Po=pr(function(e){return{block:{pointerEvents:"none",backgroundColor:"#ffffff",opacity:.6,position:"relative"},progress:{position:"absolute",left:"50%",top:"50%"}}}),Lo=function(e){var r=Po(e),o=kn(),a=H(e),t=u(go),i=t.estado,l=t.isLoading,s=t.initialValues,c=t.fichaProps,m=Mn({resource:a});return d(function(){c.onRenderFicha&&c.onRenderFicha(m,i)},[]),d(function(){l||c.onLoadFicha&&c.onLoadFicha(m,i,s)},[l]),n(He,{className:o.open?r.block:"",sx:e.sx},o.open&&n(Je,{className:r.progress,thickness:4,size:50}),n(Ye,Wr({alignItems:"flex-start"},Hr(e,Eo)),e.children))},Do=function(e){var r=u(go),o=r.initialValues,a=r.fichaProps,t=a.onBeforeSubmitFicha,l=a.config,s=void 0===l?{}:l,c=Fn(e),d=N(),m=i(function(r){var n=t&&t(Wr({form:{values:r}},c),"N");return"string"==typeof n?void d(n,{type:"warning"}):void 0===n||n?e.onSubmit(r):void 0},[t,c]);return n(D,Wr({},e,s,{onSubmit:m,defaultValues:o}),n(Lo,null))};Do.propTypes=Wr({},X.propTypes);var Ao=function(e){var r=e.handleToggle,o=e.isOpen,a=e.name,t=e.icon,i=e.children,l=e.dense,s=g(),c=$()[0],u=n(Qe,{dense:l,onClick:r},n(Ze,{sx:{minWidth:5}},o?n(Dr,null):t),n(Ke,{variant:"inherit",color:"textSecondary"},s(a)));return n("div",null,c||o?u:n(Xe,{title:s(a),placement:"right"},u),n($e,{in:o,timeout:"auto",unmountOnExit:!0},n(er,{dense:l,component:"div",disablePadding:!0,sx:{"& a":{transition:"padding-left 195ms cubic-bezier(0.4, 0, 0.6, 1) 0ms",paddingLeft:c?4:2}}},i)))},Io=["items","translate"],Ro={marginTop:"1.5em"},Oo=function(e){var r=e.onMenuClick,a=e.dense,i=e.logout,l=g(),s=o({mnuPrueba:!1}),c=s[0],u=s[1],d=We(function(e){return e.breakpoints.down("md")}),m=We(function(e){return e.breakpoints.down("sm")}),p=$()[0],f=function e(r){var o=r.items,a=r.translate,i=Hr(r,Io),l=i.state,s=i.onMenuClick,c=i.handleToggle,u=i.dense,d=i.open;return o&&n(t,null,o.map(function(r){var o=r.name,t=r.menu,m=r.label;return t?n(Ao,{key:o,name:m,handleToggle:function(){return c(o)},isOpen:l[o],sidebarIsOpen:d,icon:n(Lr,null),dense:u},e(Wr({items:t,translate:a},i))):n(h,{key:o,to:"/"+o,primaryText:a("resources."+o+".name",{_:m}),onClick:s,sidebarIsOpen:d,dense:u,leftIcon:n(Lr,null)})}))}({items:JSON.parse(localStorage.getItem("menus")),handleToggle:function(e){u(function(r){var n;return Wr({},r,((n={})[e]=!r[e],n))})},state:c,activeClassName:"",iconClass:"",className:"",open:p,dense:a,onMenuClick:r,translate:l});return n(ee,{style:Ro},n(re,{primaryText:l("ra.page.dashboard"),onClick:r,sidebarIsOpen:p}),f,m&&n(h,{to:"/configuration",primaryText:l("pos.configuration"),leftIcon:n(Lr,null),onClick:r,sidebarIsOpen:p,dense:a}),m&&i,!m&&d&&i)},Fo=function(e){return n(ne,Wr({},e,{appBar:Qr,menu:Oo}))},Mo=["className","exporter","filters","children","jsBotonGrilla"],qo=function(e){var r=e.className,o=e.exporter,t=e.filters,i=e.children,c=e.jsBotonGrilla,u=Hr(e,Mo),d=On(e).utils,m=I(e),p=H(u),f=M(u).hasCreate,g=m.currentSort,v=m.displayedFilters,h=m.filterValues,b=m.selectedIds,y=m.showFilter,_=m.total,C=Wr({},d,m);return a(function(){return n(z,Wr({className:r},oe(u)),t&&s(t,{resource:p,showFilter:y,displayedFilters:v,filterValues:h,context:"button"}),f&&n(ae,null),!1!==o&&n(te,{disabled:0===_,resource:p,sort:g,filterValues:h}),l.map(i,function(e,r){return s(e,{onClick:e.props.options?null:function(r){return c(C,e.key)},options:e.props.options?e.props.options.map(function(e){return Wr({},e,{onClick:function(r){return c(C,e.key)}})}):null})}))},[p,v,h,b,t,_])};"production"!==process.env.NODE_ENV&&(c(null).displayName="Navigation");const Vo=c(null);function Bo(e,r){if(!e)throw new Error(r)}"production"!==process.env.NODE_ENV&&(Vo.displayName="Location"),"production"!==process.env.NODE_ENV&&(c({outlet:null,matches:[]}).displayName="Route");var zo=pr(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(r){return{position:"absolute",left:e.spacing(14-Math.ceil(r.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"}}}),jo=function(e){var r=e.loginBackgroundImage,a=e.nameSource,t=void 0===a?"username":a,i=e.passwordSource,l=void 0===i?"password":i,s=o(!1),c=s[0],d=s[1],m=g(),f=m("ra.auth.sign_in"),v=zo({loginBackgroundImage:r,textLength:f.length}),h=N(),b=ie(),y=(null==u(Vo)&&("production"!==process.env.NODE_ENV?Bo(!1,"useLocation() may be used only in the context of a <Router> component."):Bo(!1)),u(Vo).location);return n(D,{onSubmit:function(e){d(!0),b(e,y.state?y.state.nextPathname:"/").catch(function(e){d(!1),h("string"==typeof e?e:void 0!==e&&e.message?e.message:"ra.auth.sign_in_error",{type:"warning",messageArgs:{_:"string"==typeof e?e:e&&e.message?e.message:void 0}})})},validate:function(e){var r={};return e[t]||(r[t]=m("ra.validation.required")),e[l]||(r[l]=m("ra.validation.required")),r}},n("div",{className:v.main},n(Ir,{className:v.card},n("div",{className:v.avatar},n(Ar,{className:v.avatarIcon},n(p,null))),n("div",{className:v.hint},"Inicio de Sesión"),n("div",{className:v.form},n("div",{className:v.input},n(le,{autoFocus:!0,name:t,label:m("ra.auth.username"),disabled:c})),n("div",{className:v.input},n(se,{name:l,label:m("ra.auth.password"),type:"password",disabled:c}))),n(Rr,{className:v.actions},n(Pr,{variant:"contained",type:"submit",color:"primary",disabled:c,fullWidth:!0},c&&n(Or,{className:v.icon,size:18,thickness:2}),f)))))},Go=["displayedFilters","filterValues","showFilter"],Uo=["className","options","icon","label","disabled"],Wo=pr({root:{display:"inline-block"},paddingRight:{paddingRight:4}}),Ho=function(e){var r,a=e.className,t=e.options,i=void 0===t?[]:t,l=e.icon,s=e.label,c=e.disabled,u=Hr(e,Uo),d=o(!1),p=d[0],f=d[1],g=m(),v=o(0),h=v[0],b=v[1],y=Wo(e),_=H(e);return n("div",Wr({className:yo(y.root,a)},Hr(u,Go)),n(T,{className:"add-filter",label:s,onClick:function(e){e.preventDefault(),f(!0),g.current=e.currentTarget},title:i[h].label,disabled:c},(null===(r=i[h])||void 0===r?void 0:r.icon)||l),n(Fr,{open:p,anchorEl:g.current,onClose:function(e){g.current&&g.current.contains(e.target)||f(!1)}},i.map(function(e,r){return n(Mr,{key:e.label,disabled:e.disabled,selected:r===h,onClick:function(n){!function(e,r){b(r),f(!1)}(0,r),e.onClick&&e.onClick(n,r)},resource:_,title:e.label},e.icon,n("span",{className:y.paddingRight}),n(ce,{label:e.label,resource:_}))})))},Jo=["fields","className","textAlign","sortable"],Yo=function(e){var r=e.fields,o=e.className,a=Hr(e,Jo),t=r.campos,i=r.separador,l=void 0===i?"":i,s=r.secundario,c=void 0===s?[]:s,u=r.hasSecundario,d=Y(),m=t.map(function(e){return void 0!==d[e]?d[e]:e}).join(""+l);return n(mr,Wr({noWrap:!0,variant:"inherit",className:o},a),m,u&&n(mr,{component:"span",display:"block",color:"textSecondary",variant:"caption"},c.map(function(e){return(e.etiqueta||"---")+": "+(d[e.campo]||"---")}).join(" ")))},Qo=["useFormulario"],Zo=function(e){var r=Hr(e,Qo),o=ue(r),t=o.record,i=o.isLoading,l=Jn(e).fichaProps,s=a(function(){return{estado:"M",initialValues:t,isLoading:i,fichaProps:l}},[t,i,l]);return n(Cn,null,n(go.Provider,{value:s},n(de,Wr({},r,o,null==l?void 0:l.panel))))},Ko=function(e){var r=u(go),o=r.initialValues,a=r.fichaProps,t=a.onBeforeSubmitFicha,l=a.config,s=void 0===l?{}:l,c=Fn(e),d=N(),m=i(function(r){var n=t&&t(Wr({form:{values:r}},c),"N");return"string"==typeof n?void d(n,{type:"warning"}):void 0===n||n?e.onSubmit(r):void 0},[t,c]);return n(D,Wr({},e,s,{onSubmit:m,defaultValues:o}),n(me,{component:Lo}))};Ko.defaultProps={syncWithLocation:!1};var Xo=Wr({},pe,{palette:Wr({},pe.palette,{mode:"dark"}),components:Wr({},pe.components,{RaSidebar:{root:{drawerPaper:{position:"sticky"}}},RaRichTextInput:{root:{"@global":{".ra-rich-text-input":{"& .ql-editor":{"& p:not(:last-child)":{marginBottom:"0"}}}}}}})}),$o={__proto__:null,lightTheme:Wr({},pe,{palette:Wr({},pe.palette,{mode:"light"}),components:Wr({},pe.components,{RaSidebar:{root:{drawerPaper:{position:"sticky"}}},RaRichTextInput:{root:{"@global":{".ra-rich-text-input":{"& .ql-editor":{"& p:not(:last-child)":{marginBottom:"0"}}}}}}})}),darkTheme:Xo},ea={ra:{action:{add_filter:"Add filter",add:"Add",back:"Go Back",bulk_actions:"1 item selected |||| %{smart_count} items selected",cancel:"Cancel",clear_input_value:"Clear value",clone:"Clone",confirm:"Confirm",create:"Create",create_item:"Create %{item}",delete:"Delete",edit:"Edit",export:"Export",list:"List",refresh:"Refresh",remove_filter:"Remove this filter",remove:"Remove",save:"Save",search:"Search",select_all:"Select all",select_row:"Select this row",show:"Show",sort:"Sort",undo:"Undo",unselect:"Unselect",expand:"Expand",close:"Close",open_menu:"Open menu",close_menu:"Close menu",update:"Update",move_up:"Move up",move_down:"Move down",open:"Open",toggle_theme:"Toggle Theme"},boolean:{true:"Yes",false:"No",null:" "},page:{create:"Create %{name}",dashboard:"Dashboard",edit:"%{name} #%{id}",error:"Something went wrong",list:"%{name}",loading:"Loading",not_found:"Not Found",show:"%{name} #%{id}",empty:"No %{name} yet.",invite:"Do you want to add one?"},input:{file:{upload_several:"Drop some files to upload, or click to select one.",upload_single:"Drop a file to upload, or click to select it."},image:{upload_several:"Drop some pictures to upload, or click to select one.",upload_single:"Drop a picture to upload, or click to select it."},references:{all_missing:"Unable to find references data.",many_missing:"At least one of the associated references no longer appears to be available.",single_missing:"Associated reference no longer appears to be available."},password:{toggle_visible:"Hide password",toggle_hidden:"Show password"}},message:{about:"About",are_you_sure:"Are you sure?",bulk_delete_content:"Are you sure you want to delete this %{name}? |||| Are you sure you want to delete these %{smart_count} items?",bulk_delete_title:"Delete %{name} |||| Delete %{smart_count} %{name}",bulk_update_content:"Are you sure you want to update this %{name}? |||| Are you sure you want to update these %{smart_count} items?",bulk_update_title:"Update %{name} |||| Update %{smart_count} %{name}",delete_content:"Are you sure you want to delete this item?",delete_title:"Delete %{name} #%{id}",details:"Details",error:"A client error occurred and your request couldn't be completed.",invalid_form:"The form is not valid. Please check for errors",loading:"The page is loading, just a moment please",no:"No",not_found:"Either you typed a wrong URL, or you followed a bad link.",yes:"Yes",unsaved_changes:"Some of your changes weren't saved. Are you sure you want to ignore them?"},navigation:{no_results:"No results found",no_more_results:"The page number %{page} is out of boundaries. Try the previous page.",page_out_of_boundaries:"Page number %{page} out of boundaries",page_out_from_end:"Cannot go after last page",page_out_from_begin:"Cannot go before page 1",page_range_info:"%{offsetBegin}-%{offsetEnd} of %{total}",partial_page_range_info:"%{offsetBegin}-%{offsetEnd} of more than %{offsetEnd}",current_page:"Page %{page}",page:"Go to page %{page}",first:"Go to first page",last:"Go to last page",next:"Go to next page",previous:"Go to previous page",page_rows_per_page:"Rows per page:",skip_nav:"Skip to content"},sort:{sort_by:"Sort by %{field} %{order}",ASC:"ascending",DESC:"descending"},auth:{auth_check_error:"Please login to continue",user_menu:"Profile",username:"Username",password:"Password",sign_in:"Sign in",sign_in_error:"Authentication failed, please retry",logout:"Logout"},notification:{updated:"Element updated |||| %{smart_count} elements updated",created:"Element created",deleted:"Element deleted |||| %{smart_count} elements deleted",bad_item:"Incorrect element",item_doesnt_exist:"Element does not exist",http_error:"Server communication error",data_provider_error:"dataProvider error. Check the console for details.",i18n_error:"Cannot load the translations for the specified language",canceled:"Action cancelled",logged_out:"Your session has ended, please reconnect.",not_authorized:"You're not authorized to access this resource."},validation:{required:"Required",minLength:"Must be %{min} characters at least",maxLength:"Must be %{max} characters or less",minValue:"Must be at least %{min}",maxValue:"Must be %{max} or less",number:"Must be a number",email:"Must be a valid email",oneOf:"Must be one of: %{options}",regex:"Must match a specific format (regexp): %{pattern}"},saved_queries:{label:"Saved queries",query_name:"Query name",new_label:"Save current query...",new_dialog_title:"Save current query as",remove_label:"Remove saved query",remove_label_with_name:'Remove query "%{name}"',remove_dialog_title:"Remove saved query?",remove_message:"Are you sure you want to remove that item from your list of saved queries?",help:"Filter the list and save this query for later"}}};ea.ra.page.empty="No records yet";var ra=Wr({},ea,{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}"}});const na={ra:{action:{add:"Añadir",add_filter:"Añadir filtro",back:"Ir atrás",bulk_actions:"1 item seleccionado |||| %{smart_count} items seleccionados",cancel:"Cancelar",clear_input_value:"Limpiar valor",clone:"Clonar",close:"Cerrar",close_menu:"Cerrar menú",confirm:"Confirmar",create:"Crear",create_item:"Crear %{item}",delete:"Eliminar",edit:"Editar",expand:"Expandir",export:"Exportar",list:"Listar",move_up:"Mover arriba",move_down:"Mover abajo",open_menu:"Abrir menú",refresh:"Refrescar",remove:"Borrar",remove_filter:"Borrar filtro",save:"Guardar",search:"Buscar",select_all:"Seleccionar todo",select_row:"Seleccionar esta fila",show:"Mostrar",sort:"Ordenar",undo:"Deshacer",unselect:"Deseleccionar",update:"Actualizar"},auth:{auth_check_error:"Por favor inicie sesión para continuar",logout:"Cerrar Sesión",password:"Contraseña",sign_in:"Acceder",sign_in_error:"La autenticación falló, por favor, vuelva a intentarlo",user_menu:"Perfil",username:"Usuario"},boolean:{true:"Sí",false:"No",null:" "},input:{file:{upload_several:"Arrastre algunos archivos para subir o haga clic para seleccionarlos.",upload_single:"Arrastre un archivo para subir o haga clic para seleccionarlo."},image:{upload_several:"Arrastre algunas imagénes para subir o haga clic para seleccionarlas.",upload_single:"Arrastre alguna imagen para subir o haga clic para seleccionarla."},references:{all_missing:"No se pueden encontrar datos de referencias.",many_missing:"Al menos una de las referencias asociadas parece no estar disponible.",single_missing:"La referencia asociada no parece estar disponible."},password:{toggle_visible:"Ocultar contraseña",toggle_hidden:"Mostrar contraseña"}},message:{about:"Acerca de",are_you_sure:"¿Está seguro?",bulk_delete_content:"¿Seguro que quiere eliminar este %{name}? |||| ¿Seguro que quiere eliminar estos %{smart_count} items?",bulk_delete_title:"Eliminar %{name} |||| Eliminar %{smart_count} %{name} items",bulk_update_content:"¿Seguro que quiere actualizar este %{name}? |||| ¿Seguro que quiere actualizar estos %{smart_count} items?",bulk_update_title:"Actualizar %{name} |||| Actualizar %{smart_count} %{name} items",delete_content:"¿Seguro que quiere eliminar este item?",delete_title:"Eliminar %{name} #%{id}",details:"Detalles",error:"Se produjo un error en el cliente y su solicitud no se pudo completar",invalid_form:"El formulario no es válido. Por favor verifique si hay errores",loading:"La página se está cargando, espere un momento por favor",no:"No",not_found:"O bien escribió una URL incorrecta o siguió un enlace incorrecto.",yes:"Sí",unsaved_changes:"Algunos de sus cambios no se guardaron. ¿Está seguro que quiere ignorarlos?"},navigation:{next:"Siguiente",no_more_results:"El número de página %{page} está fuera de los límites. Pruebe la página anterior.",no_results:"No se han encontrado resultados",page_out_from_begin:"No puede ir antes de la página 1",page_out_from_end:"No puede ir después de la última página",page_out_of_boundaries:"Número de página %{page} fuera de los límites",page_range_info:"%{offsetBegin} - %{offsetEnd} de %{total}",page_rows_per_page:"Filas por página:",prev:"Anterior",skip_nav:"Saltar al contenido"},sort:{sort_by:"Ordenar por %{field} %{order}",ASC:"ascendente",DESC:"descendente"},notification:{bad_item:"Elemento incorrecto",canceled:"Acción cancelada",created:"Elemento creado",data_provider_error:"Error del proveedor de datos. Consulte la consola para más detalles.",deleted:"Elemento borrado |||| %{smart_count} elementos borrados.",http_error:"Error de comunicación con el servidor",item_doesnt_exist:"El elemento no existe",logged_out:"Su sesión ha finalizado, vuelva a conectarse.",updated:"Elemento actualizado |||| %{smart_count} elementos actualizados",i18n_error:"No se pudieron cargar las traducciones para el idioma especificado",not_authorized:"No tiene autorización para acceder a este recurso."},page:{create:"Crear %{name}",dashboard:"Tablero",edit:"%{name} #%{id}",empty:"Sin %{name} todavía.",error:"Algo salió mal",invite:"¿Quiere agregar una?",list:"Lista de %{name}",loading:"Cargando",not_found:"No encontrado",show:"%{name} #%{id}"},validation:{email:"Debe ser un correo electrónico válido",maxLength:"Debe contener %{max} caracteres o menos",maxValue:"Debe ser %{max} o menos",minLength:"Debe contener %{min} caracteres al menos",minValue:"Debe ser al menos %{min}",number:"Debe ser un número",oneOf:"Debe ser uno de: %{options}",regex:"Debe coincidir con un formato específico (regexp): %{pattern}",required:"Requerido"}}};na.ra.notification.created="Datos guardados correctamente",na.ra.action.bulk_actions="1 seleccionado |||| %{smart_count} seleccionados",na.ra.page.dashboard="Inicio",na.ra.page.empty="Sin registros todavía",na.ra.page.invite="¿Quiere agregar uno?",na.ra.page.list="%{name}",na.ra.page.edit="Editar %{name}",na.ra.action.back="Volver";var oa=Wr({},na,{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}"}}),aa=["hidden"],ta=["hidden","useContenido"],ia=["hidden"],la=function(e){var r=u(go),n=r.estado,o=r.isLoading,a=r.fichaProps,t=(void 0===a?{}:a)[e.source],i=void 0===t?{}:t,l=e.hidden,s=void 0!==l&&l,c=Hr(e,aa),d=i.hidden,m=i.useContenido,p=void 0===m?Rn:m,f=Hr(i,ta),g=void 0!==d?d:s,v=p(Wr({},c,{estado:n,hidden:g,isLoading:o},f)),h=v.hidden,b=Hr(v,ia);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");return{propsContenido:Wr({},c,f,b),hidden:void 0!==h?h:g}},sa=function(e){var r=la(e),o=r.propsContenido,a=r.hidden,t=Y(),i=JSON.parse(JSON.stringify(t)),l=i[e.source];return i[e.source]=""!=l&&"0"!=l,!a&&n(fe,Wr({},o,{record:i}))},ca=["onFocus","onChange","onBlur","hidden","disabled","validate"],ua=["onFocus","onBlur","onChange","hidden","disabled","useContenido","validate"],da=["hidden","disabled","onFocus","onChnage","onBlur","validate"],ma=function(e,r,n){return"string"==typeof(null==n?void 0:n.data)?n.data:void 0},pa=function(e){var r=e.source,n=u(go),o=n.estado,a=n.isLoading,t=n.fichaProps,i=void 0===t?{}:t,l=yr(function(e){var n=e.configInputs?e.configInputs.filter(function(e){return e.id===r}):[];return n[0]?n[0]:null})||{},s=l.disabled,c=l.hidden,d=!0===l.required?io:void 0,p=i[r],f=void 0===p?{}:p,g=e.onFocus,v=e.onChange,h=e.onBlur,b=e.hidden,y=void 0!==b&&b,_=e.disabled,C=void 0!==_&&_,k=e.validate,w=Hr(e,ca),S=ge(e).field,x=f.onFocus,N=f.onBlur,T=f.onChange,E=f.hidden,P=f.disabled,L=f.useContenido,D=void 0===L?Rn:L,A=f.validate,I=Hr(f,ua),R=void 0!==E?E:y,O=void 0!==P?P:C,F=void 0!==x?x:g,M=void 0!==N?N:h,q=void 0!==T?T:v,V=Mn(e),B=D(Wr({},w,{estado:o,hidden:R,isLoading:a,utils:V},I)),z=m(S.value);if(void 0===B)throw new Error("useContenido está devolviendo undefined para el contenido "+r+"\n Asegúrese de incluir una instrucción return al final de la función");var j=B.hidden,G=B.disabled,U=B.onFocus,W=B.onChnage,H=B.onBlur,J=B.validate,Y=Hr(B,da),Q=U||F,Z=H||M,K=W||q,X=Wr({},V,{prev:z.current}),$=Array.isArray(k)?k:[k],ee=Array.isArray(A)?A:[A],re=Array.isArray(J)?J:[J];return{propsContenido:Wr({onFocus:function(e){Q&&F(V,o,e),z.current=e.target.value},onBlur:function(e){return Z&&Z(X,o,e)},onChange:function(e){return K&&K(X,o,e)},helperText:!1,validate:[].concat($,ee,re,[ma,d]).filter(function(e){return void 0!==e})},w,I,Y,{disabled:void 0!==s?s:void 0!==G?G:O}),hidden:void 0!==c?c:void 0!==j?j:R}},fa=function(e){var r=pa(e);return!r.hidden&&n(ve,Wr({accept:"",maxSize:5e6},r.propsContenido),n(he,{source:"src"}))},ga=function(e){var r=pa(e);return!r.hidden&&n(be,r.propsContenido)},va=["callback"],ha=["helperText","source","reference"],ba=["callback"],ya=function(e){var r=e.callback,o=Hr(e,va),a=_e(),t=a.isLoading,i=a.allChoices;return d(function(){t||"function"==typeof r&&r(Object.values([i]))},[i,r,t]),n(Ce,o)},_a=function(e){var r,o,a=pa(e).hidden,t=br(),i=e.helperText,l=e.source,s=e.reference,c=Hr(e,ha),u=yr(function(e){var r=e.reload_cb?e.reload_cb.filter(function(e){return e.id===l}):[];return r[0]?r[0]:null}),p=m(u),f=null===u&&p.current?p.current:u;return f&&(r=f.callback,o=Hr(f,ba)),d(function(){null!==u&&(p.current=u,t(Sn(l)))},[JSON.stringify(u)]),a?null:n(ye,{reference:s,source:l,perPage:250,filter:o},n(ya,Wr({},c,{callback:r,helperText:i,optionText:"etiqueta",optionValue:l})))},Ca=function(e){var r=pa(e);return!r.hidden&&n(Ce,r.propsContenido)},ka=function(e){var r=e.title,o=e.source,a=e.src,t=Y(e);return n(Ar,{title:r,src:a+"/"+t[o]})},wa=["helperText"],Sa=function(e){var r=pa(e),o=r.propsContenido,a=r.hidden,t=o.helperText,i=Hr(o,wa);return a?null:n(ke,i,n(we,{helperText:t,optionText:"etiqueta",optionValue:e.source}))},xa=function(e){var r=pa(e);return!r.hidden&&n(se,r.propsContenido)},Na=["helperText"],Ta=function(e){var r=pa(e),o=r.propsContenido,a=r.hidden,t=o.helperText,i=Hr(o,Na);return a?null:n(ye,i,n(Se,{helperText:t,optionText:"etiqueta",optionValue:e.source}))},Ea=function(e){var r=pa(e);return!r.hidden&&n(Se,r.propsContenido)},Pa=pr(function(e){return{confirmPrimary:{color:e.palette.primary.main},confirmWarning:{color:e.palette.error.main,"&:hover":{backgroundColor:dr(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}},iconPaddingStyle:{paddingRight:"0.5em"}}},{name:"RaConfirm"}),La=function(e){return n(Gr,{handle:"#draggable-dialog-title",cancel:'[class*="MuiDialogContent-root"]'},n(rr,e))},Da={cursor:"move"},Aa=function(e){var r,o=e.isOpen,a=e.isLoading,t=e.title,l=e.content,s=e.cancel,c=e.confirmColor,u=e.ConfirmIcon,d=e.CancelIcon,m=e.onClose,p=e.onConfirm,f=e.contentResource,v=e.translateOptions,h=void 0===v?{}:v,b=Pa(e),y=g(),_=xe(f)[0],C=i(function(e,r){e.stopPropagation(),p(e,_)},[_,p]),k=i(function(e){e.stopPropagation()},[]);return n(or,{open:o,onClose:m,onClick:k,fullWidth:!0,maxWidth:"lg",PaperComponent:La,"aria-labelledby":"draggable-dialog-title"},n(lr,{style:Da,id:"draggable-dialog-title"},y(t,Wr({_:t},h))),n(tr,{dividers:!0},l),n(ar,null,n(Pr,{disabled:a,onClick:m},n(d,{className:b.iconPaddingStyle}),y(s,{_:s})),n(Pr,{disabled:a,onClick:function(e){return C(e,"yes")},className:yo("ra-confirm",(r={},r[b.confirmWarning]="warning"===c,r[b.confirmPrimary]="primary"===c,r)),autoFocus:!0},n(u,{className:b.iconPaddingStyle}),y("ra.action.confirm"))))};Aa.propTypes={cancel:Ie.string,classes:Ie.object,confirm:Ie.string,confirmColor:Ie.string,ConfirmIcon:Ie.elementType,CancelIcon:Ie.elementType,content:Ie.node.isRequired,isOpen:Ie.bool,isLoading:Ie.bool,onClose:Ie.func.isRequired,onConfirm:Ie.func.isRequired,title:Ie.string.isRequired},Aa.defaultProps={cancel:"ra.action.cancel",classes:{},confirmColor:"primary",ConfirmIcon:zr,CancelIcon:jr,isOpen:!1};var Ia=["disabled","asistant","asistantResource","label","source"],Ra=function(){return n(t,null)},Oa={seleccion:[],all:!0,none:!1},Fa=function(e){return!e||null!=e&&e.all?"Todos":null!=e&&e.none||0===e.seleccion.length?"Ninguno":"Selección ("+e.seleccion.length+")"},Ma=function(e){return e},qa=function(e){var r=e.disabled,a=e.asistant,l=e.asistantResource,s=e.label,c=e.source,u=Hr(e,Ia),d=o(!1),m=d[0],p=d[1],f=Kr(),g=i(function(){p(!1)},[p]);return n(t,null,n("div",{style:{display:"flex",alignItems:"center"}},n(le,Wr({initialValue:Oa},u,{source:c,label:s,disabled:!0,parse:Ma,format:Fa,helperText:!1,InputProps:{endAdornment:n(t,null,n(Tr,{onClick:function(e){f.setValue(c,{seleccion:[],all:!1,none:!0})},disabled:r,"aria-label":"Ninguno",size:"small",title:"Ninguno"},n(Vr,null)),n(Tr,{onClick:function(e){f.setValue(c,{seleccion:[],all:!0,none:!1})},disabled:r,"aria-label":"Todos",size:"small",title:"Todos"},n(qr,null)),n(Tr,{onClick:function(e){return p(!0)},disabled:r,"aria-label":"Selección",size:"small",title:"Selección"},n(Br,null)))}}))),n(Aa,{isOpen:m,title:"Selección de "+s,contentResource:l,content:n(a,{bulkActionButtons:n(Ra,null),hasCreate:!1,exporter:!1,resource:l}),onConfirm:function(e,r){p(!1),f.setValue(c,{seleccion:r,all:!1,none:!1})},onClose:g}))},Va=function(e){return n(Ne,Wr({},e,{hasCreate:!1,exporter:!1,perPage:25,title:" ",bulkActionButtons:n("span",null)}),n(V,null,n(Te,{source:"funced",sortable:!0,label:"Cédula"}),n(Te,{source:"funpriape",sortable:!0,label:"Apellido"}),n(Te,{source:"funprinom",sortable:!0,label:"Nombre"})))},Ba={fillista:"empcod=-1"},za=function(e){var r=o(Ba),a=r[0],t=r[1],l=k(),s=i(function(e){t({fillista:e.node.key})},[t]),c=i(function(e){return l.getChildNodes("form_224",{parentId:e?e.itemData.id:""}).then(function(e){return e.data}).catch(function(){throw new Error("Data Loading Error")})},[l]);return n(nr,{display:"flex",flex:1,alignItems:"flex-start",height:"20em"},n(nr,{flexGrow:1},n(Ur,{id:"funcionarios-treeview",dataStructure:"plain",rootValue:"",onItemClick:s,createChildren:c})),n(nr,{flexGrow:2},n(Va,{resource:"form_224",filter:a})))},ja=pr(function(e){return{confirmPrimary:{color:e.palette.primary.main},confirmWarning:{color:e.palette.error.main,"&:hover":{backgroundColor:dr(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}},iconPaddingStyle:{paddingRight:"0.5em"}}},{name:"RaConfirm"}),Ga=function(e){return n(Gr,{handle:"#draggable-dialog-title",cancel:'[class*="MuiDialogContent-root"]'},n(rr,e))},Ua={cursor:"move"},Wa=function(e){var r,o=e.isOpen,a=e.isLoading,t=e.title,l=e.cancel,s=e.confirmColor,c=e.ConfirmIcon,u=e.CancelIcon,d=e.onClose,m=e.onConfirm,p=e.translateOptions,f=void 0===p?{}:p,v=ja(e),h=g(),b=i(function(e,r){e.stopPropagation(),m(e,r)},[m]),y=i(function(e){e.stopPropagation()},[]);return n(or,{open:o,onClose:d,onClick:y,fullWidth:!0,maxWidth:"lg",PaperComponent:Ga,"aria-labelledby":"draggable-dialog-title"},n(lr,{style:Ua,id:"draggable-dialog-title"},h(t,Wr({_:t},f))),n(tr,{dividers:!0},n(za,null)),n(ar,null,n(Pr,{disabled:a,onClick:d},n(u,{className:v.iconPaddingStyle}),h(l,{_:l})),n(Pr,{disabled:a,onClick:function(e){return b(e,"yes")},className:yo("ra-confirm",(r={},r[v.confirmWarning]="warning"===s,r[v.confirmPrimary]="primary"===s,r)),autoFocus:!0},n(c,{className:v.iconPaddingStyle}),h("ra.action.confirm"))))};Wa.propTypes={cancel:Ie.string,classes:Ie.object,confirm:Ie.string,confirmColor:Ie.string,ConfirmIcon:Ie.elementType,CancelIcon:Ie.elementType,isOpen:Ie.bool,isLoading:Ie.bool,onClose:Ie.func.isRequired,onConfirm:Ie.func.isRequired,title:Ie.string.isRequired},Wa.defaultProps={cancel:"ra.action.cancel",classes:{},confirmColor:"primary",ConfirmIcon:zr,CancelIcon:jr,isOpen:!1};var Ha=["disabled","asistant","asistantResource","label","source"],Ja={seleccion:[],all:!0,none:!1},Ya=function(e){return!e||null!=e&&e.all?"Todos":null!=e&&e.none||0===e.seleccion.length?"Ninguno":"Selección ("+e.seleccion.length+")"},Qa=function(e){return e},Za=function(e){var r=e.disabled,a=e.label,l=void 0===a?"Funcionarios":a,s=e.source,c=Hr(e,Ha),u=xe("form_224")[0],d=o(!1),m=d[0],p=d[1],f=Kr(),g=i(function(){p(!1)},[p]);return n(t,null,n("div",{style:{display:"flex",alignItems:"center"}},n(le,Wr({initialValue:Ja},c,{source:s,label:l,disabled:!0,parse:Qa,format:Ya,helperText:!1,InputProps:{endAdornment:n(t,null,n(Tr,{onClick:function(e){f.setValue(s,{seleccion:[],all:!1,none:!0})},disabled:r,"aria-label":"Ninguno",size:"small",title:"Ninguno"},n(Vr,null)),n(Tr,{onClick:function(e){f.setValue(s,{seleccion:[],all:!0,none:!1})},disabled:r,"aria-label":"Todos",size:"small",title:"Todos"},n(qr,null)),n(Tr,{onClick:function(e){return p(!0)},disabled:r,"aria-label":"Selección",size:"small",title:"Selección"},n(Br,null)))}}))),n(Wa,{isOpen:m,title:"Selección de "+l,onConfirm:function(e,r){p(!1),f.setValue(s,{seleccion:u,all:!1,none:!1})},onClose:g}))},Ka=function(e){var r=pa(e);return!r.hidden&&n(le,Wr({multiline:!0},r.propsContenido))},Xa=["tipo"],$a=function(e){var r=e.tipo,o=Hr(e,Xa),a=pa(o),t=a.propsContenido,i=a.hidden,l=Kr(),s=ge(e),c=s.field,u=s.fieldState,m="F"===r||"Z"===r;d(function(){t.value&&l.setValue(e.source,t.value)}),d(function(){m&&""!=c.value&&!u.error&&u.isTouched&&t.onBlur()},[c.value]);var p=Wr({},t);return!i&&("N"===r||"D"===r?n(Ee,p):"F"===r?n(Pe,p):"Z"===r?n(Le,p):n(le,"H"===r?Wr({},p,{type:"time"}):p))},et=["tipo","value"],rt=function(e){var r=e.tipo,o=Hr(e,et),a=la(o),t=a.hidden,i=Wr({},a.propsContenido);return!t&&("N"===r||"D"===r?n(De,i):"F"===r?n(Ae,i):"Z"===r?n(Ae,Wr({},i,{showTime:!0})):n(Te,i))};export{Qr as AppBar,sa as BooleanField,fa as Camino,ga as CheckBox,_a as ComboBox,Ca as ComboBoxManual,ho as CreateEtriek,wo as DeleteButtonNoWarning,xo as EditEtriek,vn as EtrGrid,to as FichaActions,go as FichaContext,To as FormDialog,Do as FormEtriek,yn as GE,jn as GrillaEtriek,ka as ImageField,Fo as Layout,qo as ListActionsEtriek,Sa as ListCheck,jo as Login,Oo as Menu,Ho as MenuButton,Yo as MultiTextField,xa as Password,Ta as RadioButton,Ea as RadioButtonManual,ao as Separador,Zo as ShowEtriek,Ao as SubMenu,Za as TBSF,Ko as TabbedFormEtriek,Wn as TabbedGrillaEtriek,Ka as TextArea,$a as TextBox,qa as TextBoxSelection,rt as TextField,mo as choicesEstado,Xn as dateFormat,so as dateFormatOptions,$n as dateParser,eo as dateTimeFormat,ro as dateTimeParser,Sn as deleteRecargarComboBox,po as descargarLink,ra as enMessages,oa as esMessages,co as etrFechaMayorQue,io as etrRequerido,lo as etrRequeridoNumerico,Zn as getFormcodFromResource,uo as localeOptions,wn as recargarComboBox,Nn as setDisableAction,xn as setHiddenAction,Tn as setRequireAction,$o as themes,no as timeFormat,oo as timeParser,In as useAjax,pa as useContenidoController,rn as useDeleteRowEtrGrid,la as useFieldController,kn as useFormProgress,An as useGetJson,Jn as useInitFicha,Xr as useNuevo,fo as useReferenceLabel,nn as useSaveRowEtrGrid,Kn as useStylesContenidos,Mn as useUtils,On as useUtilsGrilla,Fn as useUtilsSubmit};
|
|
1
|
+
import{forwardRef as e,createElement as o,createContext as t,useContext as n,useState as r,useMemo as i,useCallback as a,Fragment as l,useEffect as s,Children as c,cloneElement as d,isValidElement as u,useRef as m,memo as p}from"react";import g from"@mui/icons-material/Lock";import f from"@mui/icons-material/VpnLock";import{MenuItem as h,ListItemIcon as b,ListItemText as v,useMediaQuery as y,Typography as C,Box as x,alpha as k,createTheme as w,StyledEngineProvider as T,Stack as O,Tooltip as R,IconButton as S,ThemeProvider as P,Paper as N,CardContent as j,CircularProgress as F,Collapse as _,List as M,Divider as E}from"@mui/material";import{useTranslate as L,useUserMenu as I,useResourceDefinitions as D,AppBar as A,UserMenu as B,Logout as V,useDataProvider as q,useListContext as z,useNotify as W,useRedirect as $,useRefresh as H,useResourceContext as G,useUnselectAll as U,NumberField as J,DateField as Q,TextField as Y,ReferenceField as Z,Button as K,useRecordContext as X,useInput as ee,useGetList as oe,useSafeSetState as te,Confirm as ne,Form as re,SaveButton as ie,useCreatePath as ae,useResourceDefinition as le,DatagridRoot as se,DatagridClasses as ce,BulkActionsToolbar as de,SimpleList as ue,useGetOne as me,TopToolbar as pe,ListButton as ge,ShowButton as fe,required as he,minValue as be,useSaveContext as ve,Create as ye,useDelete as Ce,useEditController as xe,Edit as ke,SimpleForm as we,useSidebarState as Te,MenuItemLink as Oe,Menu as Re,DashboardMenuItem as Se,Layout as Pe,FilterContext as Ne,sanitizeListRestProps as je,FilterButton as Fe,CreateButton as _e,ExportButton as Me,useLogin as Ee,TextInput as Le,PasswordInput as Ie,FieldTitle as De,useShowController as Ae,Show as Be,FormTab as Ve,getTabbedFormTabFullPath as qe,TabbedFormTabs as ze,Toolbar as We,defaultTheme as $e,BooleanField as He,FileInput as Ge,FileField as Ue,BooleanInput as Je,ReferenceInput as Qe,useChoicesContext as Ye,AutocompleteInput as Ze,SelectInput as Ke,ReferenceArrayInput as Xe,SelectArrayInput as eo,RadioButtonGroupInput as oo,useRecordSelection as to,List as no,Datagrid as ro,NumberInput as io,DateInput as ao,DateTimeInput as lo}from"react-admin";import{Link as so,useLocation as co,matchPath as uo,useResolvedPath as mo,Routes as po,Route as go}from"react-router-dom";import{styled as fo,ThemeProvider as ho}from"@mui/material/styles";import bo,{string as vo,func as yo,any as Co,bool as xo}from"prop-types";import ko from"@mui/icons-material/Add";import wo from"@mui/icons-material/Cancel";import To from"@mui/icons-material/Delete";import Oo from"@mui/icons-material/Edit";import Ro from"@mui/material/Dialog";import So from"@mui/material/DialogActions";import Po from"@mui/material/DialogContent";import No from"@mui/material/DialogContentText";import jo from"@mui/material/DialogTitle";import Fo from"@mui/material/Paper";import{esES as _o,DataGridPremium as Mo,useGridApiContext as Eo,useGridApiRef as Lo,useKeepGroupedColumnsHidden as Io}from"@mui/x-data-grid-premium";import{useFormContext as Do,useFormState as Ao}from"react-hook-form";import{useDispatch as Bo,useSelector as Vo}from"react-redux";import{useMutation as qo}from"react-query";import zo from"@mui/icons-material/Settings";import{GridActionsCellItem as Wo}from"@mui/x-data-grid";import $o from"@mui/icons-material/Create";import Ho from"@mui/material/Divider";import Go from"@mui/material/Tab";import Uo from"@mui/material/Tabs";import Jo from"@mui/icons-material/ChevronLeft";import Qo from"@mui/material/Typography";import{isAfter as Yo}from"date-fns";import Zo from"date-fns/locale/en-US";import Ko from"date-fns/locale/es";import Xo from"@mui/material/IconButton";import et from"@mui/material/Tooltip";import ot from"@mui/material/Button";import tt from"@mui/icons-material/ExpandMore";import nt from"@mui/material/Avatar";import rt from"@mui/material/Card";import it from"@mui/material/CardActions";import at from"@mui/material/CircularProgress";import lt from"@mui/material/Menu";import st from"@mui/material/MenuItem";import ct from"@mui/icons-material/RemoveRedEye";import dt from"ra-language-english";import ut from"@blackbox-vision/ra-language-spanish";import mt from"@mui/icons-material/Check";import pt from"@mui/icons-material/RemoveCircleOutline";import gt from"@mui/icons-material/Search";import ft from"@mui/icons-material/CheckCircle";import ht from"@mui/icons-material/ErrorOutline";import bt from"react-draggable";import{TreeView as vt}from"devextreme-react";const yt=e((e,t)=>{const n=L(),{onClose:r}=I(),i=D(),a=i.form_59;return[i.form_275?o(h,Object.assign({component:so,ref:t},e,{key:"/form_275",to:"/form_275",onClick:r}),o(b,null,o(g,null)),o(v,null,n("pos.change_pin"))):null,a?o(h,Object.assign({component:so,ref:t},e,{key:"/form_59",to:"/form_59",onClick:r}),o(b,null,o(f,null)),o(v,null,n("pos.change_password"))):null]}),Ct=()=>o(B,null,o(yt,null),o(V,null)),xt=e=>{const t=y(e=>e.breakpoints.up("sm"));return o(A,Object.assign({},e,{color:"secondary",userMenu:o(Ct,null)}),o(C,{variant:"h6",color:"inherit",sx:{flex:1,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},id:"react-admin-title"}),t&&o(x,{component:"span",sx:{flex:1}}))},kt=t(),wt=({children:e})=>{const[t,n]=r(!1),a=i(()=>({open:t,show:()=>n(!0),hide:()=>n(!1)}),[t]);return o(kt.Provider,{value:a},e)},Tt=()=>n(kt),Ot=(e,o,t,n)=>({type:"RELOAD_CB",payload:{id:e,method:o,params:t,callback:n}}),Rt=(e,o)=>({type:"RELOAD_CB_SUCCESS",payload:{id:e,callback:o}}),St=(e,o)=>({type:"HIDE_INPUT",payload:{id:e,hidden:o}}),Pt=(e,o)=>({type:"DISABLE_INPUT",payload:{id:e,disabled:o}}),Nt=(e,o)=>({type:"REQUIRE_INPUT",payload:{id:e,required:o}}),jt=(e,o)=>({type:"ERROR_INPUT",payload:{id:e,error:o}}),Ft=()=>{const e=Bo();return a((o,t,n,r)=>{e(Ot(o,t,n,r))},[e])},_t=()=>{const e=Bo();return a((o,t)=>{e(St(o,t))},[e])},Mt=()=>{const e=Bo();return a((o,t)=>{e(Pt(o,t))},[e])},Et=()=>{const e=Bo();return a((o,t)=>{e(Nt(o,t))},[e])},Lt=()=>{const e=Bo();return a((o,t)=>{e(jt(o,t))},[e])},It=(e,o)=>{const t=q(),{mutateAsync:n,isLoading:r}=qo(o=>{const{method:n,params:r}=o;return t.getJson(e,{method:n,params:r})},o);return{mutateAsync:n,isLoading:r}},Dt=e=>{const{mutateAsync:o,isLoading:t}=It(e);return[a((e,t,n)=>o({method:e,params:t},{onSuccess:n,onError:n}),[]),t]},At=e=>({}),Bt=e=>{const o=z(e),t=W(),n=$(),r=H(),i=G(e),a=U(i),[l]=Dt(i);return{ajax:l,data:o,notify:t,redirect:n,refresh:r,unselectAll:a}},Vt=e=>{const o=Ft(),t=_t(),n=Mt(),r=Et(),i=Lt(),a=Tt(),l=W(),s=$(),c=G(e),[d]=Dt(c);return{ajax:d,notify:l,redirect:s,recargarComboBox:o,progress:a,setHidden:t,setDisable:n,setRequire:r,setError:i,etrs:e.etrs||{}}},qt=e=>{const o=Ft(),t=_t(),n=Mt(),r=Et(),i=Lt(),l=Tt(),s=W(),c=$(),d=Do(),u=G(e),[m]=Dt(u),p=e.etrs||{},g=e.asisEtr||{},{trigger:f}=d;return{form:d,ajax:m,notify:s,redirect:c,recargarComboBox:o,progress:l,setHidden:a((e,o)=>{t(e,o),setTimeout(()=>{f(e)})},[t,f]),setDisable:a((e,o)=>{n(e,o),setTimeout(()=>{f(e)})},[n,f]),setRequire:a((e,o)=>{r(e,o),setTimeout(()=>{f(e)})},[r,f]),setError:a((e,o)=>{i(e,o),setTimeout(()=>{f(e)})},[i,f]),etrs:p,asisEtr:g}},zt=t({}),Wt=t(void 0),$t=e=>{const{estado:o,isLoading:t,fichaProps:r={}}=n(zt),{[e.source]:i={}}=r,{hidden:a=!1,...l}=e,{hidden:s,useContenido:c=At,...d}=i,u=void 0!==s?s:a,m=c({...l,estado:o,hidden:u,isLoading:t,...d}),{hidden:p,...g}=m;if(void 0===m)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:{...l,...d,...g},hidden:void 0!==p?p:u}},Ht=e=>{const{tipo:t,...n}=e,{propsContenido:r,hidden:i}=$t(n),a={...r};return!i&&("N"===t||"D"===t?o(J,a):"F"===t?o(Q,a):"Z"===t?o(Q,Object.assign({},a,{showTime:!0})):o(Y,a))},Gt=(e,t,n)=>r=>o(Z,{reference:n,source:t,queryOptions:{meta:{etr:e}},record:{[t]:r.row[t]}},o(Ht,{source:"etiqueta"})),Ut=e=>{const o={...e};return delete o.id,o},Jt=e=>{const{apiRef:o,source:t,enviarTodo:n}=e;return a((e,r)=>{const i=Ut(e),a=o.current.getRowsCount()+1;o.current.updateRows([{...i,id:a}]);const l=n?Array.from(o.current.getRowModels().values(),e=>({...e,claveFila:"",estado:"N"}))||[]:r.getValues()[t]||[];n||l.push({...i,claveFila:"",estado:"N"}),r.setValue(t,l,{shouldDirty:!0})},[o,t])},Qt=e=>{const{apiRef:o,source:t,enviarTodo:n}=e;return a((e,r,i)=>{var a,l;const s="number"==typeof e?"N":"M",c=Ut(r);o.current.updateRows([{...c,id:e}]);const d=n?Array.from(o.current.getRowModels().values(),e=>({...e,estado:s}))||[]:i.getValues()[t]||[];let u=d.findIndex(o=>o.id===e);u=-1===u?d.length:u,d[u]={...c,claveFila:"N"===(null===(a=d[u])||void 0===a?void 0:a.estado)?"":e,estado:"N"===(null===(l=d[u])||void 0===l?void 0:l.estado)?"N":"M"},i.setValue(t,d,{shouldDirty:!0})},[o,t])},Yt=e=>{const{apiRef:o,source:t,enviarTodo:n}=e;return a((e,r)=>{const i=o.current.getRowModels().get(e);o.current.updateRows([{id:e,_action:"delete"}]);const a=n?Array.from(o.current.getRowModels().values(),e=>({...e,estado:"B"}))||[]:r.getValues()[t]||[];let l=a.findIndex(o=>o.claveFila===e);l=-1===l?a.length:l,a[l]={...i,estado:"B",claveFila:e},"number"==typeof e&&a.splice(l,1),r.setValue(t,a,{shouldDirty:!0})},[o,t])},Zt=e=>{const{[e.source]:o}=e.useFormulario(),t={...e,enviarTodo:o.enviarTodo};return{addRow:Jt(t),editRow:Qt(t),deleteRow:Yt(t),clear:o=>{e.apiRef.current.setRows([]),o.setValue(e.source,"")},api:e.apiRef}},Kt=fo("div")(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%","& .ant-empty-img-1":{fill:"light"===e.palette.mode?"#aeb8c2":"#262626"},"& .ant-empty-img-2":{fill:"light"===e.palette.mode?"#f5f5f7":"#595959"},"& .ant-empty-img-3":{fill:"light"===e.palette.mode?"#dce0e6":"#434343"},"& .ant-empty-img-4":{fill:"light"===e.palette.mode?"#fff":"#1c1c1c"},"& .ant-empty-img-5":{fillOpacity:"light"===e.palette.mode?"0.8":"0.08",fill:"light"===e.palette.mode?"#f5f5f5":"#fff"}})),Xt=()=>o(Kt,null,o("svg",{width:"120",height:"100",viewBox:"0 0 184 152","aria-hidden":!0,focusable:"false"},o("g",{fill:"none",fillRule:"evenodd"},o("g",{transform:"translate(24 31.67)"},o("ellipse",{className:"ant-empty-img-5",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),o("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"}),o("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"}),o("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"})),o("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"}),o("g",{className:"ant-empty-img-4",transform:"translate(149.65 15.383)"},o("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),o("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"})))),o(x,{sx:{mt:1}},"No hay registros")),en=fo(K,{name:"EtrDeleteButton",overridesResolver:(e,o)=>o.root})(({theme:e})=>({color:e.palette.primary.main,"&:hover":{backgroundColor:k(e.palette.primary.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}})),on={},tn=e=>{const t=Do();return o(Wt.Provider,{value:{form:t}},e.children)},nn=e=>o(Ro,{open:e.open,onClose:e.onClose,fullWidth:!0},o(jo,null,`${e.labelEstado} ${e.label}`),o(No,{component:"span"},o(re,{mode:"onBlur",record:on,resource:e.resource,onSubmit:e.onSubmit},o(tn,null,e.children))));nn.propTypes={label:vo,onClick:yo,icon:Co,open:xo,onClose:yo,labelEstado:vo,resource:Co,save:yo,render:yo};const rn=e=>{const{form:t,resource:r,estado:i,editors:a,recordPadre:u,camposClaveFila:m,setOpen:p,open:g}=e,{dirtyFields:f,isValid:h}=Ao(),{fichaProps:{[e.source]:b,etrs:v}}=n(zt),y=n(Wt),{onAfterRenderAsistente:C}=b,x=qt({resource:r,etrs:v,asisEtr:y});return s(()=>{g&&"function"==typeof C&&C({...x,form:t})},[g]),o(l,null,o(Po,null,o(O,{spacing:4},c.map(a,(e,o)=>d(e,{resource:r,estado:i,defaultValue:u[e.props.source]||"",fullWidth:!0,sx:{margin:0},disabled:"N"!==i&&-1!==m.indexOf(e.props.source),...b[e.props.source]})))),o(So,null,o(ie,{disabled:0===Object.keys(f).length||!h}),o(K,{label:"ra.action.cancel",onClick:e=>{p(!1),e.stopPropagation()}},o(wo,null))))},an=e=>{const{editors:t,record:n,camposClaveFila:r,label:i,source:a,enviarTodo:s}=e,[c,d]=te(!1),u=G(e),m=Do(),p=Eo(),g=Jt({apiRef:p,source:a,enviarTodo:s}),f=L()("ra.action.create");return o(l,null,o(K,{onClick:e=>{d(!0),e.stopPropagation()}},o(ko,null)),o(nn,{open:c,onClose:e=>{d(!1),e.stopPropagation()},labelEstado:f,label:i,resource:u,onSubmit:(e,o)=>{g(e,m),d(!1)}},o(rn,{source:a,form:m,resource:u,estado:"N",editors:t,recordPadre:n||{},camposClaveFila:r,open:c,setOpen:()=>{d(!1)}})))},ln=e=>{const{editors:t,camposClaveFila:n,resource:r,label:i,source:a,row:s,enviarTodo:c}=e,d=L(),[u,m]=te(!1),p=Eo(),g=Do(),f=Qt({apiRef:p,source:a,enviarTodo:c}),h=d("ra.action.edit");return o(l,null,o(K,{onClick:e=>{m(!0),e.stopPropagation()}},o(Oo,null)),o(nn,{open:u,onClose:e=>{m(!1),e.stopPropagation()},labelEstado:h,label:i,resource:r,onSubmit:(e,o)=>{f(s.id,e,g),m(!1)}},o(rn,{source:a,form:g,resource:r,estado:"M",editors:t,recordPadre:s,camposClaveFila:n,open:u,setOpen:()=>{m(!1)}})))},sn=e=>{const{confirmTitle:t="ra.message.delete_title",confirmContent:n="ra.message.delete_content",row:r,source:i,enviarTodo:a}=e,[s,c]=te(!1),d=Eo(),u=Do(),m=Yt({apiRef:d,source:i,enviarTodo:a});return o(l,null,o(en,{key:"button",onClick:e=>{c(!0),e.stopPropagation()}},o(To,null)),o(ne,{isOpen:s,title:t,content:n,onConfirm:e=>{m(r.id,u)},onClose:e=>{c(!1),e.stopPropagation()}}))},cn=w({},_o),dn=e=>{const{filterBy:t="",claves:a,sortModel:s,columns:c,reference:d,allowAdd:u=!0,allowRemove:m=!0,enableLoad:p=!0,apiRef:g,...f}=e,[h,b]=r([]),v=X(e),{field:y}=ee({defaultValue:"",...e}),{isLoading:C,fichaProps:{[f.source]:x}}=n(zt),{enviarTodo:k=!1}=x,[w,O]=r(s),[{field:R,sort:S}]=s;let P={};v&&t.split(",").forEach(e=>{e&&(P[e]=[{type:"string",comparison:"eq",value:v[e],field:e}])});const{isLoading:N}=oe(d,{pagination:{page:1,perPage:200},sort:{field:R,order:S},filter:P},{enabled:p&&!C,onSuccess:e=>{b((null==e?void 0:e.data)||[])}}),j=[...c,{field:" ",width:80,headerName:"",headerAlign:"center",sortable:!1,disableClickEventBubbling:!0,renderCell:e=>o(ln,Object.assign({},f,{enviarTodo:k,camposClaveFila:a,row:e.row}))}];u&&j.unshift({field:"BTN",headerName:"",sortable:!1,renderHeader:e=>o(an,Object.assign({},f,{enviarTodo:k,camposClaveFila:a}))}),m&&j.push({field:" ",headerName:"",headerAlign:"center",sortable:!1,disableClickEventBubbling:!0,renderCell:e=>o(sn,Object.assign({},f,{enviarTodo:k,camposClaveFila:a,row:e.row}))});const F=i(()=>j,[JSON.stringify(j)]);return o(Fo,{sx:{width:"100%",height:"40vh",borderRadius:0,marginTop:1}},o(T,{injectFirst:!0},o(ho,{theme:cn},o(l,null,o(Mo,Object.assign({apiRef:g,loading:N||C,sx:{"& .MuiDataGrid-columnsContainer":{backgroundColor:e=>"light"===e.palette.mode?"#fafafa":"#1d1d1d"},"& .MuiDataGrid-iconSeparator":{display:"none"}},disableRowSelectionOnClick:!0,paginationModel:{page:1,pageSize:50},hideFooter:!0,rows:h,columns:F,sortModel:w,onSortModelChange:e=>O(e),sortable:!1,resizable:!1,disableReorder:!0,disableExport:!0,filterable:!1,disableColumnMenu:!0,slots:{noRowsOverlay:Xt}},f)),o("input",Object.assign({type:"hidden"},y))))))},un=w({},_o),mn=e=>{const{filterBy:t="",sortModel:a,columns:l,reference:s,enableLoad:c=!0,initialState:d,...u}=e,{isLoading:m}=n(zt),p=X(),[g,f]=r(a),[{field:h,sort:b}]=a,v=i(()=>[...l],[JSON.stringify(l)]);let y={};p&&t.split(",").forEach(e=>{e&&(y[e]=[{type:"string",comparison:"eq",value:p[e],field:e}])});const{estado:C,isLoading:x,fichaProps:k={}}=n(zt),w=qt(e),{[e.source]:O={}}=k,{useContenido:R=At,restInitialProps:S}=O,{data:P=[],isLoading:N,refetch:j}=oe(s,{pagination:{page:1,perPage:200},sort:{field:h,order:b},filter:y},{enabled:c&&!m}),F=Lo(),_=Io({apiRef:F,initialState:d});return R({...u,estado:C,hidden:e.hidden,isLoading:x,utils:w,...S,refetch:j,apiRef:F}),o(Fo,{sx:{width:"100%",height:"40vh",borderRadius:0,marginTop:1}},o(T,{injectFirst:!0},o(ho,{theme:un},o(Mo,Object.assign({apiRef:F,rows:P,columns:v,loading:N||m,sx:{"& .MuiDataGrid-columnsContainer":{backgroundColor:e=>"light"===e.palette.mode?"#fafafa":"#1d1d1d"},"& .MuiDataGrid-iconSeparator":{display:"none"}},disableRowSelectionOnClick:!0,paginationModel:{page:1,pageSize:50},hideFooter:!0,sortModel:g,onSortModelChange:e=>f(e),slots:{noRowsOverlay:Xt},initialState:_},u)))))},pn=e=>{const{alignIcon:t="left",children:n,className:r,disabled:i,label:a,color:l="primary",size:s="small",to:c,...d}=e,u=L(),m=a?u(a,{_:a}):void 0,p=gn(c);return a&&!i?o(R,{title:m},o(S,Object.assign({"aria-label":m,className:r,color:l,size:"large"},d,p),n)):o(S,Object.assign({className:r,color:l,disabled:i,size:"large"},d,p),n)};pn.propTypes={alignIcon:bo.oneOf(["left","right"]),children:bo.element,className:bo.string,color:bo.oneOfType([bo.oneOf(["inherit","default","primary","secondary","error","info","success","warning"]),bo.string]),disabled:bo.bool,label:bo.string,size:bo.oneOf(["small","medium","large"])};const gn=e=>{if(null==e)return;if("string"==typeof e)return{to:e};const{redirect:o,replace:t,state:n,...r}=e;return{to:r,redirect:o,replace:t,state:n}},fn=e=>e.stopPropagation(),hn={true:{_scrollToTop:!0},false:{}},bn=o(ko,null),vn=e=>{const{icon:t=bn,label:n="ra.action.create",scrollToTop:r=!0,...i}=e,a=G(e),l=X(e),s=ae();return o(pn,Object.assign({component:so,to:s({type:"create",resource:a}),state:{record:l,...hn[String(r)]},label:n,onClick:fn},i),t)},yn=e=>e.stopPropagation(),Cn={true:{_scrollToTop:!0},false:{}},xn=o($o,null),kn=e=>{const{icon:t=xn,label:n="ra.action.edit",scrollToTop:r=!0,...i}=e,a=G(e),l=X(e),s=ae();return l?o(pn,Object.assign({component:so,to:s({type:"edit",resource:a,id:l.id}),state:Cn[String(r)],label:n,onClick:yn},i),t):null},wn=(e,o)=>void 0===o||"function"==typeof o&&o(e),Tn=w({},_o),On=new Map([["is","is"],["not","not"],["after","after"],["onOrAfter","onOrAfter"],["before","before"],["onOrBefore","onOrBefore"],["eq","="],["neq","!="],["gt",">"],["gte",">="],["lt","<"],["lte","<="],["contains","contains"],["equals","equals"],["sw","startsWith"],["ew","endsWith"],["isEmpty","isEmpty"],["isNotEmpty","isNotEmpty"],["isAnyOf","isAnyOf"]]),Rn=new Map(Array.from(On,e=>[e[1],e[0]])),Sn=e=>e.items.reduce((e,o)=>(void 0!==o.field&&o.operator&&(Rn.has(o.operator)?e[`${o.field}_${Rn.get(o.operator)}`]=o.value:e[o.field]=o.value),e),{}),Pn=e=>{const{actionButtons:t=[],bulkActionButtons:n,sx:r,columns:i,isRowEditable:a,desktopSize:l=!1,hasEdit:s,initialState:c,convertFilterModelToFilterValues:d=Sn,claveNuevo:m,mobileColumns:p="",...g}=e,f=Bt(e),h=L(),b=G(e),{data:v=[],isLoading:y,selectedIds:C,onSelect:k,displayedFilters:w,setFilters:T}=z(),O=Lo(),R=Io({apiRef:O,initialState:{...c,pinnedColumns:{right:["actions"]}}}),S=i.map((e,o)=>({...e,headerName:""!==e.headerName?h(`resources.${b}.fields.${e.field}`,{_:e.headerName}):e.headerName})),N=t.length>0||s?S.concat([{field:"actions",type:"actions",width:100,hideable:!1,getActions:e=>{const n=O.current.getRowNode(e.id);return e.row.id?[...s?[o(kn,{record:e.row,disabled:!wn(e.row,a)})]:[],...t.map(t=>{const{handler:n,...r}=t;return o(Wo,Object.assign({showInMenu:!0,onClick:o=>"function"==typeof n&&n({...f,record:e.row},r.key)},r))})]:-1!==n.children[0].indexOf(m+"=")?[o(vn,{record:m?{[m]:n.children[0].split(m+"=")[1].replaceAll("[","").trim().split("AND")[0].trim()}:void 0})]:[]}}]):S,j=u(n);return o(se,{sx:r,className:ce.root},j?o(de,{selectedIds:C},n):null,o(x,{sx:{height:"70vh",width:"100%"},className:ce.tableWrapper},o(P,{theme:Tn},o(Mo,Object.assign({sx:{display:"grid",gridTemplateRows:"auto 1fr auto"},columns:N,rows:v,apiRef:O,loading:y,hideFooterSelectedRowCount:!0,hideFooter:!0,disableMultipleRowSelection:!0,checkboxSelection:j,filterMode:"server",onFilterModelChange:e=>{T(d(e),w)},rowSelectionModel:C,onRowSelectionModelChange:e=>{y||(O.current.isRowSelected(e[0])?k([]):k(e))},isRowSelectable:e=>e.row.id,initialState:R},g)))))},Nn=e=>{const{sx:t,columns:n,actionButtons:r=[],hasEdit:i,isRowEditable:a,primaryText:l,mobileColumns:s=""}=e;let c=l;const d=Bt(e);if(!l){const e=s?s.split(",").map(e=>n.find(o=>o.field===e)):n;c=t=>o(N,{variant:"outlined",sx:{pt:2,pb:2,pl:2}},e.map(e=>{const{field:n,headerName:r,valueGetter:i,type:a="string",jsxMobile:l}=e;return o(x,null,l?l(t,e):"boolean"===a?o(x,{component:"span",sx:{color:i({value:t[n]})?"green":"red"}},r):t[n])}),o(x,null,r.map(e=>{const{key:n,handler:r,icon:i=o(zo,null),...a}=e;return o(K,Object.assign({onClick:e=>"function"==typeof r&&r({...d,record:t},n)},a),i)})))}return o(ue,{linkType:e=>!(!i||!wn(e,a))&&"edit",primaryText:c,sx:t})},jn=e=>{const t=y(e=>e.breakpoints.down("md")),{hasEdit:n}=le(e);(e=>{const{onRenderGrilla:o,onLoadGrilla:t}=e,{isLoading:n}=z(),r=Bt(e);s(()=>{o&&o(r)},[]),s(()=>{n||t&&t(r)},[n])})(e);const{desktopSize:r=!1}=e;return o(t&&!1===r?Nn:Pn,Object.assign({},e,{hasEdit:n}))},Fn=e=>{const{filterValues:t,setFilters:n,tabs:{ids:r,...i},GridComponent:a=jn,...s}=e,c=t.id;return o(l,null,o(Uo,{value:c,indicatorColor:"primary",onChange:(e,o)=>{n({...t,id:o})}},r.map(e=>o(Go,{key:e,label:e.charAt(0).toUpperCase()+e.slice(1),value:e}))),o(Ho,null),o(a,Object.assign({},s,i[c])))},_n=e=>{const{useFormulario:o=At,...t}=e;return{fichaProps:{...o(t),etrs:t.etrs}}},Mn=(e,o)=>me(e,{id:"-1"},o),En=e=>e.split("_")[1],Ln=/^\d{2}\/\d{2}\/\d{4}$/,In=e=>{if(!(e instanceof Date)||isNaN(e.getDate()))return"";const o=e.getFullYear().toString(),t=(e.getMonth()+1).toString(),n=e.getDate().toString();return`${o}-${("00"+t).slice(-2)}-${("00"+n).slice(-2)}`},Dn=e=>{if(null==e||""===e)return"";if(e instanceof Date)return In(e);if(Ln.test(e)){const o=e.split("/");return o[2]+"-"+o[1]+"-"+o[0]}return In(new Date(e))},An=e=>{if(!e)return"";const o=e.split("-");return o[2]+"/"+o[1]+"/"+o[0]},Bn=/^\d{2}\/\d{2}\/\d{4}\s\d{2}:\d{2}$/,Vn=e=>{if(null==e||""===e)return"";if(e instanceof Date)return In(e);if(Bn.test(e)){const o=e.split(" "),t=o[0].split("/");return t[2]+"-"+t[1]+"-"+t[0]+" "+o[1]}return In(new Date(e))},qn=e=>{if(!e)return"";const o=e.split("T"),t=o[0].split("-");return t[2]+"/"+t[1]+"/"+t[0]+" "+o[1]},zn=e=>{if(!e)return"";if(e instanceof Date)return e.toString();if(-1!==e.indexOf(":")){const o=e.split(":");let t=new Date;return t.setHours(o[0]),t.setMinutes(o[1]),t.toString()}{const o=/(\d{2}):(\d{2})/.exec(e);if(null===o)return;let t=new Date;return t.setHours(o[0]),t.setMinutes(o[1]),t.toString()}},Wn=(e,o)=>e?e.split(" ")[4].substring(0,5):"",$n=e=>{const{source:t}=e,n=Vo(e=>{const o=e.configInputs?e.configInputs.filter(e=>e.id===t):[];return o[0]?o[0]:null}),{hidden:r}=n||{};return!r&&o(Qo,{variant:"h6",gutterBottom:!0,id:e.source},e.children)},Hn=({children:e,className:t,data:n,hasShow:r,hasList:i=!0,...a})=>o(pe,Object.assign({className:t},(({...e})=>e)(a)),e,i&&o(ge,{label:"ra.action.back",icon:o(Jo,null)}),r&&o(fe,{record:n})),Gn=he(),Un=[Gn,be(1)],Jn={inputFormat:"dd/MM/yyyy"},Qn=e=>(o,t)=>{const n=t[e];if(o&&n){const e=new Date(n.split("/").reverse().join("/")),t=new Date(o.split("/").reverse().join("/"));if(Yo(e,t))return{message:"validation.greater_or_equal",args:{menor:n}}}},Yn=(e="es")=>({locale:"en"===e?Zo:Ko}),Zn=[{id:"1",name:"Aprobado"},{id:"2",name:"Rechazado"},{id:"3",name:"Pendiente"}],Kn=(e,o)=>{const t=document.createElement("a");t.style.display="none",document.body.appendChild(t),t.setAttribute("href",e),t.setAttribute("download",o),t.click()},Xn=(e,o)=>{const t=G(),{data:n,isLoading:r,error:i}=me("cb_"+En(t)+"_"+e,{id:o});return r||i?"":(null==n?void 0:n.etiqueta)||""},er={form:"FormEtriek-form",tab:"FormEtriek-tab",contenido:"FormEtriek-contenido"},or=e=>({["& ."+er.form]:{maxHeight:"70vh",overflow:"auto"},["& ."+er.tab]:{display:"block",maxHeight:"65vh",overflow:"auto"},["& ."+er.contenido]:{[e.breakpoints.up("xs")]:{width:"100%"},[e.breakpoints.up("md")]:{width:"12vw","&.MuiAutocomplete-root":{width:"16vw"}}}}),tr=()=>{},nr=e=>{const{fichaProps:{onBeforeSubmitFicha:o}}=n(zt),t=Vt(e),r=W(),{save:i}=ve(),l=a(async e=>{const n=o&&await o({form:{getValues:()=>e},...t},"N");return"string"==typeof n?void r(n,{type:"error"}):void 0===n||n?i(e):void 0},[o,r,tr,i]);return"function"==typeof o?l:void 0},rr=e=>{const{useFormulario:t=At,enableLoad:n=!0,...r}=e,a=G(e),{data:l,isLoading:s}=Mn(a,{enabled:n}),{fichaProps:c}=_n(e),d=i(()=>({estado:"N",initialValues:l,isLoading:s,fichaProps:c}),[l,s,c]);return o(wt,null,o(zt.Provider,{value:d},o(ye,Object.assign({redirect:"list"},r,null==c?void 0:c.panel))))};rr.propTypes={useFormulario:bo.func};const ir=fo(rr,{name:"FormEtriek",overridesResolver:(e,o)=>o.root})(({theme:e})=>or(e));function ar(e){var o,t,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(o=0;o<e.length;o++)e[o]&&(t=ar(e[o]))&&(n&&(n+=" "),n+=t);else for(o in e)e[o]&&(n&&(n+=" "),n+=o);return n}function lr(){for(var e,o,t=0,n="";t<arguments.length;)(e=arguments[t++])&&(o=ar(e))&&(n&&(n+=" "),n+=o);return n}const sr=e=>{const t=L(),{resource:n,className:r,icon:i,label:a="ra.action.delete",...l}=e,s=X(),[c,{isLoading:d}]=Ce(n,{id:s.id});return o(et,{title:t("ra.action.delete")},o(Xo,Object.assign({disabled:d,onClick:()=>c(),label:a,className:lr("ra-delete-button",r),key:"button"},(({...e})=>e)(l),{size:"large"}),i))};sr.defaultProps={redirect:"list",icon:o(To,null)};const cr=e=>{const o={};for(const t in e)"string"==typeof e[t]&&0===e[t].trim().length||(null==e[t]&&(e[t]=""),o[t]=e[t]);return o},dr=fo(e=>{const{useFormulario:t=At,mutationMode:n="pessimistic",...r}=e,a=xe({mutationMode:n,...r}),{record:l,isLoading:s}=a,{fichaProps:c}=_n(e),d=i(()=>({estado:"M",initialValues:l,isLoading:s,fichaProps:c}),[l,s,c]);return o(wt,null,o(zt.Provider,{value:d},o(ke,Object.assign({mutationMode:n,transform:cr},r,null==c?void 0:c.panel))))},{name:"FormEtriek",overridesResolver:(e,o)=>o.root})(({theme:e})=>or(e)),ur=e((e,t)=>{const{isOpen:n,onConfirm:r,onClose:i,title:a,dialogText:l,children:s,hasAccept:c=!0,hasCancel:d=!0,isLoading:u=!1}=e,m=e=>{i&&i(e)};return o(Ro,{ref:t,open:n,fullWidth:!0,onClose:m,"aria-labelledby":"form-dialog-title"},o(jo,{id:"form-dialog-title"},a),o(Po,null,o(No,null,l),s),(c||d)&&o(So,null,d&&o(ot,{onClick:m,variant:"contained",color:"secondary",sx:{margin:1},disabled:u},"Cancelar"),c&&o(ot,{onClick:e=>{r&&r(e)},variant:"contained",color:"primary",sx:{margin:1},disabled:u},"Ok")))}),mr={},pr={pointerEvents:"none",backgroundColor:"#ffffff",opacity:.6,position:"relative"},gr=e=>{const t=Tt(),r=G(e),{estado:i,isLoading:a,initialValues:l,fichaProps:c}=n(zt),d=qt({resource:r,etrs:c.etrs});return s(()=>{c.onRenderFicha&&c.onRenderFicha(d,i)},[]),s(()=>{a||c.onLoadFicha&&c.onLoadFicha(d,i,l)},[a]),o(j,{sx:{...e.sx,...t.open?pr:mr}},t.open&&o(F,{sx:{position:"absolute",left:"50%",top:"50%"},thickness:4,size:50}),e.children)},fr=e=>{const{initialValues:t,fichaProps:{config:r={}}}=n(zt),i=nr(e);return t?o(we,Object.assign({mode:"onBlur"},e,{onSubmit:i,defaultValues:t,component:gr},r)):null};fr.propTypes={...we.propTypes};const hr=e=>{const{handleToggle:t,isOpen:n,name:r,icon:i,children:a,dense:l}=e,s=L(),[c]=Te(),d=o(h,{dense:l,onClick:t},o(b,{sx:{minWidth:5}},n?o(tt,null):i),o(C,{variant:"inherit",color:"textSecondary"},s(r)));return o("div",null,c||n?d:o(R,{title:s(r),placement:"right"},d),o(_,{in:n,timeout:"auto",unmountOnExit:!0},o(M,{dense:l,component:"div",disablePadding:!0,sx:{paddingLeft:e.children.props.children[0].key.startsWith("menu")?4:0,"& a":{transition:"padding-left 195ms cubic-bezier(0.4, 0, 0.6, 1) 0ms",paddingLeft:c?4:2}}},a)))},br=e=>{const{items:t,translate:n,...r}=e,{state:i,handleToggle:a,dense:l}=r;return t&&o("div",null,t.map(e=>{const{name:t,menu:s,label:c,icon:d="settings"}=e;return s?o(hr,{key:t,name:c,handleToggle:()=>a(t),isOpen:i[t],icon:o(zo,null),dense:l},br({items:s,translate:n,...r})):o(Oe,{key:t,to:"/"+t,primaryText:n(`resources.${t}.name`,{_:c}),dense:l,leftIcon:o(zo,null)})}))},vr=({dense:e=!1})=>{const t=L(),[n,i]=r({mnuPrueba:!1}),a=y(e=>e.breakpoints.down("sm")),[l]=Te(),s=JSON.parse(localStorage.getItem("menus")),c=br({items:s,handleToggle:e=>{i(o=>({...o,[e]:!o[e]}))},state:n,activeClassName:"",iconClass:"",className:"",open:l,dense:e,translate:t});return o(x,{sx:{width:l?230:50,marginTop:1,marginBottom:1,transition:e=>e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen})}},o(Re,null,o(Se,{primaryText:t("ra.page.dashboard")}),c,a&&o(Oe,{to:"/configuration",primaryText:t("pos.configuration"),leftIcon:o(zo,null),dense:e})))};var yr=e=>o(Pe,Object.assign({},e,{appBar:xt,menu:vr}));const Cr=(e,o)=>{alert("Falta implementar la función jsBotonGrilla")},xr=e=>{const{className:t,filters:r,children:a,hideFilterButton:l=!1,jsBotonGrilla:s=Cr,...u}=e,{sort:m,displayedFilters:p,filterValues:g,exporter:f,showFilter:h,total:b}=z(e),v=G(e),{hasCreate:y}=le(e),C=n(Ne)||r,x=z(e),k={...Bt(e),...x};return delete u.hasCreate,i(()=>o(pe,Object.assign({className:t},je(u)),l?null:r?d(r,{resource:v,showFilter:h,displayedFilters:p,filterValues:g,context:"button"}):C&&o(Fe,null),y&&o(_e,null),!1!==f&&o(Me,{disabled:0===b,resource:v,sort:m,filterValues:g}),c.map(a,(e,o)=>d(e,{onClick:e.props.options?null:o=>{e.props.onClick&&e.props.onClick(o),s(k,e.key)},options:e.props.options?e.props.options.map(o=>({...o,onClick:t=>{e.props.onClick&&e.props.onClick(t),s(k,o.key)}})):null}))),[v,p,g,r,h,C,b,t,m,l,f,y])},kr=e=>{const{loginBackgroundImage:t,nameSource:n="username",passwordSource:i="password"}=e,[a,l]=r(!1),s=L(),c=s("ra.auth.sign_in"),d=W(),u=Ee(),m=co();return o(re,{onSubmit:e=>{l(!0),u(e,m.state?m.state.nextPathname:"/").catch(e=>{l(!1),d("string"==typeof e?e:void 0!==e&&e.message?e.message:"ra.auth.sign_in_error",{type:"error",messageArgs:{_:"string"==typeof e?e:e&&e.message?e.message:void 0}})})},validate:e=>{const o={};return e[n]||(o[n]=s("ra.validation.required")),e[i]||(o[i]=s("ra.validation.required")),o}},o(x,{sx:{display:"flex",flexDirection:"column",minHeight:"100vh",alignItems:"center",justifyContent:"flex-start",backgroundImage:t,backgroundRepeat:"no-repeat",backgroundSize:"cover"}},o(rt,{sx:{minWidth:300,marginTop:"6em"}},o(x,{sx:{margin:"1em",display:"flex",justifyContent:"center"}},o(nt,{sx:{backgroundColor:"secondary.main"}},o(g,null))),o(x,{sx:{marginTop:"1em",marginBottom:"1em",display:"flex",justifyContent:"center",color:"grey.600"}},"Inicio de Sesión"),o(x,{sx:{padding:"0 1em 1em 1em"}},o(x,{sx:{marginTop:0}},o(Le,{autoFocus:!0,fullWidth:!0,name:n,label:s("ra.auth.username"),disabled:a})),o(x,{sx:{marginTop:0}},o(Ie,{name:i,label:s("ra.auth.password"),type:"password",disabled:a}))),o(it,{sx:{padding:"0 1em 1em 1em"}},o(ot,{variant:"contained",type:"submit",color:"primary",disabled:a,fullWidth:!0},a&&o(at,{sx:{position:"absolute"},size:18,thickness:2}),c)))))},wr=e=>{var t;const{options:n=[],icon:i,label:a,disabled:l,...s}=e,[c,d]=r(!1),u=m(),[p,g]=r(0),f=G(e);return o(x,Object.assign({sx:{display:"inline-block"}},(({...e})=>e)(s)),o(K,{size:"large",className:"add-filter",label:a,onClick:e=>{e.preventDefault(),d(!0),u.current=e.currentTarget},title:n[p].label,disabled:l},(null===(t=n[p])||void 0===t?void 0:t.icon)||i),o(lt,{open:c,anchorEl:u.current,onClose:e=>{u.current&&u.current.contains(e.target)||d(!1)}},n.map((e,t)=>o(st,{key:e.label,disabled:e.disabled,selected:t===p,onClick:o=>{((e,o)=>{g(o),d(!1)})(0,t),e.onClick&&e.onClick(o,t)},resource:f,title:e.label},e.icon,o(x,{component:"span",sx:{paddingRight:"4px"}}),o(De,{label:e.label,resource:f})))))},Tr=e=>{const{fields:t,className:n,...r}=e,{campos:i,separador:a="",secundario:l=[],hasSecundario:s}=t,c=X(),d=i.map(e=>void 0!==c[e]?c[e]:e).join(""+a);return o(Qo,Object.assign({noWrap:!0,variant:"inherit",className:n},r),d,s&&o(Qo,{component:"span",display:"block",color:"textSecondary",variant:"caption"},l.map(e=>`${e.etiqueta||"---"}: ${c[e.campo]||"---"}`).join(" ")))},Or=fo(e=>{const{useFormulario:t=At,...n}=e,r=Ae(n),{record:a,isLoading:l}=r,{fichaProps:s}=_n(e),c=i(()=>({estado:"M",initialValues:a,isLoading:l,fichaProps:s}),[a,l,s]);return o(wt,null,o(zt.Provider,{value:c},o(Be,Object.assign({},n,r,null==s?void 0:s.panel))))},{name:"FormEtriek",overridesResolver:(e,o)=>o.root})(({theme:e})=>or(e)),Rr=e=>{const{icon:t=Pr,label:n="ra.action.show",scrollToTop:r=!0,...i}=e,a=G(e),l=X(e),s=ae();return l?o(pn,Object.assign({component:so,to:s({type:"show",resource:a,id:l.id}),state:Sr[String(r)],label:n,onClick:Nr},i),t):null},Sr={true:{_scrollToTop:!0},false:{}},Pr=o(ct,null),Nr=e=>e.stopPropagation();Rr.propTypes={icon:bo.element,label:bo.string,record:bo.any,scrollToTop:bo.bool};const jr=p(Rr,(e,o)=>e.resource===o.resource&&(e.record&&o.record?e.record.id===o.record.id:e.record==o.record)&&e.label===o.label&&e.disabled===o.disabled),Fr=e=>{const{children:t,className:i,component:a=Mr,formRootPathname:l,syncWithLocation:s=!0,tabs:m=_r,toolbar:p=Er,onChange:g,...f}=e,h=co(),b=mo(""),v=G(e),[y,C]=r(0),{fichaProps:{etrs:x}}=n(zt),k=qt({...e,etrs:x}),{estado:w}=n(zt),T=(e,o)=>{s||(C(o),g&&g(k,w,{newTab:o,prevTab:y,setTab:C},e))},O=()=>d(m,{onChange:T,syncWithLocation:s,url:l,value:y},t);return o(Lr,Object.assign({className:lr("tabbed-form",i)},Ir(f)),s?o(po,null,o(go,{path:"/*",element:O()})):O(),o(E,null),o(a,null,c.map(t,(e,o)=>{if(!e)return null;const t=qe(e,o),n=s?!uo(`${b.pathname}/${t}`,h.pathname):y!==o;return u(e)?d(e,{intent:"content",resource:v,hidden:n,value:s?t:o}):null})),!1!==p?p:null)},_r=o(ze,null),Mr=({children:e})=>o(j,null,e),Er=o(We,null),Lr=fo("div",{name:"RaTabbedForm",overridesResolver:(e,o)=>o.root})(({theme:e})=>({"& .MuiTab-root.RaTabbedForm-errorTabButton":{color:e.palette.error.main}})),Ir=({...e})=>e,Dr=e=>{const{...t}=e,n=(()=>{const e=co(),o=uo(":resource/create/*",e.pathname),t=uo(":resource/:id/*",e.pathname);return o?o.pathnameBase:t?t.pathnameBase:""})();return o(re,Object.assign({formRootPathname:n},t),o(Fr,Object.assign({formRootPathname:n},Ar(e))))};Dr.Tab=Ve;const Ar=({...e})=>e,Br=e=>{const{initialValues:t,fichaProps:{config:r={}}}=n(zt),i=nr(e);return t?o(Dr,Object.assign({mode:"onBlur"},e,{onSubmit:i,defaultValues:t,component:gr},r)):null};Br.defaultProps={syncWithLocation:!1};const Vr={...$e,palette:{...$e.palette,mode:"dark"},components:{...$e.components,MuiTextField:{defaultProps:{variant:"outlined"}},MuiFormControl:{defaultProps:{variant:"outlined"}},RaSidebar:{root:{drawerPaper:{position:"sticky"}}},RaRichTextInput:{root:{"@global":{".ra-rich-text-input":{"& .ql-editor":{"& p:not(:last-child)":{marginBottom:"0"}}}}}}}};var qr={__proto__:null,lightTheme:{...$e,palette:{...$e.palette,mode:"light"},components:{...$e.components,MuiTextField:{defaultProps:{variant:"outlined"}},MuiFormControl:{defaultProps:{variant:"outlined"}},RaSidebar:{root:{drawerPaper:{position:"sticky"}}},RaRichTextInput:{root:{"@global":{".ra-rich-text-input":{"& .ql-editor":{"& p:not(:last-child)":{marginBottom:"0"}}}}}}}},darkTheme:Vr};dt.ra.page.empty="No records yet";const zr={...dt,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}"}};ut.ra.notification.created="Datos guardados correctamente",ut.ra.action.bulk_actions="1 seleccionado |||| %{smart_count} seleccionados",ut.ra.page.dashboard="Inicio",ut.ra.page.empty="Sin registros todavía",ut.ra.page.invite="¿Quiere agregar uno?",ut.ra.page.list="%{name}",ut.ra.page.edit="Editar %{name}",ut.ra.action.back="Volver",ut.ra.message.delete_title="Eliminar",ut.ra.input.file.upload_single="Seleccione o arrastre archivo";const Wr={...ut,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}"}},$r=e=>{const{propsContenido:t,hidden:n}=$t(e),r=X(),i=JSON.parse(JSON.stringify(r)),a=i[e.source];return i[e.source]=""!=a&&"0"!=a,!n&&o(He,Object.assign({},t,{record:i}))},Hr=e=>{const{source:o}=e,{estado:t,isLoading:r,fichaProps:i={}}=n(zt),a=n(Wt),l=void 0!==a,s=Vo(e=>{const t=e.configInputs?e.configInputs.filter(e=>e.id===o):[];return t[0]?t[0]:null}),{disabled:c,hidden:d,required:u,error:p}=s||{},g=!0===u?Gn:void 0,f="function"==typeof p?p:()=>p,{[o]:h={},etrs:b}=i,{onFocus:v,onChange:y,onBlur:C,hidden:x=!1,disabled:k=!1,validate:w,...T}=e,{field:O}=ee(e),{onFocus:R,onBlur:S,onChange:P,hidden:N,disabled:j,useContenido:F=At,validate:_,...M}=h,E=l||void 0===N?x:N,L=l||void 0===j?k:j,I=l||void 0===R?v:R,D=l||void 0===S?C:S,A=l||void 0===P?y:P,B=qt({...e,etrs:b,asisEtr:a}),V=F({...T,estado:t,hidden:E,isLoading:r,utils:B,...M}),q=m(O.value);if(void 0===V)throw new Error(`useContenido está devolviendo undefined para el contenido ${o}\n Asegúrese de incluir una instrucción return al final de la función`);const{hidden:z,disabled:W,onFocus:$,onChange:H,onBlur:G,validate:U,...J}=V,Q=$||I,Y=G||D,Z=H||A,K={...B,prev:q.current};return{propsContenido:{sx:{m:1},onFocus:e=>{Q&&I(B,t,e),q.current=e.target.value},onBlur:e=>Y&&Y(K,t,e),onChange:e=>Z&&Z(K,t,e),helperText:!1,validate:[...Array.isArray(w)?w:[w],...Array.isArray(_)?_:[_],...Array.isArray(U)?U:[U],g,f].filter(e=>void 0!==e),...T,...M,...J,disabled:void 0!==c?c:void 0!==W?W:L},hidden:void 0!==d?d:void 0!==z?z:E}},Gr=e=>{const{propsContenido:t,hidden:n}=Hr(e),{options:r={},disabled:i=!1,...a}=t,l=X();return!n&&o(Ge,Object.assign({accept:"",maxSize:5e6},a,{options:{disabled:i,...r}}),o(Ue,{source:t.source,title:"Ver",record:l}))},Ur=e=>{const{propsContenido:{sx:t,...n},hidden:r}=Hr(e);return!r&&o(Je,Object.assign({},n,{sx:{...t,display:"inline-flex",margin:1}}))},Jr=e((e,t)=>o(R,Object.assign({ref:t},e))),Qr=e=>{var t;const{callback:n,sx:r,isTC:i,onChange:a,...l}=e,{isLoading:c,allChoices:d}=Ye(),u=m(null);return s(()=>{c||"function"==typeof n&&n(Object.values([d]))},[d,n,c]),o(Jr,{title:(null===(t=u.current)||void 0===t?void 0:t.value)||"",placement:"top",arrow:!0},o(x,{component:"span",sx:i?{margin:1,...r}:{display:{md:"inline-flex"},margin:1,...r},width:i?{}:{xs:"100%",md:"auto"}},o(Ze,Object.assign({size:"small",sx:i?{width:"100% !important"}:{}},l,{onChange:e=>{a({target:{value:e}})},TextFieldProps:{inputRef:u}}))))},Yr=e=>{const{propsContenido:t,hidden:n}=Hr(e),r=Bo(),{source:i,reference:a}=e,l=Vo(e=>{const o=e.reload_cb?e.reload_cb.filter(e=>e.id===i):[];return o[0]?o[0]:null}),c=m(l),d=null===l&&c.current?c.current:l;let u,p;if(d){const{callback:e,...o}=d;u=e,p=o}return s(()=>{null!==l&&(c.current=l,r(Rt(i)))},[JSON.stringify(l)]),n?null:o(Qe,{reference:a,source:i,perPage:500,filter:p},o(Qr,Object.assign({},t,{callback:u,optionText:"etiqueta",optionValue:i})))},Zr=e=>{const{propsContenido:t,hidden:n}=Hr(e);return!n&&o(Ke,t)},Kr=e=>{const{title:t,source:n,src:r}=e,i=X(e);return o(nt,{title:t,src:`${r}/${i[n]}`})},Xr=e=>{const{propsContenido:t,hidden:n}=Hr(e),{source:r,reference:i}=e;return n?null:o(Xe,{source:r,reference:i},o(eo,Object.assign({},t,{optionText:"etiqueta",optionValue:e.source})))},ei=e=>{const{propsContenido:t,hidden:n}=Hr(e);return!n&&o(Ie,t)},oi=e=>{const{propsContenido:t,hidden:r}=Hr(e),{isLoading:i}=n(zt),{source:a,reference:l}=e;return i||r?null:o(Qe,{source:a,reference:l},o(oo,Object.assign({},t,{optionText:"etiqueta",optionValue:e.source})))},ti=e=>{const{propsContenido:t,hidden:n}=Hr(e);return!n&&o(oo,t)},ni=e=>o(bt,{handle:"#draggable-dialog-title",cancel:'[class*="MuiDialogContent-root"]'},o(N,e)),ri={cursor:"move"},ii=e=>{const{isOpen:t,isLoading:n,title:r,content:i,cancel:l,ConfirmIcon:s,CancelIcon:c,onClose:d,onConfirm:u,contentResource:m,translateOptions:p={}}=e,g=L(),[f]=to(m),h=a((e,o)=>{e.stopPropagation(),u(e,f)},[f,u]),b=a(e=>{e.stopPropagation()},[]);return o(Ro,{open:t,onClose:d,onClick:b,fullWidth:!0,maxWidth:"lg",PaperComponent:ni,"aria-labelledby":"draggable-dialog-title"},o(jo,{style:ri,id:"draggable-dialog-title"},g(r,{_:r,...p})),o(Po,{dividers:!0},i),o(So,null,o(ot,{disabled:n,onClick:d},o(c,{sx:{paddingRight:"0.5em"}}),g(l,{_:l})),o(ot,{disabled:n,onClick:e=>h(e,"yes"),autoFocus:!0},o(s,{sx:{paddingRight:"0.5em"}}),g("ra.action.confirm"))))};ii.propTypes={cancel:bo.string,classes:bo.object,confirm:bo.string,confirmColor:bo.string,ConfirmIcon:bo.elementType,CancelIcon:bo.elementType,content:bo.node.isRequired,isOpen:bo.bool,isLoading:bo.bool,onClose:bo.func.isRequired,onConfirm:bo.func.isRequired,title:bo.string.isRequired},ii.defaultProps={cancel:"ra.action.cancel",classes:{},confirmColor:"primary",ConfirmIcon:ft,CancelIcon:ht,isOpen:!1};const ai=()=>o(l,null),li={seleccion:[],all:!0,none:!1},si=e=>!e||null!=e&&e.all?"Todos":null!=e&&e.none||0===e.seleccion.length?"Ninguno":`Selección (${e.seleccion.length})`,ci=e=>e,di=e=>{const{disabled:t,asistant:n,asistantResource:i,label:c,source:d,sx:u,...m}=e,[p,g]=r(!1),f=Do();s(()=>{b()},[]);const h=a(()=>{g(!1)},[g]),b=e=>{f.setValue(d,{seleccion:[],all:!0,none:!1})};return o(l,null,o(x,{display:"flex",alignItems:"center",sx:{...u,display:"inline-flex",margin:1}},o(Le,Object.assign({defaultValue:li},m,{source:d,label:c,disabled:!0,parse:ci,format:si,helperText:!1,InputProps:{endAdornment:o(l,null,o(Xo,{onClick:e=>{f.setValue(d,{seleccion:[],all:!1,none:!0})},disabled:t,"aria-label":"Ninguno",size:"small",title:"Ninguno"},o(pt,null)),o(Xo,{onClick:b,disabled:t,"aria-label":"Todos",size:"small",title:"Todos"},o(mt,null)),o(Xo,{onClick:e=>g(!0),disabled:t,"aria-label":"Selección",size:"small",title:"Selección"},o(gt,null)))}}))),o(ii,{isOpen:p,title:"Selección de "+c,contentResource:i,content:o(n,{bulkActionButtons:o(ai,null),hasCreate:!1,exporter:!1,resource:i}),onConfirm:(e,o)=>{g(!1),f.setValue(d,{seleccion:o,all:!1,none:!1})},onClose:h}))},ui=e=>o(no,Object.assign({},e,{hasCreate:!1,exporter:!1,perPage:50,empty:!1,title:" ",disableSyncWithLocation:!0}),o(ro,{bulkActionButtons:o("span",null)},o(Y,{source:"funced",sortable:!0,label:"Cédula"}),o(Y,{source:"funpriape",sortable:!0,label:"Apellido"}),o(Y,{source:"funprinom",sortable:!0,label:"Nombre"}))),mi={fillista:"empcod=-1"},pi=e=>{const[t,n]=r(mi),i=q(),l=a(e=>{n({fillista:e.node.key})},[n]),s=a(e=>i.getChildNodes("form_224",{parentId:e?e.itemData.id:""}).then(e=>e.data).catch(()=>{throw new Error("Data Loading Error")}),[i]);return o(x,{display:"flex",flex:1,alignItems:"flex-start",height:"20em"},o(x,{flexGrow:1},o(vt,{id:"funcionarios-treeview",dataStructure:"plain",rootValue:"",onItemClick:l,createChildren:s})),o(x,{flexGrow:2},o(ui,{resource:"form_224",filter:t})))},gi=e=>o(bt,{handle:"#draggable-dialog-title",cancel:'[class*="MuiDialogContent-root"]'},o(N,e)),fi={cursor:"move"},hi=e=>{const{isOpen:t,isLoading:n,title:r,cancel:i,ConfirmIcon:l,CancelIcon:s,onClose:c,onConfirm:d,translateOptions:u={}}=e,m=L(),p=a((e,o)=>{e.stopPropagation(),d(e,o)},[d]),g=a(e=>{e.stopPropagation()},[]);return o(Ro,{open:t,onClose:c,onClick:g,fullWidth:!0,maxWidth:"lg",PaperComponent:gi,"aria-labelledby":"draggable-dialog-title"},o(jo,{style:fi,id:"draggable-dialog-title"},m(r,{_:r,...u})),o(Po,{dividers:!0},o(pi,null)),o(So,null,o(ot,{disabled:n,onClick:c},o(s,{sx:{paddingRight:"0.5em"}}),m(i,{_:i})),o(ot,{disabled:n,onClick:e=>p(e,"yes"),autoFocus:!0},o(l,{sx:{paddingRight:"0.5em"}}),m("ra.action.confirm"))))};hi.propTypes={cancel:bo.string,classes:bo.object,confirm:bo.string,confirmColor:bo.string,ConfirmIcon:bo.elementType,CancelIcon:bo.elementType,isOpen:bo.bool,isLoading:bo.bool,onClose:bo.func.isRequired,onConfirm:bo.func.isRequired,title:bo.string.isRequired},hi.defaultProps={cancel:"ra.action.cancel",classes:{},confirmColor:"primary",ConfirmIcon:ft,CancelIcon:ht,isOpen:!1};const bi={seleccion:[],all:!0,none:!1},vi=e=>!e||null!=e&&e.all?"Todos":null!=e&&e.none||0===e.seleccion.length?"Ninguno":`Selección (${e.seleccion.length})`,yi=e=>e,Ci=e=>{const{disabled:t,label:n="Funcionarios",allowNone:i=!0,source:c,sx:d,...u}=e,[m]=to("form_224"),[p,g]=r(!1),f=Do();s(()=>{b()},[]);const h=a(()=>{g(!1)},[g]),b=e=>{f.setValue(c,{seleccion:[],all:!0,none:!1})};return o(l,null,o(x,{display:"flex",alignItems:"center",sx:{...d,display:"inline-flex",margin:1}},o(Le,Object.assign({defaultValue:bi},u,{source:c,label:n,disabled:!0,parse:yi,format:vi,helperText:!1,InputProps:{endAdornment:o(l,null,i&&o(Xo,{onClick:e=>{f.setValue(c,{seleccion:[],all:!1,none:!0})},disabled:t,"aria-label":"Ninguno",size:"small",title:"Ninguno"},o(pt,null)),o(Xo,{onClick:b,disabled:t,"aria-label":"Todos",size:"small",title:"Todos"},o(mt,null)),o(Xo,{onClick:e=>g(!0),disabled:t,"aria-label":"Selección",size:"small",title:"Selección"},o(gt,null)))}}))),o(hi,{isOpen:p,title:"Selección de "+n,onConfirm:(e,o)=>{g(!1),f.setValue(c,{seleccion:m,all:!1,none:!1})},onClose:h}))},xi=e=>{const{propsContenido:t,hidden:n}=Hr(e);return!n&&o(Le,Object.assign({multiline:!0},t))},ki=e=>{const{tipo:t,...n}=e,{propsContenido:r,hidden:i}=Hr(n),a=Do();s(()=>{r.value&&a.setValue(e.source,r.value)});const l={...r};return i?null:"N"===t||"D"===t?o(io,l):"F"===t?o(ao,l):"Z"===t?o(lo,l):o(Le,"H"===t?Object.assign({},l,{type:"time"}):l)},wi=e=>{const{source:t,label:n,sx:r}=e,{hidden:i}=Hr(e);return i?null:o(x,{sx:{...r,display:"inline-flex",alignItems:"flex-start",marginLeft:1,marginBottom:-1,width:{xs:"100%",md:"calc(24vw + 1em)"}}},o(Le,Object.assign({},e,{label:"",source:t,sx:{flex:1,marginTop:1}})),o(Yr,Object.assign({},e,{source:t,label:n,isTC:!0,sx:{flex:3}})))};export{xt as AppBar,$r as BooleanField,Gr as Camino,Ur as CheckBox,Yr as ComboBox,Zr as ComboBoxManual,ir as CreateEtriek,vn as CreateGridButton,sr as DeleteButtonNoWarning,dr as EditEtriek,kn as EditGridButton,dn as EtrGrid,Hn as FichaActions,zt as FichaContext,hi as FiltroFuncionarios,er as FormClasses,ur as FormDialog,fr as FormEtriek,mn as GE,pn as GridButton,jn as GrillaEtriek,Kr as ImageField,yr as Layout,xr as ListActionsEtriek,Xr as ListCheck,kr as Login,vr as Menu,wr as MenuButton,Tr as MultiTextField,ei as Password,oi as RadioButton,ti as RadioButtonManual,$n as Separador,Or as ShowEtriek,jr as ShowGridButton,hr as SubMenu,Ci as TBSF,Br as TabbedFormEtriek,Fn as TabbedGrillaEtriek,xi as TextArea,ki as TextBox,di as TextBoxSelection,wi as TextCombo,Ht as TextField,Zn as choicesEstado,Dn as dateFormat,Jn as dateFormatOptions,An as dateParser,Vn as dateTimeFormat,qn as dateTimeParser,Rt as deleteRecargarComboBox,Kn as descargarLink,zr as enMessages,Wr as esMessages,Qn as etrFechaMayorQue,Gn as etrRequerido,Un as etrRequeridoNumerico,En as getFormcodFromResource,Yn as localeOptions,Ot as recargarComboBox,Gt as renderCellComboBox,Pt as setDisableAction,jt as setErrorAction,St as setHiddenAction,Nt as setRequireAction,qr as themes,zn as timeFormat,Wn as timeParser,Dt as useAjax,Hr as useContenidoController,Zt as useEtrActions,$t as useFieldController,Tt as useFormProgress,nr as useFormSubmit,It as useGetJson,_n as useInitFicha,Mn as useNuevo,Xn as useReferenceLabel,qt as useUtils,Bt as useUtilsGrilla,Vt as useUtilsSubmit};
|
|
2
|
+
//# sourceMappingURL=index.modern.js.map
|