"use strict";(()=>{var e={};e.id=5141,e.ids=[5141],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},29021:e=>{e.exports=require("fs")},33873:e=>{e.exports=require("path")},96762:(e,t)=>{Object.defineProperty(t,"M",{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}}})},99865:(e,t,n)=>{n.r(t),n.d(t,{config:()=>c,default:()=>P,routeModule:()=>l});var r={};n.r(r),n.d(r,{default:()=>f});var i=n(89947),a=n(2706),o=n(96762),u=n(29021),s=n.n(u),d=n(33873),p=n.n(d);async function f(e,t){if("GET"!==e.method)return t.json({msg:"Invalid Request"});let n=p().resolve(process.cwd(),"./public/videos"),r=e.query.name;if(!r||"string"!=typeof r){t.status(400).end("No video name provided");return}let i=p().join(n,r);if(!s().existsSync(i)){t.status(400).end("Video not found");return}s().statSync(i).size,e.headers.range,s().createReadStream(i).pipe(t)}let P=(0,o.M)(r,"default"),c=(0,o.M)(r,"config"),l=new i.PagesAPIRouteModule({definition:{kind:a.A.PAGES_API,page:"/api/stream/[path]",pathname:"/api/stream/[path]",bundlePath:"",filename:""},userland:r})},2706:(e,t)=>{Object.defineProperty(t,"A",{enumerable:!0,get:function(){return n}});var n=function(e){return e.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.IMAGE="IMAGE",e}({})},89947:(e,t,n)=>{e.exports=n(75600)}};var t=require("../../../webpack-api-runtime.js");t.C(e);var n=t(t.s=99865);module.exports=n})();