"use strict";(()=>{var e={};e.id=975,e.ids=[975],e.modules={145:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},6249:(e,t)=>{Object.defineProperty(t,"l",{enumerable:!0,get:function(){return function e(t,s){return s in t?t[s]:"then"in t&&"function"==typeof t.then?t.then(t=>e(t,s)):"function"==typeof t&&"default"===s?t:void 0}}})},1831:(e,t,s)=>{s.r(t),s.d(t,{config:()=>d,default:()=>u,routeModule:()=>c});var r={};s.r(r),s.d(r,{default:()=>a});var n=s(1802),o=s(7153),i=s(6249);async function a(e,t){if("POST"!==e.method)return t.status(405).json({error:"Method not allowed"});let{url:s}=e.body;if(!s)return t.status(400).json({error:"URL is required"});try{new URL(s);let e=process.env.GOOGLE_APPS_SCRIPT_URL;if(!e)return t.status(500).json({error:"Google Apps Script URL not configured",success:!1});let r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:s})}),n=await r.json();return t.status(200).json({success:n.success,message:n.message||"URL submitted for crawling and indexing",data:{url:s,submittedAt:new Date().toISOString(),status:n.success?"processing":"failed",googleResponse:n}})}catch(e){return t.status(400).json({error:"Invalid URL or processing failed",message:e.message,success:!1})}}let u=(0,i.l)(r,"default"),d=(0,i.l)(r,"config"),c=new n.PagesAPIRouteModule({definition:{kind:o.x.PAGES_API,page:"/api/urls/submit",pathname:"/api/urls/submit",bundlePath:"",filename:""},userland:r})},7153:(e,t)=>{var s;Object.defineProperty(t,"x",{enumerable:!0,get:function(){return s}}),function(e){e.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE"}(s||(s={}))},1802:(e,t,s)=>{e.exports=s(145)}};var t=require("../../../webpack-api-runtime.js");t.C(e);var s=t(t.s=1831);module.exports=s})();