(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[474],{74057:function(e,t,n){Promise.resolve().then(n.bind(n,8952))},8952:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return s}});var a=n(57437),i=n(2265),r=n(27648);function s(){let[e,t]=(0,i.useState)(""),[n,s]=(0,i.useState)(!1),[o,l]=(0,i.useState)(""),[d,p]=(0,i.useState)(""),c=async n=>{n.preventDefault(),s(!0),p(""),l("");try{let n=await fetch("/api/auth/forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e})}),a=await n.json();if(!n.ok)throw Error(a.error||"Terjadi kesalahan");l("Jika email terdaftar, link reset password telah dikirim ke kotak masuk Anda. Cek juga folder spam."),t("")}catch(e){p(e.message)}finally{s(!1)}};return(0,a.jsxs)("main",{style:{minHeight:"100vh",background:"#0a0a0f",display:"flex",alignItems:"center",justifyContent:"center",padding:"24px"},children:[(0,a.jsx)("div",{style:{position:"fixed",top:"20%",left:"30%",width:400,height:400,background:"radial-gradient(circle, rgba(245,158,11,0.06), transparent 70%)",borderRadius:"50%",pointerEvents:"none"}}),(0,a.jsxs)("div",{style:{width:"100%",maxWidth:"420px",position:"relative",zIndex:1},children:[(0,a.jsxs)("div",{style:{textAlign:"center",marginBottom:"40px"},children:[(0,a.jsx)("h1",{style:{fontSize:"24px",fontWeight:700,color:"#f1f5f9",marginBottom:"8px"},children:"Lupa Password"}),(0,a.jsx)("p",{style:{color:"#64748b",fontSize:"14px"},children:"Masukkan email akun Anda untuk mendapatkan link reset password."})]}),(0,a.jsxs)("div",{className:"card",style:{padding:"32px"},children:[(0,a.jsxs)("form",{onSubmit:c,children:[d&&(0,a.jsxs)("div",{style:{padding:"12px",background:"rgba(239,68,68,0.1)",border:"1px solid rgba(239,68,68,0.2)",borderRadius:"8px",color:"#ef4444",fontSize:"13px",marginBottom:"16px"},children:["❌ ",d]}),o&&(0,a.jsxs)("div",{style:{padding:"12px",background:"rgba(16,185,129,0.1)",border:"1px solid rgba(16,185,129,0.2)",borderRadius:"8px",color:"#10b981",fontSize:"13px",marginBottom:"16px"},children:["✅ ",o]}),(0,a.jsxs)("div",{style:{marginBottom:"24px"},children:[(0,a.jsx)("label",{className:"label",children:"Email"}),(0,a.jsx)("input",{className:"input",type:"email",placeholder:"nama@email.com",value:e,onChange:e=>t(e.target.value),required:!0})]}),(0,a.jsx)("button",{type:"submit",className:"btn btn-primary",style:{width:"100%",padding:"13px",fontSize:"15px"},disabled:n||!e,children:n?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"spinner"})," Mengirim..."]}):"Kirim Link Reset"})]}),(0,a.jsxs)("p",{style:{textAlign:"center",marginTop:"20px",fontSize:"14px",color:"#64748b"},children:["Ingat password Anda?"," ",(0,a.jsx)(r.default,{href:"/auth/login",style:{color:"#f59e0b",textDecoration:"none",fontWeight:600},children:"Kembali ke Login"})]})]})]})]})}}},function(e){e.O(0,[648,971,117,744],function(){return e(e.s=74057)}),_N_E=e.O()}]);