"use strict";var u=Object.defineProperty;var o=(e,n)=>u(e,"name",{value:n,configurable:true});const r=use("Env");const s=require("node:path");const{v4:c}=require("uuid");const i=require("fs-extra");const{API_VERSION:a}=require("../../environment-remote");const v=o(async e=>{const n=s.join(r.get("USER_PATH"),"icons");await i.ensureDir(n);let t;do{t=c()+c()}while(i.existsSync(s.join(n,t)));t=`${t}.${e.extname}`;await e.move(n,{name:t,overwrite:true});return e.moved()?t:"-1"},"moveIcon");const $=o(e=>e?`http://${r.get("HOST")}:${r.get("PORT")}/${a}/icon/${e}`:null,"deduceIconUrl");module.exports={moveIcon:v,deduceIconUrl:$};
