1import{_ as De,S as Te,Z as Fe,o as a,g as He,k as Ae,K as Pe,f as i,h as e,l as qe,x as r,j as c,i as k,F as T,B as H,n as W,D as le,T as Ue,W as Qe,O as S,N as w,H as Je,w as me,y as oe,C as Ge,z as Ce,a3 as Ke,E as We}from"./index-DjMwR59M.js";import{u as Xe}from"./useToast-DS1zmGj8.js";const Ye={class:"modal",role:"dialog","aria-modal":"true"},Ze={class:"modal-header"},et={class:"modal-header-info"},tt={class:"modal-title-wrap"},st={class:"modal-title"},ot={class:"modal-subtitle"},lt={key:0},nt={key:0,class:"modal-meta"},at={key:0,class:"quiz-tabs",role:"tablist"},it=["aria-selected","title","onClick"],rt={class:"quiz-tab-title"},ut={key:0,class:"quiz-tab-count"},dt={class:"modal-body"},ct={key:0,class:"attempt-picker"},vt=["disabled"],pt={class:"attempt-info"},ft={key:0,class:"attempt-badge history"},mt={key:1,class:"attempt-badge current"},_t={key:2,class:"attempt-date"},gt=["disabled"],bt={class:"result-card"},ht={class:"result-card-top"},kt={class:"result-big"},yt={key:0,class:"result-tag"},wt={key:1,class:"mini-label",style:{"margin-top":"6px","text-transform":"none","letter-spacing":"0"}},zt={class:"text-right"},Ct={class:"result-score"},qt={key:0,class:"result-bar"},xt={class:"info-grid"},St={class:"info-item"},$t={class:"info-value"},Tt={class:"info-item"},At={class:"info-value"},jt={key:0,class:"info-item"},Mt={class:"info-value"},Bt={class:"info-item"},Lt={class:"info-value mono"},Et={class:"info-item"},Dt={class:"info-value mono"},Pt={class:"info-item"},Ut={class:"info-item"},Rt={class:"answer-list"},Ot={class:"answer-q"},It={class:"answer-a"},Nt={class:"modal-footer"},Vt=["href"],Ft={__name:"ProspectDetailModal",props:{open:Boolean,prospect:Object},emits:["close"],setup(V,{emit:xe}){const A=V,Se=xe,F=w(!1),B=w(0),D=w(0),L=w(new Map),ne=[["#fce7f3","#9d174d"],["#dbeafe","#1e40af"],["#ccfbf1","#115e59"],["#ffedd5","#9a3412"],["#fce7f3","#9f1239"],["#e0e7ff","#3730a3"],["#d1fae5","#065f46"],["#fef3c7","#78350f"]];function Q(n){if(!n)return 0;let o=0;for(let u=0;u<n.length;u++)o=o*31+n.charCodeAt(u)|0;return Math.abs(o)%ne.length}const U=S(()=>{var u,g;const o=(((u=A.prospect)==null?void 0:u.prenom)||((g=A.prospect)==null?void 0:g.email)||"?").trim().split(/[\s@.]+/).filter(Boolean);return o.length?o.length===1?o[0].slice(0,2).toUpperCase():(o[0][0]+o[1][0]).toUpperCase():"?"}),_e=S(()=>{var g,d;const n=Q(((g=A.prospect)==null?void 0:g.email)||((d=A.prospect)==null?void 0:d.prenom)||""),[o,u]=ne[n];return`background: ${o}; color: ${u};`}),f=S(()=>{const n=A.prospect;return n?(Array.isArray(n._rows)&&n._rows.length?n._rows:[n]).map(u=>{const d=[...(Array.isArray(u.history)?u.history:[]).map((m,q)=>({profil_nom:m.profil_nom,profil_id:m.profil_id,tag:m.tag,score_global:m.score_global,scores_dimensions:m.scores_dimensions,reponses:m.reponses,submitted_at:m.submitted_at,egalite_profils:m.egalite_profils,profil_auto:m.profil_auto,_isHistory:!0,_historyIdx:q})),{profil_nom:u.profil_nom,profil_id:u.profil_id,tag:u.tag,score_global:u.score_global,scores_dimensions:u.scores_dimensions,reponses:u.reponses,submitted_at:u.submitted_at||u.created_at,egalite_profils:u.egalite_profils,profil_auto:u.profil_auto,_isLatest:!0}];return{quiz_id:u.quiz_id,quiz_title:u.quiz_title||"Quiz",quiz_slug:u.quiz_slug,row:u,attempts:d,attempts_count:d.length}}):[]}),y=S(()=>f.value[B.value]||null),x=S(()=>{const n=y.value;return n&&(n.attempts[D.value]||n.attempts[n.attempts.length-1])||null}),ae=S(()=>{var d,m;const n=f.value;if(!n.length)return null;const o=[];n.length>1&&o.push(n.length+" quiz passés");const u=n.reduce((q,z)=>q+z.attempts_count,0);u>n.length&&o.push(u+" tentatives au total");const g=((d=A.prospect)==null?void 0:d.first_attempt_at)||((m=A.prospect)==null?void 0:m.created_at);if(g){const q=Math.floor((Date.now()-new Date(g).getTime())/864e5);q>=0&&n.length>1&&o.push("1er contact "+(q===0?"aujourd'hui":"il y a "+q+" j"))}return o.join(" · ")||null}),_={instagram:"Instagram",facebook:"Facebook",linkedin:"LinkedIn",tiktok:"TikTok",youtube:"YouTube",x:"X (Twitter)",pinterest:"Pinterest",snapchat:"Snapchat",whatsapp:"WhatsApp",reddit:"Reddit",email:"Newsletter",google:"Google",bing:"Bing",direct:"Direct",other:"Autre"},Y=S(()=>{var u;const n=(u=y.value)==null?void 0:u.row;if((n==null?void 0:n.source)==="other"&&(n!=null&&n.utm_source)){const g=String(n.utm_source);return g.charAt(0).toUpperCase()+g.slice(1)}if(n!=null&&n.source&&_[n.source])return _[n.source];const o=(n==null?void 0:n.utm_source)||(n==null?void 0:n.source);return o?o.charAt(0).toUpperCase()+o.slice(1):"Direct"}),O=S(()=>{var o;const n=(o=y.value)==null?void 0:o.row;return n!=null&&n.ref_code?n.ref_name||n.ref_code:null}),I=S(()=>{var o;const n=(o=y.value)==null?void 0:o.row;return n?n.webhook_sent_at?"â Envoyé":n.webhook_status==="pending"?"â³ En attente":n.webhook_status==="failed"?"â Ãchec":"â Non configuré":"â"}),ie=S(()=>{var o;const n=(o=y.value)==null?void 0:o.row;return n?n.webhook_sent_at?"ok":n.webhook_status==="failed"?"warn":"":""});async function Z(n,o){var u,g;if(!(!n||!o)&&!L.value.has(o))try{const d=await fetch("/api/quiz?slug="+encodeURIComponent(n));if(!d.ok)throw new Error("fetch failed: "+d.status);const m=await d.json(),q=((g=(u=m==null?void 0:m.quiz)==null?void 0:u.state_json)==null?void 0:g.questions)||[],z={};for(const R of q)R.id&&(z[R.id]=R.texte||R.text||R.label||R.question||"");const J=new Map(L.value);J.set(o,z),L.value=J}catch(d){console.warn("[ProspectDetailModal] quiz fetch failed:",d)}}const ee=S(()=>{const n=x.value;if(!n)return[];const o=y.value,u=o?L.value.get(o.quiz_id)||{}:{},g=n.reponses;return g?Array.isArray(g)?g.slice(0,30).filter(d=>d&&typeof d=="object").map((d,m)=>{let q="";d.question_id&&u[d.question_id]?q=u[d.question_id]:d.question||d.q||d.label?q=d.question||d.q||d.label:q="Question "+(m+1);let z="";return d.reponse_data&&typeof d.reponse_data=="object"&&(z=d.reponse_data.texte||d.reponse_data.text||d.reponse_data.label||""),!z&&d.reponse_lettre&&(z="Réponse "+d.reponse_lettre),z||(z=d.reponse||d.answer||d.value||"â"),{question:q,reponse:z}}):typeof g=="object"?Object.entries(g).slice(0,30).map(([d,m])=>({question:d,reponse:typeof m=="string"?m:JSON.stringify(m)})):[]:[]});function re(n){B.value=n;const o=f.value[n];D.value=o?o.attempts.length-1:0,o!=null&&o.quiz_slug&&o.quiz_id&&Z(o.quiz_slug,o.quiz_id)}function te(n){const o=y.value;if(!o)return;const u=Math.max(0,Math.min(o.attempts_count-1,n));D.value=u}function X(n){if(!n)return"â";
1try{return new Date(n).toLocaleString("fr-FR",{dateStyle:"short",timeStyle:"short"})}catch{return n}}function $e(){A.prospect&&(navigator.clipboard.writeText(JSON.stringify(A.prospect,null,2)),F.value=!0,setTimeout(()=>F.value=!1,1500))}Te(()=>A.prospect,()=>{B.value=0;const n=f.value[0];D.value=n?n.attempts.length-1:0},{immediate:!0}),Te([()=>A.open,()=>y.value],([n,o])=>{n&&(o!=null&&o.quiz_slug)&&o.quiz_id&&Z(o.quiz_slug,o.quiz_id)},{immediate:!0}),Te(()=>A.open,n=>{typeof document>"u"||(n?document.body.style.overflow="hidden":document.body.style.overflow="")});function N(n){n.key==="Escape"&&A.open&&Se("close")}return typeof window<"u"&&window.addEventListener("keydown",N),Fe(()=>{typeof window<"u"&&window.removeEventListener("keydown",N),typeof document<"u"&&(document.body.style.overflow="")}),(n,o)=>(a(),He(Qe,{to:"body"},[Ae(Ue,{name:"modal"},{default:Pe(()=>{var u,g,d,m,q,z,J,R,G,ge,ue,de,se,ce,be,he,ve,ke,pe,ye,we,fe;return[V.open?(a(),i("div",{key:0,class:"modal-overlay",onClick:o[3]||(o[3]=le(P=>n.$emit("close"),["self"]))},[e("div",Ye,[e("div",Ze,[e("div",et,[e("div",{class:"modal-avatar",style:qe(_e.value)},r(U.value),5),e("div",tt,[e("div",st,r(((u=V.prospect)==null?void 0:u.prenom)||"Prospect"),1),e("div",ot,[c(r(((g=V.prospect)==null?void 0:g.email)||"â")+" ",1),(d=V.prospect)!=null&&d.tel?(a(),i("span",lt," · "+r(V.prospect.tel),1)):k("",!0)]),ae.value?(a(),i("div",nt,r(ae.value),1)):k("",!0)])]),e("button",{class:"close-btn",onClick:o[0]||(o[0]=P=>n.$emit("close")),"aria-label":"Fermer"},[...o[4]||(o[4]=[e("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])]),f.value.length>1?(a(),i("div",at,[(a(!0),i(T,null,H(f.value,(P,K)=>(a(),i("button",{key:P.quiz_id||K,role:"tab","aria-selected":K===B.value,class:W(["quiz-tab",{active:K===B.value}]),title:P.quiz_title,onClick:je=>re(K)},[e("span",rt,r(P.quiz_title),1),P.attempts_count>1?(a(),i("span",ut,r(P.attempts_count)+"Ã",1)):k("",!0)],10,it))),128))])):k("",!0),e("div",dt,[y.value&&y.value.attempts_count>1?(a(),i("div",ct,[e("button",{class:"attempt-arrow",disabled:D.value<=0,"aria-label":"Tentative précédente",onClick:o[1]||(o[1]=P=>te(D.value-1))},[...o[5]||(o[5]=[e("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("polyline",{points:"15 18 9 12 15 6"})],-1)])],8,vt),e("div",pt,[o[6]||(o[6]=e("span",{class:"attempt-label"},"Tentative",-1)),e("strong",null,r(D.value+1)+" / "+r(y.value.attempts_count),1),(m=x.value)!=null&&m._isHistory?(a(),i("span",ft,"historique")):(q=x.value)!=null&&q._isLatest?(a(),i("span",mt,"dernière")):k("",!0),(z=x.value)!=null&&z.submitted_at?(a(),i("span",_t," · "+r(X(x.value.submitted_at)),1)):k("",!0)]),e("button",{class:"attempt-arrow",disabled:D.value>=y.value.attempts_count-1,"aria-label":"Tentative suivante",onClick:o[2]||(o[2]=P=>te(D.value+1))},[...o[7]||(o[7]=[e("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("polyline",{points:"9 18 15 12 9 6"})],-1)])],8,gt)])):k("",!0),o[19]||(o[19]=e("div",{class:"section-title"},"Résultat du quiz",-1)),e("div",bt,[e("div",ht,[e("div",null,[o[8]||(o[8]=e("div",{class:"mini-label"},"Profil obtenu",-1)),e("div",kt,r(((J=x.value)==null?void 0:J.profil_nom)||"â"),1),(R=x.value)!=null&&R.tag?(a(),i("div",yt,"#"+r(x.value.tag),1)):k("",!0),Array.isArray((G=x.value)==null?void 0:G.egalite_profils)&&x.value.egalite_profils.length>1?(a(),i("div",wt,[c(" Ãgalité entre "+r(x.value.egalite_profils.length)+" profils â ",1),x.value.profil_auto?(a(),i(T,{key:1},[c("tranchée par le répondant")],64)):(a(),i(T,{key:0},[c("non tranchée")],64))])):k("",!0)]),e("div",zt,[o[10]||(o[10]=e("div",{class:"mini-label"},"Score",-1)),e("div",Ct,[typeof((ge=x.value)==null?void 0:ge.score_global)=="number"?(a(),i(T,{key:0},[c(r(x.value.score_global),1),o[9]||(o[9]=e("span",{class:"small"},"/100",-1))],64)):(a(),i(T,{key:1},[c("â")],64))])])]),typeof((ue=x.value)==null?void 0:ue.score_global)=="number"?(a(),i("div",qt,[e("div",{class:"result-bar-fill",style:qe({width:Math.min(100,x.value.score_global)+"%"})},null,4)])):k("",!0)]),o[20]||(o[20]=e("div",{class:"section-title"},"Informations",-1)),e("div",xt,[e("div",St,[o[11]||(o[11]=e("div",{class:"info-label"},"Quiz",-1)),e("div",$t,r(((de=y.value)==null?void 0:de.quiz_title)||"â"),1)]),e("div",Tt,[o[12]||(o[12]=e("div",{class:"info-label"},"Source",-1)),e("div",At,r(Y.value),1)]),O.value?(a(),i("div",jt,[o[13]||(o[13]=e("div",{class:"info-label"},"Partenaire",-1)),e("div",Mt,r(O.value),1)])):k("",!0),e("div",Bt,[o[14]||(o[14]=e("div",{class:"info-label"},"Campagne UTM",-1)),e("div",Lt,r(((ce=(se=y.value)==null?void 0:se.row)==null?void 0:ce.utm_campaign)||"â"),1)]),e("div",Et,[o[15]||(o[15]=e("div",{class:"info-label"},"Date",-1)),e("div",Dt,r(X(((be=x.value)==null?void 0:be.submitted_at)||((ve=(he=y.value)==null?void 0:he.row)==null?void 0:ve.created_at))),1)]),e("div",Pt,[o[16]||(o[16]=e("div",{class:"info-label"},"RGPD",-1)),e("div",{class:W(["info-value",(pe=(ke=y.value)==null?void 0:ke.row)!=null&&pe.rgpd_consent?"ok":"warn"])},r((we=(ye=y.value)==null?void 0:ye.row)!=null&&we.rgpd_consent?"â Consentement donné":"â Non renseigné"),3)]),e("div",Ut,[o[17]||(o[17]=e("div",{class:"info-label"},"Webhook",-1)),e("div",{class:W(["info-value",ie.value])},r(I.value),3)])]),ee.value.length?(a(),i(T,{key:1},[o[18]||(o[18]=e("div",{class:"section-title"},"Réponses au quiz",-1)),e("div",Rt,[(a(!0),i(T,null,H(ee.value,(P,K)=>(a(),i("div",{key:K,class:"answer-item"},[e("div",Ot,r(P.question),1),e("div",It,r(P.reponse),1)]))),128))])],64)):k("",!0)]),e("div",Nt,[(fe=V.prospect)!=null&&fe.email?(a(),i("a",{key:0,class:"btn",href:"mailto:"+V.prospect.email},[...o[21]||(o[21]=[e("svg",{class:"icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("path",{d:"M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"}),e("polyline",{points:"22,6 12,13 2,6"})],-1),c(" Envoyer un email ",-1)])],8,Vt)):k("",!0),e("button",{class:"btn btn-primary",onClick:$e},r(F.value?"â Copié":"Copier les données (JSON)"),1)])])])):k("",!0)]}),_:1})]))}},Ht=De(Ft,[["__scopeId","data-v-906451c6"]]),Qt={class:"top-bar"},Jt={class:"top-bar-left"},Gt={key:0,class:"prospects-sub"},Kt={key:1,class:"prospects-sub"},Wt={class:"top-bar-right"},Xt=["disabled"],Yt={class:"stats-row"},Zt={class:"stat-card"},es={class:"stat-value"},ts={class:"stat-card"},ss={class:"stat-value"},os={class:"stat-card"},ls={class:"stat-value"},ns={key:0,class:"suffix"},as={class:"stat-card"},is={class:"stat-value",style:{"font-size":"18px","font-family":"'Sora', sans-serif","font-weight":"800"}},rs={class:"stat-change"},us={key:0},ds={key:1},cs={class:"filters-bar"},vs={class:"search-wrap"},ps={class:"count"},fs=["value"],ms=["value"],_s=["value"],gs=["value"],bs={class:"table-card"},hs={class:"table-header"},ks={class:"table-title"},ys={class:"muted"},ws={class:"table-actions"},zs={key:0,class:"selection-bar"},Cs={class:"selection-bar-info"},qs={class:"selection-bar-actions"},xs={key:0,class:"loading-rows"},Ss={key:1,class:"empty-state"},$s={key:0},Ts={key:1},As={key:2},js={class:"col-check"},Ms=["checked",".indeterminate"],Bs={class:"sort-icon"},Ls={class:"sort-icon"},Es=["onClick"],Ds=["checked","onChange","aria-label"],Ps={class:"cell-name"},Us={class:"cell-name-info"},Rs={class:"name"},Os=["title"],Is={class:"email"},Ns={class:"tel"},Vs={key:1,class:"muted"},Fs={key:0,style:{background:"var(--primary-soft)",color:"var(--primary)",padding:"2px 8px","border-radius":"6px","font-size":"12px","font-weight":"500"}},Hs={key:1,class:"muted"},Qs={key:0,class:"score-cell"},Js={class:"score-bar"},Gs={class:"score-value"},Ks={key:1,class:"muted"},Ws=["title"],Xs={class:"date-cell"},Ys={class:"row-action"},Zs=["onClick"],eo={key:3,class:"pagination"},to={class:"pagination-info"},so={class:"pagination-controls"},oo=["disabled"],lo=["disabled","onClick"],no=["disabled"],ao={class:"delete-modal",role:"dialog","aria-modal":"true","aria-labelledby":"delete-modal-title"},io={class:"delete-modal-header"},ro={id:"delete-modal-title"},uo={class:"delete-modal-body"},co={key:0,class:"confirm-check"},vo={class:"delete-modal-footer"},po=["disabled"],fo=["disabled"],mo={key:0},_o={key:1},Ee=10,go={__name:"DashboardProspects",emits:["counts-updated"],setup(V,{emit:xe}){const{showToast:A}=Xe(),Se=xe,F=w(!0),B=w([]),D=w(0),L=w(1),ne=w(50),Q=w(""),U=w("date_desc"),_e=w(!1),f=w({quiz_id:void 0,profil:void 0,tag:void 0,source:void 0}),y=w({total:null,last_week:null,avg_score:null,top_profil:null,top_profil_count:null,top_profil_pct:null}
1),x=w(!1),ae=w(null),_=w(new Set),Y=w(!1),O=w(!1),I=w(!1),ie=w([]),Z=w([]),ee=w([]),re=w([]),te=S(()=>{let l=0;return f.value.quiz_id&&l++,f.value.profil&&l++,f.value.tag&&l++,f.value.source&&l++,l}),X=S(()=>Math.max(1,Math.ceil(D.value/ne.value))),$e=S(()=>{const l=X.value,t=L.value;if(l<=7)return Array.from({length:l},(p,$)=>$+1);const v=[...new Set([1,2,l-1,l,t-1,t,t+1])].filter(p=>p>=1&&p<=l).sort((p,$)=>p-$),b=[];for(let p=0;p<v.length;p++)b.push(v[p]),v[p+1]&&v[p+1]-v[p]>1&&b.push("...");return b}),N=S(()=>{const l=new Map;for(const s of B.value){const v=(s.email||"").trim().toLowerCase();v&&(l.has(v)||l.set(v,[]),l.get(v).push(s))}const t=[];for(const[s,v]of l){v.sort((E,j)=>{const C=new Date(E.last_attempt_at||E.submitted_at||E.created_at||0);return new Date(j.last_attempt_at||j.submitted_at||j.created_at||0)-C});const b=v[0],p=new Set(v.map(E=>E.quiz_id).filter(Boolean)),$=new Set(v.map(E=>E.tag).filter(Boolean));t.push({...b,email:s,quizzes_count:p.size,total_attempts:v.reduce((E,j)=>E+(j.attempts_count||1),0),all_tags:[...$],_rows:v,_latest:b})}return t}),n=S(()=>N.value.length),o=S(()=>{const l=y.value;return l&&typeof l.total=="number"?{total:l.total,last_week:l.last_week??0,avg_score:l.avg_score??null,top_profil:l.top_profil??null,top_profil_count:l.top_profil_count??null,top_profil_pct:l.top_profil_pct??null}:u.value}),u=S(()=>{const l=N.value;if(!l.length)return{total:0,last_week:0,avg_score:null,top_profil:null,top_profil_count:null,top_profil_pct:null};const t=l.length,s=Date.now()-10080*60*1e3,v=l.filter(h=>{const M=h.first_attempt_at||h.created_at;return M?new Date(M).getTime()>=s:!1}).length,b=l.filter(h=>typeof h.score_global=="number"),p=b.length?Math.round(b.reduce((h,M)=>h+M.score_global,0)/b.length):null,$=new Map;for(const h of l){const M=h.profil_nom;M&&$.set(M,($.get(M)||0)+1)}let E=null,j=null;if($.size){const h=[...$.entries()].sort((M,Be)=>Be[1]-M[1]);E=h[0][0],j=h[0][1]}const C=j?Math.round(j/t*100):null;return{total:t,last_week:v,avg_score:p,top_profil:E,top_profil_count:j,top_profil_pct:C}}),g=S(()=>{const l=N.value;return l.length?l.every(t=>_.value.has(t.email)):!1}),d=S(()=>{const l=N.value;return l.length?l.some(t=>_.value.has(t.email)):!1}),m=S(()=>_.value.size>Ee);async function q(){var t;const{data:l}=await We.auth.getSession();return((t=l==null?void 0:l.session)==null?void 0:t.access_token)||null}async function z(){F.value=!0;try{const l=await q();if(!l){console.warn("[prospects] no auth token"),F.value=!1;return}const t=new URLSearchParams;t.set("page",String(L.value)),t.set("limit",String(ne.value)),t.set("sort",U.value),Q.value.trim()&&t.set("q",Q.value.trim()),f.value.quiz_id&&t.set("quiz_id",f.value.quiz_id),f.value.profil&&t.set("profil",f.value.profil),f.value.tag&&t.set("tag",f.value.tag),f.value.source&&t.set("source",f.value.source);const s=await fetch("/api/prospects?"+t.toString(),{headers:{Authorization:"Bearer "+l}});if(!s.ok)throw new Error("HTTP "+s.status);const v=await s.json();if(B.value=v.data||[],D.value=v.total||0,y.value=v.stats||y.value,Se("counts-updated",{prospects:y.value&&typeof y.value.total=="number"?y.value.total:n.value}),ie.value.length===0&&B.value.length){const b={};for(const p of B.value)p.quiz_id&&p.quiz_title&&(b[p.quiz_id]={id:p.quiz_id,title:p.quiz_title});ie.value=Object.values(b)}if(Z.value.length===0){const b=new Set(B.value.map(p=>p.profil_nom).filter(Boolean));Z.value=[...b]}if(ee.value.length===0){const b=new Set(B.value.map(p=>p.tag).filter(Boolean));ee.value=[...b]}if(re.value.length===0){const b=new Set(B.value.map(p=>p.source||p.utm_source).filter(Boolean));re.value=[...b]}if(_.value.size>0){const b=new Set(N.value.map($=>$.email)),p=[..._.value].filter($=>b.has($));p.length!==_.value.size&&(_.value=new Set(p))}}catch(l){console.error("[prospects] load failed:",l)}finally{F.value=!1}}let J=null;function R(){clearTimeout(J),J=setTimeout(()=>{L.value=1,z()},350)}function G(l=!1){l&&(L.value=1),z()}function ge(){f.value={quiz_id:void 0,profil:void 0,tag:void 0,source:void 0},L.value=1,z()}function ue(l){l==="score"?U.value=U.value==="score_desc"?"score_asc":"score_desc":U.value=U.value==="date_desc"?"date_asc":"date_desc",z()}
1function de(l){return l==="score"?U.value==="score_asc"?"â":U.value==="score_desc"?"â":"":l==="date"?U.value==="date_asc"?"â":U.value==="date_desc"?"â":"":""}function se(l){l<1||l>X.value||(L.value=l,z())}function ce(l){ae.value=l,x.value=!0}function be(l){const t=new Set(_.value);t.has(l)?t.delete(l):t.add(l),_.value=t}function he(){g.value?_.value=new Set:_.value=new Set(N.value.map(l=>l.email))}function ve(){_.value=new Set}function ke(){_.value.size!==0&&(O.value=!1,Y.value=!0)}function pe(){I.value||(Y.value=!1,O.value=!1)}async function ye(){if(!I.value&&!(m.value&&!O.value)){I.value=!0;try{const l=await q();if(!l)throw new Error("Non authentifié");const t=[..._.value],s=await fetch("/api/delete-prospects",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+l},body:JSON.stringify({emails:t})});if(!s.ok){const h=await s.json().catch(()=>({}));throw new Error(h.error||"HTTP "+s.status)}const v=await s.json(),{deleted_count:b,deleted_rows:p,deleted_emails:$,deleted_at:E}=v;I.value=!1,Y.value=!1,O.value=!1,ve();const j=b>1?`${b} prospects supprimés`:"1 prospect supprimé",C=p>b?`${p} tentatives au total`:"";A({type:"success",title:j,message:C,onUndo:()=>we($,E)}),await z()}catch(l){console.error("[delete-prospects] failed:",l),I.value=!1,A({type:"error",title:"Erreur lors de la suppression",message:l.message||"Merci de réessayer"})}}}async function we(l,t){try{const s=await q();if(!s)throw new Error("Non authentifié");const v=await fetch("/api/restore-prospects",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+s},body:JSON.stringify({emails:l,deleted_at:t})});if(!v.ok){const $=await v.json().catch(()=>({}));throw new Error($.error||"HTTP "+v.status)}const p=(await v.json()).restored_count||0;A({type:"success",title:p>1?`${p} prospects restaurés`:`${p} prospect restauré`,message:""}),await z()}catch(s){console.error("[restore-prospects] failed:",s),A({type:"error",title:"Erreur lors de la restauration",message:s.message||"Merci de réessayer"})}}const fe=[["#fce7f3","#9d174d"],["#dbeafe","#1e40af"],["#ccfbf1","#115e59"],["#ffedd5","#9a3412"],["#fce7f3","#9f1239"],["#e0e7ff","#3730a3"],["#d1fae5","#065f46"],["#fef3c7","#78350f"]];function P(l,t){if(!l)return 0;let s=0;for(let v=0;v<l.length;v++)s=s*31+l.charCodeAt(v)|0;return Math.abs(s)%t}function K(l){const s=(l.prenom||l.email||"?").trim().split(/[\s@.]+/).filter(Boolean);return s.length?s.length===1?s[0].slice(0,2).toUpperCase():(s[0][0]+s[1][0]).toUpperCase():"?"}function je(l){const[t,s]=fe[P(l.email||l.prenom||"",fe.length)];return`background: ${t}; color: ${s};`}function Re(l){return P(l,5)}const ze={instagram:"Instagram",facebook:"Facebook",linkedin:"LinkedIn",tiktok:"TikTok",youtube:"YouTube",x:"X (Twitter)",pinterest:"Pinterest",snapchat:"Snapchat",whatsapp:"WhatsApp",reddit:"Reddit",email:"Newsletter",google:"Google",bing:"Bing",direct:"Direct",other:"Autre"};function Oe(l){return ze[l]||(l?l.charAt(0).toUpperCase()+l.slice(1):"Direct")}function Ie(l){const t=(l.source||"").toLowerCase();if(ze[t])return t;const s=(l.utm_source||"direct").toLowerCase();return s.includes("facebook")||s.includes("fb")?"facebook":s.includes("insta")||s.includes("ig")?"instagram":s.includes("linkedin")||s.includes("li")?"linkedin":s.includes("mail")||s.includes("email")||s.includes("news")?"email":"direct"}function Me(l){if(l.source&&ze[l.source])return ze[l.source];const t=l.utm_source||l.source;return t?t.charAt(0).toUpperCase()+t.slice(1):"Direct"}function Ne(l){if(!l)return"â";try{const t=new Date(l);return t.toLocaleDateString("fr-FR",{day:"2-digit",month:"2-digit"})+" · "+t.toLocaleTimeString("fr-FR",{hour:"2-digit",minute:"2-digit"})}catch{return"â"}}async function Ve(){try{const l=await q();if(!l)return;const t=200,s=50,v=[];for(let C=1;C<=s;C++){const h=new URLSearchParams;h.set("page",String(C)),h.set("limit",String(t)),h.set("sort",U.value),Q.value.trim()&&h.set("q",Q.value.trim()),f.value.quiz_id&&h.set("quiz_id",f.value.quiz_id),f.value.profil&&h.set("profil",f.value.profil),f.value.tag&&h.set("tag",f.value.tag),f.value.source&&h.set("source",f.value.source);const M=await fetch("/api/prospects?"+h.toString(),{headers:{Authorization:"Bearer "+l}});if(!M.ok){console.error("[export] page",C,M.status);break}const Le=(await M.json()).data||[];if(v.push(...Le),Le.length<t)break}const p=[["prenom","email","tel","profil","tag","score","quiz","source","utm_campaign","date"],...(v||[]).map(C=>[C.prenom||"",C.email||"",C.tel||"",C.profil_nom||"",C.tag||"",C.score_global??"",C.quiz_title||"",Me(C),C.utm_campaign||"",C.created_at||""])].map(C=>C.map(h=>{const M=String(h??"");return/[,"\n]/.test(M)?'"'+M.replace(/"/g,'""')+'"':M}).join(",")).join(` 2`),$=new Blob(["\uFEFF"+p],{type:"text/csv;charset=utf-8;"}),E=URL.createObjectURL($),j=document.createElement("a");j.href=E,j.download=`prospects-${new Date().toISOString().slice(0,10)}.csv`,document.body.appendChild(j),j.click(),document.body.removeChild(j),URL.revokeObjectURL(E)}catch(l){console.error("[csv export] failed:",l),alert("Erreur lors de l'export CSV")}}return Je(()=>z()),(l,t)=>(a(),i("div",null,[e("div",Qt,[e("div",Jt,[t[23]||(t[23]=e("span",{class:"prospects-eyebrow"}
2,"Audience qualifiée",-1)),t[24]||(t[24]=e("h1",null,[c("Tes "),e("em",null,"prospects")],-1)),y.value.total!==null?(a(),i("p",Gt,[o.value.total===0?(a(),i(T,{key:0},[c(" Chaque interaction sur tes quiz devient une donnée stratégique sur ton audience. ")],64)):(a(),i(T,{key:1},[t[20]||(t[20]=c(" Tu as collecté ",-1)),e("strong",null,r(o.value.total)+" prospect"+r(o.value.total>1?"s":""),1),t[21]||(t[21]=c(" sur tes quiz · ",-1)),e("strong",null,"+"+r(o.value.last_week),1),t[22]||(t[22]=c(" cette semaine. ",-1))],64))])):(a(),i("p",Kt,"Chargementâ¦"))]),e("div",Wt,[e("button",{class:"btn",onClick:t[0]||(t[0]=s=>_e.value=!_e.value)},[t[25]||(t[25]=e("svg",{class:"icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"})],-1)),c(" Filtres "+r(te.value?`(${te.value})`:""),1)]),e("button",{class:"btn btn-dark",onClick:Ve,disabled:!B.value.length},[...t[26]||(t[26]=[e("svg",{class:"icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"}),e("polyline",{points:"7 10 12 15 17 10"}),e("line",{x1:"12",y1:"15",x2:"12",y2:"3"})],-1),c(" Exporter CSV ",-1)])],8,Xt)])]),e("div",Yt,[e("div",Zt,[t[27]||(t[27]=me('<div class="stat-card-header" data-v-7f8b915c><div class="stat-label" data-v-7f8b915c>Total prospects</div><div class="stat-icon violet" data-v-7f8b915c><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-v-7f8b915c><path d="M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2" data-v-7f8b915c></path><circle cx="9" cy="7" r="4" data-v-7f8b915c></circle></svg></div></div>',1)),e("div",es,r(o.value.total??"â"),1),t[28]||(t[28]=e("div",{class:"stat-change"},[e("span",null,"personnes uniques · tous tes quiz confondus")],-1))]),e("div",ts,[t[29]||(t[29]=me('<div class="stat-card-header" data-v-7f8b915c><div class="stat-label" data-v-7f8b915c>Cette semaine</div><div class="stat-icon blue" data-v-7f8b915c><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-v-7f8b915c><rect x="3" y="4" width="18" height="18" rx="2" data-v-7f8b915c></rect><line x1="16" y1="2" x2="16" y2="6" data-v-7f8b915c></line><line x1="8" y1="2" x2="8" y2="6" data-v-7f8b915c></line><line x1="3" y1="10" x2="21" y2="10" data-v-7f8b915c></line></svg></div></div>',1)),e("div",ss,r(o.value.last_week??"â"),1),t[30]||(t[30]=e("div",{class:"stat-change"},[e("span",null,"nouveaux sur 7 jours")],-1))]),e("div",os,[t[31]||(t[31]=me('<div class="stat-card-header" data-v-7f8b915c><div class="stat-label" data-v-7f8b915c>Score moyen</div><div class="stat-icon green" data-v-7f8b915c><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-v-7f8b915c><path d="M22 11.08V12a10 10 0 11-5.93-9.14" data-v-7f8b915c></path><polyline points="22 4 12 14.01 9 11.01" data-v-7f8b915c></polyline></svg></div></div>',1)),e("div",ls,[c(r(o.value.avg_score??"â"),1),o.value.avg_score!==null?(a(),i("span",ns,"/100")):k("",!0)]),t[32]||(t[32]=e("div",{class:"stat-change"},[e("span",null,"moyenne sur la derniere tentative de chaque prospect")],-1))]),e("div",as,[t[33]||(t[33]=me('<div class="stat-card-header" data-v-7f8b915c><div class="stat-label" data-v-7f8b915c>Profil dominant</div><div class="stat-icon orange" data-v-7f8b915c><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-v-7f8b915c><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" data-v-7f8b915c></polygon></svg></div></div>',1)),e("div",is,r(o.value.top_profil||"â"),1),e("div",rs,[o.value.top_profil_pct?(a(),i("strong",us,r(o.value.top_profil_pct)+"%",1)):k("",!0),o.value.top_profil_count?(a(),i("span",ds,"("+r(o.value.top_profil_count)+"/"+r(o.value.total)+")",1)):k("",!0)])])]),e("div",cs,[e("div",vs,[t[34]||(t[34]=e("svg",{class:"search-ico",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("circle",{cx:"11",cy:"11",r:"8"}),e("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})],-1)),oe(e("input",{type:"text","onUpdate:modelValue":t[1]||(t[1]=s=>Q.value=s),placeholder:"Rechercher par prénom, email ou téléphoneâ¦",onInput:R},null,544),[[Ge,Q.value]])]),t[40]||(t[40]=e("div",{class:"filter-sep"},null,-1)),e("button",{class:W(["filter-chip",{active:!f.value.quiz_id&&!f.value.profil&&!f.value.source&&!f.value.tag}
2]),onClick:ge},[t[35]||(t[35]=c(" Tous ",-1)),e("span",ps,r(o.value.total??"â"),1)],2),oe(e("select",{"onUpdate:modelValue":t[2]||(t[2]=s=>f.value.quiz_id=s),class:"filter-chip select-chip",onChange:t[3]||(t[3]=s=>G(!0))},[t[36]||(t[36]=e("option",{value:void 0},"Tous les quiz",-1)),(a(!0),i(T,null,H(ie.value,s=>(a(),i("option",{key:s.id,value:s.id},r(s.title),9,fs))),128))],544),[[Ce,f.value.quiz_id]]),oe(e("select",{"onUpdate:modelValue":t[4]||(t[4]=s=>f.value.profil=s),class:"filter-chip select-chip",onChange:t[5]||(t[5]=s=>G(!0))},[t[37]||(t[37]=e("option",{value:void 0},"Tous les profils",-1)),(a(!0),i(T,null,H(Z.value,s=>(a(),i("option",{key:s,value:s},r(s),9,ms))),128))],544),[[Ce,f.value.profil]]),oe(e("select",{"onUpdate:modelValue":t[6]||(t[6]=s=>f.value.tag=s),class:"filter-chip select-chip",onChange:t[7]||(t[7]=s=>G(!0))},[t[38]||(t[38]=e("option",{value:void 0},"Tous les tags",-1)),(a(!0),i(T,null,H(ee.value,s=>(a(),i("option",{key:s,value:s},r(s),9,_s))),128))],544),[[Ce,f.value.tag]]),oe(e("select",{"onUpdate:modelValue":t[8]||(t[8]=s=>f.value.source=s),class:"filter-chip select-chip",onChange:t[9]||(t[9]=s=>G(!0))},[t[39]||(t[39]=e("option",{value:void 0},"Toutes sources",-1)),(a(!0),i(T,null,H(re.value,s=>(a(),i("option",{key:s,value:s},r(Oe(s)),9,gs))),128))],544),[[Ce,f.value.source]])]),e("div",bs,[e("div",hs,[e("div",ks,[t[41]||(t[41]=c(" Résultats ",-1)),e("span",ys,r(D.value)+" prospect"+r(D.value>1?"s":""),1)]),e("div",ws,[e("button",{class:"icon-btn",onClick:t[10]||(t[10]=s=>G(!0)),title:"Actualiser"},[...t[42]||(t[42]=[e("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("polyline",{points:"23 4 23 10 17 10"}),e("path",{d:"M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15"})],-1)])])])]),Ae(Ue,{name:"selection-bar-fade"},{default:Pe(()=>[_.value.size>0?(a(),i("div",zs,[e("div",Cs,[e("strong",null,r(_.value.size),1),t[43]||(t[43]=c(" prospect",-1)),_.value.size>1?(a(),i(T,{key:0},[c("s")],64)):k("",!0),t[44]||(t[44]=c(" sélectionné",-1)),_.value.size>1?(a(),i(T,{key:1},[c("s")],64)):k("",!0)]),e("div",qs,[e("button",{class:"btn-link",onClick:ve}," Tout désélectionner "),e("button",{class:"btn btn-danger",onClick:ke},[t[45]||(t[45]=e("svg",{class:"icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("polyline",{points:"3 6 5 6 21 6"}),e("path",{d:"M19 6l-1 14a2 2 0 01-2 2H8a2 2 0 01-2-2L5 6"}),e("path",{d:"M10 11v6M14 11v6"})],-1)),c(" Supprimer "+r(_.value.size),1)])])])):k("",!0)]),_:1}),F.value?(a(),i("div",xs,[(a(),i(T,null,H(5,s=>e("div",{key:s,class:"loading-shimmer",style:{height:"48px",margin:"12px 20px"}})),64))])):B.value.length?(a(),i("table",As,[e("thead",null,[e("tr",null,[e("th",
2js,[e("input",{type:"checkbox",class:"row-checkbox",checked:g.value,".indeterminate":d.value&&!g.value,onChange:he,onClick:t[11]||(t[11]=le(()=>{},["stop"])),"aria-label":"Tout sélectionner"},null,40,Ms)]),t[50]||(t[50]=e("th",null,"Prospect",-1)),t[51]||(t[51]=e("th",null,"Téléphone",-1)),t[52]||(t[52]=e("th",null,"Profil",-1)),t[53]||(t[53]=e("th",null,"Tag",-1)),e("th",{class:"sortable",onClick:t[12]||(t[12]=s=>ue("score"))},[t[48]||(t[48]=c(" Score ",-1)),e("span",Bs,r(de("score")),1)]),t[54]||(t[54]=e("th",null,"Quiz",-1)),t[55]||(t[55]=e("th",null,"Source",-1)),e("th",{class:"sortable",onClick:t[13]||(t[13]=s=>ue("date"))},[t[49]||(t[49]=c(" Date ",-1)),e("span",Ls,r(de("date")),1)]),t[56]||(t[56]=e("th",null,null,-1))])]),e("tbody",null,[(a(!0),i(T,null,H(N.value,s=>(a(),i("tr",{key:s.email,class:W({"row-selected":_.value.has(s.email)}),onClick:v=>ce(s)},[e("td",{class:"col-check",onClick:t[15]||(t[15]=le(()=>{},["stop"]))},[e("input",{type:"checkbox",class:"row-checkbox",checked:_.value.has(s.email),onChange:v=>be(s.email),onClick:t[14]||(t[14]=le(()=>{},["stop"])),"aria-label":"Sélectionner "+(s.prenom||s.email)},null,40,Ds)]),e("td",null,[e("div",Ps,[e("div",{class:"cell-avatar",style:qe(je(s))}
2,r(K(s)),5),e("div",Us,[e("div",Rs,[c(r(s.prenom||"â")+" ",1),s.quizzes_count>1?(a(),i("span",{key:0,class:"quiz-count-badge",title:s.total_attempts+" tentatives au total sur "+s.quizzes_count+" quiz"},r(s.quizzes_count)+" quiz",9,Os)):k("",!0)]),e("div",Is,r(s.email||"â"),1)])])]),e("td",Ns,r(s.tel||"â"),1),e("td",null,[s.profil_nom?(a(),i("span",{key:0,class:W(["profile-badge","c"+Re(s.profil_nom)])},[t[57]||(t[57]=e("span",{class:"dot"},null,-1)),c(r(s.profil_nom),1)],2)):(a(),i("span",Vs,"â"))]),e("td",null,[s.tag?(a(),i("span",Fs,r(s.tag),1)):(a(),i("span",Hs,"â"))]),e("td",null,[typeof s.score_global=="number"?(a(),i("div",Qs,[e("div",Js,[e("div",{class:"score-bar-fill",style:qe({width:Math.min(100,s.score_global)+"%"})},null,4)]),e("span",Gs,r(s.score_global),1)])):(a(),i("span",Ks,"â"))]),e("td",null,[e("span",{class:"quiz-tag",title:s.quiz_title},r(s.quiz_title||"â"),9,Ws)]),e("td",null,[e("div",{class:W(["source-chip","s-"+Ie(s)])},[t[58]||(t[58]=e("span",{class:"src-dot"},null,-1)),c(r(Me(s)),1)],2)]),e("td",Xs,r(Ne(s.created_at)),1),e("td",null,[e("div",Ys,[e("button",{class:"eye-btn",onClick:le(v=>ce(s),["stop"])},[...t[59]||(t[59]=[e("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e("circle",{cx:"12",cy:"12",r:"3"})],-1)])],8,Zs)])])],10,Es))),128))])])):(a(),i("div",Ss,[t[46]||(t[46]=e("div",{class:"emoji"},"ð±",-1)),t[47]||(t[47]=e("h3",null,"Aucun prospect pour l'instant",-1)),te.value?(a(),i("p",$s,"Essayez d'ajuster les filtres")):(a(),i("p",Ts,"Publie un quiz et partage-le pour collecter tes premiers prospects"))])),!F.value&&B.value.length?(a(),i("div",eo,[e("div",to,[t[60]||(t[60]=c(" Page ",-1)),e("strong",null,r(L.value),1),t[61]||(t[61]=c(" sur ",-1)),e("strong",null,r(X.value),1),t[62]||(t[62]=c(" · ",-1)),e("strong",null,r(B.value.length),1),t[63]||(t[63]=c(" sur ",-1)),e("strong",null,r(D.value),1)]),e("div",so,[e("button",{class:"page-btn",disabled:L.value<=1,onClick:t[16]||(t[16]=s=>se(L.value-1))},[...t[64]||(t[64]=[e("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("polyline",{points:"15 18 9 12 15 6"})],-1)])],8,oo),(a(!0),i(T,null,H($e.value,s=>(a(),i("button",{key:s+"-"+Math.random(),class:W(["page-btn",{active:s===L.value}]),disabled:s==="...",onClick:v=>s!=="..."&&se(s)},r(s),11,lo))),128)),e("button",{class:"page-btn",disabled:L.value>=X.value,onClick:t[17]||(t[17]=s=>se(L.value+1))},[...t[65]||(t[65]=[e("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("polyline",{points:"9 18 15 12 9 6"})],-1)])],8,no)])])):k("",!0)]),Ae(Ht,{open:x.value,prospect:ae.value,onClose:t[18]||(t[18]=s=>x.value=!1)},null,8,["open","prospect"]),Y.value?(a(),i("div",{key:0,class:"delete-modal-overlay",onClick:le(pe,["self"])},[e("div",ao,[e("div",io,[t[67]||(t[67]=me('<div class="delete-icon" data-v-7f8b915c><svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-v-7f8b915c><path d="M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" data-v-7f8b915c></path><line x1="12" y1="9" x2="12" y2="13" data-v-7f8b915c></line><line x1="12" y1="17" x2="12.01" y2="17" data-v-7f8b915c></line></svg></div>',1)),e("h2",ro,[c(" Supprimer "+r(_.value.size)+" prospect",1),_.value.size>1?(a(),i(T,{key:0},[c("s")],64)):k("",!0),t[66]||(t[66]=c(" ? ",-1))])]),e("div",uo,[e("p",null,[t[68]||(t[68]=c(" Cette action supprimera ",-1)),e("strong",null,[c(r(_.value.size)+" prospect",1),_.value.size>1?(a(),i(T,{key:0},[c("s")],64)):k("",!0)]),t[69]||(t[69]=c(" (toutes leurs tentatives sur tous tes quiz). ",-1))]),t[72]||(t[72]=e("p",{class:"modal-text-muted"},[c(" Les données seront masquées du dashboard mais restent récupérables pendant 30 jours â tu auras un bouton "),e("strong",null,"Annuler"),c(" juste après. ")],-1)),m.value?(a(),i("label",co,[oe(e("input",{type:"checkbox","onUpdate:modelValue":t[19]||(t[19]=s=>O.value=s)},null,512),[[Ke,O.value]]),e("span",null,[t[70]||(t[70]=c(" Je comprends que cette action supprime plus de ",-1)),e("strong",null,r(Ee)),t[71]||(t[71]=c(" prospects d'un coup. ",-1))])])):k("",!0)]),e("div",vo,[e("button",{class:"btn btn-cancel",onClick:pe,disabled:I.value}," Annuler ",8,po),e("button",{class:"btn btn-danger",onClick:ye,disabled:I.value||m.value&&!O.value},[I.value?(a(),i("span",mo,"Suppressionâ¦")):(a(),i("span",_o,"Oui, supprimer"))],8,fo)])])])):k("",!0)]))}},ko=De(go,[["__scopeId","data-v-7f8b915c"]]);export{ko 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.