"use strict";(()=>{var e={};e.id=744,e.ids=[744],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,n){return n in t?t[n]:"then"in t&&"function"==typeof t.then?t.then(t=>e(t,n)):"function"==typeof t&&"default"===n?t:void 0}}})},7668:(e,t,n)=>{n.r(t),n.d(t,{config:()=>l,default:()=>p,routeModule:()=>c});var r={};n.r(r),n.d(r,{default:()=>d});var o=n(1802),a=n(7153),i=n(6249);let s=require("elevenlabs-node"),u=new(n.n(s)())({apiKey:process.env.ELEVENLABS_API_KEY,voiceId:"pNInz6obpgDQGcFmaJgB"});async function d(e,t){if("POST"===e.method){let{text:n}=e.body;try{let e=await u.textToSpeechStream({textInput:n});t.setHeader("Content-Type","audio/mpeg"),e.pipe(t)}catch(e){console.error("Error generating speech:",e),t.status(500).json({error:"Failed to generate speech."})}}else t.status(405).json({message:"Method not allowed"})}let p=(0,i.l)(r,"default"),l=(0,i.l)(r,"config"),c=new o.PagesAPIRouteModule({definition:{kind:a.x.PAGES_API,page:"/api/text-to-speech",pathname:"/api/text-to-speech",bundlePath:"",filename:""},userland:r})},7153:(e,t)=>{var n;Object.defineProperty(t,"x",{enumerable:!0,get:function(){return n}}),function(e){e.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE"}(n||(n={}))},1802:(e,t,n)=>{e.exports=n(145)}};var t=require("../../webpack-api-runtime.js");t.C(e);var n=t(t.s=7668);module.exports=n})();