`,[`datasquirel_user_${t.id}%`]),i=(Array.isArray(e)?e:[]).reduce((e,r,t)=>e?.mb?e.mb+r.mb:e+r.mb,0),n=0,o=process.env.DSQL_STATIC_SERVER_DIR;if(!o)throw console.log("Static File ENV not Found!"),Error("No Static Path!");o||c().existsSync(o)||c().mkdirSync(o,{recursive:!0});let a=l().join(o,`images/user-images/user-${t.id}`);c().existsSync(a)||c().mkdirSync(a,{recursive:!0});let u=l().join(o,`images/user-images/user-${t.id}`),f=l().join(o,`videos/user-videos/user-${t.id}`);async function s(e){try{let r=c().readdirSync(e);for(let t=0;t<r.length;t++){let i=r[t],a=e+"/"+i;if(!i.match(/\..{3,4}$/)){await s(a);continue}if(c().existsSync(a)){let e=c().statSync(a);n+=e.size/1024/1024}else{if("production".match(/production/),!o)throw console.log("Static File ENV not Found!"),Error("No Static Path!");let e=a.replace(o,process.env.DSQL_STATIC_HOST||""),r=a.replace(o,"");await (0,d.A)("DELETE FROM user_media WHERE media_path = ? OR media_thumbnail_path = ? OR media_url=? OR media_thumbnail_url=?",[r,r,e,e]),console.log(`MEDIA=>${e}DELETEDFROMDATABASE`)}}}catch(e){console.log("ERROR in getDiskUsage API route =>",e.message),(0,_.A)({component:"/api/getDiskUsage/lines-93-101",message:e.message})}}c().existsSync(f)||c().mkdirSync(f,{recursive:!0}),await s(u),await s(f);let E=n+i;r.json({success:!0,total:E})}catch(e){(0,_.A)({component:"/api/getDiskUsage/main-catch-error",message:e.message,user:t}),r.json({success:!1,msg:"Disk Usage Calculation Error!"})}}let p=(0,o.M)(s,"default"),m=(0,o.M)(s,"config"),S=new i.PagesAPIRouteModule({definition:{kind:n.A.PAGES_API,page:"/api/getDiskUsage",pathname:"/api/getDiskUsage",bundlePath:"",filename:""},userland:s})},69842:(e,r,t)=>{t.d(r,{A:()=>c});var s=t(48786),i=t(95969),n=t(29021),o=t.n(n),a=t(89159);async function c(e,r,t){try{let{keyCookieName:n,csrfCookieName:c}=(0,a.A)();if(!e.cookies?.[n]?.match(/./))throw Error("Request Cookies not Found!");let u=(0,i.A)({encryptedString:e.cookies[n]});if(!u)throw Error("Couldn't decrypt auth cookie!");let l=JSON.parse(u);if(!l.csrf_k)throw Error("No `csrf_k` present in user Object!");if(t&&!Object.keys(e.headers).find(e=>e.includes(l.csrf_k)))throw Error("Deep Auth Failed. `csrf` key not found in request headers!");let d=process.env.DSQL_USER_LOGIN_KEYS_PATH;if(!d)throw Error("DSQL_USER_LOGIN_KEYS_PATH env variable not found. Please set this variable.");if(t&&!o().existsSync(`${d}/${l.csrf_k}`))throw Error("Key not found in Auth Keys Folder!");if(0==l.verification_status&&!t){let e=await (0,s.A)(`SELECTverification_statusFROMusersWHEREid='${l.id}'`);e&&e[0]&&1==e[0].verification_status&&r.setHeader("Set-Cookie",["user_refresh=1"])}if(l?.date&&Date.now()-l.date>6048e5)throw Error("Key expired!");return l}catch(r){return console.log(`userAuthErrorfor${e.url}:${r.message}`),null}}},89159:(e,r,t)=>{t.d(r,{A:()=>s});function s(e){let r=process.env.DSQL_COOKIES_PREFIX||"dsql_",t=process.env.DSQL_COOKIES_KEY_NAME||"key",s=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",i=process.env.DSQL_COOKIES_ONE_TIME_CODE_NAME||"one-time-code",n=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),o=r;e?.userId&&(o+=`user_${e.userId}_`),n&&(o+=`${n}_`),o+=t;let a=r;e?.userId&&(a+=`user_${e.userId}_`),n&&(a+=`${n}_`),a+=s;let c=r;return e?.userId&&(c+=`user_${e.userId}_`),n&&(c+=`${n}_`),{keyCookieName:o,csrfCookieName:a,oneTimeCodeName:c+=i}}},67619:(e,r,t)=>{t.d(r,{A:()=>n});var s=t(29021),i=t.n(s);async function n({user:e,message:r,component:t,noMail:s,req:n}){let o=new Date,a=(()=>{if(!n)return null;try{let e=n.headers["x-forwarded-for"],r=n.headers["x-real-ip"],t=n.headers["cf-connecting-ip"],s=Array.isArray(e)?e[0]:e?.split(",")[0],i=t||s||r||n.socket.remoteAddress;if(!i)return null;return String(i)}catch(e){return null}})();try{let s=`🚀SERVERERROR===========================