module.exports=[56191,a=>{"use strict";var b=a.i(48333),c=a.i(81235),d=a.i(93465);let e=process.env.NEXT_PUBLIC_API_BASE||"http://localhost:5000";async function f(a){try{let b=await a.json();return String(b?.message||a.statusText)}catch{return String(a.statusText||"Request failed")}}function g(){let a=(0,d.useSearchParams)(),g=(0,d.useRouter)(),h=(0,c.useMemo)(()=>String(a.get("token")||""),[a]),[i,j]=(0,c.useState)(""),[k,l]=(0,c.useState)(""),[m,n]=(0,c.useState)(!1),[o,p]=(0,c.useState)(""),[q,r]=(0,c.useState)("");(0,c.useEffect)(()=>{h||p("Missing invite token")},[h]);let s=async()=>{if(p(""),r(""),!h)return p("Missing invite token");if(!i)return p("Password is required");if(i!==k)return p("Passwords do not match");n(!0);try{let a=await fetch(`${e}/api/admin/accept-invite`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:h,password:i})});if(!a.ok)throw Error(await f(a));let b=await a.json();r("Password set successfully. Redirecting to login...");let c=encodeURIComponent(String(b?.email||""));setTimeout(()=>{g.replace(`/admin/login?username=${c}`)},800)}catch(a){p(a?.message||"Failed to set password")}finally{n(!1)}};return(0,b.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center p-4",children:(0,b.jsxs)("div",{className:"w-full max-w-md bg-white border border-black/10 rounded-xl p-5",children:[(0,b.jsx)("div",{className:"text-xl font-bold",children:"Set your password"}),(0,b.jsx)("div",{className:"text-xs text-gray-500 mt-1",children:"This invite link expires after a short time. Choose a strong password."}),o?(0,b.jsx)("div",{className:"mt-3 p-3 border border-red-200 bg-red-50 rounded-lg text-red-700 text-sm",children:o}):null,q?(0,b.jsx)("div",{className:"mt-3 p-3 border border-emerald-200 bg-emerald-50 rounded-lg text-emerald-700 text-sm",children:q}):null,(0,b.jsxs)("div",{className:"mt-4 space-y-3",children:[(0,b.jsx)("input",{value:i,onChange:a=>j(a.target.value),type:"password",placeholder:"New password (10+ chars, upper/lower/number/symbol)",className:"w-full px-3 py-2 rounded-lg border border-black/10"}),(0,b.jsx)("input",{value:k,onChange:a=>l(a.target.value),type:"password",placeholder:"Confirm password",className:"w-full px-3 py-2 rounded-lg border border-black/10"}),(0,b.jsx)("button",{onClick:s,disabled:m,className:"w-full px-4 py-2 rounded-lg border border-black/10 hover:bg-black hover:text-white transition disabled:opacity-50",children:m?"Saving...":"Save password"}),(0,b.jsx)("div",{className:"text-xs text-gray-500",children:"Tip: Use a password manager. Strong password = 10+ chars with upper, lower, number, and symbol."})]})]})})}a.s(["default",()=>g])}];

//# sourceMappingURL=6c7f9_ui-main-fixed_ui-main_app_admin_accept-invite_AcceptInviteClient_tsx_e5266272._.js.map