PageSourceSearch

https://adquiere.co/assets/MyProfile-LqiLpyYY.js

js adquiere.co collected 2026-10-07 15:19:47 UTC 11,069 bytes, 1 lines download raw bytes

1import{u as z}from"./useHideChatbase-BBiQ4xrO.js";import{t as V,ac as i,n as d,k as e,aL as v,aG as T,l as $,an as E,r as f,ar as a,I as y,q as S,aD as L,ay as I,aA as U,ag as p,aI as M,a8 as O,a1 as G,m as B,i as q}from"./index-BDQpT_V-.js";import{_ as j}from"./MiTesisTab.vue_vue_type_script_setup_true_lang-DVvl5XQy.js";import{_ as A}from"./SpinnerElement.vue_vue_type_script_setup_true_lang-BThRugUh.js";import{_ as H}from"./PlanFacturacionPanel.vue_vue_type_script_setup_true_lang-DJL6Zd01.js";import{c as J,a as Q}from"./users.api-BNKMwDDc.js";import{g as R}from"./google.api-B828-B5I.js";import{s as N}from"./useToast-DYkpS54w.js";import"./ChipMultiSelect-NN129ax8.js";import"./dropdowns.api-DqDccWyp.js";import"./apiError-Gala52Qf.js";import"./index-DVX-9P8S.js";import"./SpotlightFormModal.vue_vue_type_script_setup_true_lang-DNb4daRs.js";import"./useApiError-DKIMh90E.js";import"./billing.api-BVni1OXv.js";/* empty css                      */import"./stripe.api-DAPIoidS.js";const K={class:"bg-[#FAFBFC] border border-[#DDE5ED] rounded-[32px] p-6 lg:p-8 w-full"},W={class:"flex flex-col gap-1"},X={class:"flex flex-col gap-1"},Y=["disabled"],Z={key:0},_={class:"mt-8 pt-6 border-t border-[#DDE5ED] flex items-center justify-between"},oo={class:"flex flex-col gap-0.5"},eo={class:"text-xs text-[#5D6064]"},to=["disabled"],so={key:0},ao={key:1,class:"flex items-center gap-2 text-sm font-semibold text-[#16A34A]"},lo={class:"flex flex-col gap-1 relative w-full"},no=["type"],io={class:"flex flex-col gap-1 relative w-full"},ro=["type"],uo={class:"flex flex-col gap-1 relative w-full"},po=["type"],mo=["disabled"],fo={key:0},co=V({__name:"MyProfileTab",props:{profileForm:{},passwordChangeForm:{},isProfileLoading:{type:Boolean},isPasswordLoading:{type:Boolean},isGoogleLinked:{type:Boolean},isLinkingGoogle:{type:Boolean},showOldPassword:{type:Boolean},showNewPassword:{type:Boolean},showConfirmation:{type:Boolean}},emits:["update-profile","update-password","link-google","toggle-old-password","toggle-new-password","toggle-confirmation"],setup(t){return(l,o)=>(i(),d("div",K,[o[20]||(o[20]=e("div",{class:"pb-6 border-b border-[#DDE5ED]"},[e("h2",{class:"text-[#04009B] text-2xl font-extrabold tracking-tight"},"Actualizar perfil"),e("p",{class:"text-[#5D6064] text-sm mt-1"}," Aquí se muestran tus datos personales y puedes actualizar tu contraseña cuando lo requieras. ")],-1)),e("form",{onSubmit:o[2]||(o[2]=s=>l.$emit("update-profile",s)),class:"flex flex-col gap-4 w-full pt-6"},[e("div",W,[o[11]||(o[11]=e("label",{class:"text-sm font-medium text-[#0B0B37]"},"Nombre",-1)),v(e("input",{"onUpdate:modelValue":o[0]||(o[0]=s=>t.profileForm.name=s),placeholder:"Nombre",class:"bg-[#F1F4F7] border border-[#BAC0C7] rounded-xl px-4 py-3 text-sm text-[#0B0B37] placeholder:text-[#5D6064] focus:outline-none focus:border-[#5F59D8] transition-colors"},null,512),[[T,t.profileForm.name]])]),e("div",X,[o[12]||(o[12]=e("label",{class:"text-sm font-medium text-[#0B0B37]"},"Teléfono",-1)),v(e("input",{"onUpdate:modelValue":o[1]||(o[1]=s=>t.profileForm.phone=s),placeholder:"Teléfono",class:"bg-[#F1F4F7] border border-[#BAC0C7] rounded-xl px-4 py-3 text-sm text-[#0B0B37] placeholder:text-[#5D6064] focus:outline-none focus:border-[#5F59D8] transition-colors"},null,512),[[T,t.profileForm.phone]])]),e("button",{type:"submit",disabled:t.isProfileLoading,class:"w-full bg-[#5F59D8] hover:bg-[#4F49C8] text-white font-bold rounded-2xl py-4 transition disabled:opacity-50 disabled:cursor-not-allowed mt-2"},[t.isProfileLoading?(i(),$(A,{key:1})):(i(),d("span",Z,"Actualizar perfil"))],8,Y)],32),e("div",_,[e("div",oo,[o[13]||(o[13]=e("span",{class:"text-sm font-semibold text-[#0B0B37]"},"Cuenta de Google",-1)),e("span",eo,E(t.isGoogleLinked?"Tu cuenta está vinculada con Google.":"Vincula tu cuenta para iniciar sesión con Google."),1)]),t.isGoogleLinked?(i(),d("div",ao,[f(a(y),{icon:"heroicons:check-circle-solid",class:"w-5 h-5"}),o[15]||(o[15]=S(" Vinculada ",-1))])):(i(),d("button",{key:0,type:"button",disabled:t.isLinkingGoogle,onClick:o[3]||(o[3]=s=>l.$emit("link-google")),class:"flex items-center gap-2 border border-[#BAC0C7] rounded-xl px-4 py-2.5 text-sm font-semibold text-[#0B0B37] hover:bg-gray-50 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"},[o[14]||(o[14]=e("img",{src:"https://www.google.com/favicon.ico",class:"w-4 h-4",alt:"Google"},null,-1)),t.isLinkingGoogle?(i(),$(A,{key:1,size:"4"})):(i(),d("span",so,"Vincular con Google"))],8,to))]),e("form",{onSubmit:o[10]||(o[10]=s=>l.$emit("update-password",s)),class:"mt-8 pt-6 border-t border-[#DDE5ED] flex flex-col gap-4"},[o[19]||(o[19]=e("h2",{class:"text-[#04009B] text-xl font-bold"},"Actualizar contraseña",-1)),e("div",lo,[o[16]||(o[16]=e("label",{class:"text-sm font-medium text-[#0B0B37]"},"Contraseña actual",-1)),v(e("input",{"onUpdate:modelValue":o[4]||(o[4]=s=>t.passwordChangeForm.current_password=s),type:t.showOldPassword?"text":"password",placeholder:"Contraseña actual",class:"bg-[#F1F4F7] border border-[#BAC0C7] rounded-xl px-4 py-3 pr-12 text-sm text-[#0B0B37] placeholder:text-[#5D6064] focus:outline-none focus:border-[#5F59D8] transition-colors"},null,8,no),[[L,t.passwordChangeForm.current_password]]),e("button",{onClick:o[5]||(o[5]=s=>l.$emit("toggle-old-password")),type:"button",class:"absolute right-4 top-9 text-[#5D6064] hover:text-[#0B0B37] transition-colors"},[f(a(y),{icon:t.showOldPassword?"heroicons:eye-slash":"heroicons:eye",class:"w-5 h-5"},null,8,["icon"])])]),e("div",io,[o[17]||(o[17]=e("label",{class:"text-sm font-medium text-[#0B0B37]"},"Contraseña nueva",-1)),v(e("input",{"onUpdate:modelValue":o[6]||(o[6]=s=>t.passwordChangeForm.new_password=s),type:t.showNewPassword?"text":"password",placeholder:"Contraseña nueva",class:"bg-[#F1F4F7] border border-[#BAC0C7] rounded-xl px-4 py-3 pr-12 text-sm text-[#0B0B37] placeholder:text-[#5D6064] focus:outline-none focus:border-[#5F59D8] transition-colors"},null,8,ro),[[L,t.passwordChangeForm.new_password]]),e("button",{onClick:o[7]||(o[7]=s=>l.$emit("toggle-new-password")),type:"button",class:"absolute right-4 top-9 text-[#5D6064] hover:text-[#0B0B37] transition-colors"},[f(a(y),{icon:t.showNewPassword?"heroicons:eye-slash":"heroicons:eye",class:"w-5 h-5"},null,8,["icon"])])]),e("div",uo,[o[18]||(o[18]=e("label",{class:"text-sm font-medium text-[#0B0B37]"},"Confirmar contraseña",-1)),v(e("input",{"onUpdate:modelValue":o[8]||(o[8]=s=>t.passwordChangeForm.password_confirmation=s),type:t.showConfirmation?"text":"password",placeholder:"Confirmar contraseña",class:"bg-[#F1F4F7] border border-[#BAC0C7] rounded-xl px-4 py-3 pr-12 text-sm text-[#0B0B37] placeholder:text-[#5D6064] focus:outline-none focus:border-[#5F59D8] transition-colors"},null,8,po),[[L,t.passwordChangeForm.password_confirmation]]),e("button",{onClick:o[9]||(o[9]=s=>l.$emit("toggle-confirmation")),type:"button",class:"absolute right-4 top-9 text-[#5D6064] hover:text-[#0B0B37] transition-colors"},[f(a(y),{icon:t.showConfirmation?"heroicons:eye-slash":"heroicons:eye",class:"w-5 h-5"},null,8,["icon"])])]),e("button",{type:"submit",disabled:t.isPasswordLoading,class:"w-full bg-[#5F59D8] hover:bg-[#4F49C8] text-white font-bold rounded-2xl py-4 transition disabled:opacity-50 disabled:cursor-not-allowed mt-2"},[t.isPasswordLoading?(i(),$(A,{key:1})):(i(),d("span",fo,"Actualizar contraseña"))],8,mo)],32)]))}});function go(){const t=I(),l=U(),o=p("perfil"),s=p(!1),c=p(!1),g=p(!1),C=p(!1),k=p(localStorage.getItem("google_linked")==="true"),w=p(!1),u=p({name:"",phone:""}),m=p({current_password:"",new_password:"",password_confirmation:""}),x=p(!1),F=async n=>{n.preventDefault(),s.value=!0,await Q(u.value)&&(N("Datos actualizados con éxito","success"),l.name=u.value.name,l.phone=u.value.phone,localStorage.setItem("user_profile",JSON.stringify({name:u.value.name,phone:u.value.phone}))),s.value=!1},D=async n=>{n.preventDefault(),x.value=!0,await J(m.value)&&(N("Contraseña actualizada con éxito","success"),m.value.current_password="",m.value.new_password="",m.value.password_confirmation=""),x.value=!1},P=async()=>{w.value=!0;try{const{url:n}=await R();localStorage.setItem("google_oauth_flow","link"),window.location.href=n}catch{N("No se pudo conectar con Google. Intenta de nuevo.","error"),w.value=!1}};return M(()=>t.query.tab,n=>{typeof n=="string"&&(o.value=n)}),O(()=>{const n=t.query.tab;typeof n=="string"&&(o.value=n),u.value.name=l.name,u.value.phone=l.phone}),{activeTab:o,store:l,isProfileLoading:s,showOldPassword:c,showNewPassword:g,showConfirmation:C,isGoogleLinked:k,isLinkingGoogle:w,profileForm:u,passwordChangeForm:m,isPasswordLoading:x,updateProfile:F,updatePassword:D,handleLinkGoogle:P}}const wo={class:"w-full flex flex-col items-center px-4 lg:px-8 py-6"},xo={class:"w-full max-w-3xl"},bo={class:"inline-flex bg-[#F1F4F7] p-1 rounded-2xl gap-1"},ho={key:0,class:"w-full max-w-3xl mt-8"},vo={key:1,class:"w-full max-w-5xl mt-8"},yo={key:2,class:"w-full max-w-3xl mt-8"},Io=V({__name:"MyProfile",setup(t){z();const{activeTab:l,isProfileLoading:o,showOldPassword:s,showNewPassword:c,showConfirmation:g,isGoogleLinked:C,isLinkingGoogle:k,profileForm:w,passwordChangeForm:u,isPasswordLoading:m,updateProfile:x,updatePassword:F,handleLinkGoogle:D}=go(),P=U(),n=q(()=>{var b;return((b=P.roles)==null?void 0:b.includes("buyer"))??!1});return(b,r)=>(i(),d("div",wo,[e("div",xo,[e("div",bo,[e("button",{class:G(["px-6 py-2.5 font-semibold text-sm rounded-xl transition-all duration-200",a(l)==="perfil"?"bg-white text-[#04009B] shadow-sm":"text-[#5D6064] hover:text-[#0B0B37]"]),onClick:r[0]||(r[0]=h=>l.value="perfil")}," Mi perfil ",2),e("button",{class:G(["px-6 py-2.5 font-semibold text-sm rounded-xl transition-all duration-200",a(l)==="configuracion"?"bg-white text-[#04009B] shadow-sm":"text-[#5D6064] hover:text-[#0B0B37]"]),onClick:r[1]||(r[1]=h=>l.value="configuracion")}," Plan y facturación ",2),n.value?(i(),d("button",{key:0,class:G(["px-6 py-2.5 font-semibold text-sm rounded-xl transition-all duration-200",a(l)==="tesis"?"bg-white text-[#04009B] shadow-sm":"text-[#5D6064] hover:text-[#0B0B37]"]),onClick:r[2]||(r[2]=h=>l.value="tesis")}," Mi tesis ",2)):B("",!0)])]),a(l)==="perfil"?(i(),d("div",ho,[f(co,{"profile-form":a(w),"password-change-form":a(u),"is-profile-loading":a(o),"is-password-loading":a(m),"is-google-linked":a(C),"is-linking-google":a(k),"show-old-password":a(s),"show-new-password":a(c),"show-confirmation":a(g),onUpdateProfile:a(x),onUp
1datePassword:a(F),onLinkGoogle:a(D),onToggleOldPassword:r[3]||(r[3]=h=>s.value=!a(s)),onToggleNewPassword:r[4]||(r[4]=h=>c.value=!a(c)),onToggleConfirmation:r[5]||(r[5]=h=>g.value=!a(g))},null,8,["profile-form","password-change-form","is-profile-loading","is-password-loading","is-google-linked","is-linking-google","show-old-password","show-new-password","show-confirmation","onUpdateProfile","onUpdatePassword","onLinkGoogle"])])):B("",!0),a(l)==="configuracion"?(i(),d("div",vo,[f(H)])):B("",!0),a(l)==="tesis"&&n.value?(i(),d("div",yo,[f(j)])):B("",!0)]))}});export{Io 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.