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