PageSourceSearch

https://www.prancer.io/assets/DistributorSettings-CjHzl88X.js

js prancer.io collected 2026-10-02 16:17:10 UTC 3,565 bytes, 1 lines download raw bytes

1import{D as f,E as N,e as v,r as o,j as e,B as d,L as C,s as y}from"./index-BmLIWSxz.js";import{C as m,b as h,c as x,d as P,a as u}from"./card-4m3JX_M4.js";import{I as p}from"./input-CeWgoj9i.js";import{L as w}from"./label-B0hSTQ-R.js";import{L as g}from"./loader-circle-ixN-_FSn.js";import{A as L}from"./arrow-left-D8oZQNgk.js";import{B as E}from"./building-2-CbWwf8-Z.js";import{L as A}from"./lock-CBd4Qj3q.js";const T=()=>{const{profile:i,isLoading:j,isAuthenticated:D}=f();N();const{toast:r}=v(),[l,c]=o.useState(!1),[a,n]=o.useState({current:"",new:"",confirm:""}),b=async t=>{if(t.preventDefault(),a.new!==a.confirm){r({title:"Error",description:"New passwords do not match",variant:"destructive"});return}if(a.new.length<8){r({title:"Error",description:"Password must be at least 8 characters",variant:"destructive"});return}c(!0);try{const{error:s}=await y.auth.updateUser({password:a.new});if(s)throw s;r({title:"Password Updated",description:"Your password has been changed successfully."}),n({current:"",new:"",confirm:""})}catch(s){console.error("Password change error:",s),r({title:"Error",description:"Failed to change password. Please try again.",variant:"destructive"})}finally{c(!1)}};return j?e.jsx("div",{className:"min-h-screen bg-slate-900 flex items-center justify-center",children:e.jsx(g,{className:"w-8 h-8 animate-spin text-blue-400"})}):e.jsxs("div",{className:"min-h-screen bg-slate-900",children:[e.jsx("header",{className:"bg-slate-800 border-b border-slate-700",children:e.jsxs("div",{className:"max-w-2xl mx-auto px-4 py-4 flex items-center gap-4",children:[e.jsx(d,{variant:"ghost",size:"icon",asChild:!0,className:"text-slate-400",children:e.jsx(C,{to:"/distributor/dashboard",children:e.jsx(L,{className:"w-5 h-5"})})}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(E,{className:"w-6 h-6 text-blue-400"}),e.jsx("h1",{className:"text-lg font-bold text-white",children:"Account Settings"})]})]})}),e.jsxs("main",{className:"max-w-2xl mx-auto px-4 py-8 space-y-6",children:[e.jsxs(m,{className:"bg-slate-800/50 border-slate-700",children:[e.jsxs(h,{children:[e.jsxs(x,{className:"text-white flex items-center gap-2",children:[e.jsx(A,{className:"w-5 h-5"}),"Change Password"]}),e.jsx(P,{className:"text-slate-400",children:"Update your account password"})]}),e.jsx(u,{children:e.jsxs("form",{onSubmit:b,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(w,{className:"text-slate-300",children:"New Password"}),e.jsx(p,{type:"password",value:a.new,onChange:t=>n(s=>({...s,new:t.target.value})),className:"bg-slate-700/50 border-slate-600 text-white",placeholder:"Minimum 8 characters",required:!0})]}),e.jsxs("div",{children:[e.jsx(w,{className:"text-slate-300",children:"Confirm New Password"}),e.jsx(p,{type:"password",value:a.confirm,onChange:t=>n(s=>({...s,confirm:t.target.value})),className:"bg-slate-700/50 border-slate-600 text-white",placeholder:"Re-enter new password",required:!0})]}),e.jsx(d,{type:"submit",disabled:l,className:"bg-blue-600 hover:bg-blue-700",children:l?e.jsxs(e.Fragment,{children:[e.jsx(g,{className:"w-4 h-4 mr-2 animate-spin"}),"Updating..."]}):"Update Password"})]})})]}),e.jsxs(m,{className:"bg-slate-800/50 border-slate-700",children:[e.jsx(h,{children:e.jsx(x,{className:"text-white",children:"Account Email"})}),e.jsxs(u,{children:[e.jsx("p",{className:"text-slate-300",children:i==null?void 0:i.primary_contact_email}),e.jsx("p",{className:"text-slate-500 text-sm mt-2",children:"Contact support to change your email address."})]})]})]})]})};export{T 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.