1import{bE as y,bd as B,bF as q,bG as d,bH as O,bI as S,I as T,a9 as e,bJ as k,aV as v,aQ as j,ad as m,bK as F,aa as w,bL as x,ao as a,bM as A,bN as L,af as R,am as c,bO as U,ag as f,at as _,aC as D,ah as G,ap as z,bf as E,bP as H,aB as $,aH as V,bQ as M,bR as W,bS as X,bl as J,aG as K,ab as Q,aI as Y,aJ as I}from"./index-51c884ce.js";import{R as Z,a as C}from"./RHFSwitch-041b7db4.js";import{T as ee,a as ne}from"./Tabs-a3572c6d.js";import"./FormControlLabel-2367695d.js";function se(){const{enqueueSnackbar:i}=y(),{user:n}=B(),o=q().shape({displayName:d().required("Name is required"),email:d().required("Email is required").email("Email must be a valid email address"),photoURL:O().required("Avatar is required"),phoneNumber:d().required("Phone number is required"),country:d().required("Country is required"),address:d().required("Address is required"),state:d().required("State is required"),city:d().required("City is required"),zipCode:d().required("Zip code is required"),about:d().required("About is required")}),r={displayName:(n==null?void 0:n.displayName)||"",email:(n==null?void 0:n.email)||"",photoURL:(n==null?void 0:n.photoURL)||null,phoneNumber:(n==null?void 0:n.phoneNumber)||"",country:(n==null?void 0:n.country)||"",address:(n==null?void 0:n.address)||"",state:(n==null?void 0:n.state)||"",city:(n==null?void 0:n.city)||"",zipCode:(n==null?void 0:n.zipCode)||"",about:(n==null?void 0:n.about)||"",isPublic:(n==null?void 0:n.isPublic)||!1},s=S({resolver:L(o),defaultValues:r}),{setValue:u,handleSubmit:t,formState:{isSubmitting:l}}=s,h=async P=>{try{await new Promise(b=>setTimeout(b,500)),i("Update success!"),console.log("DATA",P)}catch(b){console.error(b)}},p=T.useCallback(P=>{const b=P[0],N=Object.assign(b,{preview:URL.createObjectURL(b)});b&&u("photoURL",N,{shouldValidate:!0})},[u]);return e.jsx(k,{methods:s,onSubmit:t(h),children:e.jsxs(v,{container:!0,spacing:3,children:[e.jsx(v,{item:!0,xs:12,md:4,children:e.jsx(j,{sx:{py:10,px:3,textAlign:"center"},children:e.jsx(Z,{name:"photoURL",maxSize:3145728,onDrop:p,helperText:e.jsxs(m,{variant:"caption",sx:{mt:2,mx:"auto",display:"block",textAlign:"center",color:"text.secondary"},children:["Äá»nh dạng *.jpeg, *.jpg, *.png, *.gif",e.jsx("br",{})," tá»i Äa ",F(3145728)]})})})}),e.jsx(v,{item:!0,xs:12,md:8,children:e.jsxs(j,{sx:{p:3},children:[e.jsxs(w,{rowGap:3,columnGap:2,display:"grid",gridTemplateColumns:{xs:"repeat(1, 1fr)",sm:"repeat(2, 1fr)"},children:[e.jsx(x,{name:"displayName",label:"Tên hiá»n thá»"}),e.jsx(x,{name:"email",label:"Äá»a chá» Email"}),e.jsx(x,{name:"phoneNumber",label:"Sá» Äiá»n thoại"}),e.jsx(x,{name:"address",label:"Äá»a chá»"})]}),e.jsxs(a,{spacing:3,alignItems:"flex-end",sx:{mt:3},children:[e.jsx(x,{name:"about",multiline:!0,rows:4,label:"Giá»i thiá»u"}),e.jsx(A,{type:"submit",variant:"contained",loading:l,children:"Lưu thay Äá»i"})]})]})})]})})}const ie=[{value:"facebookLink",icon:e.jsx(c,{icon:"eva:facebook-fill",width:24})},{value:"instagramLink",icon:e.jsx(c,{icon:"ant-design:instagram-filled",width:24})}];function ae({socialLinks:i}){const{enqueueSnackbar:n}=y(),o={facebookLink:i.facebookLink,instagramLink:i.instagramLink,linkedinLink:i.linkedinLink,twitterLink:i.twitterLink},r=S({defaultValues:o}),{handleSubmit:s,formState:{isSubmitting:u}}=r,t=async l=>{try{await new Promise(h=>setTimeout(h,500)),n("Update success!"),console.log("DATA",l)}catch(h){console.error(h)}};return e.jsx(k,{methods:r,onSubmit:s(t),children:e.jsx(j,{sx:{p:3},children:e.jsxs(a,{spacing:3,alignItems:"flex-end",children:[ie.map(l=>e.jsx(x,{name:l.value,InputProps:{startAdornment:e.jsx(R,{position:"start",children:l.icon})}},l.value)),e.jsx(A,{type:"submit",variant:"contained",loading:u,children:"Save Changes"})]})})})}const te=[{value:"activityComments",label:"Gá»i thông báo qua email khi có ai Äó bình luáºn vá» bà i viết cá»§a tôi"},{value:"activityAnswers",label:"Gá»i thông báo qua email khi có ai Äó trả lá»i bình luáºn cá»§a tôi"}],oe=[{value:"applicationNews",label:"Tin tức và thông báo"},{value:"applicationProduct",label:"Tà i liá»u và sản phẩm má»i"}],g={activityComments:!0,activityAnswers:!0,activityFollows:!1,applicationNews:!0,applicationProduct:!1,applicationBlog:!1};function re(){const{enqueueSnackbar:i}=y(),n={activityComments:g.activityComments,activityAnswers:g.activityAnswers,activityFollows:g.activityFollows,applicationNews:g.applicationNews,applicationProduct:g.applicationProduct,applicationBlog:g.applicationBlog},o=S({defaultValues:n}),{handleSubmit:r,formState:{isSubmitting:s}}=o,u=async t=>{try{await new Promise(l=>setTimeout(l,500)),i("Update success!"),console.log("DATA",t)}catch(l){console.error(l)}};return e.jsx(k,{methods:o,onSubmit:r(u),children:e.jsxs(j,{sx:{p:3},children:[e.jsx(m,{variant:"overline",component:"div",sx:{color:"text.secondary"},children:"Hoạt Äá»ng"}),e.jsx(a,{alignItems:"flex-start",spacing:1,sx:{mt:2},children:te.map(t=>e.jsx(C,{name:t.value,label:t.label,sx:{m:0}},t.value))}),e.jsx(m,{variant:"overline",component:"div",sx:{color:"text.secondary",mt:5},children:"Ứng dụng"}),e.jsx(a,{alignItems:"flex-start",spacing:1,sx:{mt:2,mb:5},children:oe.map(t=>e.jsx(C,{name:t.value,label:t.label,sx:{m:0}},t.value))}),e.jsx(a,{children:e.jsx(A,{type:"submit",variant:"contained",loading:s,sx:{ml:"auto"},children:"Lưu thay Äá»i"})})]})})}function ce(){const{enqueueSnackbar:i}=y(),n=q().shape({oldPassword:d().required("Old Password is required"),newPassword:d().required("New Password is required").min(6,"Password must be at least 6 characters").test("no-match","New password must be different than old password",(h,{parent:p})=>h!==p.oldPassword),confirmNewPassword:d().oneOf([U("newPassword")],"Passwords must match")}),o={oldPassword:"",newPassword:"",confirmNewPassword:""},r=S({resolver:L(n),defaultValues:o}),{reset:s,handleSubmit:u,formState:{isSubmitting:t}}=r,l=async h=>{try{await new Promise(p=>setTimeout(p,500)),s(),i("Update success!"),console.log("DATA",h)}catch(p){console.error(p)}};return e.jsx(k,{methods:r,onSubmit:u(l),children:e.jsx(j,{children:e.jsxs(a,{spacing:3,alignItems:"flex-end",sx:{p:3},children:[e.jsx(x,{name:"oldPassword",type:"password",label:"Máºt khẩu cÅ©"}),e.jsx(x,{name:"newPassword",type:"password",label:"Máºt khẩu má»i",helperText:e.jsxs(a,{component:"span",direction:"row",alignItems:"center",children:[e.jsx(c,{icon:"eva:info-fill",width:16,sx:{mr:.5}})," Máºt khẩu phải có Ãt nhất 6 ký tá»±"]})}),e.jsx(x,{name:"confirmNewPassword",type:"password",label:"Xác nháºn máºt khẩu má»i"}),e.jsx(A,{type:"submit",variant:"contained",loading:t,children:"Lưu thay Äá»i"})]})})})}function le({addressBook:i}){return e.jsxs(j,{sx:{p:3},children:[e.jsxs(a,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{mb:3},children:[e.jsx(m,{variant:"overline",sx:{color:"text.secondary"},children:"Thông tin thanh toán"}),e.jsx(f,{size:"small",startIcon:e.jsx(c,{icon:"eva:plus-fill"}),children:"Äá»a chá» má»i"})]}),e.jsx(a,{spacing:3,divider:e.jsx(_,{sx:{borderStyle:"dashed"}}),children:i.map(n=>e.jsxs(a,{spacing:1,children:[e.jsx(m,{variant:"subtitle1",children:n.name}),e.jsxs(m,{variant:"body2",children:[e.jsx(w,{component:"span",sx:{color:"text.secondary",mr:.5},children:"Äá»a chá»:"}),`${n.street}, ${n.city}, ${n.state}, ${n.country} ${n.zipCode}`]}),e.jsxs(m,{variant:"body2",children:[e.jsx(w,{component:"span",sx:{color:"text.secondary",mr:.5},children:"Sá» Äiá»n thoại:"}),n.phone]}),e.jsxs(a,{direction:"row",spacing:1,children:[e.jsx(f,{color:"error",size:"small",startIcon:e.jsx(c,{icon:"eva:tras
1h-2-outline"}),children:"Xóa"}),e.jsx(f,{size:"small",startIcon:e.jsx(c,{icon:"eva:edit-fill"}),children:"Sá»a"})]})]},n.id))})]})}function de({cards:i}){const[n,o]=T.useState(!1),r=()=>{o(!0)};return e.jsx(e.Fragment,{children:e.jsxs(j,{sx:{p:3},children:[e.jsxs(a,{direction:"row",alignItems:"center",sx:{mb:3},children:[e.jsx(m,{variant:"overline",sx:{flexGrow:1,color:"text.secondary"},children:"Phương thức thanh toán"}),e.jsx(f,{size:"small",startIcon:e.jsx(c,{icon:"eva:plus-fill"}),onClick:r,children:"Thêm thẻ"})]}),e.jsx(a,{spacing:2,direction:{xs:"column",md:"row"},children:i.map(s=>e.jsxs(D,{variant:"outlined",sx:{p:3,width:1,position:"relative"},children:[e.jsx(G,{alt:"icon",src:s.cardType==="master_card"?"/assets/icons/payments/ic_mastercard.svg":"/assets/icons/payments/ic_visa.svg",sx:{mb:1,maxWidth:36}}),e.jsx(m,{variant:"subtitle2",children:s.cardNumber}),e.jsx(z,{sx:{top:8,right:8,position:"absolute"},children:e.jsx(c,{icon:"eva:more-vertical-fill"})})]},s.id))})]})})}function me({invoices:i}){return e.jsxs(a,{spacing:3,alignItems:"flex-end",children:[e.jsx(m,{variant:"overline",sx:{width:1,color:"text.secondary"},children:"Lá»ch sá» hóa ÄÆ¡n"}),e.jsx(a,{spacing:2,sx:{width:1},children:i.map(n=>e.jsxs(a,{direction:"row",justifyContent:"space-between",sx:{width:1},children:[e.jsx(m,{variant:"body2",sx:{minWidth:120},children:E(n.createdAt)}),e.jsx(m,{variant:"body2",children:H(n.price)}),e.jsx($,{children:"PDF"})]},n.id))}),e.jsx(f,{size:"small",color:"inherit",endIcon:e.jsx(c,{icon:"eva:arrow-ios-forward-fill"}),children:"Xem tất cả"})]})}function ue({cards:i,addressBook:n,invoices:o}){return e.jsxs(v,{container:!0,spacing:5,children:[e.jsx(v,{item:!0,xs:12,md:8,children:e.jsxs(a,{spacing:3,children:[e.jsx(de,{cards:i}),e.jsx(le,{addressBook:n})]})}),e.jsx(v,{item:!0,xs:12,md:4,children:e.jsx(me,{invoices:o})})]})}function je(){const{themeStretch:i}=V(),[n,o]=T.useState("general"),r=[{value:"general",label:"Thông tin",icon:e.jsx(c,{icon:"ic:round-account-box"}),component:e.jsx(se,{})},{value:"billing",label:"Thanh toán",icon:e.jsx(c,{icon:"ic:round-receipt"}),component:e.jsx(ue,{cards:M,addressBook:W,invoices:X})},{value:"notifications",label:"Thông báo",icon:e.jsx(c,{icon:"eva:bell-fill"}),component:e.jsx(re,{})},{value:"social_links",label:"Liên kết",icon:e.jsx(c,{icon:"eva:share-fill"}),component:e.jsx(ae,{socialLinks:J.socialLinks})},{value:"change_password",label:"Äá»i máºt khẩu",icon:e.jsx(c,{icon:"ic:round-vpn-key"}),component:e.jsx(ce,{})}];return e.jsxs(e.Fragment,{children:[e.jsx(K,{children:e.jsx("title",{children:"Tà i khoản | E-Learning"})}),e.jsxs(Q,{maxWidth:i?!1:"lg",children:[e.jsx(Y,{heading:"Tà i khoản",links:[{name:"E-Learning",href:I.root},{name:"Tà i khoản",href:I.user.profile}]}),e.jsx(ee,{value:n,onChange:(s,u)=>o(u),children:r.map(s=>e.jsx(ne,{label:s.label,icon:s.icon,value:s.value},s.value))}),r.map(s=>s.value===n&&e.jsx(w,{sx:{mt:5},children:s.component},s.value))]})]})}export{je 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.