1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["js/chunks/LabeledInput.Be0s9wN7.js","js/chunks/_plugin-vue2_normalizer.BaP5Oai9.js","assets/LabeledInput.Nap7alXm.css"])))=>i.map(i=>d[i]); 2import{_ as c}from"./lazy-module.Dfie_RlO.js";import{mapActions as d,mapGetters as p,mapState as f}from"./vuex.esm.browser.CCFI4PRC.js";import{a as o}from"./element-ui.common.U7SvUtYQ.js";import y from"./index.B47n8-Vo.js";import{f as h}from"../currency_format.Bi0Zz-A-.js";import{J as n}from"./joi-browser.BxnQHXdf.js";import"./get.D2lOeqsq.js";import"./isNull.Dfj8Yk3d.js";import{v as r}from"./validateWithMessages.Byt_lyOG.js";import{n as b}from"./_plugin-vue2_normalizer.BaP5Oai9.js";import"./isSymbol.BFDFnTtx.js";import"./vdom.7DEt5Ale.js";import"./vue.esm.BADOStr3.js";import"./networking.D2EXnJJb.js";import"./index.Cw12X-Jo.js";import"./user.BmoVJ-Z7.js";import"./search.CMCLpq58.js";import"./form.Ch4V1Cxx.js";import"./index.TThlE5Lb.js";import"./date.BSCEAoWD.js";import"./index.D2DiOX1H.js";import"./getters.-0Je2T48.js";import"./set.DG1V-2s4.js";import"./_assignValue.BqWJVvNY.js";import"./_defineProperty.Drw97cnk.js";import"./get.CAwYlwAd.js";import"./_isIndex.DX0dbCq3.js";import"./_setToArray.Cl6uB1g8.js";import"./_baseFindIndex.CgavSeJx.js";import"./_Set.kfIFG1zi.js";import"./index.GHS0JVu2.js";import"./parsePhoneNumber_.BO-SSTnf.js";import"./user.BZ_u4uFx.js";import"./validator.B3W9PKKr.js";import"./parsePhoneNumber.BzCzSdsM.js";import"./findIndex.DtzOufFV.js";import"./findIndex.CHlQ3aD8.js";import"./_baseIteratee.DSbi6Wi-.js";import"./_getAllKeys.BZavuOXf.js";import"./isTypedArray.CqyfT41Q.js";import"./toNumber.ClPAW3B3.js";import"./intersectObjects.Dsr1HgbY.js";import"./debounce.DMOaTH1w.js";import"./phone.h-ETdXWU.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};a.SENTRY_RELEASE={id:"v3.313.1"};var t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="d839b902-74da-4fa3-9058-16da765e639b",a._sentryDebugIdIdentifier="sentry-dbid-d839b902-74da-4fa3-9058-16da765e639b")}catch{}})();const l=a=>({availableFunds:n.number().allow(null).min(0).error(t=>({message:a.availableFunds})),maxMonthlyPayment:n.number().allow(null).min(0).error(t=>({message:a.maxMonthlyPayment})),abbr:n.string().allow(null).empty("")}),v=()=>c(()=>import("./LabeledInput.Be0s9wN7.js"),__vite__mapDeps([0,1,2]));Vue.directive("loading",o.Loading.directive);const g={name:"EditMyFinancesForm",props:["isMobile","currencyOptions"],components:{LabeledInput:v},beforeCreate(){const a=this.$store;a&&a.state&&a.state.users||a.registerModule("users",y)},async mounted(){this.getFormData()},data(){return{loading:!1,financialData:{maxMonthlyPayment:null,availableFunds:null,abbr:""},errorMessages:{}}},computed:{...f("users",{translate:a=>a.translate||{},userDetails:a=>a.userDetails,isGettingFormData:a=>a.isGettingFormData,isGettingFormDataSuccess:a=>a.isGettingFormDataSuccess,isSubmittingUser:a=>a.isSubmittingUser,SubmittingUserSuccess:a=>a.isSubmittingUserSuccess}),...p({errorMessage:"users/getErrorMessage"}),customErrorMessage(){const{translate:a={}}=this;return{maxMonthlyPayment:a.maxMonthlyPaymentValidation,availableFunds:a.availableFundsValidation,abbr:a.currencyValidation}},currencyLabel(){return this.financialData.abbr||"฿"},maxMonthlyPaymentDisplay(){return this.financialData.maxMonthlyPayment===null||this.financialData.maxMonthlyPayment===void 0?"":this.formatCurrency(this.financialData.maxMonthlyPayment)},availableFundsDisplay(){return this.financialData.availableFunds===null||this.financialData.availableFunds===void 0?"":this.formatCurrency(this.financialData.availableFunds)}},watch:{userDetails:{handler(a){a&&(this.financialData={maxMonthlyPayment:this.parseToNumber(a.maxMonthlyPayment),availableFunds:this.parseToNumber(a.availableFunds),abbr:a.financialSymbol||""})}},isSubmittingUser:{handler(a){a?this.loading=!0:this.loading=!1}},isGettingFormData:{handler(a){this.loading=!!a}},SubmittingUserSuccess:{handler(a){a&&this.isSubmittingUser===!1&&(this.loading=!1,o.Notification({title:this.translate.myFinancesUpdated,message:this.translate.financialDataSavedSuccessfully,type:"success",position:"top-right"}))}},errorMessage:{handler(a){this.errorMessages=a}}},methods:{...d("users",["getFormData","saveFinancialData"]),parseToNumber(a){if(a==null||a==="")return null;const t=parseFloat(a);return isNaN(t)?null:t},formatCurrency(a){return a==null?"":h("site",a,!1,!1)},parseDisplayValue(a){if(a==null||a==="")return null;const t=a.replace(/[^\d.-]/g,"");return t===""?null:parseFloat(t)},onFieldChange(a,t){const e=a==="maxMonthlyPayment"||a==="availableFunds"?this.parseToNumber(t):t;this.financialData={...this.financialData,[a]:e},this.validateField(a,e)},onMaxMonthlyPaymentInput(a){const t=this.parseDisplayValue(a.target.value);this.onFieldChange("maxMonthlyPayment",t)},onAvailableFundsInput(a){const t=this.parseDisplayValue(a.target.value);this.onFieldChange("availableFunds",t)},validateField(a,t){const{customErrorMessage:e={}}=this,i={[a]:l(e)[a]},s={[a]:t},u={[a]:e[a]},{errorMessages:m}=r(i,s,u);this.errorMessages={...this.errorMessages,[a]:m[a]}},validateForm(a){const{customErrorMessage:t={}}=this,{isValid:e=!1,value:i,errorMessages:s}=r(l(t),a,t);return this.errorMessages=s,{isValid:e,value:i}},async saveMyFinances(){const{isValid:a}=this.validateForm(this.financialData);if(a){const t={maxMonthlyPayment:this.financialData.maxMonthlyPayment?parseFloat(this.financialData.maxMonthlyPayment):null,availableFunds:this.financialData.availableFunds?parseFloat(this.financialData.availableFunds):null,rto_financial_currency:this.userDetails.financialAbbr||null};await this.saveFinancialData(t)}}}};var F=function(){var t=this,e=t._self._c;return e("div",[t.isGettingFormDataSuccess?e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"wrapper-contant",class:{"wrapper-profile":t.isMobile}},[e("div",{staticClass:"header_wrap"},[e("h1",[t._v(t._s(t.translate.myFinances))])]),e("div",{staticClass:"wrapper-financial-info"},[e("div",{staticClass:"financial-des"},[e("strong",{staticClass:"font-16"},[t._v(t._s(t.translate.financialInformationTitle))]),e("div",[t._v(t._s(t.translate.financialInformationDetail))])])]),e("div",{staticClass:"row-profile"},[e("div",{staticClass:"col-profile"},[e("labeled-input",{attrs:{value:t.availableFundsDisplay,label:t.translate.availableFunds,"pre-label":t.currencyLabel,"input-class":"value primary-input"},on:{"input-event":t.onAvailableFundsInput},scopedSlots:t._u([{key:"label-additional",fn:function(){return[e("i",{staticClass:"fa fa-info-circle tooltip tooltip--bottom"},[e("div",{staticClass:"tooltiptext"},[t._v(" "+t._s(t.translate.availableFundsTooltip)+" ")])])]},proxy:!0}],null,!1,2642939237)}),t.errorMessages.availableFunds?e("div",{staticClass:"invalid-feedback is-invalid"},[t._v(" "+t._s(t.errorMessages.availableFunds)+" ")]):t._e()],1),e("div",{staticClass:"col-profile"},[e("labeled-input",{attrs:{value:t.maxMonthlyPaymentDisplay,label:t.translate.maxMonthlyPayment,"pre-label":t.currencyLabel,"input-class":"value primary-input"},on:{"input-event":t.onMaxMonthlyPaymentInput},scopedSlots:t._u([{key:"label-additional",fn:function(){return[e("i",{staticClass:"fa fa-info-circle tooltip tooltip--bottom"},[e("div",{staticClass:"tooltiptext"},[t._v(" "+t._s(t.translate.maxMonthlyPaymentTooltip)+" ")])])]},proxy:!0}],null,!1,493782461)}),t.errorMessages.maxMonthlyPayment?e("div",{staticClass:"invalid-feedback is-invalid"},[t._v(" "+t._s(t.errorMessages.maxMonthlyPayment)+" ")]):t._e()],1),e("div",{staticClass:"invalid-feedback",class:{"
2is-invalid":t.errorMessages.custom}},[t._v(" "+t._s(t.errorMessages.custom)+" ")]),e("div",{staticClass:"col-profile--full"},[e("button",{staticClass:"btn btn-theme",on:{click:t.saveMyFinances}},[t.isSubmittingUser?e("loading-animation"):[t._v(t._s(t.translate.saveMyFinances))]],2)])]),e("input",{staticStyle:{height:"0px",padding:"0",border:"0"},attrs:{type:"text"}})]):t._e()])},M=[],_=b(g,F,M,!1,null,"0be87922");const pa=_.exports;export{pa 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.