module.exports=[99053,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(49986),e=a.i(97168);a.s(["UserImage",0,function({src:a,fallbackSrc:f="/images/user-default.svg",alt:g="User",onError:h,onLoad:i,...j}){let[k,l]=(0,c.useState)(null),[m,n]=(0,c.useState)(!0);return(0,c.useEffect)(()=>{let b=!0;n(!0);let c=(0,d.resolveImagePath)(a)??f,e=new Image;return e.src=c,e.onload=()=>{b&&(l(c),n(!1))},e.onerror=()=>{if(!b)return;if(c===f){l(f),n(!1);return}let a=new Image;a.src=f,a.onload=()=>{b&&(l(f),n(!1))},a.onerror=()=>{b&&(l(f),n(!1))}},()=>{b=!1}},[a,f]),(0,b.jsxs)("div",{className:"relative inline-flex items-center justify-center w-full h-full",children:[m&&(0,b.jsx)(e.FaSpinner,{className:"size-5 animate-spin shrink-0"}),!m&&k&&(0,b.jsx)("img",{...j,src:k,alt:g,onLoad:i,onError:h})]})}])},88615,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(71133),e=a.i(27348),f=a.i(50944),g=a.i(7597),h=a.i(99053),i=a.i(43349);function j({isSidebarOpen:a=!1,onSidebarToggle:k}){let[l,m]=(0,c.useState)(!1),[n,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(!1),r=(0,f.useRouter)(),s=(0,c.useRef)(null),t=(0,g.useAppSelector)(a=>a.user.user);(0,c.useEffect)(()=>{let a=()=>{q(window.scrollY>1)};return a(),window.addEventListener("scroll",a),()=>window.removeEventListener("scroll",a)},[]),(0,c.useEffect)(()=>{function a(a){s.current&&!s.current.contains(a.target)&&m(!1)}return l&&document.addEventListener("mousedown",a),()=>{document.removeEventListener("mousedown",a)}},[l]);let[u,v]=(0,c.useState)(!1);return((0,c.useEffect)(()=>{v(!0)},[]),u&&t)?(0,b.jsx)("header",{className:`
        fixed left-0 top-0 z-50 w-full transition-all duration-300
        ${p?"bg-white/90 shadow-[0_8px_30px_rgba(0,0,0,0.08)] backdrop-blur-xl":"admin-header-glass"}
      `,children:(0,b.jsxs)("div",{className:"flex h-16 items-center justify-between gap-3 px-4 py-2 lg:h-20",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("button",{type:"button",onClick:k,className:"gradient1 flex h-10 w-10 items-center justify-center rounded-md text-white lg:hidden","aria-label":a?"Close sidebar":"Open sidebar",children:a?(0,b.jsx)(e.FiX,{size:22}):(0,b.jsx)(e.FiMenu,{size:22})}),(0,b.jsx)(i.default,{href:"/",children:(0,b.jsx)(d.default,{src:"/images/logo.svg",alt:"KleboAi",width:83,height:67,priority:!0,className:"h-12 w-auto lg:h-16.75"})})]}),(0,b.jsx)("div",{className:"ml-auto flex items-center gap-2 sm:gap-4",children:(0,b.jsx)("button",{type:"button",onClick:()=>{r.push("/admin/profile")},className:"cursor-pointer relative h-10 w-10 overflow-hidden rounded-full border-2 border-[#8B5CF6] bg-white sm:h-11 sm:w-11","aria-label":"Admin profile",children:(0,b.jsx)(h.UserImage,{src:t.profilePicture,alt:"Admin Profile",className:"h-full w-full rounded-full object-cover"})})})]})}):null}let k=[{title:"Dashboard",href:"/admin",icon:e.FiGrid},{title:"Users",href:"/admin/users",icon:e.FiUsers},{title:"Packages",href:"/admin/packages",icon:e.FiCreditCard},{title:"Transactions",href:"/admin/transactions",icon:e.FiFileText},{title:"Contacts",href:"/admin/contacts",icon:e.FiInbox},{title:"System Settings",href:"/admin/settings",icon:e.FiSettings}];function l({isOpen:a=!1,onClose:c,onLogout:d}){let g=(0,f.usePathname)();return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("aside",{className:`fixed left-0 z-40 top-16 h-[calc(100vh-64px)] lg:w-56 2xl:w-70 bg-white/95 lg:admin-sidebar-bg lg:adminsidebar-shadow backdrop-blur-xl transition-transform duration-300 lg:top-20 lg:h-[calc(100vh-80px)] lg:translate-x-0 ${a?"translate-x-0":"-translate-x-full lg:translate-x-0"}`,children:(0,b.jsxs)("div",{className:"flex h-full flex-col",children:[(0,b.jsx)("div",{className:"flex-1 overflow-y-auto px-2 2xl:px-4 py-6 custom-scrollbar",children:(0,b.jsx)("nav",{className:"space-y-1",children:k.map(a=>{let d=a.icon,e=g===a.href||"/admin"!==a.href&&g.startsWith(`${a.href}/`);return(0,b.jsxs)(i.default,{href:a.href,onClick:c,className:`flex items-center gap-2 2xl:gap-3 rounded-full px-4 py-2.5 2xl:py-3 text-sm font-medium transition-all ${e?"gradient1 text-white border border-white":"text-text hover:bg-white hover:text-link-1 border border-transparent"}`,children:[(0,b.jsx)(d,{size:18}),(0,b.jsx)("span",{children:a.title})]},a.href)})})}),(0,b.jsx)("div",{className:"border-t border-gray-100 bg-gray-50 p-4",children:(0,b.jsxs)("button",{onClick:d,className:"   flex w-full items-center justify-center gap-3   rounded-xl border border-danger/20 cursor-pointer   bg-danger/10 px-4 py-3   text-sm font-semibold text-danger   transition-all duration-300   hover:bg-danger hover:text-white   ",children:[(0,b.jsx)(e.FiLogOut,{size:18}),(0,b.jsx)("span",{children:"Sign Out"})]})})]})}),(0,b.jsx)("div",{onClick:c,className:`fixed inset-0 z-30 bg-black/40 top-16 h-[calc(100vh-64px)] transition-all duration-300 lg:hidden ${a?"visible opacity-100":"invisible opacity-0"}`})]})}var m=a.i(50159);a.s(["default",0,function({children:a}){let[d,e]=(0,c.useState)(!1),{openModal:f}=(0,m.useModal)();return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(j,{isSidebarOpen:d,onSidebarToggle:()=>e(a=>!a)}),(0,b.jsx)(l,{isOpen:d,onClose:()=>e(!1),onLogout:()=>{f("LOGOUT",{})}}),(0,b.jsx)("main",{className:"min-h-screen pt-16 lg:pt-20 lg:pl-56 2xl:pl-70 bg-[#FBF8FF]",children:a})]})}],88615)}];

//# sourceMappingURL=src_1_c4pj_._.js.map