module.exports=[78170,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(50944),e=a.i(36395),f=a.i(69240);function g({children:a}){let g=(0,d.useRouter)(),{user:h,loading:i}=(0,e.useAuth)(),[j,k]=(0,c.useState)(null);return((0,c.useEffect)(()=>{!async function(){if(!i){if(!h)return g.push("/explore");try{let{data:a,error:b}=await f.supabase.from("profiles").select("role").eq("id",h.id).single();if(b||a?.role!=="admin")return void g.push("/explore");k(!0)}catch(a){console.error("Admin layout role check error:",a),g.push("/explore")}}}()},[h,i,g]),i||null===j)?(0,b.jsx)("div",{className:"Admin_loaderWrapper",style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh",width:"100vw",background:"#0a0a0a",position:"fixed",top:0,left:0,zIndex:9999},children:(0,b.jsx)("div",{className:"Loader_loader__xEUdY",children:(0,b.jsx)("img",{src:"/media/loader.f7af4e13.svg",alt:"loader",width:48,height:48})})}):(0,b.jsx)(b.Fragment,{children:a})}a.s(["default",()=>g])}];

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