1import{c as o,o as t,d as s,f as y,e as i,t as c,E as f,J as m,C as p,A as _,B as v,P,$ as k,n as b,I as N,X as g,G as w,F as V,g as M}from"./vue-vendor-zXpxZbJ5.js";import{A as U}from"./AccountWrapper-B2m6bqmm.js";import{_ as S}from"./index-R1D5dzOa.js";import{A as $}from"./AddressModal-D07O8eYq.js";import{b as B}from"./utils-BTpTYCxF.js";import{c as T}from"./ui-vendor-Djkxqtjk.js";import"./datetime-Dr26p2qm.js";import"./CheckGroupTailwind-DqB0yeVC.js";import"./BaseModal-Cu9_Y-p2.js";const I={props:{address:{type:Object,required:!0}},methods:{async edit(){this.$store.commit("addresses/setShowCreateSuccess",!1),this.$store.commit("addresses/setShowUpdateSuccess",!1),this.$store.commit("addresses/setScope","update"),this.$store.dispatch("addresses/getAddress",this.address.id),window.EventBus.$emit("showAddressModal")}},computed:{editLink(){return`/profiles/addresses/${this.address.id}`},hasState(){return this.address.state!="--"&&this.address.state!=null}}},E={class:"col-xs-12 col-sm-6"},F={class:"list-group"},W={class:"u-margin-top-plus-sm list-group-item-heading"},z={key:0,class:"list-group-item-text"},D={class:"list-group-item-text"},G={key:0};function L(n,e,r,A,d,a){return t(),o("div",E,[s("div",F,[s("a",{href:"#",onClick:e[0]||(e[0]=y((...l)=>a.edit&&a.edit(...l),["prevent"])),class:"list-group-item c-investor-profile-card has-handle"},[e[1]||(e[1]=s("div",{class:"c-investor-profile-edit-button"},[s("i",{class:"fas fa-pencil-alt"})],-1)),s("h4",W,c(r.address.name),1),r.address.address2?(t(),o("p",z,c(r.address.address2),1)):i("",!0),s("p",D,[f(c(r.address.city)+", ",1),a.hasState?(t(),o("span",G,c(r.address.state),1)):i("",!0),f(c(r.address.zip)+" "+c(r.address.country),1)])])])])}const O=S(I,[["render",L],["__scopeId","data-v-64ca1bf2"]]),Y={name:"UpdatePhoneNumber",components:{VueTelInput:T},mounted(){this.localPhone=this.customer.phone},computed:{...m("customer",["customer"]),formattedPhone(){return this.$refs.phone_number.phone}},methods:{async updatePhoneNumber(){try{this.saving=!0;const n={phone:this.formattedPhone};await B.put("/customers/phone",n)}catch(n){console.log({error:n})}finally{setTimeout(()=>{this.saving=!1,this.showSuccess=!0,setTimeout(()=>{this.showSuccess=!1},3e3)},500)}},onPhoneValidate(n){this.isValidPhone=n.valid}},data(){return{showSuccess:!1,localPhone:null,saving:!1,phoneProps:{mode:"international",defaultCountry:"US",enabledFlags:!0,placeholder:"Phone number",preferredCountries:["US","IN","GB","AU"],inputOptions:{showDialCode:!1}},isValidPhone:!1}}},j={key:0,class:"text-success bg-success c-bordered-message u-padding-plus-md"},q={class:"row"},J={class:"col-xs-12 col-sm-6"},Q={class:"form-group"},R={class:"form-group"},X=["disabled"],H={key:0,class:"fas fa-cog fa-spin"};function K(n,e,r,A,d,a){const l=p("vue-tel-input");return t(),o("div",null,[_(P,{name:"fade-slide"},{default:v(()=>[d.showSuccess?(t(),o("p",j," Your phone number was updated ")):i("",!0)]),_:1}),s("div",q,[s("div",J,[s("div",Q,[_(l,k({class:["vue-tel-input-rest",{"bg-gray-200":d.saving}],ref:"phone_number",modelValue:d.localPhone,"onUpdate:modelValue":e[0]||(e[0]=u=>d.localPhone=u),disabled:d.saving},d.phoneProps,{onValidate:a.onPhoneValidate}),null,16,["class","modelValue","disabled","onValidate"])]),s("div",R,[s("button",{disabled:!d.isValidPhone,onClick:e[1]||(e[1]=y((...u)=>a.updatePhoneNumber&&a.updatePhoneNumber(...u),["prevent"])),class:b(["c-btn c-btn--medium",[d.saving||!d.isValidPhone?"c-btn--disabled":"c-btn--orange"]]),type:"button"},[d.saving?(t(),o("i",H)):i("",!0),e[2]||(e[2]=f(" Save ",-1))],10,X)])])])])}const Z=S(Y,[["render",K]]),ss={name:"AccountAddresses",components:{AccountWrapper:U,AddressItem:O,AddressModal:$,UpdatePhoneNumber:Z},async mounted(){await this.$store.dispatch("refreshCustomer"),this.getProfiles(),this.getAddresses(),this.getStates(),this.getCountries(),window.EventBus.$on("chainQueryReceived",()=>{this.loading=!1}),window.EventBus.$on("showAddressModal",()=>{this.showAddressModal=!0})},unmounted(){this.setShowCreateSuccess(!1)},methods:{...g("geography",["getStates","getCountries"]),...g("addresses",["getAddresses"]),...g("profiles",["getProfiles"]),...N("addresses",["setShowCreateSuccess"]),showNewAddressModal(){this.$store.commit("addresses/setShowCreateSuccess",!1),this.$store.commit("addresses/setShowU
1pdateSuccess",!1),this.$store.commit("addresses/setScope","create"),this.showAddressModal=!0}},computed:{...m("geography",["states","countries"]),...m("addresses",["addresses"]),...m("profiles",["profiles"]),hasAddresses(){return this.addresses.length>0},showSuccess(){return this.showCreateSuccess||this.showUpdateSuccess},showCreateSuccess(){return this.$store.state.addresses.showCreateSuccess},showUpdateSuccess(){return this.$store.state.addresses.showUpdateSuccess}},data(){return{loading:!0,waiting:!1,showAddressModal:!1}}},es={lsi:"",class:"pt-8"},ts={class:"c-account-panel"},ds={class:"c-account-panel-body"},os={key:0},as={class:"c-account-panel"},ns={class:"c-account-panel-body"},rs={key:0},is={key:0,class:"text-success bg-success c-bordered-message u-padding-plus-md"},cs={key:0},ls={key:1},us={key:0,class:"c-account-panel-section"},hs={class:"row address-cards-row"},ps={key:1,class:"u-margin-bottom-plus-lg text-danger bg-danger c-bordered-message"},ms={class:"row"},fs={class:"col-md-12"},_s={class:"form-group text-center border-t pt-6 u-xs-center"};function gs(n,e,r,A,d,a){const l=p("UpdatePhoneNumber"),u=p("address-item"),x=p("AddressModal"),C=p("AccountWrapper");return t(),w(C,null,{default:v(()=>[s("div",es,[e[6]||(e[6]=s("div",{class:"c-account-panel-head"},[s("h2",{class:"h2 is-title hidden-xs"},"Phone Number"),s("h3",{class:"h3 is-title hidden-sm hidden-md hidden-lg text-center"},"Phone Number")],-1)),s("div",ts,[s("div",ds,[d.loading?(t(),o("div",os,[...e[2]||(e[2]=[s("div",{class:"text-center"},[s("h5",null,[s("i",{class:"fas fa-sync-alt fa-spin fa-3x fa-fw"})])],-1)])])):(t(),o("div",{key:1,class:b({"opacity-75 pointer-events-none":d.waiting})},[_(l)],2))])]),e[7]||(e[7]=s("div",{class:"c-account-panel-head"},[s("h2",{class:"h2 is-title hidden-xs"},"Addresses"),s("h3",{class:"h3 is-title hidden-sm hidden-md hidden-lg text-center"},"Addresses")],-1)),s("div",as,[s("div",ns,[d.loading?(t(),o("div",rs,[...e[3]||(e[3]=[s("div",{class:"text-center"},[s("h5",null,[s("i",{class:"fas fa-sync-alt fa-spin fa-3x fa-fw"})])],-1)])])):(t(),o("div",{key:1,class:b({"opacity-75 pointer-events-none":d.waiting})},[_(P,{name:"fade-slide"},{default:v(()=>[a.showSuccess?(t(),o("p",is,[a.showCreateSuccess?(t(),o("span",cs,"The address was successfully created.")):i("",!0),a.showUpdateSuccess?(t(),o("span",ls,"The address was successfully updated.")):i("",!0)])):i("",!0)]),_:1}),a.hasAddresses?(t(),o("div",us,[s("div",hs,[(t(!0),o(V,null,M(n.addresses,h=>(t(),w(u,{key:h.id,address:h},null,8,["address"]))),128))])])):(t(),o("div",ps,[...e[4]||(e[4]=[s("p",{class:"u-padding-plus-md"},"You have not added any addresses",-1)])])),s("div",ms,[s("div",fs,[s("div",_s,[s("a",{onClick:e[0]||(e[0]=y((...h)=>a.showNewAddressModal&&a.showNewAddressModal(...h),["prevent"])),class:"c-btn c-btn--orange c-btn--medium",href:"#"},[...e[5]||(e[5]=[s("i",{class:"fas fa-plus"},null,-1),f(" Add a New Address ",-1)])])])])])],2))])]),d.showAddressModal?(t(),w(x,{key:0,onClose:e[1]||(e[1]=h=>d.showAddressModal=!1)})):i("",!0)])]),_:1})}const ks=S(ss,[["render",gs],["__scopeId","data-v-06c8095d"]]);export{ks as default}; 2//# sourceMappingURL=AccountAddresses-CYK3A-Sh.js.map
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.