"use strict";(()=>{var e={};e.id=814,e.ids=[814],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")},57147:e=>{e.exports=require("fs")},71017:e=>{e.exports=require("path")},41046:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>y,patchFetch:()=>k,requestAsyncStorage:()=>w,routeModule:()=>x,serverHooks:()=>v,staticGenerationAsyncStorage:()=>b});var a={};t.r(a),t.d(a,{POST:()=>h});var s=t(49303),i=t(88716),o=t(60670),n=t(87070),p=t(56681),c=t(57147),l=t.n(c),m=t(71017),d=t.n(m);let u=d().resolve(process.cwd(),".."),g=d().join(u,"data","instagram_data"),f=(e,r)=>{try{let t=r.replace(/[^a-zA-Z0-9]/g,"_").toLowerCase(),a=d().join(g,`${t}.json`),s=[];if(l().existsSync(g)||l().mkdirSync(g,{recursive:!0}),l().existsSync(a)){let e=l().readFileSync(a,"utf-8");e.trim().length>0&&(s=JSON.parse(e))}s.push(e),l().writeFileSync(a,JSON.stringify(s,null,2))}catch(e){console.error("❌ Error writing file:",e.message)}};async function h(e){try{let{url:r,query:t}=await e.json();if(!r)return n.NextResponse.json({error:"URL is required"},{status:400});let a=await p.chromium.connectOverCDP("http://localhost:9222"),s=a.contexts()[0].pages()[0];await s.goto(r,{waitUntil:"domcontentloaded",timeout:6e4});try{await s.waitForTimeout(2e3),await s.keyboard.press("Escape"),await s.waitForTimeout(5e3),await s.waitForSelector('main[role="main"]',{timeout:5e3});let e=await s.evaluate(()=>{let e=document.querySelector('main[role="main"] header section')||[],r=document.querySelector("header > div span img")?.src||"",t=document.querySelector("header section h2")?.innerText||"",a=document.querySelectorAll("header section ul li")||[],s=a[0]?.innerText||"",i=a[1]?.innerText||"",o=a[2]?.innerText||"",n=e?.querySelector(":scope > div:nth-of-type(3)")?.innerText||"",p=Array.from(n.matchAll(/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g),e=>e[0]),c=[...new Set(p.filter(e=>!/\.(png|jpe?g|gif|webp|svg|bmp|tiff|heif|heic|ico|cur|psd|cdr|ai|eps|raw|cr2|nef|orf|sr2|rw2|dng|raf|arw|pef|x3f|pbm|pgm|ppm|pnm|hdr|exr|sgi|pic|pict|txt|md|rtf|docx?|odt|pdf|pages|tex|log|ans|wpd|xlsx?|xlsm|ods|csv|tsv|numbers|dbf|qif|qfx|pptx?|odp|key|js|jsx|ts|tsx|py|pyc|java|class|kt|kts|rb|php3?|pl|ps1|sh|bash|c|cpp|h|hpp|cs|go|rs|scala|swift|m|mm|vb|r|lua|groovy|erl|exs?|html?|xhtml|css|scss|sass|less|xml|json|map|ya?ml|mp3|wav|aac|m4a|flac|ogg|oga|opus|wma|aiff|alac|amr|mp4|m4v|mov|avi|mkv|wmv|flv|webm|mpeg|mpg|ts|m2ts|zip|rar|tar|gz|tgz|bz2|xz|z|lz|cab|iso|img|dmg|jar|ttf|otf|woff2?|eot|sql|sqlite3?|db|mdb|accdb|ldf|bak|ini|cfg|conf|env|plist|reg|sys|service|desktop|exe|dll|so|bin|elf|app|deb|rpm|msi|apk|ipa|lock|toml|gradle|pom|war|ear|whl|gem|npmignore|json|yarnrc|dxf|dwg|stl|obj|fbx|blend|gltf|glb|kml|kmz|geojson|shp|shx|gpx|osm|eml|msg|vcf|ics|pem|crt|cer|key|p12|pfx|asc|bib|cls|sty|ipynb|rmd|nb|mnb|trace|out|metrics|perf|tmp|old|swp|part|crdownload|torrent|lnk|ace|zst|pak|cue|md5|sha1|sha256|checksum)$/i.test(e)))],l=Array.from(n.matchAll(/\+?\d{1,4}?[-.\s]?\(?\d{2,5}\)?[-.\s]?\d{3,4}[-.\s]?\d{4,9}/g),e=>e[0]),m=[...new Set(l.filter(e=>{let r=e.replace(/[^\d+]/g,"");return!(r.length<7||r.length>15||/^\d+$/.test(r)&&(r.length<10||r.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{website:"N/A",profile_image:r,title:t,emails:c,phones:m,posts:s,followers:i,following:o,description:n}});return await a.close(),f({...e,url:r},t),n.NextResponse.json({...e,url:r})}catch(e){console.log("Error extracting instagram data:",e.message)}}catch(e){return console.error("❌ Scraping Error:",e),n.NextResponse.json({error:"Failed to scrape website"},{status:500})}}let x=new s.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/instagram_detail_scraper/route",pathname:"/api/instagram_detail_scraper",filename:"route",bundlePath:"app/api/instagram_detail_scraper/route"},resolvedPagePath:"C:\\Users\\Design Collection\\OneDrive\\Desktop\\Jitendra Vishwakarma\\Next Dashboard\\web crawler for user dev\\Scrape Genius\\app\\api\\instagram_detail_scraper\\route.js",nextConfigOutput:"",userland:a}),{requestAsyncStorage:w,staticGenerationAsyncStorage:b,serverHooks:v}=x,y="/api/instagram_detail_scraper/route";function k(){return(0,o.patchFetch)({serverHooks:v,staticGenerationAsyncStorage:b})}}};var r=require("../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),a=r.X(0,[8948,5972],()=>t(41046));module.exports=a})();