import{b as l}from"./primevue-CfIk0_DY.js";import{o as m,a2 as d,b as a,c as r,d as s,F as u,t as _,v as f,a7 as v,ah as k,a as b,a1 as g}from"./vue-core-Di3IuVqe.js";import{_ as C,s as t}from"./index-BxIwIJfy.js";import"./cjs-helpers-psZwOBky.js";import"./vue-cal-DKMVGERa.js";import"./moment-BeHQNF8T.js";const S={class:"acces-support"},x={class:"acces-support__carte"},y={__name:"AccesSupport",setup(A){const c=k(),p=g(),o=b("");return m(async()=>{const n=c.query.ticket;if(!n){o.value="Lien incomplet : aucun ticket d'accès.";return}try{const{data:e}=await d.post(`${t.lienApi}/acces-support/echange`,{ticket:n});t.state.userCloud=e.userCloud,t.state.userCommun6=e.userCommun6,t.state.dbCommun6=e.dbCommun6,t.state.omag=e.omag,t.state.token=e.token,t.state.accesSupport=e.accesSupport||null,window.history.replaceState({},"","/acces-support"),p.push("SelectSociete")}catch(e){o.value=e.response?.data?.message||"Le lien d'accès est invalide ou expiré. Relancez « Accéder » depuis OPA."}}),(n,e)=>{const i=l;return a(),r("div",S,[s("div",x,[o.value?(a(),r(u,{key:0},[e[1]||(e[1]=s("i",{class:"pi pi-times-circle acces-support__icone acces-support__icone--erreur"},null,-1)),e[2]||(e[2]=s("h2",null,"Accès impossible",-1)),s("p",null,_(o.value),1),f(i,{label:"Aller à la connexion",icon:"pi pi-sign-in",onClick:e[0]||(e[0]=B=>v(p).push("/login"))})],64)):(a(),r(u,{key:1},[e[3]||(e[3]=s("i",{class:"pi pi-spin pi-spinner acces-support__icone"},null,-1)),e[4]||(e[4]=s("h2",null,"Ouverture de la session de support…",-1)),e[5]||(e[5]=s("p",null,"Connexion à l'espace du client en cours.",-1))],64))])])}}},V=C(y,[["__scopeId","data-v-f66bbf5e"]]);export{V as default};
