PageSourceSearch

https://scwarn.org/_nuxt/profile.760a768f.js

js scwarn.org collected 2026-10-04 02:35:31 UTC 6,736 bytes, 1 lines download raw bytes

1import{_ as X}from"./KFormTextInput.5f934030.js";import{_ as Y}from"./KFormPhoneInput.a38e570c.js";import{_ as G}from"./KModal.vue.85a90b82.js";import{d as z,D as Q,r as R,z as ee,c as p,o as le,an as W,j as _,k as ae,C as n,H as h,I as oe,q as s,m as t,L as N,K as b,l as o,t as f,B as te,J as re,ab as ie,V as D,s as g,M as se,X as ne,T as V}from"./entry.9c8119d9.js";import{f as F,a as T}from"./text.bb3e585c.js";import{u as ue,a as m}from"./vee-validate.esm.de3d1e4b.js";import{_ as me}from"./ChangePasswordFormModal.vue.822cb516.js";import{_ as de}from"./layout.e185b8c4.js";import{u as fe}from"./index.02eab9c0.js";import{u as _e}from"./vue.f36acd1f.95e4cbea.js";const ce={class:"my-profile"},ve=o("p",null,[o("b",null,"Email Address")],-1),pe=o("p",null,[o("b",null,"Mobile Number"),g(" (for text alerts)")],-1),be=o("p",null,[o("b",null,"Work Number")],-1),he={class:"edit-profile-form-container"},ge={class:"form-main-container"},ke=["onSubmit"],Ne=o("legend",null,"Edit Profile",-1),Ve=z({__name:"MyProfile",setup(K){var S,C,P,E,$,B;const{getUser:k,setUser:M,userState:c}=Q(),a=R(),A=R({loading:!0}),{mobile:x}=ee(),L=p(()=>{var e;return(e=a.value)!=null&&e.first_name&&a.value.last_name?`${a.value.first_name} ${a.value.last_name}`:""}),U=p(()=>{var e;return(e=a.value)!=null&&e.mobile_phone?F(a.value.mobile_phone):""}),I=p(()=>{var e;return(e=a.value)!=null&&e.work_phone?F(a.value.work_phone):""}),Z=p(()=>{var e;return(e=a.value)!=null&&e.email?a.value.email:""}),{handleSubmit:j}=ue({validationSchema:{email(e){return e&&/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(e)?!0:"Check that you've entered the correct email. Use format: [email protected]"},firstName(e){return e&&e.length>=2?!0:"Enter your first name."},lastName(e){return e&&e.length>=2?!0:"Enter your last name."},mobile(e){return e&&T(e)?!0:"Enter your mobile number for text alerts."},work(e){return l.sameAsMobile.field.value.value||e&&T(e)?!0:"Enter your work number."}}}),l={email:{field:m("email",void 0,{initialValue:(S=a.value)==null?void 0:S.email}),label:"Email Address"},firstName:{field:m("firstName",void 0,{initialValue:(C=a.value)==null?void 0:C.first_name}),label:"First Name"},lastName:{field:m("lastName",void 0,{initialValue:(P=a.value)==null?void 0:P.last_name}),label:"Last Name"},mobile:{field:m("mobile",void 0,{initialValue:(E=a.value)==null?void 0:E.mobile_phone}),label:"Mobile Number"},work:{field:m("work",void 0,{initialValue:($=a.value)==null?void 0:$.work_phone}),label:"Work Number"},sameAsMobile:{field:m("sameAsMobile",void 0,{initialValue:(B=a.value)==null?void 0:B.work_same_as_mobile}),label:"Same as Mobile"}},H=e=>{l.mobile.field.value.value=e},q=e=>{l.work.field.value.value=e},J=e=>{j(async()=>{var d;const r={first_name:l.firstName.field.value.value,last_name:l.lastName.field.value.value,work_phone:l.sameAsMobile.field.value.value?l.mobile.field.value.value:l.work.field.value.value,mobile_phone:l.mobile.field.value.value,id:(d=a.value)==null?void 0:d.id};try{await ne(r).then(()=>{M({...c.value,...r}),V({message:`Your Profile has been edited, ${r.first_name}!`}),e()})}catch(v){throw V({message:"There was an error changing your profile. Please try again.",color:"error"}),v}},()=>{V({message:"There was an error changing your profile. Please try again.",color:"error"})})()};return le(async()=>{await k().then(e=>{a.value=e,A.value.loading=!1})}),W(a,e=>{e&&(l.email.field.value.value=e.email,l.firstName.field.value.value=e.first_name,l.lastName.field.value.value=e.last_name,l.mobile.field.value.value=e.mobile_phone,l.work.field.value.value=e.work_phone,l.sameAsMobile.field.value.value=e.work_same_as_mobile)}),W(c.value,async()=>{a.value=await k()}),(e,r)=>{const d=X,v=Y,O=G;return _(),ae("section",ce,[n(A).loading?(_(),h(oe,{key:0,indeterminate:""})):(_(),h(se,{key:1},{default:s(()=>[t(N,null,{default:s(()=>[t(b,{cols:"12",md:"4"},{default:s(()=>{var u,i;return[o("p",null,[o("b",null,f(n(L)),1)]),o("p",null,f((i=(u=n(a))==null?void 0:u.utility)==null?void 0:i.utility_name),1)]}),_:1})]),_:1}),t(N,null,{default:s(()=>[t(b,{cols:"12",md:"4"},{default:s(()=>[ve,o("p",null,f(n(Z)),1)]),_:1}),t(b,{cols:"12",md:"4"},{default:s(()=>[pe,o("p",null,f(n(U)),1)]),_:1}),t(b,{cols:"12",md:"4"},{default:s(()=>[be,o("p",null,f(n(I)),1)]),_:1})]),_:1}),t(N,null,{default:s(()=>[t(O,{class:"form-modal",fullscreen:n(x),width:n(x)?"100%":"800",text:"Edit",title:"Edit Profile",persistent:!0,"btn-class":"mini edit","btn-icon":"mdi-pencil"},{content:s(({closeDialog:u})=>[o("div",he,[o("div",ge,[o("form",{id:"edit-profile-form",onSubmit:te(i=>J(u),["prevent"])}
1,[o("fieldset",null,[Ne,t(d,{"first-input":!0,modelValue:l.firstName.field.value.value,"onUpdate:modelValue":r[0]||(r[0]=i=>l.firstName.field.value.value=i),"error-messages":l.firstName.field.errorMessage.value,variant:"outlined",label:l.firstName.label},null,8,["modelValue","error-messages","label"]),t(d,{modelValue:l.lastName.field.value.value,"onUpdate:modelValue":r[1]||(r[1]=i=>l.lastName.field.value.value=i),"error-messages":l.lastName.field.errorMessage.value,variant:"outlined",label:l.lastName.label},null,8,["modelValue","error-messages","label"]),t(v,{modelValue:l.mobile.field.value.value,"onUpdate:modelValue":[r[2]||(r[2]=i=>l.mobile.field.value.value=i),H],label:l.mobile.label,variant:"outlined","error-messages":l.mobile.field.errorMessage.value,messages:""},null,8,["modelValue","label","error-messages"]),l.sameAsMobile.field.value.value?re("",!0):(_(),h(v,{key:0,modelValue:l.work.field.value.value,"onUpdate:modelValue":[r[3]||(r[3]=i=>l.work.field.value.value=i),q],label:l.work.label,variant:"outlined","error-messages":l.work.field.errorMessage.value,messages:"Let us know the best number to reach you at during the work day."},null,8,["modelValue","label","error-messages"])),t(ie,{modelValue:l.sameAsMobile.field.value.value,"onUpdate:modelValue":r[4]||(r[4]=i=>l.sameAsMobile.field.value.value=i),label:"Same as Mobile Number"},null,8,["modelValue"])])],40,ke)])])]),actions:s(({closeDialog:u})=>[t(D,{onClick:u,ref:"closeButtonRef"},{default:s(()=>[g(" Cancel ")]),_:2},1032,["onClick"]),t(D,{class:"me-4",form:"edit-profile-form",type:"submit"},{default:s(()=>[g(" Save ")]),_:1})]),_:1},8,["fullscreen","width"]),g("   "),t(me)]),_:1})]),_:1}))])}}}),y="SCWARN — South Carolina Water/Wastewater Agency Response Network",w="SCWARN helps utilities connect with other utilities to prepare for and recover from emergencies.",Be=z({__name:"profile",setup(K){return _e({title:y,meta:[{name:"description",content:w}],htmlAttrs:{lang:"en"}}),fe({title:y,ogTitle:y,description:w,ogDescription:w}),(k,M)=>{const c=Ve,a=de;return _(),h(a,{title:"My Profile"},{default:s(()=>[t(c)]),_:1})}}});
1export{Be 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.