1import{r as c,j as e,L as b}from"./index-CpxT3N_O.js";import{B as x}from"./SEO-CsBQgFMB.js";import{I as o}from"./input-Ds-mEAKQ.js";import{L as n}from"./label-BI98_kKB.js";import{D as y,d as w,a as R,b as z,c as F,e as C}from"./dialog-DYva73i8.js";const k="/assets/Lab_Rapport-d-impact-2024-2025-CmPikbDR.webp",D={"opinion-way":{title:"Recevoir l'étude Opinion Way",description:"« Les jeunes et l'orientation » â l'étude menée avec OpinionWay. Nous vous l'envoyons par email dans la minute."},impact:{title:"Recevoir le rapport d'impact",description:"Notre rapport d'impact 2024-2025. Nous vous l'envoyons par email dans la minute."}},h={firstname:"",lastname:"",email:"",organization:"",position:"",optIn:!1,website:""},P=({report:m,children:g})=>{const[j,v]=c.useState(!1),[i,l]=c.useState(h),[r,d]=c.useState("idle"),p=D[m],a=s=>({value:i[s],onChange:t=>l(N=>({...N,[s]:t.target.value}))}),f=async s=>{if(s.preventDefault(),r!=="sending"){d("sending");try{const t=await fetch("/api/report-request",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({report:m,...i})});d(t.ok?"sent":"error")}catch{d("error")}}},u=s=>{v(s),s||(l(h),d("idle"))};return e.jsxs(y,{open:j,onOpenChange:u,children:[e.jsx(w,{asChild:!0,children:g}),e.jsxs(R,{className:"sm:max-w-lg",children:[e.jsxs(z,{children:[e.jsx(F,{children:p.title}),e.jsx(C,{children:p.description})]}),r==="sent"?e.jsxs("div",{className:"py-4",children:[e.jsx("p",{className:"font-medium",children:"C'est envoyé."}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Le document arrive dans votre boîte mail. Pensez aux indésirables s'il tarde."}),i.optIn&&e.jsxs("p",{className:"mt-3 rounded-lg bg-muted/50 p-3 text-sm text-muted-foreground",children:["Un ",e.jsx("strong",{className:"font-semibold text-foreground",children:"second email"})," vous demande de confirmer votre inscription à la newsletter. Sans ce clic, vous ne la recevrez pas."]}),e.jsx(x,{className:"mt-6 w-full",onClick:()=>u(!1),children:"Fermer"})]}):e.jsxs("form",{onSubmit:f,className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(n,{htmlFor:"report-firstname",children:"Prénom"}),e.jsx(o,{id:"report-firstname",required:!0,className:"mt-1.5",...a("firstname")})]}),e.jsxs("div",{children:[e.jsx(n,{htmlFor:"report-lastname",children:"Nom"}),e.jsx(o,{id:"report-lastname",required:!0,className:"mt-1.5",...a("lastname")})]})]}),e.jsxs("div",{children:[e.jsx(n,{htmlFor:"report-email",children:"Email professionnel"}),e.jsx(o,{id:"report-email",type:"email",required:!0,className:"mt-1.5",...a("email")})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(n,{htmlFor:"report-organization",children:"Organisation"}),e.jsx(o,{id:"report-organization",required:!0,className:"mt-1.5",...a("organization")})]}),e.jsxs("div",{children:[e.jsx(n,{htmlFor:"report-position",children:"Fonction (facultatif)"}),e.jsx(o,{id:"report-position",className:"mt-1.5",...a("position")})]})]}),e.jsxs("div",{className:"absolute left-[-9999px]","aria-hidden":"true",children:[e.jsx("label",{htmlFor:"report-website",children:"Ne remplissez pas ce champ"}),e.jsx("input",{id:"report-website",type:"text",tabIndex:-1,autoComplete:"off",value:i.website,onChange:s=>l(t=>({...t,website:s.target.value}))})]}),e.jsxs("div",{className:"flex items-start gap-3 rounded-lg bg-muted/50 p-3",children:[e.jsx("input",{id:"report-optin",type:"checkbox",checked:i.optIn,onChange:s=>l(t=>({...t,optIn:s.target.checked})),className:"mt-1 h-4 w-4 shrink-0 accent-primary"}),e.jsx("label",{htmlFor:"report-optin",className:"text-sm text-muted-foreground",children:"Je souhaite aussi recevoir la newsletter Jexplore. Facultatif : vous recevrez le document que vous demandez dans tous les cas."})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Votre demande sert à vous envoyer ce document. Vos informations sont destinées à l'équipe Jexplore."," ",e.jsx(b,{to:"/politique-confidentialite",className:"underline hover:text-foreground",children:"Politique de confidentialité"}),"."]}),r==="error"&&e.jsx("p",{className:"text-sm text-destructive",children:"L'envoi a échoué. Réessayez, ou écrivez-nous via la page contact."}),e.jsx(x,{type:"submit",size:"lg",disabled:r==="sending",children:r==="sending"?"Envoi en coursâ¦":"Recevoir le document"})]})]})]})};export{P as R,k as i};
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.