module.exports=[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"))},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"))},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"))},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"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},24361,(e,t,r)=>{t.exports=e.x("util",()=>require("util"))},51615,(e,t,r)=>{t.exports=e.x("node:buffer",()=>require("node:buffer"))},68105,e=>{"use strict";var t=e.i(24652);let r=process.env.JWT_SECRET;e.s(["createToken",0,function(e){return t.default.sign(e,r,{expiresIn:"7d"})},"verifyToken",0,function(e){try{return t.default.verify(e,r)}catch{return null}}])},87119,e=>{"use strict";var t=e.i(47909),r=e.i(74017),a=e.i(96250),n=e.i(59756),i=e.i(61916),s=e.i(74677),o=e.i(69741),l=e.i(16795),d=e.i(87718),u=e.i(95169),c=e.i(47587),p=e.i(66012),x=e.i(70101),R=e.i(26937),g=e.i(10372),h=e.i(93695);e.i(52474);var v=e.i(220),m=e.i(89171),E=e.i(62294),f=e.i(93458),w=e.i(68105);async function _(){try{let e=await (0,f.cookies)(),t=e.get("token")?.value,r=(0,w.verifyToken)(t||"");if(!r||"brigadist"!==r.role)return m.NextResponse.json({error:"No autorizado"},{status:401});let[a]=await E.db.query(`
      SELECT 
        c.id,
        c.title,
        c.message_text,
        c.image_url_1,
        c.image_url_2,
        c.image_url_3,
        c.created_at,
        t.is_read, 
        t.is_disseminated,
        t.leader_instructions -- <--- IMPORTANTE: Pedimos la columna de instrucciones
      FROM digital_campaigns c
      INNER JOIN campaign_tracking t ON c.id = t.campaign_id
      WHERE t.user_id = ?
      ORDER BY c.created_at DESC
    `,[r.id]);return a.length>0&&await E.db.query("UPDATE campaign_tracking SET is_read = 1, read_at = NOW() WHERE user_id = ? AND is_read = 0",[r.id]),m.NextResponse.json(a)}catch(e){return console.error("BRIGADIST_GET_ERROR:",e),m.NextResponse.json({error:"Error de servidor al cargar misiones"},{status:500})}}e.s(["GET",0,_],84867);var y=e.i(84867);let C=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/brigadist/campaign/route",pathname:"/api/brigadist/campaign",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/brigadist/campaign/route.ts",nextConfigOutput:"",userland:y,...{}}),{workAsyncStorage:b,workUnitAsyncStorage:T,serverHooks:N}=C;async function A(e,t,a){a.requestMeta&&(0,n.setRequestMeta)(e,a.requestMeta),C.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let m="/api/brigadist/campaign/route";m=m.replace(/\/index$/,"")||"/";let E=await C.prepare(e,t,{srcPage:m,multiZoneDraftMode:!1});if(!E)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:f,params:w,nextConfig:_,parsedUrl:y,isDraftMode:b,prerenderManifest:T,routerServerContext:N,isOnDemandRevalidate:A,revalidateOnlyGenerated:k,resolvedPathname:q,clientReferenceManifest:O,serverActionsManifest:P}=E,S=(0,o.normalizeAppPath)(m),I=!!(T.dynamicRoutes[S]||T.routes[q]),j=async()=>((null==N?void 0:N.render404)?await N.render404(e,t,y,!1):t.end("This page could not be found"),null);if(I&&!b){let e=!!T.routes[q],t=T.dynamicRoutes[S];if(t&&!1===t.fallback&&!e){if(_.adapterPath)return await j();throw new h.NoFallbackError}}let H=null;!I||C.isDev||b||(H="/index"===(H=q)?"/":H);let D=!0===C.isDev||!I,M=I&&!D;P&&O&&(0,s.setManifestsSingleton)({page:m,clientReferenceManifest:O,serverActionsManifest:P});let U=e.method||"GET",F=(0,i.getTracer)(),$=F.getActiveScopeSpan(),B=!!(null==N?void 0:N.isWrappedByNextServer),K=!!(0,n.getRequestMeta)(e,"minimalMode"),W=(0,n.getRequestMeta)(e,"incrementalCache")||await C.getIncrementalCache(e,_,T,K);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let G={params:w,previewProps:T.preview,renderOpts:{experimental:{authInterrupts:!!_.experimental.authInterrupts},cacheComponents:!!_.cacheComponents,supportsDynamicResponse:D,incrementalCache:W,cacheLifeProfiles:_.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>C.onRequestError(e,t,a,n,N)},sharedContext:{buildId:f}},L=new l.NodeNextRequest(e),V=new l.NodeNextResponse(t),X=d.NextRequestAdapter.fromNodeNextRequest(L,(0,d.signalFromNodeResponse)(t));try{let n,s=async e=>C.handle(X,G).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=F.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route");if(a){let t=`${U} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t),n&&n!==e&&(n.setAttribute("http.route",a),n.updateName(t))}else e.updateName(`${U} ${m}`)}),o=async n=>{var i,o;let l=async({previousCacheEntry:r})=>{try{if(!K&&A&&k&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let i=await s(n);e.fetchMetrics=G.renderOpts.fetchMetrics;let o=G.renderOpts.pendingWaitUntil;o&&a.waitUntil&&(a.waitUntil(o),o=void 0);let l=G.renderOpts.collectedTags;if(!I)return await (0,p.sendResponse)(L,V,i,G.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),t=(0,x.toNodeOutgoingHttpHeaders)(i.headers);l&&(t[g.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==G.renderOpts.collectedRevalidate&&!(G.renderOpts.collectedRevalidate>=g.INFINITE_CACHE)&&G.renderOpts.collectedRevalidate,a=void 0===G.renderOpts.collectedExpire||G.renderOpts.collectedExpire>=g.INFINITE_CACHE?void 0:G.renderOpts.collectedExpire;return{value:{kind:v.CachedRouteKind.APP_ROUTE,status:i.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await C.onRequestError(e,t,{routerKind:"App Router",routePath:m,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:A})},!1,N),t}},d=await C.handleResponse({req:e,nextConfig:_,cacheKey:H,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:T,isRoutePPREnabled:!1,isOnDemandRevalidate:A,revalidateOnlyGenerated:k,responseGenerator:l,waitUntil:a.waitUntil,isMinimalMode:K});if(!I)return null;if((null==d||null==(i=d.value)?void 0:i.kind)!==v.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(o=d.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});K||t.setHeader("x-nextjs-cache",A?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),b&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let u=(0,x.fromNodeOutgoingHttpHeaders)(d.value.headers);return K&&I||u.delete(g.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||u.get("Cache-Control")||u.set("Cache-Control",(0,R.getCacheControlHeader)(d.cacheControl)),await (0,p.sendResponse)(L,V,new Response(d.value.body,{headers:u,status:d.value.status||200})),null};B&&$?await o($):(n=F.getActiveScopeSpan(),await F.withPropagatedContext(e.headers,()=>F.trace(u.BaseServerSpan.handleRequest,{spanName:`${U} ${m}`,kind:i.SpanKind.SERVER,attributes:{"http.method":U,"http.target":e.url}},o),void 0,!B))}catch(t){if(t instanceof h.NoFallbackError||await C.onRequestError(e,t,{routerKind:"App Router",routePath:S,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:A})},!1,N),I)throw t;return await (0,p.sendResponse)(L,V,new Response(null,{status:500})),null}}e.s(["handler",0,A,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:b,workUnitAsyncStorage:T})},"routeModule",0,C,"serverHooks",0,N,"workAsyncStorage",0,b,"workUnitAsyncStorage",0,T],87119)}];

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