1import{A as L,L as M,o as Z,Q as a,j as r,H as K,C as H,I as j,O as N}from"./index-DsYSds65.js";import{u as V,e as _}from"./redux-vendor-suI1nlIx.js";import{u as J,r as i}from"./react-vendor-oJ9U2YUK.js";import{d as t}from"./tcmb-ui-vendor-CLb453uN.js";import{l as b,a as Q}from"./utils-vendor-C91ez9Vp.js";import{F as G}from"./index-r1jAn9hm.js";import{s as W,g as X,f as Y,u as ee,a as k}from"./slice-Bd1A7N80.js";import{u as re}from"./i18n-vendor-Xs3k-ARc.js";import"./semantic-ui-vendor-DvbcPwbN.js";import"./date-vendor-B3MxfCH0.js";import"./file-vendor-CPfkGAkk.js";import"./charts-vendor-CjfLd3I7.js";function fe(){const m=V(),{userDetailsData:o,userDetailsLoading:F}=_(W),l=J(),{userDetails:x,setUserDetails:U}=i.useContext(L),{currLanguage:u}=i.useContext(M),{t:s}=re(),{onSessionEnded:d}=Z("/anasayfa"),[p,C]=i.useState(0),[f,z]=i.useState({icon:"eye",type:"password"}),[g,D]=i.useState({icon:"eye",type:"password"}),[E,w]=i.useState(!1),A=async()=>{try{if(navigator.clipboard&&navigator.clipboard.writeText){await navigator.clipboard.writeText(o.apiKey),a.success(s("myprofile.form.api.key.success"));return}}catch{}try{const e=document.createElement("textarea");e.value=o.apiKey,e.style.position="fixed",e.style.left="-999999px",e.style.top="-999999px",document.body.appendChild(e),e.focus(),e.select();const n=document.execCommand("copy");document.body.removeChild(e),n?a.success(s("myprofile.form.api.key.success")):a.error(s("myprofile.form.api.key.error"))}catch{a.error(s("myprofile.form.api.key.error"))}},S=()=>{m(X(u)).unwrap().then(e=>{C(p+1),e.responseCode===j?a.success(e.responseMessage):(a.error(e.responseMessage),e.responseCode===N&&d())}).catch(e=>{a.error(`${s("signUpForm.signUpError")} ${e.message}`),setTimeout(()=>{l("/login",{replace:!0})},1e3)})},T=()=>{m(Y(u)).unwrap().then(e=>{C(p+1),e.responseCode===j?(a.success(e.responseMessage),d()):(a.error(e.responseMessage),e.responseCode===N&&d())}).catch(e=>{a.error(`${s("signUpForm.signUpError")} ${e.message}`),setTimeout(()=>{l("/anasayfa",{replace:!0})},1e3)}),w(!1)},O=async(e,n)=>{if(!o.userInputCaptcha||o.userInputCaptcha.trim().length===0){a.error(s("security.code.error"));return}if(!n.validateForm()){const v={userName:o.userName,email:o.email,firstName:o.firstName,lastName:o.lastName,passwordChanged:o.passwordChanged,userPassword:o.userPasswordNew,userInputCaptcha:o.userInputCaptcha,captchaVerifier:o.captchaVerifier,apiKey:o.apiKey,lang:u};m(ee(v)).unwrap().then(c=>{if(C(p+1),c.responseCode===j){a.success(c.responseMessage);const y={...x};y.firstName=o.firstName,y.lastName=o.lastName,Q.set("userDetails",JSON.stringify(y)),U(y)}else a.error(c.responseMessage),c.responseCode===N&&d()}).catch(c=>{a.error(`${s("signUpForm.signUpError")} ${c.message}`),setTimeout(()=>{l("/login",{replace:!0})},1e3)})}},R=(e,n)=>{m(k({...o,captchaVerifier:n,userInputCaptcha:e}))},I=(e,n)=>{m(k({...o,[e]:n}))},P=(e,{id:n})=>{n==="newPwd"&&z({icon:f.icon==="eye"?"eye slash":"eye",type:f.type==="password"?"text":"password"}),n==="newPwdRe"&&D({icon:g.icon==="eye"?"eye slash":"eye",type:g.type==="password"?"text":"password"})},h=(e,{name:n,value:v})=>{I(n,v)},$=()=>{I("passwordChanged",!o.passwordChanged)};i.useEffect(()=>{x?S():(a.warning(`${s("page.view.must.be.logged.in")}`),setTimeout(()=>{l("/login",{replace:!0})},500))},[u]);const q=e=>{e.preventDefault(),w(!0)},B=e=>{e.preventDefault(),l("/iletisim",{state:{userDetailsData:o}})};return r.jsx("div",{children:x&&r.jsxs(t.Dimmer.Dimmable,{blurring:F,children:[r.jsx(t.Dimmer,{active:F,children:r.jsx(t.Loader,{children:s("evds3.yukleniyor")})}),r.jsx(K,{children:r.jsx("title",{children:s("evds3.profil")})}),r.jsx(t.Container,{fluid:!0,children:r.jsx("div",{className:"form-container",children:r.jsxs(t.Form,{size:"large",onSubmit:O,id:"profileForm",className:"custom-form",children:[r.jsx(G,{textTop:s("myprofile.form.header")}),r.jsx(t.Form.Input,{fluid:!0,name:"firstName",icon:r.jsx(t.Icon,{name:"user circle",color:"grey"}),iconPosition:"left",placeholder:s("signUpForm.name"),value:o.firstName,validation:{rules:[{type:"required",trim:!0,message:s("form.validation.required")},{type:"length",max:25,trim:!0,message:s("contact.form.length.validation",{uzunluk:25})}],validateOnChange:!0},onChange:h}
1),r.jsx(t.Form.Input,{fluid:!0,name:"lastName",icon:r.jsx(t.Icon,{name:"user circle",color:"grey"}),iconPosition:"left",placeholder:s("signUpForm.surname"),value:o.lastName,validation:{rules:[{type:"required",trim:!0,message:s("form.validation.required")},{type:"length",max:25,trim:!0,message:s("contact.form.length.validation",{uzunluk:25})}],validateOnChange:!0},onChange:h}),r.jsx(t.Form.Input,{fluid:!0,icon:r.jsx(t.Icon,{name:"mail",color:"grey"}),iconPosition:"left",name:"email",placeholder:s("signUpForm.email"),value:o.email,readOnly:!0}),r.jsx(t.Form.Input,{fluid:!0,icon:r.jsx(t.Icon,{name:"user",color:"grey"}),iconPosition:"left",name:"userName",placeholder:s("signUpForm.username"),value:o.userName,readOnly:!0}),r.jsx(t.Form.Field,{children:r.jsx(t.Toggle,{name:"passwordChanged",label:s("myprofile.form.change.pwd"),checked:o.passwordChanged,onChange:$})}),o.passwordChanged&&r.jsxs(r.Fragment,{children:[r.jsxs(t.Form.Input,{name:"userPasswordNew",placeholder:s("signUpForm.password"),iconPosition:"left",type:f.type,value:o.userPasswordNew,onChange:h,validation:{validateOnChange:!0,rules:[{type:"regex",expression:/^(?=.*[a-zÅıiçöüÄ])(?=.*[A-ZZÅIİÃÃÃÄ])(?=.*\d)[A-Za-zÅÅıİçÃöÃüÃÄÄ\d@.#$!%*?&]{8,20}$/,message:s("signUpForm.passwordRegexError")},{type:"required",trim:!0,message:s("form.validation.required")}]},children:[r.jsx(t.Icon,{name:"lock",color:"grey"}),r.jsx("input",{}),r.jsx(t.Icon,{id:"newPwd",link:!0,color:"grey",name:f.icon,onClick:P,className:"right-icon"})]}),r.jsxs(t.Form.Input,{name:"userPasswordNewRe",placeholder:s("signUpForm.password.repeat"),iconPosition:"left",type:g.type,value:o.userPasswordNewRe,onChange:h,validation:{validateOnChange:!0,rules:[{type:"regex",expression:/^(?=.*[a-zÅıiçöüÄ])(?=.*[A-ZZÅIİÃÃÃÄ])(?=.*\d)[A-Za-zÅÅıİçÃöÃüÃÄÄ\d@.#$!%*?&]{8,20}$/,message:s("signUpForm.passwordRegexError")},{type:"required",trim:!0,message:s("form.validation.required")},{type:"custom",method:e=>!(!b.isEmpty(e)&&e!==o.userPasswordNew),message:s("form.validation.not.match")}]},children:[r.jsx(t.Icon,{name:"lock",color:"grey"}),r.jsx("input",{}),r.jsx(t.Icon,{id:"newPwdRe",link:!0,color:"grey",name:g.icon,onClick:P,className:"right-icon"})]})]}),r.jsx(H,{onChange:R},p),r.jsx("center",{children:r.jsxs("div",{className:"profile-form-btn-container",children:[r.jsx(t.Button,{disabled:b.isEmpty(o.userInputCaptcha),form:"profileForm",className:"custom-btn",type:"submit",children:s("myprofile.form.button")}),r.jsx(t.Button,{className:"custom-btn",content:s("myprofile.form.api.key.btn"),onClick:e=>{e.preventDefault(),A()}}),r.jsx(t.Button,{className:"custom-btn",content:s("myprofile.form.freeze.btn"),onClick:q}),r.jsx(t.Button,{className:"custom-btn",content:s("myprofile.form.cancel.btn"),onClick:B})]})})]},p)})}),r.jsx(t.Confirm,{open:E,className:"custom-confirm",size:"mini",header:s("myprofile.form.freeze.btn"),content:s("myprofile.form.freeze.confirm"),cancelButton:s("myprofile.form.freeze.no"),confirmButton:s("myprofile.form.freeze.yes"),onCancel:()=>w(!1),onConfirm:()=>T()})]})})}export{fe 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.