{"version":3,"sources":["webpack:///./src/views/Programs/Communications/Failures.vue?361e","webpack:///./src/views/Programs/Communications/Failures.vue","webpack:///./src/views/Programs/Communications/Failures.vue?4f99","webpack:///./src/views/Programs/Communications/Failures.vue?96db","webpack:///./src/views/Programs/Communications/Failures.vue?7d4a"],"names":["Actions","render","_vm","this","_h","$createElement","_c","_self","staticClass","_v","attrs","headers","statuses","scopedSlots","_u","key","fn","ref","value","_s","item","length","_l","f","id","banned","errorCode","normalizePhone","to","name","errorMessage","getAction","staticRenderFns","phone","includes","cleaned","replace","match","bannedCodes","props","components","DataTable","data","text","width","sortable","align","setup","groups","store","getters","communications","forEach","s","dateStrUtc","createdOnUtc","lastUpdateUtc","date","Date","formattedDateStr","toLocaleString","group","communicationID","body","sentDate","failures","push","Object","keys","map","k","partnerInfo","currentItem","Banned","None","dispatch","retrieveStatuses","accountNumber","upwardLeagueID","commit","clearStatuses","component"],"mappings":"yHAAA,ICuDKA,EDvDDC,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACA,EAAG,KAAK,CAACE,YAAY,aAAa,CAACN,EAAIO,GAAG,kBAAkBH,EAAG,MAAM,CAACE,YAAY,QAAQ,CAACF,EAAG,YAAY,CAACE,YAAY,cAAcE,MAAM,CAAC,QAAUR,EAAIS,QAAQ,MAAQT,EAAIU,SAAS,YAAa,GAAMC,YAAYX,EAAIY,GAAG,CAAC,CAACC,IAAI,YAAYC,GAAG,SAASC,GACrW,IAAIC,EAAQD,EAAIC,MAChB,MAAO,CAACZ,EAAG,MAAM,CAACE,YAAY,YAAY,CAACF,EAAG,OAAO,CAACI,MAAM,CAAC,MAAQQ,IAAQ,CAAChB,EAAIO,GAAG,IAAIP,EAAIiB,GAAGD,GAAO,YAAY,CAACH,IAAI,gBAAgBC,GAAG,SAASC,GACpJ,IAAIN,EAAUM,EAAIN,QACdS,EAAOH,EAAI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e6B,mBAEvB,CAAEpE,WAAUmB,YAAWJ,iBAAgBF,aC/GqX,I,wBCQnawD,EAAY,eACd,EACAhF,EACA+B,GACA,EACA,KACA,WACA,MAIa,aAAAiD,E,oECnBf","file":"js/chunk-612e145c.bbc7c715.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('h5',{staticClass:\"pt-3 pl-4\"},[_vm._v(\"SMS Failures\")]),_c('div',{staticClass:\"ml-4\"},[_c('DataTable',{staticClass:\"elevation-1\",attrs:{\"headers\":_vm.headers,\"items\":_vm.statuses,\"showExpand\":true},scopedSlots:_vm._u([{key:\"item.body\",fn:function(ref){\nvar value = ref.value;\nreturn [_c('div',{staticClass:\"ellipsis\"},[_c('span',{attrs:{\"title\":value}},[_vm._v(\" \"+_vm._s(value)+\" \")])])]}},{key:\"expanded-item\",fn:function(ref){\nvar headers = ref.headers;\nvar item = ref.item;\nreturn [_c('td',{attrs:{\"colspan\":headers.length}},[_c('table',{staticClass:\"innerTable\"},[_c('thead',[_c('tr',[_c('th'),_c('th',[_vm._v(\"Phone\")]),_c('th',[_vm._v(\"Name\")]),_c('th',[_vm._v(\"Reason\")]),_c('th',[_vm._v(\"Action\")])])]),_c('tbody',_vm._l((item.failures),function(f){return _c('tr',{key:f.id},[_c('td',[(_vm.banned(f.errorCode))?_c('i',{staticClass:\"fas fa-ban\"}):_c('i',{staticClass:\"fas fa-exclamation-triangle\"})]),_c('td',[_vm._v(_vm._s(_vm.normalizePhone(f.to)))]),_c('td',[_vm._v(_vm._s(f.name))]),_c('td',[_vm._v(_vm._s(f.errorCode)+\" - \"+_vm._s(f.errorMessage))]),_c('td',[_vm._v(_vm._s(_vm.getAction(f.errorCode)))])])}),0)])])]}}])})],1)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { defineComponent, computed, onMounted, onUnmounted } from '@vue/composition-api'\nimport DataTable from '@/elements/DataTable/DataTable.vue'\nimport { DataTableHeader } from 'vuetify/types'\nimport store from '@/store'\nconst normalizePhone = (phone: string) => {\n if (phone.includes('(')) return phone\n var cleaned = phone.replace('+1', '')\n var match = cleaned.match(/^(\\d{3})(\\d{3})(\\d{4})$/)!\n return '(' + match[1] + ') ' + match[2] + '-' + match[3]\n}\nconst bannedCodes = ['21211', '21610', '30005', '30003', '30006']\nenum Actions {\n Banned = 'This number will not receive future messages.',\n None = 'None taken.',\n}\nexport default defineComponent({\n name: 'Failures',\n props: {},\n components: {\n DataTable,\n },\n data() {\n const headers = ([\n { text: 'Message', value: 'body', width: '60%', sortable: false },\n { text: 'Failures', value: 'failures.length', align: 'center' },\n { text: '', value: 'data-table-expand', sortable: false },\n { text: 'Sent', value: 'sentDate', sortable: false },\n ] as unknown) as DataTableHeader\n\n return { headers }\n },\n setup() {\n const statuses = computed(() => {\n const groups = {} as any\n store.getters.communications.statuses.forEach((s) => {\n const dateStrUtc = s.createdOnUtc ?? s.lastUpdateUtc\n const date = dateStrUtc ? new Date(dateStrUtc) : null\n const formattedDateStr = date ? `${date.toLocaleString()}` : null\n const group = groups[s.communicationID] ?? {\n id: s.id,\n body: s.body,\n sentDate: formattedDateStr,\n failures: [],\n }\n group.failures.push(s)\n groups[s.communicationID] = group\n })\n return Object.keys(groups).map((k) => {\n return { ...groups[k] }\n })\n })\n const partnerInfo = computed(() => store.getters.communications.currentItem)\n const banned = (errorCode: string | null) => {\n return bannedCodes.includes(errorCode!)\n }\n const getAction = (errorCode: string | null) => {\n return banned(errorCode) ? Actions.Banned : Actions.None\n }\n onMounted(() =>\n store.dispatch.communications.retrieveStatuses({\n accountNumber: partnerInfo.value.accountNumber ?? '',\n upwardLeagueID: partnerInfo.value.upwardLeagueID ?? '',\n })\n )\n onUnmounted(() => {\n store.commit.communications.clearStatuses()\n })\n return { statuses, getAction, normalizePhone, banned }\n },\n})\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--14-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Failures.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--14-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Failures.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./Failures.vue?vue&type=template&id=3c12d39a&scoped=true&\"\nimport script from \"./Failures.vue?vue&type=script&lang=ts&\"\nexport * from \"./Failures.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./Failures.vue?vue&type=style&index=0&id=3c12d39a&scoped=true&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"3c12d39a\",\n null\n \n)\n\nexport default component.exports","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/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/lib/index.js??vue-loader-options!./Failures.vue?vue&type=style&index=0&id=3c12d39a&scoped=true&lang=scss&\""],"sourceRoot":""}