(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[363],{4833:function(e,r,t){Promise.resolve().then(t.bind(t,724))},724:function(e,r,t){"use strict";t.r(r);var s=t(7821),n=t(9164),a=t(3153),i=t(6712),o=t(1736),u=t(3984),c=t(6447),l=t(615),d=t(7558),m=t(1853),p=t(9881),f=t(4089),h=t(8504),v=t(8078),j=t(746),x=t(9912);r.default=()=>{let{projectName:e}=(0,v.useContext)(l.c),r=(0,h.useRouter)(),[t,_]=(0,v.useState)(!1),b=x.z.object({activation_code:x.z.string({required_error:"Veuillez renseigner le code d'activation"}),password:p.r}),g=(0,j.cI)({resolver:(0,f.F)(b),mode:"onChange"});async function w(e){try{_(!0);let t=await (0,n.u7z)({body:{reset_token:e.activation_code,new_password:e.password}});if(_(!1),t.response.status<300){r.push("/reset-password/success");return}(0,m.Am)({title:"Erreur",description:t.error.detail,variant:"destructive"})}catch(e){_(!1),(0,m.Am)({title:"Erreur",description:"".concat(e),variant:"destructive"})}}return(0,s.jsx)(a.G,{title:"R\xe9initialiser le mot de passe ".concat(e),description:"Entrez votre nouveau mot de passe",children:(0,s.jsx)(d.l0,{...g,children:(0,s.jsx)("form",{onSubmit:g.handleSubmit(w),children:(0,s.jsxs)("div",{className:"grid gap-4",children:[(0,s.jsx)(c.D,{form:g,name:"activation_code",queryParam:"reset_token"}),(0,s.jsx)(i.T,{form:g,name:"password",label:"Mot de passe",render:e=>(0,s.jsx)(u.S,{autoFocus:!0,...e})}),(0,s.jsx)(o.f,{type:"submit",className:"mt-2 w-full",label:"R\xe9initialiser le mot de passe",isLoading:t})]})})})})}},9686:function(e,r,t){"use strict";t.d(r,{F:function(){return a}});var s=t(7821),n=t(8078);let a=e=>{let{children:r}=e;return(0,s.jsx)(n.Suspense,{fallback:(0,s.jsx)(s.Fragment,{}),children:r})}},6447:function(e,r,t){"use strict";t.d(r,{D:function(){return c}});var s=t(7821),n=t(7558),a=t(8504),i=t(8078);let o=e=>{let{form:r,queryParam:t,name:o,optional:u=!1}=e,c=(0,a.useSearchParams)().get(t),l=(0,a.useRouter)();return(0,i.useEffect)(()=>{u||c?c&&r.setValue(o,c):(console.error("Missing required query parameter: ".concat(t)),l.push(encodeURI("/message?type=missing_query_param")))}),(0,s.jsx)(n.Wi,{control:r.control,name:o,render:e=>{let{field:r}=e;return(0,s.jsx)("input",{type:"hidden",...r})}})};var u=t(9686);let c=e=>{let{form:r,queryParam:t,name:n,optional:a=!1}=e;return(0,s.jsx)(u.F,{children:(0,s.jsx)(o,{form:r,name:n,queryParam:t,optional:a})})}}},function(e){e.O(0,[322,382,314,726,393,792,819,874,436,764,340,930,517,337,115,364,744],function(){return e(e.s=4833)}),_N_E=e.O()}]);