module.exports=[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"))},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"))},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"))},23862,e=>e.a(async(t,r)=>{try{let t=await e.y("pg-587764f78a6c7a9c");e.n(t),r()}catch(e){r(e)}},!0),64769,e=>e.a(async(t,r)=>{try{var a=e.i(23862),n=t([a]);[a]=n.then?(await n)():n;let o=new a.Pool({host:"209.74.80.58",port:5432,user:"rrgnihyq_admin_domiblocks",password:"D0miblocks#2026",database:"rrgnihyq_DOMIBLOCKS_OPS",max:5,idleTimeoutMillis:3e4,connectionTimeoutMillis:1e4});o.on("error",e=>{console.error("❌ [DB OPS ERROR]:",e.message)}),e.s(["default",0,o,"queryOps",0,(e,t)=>o.query(e,t)]),r()}catch(e){r(e)}},!1),68554,e=>e.a(async(t,r)=>{try{var a=e.i(89171),n=e.i(64769),o=t([n]);async function s(e){try{let{searchParams:t}=new URL(e.url),r=t.get("pricelist_id");if(!r)return a.NextResponse.json({error:"Se requiere localidad_id (pricelist_id)"},{status:400});let o=`
      SELECT 
          p.id,
          p.nombre,
          pp.precio,
          pp.precio_objetivo
      FROM 
          "Productos" p
      JOIN 
          "PrecioProducto" pp ON p.id = pp.producto_id
      WHERE 
          pp.localidad_id = $1
      ORDER BY 
          p.nombre ASC;
    `,s=(await (0,n.queryOps)(o,[r])).rows.map(e=>({id:String(e.id),name:e.nombre,display_name:e.nombre,list_price:Number(e.precio)||0,target_price:Number(e.precio_objetivo)||0,default_code:"",description:`Producto de cat\xe1logo`,activo:!0}));return a.NextResponse.json(s)}catch(e){return console.error("Error fetching products from DB OPS:",e.message),a.NextResponse.json({error:"Error al obtener productos por localidad de la base de datos de operaciones",details:e.message},{status:500})}}[n]=o.then?(await o)():o,e.s(["GET",()=>s]),r()}catch(e){r(e)}},!1),87549,e=>e.a(async(t,r)=>{try{var a=e.i(47909),n=e.i(74017),o=e.i(96250),s=e.i(59756),i=e.i(61916),l=e.i(74677),d=e.i(69741),p=e.i(16795),u=e.i(87718),c=e.i(95169),h=e.i(47587),x=e.i(66012),R=e.i(70101),m=e.i(26937),v=e.i(10372),g=e.i(93695);e.i(52474);var f=e.i(220),y=e.i(68554),E=t([y]);[y]=E.then?(await E)():E;let C=new a.AppRouteRouteModule({definition:{kind:n.RouteKind.APP_ROUTE,page:"/api/productos/route",pathname:"/api/productos",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/productos/route.ts",nextConfigOutput:"standalone",userland:y}),{workAsyncStorage:_,workUnitAsyncStorage:O,serverHooks:P}=C;function w(){return(0,o.patchFetch)({workAsyncStorage:_,workUnitAsyncStorage:O})}async function b(e,t,r){C.isDev&&(0,s.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let a="/api/productos/route";a=a.replace(/\/index$/,"")||"/";let o=await C.prepare(e,t,{srcPage:a,multiZoneDraftMode:!1});if(!o)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:y,params:E,nextConfig:w,parsedUrl:b,isDraftMode:_,prerenderManifest:O,routerServerContext:P,isOnDemandRevalidate:A,revalidateOnlyGenerated:N,resolvedPathname:T,clientReferenceManifest:S,serverActionsManifest:q}=o,k=(0,d.normalizeAppPath)(a),j=!!(O.dynamicRoutes[k]||O.routes[T]),D=async()=>((null==P?void 0:P.render404)?await P.render404(e,t,b,!1):t.end("This page could not be found"),null);if(j&&!_){let e=!!O.routes[T],t=O.dynamicRoutes[k];if(t&&!1===t.fallback&&!e){if(w.experimental.adapterPath)return await D();throw new g.NoFallbackError}}let H=null;!j||C.isDev||_||(H=T,H="/index"===H?"/":H);let I=!0===C.isDev||!j,U=j&&!I;q&&S&&(0,l.setManifestsSingleton)({page:a,clientReferenceManifest:S,serverActionsManifest:q});let M=e.method||"GET",$=(0,i.getTracer)(),B=$.getActiveScopeSpan(),F={params:E,prerenderManifest:O,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:I,incrementalCache:(0,s.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:w.cacheLife,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>C.onRequestError(e,t,a,n,P)},sharedContext:{buildId:y}},K=new p.NodeNextRequest(e),L=new p.NodeNextResponse(t),G=u.NextRequestAdapter.fromNodeNextRequest(K,(0,u.signalFromNodeResponse)(t));try{let o=async e=>C.handle(G,F).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=$.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==c.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 n=r.get("next.route");if(n){let t=`${M} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t)}else e.updateName(`${M} ${a}`)}),l=!!(0,s.getRequestMeta)(e,"minimalMode"),d=async s=>{var i,d;let p=async({previousCacheEntry:n})=>{try{if(!l&&A&&N&&!n)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=await o(s);e.fetchMetrics=F.renderOpts.fetchMetrics;let i=F.renderOpts.pendingWaitUntil;i&&r.waitUntil&&(r.waitUntil(i),i=void 0);let d=F.renderOpts.collectedTags;if(!j)return await (0,x.sendResponse)(K,L,a,F.renderOpts.pendingWaitUntil),null;{let e=await a.blob(),t=(0,R.toNodeOutgoingHttpHeaders)(a.headers);d&&(t[v.NEXT_CACHE_TAGS_HEADER]=d),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==F.renderOpts.collectedRevalidate&&!(F.renderOpts.collectedRevalidate>=v.INFINITE_CACHE)&&F.renderOpts.collectedRevalidate,n=void 0===F.renderOpts.collectedExpire||F.renderOpts.collectedExpire>=v.INFINITE_CACHE?void 0:F.renderOpts.collectedExpire;return{value:{kind:f.CachedRouteKind.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==n?void 0:n.isStale)&&await C.onRequestError(e,t,{routerKind:"App Router",routePath:a,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:A})},!1,P),t}},u=await C.handleResponse({req:e,nextConfig:w,cacheKey:H,routeKind:n.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:O,isRoutePPREnabled:!1,isOnDemandRevalidate:A,revalidateOnlyGenerated:N,responseGenerator:p,waitUntil:r.waitUntil,isMinimalMode:l});if(!j)return null;if((null==u||null==(i=u.value)?void 0:i.kind)!==f.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(d=u.value)?void 0:d.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});l||t.setHeader("x-nextjs-cache",A?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),_&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let c=(0,R.fromNodeOutgoingHttpHeaders)(u.value.headers);return l&&j||c.delete(v.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||c.get("Cache-Control")||c.set("Cache-Control",(0,m.getCacheControlHeader)(u.cacheControl)),await (0,x.sendResponse)(K,L,new Response(u.value.body,{headers:c,status:u.value.status||200})),null};B?await d(B):await $.withPropagatedContext(e.headers,()=>$.trace(c.BaseServerSpan.handleRequest,{spanName:`${M} ${a}`,kind:i.SpanKind.SERVER,attributes:{"http.method":M,"http.target":e.url}},d))}catch(t){if(t instanceof g.NoFallbackError||await C.onRequestError(e,t,{routerKind:"App Router",routePath:k,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:A})},!1,P),j)throw t;return await (0,x.sendResponse)(K,L,new Response(null,{status:500})),null}}e.s(["handler",()=>b,"patchFetch",()=>w,"routeModule",()=>C,"serverHooks",()=>P,"workAsyncStorage",()=>_,"workUnitAsyncStorage",()=>O]),r()}catch(e){r(e)}},!1)];

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