module.exports=[254799,(a,b,c)=>{b.exports=a.x("crypto",()=>require("crypto"))},522734,(a,b,c)=>{b.exports=a.x("fs",()=>require("fs"))},446786,(a,b,c)=>{b.exports=a.x("os",()=>require("os"))},688947,(a,b,c)=>{b.exports=a.x("stream",()=>require("stream"))},504446,(a,b,c)=>{b.exports=a.x("net",()=>require("net"))},755004,(a,b,c)=>{b.exports=a.x("tls",()=>require("tls"))},60438,(a,b,c)=>{b.exports=a.x("perf_hooks",()=>require("perf_hooks"))},847066,a=>{"use strict";var b=a.i(345146);a.i(384909),a.s(["getSessionController",()=>b.getSessionController,"logoutController",()=>b.logoutController])},25256,a=>{"use strict";var b=a.i(137936),c=a.i(594758),d=a.i(93321),e=a.i(530385),f=a.i(844037),g=a.i(231670);async function h(a){return{success:!0,statusCode:200,message:"UDC তালিকা লোড হয়েছে",data:{elevations:await c.db.select({id:f.udcElevations.id,entrepreneurId:f.udcElevations.entrepreneurId,entrepreneurName:g.users.name,entrepreneurNameBn:g.users.name_bn,entrepreneurPhone:g.users.phone,canManageNagorik:f.udcElevations.canManageNagorik,canManageSonod:f.udcElevations.canManageSonod,canApproveSonod:f.udcElevations.canApproveSonod,status:f.udcElevations.status,division:f.udcElevations.division,district:f.udcElevations.district,upazila:f.udcElevations.upazila,union:f.udcElevations.union,grantedBy:f.udcElevations.grantedBy,createdAt:f.udcElevations.created_at,revokedAt:f.udcElevations.revokedAt,revokedReason:f.udcElevations.revokedReason}).from(f.udcElevations).innerJoin(g.users,(0,d.eq)(f.udcElevations.entrepreneurId,g.users.id)).where((0,d.eq)(f.udcElevations.grantedBy,a)).orderBy((0,e.desc)(f.udcElevations.created_at))}}}async function i(a,b){let e=await c.db.select({division:g.users.division,district:g.users.district,upazila:g.users.upazila,union:g.users.union}).from(g.users).where((0,d.eq)(g.users.id,a)).limit(1);if(0===e.length)return{success:!1,statusCode:404,message:"অফিস ব্যবহারকারী পাওয়া যায়নি"};let h=await c.db.select({id:g.users.id,role:g.users.role}).from(g.users).where((0,d.eq)(g.users.phone,b.phone)).limit(1);if(0===h.length||"entrepreneur"!==h[0].role)return{success:!1,statusCode:404,message:"এই মোবাইল নম্বরে কোনো উদ্যোক্তা পাওয়া যায়নি"};let i=h[0].id;if((await c.db.select().from(f.udcElevations).where((0,d.and)((0,d.eq)(f.udcElevations.entrepreneurId,i),(0,d.eq)(f.udcElevations.grantedBy,a),(0,d.eq)(f.udcElevations.status,"active"))).limit(1)).length>0)return{success:!1,statusCode:400,message:"এই উদ্যোক্তা বর্তমানে সক্রিয় আছেন"};try{let d=await c.db.insert(f.udcElevations).values({entrepreneurId:i,grantedBy:a,division:e[0].division,district:e[0].district,upazila:e[0].upazila,union:e[0].union,canManageNagorik:b.canManageNagorik??!0,canManageSonod:b.canManageSonod??!0,canApproveSonod:b.canApproveSonod??!1,status:"active"}).returning();return{success:!0,statusCode:201,message:"UDC সফলভাবে উন্নত করা হয়েছে",data:{elevation:d[0]}}}catch(a){return console.error("Error creating UDC elevation:",a),{success:!1,statusCode:500,message:a.message||"UDC উন্নত করতে ব্যর্থ"}}}async function j(a,b,e){return 0===(await c.db.select().from(f.udcElevations).where((0,d.and)((0,d.eq)(f.udcElevations.id,a),(0,d.eq)(f.udcElevations.grantedBy,b))).limit(1)).length?{success:!1,statusCode:404,message:"UDC উন্নতি পাওয়া যায়নি"}:(await c.db.update(f.udcElevations).set({status:"revoked",revokedAt:new Date,revokedReason:e||null,updated_at:new Date}).where((0,d.eq)(f.udcElevations.id,a)),{success:!0,statusCode:200,message:"UDC সফলভাবে বাতিল করা হয়েছে"})}async function k(a){let b=await c.db.select().from(f.udcElevations).where((0,d.and)((0,d.eq)(f.udcElevations.entrepreneurId,a),(0,d.eq)(f.udcElevations.status,"active"))).limit(1);return 0===b.length?{canManageNagorik:!1,canManageSonod:!1,canApproveSonod:!1}:{canManageNagorik:b[0].canManageNagorik,canManageSonod:b[0].canManageSonod,canApproveSonod:b[0].canApproveSonod}}(0,a.i(713095).ensureServerEntryExports)([h,i,j,k]),(0,b.registerServerReference)(h,"4024ffdab0f6dc96e99c0091263646fa506c27152c",null),(0,b.registerServerReference)(i,"60d2663b5ffda76ff09eaba3cded7243eb4b40360b",null),(0,b.registerServerReference)(j,"7011239bf1cb10965f3ad9395e3f1880798804904f",null),(0,b.registerServerReference)(k,"4078ca721cf0ea6bf2bb83776743d0be1ccb4804e8",null),a.s(["checkUdcPermissions",0,k])},688877,a=>{"use strict";var b=a.i(847066),c=a.i(25256);a.s([],374983),a.i(374983),a.s(["0021b28e0e2b918f9df0bed9276c52ada9e512decb",()=>b.getSessionController,"00761d1c334752bf2926253c4a1b5dd893df746819",()=>b.logoutController,"4078ca721cf0ea6bf2bb83776743d0be1ccb4804e8",()=>c.checkUdcPermissions],688877)}];

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