{"version":3,"sources":["webpack:///./app/javascript/shared/components/Button.vue?d9aa","webpack:///./app/javascript/shared/components/Button.vue?26c2","webpack:///app/javascript/shared/components/Button.vue","webpack:///./app/javascript/shared/components/Button.vue","webpack:///./app/javascript/widget/views/Home.vue?40ec","webpack:///./app/javascript/widget/components/GroupedAvatars.vue?4d56","webpack:///app/javascript/widget/components/GroupedAvatars.vue","webpack:///./app/javascript/widget/components/AvailableAgents.vue?df8c","webpack:///app/javascript/widget/components/AvailableAgents.vue","webpack:///./app/javascript/widget/components/GroupedAvatars.vue","webpack:///./app/javascript/widget/components/GroupedAvatars.vue?84ff","webpack:///./app/javascript/widget/components/AvailableAgents.vue","webpack:///./app/javascript/widget/components/AvailableAgents.vue?cfab","webpack:///./app/javascript/widget/components/TeamAvailability.vue?b386","webpack:///app/javascript/widget/components/TeamAvailability.vue","webpack:///./app/javascript/widget/components/TeamAvailability.vue","webpack:///./app/javascript/widget/components/TeamAvailability.vue?9f03","webpack:///./app/javascript/widget/views/Home.vue?129f","webpack:///app/javascript/widget/views/Home.vue","webpack:///./app/javascript/widget/views/Home.vue","webpack:///./node_modules/@chatwoot/utils/dist/utils.esm.js"],"names":["component","_vm","this","_h","$createElement","_self","_c","class","buttonClassName","style","attrs","disabled","on","onClick","_t","staticClass","_l","user","index","key","id","name","avatar","users","$dm","_v","_s","isOnline","$t","replyWaitMessage","availableAgents","_e","widgetColor","textColor","startConversation","hasConversation","conversationSize","debounce","func","wait","immediate","timeout","context","args","arguments","later","apply","callNow","clearTimeout","window","setTimeout","getContrastingTextColor","bgColor","color","replace","parseInt","slice","formatTime","timeInSeconds","formattedTime","minutes","Math","floor","seconds","hours","_minutes","days","_hours","trimContent","content","maxLength","ellipsis","trimmedContent","length","substring","parseBoolean","candidate","candidateString","String","toLowerCase","Boolean","JSON","parse","error","sortAsc","arr","sort","a","b","_quantileForSorted","sorted","q","min","max","value","clamped","pos","base","rest","undefined","getQuantileIntervals","data","intervals","map","interval","MESSAGE_VARIABLES_REGEX","capitalizeName","s","toUpperCase","getFirstName","_ref","firstName","split","shift","getLastName","_ref2","lastName","pop","getMessageVariables","_ref3","_assignee$email","conversation","_conversation$meta","meta","assignee","sender","email","phone_number","replaceVariablesInMessage","_ref4","message","variables","_","trim","getUndefinedVariablesInMessage","_ref5","matches","match","filter","variable"],"mappings":"4FAAA,ICA4M,ECW5M,CACA,OACA,OACA,aACA,YAEA,MACA,YACA,gBAEA,SACA,YACA,YAEA,WACA,YACA,YAEA,UACA,aACA,aAGA,UACA,kBACA,yDAWA,MAVA,sBACA,+DAGA,4DACA,wCAEA,aACA,iBAEA,CACA,EACA,eACA,WAOA,OANA,eACA,gCAEA,iBACA,wBAEA,CACA,GAEA,SACA,WACA,qBACA,I,OCxDIA,EAAY,YACd,GHRW,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAuC,OAAjBH,EAAII,MAAMC,IAAIH,GAAa,SAAS,CAACI,MAAMN,EAAIO,gBAAgBC,MAAOR,EAAgB,aAAES,MAAM,CAAC,SAAWT,EAAIU,UAAUC,GAAG,CAAC,MAAQX,EAAIY,UAAU,CAACZ,EAAIa,GAAG,YAAY,EAAE,GAC1N,IGUpB,EACA,KACA,KACA,MAIa,IAAAd,E,kDClBf,I,kCCAoN,ECwBpN,CACA,sBACA,sB,MAAA,GACA,OACA,OACA,WACA,kB,OC9BqN,ECOrN,CACA,uBACA,2BCFgB,YACd,GCRW,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBE,EAAGL,EAAII,MAAMC,IAAIH,EAAG,OAAOG,EAAG,MAAM,CAACS,YAAY,QAAQd,EAAIe,GAAIf,EAAS,OAAE,SAASgB,EAAKC,GAAO,OAAOZ,EAAG,OAAO,CAACa,IAAIF,EAAKG,GAAGb,OAAQW,EAAQ,QAAU,IAAM,sDAAuD,CAACZ,EAAG,YAAY,CAACI,MAAM,CAAC,KAAO,OAAO,SAAWO,EAAKI,KAAK,IAAMJ,EAAKK,OAAO,aAAa,O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BE,SAC9BC,EAASH,EAAmBG,OAC5BzG,EAAKqG,EAAarG,GACpB,MAAO,CACL,eAAgBsF,GAA0B,MAAVmB,OAAiB,EAASA,EAAOxG,OAAS,IAC1E,qBAAsBwF,EAAa,CACjC5F,KAAM4G,IAER,oBAAqBX,EAAY,CAC/BjG,KAAM4G,IAER,gBAA2B,MAAVA,OAAiB,EAASA,EAAOC,MAClD,gBAA2B,MAAVD,OAAiB,EAASA,EAAOE,aAClD,aAAwB,MAAVF,OAAiB,EAASA,EAAOzG,GAC/C,kBAAmBA,EACnB,aAAcsF,GAA4B,MAAZkB,OAAmB,EAASA,EAASvG,OAAS,IAC5E,mBAAoBwF,EAAa,CAC/B5F,KAAM2G,IAER,kBAAmBV,EAAY,CAC7BjG,KAAM2G,IAER,cAAiF,OAAjEJ,EAA8B,MAAZI,OAAmB,EAASA,EAASE,OAAiBN,EAAkB,GAE9G,EACIQ,EAA4B,SAAmCC,GACjE,IAAIC,EAAUD,EAAMC,QAClBC,EAAYF,EAAME,UAEpB,OAAOD,EAAQ5E,QAAQmD,GAAyB,SAAU2B,EAAG9E,GAC3D,OAAO6E,EAAU7E,EAAQ+E,QAAUF,EAAU7E,EAAQ+E,OAAOtD,eAAiB,EAC/E,GACF,EACIuD,EAAiC,SAAwCC,GAC3E,IAAIL,EAAUK,EAAML,QAClBC,EAAYI,EAAMJ,UAEhBK,EAD0CN,EA5DnC5E,QAAQ,oBAAqB,IA6DDmF,MAAMhC,GAC7C,OAAK+B,EACEA,EAAQjC,KAAI,SAAUkC,GAC3B,OAAOA,EAAMnF,QAAQ,KAAM,IAAIA,QAAQ,KAAM,IAAI+E,MACnD,IAAGK,QAAO,SAAUC,GAClB,OAAQR,EAAUQ,EACpB,IALqB,EAMvB,C","file":"js/51-010e4b2029e9e48b7607.chunk.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('button',{class:_vm.buttonClassName,style:(_vm.buttonStyles),attrs:{\"disabled\":_vm.disabled},on:{\"click\":_vm.onClick}},[_vm._t(\"default\")],2)}\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!./Button.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!./Button.vue?vue&type=script&lang=js&\"","\n\n","import { render, staticRenderFns } from \"./Button.vue?vue&type=template&id=05075a0e&\"\nimport script from \"./Button.vue?vue&type=script&lang=js&\"\nexport * from \"./Button.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","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"flex flex-1 flex-col justify-end\"},[_c('div',{staticClass:\"flex flex-1 overflow-auto\"}),_vm._v(\" \"),_c('team-availability',{attrs:{\"available-agents\":_vm.availableAgents,\"has-conversation\":!!_vm.conversationSize},on:{\"start-conversation\":_vm.startConversation}})],1)}\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!./GroupedAvatars.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!./GroupedAvatars.vue?vue&type=script&lang=js&\"","\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!./AvailableAgents.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!./AvailableAgents.vue?vue&type=script&lang=js&\"","\n\n\n","import { render, staticRenderFns } from \"./GroupedAvatars.vue?vue&type=template&id=1f2b141a&\"\nimport script from \"./GroupedAvatars.vue?vue&type=script&lang=js&\"\nexport * from \"./GroupedAvatars.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","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"flex\"},_vm._l((_vm.users),function(user,index){return _c('span',{key:user.id,class:((index ? '-ml-4' : '') + \" inline-block rounded-full text-white shadow-solid\")},[_c('thumbnail',{attrs:{\"size\":\"40px\",\"username\":user.name,\"src\":user.avatar,\"has-border\":\"\"}})],1)}),0)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { render, staticRenderFns } from \"./AvailableAgents.vue?vue&type=template&id=9765f988&\"\nimport script from \"./AvailableAgents.vue?vue&type=script&lang=js&\"\nexport * from \"./AvailableAgents.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","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('grouped-avatars',{attrs:{\"users\":_vm.users}})}\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!./TeamAvailability.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!./TeamAvailability.vue?vue&type=script&lang=js&\"","\n\n\n","import { render, staticRenderFns } from \"./TeamAvailability.vue?vue&type=template&id=5b86a948&\"\nimport script from \"./TeamAvailability.vue?vue&type=script&lang=js&\"\nexport * from \"./TeamAvailability.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","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"px-5\"},[_c('div',{staticClass:\"flex items-center justify-between mb-4\"},[_c('div',{staticClass:\"max-w-xs\",class:_vm.$dm('text-black-700', 'dark:text-slate-50')},[_c('div',{staticClass:\"text-base leading-5 font-medium mb-1\"},[_vm._v(\"\\n \"+_vm._s(_vm.isOnline\n ? _vm.$t('TEAM_AVAILABILITY.ONLINE')\n : _vm.$t('TEAM_AVAILABILITY.OFFLINE'))+\"\\n \")]),_vm._v(\" \"),_c('div',{staticClass:\"text-xs leading-3 mt-1\"},[_vm._v(\"\\n \"+_vm._s(_vm.replyWaitMessage)+\"\\n \")])]),_vm._v(\" \"),(_vm.isOnline)?_c('available-agents',{attrs:{\"agents\":_vm.availableAgents}}):_vm._e()],1),_vm._v(\" \"),_c('custom-button',{staticClass:\"font-medium\",attrs:{\"block\":\"\",\"bg-color\":_vm.widgetColor,\"text-color\":_vm.textColor},on:{\"click\":_vm.startConversation}},[_vm._v(\"\\n \"+_vm._s(_vm.hasConversation ? _vm.$t('CONTINUE_CONVERSATION') : _vm.$t('START_CONVERSATION'))+\"\\n \")])],1)}\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!./Home.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!./Home.vue?vue&type=script&lang=js&\"","\n\n\n","import { render, staticRenderFns } from \"./Home.vue?vue&type=template&id=f2e40a68&\"\nimport script from \"./Home.vue?vue&type=script&lang=js&\"\nexport * from \"./Home.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 isToday from 'date-fns/isToday';\nimport isYesterday from 'date-fns/isYesterday';\n\n// Returns a function, that, as long as it continues to be invoked, will not\n// be triggered. The function will be called after it stops being called for\n// N milliseconds. If `immediate` is passed, trigger the function on the\n// leading edge, instead of the trailing.\n\n/**\r\n * @func Callback function to be called after delay\r\n * @delay Delay for debounce in ms\r\n * @immediate should execute immediately\r\n * @returns debounced callback function\r\n */\nvar debounce = function debounce(func, wait, immediate) {\n var timeout;\n return function () {\n var context = null;\n var args = arguments;\n var later = function later() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = window.setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n};\n\n/**\r\n * @name Get contrasting text color\r\n * @description Get contrasting text color from a text color\r\n * @param bgColor Background color of text.\r\n * @returns contrasting text color\r\n */\n\nvar getContrastingTextColor = function getContrastingTextColor(bgColor) {\n var color = bgColor.replace('#', '');\n var r = parseInt(color.slice(0, 2), 16);\n var g = parseInt(color.slice(2, 4), 16);\n var b = parseInt(color.slice(4, 6), 16); // http://stackoverflow.com/a/3943023/112731\n\n return r * 0.299 + g * 0.587 + b * 0.114 > 186 ? '#000000' : '#FFFFFF';\n};\n/**\r\n * @name Get formatted date\r\n * @description Get date in today, yesterday or any other date format\r\n * @param date date\r\n * @param todayText Today text\r\n * @param yesterdayText Yesterday text\r\n * @returns formatted date\r\n */\n\nvar formatDate = function formatDate(_ref) {\n var date = _ref.date,\n todayText = _ref.todayText,\n yesterdayText = _ref.yesterdayText;\n var dateValue = new Date(date);\n if (isToday(dateValue)) return todayText;\n if (isYesterday(dateValue)) return yesterdayText;\n return date;\n};\n/**\r\n * @name formatTime\r\n * @description Format time to Hour, Minute and Second\r\n * @param timeInSeconds number\r\n * @returns formatted time\r\n */\n\nvar formatTime = function formatTime(timeInSeconds) {\n var formattedTime = '';\n if (timeInSeconds >= 60 && timeInSeconds < 3600) {\n var minutes = Math.floor(timeInSeconds / 60);\n formattedTime = minutes + \" Min\";\n var seconds = minutes === 60 ? 0 : Math.floor(timeInSeconds % 60);\n return formattedTime + (\"\" + (seconds > 0 ? ' ' + seconds + ' Sec' : ''));\n }\n if (timeInSeconds >= 3600 && timeInSeconds < 86400) {\n var hours = Math.floor(timeInSeconds / 3600);\n formattedTime = hours + \" Hr\";\n var _minutes = timeInSeconds % 3600 < 60 || hours === 24 ? 0 : Math.floor(timeInSeconds % 3600 / 60);\n return formattedTime + (\"\" + (_minutes > 0 ? ' ' + _minutes + ' Min' : ''));\n }\n if (timeInSeconds >= 86400) {\n var days = Math.floor(timeInSeconds / 86400);\n formattedTime = days + \" Day\";\n var _hours = timeInSeconds % 86400 < 3600 || days >= 364 ? 0 : Math.floor(timeInSeconds % 86400 / 3600);\n return formattedTime + (\"\" + (_hours > 0 ? ' ' + _hours + ' Hr' : ''));\n }\n return Math.floor(timeInSeconds) + \" Sec\";\n};\n/**\r\n * @name trimContent\r\n * @description Trim a string to max length\r\n * @param content String to trim\r\n * @param maxLength Length of the string to trim, default 1024\r\n * @param ellipsis Boolean to add dots at the end of the string, default false\r\n * @returns trimmed string\r\n */\n\nvar trimContent = function trimContent(content, maxLength, ellipsis) {\n if (content === void 0) {\n content = '';\n }\n if (maxLength === void 0) {\n maxLength = 1024;\n }\n if (ellipsis === void 0) {\n ellipsis = false;\n }\n var trimmedContent = content;\n if (content.length > maxLength) {\n trimmedContent = content.substring(0, maxLength);\n }\n if (ellipsis) {\n trimmedContent = trimmedContent + '...';\n }\n return trimmedContent;\n};\n\n/**\r\n * Function that parses a string boolean value and returns the corresponding boolean value\r\n * @param {string | number} candidate - The string boolean value to be parsed\r\n * @return {boolean} - The parsed boolean value\r\n */\nfunction parseBoolean(candidate) {\n try {\n // lowercase the string, so TRUE becomes true\n var candidateString = String(candidate).toLowerCase(); // wrap in boolean to ensure that the return value\n // is a boolean even if values like 0 or 1 are passed\n\n return Boolean(JSON.parse(candidateString));\n } catch (error) {\n return false;\n }\n}\n\n/**\r\n * Sorts an array of numbers in ascending order.\r\n * @param {number[]} arr - The array of numbers to be sorted.\r\n * @returns {number[]} - The sorted array.\r\n */\nfunction sortAsc(arr) {\n // .slice() is used to create a copy of the array so that the original array is not mutated\n return arr.slice().sort(function (a, b) {\n return a - b;\n });\n}\n/**\r\n * Calculates the quantile value of an array at a specified percentile.\r\n * @param {number[]} arr - The array of numbers to calculate the quantile value from.\r\n * @param {number} q - The percentile to calculate the quantile value for.\r\n * @returns {number} - The quantile value.\r\n */\n\nfunction quantile(arr, q) {\n var sorted = sortAsc(arr); // Sort the array in ascending order\n\n return _quantileForSorted(sorted, q); // Calculate the quantile value\n}\n/**\r\n * Clamps a value between a minimum and maximum range.\r\n * @param {number} min - The minimum range.\r\n * @param {number} max - The maximum range.\r\n * @param {number} value - The value to be clamped.\r\n * @returns {number} - The clamped value.\r\n */\n\nfunction clamp(min, max, value) {\n if (value < min) {\n return min;\n }\n if (value > max) {\n return max;\n }\n return value;\n}\n/**\r\n * This method assumes the the array provided is already sorted in ascending order.\r\n * It's a helper method for the quantile method and should not be exported as is.\r\n *\r\n * @param {number[]} arr - The array of numbers to calculate the quantile value from.\r\n * @param {number} q - The percentile to calculate the quantile value for.\r\n * @returns {number} - The quantile value.\r\n */\n\nfunction _quantileForSorted(sorted, q) {\n var clamped = clamp(0, 1, q); // Clamp the percentile between 0 and 1\n\n var pos = (sorted.length - 1) * clamped; // Calculate the index of the element at the specified percentile\n\n var base = Math.floor(pos); // Find the index of the closest element to the specified percentile\n\n var rest = pos - base; // Calculate the decimal value between the closest elements\n // Interpolate the quantile value between the closest elements\n // Most libraries don't to the interpolation, but I'm just having fun here\n // also see https://en.wikipedia.org/wiki/Quantile#Estimating_quantiles_from_a_sample\n\n if (sorted[base + 1] !== undefined) {\n // in case the position was a integer, the rest will be 0 and the interpolation will be skipped\n return sorted[base] + rest * (sorted[base + 1] - sorted[base]);\n } // Return the closest element if there is no interpolation possible\n\n return sorted[base];\n}\n/**\r\n * Calculates the quantile values for an array of intervals.\r\n * @param {number[]} data - The array of numbers to calculate the quantile values from.\r\n * @param {number[]} intervals - The array of intervals to calculate the quantile values for.\r\n * @returns {number[]} - The array of quantile values for the intervals.\r\n */\n\nvar getQuantileIntervals = function getQuantileIntervals(data, intervals) {\n // Sort the array in ascending order before looping through the intervals.\n // depending on the size of the array and the number of intervals, this can speed up the process by at least twice\n // for a random array of 100 numbers and 5 intervals, the speedup is 3x\n var sorted = sortAsc(data);\n return intervals.map(function (interval) {\n return _quantileForSorted(sorted, interval);\n });\n};\nvar MESSAGE_VARIABLES_REGEX = /{{(.*?)}}/g;\nvar skipCodeBlocks = function skipCodeBlocks(str) {\n return str.replace(/```(?:.|\\n)+?```/g, '');\n};\nvar capitalizeName = function capitalizeName(name) {\n return (name || '').replace(/\\b(\\w)/g, function (s) {\n return s.toUpperCase();\n });\n};\nvar getFirstName = function getFirstName(_ref) {\n var user = _ref.user;\n var firstName = user != null && user.name ? user.name.split(' ').shift() : '';\n return capitalizeName(firstName);\n};\nvar getLastName = function getLastName(_ref2) {\n var user = _ref2.user;\n if (user && user.name) {\n var lastName = user.name.split(' ').length > 1 ? user.name.split(' ').pop() : '';\n return capitalizeName(lastName);\n }\n return '';\n};\nvar getMessageVariables = function getMessageVariables(_ref3) {\n var _assignee$email;\n var conversation = _ref3.conversation;\n var _conversation$meta = conversation.meta,\n assignee = _conversation$meta.assignee,\n sender = _conversation$meta.sender,\n id = conversation.id;\n return {\n 'contact.name': capitalizeName((sender == null ? void 0 : sender.name) || ''),\n 'contact.first_name': getFirstName({\n user: sender\n }),\n 'contact.last_name': getLastName({\n user: sender\n }),\n 'contact.email': sender == null ? void 0 : sender.email,\n 'contact.phone': sender == null ? void 0 : sender.phone_number,\n 'contact.id': sender == null ? void 0 : sender.id,\n 'conversation.id': id,\n 'agent.name': capitalizeName((assignee == null ? void 0 : assignee.name) || ''),\n 'agent.first_name': getFirstName({\n user: assignee\n }),\n 'agent.last_name': getLastName({\n user: assignee\n }),\n 'agent.email': (_assignee$email = assignee == null ? void 0 : assignee.email) != null ? _assignee$email : ''\n };\n};\nvar replaceVariablesInMessage = function replaceVariablesInMessage(_ref4) {\n var message = _ref4.message,\n variables = _ref4.variables;\n // @ts-ignore\n return message.replace(MESSAGE_VARIABLES_REGEX, function (_, replace) {\n return variables[replace.trim()] ? variables[replace.trim().toLowerCase()] : '';\n });\n};\nvar getUndefinedVariablesInMessage = function getUndefinedVariablesInMessage(_ref5) {\n var message = _ref5.message,\n variables = _ref5.variables;\n var messageWithOutCodeBlocks = skipCodeBlocks(message);\n var matches = messageWithOutCodeBlocks.match(MESSAGE_VARIABLES_REGEX);\n if (!matches) return [];\n return matches.map(function (match) {\n return match.replace('{{', '').replace('}}', '').trim();\n }).filter(function (variable) {\n return !variables[variable];\n });\n};\nexport { clamp, debounce, formatDate, formatTime, getContrastingTextColor, getMessageVariables, getQuantileIntervals, getUndefinedVariablesInMessage, parseBoolean, quantile, replaceVariablesInMessage, sortAsc, trimContent };"],"sourceRoot":""}