1import{r,j as e}from"./vendor-react-BGSoyBC3.js";import{u as L,L as M}from"./vendor-router-Bky5zxn0.js";import{m as V,a as p,W as A,c}from"./index-CY3lR3NC.js";import{L as m,aF as R,aE as v,as as D,at as F,ar as T}from"./vendor-icons-0KQIW_PB.js";import"./vendor-trpc-C-BLj2ba.js";import"./vendor-react-dom-CzqU2IQt.js";import"./vendor-ui-BKDt2K1P.js";import"./vendor-charts-BBE7Gg4G.js";function H(){const[,g]=L(),{isRTL:s}=V(),x=new URLSearchParams(window.location.search).get("token")??"",[i,o]=r.useState("loading"),[w,j]=r.useState(""),[N,u]=r.useState(""),[t,y]=r.useState(""),[h,k]=r.useState(""),[n,S]=r.useState(!1),[f,l]=r.useState(""),[b,P]=r.useState(!1),E=p.emailAuth.verifyEmail.useMutation({onSuccess:a=>{j(a.email),o("success")},onError:a=>{u(a.message),o("error")}}),d=p.emailAuth.setPassword.useMutation({onSuccess:()=>{P(!0),setTimeout(()=>{window.location.href="/dashboard"},2e3)},onError:a=>{l(a.message)}});r.useEffect(()=>{if(!x){u(s?"رابط Ø§ÙØªØÙÙ ØºÙØ± ØµØ§ÙØ.":"Invalid verification link."),o("error");return}E.mutate({token:x})},[]);const C=a=>{if(a.preventDefault(),l(""),t.length<8){l(s?"ÙÙÙ
Ø© اÙÙ
Ø±ÙØ± ÙØ¬Ø¨ أ٠تÙÙÙ 8 Ø£ØØ±Ù عÙÙ Ø§ÙØ£ÙÙ":"Password must be at least 8 characters");return}if(t!==h){l(s?"ÙÙÙ
تا اÙÙ
Ø±ÙØ± ØºÙØ± Ù
ØªØ·Ø§Ø¨ÙØªÙÙ":"Passwords do not match");return}d.mutate({email:w,password:t})};return e.jsxs(A,{mode:"signup",centered:!0,children:[i==="loading"&&e.jsxs("div",{className:"py-6 text-center",children:[e.jsx(m,{className:"mx-auto mb-4 h-12 w-12 animate-spin text-[var(--brand-navy)]"}),e.jsx("h1",{className:"brand-wordmark mb-2 text-xl font-bold text-[var(--brand-ink-soft)]",children:s?"Ø¬Ø§Ø±Ù Ø§ÙØªØÙÙ...":"Verifying..."}),e.jsx("p",{className:"text-sm text-[var(--brand-ink-muted)]",children:s?"ÙØ±Ø¬Ù Ø§ÙØ§Ùتظار ÙØØ¸Ø©":"Please wait a moment"})]}),i==="error"&&e.jsxs("div",{className:"space-y-4 text-center",children:[e.jsx("div",{className:"mx-auto flex h-14 w-14 items-center justify-center rounded-full bg-red-50",children:e.jsx(R,{className:"h-9 w-9 text-red-500"})}),e.jsx("h1",{className:"brand-wordmark text-xl font-bold text-[var(--brand-ink-soft)]",children:s?"ÙØ´Ù Ø§ÙØªØÙÙ":"Verification Failed"}),e.jsx("p",{className:"text-sm text-red-600",children:N}),e.jsx("p",{className:"text-sm text-[var(--brand-ink-muted)]",children:s?"ÙØ¯ ÙÙÙÙ Ø§ÙØ±Ø§Ø¨Ø· Ù
ÙØªÙÙ Ø§ÙØµÙاØÙØ© Ø£Ù Ù
ستخدÙ
ا٠Ù
Ø³Ø¨ÙØ§Ù.":"The link may have expired or already been used."}),e.jsx("button",{type:"button",className:"gulf-btn-primary h-11 w-full",onClick:()=>g("/signup"),children:s?"Ø¥ÙØ´Ø§Ø¡ ØØ³Ø§Ø¨ Ø¬Ø¯ÙØ¯":"Create new account"}),e.jsx(M,{href:"/login",className:"block text-sm font-medium text-[var(--brand-ink-muted)] hover:text-[var(--brand-navy)]",children:s?"â ØªØ³Ø¬ÙÙ Ø§ÙØ¯Ø®ÙÙ":"â Sign in"})]}),i==="success"&&!b&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-5 text-center",children:[e.jsx("div",{className:"mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-full bg-[var(--accent-teal)]",children:e.jsx(v,{className:"h-9 w-9 text-[var(--brand-teal)]"})}),e.jsx("h1",{className:"brand-wordmark mb-2 text-xl font-bold text-[var(--brand-ink-soft)]",children:s?"تÙ
Ø§ÙØªØÙÙ Ø¨ÙØ¬Ø§Ø!":"Email Verified!"}),e.jsx("p",{className:"text-sm text-[var(--brand-ink-muted)]",children:s?"Ø§ÙØ¢Ù عÙÙÙ ÙÙÙ
Ø© Ù
Ø±ÙØ± ÙØØ³Ø§Ø¨Ù":"Now set a password for your account"})]}),e.jsxs("form",{onSubmit:C,className:"space-y-3.5",children:[e.jsxs("div",{children:[e.jsx("label",{className:"gulf-field-label",children:s?"ÙÙÙ
Ø© اÙÙ
Ø±ÙØ±":"Password"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:n?"text":"password",value:t,onChange:a=>y(a.target.value),placeholder:s?"8 Ø£ØØ±Ù عÙÙ Ø§ÙØ£ÙÙ":"At least 8 characters",className:c("gulf-field-input",s?"pl-10":"pr-10"),required:!0,dir:"ltr"}),e.jsx("button",{type:"button",onClick:()=>S(!n),className:c("absolute top-1/2 -translate-y-1/2 text-[var(--brand-ink-faint)]",s?"left-3":"right-3"),children:n?e.jsx(D,{className:"h-4 w-4"}):e.jsx(F,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"gulf-field-label",children:s?"تأÙÙØ¯ ÙÙÙ
Ø© اÙÙ
Ø±ÙØ±":"Confirm Password"}),e.jsx("input",{type:n?"text":"password",value:h,onChange:a=>k(a.target.value),placeholder:s?"أعد إدخا٠ÙÙÙ
Ø© اÙÙ
Ø±ÙØ±":"Re-enter password",className:"gulf-field-input",required:!0,dir:"ltr"})]}),t.length>0&&e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"flex gap-1",children:[1,2,3,4].map(a=>e.jsx("div",{className:c("h-1 flex-1 rounded-full transition-colors",t.length>=a*3?t.length>=12?"bg-[var(--brand-teal)]":t.length>=8?"bg-amber-400":"bg-red-400":"bg-[var(--brand-line)]")},a))}),e.jsx("p",{className:"text-xs text-[var(--brand-ink-faint)]",children:t.length<8?s?"ضعÙÙØ©":"Weak":t.length<12?s?"Ù
ØªÙØ³Ø·Ø©":"Medium":s?"ÙÙÙØ©":"Strong"})]}),f&&e.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-red-200 bg-red-50 p-3 text-sm text-red-700",children:[e.jsx(T,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsx("p",{children:f})]}),e.jsx("button",{type:"submit",className:"gulf-btn-primary h-11 w-full",disabled:d.isPending,children:d.isPending?e.jsx(m,{className:"mx-auto h-4 w-4 animate-spin"}):s?"تعÙÙÙ ÙÙÙ
Ø© اÙÙ
Ø±ÙØ± ÙØ§ÙدخÙÙ":"Set Password & Sign In"})]})]}),b&&e.jsxs("div",{className:"py-4 text-center",children:[e.jsx("div",{className:"mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-full bg-[var(--accent-teal)]",children:e.jsx(v,{className:"h-9 w-9 text-[var(--brand-teal)]"})}),e.jsx("h1",{className:"brand-wordmark mb-2 text-xl font-bold text-[var(--brand-ink-soft)]",children:s?"Ù
Ø±ØØ¨Ø§Ù ب٠ÙÙ Doxxo!":"Welcome to Do
1xxo!"}),e.jsx("p",{className:"mb-4 text-sm text-[var(--brand-ink-muted)]",children:s?"Ø¬Ø§Ø±Ù ØªÙØ¬ÙÙÙ ÙÙ
Ø³Ø§ØØ© Ø§ÙØ¹Ù
Ù...":"Redirecting to workspace..."}),e.jsx(m,{className:"mx-auto h-6 w-6 animate-spin text-[var(--brand-navy)]"})]})]})}export{H 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.