module.exports=[84941,(a,b,c)=>{b.exports=a.x("@prisma/client-2c3a283f134fdcb6/runtime/client",()=>require("@prisma/client-2c3a283f134fdcb6/runtime/client"))},8839,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[externals]_@prisma_client_runtime_query_compiler_fast_bg_sqlite_mjs_15lig9w._.js"].map(b=>a.l(b))).then(()=>b(53315)))},998,a=>{a.v(b=>Promise.all(["server/chunks/ssr/0d-b_@prisma_client_runtime_query_compiler_fast_bg_sqlite_wasm-base64_mjs_1jb9bv_._.js"].map(b=>a.l(b))).then(()=>b(99802)))},85148,(a,b,c)=>{b.exports=a.x("better-sqlite3-90e2652d1716b047",()=>require("better-sqlite3-90e2652d1716b047"))},16005,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[externals]_node_buffer_00a6lhv._.js"].map(b=>a.l(b))).then(()=>b(51615)))},50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},57764,(a,b,c)=>{b.exports=a.x("node:url",()=>require("node:url"))},6020,a=>{"use strict";var b=a.i(37936),c=a.i(72849);a.i(70396);var d=a.i(73727),e=a.i(18558),f=a.i(66518),g=a.i(82241),h=a.i(36580);async function i(a,b){let e=String(b.get("email")??"").trim().toLowerCase(),i=String(b.get("password")??"");if(!e||!i)return{error:"Email et mot de passe requis."};let j=await f.prisma.user.findUnique({where:{email:e}});return j&&j.active?await c.default.compare(i,j.passwordHash)?void(await (0,g.createSession)({id:j.id,email:j.email,firstName:j.firstName,lastName:j.lastName,role:j.role,position:j.position}),await f.prisma.user.update({where:{id:j.id},data:{lastLoginAt:new Date}}),await (0,h.logActivity)({userId:j.id,action:"CONNEXION",entity:"auth",details:"Connexion réussie"}),(0,d.redirect)("/")):(await (0,h.logActivity)({userId:j.id,action:"CONNEXION",entity:"auth",details:"Tentative de connexion échouée (mot de passe)"}),{error:"Identifiants invalides."}):{error:"Identifiants invalides."}}async function j(){let a=await (0,g.getSession)();a&&await (0,h.logActivity)({userId:a.id,action:"CONNEXION",entity:"auth",details:"Déconnexion"}),await (0,g.destroySession)(),(0,e.revalidatePath)("/"),(0,d.redirect)("/login")}(0,a.i(13095).ensureServerEntryExports)([i,j]),(0,b.registerServerReference)(i,"60fea3dda49dc9fe78a3e8091b2d43b568bf46f451",null),(0,b.registerServerReference)(j,"00e0ee7bc13c0f33941537bfce1451ca5e1ab19590",null),a.s([],97654),a.i(97654),a.s(["60fea3dda49dc9fe78a3e8091b2d43b568bf46f451",0,i],6020)},36580,a=>{"use strict";var b=a.i(66518);async function c(a){return b.prisma.activityLog.create({data:{userId:a.userId,action:a.action,entity:a.entity,entityId:a.entityId??null,details:a.details??null}})}a.s(["logActivity",0,c])}];

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