"use strict";(()=>{vare={};e.id=9918,e.ids=[9918],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},9973:e=>{e.exports=require("serverless-mysql")},79428:e=>{e.exports=require("buffer")},55511:e=>{e.exports=require("crypto")},29021:e=>{e.exports=require("fs")},81630:e=>{e.exports=require("http")},33873:e=>{e.exports=require("path")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){returnfunctione(r,t){returntinr?r[t]:"then"inr&&"function"==typeofr.then?r.then(r=>e(r,t)):"function"==typeofr&&"default"===t?r:void0}}})},30976:(e,r,t)=>{t.r(r),t.d(r,{config:()=>g,default:()=>m,routeModule:()=>y});vars={};t.r(s),t.d(s,{default:()=>E});varn=t(89947),o=t(2706),i=t(96762),a=t(51348),c=t.n(a),l=t(48225),u=t.n(l),d=t(6420),p=t.n(d),f=t(33873),S=t.n(f);let_=t(29021);asyncfunctionE(e,r){if("POST"!==e.method)returnr.json({msg:"Failed!"});lett=awaitp()(e,r,!0);if(!t)returnr.json({success:!1,msg:"Unauthorized"});let{folder:s}=e.body;try{asyncfunctionn({path:e}){try{letr=_.readdirSync(e);for(lett=0;t<r.length;t++){lets=r[t];if(!s.match(/\..{3,4}$/)){awaitn({path:e+s+"/"});continue}leto=e.replace(/.*user-images\/user-\d+\/|.*jsonData\/dbSchemas\/users\/user-\d+\/media\//,"").replace(/\/+$/,""),i=awaitc()(`SELECT * FROM user_media WHERE folder=? && media_url LIKE '%${s}'`,[o]);i&&i[0]&&awaitc()("DELETE FROM user_media WHERE id = ?",[i[0].id]);try{_.unlinkSync(e+s)}catch(r){try{_.rmdirSync(e+s)}catch(e){}}}_.rmdirSync(e)}catch(e){console.log("File cleaning error =>",e.message)}}lete=process.env.DSQL_STATIC_SERVER_DIR;if(!e)throwconsole.log("Static File ENV not Found!"),Error("No Static Path!");leto=S().join(e,`images/user-images/user-${t.id}/`),i=`${process.env.DSQL_USER_DB_SCHEMA_PATH}/user-${t.id}/media/`,a=o+(s?s.replace(/\.| /g,"")+"/":""),l=i+(s?s.replace(/\.| /g,"")+"/":"");awaitn({path:a}),awaitn({path:l}),r.json({success:!0})}catch(e){u()({component:"/api/deleteMediaFolder/main-catch-error",message:e.message,user:t}),r.json({success:!1})}}letm=(0,i.M)(s,"default"),g=(0,i.M)(s,"config"),y=newn.PagesAPIRouteModule({definition:{kind:o.A.PAGES_API,page:"/api/deleteMediaFolder",pathname:"/api/deleteMediaFolder",bundlePath:"",filename:""},userland:s})},6420:(e,r,t)=>{t(81630);lets=t(51348),n=t(72835),o=t(29021),i=t(31341);asyncfunctiona(e,r,t,a){let{keyCookieName:c,csrfCookieName:l}=i();if(!e.cookies?.[c]?.match(/./))returnnull;letu=n({encryptedString:e.cookies[c]});if(!u)returnnull;letd=JSON.parse(u);if(!d.csrf_k||t&&!e.headers["x-csrf-auth"]?.match(RegExp(`${d.csrf_k}`)))returnnull;letp=process.env.DSQL_USER_LOGIN_KEYS_PATH;if(!p)returnconsole.log("DSQL_USER_LOGIN_KEYS_PATH env variable not found. Please set this variable."),null;if(t&&!o.existsSync(`${p}/${d.csrf_k}`))returnnull;if(0==d.verification_status&&!t){lete=awaits(`SELECT verification_status FROM users WHERE id='${d.id}'`);e&&e[0]&&1==e[0].verification_status&&r.setHeader("Set-Cookie",["user_refresh=1"])}returnd?.date&&Date.now()-d.date>6048e5?null:d}e.exports=a},31341:e=>{e.exports=function(){lete=process.env.DSQL_COOKIES_PREFIX||"dsql_";return{keyCookieName:e+(process.env.DSQL_COOKIES_KEY_NAME||"key"),csrfCookieName:e+(process.env.DSQL_COOKIES_CSRF_NAME||"csrf")}}},48225:(e,r,t)=>{lets=t(29021),{IncomingMessage:n}=t(81630);e.exports=asyncfunction({user:e,message:r,component:t,noMail:n,req:o}){leti=newDate,a=(()=>{if(!o)returnnull;try{lete=o.headers["x-forwarded-for"],r=o.headers["x-real-ip"],t=o.headers["cf-connecting-ip"],s=Array.isArray(e)?e[0]:e?.split(",")[0],n=t||s||r||o.socket.remoteAddress;if(!n)returnnull;returnString(n)}catch(e){returnnull}})();try{letn=`🚀 SERVER ERROR ===========================