"use strict";(()=>{var e={};e.id=1513,e.ids=[1513],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")},28396:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>h,patchFetch:()=>x,requestAsyncStorage:()=>_,routeModule:()=>l,serverHooks:()=>m,staticGenerationAsyncStorage:()=>p});var a={};r.r(a),r.d(a,{POST:()=>u});var n=r(49303),o=r(88716),s=r(60670),i=r(87070),d=r(56681),c=r.n(d);async function u(e){let t;try{let{url:r,headless:a=!0}=await e.json();if(!r)return i.NextResponse.json({error:"URL is required"},{status:400});t=await c().chromium.launch({headless:a});let n=await t.newPage();await n.goto(r,{waitUntil:"domcontentloaded",timeout:3e4}),await n.waitForTimeout(4e3);let o=await n.evaluate(()=>{let e=e=>document.querySelector(`.third_party_business_data_container__NE_k7 .${e}`)?.innerHTML||"",t=document.querySelector(".third_party_business_data_container__NE_k7 .name-selector")?.innerText||"",r=document.querySelector(".third_party_business_data_container__NE_k7 .email-selector")?.innerText||"",a=document.querySelector(".third_party_business_data_container__NE_k7 .website-url-selector")?.innerText||"",n=document.querySelector(".third_party_business_data_container__NE_k7 .latitude-selector")?.innerText||"",o=document.querySelector(".third_party_business_data_container__NE_k7 .longitude-selector")?.innerText||"",s=document.querySelector(".third_party_business_data_container__NE_k7 .categories-selector")?.innerText||"",i=document.querySelector(".third_party_business_data_container__NE_k7 .phone-number-selector")?.innerText||"",d=[];if(i){let e=Array.from(i.matchAll(/\+?\d{1,4}?[-.\s]?\(?\d{2,5}\)?[-.\s]?\d{3,4}[-.\s]?\d{4,9}/g),e=>e[0]);d=[...new Set(e.filter(e=>{let t=e.replace(/[^\d+]/g,"");return!(t.length<7||t.length>15||/^\d+$/.test(t)&&(t.length<10||t.length>14))&&!!/^\+?\d{1,4}[-.\s]?\(?\d{2,5}\)?[-.\s]?\d{3,4}[-.\s]?\d{4,9}$/.test(e)}))].map(e=>e.replace(/[\s()\-\+]/g,""))||[]}return{company:t,phone:d,email:r,website:a,lat:n,long:o,category:s,address:`${e("street-address-selector")}, ${e("city-selector")}, ${e("state-selector")}, ${e("zip-code-selector")}, ${e("country-selector")}`}});return i.NextResponse.json(o)}catch(e){return console.log(e),[]}finally{t&&await t.close()}}let l=new n.AppRouteRouteModule({definition:{kind:o.x.APP_ROUTE,page:"/api/nextdoor_detail_scraper/route",pathname:"/api/nextdoor_detail_scraper",filename:"route",bundlePath:"app/api/nextdoor_detail_scraper/route"},resolvedPagePath:"C:\\Users\\Design Collection\\OneDrive\\Desktop\\Jitendra Vishwakarma\\Next Dashboard\\web crawler for user dev\\Scrape Genius\\app\\api\\nextdoor_detail_scraper\\route.js",nextConfigOutput:"",userland:a}),{requestAsyncStorage:_,staticGenerationAsyncStorage:p,serverHooks:m}=l,h="/api/nextdoor_detail_scraper/route";function x(){return(0,s.patchFetch)({serverHooks:m,staticGenerationAsyncStorage:p})}}};var t=require("../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),a=t.X(0,[8948,5972],()=>r(28396));module.exports=a})();