"use strict";(()=>{var e={};e.id=214,e.ids=[214],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")},98070:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>m,patchFetch:()=>h,requestAsyncStorage:()=>l,routeModule:()=>d,serverHooks:()=>f,staticGenerationAsyncStorage:()=>x});var n={};r.r(n),r.d(n,{PUT:()=>p});var i=r(49303),s=r(88716),o=r(60670),a=r(87070),u=r(8194),c=r(95456);async function p(e,{params:t}){try{if(!await (0,c.ts)())return a.NextResponse.json({error:"Unauthorized"},{status:401});let{id:r}=await t,n=await e.json(),i=await u._.notification.update({where:{id:r},data:n});return a.NextResponse.json({notification:i})}catch{return a.NextResponse.json({error:"Server error"},{status:500})}}let d=new i.AppRouteRouteModule({definition:{kind:s.x.APP_ROUTE,page:"/api/notifications/[id]/route",pathname:"/api/notifications/[id]",filename:"route",bundlePath:"app/api/notifications/[id]/route"},resolvedPagePath:"D:\\PROJECT\\resto-saas\\src\\app\\api\\notifications\\[id]\\route.ts",nextConfigOutput:"",userland:n}),{requestAsyncStorage:l,staticGenerationAsyncStorage:x,serverHooks:f}=d,m="/api/notifications/[id]/route";function h(){return(0,o.patchFetch)({serverHooks:f,staticGenerationAsyncStorage:x})}},95456:(e,t,r)=>{r.d(t,{Gv:()=>d,MH:()=>m,PT:()=>h,RA:()=>l,WX:()=>x,c_:()=>p,ts:()=>f});var n=r(41482),i=r.n(n),s=r(42023),o=r.n(s),a=r(71615),u=r(8194);let c=process.env.JWT_SECRET||"fallback-secret-change-me";async function p(e){return o().hash(e,12)}async function d(e,t){return o().compare(e,t)}function l(e){return i().sign(e,c,{expiresIn:"7d"})}function x(e){try{return i().verify(e,c)}catch{return null}}async function f(){let e=await (0,a.cookies)(),t=e.get("token")?.value;if(!t)return null;let r=x(t);return r?await u._.user.findUnique({where:{id:r.userId},include:{tenant:!0,store:!0}}):null}function m(e,t){return t.includes(e)}function h(e){return!["owner","admin"].includes(e.role)&&!!e.storeId&&!!e.store&&!e.store.isActive}},8194:(e,t,r)=>{r.d(t,{_:()=>i});let n=require("@prisma/client"),i=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(98070));module.exports=n})();