"use strict";(()=>{var e={};e.id=8788,e.ids=[8788],e.modules={72934:e=>{e.exports=require("next/dist/client/components/action-async-storage.external.js")},54580:e=>{e.exports=require("next/dist/client/components/request-async-storage.external.js")},45869:e=>{e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},78893:e=>{e.exports=require("buffer")},84770:e=>{e.exports=require("crypto")},76162:e=>{e.exports=require("stream")},21764:e=>{e.exports=require("util")},41565:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>x,patchFetch:()=>h,requestAsyncStorage:()=>l,routeModule:()=>p,serverHooks:()=>m,staticGenerationAsyncStorage:()=>d});var n={};r.r(n),r.d(n,{GET:()=>c});var s=r(49303),a=r(88716),i=r(60670),o=r(87070),u=r(95456);async function c(){try{let e=await (0,u.ts)();if(!e)return o.NextResponse.json({error:"Unauthorized"},{status:401});if((0,u.PT)(e))return o.NextResponse.json({error:"STORE_INACTIVE",message:"Cabang Anda sedang tidak aktif"},{status:403});return o.NextResponse.json({user:{id:e.id,name:e.name,email:e.email,role:e.role,tenantId:e.tenantId,storeId:e.storeId,tenant:{id:e.tenant.id,name:e.tenant.name,slug:e.tenant.slug}}})}catch{return o.NextResponse.json({error:"Terjadi kesalahan server"},{status:500})}}let p=new s.AppRouteRouteModule({definition:{kind:a.x.APP_ROUTE,page:"/api/auth/me/route",pathname:"/api/auth/me",filename:"route",bundlePath:"app/api/auth/me/route"},resolvedPagePath:"D:\\PROJECT\\resto-saas\\src\\app\\api\\auth\\me\\route.ts",nextConfigOutput:"",userland:n}),{requestAsyncStorage:l,staticGenerationAsyncStorage:d,serverHooks:m}=p,x="/api/auth/me/route";function h(){return(0,i.patchFetch)({serverHooks:m,staticGenerationAsyncStorage:d})}},95456:(e,t,r)=>{r.d(t,{Gv:()=>l,MH:()=>h,PT:()=>f,RA:()=>d,WX:()=>m,c_:()=>p,ts:()=>x});var n=r(41482),s=r.n(n),a=r(42023),i=r.n(a),o=r(71615),u=r(8194);let c=process.env.JWT_SECRET||"fallback-secret-change-me";async function p(e){return i().hash(e,12)}async function l(e,t){return i().compare(e,t)}function d(e){return s().sign(e,c,{expiresIn:"7d"})}function m(e){try{return s().verify(e,c)}catch{return null}}async function x(){let e=await (0,o.cookies)(),t=e.get("token")?.value;if(!t)return null;let r=m(t);return r?await u._.user.findUnique({where:{id:r.userId},include:{tenant:!0,store:!0}}):null}function h(e,t){return t.includes(e)}function f(e){return!["owner","admin"].includes(e.role)&&!!e.storeId&&!!e.store&&!e.store.isActive}},8194:(e,t,r)=>{r.d(t,{_:()=>s});let n=require("@prisma/client"),s=globalThis.prisma??new n.PrismaClient}};var t=require("../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),n=t.X(0,[8948,5972,4261,2023],()=>r(41565));module.exports=n})();