(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{4025:function(e,t,s){Promise.resolve().then(s.bind(s,8470)),Promise.resolve().then(s.bind(s,419)),Promise.resolve().then(s.t.bind(s,3045,23)),Promise.resolve().then(s.t.bind(s,7960,23)),Promise.resolve().then(s.bind(s,9064))},8470:function(e,t,s){"use strict";s.d(t,{default:function(){return r}});var n=s(7437),a=s(9376);function r(e){let{children:t}=e,s=(0,a.usePathname)();return(0,n.jsx)("main",{className:"flex-1 ".concat("/"===s||"/login"===s?"":"p-8"),children:t})}s(2265)},419:function(e,t,s){"use strict";s.d(t,{default:function(){return u}});var n=s(7437),a=s(9376),r=s(7648),c=s(3145),o=s(303);let i=[{label:"Dashboard",href:"/dashboard",icon:"/images/nav/dashboard.svg"},{label:"Product",href:"/products",icon:"/images/nav/product.svg"},{label:"Store",href:"/stores",icon:"/images/nav/store.svg"},{label:"Sale",href:"/sales",icon:"/images/nav/sale.svg"},{label:"User",href:"/users",icon:"/images/nav/user.svg"}];function l(){let e=(0,a.usePathname)(),t=(0,a.useRouter)(),s=async()=>{try{await (0,o.k)()}catch(e){console.error(e)}finally{t.push("login")}};return(0,n.jsxs)("nav",{className:"h-screen w-64 top-0 bg-[#F06AA8] sticky text-white flex flex-col justify-between py-8 px-4",children:[(0,n.jsxs)("div",{className:"mb-8 flex items-center space-x-4",children:[(0,n.jsx)(c.default,{src:"/images/icon.png",alt:"logo",width:50,height:50}),(0,n.jsx)("p",{className:"text-[1.5rem]",children:"Fleura"})]}),(0,n.jsx)("ul",{className:"flex-1 space-y-4",children:i.map(t=>{let s="/"===t.href?"/"===e:e.startsWith(t.href);return(0,n.jsx)("li",{children:(0,n.jsxs)(r.default,{href:t.href,className:"flex items-center gap-3 py-2 px-4 rounded transition ".concat(s?"bg-[#A2014B]":"hover:bg-[#A2014B]"),children:[(0,n.jsx)(c.default,{src:t.icon,alt:t.label+" icon",width:24,height:24,className:"mr-2"}),t.label]})},t.href)})}),(0,n.jsx)("button",{className:"flex items-center gap-3 py-2 px-4 rounded transition hover:bg-[#A2014B]",onClick:s,children:(0,n.jsx)("p",{children:"Keluar"})})]})}var u=()=>["/","/login"].includes((0,a.usePathname)())?null:(0,n.jsx)(l,{})},5008:function(e,t,s){"use strict";let n=s(3464).Z.create({baseURL:"https://api.fleuragift.com/api"});n.interceptors.request.use(e=>{let t=localStorage.getItem("access_token");return t&&(e.headers.Authorization="Bearer ".concat(t)),e}),t.Z=n},303:function(e,t,s){"use strict";s.d(t,{k:function(){return r},x:function(){return a}});var n=s(5008);let a=async(e,t)=>{let s=(await n.Z.post("admin/auth/login",{email:e,password:t})).data.data.access_token;return localStorage.setItem("access_token",s),document.cookie="access_token=".concat(s,"; path=/"),{token:s}},r=()=>{localStorage.removeItem("access_token"),document.cookie="access_token=; path=/; expires=Thu, 01 Jan 1970 00:00:00 UTC;"}},7960:function(){}},function(e){e.O(0,[901,301,145,64,337,971,117,744],function(){return e(e.s=4025)}),_N_E=e.O()}]);