PageSourceSearch

https://rave-drone-art.lovable.app/assets/Auth-Dfk1dAkJ.js

js rave-drone-art.lovable.app collected 2026-10-03 03:41:47 UTC 4,652 bytes, 1 lines download raw bytes

1import{n as W,o as G,p as J,m as K,r as i,j as s,L as M}from"./index-CFgCxefv.js";import{N as Q,B as E}from"./Navigation-Bs513f1s.js";import{I as t}from"./input-y-_jd3nN.js";import{L as n}from"./label-DvF6zGLT.js";import{T as X,a as Y,b as C,c as P}from"./tabs-BscFKmxi.js";import{C as S,a as L,b as T,c as Z,d as k}from"./card-BlW2XVOg.js";import{a as _}from"./Footer-yBgxU77L.js";import{s as H,Z as d}from"./types-CtWaBghH.js";import"./mail-1Aa9F8kQ.js";const F=H().email({message:"Nieprawidłowy adres email"}),q=H().min(6,{message:"Hasło musi mieć minimum 6 znaków"}),ls=()=>{const g=W(),h=G(),[x]=J(),{signIn:z,signUp:D,user:j,loading:w}=K(),[m,R]=i.useState(""),[u,A]=i.useState(""),[p,f]=i.useState(""),[o,v]=i.useState(""),[y,N]=i.useState(""),[l,c]=i.useState(!1),[r,b]=i.useState({});i.useEffect(()=>{var e,a;if(!w&&j){const V=x.get("redirect")||((a=(e=h.state)==null?void 0:e.from)==null?void 0:a.pathname)||"/account";g(V,{replace:!0})}},[j,w,g,x,h]);const I=()=>{const e={};try{F.parse(m)}catch(a){a instanceof d&&(e.loginEmail=a.errors[0].message)}try{q.parse(u)}catch(a){a instanceof d&&(e.loginPassword=a.errors[0].message)}return b(e),Object.keys(e).length===0},O=()=>{const e={};try{F.parse(p)}catch(a){a instanceof d&&(e.signupEmail=a.errors[0].message)}try{q.parse(o)}catch(a){a instanceof d&&(e.signupPassword=a.errors[0].message)}return o!==y&&(e.signupConfirmPassword="Hasła nie są identyczne"),b(e),Object.keys(e).length===0},B=async e=>{e.preventDefault(),I()&&(c(!0),await z(m,u),c(!1))},U=async e=>{if(e.preventDefault(),!O())return;c(!0);const{error:a}=await D(p,o);c(!1),a||(f(""),v(""),N(""))};return s.jsxs("div",{className:"min-h-screen bg-black",children:[s.jsx(Q,{}),s.jsx("div",{className:"container mx-auto px-4 pt-28 pb-12",children:s.jsx("div",{className:"max-w-md mx-auto",children:s.jsxs(X,{defaultValue:"login",className:"w-full",children:[s.jsxs(Y,{className:"grid w-full grid-cols-2 mb-8",children:[s.jsx(C,{value:"login",children:"Zaloguj się"}),s.jsx(C,{value:"signup",children:"Zarejestruj się"})]}),s.jsx(P,{value:"login",children:s.jsxs(S,{children:[s.jsxs(L,{children:[s.jsx(T,{children:"Zaloguj się"}),s.jsx(Z,{children:"Wprowadź swoje dane aby się zalogować"})]}),s.jsx(k,{children:s.jsxs("form",{onSubmit:B,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(n,{htmlFor:"login-email",children:"Email"}),s.jsx(t,{id:"login-email",type:"email",placeholder:"[email protected]",value:m,onChange:e=>R(e.target.value),required:!0}),r.loginEmail&&s.jsx("p",{className:"text-sm text-destructive",children:r.loginEmail})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(n,{htmlFor:"login-password",children:"Hasło"}),s.jsx(M,{to:"/reset-password",className:"text-sm text-primary hover:underline",children:"Zapomniałeś hasła?"})]}),s.jsx(t,{id:"login-password",type:"password",placeholder:"••••••••",value:u,onChange:e=>A(e.target.value),required:!0}),r.loginPassword&&s.jsx("p",{className:"text-sm text-destructive",children:r.loginPassword})]}),s.jsx(E,{type:"submit",className:"w-full",disabled:l,children:l?"Logowanie...":"Zaloguj się"})]})})]})}),s.jsx(P,{value:"signup",children:s.jsxs(S,{children:[s.jsxs(L,{children:[s.jsx(T,{children:"Zarejestruj się"}),s.jsx(Z,{children:"Utwórz nowe konto w RAVEDRON"})]}),s.jsx(k,{children:s.jsxs("form",{onSubmit:U,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(n,{htmlFor:"signup-email",children:"Email"}),s.jsx(t,{id:"signup-email",type:"email",placeholder:"[email protected]",value:p,onChange:e=>f(e.target.value),required:!0}),r.signupEmail&&s.jsx("p",{className:"text-sm text-destructive",children:r.signupEmail})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(n,{htmlFor:"signup-password",children:"Hasło"}),s.jsx(t,{id:"signup-password",type:"password",placeholder:"••••••••",value:o,onChange:e=>v(e.target.value),required:!0}),r.signupPassword&&s.jsx("p",{className:"text-sm text-destructive",children:r.signupPassword})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(n,{htmlFor:"signup-confirm-password",children:"Potwierdź hasło"}),s.jsx(t,{id:"signup-confirm-password",type:"password",placeholder:"••••••••",value:y,onChange:e=>N(e.target.value),required:!0}),r.signupConfirmPassword&&s.jsx("p",{className:"text-sm text-destructive",children:r.signupConfirmPassword})]}),s.jsx(E,{type:"submit",className:"w-full",disabled:l,children:l?"Rejestracja...":"Zarejestruj się"})]})})]})})]})})}),s.jsx(_,{})]})};export{ls as default};

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.