import{b as g}from"./primevue-CfIk0_DY.js";import{b as v,s as a}from"./index-BxIwIJfy.js";import{o as h,b as l,c as n,d as t,t as o,f as d,v as f,y as r,a as _}from"./vue-core-Di3IuVqe.js";import"./cjs-helpers-psZwOBky.js";import"./vue-cal-DKMVGERa.js";import"./moment-BeHQNF8T.js";const b={class:"max-w-5xl mx-auto"},y={style:{"margin-bottom":"20px"}},w={class:"text-2xl font-bold text-gray-800"},k={class:"text-gray-500",style:{"margin-top":"2px"}},N={class:"font-semibold"},B={class:"grid grid-cols-1 sm:grid-cols-3 gap-4",style:{"margin-bottom":"24px"}},C={class:"bg-white rounded-xl shadow-sm p-5 flex items-center gap-4"},j={class:"text-2xl font-bold text-gray-800"},A={class:"bg-white rounded-xl shadow-sm p-5 flex items-center gap-4"},D={class:"text-2xl font-bold text-gray-800"},S={class:"bg-white rounded-xl shadow-sm p-5 flex items-center gap-4"},V={class:"text-2xl font-bold text-gray-800"},$={class:"bg-white rounded-xl shadow-sm p-5"},P={key:0,class:"flex items-center justify-between"},z={class:"font-semibold text-gray-800"},E={class:"text-gray-500"},R={class:"text-right"},T={class:"font-bold text-teal-700"},F={key:1,class:"text-gray-400 text-center",style:{padding:"16px 0"}},Q={__name:"PortailCabinetAccueil",setup(I){const c=r(()=>a.state.portailCabinetToken),x=r(()=>a.state.portailCabinetSociete?.Nom||""),p=r(()=>a.state.portailCabinetContact?.nom_contact||""),s=_({a_faire:0,en_retard:0,faites:0,prochaine:null}),u=i=>{if(!i)return"—";const e=new Date(i);return isNaN(e)?"—":e.toLocaleDateString("fr-FR")};return h(async()=>{try{const i=await v.get(`${a.lienApi}/portail-cabinet/resume`,{headers:{Authorization:`Bearer ${c.value}`}});s.value=i.data||s.value}catch{}}),(i,e)=>{const m=g;return l(),n("div",b,[t("div",y,[t("h1",w,"Bonjour "+o(p.value),1),t("p",k,[e[1]||(e[1]=d(" Suivi fiscal de ",-1)),t("span",N,o(x.value),1)])]),t("div",B,[t("div",C,[e[3]||(e[3]=t("div",{class:"rounded-full bg-amber-100 text-amber-600 flex items-center justify-center",style:{width:"48px",height:"48px"}},[t("i",{class:"pi pi-clock text-xl"})],-1)),t("div",null,[t("div",j,o(s.value.a_faire),1),e[2]||(e[2]=t("div",{class:"text-gray-500"},"A faire",-1))])]),t("div",A,[e[5]||(e[5]=t("div",{class:"rounded-full bg-red-100 text-red-600 flex items-center justify-center",style:{width:"48px",height:"48px"}},[t("i",{class:"pi pi-exclamation-triangle text-xl"})],-1)),t("div",null,[t("div",D,o(s.value.en_retard),1),e[4]||(e[4]=t("div",{class:"text-gray-500"},"En retard",-1))])]),t("div",S,[e[7]||(e[7]=t("div",{class:"rounded-full bg-green-100 text-green-600 flex items-center justify-center",style:{width:"48px",height:"48px"}},[t("i",{class:"pi pi-check-circle text-xl"})],-1)),t("div",null,[t("div",V,o(s.value.faites),1),e[6]||(e[6]=t("div",{class:"text-gray-500"},"Realisees",-1))])])]),t("div",$,[e[9]||(e[9]=t("h2",{class:"text-lg font-bold text-gray-800",style:{"margin-bottom":"12px"}},"Prochaine echeance",-1)),s.value.prochaine?(l(),n("div",P,[t("div",null,[t("div",z,o(s.value.prochaine.type_libelle||s.value.prochaine.code_type),1),t("div",E,"Periode : "+o(s.value.prochaine.periode||"—"),1)]),t("div",R,[t("div",T,o(u(s.value.prochaine.date_echeance)),1),f(m,{label:"Voir mes echeances",text:"",size:"small",onClick:e[0]||(e[0]=M=>i.$router.push("/portail-cabinet/echeances"))})])])):(l(),n("div",F,[...e[8]||(e[8]=[t("i",{class:"pi pi-check-circle text-2xl block",style:{"margin-bottom":"8px"}},null,-1),d(" Aucune echeance a venir. ",-1)])]))])])}}};export{Q as default};
