{"code":"var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,\"name\",{value,configurable:true});import{Resend}from\"resend\";async function registerRoutes(httpServer,app){app.post(\"/api/contact\",async(req,res)=>{console.log(\"Processing contact request...\");if(!process.env.RESEND_API_KEY){console.error(\"RESEND_API_KEY environment variable is not set\");return res.status(500).json({error:\"Email service not configured\"})}console.log(\"Resend API Key configured, length:\",process.env.RESEND_API_KEY.length);const resend=new Resend(process.env.RESEND_API_KEY);try{if(!req.body){throw new Error(\"No request body received\")}console.log(\"Request body:\",req.body);const{firstName,lastName,email,message}=req.body;if(!email||!message){return res.status(400).json({error:\"Email and message are required\"})}const name=`${firstName} ${lastName}`;const subject=`New Contact Request from ${name}`;console.log(`Attempting to send email to: muralitechlab@gmail.com`);const fromEmail=\"no-reply@prixzo.com\";const payload={from:`ethreyas calling <${fromEmail}>`,to:[\"muralitechlab@gmail.com\"],subject:`Portfolio Contact: ${subject}`,reply_to:email,html:`\n        <div style=\"font-family: Arial, sans-serif; max-width: 600px; margin: 0 auto; background: #f9f9f9; padding: 20px; border-radius: 10px;\">\n          <h2 style=\"color: #333; border-bottom: 2px solid #667eea; padding-bottom: 10px; margin-bottom: 20px;\">\\u{1F4E7} New Portfolio Contact</h2>\n\n          <div style=\"background: white; padding: 20px; border-radius: 8px; margin: 20px 0; border-left: 4px solid #667eea;\">\n            <h3 style=\"color: #667eea; margin-bottom: 15px;\">Contact Details</h3>\n            <p style=\"margin: 8px 0;\"><strong>Name:</strong> ${name}</p>\n            <p style=\"margin: 8px 0;\"><strong>Email:</strong> <a href=\"mailto:${email}\">${email}</a></p>\n            <p style=\"margin: 8px 0;\"><strong>Subject:</strong> ${subject}</p>\n          </div>\n\n          <div style=\"background: white; padding: 20px; border-radius: 8px; margin: 20px 0;\">\n            <h3 style=\"color: #333; margin-bottom: 15px;\">Message:</h3>\n            <div style=\"background: #f8f9fa; padding: 15px; border-radius: 4px; line-height: 1.6;\">\n              ${message.replace(/\\n/g,\"<br>\")}\n            </div>\n          </div>\n\n          <div style=\"text-align: center; margin-top: 30px; padding-top: 20px; border-top: 1px solid #eee;\">\n            <a href=\"mailto:${email}?subject=Re: ${subject}\" style=\"background: #667eea; color: white; padding: 12px 24px; text-decoration: none; border-radius: 5px; display: inline-block;\">Reply to ${name}</a>\n          </div>\n\n          <div style=\"margin-top: 20px; text-align: center; color: #666; font-size: 12px;\">\n            <p>This email was sent from your portfolio website contact form.</p>\n          </div>\n        </div>\n        `};try{const response=await resend.emails.send(payload);console.log(\"Resend API Response:\",response);if(response.error){console.error(\"Resend returned error:\",response.error);return res.status(400).json({error:response.error.message})}return res.status(200).json({success:true,id:response.data?.id})}catch(emailError){console.error(\"Resend send call failed:\",emailError);return res.status(500).json({error:\"Failed to send email via Resend\",details:emailError.message})}}catch(error){console.error(\"Detailed Server Error:\",error);if(!res.headersSent){return res.status(500).json({error:\"Internal Server Error\",details:error.message})}}});return httpServer}__name(registerRoutes,\"registerRoutes\");export{registerRoutes};\n","warnings":[],"map":{"version":3,"mappings":"kHAEA,OAAS,WAAc,SAEvB,eAAsB,eACpB,WACA,IACiB,CAEjB,IAAI,KAAK,eAAgB,MAAO,IAAK,MAAQ,CAC3C,QAAQ,IAAI,+BAA+B,EAE3C,GAAI,CAAC,QAAQ,IAAI,eAAgB,CAC/B,QAAQ,MAAM,gDAAgD,EAC9D,OAAO,IAAI,OAAO,GAAG,EAAE,KAAK,CAAE,MAAO,8BAA+B,CAAC,CACvE,CAEA,QAAQ,IAAI,qCAAsC,QAAQ,IAAI,eAAe,MAAM,EACnF,MAAM,OAAS,IAAI,OAAO,QAAQ,IAAI,cAAc,EAEpD,GAAI,CACF,GAAI,CAAC,IAAI,KAAM,CACb,MAAM,IAAI,MAAM,0BAA0B,CAC5C,CAEA,QAAQ,IAAI,gBAAiB,IAAI,IAAI,EAErC,KAAM,CAAE,UAAW,SAAU,MAAO,OAAQ,EAAI,IAAI,KAEpD,GAAI,CAAC,OAAS,CAAC,QAAS,CACtB,OAAO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