PageSourceSearch

https://drophighlight.com/assets/Auth-BS6KxRsL.js

js drophighlight.com collected 2026-09-30 06:37:22 UTC 11,298 bytes, 1 lines download raw bytes

1import{u as z,a as U,r as a,j as e,D as Q,b as Z,c as ee,d as se,e as ae,M as te,B as m,J as C,s as re,f as ie,g as ne,N as le,C as oe,h as ce,i as de,k as me,l as ue}from"./index-P0N1Je5T.js";import{d as he}from"./dh-logo-square-black-BwR7p7IZ.js";import{I as u}from"./input-1tKBwIjz.js";import{L as h}from"./label-CoHN_xq2.js";import{T as pe,a as ge,b as H,c as q}from"./tabs-DitHknAx.js";import{A as Y,a as O}from"./alert-BjIlbniu.js";import{u as xe,P as fe}from"./PasswordCriteriaList-CpGut5MH.js";import{C as R}from"./circle-check-big-DjwoMmiM.js";import{g as je}from"./coverUrls-CgXMhAXv.js";import{E as A}from"./eye-off-BqJujGZL.js";import{E as F}from"./eye-BxqX1t91.js";import"./useDebounce-IpreLc5E.js";const we=({open:p,onOpenChange:g})=>{const{resetPasswordForEmail:b}=z(),{t:i}=U(),[l,s]=a.useState(""),[n,r]=a.useState(!1),[d,c]=a.useState(!1),x=async v=>{if(v.preventDefault(),r(!0),!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(l)){C.error("Please enter a valid email address"),r(!1);return}const{error:f}=await b(l);f||(c(!0),setTimeout(()=>{s(""),c(!1),g(!1)},3e3)),r(!1)},o=()=>{s(""),c(!1),g(!1)};return e.jsx(Q,{open:p,onOpenChange:o,children:e.jsxs(Z,{className:"sm:max-w-md",children:[e.jsxs(ee,{children:[e.jsx(se,{children:i("auth.resetPassword")}),e.jsx(ae,{children:i("auth.enterEmailToReset")})]}),d?e.jsxs(Y,{children:[e.jsx(R,{className:"h-4 w-4"}),e.jsx(O,{children:i("auth.checkYourEmail")})]}):e.jsxs("form",{onSubmit:x,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{htmlFor:"reset-email",children:i("auth.email")}),e.jsxs("div",{className:"relative",children:[e.jsx(te,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),e.jsx(u,{id:"reset-email",type:"email",placeholder:"[email protected]",value:l,onChange:v=>s(v.target.value),className:"pl-10",required:!0,disabled:n})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(m,{type:"button",variant:"outline",onClick:o,disabled:n,className:"flex-1",children:i("auth.backToSignIn")}),e.jsx(m,{type:"submit",disabled:n||!l,className:"flex-1",children:n?e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-current"}),e.jsx("span",{children:i("admin.forms.processing")})]}
1):i("auth.sendResetLink")})]})]})]})})},be=["0af8139f-9433-4f90-9a6d-cbcec7bbd1a0","f616d655-40f7-4d1f-9d8d-12a602677a49"],ve={"0af8139f-9433-4f90-9a6d-cbcec7bbd1a0":{name:"RAW CUTS",logo:"https://atnuwxpdfodxpvhxgayj.supabase.co/storage/v1/object/public/content/logos/light-logo-1760473504218.png"},"f616d655-40f7-4d1f-9d8d-12a602677a49":{name:"Cercle",logo:"https://atnuwxpdfodxpvhxgayj.supabase.co/storage/v1/object/public/content/logos/light-logo-1761136544377.png"}},Ne=()=>{const[p,g]=a.useState([]),[b,i]=a.useState(!0);a.useEffect(()=>{(async()=>{try{const{data:n,error:r}=await re.from("galleries").select("id, title, cover_image_url, company_id").eq("status","published").in("company_id",be).not("cover_image_url","is",null).order("created_at",{ascending:!1}).limit(3);if(r){console.error("Error fetching galleries:",r);return}n&&g(n)}catch(n){console.error("Error:",n)}finally{i(!1)}})()},[]);const l=[{rotate:-12,translateX:-30,translateY:-70,zIndex:30},{rotate:8,translateX:80,translateY:70,zIndex:20},{rotate:-18,translateX:-60,translateY:-10,zIndex:10,isGhost:!0}];return b?e.jsx("div",{className:"relative w-[420px] h-[520px] flex items-center justify-center",children:e.jsx("div",{className:"animate-pulse bg-muted rounded-3xl w-64 h-80"})}):p.length===0?null:e.jsxs("div",{className:"relative w-[420px] h-[520px]",children:[e.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[500px] h-[500px] rounded-full border border-border/30",style:{transform:"translate(-50%, -50%)"}}),e.jsx("div",{className:"absolute top-1/2 left-1/2 w-[400px] h-[400px] rounded-full border border-border/20",style:{transform:"translate(-50%, -50%)"}}),p.slice(0,3).map((s,n)=>{const r=l[n];if(!r)return null;const d=je(s.cover_image_url),c=ve[s.company_id];return e.jsxs("div",{className:`absolute w-[260px] h-[340px] rounded-3xl overflow-hidden shadow-2xl transition-all duration-500 ${r.isGhost?"opacity-30 blur-[2px]":""}`,style:{transform:`rotate(${r.rotate}deg) translateX(${r.translateX}px) translateY(${r.translateY}px)`,zIndex:r.zIndex,left:"50%",top:"50%",marginLeft:"-130px",marginTop:"-170px"},children:[e.jsx("img",{src:d.thumbnail,alt:s.title,className:"absolute inset-0 w-full h-full object-cover",loading:"eager",onError:x=>{const o=x.currentTarget;o.src.includes("/thumbnail/")?o.src=d.medium:o.src.includes("/medium/")?o.src=d.large:o.src!==d.original&&(o.src=d.original)}}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/80 via-black/20 to-transparent"}),e.jsxs("div",{className:"absolute bottom-0 left-0 right-0 p-5",children:[e.jsx("h3",{className:"text-white font-bold text-lg leading-tight line-clamp-2 mb-3",children:s.title}),c&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("img",{src:c.logo,alt:c.name,className:"w-6 h-6 rounded-full object-contain bg-white/10"}),e.jsx("span",{className:"text-white/80 text-sm font-medium",children:c.name})]})]})]},s.id)})]})},_e=()=>{const{user:p,signIn:g,signUp:b}=z(),[i,l]=a.useState(!1),[s,n]=a.useState("signin"),[r,d]=a.useState(!1),[c,x]=a.useState(!1),{t:o}=U(),v=ie(),[P]=ne(),[f,G]=a.useState(!1),[y,V]=a.useState(!1),[S,X]=a.useState(!1),{password:j,updatePassword:L,criteria:$,isPasswordValid:_}=xe(),[w,M]=a.useState(""),[D,E]=a.useState(!0);if(a.useEffect(()=>{P.get("message")==="email_changed"&&C.success("Email alterado com sucesso! Faça login com seu novo email.")},[P]),p)return e.jsx(le,{to:"/admin",replace:!0});const B=async t=>{t.preventDefault(),l(!0);const N=new FormData(t.currentTarget),I=N.get("email"),T=N.get("password"),{error:k}=await g(I,T);k||v("/admin"),l(!1)},J=async t=>{if(t.preventDefault(),l(!0),j!==w){C.error("Passwords do not match. Please try again."),l(!1);return}if(!_()){C.error("Please ensure your password meets all security requirements."),l(!1);return}const N=new FormData(t.currentTarget),I=N.get("email"),T=N.get("displayName"),{error:k}=await b(I,j,T);k||(n("signin"),d(!0),L(""),M(""),E(!0)),l(!1)},W=t=>{L(t),E(t===w)},K=t=>{M(t),E(j===t)};return a.useEffect(()=>{document.title=s==="signin"?"Sign In | Drop Highlight":"Create Account | Drop Highlight"},[s]),e.jsxs("div",{className:"min-h-screen flex bg-background",children:[e.jsx("div",{className:"w-full lg:w-1/2 flex items-center justify-center p-4 bg-background",children:e.jsxs(oe,{className:"w-full max-w-md border-border",children:[e.jsxs(ce,{className:"text-center",children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("img",{src:he,alt:"Drop High Light Logo",className:"h-[90px] w-auto mt-[10px]"})}),e.jsx("h1",{className:"sr-only",children:s==="signin"?"Sign in to Drop Highlight":"Create your Drop Highlight account"}),e.jsx(de,{className:"text-2xl font-bold text-foreground",children:s==="signin"?"Platform Sign In":"Create Account"}),e.jsx(me,{children:s==="signin"?"Sign in to manage your content":"Create your account to start managing content"})]}),e.jsxs(ue,{children:[r&&e.jsxs(Y,{className:"mb-4",children:[e.jsx(R,{className:"h-4 w-4"}),e.jsx(O,{children:"Account created! Check your email to confirm your account before signing in."})]}),e.jsxs(pe,{value:s,onValueChange:n,className:"w-full",children:[e.jsxs(ge,{className:"grid w-full grid-cols-2",children:[e.jsx(H,{value:"signin",children:"Sign In"}),e.jsx(H,{value:"signup",children:"Sign Up"})]}),e.jsx(q,{value:"signin",children:e.jsxs("form",{onSubmit:B,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{htmlFor:"signin-email",children:"Email"}),e.jsx(u,{id:"signin-email",name:"email",type:"email",placeholder:"[email protected]",required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{htmlFor:"signin-password",children:"Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(u,{id:"signin-password",name:"password",type:f?"text":"password",placeholder:"********",required:!0}),e.jsx(m,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>G(!f),"aria-label":f?"Hide password":"Show password",children:f?e.jsx(A,{className:"h-4 w-4"}):e.jsx(F,{className:"h-4 w-4"})})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(m,{type:"button",variant:"link",className:"px-0 text-sm",onClick:()=>x(!0),children:o("auth.forgotPassword")})}),e.jsx(m,{type:"submit",className:"w-full apple-intelligence-button-modal",disabled:i,children:i?e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-current"}),e.jsx("span",{children:"Signing in..."})]}):"Sign In"})]})}),e.jsx(q,{value:"signup",children:e.jsxs("form",{onSubmit:J,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{htmlFor:"signup-name",children:"Full Name"}),e.jsx(u,{id:"signup-name",name:"displayName",type:"text",placeholder:"Your full name",required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{htmlFor:"signup-email",children:"Email"}),e.jsx(u,{id:"signup-email",name:"email",type:"email",placeholder:"[email protected]",required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{htmlFor:"signup-password",children:"Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(u,{id:"signup-password",name:"password",type:y?"text":"password",placeholder:"Enter a strong password",value:j,onChange:t=>W(t.target.value),required:!0}),e.jsx(m,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>V(!y),"aria-label":y?"Hide password":"Show password",children:y?e.jsx(A,{className:"h-4 w-4"}):e.jsx(F,{className:"h-4 w-4"})})]}),e.jsx(fe,{password:j,criteria:$})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{htmlFor:"confirm-password",children:"Confirm Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(u,{id:"confirm-password",name:"confirmPassword",type:S?"text":"password",placeholder:"Confirm your password",value:w,onChange:t=>K(t.target.value),className:!D&&w?"border-destructive":"",required:!0}),e.jsx(m,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>X(!S),"aria-label":S?"Hide password":"Show password",children:S?e.jsx(A,{className:"h-4 w-4"}):e.jsx(F,{className:"h-4 w-4"})})]}),!D&&w&&e.jsx("p",{className:"text-sm text-destructive",children:"Passwords do not match."})]}),e.jsx(m,{type:"submit",className:"w-full apple-intelligence-button-modal",disabled:i||!D||!_()||!j||!w,children:i?e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-current"}),e.jsx("span",{children:"Creating account..."})]}):"Create Account"})]})})]})]})]})}),e.jsx("div",{className:"hidden lg:flex w-1/2 bg-muted/30 items-center justify-center relative overflow-hidden min-h-screen",children:e.jsx(Ne,{})}),e.jsx(we,{open:c,onOpenChange:x})]})};export{_e 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.