PageSourceSearch

https://horystech.com/_next/static/chunks/pages/profile-e2617c91fb47c4f9.js

js horystech.com collected 2026-10-04 05:07:34 UTC 15,852 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[277],{99813:function(e,a,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/profile",function(){return s(84118)}])},6839:function(e,a,s){"use strict";s.d(a,{Z:function(){return Sidebar}});var l,r,n,i=s(74817),t=s(71248),d=s(36497),o=s(46670),c=s(71412),m=s(97303),u=s(98973),h=s(70332),v=s(26734),x=s(12419);function _extends(){return(_extends=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var s=arguments[a];for(var l in s)({}).hasOwnProperty.call(s,l)&&(e[l]=s[l])}return e}).apply(null,arguments)}var digitalpayments=function(e){return t.createElement("svg",_extends({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},e),l||(l=t.createElement("path",{fill:"#79879A",d:"M22.849 8.625 10.125 1.399a1.69 1.69 0 0 0-2.302.633l-.582 1.04a.47.47 0 0 0 .177.637l14.83 8.441a.47.47 0 0 0 .638-.176l.593-1.039a1.69 1.69 0 0 0-.63-2.31m-.184 1.841-.375.634L8.288 3.127l.375-.633a.75.75 0 0 1 1.012-.282l12.709 7.234a.75.75 0 0 1 .281 1.028zm-.772 2.314L7.06 4.335a.47.47 0 0 0-.637.176L4.21 8.392a1.69 1.69 0 0 0 .634 2.303l1.08.615a.468.468 0 0 0 .45-.81l-1.08-.615a.75.75 0 0 1-.281-1.024l1.98-3.476 14.025 7.976-1.793 3.139a.468.468 0 1 0 .814.465l2.029-3.562a.47.47 0 0 0-.176-.623"})),r||(r=t.createElement("path",{fill:"#79879A",d:"M16.613 12.12H1.988A1.69 1.69 0 0 0 .3 13.811v7.324a1.69 1.69 0 0 0 1.688 1.691h14.625a1.69 1.69 0 0 0 1.687-1.691v-7.324a1.69 1.69 0 0 0-1.687-1.691m.75 9a.75.75 0 0 1-.75.75H1.988a.75.75 0 0 1-.75-.75v-7.309a.75.75 0 0 1 .75-.75h14.625a.75.75 0 0 1 .75.75z"})),n||(n=t.createElement("path",{fill:"#79879A",d:"M16.388 18.885h-1.905a.469.469 0 0 0 0 .938h1.905a.469.469 0 0 0 0-.938m-11.888 0H2.588a.469.469 0 0 0 0 .938H4.5a.469.469 0 0 0 0-.938m-.109-3.765h-1.5a1.125 1.125 0 0 0-1.125 1.125v.645a1.125 1.125 0 0 0 1.125 1.125h1.5a1.125 1.125 0 0 0 1.125-1.125v-.637a1.124 1.124 0 0 0-1.125-1.133m.195 1.778a.195.195 0 0 1-.195.195h-1.5a.195.195 0 0 1-.195-.195v-.645a.195.195 0 0 1 .195-.195h1.5a.195.195 0 0 1 .195.195zm3.994 1.987H6.304a.469.469 0 0 0 0 .938h2.28a.469.469 0 0 0 0-.938zm4.091 0h-2.28a.469.469 0 1 0 0 .938h2.28a.469.469 0 0 0 0-.938"})))},p=s(21110),f=s.n(p),j=s(37518),N=s.n(j),w=s(556),g=s(33878);function Sidebar(){let e=(0,d.useRouter)(),{t:a}=useTranslation("common"),s=(0,w.E)();return(0,g.b)(),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:f().wrapTitle,children:(0,i.jsx)(o.Z,{variant:"h4",children:a("My-Account")})}),(0,i.jsxs)("div",{className:f().sideBar,children:[(0,i.jsxs)("div",{className:f().userName,children:[(0,i.jsx)(o.Z,{variant:"h6",children:a("Welcome")}),(0,i.jsx)(o.Z,{variant:"h4",className:"text-capitalize text-ellipsis",children:null==s?void 0:s.connectedUserName}),(0,i.jsx)("p",{className:"text-ellipsis",children:(0,i.jsx)(N(),{href:"#",children:null==s?void 0:s.connectedUserEmail})})]}),(0,i.jsx)(o.Z,{variant:"h5",className:f().listTitle,children:a("Navigation")}),(0,i.jsxs)(c.Z,{className:f().sideBarList,children:[(0,i.jsx)(m.ZP,{className:"/wishlist"==e.pathname?f().active:"",children:(0,i.jsx)(N(),{href:"/wishlist",children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(u.Z,{}),a("Wishlist")]})})}),(0,i.jsx)(m.ZP,{className:"/trackorder"==e.pathname?f().active:"",children:(0,i.jsx)(N(),{href:"/trackorder",children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(v.Z,{}),a("Track-Order")]})})}),(0,i.jsx)(m.ZP,{className:"/addresses"==e.pathname?f().active:"",children:(0,i.jsx)(N(),{href:"/addresses",children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(h.Z,{}),a("Addresses")]})})}),(0,i.jsx)(m.ZP,{className:"/payments"==e.pathname?f().active:"",children:(0,i.jsx)(N(),{href:"/payments",children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(digitalpayments,{}),a("Payments")]})})})]}),(0,i.jsx)(o.Z,{variant:"h5",className:f().listTitle,children:a("Settings")}),(0,i.jsx)(c.Z,{children:(0,i.jsx)(m.ZP,{className:"/profile"==e.pathname?f().active:"",children:(0,i.jsx)(N(),{href:"/profile",children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(x.Z,{}),a("Profile")]})})})})]})]})}},84118:function(e,a,s){"use strict";s.r(a),s.d(a,{__N_SSG:function(){return L},default:function(){return Profile}});var l=s(74817),r=s(71248),n=s(23087),i=s(83693),t=s(6839),d=s(19598),o=s(56481),c=s(46670),m=s(55007),u=s(26600),h=s(5030),v=s(2451),x=s(21110),p=s.n(x),f=s(76975),j=s(51711),N=s(66741),w=s(67833),g=s(36497),b=s(96398),y=s(20891),Z=s(34982);let updateUserProfile=async e=>{try{let a=await Z.y.generateHashKey(JSON.stringify(e));
1return Z.y.PutRequest(y.mG+"/api/v1/update-profile",a)}catch(e){return null}};var P=s(96100),C=s(33878),E=s(556),S=s(73066),_=s(31456),L=!0;function Profile(){var e,a,s,x;let y=(0,g.useRouter)(),{locale:Z}=y,{t:L}=(0,w.Z)("profile"),k=(0,f.Z)({typography:{fontFamily:"Work Sans"}}),U=P.Ew,[A,F]=r.useState(),[I,T]=r.useState("+971"),[B,O]=r.useState(9),[H,q]=r.useState(""),[z,G]=r.useState(""),[M,$]=r.useState(""),[R,W]=r.useState(""),[K,X]=r.useState(!0),Y=(0,E.E)(),D=(0,C.b)();r.useEffect(()=>{var e,a,s,l,r;q(null===(e=Y.connectedUser)||void 0===e?void 0:e.firstName),G(null===(a=Y.connectedUser)||void 0===a?void 0:a.lastName),$(null!==(r=null===(s=Y.connectedUser)||void 0===s?void 0:s.mobileNumber)&&void 0!==r?r:0),W(null===(l=Y.connectedUser)||void 0===l?void 0:l.email)},[Y.connectedUser]);let proceedUpdateProfile=async e=>{var a,s,l,r,n,i;e.preventDefault();let t=e.target,d={email:!0,firstName:!0,countryCode:!0,lastName:!0,mobileNumber:!0,prefferredLanguage:!0,oldPassword:!0,newPassword:!0,confirm_password:!0};if(d.firstName=""!=(0,b.tp)(t[0].value),d.lastName=""!=(0,b.tp)(t[1].value),d.email=!!(0,b.oH)(null!==(s=t[2].value)&&void 0!==s?s:""),d.mobileNumber=""!=t[5].value,d.oldPassword=""!=t[8].value,(null===(a=Y.connectedUser)||void 0===a?void 0:a.firstTimePassword)?d.oldPassword=!0:d.oldPassword=!!(0,b.uo)(t[8].value),null!=t[9].value&&t[9].value.length>0&&(d.newPassword=(null===(l=t[9])||void 0===l?void 0:l.value)!="",d.newPassword=!!(0,b.uo)(t[9].value),d.confirm_password=t[9].value==t[10].value),t[5].value.length<B&&(d.mobileNumber=!1),F(d),!d.email||!d.oldPassword||!d.newPassword||!d.confirm_password||!d.firstName||!d.mobileNumber||!d.firstName)return!1;try{D.setGlobalLoading(!0);let e=await updateUserProfile({firstName:(0,b.tp)(t[0].value),lastName:(0,b.tp)(t[1].value),email:t[2].value,countryCode:I,mobileNumber:parseInt(t[5].value),prefferredLanguage:null!==(r=y.locale)&&void 0!==r?r:"en",oldPassword:t[8].value,newPassword:t[9].value,confirm_password:t[10].value});e&&D.setAlertProps({show:!0,title:"Your account has been updated successfully",text:"",toast:!0,showConfirmButton:!1,timerProgressBar:!0,callback:D.closeAlert}),await Y.checkUserSession(),D.setGlobalLoading(!1)}catch(a){let e=null==a?void 0:null===(i=a.response)||void 0===i?void 0:null===(n=i.data)||void 0===n?void 0:n.message.replace("\n","").replace("[","").replace("]","").replace("{","").replace("}","");D.setAlertProps({show:!0,title:e,text:"",toast:!0,showConfirmButton:!1,background:"#8B0000",timer:6e3,timerProgressBar:!0,callback:D.closeAlert}),D.setGlobalLoading(!1)}},getCountryCode=e=>{var a,s;let l=null!==(a=(0,P.S7)(e))&&void 0!==a?a:"+971";T(l);let r=null!==(s=(0,P.Lx)(e))&&void 0!==s?s:8;O(r)};return(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(j.Z,{theme:k,children:(0,l.jsxs)("main",{className:p().main,children:[(0,l.jsx)(n.Z,{title:L("header1")}),(0,l.jsx)("div",{className:p().paddingTB60,children:(0,l.jsx)(d.Z,{className:p().containerBox,children:(0,l.jsxs)(o.ZP,{container:!0,spacing:3,children:[(0,l.jsx)(o.ZP,{item:!0,md:3,xs:12,className:p().sidebarGrid,children:(0,l.jsx)(t.Z,{})}),(0,l.jsxs)(o.ZP,{item:!0,md:9,xs:12,children:[(0,l.jsx)("div",{className:p().wrapTitle,children:(0,l.jsx)(c.Z,{variant:"h4",children:L("header1")})}),(0,l.jsx)("div",{className:"".concat(p().wrapBox," ").concat(p().profileSec),children:(0,l.jsxs)("form",{method:"post",onSubmit:e=>proceedUpdateProfile(e),children:[(0,l.jsxs)("div",{className:p().boxInfo,children:[(0,l.jsx)("div",{className:p().wrapSubTitle,children:(0,l.jsx)(c.Z,{variant:"h4",children:L("subheader1")})}),(0,l.jsxs)("div",{className:p().boxInfoBody,children:[(0,l.jsxs)("div",{className:p().inline,children:[(0,l.jsxs)("div",{className:p().formControl,children:[(0,l.jsxs)("label",{className:p().formLabel,children:[" ",L("First-name")," ",(0,l.jsx)("span",{className:"text-danger",children:"*"})]}),(0,l.jsx)(u.Z,{type:"text",className:p().formInput,value:H,onChange:e=>q(e.target.value),placeholder:L("First-name")})]}),(0,l.jsxs)("div",{className:p().formControl,children:[(0,l.jsxs)("label",{className:p().formLabel,children:[" ",L("Last-name")," ",(0,l.jsx)("span",{className:"text-danger",children:"*"})]}),(0,l.jsx)(u.Z,{type:"text",className:p().formInput,value:z,onChange:e=>G(e.target.value),placeholder:L("Last-name")})]})]}),(0,l.jsxs)("div",{className:p().inline,children:[(0,l.jsx)("div",{className:p().formControl,children:(0,l.jsx)("span",{className:"alert-field",children:A&&!A.firstName&&(0,l.jsx)(N.Z,{severity:"error",children:L("required-field-error")})})}),(0,l.jsx)("div",{className:p().formControl,children:(0,l.jsx)("span",{className:"alert-field",children:A&&!A.lastName&&(0,l.jsx)(N.Z,{severity:"error",children:L("required-field-error")})})})]}),(0,l.jsxs)("div",{className:p().inline,children:[(0,l.jsxs)("div",{className:p().formControl,children:[(0,l.jsxs)("label",{className:p().formLabel,children:[" ",L("Email-Address")," ",(0,l.jsx)("span",{className:"text-danger",children:"*"})]}),(0,l.jsx)(u.Z,{type:"email",className:p().formInput,value:R,onChange:e=>W(e.target.value),placeholder:L("Email-Address")})]}),(0,l.jsxs)("div",{className:"".concat(p().formControl," country-code-field"),children:[(0,l.jsxs)("label",{className:p().formLabel,children:[" ",(0,l.jsx)("p",{className:"label-text",children:L("country-code")})," ",(0,l.jsx)("span",{className:"text-danger",children:"*"})]}),(0,l.jsx)(h.Z,{className:p().formTextField,id:"filled-select-country-code",select:!0,defaultValue:null!==(x=(0,P.GY)(null!==(s=null===(e=Y.connectedUser)||void 0===e?void 0:e.countryCode)&&void 0!==s?s:""))&&void 0!==x?x:"United Arab Emirates",variant:"outlined",onChange:e=>{getCountryCode(e.target.value)},children:(0,P.KS)(S.a).map((e,a)=>{var s,r,n,i;return(0,l.jsxs)(v.Z,{className:"countries-menu-item",value:null==e?void 0:null===(s=e.name)||void 0===s?void 0:s.common,children:[(0,l.jsx)("img",{src:null==e?void 0:null===(r=e.flags)||void 0===r?void 0:r.png,className:"country-flag",style:{float:"left"}})," ","\xa0",(0,l.jsxs)("span",{className:"badge",style:{width:"60px"},children:["(",(0,P.S7)(null==e?void 0:null===(n=e.name)||void 0===n?void 0:n.common),")"]})," ",null==e?void 0:null===(i=e.name)||void 0===i?void 0:i.common]},a)})})]}),(0,l.jsxs)("div",{className:p().formControl,children:[(0,l.jsxs)("label",{className:p().formLabel,children:[" ",L("Mobile-Number")," ",(0,l.jsx)("span",{className:"text-danger",children:"*"})]}),(0,l.jsx)(u.Z,{className:p().formInput,value:M,onChange:e=>$(e.target.value),type:"number"})]})]}),(0,l.jsxs)("div",{className:p().inline,children:[(0,l.jsx)("div",{className:p().formControl,children:(0,l.jsx)("span",{className:"alert-field",children:A&&!A.email&&(0,l.jsx)(N.Z,{style:{textAlign:"left"},severity:"error",children:L("email-error")})})}),(0,l.jsx)("div",{className:p().formControl,children:(0,l.jsx)("span",{className:"alert-field",children:A&&!A.mobileNumber&&(0,l.jsxs)(N.Z,{severity:"error",children:[L("required-field-error")," (Min Lenght: ",B,")"]})})})]}),(0,l.jsxs)("div",{className:p().formControl,children:[(0,l.jsxs)("label",{className:p().formLabel,children:[" ",L("Preferred-language")," "]}),(0,l.jsx)(h.Z,{className:p().formTextField,id:"filled-select-currency",select:!0,value:null!=Z?Z:null===(a=Y.connectedUser)||void 0===a?void 0:a.preferredLanguage,variant:"outlined",disabled:!0,onChange:e=>y.push("/profile","",{locale:e.target.value}),children:U.map(e=>(0,l.jsx)(v.Z,{value:e.value,children:e.label},e.value))})]})]})]}),(0,l.jsxs)("div",{className:p().boxInfo,children:[(0,l.jsx)("div",{className:p().wrapSubTitle,children:(0,l.jsx)(c.Z,{variant:"h4",children:L("Security")})}),(0,l.jsxs)("div",{className:p().boxInfoBody,children:[(0,l.jsxs)("div",{className:"".concat(p().formControl," position-relative"),children:[(0,l.jsxs)("label",{className:p().formLabel,children:[" ",L("Old-Password")," "]}),(0,l.jsx)(u.Z,{type:"".concat(K?"password":"text"),className:p().formInput,placeholder:L("Enter-Old-Password")}),(0,l.jsx)("span",{className:"passwordEye",onClick:e=>X(!K),children:K?(0,l.jsx)(_.tgn,{}):(0,l.jsx)(_.dSq,{})})]}),A&&!A.oldPassword&&(0,l.jsxs)(N.Z,{severity:"error",children:[L("password-error1"),(0,l.jsx)("br",{}),L("password-error2")]}),(0,l.jsxs)("div",{className:p().inline,children:[(0,l.jsxs)("div",{className:"".concat(p().formControl," position-relative"),children:[(0,l.jsxs)("label",{className:p().formLabel,children:[" ",L("New-Password")," "]}),(0,l.jsx)(u.Z,{type:"".concat(K?"password":"text"),className:p().formInput,placeholder:L("Enter-New-Password")}),(0,l.jsx)("span",{className:"passwordEye",onClick:e=>X(!K),children:K?(0,l.jsx)(_.tgn,{}):(0,l.jsx)(_.dSq,{})})]}),(0,l.jsxs)("div",{className:"".concat(p().formControl," position-relative"),children:[(0,l.jsxs)("label",{className:p().formLabel,children:[" ",L("Confirm-Password")," "]}),(0,l.jsx)(u.Z,{type:"".concat(K?"password":"text"),className:p().formInput,placeholder:L("Enter-New-Password")}),(0,l.jsx)("span",{className:"passwordEye",onClick:e=>X(!K),children:K?(0,l.jsx)(_.tgn,{}):(0,l.jsx)(_.dSq,{})})]})]}),(0,l.jsxs)("div",{className:p().inline,children:[(0,l.jsx)("div",{className:p().formControl,children:(0,l.jsx)("span",{className:"alert-field",children:A&&!A.newPassword&&(0,l.jsxs)(N.Z,{severity:"error",children:[L("password-error1"),(0,l.jsx)("br",{}),L("password-error2")]})})}),(0,l.jsx)("div",{className:p().formControl,children:(0,l.jsx)("span",{className:"alert-field",children:A&&!A.confirm_password&&(0,l.jsx)(N.Z,{severity:"error",children:L("confirm-password-error")})})})]})]})]}),(0,l.jsxs)(m.Z,{type:"submit",variant:"contained",className:"".concat(p().btn," ").concat(p().btn_primary),children:[" ",L("update-btn")," "]})]})})]})]})})}),(0,l.jsx)(i.Z,{})]})})})}},96398:function(e,a,s){"use strict";s.d(a,{mO:function(){return signUpCheckEmptyFields},oH:function(){return validateEmail},tp:function(){return replaceSpecialChar},uo:function(){return validatePassword},xI:function(){return signInCheckEmptyFields}});let l=/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&^~])[A-Za-z\d@$!%*?&^~]{8,}$/,r=/[&\/\\#,+()@$~%.'":*?!<>{}]/g,n=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/,validatePassword=e=>l.test(e),replaceSpecialChar=e=>{try{return e.replaceAll(r,"")}catch(a){return e}},validateEmail=e=>n.test(e),signUpCheckEmptyFields=e=>{var a,s,l,r;let n={firstName:!0,lastName:!0,email:!0,password:!0,password_confirm:!0};return n.firstName=""!=replaceSpecialChar(null!==(a=null==e?void 0:e.firstName)&&void 0!==a?a:""),n.lastName=""!=replaceSpecialChar(null!==(s=null==e?void 0:e.lastName)&&void 0!==s?s:""),n.email=!!validateEmail(null!==(l=null==e?void 0:e.email)&&void 0!==l?l:""),n.password=(null==e?void 0:e.password)!="",n.password=!!validatePassword(null!==(r=null==e?void 0:e.password)&&void 0!==r?r:""),n.password_confirm=(null==e?void 0:e.password_confirm)!="",n.password_confirm=(null==e?void 0:e.password_confirm)==(null==e?void 0:e.password),n},signInCheckEmptyFields=e=>{var a;let s={email:!0,password:!0};return s.email=!!validateEmail(null!==(a=null==e?void 0:e.email)&&void 0!==a?a:""),s.password=""!=e.password,s.password=!!validatePassword(e.password),s}}},function(e){e.O(0,[5445,1405,5020,6600,6741,3062,5030,3087,3693,9774,2888,179],function(){return e(e.s=99813)}
1),_N_E=e.O()}]);

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.