{"version":3,"sources":["webpack:///./src/views/MessageSignature.vue?7bfa","webpack:///./src/views/MessageSignature.vue","webpack:///./src/views/MessageSignature.vue?563d","webpack:///./src/views/MessageSignature.vue?266d"],"names":["render","_vm","this","_h","$createElement","_c","_self","attrs","toolbar","staticStyle","staticClass","_v","on","updateSignatureSettings","model","value","signature","callback","$$v","$set","expression","key","signatureKey","style","tempSignature","$event","loading","modified","updateSignatureMessage","staticRenderFns","Vue","extend","data","title","help","body","button","text","link","process","left","icon","back","tooltip","permission","feature","right","learnMoreLink","randomKey","mounted","cloneSignatureMessage","computed","$store","getters","signatureEnabled","getEnabled","responsiveStyle","$vuetify","breakpoint","xsOnly","methods","popAppendHelp","dispatch","type","color","popSignaturesDisabled","paywall_type","metadata","popInvalidSignature","commit","message","popSignatureHelp","$validator","validateAll","valid","replace","payload","bool","enabled","stripped","window","_","pick","Analytics","track","watch","component","VBtn","VCard","VCardTitle","VRow","VSpacer","VSwitch"],"mappings":"2HAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,gBAAgB,CAACE,MAAM,CAAC,QAAUN,EAAIO,UAAU,CAACH,EAAG,SAAS,CAACI,YAAY,CAAC,OAAS,OAAO,YAAY,QAAQ,gBAAgB,OAAOF,MAAM,CAAC,UAAY,IAAI,SAAW,KAAK,CAACF,EAAG,eAAe,CAACA,EAAG,YAAYA,EAAG,MAAM,CAACK,YAAY,sCAAsCD,YAAY,CAAC,aAAa,QAAQ,CAACR,EAAIU,GAAG,uCAAuCN,EAAG,WAAW,CAACK,YAAY,OAAOH,MAAM,CAAC,eAAe,IAAIK,GAAG,CAAC,OAASX,EAAIY,yBAAyBC,MAAM,CAACC,MAAOd,EAAIe,UAAiB,QAAEC,SAAS,SAAUC,GAAMjB,EAAIkB,KAAKlB,EAAIe,UAAW,UAAWE,IAAME,WAAW,wBAAwB,GAAGf,EAAG,QAA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UC,MAAM,sBArBmB,SAyBjC,EAAKhC,OAAOU,SAAS,cAAec,GAzBH,OA4BvC,EAAKlD,SAAU,EA5BwB,gDA+B/C2D,MAAO,CACHrE,UADG,WAECd,KAAKgD,4BC5L0X,I,yGCOvYoC,EAAY,eACd,EACAtF,EACA6B,GACA,EACA,KACA,KACA,MAIa,aAAAyD,EAAiB,QAUhC,IAAkBA,EAAW,CAACC,OAAA,KAAKC,QAAA,KAAMC,WAAA,OAAWC,OAAA,KAAKC,UAAA,KAAQC,UAAA","file":"js/messages-signature.8ac29d05.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('v-card',{staticStyle:{\"margin\":\"auto\",\"max-width\":\"700px\",\"border-radius\":\"8px\"},attrs:{\"elevation\":\"4\",\"outlined\":\"\"}},[_c('v-card-title',[_c('v-spacer'),_c('div',{staticClass:\"tiny grey--text text--darken-2 mr-1\",staticStyle:{\"margin-top\":\"2px\"}},[_vm._v(\" Apply Signature to all Messages \")]),_c('v-switch',{staticClass:\"ma-0\",attrs:{\"hide-details\":\"\"},on:{\"change\":_vm.updateSignatureSettings},model:{value:(_vm.signature.enabled),callback:function ($$v) {_vm.$set(_vm.signature, \"enabled\", $$v)},expression:\"signature.enabled\"}})],1),_c('v-row',{staticStyle:{\"padding\":\"16px\"},attrs:{\"justify\":\"center\"}},[_c('message-text-form',{key:_vm.signatureKey,style:(_vm.responsiveStyle),attrs:{\"show-media-menu\":false,\"insert\":_vm.tempSignature,\"print\":false,\"rows\":4},on:{\"input\":function($event){_vm.tempSignature = $event;}}})],1),_c('v-row',{staticClass:\"mb-4\",attrs:{\"justify\":\"center\"}},[_c('v-btn',{staticClass:\"white--text\",attrs:{\"loading\":_vm.loading,\"color\":\"primary\",\"type\":\"submit\",\"disabled\":!_vm.modified},on:{\"click\":_vm.updateSignatureMessage}},[_vm._v(\" Save\")])],1)],1)],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\nimport Analytics from '@/services/Analytics'\nimport Setting from '@/types/Setting.interface'\nimport { randomKey } from '@/utility/helpers'\nimport Vue from 'vue'\nexport default Vue.extend({\n data() {\n return {\n loading: false,\n toolbar: {\n title: 'Signature Message',\n help: {\n title: 'Signature Message',\n body: \"The Signature is a message snippet that is auto-inserted at the end of every message sent out of MessageDesk. It's a great way for teams to personalize their messages and automatically include important information.\",\n button: {\n text: 'Learn More',\n link: `${process.env.VUE_APP_URL_LEARN}/en/articles/6060617-using-text-message-signatures`\n }\n },\n left: [\n {\n title: 'Back',\n icon: 'mdi-chevron-left',\n back: '/settings',\n tooltip: 'Back',\n permission: 0,\n feature: null\n }\n ],\n right: []\n },\n learnMoreLink: `Learn More`,\n signatureKey: randomKey(),\n tempSignature: null\n }\n },\n async mounted() {\n // If consent is already loaded, clone it\n if (this.signature) this.cloneSignatureMessage()\n },\n computed: {\n signature(): Setting {\n return this.$store.getters.signature\n },\n signatureEnabled(): boolean {\n return this.$store.getters.getEnabled('signature')\n },\n modified(): boolean {\n // Returns bool, true if either of the opt in or opt out messages have been changed\n return this.tempSignature != this.signature.data\n },\n responsiveStyle(): string {\n return this.$vuetify.breakpoint.xsOnly ? 'min-width:95%;' : 'min-width:500px;'\n }\n },\n methods: {\n cloneSignatureMessage(): void {\n // Set a temp variable for the current opt in message changes\n this.tempSignature = this.signature.data\n\n // Update our key so the form reflects the changes\n this.signatureKey = randomKey()\n },\n popAppendHelp(): void {\n this.$store.dispatch('dialogOpen', {\n type: 'MESSAGE',\n title: 'Append to All',\n text: 'This setting determines if the signature is applied to all messages.\\n\\nEnable this setting if you want the signature appended to every text message.\\n\\nDisable this setting if you do NOT want a signature appended to every message.',\n icon: 'bi-chat-right-quote-fill',\n color: 'primary'\n })\n },\n popSignaturesDisabled(): void {\n this.$store.dispatch('dialogOpen', {\n type: 'FEATURE',\n paywall_type: 'access',\n metadata: 'signature_enabled'\n })\n },\n popInvalidSignature(): void {\n this.$store.commit('appNotificationBarSet', {\n message: 'Cannot Save Empty Message Signature',\n type: 'error'\n })\n },\n popSignatureHelp(): void {\n this.$store.dispatch('dialogOpen', {\n type: 'MESSAGE',\n title: 'Signature Message',\n text: \"The Signature is a message snippet that is auto-inserted at the end of every message sent out of MessageDesk. It's a great way for teams to personalize their messages and automatically include important information.\",\n icon: 'bi-pen-fill',\n color: 'primary'\n })\n },\n async updateSignatureMessage(): Promise {\n // Check if signatures are enabled and if not, pop a dialog\n if (!this.signatureEnabled) return this.popSignaturesDisabled()\n\n // Validate the signature message\n const valid = await this.$validator.validateAll()\n\n // If not valid, return\n if (!valid) return\n\n // If user attempts to save a blank message signature we pop warning letting them know this isn't allowed\n if (!this.tempSignature) return this.popInvalidSignature()\n\n // Make sure we double encode any newline characters\n const text = this.tempSignature.replace('\\n', '\\\\n')\n\n // Create payload\n const payload = { ...this.signature, data: text }\n\n // Start the loading spinner\n this.loading = true\n\n // Dispatch api request to save the message signature\n const signature = await this.$store.dispatch('settingsPut', payload)\n\n // Stop the loading spinner\n this.loading = false\n\n // If request failed, return\n if (!signature) return\n\n // Confirmation app notification bar\n this.$store.commit('appNotificationBarSet', {\n message: 'Signature Message Updated.'\n })\n },\n async updateSignatureSettings(bool: boolean): Promise {\n // Check if signatures are enabled and if not, pop a dialog\n if (!this.signatureEnabled) {\n // Revert the modal\n this.signature.enabled = !bool\n\n // Pop our dialog\n return this.popSignaturesDisabled()\n }\n\n // We want our signature setting EXCEPT data\n const stripped = window._.pick(this.signature, ['id', 'name', 'enabled'])\n\n // Assemble the API payload\n const payload = { ...stripped, enabled: bool }\n\n // Start the loading spinner\n this.loading = true\n\n // Send event to Segment when message signature is toggled on\n if (bool) {\n Analytics.track('MessageSignatureOn')\n }\n\n // Send the changes to the server\n await this.$store.dispatch('settingsPut', payload)\n\n // Stop the loading spinner\n this.loading = false\n }\n },\n watch: {\n signature(): void {\n this.cloneSignatureMessage()\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!./MessageSignature.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!./MessageSignature.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./MessageSignature.vue?vue&type=template&id=7e25bf0a&\"\nimport script from \"./MessageSignature.vue?vue&type=script&lang=ts&\"\nexport * from \"./MessageSignature.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 { VCard } from 'vuetify/lib/components/VCard';\nimport { VCardTitle } from 'vuetify/lib/components/VCard';\nimport { VRow } from 'vuetify/lib/components/VGrid';\nimport { VSpacer } from 'vuetify/lib/components/VGrid';\nimport { VSwitch } from 'vuetify/lib/components/VSwitch';\ninstallComponents(component, {VBtn,VCard,VCardTitle,VRow,VSpacer,VSwitch})\n"],"sourceRoot":""}