{"version":3,"sources":["webpack:///./src/views/management/Invoice.vue?4f41","webpack:///./src/views/management/modals/EditInvoice.vue","webpack:///./src/views/management/modals/EditInvoice.vue?f61d","webpack:///./src/views/management/modals/EditInvoice.vue?2dba","webpack:///./src/views/management/Invoice.vue","webpack:///./src/views/management/Invoice.vue?b70c","webpack:///./src/views/management/Invoice.vue?213a","webpack:///./src/views/management/modals/EditInvoice.vue?b6ac","webpack:///./src/views/management/modals/EditInvoice.vue?6fb5","webpack:///./node_modules/mustache/mustache.js"],"names":["class","id","tabindex","aria-hidden","style","invoiceId","data-bs-dismiss","resetForm","src","model","invoiceData","rules","ref","prop","invoice_date","type","start-placeholder","format","selectedStudent","fetch-suggestions","getStudent","clearable","placeholder","selectStudent","scope","item","first_name","last_name","student_id","finance_records","length","record","key","value","moment","record_date","record_type","amount","toLocaleString","currency","payment_method","payment_type","payment_memo","title","removeFromInvoice","data","financeRecordList","records","max-height","width","label","row","addToInvoice","memo","submit","loading","name","components","props","Number","students","emits","emit","store","formRef","user","getters","currentUser","getAvailableFinancerecords","Promise","resolve","reject","ApiService","setHeader","get","then","sortByRecordDate","catch","response","console","log","Error","errors","setEmptyInvoiceData","invoice_records","user_id","student","studentObj","Object","assign","cur","prev","setDefaultInvoiceStudent","getInvoice","financeRecords","map","x","finance_record","filter","y","undefined","queryString","callback","selectedList","toLowerCase","includes","push","index","findIndex","d","splice","sort","a","b","Date","parse","required","message","trigger","editInvoice","formData","update","fire","text","icon","buttonsStyling","confirmButtonText","customClass","confirmButton","post","invoice_id","record_id","validate","valid","closeEditBtn","document","getElementById","click","render","__scopeId","align","href","data-bs-toggle","data-bs-target","property","printInvoiceAll","search","searchValue","to","invoiceTemplateId","pagedInvoices","handleSelectionChange","row-key","element-loading-text","default-sort","order","reserve-selection","created_by","default","printInvoice","handleDelete","layout","page-size","pageSize","total","invoices","setPage","selectedInvoiceId","values","getInvoices","updateInvoiceId","Invoice","CreateInvoice","route","invoiceTemplate","page","pageValue","selectedInvoiceIds","getReport","report_content","resetSelectedInvoiceId","confirm","delete","slice","val","rows","printInvoiceResult","printAll","forEach","array","getInvoicePrintData","printedInvoice","invoiceWindow","window","open","body","innerHTML","screen","height","totalChargeAmount","totalPaidAmount","element","ref_no","String","padStart","charge_amount","paid_amount","credit","balance","total_amount","invoicePrintData","error","getStudents","invoiceButton","params","param","global","factory","module","exports","this","objectToString","prototype","toString","isArray","Array","object","call","isFunction","typeStr","obj","escapeRegExp","string","replace","hasProperty","propName","primitiveHasOwnProperty","primitive","hasOwnProperty","regExpTest","RegExp","test","testRegExp","re","nonSpaceRe","isWhitespace","entityMap","escapeHtml","s","whiteRe","spaceRe","equalsRe","curlyRe","tagRe","parseTemplate","template","tags","openingTagRe","closingTagRe","closingCurlyRe","lineHasNonSpace","sections","tokens","spaces","hasTag","nonSpace","indentation","tagIndex","stripSpace","pop","compileTags","tagsToCompile","split","mustache","start","chr","token","openSection","scanner","Scanner","eos","pos","scanUntil","i","valueLength","charAt","scan","nestTokens","squashTokens","lastToken","squashedTokens","numTokens","section","nestedTokens","collector","tail","Context","view","parentContext","cache","parent","Writer","templateCache","_cache","set","clear","match","substring","lookup","intermediateValue","names","context","lookupHit","indexOf","clearCache","cacheKey","join","isCacheEnabled","partials","config","getConfigTags","renderTokens","originalTemplate","symbol","buffer","renderSection","renderInverted","renderPartial","unescapedValue","escapedValue","rawValue","self","subRender","j","indentPartial","partial","filteredIndentation","partialByNl","indentedValue","escape","getConfigEscape","version","defaultWriter","TypeError"],"mappings":"kHAAA,W,2DCEIA,MAAM,aACNC,GAAG,qBACHC,SAAS,KACTC,cAAY,Q,GAEPH,MAAM,gD,GACJA,MAAM,iB,GACJA,MAAM,gB,uBAWDA,MAAM,uB,GAMXA,MAAM,gC,GAQFA,MAAM,Y,GAMJA,MAAM,Y,GAYRA,MAAM,Y,GAMJA,MAAM,Y,GAgBRA,MAAM,Y,GAMJA,MAAM,Y,aAIII,MAAA,mK,qDAoDZJ,MAAM,Y,GAMJA,MAAM,Y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YAGd,GAIJ,IAAIlE,EAAW,CACbzN,KAAM,cACN6R,QAAS,QACTrF,KAAM,CAAE,KAAM,MACd0D,gBAAYtN,EACZ+O,YAAQ/O,EACRe,WAAOf,EACPsC,YAAQtC,EACRmL,aAASnL,EACToM,aAASpM,EACTyM,YAAQzM,EAMR,kBAAmBuM,GACjB2C,EAAcxC,cAAgBH,GAKhC,oBACE,OAAO2C,EAAcxC,gBAKrBwC,EAAgB,IAAIzC,EAyCxB,OApCA5B,EAASyC,WAAa,WACpB,OAAO4B,EAAc5B,cAQvBzC,EAAS9J,MAAQ,SAAgB4I,EAAUC,GACzC,OAAOsF,EAAcnO,MAAM4I,EAAUC,IAOvCiB,EAASvI,OAAS,SAAiBqH,EAAU0C,EAAMqB,EAAUC,GAC3D,GAAwB,kBAAbhE,EACT,MAAM,IAAIwF,UAAU,wDACUlH,EAAQ0B,GADlB,mFAKtB,OAAOuF,EAAc5M,OAAOqH,EAAU0C,EAAMqB,EAAUC,IAKxD9C,EAASkE,OAAS5F,EAGlB0B,EAASM,QAAUA,EACnBN,EAASuB,QAAUA,EACnBvB,EAAS4B,OAASA,EAEX5B","file":"js/chunk-7e5e1bec.8bea3986.js","sourcesContent":["export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader-v16/dist/index.js??ref--0-1!./Invoice.vue?vue&type=style&index=0&id=3d646636&scoped=true&lang=css\"","\r\n\r\n\r\n\r\n\r\n\r\n","\r\nimport { defineComponent, onBeforeMount, reactive, ref, toRefs, watch } from \"vue\";\r\nimport Swal from \"sweetalert2/dist/sweetalert2.js\";\r\nimport ApiService from \"@/core/services/ApiService\";\r\nimport { useStore } from \"vuex\";\r\nimport moment from \"moment\";\r\nimport { useFieldValue } from \"vee-validate\";\r\n\r\nexport default defineComponent({\r\n name: \"edit-invoice-modal\",\r\n components: {\r\n },\r\n props:{\r\n invoiceId : Number,\r\n students: [] as any\r\n },\r\n emits: ['getInvoices', 'updateInvoiceId'],\r\n setup(props, {emit}) {\r\n const store = useStore();\r\n const { students, invoiceId } = toRefs(props);\r\n const formRef = ref(null);\r\n const loading = ref(false);\r\n const user = store.getters.currentUser;\r\n const selectedStudent = ref('');\r\n const invoiceData = ref({} as any);\r\n const financeRecordList = reactive({records : [] as any});\r\n\r\n const resetForm = () =>{\r\n emit(\"updateInvoiceId\", 0);\r\n invoiceData.value = {};\r\n }\r\n\r\n const getAvailableFinancerecords = async (student_id : number) => {\r\n await new Promise((resolve, reject) => {\r\n ApiService.setHeader();\r\n ApiService.get(\"finance/records/invoice/\"+student_id)\r\n .then(({ data }) => {\r\n financeRecordList.records = data.data;\r\n sortByRecordDate();\r\n resolve(data.data);\r\n })\r\n .catch(({ response }) => {\r\n console.log(response);\r\n reject(new Error ('getAvailableFinancerecords error => '+response.data.errors));\r\n });\r\n });\r\n }\r\n\r\n const selectStudent = async(item) => {\r\n if(item){\r\n invoiceData.value.student_id = item.id;\r\n selectedStudent.value = item.first_name +\" \"+ item.last_name +\"(\"+item.student_id+\")\";\r\n await getAvailableFinancerecords(item.id).then(()=>{\r\n invoiceData.value.finance_records = [];\r\n });\r\n }\r\n }\r\n\r\n const setEmptyInvoiceData = () =>{\r\n invoiceData.value = {\r\n invoice_date :'',\r\n student_id : Number(),\r\n invoice_records : [] as any,\r\n finance_records : [] as any,\r\n memo :'',\r\n user_id: user.id,\r\n student: {} as any\r\n };\r\n\r\n if(props.students.length == 1){\r\n let studentObj = Object.assign({},props.students[0]);\r\n selectStudent(studentObj);\r\n }\r\n else{\r\n selectedStudent.value = '';\r\n financeRecordList.records = [];\r\n }\r\n }\r\n\r\n watch(() => props.invoiceId, async(cur, prev)=>{\r\n await setDefaultInvoiceStudent(props.invoiceId);\r\n })\r\n\r\n watch(() => props.students, async(cur, prev)=>{\r\n await setDefaultInvoiceStudent(props.invoiceId);\r\n })\r\n\r\n const setDefaultInvoiceStudent = async(id) =>{\r\n if(id && id > 0 ){\r\n getInvoice(id).then(()=>{\r\n const financeRecords = [...invoiceData.value.invoice_records.map(x=>x.finance_record)];\r\n selectStudent(invoiceData.value.student).then(() =>{\r\n invoiceData.value.finance_records = [...financeRecords];\r\n financeRecordList.records = financeRecordList.records.filter(x=> invoiceData.value.finance_records.filter(y=>y.id == x.id).length == 0);\r\n });\r\n });\r\n }\r\n else{\r\n setEmptyInvoiceData();\r\n }\r\n }\r\n \r\n const getInvoice = async (id : number) => {\r\n return new Promise((resolve, reject) => {\r\n ApiService.setHeader();\r\n ApiService.get(\"invoice/\"+id)\r\n .then(({ data }) => {\r\n Object.assign(invoiceData.value,data.data);\r\n resolve('done');\r\n })\r\n .catch(({ response }) => {\r\n reject(new Error ('getInvoice error => '+response.data.errors));\r\n });\r\n });\r\n }\r\n\r\n if(invoiceId.value !== undefined && invoiceId.value !== 0){\r\n getInvoice(invoiceId.value).then(async() =>{\r\n await getAvailableFinancerecords(invoiceData.value.student_id);\r\n });\r\n }\r\n else{\r\n setEmptyInvoiceData();\r\n }\r\n\r\n const getStudent=(queryString, callback)=>{\r\n let selectedList = students.value.filter(data => (!queryString \r\n || (data.first_name +\" \"+ data.last_name +\"(\"+data.student_id+\")\").toLowerCase().includes(queryString.toLowerCase())));\r\n callback(selectedList);\r\n }\r\n\r\n const addToInvoice = (row) => {\r\n invoiceData.value.finance_records.push(row);\r\n sortByRecordDate();\r\n let index = financeRecordList.records.findIndex(d => d.id === row.id);\r\n financeRecordList.records.splice(index,1); \r\n }\r\n\r\n const removeFromInvoice = (row) => {\r\n financeRecordList.records.push(row);\r\n sortByRecordDate();\r\n let index = invoiceData.value.finance_records.findIndex(d => d.id === row.id);\r\n invoiceData.value.finance_records.splice(index,1);\r\n }\r\n\r\n const sortByRecordDate = () =>{\r\n financeRecordList.records.sort(function(a,b) { \r\n if(a.id == b.id) return 0;\r\n\r\n if (Date.parse(a.record_date!) < Date.parse(b.record_date!))\r\n return 1;\r\n if (Date.parse(a.record_date!) > Date.parse(b.record_date!))\r\n return -1;\r\n return 0;\r\n });\r\n }\r\n\r\n const rules = ref({\r\n student_id: [\r\n {\r\n required: true,\r\n message: \"Please select student\",\r\n trigger: \"blur\",\r\n },\r\n ],\r\n finance_records: [\r\n {\r\n required: true,\r\n message: \"Please select finance records\",\r\n trigger: \"change\",\r\n },\r\n ]\r\n });\r\n\r\n const editInvoice = async (formData) => {\r\n delete formData.finance_records;\r\n ApiService.setHeader();\r\n if(invoiceId.value !== undefined && invoiceId.value !==0)\r\n {\r\n ApiService.update(\"invoice\", invoiceId.value, formData)\r\n .catch(({ response }) => {\r\n loading.value = false;\r\n console.log('editInvoice error => '+response.data.errors);\r\n Swal.fire({\r\n text: \"Failed to edit invoice\",\r\n icon: \"error\",\r\n buttonsStyling: false,\r\n confirmButtonText: \"Ok, got it!\",\r\n customClass: {\r\n confirmButton: \"btn btn-primary\",\r\n },\r\n });\r\n });\r\n }\r\n else\r\n {\r\n ApiService.post(\"invoice\", formData)\r\n .catch(({ response }) => {\r\n loading.value = false;\r\n console.log('createInvoice error => '+response.data.errors);\r\n Swal.fire({\r\n text: \"Failed to create the new invoice\",\r\n icon: \"error\",\r\n buttonsStyling: false,\r\n confirmButtonText: \"Ok, got it!\",\r\n customClass: {\r\n confirmButton: \"btn btn-primary\",\r\n },\r\n });\r\n });\r\n }\r\n }\r\n\r\n const submit = () => {\r\n if (!formRef.value) {\r\n return;\r\n }\r\n\r\n invoiceData.value.invoice_records = [...invoiceData.value.finance_records.map(x=>{return {invoice_id: invoiceId.value, record_id: x.id};})]\r\n formRef.value.validate((valid) => {\r\n if (valid) {\r\n loading.value = true;\r\n editInvoice(invoiceData.value).then(() => {\r\n Swal.fire({\r\n text: \"Form has been successfully submitted!\",\r\n icon: \"success\",\r\n buttonsStyling: false,\r\n confirmButtonText: \"Ok, got it!\",\r\n customClass: {\r\n confirmButton: \"btn btn-primary\",\r\n },\r\n }).then(() => {\r\n loading.value = false;\r\n emit('getInvoices');\r\n let closeEditBtn = document.getElementById('close_invoice_button');\r\n closeEditBtn?.click();\r\n });\r\n });\r\n } else {\r\n Swal.fire({\r\n text: \"Please fill out all required fields\",\r\n icon: \"error\",\r\n buttonsStyling: false,\r\n confirmButtonText: \"Ok, got it!\",\r\n customClass: {\r\n confirmButton: \"btn btn-primary\",\r\n },\r\n });\r\n return false;\r\n }\r\n });\r\n };\r\n\r\n return {\r\n invoiceData,\r\n submit,\r\n rules,\r\n loading,\r\n formRef,\r\n getStudent,\r\n selectStudent,\r\n selectedStudent,\r\n financeRecordList,\r\n moment,\r\n addToInvoice,\r\n removeFromInvoice,\r\n resetForm\r\n };\r\n },\r\n});\r\n","import { render } from \"./EditInvoice.vue?vue&type=template&id=76350396&scoped=true\"\nimport script from \"./EditInvoice.vue?vue&type=script&lang=ts\"\nexport * from \"./EditInvoice.vue?vue&type=script&lang=ts\"\n\nimport \"./EditInvoice.vue?vue&type=style&index=0&id=76350396&lang=scss&scoped=true\"\nimport \"./EditInvoice.vue?vue&type=style&index=1&id=76350396&scoped=true&lang=css\"\nscript.render = render\nscript.__scopeId = \"data-v-76350396\"\n\nexport default script","\r\n\r\n\r\n\r\n\r\n\r\n","\r\nimport { setCurrentPageBreadcrumbs } from \"@/core/helpers/breadcrumb\";\r\nimport { computed, defineComponent, onBeforeMount, onMounted, PropType, reactive, ref, toRefs } from \"vue\";\r\nimport CreateInvoice from \"@/views/management/modals/EditInvoice.vue\"\r\nimport { ElMessageBox } from \"element-plus\";\r\nimport ApiService from \"@/core/services/ApiService\";\r\nimport moment from \"moment\";\r\nimport * as Mustache from 'mustache';\r\nimport { useRoute, useRouter } from \"vue-router\";\r\nimport Swal from \"sweetalert2\";\r\n\r\nexport class Invoice{\r\n id : number;\r\n invoice_date : Date;\r\n student_id : number;\r\n memo : string;\r\n}\r\n\r\nexport default defineComponent({\r\n name: \"invoice\",\r\n components : {\r\n CreateInvoice\r\n },\r\n setup() {\r\n const route = useRoute();\r\n const selectedInvoiceId = ref(0);\r\n const students : any[] = reactive([]);\r\n const pageSize = 15;\r\n const invoiceTemplateId = 1;\r\n let invoiceTemplate = '';\r\n const page = reactive({pageValue : 1});\r\n const invoices : any[] = reactive([]);\r\n const selectedInvoiceIds = ref([]);\r\n\r\n const updateInvoiceId = (id) =>{\r\n selectedInvoiceId.value = id;\r\n }\r\n\r\n const getReport = async() =>{\r\n ApiService.setHeader();\r\n await ApiService.get(\"report/\"+invoiceTemplateId)\r\n .then(({ data }) => {\r\n invoiceTemplate = data.data.report_content;\r\n })\r\n .catch(({ response }) => {\r\n console.log('getReport error => '+response.data.errors);\r\n });\r\n }\r\n\r\n const getInvoices = async () => {\r\n await new Promise((resolve, reject) => { \r\n ApiService.setHeader(); \r\n ApiService.get(\"invoice\")\r\n .then(({ data }) => {\r\n data.data = data.data.sort(function(a,b) { \r\n return a.invoice_date > b.invoice_date ? -1 : (a.invoice_date < b.invoice_date ? 1 : 0);\r\n });\r\n Object.assign(invoices,data.data);\r\n resolve(data.data);\r\n })\r\n .catch(({ response }) => {\r\n reject(new Error ('getFinanceRecords error => '+response.data.errors));\r\n });\r\n });\r\n }\r\n\r\n const resetSelectedInvoiceId= () =>{\r\n selectedInvoiceId.value = 0;\r\n }\r\n\r\n const getInvoice = (id) : any => {\r\n return new Promise((resolve, reject) => {\r\n ApiService.setHeader();\r\n ApiService.get(\"invoice/\"+id)\r\n .then(({ data }) => {\r\n resolve(data.data);\r\n })\r\n .catch(({ response }) => {\r\n reject(new Error ('getInvoice error => '+response.data.errors));\r\n console.log('getInvoice error => '+response.data.errors);\r\n });\r\n });\r\n }\r\n\r\n const handleDelete = (row) => {\r\n ElMessageBox.confirm('Are you sure to delete this record?')\r\n .then(() => {\r\n ApiService.setHeader();\r\n ApiService.delete(\"invoice/\"+row.id)\r\n .then(() => {\r\n let index = invoices.findIndex(d => d.id === row.id);\r\n invoices.splice(index,1); \r\n })\r\n .catch(({ response }) => {\r\n console.log('handleDelete error => '+response.data.errors);\r\n });\r\n });\r\n };\r\n\r\n const search = reactive({searchValue : ''});\r\n\r\n const pagedInvoices = computed(()=>{\r\n return invoices\r\n .filter(data => (!search \r\n || data.student?.first_name.toLowerCase().includes(search.searchValue.toLowerCase())\r\n || data.student?.last_name.toLowerCase().includes(search.searchValue.toLowerCase())\r\n || data.student?.student_id.toLowerCase().includes(search.searchValue.toLowerCase())\r\n || data.memo.toLowerCase().includes(search.searchValue.toLowerCase()))\r\n )\r\n .sort(function(a,b) { \r\n if(a.id == b.id) return 0;\r\n\r\n if (Date.parse(a.record_date!) < Date.parse(b.record_date!))\r\n return 1;\r\n if (Date.parse(a.record_date!) > Date.parse(b.record_date!))\r\n return -1;\r\n return 0;\r\n })\r\n .slice(pageSize * page.pageValue - pageSize, pageSize * page.pageValue)\r\n })\r\n\r\n const setPage = (val) => {\r\n page.pageValue = val;\r\n }\r\n\r\n const handleSelectionChange = (rows) =>{\r\n selectedInvoiceIds.value = rows.map(x=>x.id);\r\n }\r\n\r\n const printInvoiceAll = async () => {\r\n if(!selectedInvoiceIds.value || selectedInvoiceIds.value.length == 0){\r\n Swal.fire({\r\n text: \"Please select one or more invoices\",\r\n icon: \"warning\",\r\n buttonsStyling: false,\r\n confirmButtonText: \"Ok, got it!\",\r\n customClass: {\r\n confirmButton: \"btn fw-bold btn-light-primary\",\r\n },\r\n })\r\n }\r\n else{\r\n var printInvoiceResult = '';\r\n\r\n var printAll = new Promise((resolve, reject) => {\r\n selectedInvoiceIds.value.forEach((value, index, array) => {\r\n getInvoicePrintData(value).then((printedInvoice: any) =>{\r\n printInvoiceResult += printedInvoice;\r\n printInvoiceResult += '
';\r\n if (index === array.length -1) resolve();\r\n });\r\n });\r\n }) \r\n\r\n printAll.then(() =>{\r\n let invoiceWindow = window.open(\"\", \"Title\", \"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes\");\r\n if(invoiceWindow){\r\n invoiceWindow.document.body.innerHTML = printInvoiceResult;\r\n }\r\n });\r\n }\r\n }\r\n\r\n const printInvoice = async (row) => {\r\n getInvoicePrintData(row.id).then((printedInvoice: any) =>{\r\n let invoiceWindow = window.open(\"\", \"Title\", \"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=900,height=700,top=\"+(screen.height-400)+\",left=\"+(screen.width-840));\r\n if(invoiceWindow){\r\n invoiceWindow.document.body.innerHTML = printedInvoice;\r\n };\r\n });\r\n }\r\n\r\n const getInvoicePrintData = async(id) =>{\r\n return new Promise((resolve, reject) => { \r\n getInvoice(id).then((data) => {\r\n data.invoice_records = data.invoice_records.sort(function(a,b) { \r\n if(a.finance_record.id == b.finance_record.id) return 0;\r\n\r\n if (Date.parse(a.finance_record.record_date!) > Date.parse(b.finance_record.record_date!))\r\n return 1;\r\n if (Date.parse(a.finance_record.record_date!) < Date.parse(b.finance_record.record_date!))\r\n return -1;\r\n return 0;\r\n });\r\n let totalChargeAmount = 0;\r\n let totalPaidAmount = 0;\r\n\r\n data.invoice_date = moment(data.invoice_date).format('MM/DD/YYYY');\r\n data.invoice_records.forEach(element => {\r\n element.record_date = moment(element.finance_record.record_date).format('MM/DD/YYYY');\r\n element.ref_no = String(element.finance_record.id).padStart(8, \"0\");\r\n element.memo = element.finance_record.memo;\r\n element.payment_method = element.finance_record.payment_method;\r\n if(element.finance_record.record_type == 'Receivable'){\r\n element.charge_amount = element.finance_record.amount.toLocaleString(\"en-US\", {style: \"currency\", currency: \"USD\"});\r\n totalChargeAmount += +element.finance_record.amount;\r\n }\r\n else if(element.finance_record.record_type == 'Deposit' || element.finance_record.record_type == 'Credit' ) {\r\n if(element.finance_record.record_type == 'Deposit'){\r\n element.paid_amount = element.finance_record.amount.toLocaleString(\"en-US\", {style: \"currency\", currency: \"USD\"});\r\n }\r\n if(element.finance_record.record_type == 'Credit'){\r\n element.credit = element.finance_record.amount.toLocaleString(\"en-US\", {style: \"currency\", currency: \"USD\"});\r\n }\r\n totalPaidAmount += +element.finance_record.amount;\r\n }\r\n element.balance = (totalChargeAmount - totalPaidAmount).toLocaleString(\"en-US\", {style: \"currency\", currency: \"USD\"});\r\n });\r\n\r\n data.total_amount = (totalChargeAmount - totalPaidAmount).toLocaleString(\"en-US\", {style: \"currency\", currency: \"USD\"});\r\n var invoicePrintData = Mustache.render(invoiceTemplate, data);\r\n resolve(invoicePrintData);\r\n })\r\n .catch((error) => {\r\n reject(new Error ('getInvoice error => '+error));\r\n });\r\n });\r\n }\r\n\r\n const getStudents = async() =>{ \r\n await new Promise((resolve, reject) => {\r\n ApiService.setHeader();\r\n ApiService.get(\"student/status/Active\")\r\n .then(({ data }) => { \r\n students.values = data.data;\r\n resolve(data.data);\r\n })\r\n .catch(({ response }) => {\r\n console.log('getStudents error => '+response.data.errors);\r\n reject('getStudents error => '+response.data.errors);\r\n });\r\n });\r\n }\r\n\r\n const editInvoice = (row, data) =>{\r\n if(data.property !== 'handlers'){\r\n selectedInvoiceId.value = row.id;\r\n let invoiceButton = document.getElementById('invoice_create_button');\r\n invoiceButton?.click();\r\n }\r\n }\r\n\r\n onBeforeMount(async () => {\r\n getStudents();\r\n getInvoices();\r\n getReport();\r\n });\r\n\r\n onMounted(() => {\r\n setCurrentPageBreadcrumbs(\"Invoice\", [\"Management\"]);\r\n if(route.params.param==='create'){\r\n editInvoice({id:0}, {property : ''});\r\n }\r\n });\r\n\r\n return {\r\n handleDelete,\r\n printInvoice,\r\n setPage,\r\n pagedInvoices,\r\n pageSize,\r\n page,\r\n invoices,\r\n search,\r\n moment,\r\n selectedInvoiceId,\r\n students,\r\n invoiceTemplateId,\r\n editInvoice,\r\n resetSelectedInvoiceId,\r\n getInvoices,\r\n updateInvoiceId,\r\n handleSelectionChange,\r\n printInvoiceAll\r\n };\r\n },\r\n});\r\n","import { render } from \"./Invoice.vue?vue&type=template&id=3d646636&scoped=true\"\nimport script from \"./Invoice.vue?vue&type=script&lang=ts\"\nexport * from \"./Invoice.vue?vue&type=script&lang=ts\"\n\nimport \"./Invoice.vue?vue&type=style&index=0&id=3d646636&scoped=true&lang=css\"\nscript.render = render\nscript.__scopeId = \"data-v-3d646636\"\n\nexport default script","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader-v16/dist/index.js??ref--0-1!./EditInvoice.vue?vue&type=style&index=0&id=76350396&lang=scss&scoped=true\"","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader-v16/dist/index.js??ref--0-1!./EditInvoice.vue?vue&type=style&index=1&id=76350396&scoped=true&lang=css\"","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = global || self, global.Mustache = factory());\n}(this, (function () { 'use strict';\n\n /*!\n * mustache.js - Logic-less {{mustache}} templates with JavaScript\n * http://github.com/janl/mustache.js\n */\n\n var objectToString = Object.prototype.toString;\n var isArray = Array.isArray || function isArrayPolyfill (object) {\n return objectToString.call(object) === '[object Array]';\n };\n\n function isFunction (object) {\n return typeof object === 'function';\n }\n\n /**\n * More correct typeof string handling array\n * which normally returns typeof 'object'\n */\n function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }\n\n function escapeRegExp (string) {\n return string.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, '\\\\$&');\n }\n\n /**\n * Null safe way of checking whether or not an object,\n * including its prototype, has a given property\n */\n function hasProperty (obj, propName) {\n return obj != null && typeof obj === 'object' && (propName in obj);\n }\n\n /**\n * Safe way of detecting whether or not the given thing is a primitive and\n * whether it has the given property\n */\n function primitiveHasOwnProperty (primitive, propName) {\n return (\n primitive != null\n && typeof primitive !== 'object'\n && primitive.hasOwnProperty\n && primitive.hasOwnProperty(propName)\n );\n }\n\n // Workaround for https://issues.apache.org/jira/browse/COUCHDB-577\n // See https://github.com/janl/mustache.js/issues/189\n var regExpTest = RegExp.prototype.test;\n function testRegExp (re, string) {\n return regExpTest.call(re, string);\n }\n\n var nonSpaceRe = /\\S/;\n function isWhitespace (string) {\n return !testRegExp(nonSpaceRe, string);\n }\n\n var entityMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '/': '/',\n '`': '`',\n '=': '='\n };\n\n function escapeHtml (string) {\n return String(string).replace(/[&<>\"'`=\\/]/g, function fromEntityMap (s) {\n return entityMap[s];\n });\n }\n\n var whiteRe = /\\s*/;\n var spaceRe = /\\s+/;\n var equalsRe = /\\s*=/;\n var curlyRe = /\\s*\\}/;\n var tagRe = /#|\\^|\\/|>|\\{|&|=|!/;\n\n /**\n * Breaks up the given `template` string into a tree of tokens. If the `tags`\n * argument is given here it must be an array with two string values: the\n * opening and closing tags used in the template (e.g. [ \"<%\", \"%>\" ]). Of\n * course, the default is to use mustaches (i.e. mustache.tags).\n *\n * A token is an array with at least 4 elements. The first element is the\n * mustache symbol that was used inside the tag, e.g. \"#\" or \"&\". If the tag\n * did not contain a symbol (i.e. {{myValue}}) this element is \"name\". For\n * all text that appears outside a symbol this element is \"text\".\n *\n * The second element of a token is its \"value\". For mustache tags this is\n * whatever else was inside the tag besides the opening symbol. For text tokens\n * this is the text itself.\n *\n * The third and fourth elements of the token are the start and end indices,\n * respectively, of the token in the original template.\n *\n * Tokens that are the root node of a subtree contain two more elements: 1) an\n * array of tokens in the subtree and 2) the index in the original template at\n * which the closing tag for that section begins.\n *\n * Tokens for partials also contain two more elements: 1) a string value of\n * indendation prior to that tag and 2) the index of that tag on that line -\n * eg a value of 2 indicates the partial is the third tag on this line.\n */\n function parseTemplate (template, tags) {\n if (!template)\n return [];\n var lineHasNonSpace = false;\n var sections = []; // Stack to hold section tokens\n var tokens = []; // Buffer to hold the tokens\n var spaces = []; // Indices of whitespace tokens on the current line\n var hasTag = false; // Is there a {{tag}} on the current line?\n var nonSpace = false; // Is there a non-space char on the current line?\n var indentation = ''; // Tracks indentation for tags that use it\n var tagIndex = 0; // Stores a count of number of tags encountered on a line\n\n // Strips all whitespace tokens array for the current line\n // if there was a {{#tag}} on it and otherwise only space.\n function stripSpace () {\n if (hasTag && !nonSpace) {\n while (spaces.length)\n delete tokens[spaces.pop()];\n } else {\n spaces = [];\n }\n\n hasTag = false;\n nonSpace = false;\n }\n\n var openingTagRe, closingTagRe, closingCurlyRe;\n function compileTags (tagsToCompile) {\n if (typeof tagsToCompile === 'string')\n tagsToCompile = tagsToCompile.split(spaceRe, 2);\n\n if (!isArray(tagsToCompile) || tagsToCompile.length !== 2)\n throw new Error('Invalid tags: ' + tagsToCompile);\n\n openingTagRe = new RegExp(escapeRegExp(tagsToCompile[0]) + '\\\\s*');\n closingTagRe = new RegExp('\\\\s*' + escapeRegExp(tagsToCompile[1]));\n closingCurlyRe = new RegExp('\\\\s*' + escapeRegExp('}' + tagsToCompile[1]));\n }\n\n compileTags(tags || mustache.tags);\n\n var scanner = new Scanner(template);\n\n var start, type, value, chr, token, openSection;\n while (!scanner.eos()) {\n start = scanner.pos;\n\n // Match any text between tags.\n value = scanner.scanUntil(openingTagRe);\n\n if (value) {\n for (var i = 0, valueLength = value.length; i < valueLength; ++i) {\n chr = value.charAt(i);\n\n if (isWhitespace(chr)) {\n spaces.push(tokens.length);\n indentation += chr;\n } else {\n nonSpace = true;\n lineHasNonSpace = true;\n indentation += ' ';\n }\n\n tokens.push([ 'text', chr, start, start + 1 ]);\n start += 1;\n\n // Check for whitespace on the current line.\n if (chr === '\\n') {\n stripSpace();\n indentation = '';\n tagIndex = 0;\n lineHasNonSpace = false;\n }\n }\n }\n\n // Match the opening tag.\n if (!scanner.scan(openingTagRe))\n break;\n\n hasTag = true;\n\n // Get the tag type.\n type = scanner.scan(tagRe) || 'name';\n scanner.scan(whiteRe);\n\n // Get the tag value.\n if (type === '=') {\n value = scanner.scanUntil(equalsRe);\n scanner.scan(equalsRe);\n scanner.scanUntil(closingTagRe);\n } else if (type === '{') {\n value = scanner.scanUntil(closingCurlyRe);\n scanner.scan(curlyRe);\n scanner.scanUntil(closingTagRe);\n type = '&';\n } else {\n value = scanner.scanUntil(closingTagRe);\n }\n\n // Match the closing tag.\n if (!scanner.scan(closingTagRe))\n throw new Error('Unclosed tag at ' + scanner.pos);\n\n if (type == '>') {\n token = [ type, value, start, scanner.pos, indentation, tagIndex, lineHasNonSpace ];\n } else {\n token = [ type, value, start, scanner.pos ];\n }\n tagIndex++;\n tokens.push(token);\n\n if (type === '#' || type === '^') {\n sections.push(token);\n } else if (type === '/') {\n // Check section nesting.\n openSection = sections.pop();\n\n if (!openSection)\n throw new Error('Unopened section \"' + value + '\" at ' + start);\n\n if (openSection[1] !== value)\n throw new Error('Unclosed section \"' + openSection[1] + '\" at ' + start);\n } else if (type === 'name' || type === '{' || type === '&') {\n nonSpace = true;\n } else if (type === '=') {\n // Set the tags for the next time around.\n compileTags(value);\n }\n }\n\n stripSpace();\n\n // Make sure there are no open sections when we're done.\n openSection = sections.pop();\n\n if (openSection)\n throw new Error('Unclosed section \"' + openSection[1] + '\" at ' + scanner.pos);\n\n return nestTokens(squashTokens(tokens));\n }\n\n /**\n * Combines the values of consecutive text tokens in the given `tokens` array\n * to a single token.\n */\n function squashTokens (tokens) {\n var squashedTokens = [];\n\n var token, lastToken;\n for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {\n token = tokens[i];\n\n if (token) {\n if (token[0] === 'text' && lastToken && lastToken[0] === 'text') {\n lastToken[1] += token[1];\n lastToken[3] = token[3];\n } else {\n squashedTokens.push(token);\n lastToken = token;\n }\n }\n }\n\n return squashedTokens;\n }\n\n /**\n * Forms the given array of `tokens` into a nested tree structure where\n * tokens that represent a section have two additional items: 1) an array of\n * all tokens that appear in that section and 2) the index in the original\n * template that represents the end of that section.\n */\n function nestTokens (tokens) {\n var nestedTokens = [];\n var collector = nestedTokens;\n var sections = [];\n\n var token, section;\n for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {\n token = tokens[i];\n\n switch (token[0]) {\n case '#':\n case '^':\n collector.push(token);\n sections.push(token);\n collector = token[4] = [];\n break;\n case '/':\n section = sections.pop();\n section[5] = token[2];\n collector = sections.length > 0 ? sections[sections.length - 1][4] : nestedTokens;\n break;\n default:\n collector.push(token);\n }\n }\n\n return nestedTokens;\n }\n\n /**\n * A simple string scanner that is used by the template parser to find\n * tokens in template strings.\n */\n function Scanner (string) {\n this.string = string;\n this.tail = string;\n this.pos = 0;\n }\n\n /**\n * Returns `true` if the tail is empty (end of string).\n */\n Scanner.prototype.eos = function eos () {\n return this.tail === '';\n };\n\n /**\n * Tries to match the given regular expression at the current position.\n * Returns the matched text if it can match, the empty string otherwise.\n */\n Scanner.prototype.scan = function scan (re) {\n var match = this.tail.match(re);\n\n if (!match || match.index !== 0)\n return '';\n\n var string = match[0];\n\n this.tail = this.tail.substring(string.length);\n this.pos += string.length;\n\n return string;\n };\n\n /**\n * Skips all text until the given regular expression can be matched. Returns\n * the skipped string, which is the entire tail if no match can be made.\n */\n Scanner.prototype.scanUntil = function scanUntil (re) {\n var index = this.tail.search(re), match;\n\n switch (index) {\n case -1:\n match = this.tail;\n this.tail = '';\n break;\n case 0:\n match = '';\n break;\n default:\n match = this.tail.substring(0, index);\n this.tail = this.tail.substring(index);\n }\n\n this.pos += match.length;\n\n return match;\n };\n\n /**\n * Represents a rendering context by wrapping a view object and\n * maintaining a reference to the parent context.\n */\n function Context (view, parentContext) {\n this.view = view;\n this.cache = { '.': this.view };\n this.parent = parentContext;\n }\n\n /**\n * Creates a new context using the given view with this context\n * as the parent.\n */\n Context.prototype.push = function push (view) {\n return new Context(view, this);\n };\n\n /**\n * Returns the value of the given name in this context, traversing\n * up the context hierarchy if the value is absent in this context's view.\n */\n Context.prototype.lookup = function lookup (name) {\n var cache = this.cache;\n\n var value;\n if (cache.hasOwnProperty(name)) {\n value = cache[name];\n } else {\n var context = this, intermediateValue, names, index, lookupHit = false;\n\n while (context) {\n if (name.indexOf('.') > 0) {\n intermediateValue = context.view;\n names = name.split('.');\n index = 0;\n\n /**\n * Using the dot notion path in `name`, we descend through the\n * nested objects.\n *\n * To be certain that the lookup has been successful, we have to\n * check if the last object in the path actually has the property\n * we are looking for. We store the result in `lookupHit`.\n *\n * This is specially necessary for when the value has been set to\n * `undefined` and we want to avoid looking up parent contexts.\n *\n * In the case where dot notation is used, we consider the lookup\n * to be successful even if the last \"object\" in the path is\n * not actually an object but a primitive (e.g., a string, or an\n * integer), because it is sometimes useful to access a property\n * of an autoboxed primitive, such as the length of a string.\n **/\n while (intermediateValue != null && index < names.length) {\n if (index === names.length - 1)\n lookupHit = (\n hasProperty(intermediateValue, names[index])\n || primitiveHasOwnProperty(intermediateValue, names[index])\n );\n\n intermediateValue = intermediateValue[names[index++]];\n }\n } else {\n intermediateValue = context.view[name];\n\n /**\n * Only checking against `hasProperty`, which always returns `false` if\n * `context.view` is not an object. Deliberately omitting the check\n * against `primitiveHasOwnProperty` if dot notation is not used.\n *\n * Consider this example:\n * ```\n * Mustache.render(\"The length of a football field is {{#length}}{{length}}{{/length}}.\", {length: \"100 yards\"})\n * ```\n *\n * If we were to check also against `primitiveHasOwnProperty`, as we do\n * in the dot notation case, then render call would return:\n *\n * \"The length of a football field is 9.\"\n *\n * rather than the expected:\n *\n * \"The length of a football field is 100 yards.\"\n **/\n lookupHit = hasProperty(context.view, name);\n }\n\n if (lookupHit) {\n value = intermediateValue;\n break;\n }\n\n context = context.parent;\n }\n\n cache[name] = value;\n }\n\n if (isFunction(value))\n value = value.call(this.view);\n\n return value;\n };\n\n /**\n * A Writer knows how to take a stream of tokens and render them to a\n * string, given a context. It also maintains a cache of templates to\n * avoid the need to parse the same template twice.\n */\n function Writer () {\n this.templateCache = {\n _cache: {},\n set: function set (key, value) {\n this._cache[key] = value;\n },\n get: function get (key) {\n return this._cache[key];\n },\n clear: function clear () {\n this._cache = {};\n }\n };\n }\n\n /**\n * Clears all cached templates in this writer.\n */\n Writer.prototype.clearCache = function clearCache () {\n if (typeof this.templateCache !== 'undefined') {\n this.templateCache.clear();\n }\n };\n\n /**\n * Parses and caches the given `template` according to the given `tags` or\n * `mustache.tags` if `tags` is omitted, and returns the array of tokens\n * that is generated from the parse.\n */\n Writer.prototype.parse = function parse (template, tags) {\n var cache = this.templateCache;\n var cacheKey = template + ':' + (tags || mustache.tags).join(':');\n var isCacheEnabled = typeof cache !== 'undefined';\n var tokens = isCacheEnabled ? cache.get(cacheKey) : undefined;\n\n if (tokens == undefined) {\n tokens = parseTemplate(template, tags);\n isCacheEnabled && cache.set(cacheKey, tokens);\n }\n return tokens;\n };\n\n /**\n * High-level method that is used to render the given `template` with\n * the given `view`.\n *\n * The optional `partials` argument may be an object that contains the\n * names and templates of partials that are used in the template. It may\n * also be a function that is used to load partial templates on the fly\n * that takes a single argument: the name of the partial.\n *\n * If the optional `config` argument is given here, then it should be an\n * object with a `tags` attribute or an `escape` attribute or both.\n * If an array is passed, then it will be interpreted the same way as\n * a `tags` attribute on a `config` object.\n *\n * The `tags` attribute of a `config` object must be an array with two\n * string values: the opening and closing tags used in the template (e.g.\n * [ \"<%\", \"%>\" ]). The default is to mustache.tags.\n *\n * The `escape` attribute of a `config` object must be a function which\n * accepts a string as input and outputs a safely escaped string.\n * If an `escape` function is not provided, then an HTML-safe string\n * escaping function is used as the default.\n */\n Writer.prototype.render = function render (template, view, partials, config) {\n var tags = this.getConfigTags(config);\n var tokens = this.parse(template, tags);\n var context = (view instanceof Context) ? view : new Context(view, undefined);\n return this.renderTokens(tokens, context, partials, template, config);\n };\n\n /**\n * Low-level method that renders the given array of `tokens` using\n * the given `context` and `partials`.\n *\n * Note: The `originalTemplate` is only ever used to extract the portion\n * of the original template that was contained in a higher-order section.\n * If the template doesn't use higher-order sections, this argument may\n * be omitted.\n */\n Writer.prototype.renderTokens = function renderTokens (tokens, context, partials, originalTemplate, config) {\n var buffer = '';\n\n var token, symbol, value;\n for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {\n value = undefined;\n token = tokens[i];\n symbol = token[0];\n\n if (symbol === '#') value = this.renderSection(token, context, partials, originalTemplate, config);\n else if (symbol === '^') value = this.renderInverted(token, context, partials, originalTemplate, config);\n else if (symbol === '>') value = this.renderPartial(token, context, partials, config);\n else if (symbol === '&') value = this.unescapedValue(token, context);\n else if (symbol === 'name') value = this.escapedValue(token, context, config);\n else if (symbol === 'text') value = this.rawValue(token);\n\n if (value !== undefined)\n buffer += value;\n }\n\n return buffer;\n };\n\n Writer.prototype.renderSection = function renderSection (token, context, partials, originalTemplate, config) {\n var self = this;\n var buffer = '';\n var value = context.lookup(token[1]);\n\n // This function is used to render an arbitrary template\n // in the current context by higher-order sections.\n function subRender (template) {\n return self.render(template, context, partials, config);\n }\n\n if (!value) return;\n\n if (isArray(value)) {\n for (var j = 0, valueLength = value.length; j < valueLength; ++j) {\n buffer += this.renderTokens(token[4], context.push(value[j]), partials, originalTemplate, config);\n }\n } else if (typeof value === 'object' || typeof value === 'string' || typeof value === 'number') {\n buffer += this.renderTokens(token[4], context.push(value), partials, originalTemplate, config);\n } else if (isFunction(value)) {\n if (typeof originalTemplate !== 'string')\n throw new Error('Cannot use higher-order sections without the original template');\n\n // Extract the portion of the original template that the section contains.\n value = value.call(context.view, originalTemplate.slice(token[3], token[5]), subRender);\n\n if (value != null)\n buffer += value;\n } else {\n buffer += this.renderTokens(token[4], context, partials, originalTemplate, config);\n }\n return buffer;\n };\n\n Writer.prototype.renderInverted = function renderInverted (token, context, partials, originalTemplate, config) {\n var value = context.lookup(token[1]);\n\n // Use JavaScript's definition of falsy. Include empty arrays.\n // See https://github.com/janl/mustache.js/issues/186\n if (!value || (isArray(value) && value.length === 0))\n return this.renderTokens(token[4], context, partials, originalTemplate, config);\n };\n\n Writer.prototype.indentPartial = function indentPartial (partial, indentation, lineHasNonSpace) {\n var filteredIndentation = indentation.replace(/[^ \\t]/g, '');\n var partialByNl = partial.split('\\n');\n for (var i = 0; i < partialByNl.length; i++) {\n if (partialByNl[i].length && (i > 0 || !lineHasNonSpace)) {\n partialByNl[i] = filteredIndentation + partialByNl[i];\n }\n }\n return partialByNl.join('\\n');\n };\n\n Writer.prototype.renderPartial = function renderPartial (token, context, partials, config) {\n if (!partials) return;\n var tags = this.getConfigTags(config);\n\n var value = isFunction(partials) ? partials(token[1]) : partials[token[1]];\n if (value != null) {\n var lineHasNonSpace = token[6];\n var tagIndex = token[5];\n var indentation = token[4];\n var indentedValue = value;\n if (tagIndex == 0 && indentation) {\n indentedValue = this.indentPartial(value, indentation, lineHasNonSpace);\n }\n var tokens = this.parse(indentedValue, tags);\n return this.renderTokens(tokens, context, partials, indentedValue, config);\n }\n };\n\n Writer.prototype.unescapedValue = function unescapedValue (token, context) {\n var value = context.lookup(token[1]);\n if (value != null)\n return value;\n };\n\n Writer.prototype.escapedValue = function escapedValue (token, context, config) {\n var escape = this.getConfigEscape(config) || mustache.escape;\n var value = context.lookup(token[1]);\n if (value != null)\n return (typeof value === 'number' && escape === mustache.escape) ? String(value) : escape(value);\n };\n\n Writer.prototype.rawValue = function rawValue (token) {\n return token[1];\n };\n\n Writer.prototype.getConfigTags = function getConfigTags (config) {\n if (isArray(config)) {\n return config;\n }\n else if (config && typeof config === 'object') {\n return config.tags;\n }\n else {\n return undefined;\n }\n };\n\n Writer.prototype.getConfigEscape = function getConfigEscape (config) {\n if (config && typeof config === 'object' && !isArray(config)) {\n return config.escape;\n }\n else {\n return undefined;\n }\n };\n\n var mustache = {\n name: 'mustache.js',\n version: '4.2.0',\n tags: [ '{{', '}}' ],\n clearCache: undefined,\n escape: undefined,\n parse: undefined,\n render: undefined,\n Scanner: undefined,\n Context: undefined,\n Writer: undefined,\n /**\n * Allows a user to override the default caching strategy, by providing an\n * object with set, get and clear methods. This can also be used to disable\n * the cache by setting it to the literal `undefined`.\n */\n set templateCache (cache) {\n defaultWriter.templateCache = cache;\n },\n /**\n * Gets the default or overridden caching object from the default writer.\n */\n get templateCache () {\n return defaultWriter.templateCache;\n }\n };\n\n // All high-level mustache.* functions use this writer.\n var defaultWriter = new Writer();\n\n /**\n * Clears all cached templates in the default writer.\n */\n mustache.clearCache = function clearCache () {\n return defaultWriter.clearCache();\n };\n\n /**\n * Parses and caches the given template in the default writer and returns the\n * array of tokens it contains. Doing this ahead of time avoids the need to\n * parse templates on the fly as they are rendered.\n */\n mustache.parse = function parse (template, tags) {\n return defaultWriter.parse(template, tags);\n };\n\n /**\n * Renders the `template` with the given `view`, `partials`, and `config`\n * using the default writer.\n */\n mustache.render = function render (template, view, partials, config) {\n if (typeof template !== 'string') {\n throw new TypeError('Invalid template! Template should be a \"string\" ' +\n 'but \"' + typeStr(template) + '\" was given as the first ' +\n 'argument for mustache#render(template, view, partials)');\n }\n\n return defaultWriter.render(template, view, partials, config);\n };\n\n // Export the escaping function so that the user may override it.\n // See https://github.com/janl/mustache.js/issues/244\n mustache.escape = escapeHtml;\n\n // Export these mainly for testing, but also for advanced usage.\n mustache.Scanner = Scanner;\n mustache.Context = Context;\n mustache.Writer = Writer;\n\n return mustache;\n\n})));\n"],"sourceRoot":""}