(self.webpackChunk=self.webpackChunk||[]).push([[847],{232:(e,t,a)=>{"use strict";a.r(t);var n=a(7760),o=a.n(n),s=a(7152),i=a(4605);window.$=window.jQuery=a(9755),window.axios=a(9669),window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";var r=document.head.querySelector('meta[name="csrf-token"]');r?window.axios.defaults.headers.common["X-CSRF-TOKEN"]=r.content:console.error("CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token");var c=document.head.querySelector('meta[name="locale"]');localStorage.locale=c?c.content:"en_US",a(6891),a(3734),a(7632),a(5432),window.vuei18n=s.Z,window.uiv=i,o().use(vuei18n),o().use(i),window.Vue=o()},9899:(e,t,a)=>{"use strict";a.d(t,{Z:()=>m});var n=a(7760),o=a.n(n),s=a(629),i=a(4478),r=a(3465);const c={namespaced:!0,state:function(){return{transactionType:"any",groupTitle:"",transactions:[],customDateFields:{interest_date:!1,book_date:!1,process_date:!1,due_date:!1,payment_date:!1,invoice_date:!1},defaultTransaction:(0,i.f$)(),defaultErrors:(0,i.kQ)()}},getters:{transactions:function(e){return e.transactions},groupTitle:function(e){return e.groupTitle},transactionType:function(e){return e.transactionType},accountToTransaction:function(e){return e.accountToTransaction},defaultTransaction:function(e){return e.defaultTransaction},sourceAllowedTypes:function(e){return e.sourceAllowedTypes},destinationAllowedTypes:function(e){return e.destinationAllowedTypes},allowedOpposingTypes:function(e){return e.allowedOpposingTypes},customDateFields:function(e){return e.customDateFields}},actions:{},mutations:{addTransaction:function(e){var t=r(e.defaultTransaction);t.errors=r(e.defaultErrors),e.transactions.push(t)},resetErrors:function(e,t){e.transactions[t.index].errors=r(e.defaultErrors)},resetTransactions:function(e){e.transactions=[]},setGroupTitle:function(e,t){e.groupTitle=t.groupTitle},setCustomDateFields:function(e,t){e.customDateFields=t},deleteTransaction:function(e,t){e.transactions.splice(t.index,1),e.transactions.length},setTransactionType:function(e,t){e.transactionType=t},setAllowedOpposingTypes:function(e,t){e.allowedOpposingTypes=t},setAccountToTransaction:function(e,t){e.accountToTransaction=t},updateField:function(e,t){e.transactions[t.index][t.field]=t.value},setTransactionError:function(e,t){e.transactions[t.index].errors[t.field]=t.errors},setDestinationAllowedTypes:function(e,t){e.destinationAllowedTypes=t},setSourceAllowedTypes:function(e,t){e.sourceAllowedTypes=t}}};const l={namespaced:!0,state:function(){return{}},getters:{},actions:{},mutations:{}};const u={namespaced:!0,state:function(){return{viewRange:"default",start:null,end:null,defaultStart:null,defaultEnd:null}},getters:{start:function(e){return e.start},end:function(e){return e.end},defaultStart:function(e){return e.defaultStart},defaultEnd:function(e){return e.defaultEnd},viewRange:function(e){return e.viewRange}},actions:{initialiseStore:function(e){"default"===e.state.viewRange&&axios.get("./api/v1/preferences/viewRange").then((function(t){var a=t.data.data.attributes.data;e.commit("setViewRange",a),e.dispatch("setDatesFromViewRange")})).catch((function(t){e.commit("setViewRange","1M"),e.dispatch("setDatesFromViewRange")}))},setDatesFromViewRange:function(e){if(localStorage.viewRangeStart&&e.commit("setStart",new Date(localStorage.viewRangeStart)),localStorage.viewRangeEnd&&e.commit("setEnd",new Date(localStorage.viewRangeEnd)),localStorage.viewRangeDefaultStart&&e.commit("setDefaultStart",new Date(localStorage.viewRangeDefaultStart)),localStorage.viewRangeDefaultEnd&&e.commit("setDefaultEnd",new Date(localStorage.viewRangeDefaultEnd)),null===e.getters.end||null===e.getters.start){var t,a;switch(e.getters.viewRange){case"1D":t=new Date,a=new Date(t.getTime()),t.setHours(0,0,0,0),a.setHours(23,59,59,999);break;case"1W":t=new Date,a=new Date(t.getTime());var n=t.getDate()-t.getDay()+(0===t.getDay()?-6:1);t.setDate(n),t.setHours(0,0,0,0);var o=a.getDate()-(a.getDay()-1)+6;a.setDate(o),a.setHours(23,59,59,999);break;case"1M":t=new Date,(t=new Date(t.getFullYear(),t.getMonth(),1)).setHours(0,0,0,0),(a=new Date(t.getFullYear(),t.getMonth()+1,0)).setHours(23,59,59,999);break;case"3M":t=new Date,a=new Date;var s=Math.floor((t.getMonth()+3)/3)-1;(t=new Date(t.getFullYear(),[0,3,6,9][s],1)).setHours(0,0,0,0),a=new Date(a.getFullYear(),[2,5,8,11][s],1),(a=new Date(a.getFullYear(),a.getMonth()+1,0)).setHours(23,59,59,999);break;case"6M":t=new Date,a=new Date;var i=t.getMonth()<=5?0:1;(t=new Date(t.getFullYear(),[0,6][i],1)).setHours(0,0,0,0),a=new Date(a.getFullYear(),[5,11][i],1),(a=new Date(a.getFullYear(),a.getMonth()+1,0)).setHours(23,59,59,999);break;case"1Y":t=new Date,a=new Date,t=new Date(t.getFullYear(),0,1),a=new Date(a.getFullYear(),11,31),t.setHours(0,0,0,0),a.setHours(23,59,59,999)}e.commit("setStart",t),e.commit("setEnd",a),e.commit("setDefaultStart",t),e.commit("setDefaultEnd",a)}}},mutations:{setStart:function(e,t){e.start=t,window.localStorage.setItem("viewRangeStart",t)},setEnd:function(e,t){e.end=t,window.localStorage.setItem("viewRangeEnd",t)},setDefaultStart:function(e,t){e.defaultStart=t,window.localStorage.setItem("viewRangeDefaultStart",t)},setDefaultEnd:function(e,t){e.defaultEnd=t,window.localStorage.setItem("viewRangeDefaultEnd",t)},setViewRange:function(e,t){e.viewRange=t}}};var d=function(){return{listPageSize:33,timezone:""}},_={initialiseStore:function(e){localStorage.listPageSize&&(d.listPageSize=localStorage.listPageSize,e.commit("setListPageSize",{length:localStorage.listPageSize})),localStorage.listPageSize||axios.get("./api/v1/preferences/listPageSize").then((function(t){e.commit("setListPageSize",{length:parseInt(t.data.data.attributes.data)})})),localStorage.timezone&&(d.timezone=localStorage.timezone,e.commit("setTimezone",{timezone:localStorage.timezone})),localStorage.timezone||axios.get("./api/v1/configuration/app.timezone").then((function(t){e.commit("setTimezone",{timezone:t.data.data.value})}))}};const p={namespaced:!0,state:d,getters:{listPageSize:function(e){return e.listPageSize},timezone:function(e){return e.timezone}},actions:_,mutations:{setListPageSize:function(e,t){var a=parseInt(t.length);0!==a&&(e.listPageSize=a,localStorage.listPageSize=a)},setTimezone:function(e,t){""!==t.timezone&&(e.timezone=t.timezone,localStorage.timezone=t.timezone)}}};const g={namespaced:!0,state:function(){return{orderMode:!1,activeFilter:1}},getters:{orderMode:function(e){return e.orderMode},activeFilter:function(e){return e.activeFilter}},actions:{},mutations:{setOrderMode:function(e,t){e.orderMode=t},setActiveFilter:function(e,t){e.activeFilter=t}}};o().use(s.ZP);const m=new s.ZP.Store({namespaced:!0,modules:{root:p,transactions:{namespaced:!0,modules:{create:c,edit:l}},accounts:{namespaced:!0,modules:{index:g}},dashboard:{namespaced:!0,modules:{index:u}}},strict:false,plugins:[],state:{currencyPreference:{},locale:"en-US",listPageSize:50},mutations:{setCurrencyPreference:function(e,t){e.currencyPreference=t.payload},initialiseStore:function(e){if(localStorage.locale)e.locale=localStorage.locale;else{var t=document.head.querySelector('meta[name="locale"]');t&&(e.locale=t.content,localStorage.locale=t.content)}}},getters:{currencyCode:function(e){return e.currencyPreference.code},currencyPreference:function(e){return e.currencyPreference},currencyId:function(e){return e.currencyPreference.id},locale:function(e){return e.locale}},actions:{updateCurrencyPreference:function(e){localStorage.currencyPreference?e.commit("setCurrencyPreference",{payload:JSON.parse(localStorage.currencyPreference)}):axios.get("./api/v1/currencies/default").then((function(t){var a={id:parseInt(t.data.data.id),name:t.data.data.attributes.name,symbol:t.data.data.attributes.symbol,code:t.data.data.attributes.code,decimal_places:parseInt(t.data.data.attributes.decimal_places)};localStorage.currencyPreference=JSON.stringify(a),e.commit("setCurrencyPreference",{payload:a})})).catch((function(t){console.error(t),e.commit("setCurrencyPreference",{payload:{id:1,name:"Euro",symbol:"€",code:"EUR",decimal_places:2}})}))}}})},157:(e,t,a)=>{e.exports=new vuei18n({locale:document.documentElement.lang,fallbackLocale:"en",messages:{bg:a(7154),cs:a(6407),de:a(4726),en:a(3340),"en-us":a(3340),"en-gb":a(6318),es:a(5394),el:a(3636),fr:a(2551),hu:a(995),it:a(9112),nl:a(4671),nb:a(9085),pl:a(6238),fi:a(7868),"pt-br":a(6586),"pt-pt":a(8664),ro:a(1102),ru:a(753),"zh-tw":a(1715),"zh-cn":a(4556),sk:a(7049),sv:a(7921),vi:a(1497)}})},9885:(e,t,a)=>{"use strict";var n=a(9899),o=a(3324),s=a(7661),i=a(6849),r=a(5524),c=a(4478);function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var u=a(3465);const d={name:"Edit",created:function(){var e=window.location.pathname.split("/");this.groupId=parseInt(e[e.length-1]),this.getTransactionGroup(),this.getAllowedOpposingTypes(),this.getCustomFields()},data:function(){return{successMessage:"",errorMessage:"",warningMessage:"",transactions:[],originalTransactions:[],groupTitle:"",originalGroupTitle:"",transactionType:"any",groupId:0,groupTitleErrors:[],customFields:{},returnedGroupId:0,returnedGroupTitle:"",date:"",originalDate:"",submittedTransaction:!1,submittedLinks:!1,submittedAttachments:!1,inError:!1,allowedOpposingTypes:{},destinationAllowedTypes:[],sourceAllowedTypes:[],enableSubmit:!0,stayHere:!1}},components:{Alert:o.Z,SplitPills:s.Z,SplitForm:i.Z,TransactionGroupTitle:r.Z},watch:{submittedTransaction:function(){this.finalizeSubmit()},submittedLinks:function(){this.finalizeSubmit()},submittedAttachments:function(){this.finalizeSubmit()}},methods:{getTransactionGroup:function(){var e=this;axios.get("./api/v1/transactions/"+this.groupId).then((function(t){e.parseTransactionGroup(t.data)})).catch((function(e){}))},parseTransactionGroup:function(e){var t=e.data.attributes,a=t.transactions.reverse();for(var n in this.groupTitle=t.group_title,this.originalGroupTitle=t.group_title,a)if(a.hasOwnProperty(n)&&/^0$|^[1-9]\d*$/.test(n)&&n<=4294967294){var o=this.parseTransaction(parseInt(n),a[n]);this.transactions.push(o),this.originalTransactions.push(u(o)),this.parseLinks(parseInt(o.transaction_journal_id),parseInt(n))}},parseTransaction:function(e,t){var a;0===e&&(this.transactionType=t.type.charAt(0).toUpperCase()+t.type.slice(1),this.sourceAllowedTypes=[t.source_type],this.destinationAllowedTypes=[t.destination_type],this.date=t.date.substring(0,16),this.originalDate=t.date.substring(0,16));var n=(0,c.f$)();return n.description=t.description,n.transaction_journal_id=parseInt(t.transaction_journal_id),n.source_account_id=t.source_id,n.source_account_name=t.source_name,n.source_account_type=t.source_type,n.destination_account_id=t.destination_id,n.destination_account_name=t.destination_name,n.destination_account_type=t.destination_type,n.amount=t.amount,n.currency_id=t.currency_id,n.foreign_amount=t.foreign_amount,n.foreign_currency_id=t.foreign_currency_id,n.category=t.category_name,n.budget_id=t.budget_id,n.bill_id=null!==(a=t.bill_id)&&void 0!==a?a:0,n.tags=t.tags,n.interest_date=t.interest_date?t.interest_date.substr(0,10):"",n.book_date=t.book_date?t.book_date.substr(0,10):"",n.process_date=t.process_date?t.process_date.substr(0,10):"",n.due_date=t.due_date?t.due_date.substr(0,10):"",n.payment_date=t.payment_date?t.payment_date.substr(0,10):"",n.invoice_date=t.invoice_date?t.invoice_date.substr(0,10):"",n.internal_reference=t.internal_reference,n.external_url=t.external_uri,n.external_id=t.external_id,n.notes=t.notes,n.location={zoom_level:t.zoom_level,longitude:t.longitude,latitude:t.latitude},n.zoom_level=t.zoom_level,n.longitude=t.longitude,n.latitude=t.latitude,n.errors=(0,c.kQ)(),n},parseLinks:function(e,t){var a=this;axios.get("./api/v1/transaction-journals/"+e+"/links").then((function(n){var o=n.data.data;for(var s in o)o.hasOwnProperty(s)&&/^0$|^[1-9]\d*$/.test(s)&&s<=4294967294&&a.parseLink(o[s],e,t)}))},parseLink:function(e,t,a){var n=this,o=[],s=parseInt(e.attributes.inward_id),i="inward";s===t&&(s=parseInt(e.attributes.outward_id),i="outward"),o.push(new Promise((function(n){n({link:e,journalId:t,opposingId:s,index:a,direction:i})}))),o.push(axios.get("./api/v1/transaction-journals/"+s)),o.push(axios.get("./api/v1/transaction_links/"+e.attributes.link_type_id)),Promise.all(o).then((function(t){var a=t[1].data.data.attributes.transactions,o=t[0].opposingId,s={};for(var i in a)a.hasOwnProperty(i)&&/^0$|^[1-9]\d*$/.test(i)&&i<=4294967294&&a[i].transaction_journal_id===o&&(s=a[i]);var r=t[0].index,c=t[0].direction,l=t[2].data.data.id,u={id:e.id,link_type_id:l+"-"+c,transaction_group_id:t[1].data.data.id,transaction_journal_id:s.transaction_journal_id,description:s.description,type:s.type,currency_code:s.currency_code,amount:s.amount};n.transactions[r].links.push(u),n.originalTransactions[r].links.push(u)}))},getAllowedOpposingTypes:function(){var e=this;axios.get("./api/v1/configuration/firefly.allowed_opposing_types").then((function(t){e.allowedOpposingTypes=t.data.data.value}))},getCustomFields:function(){var e=this;axios.get("./api/v1/preferences/transaction_journal_optional_fields").then((function(t){e.customFields=t.data.data.attributes.data}))},uploadedAttachment:function(e){},storeLocation:function(e){this.transactions[e.index].zoom_level=e.zoomLevel,this.transactions[e.index].longitude=e.lng,this.transactions[e.index].latitude=e.lat},storeAccountValue:function(e){var t=e.direction,a=e.index;this.transactions[a][t+"_account_id"]=e.id,this.transactions[a][t+"_account_type"]=e.type,this.transactions[a][t+"_account_name"]=e.name},storeDate:function(e){this.date=e.date},storeTime:function(e){this.time=e.time},storeField:function(e){var t=e.field;"category"===t&&(t="category_name"),this.transactions[e.index][t]=e.value},removeTransaction:function(e){this.transactions.splice(e.index,1),this.originalTransactions=[]},storeGroupTitle:function(e){this.groupTitle=e},selectedAttachments:function(e){for(var t in this.transactions)this.transactions.hasOwnProperty(t)&&/^0$|^[1-9]\d*$/.test(t)&&t<=4294967294&&parseInt(this.transactions[t].transaction_journal_id)===parseInt(e)&&(this.transactions[t].selectedAttachments=!0)},addTransaction:function(e){e.preventDefault();var t=(0,c.f$)();t.errors=(0,c.kQ)(),this.transactions.push(t)},submitTransaction:function(e){e.preventDefault();var t={transactions:[]},a=!1,n=!1,o=!1;this.groupTitle!==this.originalGroupTitle&&(t.group_title=this.groupTitle,a=!0);this.originalTransactions.length;var s=this.transactions.length;for(var i in s>1&&void 0===t.group_title&&(null===this.originalGroupTitle||""===this.originalGroupTitle)&&(t.group_title=this.transactions[0].description),this.transactions)if(this.transactions.hasOwnProperty(i)&&/^0$|^[1-9]\d*$/.test(i)&&i<=4294967294){var r=this.transactions[i],c=this.originalTransactions.hasOwnProperty(i)?this.originalTransactions[i]:{},d={},_=["description","source_account_id","source_account_name","destination_account_id","destination_account_name","amount","foreign_amount","foreign_currency_id","category_name","budget_id","bill_id","interest_date","book_date","due_date","payment_date","invoice_date","external_url","internal_reference","external_id","notes","zoom_level","longitude","latitude"];for(var p in i>0&&(d.type=this.transactionType.toLowerCase(),"Deposit"!==this.transactionType&&"Transfer"!==this.transactionType||(r.destination_account_name=this.originalTransactions[0].destination_account_name,r.destination_account_id=this.originalTransactions[0].destination_account_id),"Withdrawal"!==this.transactionType&&"Transfer"!==this.transactionType||(r.source_account_name=this.originalTransactions[0].source_account_name,r.source_account_id=this.originalTransactions[0].source_account_id)),_)if(_.hasOwnProperty(p)&&/^0$|^[1-9]\d*$/.test(p)&&p<=4294967294){var g=_[p],m=g;if(null===r[g]&&void 0===c[g])continue;if(r[g]!==c[g]){if("foreign_amount"===m&&""===r[g])continue;if("foreign_currency_id"===m&&0===r[g])continue;"source_account_id"===m&&(m="source_id"),"source_account_name"===m&&(m="source_name"),"destination_account_id"===m&&(m="destination_id"),"destination_account_name"===m&&(m="destination_name"),d[m]=r[g],a=!0}}if(0!==r.piggy_bank_id&&(d.piggy_bank_id=r.piggy_bank_id,a=!0),JSON.stringify(r.tags)!==JSON.stringify(c.tags)){if(d.tags=[],0!==r.tags.length)for(var h in r.tags)if(r.tags.hasOwnProperty(h)&&/^0$|^[1-9]\d*$/.test(h)&&h<=4294967294){var y=r.tags[h];"object"===l(y)&&null!==y&&d.tags.push(y.text),"string"==typeof y&&d.tags.push(y)}a=!0}if(this.compareLinks(r.links)!==this.compareLinks(c.links)&&(n=!0),void 0!==r.selectedAttachments&&!0===r.selectedAttachments&&(o=!0),this.date!==this.originalDate&&(a=!0,d.date=this.date),0===Object.keys(d).length&&s>1)d.transaction_journal_id=c.transaction_journal_id,t.transactions.push(u(d)),a=!0;else if(0!==Object.keys(d).length){var f;d.transaction_journal_id=null!==(f=c.transaction_journal_id)&&void 0!==f?f:0,t.transactions.push(u(d)),a=!0}}a&&this.submitUpdate(t,n,o),a||(this.submittedTransaction=!0),n||(this.submittedLinks=!0),o||(this.submittedAttachments=!0),!a&&n&&this.submitTransactionLinks()},compareLinks:function(e){var t=[];for(var a in e)e.hasOwnProperty(a)&&/^0$|^[1-9]\d*$/.test(a)&&a<=4294967294&&t.push({amount:e[a].amount,currency_code:e[a].currency_code,description:e[a].description,link_type_id:e[a].link_type_id,transaction_group_id:e[a].transaction_group_id,type:e[a].type});return JSON.stringify(t)},submitUpdate:function(e,t,a){var n=this;this.inError=!1;var o="./api/v1/transactions/"+this.groupId;axios.put(o,e).then((function(e){n.submittedTransaction=!0,t&&n.submitTransactionLinks(),n.returnedGroupId=parseInt(e.data.data.id),n.returnedGroupTitle=null===e.data.data.attributes.group_title?e.data.data.attributes.transactions[0].description:e.data.data.attributes.group_title})).catch((function(e){console.log("error :("),console.log(e.response.data),n.enableSubmit=!0,n.submittedTransaction=!0,n.submittedAttachments=!0,n.submittedLinks=!0,n.inError=!0,n.parseErrors(e.response.data)}))},parseErrors:function(e){for(var t in this.transactions)this.transactions.hasOwnProperty(t)&&/^0$|^[1-9]\d*$/.test(t)&&t<=4294967294&&this.resetErrors({index:t});var a,n,o;for(var s in this.successMessage="",this.errorMessage=this.$t("firefly.errors_submission"),void 0===e.errors&&(this.successMessage="",this.errorMessage=e.message),e.errors)if(e.errors.hasOwnProperty(s)){if("group_title"===s){this.groupTitleErrors=e.errors[s];continue}if("group_title"!==s)switch(n=parseInt(s.split(".")[1]),o=s.split(".")[2]){case"amount":case"description":case"date":case"tags":a={index:n,field:o,errors:e.errors[s]},this.setTransactionError(a);break;case"budget_id":a={index:n,field:"budget",errors:e.errors[s]},this.setTransactionError(a);break;case"bill_id":a={index:n,field:"bill",errors:e.errors[s]},this.setTransactionError(a);break;case"piggy_bank_id":a={index:n,field:"piggy_bank",errors:e.errors[s]},this.setTransactionError(a);break;case"category_name":a={index:n,field:"category",errors:e.errors[s]},this.setTransactionError(a);break;case"source_name":case"source_id":a={index:n,field:"source",errors:e.errors[s]},this.setTransactionError(a);break;case"destination_name":case"destination_id":a={index:n,field:"destination",errors:e.errors[s]},this.setTransactionError(a);break;case"foreign_amount":case"foreign_currency":a={index:n,field:"foreign_amount",errors:e.errors[s]},this.setTransactionError(a)}this.transactions[n]}},setTransactionError:function(e){this.transactions[e.index].errors[e.field]=e.errors},resetErrors:function(e){this.transactions[e.index].errors=u((0,c.kQ)())},deleteOriginalLinks:function(e){for(var t in e.links)if(e.links.hasOwnProperty(t)&&/^0$|^[1-9]\d*$/.test(t)&&t<=4294967294){var a="/api/v1/transaction_links/"+e.links[t].id;axios.delete(a).then((function(e){}))}},submitTransactionLinks:function(){var e=0,t=[];for(var a in this.transactions)if(this.transactions.hasOwnProperty(a)&&/^0$|^[1-9]\d*$/.test(a)&&a<=4294967294){var n=this.transactions[a],o=this.originalTransactions.hasOwnProperty(a)?this.originalTransactions[a]:{},s=this.compareLinks(n.links),i=this.compareLinks(o.links);if(s!==i)for(var r in"[]"!==i&&this.deleteOriginalLinks(o),n.links)if(n.links.hasOwnProperty(r)&&/^0$|^[1-9]\d*$/.test(r)&&r<=4294967294){var c=n.links[r],l={inward_id:n.transaction_journal_id,outward_id:n.transaction_journal_id,link_type_id:"something"},u=c.link_type_id.split("-");l.link_type_id=u[0],"inward"===u[1]&&(l.inward_id=c.transaction_journal_id),"outward"===u[1]&&(l.outward_id=c.transaction_journal_id),e++,t.push(axios.post("./api/v1/transaction_links",l).then((function(e){})))}}0!==e?Promise.all(t).then((function(){this.submittedLinks=!0})):this.submittedLinks=!0},finalizeSubmit:function(){if(this.submittedTransaction&&this.submittedAttachments&&this.submittedLinks){var e,t;if(!0===this.stayHere&&!1===this.inError&&0===this.returnedGroupId&&(this.errorMessage="",this.successMessage="",this.warningMessage=this.$t("firefly.transaction_updated_no_changes",{ID:this.returnedGroupId,title:this.returnedGroupTitle})),!1===this.stayHere&&!1===this.inError&&0===this.returnedGroupId)window.location.href=(null!==(e=window.previousURL)&&void 0!==e?e:"/")+"?transaction_group_id="+this.groupId+"&message=no_change";if(!0===this.stayHere&&!1===this.inError&&0!==this.returnedGroupId&&(this.errorMessage="",this.warningMessage="",this.successMessage=this.$t("firefly.transaction_updated_link",{ID:this.returnedGroupId,title:this.returnedGroupTitle})),!1===this.stayHere&&!1===this.inError&&0!==this.returnedGroupId)window.location.href=(null!==(t=window.previousURL)&&void 0!==t?t:"/")+"?transaction_group_id="+this.groupId+"&message=updated";for(var a in this.enableSubmit=!0,this.submittedTransaction=!1,this.submittedLinks=!1,this.submittedAttachments=!1,this.inError=!1,this.transactions)this.transactions.hasOwnProperty(a)&&/^0$|^[1-9]\d*$/.test(a)&&a<=4294967294&&this.transactions.hasOwnProperty(a)}}}};const _=(0,a(1900).Z)(d,(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("Alert",{attrs:{message:e.errorMessage,type:"danger"}}),e._v(" "),a("Alert",{attrs:{message:e.successMessage,type:"success"}}),e._v(" "),a("Alert",{attrs:{message:e.warningMessage,type:"warning"}}),e._v(" "),a("form",{attrs:{autocomplete:"off"},on:{submit:e.submitTransaction}},[a("SplitPills",{attrs:{transactions:e.transactions}}),e._v(" "),a("div",{staticClass:"tab-content"},e._l(this.transactions,(function(t,n){return a("SplitForm",{key:n,attrs:{count:e.transactions.length,transaction:t,"allowed-opposing-types":e.allowedOpposingTypes,"custom-fields":e.customFields,date:e.date,index:n,"transaction-type":e.transactionType,"destination-allowed-types":e.destinationAllowedTypes,"source-allowed-types":e.sourceAllowedTypes,"allow-switch":!1,"submitted-transaction":e.submittedTransaction},on:{"uploaded-attachments":function(t){return e.uploadedAttachment(t)},"set-marker-location":function(t){return e.storeLocation(t)},"set-account":function(t){return e.storeAccountValue(t)},"set-date":function(t){return e.storeDate(t)},"set-field":function(t){return e.storeField(t)},"remove-transaction":function(t){return e.removeTransaction(t)},"selected-attachments":function(t){return e.selectedAttachments(t)}}})})),1),e._v(" "),a("div",{staticClass:"row"},[a("div",{staticClass:"col-xl-6 col-lg-6 col-md-12 col-sm-12 col-xs-12"},[e.transactions.length>1?a("div",{staticClass:"card"},[a("div",{staticClass:"card-body"},[a("div",{staticClass:"row"},[a("div",{staticClass:"col"},[a("TransactionGroupTitle",{attrs:{errors:this.groupTitleErrors},on:{"set-group-title":function(t){return e.storeGroupTitle(t)}},model:{value:this.groupTitle,callback:function(t){e.$set(this,"groupTitle",t)},expression:"this.groupTitle"}})],1)])])]):e._e()]),e._v(" "),a("div",{staticClass:"col-xl-6 col-lg-6 col-md-12 col-sm-12 col-xs-12"},[a("div",{staticClass:"card"},[a("div",{staticClass:"card-body"},[a("div",{staticClass:"row"},[a("div",{staticClass:"col"},[a("div",{staticClass:"text-xs d-none d-lg-block d-xl-block"},[e._v("\n \n ")]),e._v(" "),a("button",{staticClass:"btn btn-outline-primary btn-block",attrs:{type:"button"},on:{click:e.addTransaction}},[a("i",{staticClass:"far fa-clone"}),e._v(" "+e._s(e.$t("firefly.add_another_split"))+"\n ")])]),e._v(" "),a("div",{staticClass:"col"},[a("div",{staticClass:"text-xs d-none d-lg-block d-xl-block"},[e._v("\n \n ")]),e._v(" "),a("button",{staticClass:"btn btn-info btn-block",attrs:{disabled:!e.enableSubmit},on:{click:e.submitTransaction}},[e.enableSubmit?a("span",[a("i",{staticClass:"far fa-save"}),e._v(" "+e._s(e.$t("firefly.update_transaction")))]):e._e(),e._v(" "),e.enableSubmit?e._e():a("span",[a("i",{staticClass:"fas fa-spinner fa-spin"})])])])]),e._v(" "),a("div",{staticClass:"row"},[a("div",{staticClass:"col"},[e._v("\n \n ")]),e._v(" "),a("div",{staticClass:"col"},[a("div",{staticClass:"form-check"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.stayHere,expression:"stayHere"}],staticClass:"form-check-input",attrs:{id:"stayHere",type:"checkbox"},domProps:{checked:Array.isArray(e.stayHere)?e._i(e.stayHere,null)>-1:e.stayHere},on:{change:function(t){var a=e.stayHere,n=t.target,o=!!n.checked;if(Array.isArray(a)){var s=e._i(a,null);n.checked?s<0&&(e.stayHere=a.concat([null])):s>-1&&(e.stayHere=a.slice(0,s).concat(a.slice(s+1)))}else e.stayHere=o}}}),e._v(" "),a("label",{staticClass:"form-check-label",attrs:{for:"stayHere"}},[a("span",{staticClass:"small"},[e._v(e._s(e.$t("firefly.after_update_create_another")))])])])])])])])])])],1)],1)}),[],!1,null,"43318932",null).exports;var p=a(7760),g=a.n(p);a(232),g().config.productionTip=!1;var m=a(157),h={};new(g())({i18n:m,store:n.Z,render:function(e){return e(_,{props:h})},beforeCreate:function(){this.$store.commit("initialiseStore"),this.$store.dispatch("updateCurrencyPreference")}}).$mount("#transactions_edit")},4478:(e,t,a)=>{"use strict";function n(){return{description:[],amount:[],source:[],destination:[],currency:[],foreign_currency:[],foreign_amount:[],date:[],custom_dates:[],budget:[],category:[],bill:[],tags:[],piggy_bank:[],internal_reference:[],external_url:[],notes:[],location:[]}}function o(){return{description:"",transaction_journal_id:0,source_account_id:null,source_account_name:null,source_account_type:null,source_account_currency_id:null,source_account_currency_code:null,source_account_currency_symbol:null,destination_account_id:null,destination_account_name:null,destination_account_type:null,destination_account_currency_id:null,destination_account_currency_code:null,destination_account_currency_symbol:null,source_account:{id:0,name:"",name_with_balance:"",type:"",currency_id:0,currency_name:"",currency_code:"",currency_decimal_places:2},destination_account:{id:0,name:"",type:"",currency_id:0,currency_name:"",currency_code:"",currency_decimal_places:2},amount:"",currency_id:0,foreign_amount:"",foreign_currency_id:0,category:null,budget_id:0,bill_id:0,piggy_bank_id:0,tags:[],interest_date:null,book_date:null,process_date:null,due_date:null,payment_date:null,invoice_date:null,internal_reference:null,external_url:null,external_id:null,notes:null,links:[],attachments:[],zoom_level:null,longitude:null,latitude:null,errors:{}}}a.d(t,{kQ:()=>n,f$:()=>o})},6665:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>r});var n=a(4015),o=a.n(n),s=a(3645),i=a.n(s)()(o());i.push([e.id,".vue-tags-input{max-width:100%!important;display:block}.ti-input,.vue-tags-input{width:100%;border-radius:.25rem}.ti-input{max-width:100%}.ti-new-tag-input{font-size:1rem}","",{version:3,sources:["webpack://./src/components/transactions/TransactionTags.vue"],names:[],mappings:"AA2HA,gBAEA,wBAAA,CACA,aAEA,CAEA,0BANA,UAAA,CAGA,oBAOA,CAJA,UAEA,cAEA,CAEA,kBACA,cACA",sourcesContent:['\x3c!--\n - TransactionTags.vue\n - Copyright (c) 2021 james@firefly-iii.org\n -\n - This file is part of Firefly III (https://github.com/firefly-iii).\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see .\n --\x3e\n\n\n