1import{_ as D}from"./Countdown.Dowaayib.js";import{j as S,k as f,c as g,a as l,w as o,h as c,o as s,y as C,e as u,u as e,z as U,g as r,D as $,f as _,ae as j,I as w,J as y,af as B,l as F,x as N,m as P,i as H}from"./entry.CSQ5x7EL.js";import{u as R}from"./cookie.B1vzYLYp.js";import{u as q}from"./asyncData.sHWVazXU.js";import"./index.DvDH6DOc.js";const z={key:0},G={__name:"settings",setup(A){S({title:"Paramètres"});const p=H(),k=R("usertoken"),V=f([d=>d==null||d==null?"Ce champ est requis":!0]),t=f({dialog:!1,datePicker:!1,date:null,hours:10,minutes:0}),v=f(null),{pending:b,data:i,error:x,refresh:J}=q("settings",()=>$fetch(p.public.backendUrl+"/admin/settings",{headers:{"Content-Type":"application/json",usertoken:k.value}}));async function h(){const{valid:d}=await v.value.validate();if(!d)return;t.value.dialog=!1;const a=new Date(t.value.date);a.setHours(t.value.hours),a.setMinutes(t.value.minutes),console.log(a);const m={id:"countdown",value:a};$fetch(p.public.backendUrl+"/admin/settings",{method:"POST",headers:{"Content-Type":"application/json",usertoken:k.value},body:JSON.stringify(m)}).then(n=>{i.value.data.find(T=>T.id=="countdown").value=n.data.value}).catch(n=>{console.log(n)})}return(d,a)=>{const m=D;return s(),g("div",null,[l(c,null,{default:o(()=>[l(C,null,{default:o(()=>[u("Compte à rebours")]),_:1}),!e(b)&&!e(x)&&e(i)?(s(),g("div",z,[l(m,{date:new Date(e(i).data.find(n=>n.id=="countdown").value)},null,8,["date"])])):U("",!0),l(r,{onClick:a[0]||(a[0]=n=>e(t).datePicker=e(t).dialog=!e(t).dialog)},{default:o(()=>[u("Changer la date")]),_:1}),l($,{modelValue:e(t).dialog,"onUpdate:modelValue":a[7]||(a[7]=n=>e(t).dialog=n),width:"auto"},{default:o(()=>[l(c,null,{default:o(()=>[e(t).datePicker?(s(),_(B,{key:0,locale:"fr"},{default:o(()=>[l(j,{"show-adjacent-months":"",modelValue:e(t).date,"onUpdate:modelValue":a[1]||(a[1]=n=>e(t).date=n),"onClick:save":a[2]||(a[2]=n=>e(t).datePicker=!e(t).datePicker)},null,8,["modelValue"]),l(w,null,{default:o(()=>[l(y),l(r,{onClick:a[3]||(a[3]=n=>e(t).datePicker=!e(t).datePicker)},{default:o(()=>[u("Suivant")]),_:1})]),_:1})]),_:1})):(s(),_(c,{key:1,width:"300px"},{default:o(()=>[l(C,null,{default:o(()=>[u("Changer l'heure")]),_:1}),l(F,null,{default:o(()=>[l(N,{ref_key:"countdownForm",ref:v},{default:o(()=>[l(P,{modelValue:e(t).hours,"onUpdate:modelValue":a[4]||(a[4]=n=>e(t).hours=n),label:"Heures",type:"number",min:"0",max:"23",rules:e(V)},null,8,["modelValue","rules"]),l(P,{modelValue:e(t).minutes,"onUpdate:modelValue":a[5]||(a[5]=n=>e(t).minutes=n),label:"Minutes",type:"number",min:"0",max:"59",rules:e(V)},null,8,["modelValue","rules"])]),_:1},512)]),_:1}),l(w,null,{default:o(()=>[l(y),l(r,{onClick:a[6]||(a[6]=n=>e(t).datePicker=!e(t).datePicker)},{default:o(()=>[u("Retour")]),_:1}),l(r,{onClick:h},{default:o(()=>[u("Valider")]),_:1})]),_:1})]),_:1}))]),_:1})]),_:1},8,["modelValue"])]),_:1})])}}};export{G as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.