import{aj as A,ak as B,a5 as w,ah as C,r as l,aU as j,af as W,j as e,au as z,ar as R,o as r,q as k,w as d,H as T,aB as H,u as M,A as U,k as $,B as x,y as D}from"./index-28356639.js";import{u as E}from"./useConfig-25a03f57.js";import{b as I,p as L}from"./env-198ff0f3.js";import{d as P,C as _,G as f}from"./MoreVert-47b3685e.js";import{C as v}from"./Card-69a23e86.js";import{C as q}from"./CardHeader-cc36f3ee.js";import{A as N}from"./Avatar-daca08cc.js";import{C as y}from"./CardContent-4a2fea3f.js";import{a as G}from"./pwdpromptLogo-90b3250a.js";function J(t){return A("MuiCardActions",t)}B("MuiCardActions",["root","spacing"]);const X=["disableSpacing","className"],K=t=>{const{classes:o,disableSpacing:s}=t;return R({root:["root",!s&&"spacing"]},J,o)},Q=w("div",{name:"MuiCardActions",slot:"Root",overridesResolver:(t,o)=>{const{ownerState:s}=t;return[o.root,!s.disableSpacing&&o.spacing]}})(({ownerState:t})=>C({display:"flex",alignItems:"center",padding:8},!t.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})),V=l.forwardRef(function(o,s){const n=j({props:o,name:"MuiCardActions"}),{disableSpacing:u=!1,className:p}=n,m=W(n,X),c=C({},n,{disableSpacing:u}),g=K(c);return e(Q,C({className:z(g.root,p),ownerState:c,ref:s},m))}),Y=V;function Z({user:t}){return r(v,{sx:{maxWidth:300,height:"220px",backgroundColor:"#71A63C",color:"#FFF"},children:[e(q,{avatar:e(N,{src:"",sx:{width:56,height:56},"aria-label":"recipe",alt:"user"}),action:e(k,{"aria-label":"settings",children:e(P,{})}),title:t.nombre,subheader:t.rol,sx:{color:"#FFF","& .MuiCardHeader-subheader":{color:"#FFF"}}}),r(y,{sx:{},children:[e(d,{color:"#FFF",fontWeight:700,gutterBottom:!0,fontSize:"1.2rem",component:"div",letterSpacing:1,sx:{textShadow:"0.4px 0.4px 0.4px #000"},children:"Bandeja de tramites"}),e(d,{color:"#FFF",gutterBottom:!0,fontSize:"0.8rem",component:"div",children:"Bandeja de tramites"})]}),e(Y,{sx:{backgroundColor:"#84BF49",height:"100%"},disableSpacing:!0})]})}const O="/WizardJS/assets/Recurso3-b9afce00.png";function ee({imgBackground:t,imgIcon:o,cardText:s}){return r(v,{variant:"elevation",sx:{maxWidth:300,height:"220px",position:"relative"},children:[e("div",{style:{backgroundImage:`url(${t||O})`,backgroundRepeat:"no-repeat",backgroundSize:"cover",objectFit:"cover",height:"150px",backgroundPositionX:"center",position:"relative"},children:e("div",{style:{display:"flex",textAlign:"center",justifyContent:"center"},children:e("img",{style:{width:"100px",marginTop:"1.5em"},src:`./assets/${o}.png`,loading:"lazy"})})}),e(y,{sx:{},children:e(d,{noWrap:!0,fontWeight:"700",fontSize:"1rem",textAlign:"center",sx:{},children:s})})]})}const le=()=>{const{loading:t,data:o,load:s}=E(),n=T();H();const[u,p]=l.useState([]),m=async()=>{await s()},{logout:c,user:g}=M(),{empresaActual:i}=l.useContext(U);l.useEffect(()=>{m(),$.post(`${I}/${L}/Engine?paquete=std.extjs&clase=Tree2JSon&metodo=getMenusRapidos&parametros=`).then(a=>{if(a.data.msg==="Acceso Denegado"){console.log("Sesión expirada"),c();return}p(a.data)})},[]);const F=()=>{const a=new Date().getHours();return a<6||a>20?"¡Buenas noches":a<12?"¡Buenos días":"¡Buenas tardes"};return r(_,{sx:{minHeight:"100vh"},children:[r(x,{sx:{},marginTop:"3rem",width:"100%",children:[e(x,{margin:"1rem auto",width:"300px",children:e("img",{style:{objectFit:"cover",maxWidth:"100%"},src:(i==null?void 0:i.EmpLogo)||G,loading:"lazy",alt:"Prompt logo"})}),r(d,{fontWeight:"bolder",noWrap:!0,fontSize:"1.7rem",textAlign:"center",children:[F(),", ",r("span",{children:["equipo ",(i==null?void 0:i.empNombre)||""]}),"!"]})]}),r(x,{sx:{marginTop:"2rem"},children:[e(d,{fontSize:"2rem",textAlign:"center",children:"Categorias"}),e(f,{container:!0,spacing:{xs:2,md:3},columns:{xs:4,sm:8,md:12},mt:2,children:u.map(({ObjIcon:a,ObjNom:h,ObjMenuLink:S},b)=>h==="Bandeja de Trámites"?e(f,{sx:{cursor:"pointer"},onClick:()=>{n(S)},xs:2,sm:2,md:3,children:e(Z,{user:g})},b):e(f,{sx:{cursor:"pointer"},onClick:()=>{h==="Salir"?D(c):n(S)},xs:2,sm:2,md:3,children:e(ee,{cardText:h,imgIcon:a})},b))})]})]})};export{le as default};
