`);let i=document.createElement("i");i.addEventListener("click",()=>{t.remove(),refreshLabelPhoto()});t.insertAdjacentElement("beforeend",i);document.getElementById("pictures").insertAdjacentElement("beforeend",t)})},always:()=>{refreshLabelPhoto()}}});$script(["/js/tools/form.js?_=638677733043259351"],()=>{let n=document.getElementById("btn_send_depot"),t=new FormJs(document.getElementById("DepotForm"),{on:{success:t=>{n.disabled=!0;console.debug(t.json);let i=Object.assign({},t.json,{prix:t.json.prix+"",volume:t.json.volume+""});if(document.querySelectorAll("#pictures .pic").length==0)return document.getElementById("file_photo").classList.add("error"),!1;n.innerHTML="Envoi en cours ...";i.photo=[...document.querySelectorAll("#pictures .pic")].map(n=>n.json);request("/api/depot",{body:i}).then(()=>{document.querySelectorAll("#DepotForm input, #DepotForm textarea, #DepotForm select").forEach(n=>n.value=""),n.innerHTML="Message envoyé !",n.classList.add("valid"),setTimeout(()=>{document.location.reload()},3e3)}).catch(()=>{n.innerHTML="Une erreur est survenue ...",n.classList.add("errno"),setTimeout(()=>{n.innerHTML="Enregistrer ma demande",n.classList.remove("errno"),n.disabled=!1},3e3)})},error:t=>{n.disabled=!1,console.debug(t,t.elements.filter(n=>n.errors.length>0).map(n=>n.errors))}}});n.addEventListener("click",()=>{n.disabled=!0,t.check()})})