1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8595],{68595:function(e,a,l){l.r(a),l.d(a,{ProfileMobileContent:function(){return C}});var s=l(11527),r=l(50959),d=l(63947),i=l(94985),t=l(84495),n=l(67395),o=l(69569),c=l(32975),u=l(56586),p=l(43352),f=l(14943),m=l(7242),x=l(66072),g=l(13333),v=l(69271),h=l(82139),w=l(57897),b=l(15598),j=l(11260),k=l(65086),N=l(94553);let C=e=>{var a,l,C,y,P,V,z,U,E,S,_,Z;let{onGoToManagePlan:G}=e,O=(0,i.m)(),{t:I}=(0,m.$G)("popup"),{studioUser:L,isGuest:A}=(0,o.t)(),{studioId:F,portal:M,isCustomDomain:W,currentPage:D,onUpdateCurrentPopup:Q}=(0,d.D)(),{formValues:R,setFormValues:H,isSaveable:T,isSaving:$,isSaved:q,onSave:B}=(0,n.i)(),[J,K]=(0,r.useState)(!1),[X,Y]=(0,r.useState)(!1),{isOpeningCardUpdatePortal:ee,onOpenCardUpdatePortal:ea}=(0,t.W)(),el=(0,u.dV)({currentPage:D,studioId:F,isCustomDomain:W,portalPath:null==M?void 0:M.path}),es=p.S.user.get.accessGroupLink.useQuery(void 0,{refetchOnWindowFocus:!0}),er=!A&&es.data&&(null===(a=es.data)||void 0===a?void 0:a.accessGroup.type)!=="invite_only"?null===(l=es.data)||void 0===l?void 0:l.accessGroup:null,ed=p.S.user.get.offersCount.useQuery({portalId:(null==M?void 0:M.portalId)||""},{refetchOnWindowFocus:!0,enabled:!!er}),ei=!!(null===(C=L.data)||void 0===C?void 0:C.customerId),et=!!((null===(y=L.data)||void 0===y?void 0:y.email)&&!(null===(P=L.data)||void 0===P?void 0:P.emailVerified)),en=async()=>{try{if(Y(!0),await new Promise(e=>setTimeout(e,2e3)),await (0,f.signOut)({redirect:!1,callbackUrl:el.logoutCallbackUrl}),el.shouldRefreshCurrentPage){window.location.reload();return}window.location.href=el.afterLogoutUrl}catch(e){Y(!1),alert(O((0,c.Z)(e)))}};return(0,s.jsx)("div",{className:"custom-scrollbar flex flex-grow flex-col gap-6 overflow-y-auto p-4",children:(0,s.jsxs)("div",{className:"glass flex flex-grow flex-col items-center gap-6 rounded-[var(--portal-roundness)] bg-white/20 p-8 glass-dark:bg-black/20",children:[(0,s.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,s.jsx)("h3",{className:"max-w-full break-all text-center text-3xl font-semibold md:break-normal",children:(null===(V=L.data)||void 0===V?void 0:V.name)||(null===(z=L.data)||void 0===z?void 0:z.email)||(null===(U=L.data)||void 0===U?void 0:U.userId)||"Unknown User"}),!A&&!J&&(0,s.jsxs)(j.z,{variant:"transparent",onClick:()=>K(!0),children:[(0,s.jsx)(g.Z,{}),I("profile.editProfile",{defaultValue:"Edit profile"})]})]}),J?(0,s.jsxs)("div",{className:"glass flex w-full flex-col gap-4 bg-white/50 px-8 py-6 glass-dark:bg-black/50",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(j.z,{variant:"transparent",size:"icon",onClick:()=>K(!1),children:(0,s.jsx)(x.Z,{})}),(0,s.jsx)("h3",{className:"text-xl font-semibold",children:I("profile.editProfile",{defaultValue:"Edit profile"})})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsx)("p",{className:"px-2",children:I("profile.edit.changeEmail",{defaultValue:"Change email"})}),(0,s.jsx)(k.e,{id:"email",name:"email",type:"email",value:R.email,className:"!rounded-[var(--portal-roundness)]",placeholder:I("emailPlaceholder",{defaultValue:"Email"}),onChange:e=>{H(a=>({...a,email:e.target.value}))}})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsx)("p",{className:"px-2",children:I("profile.edit.changeName",{defaultValue:"Change name"})}),(0,s.jsx)(k.e,{id:"name",name:"name",value:R.name,className:"!rounded-[var(--portal-roundness)]",placeholder:I("profile.edit.name",{defaultValue:"Name"}),onChange:e=>{H(a=>({...a,name:e.target.value}))}})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-end justify-between gap-4 px-2",children:[(0,s.jsx)("p",{children:I("profile.edit.changePassword",{defaultValue:"Change password for {{email}}"}).replace("{{email}}",(null===(_=L.data)||void 0===_?void 0:_.email)||"your account")}),(0,s.jsx)(b.M,{className:"text-sm [&_b]:cursor-pointer [&_b]:underline [&_b]:underline-offset-2",value:I("profile.edit.forgotPasswordHtml",{defaultValue:"Forgot your password? <b>Recover it</b>"}),onClick:()=>Q("password-reset")})]}),(0,s.jsx)(k.e,{type:"password",id:"current-password",name:"current-password",value:R.currentPassword,className:"!rounded-[var(--portal-roundness)]",placeholder:I("profile.edit.currentPassword",{defaultValue:"Current password"}),onChange:e=>{H(a=>({...a,currentPassword:e.target.value}))}}),(0,s.jsx)(k.e,{type:"password",id:"new-password",name:"new-password",value:R.newPassword,className:"!rounded-[var(--portal-roundness)]",placeholder:I("profile.edit.newPassword",{defaultValue:"New password"}),onChange:e=>{H(a=>({...a,newPassword:e.target.value}))}})]}),(0,s.jsx)("div",{className:"flex justify-end",children:(0,s.jsx)(j.z,{variant:"primary",className:"!rounded-[var(--portal-roundness)]",onClick:B,disabled:!T||$||q,children:q?I("profile.edit.savedChanges",{defaultValue:"Saved changes!"}):$?I("saving",{defaultValue:"Saving..."}):I("profile.edit.saveChanges",{defaultValue:"Save changes"})})})]}):(0,s.jsxs)("div",{className:"glass flex w-full flex-col gap-4 bg-white/50 px-8 py-6 glass-dark:bg-black/50",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsx)("p",{children:I("emailPlaceholder",{defaultValue:"Email"})}),(0,s.jsx)("p",{children:(null===(E=L.data)||void 0===E?void 0:E.email)||"No email available"}),et&&(0,s.jsx)(w.z,{variant:"glass",size:"blank",className:"rounded-[var(--portal-roundness)] border border-amber-300/70 bg-amber-100/80 px-3 py-1 text-sm font-medium text-amber-900 hover:bg-amber-200/80 glass-dark:border-amber-500/50 glass-dark:bg-amber-500/20 glass-dark:text-amber-100 glass-dark:hover:bg-amber-500/30",onClick:()=>Q("verify-email"),children:I("profile.emailUnverified",{defaultValue:"Email unverified"})})]}),!!(null===(S=L.data)||void 0===S?void 0:S.password)&&(0,s.jsxs)("div",{className:"flex items-center gap-6",children:[(0,s.jsx)("p",{children:I("passwordPlaceholder",{defaultValue:"Password"})}),(0,s.jsx)("p",{className:"text-lg font-semibold tracking-[0.9px] opacity-60",children:"********"})]})]}),!A&&(0,s.jsx)("div",{className:"glass flex w-full items-center gap-4 bg-white/50 px-8 py-6 glass-dark:bg-black/50",children:(0,s.jsxs)(w.z,{variant:"transparent",size:"blank",onClick:en,disabled:X,children:[(0,s.jsx)(v.Z,{}),X?I("profile.loggingOut",{defaultValue:"Logging out..."}):I("profile.logout",{defaultValue:"Logout"})]})}),er&&(0,s.jsx)("div",{className:"w-full",children:(0,s.jsx)(N.Z,{accessGroup:er,trialStartedAt:null===(Z=es.data)||void 0===Z?void 0:Z.createdAt,offersCount:ed.data,canUpdateCard:ei,isOpeningCardUpdatePortal:ee,onManagePlan:G,onUpgradePlan:()=>Q("pricing"),onUpdateCard:ea})}),!A&&(0,s.jsx)("div",{className:"glass flex w-full items-center gap-4 bg-white/50 px-8 py-6 glass-dark:bg-black/50",children:(0,s.jsxs)(w.z,{variant:"transparent",size:"blank",className:"text-red-500",onClick:()=>
1Q("deletion-account"),children:[(0,s.jsx)(h.Z,{}),I("deletion.account.cta",{defaultValue:"Delete Account"})]})})]})})};a.default=C}}]);
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.