1/*! For license information please see 7131.js.LICENSE.txt */ 2"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[7131],{63216(t,e,r){r.d(e,{Ay:()=>w});var a=r(72505),s=r.n(a),o=Object.defineProperty,n=Object.prototype.hasOwnProperty,i=Object.getOwnPropertySymbols,c=Object.prototype.propertyIsEnumerable,u=(t,e,r)=>e in t?o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,l=(t,e)=>{for(var r in e||(e={}))n.call(e,r)&&u(t,r,e[r]);if(i)for(var r of i(e))c.call(e,r)&&u(t,r,e[r]);return t};const m=t=>void 0===t,f=t=>Array.isArray(t),d=t=>t&&"number"==typeof t.size&&"string"==typeof t.type&&"function"==typeof t.slice,h=(t,e,r,a)=>((e=e||{}).indices=!m(e.indices)&&e.indices,e.nullsAsUndefineds=!m(e.nullsAsUndefineds)&&e.nullsAsUndefineds,e.booleansAsIntegers=!m(e.booleansAsIntegers)&&e.booleansAsIntegers,e.allowEmptyArrays=!m(e.allowEmptyArrays)&&e.allowEmptyArrays,r=r||new FormData,m(t)||(null===t?e.nullsAsUndefineds||r.append(a,""):(t=>"boolean"==typeof t)(t)?e.booleansAsIntegers?r.append(a,t?1:0):r.append(a,t):f(t)?t.length?t.forEach((t,s)=>{const o=a+"["+(e.indices?s:"")+"]";h(t,e,r,o)}):e.allowEmptyArrays&&r.append(a+"[]",""):(t=>t instanceof Date)(t)?r.append(a,t.toISOString()):!(t=>t===Object(t))(t)||(t=>d(t)&&"string"==typeof t.name&&("object"==typeof t.lastModifiedDate||"number"==typeof t.lastModified))(t)||d(t)?r.append(a,t):Object.keys(t).forEach(s=>{const o=t[s];if(f(o))for(;s.length>2&&s.lastIndexOf("[]")===s.length-2;)s=s.substring(0,s.length-2);h(o,e,r,a?a+"["+s+"]":s)})),r);var p={serialize:h};function v(t){if(null===t||"object"!=typeof t)return t;const e=Array.isArray(t)?[]:{};return Object.keys(t).forEach(r=>{e[r]=v(t[r])}),e}function b(t){return Array.isArray(t)?t:[t]}function g(t){return t instanceof File||t instanceof Blob||t instanceof FileList||"object"==typeof t&&null!==t&&void 0!==Object.values(t).find(t=>g(t))}class y{constructor(){this.errors={},this.errors={}}set(t,e){"object"==typeof t?this.errors=t:this.set(l(l({},this.errors),{[t]:b(e)}))}all(){return this.errors}has(t){return Object.prototype.hasOwnProperty.call(this.errors,t)}hasAny(...t){return t.some(t=>this.has(t))}any(){return Object.keys(this.errors).length>0}get(t){if(this.has(t))return this.getAll(t)[0]}getAll(t){return b(this.errors[t]||[])}only(...t){const e=[];return t.forEach(t=>{const r=this.get(t);r&&e.push(r)}),e}flatten(){return Object.values(this.errors).reduce((t,e)=>t.concat(e),[])}clear(t){const e={};t&&Object.keys(this.errors).forEach(r=>{r!==t&&(e[r]=this.errors[r])}),this.set(e)}}class _{constructor(t={}){this.originalData={},this.busy=!1,this.successful=!1,this.recentlySuccessful=!1,this.recentlySuccessfulTimeoutId=void 0,this.errors=new y,this.progress=void 0,this.update(t)}static make(t){return new this(t)}update(t){this.originalData=Object.assign({},this.originalData,v(t)),Object.assign(this,t)}fill(t={}){this.keys().forEach(e=>{this[e]=t[e]})}data(){return this.keys().reduce((t,e)=>l(l({},t),{[e]:this[e]}),{})}keys(){return Object.keys(this).filter(t=>!_.ignore.includes(t))}startProcessing(){this.errors.clear(),this.busy=!0,this.successful=!1,this.progress=void 0,this.recentlySuccessful=!1,clearTimeout(this.recentlySuccessfulTimeoutId)}finishProcessing(){this.busy=!1,this.successful=!0,this.progress=void 0,this.recentlySuccessful=!0,this.recentlySuccessfulTimeoutId=setTimeout(()=>{this.recentlySuccessful=!1},_.recentlySuccessfulTimeout)}clear(){this.errors.clear(),this.successful=!1,this.recentlySuccessful=!1,this.progress=void 0,clearTimeout(this.recentlySuccessfulTimeoutId)}reset(){Object.keys(this).filter(t=>!_.ignore.includes(t)).forEach(t=>{this[t]=v(this.originalData[t])})}get(t,e={}){return this.submit("get",t,e)}post(t,e={}){return this.submit("post",t,e)}patch(t,e={}){return this.submit("patch",t,e)}put(t,e={}){return this.submit("put",t,e)}delete(t,e={}){return this.submit("delete",t,e)}submit(t,e,r={}){return this.startProcessing(),r=l({data:{},params:{},url:this.route(e),method:t,onUploadProgress:this.handleUploadProgress.bind(this)},r),"get"===t.toLowerCase()?r.params=l(l({},this.data()),r.params):(r.data=l(l({},this.data()),r.data),g(r.data)&&!r.transformRequest&&(r.transformRequest=[t=>p.serialize(t)])),new Promise((t,e)=>{(_.axios||s()).request(r).then(e=>{this.finishProcessing(),t(e)}).catch(t=>{this.handleErrors(t),e(t)})})}handleErrors(t){this.busy=!1,this.progress=void 0,t.response&&this.errors.set(this.extractErrors(t.response))}extractErrors(t){return t.data&&"object"==typeof t.data?t.data.errors?l({},t.data.errors):t.data.message?{error:t.data.message}:l({},t.data):{error:_.errorMessage}}handleUploadProgress(t){this.progress={total:t.total,loaded:t.loaded,percentage:Math.round(100*t.loaded/t.total)}}route(t,e={}){let r=t;return Object.prototype.hasOwnProperty.call(_.routes,t)&&(r=decodeURI(_.routes[t])),"object"!=typeof e&&(e={id:e}),Object.keys(e).forEach(t=>{r=r.replace(`{${t}}`,e[t])}),r}onKeydown(t){const e=t.target;e.name&&this.errors.clear(e.name)}
2}_.routes={},_.errorMessage="Something went wrong. Please try again.",_.recentlySuccessfulTimeout=2e3,_.ignore=["busy","successful","errors","progress","originalData","recentlySuccessful","recentlySuccessfulTimeoutId"];const w=_},37131(t,e,r){r.r(e),r.d(e,{default:()=>f});var a=r(63216),s=r(72505),o=r.n(s);function n(){var t,e,r="function"==typeof Symbol?Symbol:{},a=r.iterator||"@@iterator",s=r.toStringTag||"@@toStringTag";function o(r,a,s,o){var n=a&&a.prototype instanceof u?a:u,l=Object.create(n.prototype);return i(l,"_invoke",function(r,a,s){var o,n,i,u=0,l=s||[],m=!1,f={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return o=e,n=0,i=t,f.n=r,c}};function d(r,a){for(n=r,i=a,e=0;!m&&u&&!s&&e<l.length;e++){var s,o=l[e],d=f.p,h=o[2];r>3?(s=h===a)&&(i=o[(n=o[4])?5:(n=3,3)],o[4]=o[5]=t):o[0]<=d&&((s=r<2&&d<o[1])?(n=0,f.v=a,f.n=o[1]):d<h&&(s=r<3||o[0]>a||a>h)&&(o[4]=r,o[5]=a,f.n=h,n=0))}if(s||r>1)return c;throw m=!0,a}return function(s,l,h){if(u>1)throw TypeError("Generator is already running");for(m&&1===l&&d(l,h),n=l,i=h;(e=n<2?t:i)||!m;){o||(n?n<3?(n>1&&(f.n=-1),d(n,i)):f.n=i:f.v=i);try{if(u=2,o){if(n||(s="next"),e=o[s]){if(!(e=e.call(o,i)))throw TypeError("iterator result is not an object");if(!e.done)return e;i=e.value,n<2&&(n=0)}else 1===n&&(e=o.return)&&e.call(o),n<2&&(i=TypeError("The iterator does not provide a '"+s+"' method"),n=1);o=t}else if((e=(m=f.n<0)?i:r.call(a,f))!==c)break}catch(e){o=t,n=1,i=e}finally{u=1}}return{value:e,done:m}}}(r,s,o),!0),l}var c={};function u(){}function l(){}function m(){}e=Object.getPrototypeOf;var f=[][a]?e(e([][a]())):(i(e={},a,function(){return this}),e),d=m.prototype=u.prototype=Object.create(f);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,i(t,s,"GeneratorFunction")),t.prototype=Object.create(d),t}return l.prototype=m,i(d,"constructor",m),i(m,"constructor",l),l.displayName="GeneratorFunction",i(m,s,"GeneratorFunction"),i(d),i(d,s,"Generator"),i(d,a,function(){return this}),i(d,"toString",function(){return"[object Generator]"}),(n=function(){return{w:o,m:h}})()}function i(t,e,r,a){var s=Object.defineProperty;try{s({},"",{})}catch(t){s=0}i=function(t,e,r,a){function o(e,r){i(t,e,function(t){return this._invoke(e,r,t)})}e?s?s(t,e,{value:r,enumerable:!a,configurable:!a,writable:!a}):t[e]=r:(o("next",0),o("throw",1),o("return",2))},i(t,e,r,a)}function c(t,e,r,a,s,o,n){try{var i=t[o](n),c=i.value}catch(t){return void r(t)}i.done?e(c):Promise.resolve(c).then(a,s)}function u(t){return function(){var e=this,r=arguments;return new Promise(function(a,s){var o=t.apply(e,r);function n(t){c(o,a,s,n,i,"next",t)}function i(t){c(o,a,s,n,i,"throw",t)}n(void 0)})}}const l={middleware:["auth","check-permissions"],metaInfo:function(){return{title:this.$t("Edit Account")}},data:function(){return{breadcrumbsCurrent:"Edit Account",breadcrumbs:[{name:"Edit Account",url:"home"},{name:"Cashbook",url:""},{name:"Accounts",url:"accounts.index"},{name:"Edit",url:""}],form:new a.Ay({accountLabel:"",bankName:"",branchName:"",accountNumber:"",date:"",image:"",note:"",status:1}),url:null,loading:!0}},mounted:function(){this.getAccount()},methods:{getAccount:function(){var t=this;return u(n().m(function e(){var r,a;return n().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,o().get(window.location.origin+"/api/accounts/"+t.$route.params.slug);case 1:r=e.v,a=r.data,t.form.accountLabel=a.data.accountLabel,t.form.bankName=a.data.bankName,t.form.branchName=a.data.branchName,t.form.accountNumber=a.data.accountNumber,t.form.date=a.data.date,t.url=a.data.image,t.form.note=a.data.note,t.form.status=a.data.status;case 2:return e.a(2)}},e)}))()},updateAccount:function(){var t=this;return u(n().m(function e(){return n().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,t.form.patch(window.location.origin+"/api/accounts/"+t.$route.params.slug).then(function(){toast.fire({type:"success",title:t.$t("Account updated successfully")}),t.$router.push({name:"accounts.index"})}).catch(function(){toast.fire({type:"error",title:t.$t("Opps...something went wrong")})});case 1:return e.a(2)}},e)}))()},onFileChange:function(t){var e=this,r=t.target.files[0],a=new FileReader;r.size<2111775&&("image/jpeg"===r.type||"image/png"===r.type||"image/gif"===r.type)?(a.onloadend=function(){e.form.image=a.result},a.readAsDataURL(r),this.url=URL.createObjectURL(r)):Swal.fire(this.$t("Error!"),this.$t("Please select a valid thumbnail with size less than 2 MB"),"error")}}};var m=(0,r(14486).A)(l,function(){var t=this,e=t._self._c;return e("div",[e("breadcrumbs",{attrs:{items:t.breadcrumbs,current:t.breadcrumbsCurrent}}),t._v(" "),e("div",{staticClass:"row"},[e("div",{staticClass:"col-lg-12"},[e("div",{staticClass:"card"},[e("div",{staticClass:"card-header"},[e("h3",{staticClass:"card-title"},[t._v("\n "+t._s(t.$t("Edit account"))+"\n ")]),t._v(" "),e("router-link",{staticClass:"btn btn-dark float-right",attrs:{to:{name:"accounts.index"}}},[e("i",{staticClass:"fas fa-long-arrow-alt-left"}),t._v(" "+t._s(t.$t("Back"))+"\n ")])],1),t._v(" "),e("form",{attrs:{role:"form"},on:{submit:function(e){return e.preventDefault(),t.updateAccount.apply(null,arguments)},keydown:function(e){return t.form.onKeydown(e)}}},[e("div",{staticClass:"card-body"},[e("div",{staticClass:"row"},[e("div",{staticClass:"form-group col-md-12"},[e("label",{attrs:{for:"bankName"}},[t._v(t._s(t.$t("Bank Name"))+"\n "),e("span",{staticClass:"required"},[t._v("*")])]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.form.bankName,expression:"form.bankName"}
2],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("bankName")},attrs:{id:"bankName",type:"text",name:"bankName",placeholder:t.$t("Enter a bank name")},domProps:{value:t.form.bankName},on:{input:function(e){e.target.composing||t.$set(t.form,"bankName",e.target.value)}}}),t._v(" "),e("has-error",{attrs:{form:t.form,field:"bankName"}})],1)]),t._v(" "),e("div",{staticClass:"row"},[e("div",{staticClass:"form-group col-md-6"},[e("label",{attrs:{for:"branchName"}},[t._v(t._s(t.$t("Branch Name"))+"\n ")]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.form.branchName,expression:"form.branchName"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("branchName")},attrs:{id:"branchName",type:"text",name:"branchName",placeholder:t.$t("Enter a branch name")},domProps:{value:t.form.branchName},on:{input:function(e){e.target.composing||t.$set(t.form,"branchName",e.target.value)}}}),t._v(" "),e("has-error",{attrs:{form:t.form,field:"branchName"}})],1),t._v(" "),e("div",{staticClass:"form-group col-md-6"},[e("label",{attrs:{for:"accountNumber"}},[t._v(t._s(t.$t("Account Number"))+"\n "),e("span",{staticClass:"required"},[t._v("*")])]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.form.accountNumber,expression:"form.accountNumber"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("accountNumber")},attrs:{id:"accountNumber",type:"text",name:"accountNumber",placeholder:t.$t("Enter an account number")},domProps:{value:t.form.accountNumber},on:{input:function(e){e.target.composing||t.$set(t.form,"accountNumber",e.target.value)}}}),t._v(" "),e("has-error",{attrs:{form:t.form,field:"accountNumber"}})],1)]),t._v(" "),e("div",{staticClass:"row"},[e("div",{staticClass:"form-group col-md-6"},[e("label",{attrs:{for:"image"}},[t._v(t._s(t.$t("Image")))]),t._v(" "),e("div",{staticClass:"custom-file"},[e("input",{staticClass:"custom-file-input",class:{"is-invalid":t.form.errors.has("image")},attrs:{id:"image",type:"file",name:"image"},on:{change:t.onFileChange}}),t._v(" "),e("label",{staticClass:"custom-file-label",attrs:{for:"image"}},[t._v(t._s(t.$t("Choose file")))])]),t._v(" "),e("has-error",{attrs:{form:t.form,field:"image"}}),t._v(" "),e("div",{staticClass:"bg-light mt-4 w-25"},[t.url?e("img",{staticClass:"img-fluid",attrs:{src:t.url,alt:t.$t("Attached Image")}}):t._e()])],1),t._v(" "),e("div",{staticClass:"form-group col-md-3"},[e("label",{attrs:{for:"date"}},[t._v(t._s(t.$t("Date")))]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.form.date,expression:"form.date"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("date")},attrs:{id:"date",type:"date",name:"date"},domProps:{value:t.form.date},on:{input:function(e){e.target.composing||t.$set(t.form,"date",e.target.value)}}}),t._v(" "),e("has-error",{attrs:{form:t.form,field:"date"}})],1),t._v(" "),e("div",{staticClass:"form-group col-md-3"},[e("label",{attrs:{for:"status"}},[t._v(t._s(t.$t("Status")))]),t._v(" "),e("select",{directives:[{name:"model",rawName:"v-model",value:t.form.status,expression:"form.status"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("status")},attrs:{id:"status"},on:{change:function(e){var r=Array.prototype.filter.call(e.target.options,function(t){return t.selected}).map(function(t){return"_value"in t?t._value:t.value});t.$set(t.form,"status",e.target.multiple?r:r[0])}}},[e("option",{attrs:{value:"1"}},[t._v(t._s(t.$t("Active")))]),t._v(" "),e("option",{attrs:{value:"0"}},[t._v(t._s(t.$t("Inactive")))])]),t._v(" "),e("has-error",{attrs:{form:t.form,field:"status"}})],1)]),t._v(" "),e("div",{staticClass:"form-group"},[e("label",{attrs:{for:"note"}},[t._v(t._s(t.$t("Note")))]),t._v(" "),e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.form.note,expression:"form.note"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("note")},attrs:{id:"note",placeholder:t.$t("Write your note here!")},domProps:{value:t.form.note},on:{input:function(e){e.target.composing||t.$set(t.form,"note",e.target.value)}}}),t._v(" "),e("has-error",{attrs:{form:t.form,field:"note"}})],1)]),t._v(" "),e("div",{staticClass:"card-footer"},[e("v-button",{staticClass:"btn btn-primary",attrs:{loading:t.form.busy}},[e("i",{staticClass:"fas fa-edit"}),t._v(" "+t._s(t.$t("Save changes"))+"\n ")])],1)])])])])],1
2)},[],!1,null,null,null);const f=m.exports}}]);
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.