\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!./ArticleList.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!./ArticleList.vue?vue&type=script&lang=js&\"","\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!./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&\"","import { render, staticRenderFns } from \"./Home.vue?vue&type=template&id=31426bcf&\"\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'; // 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 */\n\nvar debounce = function debounce(func, wait, immediate) {\n var timeout;\n return function () {\n var context = null;\n var args = arguments;\n\n var later = function later() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\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/**\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\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\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\n\nvar formatTime = function formatTime(timeInSeconds) {\n var formattedTime = '';\n\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\n if (timeInSeconds >= 3600 && timeInSeconds < 86400) {\n var hours = Math.floor(timeInSeconds / 3600);\n formattedTime = hours + \" Hr\";\n\n var _minutes = timeInSeconds % 3600 < 60 || hours === 24 ? 0 : Math.floor(timeInSeconds % 3600 / 60);\n\n return formattedTime + (\"\" + (_minutes > 0 ? ' ' + _minutes + ' Min' : ''));\n }\n\n if (timeInSeconds >= 86400) {\n var days = Math.floor(timeInSeconds / 86400);\n formattedTime = days + \" Day\";\n\n var _hours = timeInSeconds % 86400 < 3600 || days >= 364 ? 0 : Math.floor(timeInSeconds % 86400 / 3600);\n\n return formattedTime + (\"\" + (_hours > 0 ? ' ' + _hours + ' Hr' : ''));\n }\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\n\nvar trimContent = function trimContent(content, maxLength, ellipsis) {\n if (content === void 0) {\n content = '';\n }\n\n if (maxLength === void 0) {\n maxLength = 1024;\n }\n\n if (ellipsis === void 0) {\n ellipsis = false;\n }\n\n var trimmedContent = content;\n\n if (content.length > maxLength) {\n trimmedContent = content.substring(0, maxLength);\n }\n\n if (ellipsis) {\n trimmedContent = trimmedContent + '...';\n }\n\n return trimmedContent;\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 */\n\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/**\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 */\n\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\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\n\nfunction clamp(min, max, value) {\n if (value < min) {\n return min;\n }\n\n if (value > max) {\n return max;\n }\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\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\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\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};\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nvar MESSAGE_VARIABLES_REGEX = /{{(.*?)}}/g;\n\nvar skipCodeBlocks = function skipCodeBlocks(str) {\n return str.replace(/```(?:.|\\n)+?```/g, '');\n};\n\nvar capitalizeName = function capitalizeName(name) {\n return (name || '').replace(/\\b(\\w)/g, function (s) {\n return s.toUpperCase();\n });\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};\n\nvar getLastName = function getLastName(_ref2) {\n var user = _ref2.user;\n\n if (user && user.name) {\n var lastName = user.name.split(' ').length > 1 ? user.name.split(' ').pop() : '';\n return capitalizeName(lastName);\n }\n\n return '';\n};\n\nvar getMessageVariables = function getMessageVariables(_ref3) {\n var _assignee$email;\n\n var conversation = _ref3.conversation,\n contact = _ref3.contact;\n var _conversation$meta = conversation.meta,\n assignee = _conversation$meta.assignee,\n sender = _conversation$meta.sender,\n id = conversation.id,\n _conversation$custom_ = conversation.custom_attributes,\n conversationCustomAttributes = _conversation$custom_ === void 0 ? {} : _conversation$custom_;\n\n var _ref4 = contact || {},\n contactCustomAttributes = _ref4.custom_attributes;\n\n var standardVariables = {\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 var conversationCustomAttributeVariables = Object.entries(conversationCustomAttributes).reduce(function (acc, _ref5) {\n var key = _ref5[0],\n value = _ref5[1];\n acc[\"conversation.custom_attribute.\" + key] = value;\n return acc;\n }, {});\n var contactCustomAttributeVariables = Object.entries(contactCustomAttributes).reduce(function (acc, _ref6) {\n var key = _ref6[0],\n value = _ref6[1];\n acc[\"contact.custom_attribute.\" + key] = value;\n return acc;\n }, {});\n\n var variables = _extends({}, standardVariables, conversationCustomAttributeVariables, contactCustomAttributeVariables);\n\n return variables;\n};\n\nvar replaceVariablesInMessage = function replaceVariablesInMessage(_ref7) {\n var message = _ref7.message,\n variables = _ref7.variables; // @ts-ignore\n\n return message.replace(MESSAGE_VARIABLES_REGEX, function (_, replace) {\n return variables[replace.trim()] ? variables[replace.trim().toLowerCase()] : '';\n });\n};\n\nvar getUndefinedVariablesInMessage = function getUndefinedVariablesInMessage(_ref8) {\n var message = _ref8.message,\n variables = _ref8.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] === undefined;\n });\n};\n/**\r\n * Creates a typing indicator utility.\r\n * @param onStartTyping Callback function to be called when typing starts\r\n * @param onStopTyping Callback function to be called when typing stops after delay\r\n * @param idleTime Delay for idle time in ms before considering typing stopped\r\n * @returns An object with start and stop methods for typing indicator\r\n */\n\n\nvar createTypingIndicator = function createTypingIndicator(onStartTyping, onStopTyping, idleTime) {\n var timer = null;\n\n var start = function start() {\n if (!timer) {\n onStartTyping();\n }\n\n reset();\n };\n\n var stop = function stop() {\n if (timer) {\n clearTimeout(timer);\n timer = null;\n onStopTyping();\n }\n };\n\n var reset = function reset() {\n if (timer) {\n clearTimeout(timer);\n }\n\n timer = setTimeout(function () {\n stop();\n }, idleTime);\n };\n\n return {\n start: start,\n stop: stop\n };\n};\n\nexport { clamp, createTypingIndicator, debounce, formatDate, formatTime, getContrastingTextColor, getMessageVariables, getQuantileIntervals, getUndefinedVariablesInMessage, parseBoolean, quantile, replaceVariablesInMessage, sortAsc, trimContent };","'use strict';\nvar $ = require('../internals/export');\nvar $trim = require('../internals/string-trim').trim;\nvar forcedStringTrimMethod = require('../internals/string-trim-forced');\n\n// `String.prototype.trim` method\n// https://tc39.es/ecma262/#sec-string.prototype.trim\n$({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {\n trim: function trim() {\n return $trim(this);\n }\n});\n","var fails = require('../internals/fails');\nvar whitespaces = require('../internals/whitespaces');\n\nvar non = '\\u200B\\u0085\\u180E';\n\n// check that a method works with the correct list\n// of whitespaces and has a correct name\nmodule.exports = function (METHOD_NAME) {\n return fails(function () {\n return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME;\n });\n};\n","var requireObjectCoercible = require('../internals/require-object-coercible');\n\nvar quot = /\"/g;\n\n// B.2.3.2.1 CreateHTML(string, tag, attribute, value)\n// https://tc39.es/ecma262/#sec-createhtml\nmodule.exports = function (string, tag, attribute, value) {\n var S = String(requireObjectCoercible(string));\n var p1 = '<' + tag;\n if (attribute !== '') p1 += ' ' + attribute + '=\"' + String(value).replace(quot, '"') + '\"';\n return p1 + '>' + S + '' + tag + '>';\n};\n","var fails = require('../internals/fails');\n\n// check the existence of a method, lowercase\n// of a tag and escaping quotes in arguments\nmodule.exports = function (METHOD_NAME) {\n return fails(function () {\n var test = ''[METHOD_NAME]('\"');\n return test !== test.toLowerCase() || test.split('\"').length > 3;\n });\n};\n"],"sourceRoot":""}