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,IACbtC,KAAO,2BAGO,GAAVsC,SACJtC,KAAO,6BAGHsC,OAAS,IACbtC,KAAO,0BAEPA,KAAO,8CACmE,OAAxED,IAAOwB,SAASiB,2BAA2BC,UAAW,YAAyB,GAAK1C,KACtF,4FAC0E,OAAxEA,IAAOwB,SAASiB,2BAA2BC,UAAW,YAAyB,GAAK1C,KACtF,4FAC0E,OAAxEA,IAAOwB,SAASiB,2BAA2BC,UAAW,YAAyB,GAAK1C,KACtF,aAGA,OAAOC,GACP","sources":["webpack://apexchatwidgets/./widgets/templates/poke_messages/dom_poke_overlay_template.ejs","webpack://apexchatwidgets/./widgets/core/hooks/getUniqeValueArray.js","webpack://apexchatwidgets/./widgets/core/hooks/StringUtils.js","webpack://apexchatwidgets/./widgets/questiontypes/ImportFactories/ImportMessageTemplateFactory.js","webpack://apexchatwidgets/./widgets/templates/poke_messages/ep_poke_overlay_template.ejs","webpack://apexchatwidgets/./widgets/templates/dialog/RDPlusTheme/disclaimer_confirm_template.ejs","webpack://apexchatwidgets/./widgets/templates/dialog/RDTheme/restart_chat_template.ejs","webpack://apexchatwidgets/./widgets/questiontypes/ImportFactories/ImportDesclaimerOverlaySheetTemplateFactory.js","webpack://apexchatwidgets/./widgets/templates/dialog/RDPlusTheme/message_template.ejs","webpack://apexchatwidgets/./widgets/core/hooks/parseCompanyHours.js","webpack://apexchatwidgets/./widgets/templates/poke_messages/dom_poke_message_template.ejs","webpack://apexchatwidgets/./widgets/core/hooks/isMessageCompanyHours.js","webpack://apexchatwidgets/./widgets/templates/dialog_overlays/noAgentOverlay.ejs","webpack://apexchatwidgets/./widgets/templates/office_hours_messages/Rd_Dom/message_template.ejs","webpack://apexchatwidgets/./widgets/core/hooks/fixedElementToTop.js","webpack://apexchatwidgets/./widgets/pokeMessage/PokeMessagesUIController.js","webpack://apexchatwidgets/./widgets/templates/dialog/RDPlusTheme/restart_chat_template.ejs","webpack://apexchatwidgets/./widgets/templates/dialog/RDPlusTheme/disclaimer_template.ejs","webpack://apexchatwidgets/./widgets/pokeMessage/PokeMessageView.js","webpack://apexchatwidgets/./widgets/core/hooks/createArraySessionStorage.js","webpack://apexchatwidgets/./widgets/templates/dialog_overlays/RDTheme/VAChatRestartOverlay.ejs","webpack://apexchatwidgets/./widgets/templates/poke_messages/ep_poke_message_template.ejs","webpack://apexchatwidgets/./widgets/templates/dialog_overlays/VideoGreetOverlay.ejs","webpack://apexchatwidgets/./widgets/questiontypes/ImportFactories/ImportOptinOverlaySheetTemplateFactory.js","webpack://apexchatwidgets/./widgets/core/hooks/scrollIntoView.js","webpack://apexchatwidgets/./widgets/core/hooks/ParticipantsChanged.js","webpack://apexchatwidgets/./widgets/core/imports/ImportEPTemplateFactory.js","webpack://apexchatwidgets/./widgets/templates/office_hours_messages/Rd_EP/message_template.ejs","webpack://apexchatwidgets/./widgets/core/hooks/EmojiUtils.js","webpack://apexchatwidgets/./widgets/templates/dialog_overlays/RDPlusTheme/VAChatRestartOverlay.ejs","webpack://apexchatwidgets/./widgets/core/hooks/languageTransferRequest.js","webpack://apexchatwidgets/./widgets/pokeMessage/PokeMessageModel.js","webpack://apexchatwidgets/./widgets/templates/dialog/RDTheme/disclaimer_template.ejs","webpack://apexchatwidgets/./widgets/core/hooks/shiftUps.js","webpack://apexchatwidgets/./widgets/templates/dialog/RDPlusTheme/optin_consent_template.ejs","webpack://apexchatwidgets/./widgets/core/hooks/debounce.js","webpack://apexchatwidgets/./widgets/core/ChatUIController.js","webpack://apexchatwidgets/./widgets/questiontypes/QuestionTypeVersion.js","webpack://apexchatwidgets/./widgets/questiontypes/ImportFactories/ImportEndChatOverlaySheetTemplateFactory.js","webpack://apexchatwidgets/./widgets/core/hooks/ApexChatTitle.js","webpack://apexchatwidgets/./widgets/templates/exit_popup/RDTheme/exitpopup_template.ejs","webpack://apexchatwidgets/./widgets/templates/exit_popup/RDPlusTheme/message_template.ejs","webpack://apexchatwidgets/./widgets/core/hooks/resizeChatInput.js","webpack://apexchatwidgets/./widgets/templates/exit_popup/RDPlusTheme/exitpopup_template.ejs","webpack://apexchatwidgets/./widgets/core/hooks/ApplyMessageSequenceCssClasses.js","webpack://apexchatwidgets/./widgets/templates/dialog/RDTheme/optin_consent_template.ejs","webpack://apexchatwidgets/./widgets/core/chathandlers/ChatCookieHandler.js","webpack://apexchatwidgets/./widgets/templates/dialog/RDTheme/disclaimer_confirm_template.ejs","webpack://apexchatwidgets/./widgets/questiontypes/ImportFactories/ImportRestartChatOverlayFactory.js","webpack://apexchatwidgets/./widgets/core/hooks/elementObserver.js","webpack://apexchatwidgets/./widgets/core/hooks/toggleSendButton.js","webpack://apexchatwidgets/./To_ascii.js","webpack://apexchatwidgets/./widgets/templates/exit_popup/RDTheme/message_template.ejs","webpack://apexchatwidgets/./widgets/templates/dialog/RDTheme/message_template.ejs"],"sourcesContent":["module.exports = function(obj) {\nobj || (obj = {});\nvar __t, __p = '';\nwith (obj) {\n__p += '
\\r\\n
\\r\\n \\r\\n
\\r\\n
' +\n((__t = (userResponseText)) == null ? '' : __t) +\n'
\\r\\n
\\r\\n';\n\n}\nreturn __p\n}","/**\r\n * Returns a new array with unique values from the given array, based on the specified key.\r\n * If no key is provided, unique items themselves are returned. Supports nested keys.\r\n *\r\n * @param {Array} arr - The array from which to extract unique values.\r\n * @param {string} [key=null] - The key to use for uniqueness, supports dot notation for nested keys.\r\n * @returns {Array} A new array containing only unique values based on the specified key.\r\n */\r\n\r\nconst getUniqueValueArray = (arr, key = null) => {\r\n const getValue = (item, key) => {\r\n if (!key) return item; // If key is not provided, return the item itself\r\n return key.split('.').reduce((obj, k) => obj?.[k], item); // Support for nested keys\r\n };\r\n\r\n return arr.reduce((acc, item) => {\r\n const value = getValue(item, key);\r\n if (!acc.some(existingItem => getValue(existingItem, key) === value)) {\r\n acc.push(item);\r\n }\r\n return acc;\r\n }, []);\r\n};\r\n\r\nexport default getUniqueValueArray;","/*\r\n * a custom api containing string related utility functions\r\n */\r\nconst StringUtils = {\r\n isNull(str) {\r\n return !str;\r\n },\r\n isNullOrWhiteSpace(str) {\r\n return str === null || str == undefined || str.match(/^ *$/) !== null;\r\n }\r\n};\r\nexport default StringUtils;\r\n","import rdDomMessageTemplate from '../../templates/dialog/RDTheme/message_template.ejs'\r\nimport rdPlusDomMessageTemplate from '../../templates/dialog/RDPlusTheme/message_template.ejs'\r\n\r\nconst createMessageTemplateFactory = (message) => {\r\n let domMessageTemplate;\r\n if (ApexChat.IsRoundedDynamicPlusTheme) {\r\n domMessageTemplate = rdPlusDomMessageTemplate(message);\r\n } else {\r\n domMessageTemplate = rdDomMessageTemplate(message);\r\n }\r\n\r\n return {\r\n domMessageTemplate,\r\n };\r\n};\r\nexport default createMessageTemplateFactory;\r\n","module.exports = function(obj) {\nobj || (obj = {});\nvar __t, __p = '';\nwith (obj) {\n__p += '
\\r\\n
\\r\\n \\r\\n
\\r\\n
' +\n((__t = (userResponseText)) == null ? '' : __t) +\n'
\\r\\n
\\r\\n';\n\n}\nreturn __p\n}","module.exports = function(obj) {\nobj || (obj = {});\nvar __t, __p = '';\nwith (obj) {\n__p += '
\\r\\n
\\r\\n

Are you sure?

\\r\\n
\\r\\n

\\r\\n ' +\n((__t = (decliningBoxText )) == null ? '' : __t) +\n'\\r\\n

\\r\\n\\r\\n \\r\\n
';\n\n}\nreturn __p\n}","module.exports = function(obj) {\nobj || (obj = {});\nvar __t, __p = '';\nwith (obj) {\n__p += '
\\r\\n
\\r\\n The previous chat session has ended\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
';\n\n}\nreturn __p\n}","import desclaimerTemplate from '../../templates/dialog/RDTheme/disclaimer_template.ejs'\r\nimport desclaimerConfirmTemplate from '../../templates/dialog/RDTheme/disclaimer_confirm_template.ejs'\r\n\r\nimport desclaimerRDPlusThemeTemplate from '../../templates/dialog/RDPlusTheme/disclaimer_template.ejs'\r\nimport desclaimerConfirmRDPlusThemeTemplate from '../../templates/dialog/RDPlusTheme/disclaimer_confirm_template.ejs'\r\n\r\nconst importDesclaimerOverlaySheetTemplateFactory = (options = {}) => {\r\n if (ApexChat.IsRoundedDynamicPlusTheme) {\r\n return {\r\n desclaimerTemplate: desclaimerRDPlusThemeTemplate(options),\r\n desclaimerConfirmTemplate: desclaimerConfirmRDPlusThemeTemplate(options),\r\n }\r\n }\r\n return {\r\n desclaimerTemplate: desclaimerTemplate(options),\r\n desclaimerConfirmTemplate: desclaimerConfirmTemplate(options),\r\n }\r\n};\r\nexport default importDesclaimerOverlaySheetTemplateFactory;\r\n","module.exports = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n__p += ' 0){ ;\n__p += ' apexchat_agent apexchat_rd_received';\n};\n__p += ' ';\n if(userId === -3){ ;\n__p += ' apexchat_rd_received';\n};\n__p += ' \">\\r\\n
\\r\\n ';\n if (userId !==0 && handlerImageUrl) { ;\n__p += '\\r\\n
\\r\\n \"Live\\r\\n
\\r\\n ';\n } ;\n__p += '\\r\\n
\\r\\n ' +\n((__t = (text )) == null ? '' : __t) +\n'\\r\\n
\\r\\n
\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n 0){ ;\n__p += ' apexchat_element_hide';\n};\n__p += '\"> -->\\r\\n \\r\\n ' +\n((__t = (ApexChat.getCurrentFormatedDateTime(createdOn, 'hh:mmtt' ) )) == null ? '' : __t) +\n'\\r\\n\\r\\n';\n\n}\nreturn __p\n}","import logIt from \"../../../logIt\";\r\nimport GlobalVariables from \"../GlobalVariables\";\r\n\r\n/**\r\n * Parses company CallConnect/Office hours raw text and converts into valid html as per design\r\n * @param {any} msgText\r\n */\r\nconst parseCompanyHours = function (msgText, matches, isRdTheme) {\r\n let messageTemplate = matches.prefix ? matches.prefix : ''; // to return\r\n\r\n\r\n\r\n // mock\r\n // msgText = 'Sunday: Closed, Monday: 9:00 AM-06:00 PM, Tuesday: 9:00 AM-06:00 PM, Wednesday: 9:00 AM-06:00 PM, Thursday: 9:00 AM-06:00 PM, Friday: 9:00 AM-05:00 PM, Saturday: Closed';\r\n const model = [\r\n // { order:5, day: 'Saturday', timeFrom: '9:00 AM', timeTo: '11:00 PM' }\r\n ];\r\n const days = {\r\n Monday: 0,\r\n Tuesday: 1,\r\n Wednesday: 2,\r\n Thursday: 3,\r\n Friday: 4,\r\n Saturday: 5,\r\n Sunday: 6\r\n };\r\n // 1- start preparing days model data\r\n const arr = matches.officeHrs;\r\n arr.forEach((item, index) => {\r\n var item = item.replace(/,\\s*$/, ''); // replace last coma or space if found\r\n logIt(`OH::${item}`);\r\n // grab one day & time and split its parts\r\n const firstIndexOfColon = item.indexOf(':');\r\n const day = item.substring(0, firstIndexOfColon).trim();\r\n const timing = item.substring(firstIndexOfColon + 1).trim();\r\n const fromTo = timing.split('-');\r\n const fromTime = (fromTo && fromTo.length > 0 ? fromTo[0] : '').trim();\r\n const toTime = (fromTo && fromTo.length > 1 ? fromTo[1] : '').trim();\r\n // apply regex to validate day and time parts\r\n let validDay;\r\n let validFromTime;\r\n let validToTime;\r\n try {\r\n validDay = day.match(GlobalVariables.regexWeekDay) ? day : '';\r\n validFromTime = fromTime.match(GlobalVariables.regexTime) ? fromTime : '';\r\n validToTime = toTime.match(GlobalVariables.regexTime) ? toTime : '';\r\n } catch (e) {\r\n logIt(`OH::error parsing company hours:${e.message}`);\r\n }\r\n if (validDay !== '') {\r\n // if a day is either missing or invalid, we should miss it in the schedule display\r\n const order = days[validDay]; // extract the day index\r\n\r\n // one model created, store it\r\n model.push({\r\n order,\r\n day: validDay,\r\n timeFrom: validFromTime,\r\n timeTo: validToTime\r\n });\r\n }\r\n });\r\n if (model.length == 0) {\r\n return messageTemplate;\r\n }\r\n // sort by day index if found out of order\r\n model.sort((a, b) => a.order - b.order);\r\n // 2- now create html for the complately formatted message\r\n // if not RD, simply list office hours w/o any formatting\r\n if (!isRdTheme) {\r\n // messageTemplate += '';\r\n } else {\r\n // for RD, we have a design to incorporate\r\n messageTemplate += ' ';\r\n }\r\n return messageTemplate;\r\n};\r\nexport default parseCompanyHours;\r\n","module.exports = function(obj) {\nobj || (obj = {});\nvar __t, __p = '';\nwith (obj) {\n__p += '
\\r\\n
' +\n((__t = (msgTimeStamp)) == null ? '' : __t) +\n'
\\r\\n
' +\n((__t = (text)) == null ? '' : __t) +\n'
\\r\\n
\\r\\n';\n\n}\nreturn __p\n}","import StringUtils from './StringUtils';\r\nimport GlobalVariables from '../GlobalVariables';\r\nimport logIt from '../../../logIt';\r\n\r\n/**\r\n * a validator for detecting an agent message containing company CallConnect/Office hours of the format:\r\n * Sunday: Closed, Monday: 9:00 AM-06:00 PM, Tuesday: 9:00 AM-06:00 PM, Wednesday: 9:00 AM-06:00 PM, Thursday: 9:00 AM-06:00 PM, Friday: 9:00 AM-05:00 PM, Saturday: Closed\r\n * @param {any} msgText\r\n */\r\nconst isMessageCompanyHours = (msgText) => {\r\n /**\r\n * Test message:\r\n 'we are open Monday: 9:00 AM-06:00 PM, Tuesday: 9:00 AM-06:00 PM, Wednesday: 9:00 AM-06:00 PM, Thursday: 9:00 AM-06:00 PM, Friday: 9:00 AM-05:00 PM, Saturday: Closed, Sunday: Closed'.match(/^((\\w*?)\\s+)*|(Mon|Tues|Wed(nes)?|Thur(s)?|Fri|Sat(ur)?|Sun)(day)?:\\s+(((1[0-2]|0?[1-9]):([0-5][0-9])\\s?([AaPp][Mm])\\s?-\\s?(1[0-2]|0?[1-9]):([0-5][0-9])\\s?([AaPp][Mm]))|Closed\\,*\\s*)|$/g);\r\n \r\n * */\r\n const regexOfficeHoursWithPrefix =\r\n /^(.*?\\s*)|((Mon|Tues|Wed(nes)?|Thur(s)?|Fri|Sat(ur)?|Sun)(day)?:\\s+((((1[0-2]|0?[1-9]):([0-5][0-9])\\s?([AaPp][Mm])\\s?-\\s?(1[0-2]|0?[1-9]):([0-5][0-9])\\s?([AaPp][Mm]))|Closed*),*\\s*))|$/g;\r\n const result = { result: false, prefix: '', officeHrs: [] };\r\n let officeHours_matches = ` ${msgText}`.match(regexOfficeHoursWithPrefix); // https://regexr.com/5d0h4, https://regexr.com/5dv5f\r\n try {\r\n if (officeHours_matches && officeHours_matches.length > 0) {\r\n officeHours_matches = officeHours_matches.filter(\r\n (item) => !StringUtils.isNullOrWhiteSpace(item)\r\n );\r\n // match 1st token; if matched, extract prefix phrase if any\r\n const matched =\r\n officeHours_matches[0] &&\r\n officeHours_matches[0].match(GlobalVariables.regexOfficeHours);\r\n if (matched) {\r\n result.prefix = msgText.substring(0, msgText.indexOf(officeHours_matches[0])); // prefix phrase\r\n result.officeHrs = officeHours_matches; // all matches are office hours\r\n }\r\n result.result = officeHours_matches.length > 6; // we assume there should be at least 7 office hours\r\n }\r\n } catch (er) {\r\n logIt(`OH::Error extracting office hours:${er.message}`);\r\n }\r\n return result;\r\n};\r\nexport default isMessageCompanyHours;\r\n","module.exports = function(obj) {\nobj || (obj = {});\nvar __t, __p = '';\nwith (obj) {\n__p += '
\\r\\n\t
\\r\\n\t\t
\\r\\n\t\t\t\\r\\n\t\t\t\t\\r\\n\t\t\t\\r\\n\t\t
\\r\\n\t\t

Live Chat Offline

\\r\\n\t\t

No Live person available at the moment. Please try again later.

\\r\\n\t\t
\\r\\n\t\t\t\\r\\n\t\t
\\r\\n\t
\\r\\n\t
\\r\\n
';\n\n}\nreturn __p\n}","module.exports = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n__p += ' 0){ ;\n__p += ' apexchat_agent apexchat_rd_received';\n};\n__p += ' ';\n if(userId === -3){ ;\n__p += ' apexchat_rd_received';\n};\n__p += ' \">\\r\\n
\\r\\n
\\r\\n ' +\n((__t = (html )) == null ? '' : __t) +\n'\\r\\n
\\r\\n
\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n 0){ ;\n__p += ' apexchat_element_hide';\n};\n__p += '\"> -->\\r\\n \\r\\n ' +\n((__t = (ApexChat.getCurrentFormatedDateTime(createdOn, 'hh:mmtt' ) )) == null ? '' : __t) +\n'\\r\\n\\r\\n';\n\n}\nreturn __p\n}","const fixedElementToTop = (container, element) => {\r\n // Get the container and element nodes\r\n const containerNode = container[0];\r\n const elementNode = element[0];\r\n\r\n if (!containerNode || !elementNode) {\r\n return;\r\n }\r\n\r\n // Get the initial offset of the element relative to the container\r\n const initialOffset = elementNode.offsetTop - containerNode.offsetTop;\r\n\r\n // Function to handle scroll events on the container\r\n function handleScroll() {\r\n // Get the scroll position inside the container\r\n const scrollPosition = containerNode.scrollTop;\r\n\r\n // Calculate the new position for the element\r\n const newPosition = scrollPosition - initialOffset;\r\n\r\n // Fix the element on top when scrolling down\r\n if (newPosition > 0) {\r\n elementNode.style.position = 'sticky';\r\n elementNode.style.top = '0';\r\n elementNode.classList.add('apexchat-stick-to-top');\r\n } else {\r\n // Release the sticky position when scrolling up\r\n elementNode.style.position = 'relative';\r\n elementNode.style.top = 'auto';\r\n elementNode.classList.remove('apexchat-stick-to-top');\r\n }\r\n }\r\n\r\n // Add scroll event listener to the container\r\n containerNode.addEventListener('scroll', handleScroll);\r\n\r\n // Cleanup: Remove event listener when no longer needed\r\n return function cleanup() {\r\n containerNode.removeEventListener('scroll', handleScroll);\r\n };\r\n};\r\nexport default fixedElementToTop;\r\n","/**\r\n * We split a single widget called WidgetTypes.PockMessagesOverLay\r\n * into 3 small classes according to their Roles: Model, View Controller\r\n *\r\n * */\r\nimport TempCache from '../core/enums/TempCache';\r\nimport BaseClass from '../core/BaseClass';\r\nimport WidgetTypes from '../core/enums/WidgetTypes';\r\nimport getStorageAPIValue from '../core/hooks/getStorageAPIValue';\r\nimport storageAPIExists from '../core/hooks/storageAPIExists';\r\nimport logIt from '../../logIt';\r\n\r\nexport default class PokeMessagesUIController extends BaseClass {\r\n constructor(options) {\r\n super(options);\r\n const me = this;\r\n me.widget = WidgetTypes.PokeMessagesOverLay;\r\n me.model = options.model;\r\n me.view = options.view;\r\n me.view.setModel(me.model);\r\n logIt('PokeMessagesUIController init');\r\n }\r\n\r\n show() {\r\n const me = this;\r\n me.view.show();\r\n }\r\n\r\n addPokeMessage(pokeMessage) {\r\n const me = this;\r\n logIt('PokeMessage');\r\n logIt(JSON.stringify(pokeMessage));\r\n // extracting the last respond time of visitor via PokeOverLay Button\r\n if (storageAPIExists(TempCache.POKE_MESSAGE_LastJoinBackTime)) {\r\n const lastJoinBackTime = parseInt(\r\n getStorageAPIValue(TempCache.POKE_MESSAGE_LastJoinBackTime)\r\n );\r\n // If the message createdOn time is less than last respond time, we dont need to show previously shown poke messages.\r\n if (pokeMessage.createdOn.getTime() < lastJoinBackTime) {\r\n return;\r\n }\r\n }\r\n // me.model.addPokeMessage(pokeMessage);//adding a PM in an array is not utilized currently; so commenting out for brevity\r\n me.show(); // show overley if not shown already.\r\n me.view.render(pokeMessage);\r\n }\r\n}\r\n","module.exports = function(obj) {\nobj || (obj = {});\nvar __t, __p = '';\nwith (obj) {\n__p += '
\\r\\n \\r\\n \\r\\n
';\n\n}\nreturn __p\n}","module.exports = function(obj) {\nobj || (obj = {});\nvar __t, __p = '';\nwith (obj) {\n__p += '
\\r\\n \\r\\n \\r\\n
';\n\n}\nreturn __p\n}","import TempCache from '../core/enums/TempCache';\r\nimport BaseClass from '../core/BaseClass';\r\nimport WidgetTypes from '../core/enums/WidgetTypes';\r\nimport SimpleView from '../core/SimpleView';\r\nimport Utils from '../core/Utils';\r\nimport WidgetStates from '../core/hooks/WidgetStates';\r\nimport addClass from '../core/hooks/addClass';\r\nimport createArraySessionStorage from '../core/hooks/createArraySessionStorage';\r\nimport logIt from '../../logIt';\r\n\r\nexport default class PokeMessageView extends BaseClass {\r\n constructor(options) {\r\n super(options);\r\n const me = this;\r\n me.widget = WidgetTypes.PokeMessagesOverLay;\r\n me.context = options.context;\r\n me.identifier = options.identifier;\r\n me.overLayTargetElementSelector = options.overLayTargetElementSelector;\r\n me.overLayTemplate = options.overLayTemplate;\r\n me.messageContainer = options.messageContainer;\r\n me.messageTargetElementSelector = options.messageTargetElementSelector;\r\n me.messageTemplate = options.messageTemplate;\r\n me.BackButtonSelector = options.btnBackSelector;\r\n me.overlayDisplayClass = options.overlayDisplayClass;\r\n me.pokeHistory = createArraySessionStorage(me, 'livechat_pokeHistory');\r\n logIt('PokeMessageView init');\r\n me.avoidDuplicationById = options.avoidDuplicationById || true;\r\n me.avoidDuplicationByText = options.avoidDuplicationByText || true;\r\n }\r\n\r\n setOverLay() {\r\n const me = this;\r\n if (me.overlay) {\r\n // dbl check to make sure overlay doesn't get displayed when already shown\r\n return false;\r\n }\r\n me.overlay = new SimpleView({\r\n // a model less markup to contain individual messages\r\n context: me.context,\r\n identifier: me.identifier,\r\n targetElementSelector: me.overLayTargetElementSelector,\r\n template: me.overLayTemplate,\r\n model: me.model.overLayModel,\r\n afterRender() {\r\n addClass(\r\n me.context.querySelector(me.overLayTargetElementSelector),\r\n me.overlayDisplayClass\r\n );\r\n me.bindEvents();\r\n }\r\n });\r\n }\r\n\r\n setModel(model) {\r\n const me = this;\r\n me.model = model;\r\n }\r\n\r\n bindEvents() {\r\n const me = this;\r\n const $BackBtn = ApexChat.ApexChatJquery(me.BackButtonSelector, me.context);\r\n $BackBtn.on('click', (arg) => {\r\n // saving the last respond time of visitor via PokeOverLay Button\r\n ApexChat.storageAPI.Store(\r\n TempCache.POKE_MESSAGE_LastJoinBackTime,\r\n new Date().getTime()\r\n );\r\n me.publish({\r\n event: WidgetTypes.PokeMessagesOverLay + WidgetStates.Hidden,\r\n data: {}\r\n });\r\n });\r\n $BackBtn.trigger('focus');\r\n }\r\n\r\n show() {\r\n const me = this;\r\n me.setOverLay();\r\n }\r\n\r\n isTextDuplicate(msg) {\r\n const me = this;\r\n\r\n if (me.pokeHistory.indexOf(msg, 'text') == -1) {\r\n me.pokeHistory.add(msg);\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n isIdDuplicate(msg) {\r\n const me = this;\r\n const pokeMsgPrefix = '#apexChat_poke_msg_';\r\n if (ApexChat.ApexChatJquery(pokeMsgPrefix + msg.id, me.context).length) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n render(messageModel) {\r\n const me = this;\r\n // avoid duplication based on message id matching\r\n if (me.avoidDuplicationById && me.isIdDuplicate(messageModel)) {\r\n return;\r\n }\r\n // avoid duplication based on message text matching\r\n if (me.avoidDuplicationByText && me.isTextDuplicate(messageModel)) {\r\n return;\r\n }\r\n\r\n const singleMsgView = new SimpleView({\r\n context: me.context,\r\n identifier: me.messageContainer,\r\n targetElementSelector: me.messageTargetElementSelector,\r\n template: me.messageTemplate,\r\n model: messageModel,\r\n wrap: true,\r\n beforeRender() {\r\n this.template = this.template(this.model);\r\n }\r\n });\r\n }\r\n}\r\n","const createArraySessionStorage = (me, name) => {\r\n const _init = function () {\r\n me.name = name;\r\n me.store = [];\r\n _save();\r\n };\r\n\r\n var _save = function () {\r\n sessionStorage.setItem(me.name, JSON.stringify(me.store));\r\n };\r\n const _addItem = function (item) {\r\n me.store = JSON.parse(sessionStorage.getItem(me.name));\r\n me.store.push(item);\r\n _save();\r\n };\r\n const _getItemIndex = function (obj, prop) {\r\n me.store = JSON.parse(sessionStorage.getItem(me.name));\r\n return me.store.findIndex((item) => (prop ? item[prop] === obj[prop] : item === obj));\r\n };\r\n\r\n _init();\r\n\r\n return {\r\n add: _addItem,\r\n indexOf: _getItemIndex\r\n };\r\n}\r\nexport default createArraySessionStorage;","module.exports = function(obj) {\nobj || (obj = {});\nvar __t, __p = '';\nwith (obj) {\n__p += '
\\r\\n\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n

\\r\\n Restart Confirmation\\r\\n

\\r\\n

\\r\\n Are you sure you want to restart the chat from the beginning?\\r\\n

\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
';\n\n}\nreturn __p\n}","module.exports = function(obj) {\nobj || (obj = {});\nvar __t, __p = '';\nwith (obj) {\n__p += '
\\r\\n
' +\n((__t = (msgTimeStamp)) == null ? '' : __t) +\n'
\\r\\n
' +\n((__t = (text)) == null ? '' : __t) +\n'
\\r\\n
\\r\\n';\n\n}\nreturn __p\n}","module.exports = function(obj) {\nobj || (obj = {});\nvar __t, __p = '';\nwith (obj) {\n__p += '
\\r\\n\t
\\r\\n\t\t
\\r\\n\t\t
\\r\\n\t\t
\\r\\n\t\t\t
\\r\\n\t\t\t\t
\\r\\n\t\t\t
\\r\\n\\r\\n\t\t\t
\\r\\n\t\t
\\r\\n\\r\\n\t\t
\\r\\n\t\t\t
    \\r\\n\t\t\t\t
  • \\r\\n\t\t\t\t\t\\r\\n\t\t\t\t\t\t\"close\"\\r\\n\t\t\t\t\t\\r\\n\t\t\t\t
  • \\r\\n\t\t\t\t
  • \\r\\n\t\t\t\t\t\\r\\n\t\t\t\t\t\t\"close\"\\r\\n\t\t\t\t\t\\r\\n\t\t\t\t
  • \\r\\n\t\t\t
\\r\\n\\r\\n\t\t\t
\\r\\n\t\t\t\t\\r\\n\t\t\t
\\r\\n\t\t
\\r\\n\t
\\r\\n
';\n\n}\nreturn __p\n}","import optinConsentRDPlusThemeTemplate from '../../templates/dialog/RDPlusTheme/optin_consent_template.ejs'\r\nimport optinConsentTemplate from '../../templates/dialog/RDTheme/optin_consent_template.ejs'\r\n\r\nconst importOptinConsentTemplateFactory = (options = {}) => {\r\n if (ApexChat.IsRoundedDynamicPlusTheme) {\r\n return {\r\n optinConsentTemplate: optinConsentRDPlusThemeTemplate(options),\r\n }\r\n }\r\n return {\r\n optinConsentTemplate: optinConsentTemplate(options),\r\n };\r\n};\r\nexport default importOptinConsentTemplateFactory;\r\n","const scrollIntoView = (element) => {\r\n // In order to support Element ScrollIntoView functionality this function created\r\n // if window.scrollIntoView is not available then execute this code\r\n if (!window.scrollIntoView) {\r\n (function () {\r\n function e(t, n, r) {\r\n function s(o, u) {\r\n if (!n[o]) {\r\n if (!t[o]) {\r\n const a = typeof require === 'function' && require;\r\n if (!u && a) return a(o, !0);\r\n if (i) return i(o, !0);\r\n const f = new Error(`Cannot find module '${o}'`);\r\n throw ((f.code = 'MODULE_NOT_FOUND'), f);\r\n }\r\n const l = (n[o] = { exports: {} });\r\n t[o][0].call(\r\n l.exports,\r\n (e) => {\r\n const n = t[o][1][e];\r\n return s(n || e);\r\n },\r\n l,\r\n l.exports,\r\n e,\r\n t,\r\n n,\r\n r\r\n );\r\n }\r\n return n[o].exports;\r\n }\r\n var i = typeof require === 'function' && require;\r\n for (let o = 0; o < r.length; o++) s(r[o]);\r\n return s;\r\n }\r\n return e;\r\n })()(\r\n {\r\n 1: [\r\n function (require, module, exports) {\r\n const COMPLETE = 'complete';\r\n const CANCELED = 'canceled';\r\n function raf(e) {\r\n if ('requestAnimationFrame' in window)\r\n return window.requestAnimationFrame(e);\r\n setTimeout(e, 16);\r\n }\r\n function setElementScroll(e, t, n) {\r\n e.self === e\r\n ? e.scrollTo(t, n)\r\n : ((e.scrollLeft = t), (e.scrollTop = n));\r\n }\r\n function getTargetScrollLocation(e, t, n) {\r\n let l;\r\n let i;\r\n let r;\r\n let a;\r\n let o;\r\n let s;\r\n let f;\r\n const c = e.getBoundingClientRect();\r\n const u = n && n.left != null ? n.left : 0.5;\r\n const d = n && n.top != null ? n.top : 0.5;\r\n const m = n && n.leftOffset != null ? n.leftOffset : 0;\r\n const g = n && n.topOffset != null ? n.topOffset : 0;\r\n const h = u;\r\n const p = d;\r\n if (t.self === t)\r\n (s = Math.min(c.width, t.innerWidth)),\r\n (f = Math.min(c.height, t.innerHeight)),\r\n (i = c.left + t.pageXOffset - t.innerWidth * h + s * h),\r\n (r = c.top + t.pageYOffset - t.innerHeight * p + f * p),\r\n (r -= g),\r\n (a = (i -= m) - t.pageXOffset),\r\n (o = r - t.pageYOffset);\r\n else {\r\n (s = c.width), (f = c.height), (l = t.getBoundingClientRect());\r\n const E = c.left - (l.left - t.scrollLeft);\r\n const S = c.top - (l.top - t.scrollTop);\r\n (i = E + s * h - t.clientWidth * h),\r\n (r = S + f * p - t.clientHeight * p),\r\n (i = Math.max(\r\n Math.min(i, t.scrollWidth - t.clientWidth),\r\n 0\r\n )),\r\n (r = Math.max(\r\n Math.min(r, t.scrollHeight - t.clientHeight),\r\n 0\r\n )),\r\n (r -= g),\r\n (a = (i -= m) - t.scrollLeft),\r\n (o = r - t.scrollTop);\r\n }\r\n return { x: i, y: r, differenceX: a, differenceY: o };\r\n }\r\n function animate(e) {\r\n const t = e._scrollSettings;\r\n if (t) {\r\n const n = getTargetScrollLocation(t.target, e, t.align);\r\n const l = Date.now() - t.startTime;\r\n const i = Math.min((1 / t.time) * l, 1);\r\n if (l > t.time && t.endIterations > 3)\r\n return (\r\n setElementScroll(e, n.x, n.y),\r\n (e._scrollSettings = null),\r\n t.end(COMPLETE)\r\n );\r\n t.endIterations++;\r\n const r = 1 - t.ease(i);\r\n if ((setElementScroll(\r\n e,\r\n n.x - n.differenceX * r,\r\n n.y - n.differenceY * r\r\n ),\r\n l >= t.time))\r\n return animate(e);\r\n raf(animate.bind(null, e));\r\n }\r\n }\r\n function transitionScrollTo(e, t, n, l) {\r\n let i;\r\n const r = !t._scrollSettings;\r\n const a = t._scrollSettings;\r\n const o = Date.now();\r\n function s(e) {\r\n (t._scrollSettings = null),\r\n t.parentElement &&\r\n t.parentElement._scrollSettings &&\r\n t.parentElement._scrollSettings.end(e),\r\n l(e),\r\n t.removeEventListener('touchstart', i, { passive: !0 });\r\n }\r\n a && a.end(CANCELED),\r\n (t._scrollSettings = {\r\n startTime: a ? a.startTime : Date.now(),\r\n endIterations: 0,\r\n target: e,\r\n time: n.time + (a ? o - a.startTime : 0),\r\n ease: n.ease,\r\n align: n.align,\r\n end: s\r\n }),\r\n (i = s.bind(null, CANCELED)),\r\n t.addEventListener('touchstart', i, { passive: !0 }),\r\n r && animate(t);\r\n }\r\n function defaultIsScrollable(e) {\r\n return (\r\n 'pageXOffset' in e ||\r\n ((e.scrollHeight !== e.clientHeight ||\r\n e.scrollWidth !== e.clientWidth) &&\r\n getComputedStyle(e).overflow !== 'hidden')\r\n );\r\n }\r\n function defaultValidTarget() {\r\n return !0;\r\n }\r\n module.exports = function (e, t, n) {\r\n if (e) {\r\n typeof t === 'function' && ((n = t), (t = null)),\r\n t || (t = {}),\r\n (t.time = isNaN(t.time) ? 1000 : t.time),\r\n (t.ease =\r\n t.ease ||\r\n function (e) {\r\n return 1 - (1 - e) ** (e / 2);\r\n });\r\n for (var l = e.parentElement, i = 0, r = t.validTarget || defaultValidTarget, a = t.isScrollable; l;) {\r\n if ((r(l, i) &&\r\n (a\r\n ? a(l, defaultIsScrollable)\r\n : defaultIsScrollable(l)) &&\r\n (i++, transitionScrollTo(e, l, t, o)),\r\n !(l = l.parentElement)))\r\n return;\r\n l.tagName === 'BODY' &&\r\n (l =\r\n (l = l.ownerDocument).defaultView || l.ownerWindow);\r\n }\r\n }\r\n function o(e) {\r\n --i || (n && n(e));\r\n }\r\n };\r\n },\r\n {}\r\n ],\r\n 2: [\r\n function (require, module, exports) {\r\n window.scrollIntoView = require('./scrollIntoView');\r\n },\r\n { './scrollIntoView': 1 }\r\n ]\r\n },\r\n {},\r\n [2]\r\n );\r\n }\r\n // scroll the requested element into View\r\n window.scrollIntoView(element);\r\n};\r\nexport default scrollIntoView;\r\n","import RunAsSoonAs from \"./RunAsSoonAs\";\r\nimport AgentImageHandler from \"./AgentImageHandler\";\r\n\r\n/**\r\n * This function will handle the image and agent title when the participant of chat changed\r\n * This function is being used by EP, DOM and windowed (Both RD and Standard)\r\n * @param participants\r\n */\r\nconst ParticipantsChanged = (participants, config) => {\r\n if (config && !config.isExitPopup) {\r\n const unique = {};\r\n const result = [];\r\n var i;\r\n for (i = 0; i < participants.length; i++) {\r\n const n = participants[i].displayName;\r\n\r\n if (participants[i].userId > 0 &&\r\n participants[i].userId == participants[i].currentlyAssigntoChat) {\r\n if (!unique[n]) {\r\n unique[n] = true;\r\n result.push(n);\r\n }\r\n }\r\n }\r\n RunAsSoonAs(\r\n () => {\r\n if ((result.length > 1 || config.participantsHasBeenGreaterThanOne) &&\r\n !config.ended) {\r\n config.hideWaitingIndicator(result.join(', '));\r\n }\r\n },\r\n () => typeof config.hideWaitingIndicator !== 'undefined'\r\n );\r\n }\r\n // update image\r\n const indicator = config.imageObjSelector;\r\n // get old url for comparison\r\n const prevUrl = indicator.attr('src');\r\n for (var i = 0; i < participants.length; i++) {\r\n // change image if operator joins for the first time\r\n if (participants[i].userId > 0 &&\r\n participants[i].userId == participants[i].currentlyAssigntoChat) {\r\n config.options.agentName = participants[i].displayName;\r\n if (config.isExitPopup) {\r\n const userTitle = config.userTitleSelector;\r\n userTitle[0].innerText = config.options.agentName;\r\n }\r\n if (prevUrl != participants[i].handlerImageUrl && participants[i].handlerImageUrl) {\r\n const imageUrl = participants[i].handlerImageUrl;\r\n indicator.attr('src', AgentImageHandler(imageUrl));\r\n }\r\n // if chat transferred or received on mobile device, get the agent name from the transferred participant.\r\n // if (participants[i].isTransferredChat || participants[i].isDeviceParticipant) {\r\n const headerText = config.$(config.options.participantsSelector);\r\n if (headerText && headerText.length > 0) {\r\n headerText[0].innerText = `Chat with: Visitor, ${config.options.agentName}`;\r\n config.participantsContainer = headerText;\r\n if (participants[i].handlerImageUrl && participants[i].handlerImageUrl != '') {\r\n indicator.attr('src', AgentImageHandler(participants[i].handlerImageUrl));\r\n }\r\n }\r\n }\r\n // }\r\n // initialize the value of participant display name if it is not initalized\r\n if (!config.options.participantDisplayName) {\r\n config.options.participantDisplayName = participants[i].displayName;\r\n }\r\n if (config.options.model &&\r\n participants[i].userId > 0 &&\r\n participants[i].userId == participants[i].currentlyAssigntoChat) {\r\n config.options.model.agentName = participants[i].displayName;\r\n }\r\n }\r\n return config;\r\n};\r\nexport default ParticipantsChanged;\r\n","\r\nimport exitPopupThemeTemplate from '../../templates/exit_popup/RDTheme/exitpopup_template.ejs'\r\nimport exitPopupRDPlusThemeTemplate from '../../templates/exit_popup/RDPlusTheme/exitpopup_template.ejs'\r\n\r\n// message template\r\nimport exitPopupMessageTemplate from '../../templates/exit_popup/RDTheme/message_template.ejs'\r\nimport exitPopupMessageRDPlusThemeTemplate from '../../templates/exit_popup/RDPlusTheme/message_template.ejs'\r\n\r\n\r\nconst ImportEPTemplateFactory = (options) => {\r\n const defaultTemplates = {\r\n exitPopupThemeTemplate,\r\n exitPopupMessageTemplate\r\n };\r\n\r\n const rdPlusTemplates = {\r\n exitPopupThemeTemplate: exitPopupRDPlusThemeTemplate,\r\n exitPopupMessageTemplate: exitPopupMessageRDPlusThemeTemplate\r\n };\r\n\r\n if (ApexChat.IsRoundedDynamicPlusTheme) {\r\n return rdPlusTemplates;\r\n }\r\n\r\n return defaultTemplates;\r\n}\r\nexport default ImportEPTemplateFactory;\r\n","module.exports = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n__p += ' 0 || participantId === -7){ ;\n__p += ' apexchat_agent apexchat_rd_received';\n};\n__p += ' \">\\r\\n
\\r\\n
0){ ;\n__p += 'Left';\n};\n__p += ' apexchat_rd_delay_s apexchat_text\"\\r\\n id=\"apexchat_chatlog_' +\n((__t = (id)) == null ? '' : __t) +\n'\">\\r\\n ' +\n((__t = (html)) == null ? '' : __t) +\n'\\r\\n
\\r\\n
\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n 0){ ;\n__p += ' apexchat_element_hide';\n};\n__p += '\"> -->\\r\\n \\r\\n ' +\n((__t = (ApexChat.getCurrentFormatedDateTime(createdOn, 'hh:mmtt' ) )) == null ? '' : __t) +\n'\\r\\n\\r\\n';\n\n}\nreturn __p\n}","// Deprecated: use ApexChat.EmojiUtils.createEmojiList() instead\r\nexport default class EmojiUtils {\r\n constructor() {\r\n this.emojiNames = [\r\n ':grinning_face:',\r\n ':grinning_face_with_smiling_face:',\r\n ':face_with_tears_of_joy:',\r\n ':smiling_face_with_open_mouth:',\r\n ':smiling_face_with_open_mouth_and_smiling_eyes:',\r\n ':smiling_face_with_open_mouth_and_cold_sweat:',\r\n ':smiling_face_with_open_mouth_and_tightly_closed_eyes:',\r\n ':smiling_face_with_halo:',\r\n ':smiling_face_with_horns:',\r\n ':winking_face:',\r\n ':smiling_face_with_smiling_eyes:',\r\n ':face_savouring_delicious_food:',\r\n ':relieved_face:',\r\n ':smiling_face_with_heart_shaped_eyes:',\r\n ':smiling_face_with_sunglasses:',\r\n ':smirking_face:',\r\n ':neutral_face:',\r\n ':expressionalLess_face:',\r\n ':unamused_face:',\r\n ':face_with_cold_sweat:',\r\n ':pensive_face:',\r\n ':confused_face:',\r\n ':confounded_face:',\r\n ':kissing_face:',\r\n ':face_throwing_a_kiss:',\r\n ':kissing_face_with_smiling_eyes:',\r\n ':kissing_face_with_closed_eyes:',\r\n ':disappointed_face:',\r\n ':worried_face:',\r\n ':angry_face:',\r\n ':pouting_face:',\r\n ':crying_face:',\r\n ':perserving_face:',\r\n ':face_with_look_of_triumph:',\r\n ':disappointed_but_relieved_face:',\r\n ':frowning_face_with_open_mouth:'\r\n ];\r\n this.emojiDecimalCodes = [\r\n '😀',\r\n '😁',\r\n '😂',\r\n '😃',\r\n '😄',\r\n '😅',\r\n '😆',\r\n '😇',\r\n '😈',\r\n '😉',\r\n '😊',\r\n '😋',\r\n '😌',\r\n '😍',\r\n '😎',\r\n '😏',\r\n '😐',\r\n '😑',\r\n '😒',\r\n '😓',\r\n '😔',\r\n '😕',\r\n '😖',\r\n '😗',\r\n '😘',\r\n '😛',\r\n '😝',\r\n '😞',\r\n '😟',\r\n '😠',\r\n '😡',\r\n '😢',\r\n '😣',\r\n '😤',\r\n '😥',\r\n '😦'\r\n ];\r\n // create a key-value pair to keep emoji, decimal\r\n this.mappingCodes = {};\r\n for (let i = 0; i < this.emojiNames.length; i++) {\r\n this.mappingCodes[this.emojiNames[i]] = this.emojiDecimalCodes[i].substring(2, 8);\r\n }\r\n // var emojiRegexArr = [];\r\n // for (var i = 0; i < emojiNames.length; i++) {\r\n // emojiRegexArr[i] = new RegExp('\\(' + emojiNames[i] + '\\)', 'g');\r\n // }\r\n // create clickable emoji's list\r\n this.clickableEmojisList = [];\r\n for (let j = 0; j < this.emojiNames.length; j++) {\r\n let emoji = `${this.emojiDecimalCodes[j]}`;\r\n if (j != 0 && j % 6 == 0) {\r\n emoji = `
${emoji}`;\r\n }\r\n this.clickableEmojisList.push(emoji);\r\n }\r\n // Pollyfill for String.fromCodePoint as per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint\r\n if (!String.fromCodePoint)\r\n (function (stringFromCharCode) {\r\n const fromCodePoint = function (_) {\r\n const codeUnits = [];\r\n let codeLen = 0;\r\n let result = '';\r\n for (let index = 0, len = arguments.length; index !== len; ++index) {\r\n let codePoint = +arguments[index];\r\n // correctly handles all cases including `NaN`, `-Infinity`, `+Infinity`\r\n // The surrounding `!(...)` is required to correctly handle `NaN` cases\r\n // The (codePoint>>>0) === codePoint clause handles decimals and negatives\r\n if (!(codePoint < 1114111 && codePoint >>> 0 === codePoint))\r\n throw RangeError(`Invalid code point: ${codePoint}`);\r\n if (codePoint <= 65535) {\r\n // BMP code point\r\n codeLen = codeUnits.push(codePoint);\r\n } else {\r\n // Astral code point; split in surrogate halves\r\n // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\r\n codePoint -= 65536;\r\n codeLen = codeUnits.push(\r\n (codePoint >> 10) + 55296, // highSurrogate\r\n (codePoint % 1024) + 56320 // lowSurrogate\r\n );\r\n }\r\n if (codeLen >= 16383) {\r\n result += stringFromCharCode.apply(null, codeUnits);\r\n codeUnits.length = 0;\r\n }\r\n }\r\n return result + stringFromCharCode.apply(null, codeUnits);\r\n };\r\n try {\r\n // IE 8 only supports `Object.defineProperty` on DOM elements\r\n Object.defineProperty(String, 'fromCodePoint', {\r\n value: fromCodePoint,\r\n configurable: true,\r\n writable: true\r\n });\r\n } catch (e) {\r\n String.fromCodePoint = fromCodePoint;\r\n }\r\n })(String.fromCharCode);\r\n // Pollyfill for string's includes method which clickEmojis() uses; which crashes in an older IE; ref. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes\r\n if (!String.prototype.includes) {\r\n Object.defineProperty(String.prototype, 'includes', {\r\n value(search, start) {\r\n if (typeof start !== 'number') {\r\n start = 0;\r\n }\r\n if (start + search.length > this.length) {\r\n return false;\r\n }\r\n return this.indexOf(search, start) !== -1;\r\n }\r\n });\r\n }\r\n }\r\n\r\n createEmojiList() {\r\n const me = this;\r\n return me.clickableEmojisList;\r\n }\r\n\r\n parse(text) {\r\n if (text) {\r\n for (let m = 0; m < this.emojiNames.length; m++) {\r\n text = text.replace(\r\n this.emojiDecimalCodes[m],\r\n `${this.emojiDecimalCodes[m]}`\r\n );\r\n }\r\n }\r\n return text;\r\n }\r\n\r\n toEmoji(name) {\r\n const emojiInDecimal = this.mappingCodes[name];\r\n const emoji = String.fromCodePoint(Number(emojiInDecimal));\r\n return emoji;\r\n }\r\n}\r\n","module.exports = function(obj) {\nobj || (obj = {});\nvar __t, __p = '';\nwith (obj) {\n__p += '
\\r\\n
\\r\\n \\r\\n\\r\\n \\r\\n
\\r\\n
';\n\n}\nreturn __p\n}","import GlobalVariables from '../GlobalVariables';\r\n\r\nconst languageTransferRequest = function (baseUrl, ajax, chatId, lng) {\r\n ajax({\r\n url: `${GlobalVariables.LiveChatServiceUrl}Services/ApexChatUtilityService.svc/chats/${chatId}/${lng}/transfer`,\r\n type: 'GET'\r\n });\r\n};\r\nexport default languageTransferRequest;\r\n","import logIt from '../../logIt';\r\nimport BaseClass from '../core/BaseClass';\r\nimport WidgetTypes from '../core/enums/WidgetTypes';\r\n\r\nexport default class PokeMessageModel extends BaseClass {\r\n constructor(options) {\r\n super(options);\r\n const me = this;\r\n me.widget = WidgetTypes.PokeMessagesOverLay;\r\n me.overLayModel = options.overLayModel;\r\n logIt('PokeMessageModel init');\r\n me.PokeMessages = [];\r\n }\r\n\r\n addPokeMessage(message) {\r\n const me = this;\r\n me.PokeMessages.push(message);\r\n }\r\n\r\n getPokeMessages() {\r\n const me = this;\r\n return me.PokeMessages;\r\n }\r\n}\r\n","module.exports = function(obj) {\nobj || (obj = {});\nvar __t, __p = '';\nwith (obj) {\n__p += '
\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
';\n\n}\nreturn __p\n}","const shiftUps = {\r\n 96: '~',\r\n 49: '!',\r\n 50: '@',\r\n 51: '#',\r\n 52: '$',\r\n 53: '%',\r\n 54: '^',\r\n 55: '&',\r\n 56: '*',\r\n 57: '(',\r\n 48: ')',\r\n 45: '_',\r\n 61: '+',\r\n 91: '{',\r\n 93: '}',\r\n 92: '|',\r\n 59: ':',\r\n 39: '\"',\r\n 44: '<',\r\n 46: '>',\r\n 47: '?'\r\n};\r\nexport default shiftUps;\r\n","module.exports = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n__p += '
\\r\\n \\r\\n \\r\\n
';\n\n}\nreturn __p\n}","\r\n/**\r\n * Returns a debounced version of the given function.\r\n * Debouncing is a performance optimization technique that\r\n * ensures a function is only called after a certain amount\r\n * of time has passed since the last time the function was called.\r\n * This can be especially useful for functions that are\r\n * called rapidly, such as on window resizes or on keypresses.\r\n *\r\n * @param {Function} func The function to debounce.\r\n * @param {Number} timeout The amount of time to debounce in milliseconds.\r\n * @returns {Function} The debounced version of the given function.\r\n */\r\nconst debounce = (func, timeout = 300) => {\r\n let timer;\r\n return (...args) => {\r\n clearTimeout(timer);\r\n timer = setTimeout(() => { func.apply(this, args); }, timeout);\r\n };\r\n}\r\n\r\nexport default debounce;","/*\r\n A generic class used to control common view logic of chat windows: DOM/EP\r\n*/\r\n// import exitPopupMessageTemplate from '../templates/exit_popup/message_template.ejs'\r\nimport createMessageTemplateFactory from '../questiontypes/ImportFactories/ImportMessageTemplateFactory'\r\n\r\nimport epOfficeHoursMessageTemplate from '../templates/office_hours_messages/Rd_Dom/message_template.ejs'\r\nimport domOfficeHoursMessageTemplate from '../templates/office_hours_messages/Rd_EP/message_template.ejs'\r\n// import VAChatRestartOverlay from '../templates/dialog_overlays/VAChatRestartOverlay.ejs';\r\nimport VideoGreetOverlay from '../templates/dialog_overlays/VideoGreetOverlay.ejs';\r\nimport noAgentAvailable from '../templates/dialog_overlays/noAgentOverlay.ejs';\r\n\r\n\r\nimport epPokeMessageTemplate from '../templates/poke_messages/ep_poke_message_template.ejs';\r\nimport domPokeMessageTemplate from '../templates/poke_messages/dom_poke_message_template.ejs';\r\n\r\nimport epPokeOverlayTemplate from '../templates/poke_messages/ep_poke_overlay_template.ejs';\r\nimport domPokeOverlayTemplate from '../templates/poke_messages/dom_poke_overlay_template.ejs';\r\n\r\nimport BaseClass from './BaseClass';\r\nimport LiveChatRoom from './LiveChatRoom';\r\nimport QuestionTypeRendererExtentions from '../questiontypes/QuestionTypeRendererExtension';\r\nimport QuestionTypeVersion from '../questiontypes/QuestionTypeVersion';\r\nimport ChatCookieHandler from './chathandlers/ChatCookieHandler';\r\nimport WidgetTypes from './enums/WidgetTypes';\r\nimport SimpleView from './SimpleView';\r\nimport TempCache from './enums/TempCache';\r\nimport ParticipantIds from './enums/ParticipantIds';\r\nimport { arrayObjectIndexOf } from './ChatUtilityFunctions';\r\nimport PokeMessageView from '../pokeMessage/PokeMessageView';\r\nimport PokeMessagesUIController from '../pokeMessage/PokeMessagesUIController';\r\nimport PokeMessageModel from '../pokeMessage/PokeMessageModel';\r\nimport GlobalVariables from './GlobalVariables';\r\nimport cleanInvalidHtml from './hooks/cleanInvalidHtml';\r\nimport isMessageCompanyHours from './hooks/isMessageCompanyHours';\r\nimport parseCompanyHours from './hooks/parseCompanyHours';\r\nimport UserIds from './hooks/UserIds';\r\nimport ChatMode from './hooks/ChatMode';\r\nimport EmojiUtils from './hooks/EmojiUtils';\r\nimport fixedElementToTop from './hooks/fixedElementToTop';\r\nimport ManageFocusOnKeyEvents from './hooks/ManageFocusOnKeyEvents';\r\nimport ParticipantsChanged from './hooks/ParticipantsChanged';\r\nimport TimeTracker from './hooks/TimeTracker';\r\nimport PipedMessageHandler from './hooks/PipedMessageHandler';\r\nimport WebSmsFormValidator from './hooks/WebSmsFormValidator';\r\nimport Queue from './hooks/Queue';\r\nimport ADACompliant from './hooks/ADACompliant';\r\nimport log from './hooks/log';\r\nimport { LogLevel, QTGridMessageType, ScriptsQuestionType, SkinInviteType, SystemMessageType, VISITOR_MESSAGE_SOUND } from './enums/Enum';\r\nimport checkSpanishLanguage from './hooks/checkSpanishLanguage';\r\nimport scrollIntoView from './hooks/scrollIntoView';\r\nimport parseTemplate from './hooks/parseTemplate';\r\nimport setPlaceholder from './hooks/setPlaceholder';\r\nimport TempStorageCache from './hooks/TempStorageCache';\r\nimport Browser from './hooks/Browser';\r\nimport ServerLog from './hooks/ServerLog';\r\nimport decodeHTML from './hooks/decodeHTML';\r\nimport removeTextFollowedByColon from './hooks/removeTextFollowedByColon';\r\nimport addOptionProperty from './hooks/addOptionProperty';\r\nimport googleAnalyticsObjectInit from './hooks/googleAnalyticsObjectInit';\r\nimport GetChatID from './hooks/GetChatID';\r\nimport getQueryStringValue from './hooks/getQueryStringValue';\r\nimport To_ascii from '../../To_ascii';\r\nimport shiftUps from './hooks/shiftUps';\r\nimport RunAsSoonAs from './hooks/RunAsSoonAs';\r\nimport ScriptsQuestionTypeToolTips from './hooks/ScriptsQuestionTypeToolTips';\r\nimport ChatStates from './hooks/ChatStates';\r\nimport RunAfter from './hooks/RunAfter';\r\nimport isEnterKeyPressed from './hooks/isEnterKeyPressed';\r\nimport observe from './hooks/observe';\r\nimport ApexChatTitle from '../core/hooks/ApexChatTitle';\r\nimport Cookies from './hooks/Cookies';\r\nimport ChatEvents from './hooks/ChatEvents';\r\nimport WidgetStates from './hooks/WidgetStates';\r\nimport getCookieValue from './hooks/getCookieValue';\r\nimport getStorageAPIValue from './hooks/getStorageAPIValue';\r\nimport fromQueryString from './hooks/fromQueryString';\r\nimport storageAPIExists from './hooks/storageAPIExists';\r\nimport languageTransferRequest from './hooks/languageTransferRequest';\r\nimport isAcceptKey from './hooks/isAcceptKey';\r\nimport showElement from './hooks/showElement';\r\nimport hideElement from './hooks/hideElement';\r\nimport removeClass from './hooks/removeClass';\r\nimport localstorageAPIExists from './hooks/localstorageAPIExists';\r\nimport disableTypingInput from './hooks/disableTypingInput';\r\nimport enableTypingInput from './hooks/enableTypingInput';\r\nimport logIt from '../../logIt';\r\nimport getStyleForIframe from './hooks/getStyleForIframe';\r\nimport videojs from 'video.js';\r\nimport RunUntil from './hooks/RunUntil';\r\nimport Utils from './Utils';\r\nimport importEndChatOverlaySheetTemplateFactory from '../questiontypes/ImportFactories/ImportEndChatOverlaySheetTemplateFactory';\r\nimport importDesclaimerOverlaySheetTemplateFactory from '../questiontypes/ImportFactories/ImportDesclaimerOverlaySheetTemplateFactory';\r\nimport importOptinConsentTemplateFactory from '../questiontypes/ImportFactories/ImportOptinOverlaySheetTemplateFactory';\r\nimport ImportEPTemplateFactory from './imports/ImportEPTemplateFactory';\r\nimport AgentImageHandler from './hooks/AgentImageHandler';\r\nimport ApplySequenceCssClasses from './hooks/ApplyMessageSequenceCssClasses';\r\nimport watchElementChanges from './hooks/elementObserver';\r\nimport toggleSendButtonClasses from './hooks/toggleSendButton';\r\nimport getUniqueValueArray from './hooks/getUniqeValueArray';\r\nimport ImportRestartChatOverlayFactory from '../questiontypes/ImportFactories/ImportRestartChatOverlayFactory';\r\n\r\nexport default class ChatUIController extends BaseClass {\r\n // The life of counterForQueuedTimers starts in showTypingIndicatorThenDisplayMessage and ends\r\n // in showTypingIndicatorThenDisplayMessage after onComplete has run; the purpose is to make super fast consecutive None type of messages show with delay by incrementing setTimeOut interval\r\n // Plz note consecutive None messages don't respect setTimeout based delay in\r\n // showTypingIndicatorThenDisplayMessage and render all at once; this counter variable is a hack to address this issue\r\n // for other types of messages, this counter variable has no effect\r\n\r\n constructor(options) {\r\n let opt = null;\r\n opt = Object.assign(options, {\r\n widget: options.objectType,\r\n apologizeForWaitAfter: 0,\r\n isRoundedDynamic: true,\r\n apologizeForWaitMessage: 'Just one moment.',\r\n chatMode: options.model.chatMode,\r\n position: options.model.position, // Position.Right\r\n handlerImageUrl: '/contents/images/agents/amanda.jpg'\r\n });\r\n\r\n // General Elements :: Those elements which are common in all widget.\r\n\r\n // super(options);\r\n opt.elements = Object.assign(options.elements, {\r\n chatLogSelectorPrefix:\r\n '#apexchat_chatlog_' /* this is prefixed to the id of the chat log to ensure no dupes arrive */\r\n });\r\n\r\n super(opt);\r\n const me = this;\r\n if (typeof ApexChat.ApexChatJquery === 'function') {\r\n me.$ = ApexChat.ApexChatJquery;\r\n }\r\n me.widget = options.widget;\r\n me.oneTimeSoundSetup = true;\r\n me.mode = null;\r\n me.isFirstNotificationRendered = false;\r\n me.counterForQueuedTimers = 0;\r\n me.INITIAL_DELAY_AGENT_PICKUP = 0.5 * 1000;\r\n me.INITIAL_DELAY_PRELOAD_GREETING = 1 * 1000; // # of seconds to wait before greeting\r\n me.ADAHandler = options.ADAHandler;\r\n\r\n me.preserveChatArray = [];\r\n me.context = me.options.context;\r\n me.options.widgetType = me.getContextId();\r\n me.options.model.aiBotEnabled = me.isTransferredToLiveAgent() ? false : me.options.model.aiBotEnabled\r\n me.options.aiBotEnabled = me.options.model.aiBotEnabled;\r\n me.allowSoundFloodingOnNewMesssage = false; // introduced this flag to enable/disable sound flooding on demand\r\n const removeUnnecessaryCookies = function (args) {\r\n // JIRA_6537 - Greeting not showing after Refresh Ended Chat's overlay on pop out cases\r\n // summary: We cant move this code inside PreChat Class as it doesnt exist in case of Popedout windowed chat, Removing the PreChat Message Sent helped the greeting to appear it again.\r\n ApexChat.storageAPI.Remove(TempCache.PreChat_Message_Sent);\r\n };\r\n\r\n // When Chat Session Ends, On very next message from Visitor, an overlay mask for starting new chat appears,\r\n // & visitor starts the chat at this point we need to delete few cookies for PreChat.\r\n me.subscribe(\r\n WidgetTypes.ChatRoom + ChatEvents.OnSendMessageFailure,\r\n removeUnnecessaryCookies\r\n );\r\n me.subscribe(WidgetTypes.PreChat + WidgetStates.MessageSent, (args) => {\r\n if (args.questionType === ScriptsQuestionType.FullText) {\r\n me.handleFullTextType({ res: args });\r\n } else {\r\n me.handleQuestionType(args, true);\r\n }\r\n });\r\n me.subscribe(ChatEvents.onOperatorNotAvailable, () => {\r\n Cookies.set(TempCache.SHOW_OPERATOR_NOT_FOUND_OVERLAY, true);\r\n me.showOperatorNotFoundOverlay();\r\n me.hidePokeMessages(); // clear poke overlay if present on screen\r\n });\r\n me.subscribe(ChatEvents.onVideoGreetOverlay, () => {\r\n me.showVideoGreetOverlay();\r\n me.hidePokeMessages(); // clear poke overlay if present on screen\r\n });\r\n // if (me.mode == WidgetTypes.DOM || me.mode == WidgetTypes.ExitPopup) {\r\n // me.initChatRoom();\r\n // }\r\n // me.initChatRoom();\r\n if (\r\n me.options.model.customVisitorScript &&\r\n me.options.model.runCustomVisitorScriptAfterSeconds\r\n ) {\r\n window.setTimeout(() => {\r\n try {\r\n eval(me.options.model.customVisitorScript);\r\n } catch (e) {\r\n log(me.options.model, LogLevel.Warn);\r\n }\r\n }, me.options.model.runCustomVisitorScriptAfterSeconds * 1000);\r\n }\r\n me.currentText = [];\r\n if (\r\n me.options.model.skinInviteType !== SkinInviteType.Image &&\r\n me.options.model.isOpenForBusiness === false\r\n ) {\r\n me.$('.livechat_videochat', me.context).remove();\r\n }\r\n if (\r\n me.options.model.chatMode == ChatMode.DOM &&\r\n me.options.model.invitationWidgetStyleCustom.indexOf('IsChevronStyleDOM') !== -1\r\n ) {\r\n if (\r\n me.options.model.invitationWidgetStyleCustom.indexOf('IsChevronBOXStyleDOM') !== -1\r\n ) {\r\n me.$(`#${me.mobileDOM_ChevronChatArrow}`, me.context)\r\n .addClass('apexchat-icon-down-open apexchat-icon-white-13')\r\n .removeClass('apexchat-icon-angle-double-down apexchat_icon_white');\r\n } else {\r\n me.$(`#${me.mobileDOM_ChevronChatArrow}`, me.context)\r\n .addClass('apexchat-icon-angle-double-down apexchat_icon_white')\r\n .removeClass('apexchat-icon-down-open apexchat-icon-white-13');\r\n }\r\n }\r\n if (me.options.model.chatMode == ChatMode.DOM) {\r\n if (\r\n /iPad|iPhone|iPod/.test(navigator.userAgent) &&\r\n !window.MSStream &&\r\n me.options.model.chatMode == ChatMode.DOM\r\n ) {\r\n me.$('#apexchat_chatMsg_textbox', me.context).blur(() => {\r\n me.reposition.bind2(me);\r\n });\r\n }\r\n }\r\n me.$('#livechat_send_message_button_new_dom', me.context).click(me.sendMessage.bind2(me));\r\n if (me.options.model.chatMode == ChatMode.DOM) {\r\n me.repositionFn = me.reposition.bind2(me);\r\n } else {\r\n me.repositionFn = me.syncSize.bind2(me);\r\n }\r\n me.$(window).bind('resize orientationchange', me.repositionFn);\r\n // do not show the auto greet message if operators enabled as then we will see duplicate greetings- first from default and then from the real operator\r\n const isDOM = getQueryStringValue('initiatedBy') == '';\r\n const isEPConnected = getQueryStringValue('isEPConnected') == 'true';\r\n // [ExitPopup]: If Popout from exit popup then greeting message will not show. me.getQueryStringValue(\"initiatedBy\") != \"ExitPopup\" window.opener.ApexChat.ExitPopup == undefined || !window.opener.ApexChat.ExitPopup.isConnectionEstablished)\r\n // window.setTimeout(function () {\r\n\r\n // }, 1000);\r\n me.subscribe(ChatEvents.OnMessageArrived, (args) => {\r\n me.onMessageArrived(args.m, args.initialLoad, args.index, args.cb);\r\n });\r\n me.subscribe(ChatEvents.OnTypingArrived, (args) => {\r\n me.onTypingArrived(args);\r\n });\r\n me.subscribe(ChatEvents.OnChatJoinFailure, (args) => {\r\n me.onChatJoinFailure(args);\r\n });\r\n me.subscribe(WidgetTypes.ChatRoom + ChatEvents.OnMessageArrived, (args) => {\r\n me.onMessageArrived(args.m, args.initialLoad, args.index, args.cb);\r\n });\r\n me.subscribe(WidgetTypes.ChatRoom + ChatEvents.ChatIdleOut, (args) => {\r\n me.endChat();\r\n });\r\n me.subscribe(WidgetTypes.ChatRoom + ChatEvents.OnSMSChatTransferring, (args) => {\r\n me.renderUIOnChatTransfer(args);\r\n });\r\n me.subscribe(ChatEvents.OnHistoryStartLoading, (args) => {\r\n me.hideChatLog();\r\n });\r\n\r\n me.subscribe(ChatEvents.OnHistoryLoadedCompletely, (args) => {\r\n me.showChatLog();\r\n });\r\n me.subscribe(ChatEvents.OnStopWaiting, (args) => {\r\n me.stopWaiting();\r\n });\r\n me.subscribe(\r\n WidgetTypes.ChatRoom + ChatEvents.OnParticipantsChanged,\r\n (participants) => {\r\n me.onParticipantsChanged(participants);\r\n }\r\n );\r\n me.subscribe(ChatEvents.OnHideWaitingIndicator, (participants) => {\r\n me.HideWaitingIndicator(participants);\r\n });\r\n me.subscribe(WidgetTypes.ChatRoom + ChatEvents.OnTypingArrived, (args) => {\r\n me.onTypingArrived(args);\r\n });\r\n me.subscribe(ChatEvents.OnCallStatusArrived, (args) => {\r\n me.onCallStatusArrived(args);\r\n });\r\n me.subscribe(ChatEvents.OnPredefinedPokeMessage, (args) => {\r\n me.preserveChatArray.push({\r\n index: args.index,\r\n predefinedMsgs: args.msg.text,\r\n agentParticipantId: ParticipantIds.pokeMessage,\r\n participantDisplayName: me.options.model.agentName,\r\n userId: ParticipantIds.pokeMessage,\r\n isPredefinedResponse: true\r\n });\r\n me.showPokeMessages(args.msg); // show a poke message 1-by-1 after EP predefined messages have appeared\r\n });\r\n me.subscribe(WidgetTypes.ChatRoom + ChatEvents.OnChatEnded, () => {\r\n me.onChatEnded();\r\n });\r\n me.subscribe(WidgetTypes.ChatRoom + ChatEvents.OnSendMessageSuccess, (args) => {\r\n me.onMessageArrived(args, false);\r\n });\r\n me.subscribe(\r\n WidgetTypes.DOMUIController + ChatEvents.OnTransferRequested,\r\n (args) => {\r\n me.hidePokeMessages(); // clear poke overlay if present on screen\r\n if (me.chatTransfer) {\r\n const chatId = getStorageAPIValue(TempCache.CHAT_ID_COOKIE) || 0;\r\n logIt(`TC::transfer chat requested:${chatId}`);\r\n const data = {\r\n message: 'Chat Transfer requested by the visitor',\r\n isSMS: false,\r\n chatId: me.getChatId()\r\n };\r\n me.chatTransfer.Transfer(GlobalVariables.LiveChatServiceUrl, me.$.ajax, data, 'true');\r\n }\r\n }\r\n );\r\n me.subscribe(WidgetTypes.DOMUIController + ChatEvents.OnChatRestart, (args) => {\r\n me.hidePokeMessages(); // clear poke overlay if present on screen\r\n me.showChatRestartOverlay();\r\n });\r\n me.subscribe(WidgetTypes.EPUIController + ChatEvents.OnChatRestart, (args) => {\r\n me.hidePokeMessages(); // clear poke overlay if present on screen\r\n me.showChatRestartOverlay();\r\n });\r\n me.subscribe(\r\n WidgetTypes.EPUIController + ChatEvents.OnTransferRequested,\r\n (args) => {\r\n me.hidePokeMessages(); // clear poke overlay if present on screen\r\n if (me.chatTransfer) {\r\n const chatId = getStorageAPIValue(TempCache.CHAT_ID_COOKIE) || 0;\r\n logIt(`TC::transfer chat requested:${chatId}`);\r\n const data = {\r\n message: 'Chat Transfer requested by the visitor',\r\n isSMS: false,\r\n chatId\r\n };\r\n me.chatTransfer.Transfer(GlobalVariables.LiveChatServiceUrl, me.$.ajax, data, 'true');\r\n }\r\n }\r\n );\r\n me.subscribe(WidgetTypes.ChatRoom + ChatEvents.OnSendMessageFailure, (args) => {\r\n if (\r\n (args && args.getErrorCode() && args.getErrorCode() == -1) ||\r\n me.room.webSyncClient.getIsConnected() == false\r\n ) {\r\n // condition when server is down or chat is not ended properly\r\n return; // overlay is not shown when chat is not necessarily end\r\n }\r\n if (me.widget == WidgetTypes.DOMUIController) {\r\n // me.QTRendererExt && me.QTRendererExt.setLastFullText();//keep the last FT text in it (if present in current session) for resending attempt\r\n me.showChatEndedNotificationBar();\r\n } else if (me.widget == WidgetTypes.EPUIController) {\r\n me.showChatEndedNotificationEP();\r\n }\r\n });\r\n me.subscribe(\r\n WidgetTypes.PokeMessagesOverLay + ChatEvents.OnPokeMessageArrived,\r\n (args) => {\r\n if (\r\n me.state.getStateValue(WidgetTypes.DOMUIController) ==\r\n ChatEvents.OnChatRestart\r\n ) {\r\n return; // no poke, if visitor has initiated chat restart\r\n }\r\n if (args.m && args.m.isPredefinedResponse) {\r\n // when EP predefined message response there is no need to show poke messages\r\n return;\r\n }\r\n me.showPokeMessages(args.m);\r\n }\r\n );\r\n me.subscribe(ChatEvents.OnChatOptInConsentAccepted, (args) => {\r\n me.publishOptInSelection(args);\r\n });\r\n\r\n me.subscribe(ChatEvents.OnChatOptInConsentRejected, (args) => {\r\n me.publishOptInSelection(args);\r\n });\r\n\r\n me.subscribe(\r\n ChatEvents.OnChatOptInConsentAcceptedButNumberChangeRequested,\r\n (args) => {\r\n me.publishOptInSelection(args);\r\n }\r\n );\r\n me.subscribe(ChatEvents.OnChatDisclaimerAccepted, (args) => {\r\n me.publishDisclaimerSelection(args);\r\n });\r\n me.subscribe(ChatEvents.OnChatDisclaimerRejected, (args) => {\r\n me.publishDisclaimerSelection(args);\r\n });\r\n me.subscribe(ChatEvents.OnWebToSmsRejected, function (args) {\r\n me.publishConvertToSMSRejection(args);\r\n });\r\n me.subscribe(WidgetTypes.PokeMessagesOverLay + WidgetStates.Hidden, (args) => {\r\n me.hidePokeMessages();\r\n });\r\n\r\n if (\r\n me.isPageRefreshed() &&\r\n me.state.getStateValue(WidgetTypes.DOMUIController) ===\r\n ChatEvents.OnChatRestart\r\n ) {\r\n me.hidePokeMessages(); // poke overlay should also be re-reset\r\n me.showChatRestartOverlay();\r\n return;\r\n }\r\n if (\r\n me.isPageRefreshed() &&\r\n me.state.getStateValue(WidgetTypes.EPUIController) === ChatEvents.OnChatRestart\r\n ) {\r\n me.hidePokeMessages(); // clear poke overlay if present on screen\r\n me.showChatRestartOverlay();\r\n return;\r\n }\r\n\r\n me.state.changeState({ toState: ChatStates.UIRendered });\r\n me.askConfirmation = function (options) {\r\n var message, flag, callback, result;\r\n if (!options.message) {\r\n console.error('message is mandatory!');\r\n return;\r\n }\r\n if (!options.callback) {\r\n console.error('callback is mandatory!');\r\n return;\r\n }\r\n message = options.message;\r\n //console.log('askConfirmation running');\r\n flag = options.flag;\r\n callback = options.callback || false;\r\n if (flag === undefined || flag === true) {\r\n result = window.confirm(message);\r\n if (result) {\r\n callback();\r\n //console.log('askConfirmation callback invoked');\r\n }\r\n } else {\r\n callback();\r\n //console.log('askConfirmation callback invoked');\r\n }\r\n };\r\n\r\n if (me.options.elements.messagesContainerSelector && me.$) {\r\n const messagesContainerSelector = me.$(me.options.elements.messagesContainerSelector, me.context);\r\n // different messages take variable time to render\r\n // so that we have to wathc the message container for changes\r\n // then we have added the sequence css classess to the msg elements\r\n watchElementChanges(messagesContainerSelector[0], () => ApplySequenceCssClasses(me));\r\n }\r\n\r\n }\r\n publishConvertToSMSRejection(args) {\r\n var me = this;\r\n var chatId = me.room.chatId || me.options.chatId || getCookieValue('livechat_chat_id');\r\n me.room.webSyncClient.publish({\r\n retries: 3,\r\n channel: '/chatroom/' + chatId + '/rejectconverttosms',\r\n data: args,\r\n onSuccess: function (args) {\r\n // nothing\r\n }\r\n });\r\n }\r\n publishDisclaimerSelection(args) {\r\n const me = this;\r\n const { chatId } = args;\r\n if (!chatId) {\r\n return;\r\n }\r\n me.room.webSyncClient.publish({\r\n retries: 3,\r\n channel: `/chatroom/${chatId}/disclaimer`,\r\n data: args,\r\n onSuccess(args) {\r\n // nothing\r\n }\r\n });\r\n }\r\n\r\n publishOptInSelection(args) {\r\n const me = this;\r\n const chatId =\r\n me.room.chatId || me.options.chatId || getCookieValue('livechat_chat_id');\r\n me.room.webSyncClient.publish({\r\n retries: 3,\r\n channel: `/chatroom/${chatId}/optinconsent`,\r\n data: args,\r\n onSuccess(args) {\r\n // nothing\r\n }\r\n });\r\n }\r\n\r\n bind() {\r\n const me = this;\r\n const clickSource = me.$(me.options.elements.clickSourceId, me.context);\r\n if (clickSource) {\r\n observe(clickSource, 'click', me.clickSourceClick.bind2(me));\r\n }\r\n me.container = me.context.querySelector(me.options.elements.containerSelector);\r\n me.messageInput = me.context.querySelector(me.options.elements.textboxSelector);\r\n me.autoCompleteInput = me.context.querySelector('#txtAutocompleteInput');\r\n me.messageInputContainer = me.context.querySelector(me.options.elements.inputContainerSelector);\r\n me.handlerImageSelector = me.context.querySelector(me.options.elements.handlerImageSelector);\r\n me.participantsSelector = me.context.querySelectorAll(me.options.elements.participantsSelector);\r\n me.minimizeButton = me.context.querySelector(me.options.elements.minimizeSelector);\r\n me.popoutButton = me.context.querySelector(me.options.elements.popoutSelector);\r\n me.closeButton = me.context.querySelector(me.options.elements.closeSelector);\r\n me.clickButton = me.context.querySelector(me.options.elements.clickSelector);\r\n me.messagesContainer = me.context.querySelector(me.options.elements.messagesContainerSelector);\r\n me.participantsContainer = me.context.querySelectorAll(me.options.elements.participantsSelector)[0];\r\n me.introContainer = me.context.querySelector(me.options.elements.introSelector);\r\n me.emoticonsArea = me.context.querySelector(me.options.elements.emoticonsAreaSelector);\r\n me.emoticonsButton = me.context.querySelector('.livechat_emoticons_area'); // this should now work for all chat windows\r\n me.multiLanguage_dropdown_wrapper = me.context.querySelector(\r\n me.options.elements.multiLanguage_dropdown_wrapperSelector\r\n );\r\n me.scroller = me.$(me.options.elements.scrollerSelector, me.context);\r\n me.typingIndicator = me.$(me.options.elements.typingIndicatorSelector, me.context);\r\n me.headerDropdown = me.context.querySelector('#apexchat_header_dropdown');\r\n me.actionMenu = me.$(me.options.elements.actionMenuSelector, me.context);\r\n me.restartVAChatActionMenuItem = me.context.querySelector(\r\n me.options.elements.restartVAChatSelector\r\n\r\n );\r\n me.popoutActionMenuItem = me.context.querySelector(me.options.elements.popoutSelector);\r\n me.transferChatActionMenuItem = me.context.querySelector(me.options.elements.transferChatSelector);\r\n me.volumeMuteActionMenuItem = me.context.querySelector(me.options.elements.volumeMuteUnmute);\r\n me.minimizeButton?.addEventListener('click', me.minimize.bind2(me), false);\r\n me.popoutButton?.addEventListener('click', me.popOut.bind2(me));\r\n me.closeButton?.addEventListener('click', me.end.bind2(me));\r\n me.$(me.clickButton, me.context).bind('click', () => {\r\n const autoComplete = me.$(me.autoCompleteInput).is(':visible') ? me.$(me.autoCompleteInput) : null;\r\n me.sendMessage(autoComplete);\r\n });\r\n // Sound Controls\r\n me.soundControl = me.$(me.options.elements.soundControl, me.context);\r\n me.soundMute = me.$(me.options.elements.soundMute, me.context);\r\n me.soundUnmute = me.$(me.options.elements.soundUnmute, me.context);\r\n\r\n // bottom sheet for langauge\r\n me.languageBottomSheet = me.$('.open_bottom_sheet', me.context);\r\n me.smsBottomSheet = me.$('.open_sms_bottom_sheet', me.context);\r\n // ChevronStyle DOM Elements\r\n me.mobileDOM_ChevronChatArrow = me.$(\r\n me.options.elements.mobileDOM_ChevronChatArrow,\r\n me.context\r\n );\r\n // change checkbox selection when visitor click on non textable area -- CHAT-4520\r\n me.$(me.context).on(\r\n 'click',\r\n '.apexchat_question_type_all_that_apply_checkbox',\r\n function (sender) {\r\n me.$(this)\r\n .children(':checkbox')\r\n .prop('checked', !me.$(this).children(':checkbox').is(':checked'));\r\n }\r\n );\r\n me.$(me.messageInput, me.context)\r\n .keydown((e) => {\r\n me.onMessageTyping(e, me.messageInput);\r\n })\r\n .focus(function () {\r\n me.$(this).removeClass('blur');\r\n })\r\n .blur(function () {\r\n me.$(this).addClass('blur');\r\n })\r\n .on('input', (e) => {\r\n const $txt = me.$(me.messageInput, me.context);\r\n me.sendButtonDisableOrEnableForATA($txt);\r\n });\r\n me.$(me.autoCompleteInput, me.context)\r\n .on('keydown', (e) => {\r\n me.onMessageTyping(e, me.autoCompleteInput);\r\n })\r\n .focus(function () {\r\n me.$(this).removeClass('blur');\r\n })\r\n .blur(function () {\r\n me.$(this).addClass('blur');\r\n });\r\n // to bring focus on drop down, restartchat and popout buttons\r\n ManageFocusOnKeyEvents(me.headerDropdown);\r\n ManageFocusOnKeyEvents(me.restartVAChatActionMenuItem);\r\n ManageFocusOnKeyEvents(me.popoutActionMenuItem);\r\n ManageFocusOnKeyEvents(me.transferChatActionMenuItem);\r\n ManageFocusOnKeyEvents(me.volumeMuteActionMenuItem);\r\n // header dropdown menu toggle function\r\n me.$(me.headerDropdown).on('keyup click', (e) => {\r\n // check if button already not selected then do the action\r\n e.stopPropagation();\r\n if (e.type == 'click' || (e.type == 'keyup' && isAcceptKey(e))) {\r\n // check for mouse click or tab and enter key\r\n me.actionMenu.toggle(); // When the user clicks on the header dropdown, the menu item is displayed\r\n }\r\n });\r\n // header dropdown close menu when clicked outside the menu area.\r\n me.$('#apexchat', me.context).on('click', () => {\r\n const element = me.actionMenu;\r\n element.hide();\r\n });\r\n me._countDownInterval = window.setInterval(me.updateCountdown.bind2(me), 1000);\r\n const chatHeaderTemplate =\r\n me.options.chatModel &&\r\n me.options.chatModel.chatHeaderTemplate &&\r\n parseTemplate(me.options.chatModel.chatHeaderTemplate, me.options.model);\r\n const initialChat = chatHeaderTemplate\r\n ? chatHeaderTemplate\r\n : checkSpanishLanguage(me.options)\r\n ? 'Chateando con ' + me.options.model.agentName\r\n : 'Chatting with ' + me.options.model.agentName;\r\n\r\n me.$(me.introContainer, me.context).html(initialChat);\r\n if (checkSpanishLanguage(me.options)) {\r\n setPlaceholder(\r\n me.$('#apexchat_rd_msg_box', me.context),\r\n ScriptsQuestionTypeToolTips.Spa.Text\r\n );\r\n }\r\n // inserting emojis img tags inside a div with the help of div css name.\r\n // Emoticon WORK - start - // inserting emojis img tags inside a div with the help of div css name.\r\n if (me.emoticonsArea) {\r\n // this check avoids inserting emojis twice.\r\n const emoticonContentContainer = me.$(me.emoticonsArea, me.context);\r\n if (emoticonContentContainer.children().length == 0) {\r\n const emojisList = new EmojiUtils().createEmojiList(); // ref. CHAT-3836\r\n if (emojisList.length > 0) {\r\n for (let e = 0; e < emojisList.length; e++) {\r\n emoticonContentContainer.append(emojisList[e]);\r\n }\r\n }\r\n }\r\n\r\n if (me.emoticonsArea && me.emoticonsArea.children.length > 0) {\r\n const children = me.emoticonsArea.children;\r\n\r\n for (let i = 0; i < children.length; i++) {\r\n children[i].addEventListener('click', function (e) {\r\n me.clickEmojis(e);\r\n });\r\n }\r\n }\r\n\r\n if (me.ADAHandler) {\r\n me.ADAHandler(me.emoticonsButton, () => {\r\n me.openEmoticons();\r\n });\r\n }\r\n }\r\n // Emoticon WORK - end\r\n let lastValue = '';\r\n // check for updates every second in the visitor response area\r\n const $txt = me.messageInput;\r\n RunAsSoonAs(\r\n () => {\r\n me.dmp = new diff_match_patch();\r\n },\r\n () => typeof diff_match_patch !== 'undefined'\r\n );\r\n setInterval(() => {\r\n try {\r\n if (me.room) {\r\n const textValue = $txt.value;\r\n if (textValue == $txt.getAttribute('title')) {\r\n return;\r\n }\r\n if (textValue != lastValue) {\r\n const text1 = lastValue;\r\n const text2 = textValue\r\n lastValue = textValue;\r\n const diff = me.dmp.diff_main(text1, text2, true);\r\n if (diff.length > 2) {\r\n me.dmp.diff_cleanupSemantic(diff);\r\n }\r\n const patch_list = me.dmp.patch_make(text1, text2, diff);\r\n const patch_text = me.dmp.patch_toText(patch_list);\r\n me.room.sendVisitorRealtimeTyping(patch_text, false);\r\n }\r\n }\r\n } catch (e) {\r\n console.log(e);\r\n }\r\n }, 1000);\r\n // JIRA_2908 - START - Recent response should appear\r\n if (me.options.model.isMobile) {\r\n me.$(me.options.model.textboxSelector, me.context).focus(() => {\r\n window.setTimeout(() => {\r\n me.autoScroll(); // specifically for mobile devices.\r\n }, 600); // delaying 600ms because keyboard takes time to appear without delay autoscroll was not working before keyboard appearance\r\n });\r\n } // JIRA_2908 - END\r\n // hide the disclaimer if it's empty\r\n me.$(`${me.options.model.disclaimerSelector}:empty`, me.context).hide();\r\n // JIRA_2905 - START - Sound indicator for incoming messages\r\n // summary: This is the function which hide/shows the sound icon button + It also binds their click events.\r\n // bind Sound Controls\r\n if (!storageAPIExists(TempCache.CHAT_SOUND_ENABLED)) {\r\n ApexChat.storageAPI.Store(TempCache.CHAT_SOUND_ENABLED, true);\r\n }\r\n if (getStorageAPIValue(TempCache.CHAT_SOUND_ENABLED) == 'false') {\r\n me.soundMute.hide();\r\n me.soundUnmute.show();\r\n }\r\n me.$(me.soundControl, me.context).click(() => {\r\n if (getStorageAPIValue(TempCache.CHAT_SOUND_ENABLED) == 'true') {\r\n me.soundMute.hide();\r\n me.soundUnmute.show();\r\n ApexChat.storageAPI.Store(TempCache.CHAT_SOUND_ENABLED, false);\r\n } else {\r\n me.soundMute.show();\r\n me.soundUnmute.hide();\r\n ApexChat.storageAPI.Store(TempCache.CHAT_SOUND_ENABLED, true);\r\n }\r\n });\r\n // Capturing User's Touch Event For the sake of enabling the Sound Permission on mobile/tablet devices.\r\n let hasUserGrantedSoundPermission = false;\r\n me.$('#apexchat', me.context).on('touchstart', () => {\r\n if (!hasUserGrantedSoundPermission) {\r\n hasUserGrantedSoundPermission = true;\r\n const soundName =\r\n Cookies.get(VISITOR_MESSAGE_SOUND.name) ||\r\n VISITOR_MESSAGE_SOUND.tune;\r\n me.playSound(soundName);\r\n }\r\n });\r\n // JIRA_2905 - END\r\n // JIRA_2953 - START - display disclaimer above the initial greeting and below header\r\n // Summary: checking newly added disclaimer if its empty then just hide it.\r\n if (!me.options.model.headerDisclaimer || me.options.model.headerDisclaimer.trim() == '') {\r\n // Added .trim() So if someone used 'Blank Spaces' this condition will catch it and will not show the header disclaimer\r\n me.$('.apexchat_headerdisclaimer', me.context).hide();\r\n } // JIRA_2953 - END\r\n setTimeout(() => {\r\n me.$(me.messageInput, me.context).focus();\r\n me.$(me.autoCompleteInput, me.context).focus();\r\n }, 50);\r\n this.subscribe('chatui-message-arrived', () => {\r\n if (!me.ADAHandler) {\r\n return;\r\n }\r\n // we can apply custom logic here onMessageArrived\r\n // logIt('messageArrived');\r\n const elements = me.$('.apexchat_auto_genned_message_wrapper', me.context);\r\n\r\n for (let i = 0; i < elements.length; i++) {\r\n me.ADAHandler(elements[i]);\r\n }\r\n });\r\n if (me.ADAHandler) {\r\n me.applyADAonEmojis(me.ADAHandler); // this should work for all chat windows\r\n }\r\n }\r\n\r\n showChatLog() {\r\n const me = this;\r\n me.$(me.options.elements.messagesContainerSelector, me.context).show();\r\n me.autoScroll();\r\n }\r\n\r\n hideChatLog() {\r\n const me = this;\r\n // CHAT - 8646 The input field gets unlocked after a page refresh\r\n // (DISCARDED) : Preventvisitorresponse area disbale was introduced due to prevent the flikering on textarea\r\n // incase of refresh. Now noticed that the issue has been resolved and no more producing the flikering effect.\r\n\r\n // me.$.preventVisitorResponseAreaDisabling = true;\r\n me.$(me.options.elements.messagesContainerSelector, me.context).hide();\r\n // while loading chat if operation get disruppted due to an error,\r\n // it will automatically show the chatLog of loaded content after 5seconds\r\n RunAfter(() => {\r\n me.showChatLog();\r\n }, 5000);\r\n }\r\n\r\n hidePokeMessages() {\r\n const me = this;\r\n logIt('destroying poke messages controller, etc....');\r\n if (me.POKE_MESSAGE_CONTROLLER && me.POKE_MESSAGE_CONTROLLER.view) {\r\n const overlay = me.context.querySelector(\r\n me.POKE_MESSAGE_CONTROLLER.view.overLayTargetElementSelector\r\n );\r\n removeClass(overlay, me.POKE_MESSAGE_CONTROLLER.view.overlayDisplayClass);\r\n me.POKE_MESSAGE_CONTROLLER = null; // just destroy this object to make room for next nbrand new one\r\n const isDisabled = me\r\n .$(me.messageInputContainer, me.context)\r\n .find('textarea')\r\n .prop('disabled');\r\n if (me.messageInputContainer && me.messageInputContainer.length && !isDisabled) {\r\n // focus text area\r\n if (!Browser.isiOS()) {\r\n // Do not focus the input in iOs case because keyboard is not showing but reposition function executed\r\n // which is producing flickering effect in UI\r\n me.$(me.messageInputContainer, me.context).find('textarea').trigger('focus');\r\n }\r\n }\r\n }\r\n }\r\n\r\n showPokeMessages(m) {\r\n // popup poke overlay and show poke messages when arrived\r\n const me = this;\r\n if (!me.POKE_MESSAGE_CONTROLLER) {\r\n let overlay_options;\r\n const is_RD_EP =\r\n me.widget === WidgetTypes.EPUIController;\r\n if (me.isEPChatClosed()) {\r\n return; // no active EP chat, no poke (re-fixed: Bug/CHAT-8678)\r\n }\r\n if (is_RD_EP) {\r\n overlay_options = {\r\n context: me.context,\r\n\r\n identifier: 'apexChat_ep_poke_overlay_container',\r\n overLayTargetElementSelector: '#apexChat_ep_poke_overlay_container',\r\n overLayTemplate:\r\n epPokeOverlayTemplate,\r\n\r\n messageContainer: 'apexchat_ep_poke_msg_container',\r\n messageTargetElementSelector: '#apexchat_ep_poke_msg_container',\r\n messageTemplate:\r\n epPokeMessageTemplate,\r\n btnBackSelector: '#apexChat_ep_poke_btn',\r\n overlayDisplayClass: 'apexChat_ep_poke_overlay_show'\r\n };\r\n } else {\r\n // RD DOM?\r\n overlay_options = {\r\n context: me.context,\r\n\r\n identifier: 'apexChat_poke_overlay_container',\r\n overLayTargetElementSelector: '#apexChat_poke_overlay_container',\r\n overLayTemplate:\r\n domPokeOverlayTemplate,\r\n\r\n messageContainer: 'apexchat_poke_msg_container',\r\n messageTargetElementSelector: '#apexchat_poke_msg_container',\r\n messageTemplate:\r\n domPokeMessageTemplate,\r\n\r\n btnBackSelector: '#apexChat_poke_btn',\r\n overlayDisplayClass: 'apexChat_poke_overlay_show'\r\n };\r\n }\r\n me.POKE_MESSAGE_CONTROLLER = new PokeMessagesUIController({\r\n model: new PokeMessageModel({\r\n overLayModel: {\r\n userResponseText: \"Yes, I'm back\"\r\n }\r\n }),\r\n view: new PokeMessageView(overlay_options)\r\n });\r\n // me.POKE_MESSAGE_CONTROLLER.show();//trigger the overlay if not shown on top of messages area\r\n }\r\n m.msgTimeStamp = m.createdOn.toLocaleTimeString([], {\r\n hour: '2-digit',\r\n minute: '2-digit'\r\n });\r\n me.POKE_MESSAGE_CONTROLLER.addPokeMessage(m); // which should show/append a new message in the poke message overlay\r\n if (me.messageInputContainer && me.messageInputContainer.length) {\r\n // blur text area just in case it in focus\r\n me.$(me.messageInputContainer, me.context).find('textarea').trigger('blur');\r\n }\r\n }\r\n\r\n applyADAonEmojis(handleADA) {\r\n const me = this;\r\n const emojiDiv = me.emoticonsArea;\r\n if (emojiDiv && emojiDiv.length > 0) {\r\n // TODO: simplify this using jquery later\r\n const { children } = emojiDiv[0];\r\n if (children.length > 0) {\r\n for (let i = 0; i < children.length; i++) {\r\n handleADA(children[i], me.clickEmojis.bind2(me), me.closeEmoticons.bind2(me));\r\n }\r\n }\r\n }\r\n }\r\n\r\n openEmoticons(e) {\r\n if (this.$(this.emoticonsArea).hasClass('livechat_emoticons_area_content_active')) {\r\n this.$(this.emoticonsArea).removeClass('livechat_emoticons_area_content_active');\r\n } else {\r\n this.$(this.emoticonsArea).addClass('livechat_emoticons_area_content_active');\r\n }\r\n // this.$(this.emoticonsArea).css({ display: 'inline', right: 0, bottom: 0 });\r\n }\r\n\r\n closeEmoticons(e) {\r\n this.$(this.emoticonsArea).css({ display: 'none' });\r\n }\r\n\r\n handleFullTextType(options) {\r\n const me = this;\r\n let res;\r\n let cb;\r\n let isSkippable;\r\n res = options && options.res;\r\n cb = options && options.cb;\r\n isSkippable = res && res.isSkipped;\r\n if (isSkippable === true) {\r\n me.skipFullTextType(res);\r\n return;\r\n }\r\n // make sure Chat Is Active and In Progress before sending the message to Websync\r\n if (!me.isChatActive() && !me.QTRendererExt.isLastFullTextValidated) {\r\n return; // we won't come here ever; just a dbl safety\r\n }\r\n me.room.sendMessage({\r\n isForAIBot: ApexChat.options.aiBotEnabled,\r\n chatMsg: res.msgText,\r\n isGreeting: res.isGreeting,\r\n shouldRenderResponseAsText: true,\r\n questionTypeChatLogIdToBeUpdated: res.questionTypeChatLogIdToBeUpdated,\r\n questionType: res.questionType || '',\r\n onSuccess() {\r\n // on success of websync publish\r\n logIt('FT::publishing FT...');\r\n me.room.publishQuestionTypeResponse(res, cb);\r\n }\r\n });\r\n }\r\n\r\n skipFullTextType(res) {\r\n const me = this;\r\n me.room.publishQuestionTypeResponse(res);\r\n }\r\n\r\n /**\r\n * simulated predefined message after selection of QT.\r\n * @param {} msg - Message Object\r\n */\r\n simulatePredefinedResponse(msg) {\r\n const me = this;\r\n if (!ApexChat.IsShowDisclaimeOverlay && me.options.shouldShowLocationDisclaimer) {\r\n ApexChat.IsShowDisclaimeOverlay = true;\r\n me.showDisclaimerOverlay(me.options.locationDisclaimerText);\r\n }\r\n if (msg.shouldRenderResponseAsText) {\r\n // only simulate those message which allow render as text\r\n me.onMessageArrived({\r\n id: msg.predefinedMessageId || GlobalVariables.predefinedMessageId, // check the predefined message id exists into the object if not execute old scenario\r\n userId: ParticipantIds.visitor,\r\n createdOn: new Date(),\r\n participantDisplayName: 'Visitor',\r\n text: msg.msgText,\r\n allowDupe: false,\r\n participantId: ParticipantIds.visitor,\r\n showTime: true // show time for simulated message\r\n });\r\n me.isPredefinedResponse = true; // set flag true for upcoming response message.\r\n me.QTRendererExt.questionTypeRenderer.afterMCSelectionRD(msg); // for MC selection.\r\n me.postMessage({\r\n event: ChatEvents.OnTypingArrived,\r\n value: { indicator: true }\r\n }); // show typing after simulated message.\r\n }\r\n }\r\n\r\n handleQuestionType(res, isFromPreChat) {\r\n const me = this;\r\n logIt('handleQuestionType:');\r\n logIt(res);\r\n if (res.isExitPopupPredefinedMessage) {\r\n me.handleExitPopupPredefinedQT(res, isFromPreChat);\r\n return;\r\n }\r\n if ((!res.msgText || (res.msgText.trim && !res.msgText.trim())) && !res.isSkipped) {\r\n // when msg text is empty we must not send it to server\r\n return;\r\n }\r\n if (!res.isSkipped) {\r\n // CHAT-3069\r\n me.showTyptingIndicatorForAIBot(me);\r\n me.room.sendMessage({\r\n isForAIBot: ApexChat.options.aiBotEnabled,\r\n chatMsg: res.msgText,\r\n isGreeting: res.isGreeting,\r\n shouldRenderResponseAsText: res.shouldRenderResponseAsText,\r\n questionTypeChatLogIdToBeUpdated: res.questionTypeChatLogIdToBeUpdated,\r\n isPredefinedResponse: !!res.isPredefinedResponse,\r\n contactInfo: res.contactInfo || '',\r\n textContactInfo: res.textContactInfo || '',\r\n questionType: res.questionType || '',\r\n timeCalendarOrText: res.timeCalendarOrText || false,\r\n onSuccess() {\r\n // on success of websync publish\r\n me.room.publishQuestionTypeResponse(res);\r\n // Set the visitor selection of question type\r\n if (me.QTRendererExt.questionTypeRenderer.renderer) {\r\n res.visitorSelectedOptions = res.answers;\r\n res.questionType =\r\n me.QTRendererExt.questionTypeRenderer.renderer.model.questionType;\r\n res.questionTypeDisplayListForVisitor =\r\n me.QTRendererExt.questionTypeRenderer.renderer.model.questionTypeDisplayListForVisitor;\r\n res.id = res.chatLogId;\r\n me.QTRendererExt.questionTypeRenderer.setVisitorSelection(res);\r\n if (me.options && !me.options.enableFullTextLogic) {\r\n // check is RD or not\r\n me.QTRendererExt.setInstruction(me.getQTPlaceHolder());\r\n }\r\n }\r\n if (isFromPreChat) {\r\n setTimeout(() => {\r\n me.maximize();\r\n if (\r\n me.state.getStateValue(WidgetTypes.PreChat) ===\r\n WidgetStates.Hidden\r\n ) {\r\n me.QTRendererExt.questionTypeRenderer.afterSubmit();\r\n } else {\r\n me.QTRendererExt.questionTypeRenderer.afterSubmit();\r\n me.QTRendererExt.questionTypeRenderer.hideAll();\r\n }\r\n res.isFromPreChat = isFromPreChat;\r\n // CHAT-7045 - If DOM minimized & prechat has appeared now agent sends TRUE/FALSE we need to handle the selection, DOM should be able to retain the selection.\r\n res.questionType === ScriptsQuestionType.TrueOrFalse &&\r\n me.QTRendererExt.questionTypeRenderer.renderSelection(res);\r\n }, 100);\r\n }\r\n },\r\n callback() { } // after sending msg to dashboard do something\r\n });\r\n } else {\r\n // marked, visitor skip that question\r\n me.room.publishQuestionTypeResponse(res);\r\n }\r\n }\r\n\r\n async injectQuestionTypeRenderer() {\r\n /**\r\n * questionType rendered to initialize question type when needed.\r\n */\r\n const me = this;\r\n const preloadOptions = ApexChat.preLoadedOptions || me.getPreloadedOptionsStorage();\r\n if (!me.QTRendererExt) {\r\n me.QTRendererExt = new QuestionTypeRendererExtentions();\r\n if (preloadOptions) {\r\n preloadOptions.aiBotEnabled = ApexChat.options.aiBotEnabled;\r\n }\r\n await me.QTRendererExt.initComponent(\r\n Object.assign(Object.assign(me.options, preloadOptions), {\r\n context: me.context,\r\n isUpdateSupported: true,\r\n sendButton: me.clickButton,\r\n messagesContainer: me.messagesContainer,\r\n isBottomSheetSupported:\r\n (me.widget == WidgetTypes.DOMUIController ||\r\n me.widget == WidgetTypes.EPUIController),\r\n applyNewDateTime: true,\r\n enableFullTextLogic:\r\n (me.widget === WidgetTypes.DOMUIController ||\r\n me.widget == WidgetTypes.EPUIController), // . CHAT-7137 - We need this FullText Logic for DOM & EP\r\n widgetType:\r\n me.widget == WidgetTypes.DOMUIController\r\n ? WidgetTypes.DOM\r\n : WidgetTypes.ExitPopup,\r\n inputContainer: me.messageInputContainer\r\n\r\n })\r\n );\r\n }\r\n }\r\n\r\n getPreloadedOptionsStorage() {\r\n // summary: To get preload options from local storage when ApexChat.preLoadedOptions is not available\r\n // below scenario is done due to DOM refresh case. It's looses question type template, So we get it from local storage available at first time.\r\n let preloadedOptionsStorage = null;\r\n if (\r\n !ApexChat.preLoadedOptions &&\r\n localstorageAPIExists('livechat_preloaded_options')\r\n ) {\r\n logIt('Inside apexchat_preloaded_options');\r\n preloadedOptionsStorage = ApexChat.TryParse(\r\n ApexChat.localStorageAPI.Get('livechat_preloaded_options')\r\n );\r\n }\r\n return preloadedOptionsStorage;\r\n }\r\n\r\n showChatRestartOverlay() {\r\n const me = this;\r\n if (!me.restartOverlayView) {\r\n // rare scenario\r\n return;\r\n }\r\n const elOverlay = me.restartOverlayView.getContainer();\r\n if (elOverlay && me.restartOverlayView.isViewRendered()) {\r\n // view previously rendered? just show it\r\n me.$(elOverlay, me.context).show();\r\n } else {\r\n me.restartOverlayView.render(); // is it v 1st time?\r\n }\r\n }\r\n\r\n showVideoGreetOverlay() {\r\n const me = this;\r\n const elOverlay = me.videoGreetOverlayView?.getContainer();\r\n if (elOverlay && me.videoGreetOverlayView.isViewRendered()) {\r\n // view previously rendered? just show it\r\n me.$(elOverlay, me.context).show();\r\n } else {\r\n me.videoGreetOverlayView.render(); // is it v 1st time?\r\n }\r\n }\r\n\r\n isOperatorAvailable(message) {\r\n const me = this;\r\n const showOperatorOverlay = Cookies.get(TempCache.SHOW_OPERATOR_NOT_FOUND_OVERLAY);\r\n if (message.text === ApexChat.operatorNotAvailableMessage) {\r\n if (me.isPageRefreshed() && showOperatorOverlay === 'false') {\r\n return true;\r\n }\r\n me.showOperatorNotFoundOverlay();\r\n return true;\r\n }\r\n if (showOperatorOverlay === 'true') {\r\n me.showOperatorNotFoundOverlay();\r\n }\r\n }\r\n\r\n isChatTransferredToOperator(m) {\r\n const me = this;\r\n if (m.text === ApexChat.chatTransferSuccussMessage) {\r\n me.postMessage({\r\n event: ChatEvents.OnChatTransferredToOperator,\r\n data: m\r\n });\r\n }\r\n }\r\n\r\n showOperatorNotFoundOverlay(m) {\r\n const me = this;\r\n if (!me.agentNotFoundOverlayView) {\r\n // rare scenario\r\n return;\r\n }\r\n const elOverlay = me.agentNotFoundOverlayView.getContainer();\r\n if (elOverlay && me.agentNotFoundOverlayView.isViewRendered()) {\r\n // view previously rendered? just show it\r\n me.$(elOverlay, me.context).show();\r\n } else {\r\n me.agentNotFoundOverlayView.render(); // is it v 1st time?\r\n }\r\n }\r\n\r\n showChatEndedNotificationBar() {\r\n var me = this;\r\n var wrapper = document.createElement('div');\r\n me.optInConsentTaken = false;\r\n me.showOverlayWithAction(wrapper, me.getEndChatSessionHtml(wrapper), function () {\r\n RunAsSoonAs(\r\n function () {\r\n me.$('#apexchat_reinit_chat', me.context).addClass(\r\n 'apexchat_optin_concent_show'\r\n );\r\n },\r\n function () {\r\n return me.$('#apexchat_reinit_chat', me.context).is(':visible');\r\n }\r\n );\r\n //event binding\r\n me.context.querySelector('.apexchat_closebtn').addEventListener('click', function () {\r\n //CHAT-7520 removing overlay from DOM & windowed mode.\r\n me.hideReInitOverlay('#apexchat_reinit_chat');\r\n enableTypingInput.bind2(me)(me, me.options.inputContainer); //after reInit chat typing input feild is enabled.\r\n });\r\n me.ADAHandler(\r\n me.context.querySelector('.apexchat_closebtn'),\r\n me.hideReInitOverlay.bind2(me, '#apexchat_reinit_chat')\r\n );\r\n me.ADAHandler(me.context.querySelector('.apexchat_new_chat_start'), function () {\r\n me.reInitializeChat();\r\n });\r\n me.context.querySelector('.apexchat_new_chat_start').addEventListener('click', function () {\r\n me.reInitializeChat();\r\n });\r\n });\r\n }\r\n\r\n hideReInitOverlay(overlay) {\r\n const me = this;\r\n if (overlay) {\r\n if (me.widget == WidgetTypes.EPUIController) {\r\n // CHAT-8737 V3 - NonRD: Cross icon of ended chat overlay is not functional\r\n me.$(overlay, me.context).hide();\r\n me.$(overlay, me.context).parent().removeClass('livechat_reinit_show')\r\n } else {\r\n me.$(overlay, me.context).remove();\r\n // reset state\r\n me.state.changeState({\r\n toState: ChatStates.UIRendered\r\n });\r\n }\r\n }\r\n }\r\n\r\n // Re-Initializes chat if chat session ended OR if chat restarted\r\n reInitializeChat(currentOverlaySelector, headerMessage) {\r\n const me = this;\r\n me.$(me.options.elements.transferChatSelector, me.context).show();\r\n me.$(me.options.elements.actionMenuStartSMSChat, me.context).show();\r\n me.$(me.options.elements.actionMenuLanguageSwitcher, me.context).show();\r\n me.messagesContainer?.innerHTML = '';\r\n me.participantsContainer?.innerHTML = '';\r\n me.$(currentOverlaySelector || '#apexchat_reinit_chat', me.context).remove();\r\n me.participantsContainer?.style.display = 'block';\r\n me.introContainer?.style.display = 'block';\r\n const initialChat = checkSpanishLanguage(me.options)\r\n ? `Chateando con ${me.options.model.agentName}`\r\n : `Chatting with ${me.options.model.agentName}`;\r\n // me.introContainer?.innerHTML = (headerMessage || initialChat);\r\n me.introContainer?.innerHTML = initialChat;\r\n me._countDownInterval = window.setInterval(me.updateCountdown.bind2(me), 1000);\r\n me.postMessage({\r\n event: (me.objectType || me.options.objectType) + ChatEvents.OnChatReInit\r\n });\r\n }\r\n\r\n getEndChatSessionHtml(wrapperDiv) {\r\n const divHtml = importEndChatOverlaySheetTemplateFactory()?.restartChatTemplate;\r\n wrapperDiv.id = 'apexchat_reinit_chat';\r\n wrapperDiv.className = 'apexchat_overlay apexchat_optin_concent';\r\n return divHtml;\r\n }\r\n\r\n getOptInConsentHtml(wrapperDiv, options) {\r\n const divHtml = importOptinConsentTemplateFactory(options)?.optinConsentTemplate;\r\n wrapperDiv.id = 'livechat_opt_in_consent';\r\n wrapperDiv.className = 'apexchat_overlay apexchat_optin_concent';\r\n return divHtml;\r\n }\r\n\r\n getDisclaimerHtml(wrapperDiv, options) {\r\n const importedFactory = importDesclaimerOverlaySheetTemplateFactory(options);\r\n let divHtml = importedFactory?.desclaimerTemplate;\r\n divHtml += importedFactory?.desclaimerConfirmTemplate;\r\n wrapperDiv.id = 'livechat_disclaimer_consent';\r\n wrapperDiv.className = 'apexchat_overlay apexchat_optin_concent';\r\n return divHtml;\r\n }\r\n\r\n updateCountdown() {\r\n const me = this;\r\n this._ellipses = `${this._ellipses || ''}.`;\r\n if (this._ellipses.length > 4) {\r\n this._ellipses = '.';\r\n }\r\n }\r\n\r\n clickEmojis(event) {\r\n console.log(event); // Debugging log\r\n const me = this;\r\n const currentTarget = event.currentTarget;\r\n\r\n // Get emoji from its ID\r\n const emojiCode = currentTarget.id;\r\n const emoji = new EmojiUtils().toEmoji(emojiCode); // Convert emoji code\r\n\r\n // Function to update input values safely\r\n function appendEmojiToInput(inputField) {\r\n if (!inputField) return;\r\n\r\n let val = inputField.value;\r\n const placeholder = inputField.getAttribute('title');\r\n\r\n // Remove placeholder text if it exists\r\n if (placeholder && val.includes(placeholder)) {\r\n val = val.replace(placeholder, '');\r\n }\r\n\r\n inputField.value = val + emoji; // Append emoji\r\n toggleSendButtonClasses({ e: { target: { value: inputField.value } }, me });\r\n }\r\n\r\n // Apply to both input fields\r\n appendEmojiToInput(me.messageInput);\r\n appendEmojiToInput(me.autoCompleteInput);\r\n\r\n console.log(\"Emoji added to both inputs:\", emoji);\r\n }\r\n\r\n hasScrollbar(elem_id) {\r\n const elem = this.context.getElementById(elem_id);\r\n if (elem.clientHeight < elem.scrollHeight) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n endChat(cb) {\r\n const me = this;\r\n ApexChat.AIResponseReceived = true;\r\n // unsubscribe chatroom channel if exists\r\n if (me.room && me.room.leaveChat && typeof me.room.leaveChat === 'function') {\r\n me.room.leaveChat();\r\n }\r\n if (\r\n me.options &&\r\n me.options.elements &&\r\n me.options.elements.inputContainerSelector &&\r\n me.QTRendererExt\r\n ) {\r\n me.QTRendererExt.enableTypingInput();\r\n setPlaceholder(\r\n me.context.querySelector(me.options.elements.inputContainerSelector),\r\n checkSpanishLanguage(me.options)\r\n ? ScriptsQuestionTypeToolTips.Spa.Text\r\n : ScriptsQuestionTypeToolTips.Eng.Text\r\n );\r\n }\r\n me.stopPredefinedQueue = false; // CHAT-8677 clear global variable when new chat start\r\n me.hasAnswerInQTChatLogIdToBeUpdated = false; // CHAT-8677 clear global variable when new chat start\r\n me.options.chatId = 0;\r\n ApexChat.options.chatEnded = true;\r\n me.removeSMSToWebNotification();\r\n me.onChatEnded(cb);\r\n }\r\n\r\n // ex. endDOMChatSession\r\n endChatSession() {\r\n // This is the common code to end dom chat session\r\n const me = this;\r\n this.hide();\r\n me.endChat();\r\n }\r\n\r\n /*\r\n * WebSync event handlers\r\n */\r\n stopWaiting() {\r\n window.clearTimeout(ApexChat.waitedTooLongTimeout);\r\n this.waiting = false;\r\n }\r\n\r\n resetWaiting() {\r\n this.stopWaiting();\r\n this.startWaiting();\r\n }\r\n\r\n getRequestedTime() {\r\n const domStartedAt =\r\n this.options.chatMode == ChatMode.DOM\r\n ? ApexChat.options._domStartTime\r\n : fromQueryString('cb') * 1;\r\n return domStartedAt;\r\n }\r\n\r\n startWaiting() {\r\n // if we have a wait timer, and we're not already waiting\r\n const me = this;\r\n if (me.options.apologizeForWaitAfter) {\r\n me.waiting = true;\r\n // message from the visitor - start watching\r\n // this should clear any previous timeout as well\r\n window.clearTimeout(ApexChat.waitedTooLongTimeout);\r\n ApexChat.waitedTooLongTimeout = window.setTimeout(() => {\r\n if (!me.hasEnded()) {\r\n const msg = me.options.apologizeForWaitMessage || \"I'm sorry, just one moment.\";\r\n me.onMessageArrived({\r\n id: -1 * new Date().getTime(),\r\n // anything greater than 0 works here, we're just telling the visitor anyway\r\n userId: TempCache.FAKE_AGENT_ID,\r\n createdOn: new Date(),\r\n participantDisplayName: me.options.agentName,\r\n allowDupe: true,\r\n text: msg\r\n });\r\n const data = {\r\n text: msg,\r\n participantId: -1,\r\n userId: TempCache.FAKE_AGENT_ID,\r\n participantDisplayName: me.options.agentName\r\n };\r\n fm.websync.client.publish({\r\n retries: 0,\r\n meta: me.getMeta(),\r\n channel: `/chatroom/${me.options.chatId}`,\r\n data,\r\n onSuccess(args) {\r\n // nothing\r\n }\r\n });\r\n }\r\n }, me.options.apologizeForWaitAfter * 1000);\r\n }\r\n }\r\n\r\n onTypingArrived(args, self) {\r\n const me = this;\r\n\r\n const indicator = me.typingIndicator;\r\n if (args && args.indicator) {\r\n me.showTyping();\r\n me.stopWaiting();\r\n } else if (indicator) {\r\n me.hideTyping();\r\n }\r\n // me.postMessage({ event: ChatEvents.OnTypingArrived, data: args.indicator });\r\n me.state.changeState({\r\n origin: me.objectType || me.options.objectType,\r\n toState: ChatEvents.OnTypingArrived,\r\n value: args.indicator\r\n });\r\n }\r\n\r\n onChatEnded(cb) {\r\n const me = this;\r\n // me.introContainer.html('The chat session has ended.');\r\n // me.introContainer.show();\r\n me.participantsContainer?.style.display = 'none';\r\n // chat ends, always clear the timer\r\n window.clearInterval(this._countDownInterval);\r\n this._ended = true;\r\n const cookieHandler = new ChatCookieHandler();\r\n cookieHandler.DeleteCookie();\r\n me.$(me.options.elements.transferChatSelector, me.context).hide();\r\n me.$(me.options.elements.actionMenuStartSMSChat, me.context).hide();\r\n me.$(me.options.elements.actionMenuLanguageSwitcher, me.context).hide();\r\n // me.state.changeState({ toState: ChatStates.Ended, value: true });\r\n // stop typing indicator when chat ended.\r\n me.onTypingArrived({ indicator: false });\r\n if (cb && typeof cb === 'function') {\r\n cb();\r\n }\r\n }\r\n\r\n onCallStatusArrived(args) {\r\n const indicator = me.$(this.options.callIndicatorSelector);\r\n if (args.status == 1 || args.status == 2 || args.status == 3) {\r\n indicator.show();\r\n } else {\r\n indicator.hide();\r\n }\r\n /* window.setTimeout(function () {\r\n // after 10 seconds, hide the indicator if it's still visible\r\n indicator.hide();\r\n }, 10000); */\r\n }\r\n\r\n onParticipantsChanged(participants) {\r\n const me = this;\r\n const config = ParticipantsChanged(participants, {\r\n $: me.$,\r\n options: this.options,\r\n hideWaitingIndicator: this.hideWaitingIndicator,\r\n participantsHasBeenGreaterThanOne: this._participantsHasBeenGreaterThanOne,\r\n ended: this._ended,\r\n isExitPopup: this.mode == WidgetTypes.ExitPopup,\r\n userTitleSelector: this.$(this.options.elements.agentTitle, this.context),\r\n imageObjSelector:\r\n this.mode == WidgetTypes.ExitPopup\r\n ? this.$('.Apex-agentImage', this.context)\r\n : this.$(this.handlerImageSelector),\r\n participantsContainer: this.participantsContainer\r\n });\r\n this.options = config.options;\r\n this.participantsContainer = config.participantsContainer;\r\n }\r\n\r\n afterSMSChatTransfer() {\r\n const me = this;\r\n disableTypingInput.bind2(me)(me,\r\n me.options.elements.inputContainerSelector,\r\n '...'\r\n );\r\n me.hideTyping(); // CHAT-7884 hide typing indicator when chat has been transferred successfully\r\n // idel out current chat room\r\n me.postMessage({\r\n event: WidgetTypes.ChatRoom + ChatEvents.ChatIdleOut\r\n });\r\n }\r\n\r\n /**\r\n * renders SMS Chat Transfer UI and ends current DOM chat\r\n * @param {any} m: system message\r\n */\r\n renderUIOnChatTransfer(m) {\r\n const me = this;\r\n\r\n const notifications = {\r\n transferStatus: 'Chat is being transferred to SMS...',\r\n transferStatusUpdate:\r\n 'Your chat has been transferred; please check your phone for the text from our specialist.'\r\n };\r\n if (m && m.systemMessageType == SystemMessageType.SMSTransferInProgress) {\r\n // notifications.transferStatus = m.text;//uncomment when server message is to be shown\r\n } else if (m && m.systemMessageType == SystemMessageType.SMSTransferred) {\r\n // notifications.transferStatusUpdate = m.text;//uncomment when server message is to be shown\r\n } else {\r\n return; // on invalid status, bail out\r\n }\r\n\r\n const transferChatUI = new SimpleView({\r\n context: me.context,\r\n identifier: `apexchat_transferChat_ui_${m.id}`,\r\n template: me.options.smsTransferChatUI,\r\n model: notifications,\r\n classes: [\r\n 'apexchat_auto_genned_message_wrapper',\r\n 'agent_message',\r\n 'apexchat_message_left'\r\n ],\r\n wrap: true,\r\n targetElementSelector: me.options.elements.messagesContainerSelector,\r\n afterRender() {\r\n const transferringContainer = this.getContainer().children[0];\r\n const transferredContainer = this.getContainer().children[1];\r\n const elStatusToShow =\r\n m.systemMessageType == SystemMessageType.SMSTransferInProgress\r\n ? transferringContainer\r\n : transferredContainer;\r\n const elStatusToHide =\r\n m.systemMessageType == SystemMessageType.SMSTransferInProgress\r\n ? transferredContainer\r\n : transferringContainer;\r\n // play show/hide when transferring:\r\n // hide transfer complete UI and show transfer in progress UI\r\n showElement(elStatusToShow);\r\n hideElement(elStatusToHide);\r\n me.afterSMSChatTransfer();\r\n // and show transfer complete UI\r\n setTimeout(() => {\r\n showElement(elStatusToHide);\r\n hideElement(elStatusToShow);\r\n }, TempCache.SMS_TRANSFER_CHAT_DELAY * 1000);\r\n }\r\n });\r\n me.autoScroll();\r\n }\r\n\r\n showTyping(args) {\r\n const me = this;\r\n // logIt('typing arrived:' + args);\r\n me.typingIndicator.html(`${me.options.model.agentName} is typing...`);\r\n me.typingIndicator.show();\r\n }\r\n\r\n hideTyping(args) {\r\n const me = this;\r\n if (me.mode == WidgetTypes.ExitPopup) {\r\n me.typingIndicator.html('');\r\n } else {\r\n me.typingIndicator.hide();\r\n }\r\n }\r\n\r\n predefinedMsgsOnRefresh(m, msg, index) {\r\n const me = this;\r\n m.text = msg;\r\n m.participantDisplayName = me.options.model.agentName;\r\n me.preserveChatArray.push({ index, predefinedMsgs: msg });\r\n me.onMessageArrived(m);\r\n }\r\n\r\n predefinedMsgs(m, msgDuration, msg, index) {\r\n const me = this;\r\n if (me.totalDuration === undefined) {\r\n me.totalDuration = msgDuration;\r\n } else {\r\n me.totalDuration += msgDuration;\r\n }\r\n setTimeout(() => {\r\n if (!me.isUserTyping) {\r\n me.showTyping();\r\n } else {\r\n me.hideTyping();\r\n }\r\n }, msgDuration * 700);\r\n setTimeout(() => {\r\n me.hideTyping();\r\n if (!me.isUserTyping) {\r\n if (Cookies.get(WidgetTypes.ExitPopup) != WidgetStates.Closed) {\r\n // CHAT-9756 Visitors won't hear the EP messages sound after closing the widget.\r\n const soundName =\r\n Cookies.get(VISITOR_MESSAGE_SOUND.name) ||\r\n VISITOR_MESSAGE_SOUND.tune;\r\n me.playSoundEPPredefinedMessage(soundName); // JIRA_2491 - EP Predefined messages comes with sound.\r\n }\r\n msg = removeTextFollowedByColon(msg);\r\n\r\n m.text = msg;\r\n m.participantDisplayName = me.options.model.agentName;\r\n me.preserveChatArray.push({\r\n index,\r\n predefinedMsgs: msg,\r\n answerScript: m.answerScript,\r\n agentParticipantId: ParticipantIds.predefined,\r\n userId: UserIds.simulated,\r\n participantDisplayName: me.options.agentName || me.options.model.agentName,\r\n delayTime: msgDuration\r\n });\r\n m.text = removeTextFollowedByColon(m.text);\r\n const messageInterval = me.options.model.questionTypeDelay * 1000; // set default interval\r\n const PipedMessageHandlerSingleton = new PipedMessageHandler();\r\n if (\r\n PipedMessageHandlerSingleton.isValidPipedMessage({\r\n m\r\n })\r\n ) {\r\n logIt(`RDEP::processing piped${m.text}`);\r\n PipedMessageHandlerSingleton.startPolling({\r\n init() {\r\n me.postMessage({\r\n event: ChatEvents.OnTypingArrived,\r\n value: { indicator: true }\r\n });\r\n },\r\n async startPollingCallback(m) {\r\n logIt(`RDEP::startPollingCallback:${m.text}`);\r\n\r\n me.postMessage({\r\n event: ChatEvents.OnMessageArrived,\r\n value: {\r\n m,\r\n initialLoad: false,\r\n index\r\n }\r\n });\r\n me.postMessage({\r\n event: ChatEvents.OnTypingArrived,\r\n value: { indicator: true }\r\n });\r\n },\r\n lastPollingCallback(args) {\r\n logIt(`RDEP::lastPollingCallback:${args.m.text}`);\r\n me.postMessage({\r\n event: ChatEvents.OnTypingArrived,\r\n value: { indicator: false }\r\n });\r\n me.postMessage({\r\n event: ChatEvents.OnMessageArrived,\r\n value: {\r\n m,\r\n initialLoad: false,\r\n index\r\n }\r\n });\r\n },\r\n messageDisplayDuration: messageInterval\r\n });\r\n } else {\r\n me.onMessageArrived(m);\r\n }\r\n if (m.isLastPredefinedMessage) {\r\n // when last predefined message shown start poke message job.\r\n me.postMessage({\r\n event: ChatEvents.OnPredefinedCompleted\r\n });\r\n }\r\n }\r\n }, msgDuration * 1000);\r\n }\r\n\r\n renderMultiLanguageDropDown(config) {\r\n const me = this;\r\n me.nonSMSLanguages = [];\r\n const supportedLanguages = me.options.model.supportedLanguagesList;\r\n if (supportedLanguages.length > 1) {\r\n function getNonSMSAndScriptLanguages(languages) {\r\n const isSMSOrScriptBasedLanguage =\r\n languages.languageFullName.toLowerCase().indexOf('sms') == -1 &&\r\n languages.languageFullName.toLowerCase().indexOf('script bot') == -1;\r\n return isSMSOrScriptBasedLanguage;\r\n }\r\n me.nonSMSLanguages = supportedLanguages.filter(getNonSMSAndScriptLanguages);\r\n me.implementMultiLanguageSupport(config);\r\n } else if (me.options.model && me.options.model.supportedLanguagesList.length === 1) {\r\n // if there is only scriptbot language selected in company then we should hide language dropdown\r\n function getScriptBotLanguages(languages) {\r\n return languages.languageFullName.toLowerCase() == 'english script bot';\r\n }\r\n me.scriptBotLanguage = supportedLanguages.filter(getScriptBotLanguages);\r\n me.implementMultiLanguageSupport(config);\r\n } else if (me.multiLanguage_dropdown_wrapper) {\r\n hideElement(me.multiLanguage_dropdown_wrapper[0]);\r\n }\r\n }\r\n\r\n requestTransferringChat(config) {\r\n const me = this;\r\n const chatId = getStorageAPIValue(TempCache.CHAT_ID_COOKIE) || 0;\r\n if (chatId > 0) {\r\n me.requestTransferringChatToOtherLanguage(chatId, me.options.language);\r\n }\r\n }\r\n\r\n requestTransferringChatToOtherLanguage(chatId, lang) {\r\n const me = this;\r\n me.isOpen = true;\r\n const reqUrl = `${GlobalVariables.LiveChatServiceUrl}Services/ApexChatUtilityService.svc/chats/${chatId}/status`;\r\n // if (this.chatEventsHandler.checkChatRoomExists(reqUrl)) {\r\n me.requestAgentForTransferChat();\r\n // }\r\n }\r\n\r\n requestAgentForTransferChat() {\r\n const me = this;\r\n if (me.room) {\r\n languageTransferRequest(\r\n GlobalVariables.LiveChatServiceUrl,\r\n me.$.ajax,\r\n me.options.chatModel.chatId,\r\n me.chatLanguageName || me.options.language\r\n );\r\n }\r\n }\r\n\r\n async enableChatTransfer(chatId) {\r\n const me = this;\r\n const module = await import(/* webpackChunkName: \"chatTransfer\" */ './ChatTransfer')\r\n const ChatTransfer = module.default;\r\n me.chatTransfer = new ChatTransfer({\r\n webSyncClient: me.room.webSyncClient,\r\n chatId,\r\n onTransferRequested(arg) {\r\n me.requestAgentForTransferChat();\r\n },\r\n onTransferSuccess(args) {\r\n if (!args.data) {\r\n me.postMessage({\r\n event: ChatEvents.onOperatorNotAvailable,\r\n data: { message: 'operator is not available' }\r\n });\r\n }\r\n }\r\n });\r\n return me.chatTransfer;\r\n }\r\n\r\n queuePredefinedQTs(m) {\r\n const me = this;\r\n me.isPredefinedMsgsRendered = true;\r\n m = Object.assign(m, {\r\n agentParticipantId: ParticipantIds.predefined, // CHAT-6370 predefined participantId -4\r\n userId: UserIds.simulated,\r\n isExitPopupPredefinedMessage: true\r\n });\r\n const predefinedMsgArray = ApexChat.options.exitpopup.exitPopupMessages;\r\n const _queueMessage = function () {\r\n if (me.stopPredefinedQueue) {\r\n return;\r\n }\r\n const nextPredefinedMessage = predefinedMessagesQueue.dequeue();\r\n if (nextPredefinedMessage) {\r\n // CHAT-8530 Uncaught TypeError in the console - check for undefined value\r\n const predefinedMessage = Object.assign(nextPredefinedMessage, {\r\n agentParticipantId: ParticipantIds.predefined, // CHAT-6370 predefined participantId -4\r\n isExitPopupPredefinedMessage: true,\r\n participantDisplayName: me.options.model.agentName,\r\n id: nextPredefinedMessage.id, // CHAT-8519 Timestamp doesn't appear after 1st Plain Text pre-defined response on RD EP.\r\n userId: TempCache.EP_PREDEFINED_AGENT_ID,\r\n createdOn: new Date(),\r\n isPredefinedMsg: true,\r\n isPageRefreshed: me.isPageRefreshed()\r\n });\r\n // CHAT-7942 : If predefined message is QT & NOT None-Type then it should considered as QT, render QT-None as Plain-Text.\r\n me.accumulatedTime = me.accumulatedTime || 0;\r\n me.accumulatedTime =\r\n getCookieValue('apexchat_exitpopup_predefined_messages_rendered') ===\r\n 'true' && m.isPageRefreshed\r\n ? 0\r\n : predefinedMessage.duration;\r\n predefinedMessage.duration = me.accumulatedTime;\r\n if (predefinedMessage.isLastPredefinedMessage) {\r\n // exit popup last message render then insert true in cookie\r\n Cookies.set('apexchat_exitpopup_predefined_messages_rendered', true);\r\n }\r\n if (\r\n predefinedMessage.messageType === QTGridMessageType.agent_Script &&\r\n predefinedMessage.questionType != ScriptsQuestionType.None\r\n ) {\r\n me.stopPredefinedQueue = true;\r\n me.renderPredefinedQTs(predefinedMessage);\r\n } else {\r\n me.renderPredefinedQTs(predefinedMessage);\r\n }\r\n }\r\n };\r\n var predefinedMessagesQueue = new Queue();\r\n for (let i = 0; i < predefinedMsgArray.length; i++) {\r\n predefinedMsgArray[i].isPredefinedMessage = true;\r\n if (i == predefinedMsgArray.length - 1) {\r\n predefinedMsgArray[i].isLastPredefinedMessage = true;\r\n }\r\n predefinedMessagesQueue.enqueue(predefinedMsgArray[i]);\r\n }\r\n _queueMessage();\r\n me.subscribe('predefined-message-completed', () => {\r\n _queueMessage();\r\n });\r\n }\r\n\r\n renderPredefinedQTs(m) {\r\n let message = m;\r\n const me = this;\r\n if (message.messageType === QTGridMessageType.agent_Script) {\r\n message = Object.assign(m, {\r\n scriptAnswerId: m.agentScriptAnswerId,\r\n options: m.agentScript?.agentScriptOptions,\r\n questionType: m.agentScript.questionType,\r\n messagePlaceholder: m.agentScript.messagePlaceholder,\r\n visitorResponseType: m.agentScript.visitorResponseType,\r\n visitorResponseTypes: m.agentScript.visitorResponseTypes,\r\n answerScript: m.agentScript\r\n });\r\n message.answerScript = Object.assign(m.answerScript, {\r\n agentScriptAnswerId: m.scriptAnswerId\r\n });\r\n }\r\n me.predefinedMsgs(m, m.duration, m.message, m.order);\r\n }\r\n\r\n renderPredefinedMessages(m) {\r\n const me = this;\r\n me.isPredefinedMsgsRendered = true;\r\n const countingArray = ['Primary', 'Secondary', 'Third', 'Fourth', 'Fifth'];\r\n let msgDuration = 0;\r\n for (let i = 0; i < countingArray.length; i++) {\r\n const msgVar = `popup${countingArray[i]}Message`;\r\n const msgNo = `popup${countingArray[i]}Duration`;\r\n let msg = me.options.model.exitpopup[msgVar];\r\n msgDuration += me.options.model.exitpopup[msgNo];\r\n if (msg) {\r\n // FogBugs [2283] - Typing Indicator issue was resolved by adding\r\n msg = parseTemplate(msg, me.options.model);\r\n if (!m.isPageRefreshed) {\r\n me.predefinedMsgs(m, msgDuration, msg, i);\r\n } else {\r\n // Render predefined messages in page refresh case\r\n me.predefinedMsgsOnRefresh(m, msg, i);\r\n }\r\n }\r\n }\r\n }\r\n\r\n checkArrayDuplication(array, msg, property) {\r\n let i = array.length;\r\n while (i--) {\r\n if (array[i][property] === msg || array[i][property] === decodeHTML(msg)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n publishPredefinedMessages(callback) {\r\n const me = this;\r\n let lastPredefinedMsg = null;\r\n // Introduced \"Batch\" for sending multiple published messages in a sequence.\r\n // source: https://docs.frozenmountain.com/websync4/#class=websync-code-snippets-batching-data\r\n me.room.startBatch();\r\n logIt(`EP::CHAT:: ABOUT TO publish...${JSON.stringify(me.preserveChatArray)}`);\r\n me.isPreDefinedMessagesSent = true;\r\n for (var i = 0, j = 0; i < me.preserveChatArray.length; i++) {\r\n if (me.preserveChatArray[i].delayTime !== undefined && i > 0) {\r\n me.totalDuration -= me.preserveChatArray[i].delayTime;\r\n }\r\n var message = {\r\n isForAIBot: ApexChat.options.aiBotEnabled,\r\n chatMsg: me.preserveChatArray[i].predefinedMsgs || me.preserveChatArray[i].text,\r\n agentParticipantId: me.preserveChatArray[i].agentParticipantId, // CHAT-6370 predefined participantId -4\r\n userId: me.preserveChatArray[i].userId || UserIds.visitor,\r\n answerScript: me.preserveChatArray[i].answerScript,\r\n\r\n isPredefinedResponse: me.preserveChatArray[i].isPredefinedResponse,\r\n createdOn: me.preserveChatArray[i].createdOn,\r\n participantId: me.preserveChatArray[i].participantId,\r\n participantDisplayName: me.preserveChatArray[i].participantDisplayName,\r\n delayTime: me.totalDuration,\r\n onSuccess(args) {\r\n ++j;\r\n if (args && args.userId != ParticipantIds.pokeMessage) {\r\n lastPredefinedMsg = args;\r\n }\r\n if (j == me.preserveChatArray.length) {\r\n // run callback only after last predefined msg has been published\r\n args =\r\n me.preserveChatArray[me.preserveChatArray.length - 1].userId ===\r\n ParticipantIds.pokeMessage\r\n ? lastPredefinedMsg\r\n : args;\r\n // If last message is poke message then we need to send the last predefined message instead of poke message\r\n me.preserveChatArray = []; // clear\r\n if (callback && typeof callback === 'function') {\r\n callback.bind2(me)(args);\r\n }\r\n }\r\n },\r\n onFailure(args) {\r\n }\r\n }\r\n me.room.sendMessage(message);\r\n }\r\n me.room.endBatch();\r\n }\r\n\r\n async onMessageArrived(m, initialLoad, index, lastSplitMsgCallback) {\r\n const me = this;\r\n if (m.questionType >= 0 &&\r\n m.questionType != ScriptsQuestionType.FullText &&\r\n m.questionType != ScriptsQuestionType.None &&\r\n m.questionType != ScriptsQuestionType.VideoGreet\r\n ) {\r\n me.$(\".apexchat_rd_input_wrapper\", me.context).addClass(\"livechat_is_current_qt_msg\");\r\n } else { // if (!m.questionType && m.participantId > 0) this comment to be removed\r\n me.$(\".apexchat_rd_input_wrapper\", me.context).removeClass(\"livechat_is_current_qt_msg\");\r\n }\r\n if (m.errorMessage) {// this is only active in conversational bot case only\r\n console.log(m.errorMessage);\r\n }\r\n if (m.scriptAnswerId) {\r\n Cookies.set('lastMessageAnswerId', m.scriptAnswerId);\r\n }\r\n if (m.isAIBotReply) {\r\n ApexChat.AIResponseReceived = true;\r\n }\r\n const isSystemMessage = m.systemMessageType == SystemMessageType.SMSOptIn || m.questionType == ScriptsQuestionType.WebToSMSNotification;\r\n m.text = ApexChat.options\r\n ? parseTemplate(\r\n removeTextFollowedByColon(decodeHTML(m.text)),\r\n ApexChat.options\r\n )\r\n : parseTemplate(\r\n removeTextFollowedByColon(decodeHTML(m.text)),\r\n me.options\r\n );\r\n if (\r\n m.participantId == ParticipantIds.pokeMessage &&\r\n me.isChatActive()\r\n ) {\r\n /* HANDLE POKE MESSAGE FOR RD THEME ONLY */\r\n me.postMessage({\r\n event: WidgetTypes.PokeMessagesOverLay + ChatEvents.OnPokeMessageArrived,\r\n data: { m }\r\n });\r\n // We need to notify MessageQueue that message is handled and proceed further for next message\r\n me.notifyMessageHandled(m);\r\n return false;\r\n }\r\n if (m.participantId === -1) {\r\n me.$('.live_chat_scheduler_bg', me.context).each(function (index) {\r\n me.$(this).disable({ applyGrayBackground: true });\r\n });\r\n }\r\n me.isChatTransferredToOperator(m);\r\n // if CHAT transfer from script bot to livechat we need to enable text field CHAT-7919\r\n if (\r\n !me.isTransferredToLiveAgent() &&\r\n m.userId === ParticipantIds.system &&\r\n m.systemMessageType === SystemMessageType.TransferToLiveAgent\r\n ) {\r\n me.setTransferredToLiveAgent();\r\n }\r\n // Donot continue further if the text is empty and chat message is from visrtual assistant (Lumin)\r\n if (!m.text && m.virtualAssistantStatus > 0) {\r\n return;\r\n }\r\n /* checking if message text contain invalid html then correct and replace message with correct one */\r\n m.text = cleanInvalidHtml(m.text);\r\n // if userId is null then something went wrong\r\n // if userId is -6 (non visitor system message), it means this message is not supposed to show to visitor\r\n if (\r\n m.userId == null ||\r\n m.userId == ParticipantIds.nonVisitorSystem ||\r\n me.isOperatorAvailable(m)\r\n ) {\r\n // We need to notify MessageQueue that message is handled and proceed further for next message\r\n me.notifyMessageHandled(m);\r\n return;\r\n }\r\n if (m.shouldShowChatEndedMessage) {\r\n m.text = GlobalVariables.CHAT_ENDED_MESSAGE;\r\n }\r\n // [EP] - Predefined msgs - START\r\n if (\r\n !m.isPredefinedMsg &&\r\n me.checkArrayDuplication(me.preserveChatArray, m.text, 'predefinedMsgs') &&\r\n me.mode == WidgetTypes.ExitPopup\r\n ) {\r\n // We need to notify MessageQueue that message is handled and proceed further for next message\r\n me.notifyMessageHandled(m);\r\n return;\r\n }\r\n // If message is predefined response we need to return it because we have already shown it.\r\n if (m.isPredefinedResponse) {\r\n me.postMessage({\r\n event: ChatEvents.OnTypingArrived,\r\n value: { indicator: false }\r\n });\r\n return;\r\n }\r\n // CHAT-7226 Next Mapped Question Logic Change\r\n // as option property removed from backend now we explicity add option property to our msg.options object,\r\n // because all QT UI depend upon that property.\r\n if (m.questionType != ScriptsQuestionType.None && m.options) {\r\n m.options = addOptionProperty(m.options);\r\n }\r\n // JIRA_4190 - PreChat msgs got repeated if chat is minimized\r\n // summary: we are not rendering the String text Answer of QuestionType because we have some UI to show Tick of user selected options.\r\n // So, we have three conditions to be TRUE for not to render QuesntionType Answer,\r\n // 1- Dont Render IF the message is QuestionType reply from USER\r\n // 2- initialLoad should be false, this flag indicate that the chat is from History used in refresh scenarios, In this case we need the string text of QuestionType Answer from USER to be rendered.(JIRA_4190 for more explanation)\r\n // 3- The DOM should not be minimized because If DOM would be minimized means PreChat would be appeared and If Agent sends a QuestionType msg and User answers it than we want it to be rendered.(JIRA_4190 for more explanation)\r\n if (/*! initialLoad && */ m.options == 'QuestionTypeAnswer') {\r\n // We need to notify MessageQueue that message is handled and proceed further for next message\r\n me.notifyMessageHandled(m);\r\n return;\r\n }\r\n // show chat popout icon in case of chat mode is windowed\r\n if (\r\n m.chatId &&\r\n m.chatId > 0 &&\r\n me.options.elements.popoutSelector &&\r\n me.options.chatMode != ChatMode.DOM\r\n ) {\r\n me.$(me.options.elements.popoutSelector, me.context).show();\r\n }\r\n // questionTypeResponseChatLogId is ChatLog of the Last Answer of QT which is to be replaced with New Answer\r\n // therefore, it has to be removed from UI before appending new Answer\r\n const tracker = new TimeTracker()\r\n tracker.check('v3/messageArrived/Greeting');\r\n if (m.questionTypeResponseChatLogId && m.questionTypeResponseChatLogId > 0) {\r\n const lastLogMessage = me.$(\r\n `#apexchat_chatlog_${m.questionTypeResponseChatLogId}`,\r\n me.context\r\n );\r\n logIt(`>>>${lastLogMessage}`);\r\n if (lastLogMessage) {\r\n me.$(lastLogMessage).parent().remove();\r\n }\r\n }\r\n\r\n // CHAT-5829-Quick Reply Message unclickable\r\n // save last msg id to compare with last questiontypeid available to make last message clickable\r\n let lastMsgId = ApexChat.storageAPI.Get('lastMsgId');\r\n if (m.isChatEnded) {\r\n // disable all previous QT's if chat ended\r\n var questionTypeId = ApexChat.storageAPI.Get('questionTypeId');\r\n var isLastMsgWasQType = parseInt(lastMsgId) === parseInt(questionTypeId);\r\n if (isLastMsgWasQType) {\r\n me.QTRendererExt &&\r\n me.QTRendererExt.questionTypeRenderer &&\r\n me.QTRendererExt.questionTypeRenderer.afterSubmit();\r\n }\r\n }\r\n /** CHAT-6049-QR-Greeting Message\r\n * to see if its a first message and no lastmsgId available inside cookies,\r\n * because when we refresh page method rerun all messages , so lastMsgId is already filled that means that msg already appeared */\r\n const isGreetingMessageQuestionType = me.isGreetingQuestionType(m, index); // check is greeting message is a question type\r\n\r\n logIt(`isGreetingMessageQuestionType:${isGreetingMessageQuestionType}`);\r\n /*\r\n * first conditon is that if new message arrived its index is undefined and userId equals to 0 or greater then 0 so we consider it a new message and put in our lastmsgid when\r\n * pages refreshed every message comes with its index which means that its just loading messages so lastmsgid will not get updated when page refresh,\r\n * for second conditon isGreetingMessageQuestionType just check first greeting message is question type then add it on lastmsgid, so its accessible after refresh\r\n third and fourth conditions are to update lastMsgId if the chat is transferred because previously it's making QR clickable (in later condition at line no. 2938) even after chat transfer via menu or dashboard CHAT-9753 */\r\n if (\r\n (!initialLoad && !index && m.userId >= 0) ||\r\n isGreetingMessageQuestionType ||\r\n SystemMessageType.TransferToLiveAgent == m.systemMessageType ||\r\n SystemMessageType.Default == m.systemMessageType\r\n ) {\r\n // add to lastmsgid if new message arrived or greeting message is question type\r\n lastMsgId = m.id || 0;\r\n ApexChat.storageAPI.Store('lastMsgId', lastMsgId);\r\n }\r\n var questionTypeId = ApexChat.storageAPI.Get('questionTypeId');\r\n var isLastMsgWasQType = parseInt(lastMsgId) === parseInt(questionTypeId); // compare if our last message is question type then after refresh it should be clickable\r\n if (\r\n !m.questionTypeResponseChatLogId &&\r\n !m.isFromPreChat &&\r\n questionTypeId &&\r\n m.id != -1 &&\r\n !isLastMsgWasQType &&\r\n !(m.participantId === ParticipantIds.bot)\r\n ) {\r\n // m.participantId !== -2 /*stop executing for System messages coming in refresh scenario: _All visitors have left the chat_*/\r\n if (me.QTRendererExt && me.QTRendererExt.questionTypeRenderer && !isSystemMessage) {\r\n me.QTRendererExt.questionTypeRenderer.afterSubmit();\r\n ApexChat.storageAPI.Remove('questionTypeId', questionTypeId);\r\n }\r\n }\r\n // [EP] - Predefined msgs - END\r\n // m.text = ApexChat.convertCodeToEmoji(m.text);\r\n m.text = new EmojiUtils().parse(m.text); // ref. CHAT-3836\r\n // me.onTypingArrived({ indicator: false });\r\n const initialArgs = arguments;\r\n me.exitMessage = false;\r\n // if a message is coming in due to the auto greet flag or due to agent pick up of chat, but this is not the first message from an agent, then skip it\r\n if (\r\n m.userId == TempCache.AUTOGREET_AGENT_ID ||\r\n (m.isGreeting && !TempCache.IS_GREETING_QUESTIONTYPE && !m.isSplitMessage)\r\n ) {\r\n me.$('.apexchat_message .apexchat_text', me.messagesContainer, me.context).each(\r\n function () {\r\n if (\r\n me.$(this, me.context).parent().hasClass('apexchat_agent') ||\r\n (me.$(this, me.context).parent().parent() &&\r\n me.$(this, me.context).parent().parent().hasClass('apexchat_agent'))\r\n ) {\r\n {\r\n me.exitMessage = true;\r\n // exit from each\r\n }\r\n }\r\n }\r\n );\r\n }\r\n if (me.exitMessage) {\r\n // We need to notify MessageQueue that message is handled and proceed further for next message\r\n me.notifyMessageHandled(m);\r\n return;\r\n }\r\n const handleMessage = async (m) => {\r\n m.id = m.id || 0;\r\n m.createdOn = m.createdOn || null;\r\n if (me.options.model.aiBotEnabled && !me.options.model.botGuid && m.questionType === ScriptsQuestionType.FullText) {\r\n m.questionType = ScriptsQuestionType.Text\r\n m.visitorResponseTypes = `[${m.visitorResponseType}]`\r\n }\r\n // avoid duplicate messages\r\n if (me.$(me.options.elements.chatLogSelectorPrefix + m.id, me.context).length) {\r\n // We need to notify MessageQueue that message is handled and proceed further for next message\r\n me.notifyMessageHandled(m);\r\n return;\r\n }\r\n if (m.participantDisplayName == 'Visitor' || !m.participantDisplayName) {\r\n me.options.participantDisplayName = m.participantDisplayName;\r\n m.participantDisplayName = 'You';\r\n if (!ApexChat.IsShowDisclaimeOverlay && me.options.shouldShowLocationDisclaimer) {\r\n ApexChat.IsShowDisclaimeOverlay = true;\r\n me.showDisclaimerOverlay(me.options.locationDisclaimerText);\r\n }\r\n } else if (\r\n m.participantDisplayName != 'You' &&\r\n !m.isChatEnded &&\r\n !me.isPageRefreshed() &&\r\n m.participantId != ParticipantIds.system\r\n ) {\r\n // added a check for system message i-e -1, so agentname is not displayed instead of 'system' in v3.\r\n // In chat refresh case if multiple user participant work on chat. The actual participant name should display\r\n m.participantDisplayName = me.options.agentName || me.options.model.agentName;\r\n }\r\n // If found predefined or prechat message it means the first message has arrived.\r\n // CHAT-7321 if message is split message set firtMessageArrived so later irrelevant setTimeout will not apply as we used for first message\r\n if (\r\n (m.userId == UserIds.simulated &&\r\n m.participantId == ParticipantIds.predefined) ||\r\n m.participantId == ParticipantIds.prechat ||\r\n m.isSplitMessage ||\r\n m.questionType === ScriptsQuestionType.VideoGreet\r\n ) {\r\n me.firstMessageArrived = true;\r\n }\r\n // test to exclude visitorinfo form text\r\n const visitorInfoTest = /^\\(via Submit Form [a-zA-Z]+\\)/gi;\r\n if (typeof String.prototype.trim !== 'function') {\r\n String.prototype.trim = function () {\r\n return this.replace(/^\\s+|\\s+$/g, '');\r\n };\r\n }\r\n if (visitorInfoTest.test(m.text)) {\r\n if (/^\\(via Submit Form Message\\)/gi.test(m.text)) {\r\n m.text = m.text.substring(m.text.indexOf(')') + 1).trim();\r\n } else {\r\n return false;\r\n }\r\n }\r\n if (me.clickButton && me.$(me.clickButton).isDisabled()) {\r\n me.$(me.clickButton).enable({ applyGrayBackground: false });\r\n }\r\n let officeMessageTemplate = null; // we will set this only when the agent's message is office hours\r\n if (m.userId != 0) {\r\n // not visitor's msg\r\n // detect company hours and convert raw text into well-formatted html\r\n const officeHrsValidationResult = isMessageCompanyHours(m.text); // validate 1st\r\n if (officeHrsValidationResult.result) {\r\n if (me.mode == WidgetTypes.ExitPopup) {\r\n officeMessageTemplate =\r\n epOfficeHoursMessageTemplate;\r\n } else {\r\n officeMessageTemplate = domOfficeHoursMessageTemplate; /* for DOM */\r\n }\r\n // make the parsed message template as message's html not text\r\n m.html = parseCompanyHours(\r\n m.text,\r\n officeHrsValidationResult,\r\n true\r\n );\r\n }\r\n }\r\n let content;\r\n if (me.mode == WidgetTypes.ExitPopup) {\r\n m.cssClass =\r\n m.participantDisplayName == 'You'\r\n ? 'user'\r\n : m.participantDisplayName == 'System'\r\n ? 'system'\r\n : 'bot';\r\n if (!m.html) {\r\n if (!m.handlerImageUrl) {\r\n m.handlerImageUrl = me.options.model?.handlerImageUrl;\r\n }\r\n\r\n content = ImportEPTemplateFactory().exitPopupMessageTemplate(m);\r\n } else {\r\n content = officeMessageTemplate(m);\r\n }\r\n\r\n } else {\r\n if (!m.html) {\r\n if (m.questionType !== ScriptsQuestionType.ContinueChat) {\r\n m.handlerImageUrl = AgentImageHandler(me.options.handlerImageUrl);\r\n content = createMessageTemplateFactory(m).domMessageTemplate;\r\n }\r\n } else {\r\n content = officeMessageTemplate(m);\r\n }\r\n }\r\n logIt(`CH::content\\n${content}`);\r\n // [Exitpopup]: It is to set CSS Class for Exit Popup predefined messages.\r\n if (\r\n m.participantId == ParticipantIds.bot &&\r\n m.participantDisplayName == me.options.model.agentName\r\n ) {\r\n content = content.replace('apexchat_visitor', 'apexchat_agent');\r\n content = content.replace('apexchat_rd_sent', 'apexchat_rd_received');\r\n content = content.replace('apexchat_rd_float_right', 'apexchat_rd_float_left');\r\n }\r\n let dupe = false;\r\n // remove any html tags before comparison\r\n const html = m.text;\r\n var div = document.createElement('div');\r\n div.innerHTML = html;\r\n let text = div.textContent || div.innerText;\r\n // replace any non numeric or non alphabetic characters\r\n text = text.replace(TempCache.REMOVE_NON_ALPHANUMERIC, '');\r\n // index will tell us the index of the message if it already exists\r\n // only allow duplicate messages from agents if they are consecutive as an agent may ask severl times: Is there anything else I can helo you with....\r\n if (Browser.isIE8()) {\r\n var index = arrayObjectIndexOf(\r\n me.$('.apexchat_message .apexchat_text', me.messagesContainer, me.context),\r\n text,\r\n 'innerText'\r\n );\r\n } else {\r\n var index = arrayObjectIndexOf(\r\n me.$('.apexchat_message .apexchat_text', me.messagesContainer, me.context),\r\n text,\r\n 'textContent'\r\n );\r\n }\r\n me.$('.apexchat_message .apexchat_text', me.messagesContainer, me.context).each(\r\n function () {\r\n // greeting should not be repeated no matter what\r\n if (index == 0) {\r\n if (\r\n me\r\n .$(this, me.context)\r\n .text()\r\n .replace(TempCache.REMOVE_NON_ALPHANUMERIC, '') == text\r\n ) {\r\n if (\r\n me.$(this, me.context).parent().hasClass('apexchat_agent') &&\r\n m.userId != 0\r\n ) {\r\n dupe = true;\r\n } else if (\r\n me.$(this, me.context).parent().parent() &&\r\n me\r\n .$(this, me.context)\r\n .parent()\r\n .parent()\r\n .hasClass('apexchat_agent') &&\r\n m.userId != 0\r\n ) {\r\n dupe = true;\r\n }\r\n }\r\n }\r\n if (index > 0) {\r\n // do not allow duplicates only in they occur consecutively\r\n if (\r\n me.$(this).text().replace(TempCache.REMOVE_NON_ALPHANUMERIC, '') ==\r\n text &&\r\n index ==\r\n me.$(\r\n '.apexchat_message .apexchat_text',\r\n me.messagesContainer,\r\n me.context\r\n ).length -\r\n 1\r\n ) {\r\n if (\r\n me.$(this, me.context).parent().hasClass('apexchat_agent') &&\r\n m.userId != 0\r\n ) {\r\n dupe = true;\r\n } else if (\r\n me.$(this, me.context).parent().parent() &&\r\n me\r\n .$(this, me.context)\r\n .parent()\r\n .parent()\r\n .hasClass('apexchat_agent') &&\r\n m.userId != 0\r\n ) {\r\n dupe = true;\r\n }\r\n }\r\n }\r\n }\r\n );\r\n if (!me.options.model.aiBotEnabled && dupe && !m.allowDupe /* && m.userId != FAKE_AGENT_ID */) {\r\n // We need to notify MessageQueue that message is handled and proceed further for next message\r\n me.getNotifyMessageHandler.call(me, m);\r\n return;\r\n }\r\n if (m.userId == -2) {\r\n // We need to notify MessageQueue that message is handled and proceed further for next message\r\n me.notifyMessageHandled(m);\r\n // \"bot\" messages, ignored by visitor\r\n return;\r\n }\r\n // the message came from an agent\r\n if (\r\n m.userId != 0 &&\r\n !getCookieValue(TempCache.APEXCHAT_PRECHAT_MESSAGE_SENT_COOKIE)\r\n ) {\r\n // if this is the first message from an agent, we have a special condition;\r\n // the first message is auto-sent, but we don't want it to *appear* auto-sent\r\n // so, we'll hold this message momentarily, showing the typing indicator\r\n if (!me.firstMessageArrived && me.options.isNewChat) {\r\n logIt('DELAY::INITIAL_DELAY_AGENT_PICKUP::OUT');\r\n me.firstMessageArrived = true;\r\n if (me.options.model.agentName) {\r\n me.onTypingArrived({\r\n indicator: true,\r\n participantDisplayName: me.options.model.agentName\r\n });\r\n } else {\r\n me.onTypingArrived({\r\n indicator: true,\r\n participantDisplayName: m.participantDisplayName\r\n });\r\n }\r\n\r\n window.setTimeout(() => {\r\n logIt('DELAY::INITIAL_DELAY_AGENT_PICKUP::IN');\r\n\r\n me.onTypingArrived({ indicator: false });\r\n me.onMessageArrived.apply(me, initialArgs);\r\n }, me.INITIAL_DELAY_AGENT_PICKUP);\r\n // TODO: test\r\n me.state.changeState({\r\n origin: me.objectType,\r\n toState: ChatStates.GreetingShown\r\n });\r\n return;\r\n }\r\n window.clearInterval(me._countDownInterval);\r\n }\r\n // for operator chats, me.options.agentName will be blank,so hideWaitingIndicator will not be called\r\n // waiting Indicator will be hidden through 'onParticipantsChanged'\r\n if (me.options.model.agentName) {\r\n me.hideWaitingIndicator(`Visitor, ${me.options.model.agentName}`);\r\n }\r\n // create the actual message contents and display\r\n var div = document.createElement('div');\r\n // div.id = this.options.chatLogSelectorPrefix + m.id;\r\n let msgType = '';\r\n let isVisitorResponse = false;\r\n if (m.userId === ParticipantIds.system) {\r\n msgType = 'system_message apexchat_message_left';\r\n } else if (m.userId === ParticipantIds.visitor) {\r\n msgType = 'vistor_message apexchat_message_right';\r\n isVisitorResponse = true;\r\n } else if (m.userId > 0 || m.userId === ParticipantIds.prechat) {\r\n msgType = 'agent_message apexchat_message_left';\r\n }\r\n ApexChat.VisitorResponse = isVisitorResponse;\r\n div.className = `apexchat_auto_genned_message_wrapper ${msgType}`;\r\n div.id = `apexchat_message_container_${msgType}`;\r\n div.setAttribute('chatlogid', m.id);\r\n me.chatLogArray = me.chatLogArray || [];\r\n me.chatLogArray.push({\r\n id: m.id,\r\n isVisitorResponse\r\n });\r\n div.tabIndex = 0;\r\n // Ref. CHAT-6860: We always need a handler now; not just for QT - hence removed the if-block\r\n // if (!me.questionTypeRenderer && m.questionType != ScriptsQuestionType.None) {\r\n await me.injectQuestionTypeRenderer(); // when message is question type, we need to inject questiontype Renderer\r\n // possible error scenario except for RD/EP predefined msgs\r\n // }\r\n logIt(`visitorResponseType:${m.visitorResponseType}`);\r\n if (!isSystemMessage && m.userId != 0) {\r\n var cb =\r\n m.questionType !== ScriptsQuestionType.FullText\r\n ? me.handleQuestionType.bind2(me)\r\n : me.handleFullTextType.bind2(me);\r\n //set respnse callback as before; but different way\r\n me.QTRendererExt.questionTypeRenderer.options.responseCallback = cb;\r\n }\r\n me.QTRendererExt.questionTypeRenderer.options.createChatRoom =\r\n me.createChatRoom.bind2(me);\r\n me.QTRendererExt.questionTypeRenderer.options.isChatroomAlive = me.isChatroomAlive.bind2(me);\r\n me.QTRendererExt.questionTypeRenderer.options.loadChatRoom = me.loadChatRoom.bind2(me);\r\n me.QTRendererExt.questionTypeRenderer.options.enableChatTransferCallback =\r\n me.enableChatTransfer.bind(me);\r\n me.QTRendererExt.questionTypeRenderer.options.showOperatorNotAvailableOverlayCb =\r\n me.showOperatorNotFoundOverlay.bind(me);\r\n me.QTRendererExt.questionTypeRenderer.options.afterFlatPickerLoaded = function () {\r\n me.autoScroll();\r\n };\r\n logIt(\r\n `isGreetingMessageQuestionType:${isGreetingMessageQuestionType}:${m.text}`\r\n );\r\n const _playSound = function (conditions) {\r\n if (conditions) {\r\n // after the first load, flash the title and play a sound\r\n return me.notifyNewMessageArrived.bind2(\r\n me,\r\n m.isSplitMessage || m.questionType > 0\r\n ); // JIRA_2905 - Play sound only for agent message. (Its cookie based for visitor-end incoming sound) and notifyMessage was using Dashboard sound cookie)\r\n }\r\n };\r\n const soundOnLastPipeMessage = m.isSplitMessage && m.isLastSplitMessage; // CHAT-8290- Play sound only on last message of pipe.\r\n m.beepAfterRender = _playSound(\r\n (!m.isSplitMessage || soundOnLastPipeMessage) &&\r\n ((!initialLoad && m.userId != 0) ||\r\n (initialLoad && m.userId == TempCache.SIMULATED_AGENT_ID))\r\n );\r\n\r\n m.isDocument = m.isDocument || (m.agentScript && m.agentScript.isDocument);\r\n m.agentScriptDocuments = m.agentScriptDocuments || (m.agentScript && m.agentScript.agentScriptDocuments);\r\n const mqtMeta = {\r\n meta: {\r\n instruction: m.messagePlaceholder\r\n ? m.messagePlaceholder\r\n : me.QTRendererExt.inputTitle,\r\n isFullText: false\r\n },\r\n msg: m\r\n };\r\n if (\r\n ((m.isAIBotReply || m.scriptAnswerId > 0) &&\r\n (m.questionType != ScriptsQuestionType.None || (m.agentScriptDocuments && (!m.isSplitMessage || m.isLastSplitMessage))) &&\r\n m.questionType !== ScriptsQuestionType.FullText) ||\r\n m.questionType === ScriptsQuestionType.AppointmentScheduler\r\n ) {\r\n // m.isLastSplitMessage: No typing indicator and delay required.\r\n if (\r\n m.questionType == ScriptsQuestionType.MultipleChoiceConsent &&\r\n m.isUnread\r\n ) {\r\n me.showOptInConsentOverlay(m);\r\n }\r\n\r\n // m.isLastSplitMessage: No typing indicator and delay required.\r\n else if (\r\n m.isLastSplitMessage ||\r\n ApexChat.shouldContinueMapping ||\r\n m.shouldRenderWithDelay\r\n ) {\r\n // Apply disable when question type is quick reply - DISBALED\r\n if (me.QTRendererExt.questionTypeRenderer.isQuestionTypeOptionsAvailable(m)) {\r\n me.QTRendererExt.questionTypeRenderer.setVersion(\r\n QuestionTypeVersion.RoundedDynamic\r\n );\r\n\r\n m.isGreeting = isGreetingMessageQuestionType;\r\n // pass in a callback: afterRenderMessage\r\n const alreadyMapped = null;\r\n const isContinueMappingApplied = ApexChat.TryParse(\r\n Cookies.get(TempCache.Continue_Mapping_Applied)\r\n );\r\n if (\r\n me.options.chatMode == ChatMode.Windowed &&\r\n !isContinueMappingApplied\r\n ) {\r\n // for windowed mode continue mapping should get from querystring\r\n Cookies.set(TempCache.Continue_Mapping_Applied, true); // if continue mapping already run once we dont need to run again on windowed.\r\n ApexChat.shouldContinueMapping = ApexChat.TryParse(\r\n fromQueryString('shouldContinueMapping')\r\n ); // fetch value of continueMapping from querystring.\r\n }\r\n m.shouldContinueMapping = ApexChat.shouldContinueMapping;\r\n ApexChat.shouldContinueMapping = alreadyMapped;\r\n await me.QTRendererExt.questionTypeRenderer.renderMessage(\r\n m,\r\n me.QTRendererExt.afterRenderMessage.bind2(me.QTRendererExt),\r\n lastSplitMsgCallback\r\n );\r\n }\r\n } else {\r\n logIt('DELAY::me.options.questionTypeDelay::OUT');\r\n\r\n me.onTypingArrived({ indicator: true, participantDisplayName: m.participantDisplayName });\r\n function processOnMessageArrived() {\r\n logIt('DELAY::me.options.questionTypeDelay::IN:' + me.options.questionTypeDelay);\r\n me.onTypingArrived({ indicator: false });\r\n m.shouldRenderWithDelay = true;\r\n me.onMessageArrived.call(me, m, initialLoad, index, lastSplitMsgCallback);\r\n }\r\n // omit timeout on initial load\r\n if (initialLoad) {\r\n processOnMessageArrived();\r\n } else {\r\n window.setTimeout(function () {\r\n processOnMessageArrived();\r\n }, (isGreetingMessageQuestionType ? 0.1 : me.options.questionTypeDelay) * 1000);//we need to literally omit questionTypeDelay in case of a QT greeting \r\n }\r\n return;\r\n }\r\n me.hideTimeStampForPreviousMessages();\r\n me.autoScroll();\r\n me.notifyMessageHandled(m);\r\n } else {\r\n if (m.questionType == ScriptsQuestionType.WebToSMSNotification) {\r\n me.handleWebToSmsNotification(m);\r\n }\r\n const shouldDisplayTypingIndicator = function (m) {\r\n // This is the logical component which will take decison either to show Typing or not\r\n // Show Typig only IF\r\n const shouldBeQTType = m.scriptAnswerId > 0;\r\n const shouldNotBeUserMessage = m.userId !== 0;\r\n const shouldNotBeHistoryMessage = !initialLoad;\r\n const shouldNotBeSplitPipedMessage = !m.isSplitMessage;\r\n const shouldNotBeLastPipedMessage = !m.isLastPipedMessage;\r\n const isQTNone = m.questionType === ScriptsQuestionType.None;\r\n const isQTFullText = m.questionType === ScriptsQuestionType.FullText;\r\n const shouldNotQTNoneFromPreChat = !(isQTNone && m.isFromPreChat);\r\n return (\r\n shouldBeQTType && // IF QTType AND\r\n shouldNotBeUserMessage && // NOT User message AND\r\n shouldNotBeHistoryMessage && // NOT Coming From History (Refresh Scenario) AND\r\n shouldNotBeSplitPipedMessage && // NOT SplitMessage AND (i.e; Piped, we already have shown typing for this)\r\n // (For QT - None |OR| QT - FullText) (ONLY)\r\n shouldNotQTNoneFromPreChat && // Should not be QTNone From PreChat\r\n (isQTNone || isQTFullText)\r\n );\r\n };\r\n if (m.questionType === ScriptsQuestionType.VideoGreet) {\r\n await me.QTRendererExt.questionTypeRenderer.renderMessage(\r\n m,\r\n me.QTRendererExt.afterRenderMessage.bind2(me.QTRendererExt),\r\n lastSplitMsgCallback\r\n );\r\n }\r\n me.showTypingIndicatorThenDisplayMessage({\r\n indicatorDuration: me.options.questionTypeDelay * 1000,\r\n shouldDisplayTypingIndicator: shouldDisplayTypingIndicator(m),\r\n m,\r\n onComplete(cb) {\r\n logIt(`displaying msg:${m.text}`);\r\n // Apply enable when question type is plain text- DISBALED for now\r\n div.innerHTML = decodeHTML(content);\r\n if (m.questionType !== ScriptsQuestionType.VideoGreet && m.questionType != ScriptsQuestionType.WebToSMSNotification) {\r\n me.messagesContainer.append(div);\r\n }\r\n if (m.participantId === ParticipantIds.AIBot) {\r\n me.getLastQuestionTypeForAIbot()\r\n }\r\n\r\n mqtMeta.msg = m;\r\n mqtMeta.cb = lastSplitMsgCallback;\r\n me.QTRendererExt.afterRenderMessage(mqtMeta);\r\n const isContinueMappingApplied = ApexChat.TryParse(\r\n Cookies.get(TempCache.Continue_Mapping_Applied)\r\n );\r\n if (\r\n me.options.chatMode == ChatMode.Windowed &&\r\n !isContinueMappingApplied &&\r\n m.questionType === ScriptsQuestionType.FullText\r\n ) {\r\n Cookies.set(TempCache.Continue_Mapping_Applied, true); // if continue mapping already run once we dont need to run again on windowed.\r\n let fullTextResponse =\r\n fromQueryString('FullTextVisitorResponse'); // for fullText response send from prechat should render on windowed\r\n fullTextResponse = fullTextResponse\r\n ? window.decodeURI(fullTextResponse)\r\n : fullTextResponse; // decoded value from query string to send correct response\r\n ApexChat.FullTextVisitorResponse = ApexChat.TryParse(fullTextResponse); // set FullTextVisitor Response from query string.\r\n }\r\n if (\r\n m.questionType === ScriptsQuestionType.FullText &&\r\n ApexChat.FullTextVisitorResponse\r\n ) {\r\n const FullTextAnswer = ApexChat.TryParse(\r\n ApexChat.FullTextVisitorResponse\r\n )[0].option;\r\n me.QTRendererExt.isLastFullTextValidated = true;\r\n const customRes = {\r\n chatId: m.chatId,\r\n isSkipped: false,\r\n answers: ApexChat.FullTextVisitorResponse,\r\n msgText: FullTextAnswer,\r\n agentScriptAnswerId: m.scriptAnswerId,\r\n chatLogId: m.id,\r\n questionTypeChatLogIdToBeUpdated:\r\n m.questionTypeChatLogIdToBeUpdated || 0\r\n };\r\n me.handleFullTextType({ res: customRes });\r\n\r\n ApexChat.FullTextVisitorResponse = null;\r\n }\r\n if (!m.showTime) {\r\n // Show time by force where needed.\r\n me.hideTimeStampForPreviousMessages();\r\n }\r\n me.autoScroll();\r\n me.getNotifyMessageHandler.call(me, m);\r\n // with this callback parameter we can perform some function after onComplete\r\n if (cb) {\r\n cb();\r\n }\r\n }\r\n });\r\n }\r\n questionTypeId = ApexChat.storageAPI.Get('questionTypeId');\r\n // console.log(questionTypeId);\r\n // scroll to the bottom\r\n if (\r\n (m.scriptAnswerId > 0 && m.questionType != ScriptsQuestionType.None) ||\r\n m.questionTypeResponseChatLogId\r\n ) {\r\n me.autoScroll(questionTypeId);\r\n } else {\r\n me.autoScroll();\r\n }\r\n // parent method\r\n // me.$super('onMessageArrived', m);\r\n\r\n // Detect if the user is not looking at the chat window.\r\n // Show dialog box to bring the chat box on top\r\n // Limited to Window chats only\r\n if (\r\n me.options.chatMode == ChatMode.Windowed &&\r\n me.options.newMessageVisibility\r\n ) {\r\n newMessage = true;\r\n if (window.restartTimer && typeof window.restartTimer === 'function') {\r\n // Make sure it starts counting only when a new message arrives\r\n window.restartTimer();\r\n }\r\n }\r\n // after the first load, flash the title and play a sound\r\n // if ((!initialLoad && m.userId != 0) || (initialLoad && m.userId == TempCache.SIMULATED_AGENT_ID)) {\r\n // me.playSound(Cookies.get('messageSound')); // JIRA_2905 - Play sound only for agent message. (Its cookie based for visitor-end incoming sound) and notifyMessage was using Dashboard sound cookie)\r\n // }\r\n m.initialLoad = initialLoad;\r\n me.state.changeState({\r\n origin: me.objectType,\r\n toState: ChatEvents.OnMessageIncoming,\r\n value: m\r\n });\r\n me.postMessage({ event: 'chatui-message-arrived' });\r\n // TODO\r\n // ADACompliant.push(me.context.querySelector('.apexchat_ada_compliance')).apply();\r\n // note that we have some content\r\n me._hasMessages = true;\r\n if (\r\n me.options.model.chatMode == ChatMode.Windowed &&\r\n me.options.model.autoPushUrls\r\n ) {\r\n try {\r\n const els = me.$('a', div);\r\n for (let i = 0; i < els.length; i++) {\r\n // we have to pick one, so we're going with the first that has an absolute url\r\n if (els[i].href.indexOf('http') === 0) {\r\n window.opener.location = els[i].href;\r\n break;\r\n }\r\n }\r\n } catch (ex) {\r\n if (window.console) {\r\n window.console.error(ex);\r\n }\r\n }\r\n }\r\n };\r\n try {\r\n await handleMessage(m);\r\n } catch (ex) {\r\n if (ApexChat.isInDevMode) {\r\n // helpful for v3-developer\r\n const exception = ex;\r\n logIt(exception.message, null, console.error);\r\n }\r\n // if, for whatever reason, the message arriving fails (for example, if the DOM isn't ready when a message shows up), then\r\n // we always want to just retry in a moment.\r\n let retryCount = 0;\r\n window.setTimeout(() => {\r\n if (retryCount < 10) {\r\n retryCount++;\r\n log(`${ex}! Retrying message arrived...`, LogLevel.Debug);\r\n me.onMessageArrived(m, initialLoad, index);\r\n }\r\n }, 200);\r\n }\r\n // check if the message is docusign preview\r\n if (m.isDocuSignRequest) {\r\n // split text and URL\r\n const docusignMessage = m.text.split(',');\r\n // 0 index is the text and 1 index is the URL\r\n // generate HTML to be rendered\r\n const wrapHTML = `${docusignMessage[0]}`;\r\n // get the current message wrapper\r\n const messageWrapper = me.$(`#apexchat_chatlog_${m.id}`, me.context);\r\n // add docusign specific class to wrapper\r\n messageWrapper.addClass('docusign-container');\r\n // replace HTML\r\n messageWrapper.html(wrapHTML);\r\n }\r\n var textBox = me.$('#apexchat_rd_msg_box, #frmAutocomplete input', me.options.context);\r\n if (textBox && textBox.length > 0) {\r\n if (m.questionType === ScriptsQuestionType.FullText) {\r\n textBox.addClass('apexchat_full_text');\r\n } else {\r\n textBox.removeClass('apexchat_full_text');\r\n }\r\n }\r\n me.handleDateTimeDOBMessage();\r\n }\r\n getLastQuestionTypeForAIbot() {\r\n let me = this;\r\n let scriptId = Cookies.get('lastMessageAnswerId');\r\n if (scriptId) {\r\n const xhr = new XMLHttpRequest();\r\n xhr.open(\r\n 'GET',\r\n `${GlobalVariables.LiveChatServiceUrl\r\n }Handlers/SendQuestionToVisitorHandler.ashx?questionId=${scriptId}&chatId=${me.getChatId()}`\r\n );\r\n xhr.send();\r\n me.autoScroll();\r\n ApexChat.AIResponseReceived = true;\r\n }\r\n }\r\n removeSMSToWebNotification() {\r\n var me = this;\r\n me.$('.apexchat_rd_transfer_to_sms', me.context).hide();\r\n var $wrapper = me.$('#apexchat_rd_chat_content', me.context);\r\n if ($wrapper && $wrapper.length === 0) {\r\n $wrapper = me.$('#apex-transcript', me.context);\r\n }\r\n $wrapper.unbind('scroll');\r\n $wrapper.css({\r\n paddingBottom: 0,\r\n paddingTop: 0,\r\n transition: \"none\",\r\n boxSizing: \"initial\",\r\n });\r\n }\r\n handleWebToSmsNotification(msg) {\r\n const me = this;\r\n if (!msg.isUnread) {\r\n return;\r\n }\r\n var chatLogId = msg.id;\r\n me.savePhoneNumber(msg.maskedText);\r\n RunAsSoonAs(function () {\r\n if (me.options.msg && me.options.msg.isSmsTransfer) {\r\n var phonemsg = me.getPhoneMessage();\r\n var smsForm = WebSmsFormValidator(me.options);\r\n smsForm.init();\r\n smsForm.getWebSmsService({\r\n initiatedBy: me.options.chatInitiatedBy,\r\n phone: phonemsg.phone,\r\n interceptorResults: me.options.interceptorResult,\r\n chatId: GetChatID(me.options),\r\n chatLogId: chatLogId,\r\n serviceUrl: '/Handlers/ConvertToSMSHandler.ashx'\r\n }, function () { });\r\n }\r\n }, function () {\r\n var msgsList = me.$('[chatlogid] ', me.context).toArray().reverse();\r\n var cleaningRegex = /(^[^\\w()]+)|([^\\w()]+$)/g;\r\n var cleanedMaskedText = msg.maskedText.replace(cleaningRegex, '');\r\n var phoneMsgRendered = msgsList.find(x => me.$(me.$(x, me.context).find('p.apexchat_rd_msg_text', me.context)[0], me.context).text().replace(cleaningRegex, '') == cleanedMaskedText);\r\n if (phoneMsgRendered) {\r\n var renderedmsgChatlogId = me.$(phoneMsgRendered, me.context).attr('chatlogid');\r\n if ((renderedmsgChatlogId > chatLogId) || (renderedmsgChatlogId < 0 && !me.isFirstNotificationRendered)) {\r\n let phoneChatLogId = renderedmsgChatlogId;\r\n me.isFirstNotificationRendered = true;\r\n return true;\r\n }\r\n return false;\r\n\r\n }\r\n });\r\n }\r\n getCSSSelectorForRDThemeTimeStamp(id) {\r\n return `.apexchat_auto_genned_message_wrapper[chatlogid|=${id}] .apexchat_rd_timer_span`;\r\n }\r\n\r\n getCSSSelectorForRDThemeToolTip(id) {\r\n return `.apexchat_auto_genned_message_wrapper[chatlogid|=${id}] .apexchat_tooltip_container`;\r\n }\r\n\r\n hideTimeStampForPreviousMessages() {\r\n const me = this;\r\n // This new feature is only for V3-RDTheme\r\n if (!me.options.isRoundedDynamic) {\r\n return;\r\n }\r\n for (let i = 0; i < me.chatLogArray.length; i++) {\r\n // IF the current message is Visitor Response we need to apply some logic\r\n if (\r\n me.chatLogArray[i].isVisitorResponse &&\r\n me.chatLogArray[i - 1] &&\r\n me.chatLogArray[i - 1].isVisitorResponse\r\n ) {\r\n // Current Message = Visitor Response\r\n // 1- Hide the TimeStamp of Previous message (If any).\r\n // me.$(\r\n // me.getCSSSelectorForRDThemeTimeStamp(me.chatLogArray[i - 1].id),\r\n // me.context\r\n // ).hide();\r\n // // 2- Show the ToolTip of Previous message (if any).\r\n // me.$(me.getCSSSelectorForRDThemeToolTip(me.chatLogArray[i - 1].id), me.context)\r\n // .removeClass('livechat_hide_with_opacity')\r\n // .addClass('livechat_show_with_opacity');\r\n // // 3- Hide the ToolTip of Current Message.\r\n // me.$(me.getCSSSelectorForRDThemeToolTip(me.chatLogArray[i].id), me.context)\r\n // .removeClass('livechat_show_with_opacity')\r\n // .addClass('livechat_hide_with_opacity');\r\n }\r\n if (\r\n !me.chatLogArray[i].isVisitorResponse &&\r\n me.chatLogArray[i - 1] &&\r\n !me.chatLogArray[i - 1].isVisitorResponse\r\n ) {\r\n // Current Message = Agent Response\r\n // 1- Hide the TimeStamp of Previous message (If any).\r\n // me.$(\r\n // me.getCSSSelectorForRDThemeTimeStamp(me.chatLogArray[i - 1].id),\r\n // me.context\r\n // ).hide();\r\n // // 2- Show the ToolTip of Previous message (if any).\r\n // me.$(me.getCSSSelectorForRDThemeToolTip(me.chatLogArray[i - 1].id), me.context)\r\n // .removeClass('livechat_hide_with_opacity')\r\n // .addClass('livechat_show_with_opacity');\r\n // // 3- Hide the ToolTip of Current Message.\r\n // me.$(me.getCSSSelectorForRDThemeToolTip(me.chatLogArray[i].id), me.context)\r\n // .removeClass('livechat_show_with_opacity')\r\n // .addClass('livechat_hide_with_opacity');\r\n }\r\n // General Rule: Hide the Tooltip of current message because we will show TimeStamp of current message not ToolTip.\r\n me.$(me.getCSSSelectorForRDThemeToolTip(me.chatLogArray[i].id), me.context)\r\n .removeClass('livechat_show_with_opacity')\r\n .addClass('livechat_hide_with_opacity');\r\n }\r\n }\r\n\r\n showTypingIndicatorThenDisplayMessage(params) {\r\n const me = this;\r\n const { m } = params;\r\n\r\n if (!params.shouldDisplayTypingIndicator) {\r\n params.onComplete();\r\n return false;\r\n }\r\n logIt('DELAY::showTypingIndicatorThenDisplayMessage');\r\n\r\n me.onTypingArrived({\r\n indicator: true,\r\n participantDisplayName: m.participantDisplayName\r\n });\r\n\r\n // display messages async\r\n setTimeout(() => {\r\n logIt(`DELAY::params.indicatorDuration:${params.indicatorDuration}`);\r\n\r\n logIt('NONE:: started processing msg:');\r\n me.onTypingArrived({ indicator: false });\r\n if (params.onComplete) {\r\n params.onComplete(() => {\r\n // do whatever required after msg has completely been processed\r\n // setTimeout(function () {\r\n // clearTimeout(timeout);\r\n // }, 1000);\r\n me.counterForQueuedTimers = 0; // reset counter\r\n });\r\n }\r\n }, params.indicatorDuration * ++me.counterForQueuedTimers);\r\n\r\n logIt(`NONE:: ApexChat.counterForQueuedTimers:${me.counterForQueuedTimers}`);\r\n\r\n return true;\r\n }\r\n\r\n isGreetingQuestionType(m, index) {\r\n /* Checking if it is first message and it is QuestionType then return true ,\r\n * greeting message comes with index == 0 , so we test here that if index is 0 so its a greeting message.\r\n * */\r\n if (m.scriptAnswerId && m.questionType && m.options && index == 0) {\r\n TempCache.IS_GREETING_QUESTIONTYPE = true;\r\n return true;\r\n }\r\n if (m.userId != TempCache.AUTOGREET_AGENT_ID && !m.isGreeting) {\r\n TempCache.IS_GREETING_QUESTIONTYPE = false;\r\n return false;\r\n }\r\n return false;\r\n }\r\n\r\n checkChatRoomLoaded(cb) {\r\n const me = this;\r\n var checkingInterval = setInterval(() => {\r\n if (!me.isChatroomAlive()) {\r\n me.loadChatRoom();\r\n } else {\r\n cb();\r\n clearInterval(checkingInterval);\r\n }\r\n }, 300);\r\n }\r\n\r\n sendMsgWhenChatroomAvailable() {\r\n const me = this;\r\n var checkingChatRoom = setInterval(() => {\r\n if (me.isChatroomAlive()) {\r\n me.sendMessage();\r\n clearInterval(checkingChatRoom);\r\n // we must bind back after 1st msg\r\n // me.clickButton.click(me.sendMessage.bind2(me));\r\n }\r\n }, 200);\r\n }\r\n\r\n transferChatWhenChatroomAvailable() {\r\n const me = this;\r\n var checkingChatRoom = setInterval(() => {\r\n if (me.isChatroomAlive()) {\r\n me.publishPredefinedMessages(() => {\r\n me.startWaiting();\r\n me.room.sendLive();\r\n me.preserveChatArray = []; // clear\r\n me.enableChatTransfer().then(_ => {\r\n me.transferChat();\r\n });\r\n });\r\n clearInterval(checkingChatRoom);\r\n }\r\n }, 200);\r\n }\r\n\r\n isChatroomAlive() {\r\n const me = this;\r\n return me.room && me.room.isConnectionEstablished;\r\n }\r\n\r\n sendTyping(e) {\r\n const me = this;\r\n let text = []; // assign empty array\r\n // reset waiting when the visitor is typing\r\n try {\r\n const $txt = me.$(me.messageInput, me.context);\r\n logIt(`input text:${$txt.val()}`);\r\n TempStorageCache.add(TempCache.INPUT_OLD_VALUE, $txt.val(), true); // cache input value as it is typed\r\n } catch (err) {\r\n // ignore it\r\n logIt(`error caching input text:${err.message}`);\r\n }\r\n logIt('BASE::sendTyping');\r\n let c = e.which;\r\n // normalize keyCode\r\n if (To_ascii.hasOwnProperty(c)) {\r\n c = To_ascii[c];\r\n }\r\n // small case letters\r\n if (!e.shiftKey && c >= 65 && c <= 90) {\r\n c = String.fromCharCode(c + 32);\r\n } else if (e.shiftKey && shiftUps.hasOwnProperty(c)) {\r\n c = shiftUps[c];\r\n } else {\r\n c = String.fromCharCode(c);\r\n }\r\n // push all entries into the text array\r\n text.push(c);\r\n // send the message after 15 chars are entered\r\n if (text.length == 15 && e.keyCode == 32) {\r\n // on spacebar press we are sending typing indcator\r\n me.room.sendTyping(true, text.join(''));\r\n // reset the array\r\n text = [];\r\n }\r\n // else just send the indicator signal with no text\r\n else if (!me.typing && e.keyCode == 32) {\r\n me.typing = true;\r\n me.room.sendTyping(true);\r\n }\r\n window.clearTimeout(me.timeout);\r\n me.timeout = window.setTimeout(() => {\r\n if (me.room) {\r\n me.typing = false;\r\n me.room.sendTyping(false);\r\n }\r\n }, TempCache.IDLE_TYPING_THRESHOLD * 1000);\r\n }\r\n\r\n onMessageTyping(e, el) {\r\n const me = this;\r\n // reset waiting when the visitor is typing\r\n try {\r\n const $txt = me.$(el || me.messageInput, me.context);\r\n logIt(`input text:${$txt.val()}`);\r\n TempStorageCache.add(TempCache.INPUT_OLD_VALUE, $txt.val(), true); // cache input value as it is typed\r\n } catch (err) {\r\n // ignore it\r\n logIt(`error caching input text:${err.message}`);\r\n }\r\n try {\r\n me.isUserTyping = true;\r\n let text = [];\r\n\r\n if (isEnterKeyPressed(e)) {\r\n if (!me.room) {\r\n me.loadChatRoom();\r\n me.sendMsgWhenChatroomAvailable();\r\n } else {\r\n TempCache.IS_GREETING_QUESTIONTYPE = false;\r\n me.sendMessage(el);\r\n window.clearTimeout(me.timeout);\r\n me.typing = false;\r\n me.room.sendTyping(false);\r\n e.preventDefault();\r\n text = [];\r\n }\r\n } else if (me.room) {\r\n me.sendTyping(e);\r\n }\r\n } catch (ex) {\r\n console.log(ex.message);\r\n }\r\n }\r\n\r\n sendButtonDisableOrEnableForATA(txt) {\r\n var me = this;\r\n var msg = me.options.msg || '';\r\n if (msg) {\r\n if (\r\n !msg.questionTypeDisplayListForVisitor &&\r\n !me.isBottomSheetSupported &&\r\n me.options.msg.questionType == ScriptsQuestionType.AllThatApply\r\n ) {\r\n var v = txt.val().trim();\r\n if (!v || v.replace(/\\s/g, '') === '' || v == txt.attr('title')) {\r\n Utils.disableElement(me.clickButton, { applyGrayBackground: true });\r\n return;\r\n }\r\n Utils.enableElement(me.clickButton, { applyGrayBackground: false, recursively: true })\r\n }\r\n }\r\n }\r\n\r\n onLiveArrived(liveChat) { }\r\n\r\n onChatJoinFailure(args) {\r\n window.clearInterval(this._countDownInterval);\r\n const me = this;\r\n if (me.introContainer) {\r\n me.introContainer.html(args.error);\r\n } else {\r\n alert(args.error);\r\n }\r\n }\r\n\r\n onChatJoined(args) { }\r\n\r\n sendMessage(textInput) {\r\n TempCache.IS_GREETING_QUESTIONTYPE = false;\r\n const me = this;\r\n if (!me.isChatroomAlive()) {\r\n return;\r\n }\r\n // CHAT-7003, CHAT-7004, CHAT-7005: validate FullText\r\n if (me.QTRendererExt && me.QTRendererExt.isLastMessageFullText()) {\r\n me.QTRendererExt.validateFullTextMessage(textInput); // just validate and return\r\n return; // we are separately handling Fulltext scenario in handleFullTextType()\r\n }\r\n logIt(`EP::BASE:sendMessage::msg:${textInput}`);\r\n\r\n me.startWaiting();\r\n me.room.sendLive();\r\n me.showTyptingIndicatorForAIBot(me);\r\n me.room.sendMessage({\r\n chatMsg: textInput,\r\n isForAIBot: me.options.model.aiBotEnabled,\r\n callback() {\r\n // after sending msg to dashboard do something\r\n }\r\n });\r\n }\r\n showTyptingIndicatorForAIBot(me) {\r\n if (me.options.model.aiBotEnabled && !me.room?.isChatEnded) {\r\n ApexChat.AIResponseReceived = false;\r\n RunUntil(() => {\r\n console.log('waiting for AI response...' + ApexChat.AIResponseReceived);\r\n me.onTypingArrived({\r\n indicator: true,\r\n participantDisplayName: me.options.model.agentName\r\n });\r\n }, 1000, () => {\r\n if (ApexChat.AIResponseReceived) {\r\n me.$('.apexchat_rd_chat_typing', me.context).hide();\r\n me.$('apexchat_rd_ep_typing', me.context).hide();\r\n }\r\n return ApexChat.AIResponseReceived;\r\n });\r\n }\r\n }\r\n minimize() {\r\n this.hide();\r\n }\r\n\r\n maximize() {\r\n // JIRA_4190 - the setChatId function is no more needed because loadChatRoom we are calling seperately.\r\n // this.options.chatModel = ApexChatStartData;\r\n // this.room.setChatId(this.options.chatModel.chatId);\r\n }\r\n\r\n popOut() {\r\n // var me = this;\r\n // this.hide();\r\n // this.options.chatInitiatedBy = 'ExitPopup';\r\n // this.startWindowedChat(me.options);\r\n this.postMessage({\r\n event: this.objectType + WidgetStates.PoppedOut\r\n });\r\n }\r\n\r\n hide() {\r\n const me = this;\r\n me.$(me.container, me.context).hide();\r\n }\r\n\r\n loadChatRoom(cb) {\r\n const me = this;\r\n if (me.room) {\r\n return;\r\n }\r\n\r\n try {\r\n RunAsSoonAs(\r\n () => {\r\n // initializing the analytics object before starting the chat due to unavailability of ga object in windowed chat widget.\r\n googleAnalyticsObjectInit('gat');\r\n me.room = new LiveChatRoom(Object.assign(me.options, me.options.model));\r\n me.room.initChatRoom();\r\n me.options.chatModel = ApexChatStartData;\r\n me.room.setChatId(me.options.chatModel.chatId, me.options.chatModel.token);\r\n me.room.setNewChat(me.options.chatModel.isNewChat);\r\n // track the time from when the click was triggered (stored in the 'cb' variable) to when we render the UI\r\n const clickTime = me.getRequestedTime(); // TODO: dbl check this is right way\r\n const endTime = new Date().getTime();\r\n const timeSpent = endTime - clickTime;\r\n // logIt('DOM loading time is:' + timeSpent);\r\n // track that we've shown the UI\r\n me.state.changeState({\r\n origin: me.objectType,\r\n toState: me.state.getStateValue(WidgetTypes.DOMUIController),\r\n value: timeSpent\r\n });\r\n // do wahtever caller wants to after this piece is done\r\n if (cb) {\r\n cb();\r\n }\r\n if (!Cookies.get(TempCache.SUBSEQUENT_GREETING_COOKIE)) {\r\n Cookies.setShortMinutes(\r\n TempCache.SUBSEQUENT_GREETING_COOKIE,\r\n true,\r\n me.options.model.reShowIntervalMinutes\r\n );\r\n }\r\n },\r\n () => {\r\n const isChatRoomV3Loaded = typeof LiveChatRoom !== 'undefined'; // check if LiveChatRoom loaded\r\n logIt(`CV3::isChatRoomV3Loaded:${isChatRoomV3Loaded}`);\r\n const checkApexChatStartDataExists =\r\n typeof ApexChatStartData !== 'undefined' && ApexChatStartData != null; // check when ApexChatStartData declared in current context and also check null\r\n return isChatRoomV3Loaded && checkApexChatStartDataExists;\r\n }\r\n );\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n show(state /** _min or _max? */) {\r\n const me = this;\r\n me.reposition();\r\n me.bind(state);\r\n }\r\n\r\n async end() {\r\n if (this.isChatActive()) {\r\n const me = this;\r\n me.askConfirmation({\r\n message: GlobalVariables.ChatCloseWarningMessage,\r\n flag: me.options.model.enableChatWindowCloseWarning,\r\n callback() {\r\n me.endChatSession();\r\n }\r\n });\r\n\r\n } else {\r\n this.endChatSession();\r\n }\r\n const module = await import(/* webpackChunkName: \"questionTypeRendererFactory\" */ '../questiontypes/QuestionTypeRendererFactory')\r\n new module.default().destroy();\r\n }\r\n\r\n autoScroll(id) {\r\n // allow a scroller to be set independant of the message container\r\n // arrived...\r\n const me = this;\r\n if (!id) {\r\n const scroller = me.$(this.options.elements.scrollerSelector, me.context);\r\n if (scroller.length) {\r\n scroller.prop('scrollTop', scroller.prop('scrollHeight'));\r\n } else if (this.messagesContainer) {\r\n this.messagesContainer.scrollTop = this.messagesContainer.scrollHeight\r\n\r\n }\r\n } else {\r\n // var idHeight = $('#apexchat_chatlog_' + id).offset().top;\r\n // if (this.messageContainer) {\r\n // this.messageContainer.prop('scrollTop', idHeight);\r\n // }\r\n if (/iPhone/.test(navigator.platform) || /Android/i.test(navigator.userAgent)) {\r\n var target = me.context.getElementById(`apexchat_chatlog_${id}`);\r\n // target.parentNode.scrollTop = target.offsetTop;\r\n if (target) {\r\n scrollIntoView(target);\r\n }\r\n } else {\r\n var target = me.context.getElementById(`apexchat_chatlog_${id}`);\r\n if (target) {\r\n target.scrollIntoView(true);\r\n }\r\n }\r\n }\r\n }\r\n\r\n playSound(soundName) {\r\n const me = this;\r\n RunAsSoonAs(\r\n () => {\r\n if (getStorageAPIValue(TempCache.CHAT_SOUND_ENABLED) != 'false') {\r\n if (me.oneTimeSoundSetup) {\r\n soundManager.setup({\r\n url: `${GlobalVariables.ApexChatBaseUrl}scripts/libraries/soundmanager2/swf/`,\r\n flashVersion: 9,\r\n preferFlash: false, // prefer 100% HTML5 mode, where both supported\r\n onready() {\r\n // console.log('SM2 ready!');\r\n },\r\n ontimeout() {\r\n // console.log('SM2 init failed!');\r\n },\r\n defaultOptions: {\r\n // set global default volume for all sound objects\r\n volume: GlobalVariables.visitorEndSoundVolume\r\n\r\n }\r\n });\r\n // JIRA_3188 - 23JAN18 - START (dev: Mahad) - Error in console due to Sound flooding\r\n // summmary: Actual bug: When agent from dashboard was floods message the visitor-end visitor was receiving sound flood,\r\n // in this case, Im preventing Sound to be played but just one time in 5seconds.\r\n GlobalVariables.timeIntervalSoundFlood = setInterval(() => {\r\n GlobalVariables.avoidSoundFlooding++; // I introduced this setInterval which will count seconds.\r\n if (GlobalVariables.avoidSoundFlooding > 30) {\r\n // for best practice we are clearing this setInterval after 30seconds, so user's page will not get slow.\r\n me.oneTimeSoundSetup = true; // I'm reseting this oneTimeSoundSetup so this scope will run again on agent's response.\r\n GlobalVariables.avoidSoundFlooding = 0; // resetting seconds counter.\r\n clearInterval(GlobalVariables.timeIntervalSoundFlood); // Finally clearing the interval.\r\n }\r\n }, 1000);\r\n // JIRA_3188 - 23JAN18 - END\r\n }\r\n const playSound =\r\n me.allowSoundFloodingOnNewMesssage ||\r\n (!me.allowSoundFloodingOnNewMesssage && GlobalVariables.avoidSoundFlooding > 5);\r\n if (me.oneTimeSoundSetup || playSound) {\r\n // this code will only run when agent's first response or his response after 5sec.\r\n // means if agent send 2 response simultaneously within 5sec this code will play sound only one time.\r\n const _sound = soundManager.createSound({\r\n id: soundName,\r\n url: `${GlobalVariables.ApexChatBaseUrl}Contents/media/${soundName}.mp3`,\r\n volume: GlobalVariables.visitorEndSoundVolume,\r\n onload() {\r\n console.log(`${this.id} loaded.`);\r\n },\r\n onplay() {\r\n console.log(`Starting sound: ${this.id}`);\r\n },\r\n autoPlay: false,\r\n autoLoad: true,\r\n stream: true\r\n });\r\n _sound.play();\r\n GlobalVariables.avoidSoundFlooding = 0; // resetting seconds counter.\r\n }\r\n me.oneTimeSoundSetup = false; // preventing oneTimeSoundSetup to load again and again.\r\n }\r\n },\r\n () => typeof window.soundManager !== 'undefined'\r\n );\r\n }\r\n\r\n playSoundEPPredefinedMessage(soundName) {\r\n RunAsSoonAs(\r\n () => {\r\n if (getStorageAPIValue(TempCache.CHAT_SOUND_ENABLED) != 'false') {\r\n soundManager.setup({\r\n preferFlash: false,\r\n url: `${GlobalVariables.ApexChatBaseUrl}scripts/libraries/soundmanager2/swf/`,\r\n defaultOptions: {\r\n volume: GlobalVariables.visitorEndSoundVolume\r\n\r\n }\r\n });\r\n setTimeout(() => {\r\n // using this setTimeout for 1000 =1sec, for downloading that .mp3 file.\r\n soundManager.createSound({\r\n id: soundName,\r\n url: `${GlobalVariables.ApexChatBaseUrl}Contents/media/${soundName}.mp3`,\r\n volume: GlobalVariables.visitorEndSoundVolume\r\n\r\n });\r\n soundManager.play(soundName, {\r\n onfinish() { }\r\n });\r\n }, 1000);\r\n }\r\n },\r\n () => typeof window.soundManager !== 'undefined'\r\n );\r\n }\r\n\r\n notifyNewMessageArrived(allowflooding) {\r\n const me = this;\r\n me.allowSoundFloodingOnNewMesssage = allowflooding;\r\n ApexChatTitle.flash();\r\n const soundName =\r\n Cookies.get(VISITOR_MESSAGE_SOUND.name) ||\r\n VISITOR_MESSAGE_SOUND.tune;\r\n me.playSound(soundName);\r\n }\r\n\r\n reposition() {\r\n const me = this;\r\n }\r\n\r\n syncSize(cb) {\r\n const me = this;\r\n const container = me.$('html');\r\n const diff = me.$(window).height() - container.height();\r\n const current = me.$('.livechat_messages').height();\r\n let target = current + diff;\r\n if (target < 80) {\r\n target = 80; // cutoff\r\n }\r\n me.$('.livechat_messages').css({ height: `${target}px` });\r\n // extend the window horizontally\r\n me.$('.apexchat_windowed').css({ width: '95%' });\r\n // hide the scroll bars\r\n me.$('.apexchat_loaded').css({ overflow: 'hidden' });\r\n if (cb && typeof cb === 'function') {\r\n cb();\r\n }\r\n\r\n // added this code to adjust height on android when keyboard is on/off\r\n const { isDefaultMobileTheme } = me.options;\r\n if (\r\n /Android/i.test(navigator.userAgent) &&\r\n me.options.chatMode == ChatMode.Windowed &&\r\n isDefaultMobileTheme\r\n ) {\r\n setTimeout(() => {\r\n me.$('.livechat_messages').css({ height: '100%' });\r\n // scroll to show latest message to user\r\n if (me.$('#apexchat_chatMsg_textbox').is(':focus')) {\r\n me.autoScroll();\r\n }\r\n }, 150);\r\n }\r\n }\r\n\r\n clickSourceClick() {\r\n // log that it was clicked\r\n ServerLog.trackClick({\r\n companyId: this.options.companyId,\r\n visitorId: this.options.visitorId,\r\n clickSource: 'chatroom'\r\n });\r\n }\r\n\r\n hideWaitingIndicator(participants) {\r\n const me = this;\r\n if (me.options.model.chatheadertemplate) {\r\n if (me.introcontainer) {\r\n me.introcontainer.hide();\r\n }\r\n me.options.model.chatheader = parsetemplate(\r\n me.options.model.chatheadertemplate,\r\n me.options.model || me.options\r\n );\r\n if (me.participantscontainer) {\r\n me.participantscontainer.html(me.options.model.chatheader);\r\n }\r\n }\r\n me._participantsHasBeenGreaterThanOne = true;\r\n }\r\n\r\n getNotifyMessageHandler(m) {\r\n const me = this;\r\n if (\r\n (me.widget === WidgetTypes.EPUIController && // 1- for EP only\r\n m.isPredefinedMessage &&\r\n m.isLastSplitMessage) || // Send notification for rendering the last part of predefined pipe message\r\n (m.isPredefinedMessage && m.questionType == ScriptsQuestionType.None)\r\n ) {\r\n // Notify the subscriber that Plain text predefined message has been rendered\r\n return me.notifyPredefinedMessageRendered(m);\r\n }\r\n return me.notifyMessageHandled(m);\r\n }\r\n\r\n /**\r\n * notifies subscribers that a message has been either completely rendered or handled; the 2 subscribers are:\r\n * 1. EP Predefined Queue: for 1st time or reload scenarios\r\n * 2. chatroom-v3 Queue: for refresh/history scenario\r\n */\r\n notifyMessageHandled(m) {\r\n const me = this;\r\n const restartChatOption =\r\n ((me.QTRendererExt &&\r\n me.QTRendererExt.lastMessage &&\r\n me.QTRendererExt.lastMessage.isChatEnded) ||\r\n me.isTransferredToLiveAgent());\r\n if (restartChatOption) {\r\n me.adjustRdActionMenu(); // This function hides or shows the restart option/button in dropdown/header when either live chat is transferred to live agent or the chat is ended\r\n }\r\n // 2- in case of reload/history, a piped messagebut only if its last split message\r\n const isNotLastSplitMsg = m.isSplitMessage && !m.isLastSplitMessage;\r\n if (isNotLastSplitMsg) {\r\n // we bail out for a split msg in normal chat msgs\r\n return;\r\n }\r\n if (!m.isFromHistory) {\r\n // we bail out for a normal chat msg;i.e. not coming from history\r\n return;\r\n }\r\n // we only come here for either 1- predefined last split messages or 2- all history messages but only last split message (in case of a piped one)\r\n\r\n setTimeout(() => {\r\n logIt(`after::${ChatStates.MessageArrived}:${m.text}`);\r\n me.postMessage({\r\n event: ChatStates.MessageArrived,\r\n data: m\r\n }); //\r\n }, 100);\r\n }\r\n\r\n notifyPredefinedMessageRendered(m) {\r\n const me = this;\r\n setTimeout(() => {\r\n logIt(`after::predefined-message-completed: ${m.text}`);\r\n me.postMessage({ event: 'predefined-message-completed', data: m }); //\r\n }, 100);\r\n }\r\n\r\n enableTypingInputOnServerResponse(emptyField) {\r\n const me = this;\r\n // enable the input field again, we block input field on sending\r\n // a message to server, to avoid duplication CHAT-8369\r\n if (me.options.scriptBotEnabled && !me.isTransferredToLiveAgent()) {\r\n $txt = me.$('#apexchat_rd_msg_box', me.options.context);\r\n if (emptyField) {\r\n $txt.val('');\r\n }\r\n enableTypingInput.bind2(me)(me, me.options.elements.inputContainerSelector);\r\n }\r\n }\r\n\r\n restartVAChat() {\r\n const me = this;\r\n me.state.changeState({\r\n toState: ChatEvents.OnChatRestart,\r\n value: true\r\n });\r\n }\r\n\r\n transferChat() {\r\n const me = this;\r\n me.state.changeState({\r\n toState: ChatEvents.OnTransferRequested,\r\n value: true\r\n });\r\n }\r\n\r\n initAgentNotFoundOverlay(targetSelector) {\r\n const me = this;\r\n me.targetSelector = targetSelector;\r\n if (\r\n !me.options.model.scriptBotEnabled ||\r\n !(true)\r\n ) {\r\n return;\r\n }\r\n // we keep this instance of agentNotFoundOverlay so we don't need tore-render every time\r\n me.agentNotFoundOverlayView = new SimpleView({\r\n identifier: 'livechat_agent_not_found_overlay',\r\n context: me.context,\r\n renderOninit: 'false',\r\n model: { baseUrl: GlobalVariables.ApexChatBaseUrl },\r\n style: [],\r\n template: noAgentAvailable({}),\r\n targetElementSelector: me.targetSelector,\r\n wrap: true,\r\n afterRender() {\r\n // var reinit = me.reInitializeChat.bind2(me, '.apexchat_chat_restart_wrapper', 'Restarting chat...');\r\n // var endChatAndstartNewChat = me.endChat.bind2(me, reinit);\r\n // to bring focus on restartchat and cancel buttons of overlay.\r\n ManageFocusOnKeyEvents(me.context.querySelector('.apexchat_btn_primary', me.context));\r\n // ManageFocusOnKeyEvents(me.$('.apexchat_btn_default', me.context));\r\n // now bind events: reInit and close\r\n me.ADAHandler(me.context.querySelector('.apexchat_btn_primary'), () => {\r\n // endChatAndstartNewChat();\r\n me.hideReInitOverlay('#apexchat_chat_restart_overlay');\r\n\r\n // reset state\r\n me.state.changeState({\r\n toState: ChatStates.UIRendered\r\n });\r\n });\r\n me.$('.apexchat_btn_primary', me.context).bind('click', () => {\r\n me.postMessage({\r\n event: WidgetTypes.PokeMessagesOverLay + WidgetStates.Hidden\r\n });\r\n me.hideReInitOverlay('#livechat_agent_not_found_overlay');\r\n Cookies.set(TempCache.SHOW_OPERATOR_NOT_FOUND_OVERLAY, false);\r\n // reset state\r\n me.state.changeState({\r\n toState: ChatStates.UIRendered\r\n });\r\n });\r\n me.$('.apexchat_rd_chat_window_mode', me.context).addClass('apexchat_modal_opened');\r\n const _hideOverlay = function (overlaySelector) {\r\n me.$(overlaySelector, me.context).hide();\r\n me.state.changeState({\r\n toState: ChatStates.UIRendered\r\n });\r\n };\r\n me.ADAHandler(me.context.querySelector('.apexchat_btn_default'), () => {\r\n _hideOverlay('#apexchat_chat_restart_overlay');\r\n });\r\n me.$('.apexchat_btn_default', me.context).bind('click', () => {\r\n _hideOverlay('#apexchat_chat_restart_overlay');\r\n });\r\n }\r\n });\r\n }\r\n\r\n initRestartOverlay() {\r\n const me = this;\r\n if (!me.options.model.scriptBotEnabled) {\r\n return;\r\n }\r\n // we keep this instance of restartOverlay so we don't need tore-render every time\r\n me.restartOverlayView = new SimpleView({\r\n identifier: 'apexchat_chat_restart_overlay',\r\n context: me.context,\r\n renderOninit: 'false',\r\n model: { baseUrl: GlobalVariables.ApexChatBaseUrl },\r\n style: [],\r\n template: ImportRestartChatOverlayFactory().VAChatRestartOverlayTemplate(me.options.model),\r\n // VAChatRestartOverlay(me.options.model),\r\n targetElementSelector: me.isRDEP() ? '.apex-col-2' : '#apexchat',\r\n wrap: true,\r\n afterRender() {\r\n const reinit = me.reInitializeChat.bind2(\r\n me,\r\n '.apexchat_chat_restart_wrapper',\r\n 'Restarting chat...'\r\n );\r\n const endChatAndstartNewChat = me.endChat.bind2(me, reinit);\r\n // to bring focus on restartchat and cancel buttons of overlay.\r\n ManageFocusOnKeyEvents(me.context.querySelector('.apexchat_btn_primary'));\r\n ManageFocusOnKeyEvents(me.context.querySelector('.apexchat_btn_default'));\r\n // now bind events: reInit and close\r\n me.ADAHandler(me.context.querySelector('.apexchat_btn_primary'), () => {\r\n endChatAndstartNewChat();\r\n if (me.isRDEP()) {\r\n me.startNewChatForEP();\r\n }\r\n me.hideReInitOverlay('#apexchat_chat_restart_overlay');\r\n // reset state\r\n me.state.changeState({\r\n toState: ChatStates.UIRendered\r\n });\r\n });\r\n me.$('.apexchat_btn_primary', me.context).bind('click', () => {\r\n me.postMessage({\r\n event: WidgetTypes.PokeMessagesOverLay + WidgetStates.Hidden\r\n });\r\n endChatAndstartNewChat();\r\n if (me.isRDEP()) {\r\n me.startNewChatForEP();\r\n }\r\n me.hideReInitOverlay('#apexchat_chat_restart_overlay');\r\n // reset state\r\n me.state.changeState({\r\n toState: ChatStates.UIRendered\r\n });\r\n });\r\n me.$('.apexchat_rd_chat_window_mode', me.context).addClass('apexchat_modal_opened');\r\n const _hideOverlay = function (overlaySelector) {\r\n me.$(overlaySelector, me.context).hide();\r\n me.state.changeState({\r\n toState: ChatStates.UIRendered\r\n });\r\n };\r\n me.ADAHandler(me.context.querySelector('.apexchat_btn_default'), () => {\r\n _hideOverlay('#apexchat_chat_restart_overlay');\r\n });\r\n me.$('.apexchat_btn_default', me.context).bind('click', () => {\r\n _hideOverlay('#apexchat_chat_restart_overlay');\r\n });\r\n }\r\n });\r\n }\r\n\r\n initVideoGreetOverlay() {\r\n var me = this;\r\n if (me.options.model && !me.options.model.videoGreetEnabled) {\r\n return;\r\n }\r\n //we keep this instance of restartOverlay so we don't need tore-render every time\r\n me.videoGreetOverlayView = new SimpleView({\r\n identifier: 'apexchat_chat_video_greet_overlay',\r\n context: me.context,\r\n renderOninit: 'false',\r\n template: VideoGreetOverlay({ baseUrl: GlobalVariables.ApexChatBaseUrl }),\r\n model: { baseUrl: ApexChatBaseUrl },\r\n style: null,\r\n targetElementSelector: me.isRDEP() ? '.apex-col-2' : '#apexchat', // the overly will append on this element\r\n wrap: true,\r\n afterRender: function () {\r\n me.loadVideoGreet()\r\n }\r\n });\r\n }\r\n loadVideoGreet() {\r\n var me = this;\r\n me.options.videoGreetSeekbar = '#apexchat_greet_video_overlay_seekbar';\r\n me.options.videoGreetPlayTrigger = '#apexchat_greet_video_play';\r\n me.options.videoGreetPlayPauseIcon = '#play_pause_icon';\r\n me.options.playerElementId = 'overlay_greet_video_player';\r\n me.options.vimeoScriptID = 'vimeo_js_overlay';\r\n me.options.videoGreetMuteTrigger = '#apexchat_greet_video_mute';\r\n me.options.vimeoPlayerConfig = {\r\n id: me.options.videoGreet.videoGreetURL,\r\n width: 300,\r\n loop: false,\r\n controls: false,\r\n byline: false,\r\n title: false,\r\n muted: false,\r\n autoplay: true,\r\n background: true,\r\n };\r\n\r\n if (!ApexChat.Vimeo2 && me.options.videoGreet.videoGreetURL) {\r\n me.setupVideoGreetVimeoPlayer();\r\n }\r\n }\r\n setupVideoGreetVimeoPlayer() {\r\n var me = this;\r\n const videoTemplate = `\r\n \r\n `;\r\n\r\n const lazyLoadCss = getStyleForIframe(\r\n `https://vjs.zencdn.net/8.16.1/video-js.css`,\r\n \"apexchat_Iframe_videogreet\",\r\n me.options.iframeId || me.options.model.iframeId || 'apexchat_browser_chatwindow_max'\r\n );\r\n me.context.getElementById(\r\n \"overlay_greet_video_player\"\r\n ).innerHTML = videoTemplate;\r\n\r\n var player = me.context.getElementById(\"video-greet-pl\");\r\n const options = {\r\n controls: false,\r\n autoplay: true,\r\n preload: 'auto',\r\n fill: true,\r\n muted: true,\r\n playsinline: true\r\n };\r\n videojs(player, options).ready(function () {\r\n me.videoPlayer = this;\r\n me.videoPlayer.muted(false)\r\n if (!me.videoPlayerState) {\r\n me.videoPlayerState = \"playing\";\r\n }\r\n me.$(me.options.videoGreetPlayTrigger, me.context).on(\r\n \"click\",\r\n function () {\r\n me.handlePlayPause();\r\n }\r\n );\r\n me.$(me.options.videoGreetMuteTrigger, me.context).on(\r\n \"click\",\r\n function () {\r\n me.handleVideoGreetMute();\r\n }\r\n );\r\n me.videoPlayer.on(\"timeupdate\", function (data) {\r\n var currentTime = this.currentTime();\r\n var duration = this.duration();\r\n\r\n // Calculate the percentage of playtime\r\n var playtimePercentage = (currentTime / duration) * 100;\r\n console.log(\"Video progress\", playtimePercentage + \"%\");\r\n me.$(me.options.videoGreetSeekbar, me.context).css(\r\n \"width\",\r\n playtimePercentage + \"%\"\r\n );\r\n // }\r\n if (duration - currentTime <= 0.3) {\r\n me.resetPlayerAfterVideoEnded();\r\n }\r\n });\r\n\r\n me.videoPlayer.on(\"play\", function () {\r\n console.log(\"played the video!\");\r\n });\r\n\r\n me.videoPlayer.on(\"ended\", function () {\r\n // me.onVideoEnded();\r\n });\r\n\r\n me.$(\".apexchat_greet_video_close\", me.context).on(\r\n \"click\",\r\n function () {\r\n me.handlePlayPause(true);\r\n me.$(\"#apexchat_chat_video_greet_overlay\", me.context).hide();\r\n }\r\n );\r\n });\r\n }\r\n resetPlayerAfterVideoEnded() {\r\n var me = this;\r\n // hack to reset the vimeo player in case of \r\n // hiding free account video suggestion\r\n // checking if the duration of the video is about to end\r\n // then reset the player, the video will end 100 ms before of it's actual time\r\n setTimeout(function () {\r\n me.videoPlayer.currentTime(0);\r\n me.videoPlayer.pause();\r\n me.videoPlayerState = 'paused';\r\n me.$(me.options.videoGreetPlayTrigger, me.context).find(me.options.videoGreetPlayPauseIcon).addClass('play_icon').removeClass('pause_icon');\r\n me.$(me.options.videoGreetSeekbar, me.context).css('width', 0);\r\n logIt('â–¶ Video Greet:: ended');\r\n }, 200)\r\n }\r\n onVideoEnded() {\r\n var me = this;\r\n console.log('video ended!');\r\n me.videoPlayerState = 'paused';\r\n me.$(me.options.videoGreetPlayTrigger, me.context).find(me.options.videoGreetPlayPauseIcon).toggleClass('play_icon pause_icon');\r\n me.videoPlayer.pause();\r\n me.$(me.options.videoGreetSeekbar, me.context).css('width', 0);\r\n }\r\n handlePlayPause(pauseOnly) {\r\n var me = this;\r\n if (me.videoPlayerState === 'playing' || pauseOnly) {\r\n me.handlePause();\r\n }\r\n else {\r\n me.$(me.options.videoGreetPlayPauseIcon, me.context).toggleClass('play_icon pause_icon');\r\n me.videoPlayerState = 'playing';\r\n me.videoPlayer.play();\r\n console.log('video resumed');\r\n }\r\n }\r\n handlePause() {\r\n var me = this;\r\n me.$(me.options.videoGreetPlayPauseIcon, me.context).addClass('play_icon').removeClass('pause_icon');\r\n me.videoPlayerState = 'paused';\r\n me.videoPlayer.pause();\r\n console.log('video paused');\r\n }\r\n handleVideoGreetMute() {\r\n var me = this;\r\n if (me.videoPlayer) {\r\n console.log('video is on mute:' + me.videoPlayer.muted());\r\n if (me.videoPlayer.muted()) {\r\n // If the video is muted, unmute it\r\n me.videoPlayer.muted(false);\r\n me.replaceMuteIcon(false)\r\n } else {\r\n // If the video is not muted, mute it\r\n me.videoPlayer.muted(true);\r\n me.replaceMuteIcon(true)\r\n }\r\n }\r\n }\r\n replaceMuteIcon(muted) {\r\n var me = this;\r\n me.$(me.$(me.options.videoGreetMuteTrigger, me.context))\r\n .find('img').attr('src', 'https://d3b4i635mede5k.cloudfront.net/' + (muted ? 'mute' : 'unmute') + '.png');\r\n logIt('â–¶ Video Greet:: icon changed to ' + muted ? 'mute' : 'unmute');\r\n }\r\n\r\n isEPChatClosed() {\r\n return ApexChat.storageAPI.Get('livechat_exitpopup_is_closed') === 'true';\r\n }\r\n\r\n volumeMuteUnmute() {\r\n const me = this;\r\n if (getStorageAPIValue(TempCache.CHAT_SOUND_ENABLED) == 'true') {\r\n ApexChat.storageAPI.Store(TempCache.CHAT_SOUND_ENABLED, false);\r\n } else {\r\n ApexChat.storageAPI.Store(TempCache.CHAT_SOUND_ENABLED, true);\r\n }\r\n }\r\n\r\n bindRestartChatEvents(el, isDOM) {\r\n // function for menudropdown ada compliance\r\n const me = this;\r\n // el.on('keyup click', (e) => {\r\n if (!el) {\r\n return;\r\n }\r\n // });\r\n \"keyup click\".split(\" \").forEach(function (e) {\r\n el.addEventListener(e, (e) => {\r\n // check if button already not selected then do the action\r\n e.stopPropagation();\r\n if (e.type == 'click' || (e.type == 'keyup' && isAcceptKey(e))) {\r\n // check for mouse click or tab and enter key\r\n me.restartVAChat();\r\n if (isDOM) {\r\n me.$(me.actionMenu, me.context).toggle(); // When restart chat overlay is visible then we should hide the action menu.\r\n }\r\n }\r\n }, false);\r\n });\r\n }\r\n\r\n bindTransferChatEvents(el, isDOM) {\r\n // function for menudropdown ada compliance\r\n if (!el) {\r\n return;\r\n }\r\n const me = this;\r\n // el.on('keyup click', (e) => {\r\n // // check if button already not selected then do the action\r\n // e.stopPropagation();\r\n // if (e.type == 'click' || (e.type == 'keyup' && isAcceptKey(e))) {\r\n // // check for mouse click or tab and enter key\r\n // me.enableChatTransfer();\r\n // me.transferChat();\r\n // if (isDOM) {\r\n // me.$(me.actionMenu, me.context).toggle(); // When restart chat overlay is visible then we should hide the action menu.\r\n // }\r\n // }\r\n // });\r\n\r\n \"keyup click\".split(\" \").forEach(function (e) {\r\n el.addEventListener(e, (e) => {\r\n // check if button already not selected then do the action\r\n e.stopPropagation();\r\n if (e.type == 'click' || (e.type == 'keyup' && isAcceptKey(e))) {\r\n // check for mouse click or tab and enter key\r\n me.enableChatTransfer().then(_ => {\r\n me.transferChat();\r\n if (isDOM) {\r\n me.$(me.actionMenu, me.context).toggle(); // When restart chat overlay is visible then we should hide the action menu.\r\n }\r\n })\r\n }\r\n }, false);\r\n });\r\n }\r\n\r\n toggleLanguageBottomSheet(el) {\r\n // function for menudropdown ada compliance\r\n if (!el) {\r\n return;\r\n }\r\n const me = this;\r\n // el.on('keyup click', (e) => {\r\n // // check if button already not selected then do the action\r\n // // e.stopPropagation();\r\n // if (e.type == 'click' || (e.type == 'keyup' && isAcceptKey(e))) {\r\n // // check for mouse click or tab and enter key\r\n // // me.actionMenu.toggle()\r\n // me.$(me.languageBottomSheet, me.context).toggle();\r\n // }\r\n // });\r\n\r\n \"keyup click\".split(\" \").forEach(function (e) {\r\n el.addEventListener(e, (e) => {\r\n // check if button already not selected then do the action\r\n // e.stopPropagation();\r\n if (e.type == 'click' || (e.type == 'keyup' && isAcceptKey(e))) {\r\n // check for mouse click or tab and enter key\r\n // me.actionMenu.toggle()\r\n me.$(me.languageBottomSheet, me.context).toggle();\r\n }\r\n });\r\n })\r\n }\r\n\r\n toggleSMSNumberInput(el, payload) { // function for menudropdown ada compliance\r\n var me = this;\r\n if (!el) {\r\n return;\r\n }\r\n if (payload) {\r\n var container = me.$(payload.container, me.context)\r\n var element = me.$(payload.element, me.context)\r\n if (element.length > 0) {\r\n fixedElementToTop(container, element)\r\n }\r\n }\r\n // el.on('keyup click', function (e) {\r\n // if ((e.type == 'click' || e.type == 'keyup' && isAcceptKey(e))) { // check for mouse click or tab and enter key\r\n // me.toggleSmsBottomSheet();\r\n // }\r\n // });\r\n el.forEach(element => {\r\n \"keyup click\".split(\" \").forEach(function (e) {\r\n element?.addEventListener(e, (e) => {\r\n if ((e.type == 'click' || e.type == 'keyup' && isAcceptKey(e))) { // check for mouse click or tab and enter key\r\n me.toggleSmsBottomSheet();\r\n }\r\n });\r\n })\r\n })\r\n\r\n }\r\n\r\n createChatRoom(cb) {\r\n const me = this;\r\n if (!me.isChatroomAlive()) {\r\n // if chatroom is not alive and user click on transfer chat option\r\n me.options.execChatStartHandler(() => {\r\n me.chatStarted = true;\r\n logIt('loading chat room on 1st msg...');\r\n me.loadChatRoom(() => {\r\n if (cb && typeof cb === 'function') {\r\n cb();\r\n }\r\n });\r\n });\r\n }\r\n }\r\n showOverlayWithAction(wrapperEl, html, bindEvents, denyDisable) {\r\n var me = this;\r\n var messageElement = me.$('#apexchat', me.context)[0];\r\n if (messageElement) {\r\n wrapperEl.innerHTML = html;\r\n messageElement.insertBefore(wrapperEl, messageElement.firstChild);\r\n if (!denyDisable) {\r\n disableTypingInput.bind2(me)(me, me.options.inputContainer); //When chat is ended we should disable input feild.\r\n }\r\n if (bindEvents) {\r\n bindEvents();\r\n }\r\n }\r\n }\r\n\r\n showOptInConsentOverlay(m) {\r\n var me = this;\r\n var wrapper = document.createElement('div');\r\n if (!m.options || me.optInConsentTaken) {\r\n return;\r\n }\r\n\r\n var acceptText = '',\r\n rejectText = '',\r\n changeText = '',\r\n acceptTextOnSuccess = '',\r\n rejectTextOnSuccess = '',\r\n changeTextOnSuccess = '';\r\n m.options.forEach(function (v) {\r\n var obj = ApexChat.TryParse(v.option);\r\n switch (obj.consentType) {\r\n case 'Accept':\r\n acceptText = obj.text;\r\n acceptTextOnSuccess = obj.textOnSuccess;\r\n break;\r\n case 'Reject':\r\n rejectText = obj.text;\r\n rejectTextOnSuccess = obj.textOnSuccess;\r\n break;\r\n case 'Change':\r\n changeText = obj.text;\r\n changeTextOnSuccess = obj.textOnSuccess;\r\n break;\r\n default:\r\n }\r\n });\r\n\r\n me.showOverlayWithAction(\r\n wrapper,\r\n me.getOptInConsentHtml(wrapper, { text: m.text, acceptText, rejectText, changeText }),\r\n function () {\r\n // add show class to sms opt in parent div\r\n // after it's been loaded to the dom\r\n me.$('#livechat_opt_in_consent', me.context).wrap(\r\n ''\r\n );\r\n RunAsSoonAs(\r\n function () {\r\n me.$('#livechat_opt_in_consent', me.context).addClass(\r\n 'apexchat_optin_concent_show'\r\n );\r\n },\r\n function () {\r\n return me.$('#livechat_opt_in_consent', me.context).is(':visible');\r\n }\r\n );\r\n me.ADAHandler(me.context.querySelector('.livechat_optin_agree'), function () {\r\n me.optInConsentAccepted(m.id, acceptTextOnSuccess);\r\n });\r\n\r\n me.$('.livechat_optin_agree', me.context).bind('click', function () {\r\n me.optInConsentAccepted(m.id, acceptTextOnSuccess);\r\n });\r\n\r\n me.ADAHandler(me.context.querySelector('.livechat_optin_change'), function () {\r\n me.optInNumberChangeRequested(m.id, changeTextOnSuccess);\r\n });\r\n\r\n me.$('.livechat_optin_change', me.context).bind('click', function () {\r\n me.optInNumberChangeRequested(m.id, changeTextOnSuccess);\r\n });\r\n\r\n me.ADAHandler(me.context.querySelector('.livechat_optout'), function () {\r\n me.optInConsentRejected(m.id, rejectTextOnSuccess);\r\n });\r\n\r\n me.$('.livechat_optout', me.context).bind('click', function () {\r\n me.optInConsentRejected(m.id, rejectTextOnSuccess);\r\n });\r\n },\r\n true\r\n );\r\n }\r\n showWarning(cb) {\r\n var me = this;\r\n me.$('.livechat-warning-wrapper', me.context).addClass('livechat-warnin-show');\r\n if (typeof cb === 'function') {\r\n cb();\r\n }\r\n }\r\n\r\n showDisclaimerOverlay(disclaimerText) {\r\n var me = this;\r\n var wrapper = document.createElement('div');\r\n // if (!m.options || me.disclaimerTaken) {\r\n // return;\r\n // }\r\n if (Cookies.get(TempCache.USER_REACT_ON_LOC_DISCLAIMER, true)) {\r\n return;\r\n }\r\n var acceptText = 'Yes',\r\n rejectText = 'No',\r\n changeText = '',\r\n acceptTextOnSuccess = '',\r\n rejectTextOnSuccess = '',\r\n changeTextOnSuccess = '',\r\n decliningBoxText =\r\n 'Without your consent, the chat will conclude. Would you like to provide consent and continue the chat?',\r\n text = disclaimerText;\r\n me.showOverlayWithAction(\r\n wrapper,\r\n me.getDisclaimerHtml(wrapper, {\r\n text,\r\n decliningBoxText,\r\n acceptText,\r\n rejectText,\r\n changeText\r\n }),\r\n function () {\r\n // add show class to sms opt in parent div\r\n // after it's been loaded to the dom\r\n\r\n me.$('#livechat_disclaimer_consent', me.context).wrap(\r\n ''\r\n );\r\n RunAsSoonAs(\r\n function () {\r\n me.$('#livechat_disclaimer_consent', me.context).addClass(\r\n 'apexchat_disclaimer_show'\r\n );\r\n me.$('.livechat_consent_warning', me.context).on('click', function () {\r\n me.$(this).parents('.apexchat_overlay_content').hide();\r\n me.showWarning();\r\n });\r\n },\r\n function () {\r\n return me.context.querySelector('#livechat_disclaimer_consent')?.style.display !== 'none'\r\n }\r\n );\r\n var agreeButtons = me.context.querySelectorAll('.livechat_consent_agree');\r\n agreeButtons.forEach(button => {\r\n me.ADAHandler(button, function () {\r\n me.disclaimerAccepted(1);\r\n });\r\n\r\n button.addEventListener('click', function () {\r\n me.disclaimerAccepted(1);\r\n });\r\n })\r\n\r\n\r\n me.ADAHandler(me.context.querySelector('.livechat_consent_deny'), function () {\r\n me.disclaimerRejected(2);\r\n });\r\n\r\n me.context.querySelector('.livechat_consent_deny').addEventListener('click', function () {\r\n me.disclaimerRejected(2);\r\n });\r\n },\r\n true\r\n );\r\n }\r\n\r\n removeOptInConsentOverlay() {\r\n var me = this;\r\n me.$('#livechat_opt_in_consent', me.context).removeClass('apexchat_optin_concent_show');\r\n setTimeout(() => {\r\n me.$('#livechat_opt_in_consent', me.context).remove();\r\n me.$('#livechat_opt_in_consent_wrapper', me.context).remove();\r\n }, 500)\r\n\r\n }\r\n\r\n removeDisclaimerOverlay() {\r\n var me = this;\r\n me.$('#livechat_disclaimer_consent', me.context).removeClass('apexchat_optin_concent_show');\r\n\r\n setTimeout(() => {\r\n me.$('#livechat_disclaimer_consent', me.context).remove();\r\n }, 500)\r\n }\r\n\r\n optInConsentAccepted(chatLogId, postText) {\r\n var me = this;\r\n me.optInConsentTaken = true;\r\n me.sendMessage(me.$(me.messageInput, me.context));\r\n me.postMessage({\r\n event: ChatEvents.OnChatOptInConsentAccepted,\r\n data: {\r\n chatId: me.getChatId(),\r\n consentGiven: me.optInConsentTaken,\r\n chatLogId: chatLogId,\r\n textOnSuccess: postText\r\n }\r\n });\r\n me.removeOptInConsentOverlay();\r\n }\r\n\r\n optInConsentRejected(chatLogId, postText) {\r\n var me = this;\r\n me.optInConsentTaken = false;\r\n me.sendMessage(me.$(me.messageInput, me.context));\r\n me.postMessage({\r\n event: ChatEvents.OnChatOptInConsentRejected,\r\n data: {\r\n chatId: me.getChatId(),\r\n consentGiven: me.optInConsentTaken,\r\n chatLogId: chatLogId,\r\n textOnSuccess: postText\r\n }\r\n });\r\n me.removeOptInConsentOverlay();\r\n }\r\n\r\n disclaimerAccepted(postAction) {\r\n var me = this;\r\n me.disclaimerTaken = true;\r\n setTimeout(() => {\r\n me.$('#livechat_disclaimer_consent_wrapper', me.context).hide();\r\n }, 500)\r\n RunAsSoonAs(\r\n function () {\r\n Cookies.set(TempCache.USER_REACT_ON_LOC_DISCLAIMER, true);\r\n me.postMessage({\r\n event: ChatEvents.OnChatDisclaimerAccepted,\r\n data: { chatId: me.getChatId(), action: postAction }\r\n });\r\n },\r\n function () {\r\n return typeof me.getChatId() !== 'undefined';\r\n }\r\n );\r\n me.removeDisclaimerOverlay();\r\n }\r\n\r\n disclaimerRejected(postAction) {\r\n var me = this;\r\n me.$('#livechat_disclaimer_consent', me.context).css('cursor', 'wait');\r\n me.disclaimerTaken = true;\r\n setTimeout(() => {\r\n me.$('#livechat_disclaimer_consent_wrapper', me.context).hide();\r\n }, 500)\r\n RunAsSoonAs(\r\n function () {\r\n Cookies.set(TempCache.USER_REACT_ON_LOC_DISCLAIMER, true);\r\n me.postMessage({\r\n event: ChatEvents.OnChatDisclaimerRejected,\r\n data: { chatId: me.getChatId(), action: postAction }\r\n });\r\n },\r\n function () {\r\n return typeof me.getChatId() !== 'undefined';\r\n }\r\n );\r\n me.removeDisclaimerOverlay();\r\n me.removeOptInConsentOverlay();\r\n }\r\n\r\n optInNumberChangeRequested(chatLogId, postText) {\r\n var me = this;\r\n me.$(me.messageInput, me.context).val('').focus();\r\n me.postMessage({\r\n event: ChatEvents.OnChatOptInConsentAcceptedButNumberChangeRequested,\r\n data: {\r\n chatId: me.getChatId(),\r\n consentGiven: me.optInConsentTaken,\r\n chatLogId: chatLogId,\r\n textOnSuccess: postText,\r\n changeRequested: true\r\n }\r\n });\r\n me.removeOptInConsentOverlay();\r\n }\r\n /**\r\n * Handles the Date of Birth (DOB) message by disabling pointer events\r\n * for the previous BottomSheet DOB input element in the chat log.\r\n * and if a previous DOB input element is found, it sets its pointer\r\n * events to 'none' after a delay. This ensures that the element is\r\n * no longer interactive.\r\n */\r\n handleDateTimeDOBMessage() {\r\n var me = this;\r\n try {\r\n const chatLogLength = me.chatLogArray?.length;\r\n if (chatLogLength) {\r\n const uniqChatArray = getUniqueValueArray(me.chatLogArray, \"id\")\r\n const previousMsg = uniqChatArray[uniqChatArray.length - 2];\r\n if (previousMsg) {\r\n setTimeout(() => {\r\n const prevBottomSheetDOBInput = me.context.querySelector(`#livechat_qt_dob_input_${previousMsg.id}`)\r\n if (prevBottomSheetDOBInput) {\r\n prevBottomSheetDOBInput.style.pointerEvents = 'none';\r\n }\r\n }, 1000); // wait for chat UI to be loaded\r\n }\r\n }\r\n } catch (error) {\r\n console.error(error)\r\n }\r\n }\r\n}\r\n","const QuestionTypeVersion = {\r\n Classical: 0,\r\n RoundedDynamic: 1\r\n};\r\nexport default QuestionTypeVersion;\r\n","import restartChatRDPlusThemeTemplate from '../../templates/dialog/RDPlusTheme/restart_chat_template.ejs'\r\nimport restartChatTemplate from '../../templates/dialog/RDTheme/restart_chat_template.ejs'\r\n\r\nconst importEndChatOverlaySheetTemplateFactory = (options = {}) => {\r\n if (ApexChat.IsRoundedDynamicPlusTheme) {\r\n return {\r\n restartChatTemplate: restartChatRDPlusThemeTemplate(options),\r\n }\r\n }\r\n return {\r\n restartChatTemplate: restartChatTemplate(options),\r\n }\r\n\r\n};\r\nexport default importEndChatOverlaySheetTemplateFactory;\r\n","import getBody from './getBody';\r\nimport observe from './observe';\r\n\r\nconst ApexChatTitle = {\r\n TITLE_FLASH_INTERVAL: 1,\r\n set(title) {\r\n document.title = title;\r\n },\r\n flash() {\r\n window.clearInterval(document.flashInterval);\r\n document.flashInterval = window.setInterval(\r\n ApexChatTitle.toggle,\r\n 1 * 1000\r\n // TITLE_FLASH_INTERVAL * 1000\r\n );\r\n if (!getBody().monitoredForTitleFlash) {\r\n observe(window, 'click', ApexChatTitle.stopFlashing);\r\n observe(getBody(), 'click', ApexChatTitle.stopFlashing);\r\n observe(getBody(), 'keypress', ApexChatTitle.stopFlashing);\r\n getBody().monitoredForTitleFlash = true;\r\n }\r\n },\r\n stopFlashing() {\r\n window.clearInterval(document.flashInterval);\r\n if (document.originalTitle) {\r\n document.title = document.originalTitle;\r\n }\r\n },\r\n toggle() {\r\n if (!document.originalTitle) {\r\n document.originalTitle = document.title;\r\n }\r\n if (document.title == document.originalTitle) {\r\n document.title = `(New Message) ${document.originalTitle}`;\r\n } else {\r\n document.title = document.originalTitle;\r\n }\r\n }\r\n};\r\nexport default ApexChatTitle;\r\n","module.exports = function(obj) {\nobj || (obj = {});\nvar __t, __p = '';\nwith (obj) {\n__p += '
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n The previous chat session has ended\\r\\n
\\r\\n
\\r\\n Start New Chat\\r\\n
\\r\\n
\\r\\n Close\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \"logo\"\\r\\n
\\r\\n \\r\\n
\\r\\n Hello.\\r\\n
\\r\\n
We are ONLINE!
We hate to see you go.
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \"Live\\r\\n
\\r\\n
Elaine
\\r\\n
\\r\\n
\\r\\n <#=agentName#>\\r\\n
\\r\\n
\\r\\n Online Agent\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n Mute\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n ' +\n((__t = (headerDisclaimer )) == null ? '' : __t) +\n'\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n Switch from live chat session to SMS conversation on your phone\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n Convert this chat to text\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n Invalid phone number\\r\\n You have already been contacted\\r\\n
\\r\\n Continue\\r\\n \\r\\n Hidden Continue\\r\\n \\r\\n \\r\\n Cancel \\r\\n \\r\\n
\\r\\n
    \\r\\n
    \\r\\n \\r\\n Continue\\r\\n \\r\\n
    \\r\\n

    \\r\\n By clicking continue you are agreeing to receive text messages.\\r\\n Carrier message/data rates may apply.\\r\\n

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n Skip phone number\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    ';\n\n}\nreturn __p\n}","module.exports = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n__p += '
    \\r\\n

    \\r\\n \\r\\n ' +\n((__t = (participantDisplayName)) == null ? '' : __t) +\n'\\r\\n \\r\\n ' +\n((__t = (text)) == null ? '' : __t) +\n'\\r\\n \\r\\n

    \\r\\n
    \\r\\n 0 || participantId === -7){ ;\n__p += ' apexchat_agent apexchat_rd_received';\n};\n__p += '\">\\r\\n \\r\\n
    \\r\\n ';\n if (userId !==0 && handlerImageUrl) { ;\n__p += '\\r\\n
    \\r\\n \"Live\\r\\n
    \\r\\n ';\n } ;\n__p += '\\r\\n
    \\r\\n ' +\n((__t = (text )) == null ? '' : __t) +\n'\\r\\n
    \\r\\n
    \\r\\n\\r\\n\\r\\n\\r\\n\\r\\n 0){ ;\n__p += ' apexchat_element_hide';\n};\n__p += '\"> -->\\r\\n \\r\\n ' +\n((__t = (ApexChat.getCurrentFormatedDateTime(createdOn, 'hh:mmtt' ) )) == null ? '' : __t) +\n'\\r\\n\\r\\n';\n\n}\nreturn __p\n}","import debounce from \"./debounce\";\r\n\r\n/**\r\n * Applies classes to the given textarea and its container based on the number\r\n * of lines in the textarea. The classes are determined by the given object\r\n * where the keys are the number of lines and the values are the class to apply.\r\n * If the number of lines is greater than the number of keys in the object, the\r\n * class for the maximum number of lines is used.\r\n *\r\n * @param {Object} options\r\n * @param {string} options.textarea - The selector for the textarea\r\n * @param {string} options.wrapper - The selector for the container for the\r\n * textarea\r\n * @param {string} options.mainWrapper - The selector for the main application\r\n * container\r\n * @param {Object} options.classes - The object mapping the number of lines to\r\n * the class to apply\r\n */\r\nconst applyResizeClassOnInput = (options) => {\r\n\r\n const { me = {}, textarea, wrapper, mainWrapper, classes, cleanup = false } = options;\r\n\r\n\r\n const debouncedAutoScroll = debounce(() => {\r\n me.autoScroll && me.autoScroll();\r\n }, 500); // Adjust delay as needed\r\n\r\n const textareaElement = me.$(textarea, me.context)?.[0];\r\n const wrapperElement = me.$(wrapper, me.context);\r\n const mainWrapperIds = mainWrapper.split(',');\r\n const domId = mainWrapperIds[0];\r\n const windowedId = mainWrapperIds[1];\r\n const exitpopupId = mainWrapperIds[2];\r\n let mainWrapperElement = me.$(domId, me.context);\r\n if (mainWrapperElement.length == 0) {\r\n mainWrapperElement = me.$(windowedId, me.context);\r\n } else if (mainWrapperElement.length == 0) {\r\n mainWrapperElement = me.$(exitpopupId, me.context);\r\n }\r\n if (!textareaElement) {\r\n console.error(`Textarea with selector '${textarea}' not found.`);\r\n return;\r\n }\r\n const removeAllClasses = () => {\r\n Object.values(classes).forEach(className => {\r\n textareaElement.classList.remove(className);\r\n wrapperElement.removeClass(`${className}_textarea_wrapper`);\r\n mainWrapperElement.removeClass(`${className}_app_wrapper`);\r\n });\r\n };\r\n\r\n // If cleanup is true, remove all classes and exit\r\n if (cleanup) {\r\n removeAllClasses();\r\n return;\r\n }\r\n // Helper function to count the number of lines in the textarea\r\n function getLineCount(textarea) {\r\n const lineHeight = parseFloat(getComputedStyle(textarea).lineHeight);\r\n const contentHeight = textarea.scrollHeight;\r\n\r\n // Ensure a minimum of 1 line is counted, or 0 if the textarea is empty\r\n const lineCount = Math.max(1, Math.floor(contentHeight / lineHeight));\r\n\r\n // If the textarea is empty, return 1 (assuming 1 line for an empty textarea)\r\n if (!textarea.value.trim()) {\r\n return 1;\r\n }\r\n\r\n return lineCount;\r\n }\r\n\r\n // Update classes based on the number of lines\r\n function updateClasses() {\r\n const lineCount = getLineCount(textareaElement);\r\n // Remove all line-related classes from all elements\r\n Object.values(classes).forEach(className => {\r\n textareaElement.classList.remove(className);\r\n wrapperElement.removeClass(`${className}_textarea_wrapper`);\r\n mainWrapperElement.removeClass(`${className}_app_wrapper`);\r\n });\r\n\r\n // Add the appropriate class for the current line count\r\n if (classes[lineCount]) {\r\n textareaElement.classList.add(classes[lineCount]);\r\n wrapperElement.addClass(`${classes[lineCount]}_textarea_wrapper`);\r\n mainWrapperElement.addClass(`${classes[lineCount]}_app_wrapper`);\r\n } else if (lineCount > Object.keys(classes).length - 1) { // Dynamically determine the threshold for 'max'\r\n textareaElement.classList.add(classes.max);\r\n wrapperElement.addClass(`${classes.max}_textarea_wrapper`);\r\n mainWrapperElement.addClass(`${classes.max}_app_wrapper`);\r\n }\r\n debouncedAutoScroll();\r\n }\r\n\r\n // Attach event listener to update classes on input\r\n // textareaElement.addEventListener('input', updateClasses);\r\n\r\n // Initial update\r\n updateClasses();\r\n}\r\n\r\nexport default applyResizeClassOnInput;","module.exports = function(obj) {\nobj || (obj = {});\nvar __t, __p = '';\nwith (obj) {\n__p += '
    \\r\\n
    \\r\\n\\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n \"logo\"\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \"Live\\r\\n
    \\r\\n
    \\r\\n ' +\n((__t = (agentName)) == null ? '' : __t) +\n'\\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n ' +\n((__t = (companyName)) == null ? '' : __t) +\n'\\r\\n
    \\r\\n \\r\\n Chatting with ' +\n((__t = (agentName)) == null ? '' : __t) +\n'\\r\\n
    \\r\\n
    \\r\\n Chatting with ' +\n((__t = (agentName)) == null ? '' : __t) +\n'\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n ' +\n((__t = (sidePanelWelcomeText)) == null ? '' : __t) +\n'\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n ' +\n((__t = (regionLabel)) == null ? '' : __t) +\n'\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n Mute\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n Menu\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n ' +\n((__t = (poweredBy)) == null ? '' : __t) +\n'\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n ' +\n((__t = (chatTitle)) == null ? '' : __t) +\n'\\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n ' +\n((__t = (headerDisclaimer )) == null ? '' : __t) +\n'\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n Switch from live chat session to SMS conversation on your phone\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n ' +\n((__t = ( getFormatedDay )) == null ? '' : __t) +\n'\\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \"Live\\r\\n
    \\r\\n
    \\r\\n ' +\n((__t = (agentName)) == null ? '' : __t) +\n'\\r\\n
    \\r\\n
    \\r\\n is typing\\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n Invalid phone number\\r\\n You have\\r\\n already been contacted\\r\\n
    \\r\\n
    \\r\\n\\r\\n Continue\\r\\n \\r\\n Hidden Continue\\r\\n \\r\\n
    \\r\\n \\r\\n Cancel \\r\\n \\r\\n
    \\r\\n
      \\r\\n
      \\r\\n \\r\\n Continue\\r\\n \\r\\n
      \\r\\n

      \\r\\n By clicking continue you are agreeing to receive text messages.\\r\\n Carrier message/data rates may apply.\\r\\n

      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n \\r\\n
      \\r\\n\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
      \\r\\n
      \\r\\n Skip phone number\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n';\n\n}\nreturn __p\n}","const ApplySequenceCssClasses = function (me) {\r\n const systemMessages = me.context.querySelectorAll('.system_message');\r\n\r\n // if (systemMessages.length) {\r\n // systemMessages.forEach((message, index) => {\r\n // const messageText = message.querySelector('.apexchat_rd_msg_text');\r\n // const timer = message.querySelector('.apexchat_rd_timer_span');\r\n\r\n // if (messageText) {\r\n // const parentWidth = message.offsetWidth; // The `.system_message` itself\r\n // const textWidth = messageText.scrollWidth; // Get actual content width\r\n // const textHeight = messageText.scrollHeight; // Get actual content width\r\n // const maxWidth = parentWidth - (80 * 2); // Parent width - 152px (76px timer on both sides)\r\n // if (textWidth <= maxWidth) {\r\n // messageText.style.margin = \"0 auto\"; // Center align\r\n // message.classList.add(\"timer_center\");\r\n // message.classList.remove(\"content_left\");\r\n // message.classList.remove(\"content_full_width\");\r\n\r\n // } else if (textHeight > 38) {\r\n // message.classList.add(\"content_full_width\");\r\n // message.classList.remove(\"content_left\");\r\n // message.classList.remove(\"timer_center\");\r\n // } else {\r\n // messageText.style.margin = \"\"; // Default left align\r\n // message.classList.add(\"content_left\");\r\n // message.classList.remove(\"timer_center\");\r\n // message.classList.remove(\"content_full_width\");\r\n // }\r\n // }\r\n\r\n // // Find the next message element\r\n // const nextMessage = systemMessages[index + 1];\r\n\r\n // if (nextMessage) {\r\n // if (nextMessage.classList.contains(\"apexchat_message_left\")) {\r\n // message.classList.add(\"timer_right\");\r\n // message.classList.remove(\"timer_left\");\r\n // } else if (nextMessage.classList.contains(\"apexchat_message_right\")) {\r\n // message.classList.add(\"timer_left\");\r\n // message.classList.remove(\"timer_right\");\r\n // }\r\n // }\r\n // });\r\n // }\r\n\r\n const messages = me.context.querySelectorAll(\r\n '.apexchat_message_left:not(.system_message), .apexchat_message_right:not(.system_message)'\r\n );\r\n // Loop through all the messages\r\n messages.forEach((message, index) => {\r\n const isLeft = message.classList.contains('apexchat_message_left');\r\n const isRight = message.classList.contains('apexchat_message_right');\r\n\r\n // Remove sequence classes if they already exist\r\n message.classList.remove('message_sequence_start', 'message_sequence_end');\r\n\r\n // Check for left group\r\n if (isLeft) {\r\n // Check if it's the first left element\r\n if (index === 0 || messages[index - 1].classList.contains('apexchat_message_right')) {\r\n message.classList.add('message_sequence_start');\r\n }\r\n\r\n // Check if it's the last left element or the next is a right element\r\n if (index === messages.length - 1 || messages[index + 1].classList.contains('apexchat_message_right')) {\r\n message.classList.add('message_sequence_end');\r\n }\r\n }\r\n\r\n // Check for right group\r\n if (isRight) {\r\n // If it's the only right element, add both sequence classes\r\n if (\r\n (index === 0 || messages[index - 1].classList.contains('apexchat_message_left')) &&\r\n (index === messages.length - 1 || messages[index + 1].classList.contains('apexchat_message_left'))\r\n ) {\r\n message.classList.add('message_sequence_start', 'message_sequence_end');\r\n } else {\r\n // For the first right element in a group, add \"message_sequence_start\"\r\n if (index === 0 || messages[index - 1].classList.contains('apexchat_message_left')) {\r\n message.classList.add('message_sequence_start');\r\n }\r\n // For the last right element in a group, add \"message_sequence_end\"\r\n if (index === messages.length - 1 || messages[index + 1].classList.contains('apexchat_message_left')) {\r\n message.classList.add('message_sequence_end');\r\n }\r\n }\r\n }\r\n });\r\n};\r\n\r\nexport default ApplySequenceCssClasses;\r\n","module.exports = function(obj) {\nobj || (obj = {});\nvar __t, __p = '';\nwith (obj) {\n__p += '
      \\r\\n
      \\r\\n Can we contact you via text messaging regarding your inquiry?\\r\\n
      \\r\\n
      \\r\\n \\r\\n \\r\\n \\r\\n
      \\r\\n
      ';\n\n}\nreturn __p\n}","import WidgetTypes from '../enums/WidgetTypes';\r\nimport TempCache from '../enums/TempCache';\r\nimport { ChatState } from '../enums/Enum';\r\nimport Cookies from '../hooks/Cookies';\r\n\r\nexport default class ChatCookieHandler {\r\n DeleteCookie() {\r\n Cookies.set(TempCache.CHAT_STATE, ChatState.Closed);\r\n // Delete the CHAT_IN_PROGRESS COOKIE that was set on chat startup in invitation\r\n Cookies.del(TempCache.VISITORINFO_IN_PROGRESS_COOKIE);\r\n Cookies.del(TempCache.CHAT_IN_PROGRESS_COOKIE);\r\n Cookies.del(WidgetTypes.ExitPopup);\r\n Cookies.del(WidgetTypes.PreChat);\r\n Cookies.del(WidgetTypes.VideoGreetInvitation);\r\n Cookies.del(TempCache.SHOW_OPERATOR_NOT_FOUND_OVERLAY);\r\n Cookies.del('apexchat_live_contactInfo');\r\n // chat's over; if they leave the page, it starts fresh\r\n Cookies.del(TempCache.TRANSFER_TO_LIVE_AGENT);\r\n Cookies.del(TempCache.USER_REACT_ON_LOC_DISCLAIMER);\r\n Cookies.del(TempCache.CHAT_STATE);\r\n Cookies.del(TempCache.CHAT_ID_COOKIE);\r\n Cookies.del(TempCache.CHAT_TOKEN_COOKIE);\r\n Cookies.del(TempCache.IS_PAGE_REFRESHED); //missing state to clean up when chat ends\r\n Cookies.del(TempCache.APEXCHAT_PRECHAT_MESSAGE_IDS_COOKIE);\r\n Cookies.del(TempCache.PreChat_Message_Sent);\r\n Cookies.del(WidgetTypes.DOMUIController); //remove domuicontroller cookies as it refresh it will create a new one\r\n Cookies.del('apexchat_video_greet_maximized'); // delete video greet cookies\r\n ApexChat.preLoadedOptions = null;\r\n if (typeof ApexChatStartData !== 'undefined') {\r\n ApexChatStartData = null;\r\n }\r\n ApexChat.IsShowDisclaimeOverlay = false;\r\n ApexChat.chatArray = []; //CHAT-8365 After chat end array should be re-initiated;\r\n ApexChat.allHistoryMessages = []; //After chat end all history messages should be clear\r\n }\r\n}\r\n","module.exports = function(obj) {\nobj || (obj = {});\nvar __t, __p = '';\nwith (obj) {\n__p += '
      \\r\\n
      \\r\\n

      Are you sure?

      \\r\\n
      \\r\\n

      \\r\\n ' +\n((__t = (decliningBoxText )) == null ? '' : __t) +\n'\\r\\n

      \\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n
      ';\n\n}\nreturn __p\n}","import VAChatRestartOverlayTemplate from '../../templates/dialog_overlays/RDTheme/VAChatRestartOverlay.ejs';\r\nimport VAChatRestartOverlayRDPlusThemeTemplate from '../../templates/dialog_overlays/RDPlusTheme/VAChatRestartOverlay.ejs';\r\n\r\nconst ImportRestartChatOverlayFactory = () => {\r\n if (ApexChat.IsRoundedDynamicPlusTheme) {\r\n return {\r\n VAChatRestartOverlayTemplate: VAChatRestartOverlayRDPlusThemeTemplate\r\n };\r\n }\r\n return {\r\n VAChatRestartOverlayTemplate\r\n };\r\n};\r\nexport default ImportRestartChatOverlayFactory;\r\n","/**\r\n * Helper method to watch changes inside a target element.\r\n * @param {HTMLElement} targetElement - The element to observe.\r\n * @param {Function} callback - Function to execute when changes occur.\r\n * @returns {MutationObserver} The created observer instance.\r\n */\r\nfunction watchElementChanges(targetElement, callback) {\r\n if (!targetElement) {\r\n throw new Error(\"Target element is required.\");\r\n }\r\n if (typeof callback !== \"function\") {\r\n throw new Error(\"Callback must be a function.\");\r\n }\r\n\r\n // Create a MutationObserver instance\r\n const observer = new MutationObserver((mutationsList) => {\r\n for (const mutation of mutationsList) {\r\n if (mutation.type === 'childList') {\r\n callback(mutation);\r\n }\r\n }\r\n });\r\n\r\n // Configure the observer to watch for changes in child elements\r\n const config = { childList: true, subtree: true };\r\n\r\n // Start observing the target element\r\n observer.observe(targetElement, config);\r\n\r\n // Return the observer instance to allow for manual disconnect if needed\r\n return observer;\r\n}\r\n\r\nexport default watchElementChanges;\r\n","/**\r\n * Toggles send button classes based on the value of the text input.\r\n * If the value is not empty, it adds the active class and removes the inactive class.\r\n * If the value is empty, it adds the inactive class and removes the active class.\r\n * If forceInactive is true, it adds the inactive class and removes the active class.\r\n * @param {{e: object, me: object, activeClass: string, inactiveClass: string, forceInactive: boolean}} options\r\n * @param {object} options.e - The event object.\r\n * @param {object} options.me - The instance of the ChatUIController class.\r\n * @param {string} [options.activeClass='livechat_send_message_button_active'] - The class name to add to the send button when active.\r\n * @param {string} [options.inactiveClass='livechat_send_message_button_inactive'] - The class name to add to the send button when inactive.\r\n * @param {boolean} [options.forceInactive=false] - Whether to remove the active class regardless of the value of the text input.\r\n */\r\nconst toggleSendButtonClasses = (props) => {\r\n const {\r\n e = {},\r\n me = {},\r\n activeClass = 'livechat_send_message_button_active',\r\n inactiveClass = 'livechat_send_message_button_inactive',\r\n forceInactive = false,\r\n } = props;\r\n const value = e?.target?.value;\r\n if (value?.length > 0) {\r\n me.clickButton.classList.add(activeClass);\r\n me.clickButton.classList.remove(inactiveClass);\r\n } else {\r\n me.clickButton.classList.add(inactiveClass);\r\n me.clickButton.classList.remove(activeClass);\r\n }\r\n if (forceInactive) {\r\n me.clickButton.classList.add(inactiveClass);\r\n me.clickButton.classList.remove(activeClass);\r\n }\r\n}\r\nexport default toggleSendButtonClasses;\r\n","const To_ascii = {\r\n 188: '44',\r\n 109: '45',\r\n 190: '46',\r\n 191: '47',\r\n 192: '96',\r\n 220: '92',\r\n 222: '39',\r\n 221: '93',\r\n 219: '91',\r\n 173: '45',\r\n 187: '61', // IE Key codes\r\n 186: '59', // IE Key codes\r\n 189: '45' // IE Key codes\r\n};\r\nexport default To_ascii;\r\n","module.exports = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n__p += '
      \\r\\n

      \\r\\n \\r\\n ' +\n((__t = (participantDisplayName)) == null ? '' : __t) +\n'\\r\\n \\r\\n ' +\n((__t = (text)) == null ? '' : __t) +\n'\\r\\n \\r\\n

      \\r\\n
      \\r\\n 0 || participantId === -7){ ;\n__p += ' apexchat_agent apexchat_rd_received';\n};\n__p += '\">\\r\\n
      \\r\\n

      0){ ;\n__p += 'Left';\n};\n__p += ' apexchat_rd_delay_s apexchat_text\"\\r\\n id=\"apexchat_chatlog_' +\n((__t = (id)) == null ? '' : __t) +\n'\">\\r\\n ' +\n((__t = (text)) == null ? '' : __t) +\n'\\r\\n

      \\r\\n
      \\r\\n\\r\\n\\r\\n\\r\\n\\r\\n 0){ ;\n__p += ' apexchat_element_hide';\n};\n__p += '\"> -->\\r\\n \\r\\n ' +\n((__t = (ApexChat.getCurrentFormatedDateTime(createdOn, 'hh:mmtt' ) )) == null ? '' : __t) +\n'\\r\\n\\r\\n';\n\n}\nreturn __p\n}","module.exports = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n__p += ' 0){ ;\n__p += ' apexchat_agent apexchat_rd_received';\n};\n__p += ' ';\n if(userId === -3){ ;\n__p += ' apexchat_rd_received';\n};\n__p += ' \">\\r\\n
      \\r\\n

      \\r\\n ' +\n((__t = (text )) == null ? '' : __t) +\n'\\r\\n

      \\r\\n
      \\r\\n\\r\\n 0){ ;\n__p += ' apexchat_rd_float_left ';\n};\n__p += '\">\\r\\n \\r\\n ' +\n((__t = (ApexChat.getCurrentFormatedDateTime(createdOn, 'hh:mmtt' ) )) == null ? '' : __t) +\n'\\r\\n\\r\\n 0){ ;\n__p += ' apexchat_element_hide';\n};\n__p += '\">\\r\\n \\r\\n ' +\n((__t = (ApexChat.getCurrentFormatedDateTime(createdOn, 'hh:mmtt' ) )) == null ? '' : __t) +\n'\\r\\n\\r\\n
      \\r\\n ' +\n((__t = (ApexChat.getCurrentFormatedDateTime(createdOn, 'hh:mmtt' ) )) == null ? '' : __t) +\n'\\r\\n
      \\r\\n
      \\r\\n ' +\n((__t = (ApexChat.getCurrentFormatedDateTime(createdOn, 'hh:mmtt' ) )) == null ? '' : __t) +\n'\\r\\n
      ';\n\n}\nreturn __p\n}"],"names":["module","exports","obj","__t","__p","arr","key","arguments","length","undefined","getValue","item","split","reduce","k","acc","value","some","existingItem","push","StringUtils","isNull","str","isNullOrWhiteSpace","match","message","domMessageTemplate","ApexChat","IsRoundedDynamicPlusTheme","rdPlusDomMessageTemplate","rdDomMessageTemplate","options","desclaimerTemplate","desclaimerRDPlusThemeTemplate","desclaimerConfirmTemplate","desclaimerConfirmRDPlusThemeTemplate","__j","Array","prototype","join","print","call","userId","handlerImageUrl","getCurrentFormatedDateTime","createdOn","msgText","matches","isRdTheme","messageTemplate","prefix","model","days","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday","officeHrs","forEach","index","replace","logIt","firstIndexOfColon","indexOf","day","substring","trim","fromTo","fromTime","toTime","validDay","validFromTime","validToTime","GlobalVariables","regexWeekDay","regexTime","e","order","timeFrom","timeTo","sort","a","b","result","officeHours_matches","filter","regexOfficeHours","er","fixedElementToTop","container","element","containerNode","elementNode","initialOffset","offsetTop","handleScroll","scrollTop","style","position","top","classList","add","remove","addEventListener","removeEventListener","PokeMessagesUIController","BaseClass","constructor","super","me","this","widget","WidgetTypes","PokeMessagesOverLay","view","setModel","show","addPokeMessage","pokeMessage","JSON","stringify","storageAPIExists","TempCache","POKE_MESSAGE_LastJoinBackTime","lastJoinBackTime","parseInt","getStorageAPIValue","getTime","render","PokeMessageView","context","identifier","overLayTargetElementSelector","overLayTemplate","messageContainer","messageTargetElementSelector","BackButtonSelector","btnBackSelector","overlayDisplayClass","pokeHistory","createArraySessionStorage","name","_save","sessionStorage","setItem","store","parse","getItem","prop","findIndex","avoidDuplicationById","avoidDuplicationByText","setOverLay","overlay","SimpleView","targetElementSelector","template","overLayModel","afterRender","addClass","querySelector","bindEvents","$BackBtn","ApexChatJquery","on","arg","storageAPI","Store","Date","publish","event","WidgetStates","Hidden","data","trigger","isTextDuplicate","msg","isIdDuplicate","id","messageModel","wrap","beforeRender","optinConsentTemplate","optinConsentRDPlusThemeTemplate","window","scrollIntoView","t","n","r","s","o","u","i","f","Error","code","l","require","CANCELED","setElementScroll","self","scrollTo","scrollLeft","animate","_scrollSettings","c","getBoundingClientRect","left","d","m","leftOffset","g","topOffset","h","p","Math","min","width","innerWidth","height","innerHeight","pageXOffset","pageYOffset","E","S","clientWidth","clientHeight","max","scrollWidth","scrollHeight","x","y","differenceX","differenceY","getTargetScrollLocation","target","align","now","startTime","time","endIterations","end","ease","requestAnimationFrame","setTimeout","raf","bind","transitionScrollTo","parentElement","passive","defaultIsScrollable","getComputedStyle","overflow","defaultValidTarget","isNaN","validTarget","isScrollable","tagName","ownerDocument","defaultView","ownerWindow","ParticipantsChanged","participants","config","isExitPopup","unique","displayName","currentlyAssigntoChat","RunAsSoonAs","participantsHasBeenGreaterThanOne","ended","hideWaitingIndicator","indicator","imageObjSelector","prevUrl","attr","agentName","userTitleSelector","innerText","imageUrl","AgentImageHandler","headerText","$","participantsSelector","participantsContainer","participantDisplayName","defaultTemplates","exitPopupThemeTemplate","exitPopupMessageTemplate","rdPlusTemplates","exitPopupRDPlusThemeTemplate","exitPopupMessageRDPlusThemeTemplate","participantId","EmojiUtils","emojiNames","emojiDecimalCodes","mappingCodes","clickableEmojisList","j","emoji","String","fromCodePoint","stringFromCharCode","_","codeUnits","codeLen","len","codePoint","RangeError","apply","Object","defineProperty","configurable","writable","fromCharCode","includes","search","start","createEmojiList","text","toEmoji","emojiInDecimal","Number","baseUrl","ajax","chatId","lng","url","LiveChatServiceUrl","type","PokeMessageModel","PokeMessages","getPokeMessages","acceptText","changeText","rejectText","func","timer","timeout","_len","args","_key","clearTimeout","ChatUIController","opt","assign","objectType","apologizeForWaitAfter","isRoundedDynamic","apologizeForWaitMessage","chatMode","elements","chatLogSelectorPrefix","oneTimeSoundSetup","mode","isFirstNotificationRendered","counterForQueuedTimers","INITIAL_DELAY_AGENT_PICKUP","INITIAL_DELAY_PRELOAD_GREETING","ADAHandler","preserveChatArray","widgetType","getContextId","aiBotEnabled","isTransferredToLiveAgent","allowSoundFloodingOnNewMesssage","removeUnnecessaryCookies","Remove","PreChat_Message_Sent","subscribe","ChatRoom","ChatEvents","OnSendMessageFailure","PreChat","MessageSent","questionType","ScriptsQuestionType","FullText","handleFullTextType","res","handleQuestionType","onOperatorNotAvailable","Cookies","set","SHOW_OPERATOR_NOT_FOUND_OVERLAY","showOperatorNotFoundOverlay","hidePokeMessages","onVideoGreetOverlay","showVideoGreetOverlay","customVisitorScript","runCustomVisitorScriptAfterSeconds","eval","log","LogLevel","Warn","currentText","skinInviteType","SkinInviteType","Image","isOpenForBusiness","ChatMode","DOM","invitationWidgetStyleCustom","mobileDOM_ChevronChatArrow","removeClass","test","navigator","userAgent","MSStream","blur","reposition","bind2","click","sendMessage","repositionFn","syncSize","isDOM","getQueryStringValue","isEPConnected","OnMessageArrived","onMessageArrived","initialLoad","cb","OnTypingArrived","onTypingArrived","OnChatJoinFailure","onChatJoinFailure","ChatIdleOut","endChat","OnSMSChatTransferring","renderUIOnChatTransfer","OnHistoryStartLoading","hideChatLog","OnHistoryLoadedCompletely","showChatLog","OnStopWaiting","stopWaiting","OnParticipantsChanged","onParticipantsChanged","OnHideWaitingIndicator","HideWaitingIndicator","OnCallStatusArrived","onCallStatusArrived","OnPredefinedPokeMessage","predefinedMsgs","agentParticipantId","ParticipantIds","isPredefinedResponse","showPokeMessages","OnChatEnded","onChatEnded","OnSendMessageSuccess","DOMUIController","OnTransferRequested","chatTransfer","CHAT_ID_COOKIE","isSMS","getChatId","Transfer","OnChatRestart","showChatRestartOverlay","EPUIController","getErrorCode","room","webSyncClient","getIsConnected","showChatEndedNotificationBar","showChatEndedNotificationEP","OnPokeMessageArrived","state","getStateValue","OnChatOptInConsentAccepted","publishOptInSelection","OnChatOptInConsentRejected","OnChatOptInConsentAcceptedButNumberChangeRequested","OnChatDisclaimerAccepted","publishDisclaimerSelection","OnChatDisclaimerRejected","OnWebToSmsRejected","publishConvertToSMSRejection","isPageRefreshed","changeState","toState","ChatStates","UIRendered","askConfirmation","flag","callback","confirm","console","error","messagesContainerSelector","watchElementChanges","ApplySequenceCssClasses","getCookieValue","retries","channel","onSuccess","clickSource","clickSourceId","observe","clickSourceClick","containerSelector","messageInput","textboxSelector","autoCompleteInput","messageInputContainer","inputContainerSelector","handlerImageSelector","querySelectorAll","minimizeButton","minimizeSelector","popoutButton","popoutSelector","closeButton","closeSelector","clickButton","clickSelector","messagesContainer","introContainer","introSelector","emoticonsArea","emoticonsAreaSelector","emoticonsButton","multiLanguage_dropdown_wrapper","multiLanguage_dropdown_wrapperSelector","scroller","scrollerSelector","typingIndicator","typingIndicatorSelector","headerDropdown","actionMenu","actionMenuSelector","restartVAChatActionMenuItem","restartVAChatSelector","popoutActionMenuItem","transferChatActionMenuItem","transferChatSelector","volumeMuteActionMenuItem","volumeMuteUnmute","minimize","popOut","autoComplete","is","soundControl","soundMute","soundUnmute","languageBottomSheet","smsBottomSheet","sender","children","keydown","onMessageTyping","focus","$txt","sendButtonDisableOrEnableForATA","ManageFocusOnKeyEvents","stopPropagation","isAcceptKey","toggle","hide","_countDownInterval","setInterval","updateCountdown","initialChat","chatModel","chatHeaderTemplate","parseTemplate","checkSpanishLanguage","html","setPlaceholder","ScriptsQuestionTypeToolTips","Spa","Text","emoticonContentContainer","emojisList","append","clickEmojis","openEmoticons","lastValue","dmp","diff_match_patch","textValue","getAttribute","text1","text2","diff","diff_main","diff_cleanupSemantic","patch_list","patch_make","patch_text","patch_toText","sendVisitorRealtimeTyping","isMobile","autoScroll","disclaimerSelector","CHAT_SOUND_ENABLED","hasUserGrantedSoundPermission","soundName","get","VISITOR_MESSAGE_SOUND","tune","playSound","headerDisclaimer","applyADAonEmojis","RunAfter","POKE_MESSAGE_CONTROLLER","isDisabled","find","Browser","isiOS","overlay_options","is_RD_EP","isEPChatClosed","epPokeOverlayTemplate","epPokeMessageTemplate","domPokeOverlayTemplate","domPokeMessageTemplate","userResponseText","msgTimeStamp","toLocaleTimeString","hour","minute","handleADA","emojiDiv","closeEmoticons","hasClass","css","display","isSkippable","isSkipped","isChatActive","QTRendererExt","isLastFullTextValidated","isForAIBot","chatMsg","isGreeting","shouldRenderResponseAsText","questionTypeChatLogIdToBeUpdated","publishQuestionTypeResponse","skipFullTextType","simulatePredefinedResponse","IsShowDisclaimeOverlay","shouldShowLocationDisclaimer","showDisclaimerOverlay","locationDisclaimerText","predefinedMessageId","visitor","allowDupe","showTime","questionTypeRenderer","afterMCSelectionRD","postMessage","isFromPreChat","isExitPopupPredefinedMessage","handleExitPopupPredefinedQT","showTyptingIndicatorForAIBot","contactInfo","textContactInfo","timeCalendarOrText","renderer","visitorSelectedOptions","answers","questionTypeDisplayListForVisitor","chatLogId","setVisitorSelection","enableFullTextLogic","setInstruction","getQTPlaceHolder","maximize","afterSubmit","hideAll","TrueOrFalse","renderSelection","injectQuestionTypeRenderer","preloadOptions","preLoadedOptions","getPreloadedOptionsStorage","QuestionTypeRendererExtentions","initComponent","isUpdateSupported","sendButton","isBottomSheetSupported","applyNewDateTime","ExitPopup","inputContainer","preloadedOptionsStorage","localstorageAPIExists","TryParse","localStorageAPI","Get","restartOverlayView","elOverlay","getContainer","isViewRendered","videoGreetOverlayView","isOperatorAvailable","showOperatorOverlay","operatorNotAvailableMessage","isChatTransferredToOperator","chatTransferSuccussMessage","OnChatTransferredToOperator","agentNotFoundOverlayView","wrapper","document","createElement","optInConsentTaken","showOverlayWithAction","getEndChatSessionHtml","hideReInitOverlay","enableTypingInput","reInitializeChat","parent","currentOverlaySelector","headerMessage","_me$messagesContainer","_me$participantsConta","_me$participantsConta2","_me$introContainer","_me$introContainer2","actionMenuStartSMSChat","actionMenuLanguageSwitcher","innerHTML","OnChatReInit","wrapperDiv","divHtml","importEndChatOverlaySheetTemplateFactory","restartChatTemplate","className","getOptInConsentHtml","importOptinConsentTemplateFactory","getDisclaimerHtml","importedFactory","importDesclaimerOverlaySheetTemplateFactory","_ellipses","emojiCode","currentTarget","appendEmojiToInput","inputField","val","placeholder","toggleSendButtonClasses","hasScrollbar","elem_id","elem","getElementById","AIResponseReceived","leaveChat","Eng","stopPredefinedQueue","hasAnswerInQTChatLogIdToBeUpdated","chatEnded","removeSMSToWebNotification","endChatSession","waitedTooLongTimeout","waiting","resetWaiting","startWaiting","getRequestedTime","_domStartTime","fromQueryString","hasEnded","FAKE_AGENT_ID","fm","websync","client","meta","getMeta","showTyping","hideTyping","origin","_me$participantsConta3","clearInterval","_ended","ChatCookieHandler","DeleteCookie","callIndicatorSelector","status","_participantsHasBeenGreaterThanOne","agentTitle","afterSMSChatTransfer","disableTypingInput","systemMessageType","SystemMessageType","SMSTransferInProgress","SMSTransferred","smsTransferChatUI","transferStatus","transferStatusUpdate","classes","transferringContainer","transferredContainer","elStatusToShow","elStatusToHide","showElement","hideElement","SMS_TRANSFER_CHAT_DELAY","predefinedMsgsOnRefresh","msgDuration","totalDuration","isUserTyping","Closed","playSoundEPPredefinedMessage","removeTextFollowedByColon","answerScript","predefined","UserIds","simulated","delayTime","messageInterval","questionTypeDelay","PipedMessageHandlerSingleton","PipedMessageHandler","isValidPipedMessage","startPolling","init","startPollingCallback","lastPollingCallback","messageDisplayDuration","isLastPredefinedMessage","OnPredefinedCompleted","renderMultiLanguageDropDown","nonSMSLanguages","supportedLanguages","supportedLanguagesList","getNonSMSAndScriptLanguages","languages","languageFullName","toLowerCase","implementMultiLanguageSupport","getScriptBotLanguages","scriptBotLanguage","requestTransferringChat","requestTransferringChatToOtherLanguage","language","lang","isOpen","requestAgentForTransferChat","languageTransferRequest","chatLanguageName","enableChatTransfer","ChatTransfer","default","onTransferRequested","onTransferSuccess","queuePredefinedQTs","isPredefinedMsgsRendered","predefinedMsgArray","exitpopup","exitPopupMessages","_queueMessage","nextPredefinedMessage","predefinedMessagesQueue","dequeue","predefinedMessage","EP_PREDEFINED_AGENT_ID","isPredefinedMsg","accumulatedTime","duration","messageType","QTGridMessageType","agent_Script","None","renderPredefinedQTs","Queue","isPredefinedMessage","enqueue","scriptAnswerId","agentScriptAnswerId","agentScript","agentScriptOptions","messagePlaceholder","visitorResponseType","visitorResponseTypes","renderPredefinedMessages","countingArray","msgVar","msgNo","checkArrayDuplication","array","property","decodeHTML","publishPredefinedMessages","lastPredefinedMsg","startBatch","isPreDefinedMessagesSent","onFailure","endBatch","lastSplitMsgCallback","VideoGreet","errorMessage","isAIBotReply","isSystemMessage","SMSOptIn","WebToSMSNotification","notifyMessageHandled","each","disable","applyGrayBackground","system","TransferToLiveAgent","setTransferredToLiveAgent","virtualAssistantStatus","cleanInvalidHtml","nonVisitorSystem","shouldShowChatEndedMessage","CHAT_ENDED_MESSAGE","addOptionProperty","TimeTracker","check","questionTypeResponseChatLogId","lastLogMessage","lastMsgId","isChatEnded","questionTypeId","isLastMsgWasQType","isGreetingMessageQuestionType","isGreetingQuestionType","Default","bot","initialArgs","exitMessage","AUTOGREET_AGENT_ID","IS_GREETING_QUESTIONTYPE","isSplitMessage","handleMessage","async","botGuid","prechat","firstMessageArrived","enable","content","officeMessageTemplate","officeHrsValidationResult","isMessageCompanyHours","epOfficeHoursMessageTemplate","domOfficeHoursMessageTemplate","parseCompanyHours","cssClass","ImportEPTemplateFactory","ContinueChat","createMessageTemplateFactory","dupe","div","textContent","REMOVE_NON_ALPHANUMERIC","isIE8","arrayObjectIndexOf","getNotifyMessageHandler","APEXCHAT_PRECHAT_MESSAGE_SENT_COOKIE","isNewChat","GreetingShown","msgType","isVisitorResponse","VisitorResponse","setAttribute","chatLogArray","tabIndex","responseCallback","createChatRoom","isChatroomAlive","loadChatRoom","enableChatTransferCallback","showOperatorNotAvailableOverlayCb","afterFlatPickerLoaded","soundOnLastPipeMessage","isLastSplitMessage","beepAfterRender","conditions","notifyNewMessageArrived","_playSound","SIMULATED_AGENT_ID","isDocument","agentScriptDocuments","mqtMeta","instruction","inputTitle","isFullText","AppointmentScheduler","MultipleChoiceConsent","isUnread","showOptInConsentOverlay","shouldContinueMapping","shouldRenderWithDelay","processOnMessageArrived","isQuestionTypeOptionsAvailable","setVersion","QuestionTypeVersion","RoundedDynamic","alreadyMapped","isContinueMappingApplied","Continue_Mapping_Applied","Windowed","renderMessage","afterRenderMessage","hideTimeStampForPreviousMessages","handleWebToSmsNotification","shouldDisplayTypingIndicator","shouldBeQTType","shouldNotBeUserMessage","shouldNotBeHistoryMessage","shouldNotBeSplitPipedMessage","isQTNone","isLastPipedMessage","isQTFullText","shouldNotQTNoneFromPreChat","showTypingIndicatorThenDisplayMessage","indicatorDuration","onComplete","AIBot","getLastQuestionTypeForAIbot","fullTextResponse","decodeURI","FullTextVisitorResponse","FullTextAnswer","option","customRes","newMessageVisibility","newMessage","restartTimer","OnMessageIncoming","_hasMessages","autoPushUrls","els","href","opener","location","ex","isInDevMode","exception","retryCount","Debug","isDocuSignRequest","docusignMessage","wrapHTML","messageWrapper","textBox","handleDateTimeDOBMessage","scriptId","xhr","XMLHttpRequest","open","send","$wrapper","unbind","paddingBottom","paddingTop","transition","boxSizing","savePhoneNumber","maskedText","isSmsTransfer","phonemsg","getPhoneMessage","smsForm","WebSmsFormValidator","getWebSmsService","initiatedBy","chatInitiatedBy","phone","interceptorResults","interceptorResult","GetChatID","serviceUrl","msgsList","toArray","reverse","cleaningRegex","cleanedMaskedText","phoneMsgRendered","renderedmsgChatlogId","getCSSSelectorForRDThemeTimeStamp","getCSSSelectorForRDThemeToolTip","params","checkChatRoomLoaded","checkingInterval","sendMsgWhenChatroomAvailable","checkingChatRoom","transferChatWhenChatroomAvailable","sendLive","then","transferChat","isConnectionEstablished","sendTyping","TempStorageCache","INPUT_OLD_VALUE","err","which","To_ascii","hasOwnProperty","shiftKey","shiftUps","keyCode","typing","IDLE_TYPING_THRESHOLD","el","isEnterKeyPressed","preventDefault","txt","AllThatApply","v","Utils","disableElement","enableElement","recursively","onLiveArrived","liveChat","alert","onChatJoined","textInput","isLastMessageFullText","validateFullTextMessage","RunUntil","PoppedOut","googleAnalyticsObjectInit","LiveChatRoom","initChatRoom","ApexChatStartData","setChatId","token","setNewChat","clickTime","timeSpent","SUBSEQUENT_GREETING_COOKIE","setShortMinutes","reShowIntervalMinutes","isChatRoomV3Loaded","checkApexChatStartDataExists","ChatCloseWarningMessage","enableChatWindowCloseWarning","destroy","platform","soundManager","setup","ApexChatBaseUrl","flashVersion","preferFlash","onready","ontimeout","defaultOptions","volume","visitorEndSoundVolume","timeIntervalSoundFlood","avoidSoundFlooding","createSound","onload","onplay","autoPlay","autoLoad","stream","play","onfinish","allowflooding","ApexChatTitle","flash","isDefaultMobileTheme","ServerLog","trackClick","companyId","visitorId","chatheadertemplate","introcontainer","chatheader","parsetemplate","participantscontainer","notifyPredefinedMessageRendered","lastMessage","adjustRdActionMenu","isFromHistory","MessageArrived","enableTypingInputOnServerResponse","emptyField","scriptBotEnabled","restartVAChat","initAgentNotFoundOverlay","targetSelector","renderOninit","noAgentAvailable","_hideOverlay","overlaySelector","initRestartOverlay","ImportRestartChatOverlayFactory","VAChatRestartOverlayTemplate","isRDEP","reinit","endChatAndstartNewChat","startNewChatForEP","initVideoGreetOverlay","videoGreetEnabled","VideoGreetOverlay","loadVideoGreet","videoGreetSeekbar","videoGreetPlayTrigger","videoGreetPlayPauseIcon","playerElementId","vimeoScriptID","videoGreetMuteTrigger","vimeoPlayerConfig","videoGreet","videoGreetURL","loop","controls","byline","title","muted","autoplay","background","Vimeo2","setupVideoGreetVimeoPlayer","videoTemplate","getStyleForIframe","iframeId","player","videojs","preload","fill","playsinline","ready","videoPlayer","videoPlayerState","handlePlayPause","handleVideoGreetMute","currentTime","playtimePercentage","resetPlayerAfterVideoEnded","pause","onVideoEnded","toggleClass","pauseOnly","handlePause","replaceMuteIcon","bindRestartChatEvents","bindTransferChatEvents","toggleLanguageBottomSheet","toggleSMSNumberInput","payload","toggleSmsBottomSheet","execChatStartHandler","chatStarted","wrapperEl","denyDisable","messageElement","insertBefore","firstChild","acceptTextOnSuccess","rejectTextOnSuccess","changeTextOnSuccess","consentType","textOnSuccess","optInConsentAccepted","optInNumberChangeRequested","optInConsentRejected","showWarning","disclaimerText","USER_REACT_ON_LOC_DISCLAIMER","decliningBoxText","parents","button","disclaimerAccepted","disclaimerRejected","removeOptInConsentOverlay","removeDisclaimerOverlay","postText","consentGiven","postAction","disclaimerTaken","action","changeRequested","chatLogLength","uniqChatArray","getUniqueValueArray","previousMsg","prevBottomSheetDOBInput","pointerEvents","Classical","restartChatRDPlusThemeTemplate","TITLE_FLASH_INTERVAL","flashInterval","getBody","monitoredForTitleFlash","stopFlashing","originalTitle","textarea","mainWrapper","cleanup","debouncedAutoScroll","debounce","textareaElement","wrapperElement","mainWrapperIds","domId","windowedId","exitpopupId","mainWrapperElement","values","lineCount","lineHeight","parseFloat","contentHeight","floor","getLineCount","keys","updateClasses","messages","isLeft","contains","isRight","CHAT_STATE","ChatState","del","VISITORINFO_IN_PROGRESS_COOKIE","CHAT_IN_PROGRESS_COOKIE","VideoGreetInvitation","TRANSFER_TO_LIVE_AGENT","CHAT_TOKEN_COOKIE","IS_PAGE_REFRESHED","APEXCHAT_PRECHAT_MESSAGE_IDS_COOKIE","chatArray","allHistoryMessages","VAChatRestartOverlayRDPlusThemeTemplate","targetElement","observer","MutationObserver","mutationsList","mutation","childList","subtree","props","activeClass","inactiveClass","forceInactive"],"sourceRoot":""}