{"version":3,"sources":["webpack:///./src/views/PersonsSearch.vue?620b","webpack:///./src/views/PersonsSearch.vue","webpack:///./src/views/PersonsSearch.vue?0873","webpack:///./src/views/PersonsSearch.vue?55f1"],"names":["render","_vm","this","_h","$createElement","_c","_self","attrs","toolbar","searchBarPlaceHolder","on","onClear","model","value","callback","$$v","searchBarText","expression","contactActions","staticClass","_v","searchPersons","searchGroups","searchMessages","ref","personItems","personTile","noPersonsFoundPlaceholder","groupItems","groupTile","noGroupsFoundPlaceholder","messageItems","messageTile","isApp","noMessagesFoundPlaceholderMobile","noMessagesFoundPlaceholder","initialSearchPlaceholder","img","content","staticRenderFns","Vue","extend","components","TriPanelTools","data","button","text","$router","push","title","left","icon","back","tooltip","right","mounted","computed","mapGetters","scrollPositionLeft","searchBarListNextPage","searchBarListLastPage","tenant","userHasPermission","color","popNewContact","disabledPopup","$store","getters","disabledPopupText","hidden","isQBOXeroUser","isMobile","params","limit","searchtext","replace","paginate","page","get","set","debounce","commit","searchDeep","methods","goToGroup","group","id","$route","path","goToPerson","person","primary_channel_id","goToMessage","message","type","channel_id","groupIcon","$options","filters","badgeIcon","groupBadge","badge","listIcon","IListIconType","searchText","leftFooter","groupType","leftIcon","line1","str","name","highlight","line2","description","line3","groupPersonsCount","provider","data_provider","toLowerCase","messageIcon","messageType","messageAuthor","messageTo","line4","status","navigateToImport","paginateCurrentList","personIcon","personType","personFullNameOrEmail","personDefaultPhone","addressString","address_billing","extensionsToString","extensions","newPerson","name_given","name_family","phone_default","free_form_number","default","dispatch","component","props","withImport","selectedPerson","isValid","length","isNullOrWhiteSpace","Analytics","track","search_type","search_query","searchForPersons","searchForGroups","searchForMessages","watch","position","bottom","VBtn","VBtnToggle","VCol","VDivider","VRow","VTextField"],"mappings":"yHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,gBAAgB,CAACE,MAAM,CAAC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KxB,OAAO2E,SAAS,cAAe,OAR9B,2CAAF,sDAAE,MAYlB3D,WA1PK,WA6PD,IAAKhF,KAAKc,cACN,OAAOd,KAAKS,UAIhB,IAAMmC,EAAQ5C,KAAKc,cAAc2D,QAAQ,QAAS,IAG5CuE,EAAUpG,GAAQA,EAAKqG,OAAS,IAAMrG,EAAKsG,qBAGjD,OAAKF,EAGDhJ,KAAKmB,eACLgI,OAAUC,MAAM,mBAAoB,CAChCC,YAAa,WACbC,aAAc1G,IAGZ5C,KAAKuJ,oBAGXvJ,KAAKoB,cACL+H,OAAUC,MAAM,mBAAoB,CAChCC,YAAa,SACbC,aAAc1G,IAGZ5C,KAAKwJ,mBAGXxJ,KAAKqB,gBACL8H,OAAUC,MAAM,mBAAoB,CAChCC,YAAa,WACbC,aAAc1G,IAGX5C,KAAKyJ,0BANhB,OArBA,GA+BED,gBAvSD,WAuSgB,8KAEE,EAAKxF,OAAO2E,SAAS,eAAgB,EAAKrE,QAF5C,UAEXK,EAFW,OAKZA,EALY,wFAOf4E,iBA9SD,WA8SiB,8KAEC,EAAKvF,OAAO2E,SAAS,gBAAiB,EAAKrE,QAF5C,UAEZK,EAFY,OAKbA,EALa,wFAOhB8E,kBArTD,WAqTkB,8KAEA,EAAKzF,OAAO2E,SAAS,iBAAkB,EAAKrE,QAF5C,UAEbK,EAFa,OAKdA,EALc,yFAQ3B+E,MAAO,CACHlG,mBADG,SACgBmG,GAEXA,EAASC,QAAQ5J,KAAK4H,0BChfkW,I,yGCOpYgB,EAAY,eACd,EACA9I,EACAuC,GACA,EACA,KACA,KACA,MAIa,aAAAuG,EAAiB,QAUhC,IAAkBA,EAAW,CAACiB,OAAA,KAAKC,aAAA,KAAWC,OAAA,KAAKC,WAAA,KAASC,OAAA,KAAKC,aAAA","file":"js/persons-search.3255050b.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('page-template',{attrs:{\"toolbar\":_vm.toolbar}},[_c('div',[_c('v-col',[_c('v-row',{attrs:{\"no-gutters\":\"\"}},[_c('v-col',{attrs:{\"align\":\"left\"}},[_c('v-text-field',{attrs:{\"prepend-inner-icon\":\"mdi-magnify\",\"clearable\":\"\",\"outlined\":\"\",\"label\":_vm.searchBarPlaceHolder,\"color\":\"primary\",\"dense\":\"\",\"autofocus\":\"\"},on:{\"click:clear\":_vm.onClear},model:{value:(_vm.searchBarText),callback:function ($$v) {_vm.searchBarText=$$v},expression:\"searchBarText\"}})],1),_c('v-col',[_c('tri-panel-tools',{attrs:{\"buttons\":_vm.contactActions,\"justify\":\"end\"}})],1)],1),_c('v-row',[_c('v-col',{attrs:{\"align\":\"left\"}},[_c('div',{staticClass:\"grey--text text--darken-1\"},[_vm._v(\" Search For: \")]),_c('v-btn-toggle',{attrs:{\"mandatory\":\"\",\"color\":\"primary\"}},[_c('v-btn',{on:{\"click\":_vm.onClear},model:{value:(_vm.searchPersons),callback:function ($$v) {_vm.searchPersons=$$v},expression:\"searchPersons\"}},[_vm._v(\" Contacts \")]),_c('v-btn',{on:{\"click\":_vm.onClear},model:{value:(_vm.searchGroups),callback:function ($$v) {_vm.searchGroups=$$v},expression:\"searchGroups\"}},[_vm._v(\" Groups \")]),_c('v-btn',{on:{\"click\":_vm.onClear},model:{value:(_vm.searchMessages),callback:function ($$v) {_vm.searchMessages=$$v},expression:\"searchMessages\"}},[_vm._v(\" Messages \")])],1)],1)],1)],1),_c('v-divider')],1),(_vm.personItems)?_c('i-list',{ref:\"personsList\",attrs:{\"id\":\"personsSearchPersonsList\",\"color\":\"primary\",\"items\":_vm.personItems,\"tile\":_vm.personTile(),\"placeholder\":_vm.noPersonsFoundPlaceholder}}):(_vm.groupItems)?_c('i-list',{ref:\"groupsList\",attrs:{\"id\":\"groupsSearchPersonsList\",\"color\":\"primary\",\"items\":_vm.groupItems,\"tile\":_vm.groupTile(),\"placeholder\":_vm.noGroupsFoundPlaceholder}}):(_vm.messageItems)?_c('i-list',{ref:\"messagesList\",attrs:{\"id\":\"messagesSearchPersonsList\",\"color\":\"primary\",\"items\":_vm.messageItems,\"tile\":_vm.messageTile(),\"placeholder\":_vm.isApp ? _vm.noMessagesFoundPlaceholderMobile : _vm.noMessagesFoundPlaceholder}}):_c('i-list-placeholder',{attrs:{\"img\":_vm.initialSearchPlaceholder.img,\"placeholder\":_vm.initialSearchPlaceholder.content}})],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\n\n\n\n\n\n\n\nimport ScrollPosition from '@/types/components/ScrollPosition.interface'\nimport IListIcon, { IListBadge, IListIconType } from '@/types/components/IListIcon.interface'\nimport IListTile from '@/types/components/IListTile.interface'\nimport Person from '@/types/Person.interface'\nimport Vue from 'vue'\nimport { mapGetters } from 'vuex'\nimport Group from '@/types/Group.interface'\nimport Message from '@/types/Message.interface'\nimport TriPanelTools from '@/components/TriPanelTools.vue'\nimport Button from '@/types/components/Button.interface'\nimport { debounce } from 'debounce'\nimport Analytics from '@/services/Analytics'\nexport default Vue.extend({\n components: { TriPanelTools },\n data() {\n return {\n // The IList placeholder shown when no search has been made \n initialSearchPlaceholder: {\n content: `Enter some text into the searchbar, then press 'enter' to see your results here.`,\n img: 'startTyping'\n },\n // Next three placeholders are shown when no item is found that the user searched for\n noGroupsFoundPlaceholder: {\n content: `No groups found, please try adjusting search`,\n img: 'noSearch'\n },\n noMessagesFoundPlaceholder: {\n content: `No messages found within the last 30 days`,\n button: {\n text: 'Search All Time',\n callback: () => {this.$router.push('/messages')},\n },\n img: 'noSearch'\n },\n noMessagesFoundPlaceholderMobile: {\n content: `No messages found within the last 30 days`,\n img: 'noSearch'\n },\n noPersonsFoundPlaceholder: {\n content: `No contacts found, please try adjusting search`,\n img: 'noSearch'\n },\n toolbar: {\n title: 'Search',\n left: [\n {\n title: 'Back',\n icon: 'mdi-chevron-left',\n back: '/home',\n tooltip: 'Back'\n }\n ],\n right: []\n },\n // Variables hold which search is currently active with the default being the persons (contacts) search\n searchPersons: true,\n searchGroups: false,\n searchMessages: false,\n }\n },\n mounted() {\n this.onClear()\n },\n computed: {\n ...mapGetters({\n isApp: 'isApp',\n scrollPositionLeft: 'scrollPositionLeft',\n searchBarText: 'searchBarText',\n searchBarListNextPage: 'searchBarListNextPage',\n searchBarListLastPage: 'searchBarListLastPage',\n personItems: 'personsSearchList',\n groupItems: 'groupsSearchList',\n messageItems: 'messagesSearchList',\n tenant: 'tenant',\n userHasPermission: 'userHasPermission'\n }),\n // Our tools we display on the top toolbar for managing contacts when NOT multiselected\n contactActions(): Button[] {\n return [\n {\n text: 'Add Contact',\n icon: 'mdi-account-plus',\n color: 'primary',\n callback: () => this.popNewContact()\n },\n {\n text: 'Import Contacts',\n icon: 'mdi-arrow-expand-up',\n color: 'primary',\n disabledPopup: !this.$store.getters.userHasPermission(2),\n disabledPopupText:\n \"You don't have permission to access this feature. Please contact your account's admin to perform this task or have them update your account permission\",\n hidden: this.isQBOXeroUser() || this.isApp || this.isMobile,\n callback: () => this.$router.push('/csv/import')\n }\n ]\n },\n // The IList pagination params\n params(): object {\n return {\n limit: 30,\n searchtext: this.searchBarText.replace(/[()]/g, ''),\n paginate: true,\n page: 1\n }\n },\n // Holds the users current search query\n searchBarText: {\n get(): string {\n return this.$store.getters.searchBarText\n },\n set: debounce(function(value: string): void {\n this.$store.commit('searchBarTextSet', value)\n this.searchDeep()\n }, 250)\n },\n // Depending on the search the user is doing we change the placeholder to help tell the user what they are searching for\n searchBarPlaceHolder() {\n if (this.searchPersons) return \"Search for Contacts\"\n\n if (this.searchGroups) return \"Search for Groups\"\n\n if (this.searchMessages) return \"Search for Messages\"\n }\n },\n methods: {\n // Callback function used in our IList for the groups search which takes user to the group of the tile they click\n goToGroup(group: Group): void {\n this.$router.push(`/groups/${group.id}?sender=${this.$route.path}`)\n },\n // Callback function used in our IList for the persons search which takes user to the channel of the tile they click\n goToPerson(person: Person): void {\n this.$router.push(`/inbox?channel=${person.primary_channel_id}`)\n },\n goToMessage(message: Message): void {\n // If the user clicked on a scheduled message we add an additional search parameter so we can modify the SmsMessagesPanel filter to show scheduled messages\n // since they are not shown in the default filter, the message id is also passed so it can be scrolled to\n if (message.type === 'scheduled') return this.$router.push(`/inbox?channel=${message.channel_id}&item=${message.id}&filter=${message.type}`)\n \n // Otherwise just pass the message id so we can scroll to it when the channel is loaded\n this.$router.push(`/inbox?channel=${message.channel_id}&item=${message.id}`)\n },\n // The IListIcon bound to the persons list\n groupIcon(group: Group): IListIcon {\n // Get our icon from the vue filter\n const icon = this.$options.filters.groupIcon(group)\n\n // Get our badge icon\n const badgeIcon = this.$options.filters.groupBadge(group)\n\n // Get our badge\n const badge: IListBadge = {\n color: 'grey darken-1',\n icon: badgeIcon\n }\n\n // Create our IListIcon object\n const listIcon: IListIcon = {\n type: IListIconType.icon,\n content: icon,\n color: 'grey darken-1'\n }\n\n // If we have a badge icon, add badge to our ilisticon\n if (badgeIcon) listIcon.badge = badge\n\n // Return our IListIcon object\n return listIcon\n },\n // The group tile bound to the groups list\n groupTile(): IListTile {\n // We use a temp variable and don't change the actual search text the user sees, reason is if the user decides to format their search like so (775)\n // if we change this.searchBarText then what they type will get replaced and causes a bad UX\n const searchText = this.searchBarText.replace(/[()]/g, '')\n return {\n leftFooter: (group: Group) => this.$options.filters.groupType(group),\n leftIcon: (group: Group) => this.groupIcon(group),\n line1: (group: Group) => {\n const str = group.name\n const highlight = this.$options.filters.highlight(str, searchText)\n return highlight\n },\n line2: (group: Group) => {\n const str = group.description\n const highlight = this.$options.filters.highlight(str, searchText)\n return highlight\n },\n line3: (group: Group) => {\n const str = this.$options.filters.groupPersonsCount(group)\n const highlight = this.$options.filters.highlight(str, searchText)\n return highlight\n },\n \n callback: (group: Group) => this.goToGroup(group)\n }\n },\n isQBOXeroUser(): boolean {\n // Grab the tenant's data provider\n const provider = this.tenant.data_provider\n\n // If provider is null, return false\n if (!provider) return false\n\n // Else, check if they are QBO or Xero\n const isQBOXeroUser =\n provider.toLowerCase() === 'qbo' || provider.toLowerCase() === 'xero'\n\n // Return true if they are QBO or Xero\n return isQBOXeroUser\n },\n // The IListIcon bound to the messages list\n messageIcon(message: Message): IListIcon {\n // Get our icon from the vue filter\n const icon = this.$options.filters.messageIcon(message)\n\n // Create our IListIcon object\n const listIcon: IListIcon = {\n type: IListIconType.icon,\n content: icon,\n color: 'grey darken-1'\n }\n\n // Scheduled messages only include a clock badge to indicate they are scheduled \n if (message.type === 'scheduled') {\n // Create our badge\n const badge: IListBadge = {\n color: 'grey darken-1',\n icon: 'mdi-clock'\n }\n\n listIcon.badge = badge\n\n return listIcon\n }\n\n // Return our IListIcon object\n return listIcon\n },\n // The message tile bound to the messages list\n messageTile(): IListTile {\n // We use a temp variable and don't change the actual search text the user sees, reason is if the user decides to format their search like so (775)\n // if we change this.searchBarText then what they type will get replaced and causes a bad UX\n const searchText = this.searchBarText.replace(/[()]/g, '')\n return {\n leftFooter: (message: Message) => this.$options.filters.messageType(message),\n leftIcon: (message: Message) => this.messageIcon(message),\n line1: (message: Message) => {\n const str = message.text\n const highlight = this.$options.filters.highlight(str, searchText)\n return highlight\n },\n line2: (message: Message) => {\n const str = \"From: \" + this.$options.filters.messageAuthor(message)\n const highlight = this.$options.filters.highlight(str, searchText)\n return highlight\n },\n line3: (message: Message) => {\n const str = \"To: \" + this.$options.filters.messageTo(message)\n const highlight = this.$options.filters.highlight(str, searchText)\n return highlight\n },\n line4: (message: Message) => {\n const str = \"Message Status: \" + message.status\n const highlight = this.$options.filters.highlight(str, searchText)\n return highlight\n },\n \n callback: (message: Message) => this.goToMessage(message)\n }\n },\n navigateToImport(): void {\n // Take user to contat import workflow\n this.$router.push('/csv/import')\n },\n // If the user chooses to clear the search via the x icon then we reset the search\n onClear(): void {\n // Prevents bug where a user leaves the search experience and returns to have their search still there\n this.$store.commit('searchBarReset')\n },\n // Paginate the next page of the current filtered list\n paginateCurrentList(): void {\n // Get current pagination params\n const params = this.params\n\n if (this.searchBarListNextPage > this.searchBarListLastPage) return\n\n params.page = this.searchBarListNextPage\n\n // Paginate the next page\n this.searchDeep()\n },\n // The IListIcon bound to the persons list\n personIcon(person: Person): IListIcon {\n // Get our icon from the vue filter\n const icon = this.$options.filters.personIcon(person)\n\n // Create our IListIcon object\n const listIcon: IListIcon = {\n type: IListIconType.icon,\n content: icon,\n color: 'grey darken-1'\n }\n\n // Return our IListIcon object\n return listIcon\n },\n // The persons tile bound to the persons list\n personTile(): IListTile {\n // We use a temp variable and don't change the actual search text the user sees, reason is if the user decides to format their search like so (775)\n // if we change this.searchBarText then what they type will get replaced and causes a bad UX\n const searchText = this.searchBarText.replace(/[()]/g, '')\n return {\n leftFooter: (person: Person) => this.$options.filters.personType(person),\n leftIcon: (person: Person) => this.personIcon(person),\n line1: (person: Person) => {\n // We format the line, in this case the persons phone number, and then apply a highlight for the matching text which is shown to the user if there is a match\n const str = this.$options.filters.personFullNameOrEmail(person)\n const highlight = this.$options.filters.highlight(str, searchText)\n return highlight\n },\n line2: (person: Person) => {\n const str = this.$options.filters.personDefaultPhone(person)\n const highlight = this.$options.filters.highlight(str, searchText)\n return highlight\n },\n line3: (person: Person) => {\n const str = this.$options.filters.addressString(person.address_billing)\n const highlight = this.$options.filters.highlight(str, searchText)\n return highlight\n },\n line4: (person: Person) => {\n const str = this.$options.filters.extensionsToString(person.extensions)\n const highlight = this.$options.filters.highlight(str, searchText)\n return highlight\n },\n \n callback: (person: Person) => this.goToPerson(person)\n }\n },\n // Pop a new contact form\n popNewContact(): void {\n // Our base new person model\n const newPerson = {\n name_given: null,\n name_family: null,\n phone_default: {\n free_form_number: null,\n default: true,\n type: 'MOBILE'\n }\n }\n\n // Open the dialog app workflow to create a new contact\n this.$store.dispatch('dialogOpen', {\n type: 'APP',\n title: 'Add Contact',\n icon: 'mdi-account',\n color: 'primary',\n component: 'new-contact-selector',\n props: {\n model: newPerson,\n withImport: true\n },\n callback: async (person: Person) => {\n // If the request failed, do nothing\n if (!person) return null\n\n // Else, add the new contact to the top of the personsList\n this.selectedPerson = person\n\n // close the app dialog\n this.$store.dispatch('dialogClose', 'APP')\n }\n })\n },\n searchDeep(): void {\n // If the user gets rid of the searchtext via backspaces we want to reset the search once they get rid of all the text so we don't\n // cache search items and show them when no search is occuring\n if (!this.searchBarText) {\n return this.onClear()\n }\n\n // Remove parentheses from our search text because it turns our search query into a regex\n const text = this.searchBarText.replace(/[()]/g, '')\n\n // Validate the search text for length and whitespace\n const isValid = text && text.length > 1 && !text.isNullOrWhiteSpace()\n\n // If the search text is NOT valid, do nothing\n if (!isValid) return\n\n // If we are in the contact search section we will pass the search to our persons search, same applies for messages and groups\n if (this.searchPersons) {\n Analytics.track('GlobalSearchUsed', {\n search_type: 'Contacts',\n search_query: text\n })\n\n return this.searchForPersons()\n }\n\n if (this.searchGroups) {\n Analytics.track('GlobalSearchUsed', {\n search_type: 'Groups',\n search_query: text\n })\n\n return this.searchForGroups()\n }\n\n if (this.searchMessages) {\n Analytics.track('GlobalSearchUsed', {\n search_type: 'Messages',\n search_query: text\n })\n\n return this.searchForMessages()\n }\n\n },\n async searchForGroups(): Promise {\n // Send the search request\n const page = await this.$store.dispatch('groupsSearch', this.params)\n\n // If the request failed, do nothing\n if (!page) return\n },\n async searchForPersons(): Promise {\n // Send the search request\n const page = await this.$store.dispatch('personsSearch', this.params)\n\n // If the request failed, do nothing\n if (!page) return\n },\n async searchForMessages(): Promise {\n // Send the search request\n const page = await this.$store.dispatch('messagesSearch', this.params)\n\n // If the request failed, do nothing\n if (!page) return\n },\n },\n watch: {\n scrollPositionLeft(position: ScrollPosition): void {\n // If we are NOT paginating AND scroll is at bottom, paginate next page\n if (position.bottom) this.paginateCurrentList()\n }\n }\n})\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PersonsSearch.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PersonsSearch.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./PersonsSearch.vue?vue&type=template&id=8ac6bb34&\"\nimport script from \"./PersonsSearch.vue?vue&type=script&lang=ts&\"\nexport * from \"./PersonsSearch.vue?vue&type=script&lang=ts&\"\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 null,\n null\n \n)\n\nexport default component.exports\n\n/* vuetify-loader */\nimport installComponents from \"!../../node_modules/vuetify-loader/lib/runtime/installComponents.js\"\nimport { VBtn } from 'vuetify/lib/components/VBtn';\nimport { VBtnToggle } from 'vuetify/lib/components/VBtnToggle';\nimport { VCol } from 'vuetify/lib/components/VGrid';\nimport { VDivider } from 'vuetify/lib/components/VDivider';\nimport { VRow } from 'vuetify/lib/components/VGrid';\nimport { VTextField } from 'vuetify/lib/components/VTextField';\ninstallComponents(component, {VBtn,VBtnToggle,VCol,VDivider,VRow,VTextField})\n"],"sourceRoot":""}