biblio-react 2.0.0-alpha108 → 2.0.0-alpha109

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.
@@ -1,2 +1,2 @@
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 w,createTheme as k,StyledEngineProvider as T,Stack as O,Tooltip as R,IconButton as S,ThemeProvider as P,CardContent as N,CircularProgress as F,Collapse as _,List as j,Divider as M,Paper 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 $,useRedirect as W,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 we,SimpleForm as ke,useSidebarState as Te,MenuItemLink as Oe,Menu as Re,DashboardMenuItem as Se,Layout as Pe,FilterContext as Ne,sanitizeListRestProps as Fe,FilterButton as _e,CreateButton as je,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 $e,defaultTheme as We,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 wo from"@mui/icons-material/Add";import ko 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 Fo from"@mui/material/DialogTitle";import _o from"@mui/material/Paper";import{esES as jo,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{GridActionsCellItem as zo}from"@mui/x-data-grid";import $o from"@mui/icons-material/Create";import Wo from"@mui/material/Divider";import Ho from"@mui/material/Tab";import Go from"@mui/material/Tabs";import Uo from"@mui/icons-material/ChevronLeft";import Jo from"@mui/material/Typography";import"@mui/styles";import{isAfter as Qo}from"date-fns";import Yo from"date-fns/locale/en-US";import Zo from"date-fns/locale/es";import Ko from"@mui/material/IconButton";import Xo from"@mui/material/Tooltip";import et from"@mui/material/Button";import ot from"@mui/icons-material/Settings";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}}))},wt=t(),kt=({children:e})=>{const[t,n]=r(!1),a=i(()=>({open:t,show:()=>n(!0),hide:()=>n(!1)}),[t]);return o(wt.Provider,{value:a},e)},Tt=()=>n(wt),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}}),Ft=(e,o)=>({type:"ERROR_INPUT",payload:{id:e,error:o}}),_t=()=>{const e=Bo();return a((o,t,n,r)=>{e(Ot(o,t,n,r))},[e])},jt=()=>{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(Ft(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=$(),n=W(),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=_t(),t=jt(),n=Mt(),r=Et(),i=Lt(),a=Tt(),l=$(),s=W(),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=_t(),t=jt(),n=Mt(),r=Et(),i=Lt(),l=Tt(),s=$(),c=W(),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({}),$t=t(void 0),Wt=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}=Wt(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:w(e.palette.primary.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}})),on={},tn=e=>{const t=Do();return o($t.Provider,{value:{form:t}},e.children)},nn=e=>o(Ro,{open:e.open,onClose:e.onClose,fullWidth:!0},o(Fo,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($t),{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(ko,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(wo,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=k({},jo),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:w=!1}=x,[k,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)||[])}}),F=[...c,{field:" ",width:80,headerName:"",headerAlign:"center",sortable:!1,disableClickEventBubbling:!0,renderCell:e=>o(ln,Object.assign({},f,{enviarTodo:w,camposClaveFila:a,row:e.row}))}];u&&F.unshift({field:"BTN",headerName:"",sortable:!1,renderHeader:e=>o(an,Object.assign({},f,{enviarTodo:w,camposClaveFila:a}))}),m&&F.push({field:" ",headerName:"",headerAlign:"center",sortable:!1,disableClickEventBubbling:!0,renderCell:e=>o(sn,Object.assign({},f,{enviarTodo:w,camposClaveFila:a,row:e.row}))});const _=i(()=>F,[JSON.stringify(F)]);return o(_o,{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:_,sortModel:k,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=k({},jo),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:w={}}=n(zt),k=qt(e),{[e.source]:O={}}=w,{useContenido:R=At,restInitialProps:S}=O,{data:P=[],isLoading:N,refetch:F}=oe(s,{pagination:{page:1,perPage:200},sort:{field:h,order:b},filter:y},{enabled:c&&!m}),_=Lo(),j=Io({apiRef:_,initialState:d});return R({...u,estado:C,hidden:e.hidden,isLoading:x,utils:k,...S,refetch:F,apiRef:_}),o(_o,{sx:{width:"100%",height:"40vh",borderRadius:0,marginTop:1}},o(T,{injectFirst:!0},o(ho,{theme:un},o(Mo,Object.assign({apiRef:_,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:j},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(wo,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),wn=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},kn=(e,o)=>void 0===o||"function"==typeof o&&o(e),Tn=k({},jo),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,...p}=e,g=Bt(e),f=L(),h=G(e),{data:b=[],isLoading:v,selectedIds:y,onSelect:C,displayedFilters:w,setFilters:k}=z(),T=Lo(),O=Io({apiRef:T,initialState:{...c,pinnedColumns:{right:["actions"]}}}),R=i.map((e,o)=>({...e,headerName:""!==e.headerName?f(`resources.${h}.fields.${e.field}`,{_:e.headerName}):e.headerName})),S=t.length>0||s?R.concat([{field:"actions",type:"actions",width:100,hideable:!1,getActions:e=>{const n=T.current.getRowNode(e.id);return e.row.id?[...s?[o(wn,{record:e.row,disabled:!kn(e.row,a)})]:[],...t.map(t=>{const{handler:n,...r}=t;return o(zo,Object.assign({showInMenu:!0,onClick:o=>"function"==typeof n&&n({...g,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})]:[]}}]):R,N=u(n);return o(se,{sx:r,className:ce.root},N?o(de,{selectedIds:y},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:S,rows:b,apiRef:T,loading:v,hideFooterSelectedRowCount:!0,hideFooter:!0,disableMultipleRowSelection:!0,checkboxSelection:N,filterMode:"server",onFilterModelChange:e=>{k(d(e),w)},rowSelectionModel:y,onRowSelectionModelChange:e=>{v||(T.current.isRowSelected(e[0])?C([]):C(e))},isRowSelectable:e=>e.row.id,initialState:O},p)))))},Nn=e=>{const{sx:t,columns:n,hasEdit:r,isRowEditable:i,primaryText:a,secondaryText:l}=e,s=n.length;let c=a,d=l;return a||(s>=4?c=e=>`${e[n[0].field]} - ${e[n[0].field]}`:s>=3||s>=2?c=e=>`${e[n[0].field]} - ${e[n[1].field]}`:1===s&&(c=e=>e[n[0].field])),l||(s>=4?d=e=>`${e[n[2].field]} - ${e[n[3].field]}`:s>=3?d=e=>e[n[2].field]:s>=2?c=e=>`${e[n[0].field]} - ${e[n[1].field]}`:1===s&&(c=e=>e[n[0].field])),o(ue,{linkType:e=>!(!r||!kn(e,i))&&"edit",primaryText:c,secondaryText:d,sx:t})},Fn=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}))},_n=e=>{const{filterValues:t,setFilters:n,tabs:{ids:r,...i},GridComponent:a=Fn,...s}=e,c=t.id;return o(l,null,o(Go,{value:c,indicatorColor:"primary",onChange:(e,o)=>{n({...t,id:o})}},r.map(e=>o(Ho,{key:e,label:e.charAt(0).toUpperCase()+e.slice(1),value:e}))),o(Wo,null),o(a,Object.assign({},s,i[c])))},jn=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()}},$n=(e,o)=>e?e.split(" ")[4].substring(0,5):"",Wn=e=>o(Jo,{variant:"h6",gutterBottom:!0},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(Uo,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(Qo(e,t))return{message:"validation.greater_or_equal",args:{menor:n}}}},Yn=(e="es")=>({locale:"en"===e?Yo:Zo}),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=$(),{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}=jn(e),d=i(()=>({estado:"N",initialValues:l,isLoading:s,fichaProps:c}),[l,s,c]);return o(kt,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(Xo,{title:t("ra.action.delete")},o(Ko,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}=jn(e),d=i(()=>({estado:"M",initialValues:l,isLoading:s,fichaProps:c}),[l,s,c]);return o(kt,null,o(zt.Provider,{value:d},o(we,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(Fo,{id:"form-dialog-title"},a),o(Po,null,o(No,null,l),s),(c||d)&&o(So,null,d&&o(et,{onClick:m,variant:"contained",color:"secondary",sx:{margin:1},disabled:u},"Cancelar"),c&&o(et,{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(N,{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(ke,Object.assign({mode:"onBlur"},e,{onSubmit:i,defaultValues:t,component:gr},r)):null};fr.propTypes={...ke.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(j,{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(ot,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(ot,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(ot,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),w={...Bt(e),...x};return i(()=>o(pe,Object.assign({className:t},Fe(u)),l?null:r?d(r,{resource:v,showFilter:h,displayedFilters:p,filterValues:g,context:"button"}):C&&o(_e,null),y&&o(je,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(w,e.key)},options:e.props.options?e.props.options.map(o=>({...o,onClick:t=>{e.props.onClick&&e.props.onClick(t),s(w,o.key)}})):null}))),[v,p,g,r,h,C,b,t,m,l,f,y])},wr=e=>{const{loginBackgroundImage:t,nameSource:n="username",passwordSource:i="password"}=e,[a,l]=r(!1),s=L(),c=s("ra.auth.sign_in"),d=$(),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(et,{variant:"contained",type:"submit",color:"primary",disabled:a,fullWidth:!0},a&&o(at,{sx:{position:"absolute"},size:18,thickness:2}),c)))))},kr=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(Jo,Object.assign({noWrap:!0,variant:"inherit",className:n},r),d,s&&o(Jo,{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}=jn(e),c=i(()=>({estado:"M",initialValues:a,isLoading:l,fichaProps:s}),[a,l,s]);return o(kt,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 Fr=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),_r=e=>{const{children:t,className:i,component:a=Mr,formRootPathname:l,syncWithLocation:s=!0,tabs:m=jr,toolbar:p=Er,onChange:g,...f}=e,h=co(),b=mo(""),v=G(e),[y,C]=r(0),{fichaProps:{etrs:x}}=n(zt),w=qt({...e,etrs:x}),{estado:k}=n(zt),T=(e,o)=>{s||(C(o),g&&g(w,k,{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(M,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)},jr=o(ze,null),Mr=({children:e})=>o(N,null,e),Er=o($e,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(_r,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={...We,palette:{...We.palette,mode:"dark"},components:{...We.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:{...We,palette:{...We.palette,mode:"light"},components:{...We.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 $r={...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}"}},Wr=e=>{const{propsContenido:t,hidden:n}=Wt(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($t),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:w=!1,validate:k,...T}=e,{field:O}=ee(e),{onFocus:R,onBlur:S,onChange:P,hidden:N,disabled:F,useContenido:_=At,validate:j,...M}=h,E=l||void 0===N?x:N,L=l||void 0===F?w:F,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=_({...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:$,onFocus:W,onChange:H,onBlur:G,validate:U,...J}=V,Q=W||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(k)?k:[k],...Array.isArray(j)?j:[j],...Array.isArray(U)?U:[U],g,f].filter(e=>void 0!==e),...T,...M,...J,disabled:void 0!==c?c:void 0!==$?$: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(E,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(Fo,{style:ri,id:"draggable-dialog-title"},g(r,{_:r,...p})),o(Po,{dividers:!0},i),o(So,null,o(et,{disabled:n,onClick:d},o(c,{sx:{paddingRight:"0.5em"}}),g(l,{_:l})),o(et,{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(Ko,{onClick:e=>{f.setValue(d,{seleccion:[],all:!1,none:!0})},disabled:t,"aria-label":"Ninguno",size:"small",title:"Ninguno"},o(pt,null)),o(Ko,{onClick:b,disabled:t,"aria-label":"Todos",size:"small",title:"Todos"},o(mt,null)),o(Ko,{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(E,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(Fo,{style:fi,id:"draggable-dialog-title"},m(r,{_:r,...u})),o(Po,{dividers:!0},o(pi,null)),o(So,null,o(et,{disabled:n,onClick:c},o(s,{sx:{paddingRight:"0.5em"}}),m(i,{_:i})),o(et,{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(Ko,{onClick:e=>{f.setValue(c,{seleccion:[],all:!1,none:!0})},disabled:t,"aria-label":"Ninguno",size:"small",title:"Ninguno"},o(pt,null)),o(Ko,{onClick:b,disabled:t,"aria-label":"Todos",size:"small",title:"Todos"},o(mt,null)),o(Ko,{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))},wi=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)},ki=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,Wr 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,wn 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,Fn as GrillaEtriek,Kr as ImageField,yr as Layout,xr as ListActionsEtriek,Xr as ListCheck,wr as Login,vr as Menu,kr as MenuButton,Tr as MultiTextField,ei as Password,oi as RadioButton,ti as RadioButtonManual,Wn as Separador,Or as ShowEtriek,Fr as ShowGridButton,hr as SubMenu,Ci as TBSF,Br as TabbedFormEtriek,_n as TabbedGrillaEtriek,xi as TextArea,wi as TextBox,di as TextBoxSelection,ki 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,$r 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,Ft as setErrorAction,St as setHiddenAction,Nt as setRequireAction,qr as themes,zn as timeFormat,$n as timeParser,Dt as useAjax,Hr as useContenidoController,Zt as useEtrActions,Wt as useFieldController,Tt as useFormProgress,nr as useFormSubmit,It as useGetJson,jn as useInitFicha,Mn as useNuevo,Xn as useReferenceLabel,qt as useUtils,Bt as useUtilsGrilla,Vt 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,...p}=e,g=Bt(e),f=L(),h=G(e),{data:b=[],isLoading:v,selectedIds:y,onSelect:C,displayedFilters:k,setFilters:w}=z(),T=Lo(),O=Io({apiRef:T,initialState:{...c,pinnedColumns:{right:["actions"]}}}),R=i.map((e,o)=>({...e,headerName:""!==e.headerName?f(`resources.${h}.fields.${e.field}`,{_:e.headerName}):e.headerName})),S=t.length>0||s?R.concat([{field:"actions",type:"actions",width:100,hideable:!1,getActions:e=>{const n=T.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({...g,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})]:[]}}]):R,N=u(n);return o(se,{sx:r,className:ce.root},N?o(de,{selectedIds:y},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:S,rows:b,apiRef:T,loading:v,hideFooterSelectedRowCount:!0,hideFooter:!0,disableMultipleRowSelection:!0,checkboxSelection:N,filterMode:"server",onFilterModelChange:e=>{w(d(e),k)},rowSelectionModel:y,onRowSelectionModelChange:e=>{v||(T.current.isRowSelected(e[0])?C([]):C(e))},isRowSelectable:e=>e.row.id,initialState:O},p)))))},Nn=e=>{const{sx:t,columns:n,actionButtons:r=[],hasEdit:i,isRowEditable:a,primaryText:l}=e;let s=l;const c=Bt(e);return l||(s=e=>o(N,{variant:"outlined",sx:{pt:2,pb:2,pl:2}},n.map(t=>{const{field:n,headerName:r,valueGetter:i,type:a="string",jsxMobile:l}=t;return o(x,null,l?l(e,t):"boolean"===a?o(x,{component:"span",sx:{color:i({value:e[n]})?"green":"red"}},r):e[n])}),o(x,null,r.map(t=>{const{key:n,handler:r,icon:i=o(zo,null),...a}=t;return o(K,Object.assign({onClick:o=>"function"==typeof r&&r({...c,record:e},n)},a),i)})))),o(ue,{linkType:e=>!(!i||!wn(e,a))&&"edit",primaryText:s,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=>o(Qo,{variant:"h6",gutterBottom:!0},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 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
2
  //# sourceMappingURL=index.modern.js.map