{"version":3,"sources":["webpack:///./app/javascript/shared/helpers/markdownIt/link.js","webpack:///./app/javascript/shared/helpers/MessageFormatter.js","webpack:///./app/javascript/shared/mixins/messageFormatterMixin.js","webpack:///./app/javascript/dashboard/assets/images/chatwoot_bot.png","webpack:///./app/javascript/widget/components/UnreadMessage.vue?0234","webpack:///./app/javascript/widget/components/UnreadMessageList.vue?345f","webpack:///./app/javascript/widget/components/UnreadMessageList.vue?d57e","webpack:///./app/javascript/widget/components/UnreadMessage.vue?829b","webpack:///app/javascript/widget/components/UnreadMessage.vue","webpack:///./app/javascript/widget/components/UnreadMessage.vue","webpack:///./app/javascript/widget/components/UnreadMessage.vue?23e3","webpack:///app/javascript/widget/components/UnreadMessageList.vue","webpack:///./app/javascript/widget/components/UnreadMessageList.vue?4033","webpack:///./app/javascript/widget/components/UnreadMessageList.vue","webpack:///./app/javascript/widget/views/Campaigns.vue?944e","webpack:///app/javascript/widget/views/Campaigns.vue","webpack:///./app/javascript/widget/views/Campaigns.vue?ca47","webpack:///./app/javascript/widget/views/Campaigns.vue","webpack:///./app/javascript/shared/helpers/colorHelper.js"],"names":["USER_MENTIONS_REGEX","processInlineToken","blockToken","children","forEach","inlineToken","type","imgSrc","attrGet","height","URL","searchParams","get","attrSet","setImageHeight","md","require","html","xhtmlOut","breaks","langPrefix","linkify","typographer","quotes","maxNesting","use","renderer","rules","mention","tokens","idx","content","inline","ruler","before","state","silent","label","labelEnd","labelStart","pos","res","token","href","max","posMax","src","charCodeAt","helpers","parseLinkLabel","slice","parseLinkDestination","ok","normalizeLink","str","validateLink","match","RegExp","push","core","after","mila","attrs","class","rel","target","TWITTER_USERNAME_REGEX","TWITTER_HASH_REGEX","MessageFormatter","message","isATweet","isAPrivateNote","this","updatedMessage","replace","render","formatMessage","DOMParser","parseFromString","formattedMessage","body","textContent","methods","getPlainText","plainText","truncateMessage","description","length","highlightContent","searchTerm","highlightClass","plainTextContent","escapedSearchTerm","module","exports","_vm","_c","_self","staticClass","$dm","on","onClickMessage","avatarUrl","agentName","availabilityStatus","_v","directives","name","rawName","value","expression","_e","closeFullView","_s","$t","_l","index","key","id","messageType","sender","getMessageContent","campaignId","openConversationView","isBackgroundLighter","style","color","widgetColor","component","messages","isWidgetColorLighter","colorToCheck","parseInt","substr","adjustColorForContrast","backgroundColor","adjustedColor","iteration","getContrast","adjustmentDirection","getLuminance","mix","toHex"],"mappings":"yLACMA,G,OAAsB,0C,oQCE5B,IASMC,EAAqB,SAAAC,GACzBA,EAAWC,SAASC,SAAQ,SAAAC,GACD,UAArBA,EAAYC,MAXG,SAAAD,GACrB,IAAME,EAASF,EAAYG,QAAQ,OACnC,GAAKD,EAAL,CACA,IACME,EADM,IAAIC,IAAIH,GACDI,aAAaC,IAAI,mBAC/BH,GACLJ,EAAYQ,QAAQ,QAApB,kBAAwCJ,EAAxC,OAMIK,CAAeT,OAiBfU,EAAKC,EAAQ,KAARA,CAAuB,CAChCC,MAAM,EACNC,UAAU,EACVC,QAAQ,EACRC,WAAY,YACZC,SAAS,EACTC,aAAa,EACbC,OAAQ,2BACRC,WAAY,KAEXC,KDuBY,SAAuBV,GACpCA,EAAGW,SAASC,MAAMC,QALS,SAACC,EAAQC,GACpC,MAAM,0CAAN,OAAiDD,EAAOC,GAAKC,QAA7D,YAKAhB,EAAGiB,OAAOC,MAAMC,OAAO,OAAQ,WAhEA,SAACC,EAAOC,GACvC,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EAAO,GACPC,EAAMT,EAAMU,OAEhB,OAAwC,KAApCV,EAAMW,IAAIC,WAAWZ,EAAMK,OAI/BD,EAAaJ,EAAMK,IAAM,KACzBF,EAAWH,EAAMpB,GAAGiC,QAAQC,eAAed,EAAOA,EAAMK,KAAK,IAG9C,KAIfH,EAAQF,EAAMW,IAAII,MAAMX,EAAYD,IACpCE,EAAMF,EAAW,GAEPM,GAAqC,KAA9BT,EAAMW,IAAIC,WAAWP,KACpCA,GAAO,GACPC,EAAMN,EAAMpB,GAAGiC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IAF1BD,SAASD,EAAaE,OAAO,EAAG,GAAI,IAEE,IADtCD,SAASD,EAAaE,OAAO,EAAG,GAAI,KACS,IACrC,KAGTC,EAAyB,SAACR,EAAOS,GAK5C,IAJA,IAEIC,EAAgBV,EAEXW,EAAY,EAAGA,EAHD,GAG6BA,GAAa,EAAG,CAElE,GADqBC,YAAYF,EAAeD,IAL9B,IAOhB,MAEF,IAAMI,EACJC,YAAaJ,GAAiB,GAAM,OAAS,UAC/CA,EAAgBK,YAAIL,EAAeG,EAAqB,KAG1D,OAAOG,YAAMN","file":"js/55-c4c68cf1d2b963629576.chunk.js","sourcesContent":["// Process [@mention](mention://user/1/Pranav)\nconst USER_MENTIONS_REGEX = /mention:\\/\\/(user|team)\\/(\\d+)\\/(.+)/gm;\n\nconst buildMentionTokens = () => (state, silent) => {\n var label;\n var labelEnd;\n var labelStart;\n var pos;\n var res;\n var token;\n var href = '';\n var max = state.posMax;\n\n if (state.src.charCodeAt(state.pos) !== 0x5b /* [ */) {\n return false;\n }\n\n labelStart = state.pos + 1;\n labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true);\n\n // parser failed to find ']', so it's not a valid link\n if (labelEnd < 0) {\n return false;\n }\n\n label = state.src.slice(labelStart, labelEnd);\n pos = labelEnd + 1;\n\n if (pos < max && state.src.charCodeAt(pos) === 0x28 /* ( */) {\n pos += 1;\n res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);\n if (res.ok) {\n href = state.md.normalizeLink(res.str);\n if (state.md.validateLink(href)) {\n pos = res.pos;\n } else {\n href = '';\n }\n }\n pos += 1;\n }\n\n if (!href.match(new RegExp(USER_MENTIONS_REGEX))) {\n return false;\n }\n\n if (!silent) {\n state.pos = labelStart;\n state.posMax = labelEnd;\n\n token = state.push('mention', '');\n token.href = href;\n token.content = label;\n }\n\n state.pos = pos;\n state.posMax = max;\n\n return true;\n};\n\nconst renderMentions = () => (tokens, idx) => {\n return `${tokens[idx].content}`;\n};\n\nexport default function mentionPlugin(md) {\n md.renderer.rules.mention = renderMentions(md);\n md.inline.ruler.before('link', 'mention', buildMentionTokens(md));\n}\n","import mila from 'markdown-it-link-attributes';\nimport mentionPlugin from './markdownIt/link';\n\nconst setImageHeight = inlineToken => {\n const imgSrc = inlineToken.attrGet('src');\n if (!imgSrc) return;\n const url = new URL(imgSrc);\n const height = url.searchParams.get('cw_image_height');\n if (!height) return;\n inlineToken.attrSet('style', `height: ${height};`);\n};\n\nconst processInlineToken = blockToken => {\n blockToken.children.forEach(inlineToken => {\n if (inlineToken.type === 'image') {\n setImageHeight(inlineToken);\n }\n });\n};\n\nconst imgResizeManager = md => {\n // Custom rule for image resize in markdown\n // If the image url has a query param cw_image_height, then add a style attribute to the image\n md.core.ruler.after('inline', 'add-image-height', state => {\n state.tokens.forEach(blockToken => {\n if (blockToken.type === 'inline') {\n processInlineToken(blockToken);\n }\n });\n });\n};\n\nconst md = require('markdown-it')({\n html: false,\n xhtmlOut: true,\n breaks: true,\n langPrefix: 'language-',\n linkify: true,\n typographer: true,\n quotes: '\\u201c\\u201d\\u2018\\u2019',\n maxNesting: 20,\n})\n .use(mentionPlugin)\n .use(imgResizeManager)\n .use(mila, {\n attrs: {\n class: 'link',\n rel: 'noreferrer noopener nofollow',\n target: '_blank',\n },\n });\n\nconst TWITTER_USERNAME_REGEX = /(^|[^@\\w])@(\\w{1,15})\\b/g;\nconst TWITTER_USERNAME_REPLACEMENT = '$1[@$2](http://twitter.com/$2)';\nconst TWITTER_HASH_REGEX = /(^|\\s)#(\\w+)/g;\nconst TWITTER_HASH_REPLACEMENT = '$1[#$2](https://twitter.com/hashtag/$2)';\n\nclass MessageFormatter {\n constructor(message, isATweet = false, isAPrivateNote = false) {\n this.message = message || '';\n this.isAPrivateNote = isAPrivateNote;\n this.isATweet = isATweet;\n }\n\n formatMessage() {\n let updatedMessage = this.message;\n if (this.isATweet && !this.isAPrivateNote) {\n updatedMessage = updatedMessage.replace(\n TWITTER_USERNAME_REGEX,\n TWITTER_USERNAME_REPLACEMENT\n );\n updatedMessage = updatedMessage.replace(\n TWITTER_HASH_REGEX,\n TWITTER_HASH_REPLACEMENT\n );\n }\n return md.render(updatedMessage);\n }\n\n get formattedMessage() {\n return this.formatMessage();\n }\n\n get plainText() {\n const strippedOutHtml = new DOMParser().parseFromString(\n this.formattedMessage,\n 'text/html'\n );\n return strippedOutHtml.body.textContent || '';\n }\n}\n\nexport default MessageFormatter;\n","import MessageFormatter from '../helpers/MessageFormatter';\n\nexport default {\n methods: {\n formatMessage(message, isATweet, isAPrivateNote) {\n const messageFormatter = new MessageFormatter(\n message,\n isATweet,\n isAPrivateNote\n );\n return messageFormatter.formattedMessage;\n },\n getPlainText(message, isATweet) {\n const messageFormatter = new MessageFormatter(message, isATweet);\n return messageFormatter.plainText;\n },\n truncateMessage(description = '') {\n if (description.length < 100) {\n return description;\n }\n\n return `${description.slice(0, 97)}...`;\n },\n\n highlightContent(content = '', searchTerm = '', highlightClass = '') {\n const plainTextContent = this.getPlainText(content);\n\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#escaping\n const escapedSearchTerm = searchTerm.replace(\n /[.*+?^${}()|[\\]\\\\]/g,\n '\\\\$&'\n );\n\n return plainTextContent.replace(\n new RegExp(`(${escapedSearchTerm})`, 'ig'),\n `$1`\n );\n },\n },\n};\n","module.exports = __webpack_public_path__ + \"media/dashboard/assets/images/chatwoot_bot-905112376e6493b37e2cecea8f9dc50c.png\";","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ref--3-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/dist/cjs.js??ref--3-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--3-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./UnreadMessage.vue?vue&type=style&index=0&id=19750f4a&prod&lang=scss&scoped=true&\"","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ref--3-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/dist/cjs.js??ref--3-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--3-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./UnreadMessageList.vue?vue&type=style&index=0&id=38679e35&prod&lang=scss&scoped=true&\"","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:\"unread-wrap\"},[_c('div',{staticClass:\"close-unread-wrap\"},[_c('button',{staticClass:\"button small close-unread-button\",on:{\"click\":_vm.closeFullView}},[_c('span',{staticClass:\"flex items-center\"},[_c('fluent-icon',{staticClass:\"mr-1\",attrs:{\"icon\":\"dismiss\",\"size\":\"12\"}}),_vm._v(\"\\n \"+_vm._s(_vm.$t('UNREAD_VIEW.CLOSE_MESSAGES_BUTTON'))+\"\\n \")],1)])]),_vm._v(\" \"),_c('div',{staticClass:\"unread-messages\"},_vm._l((_vm.messages),function(message,index){return _c('unread-message',{key:message.id,attrs:{\"message-type\":message.messageType,\"message-id\":message.id,\"show-sender\":!index,\"sender\":message.sender,\"message\":_vm.getMessageContent(message),\"campaign-id\":message.campaignId}})}),1),_vm._v(\" \"),_c('div',{staticClass:\"open-read-view-wrap\"},[(_vm.unreadMessageCount)?_c('button',{staticClass:\"button clear-button\",on:{\"click\":_vm.openConversationView}},[_c('span',{staticClass:\"flex items-center\",class:{\n 'is-background-light': _vm.isBackgroundLighter,\n },style:({\n color: _vm.widgetColor,\n })},[_c('fluent-icon',{staticClass:\"mr-2\",attrs:{\"size\":\"16\",\"icon\":\"arrow-right\"}}),_vm._v(\"\\n \"+_vm._s(_vm.$t('UNREAD_VIEW.VIEW_MESSAGES_BUTTON'))+\"\\n \")],1)]):_vm._e()])])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js??ref--7-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./UnreadMessage.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js??ref--7-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./UnreadMessage.vue?vue&type=script&lang=js&\"","\n \n \n \n \n \n \n \n \n \n \n\n\n\n\n","import { render, staticRenderFns } from \"./UnreadMessage.vue?vue&type=template&id=19750f4a&scoped=true&\"\nimport script from \"./UnreadMessage.vue?vue&type=script&lang=js&\"\nexport * from \"./UnreadMessage.vue?vue&type=script&lang=js&\"\nimport style0 from \"./UnreadMessage.vue?vue&type=style&index=0&id=19750f4a&prod&lang=scss&scoped=true&\"\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 \"19750f4a\",\n null\n \n)\n\nexport default component.exports","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:\"chat-bubble-wrap\"},[_c('button',{staticClass:\"chat-bubble agent\",class:_vm.$dm('bg-white', 'dark:bg-slate-50'),on:{\"click\":_vm.onClickMessage}},[(_vm.showSender)?_c('div',{staticClass:\"row--agent-block\"},[_c('thumbnail',{attrs:{\"src\":_vm.avatarUrl,\"size\":\"20px\",\"username\":_vm.agentName,\"status\":_vm.availabilityStatus}}),_vm._v(\" \"),_c('span',{directives:[{name:\"dompurify-html\",rawName:\"v-dompurify-html\",value:(_vm.agentName),expression:\"agentName\"}],staticClass:\"agent--name\"}),_vm._v(\" \"),_c('span',{directives:[{name:\"dompurify-html\",rawName:\"v-dompurify-html\",value:(_vm.companyName),expression:\"companyName\"}],staticClass:\"company--name\"})],1):_vm._e(),_vm._v(\" \"),_c('div',{directives:[{name:\"dompurify-html\",rawName:\"v-dompurify-html\",value:(_vm.formatMessage(_vm.message, false)),expression:\"formatMessage(message, false)\"}],staticClass:\"message-content\"})])])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n \n \n \n \n \n {{ $t('UNREAD_VIEW.CLOSE_MESSAGES_BUTTON') }}\n \n \n \n \n \n \n\n \n \n \n \n {{ $t('UNREAD_VIEW.VIEW_MESSAGES_BUTTON') }}\n \n \n \n \n\n\n\n\n","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js??ref--7-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./UnreadMessageList.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js??ref--7-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./UnreadMessageList.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./UnreadMessageList.vue?vue&type=template&id=38679e35&scoped=true&\"\nimport script from \"./UnreadMessageList.vue?vue&type=script&lang=js&\"\nexport * from \"./UnreadMessageList.vue?vue&type=script&lang=js&\"\nimport style0 from \"./UnreadMessageList.vue?vue&type=style&index=0&id=38679e35&prod&lang=scss&scoped=true&\"\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 \"38679e35\",\n null\n \n)\n\nexport default component.exports","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('unread-message-list',{attrs:{\"messages\":_vm.messages},on:{\"close\":_vm.closeFullView}})\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n \n\n\n\n","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js??ref--7-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Campaigns.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js??ref--7-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Campaigns.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./Campaigns.vue?vue&type=template&id=1fac1358&\"\nimport script from \"./Campaigns.vue?vue&type=script&lang=js&\"\nexport * from \"./Campaigns.vue?vue&type=script&lang=js&\"\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","import { toHex, mix, getLuminance, getContrast } from 'color2k';\n\nexport const isWidgetColorLighter = color => {\n const colorToCheck = color.replace('#', '');\n const c_r = parseInt(colorToCheck.substr(0, 2), 16);\n const c_g = parseInt(colorToCheck.substr(2, 2), 16);\n const c_b = parseInt(colorToCheck.substr(4, 2), 16);\n const brightness = (c_r * 299 + c_g * 587 + c_b * 114) / 1000;\n return brightness > 225;\n};\n\nexport const adjustColorForContrast = (color, backgroundColor) => {\n const targetRatio = 3.1;\n const MAX_ITERATIONS = 20;\n let adjustedColor = color;\n\n for (let iteration = 0; iteration < MAX_ITERATIONS; iteration += 1) {\n const currentRatio = getContrast(adjustedColor, backgroundColor);\n if (currentRatio >= targetRatio) {\n break;\n }\n const adjustmentDirection =\n getLuminance(adjustedColor) < 0.5 ? '#fff' : '#151718';\n adjustedColor = mix(adjustedColor, adjustmentDirection, 0.05);\n }\n\n return toHex(adjustedColor);\n};\n"],"sourceRoot":""}