module.exports=[63021,(e,t,r)=>{t.exports=e.x("@prisma/client-2c3a283f134fdcb6",()=>require("@prisma/client-2c3a283f134fdcb6"))},54799,(e,t,r)=>{t.exports=e.x("crypto",()=>require("crypto"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},20635,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},59043,(e,t,r)=>{t.exports=e.x("next/dist/server/runtime-reacts.external.js",()=>require("next/dist/server/runtime-reacts.external.js"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},81111,(e,t,r)=>{t.exports=e.x("node:stream",()=>require("node:stream"))},23862,e=>e.a(async(t,r)=>{try{var s=await e.y("pg-587764f78a6c7a9c");e.n(s),r()}catch(e){r(e)}},!0),87125,e=>{"use strict";e.s(["clientIp",0,function(e){let t=e.headers.get("x-forwarded-for");if(!t)return"unknown";let r=t.split(",").map(e=>e.trim()).filter(Boolean);return r.length>0?r[r.length-1]:"unknown"}])},89104,e=>{"use strict";e.s(["FixedWindowRateLimiter",0,class{limit;windowMs;hits;constructor(e,t){this.limit=e,this.windowMs=t,this.hits=new Map}check(e,t=Date.now()){let r=this.hits.get(e);return!r||t-r.windowStart>=this.windowMs?(this.hits.set(e,{count:1,windowStart:t}),{allowed:!0,remaining:this.limit-1}):r.count>=this.limit?{allowed:!1,remaining:0}:(r.count+=1,{allowed:!0,remaining:this.limit-r.count})}reset(){this.hits.clear()}}])},39301,78726,e=>{"use strict";var t=e.i(5662);let r=new Set(["OWNER","ADMIN","EDITOR"]);async function s(e,s){let i=await (0,t.getMembership)(e,s);return!!i&&"ACTIVE"===i.status&&r.has(i.role)}async function i(e,t,r,s,i,n,a,o){return{auditEntryId:(await e.auditLog.create({data:{trahId:t,entityType:r,entityId:s,actorUserId:i,actorMembershipId:n,action:a,changes:o}})).id}}e.s(["canWrite",0,s],39301),e.s(["record",0,i],78726)},99291,e=>{"use strict";async function t(e,t,r){return e.membership.findUnique({where:{trahId_userId:{trahId:t,userId:r}}})}e.s(["findMembershipByUserAndTrah",0,t])},61302,e=>e.a(async(t,r)=>{try{var s=e.i(98902),i=e.i(98043),n=e.i(99291),a=t([s,i]);async function o(){let e=await (0,s.auth)(),t=e?.user?.id;return"string"==typeof t?t:null}async function d(e){let t=await o();if(!t)return null;let r=await (0,n.findMembershipByUserAndTrah)(i.prisma,e,t);return r&&"ACTIVE"===r.status?{userId:t,membershipId:r.id}:null}[s,i]=a.then?(await a)():a,e.s(["getCallerMembership",0,d,"getCallerUserId",0,o]),r()}catch(e){r(e)}},!1),5662,e=>{"use strict";async function t(e,t){let r=await e.membership.findUnique({where:{id:t}});return r?{id:r.id,trahId:r.trahId,userId:r.userId,role:r.role,claimedPersonId:r.claimedPersonId,status:r.status}:null}e.s(["getMembership",0,t])}];

//# sourceMappingURL=%5Broot-of-the-server%5D__1c4irqx._.js.map