1import{a as j,dZ as y,r as m,d_ as C,c as f,j as e,av as P,B as i,E as b,F as D,b1 as v,b2 as I,b3 as S,G as k,aw as E}from"./index-XzWw1KPV.js";import{I as t}from"./InputFormItem-3t6aupps.js";import{S as F}from"./SectionLayout-DFNEmjMl.js";import{u as R,s as T,F as L}from"./zod-CJ7tmwcf.js";function N(){const r=j(),{mutate:o,isPending:l}=y(),[w,n]=m.useState(!1),s=R({resolver:T(C),mode:"onSubmit",defaultValues:{currentPassword:"",newPassword:"",confirmPassword:""}}),g=m.useCallback(h=>{o(h,{onSuccess:()=>{f.success("Åifre baÅarıyla güncellendi"),s.reset(),r({to:"/app/ayarlar"})},onError:a=>{var d,u,p;const x=(d=a==null?void 0:a.error)==null?void 0:d.code,c=(((u=a==null?void 0:a.error)==null?void 0:u.message)||"").toLowerCase();if(x==="INVALID_CREDENTIALS"||c.includes("incorrect username or password")||c.includes("kullanıcı adı veya Åifre hatalı")){n(!0);return}f.error(((p=a.error)==null?void 0:p.message)||"Åifre güncellenemedi")}})},[o,s,r]);return e.jsxs(e.Fragment,{children:[e.jsx(L,{...s,children:e.jsx("form",{onSubmit:s.handleSubmit(g),className:"w-full",children:e.jsx(F,{title:"Åifreyi DeÄiÅtir",icon:P,children:e.jsxs("div",{className:"grid grid-cols-1 gap-4",children:[e.jsx(t,{type:"password",placeholder:"Mevcut Åifre",form:s,formKey:"currentPassword",label:"Mevcut Åifre",autoComplete:"current-password"}),e.jsx(t,{type:"password",placeholder:"Yeni Åifre",form:s,formKey:"newPassword",label:"Yeni Åifre",autoComplete:"new-password"}),e.jsx(t,{type:"password",placeholder:"Yeni Åifre Tekrar",form:s,formKey:"confirmPassword",label:"Yeni Åifre Tekrar",autoComplete:"new-password"}),e.jsxs("div",{className:"flex flex-wrap justify-end gap-2",children:[e.jsx(i,{type:"button",variant:"outline",onClick:()=>r({to:"/app/ayarlar"}),children:"Vazgeç"}),e.jsx(i,{type:"submit",disabled:l,children:l?"Güncelleniyor...":"Åifreyi Güncelle"})]})]})})})}),e.jsx(b,{open:w,onOpenChange:n,children:e.jsxs(D,{children:[e.jsxs(v,{children:[e.jsx(I,{children:"Mevcut Åifre yanlıÅ"}),e.jsx(S,{children:"GirdiÄiniz mevcut Åifre doÄru deÄil. Lütfen kontrol edip tekrar deneyin."})]}),e.jsx(k,{children:e.jsx(i,{onClick:()=>n(!1),children:"Tamam"})})]})})]})}const Y=function(){return e.jsx(E,{title:"Åifreyi DeÄiÅtir",routeId:"/_app/app/ayarlar/sifre",children:e.jsx(N,{})})};export{Y as component};
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.