1 line
8.7 KiB
JavaScript
1 line
8.7 KiB
JavaScript
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,44026,e=>{"use strict";let t=(0,e.i(78445).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",()=>t],44026)},50147,e=>{"use strict";let t=(0,e.i(78445).default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);e.s(["User",()=>t],50147)},62746,e=>{"use strict";let t=(0,e.i(78445).default)("book-open",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);e.s(["BookOpen",()=>t],62746)},78445,e=>{"use strict";var t=e.i(59760);let s=(...e)=>e.filter((e,t,s)=>!!e&&""!==e.trim()&&s.indexOf(e)===t).join(" ").trim(),a=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,s)=>s?s.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var l={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let r=(0,t.forwardRef)(({color:e="currentColor",size:a=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:n="",children:o,iconNode:c,...d},u)=>(0,t.createElement)("svg",{ref:u,...l,width:a,height:a,stroke:e,strokeWidth:i?24*Number(r)/Number(a):r,className:s("lucide",n),...!o&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(d)&&{"aria-hidden":"true"},...d},[...c.map(([e,s])=>(0,t.createElement)(e,s)),...Array.isArray(o)?o:[o]])),i=(e,l)=>{let i=(0,t.forwardRef)(({className:i,...n},o)=>(0,t.createElement)(r,{ref:o,iconNode:l,className:s(`lucide-${a(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,i),...n}));return i.displayName=a(e),i};e.s(["default",()=>i],78445)},12856,(e,t,s)=>{t.exports=e.r(96479)},11690,e=>{"use strict";let t=(0,e.i(78445).default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);e.s(["ArrowRight",()=>t],11690)},35809,e=>{"use strict";let t=(0,e.i(78445).default)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);e.s(["Lock",()=>t],35809)},24605,e=>{"use strict";var t=e.i(30064),s=e.i(59760),a=e.i(78445);let l=(0,a.default)("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);var r=e.i(35809),i=e.i(50147),n=e.i(11690),o=e.i(44026),c=e.i(62746);let d=(0,a.default)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var u=e.i(18404);let m=({onBack:e,onSuccess:a,initialMode:m="signin"})=>{let[x,h]=(0,s.useState)(m),[p,f]=(0,s.useState)(!1),[b,g]=(0,s.useState)({name:"",email:"",password:""}),[v,w]=(0,s.useState)(""),{user:y,login:j,signup:N}=(0,u.useAuthContext)();(0,s.useEffect)(()=>{y&&a()},[y,a]);let k=async()=>{let e={email:"streaper2@gmail.com",password:"Kency1313"};g({name:"Admin Plume",...e}),f(!0),w("");try{await j(e.email,e.password)}catch(e){w(e?.message||"Erreur de connexion au service.")}finally{f(!1)}},C=async e=>{e.preventDefault(),w(""),f(!0);try{"signup"===x?await N(b.email,b.password,b.name):await j(b.email,b.password)}catch(e){w(e?.message||"Une erreur technique est survenue.")}finally{f(!1)}};return(0,t.jsxs)("div",{className:"min-h-screen bg-slate-50 flex overflow-hidden font-sans text-slate-900",children:[(0,t.jsxs)("div",{className:"hidden lg:flex w-1/2 bg-slate-900 relative p-12 flex-col justify-between overflow-hidden",children:[(0,t.jsxs)("div",{className:"absolute top-0 right-0 w-full h-full opacity-20 pointer-events-none",children:[(0,t.jsx)("div",{className:"absolute top-10 right-10 w-64 h-64 bg-blue-500 rounded-full blur-[120px]"}),(0,t.jsx)("div",{className:"absolute bottom-10 left-10 w-96 h-96 bg-indigo-500 rounded-full blur-[150px]"})]}),(0,t.jsxs)("div",{className:"relative z-10 flex items-center gap-2 text-white text-2xl font-black",children:[(0,t.jsx)(c.BookOpen,{className:"text-blue-500"})," PlumeIA"]}),(0,t.jsxs)("div",{className:"relative z-10 max-w-lg",children:[(0,t.jsxs)("h2",{className:"text-5xl font-black text-white leading-tight mb-6",children:["L'endroit où vos ",(0,t.jsx)("span",{className:"text-blue-400",children:"histoires"})," prennent vie."]}),(0,t.jsx)("p",{className:"text-slate-400 text-lg leading-relaxed",children:"Rejoignez une communauté d'auteurs qui utilisent l'IA pour briser la page blanche."})]}),(0,t.jsx)("div",{className:"relative z-10 text-slate-500 text-sm",children:"© 2024 PlumeIA Ecosystem."})]}),(0,t.jsx)("div",{className:"w-full lg:w-1/2 flex items-center justify-center p-8 bg-white overflow-y-auto",children:(0,t.jsxs)("div",{className:"w-full max-w-md animate-in fade-in slide-in-from-right-10 duration-500 py-8",children:[(0,t.jsxs)("div",{className:"text-center mb-10",children:[(0,t.jsx)("h1",{className:"text-3xl font-black text-slate-900 mb-2",children:"signin"===x?"Content de vous revoir":"signup"===x?"Commencer l'aventure":"Récupération"}),(0,t.jsx)("p",{className:"text-slate-500",children:"signin"===x?"Entrez vos identifiants pour continuer.":"Créez votre compte gratuit en quelques secondes."})]}),v&&(0,t.jsx)("div",{className:"mb-6 p-4 bg-red-50 border border-red-100 text-red-600 text-sm font-medium rounded-xl animate-in shake duration-300",children:v}),(0,t.jsxs)("form",{onSubmit:C,className:"space-y-4",children:["signup"===x&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("label",{className:"text-xs font-black text-slate-500 uppercase tracking-widest ml-1",children:"Nom complet"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(i.User,{className:"absolute left-4 top-3.5 text-slate-400",size:18}),(0,t.jsx)("input",{type:"text",required:!0,value:b.name,onChange:e=>g({...b,name:e.target.value}),placeholder:"Marc Dupré",className:"w-full pl-12 pr-4 py-3 bg-slate-50 border border-slate-200 rounded-xl outline-none focus:ring-2 focus:ring-blue-500 font-medium"})]})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("label",{className:"text-xs font-black text-slate-500 uppercase tracking-widest ml-1",children:"Email"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(l,{className:"absolute left-4 top-3.5 text-slate-400",size:18}),(0,t.jsx)("input",{type:"email",required:!0,value:b.email,onChange:e=>g({...b,email:e.target.value}),placeholder:"votre@email.com",className:"w-full pl-12 pr-4 py-3 bg-slate-50 border border-slate-200 rounded-xl outline-none focus:ring-2 focus:ring-blue-500 font-medium"})]})]}),"forgot"!==x&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("label",{className:"text-xs font-black text-slate-500 uppercase tracking-widest ml-1",children:"Mot de passe"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(r.Lock,{className:"absolute left-4 top-3.5 text-slate-400",size:18}),(0,t.jsx)("input",{type:"password",required:!0,value:b.password,onChange:e=>g({...b,password:e.target.value}),placeholder:"••••••••",className:"w-full pl-12 pr-4 py-3 bg-slate-50 border border-slate-200 rounded-xl outline-none focus:ring-2 focus:ring-blue-500 font-medium"})]})]}),(0,t.jsx)("button",{type:"submit",disabled:p,className:"w-full bg-slate-900 text-white py-4 rounded-xl font-bold flex items-center justify-center gap-2 hover:bg-blue-600 transition-all shadow-xl disabled:opacity-50 mt-4",children:p?(0,t.jsx)(o.Loader2,{className:"animate-spin"}):(0,t.jsxs)(t.Fragment,{children:["signin"===x?"Se connecter":"signup"===x?"Créer mon compte":"Envoyer"," ",(0,t.jsx)(n.ArrowRight,{size:18})]})})]}),"signin"===x&&(0,t.jsxs)("button",{onClick:k,className:"w-full mt-4 bg-amber-50 border border-amber-200 text-amber-800 py-3 rounded-xl font-bold flex items-center justify-center gap-2 hover:bg-amber-100 transition-all",children:[(0,t.jsx)(d,{size:18})," Connexion démo (Admin)"]}),(0,t.jsx)("div",{className:"mt-10 text-center",children:(0,t.jsxs)("p",{className:"text-sm text-slate-500",children:["signin"===x?"Pas de compte ?":"Déjà membre ?",(0,t.jsx)("button",{onClick:()=>h("signin"===x?"signup":"signin"),className:"ml-2 font-bold text-blue-600",children:"signin"===x?"S'inscrire":"Se connecter"})]})}),(0,t.jsx)("button",{onClick:e,className:"mt-8 text-xs text-slate-300 w-full text-center hover:text-slate-500 transition-colors",children:"← Revenir au site"})]})})]})};var x=e.i(12856);function h(){let e=(0,x.useRouter)();return(0,t.jsx)(m,{onBack:()=>e.push("/"),onSuccess:()=>e.push("/dashboard"),initialMode:"signup"})}e.s(["default",()=>h],24605)}]); |