"use strict";(()=>{var e={};e.id=2127,e.ids=[2127],e.modules={76102:e=>{e.exports=require("@moduletrace/datasquirel/dist/client")},39383:e=>{e.exports=require("@moduletrace/datasquirel/dist/package-shared/actions/users/user-auth")},65967:e=>{e.exports=require("@moduletrace/datasquirel/dist/package-shared/utils/ejson")},93726:e=>{e.exports=require("@moduletrace/datasquirel/dist/package-shared/utils/numberfy")},30889:e=>{e.exports=require("@moduletrace/datasquirel/dist/package-shared/utils/slugify")},75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},29021:e=>{e.exports=require("fs")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){return function e(r,t){return t in r?r[t]:"then"in r&&"function"==typeof r.then?r.then(r=>e(r,t)):"function"==typeof r&&"default"===t?r:void 0}}})},63311:(e,r,t)=>{t.r(r),t.d(r,{config:()=>l,default:()=>_,routeModule:()=>p});var a={};t.r(a),t.d(a,{default:()=>c});var s=t(89947),n=t(2706),i=t(96762),u=t(29021),o=t.n(u),d=t(69842);async function c(e,r){if("POST"!==e.method)return r.json({success:!1,msg:"Failed!"});let{user:t,appData:a}=await (0,d.A)(e,r,!0);if(!t)return r.json({success:!1,msg:"Unauthorized"});try{let a=JSON.parse(e.body).path.replace(/ /g,"").replace(/\.\./g,"");if(a?.match(/\.\./))return r.json({success:!1,msg:"Error!",error:"Invalid url"});let s=`${process.env.DSQL_USER_DB_SCHEMA_PATH}/user-${t.id.toString().replace(/\//g,"")}`,n=a.replace(/\@/,s);o().createReadStream(n).pipe(r)}catch(e){console.log("ERROR in getPrivateMedia api route:",e.message),r.json({success:!1,msg:"Error!",error:e})}}let _=(0,i.M)(a,"default"),l=(0,i.M)(a,"config"),p=new s.PagesAPIRouteModule({definition:{kind:n.A.PAGES_API,page:"/api/media/getPrivateMedia",pathname:"/api/media/getPrivateMedia",bundlePath:"",filename:""},userland:a})},55153:(e,r,t)=>{t.d(r,{On:()=>s.a,_n:()=>i}),t(76102);var a=t(65967),s=t.n(a);t(30889);var n=t(93726);let i=t.n(n)()},69842:(e,r,t)=>{t.d(r,{A:()=>i});var a=t(39383),s=t.n(a),n=t(55153);async function i(e,r,t,a){let i=s()({req:e,level:t?"deep":void 0}),u={DSQL_REMOTE_SQL_HOST:process.env.DSQL_REMOTE_SQL_HOST,DSQL_SU_USER_ID:process.env.DSQL_SU_USER_ID,DSQL_HOST_ENV:process.env.DSQL_HOST_ENV,DSQL_HOST:process.env.DSQL_HOST,DSQL_STATIC_HOST:process.env.DSQL_STATIC_HOST,DSQL_GOOGLE_CLIENT_ID:process.env.DSQL_GOOGLE_CLIENT_ID,DSQL_TINY_MCE_API_KEY:process.env.DSQL_TINY_MCE_API_KEY};return a&&i.payload?.id&&(0,n._n)(process.env.DSQL_SU_USER_ID)!==i.payload.id?{user:null,appData:u}:{user:i.payload,appData:u}}},2706:(e,r)=>{Object.defineProperty(r,"A",{enumerable:!0,get:function(){return t}});var t=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,r,t)=>{e.exports=t(75600)}};var r=require("../../../webpack-api-runtime.js");r.C(e);var t=r(r.s=63311);module.exports=t})();