(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-79a4768a"],{"3ba2":function(e,t,o){"use strict";var a=function(){var e=this,t=e._self._c;return t("router-link",{attrs:{to:e.to},nativeOn:{click:function(t){return e.routeToAnchor.apply(null,arguments)}}},[e._t("default")],2)},i=[],n=(o("c5f6"),o("2b0e")),r=o("8c4f"),s=o("f13c"),c=o.n(s);n["default"].use(r["a"]),n["default"].use(c.a);var d={name:"vue-anchor-router-link",props:{to:Object,scrollOptions:{type:[Object,Number],default:1}},data:function(){return{previousRoute:this.$route}},methods:{routeToAnchor:function(){this.$route.fullPath===this.previousRoute.fullPath&&this.$scrollTo(this.to.hash,this.scrollOptions)}},watch:{$route:function(e,t){this.previousRoute=e}}},l=d,u=o("2877"),p=Object(u["a"])(l,a,i,!1,null,null,null),m=p.exports;t["a"]=m},"45a3":function(e,t,o){"use strict";var a=function(){var e=this,t=e._self._c;return t("v-dialog",{attrs:{"max-width":"500px",persistent:""},on:{keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:e.cancelAction()}},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},[t("v-card",[t("v-card-title",{staticClass:"headline"},[e._v("\n      "+e._s(e.title)+"\n    ")]),t("v-card-text",[e._v("\n      "+e._s(e.text)+"\n    ")]),t("v-card-actions",[t("v-spacer"),this.loading?e._e():t("v-btn",{attrs:{color:"red",flat:"",loading:this.loading},on:{click:e.cancelAction}},[e._v(e._s(e.cancelText))]),t("v-btn",{attrs:{color:"green",flat:"",loading:this.loading},on:{click:e.confirmAction,keydown:function(t){if(!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter"))return null;t.preventDefault()}}},[e._v(e._s(e.confirmText)+" ")])],1)],1)],1)},i=[],n={props:["title","text","cancelText","confirmText","value"],data:function(){return{loading:!1}},watch:{value:function(){this.resetState()}},methods:{resetState:function(){this.loading=!1},confirmAction:function(){this.loading=!0,this.$emit("confirmAction")},cancelAction:function(){this.loading=!0,this.$emit("cancelAction")}}},r=n,s=o("2877"),c=Object(s["a"])(r,a,i,!1,null,null,null);t["a"]=c.exports},"5e44":function(e,t,o){"use strict";var a=function(){var e=this,t=e._self._c;return t("v-toolbar",{attrs:{flat:"",color:e.color?e.color:"white"}},[t("v-breadcrumbs",{attrs:{divider:"/",items:e.breadcrumbs},scopedSlots:e._u([{key:"item",fn:function(o){return[o.item.to?[t("vue-anchor-router-link",{attrs:{to:o.item.to}},[e._v(e._s(o.item.text))])]:[e._v("\n        "+e._s(o.item.text)+"\n      ")]]}}])}),t("v-spacer"),e._t("default")],2)},i=[],n=o("3ba2"),r={props:["breadcrumbs","color"],computed:{},components:{VueAnchorRouterLink:n["a"]}},s=r,c=o("2877"),d=Object(c["a"])(s,a,i,!1,null,null,null);t["a"]=d.exports},"7fb5":function(e,t,o){var a,i;(function(o,n){o||(o={}),a=[],i=function(){return o.jsonToFormData=n()}.apply(t,a),void 0===i||(e.exports=i)})(this,(function(){function e(e,t){return[e,t].reduce((function(e,t){return Object.keys(t).forEach((function(o){e[o]=t[o]})),e}),{})}function t(e){return"[object Array]"==={}.toString.call(e)}function o(e){return!t(e)&&"object"===typeof e&&!!e&&!(e instanceof Blob)&&!(e instanceof Date)}function a(e){return"function"===typeof e.append}function i(){return"function"===typeof FormData}function n(){if(i())return new FormData}function r(t,o){if(o&&o.initialFormData){if(!a(o.initialFormData))throw"initialFormData must have an append function."}else if(!i())throw"This environment does not have global form data. options.initialFormData must be specified.";var r={initialFormData:n(),showLeafArrayIndexes:!0,includeNullValues:!1,mapping:function(e){return"boolean"===typeof e?+e?"1":"0":e}},c=e(r,o||{});return s(t,c,c.initialFormData)}function s(e,a,i,n){var r=0;for(var c in e){if(e.hasOwnProperty(c)){var d=n||c,l=a.mapping(e[c]);if(n&&o(e)&&(d=n+"["+c+"]"),n&&t(e)&&(d=t(l)||a.showLeafArrayIndexes?n+"["+r+"]":n+"[]"),t(l)||o(l))s(l,a,i,d);else if(l instanceof FileList)for(var u=0;u<l.length;u++)i.append(d+"["+u+"]",l.item(u));else l instanceof Blob?i.append(d,l,l.name):l instanceof Date?i.append(d,l.toISOString()):(null===l&&a.includeNullValues||null!==l)&&void 0!==l&&i.append(d,l)}r++}return i}return r}))},"9d3b":function(e,t,o){"use strict";o.r(t);var a=function(){var e=this,t=e._self._c;return t("div",[t("breadcrumbs",{staticClass:"mb-3",attrs:{breadcrumbs:e.breadcrumbs}},[e.allowedTo("add")?t("v-btn",{attrs:{color:"primary",depressed:"",to:{name:"admin.financial-misc-ar.billing-collection.receipt.view",params:{receiptId:"new",pagination:e.getValue(e.$route.params.pagination)}}}},[e._v(e._s(e.$t("message.new")))]):e._e()],1),t("v-container",{staticClass:"pt-0",attrs:{fluid:""}},[t("v-card",{attrs:{flat:""}},[t("v-toolbar",{staticClass:"primary lighten-2",attrs:{flat:"",dark:""}},[t("v-toolbar-title",{staticClass:"font-weight-light"},[e._v(e._s(e.$t("message.miscellaneousReceipt")))])],1),t("v-toolbar",{attrs:{dense:"",flat:"",color:"grey lighten-2"}},[t("v-spacer"),e.form.fetching?[t("v-btn",{attrs:{depressed:"",color:"transparent",loading:e.form.fetching}})]:[e.allowedTo("save")&&"0"==this.closingStatus?t("AddSundryDebtorButton",{attrs:{depressed:"",color:"info",loading:"save"==e.form.action},on:{update:function(t){e.refreshSundryDebtorLookupKey++}}},[e._v(e._s(e.$t("message.save")))]):e._e(),e.allowedTo("save")&&"new"==e.mode&&"0"==this.closingStatus?t("v-btn",{attrs:{color:"info",depressed:"",loading:"save"==e.form.action},on:{click:e.saveData}},[e._v(e._s(e.$t("message.save")))]):e._e(),e.allowedTo("save")&&"edit"==e.mode?t("v-btn",{attrs:{color:"info",depressed:"",loading:"save"==e.form.action},on:{click:e.saveData}},[e._v(e._s(e.$t("message.save")))]):e._e(),e.allowedTo("edit")?t("v-btn",{attrs:{color:"info",depressed:""},on:{click:function(t){e.mode="edit"}}},[e._v(e._s(e.$t("message.edit")))]):e._e(),e.allowedTo("print")?t("v-btn",{attrs:{color:"info",depressed:"",href:e.printLink,target:"_blank"}},[e._v(e._s(e.$t("message.print")))]):e._e()]],2),"1"==this.closingStatus?t("v-layout",{attrs:{row:"",wrap:""}},[t("v-flex",[t("v-container",{staticClass:"pa-0 px-3",attrs:{fluid:""}},[t("v-alert",{attrs:{value:!0,type:"error"}},[e._v("\n              This financial month has already been closed. With an exception of allocation / unallocation, you are not allowed to create new, or to edit transaction for this month. Please contact your administrator if further action is required.\n            ")])],1)],1)],1):e._e(),t("v-layout",{attrs:{row:"",wrap:""}},[t("v-flex",{attrs:{xl8:"",lg8:"",md8:"",sm12:""}},[t("v-container",{staticClass:"pa-3"},[t("v-layout",{attrs:{column:"",wrap:""}},[e.canEdit("debtor")?t("sundry-debtor-lookup",e._b({key:e.refreshSundryDebtorLookupKey,attrs:{label:e.$t("message.name")+" *"},on:{change:function(t){e.getPaymentItems(e.record.id,e.getValue(e.record,"debtor.debtor_name"))}},model:{value:e.record.debtor,callback:function(t){e.$set(e.record,"debtor",t)},expression:"record.debtor"}},"sundry-debtor-lookup",{dense:!0,box:!0,returnObject:!0,error:e.getValue(e.errorMessages,"debtor.id")},!1)):t("v-text-field",{attrs:{value:e.getValue(e.record,"debtor.debtor_name"),label:e.$t("message.name")+" *",placeholder:" ",box:"",readonly:"","background-color":"transparent"}}),e.canEdit("payment_method")?e._e():t("v-text-field",{attrs:{value:e.getValue(e.record,"payment_method_label"),label:e.$t("message.paymentMethod"),placeholder:" ",box:"","background-color":"transparent",readonly:""}}),e.canEdit("paymentMethod")?t("payment-method-lookup",e._b({attrs:{label:e.$t("message.paymentMethod")+" *"},model:{value:e.record.payment_method,callback:function(t){e.$set(e.record,"payment_method",t)},expression:"record.payment_method"}},"payment-method-lookup",{dense:!0,box:!0,returnObject:!1,error:e.getValue(e.errorMessages,"payment_method")},!1)):e._e(),t("v-text-field",{attrs:{label:e.$t("message.chequeTTNo")+" *",placeholder:" ",box:"","background-color":e.canEdit("reference_no")?"":"transparent",readonly:!e.canEdit("reference_no"),"error-messages":e.getValue(e.errorMessages,"reference_no")},model:{value:e.record.reference_no,callback:function(t){e.$set(e.record,"reference_no",t)},expression:"record.reference_no"}}),t("v-textarea",{attrs:{label:e.$t("message.remarks"),placeholder:" ",box:"","background-color":e.canEdit("description")?"":"transparent",readonly:!e.canEdit("description"),"error-messages":e.getValue(e.errorMessages,"description")},model:{value:e.record.description,callback:function(t){e.$set(e.record,"description",t)},expression:"record.description"}}),e.canEdit("credit_ledger")?t("v-autocomplete",{attrs:{label:e.$t("message.creditLedger")+" *",placeholder:" ",box:"",items:e.creditLedgerLookupItems,loading:e.loadingCreditLedgerLookupOptions,"search-input":e.searchCreditLedgerLookupOptions,attach:"",clearable:"",dense:"","return-object":"","item-value":"id","item-text":"name","error-messages":e.getValue(e.errorMessages,"credit_ledger.id")},on:{"update:searchInput":function(t){e.searchCreditLedgerLookupOptions=t},"update:search-input":function(t){e.searchCreditLedgerLookupOptions=t}},model:{value:e.record.credit_ledger,callback:function(t){e.$set(e.record,"credit_ledger",t)},expression:"record.credit_ledger"}}):t("v-text-field",{attrs:{value:e.getValue(e.record.credit_ledger,"code")+" - "+e.getValue(e.record.credit_ledger,"name"),label:e.$t("message.creditLedger"),placeholder:" ",box:"","background-color":"transparent",readonly:""}}),e.canEdit("debit_ledger")?t("v-autocomplete",{attrs:{label:e.$t("message.debitLedger")+" *",placeholder:" ",box:"",items:e.debitLedgerLookupItems,loading:e.loadingDebitLedgerLookupOptions,"search-input":e.searchDebitLedgerLookupOptions,attach:"",clearable:"",dense:"","return-object":"","item-value":"id","item-text":"name","error-messages":e.getValue(e.errorMessages,"debit_ledger.id")},on:{"update:searchInput":function(t){e.searchDebitLedgerLookupOptions=t},"update:search-input":function(t){e.searchDebitLedgerLookupOptions=t}},model:{value:e.record.debit_ledger,callback:function(t){e.$set(e.record,"debit_ledger",t)},expression:"record.debit_ledger"}}):t("v-text-field",{attrs:{value:e.getValue(e.record.debit_ledger,"code")+" - "+e.getValue(e.record.debit_ledger,"name"),label:e.$t("message.debitLedger"),placeholder:" ",box:"","background-color":"transparent",readonly:""}})],1)],1)],1),t("v-flex",{attrs:{xl4:"",lg4:"",md4:"",sm12:""}},[t("v-container",{staticClass:"pa-3"},[t("v-layout",{attrs:{column:"",wrap:""}},[t("v-container",{attrs:{"pa-0":"","grid-list-md":""}},[t("v-layout",{attrs:{row:"",wrap:""}},[t("v-flex",{attrs:{sm6:"",xs12:""}},["new"!=e.mode?t("v-text-field",{attrs:{label:e.$t("message.postingNo"),placeholder:" ",box:"","background-color":"transparent",readonly:"","error-messages":e.getValue(e.errorMessages,"batchpost_no")},model:{value:e.record.batch_posting_no,callback:function(t){e.$set(e.record,"batch_posting_no",t)},expression:"record.batch_posting_no"}}):e._e()],1),t("v-flex",{attrs:{sm6:"",xs12:""}},["new"!=e.mode?t("v-text-field",{attrs:{label:e.$t("message.receiptNo"),placeholder:" ",box:"","background-color":"transparent",readonly:"","error-messages":e.getValue(e.errorMessages,"document_no")},model:{value:e.record.document_no,callback:function(t){e.$set(e.record,"document_no",t)},expression:"record.document_no"}}):e._e()],1)],1)],1),e.canEdit("posting_date")?t("v-menu",{attrs:{"close-on-content-click":!1,"nudge-right":40,lazy:"",transition:"scale-transition","offset-y":"","full-width":"","min-width":"290px"},model:{value:e.record.posting_date_picker,callback:function(t){e.$set(e.record,"posting_date_picker",t)},expression:"record.posting_date_picker"}},[t("v-text-field",{attrs:{slot:"activator",value:e.getDateFromISO(e.record.posting_date),label:e.$t("message.postingDate")+" *",placeholder:" ","append-icon":"event",box:"",readonly:"",clearable:"","error-messages":e.getValue(e.errorMessages,"posting_date")},on:{input:function(t){e.record.posting_date=""}},slot:"activator"}),t("v-date-picker",{attrs:{color:"primary lighten-2"},on:{input:function(t){e.record.posting_date_picker=!1,e.getMonthlyClosingStatus(t,!0)}},model:{value:e.record.posting_date_model,callback:function(t){e.$set(e.record,"posting_date_model",t)},expression:"record.posting_date_model"}})],1):t("v-text-field",{attrs:{label:e.$t("message.postingDate"),value:e.getDateFromISO(e.record.posting_date),placeholder:" ",box:"","background-color":"transparent",readonly:"","error-messages":e.getValue(e.errorMessages,"posting_date")}}),e.canEdit("document_date")?t("v-menu",{attrs:{"close-on-content-click":!1,"nudge-right":40,lazy:"",transition:"scale-transition","offset-y":"","full-width":"","min-width":"290px"},model:{value:e.record.document_date_picker,callback:function(t){e.$set(e.record,"document_date_picker",t)},expression:"record.document_date_picker"}},[t("v-text-field",{attrs:{slot:"activator",value:e.getDateFromISO(e.record.document_date),label:e.$t("message.date")+" *",placeholder:" ","append-icon":"event",box:"",readonly:"",clearable:"","error-messages":e.getValue(e.errorMessages,"document_date")},on:{input:function(t){e.record.document_date=""}},slot:"activator"}),t("v-date-picker",{attrs:{color:"primary lighten-2"},on:{input:function(t){e.record.document_date_picker=!1}},model:{value:e.record.document_date_model,callback:function(t){e.$set(e.record,"document_date_model",t)},expression:"record.document_date_model"}})],1):t("v-text-field",{attrs:{label:e.$t("message.date"),value:e.getDateFromISO(e.record.document_date),placeholder:" ",box:"","background-color":"transparent",readonly:"","error-messages":e.getValue(e.errorMessages,"document_date")}}),t("v-text-field",{attrs:{label:e.$t("message.amount")+" *",placeholder:" ",box:"","background-color":e.canEdit("amount")?"":"transparent",readonly:!e.canEdit("amount"),"error-messages":e.getValue(e.errorMessages,"amount")},on:{input:function(t){return e.onTotalAmountChange(t,!0)},keypress:function(t){return e.isNumeric(t)}},model:{value:e.amount,callback:function(t){e.amount=t},expression:"amount"}}),"view"!=e.mode?t("v-text-field",{attrs:{label:e.$t("message.totalSelectedOS"),placeholder:" ",box:"","background-color":"transparent",readonly:"","error-messages":e.getValue(e.errorMessages,"total_selected_os")},model:{value:e.totalSelectedOutstanding,callback:function(t){e.totalSelectedOutstanding=t},expression:"totalSelectedOutstanding"}}):e._e(),t("v-text-field",{attrs:{label:e.$t("message.unappliedCredit"),placeholder:" ",box:"","background-color":"transparent",readonly:"","error-messages":e.getValue(e.errorMessages,"open_credit")},model:{value:e.unappliedCredit,callback:function(t){e.unappliedCredit=t},expression:"unappliedCredit"}})],1)],1)],1)],1),t("v-layout",{attrs:{row:"",wrap:""}},[t("v-flex",[t("v-container",{staticClass:"pa-0 px-3",attrs:{fluid:""}},["view"==e.mode?t("v-data-table",{attrs:{headers:e.headers,items:e.record.receipt_items,"hide-actions":""},scopedSlots:e._u([{key:"headers",fn:function(o){return[t("tr",[e._l(o.headers,(function(o){return t("th",{key:o.text},["Select/Unselect All"!=o.text?t("span",[e._v("\n                      "+e._s(o.text)+"\n                    ")]):t("span",[e._v("\n                      "+e._s("")+"\n                    ")])])})),t("th",{staticStyle:{width:"1%"}})],2)]}},{key:"items",fn:function(o){return[t("tr",[t("td",{staticClass:"py-3",staticStyle:{"vertical-align":"top",width:"7%"}},[e._v("\n                     "+e._s(e.getDateFromISO(e.getValue(o.item.invoice_item,"main_table.posting_date")))+"\n                  ")]),t("td",{staticClass:"py-3",staticStyle:{"vertical-align":"top",width:"7%"}},[e._v("\n                    "+e._s(e.getValue(o.item.invoice_item,"main_table.batchpost_no"))+"\n                  ")]),t("td",{staticClass:"py-3",staticStyle:{"vertical-align":"top"}},[e._v("\n                    "+e._s(e.getValue(o.item.invoice_item,"main_table.document_no"))+"/"+e._s(e.getValue(o.item.invoice_item,"remarks"))+"\n                  ")]),t("td",{staticClass:"py-3",staticStyle:{"vertical-align":"top","text-align":"right",width:"7%"}},[e._v("\n                    "+e._s(e.formatNumber(e.getValue(o.item.invoice_item,"amount")).format("0,0.00"))+"\n                  ")]),t("td",{staticClass:"py-3",staticStyle:{"vertical-align":"top","text-align":"right",width:"7%"}},[e._v("\n                    "+e._s(e.formatNumber(e.getValue(o.item.invoice_item,"tax_amount")).format("0,0.00"))+"\n                  ")]),t("td",{staticClass:"py-3",staticStyle:{"vertical-align":"top","text-align":"center",width:"5%"}}),t("td",{staticClass:"py-3",staticStyle:{"vertical-align":"top","text-align":"right",width:"10%"}},[e._v("\n                    "+e._s(e.formatNumber(e.getValue(o.item,"paid_amount")).format("0,0.00"))+"\n                  ")]),t("td",{staticClass:"py-3",staticStyle:{"vertical-align":"top","text-align":"right",width:"10%"}},[e._v("\n                    "+e._s(e.formatNumber(e.getValue(o.item,"tax_paid_amount")).format("0,0.00"))+"\n                  ")])])]}}],null,!1,3779108643)}):e._e(),"view"!=e.mode?t("v-data-table",{attrs:{headers:e.headers,items:e.itemRecords,"hide-actions":""},scopedSlots:e._u([{key:"headers",fn:function(o){return[t("tr",[e._l(o.headers,(function(o){return t("th",{key:o.text},[e._v(e._s(o.text)+"\n                    "),"Select/Unselect All"==o.text?t("span",[t("v-checkbox",{on:{change:function(t){return e.onSelectedAll(t)}},model:{value:e.selectAll,callback:function(t){e.selectAll=t},expression:"selectAll"}})],1):e._e()])})),t("th",{staticStyle:{width:"1%"}})],2)]}},{key:"items",fn:function(o){return[t("tr",[t("td",{staticClass:"py-3",staticStyle:{"vertical-align":"top",width:"7%"}},[e._v("\n                     "+e._s(e.getDateFromUnixTime(o.item.document_date))+"\n                  ")]),t("td",{staticClass:"py-3",staticStyle:{"vertical-align":"top",width:"7%"}},[e._v("\n                    "+e._s(e.getValue(o.item,"posting_no"))+"\n                  ")]),t("td",{staticClass:"py-3",staticStyle:{"vertical-align":"top"}},[e._v("\n                    "+e._s(e.getValue(o.item.document_no))+"/"+e._s(e.getValue(o.item.description))+"\n                  ")]),t("td",{staticClass:"py-3",staticStyle:{"vertical-align":"top",width:"7%"}},[t("v-text-field",{attrs:{value:e.formatNumber(e.getValue(o.item,"amount")).format("0,0.00"),placeholder:" ",box:"","background-color":"transparent",readonly:""}})],1),t("td",{staticClass:"py-3",staticStyle:{"vertical-align":"top",width:"7%"}},[t("v-text-field",{attrs:{value:e.formatNumber(e.getValue(o.item,"tax_amount")).format("0,0.00"),placeholder:" ",box:"","background-color":"transparent",readonly:""}})],1),t("td",{staticClass:"py-3",staticStyle:{"vertical-align":"top","text-align":"center",width:"5%"}},[t("v-checkbox",{on:{change:function(t){return e.onSelectedClick(o.item,t)}},model:{value:o.item.isSelected,callback:function(t){e.$set(o.item,"isSelected",t)},expression:"props.item.isSelected"}})],1),t("td",{staticClass:"py-3",staticStyle:{"vertical-align":"top","text-align":"right",width:"10%"}},[t("v-text-field",{attrs:{placeholder:" ",box:"","background-color":e.canEdit("totalPaid")?"":"transparent",readonly:!e.canEdit("totalPaid")},on:{input:function(t){return e.onAmountPaidChange(o.item,t)},keypress:function(t){return e.isNumeric(t)}},model:{value:o.item.total_paid,callback:function(t){e.$set(o.item,"total_paid",t)},expression:"props.item.total_paid"}})],1),t("td",{staticClass:"py-3",staticStyle:{"vertical-align":"top","text-align":"right",width:"10%"}},[t("v-text-field",{attrs:{placeholder:" ",box:"","background-color":e.canEdit("totalTaxPaid")?"":"transparent",readonly:!e.canEdit("totalTaxPaid")},on:{input:function(t){return e.onTaxAmountPaidChange(o.item,t)},keypress:function(t){return e.isNumeric(t)}},model:{value:o.item.total_tax_paid,callback:function(t){e.$set(o.item,"total_tax_paid",t)},expression:"props.item.total_tax_paid"}})],1)])]}}],null,!1,661546215)}):e._e()],1)],1)],1),t("v-toolbar",{attrs:{dense:"",flat:"",color:"grey lighten-2"}},[t("v-spacer"),e.form.fetching?[t("v-btn",{attrs:{depressed:"",color:"transparent",loading:e.form.fetching}})]:[e.allowedTo("save")&&"new"==e.mode&&"0"==this.closingStatus?t("v-btn",{attrs:{color:"info",depressed:"",loading:"save"==e.form.action},on:{click:e.saveData}},[e._v(e._s(e.$t("message.save")))]):e._e(),e.allowedTo("save")&&"edit"==e.mode?t("v-btn",{attrs:{color:"info",depressed:"",loading:"save"==e.form.action},on:{click:e.saveData}},[e._v(e._s(e.$t("message.save")))]):e._e(),e.allowedTo("edit")?t("v-btn",{attrs:{color:"info",depressed:""},on:{click:function(t){e.mode="edit"}}},[e._v(e._s(e.$t("message.edit")))]):e._e()]],2)],1)],1),t("snackbar",{attrs:{snackbar:e.snackbar}})],1)},i=[],n=(o("8e6e"),o("456d"),o("a481"),o("c5f6"),o("20d6"),o("ac6a"),o("7f7f"),o("ade3")),r=o("365c"),s=o("2f62"),c=o("4da1"),d=o("323e"),l=o.n(d),u=(o("7fb5"),o("1dce")),p=o("c1df"),m=o.n(p),f=o("45a3"),h=o("5e44"),g=o("8106"),b=o("c24f"),v=o("df01"),_=o("84f3");function y(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function O(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?y(Object(o),!0).forEach((function(t){Object(n["a"])(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):y(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}var k={mixins:[u["validationMixin"]],validations:{},constants:{},props:{creditLedgerOptions:{type:Array,default:function(){return[]}},debitLedgerOptions:{type:Array,default:function(){return[]}}},created:function(){this.record=this.defaultRecord,"new"==this.recordId&&(this.mode="new",this.getMonthlyClosingStatus(this.record.posting_date,!1)),this.getAdvanceRoles(),this.getData(),this.getCreditLedgerLookupOptions(),this.getDebitLedgerLookupOptions()},components:{Breadcrumbs:h["a"],Snackbar:g["a"],ConfirmDialog:f["a"],PaymentMethodLookup:b["a"],SundryDebtorLookup:v["a"],AddSundryDebtorButton:_["a"]},computed:O(O({},Object(s["b"])(["adminScope","mySession"])),{},{defaultRecord:function(){return Object.assign({},{posting_date:m()().format()})},creditLedgerLookupItems:function(){return this.filteredLookupOptions=this.entryCreditLedgerLookupOptions,this.filteredLookupOptions.map((function(e){for(var t="",o=1;o<=e.depth;o++)t+="      ";var a=t+e.code+" - "+e.name;return Object.assign({},e,{name:a})}))},debitLedgerLookupItems:function(){return this.filteredLookupOptions=this.entryDebitLedgerLookupOptions,this.filteredLookupOptions.map((function(e){for(var t="",o=1;o<=e.depth;o++)t+="      ";var a=t+e.code+" - "+e.name;return Object.assign({},e,{name:a})}))},breadcrumbs:function(){var e=[{text:this.$t("message.miscellaneousReceipt"),disabled:!1,to:{name:"admin.financial-misc-ar.billing-collection.receipt",params:{pagination:Object(c["j"])(this.$route.params.pagination)}}}];return e.push({text:"new"==this.recordId?"New":Object(c["j"])(this.record,"document_no"),disabled:!0}),e},locked:function(){return this.record.locked},printLink:function(){var e=this.adminScope.projectId,t=this.adminScope.companyId,o=this.mySession.username;return"https://pms.putericoveresidences.net/service/api/admin/financial/miscellaneous-ar/receipt/"+this.recordId+"/print?project_id="+e+"&company_id="+t+"&my_username="+o}}),watch:{$route:function(e,t){this.recordId=Object(c["j"])(e.params,"receiptId"),this.record=Object.assign({},this.defaultRecord),"new"==this.recordId&&(this.mode="new",this.getMonthlyClosingStatus(this.record.posting_date,!1)),this.getData()},searchCreditLedgerLookupOptions:function(e){this.creditLedgerLookupItems.length>0||this.loadingCreditLedgerLookupOptions||(this.loadingCreditLedgerLookupOptions=!0,this.getCreditLedgerLookupOptions())},searchDebitLedgerLookupOptions:function(e){this.debitLedgerLookupItems.length>0||this.loadingDebitLedgerLookupOptions||(this.loadingDebitLedgerLookupOptions=!0,this.getDebitLedgerLookupOptions())},"record.document_date_model":function(e){e&&(this.record.document_date=m()(e).format())},"record.posting_date_model":function(e){e&&(this.record.posting_date=m()(e).format())}},methods:{getValue:function(e,t){return Object(c["j"])(e,t)},getDateTimeFromISO:function(e,t){return Object(c["g"])(e,t)},getDateFromISO:function(e,t){return Object(c["e"])(e,t)},getDateFromUnixTime:function(e,t){return Object(c["f"])(e,t)},convertDateToISO:function(e,t){return Object(c["a"])(e,t)},formatNumber:function(e,t){return Object(c["c"])(e,t)},removeFormatNumber:function(e){return Object(c["l"])(e)},allowedTo:function(e){switch(e){case"add":return!this.$can.not("add","acl.admin.financial-misc-ar.billings-collections.receipt");case"delete":if(this.$can.not("add","acl.admin.financial-misc-ar.billings-collections.receipt")&&this.$can.not("delete","acl.admin.financial-misc-ar.billings-collections.receipt"))return!1;if("new"==this.mode)return!1;if("new"!=this.recordId)return!this.record.locked;break;case"save":if(this.$can.not("add","acl.admin.financial-misc-ar.billings-collections.receipt")&&this.$can.not("edit","acl.admin.financial-misc-ar.billings-collections.receipt"))return!1;if("new"==this.mode||"edit"==this.mode)return!0;break;case"edit":return(!this.$can.not("add","acl.admin.financial-misc-ar.billings-collections.receipt")||!this.$can.not("edit","acl.admin.financial-misc-ar.billings-collections.receipt"))&&("new"!=this.recordId&&"edit"!=this.mode);case"cancel":if("new"!=this.recordId&&"edit"==this.mode)return!0;break;case"print":return"new"!=this.recordId}return!1},canEdit:function(e){var t=!1;switch(t="edit"==this.mode||"new"==this.mode,e){case"amount":"edit"==this.mode&&"0"==this.closingStatus&&(t=this.advanceRoles["misc-ar.receipt.amount"]),"edit"==this.mode&&"1"==this.closingStatus&&(t=!1);break;case"debtor_name":"edit"==this.mode&&"1"==this.closingStatus&&(t=!1);break;case"payment_method":"edit"==this.mode&&"1"==this.closingStatus&&(t=!1);break;case"description":"edit"==this.mode&&"1"==this.closingStatus&&(t=!1);break;case"credit_ledger":"edit"==this.mode&&"1"==this.closingStatus&&(t=!1);break;case"debit_ledger":"edit"==this.mode&&"1"==this.closingStatus&&(t=!1);break;case"posting_date":"edit"==this.mode&&"1"==this.closingStatus&&(t=!1);break;case"document_date":"edit"==this.mode&&"1"==this.closingStatus&&(t=!1);break;case"reference_no":"edit"==this.mode&&"1"==this.closingStatus&&(t=!1);break;default:break}return t},onCancel:function(){this.errorMessages=null,this.getData(),this.mode="view"},onTotalAmountChange:function(e){var t=this,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.amount=Object(c["l"])(e),this.unappliedCredit=Object(c["l"])(e),this.itemRecords.forEach((function(e){if(e.isSelected){if(o&&(e.total_paid=Object(c["l"])(e.amount),e.total_tax_paid=Object(c["l"])(e.tax_amount)),t.unappliedCredit>Object(c["l"])(e.total_paid))t.unappliedCredit=t.unappliedCredit-Object(c["l"])(e.total_paid);else if(0==t.unappliedCredit)e.total_paid=0;else{var a=t.unappliedCredit;t.unappliedCredit-=t.unappliedCredit,e.total_paid=a}if(t.unappliedCredit>Object(c["l"])(e.total_tax_paid))t.unappliedCredit=t.unappliedCredit-Object(c["l"])(e.total_tax_paid);else if(0==t.unappliedCredit)e.total_tax_paid=0;else{var i=t.unappliedCredit;t.unappliedCredit-=t.unappliedCredit,o&&(e.total_tax_paid=i)}e.total_paid=Object(c["c"])(e.total_paid).format("0,0.00"),e.total_tax_paid=Object(c["c"])(e.total_tax_paid).format("0,0.00")}})),this.unappliedCredit=Object(c["c"])(this.unappliedCredit).format("0,0.00")},onAmountPaidChange:function(e,t){var o=this.itemRecords.findIndex((function(t){return t.item_index==e.item_index}));0==this.itemRecords[o].isSelected&&(this.itemRecords[o].isSelected=!0);var a=Object(c["l"])(t);a>Object(c["l"])(this.itemRecords[o].amount)?this.itemRecords[o].total_paid=this.itemRecords[o].amount:this.itemRecords[o].total_paid=a;var i=0;this.itemRecords.forEach((function(e){e.isSelected&&(i+=Object(c["l"])(e.amount)+Object(c["l"])(e.tax_amount))})),this.totalSelectedOutstanding=Object(c["c"])(i).format("0,0.00"),this.updateUnappliedCredit(this.itemRecords[o].item_index)},onTaxAmountPaidChange:function(e,t){var o=this.itemRecords.findIndex((function(t){return t.item_index==e.item_index}));0==this.itemRecords[o].isSelected&&(this.itemRecords[o].isSelected=!0);var a=Object(c["l"])(t);a>Object(c["l"])(this.itemRecords[o].tax_amount)?this.itemRecords[o].total_tax_paid=this.itemRecords[o].tax_amount:this.itemRecords[o].total_tax_paid=a;var i=0;this.itemRecords.forEach((function(e){e.isSelected&&(i+=Object(c["l"])(e.amount)+Object(c["l"])(e.tax_amount))})),this.totalSelectedOutstanding=Object(c["c"])(i).format("0,0.00"),this.updateUnappliedCredit(this.itemRecords[o].item_index)},onSelectedClick:function(e,t){var o=this.itemRecords.findIndex((function(t){return t.item_index==e.item_index}));if(t){this.itemRecords[o].total_paid=Object(c["c"])(this.itemRecords[o].amount).format("0,0.00"),this.itemRecords[o].total_tax_paid=Object(c["c"])(this.itemRecords[o].tax_amount).format("0,0.00");var a=0;this.itemRecords.forEach((function(e){e.isSelected&&(a+=Object(c["l"])(e.amount)+Object(c["l"])(e.tax_amount))})),this.totalSelectedOutstanding=Object(c["c"])(a).format("0,0.00"),this.updateUnappliedCredit(this.itemRecords[o].item_index)}else{var i=0;this.itemRecords.forEach((function(e){e.isSelected&&(i+=Object(c["l"])(e.amount)+Object(c["l"])(e.tax_amount))})),this.totalSelectedOutstanding=Object(c["c"])(i).format("0,0.00"),this.itemRecords[o].total_paid=0,this.itemRecords[o].total_tax_paid=0,this.updateUnappliedCredit(this.itemRecords[o].item_index)}},onSelectedAll:function(e){var t=this;this.itemRecords.forEach((function(t){return t.isSelected=e})),this.itemRecords.forEach((function(o){return t.onSelectedClick(o,e)}))},updateUnappliedCredit:function(e){var t=this;this.unappliedCredit=Object(c["l"])(this.amount),console.log(this.unappliedCredit),this.itemRecords.forEach((function(o){if(o.item_index!==e){if(t.unappliedCredit>Object(c["l"])(o.total_paid))t.unappliedCredit=t.unappliedCredit-Object(c["l"])(o.total_paid);else if(0==t.unappliedCredit);else{t.unappliedCredit;t.unappliedCredit-=t.unappliedCredit}if(t.unappliedCredit>Object(c["l"])(o.total_tax_paid))t.unappliedCredit=t.unappliedCredit-Object(c["l"])(o.total_tax_paid);else if(0==t.unappliedCredit);else{t.unappliedCredit;t.unappliedCredit-=t.unappliedCredit}}})),this.itemRecords.forEach((function(o){if(o.item_index==e){if(t.unappliedCredit=Number(t.unappliedCredit).toFixed(4),t.unappliedCredit>Object(c["l"])(o.total_paid))t.unappliedCredit=t.unappliedCredit-Object(c["l"])(o.total_paid),t.unappliedCredit=Number(t.unappliedCredit).toFixed(4);else if(0==t.unappliedCredit)o.total_paid=0;else{var a=t.unappliedCredit;t.unappliedCredit-=t.unappliedCredit,o.total_paid=a}if(t.unappliedCredit>Object(c["l"])(o.total_tax_paid))t.unappliedCredit=t.unappliedCredit-Object(c["l"])(o.total_tax_paid),t.unappliedCredit=Number(t.unappliedCredit).toFixed(4);else if(0==t.unappliedCredit)o.total_tax_paid=0;else{var i=Number(t.unappliedCredit);t.unappliedCredit-=t.unappliedCredit,o.total_tax_paid=i}}})),this.unappliedCredit=Object(c["c"])(this.unappliedCredit).format("0,0.00")},getData:function(){var e=this;this.record=Object.assign({},this.defaultRecord),this.itemRecords=[],this.amount=0,this.unappliedCredit=0,this.totalSelectedOutstanding=0,"new"!=this.recordId&&(this.form.fetching=!0,l.a.start(),r["a"].get("admin/financial/miscellaneous-ar/receipt/"+this.recordId,{params:{project_id:this.adminScope.projectId,company_id:this.adminScope.companyId}}).then((function(t){e.record=Object(c["j"])(t,"data.data"),e.amount=Object(c["c"])(e.record.amount).format("0,0.00"),e.unappliedCredit=Object(c["c"])(e.record.open_credit).format("0,0.00"),e.getPaymentItems(e.record.id,Object(c["j"])(e.record,"debtor.debtor_name")),e.getMonthlyClosingStatus(e.record.posting_date,!1)})).catch((function(e){})).then((function(){l.a.done(),e.form.fetching=!1})))},saveData:function(){var e=this;l.a.start(),this.form.loading=!0,this.form.action="save",this.errorMessages=null,this.record.project_id||(this.record.project_id=this.adminScope.projectId),this.record.company_id||(this.record.company_id=this.adminScope.companyId),this.record.my_username=this.mySession.username,this.record.paid_items=this.itemRecords.length>0?this.itemRecords:[],this.record.open_credit=this.unappliedCredit,this.record.amount=this.amount,this.record.closing_status=this.closingStatus;var t="admin/financial/miscellaneous-ar/receipt";"new"!==this.recordId&&(t=t+"/"+this.recordId,this.record._method="PATCH"),r["a"].post(t,this.record).then((function(t){e.record=Object(c["j"])(t,"data.data"),e.getPaymentItems(e.record.id,Object(c["j"])(e.record,"debtor.debtor_name")),e.snackbar.message=Object(c["j"])(t,"data.message"),e.snackbar.type="success",e.snackbar.show=!0,e.mode="edit",e.$router.replace({name:"admin.financial-misc-ar.billing-collection.receipt.view",params:{receiptId:e.record.id}})})).catch((function(t){e.snackbar.message=Object(c["j"])(t,"response.data.message"),e.snackbar.type="error",e.snackbar.show=!0,e.errorMessages=Object(c["j"])(t,"response.data.errors")})).then((function(){l.a.done(),e.form.loading=!1,e.form.action=null}))},getCreditLedgerLookupOptions:function(){var e=this;r["a"].get("admin/lookup/chart-of-account/",{params:{project_id:this.adminScope.projectId,company_id:this.adminScope.companyId}}).then((function(t){var o=t.data.data;e.entryCreditLedgerLookupOptions=o})).catch((function(e){})).finally(this.loadingCreditLedgerLookupOptions=!1)},getDebitLedgerLookupOptions:function(){var e=this;r["a"].get("admin/lookup/chart-of-account/",{params:{project_id:this.adminScope.projectId,company_id:this.adminScope.companyId}}).then((function(t){var o=t.data.data;e.entryDebitLedgerLookupOptions=o})).catch((function(e){})).finally(this.loadingDebitLedgerLookupOptions=!1)},getPaymentItems:function(e,t){var o=this;r["a"].get("admin/financial/miscellaneous-ar/receipt/receipt-items",{params:{id:e,debtor_name:t,project_id:this.adminScope.projectId,company_id:this.adminScope.companyId}}).then((function(e){var t=e.data.data;o.itemRecords=t,o.itemRecords=o.checkIsSelected(o.itemRecords),o.itemRecords=o.reformatPaidAmount(o.itemRecords),o.itemRecords=o.reformatTaxPaidAmount(o.itemRecords)})).catch((function(e){})).finally()},checkIsSelected:function(e){var t=this,o=e.map((function(e){return Object(c["l"])(e.total_tax_paid)+Object(c["l"])(e.total_paid)>0?(e.isSelected=!0,t.totalSelectedOutstanding+=Object(c["l"])(e.total_tax_paid+Object(c["l"])(e.total_paid))):e.isSelected=!1,e}));return this.totalSelectedOutstanding=Object(c["c"])(this.totalSelectedOutstanding).format("0,0.00"),o},reformatPaidAmount:function(e){var t=e.map((function(e){return e.total_paid=Object(c["c"])(e.total_paid).format("0,0.00"),e}));return t},reformatTaxPaidAmount:function(e){var t=e.map((function(e){return e.total_tax_paid=Object(c["c"])(e.total_tax_paid).format("0,0.00"),e}));return t},getAdvanceRoles:function(){var e=this;r["a"].get("admin/my-advance-roles",{params:{project_id:this.adminScope.projectId,company_id:this.adminScope.companyId}}).then((function(t){e.advanceRoles=t.data})).catch((function(t){e.advanceRoles={}})).finally()},getMonthlyClosingStatus:function(e){var t=this;r["a"].get("admin/lookup/get-monthly-closing-status",{params:{date:e,project_id:this.adminScope.projectId,company_id:this.adminScope.companyId}}).then((function(e){var o=e.data.data;t.closingStatus=o})).catch((function(e){})).finally()},isNumeric:function(e){var t=String.fromCharCode(e.keyCode);if(/^[\d.]+$/.test(t))return!0;e.preventDefault()}},data:function(){return{recordId:this.$route.params.receiptId,record:{},itemRecords:[],amount:0,unappliedCredit:0,totalSelectedOutstanding:0,closingStatus:"0",entryCreditLedgerLookupOptions:this.creditLedgerOptions,loadingCreditLedgerLookupOptions:!1,searchCreditLedgerLookupOptions:null,entryDebitLedgerLookupOptions:this.debitLedgerOptions,loadingDebitLedgerLookupOptions:!1,searchDebitLedgerLookupOptions:null,mode:"view",showConfirmDeleteRecord:!1,selectAll:!1,refreshSundryDebtorLookupKey:0,form:{fetching:!1,loading:!1,action:null},snackbar:{show:!1,type:null,message:null},errorMessages:null,headers:[{text:this.$t("message.date"),width:"7%"},{text:this.$t("message.postingNo"),width:"7%"},{text:this.$t("message.documentNo")+"/"+this.$t("message.description")},{text:this.$t("message.amount"),align:"right",width:"7%"},{text:this.$t("message.taxAmount"),align:"right",width:"7%"},{text:"Select/Unselect All",width:"5%"},{text:this.$t("message.amountPaid"),align:"right",width:"10%"},{text:this.$t("message.taxPaid"),align:"right",width:"10%"}]}}},x=k,j=o("2877"),w=Object(j["a"])(x,a,i,!1,null,null,null);t["default"]=w.exports},c24f:function(e,t,o){"use strict";var a=function(){var e=this,t=e._self._c;return t("div",[t("v-autocomplete",{attrs:{label:e.label,items:e.itemLookupOptions,loading:e.loadingLookupOptions,"search-input":e.searchLookupOptions,clearable:"","item-text":"name","item-value":"id",placeholder:" ","return-object":e.returnObject,"error-messages":e.error,"menu-props":{fixed:!0,nudgeBottom:10,maxHeight:300},dense:e.dense,box:e.box,solo:e.solo,flat:e.flat,outline:e.outline,"hide-details":e.hideDetails},on:{"update:searchInput":function(t){e.searchLookupOptions=t},"update:search-input":function(t){e.searchLookupOptions=t}},model:{value:e.internalValue,callback:function(t){e.internalValue=t},expression:"internalValue"}})],1)},i=[],n=(o("8e6e"),o("ac6a"),o("456d"),o("ade3")),r=o("365c"),s=o("2f62");function c(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function d(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?c(Object(o),!0).forEach((function(t){Object(n["a"])(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):c(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}var l={props:{value:[String,Object],itemOptions:{type:Array,default:function(){return[]}},label:String,error:Array,returnObject:{type:Boolean,default:!0},dense:{type:Boolean,default:!1},solo:{type:Boolean,default:!1},box:{type:Boolean,default:!1},flat:{type:Boolean,default:!1},outline:{type:Boolean,default:!1},hideDetails:{type:Boolean,default:!1}},created:function(){this.internalValue=this.value},mounted:function(){0==this.itemOptions.length&&this.getLookupOptions()},computed:d(d({},Object(s["b"])(["adminScope"])),{},{itemLookupOptions:function(){return this.filteredLookupOptions=this.entryLookupOptions,this.filteredLookupOptions.map((function(e){var t=e.label;return Object.assign({},e,{name:t})}))}}),watch:{searchLookupOptions:function(e){this.itemLookupOptions.length>0||this.loadingLookupOptions||(this.loadingLookupOptions=!0,this.getLookupOptions())},internalValue:function(){this.$emit("input",this.internalValue)}},methods:{getLookupOptions:function(){var e=this;r["a"].get("admin/lookup/misc-ar-receipt-payment-method",{params:{project_id:this.adminScope.projectId,company_id:this.adminScope.companyId}}).then((function(t){var o=t.data.data;e.entryLookupOptions=o})).catch((function(e){})).finally((function(){return e.loadingLookupOptions=!1}))}},data:function(){return{internalValue:{},entryLookupOptions:this.itemOptions,loadingLookupOptions:!1,searchLookupOptions:null}}},u=l,p=o("2877"),m=Object(p["a"])(u,a,i,!1,null,null,null);t["a"]=m.exports},f13c:function(e,t,o){(function(t,o){e.exports=o()})(0,(function(){"use strict";var e=4,t=.001,o=1e-7,a=10,i=11,n=1/(i-1),r="function"===typeof Float32Array;function s(e,t){return 1-3*t+3*e}function c(e,t){return 3*t-6*e}function d(e){return 3*e}function l(e,t,o){return((s(t,o)*e+c(t,o))*e+d(t))*e}function u(e,t,o){return 3*s(t,o)*e*e+2*c(t,o)*e+d(t)}function p(e,t,i,n,r){var s,c,d=0;do{c=t+(i-t)/2,s=l(c,n,r)-e,s>0?i=c:t=c}while(Math.abs(s)>o&&++d<a);return c}function m(t,o,a,i){for(var n=0;n<e;++n){var r=u(o,a,i);if(0===r)return o;var s=l(o,a,i)-t;o-=s/r}return o}var f=function(e,o,a,s){if(!(0<=e&&e<=1&&0<=a&&a<=1))throw new Error("bezier x values must be in [0, 1] range");var c=r?new Float32Array(i):new Array(i);if(e!==o||a!==s)for(var d=0;d<i;++d)c[d]=l(d*n,e,a);function f(o){for(var r=0,s=1,d=i-1;s!==d&&c[s]<=o;++s)r+=n;--s;var l=(o-c[s])/(c[s+1]-c[s]),f=r+l*n,h=u(f,e,a);return h>=t?m(o,f,e,a):0===h?f:p(o,r,r+n,e,a)}return function(t){return e===o&&a===s?t:0===t?0:1===t?1:l(f(t),o,s)}},h={ease:[.25,.1,.25,1],linear:[0,0,1,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]},g=!1;try{var b=Object.defineProperty({},"passive",{get:function(){g=!0}});window.addEventListener("test",null,b)}catch(V){}var v={$:function(e){return"string"!==typeof e?e:document.querySelector(e)},on:function(e,t,o){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{passive:!1};t instanceof Array||(t=[t]);for(var i=0;i<t.length;i++)e.addEventListener(t[i],o,!!g&&a)},off:function(e,t,o){t instanceof Array||(t=[t]);for(var a=0;a<t.length;a++)e.removeEventListener(t[a],o)},cumulativeOffset:function(e){var t=0,o=0;do{t+=e.offsetTop||0,o+=e.offsetLeft||0,e=e.offsetParent}while(e);return{top:t,left:o}}},_="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},y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(e[a]=o[a])}return e},O=["mousedown","wheel","DOMMouseScroll","mousewheel","keyup","touchmove"],k={container:"body",duration:500,easing:"ease",offset:0,force:!0,cancelable:!0,onStart:!1,onDone:!1,onCancel:!1,x:!1,y:!0};function x(e){k=y({},k,e)}var j=function(){var e=void 0,t=void 0,o=void 0,a=void 0,i=void 0,n=void 0,r=void 0,s=void 0,c=void 0,d=void 0,l=void 0,u=void 0,p=void 0,m=void 0,g=void 0,b=void 0,y=void 0,x=void 0,j=void 0,w=void 0,S=function(e){r&&(w=e,j=!0)},C=void 0,L=void 0,$=void 0,D=void 0;function I(e){var t=e.scrollTop;return"body"===e.tagName.toLowerCase()&&(t=t||document.documentElement.scrollTop),t}function R(e){var t=e.scrollLeft;return"body"===e.tagName.toLowerCase()&&(t=t||document.documentElement.scrollLeft),t}function V(e){if(j)return A();L||(L=e),$=e-L,D=Math.min($/o,1),D=C(D),T(t,g+x*D,p+y*D),$<o?window.requestAnimationFrame(V):A()}function A(){j||T(t,b,m),L=!1,v.off(t,O,S),j&&d&&d(w,e),!j&&c&&c(e)}function T(e,t,o){u&&(e.scrollTop=t),l&&(e.scrollLeft=o),"body"===e.tagName.toLowerCase()&&(u&&(document.documentElement.scrollTop=t),l&&(document.documentElement.scrollLeft=o))}function P(L,$){var D=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("object"===("undefined"===typeof $?"undefined":_($))?D=$:"number"===typeof $&&(D.duration=$),e=v.$(L),!e)return console.warn("[vue-scrollto warn]: Trying to scroll to an element that is not on the page: "+L);t=v.$(D.container||k.container),o=D.duration||k.duration,a=D.easing||k.easing,i=D.offset||k.offset,n=D.hasOwnProperty("force")?!1!==D.force:k.force,r=D.hasOwnProperty("cancelable")?!1!==D.cancelable:k.cancelable,s=D.onStart||k.onStart,c=D.onDone||k.onDone,d=D.onCancel||k.onCancel,l=void 0===D.x?k.x:D.x,u=void 0===D.y?k.y:D.y;var A=v.cumulativeOffset(t),T=v.cumulativeOffset(e);if("function"===typeof i&&(i=i()),g=I(t),b=T.top-A.top+i,p=R(t),m=T.left-A.left+i,j=!1,x=b-g,y=m-p,!n){var P=g,E=P+t.offsetHeight,M=b,N=M+e.offsetHeight;if(M>=P&&N<=E)return}return"string"===typeof a&&(a=h[a]||h["ease"]),C=f.apply(f,a),x||y?(s&&s(e),v.on(t,O,S,{passive:!0}),window.requestAnimationFrame(V),function(){w=null,j=!0}):void 0}return P},w=j(),S=[];function C(e){for(var t=0;t<S.length;++t)if(S[t].el===e)return S.splice(t,1),!0;return!1}function L(e){for(var t=0;t<S.length;++t)if(S[t].el===e)return S[t]}function $(e){var t=L(e);return t||(S.push(t={el:e,binding:{}}),t)}function D(e){e.preventDefault();var t=$(this).binding;if("string"===typeof t.value)return w(t.value);w(t.value.el||t.value.element,t.value)}var I={bind:function(e,t){$(e).binding=t,v.on(e,"click",D)},unbind:function(e){C(e),v.off(e,"click",D)},update:function(e,t){$(e).binding=t},scrollTo:w,bindings:S},R=function(e,t){t&&x(t),e.directive("scroll-to",I),e.prototype.$scrollTo=I.scrollTo};return"undefined"!==typeof window&&window.Vue&&(window.VueScrollTo=I,window.VueScrollTo.setDefaults=x,window.Vue.use(R)),I.install=R,I}))}}]);