"use strict";(()=>{var e={};e.id=6058,e.ids=[6058],e.modules={20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},56681:e=>{e.exports=require("playwright")},76423:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>g,patchFetch:()=>x,requestAsyncStorage:()=>c,routeModule:()=>d,serverHooks:()=>w,staticGenerationAsyncStorage:()=>m});var a={};r.r(a),r.d(a,{POST:()=>p});var i=r(49303),n=r(88716),o=r(60670),s=r(87070),u=r(56681),l=r.n(u);async function p(e){let t;try{let{url:r}=await e.json();if(!r)return s.NextResponse.json({error:"URL is required"},{status:400});t=await l().chromium.launch();let a=await t.newPage();await a.route("**/*",e=>{["image","stylesheet","font"].includes(e.request().resourceType())?e.abort():e.continue()}),await a.goto(r,{waitUntil:"domcontentloaded",timeout:3e4}),await a.waitForTimeout(4e3);let i=await a.evaluate(()=>{let e=e=>{let t=Array.from(document.querySelectorAll("body *")).find(t=>t.innerText?.trim()===e);if(t){let e=t.nextElementSibling;return e?.innerText?.trim()||"N/A"}return"N/A"};return{turnover:e("Annual Turnover"),gst_date:e("GST Registration Date"),total_emp:e("Total Number of Employees"),gst:(()=>{let e=document.body.innerText.match(/\b[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z]{1}[1-9A-Z]{1}[Z]{1}[0-9A-Z]{1}\b/g);return e?.[0]||"N/A"})()}});return await t.close(),s.NextResponse.json({...i,url:r})}catch(e){return console.error("❌ Scraping Error:",e),s.NextResponse.json({error:"Failed to scrape website"},{status:500})}finally{await t.close()}}let d=new i.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/indiamart_detail_scraper/route",pathname:"/api/indiamart_detail_scraper",filename:"route",bundlePath:"app/api/indiamart_detail_scraper/route"},resolvedPagePath:"C:\\Users\\Design Collection\\OneDrive\\Desktop\\Jitendra Vishwakarma\\Next Dashboard\\web crawler for user dev\\Scrape Genius\\app\\api\\indiamart_detail_scraper\\route.js",nextConfigOutput:"",userland:a}),{requestAsyncStorage:c,staticGenerationAsyncStorage:m,serverHooks:w}=d,g="/api/indiamart_detail_scraper/route";function x(){return(0,o.patchFetch)({serverHooks:w,staticGenerationAsyncStorage:m})}}};var t=require("../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),a=t.X(0,[8948,5972],()=>r(76423));module.exports=a})();