????

Your IP : 3.144.235.50


Current Path : C:/inetpub/vhost/tracnghiem.gdtsolutions.vn/wwwroot/assets/
Upload File :
Current File : C:/inetpub/vhost/tracnghiem.gdtsolutions.vn/wwwroot/assets/Layout1-aa20c4ec.js

import{g as fe,a as be,s as v,M as $e,r as ze,P as Ae,c as A,_ as w,b as x,u as ye,d as Z,e as q,j as e,f as z,p as a,i as Oe,h as je,k as ce,l as Fe,T as He,m as We,n as _e,o as Ee,q as Ve,t as de,R as pe,v as Ge,w as S,x as h,y as Ue,z as D,A as P,S as R,B as ve,C as O,D as ee,E as B,I as f,H as Xe,F as M,G as F,J as Se,K as H,L as te,N as we,O as Ye,Q as ke,U as Qe,V as b,W as he,X as qe,Y as J,Z as Je,$ as Ke,a0 as Ze,a1 as et,a2 as tt,a3 as ot,a4 as oe,a5 as nt,a6 as Ce,a7 as rt,a8 as st,a9 as at,aa as K,ab as it,ac as lt,ad as ct,ae as dt,af as pt,ag as ue,ah as xe}from"./index-9bcd78a9.js";import{T as ht}from"./Toolbar-d5f2ec66.js";import{A as ut}from"./AppBar-a2b92a6e.js";import{B as ne}from"./Badge-bc5cbe8c.js";import{T as xt}from"./Tooltip-4d2e5457.js";import{S as mt}from"./Slide-d13e3d86.js";import{F as gt}from"./Fab-ba6297ee.js";import{H as Te}from"./Hidden-5cc502db.js";import{S as ft}from"./Switch-04a62a88.js";import{M as bt}from"./MenuItem-3ea292e1.js";import{u as De}from"./useMediaQuery-72cdd2fe.js";import"./shouldSpreadAdditionalProps-98202fee.js";import"./Popper-151dcaf9.js";import"./popper-578b62a7.js";import"./SwitchBase-f2562236.js";import"./listItemIconClasses-873dc6a3.js";function yt(t){return fe("MuiDrawer",t)}be("MuiDrawer",["root","docked","paper","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const jt=["BackdropProps"],vt=["anchor","BackdropProps","children","className","elevation","hideBackdrop","ModalProps","onClose","open","PaperProps","SlideProps","TransitionComponent","transitionDuration","variant"],Be=(t,o)=>{const{ownerState:n}=t;return[o.root,(n.variant==="permanent"||n.variant==="persistent")&&o.docked,o.modal]},St=t=>{const{classes:o,anchor:n,variant:r}=t,s={root:["root"],docked:[(r==="permanent"||r==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${A(n)}`,r!=="temporary"&&`paperAnchorDocked${A(n)}`]};return je(s,yt,o)},wt=v($e,{name:"MuiDrawer",slot:"Root",overridesResolver:Be})(({theme:t})=>({zIndex:(t.vars||t).zIndex.drawer})),me=v("div",{shouldForwardProp:ze,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:Be})({flex:"0 0 auto"}),kt=v(Ae,{name:"MuiDrawer",slot:"Paper",overridesResolver:(t,o)=>{const{ownerState:n}=t;return[o.paper,o[`paperAnchor${A(n.anchor)}`],n.variant!=="temporary"&&o[`paperAnchorDocked${A(n.anchor)}`]]}})(({theme:t,ownerState:o})=>w({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(t.vars||t).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0},o.anchor==="left"&&{left:0},o.anchor==="top"&&{top:0,left:0,right:0,height:"auto",maxHeight:"100%"},o.anchor==="right"&&{right:0},o.anchor==="bottom"&&{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"},o.anchor==="left"&&o.variant!=="temporary"&&{borderRight:`1px solid ${(t.vars||t).palette.divider}`},o.anchor==="top"&&o.variant!=="temporary"&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`},o.anchor==="right"&&o.variant!=="temporary"&&{borderLeft:`1px solid ${(t.vars||t).palette.divider}`},o.anchor==="bottom"&&o.variant!=="temporary"&&{borderTop:`1px solid ${(t.vars||t).palette.divider}`})),Re={left:"right",right:"left",top:"down",bottom:"up"};function Ct(t){return["left","right"].indexOf(t)!==-1}function Tt(t,o){return t.direction==="rtl"&&Ct(o)?Re[o]:o}const Pe=x.forwardRef(function(o,n){const r=ye({props:o,name:"MuiDrawer"}),s=Z(),i={enter:s.transitions.duration.enteringScreen,exit:s.transitions.duration.leavingScreen},{anchor:p="left",BackdropProps:l,children:c,className:u,elevation:g=16,hideBackdrop:d=!1,ModalProps:{BackdropProps:j}={},onClose:k,open:y=!1,PaperProps:C={},SlideProps:m,TransitionComponent:L=mt,transitionDuration:W=i,variant:I="temporary"}=r,G=q(r.ModalProps,jt),$=q(r,vt),_=x.useRef(!1);x.useEffect(()=>{_.current=!0},[]);const E=Tt(s,p),T=w({},r,{anchor:p,elevation:g,open:y,variant:I},$),N=St(T),ie=e.jsx(kt,w({elevation:I==="temporary"?g:0,square:!0},C,{className:z(N.paper,C.className),ownerState:T,children:c}));if(I==="permanent")return e.jsx(me,w({className:z(N.root,N.docked,u),ownerState:T,ref:n},$,{children:ie}));const le=e.jsx(L,w({in:y,direction:Re[E],timeout:W,appear:_.current},m,{children:ie}));return I==="persistent"?e.jsx(me,w({className:z(N.root,N.docked,u),ownerState:T,ref:n},$,{children:le})):e.jsx(wt,w({BackdropProps:w({},l,j,{transitionDuration:W}),className:z(N.root,N.modal,u),open:y,ownerState:T,onClose:k,hideBackdrop:d,ref:n},$,G,{children:le}))});Pe.propTypes={anchor:a.oneOf(["bottom","left","right","top"]),BackdropProps:a.object,children:a.node,classes:a.object,className:a.string,elevation:Oe,hideBackdrop:a.bool,ModalProps:a.object,onClose:a.func,open:a.bool,PaperProps:a.object,SlideProps:a.object,sx:a.oneOfType([a.arrayOf(a.oneOfType([a.func,a.object,a.bool])),a.func,a.object]),transitionDuration:a.oneOfType([a.number,a.shape({appear:a.number,enter:a.number,exit:a.number})]),variant:a.oneOf(["permanent","persistent","temporary"])};const re=Pe;function Dt(t){return fe("MuiLink",t)}const Bt=be("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),Rt=Bt,Le={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},Pt=t=>Le[t]||t,Lt=({theme:t,ownerState:o})=>{const n=Pt(o.color),r=ce(t,`palette.${n}`,!1)||o.color,s=ce(t,`palette.${n}Channel`);return"vars"in t&&s?`rgba(${s} / 0.4)`:Fe(r,.4)},Mt=Lt,It=["className","color","component","onBlur","onFocus","TypographyClasses","underline","variant","sx"],Nt=t=>{const{classes:o,component:n,focusVisible:r,underline:s}=t,i={root:["root",`underline${A(s)}`,n==="button"&&"button",r&&"focusVisible"]};return je(i,Dt,o)},$t=v(He,{name:"MuiLink",slot:"Root",overridesResolver:(t,o)=>{const{ownerState:n}=t;return[o.root,o[`underline${A(n.underline)}`],n.component==="button"&&o.button]}})(({theme:t,ownerState:o})=>w({},o.underline==="none"&&{textDecoration:"none"},o.underline==="hover"&&{textDecoration:"none","&:hover":{textDecoration:"underline"}},o.underline==="always"&&w({textDecoration:"underline"},o.color!=="inherit"&&{textDecorationColor:Mt({theme:t,ownerState:o})},{"&:hover":{textDecorationColor:"inherit"}}),o.component==="button"&&{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Rt.focusVisible}`]:{outline:"auto"}})),Me=x.forwardRef(function(o,n){const r=ye({props:o,name:"MuiLink"}),{className:s,color:i="primary",component:p="a",onBlur:l,onFocus:c,TypographyClasses:u,underline:g="always",variant:d="inherit",sx:j}=r,k=q(r,It),{isFocusVisibleRef:y,onBlur:C,onFocus:m,ref:L}=We(),[W,I]=x.useState(!1),G=_e(n,L),$=T=>{C(T),y.current===!1&&I(!1),l&&l(T)},_=T=>{m(T),y.current===!0&&I(!0),c&&c(T)},E=w({},r,{color:i,component:p,focusVisible:W,underline:g,variant:d}),ae=Nt(E);return e.jsx($t,w({color:i,className:z(ae.root,s),classes:u,component:p,onBlur:$,onFocus:_,ref:G,ownerState:E,variant:d,sx:[...Object.keys(Le).includes(i)?[]:[{color:i}],...Array.isArray(j)?j:[j]]},k))});Me.propTypes={children:a.node,classes:a.object,className:a.string,color:a.any,component:Ee,onBlur:a.func,onFocus:a.func,sx:a.oneOfType([a.arrayOf(a.oneOfType([a.func,a.object,a.bool])),a.func,a.object]),TypographyClasses:a.object,underline:a.oneOf(["always","hover","none"]),variant:a.oneOfType([a.oneOf(["body1","body2","button","caption","h1","h2","h3","h4","h5","h6","inherit","overline","subtitle1","subtitle2"]),a.string])};const zt=Me;var At=function(o,n){return o===n};function Ot(t,o,n,r){var s=x.useReducer(function(y){return y+1},0),i=s[1],p=x.useMemo(function(){return Ve(n,r)},[n,r]),l=x.useRef(),c=x.useRef(),u=x.useRef(),g=x.useRef(),d=n.getState(),j;try{if(t!==c.current||d!==u.current||l.current){var k=t(d);g.current===void 0||!o(k,g.current)?j=k:j=g.current}else j=g.current}catch(y){throw l.current&&(y.message+=`
The error may be correlated with this previous error:
`+l.current.stack+`

`),y}return de(function(){c.current=t,u.current=d,g.current=j,l.current=void 0}),de(function(){function y(){try{var C=n.getState();if(C===u.current)return;var m=c.current(C);if(o(m,g.current))return;g.current=m,u.current=C}catch(L){l.current=L}i()}return p.onStateChange=y,p.trySubscribe(),y(),function(){return p.tryUnsubscribe()}},[n,p]),j}function Ft(t){t===void 0&&(t=pe);var o=t===pe?Ge:function(){return x.useContext(t)};return function(r,s){s===void 0&&(s=At);{if(!r)throw new Error("You must pass a selector to useSelector");if(typeof r!="function")throw new Error("You must pass a function as a selector to useSelector");if(typeof s!="function")throw new Error("You must pass a function as an equality function to useSelector")}var i=o(),p=i.store,l=i.subscription,c=Ot(r,s,p,l);return x.useDebugValue(c),c}}var se=Ft();const Ht=({className:t})=>{const{settings:o}=S(),n=o.themes[o.activeTheme];return e.jsx("svg",{width:"24px",height:"24px",className:t,viewBox:"0 0 240 239",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:e.jsx("g",{id:"Page-1",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:e.jsx("g",{id:"logo",transform:"translate(120.500000, 98.000000) rotate(-270.000000) translate(-120.500000, -98.000000) translate(-21.000000, -35.000000)",children:e.jsxs("g",{id:"Group",transform:"translate(141.500000, 133.000000) rotate(90.000000) translate(-141.500000, -133.000000) translate(9.000000, -8.000000)",children:[e.jsxs("g",{id:"Path-4-Copy",transform:"translate(132.242532, 149.243361) rotate(-135.000000) translate(-132.242532, -149.243361) translate(38.742532, 55.743361)",children:[e.jsx("g",{id:"path-1-link",fill:"#000000",children:e.jsx("polygon",{id:"path-1",points:"136.269985 0.8695976 186.615824 50.367072 186.615824 186.98041 50.7100649 186.98041 0.4346189 136.704964"})}),e.jsx("g",{id:"path-1-link",fill:n.palette.primary.light,children:e.jsx("polygon",{id:"path-1",points:"136.269985 0.8695976 186.615824 50.367072 186.615824 186.98041 50.7100649 186.98041 0.4346189 136.704964"})})]}),e.jsx("polygon",{id:"Path-3",fill:n.palette.primary.light,points:"13 238.415212 13 0 249.898437 238.415212"}),e.jsx("polygon",{id:"Path-4",fill:n.palette.primary.main,points:"252.486992 0 252.486992 238.799226 13 238.799226"})]})})})})},Wt=h(ht)(()=>({display:"flex",alignItems:"center",minHeight:`${Ue} !important`,"@media (max-width: 499px)":{display:"table",width:"100%",minHeight:"auto",padding:"1rem 0","& .container":{flexDirection:"column !important","& a":{margin:"0 0 16px !important"}}}})),_t=h("div")(()=>({width:"100%",display:"flex",alignItems:"center",padding:"0px 1rem",maxWidth:"1170px",margin:"0 auto"})),U=()=>{const t=D(),{settings:o}=S(),n=o.themes[o.footer.theme]||t;return e.jsx(P,{theme:n,children:e.jsx(ut,{color:"primary",position:"static",sx:{zIndex:96},children:e.jsx(Wt,{children:e.jsxs(_t,{children:[e.jsx(R,{sx:{m:"auto"}}),e.jsxs(ve,{sx:{m:0},children:["Thiết kế và phát triển bởi"," ",e.jsx("a",{href:"https://gdtsolutions.vn/",target:"_blank",rel:"noreferrer",children:"GDT"})]})]})})})})},Et=({children:t})=>{const o=Z(),{settings:n}=S(),r=n.themes[n.layout1Settings.leftSidebar.theme]||o;return e.jsx(P,{theme:r,children:t})},Vt=({theme:t,classes:o,children:n,open:r})=>e.jsx(P,{theme:t,children:n}),Gt=v(ne)(()=>({top:"0",right:"0",height:"32px",width:"32px",borderRadius:"50%"})),Ut=v(R)(({theme:t})=>({fontWeight:700,fontSize:"1rem",cursor:"pointer",borderRadius:"4px",marginBottom:"2.5rem",letterSpacing:"1.5px",padding:".25rem .5rem",transform:"rotate(90deg)",color:t.palette.secondary.main,backgroundColor:t.palette.primary.dark,"&:hover, &.open":{backgroundColor:t.palette.secondary.main,color:t.palette.secondary.contrastText}})),Xt=v("div")(({theme:t})=>({top:0,right:0,zIndex:50,width:320,display:"flex",height:"100vh",position:"fixed",paddingBottom:"32px",flexDirection:"column",boxShadow:O[12],background:t.palette.background.default,"& .helpText":{margin:"0px .5rem 1rem"}})),Yt=v(Gt)(()=>({width:"100%",height:"152px !important",cursor:"pointer",marginTop:"12px",marginBottom:"12px","& .layout-name":{display:"none"},"&:hover .layout-name":{zIndex:12,width:"100%",height:"100%",display:"flex",alignItems:"center",position:"absolute",justifyContent:"center",background:"rgba(0,0,0,0.3)"}})),Qt=v("div")(()=>({minHeight:58,display:"flex",alignItems:"center",marginBottom:"16px",padding:"14px 20px",boxShadow:O[6],justifyContent:"space-between"})),qt=v("img")(()=>({width:"100%"})),Jt=v(ee)(()=>({paddingLeft:"16px",paddingRight:"16px"})),Kt=()=>{const t=Z(),[o,n]=x.useState(!1),[r,s]=x.useState(0),{settings:i,updateSettings:p}=S(),l=t.palette.text.secondary,c=()=>n(!o),u=d=>s(d);let g={...i.themes[i.activeTheme]};return e.jsxs(x.Fragment,{children:[e.jsx(xt,{title:"Theme Settings",placement:"left",children:e.jsx(Ut,{className:"open",onClick:c,children:"DEMOS"})}),e.jsx(P,{theme:g,children:e.jsx(re,{open:o,anchor:"right",variant:"temporary",onClose:c,ModalProps:{keepMounted:!0},children:e.jsxs(Xt,{children:[e.jsxs(Qt,{children:[e.jsxs(B,{display:"flex",children:[e.jsx(f,{className:"icon",color:"primary",children:"settings"}),e.jsx(Xe,{sx:{ml:1,fontSize:"1rem"},children:"Theme Settings"})]}),e.jsx(M,{onClick:c,children:e.jsx(f,{className:"icon",children:"close"})})]}),e.jsxs(B,{px:3,mb:2,display:"flex",children:[e.jsx(F,{variant:"outlined",onClick:()=>u(0),color:r===0?"secondary":"primary",sx:{mr:2},children:"Demos"}),e.jsx(F,{variant:"outlined",onClick:()=>u(1),color:r===1?"secondary":"primary",children:"Settings"})]}),e.jsxs(Jt,{options:{suppressScrollX:!0},children:[r===0&&e.jsxs(B,{sx:{mb:4,mx:3},children:[e.jsx(B,{sx:{color:l},children:"Layouts"}),e.jsx(B,{display:"flex",flexDirection:"column",children:Zt.map(d=>e.jsx(Yt,{color:"secondary",badgeContent:"Pro",invisible:!d.isPro,children:e.jsxs(Se,{elevation:4,sx:{position:"relative"},onClick:()=>p(d.options),children:[e.jsx(B,{sx:{overflow:"hidden"},className:"layout-name",children:e.jsx(F,{variant:"contained",color:"secondary",children:d.name})}),e.jsx(qt,{src:d.thumbnail,alt:d.name})]})},d.name))})]}),r===1&&e.jsx("div",{children:e.jsxs("div",{className:"helpText",children:["We used React context API to control layout. Check out the"," ",e.jsx(zt,{href:"http://demos.ui-lib.com/matx-react-doc/layout.html",target:"_blank",children:"Documentation"})]})})]})]})})})]})},Zt=[{isPro:!1,name:"Light Sidebar",thumbnail:"/assets/images/screenshots/layout1-customizer.png",options:{activeTheme:"blue",activeLayout:"layout1",layout1Settings:{topbar:{theme:"blueDark",fixed:!0},leftSidebar:{mode:"full",theme:"whiteBlue",bgOpacity:.98}},footer:{theme:"slateDark1"}}},{isPro:!1,name:"Compact Sidebar",thumbnail:"/assets/images/screenshots/layout5-customizer.png",options:{activeTheme:"blue",activeLayout:"layout1",layout1Settings:{topbar:{theme:"whiteBlue",fixed:!0},leftSidebar:{mode:"compact",theme:"slateDark1",bgOpacity:.92}}}},{isPro:!1,name:"Dark Sidebar",thumbnail:"/assets/images/screenshots/layout1-blue-customizer.png",options:{activeTheme:"blue",activeLayout:"layout1",layout1Settings:{topbar:{theme:"blueDark",fixed:!0},leftSidebar:{mode:"full",theme:"slateDark1",bgOpacity:.92}}}}],X=h(M)(({theme:t})=>({"& span":{color:t.palette.text.primary},"& #disable":{color:t.palette.text.disabled}})),eo=h("div")(({theme:t})=>({height:"100%",display:"flex",flexDirection:"column",width:H})),to=h("div")(()=>({padding:"4px",paddingLeft:"16px",display:"flex",alignItems:"center",boxShadow:O[6],height:te,"& h5":{marginTop:0,marginBottom:0,marginLeft:"16px",fontWeight:"500"}})),oo=h("div")(()=>({display:"flex",alignItems:"center",padding:"8px 8px",transition:"background 300ms ease","&:hover":{background:"rgba(0,0,0,0.01)"}})),no=h("img")(()=>({width:48})),ro=h("div")(()=>({marginRight:"8",textAlign:"center",flexGrow:1,display:"flex",flexDirection:"column","& h6":{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"block",width:120,marginBottom:"4px"}}));let ge=!1;function Ie({container:t}){const[o,n]=x.useState(0),[r,s]=x.useState(!1),i=we(),p=Ye(),{user:l}=ke(),{cartList:c}=se(m=>m.ecommerce),{settings:u}=S(),d=D().palette.text.secondary;ge||(l&&i(Qe(l.id)),ge=!0);const j=()=>{s(!r)},k=()=>{o>0&&(p("/ecommerce/checkout"),s(!1))};x.useEffect(()=>{let m=0;c.forEach(L=>{m+=L.price*L.amount}),n(m)},[c]);const{palette:y}=D(),C=y.text.primary;return e.jsxs(x.Fragment,{children:[e.jsx(M,{onClick:j,children:e.jsx(ne,{color:"secondary",badgeContent:c.length,children:e.jsx(f,{sx:{color:C},children:"shopping_cart"})})}),e.jsx(P,{theme:u.themes[u.activeTheme],children:e.jsx(re,{container:t,variant:"temporary",anchor:"right",open:r,onClose:j,ModalProps:{keepMounted:!0},children:e.jsxs(eo,{children:[e.jsxs(to,{children:[e.jsx(f,{color:"primary",children:"shopping_cart"}),e.jsx("h5",{children:"Cart"})]}),e.jsx(b,{flexGrow:1,overflow:"auto",children:c.map(m=>e.jsxs(oo,{children:[e.jsxs(b,{mr:"4px",display:"flex",flexDirection:"column",children:[e.jsx(X,{size:"small",onClick:()=>i(he(l.id,m.id,m.amount+1)),children:e.jsx(f,{sx:{cursor:"pinter"},children:"keyboard_arrow_up"})}),e.jsx(X,{disabled:!(m.amount-1),size:"small",onClick:()=>i(he(l.id,m.id,m.amount-1)),children:e.jsx(f,{id:!(m.amount-1)&&"disable",children:"keyboard_arrow_down"})})]}),e.jsx(b,{mr:1,children:e.jsx(no,{src:m.imgUrl,alt:m.title})}),e.jsxs(ro,{children:[e.jsx(qe,{children:m.title}),e.jsxs(J,{sx:{color:d},children:["$",m.price," x ",m.amount]})]}),e.jsx(X,{size:"small",onClick:()=>i(Je(l.userId,m.id)),children:e.jsx(f,{fontSize:"small",children:"clear"})})]},m.id))}),e.jsxs(F,{sx:{width:"100%",borderRadius:0},variant:"contained",color:"primary",onClick:k,children:["Checkout ($",o.toFixed(2),")"]})]})})})]})}const so=h("div")(({theme:t,width:o})=>({position:"fixed",height:"100vh",width:o,right:0,bottom:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",boxShadow:t.shadows[8],backgroundColor:t.palette.primary.main,zIndex:98,transition:"all 0.15s ease",color:t.palette.text.primary,"@global":{"@media screen and (min-width: 767px)":{".content-wrap, .layout2.layout-contained, .layout2.layout-full":{marginRight:n=>n.width},".matx-customizer":{right:n=>n.width}},"@media screen and (max-width: 959px)":{".toolbar-menu-wrap .menu-area":{width:n=>`calc(100% - ${n.width})`}}}})),ao=()=>{const{palette:t}=D(),o=t.primary.contrastText;return e.jsxs(so,{width:"50px",className:"secondary-sidebar",children:[e.jsx(R,{sx:{m:"auto"}}),e.jsx(Kt,{}),e.jsx(Ie,{}),e.jsx(Ke,{icon:e.jsx(M,{sx:{my:"12px",color:o},size:"small",children:e.jsx(f,{children:"comments"})}),children:e.jsx(Ze,{})}),e.jsx(R,{sx:{m:"auto"}})]})},io=h("div")(()=>({position:"fixed",right:"30px",bottom:"50px",zIndex:99,transition:"all 0.15s ease","&.open":{right:"10px"}})),lo=()=>{const{settings:t,updateSettings:o}=S(),n=()=>{o({secondarySidebar:{open:!t.secondarySidebar.open}})},{palette:r}=D(),s=r.primary.contrastText;return e.jsxs(io,{className:z({open:t.secondarySidebar.open}),children:[t.secondarySidebar.open&&e.jsx(M,{onClick:n,size:"small","aria-label":"toggle",children:e.jsx(f,{sx:{color:s},children:"close"})}),!t.secondarySidebar.open&&e.jsx(gt,{color:"primary","aria-label":"expand",onClick:n,children:e.jsx(f,{sx:{color:s},children:"settings"})})]})},co=()=>{const{settings:t}=S(),o=t.themes[t.secondarySidebar.theme];return e.jsxs(Vt,{theme:o,children:[t.secondarySidebar.open&&e.jsx(ao,{}),e.jsx(lo,{})]})},po=v(B)(()=>({display:"flex",alignItems:"center",justifyContent:"space-between",padding:"20px 18px 20px 29px"})),ho=v(R)(({mode:t})=>({fontSize:18,marginLeft:".5rem",display:t==="compact"?"none":"block"})),uo=({children:t})=>{const{settings:o}=S(),n=o.layout1Settings.leftSidebar,{mode:r}=n;return e.jsxs(po,{children:[e.jsxs(B,{display:"flex",alignItems:"center",children:[e.jsx(Ht,{}),e.jsx(ho,{mode:r,className:"sidenavHoverShow",children:"Quản trị"})]}),e.jsx(B,{className:"sidenavHoverShow",sx:{display:r==="compact"?"none":"block"},children:t||null})]})},xo=h(ee)(()=>({paddingLeft:"1rem",paddingRight:"1rem",position:"relative"})),Ne=(t,o)=>t.map(r=>{let s=o.filter(i=>r.id===i.idParent);return s.length>0&&(s=Ne(s,o)),s.length>0?{...r,children:s}:r}),mo=t=>{const o=Array.isArray(t)?[...t].sort((n,r)=>n.ordinal-r.ordinal):[];return o?Ne(o.filter(n=>!n.idParent),o):[]},go=h("div")(({theme:t})=>({position:"fixed",top:0,left:0,bottom:0,right:0,width:"100vw",background:"rgba(0, 0, 0, 0.54)",zIndex:-1,[t.breakpoints.up("lg")]:{display:"none"}})),fo=({children:t})=>{const{settings:o,updateSettings:n}=S(),r=se(et),s=i=>{let p=o.activeLayout+"Settings",l=o[p];n({...o,[p]:{...l,leftSidebar:{...l.leftSidebar,...i}}})};return e.jsxs(x.Fragment,{children:[e.jsxs(xo,{options:{suppressScrollX:!0},children:[t,e.jsx(tt,{items:[...ot,...mo(r)]})]}),e.jsx(go,{onClick:()=>s({mode:"close"})})]})},bo=h(b)(({theme:t,width:o,primaryBg:n,bgImgURL:r})=>({position:"fixed",top:0,left:0,height:"100vh",width:o,boxShadow:O[8],backgroundRepeat:"no-repeat",backgroundPosition:"top",backgroundSize:"cover",zIndex:111,overflow:"hidden",color:t.palette.text.primary,transition:"all 250ms ease-in-out",backgroundImage:`linear-gradient(to bottom, rgba(${n}, 0.96), rgba(${n}, 0.96)), url(${r})`,"&:hover":{width:H,"& .sidenavHoverShow":{display:"block"},"& .compactNavItem":{width:"100%",maxWidth:"100%","& .nav-bullet":{display:"block"},"& .nav-bullet-text":{display:"none"}}}})),yo=h(b)(()=>({height:"100%",display:"flex",flexDirection:"column"})),jo=()=>{const t=D(),{settings:o,updateSettings:n}=S(),r=o.layout1Settings.leftSidebar,{mode:s,bgImgURL:i}=r,p=()=>{switch(s){case"compact":return Ce;default:return H}},l=nt(t.palette.primary.main),c=g=>{n({layout1Settings:{leftSidebar:{...g}}})},u=()=>{c({mode:s==="compact"?"full":"compact"})};return e.jsx(bo,{bgImgURL:i,primaryBg:l,width:p(),children:e.jsxs(yo,{children:[e.jsx(uo,{children:e.jsx(Te,{smDown:!0,children:e.jsx(ft,{onChange:u,checked:r.mode!=="full",color:"secondary",size:"small"})})}),e.jsx(fo,{})]})})},vo=oe.memo(jo),So=h("div")(()=>({padding:"16px",marginBottom:"16px",display:"flex",alignItems:"center",height:te,boxShadow:O[6],"& h5":{marginLeft:"8px",marginTop:0,marginBottom:0,fontWeight:"500"}})),wo=h(b)(({theme:t})=>({position:"relative","&:hover":{"& .messageTime":{display:"none"},"& .deleteButton":{opacity:"1"}},"& .messageTime":{color:t.palette.text.secondary},"& .icon":{fontSize:"1.25rem"}})),ko=h(M)(({theme:t})=>({opacity:"0",position:"absolute",right:5,marginTop:9,marginRight:"24px",background:"rgba(0, 0, 0, 0.01)"})),Co=h("div")(({theme:t})=>({padding:"12px 8px",display:"flex",alignItems:"center",justifyContent:"space-between",background:"rgba(0, 0, 0, 0.01)","& small":{fontWeight:"500",marginLeft:"16px",color:t.palette.text.secondary}})),To=h("span")(({theme:t})=>({fontWeight:"500",marginLeft:"16px",color:t.palette.text.secondary})),Do=({container:t})=>{const{settings:o}=S(),r=D().palette.text.secondary,[s,i]=x.useState(!1),p=se(rt),l=we();x.useEffect(()=>{l(st())},[l]);const c=x.useCallback(()=>{i(d=>!d)},[]),{palette:u}=D(),g=u.text.primary;return e.jsxs(x.Fragment,{children:[e.jsx(M,{onClick:c,children:e.jsx(ne,{color:"secondary",badgeContent:p==null?void 0:p.length,children:e.jsx(f,{sx:{color:g},children:"notifications"})})}),e.jsx(P,{theme:o.themes[o.activeTheme],children:e.jsx(re,{width:"100px",container:t,variant:"temporary",anchor:"right",open:s,onClose:c,ModalProps:{keepMounted:!0},children:e.jsxs(b,{sx:{width:H},children:[e.jsxs(So,{children:[e.jsx(f,{color:"primary",children:"notifications"}),e.jsx("h5",{children:"Thông báo"})]}),p.map(d=>e.jsxs(wo,{children:[e.jsx(ko,{size:"small",className:"deleteButton",onClick:()=>{l(at(d.id))},children:e.jsx(f,{className:"icon",children:"clear"})}),e.jsx(K,{to:`/${d.path}`,onClick:c,style:{textDecoration:"none"},children:e.jsxs(Se,{sx:{mx:2,mb:3},elevation:3,children:[e.jsxs(Co,{children:[e.jsxs(b,{display:"flex",children:[e.jsx(f,{className:"icon",color:d.icon.color,children:d.icon.name}),e.jsx(To,{children:d.heading})]}),e.jsxs(J,{className:"messageTime",children:[it(new Date(d.timestamp)),"ago"]})]}),e.jsxs(b,{sx:{px:2,pt:1,pb:2},children:[e.jsx(ve,{sx:{m:0},children:d.title}),e.jsx(J,{sx:{color:r},children:d.subtitle})]})]})})]},d.id)),p.length?e.jsx(b,{sx:{color:r,textAlign:"center"},children:e.jsx(F,{onClick:()=>l(lt()),children:"Xóa thông báo"})}):e.jsx(e.Fragment,{})]})})})]})},V=h(M)(({theme:t})=>({color:t.palette.text.primary})),Bo=h("div")(({theme:t})=>({top:0,zIndex:96,transition:"all 0.3s ease",boxShadow:O[8],height:te})),Ro=h(b)(({theme:t})=>({padding:"8px",paddingLeft:18,paddingRight:20,height:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",background:t.palette.primary.main,[t.breakpoints.down("sm")]:{paddingLeft:16,paddingRight:16},[t.breakpoints.down("xs")]:{paddingLeft:14,paddingRight:16}})),Po=h(b)(()=>({display:"flex",alignItems:"center",cursor:"pointer",borderRadius:24,padding:4,"& span":{margin:"0 8px"}})),Y=h(bt)(({theme:t})=>({display:"flex",alignItems:"center",minWidth:185,"& a":{width:"100%",display:"flex",alignItems:"center",textDecoration:"none"},"& span":{marginRight:"10px",color:t.palette.text.primary}})),Lo=h("div")(({theme:t})=>({display:"inherit",[t.breakpoints.down("md")]:{display:"none !important"}})),Mo=()=>{const t=D(),{settings:o,updateSettings:n}=S(),{logout:r,user:s}=ke(),i=De(t.breakpoints.down("md")),p=c=>{n({layout1Settings:{leftSidebar:{...c}}})},l=()=>{let{layout1Settings:c}=o,u;i?u=c.leftSidebar.mode==="close"?"mobile":"close":u=c.leftSidebar.mode==="full"?"close":"full",p({mode:u})};return e.jsx(Bo,{children:e.jsxs(Ro,{children:[e.jsxs(b,{display:"flex",children:[e.jsx(V,{onClick:l,children:e.jsx(f,{children:"menu"})}),e.jsxs(Lo,{children:[e.jsx(V,{children:e.jsx(f,{children:"mail_outline"})}),e.jsx(V,{children:e.jsx(f,{children:"web_asset"})}),e.jsx(V,{children:e.jsx(f,{children:"star_outline"})})]})]}),e.jsxs(b,{display:"flex",alignItems:"center",children:[e.jsx(ct,{}),e.jsx(Do,{}),e.jsx(Ie,{}),e.jsxs(dt,{menuButton:e.jsxs(Po,{children:[e.jsx(Te,{xsDown:!0,children:e.jsxs(R,{children:["Hi ",e.jsx("strong",{children:s==null?void 0:s.name})]})}),e.jsx(pt,{src:s==null?void 0:s.avatar,sx:{cursor:"pointer"}})]}),children:[e.jsx(Y,{children:e.jsxs(K,{to:"/",children:[e.jsx(f,{children:" home "}),e.jsx(R,{children:" Trang chủ "})]})}),e.jsx(Y,{children:e.jsxs(K,{to:"/page-layouts/account",children:[e.jsx(f,{children:" settings "}),e.jsx(R,{children:" Cài đặt "})]})}),e.jsxs(Y,{onClick:r,children:[e.jsx(f,{children:" power_settings_new "}),e.jsx(R,{children:" Đăng xuất "})]})]})]})]})})},Q=oe.memo(Mo),Io=h(b)(({theme:t})=>({display:"flex",background:t.palette.background.default})),No=h(b)(()=>({height:"100%",display:"flex",overflowY:"auto",overflowX:"hidden",flexDirection:"column",justifyContent:"space-between"})),$o=h(ee)(()=>({height:"100%",position:"relative",display:"flex",flexGrow:"1",flexDirection:"column"})),zo=h(b)(({width:t,secondarySidebar:o})=>({height:"100vh",display:"flex",flexGrow:"1",flexDirection:"column",verticalAlign:"top",marginLeft:t,position:"relative",overflow:"hidden",transition:"all 0.3s ease",marginRight:o.open?50:0})),Ao=()=>{const{settings:t,updateSettings:o}=S(),{layout1Settings:n,secondarySidebar:r}=t,s=t.themes[n.topbar.theme],{leftSidebar:{mode:i,show:p}}=n,c=(()=>{switch(i){case"full":return H;case"compact":return Ce;default:return"0px"}})(),u=D(),g=De(u.breakpoints.down("md")),d=x.useRef({isMdScreen:g,settings:t}),j=`theme-${u.palette.type}`;return x.useEffect(()=>{let{settings:k}=d.current,y=k.layout1Settings.leftSidebar.mode;k.layout1Settings.leftSidebar.show&&o({layout1Settings:{leftSidebar:{mode:g?"close":y}}})},[g]),e.jsxs(Io,{className:j,children:[p&&i!=="close"&&e.jsx(Et,{children:e.jsx(vo,{})}),e.jsxs(zo,{width:c,secondarySidebar:r,children:[n.topbar.show&&n.topbar.fixed&&e.jsx(P,{theme:s,children:e.jsx(Q,{fixed:!0,className:"elevation-z8"})}),t.perfectScrollbar&&e.jsxs($o,{children:[n.topbar.show&&!n.topbar.fixed&&e.jsx(P,{theme:s,children:e.jsx(Q,{})}),e.jsx(b,{flexGrow:1,position:"relative",children:e.jsx(ue,{children:e.jsx(xe,{})})}),t.footer.show&&!t.footer.fixed&&e.jsx(U,{})]}),!t.perfectScrollbar&&e.jsxs(No,{children:[n.topbar.show&&!n.topbar.fixed&&e.jsx(P,{theme:s,children:e.jsx(Q,{})}),e.jsx(b,{flexGrow:1,position:"relative",children:e.jsx(ue,{children:e.jsx(xe,{})})}),t.footer.show&&!t.footer.fixed&&e.jsx(U,{})]}),t.footer.show&&t.footer.fixed&&e.jsx(U,{})]}),t.secondarySidebar.show&&e.jsx(co,{})]})},en=oe.memo(Ao);export{en as default};