"use strict";(()=>{vare={};e.id=9918,e.ids=[9918],e.modules={39908:e=>{e.exports=require("@moduletrace/datasquirel/dist/users/user-auth")},75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},9973:e=>{e.exports=require("serverless-mysql")},29021:e=>{e.exports=require("fs")},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}}})},32306:(e,r,t)=>{t.r(r),t.d(r,{config:()=>m,default:()=>D,routeModule:()=>f});vars={};t.r(s),t.d(s,{default:()=>S});varn=t(89947),o=t(2706),a=t(96762),i=t(29021),c=t.n(i),l=t(48786),u=t(67619),d=t(69842),_=t(33873),p=t.n(_);asyncfunctionS(e,r){if("POST"!==e.method)returnr.json({msg:"Failed!"});lett=await(0,d.A)(e,r,!0);if(!t)returnr.json({success:!1,msg:"Unauthorized"});let{folder:s}=e.body;try{asyncfunctionn({path:e}){try{letr=c().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(/\/+$/,""),a=await(0,l.A)(`SELECT * FROM user_media WHERE folder=? && media_url LIKE '%${s}'`,[o]);a&&a[0]&&await(0,l.A)("DELETE FROM user_media WHERE id = ?",[a[0].id]);try{c().unlinkSync(e+s)}catch(r){try{c().rmdirSync(e+s)}catch(e){}}}c().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=p().join(e,`images/user-images/user-${t.id}/`),a=`${process.env.DSQL_USER_DB_SCHEMA_PATH}/user-${t.id}/media/`,i=o+(s?s.replace(/\.| /g,"")+"/":""),u=a+(s?s.replace(/\.| /g,"")+"/":"");awaitn({path:i}),awaitn({path:u}),r.json({success:!0})}catch(e){(0,u.A)({component:"/api/deleteMediaFolder/main-catch-error",message:e.message,user:t}),r.json({success:!1})}}letD=(0,a.M)(s,"default"),m=(0,a.M)(s,"config"),f=newn.PagesAPIRouteModule({definition:{kind:o.A.PAGES_API,page:"/api/deleteMediaFolder",pathname:"/api/deleteMediaFolder",bundlePath:"",filename:""},userland:s})},69842:(e,r,t)=>{t.d(r,{A:()=>o});vars=t(39908),n=t.n(s);asyncfunctiono(e,r,t){lets=n()({req:e,level:t?"deep":void0});returnconsole.log(s),s.payload}},67619:(e,r,t)=>{t.d(r,{A:()=>o});vars=t(29021),n=t.n(s);asyncfunctiono({user:e,message:r,component:t,noMail:s,req:o}){leta=newDate,i=(()=>{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{lets=`🚀 SERVER ERROR ===========================