import{$ as y,a0 as F,M as B,Y as C,r as d,ar as w,W,j as e,at as j,a8 as z,f as r,h as R,T as c,k as T,ah as k,u as H,A as M,B as x}from"./index-7ecf457b.js";import{u as $}from"./useConfig-0a0864f0.js";import{a as U,l as D}from"./api-cbc533e6.js";import{b as I,p as P}from"./env-198ff0f3.js";import{C as _,d as E,a as L,G as f}from"./MoreVert-dbd138df.js";import{C as v,a as A}from"./CardContent-85d1a348.js";import{A as N}from"./Avatar-11330c7e.js";import{a as q}from"./pwdpromptLogo-90b3250a.js";import"./createContainer-f29fb9c0.js";function G(t){return y("MuiCardActions",t)}F("MuiCardActions",["root","spacing"]);const J=["disableSpacing","className"],X=t=>{const{classes:a,disableSpacing:s}=t;return z({root:["root",!s&&"spacing"]},G,a)},Y=B("div",{name:"MuiCardActions",slot:"Root",overridesResolver:(t,a)=>{const{ownerState:s}=t;return[a.root,!s.disableSpacing&&a.spacing]}})(({ownerState:t})=>C({display:"flex",alignItems:"center",padding:8},!t.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})),K=d.forwardRef(function(a,s){const n=w({props:a,name:"MuiCardActions"}),{disableSpacing:l=!1,className:u}=n,p=W(n,J),i=C({},n,{disableSpacing:l}),g=X(i);return e(Y,C({className:j(g.root,u),ownerState:i,ref:s},p))}),Q=K;function V({user:t}){return r(v,{sx:{maxWidth:300,height:"220px",backgroundColor:"#71A63C",color:"#FFF"},children:[e(_,{avatar:e(N,{src:"",sx:{width:56,height:56},"aria-label":"recipe",alt:"user"}),action:e(R,{"aria-label":"settings",children:e(E,{})}),title:t.nombre,subheader:t.rol,sx:{color:"#FFF","& .MuiCardHeader-subheader":{color:"#FFF"}}}),r(A,{sx:{},children:[e(c,{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(c,{color:"#FFF",gutterBottom:!0,fontSize:"0.8rem",component:"div",children:"Bandeja de tramites"})]}),e(Q,{sx:{backgroundColor:"#84BF49",height:"100%"},disableSpacing:!0})]})}const Z="/WizardJS/assets/Recurso3-b9afce00.png";function O({imgBackground:t,imgIcon:a,cardText:s}){return r(v,{variant:"elevation",sx:{maxWidth:300,height:"220px",position:"relative"},children:[e("div",{style:{backgroundImage:`url(${t||Z})`,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/${a}.png`,loading:"lazy"})})}),e(A,{sx:{},children:e(c,{noWrap:!0,fontWeight:"700",fontSize:"1rem",textAlign:"center",sx:{},children:s})})]})}const le=()=>{const{loading:t,data:a,load:s}=$(),n=T();k();const[l,u]=d.useState([]),p=async()=>{await s()},{logout:i,user:g}=H(),{empresaActual:m}=d.useContext(M);return d.useEffect(()=>{p(),U.get(`${I}/${P}/Engine?paquete=std.extjs&clase=Tree2JSon&metodo=getMenusRapidos&parametros=`).then(o=>{if(o.data.msg==="Acceso Denegado"){console.log("Sesión expirada"),i();return}u(o.data)})},[]),r(L,{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:q,loading:"lazy",alt:"Prompt logo"})}),r(c,{fontWeight:"bolder",noWrap:!0,fontSize:"1.7rem",textAlign:"center",children:[(()=>{const o=new Date().getHours();return o<6||o>20?"¡Buenas noches":o<12?"¡Buenos días":"¡Buenas tardes"})(),", ",r("span",{children:["equipo ",(m==null?void 0:m.empNombre)||""]}),"!"]})]}),r(x,{sx:{marginTop:"2rem"},children:[e(c,{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:l.map(({ObjIcon:o,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(V,{user:g})},b):e(f,{sx:{cursor:"pointer"},onClick:()=>{h==="Salir"?D(i):n(S)},xs:2,sm:2,md:3,children:e(O,{cardText:h,imgIcon:o})},b))})]})]})};export{le as default};
