Datavision / backend /static /assets /ForgotPassword-DZWHTf76.js
DataVision CI/CD Bot
release: clean production build for HuggingFace Space
09801ca
Raw
History Blame Contribute Delete
5.75 kB
import{j as e,m as l,L as o}from"./vendor-Dy_Aqit6.js";import{a}from"./plotly-BRtgkqNO.js";import{u as y,i as f,n as v,m as j}from"./index-DkRDPfDI.js";function F(){const{isDark:i,toggleTheme:p}=y(),[n,g]=a.useState(""),[d,c]=a.useState(!1),[m,t]=a.useState(""),[x,u]=a.useState(""),b=async s=>{s.preventDefault(),c(!0),u(""),t("");try{const r=await f.post("/api/v1/settings/auth/request-password-reset",{email:n.trim().toLowerCase()});r.data.success?t("If an account exists with this email, you will receive a password reset link shortly. Please check your inbox and spam folder."):u(r.data.message||"Failed to send reset email")}catch{t("If an account exists with this email, you will receive a password reset link shortly. Please check your inbox and spam folder.")}finally{c(!1)}},h=()=>e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"absolute top-0 left-0 w-full h-full overflow-hidden pointer-events-none",children:[e.jsx("div",{className:"absolute top-[-10%] right-[-5%] w-[500px] h-[500px] rounded-full blur-[100px] opacity-20 bg-emerald-500/20"}),e.jsx("div",{className:"absolute bottom-[-10%] left-[-10%] w-[600px] h-[600px] rounded-full blur-[120px] opacity-10 bg-green-500/20"})]}),e.jsx("button",{onClick:p,className:"absolute top-6 right-6 p-3 rounded-full shadow-lg transition-transform hover:scale-110 active:scale-95 z-50 glass-card border border-border","aria-label":"Toggle theme",children:i?e.jsx(v,{className:"w-6 h-6 text-amber-400"}):e.jsx(j,{className:"w-6 h-6 text-slate-500"})})]});return m?e.jsxs("div",{className:"min-h-screen flex items-center justify-center p-4 transition-colors duration-300 relative overflow-hidden bg-primary text-primary",children:[h(),e.jsxs(l.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"max-w-md w-full rounded-2xl p-8 text-center glass-card shadow-xl backdrop-blur-xl border border-white/10 relative z-10",children:[e.jsx("div",{className:"w-20 h-20 bg-emerald-500/10 rounded-full flex items-center justify-center mx-auto mb-6 border border-emerald-500/20",children:e.jsx("svg",{className:"w-10 h-10 text-emerald-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),e.jsx("h2",{className:"text-2xl font-bold mb-3",style:{color:"var(--text-primary)"},children:"Check your email"}),e.jsx("p",{className:"mb-8",style:{color:"var(--text-muted)"},children:m}),e.jsx(o,{to:"/login",className:"inline-block px-8 py-3 font-semibold rounded-lg transition-all hover:opacity-90 shadow-lg shadow-emerald-500/20",style:{background:"linear-gradient(135deg, #22c55e 0%, #16a34a 100%)",color:"#FFFFFF"},children:"Return to Login"})]})]}):e.jsxs("div",{className:"min-h-screen flex items-center justify-center p-4 transition-colors duration-300 relative overflow-hidden bg-primary text-primary",children:[h(),e.jsxs(l.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"max-w-md w-full relative z-10",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsxs(o,{to:"/",className:"inline-flex items-center gap-3 group",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 rounded-full blur-lg opacity-50 group-hover:opacity-100 transition-opacity bg-green-500/30"}),e.jsx("img",{src:i?"/datavision-logo-dark.jpg":"/datavision-logo-light.jpg",alt:"DataVision Logo",className:"w-14 h-14 object-contain relative z-10 drop-shadow-lg rounded-full",onError:s=>{s.target.src="/logo.svg"}})]}),e.jsxs("span",{className:"text-3xl font-bold tracking-tight",children:[e.jsx("span",{style:{color:"var(--text-primary)"},children:"Data"}),e.jsx("span",{className:"text-emerald-500",children:"Vision"})]})]}),e.jsx("p",{className:"mt-2 text-sm",style:{color:"var(--text-muted)"},children:"Recover your account access"})]}),e.jsxs(l.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{delay:.1},className:"p-8 md:p-10 rounded-3xl shadow-2xl glass-card backdrop-blur-xl border border-white/10",children:[e.jsx("h2",{className:"text-2xl font-bold text-center mb-2",style:{color:"var(--text-primary)"},children:"Reset Password"}),e.jsx("p",{className:"text-center mb-8",style:{color:"var(--text-muted)"},children:"Enter your email to receive a reset link"}),x&&e.jsxs("div",{className:"mb-6 p-4 rounded-xl flex items-start gap-3 bg-red-500/10 border border-red-500/20",children:[e.jsx("div",{className:"w-1 h-full bg-red-500 rounded-full"}),e.jsx("p",{className:"text-sm text-red-500",children:x})]}),e.jsx("form",{onSubmit:b,children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"email",className:"block text-sm font-medium mb-2",style:{color:"var(--text-muted)"},children:"Email"}),e.jsx("input",{id:"email",type:"email",value:n,onChange:s=>g(s.target.value),required:!0,className:"w-full px-5 py-3.5 rounded-xl transition-all focus:outline-none focus:ring-2 focus:ring-primary-500/50 glass-input",placeholder:"you@example.com"})]}),e.jsx("button",{type:"submit",disabled:d,className:"w-full py-3.5 rounded-xl font-semibold text-white shadow-lg shadow-green-500/20 transition-all hover:scale-[1.02] active:scale-[0.98] disabled:opacity-70 disabled:cursor-not-allowed",style:{background:"linear-gradient(135deg, #22c55e 0%, #16a34a 100%)"},children:d?"Sending...":"Send Reset Link"})]})}),e.jsx("div",{className:"mt-8 text-center pt-6 border-t border-border/50",children:e.jsx(o,{to:"/login",className:"text-sm transition-colors hover:opacity-100 opacity-80 font-medium",style:{color:"#22c55e"},children:"← Back to login"})})]})]})]})}export{F as default};