(function(e){function t(t){for(var s,o,c=t[0],r=t[1],l=t[2],u=0,h=[];ue.includes("campaign")).split("=")[1],i=e.findIndex(e=>e.configuration.campaign===t);e[i].interaction.transfering=!0},updateVuex(e,t){window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1];Object.keys(t).forEach(i=>{t[i].interaction.active&&(e[i].interaction=t[i].interaction,e[i].client=t[i].client)})},endTransfering(e){const t=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],i=e.findIndex(e=>e.configuration.campaign===t);e[i].interaction.transfering=!1},changeLastActiveTime(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].interaction.lastActiveTime=t},changeFirstMessageDisplayed(e){const t=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],i=e.findIndex(e=>e.configuration.campaign===t);e[i].firstMessageDisplayed=!e.firstMessageDisplayed},changeTitle(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].menu.menu_title=t},changeImage(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].menu.menu_img=t},addConfiguration(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);let a=e[s].configuration.ip,n=e[s].configuration.campaign;e[s].configuration=t.param,e[s].configuration.ip||(e[s].configuration.ip=a),e[s].configuration.campaign||(e[s].configuration.campaign=n)},setOnTime(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].campaign=t.param,e[s].campaign.onTime||(e[s].menu.menu_title="Offline")},setFeedback(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].feedback=t},setIpAddress(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].client.ipAddress=t},isMobile(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].isMobile=t},isIOS(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].isIOS=t},isLowRes(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].isLowRes=t},currentURL(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].currentURL=t},setNameClient(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].client.name=t},setEmailClient(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].client.mail=t},setNumberClient(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].client.number=t},setAccessibilityFontSize(e,t){const i=window.location.hash.substring(window.location.hash.indexOf("campaign=")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].client.accessibility||(e[s].client.accessibility=new Object),e[s].client.accessibility.fontSize=t},setInitialMessageClient(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].client.initialMessage=t},changeGuidInteraction(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].interaction.guid=t},changeHoldTime(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].interaction.holdTime=t},waitingInteraction(e){const t=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],i=e.findIndex(e=>e.configuration.campaign===t);e[i].interaction.state="waiting",e[i].interaction.active=!0,e[i].configuration.name="",e[i].configuration.mail="",e[i].configuration.initialMessage=""},connectedInteraction(e){const t=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],i=e.findIndex(e=>e.configuration.campaign===t);e[i].interaction.state="started"},finishedInteraction(e){const t=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],i=e.findIndex(e=>e.configuration.campaign===t);e[i].interaction.state="finished",e[i].interaction.active=!1,e[i].interaction.transfering=!1,e[i].interaction.lastActiveTime=null,e[i].configuration.name="",e[i].configuration.mail="",e[i].configuration.initialMessage=""},noStartedInteraction(e){const t=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],i=e.findIndex(e=>e.configuration.campaign===t);e[i].interaction.state="notstarted",e[i].interaction.active=!1,e[i].interaction.transfering=!1},nameImage(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].menu.menu_img="https://"+e[s].configuration.ip+"/images/"+t.replace(/\s+/g,"")+".jpg"},nameAgent(e,t){if(t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].menu.menu_title=t,e[s].interaction.agent=t}},telAgent(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].interaction.telAgent=t},username(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].interaction.username=t},newMessage(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);t.date=c["DateTime"].fromJSDate(new Date).toFormat("HH:mm"),t.self?(e[s].lastOneMe&&(e[s].lastOneMe.lastOne=!1),e[s].lastOneMe=t):(e[s].lastOneAgent&&(e[s].lastOneAgent.lastOne=!1),e[s].lastOneAgent=t);let a=e[s].interaction.messages.push(t);t.position=a-1,t.optionClicked=!1},updateMessage(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].interaction.messages[t.position]=t},clearInteraction(e){const t=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],i=e.findIndex(e=>e.configuration.campaign===t);e[i].interaction.messages=[],e[i].interaction.guid="",e[i].interaction.agent="",e[i].interaction.holdTime=0,e[i].interaction.telAgent="",e[i].menu.menu_title=""},newGuid(e){const t=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],i=e.findIndex(e=>e.configuration.campaign===t);e[i].client.guid=f()},setTypingText(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].client.typingText=t},clearMessage(e){const t=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],i=e.findIndex(e=>e.configuration.campaign===t);e[i].client.typingText=""},setRatingValue(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].client.rating=t},setSendMail(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].client.sendmail=t},setIsInCall(e,t){const i=window.location.hash.substring(window.location.hash.indexOf("campaign=")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].isInCall=t},setSurveyMessage(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].client.surveyMessage=t},setNotifications(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].notifications.notifications=t},setLang(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1];let s=e.findIndex(e=>e.configuration.campaign===i);-1===s&&(e.push(new u),e.at(-1).configuration.campaign=i,s=e.findIndex(e=>e.configuration.campaign===i)),e[s].client.lang=t},setOffline(e){const t=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],i=e.findIndex(e=>e.configuration.campaign===t);e[i].campaign.timeOut=!0},clearInitialMessage(e){const t=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],i=e.findIndex(e=>e.configuration.campaign===t);e[i].client.initialMessage=""},clearSurveyMessage(e){const t=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],i=e.findIndex(e=>e.configuration.campaign===t);e[i].client.surveyMessage=""},clearCalification(e){const t=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],i=e.findIndex(e=>e.configuration.campaign===t);e[i].client.rating=0},setEventState(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].eventState=t},setClientInfo(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].client.name=t.name,e[s].client.mail=t.mail,e[s].client.number=t.number,e[s].client.initialMessage=t.initialMessage,e[s].client.data=t.data},toggleOpen(e){const t=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],i=e.findIndex(e=>e.configuration.campaign===t);e[i].open=!e.open},restartUnreadedMessagesCounter(e){const t=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],i=e.findIndex(e=>e.configuration.campaign===t);e[i].interaction.unreadMessages=0},addOneUnreadedMessagesCounter(e){const t=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],i=e.findIndex(e=>e.configuration.campaign===t);e[i].interaction.unreadMessages++},changeIsExternalWindow(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].isExternalWindow=t},interactionFinished(e){const t=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],i=e.findIndex(e=>e.configuration.campaign===t);e[i].interaction.active=!1,e[i].interaction.transfering=!1,e[i].firstMessageDisplayed=!e.firstMessageDisplayed},setCampaignLogo(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].campaign.logo=t},setCampaignLogoName(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].campaign.logoName="https://"+e[s].configuration.ip+"/images/"+t.replace(/\s+/g,"")+".jpg"},setTurnConf(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].turnConf=t},setTelephonyServer(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=e.findIndex(e=>e.configuration.campaign===i);e[s].telephonyServer=t}},m={increment:({commit:e})=>e("increment"),decrement:({commit:e})=>e("decrement"),incrementIfOdd({commit:e,state:t}){(t.count+1)%2===0&&e("increment")},incrementAsync({commit:e}){return new Promise((t,i)=>{setTimeout(()=>{e("increment"),t()},1e3)})}},g={hasImageMenuTitle:e=>{const t=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],i=e.findIndex(e=>e.configuration.campaign===t);e[i].menu.menu_img},getLastActiveTime:e=>{const t=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],i=e.findIndex(e=>e.configuration.campaign===t);return e[i].interaction.lastActiveTime},getClassColorStatus:e=>{const t=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],i=e.findIndex(e=>e.configuration.campaign===t);return e[i].campaign.onTime?"avaiablecolor":"unavaiablecolor"},isWaitingInteraction:e=>{const t=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],i=e.findIndex(e=>e.configuration.campaign===t);return"waiting"===e[i].interaction.state},isStartedInteraction:e=>{const t=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],i=e.findIndex(e=>e.configuration.campaign===t);return"started"===e[i].interaction.state},hasTextareaText:e=>{const t=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],i=e.findIndex(e=>e.configuration.campaign===t);return""!==e[i].client.typingText.trim()},messages:e=>{const t=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],i=e.findIndex(e=>e.configuration.campaign===t);return e[i].interaction.messages},imageAgent:e=>{const t=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],i=e.findIndex(e=>e.configuration.campaign===t);e[i].menu.menu_title},getMainTitle:e=>{const t=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],i=e.findIndex(e=>e.configuration.campaign===t);return e[i].menu.menu_title?e[i].menu.menu_title:e[i].campaign.onTime?"Chat":"Offline"},turnConf:e=>{const t=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],i=e.findIndex(e=>e.configuration.campaign===t);return e[i].turnConf},telephonyServer:e=>{const t=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],i=e.findIndex(e=>e.configuration.campaign===t);return e[i].telephonyServer}};var p=new o["a"].Store({state:d,getters:g,actions:m,mutations:h,plugins:[Object(r["a"])()]});const f=()=>{function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()},v=(e,t)=>"wss://"+e+"/websockets/webmessages/"+t,b=(e,t,i,s)=>{const a=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],n=p.state.findIndex(e=>e.configuration.campaign===a);if("undefined"!==typeof Notification&&"null"!==typeof Notification&&p.state[n].notifications.notifications)if("granted"===Notification.permission){let a=navigator.serviceWorker.ready.then(i=>{i.showNotification(e,{body:t,icon:s,vibrate:[200,100,200,100,200,100,200],tag:"vibration-sample",dir:"ltr",lang:"en"})});a.onclick=function(){window.focus(),a.close(),i()}}else window.parent.postMessage({action:"REQUEST_NOTIFICATION_PERMISSION"},"*")},w=()=>{let e=["en","es","pt","bn","lv","it"],t=window.navigator.language.split("-")[0];for(let i=0;ie.replace(/(\s[*])(.*?)([*]\s)/g," $2 ").replace(/(^[*])(.*?)([*]$)/g,"$2").replace(/(\s[*])(.*?)([*]$)/g," $2").replace(/(^[*])(.*?)([*]\s$)/g,"$2 ").replace(/(^[_])(.*?)([_]$)/g,"$2").replace(/(\s[_])(.*?)([_]\s)/g," $2 ").replace(/(\s[_])(.*?)([_]$)/g," $2").replace(/(^[_])(.*?)([_]\s$)/,"$2 ").replace(/(\s[~])(.*?)([~]\s)/g," $2 ").replace(/(^[~])(.*?)([~]$)/g,"$2").replace(/(\s[~])(.*?)([~]$)/g," $2").replace(/(^[~])(.*?)([~]\s$)/,"$2 ").replace(/(^[`]{3})(.*?)([`]{3}$)/g," $2 ").replace(/(\s[`]{3})(.*?)([`]{3}\s)/g," $2 ").replace(/(\s[`]{3})(.*?)([`]{3}$)/g," $2").replace(/([`]{3})(.*?)([`]{3}\s$)/g,"$2 "),C=(e="#FFFFFF",t=!0,i)=>{if(i)return e;if(0===e.indexOf("#")&&(e=e.slice(1)),3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),6!==e.length)throw new Error("Invalid HEX color.");var s=parseInt(e.slice(0,2),16),a=parseInt(e.slice(2,4),16),n=parseInt(e.slice(4,6),16);return t?.299*s+.587*a+.114*n>186?"#0F120F":"#F1F2EB":void 0},$=()=>!(!/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)&&!/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4))),x=()=>/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream;var S=function(){var e=this,t=e._self._c;return t("transition",{attrs:{name:"slide-chat"}},[e.$store.getters.isWaitingInteraction||"started"!==e.getWebchat().interaction.state&&"finished"!==e.getWebchat().interaction.state?e._e():t("div",{staticStyle:{display:"flex","justify-content":"flex-end",height:"100svh"}},[e.isOnVideoCall&&!e.$vuetify.breakpoint.smAndDown?t("div",{staticClass:"fill-height expand-width",staticStyle:{"background-color":"black",position:"relative"},style:{width:e.fullWebcam?"100%":"67%"}},[t("v-btn",{staticStyle:{position:"absolute",top:"72px",right:"0"},attrs:{fab:"",color:"transparent"},on:{click:function(t){e.fullWebcam=!e.fullWebcam}}},[t("v-icon",{attrs:{color:"white"}},[e._v(" "+e._s(e.fullWebcam?"mdi-fullscreen-exit":"mdi-fullscreen")+" ")])],1),t("call",{ref:"callComponent",attrs:{show:e.isInCall,video:e.isOnVideoCall},on:{hangupEv:e.hangup,hideTextAreaEv:e.switchShowTextInput,phone:e.onPhone}})],1):e._e(),t("div",{staticClass:"expand-width",staticStyle:{"self-align":"flex-end"},style:{width:e.isOnVideoCall?e.fullWebcam?"0":e.$vuetify.breakpoint.smAndDown?"100%":"33%":"100%"}},[t("v-row",{staticClass:"fill-height",attrs:{"no-gutters":""}},[t("v-col",{class:{"show-chat":e.$store.getters.isStartedInteraction},style:{zoom:"1."+e.getWebchat().client.accessibility.fontSize},attrs:{cols:"12"}},[t("div",{staticClass:"d-flex align-center"},[t("chat-toolbar",{staticClass:"width-100",attrs:{hideEndConv:this.endConv,isBot:this.bot},on:{openConfirmationModal:e.openCloseDialog,clickCallEv:e.openWindowCalling,openAccessibilityModal:e.openAccessibilityModal,clickVideoCallEv:e.openWindowVideocalling}})],1)]),!e.showClosingDialog||e.showEndConv||e.showWebrtcStream.dialog?e._e():t("v-col",{class:{"show-chat":e.$store.getters.isStartedInteraction},style:{zoom:"1."+e.getWebchat().client.accessibility.fontSize},attrs:{cols:"12"}},[t("closing-dialog",{attrs:{show:e.showClosingDialog,messageDialogue:e.$t("closeconf")},on:{confirmClosingEv:e.shouldClose,cancelClosingEv:e.hideClosingModal}})],1),e.showEndConv&&!e.showWebrtcStream.dialog?t("v-col",{class:{"show-chat":e.$store.getters.isStartedInteraction},style:{zoom:"1."+e.getWebchat().client.accessibility.fontSize},attrs:{cols:"12"}},[t("closing-dialog",{attrs:{show:e.showEndConv,messageDialogue:e.$t("conversationend")},on:{confirmClosingEv:e.acceptModalEndConv,cancelClosingEv:e.cancelModalEndConv}})],1):e._e(),!e.showWebrtcStream.dialog||e.showClosingDialog||e.showEndConv?e._e():t("v-col",{class:{"show-chat":e.$store.getters.isStartedInteraction},style:{zoom:"1."+e.getWebchat().client.accessibility.fontSize},attrs:{cols:"12"}},[t("screen-share-dialog",{attrs:{show:e.showWebrtcStream.dialog},on:{yes:function(t){return e.screenShareController.shareScreen()},no:function(t){return e.screenShareController.cancelShareScreen()}}})],1),!e.showAccessibilityDialog||e.showClosingDialog||e.showEndConv||e.showWebrtcStream.dialog?e._e():t("v-col",{class:{"show-chat":e.$store.getters.isStartedInteraction},staticStyle:{position:"relative"},style:{zoom:"1."+e.getWebchat().client.accessibility.fontSize},attrs:{cols:"12"}},[t("accessibility-options",{attrs:{show:e.showAccessibilityDialog,fromChat:!0},on:{close:e.closeAccessibilityModal}})],1),e.isInCall&&e.$vuetify.breakpoint.smAndDown||!e.isOnVideoCall&&!e.$vuetify.breakpoint.smAndDown?t("v-col",{directives:[{name:"show",rawName:"v-show",value:!e.showWebrtcStream.visible,expression:"!showWebrtcStream.visible"}],class:{"show-chat":e.$store.getters.isStartedInteraction},style:{zoom:"1."+e.getWebchat().client.accessibility.fontSize},attrs:{cols:"12"}},[t("call",{ref:"callComponent",attrs:{show:e.isInCall,video:e.isOnVideoCall},on:{hangupEv:e.hangup,hideTextAreaEv:e.switchShowTextInput,phone:e.onPhone}})],1):e._e(),e.showWebrtcStream.visible?t("v-col",{class:{"show-chat":e.$store.getters.isStartedInteraction},style:{zoom:"1."+e.getWebchat().client.accessibility.fontSize},attrs:{cols:"12"}},[t("v-row",{staticStyle:{position:"relative"},attrs:{"no-gutters":""}},[t("v-btn",{class:{oncall:e.isInCall},attrs:{icon:"",id:"closeStream"},on:{click:function(t){return e.screenShareController.closeStream()}}},[t("v-icon",[e._v("mdi-close")])],1),t("video",{class:{oncall:e.isInCall},attrs:{autoplay:"",id:"webrtcstream",width:"300px",height:"300px"},domProps:{srcObject:e.showWebrtcStream.stream}})],1)],1):e._e(),t("v-col",{ref:"chatContainer",staticClass:"overflow-x-hidden",class:{"show-chat":e.$store.getters.isStartedInteraction},style:[{height:e.evaluateHeight,zoom:"1."+e.getWebchat().client.accessibility.fontSize}],attrs:{cols:"12"}},[t("div",{staticClass:"holderChat chat-background",class:{"relative-pos":e.getWebchat().isLowRes,holderChatWithVideo:e.isOnVideoCall}},[t("ol",{staticClass:"chat",on:{click:function(t){return e.$refs.textarea.hidePicker()}}},[e._l(e.getWebchat().interaction.messages,(function(i,s){return t("message",{key:s,attrs:{visible:!(0==s&&e.hasParameters()),message:i},on:{menuMessage:e.menuMessageEvent}})})),e.typingVisible?t("message"):e._e()],2)])]),t("v-col",{staticStyle:{height:"45px"},style:{zoom:"1."+e.getWebchat().client.accessibility.fontSize},attrs:{cols:"12"}},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.showTextInput&&!this.endConv&&!e.getWebchat().interaction.transfering,expression:"\n showTextInput &&\n !this.endConv &&\n !getWebchat().interaction.transfering\n "}],staticClass:"containerButtons"},[t("Emoji-textArea",{ref:"textarea",attrs:{placeholder:e.$t("typehere"),"picker-position":"top"},on:{enter:e.sendMessage},model:{value:e.typingText,callback:function(t){e.typingText=t},expression:"typingText"}}),e.$store.getters.hasTextareaText?t("div",{staticClass:"btnTextarea"},[t("v-btn",{attrs:{icon:""},on:{click:e.sendMessage}},[t("Send")],1)],1):e.getWebchat().campaign.allow_attachments?t("div",{staticClass:"btnTextarea"},[this.attachUploading?t("v-btn",{attrs:{icon:"",disabled:""}},[t("v-icon",{staticClass:"rotate"},[e._v("mdi-autorenew")])],1):t("v-btn",{attrs:{icon:""},nativeOn:{click:function(t){return e.addAttachment.apply(null,arguments)}}},[t("v-icon",{attrs:{color:"grey darken-1"}},[e._v("mdi-paperclip")])],1),t("input",{ref:"inputfiles",staticStyle:{display:"none"},attrs:{type:"file"},on:{change:e.onFileChange}})],1):e._e()],1)])],1)],1)]),e.$store.getters.isWaitingInteraction?t("v-card",{staticClass:"d-flex align-center",style:{zoom:"1."+e.getWebchat().client.accessibility.fontSize},attrs:{id:"holderWaiting"}},[t("v-tooltip",{attrs:{bottom:""},scopedSlots:e._u([{key:"activator",fn:function({on:i}){return[t("div",{staticClass:"finishInteractionButton"},[t("v-btn",e._g({attrs:{icon:""},on:{click:function(t){e.showModalAbandon=!0}}},i),[t("v-icon",{style:{color:e.invertColor(e.getWebchat().campaign.color)}},[e._v("mdi-close")])],1)],1)]}}],null,!1,1768998756)},[t("span",[e._v(e._s(e.$t("close")))])]),t("v-dialog",{model:{value:e.showModalAbandon,callback:function(t){e.showModalAbandon=t},expression:"showModalAbandon"}},[t("v-card",[t("v-card-title",{staticClass:"headline"},[e._v(e._s(e.$t("closeconf")))]),t("v-card-actions",[t("v-spacer"),t("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:function(t){return e.clickModalAbandon()}}},[e._v(e._s(e.$t("yes")))]),t("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:function(t){e.showModalAbandon=!1}}},[e._v(e._s(e.$t("no")))])],1)],1)],1),t("div",{staticClass:"holdTimeText"},[t("p",[t("v-icon",{staticClass:"rotate"},[e._v("mdi-autorenew")])],1),t("p",{domProps:{innerHTML:e._s(e.getText)}}),t("p",[t("chronometer")],1)])],1):e._e()],1)},k=[],M=(i("5b81"),Object.freeze({NOT_STARTED_STATE:"notstarted",STARTED_STATE:"started",WAITING_STATE:"waiting",FINISHED_STATE:"finished",WS_CHAT_CREATED:"chatcreated",WS_CONNECTED:"connected",WS_NEW_MESSAGE:"newmessage",WS_CHAT_FINISHED:"finishchat",WS_TYPING:"typing",WS_TIMEOUT:"timeout",WS_TRANSFERRED:"transferred",WS_ATTENDED:"attended",WS_TYPING:"typing",WS_REQUEST_SCREEN:"request_screen",WS_SIGNALLING:"signalling",WS_NOT_SUPPORTED:"not_supported",WS_DENIED:"denied",WS_WEBCHAT_EVENT:"webchatevent",WS_QUEUE_POSITION:"queuePosition"})),I=function(){var e=this,t=e._self._c;return e.message&&e.visible&&e.message.notif?t("li",{staticClass:"self"},[t("div",{staticClass:"containerMessage"},[t("div",{staticClass:"msg",staticStyle:{"background-color":"#e8e7e7","font-style":"italic"}},[t("div",{staticClass:"black-text",style:{color:e.invertColor(e.getWebchat().campaign.color)}},[t("v-icon",[e._v("mdi-alert-circle-outline")]),e._v(" "+e._s(e.message.message)+" ")],1)])])]):e.visible&&e.message&&e.menuMessage(e.message.message)?t("li",{class:{self:e.message&&e.message.self,other:e.message&&!e.message.self}},[t("messageMenu",{ref:"menuMessage",attrs:{message:e.message}})],1):e.message&&e.surveyMessage(e.message.message)?t("li",{class:{self:e.message&&e.message.self,"other otherSurvey":e.message&&!e.message.self}},[e.isFaces(e.message.message)?t("messageSurvey",{ref:"surveyMessage",attrs:{message:e.message}}):e.isYesNo(e.message.message)?t("messageSurveyYesNo",{attrs:{message:e.message}}):e._e()],1):e.visible?t("li",{class:{self:e.message&&e.message.self,other:e.message&&!e.message.self}},[t("v-row",{staticClass:"containerMessage",attrs:{"no-gutters":""}},[t("v-col",{staticClass:"d-flex",class:{self:e.message&&e.message.self,other:e.message&&!e.message.self},attrs:{cols:"12"}},[e.message&&!e.message.self&&e.getWebchat().campaign.show_agent_image_aside?t("img",{staticClass:"logo mr-2",staticStyle:{"aspect-ratio":"1/1",width:"40px","border-radius":"100%"},attrs:{src:e.avatar,alt:e.getWebchat().campaign.logo?e.getWebchat().campaign.logoName:e.getWebchat().campaign.name,title:e.getWebchat().campaign.name}}):e._e(),t("div",{staticClass:"msg",style:{"background-color":e.message&&!e.message.self?e.getWebchat().campaign.color:"#e8e7e7"}},[e.message.message?t("div",e._l(e.getEnters(e.message.message),(function(i,s){return t("div",{directives:[{name:"linkify",rawName:"v-linkify"}],key:s,class:{"black-text":e.message&&e.message.self},style:{color:e.invertColor(e.getWebchat().campaign.color),"font-family":"Windows"===e.OS?"'Open Sans','Noto Color Emoji'":"'Open Sans', sans-serif !important;"},attrs:{message:i},domProps:{innerHTML:e._s(e.styleMessage(i))}},[e._v(" "+e._s(i)+" ")])})),0):e._e(),e.message.attachments&&e.message.attachments.length?t("attachments",{attrs:{files:e.message.attachments,messageColor:e.message&&!e.message.self?e.getWebchat().campaign.color:"#e8e7e7"}}):e._e()],1)]),t("v-col",{staticClass:"d-flex",class:{self:e.message&&e.message.self,other:e.message&&!e.message.self},attrs:{cols:"12"}},[t("p",[e._v(e._s(e.message.date))])])],1)],1):e._e()},_=[],W=(i("d866"),function(){var e=this,t=e._self._c;return t("div",[e.files&&e.files.length?t("div",{staticClass:"attachments-container"},e._l(e.files,(function(i,s){return t("div",{key:s},[e.isImage(i)?t("img",{staticClass:"image-attachment",attrs:{src:e.getSrc(i)},on:{click:function(t){return e.openImage(i)}}}):e.isVideo(i)?t("video",{staticClass:"image-attachment",attrs:{src:e.getSrc(i),controls:"controls",muted:"muted"},domProps:{muted:!0}}):e.isAudio(i)?t("audioPlayer",{attrs:{messageColor:e.$props.messageColor,src:e.getSrc(i)}}):t("a",{staticClass:"link-attachment",attrs:{target:"_blank",href:e.getSrc(i)}},[t("i",{staticClass:"fa fa-file"}),t("span",{domProps:{innerHTML:e._s(e.getNameFile(i))}})])],1)})),0):e._e()])}),T=[],E=function(){var e=this,t=e._self._c;return t("div",{staticClass:"contenedor"},[[t("div",{staticClass:"audio"},[t("v-btn",{attrs:{icon:""},on:{click:e.playPauseAudio}},[e.currentlyPlaying?e.currentlyPlaying?t("v-icon",{attrs:{color:e.invertColor(e.$props.messageColor)}},[e._v("mdi-pause")]):e._e():t("v-icon",{attrs:{color:e.invertColor(e.$props.messageColor)}},[e._v("mdi-play-outline")])],1),t("div",[t("h5",{staticClass:"currentTimeAndDuration",style:"color:"+e.invertColor(e.$props.messageColor)},[e._v(" "+e._s(e.currentTimeShow)+" / "+e._s(e.trackDurationShow)+" ")])]),t("div",{staticClass:"progressbar"},[t("v-progress-linear",{attrs:{height:5,color:e.invertColor(e.$props.messageColor)},on:{change:e.seekAudio},model:{value:e.currentProgressBar,callback:function(t){e.currentProgressBar=t},expression:"currentProgressBar"}})],1),t("span",{staticClass:"download-audio mdi mdi-download",style:"color:"+e.invertColor(e.$props.messageColor),on:{click:e.downloadAudio}}),t("v-btn",{attrs:{icon:""},on:{click:e.checkSpeed}},[t("h5",{staticClass:"speedLabel",style:"color:"+e.invertColor(e.$props.messageColor)},[e._v(" "+e._s(e.speed.toFixed(1))+"x ")])])],1)]],2)},A=[],O={name:"AudioPlayer",props:{src:{type:String,required:!0},messageColor:String},data(){return{currentTime:0,audio:new Audio(this.$props.src),audioDuration:0,currentlyPlaying:!1,currentProgressBar:0,speed:1,invertColor:C}},computed:{currentTimeShow(){return this.timeFormat(Math.ceil(this.currentTime))},trackDurationShow(){return this.timeFormat(Math.ceil(this.audioDuration))}},mounted(){this.audio.onloadeddata=()=>{this.audioDuration=this.audio.duration},this.audio.onended=()=>{this.currentlyPlaying=!1,this.stopAudio(),this.currentTime=0}},methods:{seekAudio(){let e=Math.ceil(this.currentProgressBar*this.audioDuration/100);this.audio.currentTime=e,this.currentTime=e},timeFormat(e){return(e-(e%=60))/60+(9{this.currentTime=this.audio.currentTime,this.currentProgressBar=this.audio.currentTime/this.audio.duration*100},100)},checkSpeed(){if(2===this.speed)return this.audio.playbackRate=1,void(this.speed=1);this.audio.playbackRate=this.speed+.5,this.speed+=.5},downloadAudio(){var e=document.createElement("a"),t="Audio.mp3";e.href=this.$props.src,e.download=t,document.body.appendChild(e),e.click(),document.body.removeChild(e)}}},N=O,j=(i("584c"),i("2877")),z=Object(j["a"])(N,E,A,!1,null,null,null),D=z.exports,P={props:{files:Array,messageColor:String},name:"attachments",components:{audioPlayer:D},data(){return{arr:[]}},methods:{isImage(e){let t=e.url?e.url:e,i=t.split("|");return"image"===i[0]},isVideo(e){let t=e.url?e.url:e,i=t.split("|");return"video"===i[0]},isAudio(e){let t=e.url?e.url:e,i=t.split("|");return"audio"===i[0]},isAudio(e){let t=e.url?e.url:e,i=t.split("|");return"audio"===i[0]||"voice"===i[0]},getSrc(e){let t=e.url?e.url:e;const i=this.$route.query.campaign,s=this.$store.state.findIndex(e=>e.configuration.campaign===i);return"https://"+this.$store.state[s].configuration.ip+"/attachments/"+t.split("|")[1]},openImage(e){var t=document.createElement("a");let i=this.getSrc(e);t.href=i,t.target="_blank",document.body.appendChild(t),t.click(),document.body.removeChild(t)},getNameFile(e){const t=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}.*$/;if(e.name)return e.name;if(e.indexOf(">")>-1){let t=e.indexOf(">");return e.substr(t+1,e.length)}{let i=e.split("/"),s=i[i.length-1];return t.test(s)?s.substr(37,s.length):s}}}},q=P,R=(i("f0ba"),Object(j["a"])(q,W,T,!1,null,"5cbdf09e",null)),L=R.exports,F=function(){var e=this,t=e._self._c;return t("div",{staticClass:"containerMessage",style:{"background-color":"none"}},[t("ul",{staticClass:"ulMessageMenu"},e._l(e.getObjectMenu(e.message.message),(function(i,s){return t("li",{key:s,staticClass:"liMessageMenu",class:e.optionClicked?"changeCursor "+(s+1!==e.optionClicked?"notselected":"selected"):"selected",style:{"border-color":e.getWebchat().campaign.color,color:e.invertColor(e.getWebchat().campaign.color,!0,!0)},on:{click:function(t){return e.sendMessage(i.option,s)}}},[t("span",{staticStyle:{float:"left",position:"absolute",top:"6px"}},[t("v-icon",{style:{color:e.invertColor(e.getWebchat().campaign.color,!0,!0)}},[e._v(" mdi-chevron-right ")])],1),e._l(i.optionName,(function(i){return t("div",{key:i.optionName,staticClass:"pMessageMenu",class:e.optionClicked?"changeCursor":"",style:{color:e.invertColor(e.getWebchat().campaign.color,!0,!0),"font-size":"14px"}},[t("a",{class:e.optionClicked?"changeCursor":"",style:{color:e.invertColor(e.getWebchat().campaign.color,!0,!0),"font-size":"14px"},domProps:{innerHTML:e._s(e.styleMessage(i))}})])}))],2)})),0)])},V=[],U=(i("910d"),{props:{message:Object},name:"messageMenu",components:{},computed:{},methods:{disableMenuMessage(e){this.message.optionClicked=e,this.optionClicked=e},sendMessage(e,t){this.message.optionClicked||(this.message.optionClicked=e,this.optionClicked=e,this.$eventManagerMenu.sendMessage(e),this.$store.commit("updateMessage",this.message))},getObjectMenu(e){let t=e.split(/(\d+ *\- *)/g);t=t.filter(e=>e);for(var i=[],s=0;s{let t={};return t.option=parseInt(e.split(/\-/)[0].replace("-","").trim()),t.optionName=e.split(/\-/)[1],t.optionName=t.optionName.split(String.fromCharCode(10)),t.optionName=t.optionName.filter(e=>e),t.optionName[0]=t.option+" - "+t.optionName[0],t})},getWebchat(){return this.$store.state[this.$store.state.findIndex(e=>e.configuration.campaign===this.$route.query.campaign)]},invertColor:C,styleMessage:y},created(){this.optionClicked=this.message.optionClicked},data(){return{optionClicked:!1}}}),B=U,H=(i("1db2"),Object(j["a"])(B,F,V,!1,null,null,null)),G=H.exports,J=function(){var e=this,t=e._self._c;return t("div",{staticClass:"containerMessage",style:{"background-color":"none",width:"100% !important","max-width":"100%"}},[t("ul",{staticClass:"ulMessageMenu"},[t("li",{staticClass:"liMessageMenu",class:e.optionClicked?"changeCursor notselected":"selected",style:{height:"120px !important"}},[t("div",{staticClass:"row"},[t("div",{staticClass:"column"},[t("a",{staticClass:"aSurveyMessage",class:e.optionClicked?"changeCursor":"",on:{click:function(t){e.sendMessage(e.getObjectMenu(e.message.message)[0].option)}}},[t("div",{staticClass:"faces centrado",style:{"background-image":"url("+e.avatar5+")",top:"0px"}}),t("div",{staticClass:"centrado",style:{"font-size":"9px!important",top:"50px"}},[e._v(e._s(e.getObjectMenu(e.message.message)[0].optionName[0]))])])]),t("div",{staticClass:"column"},[t("a",{staticClass:"aSurveyMessage",class:e.optionClicked?"changeCursor":"",on:{click:function(t){e.sendMessage(e.getObjectMenu(e.message.message)[1].option)}}},[t("div",{staticClass:"faces centrado",style:{"background-image":"url("+e.avatar4+")",top:"0px"}}),t("div",{staticClass:"centrado",style:{"font-size":"9px!important",top:"50px"}},[e._v(e._s(e.getObjectMenu(e.message.message)[1].optionName[0]))])])]),t("div",{staticClass:"column"},[t("a",{staticClass:"aSurveyMessage",class:e.optionClicked?"changeCursor":"",on:{click:function(t){e.sendMessage(e.getObjectMenu(e.message.message)[2].option)}}},[t("div",{staticClass:"faces centrado",style:{"background-image":"url("+e.avatar3+")",top:"0px"}}),t("div",{staticClass:"centrado",style:{"font-size":"9px!important",top:"50px"}},[e._v(" "+e._s(e.getObjectMenu(e.message.message)[2].optionName[0])+" ")])])]),t("div",{staticClass:"column"},[t("a",{staticClass:"aSurveyMessage",class:e.optionClicked?"changeCursor":"",on:{click:function(t){e.sendMessage(e.getObjectMenu(e.message.message)[3].option)}}},[t("div",{staticClass:"faces centrado",style:{"background-image":"url("+e.avatar2+")",top:"0px"}}),t("div",{staticClass:"centrado",style:{"font-size":"9px!important","text-align":"center !important",top:"50px"}},[e._v(" "+e._s(e.getObjectMenu(e.message.message)[3].optionName[0])+" ")])])]),t("div",{staticClass:"column"},[t("a",{staticClass:"aSurveyMessage",class:e.optionClicked?"changeCursor":"",on:{click:function(t){e.sendMessage(e.getObjectMenu(e.message.message)[4].option)}}},[t("div",{staticClass:"faces centrado",style:{"background-image":"url("+e.avatar1+")",top:"0px"}}),t("div",{staticClass:"centrado",style:{"font-size":"9px!important",top:"50px"}},[e._v(" "+e._s(e.getObjectMenu(e.message.message)[4].optionName[0])+" ")])])])])])])])},Q=[],X=i("a84b"),K=i.n(X),Y=i("e086"),Z=i.n(Y),ee=i("b217"),te=i.n(ee),ie=i("8fa4"),se=i.n(ie),ae=i("b3bf"),ne=i.n(ae),oe={props:{message:Object},name:"messageSurvey",components:{},computed:{},methods:{disableMenuMessage(e){this.message.optionClicked=e,this.optionClicked=e},sendMessage(e){this.message.optionClicked||(this.message.optionClicked=e,this.optionClicked=e,this.$eventManagerMenu.sendMessage(e),this.$store.commit("updateMessage",this.message))},getObjectMenu(e){let t=e.substring(8),i=t.split(/(\d+ *\- *)/g);i=i.filter(e=>e);for(var s=[],a=0;a{let t={};return t.option=parseInt(e.split(/\-/)[0].replace("-","").trim()),t.optionName=e.split(/\-/)[1],t.optionName=t.optionName.split(String.fromCharCode(10)),t.optionName=t.optionName.filter(e=>e),t.optionName[0]=t.optionName[0],t})},invertColor:C},created(){this.optionClicked=this.message.optionClicked},data(){return{optionClicked:!1,avatar1:K.a,avatar2:Z.a,avatar3:te.a,avatar4:se.a,avatar5:ne.a}}},ce=oe,re=(i("c8d8"),Object(j["a"])(ce,J,Q,!1,null,null,null)),le=re.exports,de=function(){var e=this,t=e._self._c;return t("div",{staticClass:"containerMessage",style:{"background-color":"none"}},[t("ul",{staticClass:"ulMessageMenu"},[t("li",{staticClass:"liMessageMenu",class:e.optionClicked?"changeCursor notselected":"selected",style:{height:"120px !important"}},[t("div",{staticClass:"row"},[t("div",{staticClass:"column",style:{"margin-left":"35px"}},[t("a",{staticClass:"aSurveyMessage",class:e.optionClicked?"changeCursor":"",on:{click:function(t){e.sendMessage(e.getObjectMenu(e.message.message)[0].option)}}},[t("div",{staticClass:"faces centrado",style:{"background-image":"url("+e.yes+")",top:"0px"}}),t("div",{staticClass:"centrado",style:{"font-size":"10px!important",top:"50px"}},[e._v(e._s(e.getObjectMenu(e.message.message)[0].optionName[0]))])])]),t("div",{staticClass:"column",style:{"margin-left":"60px"}},[t("a",{staticClass:"aSurveyMessage",class:e.optionClicked?"changeCursor":"",on:{click:function(t){e.sendMessage(e.getObjectMenu(e.message.message)[1].option)}}},[t("div",{staticClass:"faces centrado",style:{"background-image":"url("+e.no+")",top:"0px"}}),t("div",{staticClass:"centrado",style:{"font-size":"10px!important",top:"50px"}},[e._v(e._s(e.getObjectMenu(e.message.message)[1].optionName[0]))])])])])])])])},ue=[],he=i("f6cb"),me=i.n(he),ge=i("500b"),pe=i.n(ge),fe={props:{message:Object},name:"messageSurveyYesNo",components:{},computed:{},methods:{disableMenuMessage(e){this.message.optionClicked=e,this.optionClicked=e},sendMessage(e){this.message.optionClicked||(this.message.optionClicked=e,this.optionClicked=e,this.$eventManagerMenu.sendMessage(e),this.$store.commit("updateMessage",this.message))},getObjectMenu(e){let t=e.substring(9),i=t.split(/(\d+ *\- *)/g);i=i.filter(e=>e);for(var s=[],a=0;a{let t={};return t.option=parseInt(e.split(/\-/)[0].replace("-","").trim()),t.optionName=e.split(/\-/)[1],t.optionName=t.optionName.split(String.fromCharCode(10)),t.optionName=t.optionName.filter(e=>e),t.optionName[0]=t.optionName[0],t})},invertColor:C},created(){this.optionClicked=this.message.optionClicked},data(){return{optionClicked:!1,yes:me.a,no:pe.a}}},ve=fe,be=(i("7046"),Object(j["a"])(ve,de,ue,!1,null,null,null)),we=be.exports,ye=i("9aa5"),Ce=i.n(ye),$e=i("1195"),xe=i.n($e),Se={props:{message:Object,visible:Boolean},components:{Attachments:L,MessageMenu:G,MessageSurvey:le,MessageSurveyYesNo:we},name:"message",data(){return{window:window,OS:"Win32"===navigator.platform?"Windows":"Other",avatar:this.getWebchat().campaign.show_agent&&!this.message.self?"https://"+this.getWebchat().configuration.ip+"/images/"+this.message.agent+".jpg?"+Date.now():this.getWebchat().campaign.logo?this.getWebchat().campaign.logoName+"?"+(new Date).getTime()+")":xe.a}},computed:Object(o["b"])([]),directives:{linkify:Ce.a},created(){this.message&&(this.menuMessage(this.message.message)&&this.$emit("menuMessage",this),this.surveyMessage(this.message.message)&&this.$emit("surveyMessage",this))},methods:{disableMenuMessage(e){this.$refs.menuMessage&&this.$refs.menuMessage.disableMenuMessage(e)},invertColor:C,styleMessage:y,menuMessage(e){return e.split("\n").every(e=>null!=e.match(/[0-9]+ *- *[^]*/imy)&&e.split(2=="-".length))},getEnters(e){let t=e.split(String.fromCharCode(10));return t},surveyMessage(e){if(e){let t=e.split("\n");return("(faces)"==t[0]||"(yes/no)"==t[0])&&(t.shift(),t.every(e=>null!=e.match(/[0-9]+ *- *[^]*/imy)))}},getWebchat(){return this.$store.state[this.$store.state.findIndex(e=>e.configuration.campaign===this.$route.query.campaign)]},isFaces(e){if(e){let t=e.split("\n");return"(faces)"==t[0]}return!1},isYesNo(e){if(e){let t=e.split("\n");return"(yes/no)"==t[0]}return!1}}},ke=Se,Me=(i("2f94"),Object(j["a"])(ke,I,_,!1,null,"603ebd22",null)),Ie=Me.exports,_e=function(){var e=this,t=e._self._c;return t("div",{directives:[{name:"show",rawName:"v-show",value:e.show,expression:"show"}],staticClass:"element-top"},[t("div",[t("v-toolbar",{staticClass:"call-toolbar",class:{show:e.show},attrs:{elevation:"1",height:!e.$vuetify.breakpoint.smAndDown&&e.$props.video?"67px":"50px"}},[t("v-toolbar-title",{staticClass:"call-title"},[e._v(e._s(e.$t("calling"))+" ")]),t("v-spacer"),t("v-toolbar-items",[t("v-btn",{attrs:{small:"",plain:""}},[e._v(" "+e._s(e.$t("duration"))),e.show?t("chronometer",{attrs:{isCall:!0}}):e._e()],1),e.isOnVideoCall?t("v-tooltip",{attrs:{bottom:""},scopedSlots:e._u([{key:"activator",fn:function({on:i}){return[t("v-btn",e._g({attrs:{icon:""},on:{click:e.switchShowVideo}},i),[t("v-icon",{domProps:{textContent:e._s(e.showTextInput?"mdi-eye":"mdi-note-multiple")}})],1)]}}],null,!1,1707754057)},[t("span",[e._v(e._s(e.$t("write")))])]):e._e(),t("v-tooltip",{attrs:{bottom:""},scopedSlots:e._u([{key:"activator",fn:function({on:i}){return[t("v-btn",e._g({staticClass:"ma-0",attrs:{icon:""},on:{click:e.mutebutton}},i),[t("v-icon",{staticClass:"mic-mute red--text darken-1",attrs:{color:"error"},domProps:{innerHTML:e._s(e.mute?"mdi-microphone-off":"mdi-microphone")}})],1)]}}])},[t("span",[e._v(e._s(e.mute?e.$t("unmute"):e.$t("mute")))])]),t("v-tooltip",{attrs:{bottom:""},scopedSlots:e._u([{key:"activator",fn:function({on:i}){return[t("v-btn",e._g({staticClass:"hangup-button ma-0",attrs:{icon:""},on:{click:e.hangup}},i),[t("v-icon",[e._v("mdi-phone-hangup")])],1)]}}])},[t("span",[e._v(e._s(e.$t("hangup")))])])],1)],1)],1),t("div",{class:e.$props.video?e.$vuetify.breakpoint.smAndDown?"video-container":"video-container-fs":null},[t("video",{directives:[{name:"show",rawName:"v-show",value:e.video,expression:"video"}],ref:"agentself",class:{show:e.showVideo},style:[{"max-height":e.$vuetify.breakpoint.smAndDown?"188px !important":"70vh"}],attrs:{id:"agentsCamera",autoplay:"",playsinline:""}}),t("div",{class:e.$vuetify.breakpoint.smAndDown?"myCameraContainer":"myCameraContainer-fs"},[t("video",{directives:[{name:"show",rawName:"v-show",value:e.video,expression:"video"}],ref:"myself",attrs:{id:"myCamera",autoplay:"",playsinline:"",muted:""},domProps:{muted:!0}})])])])},We=[],Te=i("9715"),Ee=i.n(Te),Ae=class{constructor(e,t,i,s,a){this.ua=null,this.line1=null,this.remoteView=void 0,this.selfView=void 0,this.__endcall=a,this.campaign=t,this.telserver=e,this.guid=i,this.mynumber="web",this.mypassword="uC0nt4ctW3bch4t",this.voice=!0,this.stunTurnConfs=s,-1!=navigator.userAgent.indexOf("Chrome")&&(this.voice="{ mandatory : { googEchoCancellation: true, googEchoCancellation2: true, googAutoGainControl: true, googNoiseSuppression: true, googHighpassFilter: true, googTypingNoiseDetection: true } }"),this.socket=new Ee.a.WebSocketInterface("wss://"+this.telserver+":8089/ws"),this.configuration={sockets:[this.socket],uri:"sip:"+this.mynumber+"@"+this.telserver,password:this.mypassword,session_timers:!1,realm:"asterisk",register:!1},window.onbeforeunload=e=>(this.hangUp(),null)}setVideoElements(e,t,i){this.selfView=e,this.remoteView=t,this.store=i}startUA(){null===this.ua&&(this.ua=new Ee.a.UA(this.configuration),this.ua.start(),this.attachUAEventHandlers())}attachUAEventHandlers(){this.ua.on("registered",e=>{}),this.ua.on("connecting",e=>{}),this.ua.on("connected",e=>{}),this.ua.on("disconnected",e=>{}),this.ua.on("unregistered",e=>{}),this.ua.on("registrationFailed",e=>{}),this.ua.on("newMessage",e=>{}),this.ua.on("newRTCSession",e=>{this.line1=e.session,this.attachCallEventHandlers()})}attachCallEventHandlers(){var e=null;this.line1.on("icecandidate",(function(t,i){null!=e&&clearTimeout(e),e=setTimeout(t.ready,3e3)})),this.line1.on("connecting",e=>{this.attachRTCHandlers()}),this.line1.on("confirmed",e=>{this.chat.sendStartCallEvent(this.video)});var t=this.__endcall;this.line1.on("ended",e=>{"undefined"!==typeof e.message&&null!==e.message&&"undefined"!==typeof e.message.headers&&null!==e.message.headers&&"undefined"!==typeof e.message.headers["X-Asterisk-Hangupcausecode"]&&null!==e.message.headers["X-Asterisk-Hangupcausecode"]&&"undefined"!==typeof e.message.headers["X-Asterisk-Hangupcausecode"][0].raw&&null!==e.message.headers["X-Asterisk-Hangupcausecode"][0].raw&&"undefined"!==typeof e.message.headers["X-Asterisk-Hangupcausecode"][0].raw&&e.message.headers["X-Asterisk-Hangupcausecode"][0].raw,this.chat.sendEndCallEvent(this.video),window.parent.postMessage({action:"HANGUP_CALL",video:this.video},"*"),this.line1=null,this.audio=!1,this.video=!1,t()}),this.line1.on("failed",e=>{this.line1=null,this.audio=!1,this.emptyVideo(),this.video=!1,console.log("failed"),"Canceled"===e.cause&&console.log("cause canceled")})}attachRTCHandlers(){this.line1.connection.onaddstream=e=>{this.remoteView.srcObject=e.stream},this.line1.connection.onremovestream=e=>{console.log("Removestream...")},this.line1.connection.ontrack=e=>{this.remoteView.srcObject=e.streams[0]},this.line1.connection.addEventListener("iceconnectionstatechange",e=>{if("connected"==e.target.iceConnectionState){let e=new MediaStream;this.line1.connection.getSenders().forEach(t=>{e.addTrack(t.track)}),this.selfView.srcObject=e}})}makeCall(e,t){if(1===this.ua.status){if(null==this.line1){let i={mediaConstraints:{audio:this.voice,video:t},extraHeaders:["CAMPAIGN: "+this.campaign,"GUID:"+this.guid],pcConfig:{iceServers:[this.getTurnCredentials()]}};this.ua.call("sip:"+e+"@"+this.telserver,i),this.video=t,window.parent.postMessage({action:"MAKE_CALL",video:t},"*")}}else setTimeout(()=>{this.makeCall(e,t)},1e3)}hangUp(){null!=this.ua&&this.ua.terminateSessions(),this.line1=null}SendDTMF(e){null!=this.line1&&this.line1.sendDTMF(e)}mute(){null!=this.line1&&this.line1.mute()}unmute(){null!=this.line1&&this.line1.unmute()}emptyVideo(){this.remoteView.src="",this.selfView.src=""}getTurnCredentials(){let e;return e=this.stunTurnConfs.TurnServer&&this.stunTurnConfs.TurnUser&&this.stunTurnConfs.TurnPassword?{urls:["turn:"+this.stunTurnConfs.TurnServer,"stun:stun.l.google.com:19302","stun:stun.ucontactcloud.com"],username:this.stunTurnConfs.TurnUser,credential:this.stunTurnConfs.TurnPassword}:{urls:["stun:stun.l.google.com:19302","stun:stun.ucontactcloud.com"]},e}},Oe=function(){var e=this,t=e._self._c;return t("span",{attrs:{id:"chronometer"}},[e._v(e._s(e.chronometer))])},Ne=[],je={name:"chronometer",props:{isCall:{type:Boolean,default:!1}},data(){return{callSecondsCounter:{hours:0,minutes:0,seconds:"00"},startTime:(new Date).getTime(),updateInterval:null}},computed:{chronometer(){return this.callSecondsCounter.hours?` ${this.callSecondsCounter.hours}:${this.callSecondsCounter.minutes}:${this.callSecondsCounter.seconds}`:` ${this.callSecondsCounter.minutes}:${this.callSecondsCounter.seconds}`}},mounted(){const e=(new Date).getTime();let t=this.$store.getters.getLastActiveTime;null!=t&&void 0!=t&&1!=this.$props.isCall||(this.$store.commit("changeLastActiveTime",e),t=e);const i=(e-t)/1e3;this.startTimer(i)},methods:{startTimer(e){this.updateInterval=setInterval(()=>{this.updateTimer(e)},1e3)},updateTimer(e){const t=(new Date).getTime(),i=parseInt(e)+(t-this.startTime)/1e3,s=Math.floor(i/3600),a=Math.floor(i%3600/60),n=Math.floor(i%60);this.callSecondsCounter.seconds=n<10?"0"+n:n,this.callSecondsCounter.hours=s,this.callSecondsCounter.minutes=a}}},ze=je,De=(i("9239"),Object(j["a"])(ze,Oe,Ne,!1,null,"6aa4dbe0",null)),Pe=De.exports,qe={props:{show:Boolean,video:Boolean},name:"call",components:{Chronometer:Pe},data(){return{phone:null,mute:!1,showVideo:!0,isOnVideoCall:!1}},watch:{show(){this.show&&this.initTelephony()}},created(){this.video&&(this.showVideo=!0)},mounted(){this.initTelephony()},methods:{async initTelephony(){const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);if(this.show){let e=this.$refs.agentself,i=this.$refs.myself,s=this.$store.state[t].configuration.campaign,a=this.$store.state[t].interaction.guid,n=this.$store.state[t].turnConf,o=this.$store.state[t].telephonyServer;this.phone=new Ae(o,s,a,n,()=>{this.hangup()}),this.$emit("phone",this.phone),this.phone.setVideoElements(i,e,this.$store),this.phone.startUA(),this.phone.makeCall(this.$store.state[t].interaction.telAgent,this.video)}},hangup(){this.$emit("hangupEv"),this.phone?(this.$store.commit("setIsInCall",!1),this.phone.hangUp()):window.close()},mutebutton(){this.mute=!this.mute,this.mute?this.phone.mute():this.phone.unmute()},switchShowVideo(){this.showVideo=!this.showVideo,this.showTextInput=!this.showTextInput,this.$emit("hideTextAreaEv")}}},Re=qe,Le=(i("d866e"),Object(j["a"])(Re,_e,We,!1,null,"ab50592c",null)),Fe=Le.exports,Ve=class{constructor(e){this.http=e}addAttachment(e,t){const i=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],s=p.state.findIndex(e=>e.configuration.campaign===i);let a=e.name.split("."),n=["doc","txt","docm","docx","dot","ppt","pptm","pptx","psd","pst","tif","tiff","xlsx","dotx","pdf","xls","zip","wav","mp3","mp4","avi","mpeg","mpg","png","jpg","jpeg","gif","bmp","csv","m4a","mov"],o=a[a.length-1];return n.includes(o.toLowerCase())?e.size>1024e4?"maxfilesize10mb":(this.convertirB64(e,i=>{this.http.post("https://"+p.state[s].configuration.ip+"/IntegraChannels/resources/webchat/addAttachment",i,{headers:{"Content-type":"application/x-www-form-urlencoded"},params:{filename:e.name.replace(/[^a-zA-Z0-9.]/g,"_")}}).then(i=>{200===i.status&&t(this.getFileType(e)+"|"+JSON.parse(i.bodyText)[0])},e=>{})}),!0):"invalidextension"}getFileType(e){var t=e.type;return t.indexOf("image")>-1?"image":t.split("/")[0]}convertirB64(e,t){let i=new FileReader;i.onload=e=>{let i=btoa(e.target.result);t(this.checkB64(i))},i.readAsBinaryString(e)}checkB64(e){let t=0;e.length%4!=0&&(t=4-e.length%4);for(let i=0;ie.show()),(function(i,s){return t("v-list-item",{key:s,attrs:{id:i.id,disabled:i.disabled()},on:{click:i.action}},[t("v-list-item-icon",{staticClass:"mr-3"},[t("v-icon",[e._v("mdi-"+e._s(i.icon))])],1),t("v-list-item-content",[t("v-list-item-title",[e._v(e._s(e.$t(i.text)))])],1)],1)})),1)],1)],1):t("v-toolbar-items",e._l(e.buttons.filter(e=>e.show()),(function(i,s){return t("v-tooltip",{key:s,attrs:{bottom:""},scopedSlots:e._u([{key:"activator",fn:function({on:s}){return[t("v-btn",e._g({attrs:{icon:"",id:i.id,disabled:i.disabled()},on:{click:function(e){return e.stopPropagation(),e.preventDefault(),i.action.apply(null,arguments)}}},s),[t("v-icon",{style:{color:e.invertColor(e.getWebchat().campaign.color)}},[e._v(" mdi-"+e._s(i.icon)+" ")])],1)]}}],null,!0)},[t("span",[e._v(e._s(e.$t(i.text)))])])})),1)],1)],1)},Ge=[],Je={name:"chat-toolbar",props:{hideEndConv:Boolean,isBot:Boolean},data(){return{avatar:xe.a,hasWebRTC:!1,window:window,buttons:[{text:"videocall",icon:"video",action:this.videoCall,id:"btn-videocall",disabled:()=>this.isInCall,show:()=>this.allowedCalls&&this.hasWebRTC&&!this.hideButtons},{text:"call",icon:"phone",action:this.makeCall,id:"btn-call",disabled:()=>this.isInCall,show:()=>this.allowedCalls&&this.hasWebRTC&&!this.hideButtons},{text:"accessibility",icon:"human",action:this.openAccessibilityModal,id:"btn-accessibility",disabled:()=>!1,show:()=>!0},{text:"endchat",icon:"close",action:this.openCloseModal,id:"btn-endchat",disabled:()=>!1,show:()=>!this.hideEndConv}]}},computed:{getVisiblePhoneIcons(){return this.hasWebRTC},isInCall(){return this.$store.state[this.$store.state.findIndex(e=>e.configuration.campaign===this.$route.query.campaign)].isInCall},isIOS(){const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);return this.$store.state[t].isIOS},isMobile(){const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);return this.$store.state[t].isMobile},allowedCalls(){const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);return this.$store.state[t].campaign.allow_call},hideButtons(){return this.hideEndConv||this.isBot}},created(){Be.a.load(()=>{this.hasWebRTC=Be.a.isWebRTCSupported})},methods:{isChrome(){return navigator.userAgent.indexOf("CriOS")>-1},makeCall(){this.$emit("clickCallEv")},videoCall(){this.$emit("clickVideoCallEv")},openCloseModal(){this.$emit("openConfirmationModal")},openAccessibilityModal(){this.$emit("openAccessibilityModal")},getWebchat(){return this.$store.state[this.$store.state.findIndex(e=>e.configuration.campaign===this.$route.query.campaign)]},minimizeWindow(){window.parent.postMessage({action:"MINIMIZE"},"*")},invertColor:C}},Qe=Je,Xe=(i("60cb"),i("23ed"),Object(j["a"])(Qe,He,Ge,!1,null,"3608a490",null)),Ke=Xe.exports,Ye=function(){var e=this,t=e._self._c;return t("v-row",{attrs:{"no-gutters":""}},[t("v-col",{staticClass:"close-chat-modal",class:{show:e.show},style:{"background-color":e.getWebchat().campaign.color,color:e.invertColor(e.getWebchat().campaign.color)},attrs:{cols:"12"}},[t("v-row",{staticClass:"pt-2",attrs:{"no-gutters":""}},[t("v-col",{attrs:{cols:"12"}},[t("span",{staticStyle:{"font-size":"clamp(8px, 3.4vw, 16px)"}},[e._v(e._s(e.messageDialogue))])]),t("v-col",{attrs:{cols:"12"}},[t("v-btn",{style:{color:e.invertColor(e.getWebchat().campaign.color)},attrs:{text:""},nativeOn:{click:function(t){return e.confirmClosing.apply(null,arguments)}}},[e._v(e._s(e.$t("yes")))]),t("v-btn",{style:{color:e.invertColor(e.getWebchat().campaign.color)},attrs:{text:""},nativeOn:{click:function(t){return e.cancelClosing.apply(null,arguments)}}},[e._v(" "+e._s(e.$t("no"))+" ")])],1)],1)],1)],1)},Ze=[],et={props:{show:Boolean,messageDialogue:String},name:"closing-dialog",data(){return{dialog:!1,window:window}},methods:{invertColor:C,cancelClosing(){this.$emit("cancelClosingEv",!1)},confirmClosing(){this.$emit("confirmClosingEv",!0)},getWebchat(){return this.$store.state[this.$store.state.findIndex(e=>e.configuration.campaign===this.$route.query.campaign)]}}},tt=et,it=(i("3151"),Object(j["a"])(tt,Ye,Ze,!1,null,null,null)),st=it.exports,at=function(){var e=this,t=e._self._c;return"started"===e.getWebchat().interaction.state||e.fromChat?"started"===e.getWebchat().interaction.state&&e.fromChat?t("v-row",{staticClass:"pt-2 accessibility-options-dialog",class:{show:e.show},style:{"background-color":e.getWebchat().campaign.color,color:e.invertColor(e.getWebchat().campaign.color)},attrs:{"no-gutters":""}},[t("v-col",{attrs:{cols:"12"}},[e._v(" "+e._s(e.$t("accessibilityMenu"))+" "),t("v-btn",{staticStyle:{bottom:"4px",right:"4px"},attrs:{elevation:"0",fab:"",icon:"",depressed:"",absolute:"","x-small":"",color:e.invertColor(e.getWebchat().campaign.color)},on:{click:function(t){return e.$emit("close")}}},[t("v-icon",[e._v("mdi-arrow-up")])],1)],1),t("v-col",{attrs:{cols:"12"}},[t("div",{staticClass:"d-flex flex-column align-start"},[e._l(e.accessibilityOptions,(function(i,s){return t("v-btn",{key:s,staticClass:"mx-2 pa-0",attrs:{color:e.invertColor(e.getWebchat().campaign.color),text:""},on:{click:i.action}},[t("v-icon",[e._v(" "+e._s(i.icon)+" ")]),e._v(" "+e._s(e.$t(i.label))+" ")],1)})),t("v-stepper",{staticClass:"d-flex justify-center mx-2 pa-0 mb-2",staticStyle:{gap:"3px","background-color":"transparent"},attrs:{flat:""},model:{value:e.getWebchat().client.accessibility.fontSize,callback:function(t){e.$set(e.getWebchat().client.accessibility,"fontSize",t)},expression:"getWebchat().client.accessibility.fontSize"}},e._l(3,(function(i){return t("v-stepper-step",{key:i,staticClass:"pa-0",staticStyle:{height:"5px","border-radius":"10px",background:"white"},attrs:{complete:i==e.getWebchat().client.accessibility.fontSize,step:" ","complete-icon":" "}})})),1)],2)])],1):e._e():t("v-menu",{attrs:{top:"","close-on-content-click":!1,"offset-x":!0,"offset-y":!0,absolute:"","position-y":8,"position-x":8},scopedSlots:e._u([{key:"activator",fn:function({on:i,attrs:s}){return[t("v-btn",e._g(e._b({staticClass:"accessibility-options-button",staticStyle:{position:"absolute",left:"8px","z-index":"1"},style:[{color:e.invertColor(e.getWebchat().campaign.color)},{top:e.getWebchat().isLowRes?"32px":"8px"},{zoom:"1."+e.getWebchat().client.accessibility.fontSize}],attrs:{color:e.invertColor(e.getWebchat().campaign.color),dark:"",icon:""}},"v-btn",s,!1),i),[t("v-icon",[e._v(" mdi-human ")])],1)]}}],null,!1,2746725142)},[t("v-list",{staticClass:"py-3"},e._l(e.accessibilityOptions,(function(i,s){return t("v-list-item",{key:s,staticStyle:{"min-height":"auto"},on:{click:i.action}},[t("v-list-item-icon",{staticClass:"ma-0 py-2 pr-2"},[t("v-icon",[e._v(e._s(i.icon))])],1),t("v-list-item-content",[t("v-list-item-title",[e._v(e._s(e.$t(i.label)))]),t("v-list-item-subtitle",[t("v-stepper",{staticClass:"d-flex justify-center mx-2 pa-0 mb-2",staticStyle:{gap:"3px","background-color":"transparent","justify-content":"flex-start !important"},attrs:{flat:""},model:{value:e.getWebchat().client.accessibility.fontSize,callback:function(t){e.$set(e.getWebchat().client.accessibility,"fontSize",t)},expression:"getWebchat().client.accessibility.fontSize"}},e._l(3,(function(s){return t("v-stepper-step",{key:s,staticClass:"pa-0",staticStyle:{height:"5px","border-radius":"10px",background:"white"},attrs:{complete:s==e.getWebchat().client.accessibility.fontSize,step:" ","complete-icon":" "},on:{click:i.action}})})),1)],1)],1)],1)})),1)],1)},nt=[],ot={props:{show:Boolean,fromChat:Boolean},name:"accessibility-options-dialog",data(){return{accessibilityOptions:[{name:"fontsize",icon:"mdi-format-size",label:"Font size",action:()=>{this.$store.commit("setAccessibilityFontSize",this.getWebchat().client.accessibility.fontSize>=3?0:this.getWebchat().client.accessibility.fontSize+1),window.parent.postMessage({action:"WEBCHAT_SIZE",size:this.getWebchat().client.accessibility.fontSize},"*")}}]}},methods:{invertColor:C,getWebchat(){return this.$store.state[this.$store.state.findIndex(e=>e.configuration.campaign===this.$route.query.campaign)]},no(){this.$emit("no",!1)},yes(){this.$emit("yes",!0)}}},ct=ot,rt=(i("809a"),Object(j["a"])(ct,at,nt,!1,null,null,null)),lt=rt.exports,dt=function(){var e=this,t=e._self._c;return t("v-row",{attrs:{"no-gutters":""}},[t("v-col",{staticClass:"screen-share-dialog",class:{show:e.show},style:{"background-color":e.getWebchat().campaign.color,color:e.invertColor(e.getWebchat().campaign.color)},attrs:{cols:"12"}},[t("v-row",{staticClass:"pt-2",attrs:{"no-gutters":""}},[t("v-col",{attrs:{cols:"12"}},[e._v(" "+e._s(e.$t("shareScreen"))+" ")]),t("v-col",{attrs:{cols:"12"}},[t("v-btn",{style:{color:e.invertColor(e.getWebchat().campaign.color)},attrs:{text:""},nativeOn:{click:function(t){return e.yes.apply(null,arguments)}}},[e._v(e._s(e.$t("yes")))]),t("v-btn",{style:{color:e.invertColor(e.getWebchat().campaign.color)},attrs:{text:""},nativeOn:{click:function(t){return e.no.apply(null,arguments)}}},[e._v(e._s(e.$t("no")))])],1)],1)],1)],1)},ut=[],ht={props:{show:Boolean},name:"screen-share-dialog",data(){return{dialog:!1,window:window}},methods:{invertColor:C,no(){this.$emit("no",!1)},yes(){this.$emit("yes",!0)},getWebchat(){return this.$store.state[this.$store.state.findIndex(e=>e.configuration.campaign===this.$route.query.campaign)]}}},mt=ht,gt=(i("5e6f"),Object(j["a"])(mt,dt,ut,!1,null,null,null)),pt=gt.exports;const ft=i("051a");class vt{constructor(e,t,i,s){this.sendMessage=e,this.showWebrtcStream=t,this.active=!1,this.isMobile=i,this.turnConfs=s,Be.a.load()}onMessage(e){e.subtype===M.WS_REQUEST_SCREEN?this.isMobile?this.sendError(M.WS_NOT_SUPPORTED):this.active||(this.showWebrtcStream.dialog=!0):e.subtype===M.WS_SIGNALLING&&(this.peer||this.initPeer(!1),this.peer.signal(e.content))}cancelShareScreen(){this.showWebrtcStream.dialog=!1,this.sendError(M.WS_DENIED)}async shareScreen(){this.showWebrtcStream.dialog=!1,this.active=!0;let e=await this.getDisplayMedia();e?this.initPeer(!0,e):(this.active=!1,this.sendError(M.WS_DENIED))}sendError(e){const t=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],i=p.state.findIndex(e=>e.configuration.campaign===t);let s={type:"webchat",subtype:M.WS_REQUEST_SCREEN,content:e,source:p.state[i].client.guid,guid:p.state[i].interaction.guid};this.sendMessage(s)}async getDisplayMedia(){try{this.stream=await navigator.mediaDevices.getDisplayMedia({video:!0})}catch(e){this.stream=null,console.error(e)}return this.stream}getTurnCredentials(){let e;return e=this.turnConfs.TurnServer&&this.turnConfs.TurnUser&&this.turnConfs.TurnPassword?{urls:["turn:"+this.turnConfs.TurnServer,"stun:stun.l.google.com:19302","stun:stun.ucontactcloud.com"],username:this.turnConfs.TurnUser,credential:this.turnConfs.TurnPassword}:{urls:["stun:stun.l.google.com:19302","stun:stun.ucontactcloud.com"]},console.log(e),e}initPeer(e,t){this.peer=new ft({initiator:e,stream:t,config:{iceServers:[this.getTurnCredentials()]}}),this.peer.on("signal",e=>{const t=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],i=p.state.findIndex(e=>e.configuration.campaign===t);this.sendMessage({type:"webchat",subtype:M.WS_SIGNALLING,content:e,source:p.state[i].client.guid,guid:p.state[i].interaction.guid})}),this.peer.on("stream",e=>{this.showWebrtcStream.visible=!0,this.showWebrtcStream.stream=e}),this.peer.on("close",()=>{this.onCloseConnection()}),this.peer.on("error",e=>{this.onCloseConnection(),console.log(e)}),t&&(t.getVideoTracks()[0].onended=()=>{this.closeStream()})}onCloseConnection(){this.showWebrtcStream.visible=!1,this.active=!1,this.peer=null,this.stream&&this.stream.getTracks().forEach(e=>{e.stop()})}closeStream(){this.peer&&this.peer.destroy()}}var bt=i("d096"),wt=function(){var e=this,t=e._self._c;return t("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",fill:e.$props.color,width:e.$props.size,viewBox:"0 0 512 512"}},[t("path",{attrs:{d:"M498.1 5.6c10.1 7 15.4 19.1 13.5 31.2l-64 416c-1.5 9.7-7.4 18.2-16 23s-18.9 5.4-28 1.6L284 427.7l-68.5 74.1c-8.9 9.7-22.9 12.9-35.2 8.1S160 493.2 160 480V396.4c0-4 1.5-7.8 4.2-10.7L331.8 202.8c5.8-6.3 5.6-16-.4-22s-15.7-6.4-22-.7L106 360.8 17.7 316.6C7.1 311.3 .3 300.7 0 288.9s5.9-22.8 16.1-28.7l448-256c10.7-6.1 23.9-5.5 34 1.4z"}})])},yt=[],Ct={name:"send",props:{color:{type:String,default:"rgba(0,0,0,.54)"},size:{type:String,default:"18px"}}},$t=Ct,xt=Object(j["a"])($t,wt,yt,!1,null,null,null),St=xt.exports,kt=function(){var e=this,t=e._self._c;return t("div",{staticStyle:{display:"flex","max-height":"100%",height:"100%"}},[t("v-textarea",{ref:"textarea",staticStyle:{"max-height":"100%","border-top":"none !important","margin-top":"0"},attrs:{"hide-details":"","no-resize":"","single-line":"",placeholder:e.$props.placeholder,rows:"1",height:"100%",dense:"",color:"rgba(0,0,0,.54) ","prepend-inner-icon":"mdi-emoticon-outline"},on:{click:e.hidePicker,blur:e.textArea,keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.submit.apply(null,arguments)},input:function(t){return e.$emit("input",e.$attrs.value)},"click:prepend-inner":function(t){return t.stopPropagation(),e.togglePicker.apply(null,arguments)}},model:{value:e.$attrs.value,callback:function(t){e.$set(e.$attrs,"value",t)},expression:"$attrs.value"}}),e.showPicker?t("EmojiPicker",{ref:"emojiPicker",staticClass:"emojiPicker",on:{click:function(t){return t.stopPropagation(),e.textArea.apply(null,arguments)},addEmoji:e.addEmoji}}):e._e()],1)},Mt=[],It=function(){var e=this,t=e._self._c;return t("div",{staticClass:"emojiPicker active"},[t("Picker",{ref:"picker",staticClass:"picker",attrs:{data:e.emojiIndex,set:"google",native:"Windows"!==e.OS,title:e.emojiMartI18n.title+"...",i18n:e.emojiMartI18n},on:{select:e.addEmoji}})],1)},_t=[],Wt=i("364d"),Tt=(i("01ce"),i("41fb"));let Et=new Tt["EmojiIndex"](Wt,{exclude:["flags"]});var At={name:"EmojiPicker",components:{Picker:Tt["Picker"]},data(){return{emojiIndex:Et,emojisOutput:"",OS:""}},mounted(){this.OS="Win32"===navigator.platform?"Windows":"Other",this.excludeSpecificEmojis()},computed:{emojiMartI18n(){return this.$i18n.messages[this.getWebchat().client.lang].emojis||this.$i18n.messages["en"].emojis}},methods:{getWebchat(){return this.$store.state[this.$store.state.findIndex(e=>e.configuration.campaign===this.$route.query.campaign)]},excludeSpecificEmojis(){let e=["relaxed"],t=this.$refs.picker.$data.view._categories;for(let i of t){let t=i.emojis;i.emojis=t.filter(t=>!e.includes(t.id))}},addEmoji(e){this.$emit("addEmoji",e)}}},Ot=At,Nt=(i("aecc"),Object(j["a"])(Ot,It,_t,!1,null,null,null)),jt=Nt.exports,zt={name:"EmojiTextArea",components:{EmojiPicker:jt},props:{placeholder:{type:String}},data(){return{message:"Hello Vue!",lastPosition:0,showPicker:!1}},mounted(){let e="Win32"===navigator.platform?"Windows":"Other";document.querySelectorAll("style")[0].innerHTML+=`textarea {\n margin: 0 !important;\n padding-right: 20px !important;\n font-family: ${"Windows"===e?"'Open Sans', 'Noto Color Emoji'":"'Open Sans', sans-serif !important;"} !important;\n }`},methods:{togglePicker(){this.showPicker=!this.showPicker,this.$emit("click")},submit(e){e.shiftKey||(this.$emit("enter",this.$attrs.value),this.$attrs.value="",e.preventDefault())},addEmoji(e){let t=this.$attrs.value.slice(0,this.lastPosition),i=this.$attrs.value.slice(this.lastPosition);this.$attrs.value=t+e.native+i,this.lastPosition=this.lastPosition+e.native.length;let s=this.$refs.textarea.$refs.input;this.$nextTick().then(()=>{this.$emit("input",this.$attrs.value),s.focus(),this.$nextTick(()=>{s.selectionStart=this.lastPosition,s.selectionEnd=this.lastPosition})})},textArea(){this.$nextTick(()=>{this.lastPosition=this.$refs.textarea.$refs.input.selectionStart})},hidePicker(){this.showPicker=!1},open(e){this.isOpen=e}}},Dt=zt,Pt=(i("429b2"),Object(j["a"])(Dt,kt,Mt,!1,null,null,null)),qt=Pt.exports,Rt={name:"chat",components:{Message:Ie,Call:Fe,Chronometer:Pe,ChatToolbar:Ke,ClosingDialog:st,ScreenShareDialog:pt,AccessibilityOptions:lt,Send:St,EmojiTextArea:qt},data(){return{showModalAbandon:!1,interval:null,websocket:null,usertyping:!1,windowcall:null,attachments:new Ve(this.$http),transfering:!1,isOnVideoCall:!1,isInCall:!1,showTextInput:!0,showClosingDialog:!1,lastOneMe:null,lastOneAgent:null,fullWebcam:!1,sentTyping:!1,showWebrtcStream:{visible:!1,dialog:!1,stream:null},showEndConv:!1,endConv:!1,bot:!1,screenShareController:null,attachUploading:!1,window:window,showAccessibilityDialog:!1,Send:St,sendedFiles:[]}},computed:{typingText:{get(){const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);return this.$store.state[t].client.typingText},set(e){this.$store.commit("setTypingText",e),e&&!this.sentTyping?this.sendTyping():e||this.sendNotTyping()}},typingVisible(){return this.usertyping},notif:{get(){const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);return this.$store.state[t].notifications.notifications},set(e){this.$store.commit("setNotifications",e)}},getText(){const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);let i=this.$store.state[t].campaign,s=this.$store.state[t].client.lang;return i.holdtimemessage[s]?i.holdtimemessage[s]:i.holdtimemessage["en"]},...Object(o["b"])({imageAgent:"imageAgent"}),evaluateHeight(){let e=`calc(100svh / 1.${this.getWebchat().client.accessibility.fontSize} - 111px)`;return this.$vuetify.breakpoint.smAndDown?this.isInCall?e=this.isOnVideoCall?this.showClosingDialog||this.showWebrtcStream.dialog||this.showAccessibilityDialog?this.showWebrtcStream.visible?`calc(100svh / 1.${this.getWebchat().client.accessibility.fontSize} - 486px)`:`calc(100svh / 1.${this.getWebchat().client.accessibility.fontSize} - 424px)`:this.showWebrtcStream.visible?`calc(100svh / 1.${this.getWebchat().client.accessibility.fontSize} - 411px)`:`calc(100svh / 1.${this.getWebchat().client.accessibility.fontSize} - 349px)`:this.showClosingDialog||this.showWebrtcStream.dialog||this.showAccessibilityDialog?this.showWebrtcStream.visible?`calc(100svh / 1.${this.getWebchat().client.accessibility.fontSize} - 486px)`:`calc(100svh / 1.${this.getWebchat().client.accessibility.fontSize} - 236px)`:this.showWebrtcStream.visible?`calc(100svh / 1.${this.getWebchat().client.accessibility.fontSize} - 411px)`:`calc(100svh / 1.${this.getWebchat().client.accessibility.fontSize} - 161px)`:this.showClosingDialog||this.showWebrtcStream.dialog||this.showAccessibilityDialog?e=this.showWebrtcStream.visible?`calc(100svh / 1.${this.getWebchat().client.accessibility.fontSize} - 486px)`:`calc(100svh / 1.${this.getWebchat().client.accessibility.fontSize} - 186px)`:this.showWebrtcStream.visible?e=`calc(100svh / 1.${this.getWebchat().client.accessibility.fontSize} - 411px)`:e:this.isInCall?this.isOnVideoCall?this.showClosingDialog||this.showWebrtcStream.dialog||this.showAccessibilityDialog?e=this.showWebrtcStream.visible?`calc(100svh / 1.${this.getWebchat().client.accessibility.fontSize} - 486px)`:`calc(100svh / 1.${this.getWebchat().client.accessibility.fontSize} - 186px)`:this.showWebrtcStream.visible?e=`calc(100svh / 1.${this.getWebchat().client.accessibility.fontSize} - 411px)`:e:e=this.showClosingDialog||this.showWebrtcStream.dialog||this.showAccessibilityDialog?this.showWebrtcStream.visible?`calc(100svh / 1.${this.getWebchat().client.accessibility.fontSize} - 486px)`:`calc(100svh / 1.${this.getWebchat().client.accessibility.fontSize} - 236px)`:this.showWebrtcStream.visible?`calc(100svh / 1.${this.getWebchat().client.accessibility.fontSize} - 411px)`:`calc(100svh / 1.${this.getWebchat().client.accessibility.fontSize} - 161px)`:this.showClosingDialog||this.showWebrtcStream.dialog||this.showAccessibilityDialog?e=this.showWebrtcStream.visible?`calc(100svh / 1.${this.getWebchat().client.accessibility.fontSize} - 486px)`:`calc(100svh / 1.${this.getWebchat().client.accessibility.fontSize} - 186px)`:this.showWebrtcStream.visible?e=`calc(100svh / 1.${this.getWebchat().client.accessibility.fontSize} - 411px)`:e}},created(){window.addEventListener("beforeunload",this.leaving);const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);this.$store.state[t].interaction.guid?this.checkStateOnServer():this.connectWebSocket(),this.$eventsManager.susbscribeChat(this),this.$eventManagerMenu.subscribeChat(this),this.screenShareController=new vt(this.sendWebSocket,this.showWebrtcStream,this.$store.state[t].isMobile,this.$store.state[t].turnConf)},mounted(){this.scrollBottom()},methods:{leaving(){this.$refs.callComponent.hangUp()},onPhone(e){e.chat=this},invertColor:C,hasParameters(){const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);return this.$store.state[t].configuration.name&&this.$store.state[t].configuration.mail&&this.$store.state[t].configuration.initialMessage},getWebchat(){return this.$store.state[this.$store.state.findIndex(e=>e.configuration.campaign===this.$route.query.campaign)]},menuMessageEvent(e){this.lastMenuMessage=e},disableLastMenuMessage(e){this.lastMenuMessage&&this.lastMenuMessage.disableMenuMessage(e)},async checkStateOnServer(){const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);try{let i=await this.$http.get("https://"+this.$store.state[t].configuration.ip+"/IntegraChannels/resources/webchat/thisGuid",{params:{guid:this.$store.state[t].interaction.guid}});i.body[0]?this.connectWebSocket():this.$router.push({path:"form",query:{campaign:e}})}catch(i){this.$router.push({path:"form",query:{campaign:e}})}},connectWebSocket(){const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);let i=this.$store.state[t].configuration.ip,s=this.$store.state[t].client.guid;this.websocket=new bt["a"](v(i,s)),this.websocket.timeoutInterval=5e3,this.websocket.maxReconnectInterval=5e3,this.websocket.reconnectDecay=1.1,this.websocket.onopen=this.onOpenWebSocket,this.websocket.onmessage=this.onMessageWebSocket,this.websocket.onclose=this.onCloseWebSocket,this.interval=setInterval(()=>{this.sendWebSocket({})},3e4)},onOpenWebSocket(e){const t=this.$route.query.campaign,i=this.$store.state.findIndex(e=>e.configuration.campaign===t);this.$store.state[i].interaction.state===M.NOT_STARTED_STATE?this.startChat():window.parent.postMessage({action:"CURRENT_URL"},"*")},onCloseWebSocket(e){console.log("websocket disconnected")},onMessageWebSocket(e){const t=this.$route.query.campaign,i=this.$store.state.findIndex(e=>e.configuration.campaign===t);let s=JSON.parse(e.data);switch(s.subtype){case M.WS_CHAT_CREATED:this.chatCreated(s);break;case M.WS_CONNECTED:this.connected(s);break;case M.WS_NEW_MESSAGE:if(this.bot=s.bot,this.newMessage(s),!this.$store.state[i].firstMessageDisplayed&&this.$store.state[i].campaign.first_message_agent){let e=new Object;e.content=this.$store.state[i].campaign.first_message_agent,e.source=this.$store.state[i].interaction.telAgent,this.newMessage(e),this.$store.commit("changeFirstMessageDisplayed")}break;case M.WS_CHAT_FINISHED:this.finishChat(s);break;case M.WS_TYPING:this.typing(s);break;case M.WS_TIMEOUT:this.timeOut();break;case M.WS_TRANSFERRED:this.bot=!1,this.$store.commit("startTransfering");break;case M.WS_ATTENDED:this.connected(s),this.$store.commit("endTransfering");break;case M.WS_REQUEST_SCREEN:this.screenShareController.onMessage(s);break;case M.WS_SIGNALLING:this.screenShareController.onMessage(s);break;case M.WS_WEBCHAT_EVENT:this.webChatEvent(s.content);break;case M.WS_QUEUE_POSITION:window.parent.postMessage({action:M.WS_QUEUE_POSITION,state:this.$store.state[i],position:s.content},"*");break}},webChatEvent(e){window.parent.postMessage({action:"WEBCHAT_EVENT",data:e},"*")},sendWebSocket(e){this.websocket&&this.websocket.send(JSON.stringify(e))},sendTyping(){const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);let i={type:"webchat",subtype:"typing",content:"typing",source:this.$store.state[t].client.guid,guid:this.$store.state[t].interaction.guid};this.sentTyping=!0,this.sendWebSocket(i)},sendStartCallEvent(e){const t=this.$route.query.campaign,i=this.$store.state.findIndex(e=>e.configuration.campaign===t);let s={type:"webchat",subtype:"startcall",content:e?"video":"",source:this.$store.state[i].client.guid,guid:this.$store.state[i].interaction.guid};this.sendWebSocket(s)},sendEndCallEvent(e){const t=this.$route.query.campaign,i=this.$store.state.findIndex(e=>e.configuration.campaign===t);let s={type:"webchat",subtype:"ENDCALL",content:e?"video":"",source:this.$store.state[i].client.guid,guid:this.$store.state[i].interaction.guid};this.sendWebSocket(s)},sendNotTyping(){const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);let i={type:"webchat",subtype:"typing",content:"nottyping",source:this.$store.state[t].client.guid,guid:this.$store.state[t].interaction.guid};this.sentTyping=!1,this.sendWebSocket(i)},startChat(){this.$store.commit("clearInteraction");const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);let i={type:"webchat",subtype:"startinteraction"};i.source=this.$store.state[t].client.guid,i.content={},i.content.campaign=this.$store.state[t].configuration.campaign,i.content.name=this.$store.state[t].client.name,i.content.mail=this.$store.state[t].client.mail,i.content.initialMessage=this.$store.state[t].client.initialMessage,i.content.number=this.$store.state[t].client.number,i.content.ipAddress=this.$store.state[t].client.ipAddress,i.content.data=this.$store.state[t].client.data,this.sendWebSocket(i)},chatCreated(e){this.$store.commit("waitingInteraction");let t=e.guid;parseInt(e.content);this.$store.commit("changeGuidInteraction",t)},newMessage(e){const t=this.$route.query.campaign,i=this.$store.state.findIndex(e=>e.configuration.campaign===t);let s=[],a=e.attachments||[];if(e.source===e.destination)for(let o=0;o{this.$refs.textarea.focus()},this.$store.state[i].menu.menu_img)},newNotifMessage(e){this.disableLastMenuMessage(!0);let t={};t.message=e,t.notif=!0,this.$store.commit("newMessage",t),this.scrollBottom()},finishChat(e){this.$store.commit("interactionFinished");const t=this.$route.query.campaign,i=this.$store.state.findIndex(e=>e.configuration.campaign===t);"finished"!==this.$store.state[i].interaction.state&&window.parent.postMessage({action:"COMPLETEAGENT",state:this.$store.state[i]},"*"),this.interval&&clearInterval(this.interval),this.websocket&&this.websocket.close(),this.endConv=!0,this.openEndConvModal()},typing(e){"typing"===e.content?(this.usertyping=!0,this.scrollBottom()):"nottyping"===e.content&&(this.usertyping=!1)},connected(e){const t=this.$route.query.campaign,i=this.$store.state.findIndex(e=>e.configuration.campaign===t);if(this.$store.commit("connectedInteraction"),e.content){const t=e.content.agent||"Chat",s=e.content.fullname||t,a=e.content.agentnumber;t?this.$store.commit("nameImage",t):1==this.state[i].campaign.logo&&this.$store.commit("nameImage",this.state[i].configuration.campaign),s&&this.$store.commit("nameAgent",s),this.$store.commit("telAgent",a),this.$store.commit("username",e.content.agent),e.content.isBot||(1==e.content.autoanswer?this.openWindowCalling():2==e.content.autoanswer&&this.openWindowVideocalling())}window.parent.postMessage({action:"CURRENT_URL"},"*"),window.parent.postMessage({action:"CONNECTED",state:this.$store.state[i]},"*")},sendMessage(e){const t=this.$route.query.campaign,i=this.$store.state.findIndex(e=>e.configuration.campaign===t);let s=this.$store.state[i].client.typingText.replaceAll(/<[^>]*>/g,"").trim();if(""!==s){let e={type:"webchat",subtype:"newmessage"};e.source=this.$store.state[i].client.guid,e.guid=this.$store.state[i].interaction.guid,e.content=s,this.disableLastMenuMessage(e.content),this.$store.commit("clearMessage"),this.sendNotTyping(),this.sendWebSocket(e)}else this.$store.commit("clearMessage")},sendCurrentURL(e){const t=this.$route.query.campaign,i=this.$store.state.findIndex(e=>e.configuration.campaign===t);let s={type:"webchat",subtype:"currentURL"};s.source=this.$store.state[i].client.guid,s.guid=this.$store.state[i].interaction.guid,s.content=e,this.sendWebSocket(s)},timeOut(){const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);this.$store.state[t].interaction.transfering&&this.$store.commit("endTransfering"),this.$store.commit("setOffline"),this.$router.push({path:"/form",query:{campaign:e}})},sendFinish(){const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);window.parent.postMessage({action:"COMPLETECALLER",state:this.$store.state[t]},"*"),this.$store.commit("finishedInteraction");let i=new Object;i.type="webchat",i.subtype="finishchat",i.source=this.$store.state[t].client.guid,i.guid=this.$store.state[t].interaction.guid,this.sendWebSocket(i)},sendAbandon(){const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);window.parent.postMessage({action:"ABANDON",state:this.$store.state[t]},"*");let i=new Object;i.type="webchat",i.subtype="finishchat",i.source=this.$store.state[t].client.guid,i.guid=this.$store.state[t].interaction.guid,this.sendWebSocket(i)},openWindowCalling(){this.isInCall=!0,this.$store.commit("setIsInCall",!0)},openWindowVideocalling(){this.isInCall=!0,this.isOnVideoCall=!0,this.$store.commit("setIsInCall",!0)},openAccessibilityModal(){this.showAccessibilityDialog=!this.showAccessibilityDialog},closeAccessibilityModal(){this.showAccessibilityDialog=!1},hangup(){this.isInCall=!1,this.isOnVideoCall=!1,this.scrollBottom()},switchShowTextInput(){this.showTextInput=!this.showTextInput},addAttachment(){this.$refs.inputfiles.click()},scrollBottom(){this.$nextTick(()=>{if(this.$refs.chatContainer){let e=this.$refs.chatContainer;e.scrollTop=e.scrollHeight}})},focusTextArea(){this.$refs.textarea.focus()},openCloseDialog(){const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);"finished"==this.$store.state[t].interaction.state?(this.showClosingDialog=!1,this.showEndConv=!0):(this.showClosingDialog=!0,this.showEndConv=!1),this.showWebrtcStream.dialog=!1},hideClosingModal(){this.showClosingDialog=!1},clickModalAbandon(){const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);this.showModalAbandon=!1,this.sendAbandon(),this.$store.state[t].campaign.allow_feedback_client?(this.$store.commit("finishedInteraction"),this.$router.push({path:"/survey",query:{campaign:e}})):(this.$store.commit("noStartedInteraction"),this.$router.push({path:"/form",query:{campaign:e}}))},shouldClose(e){const t=this.$route.query.campaign,i=this.$store.state.findIndex(e=>e.configuration.campaign===t);e&&(this.isInCall&&this.$refs.callComponent.hangup(),this.endConv&&(this.$store.state[i].campaign.allow_feedback_client?(this.$store.commit("finishedInteraction"),this.$router.push({path:"/survey",query:{campaign:t}})):(this.$store.commit("noStartedInteraction"),this.$router.push({path:"/form",query:{campaign:t}}))),this.sendFinish()),this.showClosingDialog=!1},onFileChange(e){const t=this.$route.query.campaign,i=this.$store.state.findIndex(e=>e.configuration.campaign===t);this.attachUploading=!0,this.sendedFiles=[...e.target.files];let s=this.attachments.addAttachment(e.target.files[0],e=>{this.disableLastMenuMessage(!0);let t=new Object;t.type="webchat",t.subtype="newmessage",t.source=this.$store.state[i].client.guid,t.guid=this.$store.state[i].interaction.guid,t.content="",t.attachments=[e],this.$store.commit("clearMessage"),this.sendWebSocket(t),this.attachUploading=!1});"string"==typeof s&&(this.newNotifMessage(this.$t(s)),this.attachUploading=!1),e.target.value=""},currentUrl(e){this.sendCurrentURL(e)},finish(){this.finishChat()},sendOnlyText(e){const t=this.$route.query.campaign,i=this.$store.state.findIndex(e=>e.configuration.campaign===t);let s={type:"webchat",subtype:"newmessage",source:this.$store.state[i].client.guid,guid:this.$store.state[i].interaction.guid,content:JSON.stringify(e),destination:"agent"};this.sendWebSocket(s)},cancelModalEndConv(){this.showEndConv=!1},acceptModalEndConv(e){const t=this.$route.query.campaign,i=this.$store.state.findIndex(e=>e.configuration.campaign===t);e?(window.parent.postMessage({action:"FINISH_CHAT",state:this.$store.state[i]},"*"),this.$store.state[i].campaign.allow_feedback_client?(this.$store.commit("finishedInteraction"),this.$router.push({path:"/survey",query:{campaign:t}})):(this.$store.commit("noStartedInteraction"),this.$router.push({path:"/form",query:{campaign:t}}))):(this.showTextInput=!1,this.showEndConv=!1)},openEndConvModal(){return this.showEndConv=!0,this.showWebrtcStream.dialog=!1}}},Lt=Rt,Ft=(i("7032"),i("750f"),Object(j["a"])(Lt,S,k,!1,null,"3335539a",null)),Vt=Ft.exports,Ut=class{constructor(e){this.http=e}newState(e,t,i){const s=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],a=p.state.findIndex(e=>e.configuration.campaign===s);let n=0;e&&(n=t?i?3:2:1);let o=p.state[a].eventState;n!==o&&(p.commit("setEventState",n),3!==n&&this.sendEvent(n))}sendEvent(e){const t=window.location.hash.split("&").find(e=>e.includes("campaign")).split("=")[1],i=p.state.findIndex(e=>e.configuration.campaign===t);this.http.get("https://"+p.state[i].configuration.ip+"/IntegraChannels/resources/webchat/sendEventLog",{params:{type:e,campaign:p.state[i].configuration.campaign,email:p.state[i].client.mail,name:p.state[i].client.name}}).then(e=>{console.log(e)},e=>{console.log(e)})}},Bt=function(){var e=this,t=e._self._c;return t("v-card",{staticClass:"border-radius-welcome",style:{"background-color":e.getWebchat().campaign.color,color:e.invertColor(e.getWebchat().campaign.color),zoom:"1."+e.getWebchat().client.accessibility.fontSize}},[e.getWebchat().isLowRes?t("v-btn",{staticClass:"right-arrow-back",attrs:{icon:""},nativeOn:{click:function(t){return e.minimizeWindow.apply(null,arguments)}}},[t("v-icon",{staticStyle:{"font-size":"28px !important"},style:{color:e.invertColor(e.getWebchat().campaign.color)}},[e._v("mdi-chevron-left")])],1):e._e(),t("div",{staticClass:"header-content"},[t("div",{staticClass:"vtext-content",style:{color:e.invertColor(e.getWebchat().campaign.color)},domProps:{innerHTML:e._s(e.getText)}})])],1)},Ht=[],Gt={name:"welcome-message",data(){return{window:window}},computed:{getText(){const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);let i=this.$store.state[t].campaign,s=this.$store.state[t].client.lang,a="";return i.timeOut?a=i.notavailablemessage[s]?i.notavailablemessage[s]:i.notavailablemessage["en"]:i.onTime?a=i.available?i.welcome[s]?i.welcome[s]:i.welcome["en"]:i.notavailablemessage[s]?i.notavailablemessage[s]:i.notavailablemessage["en"]:i.outoftime&&(a=i.outoftime[s]?i.outoftime[s]:i.outoftime["en"]),a}},methods:{invertColor:C,minimizeWindow(){window.parent.postMessage({action:"MINIMIZE"},"*")},getWebchat(){return this.$store.state[this.$store.state.findIndex(e=>e.configuration.campaign===this.$route.query.campaign)]}}},Jt=Gt,Qt=(i("7d65"),i("6a3e"),Object(j["a"])(Jt,Bt,Ht,!1,null,"6811f5ba",null)),Xt=Qt.exports,Kt={name:"app",components:{Chat:Vt,WelcomeMessage:Xt,AccessibilityOptions:lt},data(){return{allowedDomain:!0,eventsLog:new Ut(this.$http),broadcastedColor:!1}},computed:{showWelcome(){const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);let i=this.$store.state[t].interaction.state;return i!=M.STARTED_STATE&&i!=M.FINISHED_STATE}},created(){this.init()},methods:{init(){this.$route.query.ip&&this.$store.commit({type:"addConfiguration",param:this.$route.query}),this.getWebchat().client&&!this.getWebchat().client.accessibility&&this.$store.commit("setAccessibilityFontSize",0),this.isOnTime(),this.checkRouter(),this.appReady(),window.parent.postMessage({action:"WEBCHAT_SIZE",size:this.getWebchat().client.accessibility.fontSize},"*")},appReady(){this.$store.commit("isMobile",$()),this.$store.commit("isIOS",x())},getWebchat(){return this.$store.state[this.$store.state.findIndex(e=>e.configuration.campaign===this.$route.query.campaign)]},hasParameters(){const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);return this.$store.state[t].configuration.name&&this.$store.state[t].configuration.mail},startChatWithParameters(){const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);this.$store.commit("setClientInfo",{name:this.$store.state[t].configuration.name,mail:this.$store.state[t].configuration.mail,number:this.$store.state[t].configuration.number||"",initialMessage:this.$store.state[t].configuration.initialMessage,data:this.$store.state[t].configuration.data}),this.$store.commit("newGuid"),this.$router.push({path:"chat",query:{campaign:e}})},checkRouter(){const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);let i=this.$store.state[t].interaction.state;i===M.NOT_STARTED_STATE?this.hasParameters()?this.startChatWithParameters():this.$router.push({path:"form",query:{campaign:e}}):i===M.WAITING_STATE||i===M.STARTED_STATE?this.$router.push({path:"chat",query:{campaign:e}}):i===M.FINISHED_STATE&&this.$router.push({path:"form",query:{campaign:e}})},async isOnTime(){const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);try{let e=await this.$http.get("https://"+this.$store.state[t].configuration.ip+"/IntegraChannels/resources/webchat/isOnTimeV2",{params:{campaign:this.$store.state[t].configuration.campaign}});this.onResponseTime(e.data)}catch(i){this.$store.commit("setOnTime",{param:{onTime:!1}}),console.log("ERROR FETCHING INFO:"+i)}},deB64(e){try{return decodeURIComponent(escape(window.atob(e)))}catch(t){return console.error(t),atob(e)}},onResponseTime:function(e){const t=this.$route.query.campaign,i=this.$store.state.findIndex(e=>e.configuration.campaign===t);if(!e)return;let s=JSON.parse(this.deB64(e));s.outoftime=JSON.parse(s.outoftime),s.welcome=JSON.parse(s.welcome),s.feedback=JSON.parse(s.feedback),s.holdtimemessage=JSON.parse(s.holdtimemessage);let a={TurnServer:s.TurnServer,TurnUser:s.TurnUser,TurnPassword:s.TurnPassword},n=s.telephonyServer,o=window.location.href.indexOf(s.allowedDomains||"")>-1;if(!s.allowedDomains||s.allowedDomains&&o){s.custom_field?s.custom_field=JSON.parse(s.custom_field):s.custom_field={required:!1,visible:!0,text:{en:"Phone Number",es:"Telefono",pt:"Telefone"}};let e={es:"No disponible",en:"Not available",pt:"Não disponível"};s.notavailablemessage?(s.notavailablemessage=JSON.parse(s.notavailablemessage),s.notavailablemessage.es||s.notavailablemessage.en||s.notavailablemessage.pt||(s.notavailablemessage=e)):s.notavailablemessage=e,this.$store.commit({type:"setOnTime",param:s}),this.$store.commit("setFeedback",s.feedback),this.$store.commit("setIpAddress",s.ipAddress),this.$store.commit("setCampaignLogo",s.logo),this.$store.commit("setCampaignLogoName",this.$store.state[i].configuration.campaign),this.$store.commit("setTurnConf",a),this.$store.commit("setTelephonyServer",n),this.broadcastedColor||(setTimeout(()=>{window.parent.postMessage({action:"SET_COLOR",color:s.color},"*")},500),this.broadcastedColor=!0),s.available||setTimeout(this.isOnTime,1e4)}else this.allowedDomain=!1}}},Yt=Kt,Zt=(i("bc67"),Object(j["a"])(Yt,a,n,!1,null,null,null)),ei=Zt.exports,ti=i("9483");Object(ti["a"])("/webchatclient/service-worker.js",{ready(){console.log("App is being served from cache by a service worker.\nFor more details, visit https://goo.gl/AFskqB")},registered(){console.log("Service worker has been registered.")},cached(){console.log("Content has been cached for offline use.")},updatefound(){console.log("New content is downloading.")},updated(){console.log("New content is available; please refresh.")},offline(){console.log("No internet connection found. App is running in offline mode.")},error(e){console.error("Error during service worker registration:",e)}});i("a732");var ii=i("8c4f"),si=function(){var e=this,t=e._self._c;return t("transition",{attrs:{name:"slide-form"}},[t("div",{staticClass:"cardHolder",style:{zoom:"1."+e.getWebchat().client.accessibility.fontSize}},[e.getVisibleForm?t("v-card",{directives:[{name:"show",rawName:"v-show",value:e.showInputs,expression:"showInputs"}],staticClass:"main-form-div",style:{"border-top":"2px solid "+e.getWebchat().campaign.color+"60"}},[t("v-layout",{attrs:{row:"",wrap:""}},[t("v-flex",{attrs:{xs12:"",sm12:"",md12:"",lg12:"",xl12:""}},[t("v-text-field",{ref:"namefield",staticClass:"form-input input-style first-input",style:{color:e.getWebchat().campaign.color},attrs:{label:e.$t("name"),rules:[()=>!!e.client.name||e.$t("musttypename")],error:e.errorCheck&&""==e.client.name,"prepend-icon":"mdi-account",required:""},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.$refs.emailfield.focus.apply(null,arguments)}},model:{value:e.client.name,callback:function(t){e.$set(e.client,"name",t)},expression:"client.name"}})],1),e.getWebchat().campaign.show_email?t("v-flex",{attrs:{xs12:"",sm12:"",md12:"",lg12:"",xl12:""}},[t("v-text-field",{ref:"emailfield",staticClass:"form-input input-style",style:{color:e.getWebchat().campaign.color},attrs:{label:e.$t("email"),rules:[()=>!!e.client.mail||e.$t("musttypemail"),()=>e.emailRegex.test(e.client.mail)||e.$t("validemail")],error:e.errorCheck&&""==e.client.mail,"prepend-icon":"mdi-mail",required:""},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.$refs.customfield.focus.apply(null,arguments)}},model:{value:e.client.mail,callback:function(t){e.$set(e.client,"mail",t)},expression:"client.mail"}})],1):e._e(),e.getWebchat().campaign.custom_field.visible?t("v-flex",{attrs:{xs12:"",sm12:"",md12:"",lg12:"",xl12:""}},[t("v-text-field",{ref:"customfield",staticClass:"form-input input-style",style:{color:e.getWebchat().campaign.color},attrs:{"prepend-icon":"mdi-label",label:e.getWebchat().campaign.custom_field.text[e.getWebchat().client.lang],error:e.errorCheck&&e.getWebchat().campaign.custom_field.required&&""==e.client.number,required:e.getWebchat().campaign.custom_field.required},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.$refs.messagefield.focus.apply(null,arguments)}},model:{value:e.client.number,callback:function(t){e.$set(e.client,"number",t)},expression:"client.number"}})],1):e._e(),t("v-flex",{attrs:{xs12:"",sm12:"",md12:"",lg12:"",xl12:""}},[t("v-textarea",{ref:"messagefield",staticClass:"form-input input-style",style:{color:e.getWebchat().campaign.color},attrs:{label:e.$t("message"),rules:[()=>!!e.client.initialMessage||e.$t("musttypemessage")],error:e.errorCheck&&""==e.client.initialMessage,"prepend-icon":"mdi-chat",required:"","auto-grow":"",rows:"1"},nativeOn:{keyup:function(t){return t.type.indexOf("key")||13===t.keyCode?e.clickForm.apply(null,arguments):null}},model:{value:e.client.initialMessage,callback:function(t){e.$set(e.client,"initialMessage",t)},expression:"client.initialMessage"}})],1),t("v-btn",{style:{"background-color":e.getWebchat().campaign.color},attrs:{rounded:"",small:"",width:"100%",id:"btnEnviar"},on:{click:e.clickForm}},[t("span",{staticStyle:{"font-size":"2.8vw"},style:{color:e.invertColor(e.getWebchat().campaign.color)}},[e._v(e._s(e.getWebchat().campaign.available?e.$t("newConversation"):e.$t("sendMessage"))+"  ")]),t("Send",{attrs:{color:e.invertColor(e.getWebchat().campaign.color)}})],1)],1)],1):e._e()],1)])},ai=[],ni={name:"main-form",components:{Send:St},data(){return{showInputs:!0,client:{name:"",mail:"",number:"",message:"",initialMessage:"",data:"",lang:""},window:window,emailRegex:new RegExp(/\S+@\S+\.\S+/),messageSended:!1,errorCheck:!1,Send:St}},computed:{getVisibleForm(){const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);let i=this.$store.state[t].campaign;return!!(i.onTime&&i.avaiableAgents&&i.avaiableInteractions)||i.showMessage}},created(){this.$store.commit("changeImage",""),this.getInitialInfo()},mounted(){this.$store.commit("noStartedInteraction"),this.$store.commit("newGuid"),this.$store.commit("clearInitialMessage"),this.$store.commit("clearInteraction"),window.parent.postMessage({action:"WEBCHAT_READY"},"*")},methods:{invertColor:C,getInitialInfo(){const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);let i=this.$store.state[t].client;this.client.name=i.name,this.client.number=i.number,this.client.lang=i.lang,-1==i.mail.indexOf("no-domain")&&(this.client.mail=i.mail)},clickForm(){const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);let i=this.$store.state[t].campaign,{name:s,initialMessage:a,mail:n,number:o}=this.client,c=new RegExp("^([a-zA-ZàèìòùÀÈÌÒÙáéíóúýÁÉÍÓÚÝâêîôûÂÊÎÔÛãñõÃÑÕäëïöüÿÄËÏÖÜŸçÇߨøÅ寿œ0-9_.@ -])+$");const r=localStorage.getItem("vuex");if(r){const e=JSON.parse(r);this.$store.commit("updateVuex",e)}let l=this.$store.state[t].interaction.state;l===M.WAITING_STATE||l===M.STARTED_STATE?this.$router.push({path:"chat",query:{campaign:e}}):(this.client.data=this.$store.state[t].configuration.data,s&&c.test(s)&&a&&(!o||c.test(o))?i.show_email&&n&&c.test(n)&&this.emailRegex.test(n)||!i.show_email?i.custom_field.required&&o||!i.custom_field.required?i.onTime&&i.available?(i.show_email||(this.client.mail=f()+"@no-domain.com"),this.sendTochat()):this.sendMessageOffline():(this.$toast.bottom(this.$t("fieldserror")),this.errorCheck=!0):(this.errorCheck=!0,this.$toast.bottom(this.$t("emailerror"))):(this.$toast.bottom(this.$t("fieldserror")),this.errorCheck=!0))},async sendMessageOffline(){const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);if(!this.messageSended){this.messageSended=!0,this.client.campaign=this.$store.state[t].configuration.campaign;try{await this.$http.get("https://"+this.$store.state[t].configuration.ip+"/IntegraChannels/resources/webchat/sendOfflineMessage",{params:this.client}),this.showInputs=!1,this.$toast.bottom(this.$t("messagesended"))}catch(i){this.$toast.bottom(this.$t("messageserror")),console.log(i)}}},sendTochat(e){const t=this.$route.query.campaign;this.$store.commit("setClientInfo",this.client),this.$store.commit("newGuid"),this.$router.push({path:"chat",query:{campaign:t}})},getWebchat(){return this.$store.state[this.$store.state.findIndex(e=>e.configuration.campaign===this.$route.query.campaign)]}}},oi=ni,ci=(i("3722"),Object(j["a"])(oi,si,ai,!1,null,"a8c72278",null)),ri=ci.exports,li=function(){var e=this,t=e._self._c;return t("transition",{attrs:{name:"slide-fade"}},[t("div",{staticClass:"holderInputs",style:{zoom:"1."+e.getWebchat().client.accessibility.fontSize}},[t("v-card",{staticClass:"header-card",style:{"background-color":e.getWebchat().campaign.color,color:e.invertColor(e.getWebchat().campaign.color)}},[e.getWebchat().isLowRes?t("v-btn",{staticClass:"left-arrow-back",attrs:{icon:""},nativeOn:{click:function(t){return e.minimizeWindow.apply(null,arguments)}}},[t("v-icon",{staticStyle:{"font-size":"28px !important"},style:{color:e.invertColor(e.getWebchat().campaign.color)},attrs:{"x-large":""}},[e._v("mdi-close")])],1):e._e(),t("div",{staticClass:"header-content"},[t("div",{staticClass:"vtext-content",style:{color:e.invertColor(e.getWebchat().campaign.color)},domProps:{innerHTML:e._s(e.getTitleMessage)}})])],1),t("v-card",{staticClass:"survey-content"},[t("star-rating",{staticClass:"star-rating-comp",attrs:{"show-rating":!1,increment:0==e.getWebchat().campaign.fullStars?.5:1},model:{value:e.rating,callback:function(t){e.rating=t},expression:"rating"}}),e.getWebchat().campaign.show_email?t("v-switch",{staticClass:"switch-align",attrs:{color:e.getWebchat().campaign.color,label:e.$t("sendbymail")},model:{value:e.sendmail,callback:function(t){e.sendmail=t},expression:"sendmail"}}):e._e(),t("div",{staticClass:"containerTextArea",staticStyle:{padding:"9px 20px"}},[t("v-text-field",{attrs:{label:e.$t("message"),maxlength:"300",counter:"300"},model:{value:e.surveyMessage,callback:function(t){e.surveyMessage=t},expression:"surveyMessage"}})],1),t("v-btn",{staticStyle:{"font-size":"2.8vw"},style:{"background-color":e.getWebchat().campaign.color,color:e.invertColor(e.getWebchat().campaign.color)},attrs:{id:"btnEnviar",width:"100%",rounded:""},on:{click:e.clickSend}},[e._v(" "+e._s(e.$t("sendpunctuation"))+"   "),t("Send",{attrs:{color:e.invertColor(e.getWebchat().campaign.color),size:"20px"}})],1)],1)],1)])},di=[],ui=i("5b3d"),hi=i.n(ui),mi={name:"survey",components:{StarRating:hi.a,Send:St},data(){return{window:window,Send:St}},computed:{rating:{get(){const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);return this.$store.state[t].client.rating},set(e){this.$store.commit("setRatingValue",e)}},surveyMessage:{get(){const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);return this.$store.state[t].client.surveyMessage},set(e){this.$store.commit("setSurveyMessage",e)}},sendmail:{get(){const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);return this.$store.state[t].client.sendmail},set(e){this.$store.commit("setSendMail",e)}},getTitleMessage(){const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);let i=this.$store.state[t].campaign.feedback,s=this.$store.state[t].client.lang;return i[s]}},mounted(){this.$store.commit("clearSurveyMessage"),this.$store.commit("clearCalification")},methods:{invertColor:C,async clickSend(){const e=this.$route.query.campaign,t=this.$store.state.findIndex(t=>t.configuration.campaign===e);if(this.rating)try{await this.$http.get("https://"+this.$store.state[t].configuration.ip+"/IntegraChannels/resources/webchat/rating",{params:{guid:this.$store.state[t].interaction.guid,rating:this.$store.state[t].client.rating*(0==this.$store.state[t].campaign.fullStars?2:1),comments:this.$store.state[t].client.surveyMessage,mail:this.$store.state[t].client.sendmail?1:0,from:this.$store.state[t].client.mail}}),this.$store.commit("noStartedInteraction"),this.$router.push({path:"/form",query:{campaign:e}}),window.parent.postMessage({action:"SURVEYCOMPLETED"},"*")}catch(i){console.warn("ERROR SENDING REQUEST => ",i)}else this.$toast.bottom(this.$t("youmustpickastar"))},minimizeWindow(){window.parent.postMessage({action:"MINIMIZE"},"*")},getWebchat(){return this.$store.state[this.$store.state.findIndex(e=>e.configuration.campaign===this.$route.query.campaign)]}}},gi=mi,pi=(i("ee56"),i("1b98"),Object(j["a"])(gi,li,di,!1,null,"f8c605de",null)),fi=pi.exports;s["default"].use(ii["a"]);const vi=new ii["a"]({routes:[{path:"/",component:ri},{path:"/call",name:"call",component:Fe},{path:"/chat",name:"chat",component:Vt},{path:"/form",name:"form",component:ri},{path:"/survey",name:"survey",component:fi}]});vi.beforeEach((e,t,i)=>{if(e.matched.some(e=>e.meta.hasQueryParamPage)){let t=null;if(Object.prototype.hasOwnProperty.call(e.query,"page")||(t={...e,query:{...e.query,page:1}}),t)return void i(t)}i()});var bi=vi,wi=i("a925"),yi={shareScreen:"Would you like to share your screen?",no:"No",yes:"Yes",youmustpickastar:"You must pick a calification",name:"Name",email:"E-mail",phone:"Phone",message:"Message",sendMessage:"Send message",newConversation:"New conversation",sendpunctuation:"Send Feedback",musttypemail:"You must type your mail",validemail:"This is not a valid E-mail",screenshare:"Share Screen",musttypename:"You must type your name",musttypemessage:"You must type a message",configuration:"Configuration",notifications:"Notifications",notificationDetails:"Notify me about new messages that I recive in this chat",close:"Close",cancel:"Cancel",save:"Save",willclose:"Closing Chat",closeconf:"Are you sure you want to close the chat ?",conversationend:"The chat ended, Do you want to close it?",newmessage:"New message",typehere:"Send a message...",whatdoyouthink:"What do you think about the service you have received ?",sendbymail:"Send conversation by e-mail",holdtimeavg:"Hold time average",holdtime:"Your hold time",messagesended:"Message Sent!",emailerror:"Please enter a valid e-mail to continue",fieldserror:"Please check the fields and try again",messageserror:"Oops, something went wrong :(",message:"Write your Message...",transfering:"Transfering...",endchat:"End chat",videocall:"Videocall",call:"Call",openinextarnalwindow:"Open in external window",calling:"Calling",callingduration:"Calling duration",mute:"Mute",allowmicrophone:"Allow microphone",hangup:"Hangup",duration:"Duration ",write:"Write",survey_title:"We hope you are happy with the service",survey_desc:"We'd love to know more about your experience with our support, you think you can take the time to give us some feedback?",available:"Available",invalidextension:"Attachment format invalid",maxfilesize10mb:"Max file size 10 MB",accessibility:"Accessibility",accessibilityMenu:"Accessibility Menu","Font size":"Font size",emojis:{search:"Search",notfound:"No Emoji Found",title:"Pick an Emoji",categories:{search:"Search Results",recent:"Frequently Used",people:"Smileys & People",nature:"Animals & Nature",foods:"Food & Drink",activity:"Activity",places:"Travel & Places",objects:"Objects",symbols:"Symbols",flags:"Flags",custom:"Custom"}}},Ci={shareScreen:"¿Le gustaría compartir la pantalla?",no:"No",yes:"Si",youmustpickastar:"Debe elegir una calificación",name:"Nombre",email:"Correo Electrónico",phone:"Teléfono",message:"Mensaje",sendMessage:"Enviar mensaje",newConversation:"Nueva conversación",sendpunctuation:"Enviar calificación",musttypemail:"Debe ingresar su correo electrónico",validemail:"No es un correo electrónico válido",musttypename:"Debe ingresar su nombre",musttypemessage:"Debe escribir un mensaje",configuration:"Configuración",notifications:"Notificaciones",screenshare:"Compartir Pantalla",notificationDetails:"Notificarme sobre nuevos mensajes que reciba en esta conversación",close:"Cerrar",cancel:"Cancelar",save:"Guardar",willclose:"Cerrando Conversación",closeconf:"¿Está seguro que quiere cerrar la conversación?",conversationend:"La conversación ha finalizado, ¿Desea cerrarla?",newmessage:"Nuevo mensaje",typehere:"Envía un mensaje ...",whatdoyouthink:"¿Qué piensa acerca del servicio brindado?",sendbymail:"Enviar conversación por email",holdtimeavg:"Tiempo promedio de espera",holdtime:"Su tiempo de espera",messagesended:"Mensaje enviado",emailerror:"Debe ingresar un correo válido para continuar",fieldserror:"Por favor verifique los campos e intente nuevamente",messageserror:"Oops, algo salio mal :(",message:"Escribe tu mensaje...",transfering:"Transfiriendo...",endchat:"Finalizar chat",videocall:"Videollamada",call:"Llamada",openinextarnalwindow:"Abrir en ventana externa",calling:"Llamando",callingduration:"Duración de la llamada",mute:"Mute",allowmicrophone:"Permitir micrófono",hangup:"Colgar",duration:"Duración ",write:"Escribir",survey_title:"Esperamos haberte asistido",survey_desc:"Agradecemos que se tome el tiempo para contarnos que piensa del servicio brindado, estos datos nos ayudan a seguir brindandole un servicio óptimo!",available:"Disponible",invalidextension:"Formato de archivo adjunto inválido",maxfilesize10mb:"Tamaño máximo de archivos 10 MB",accessibility:"Accesibilidad",accessibilityMenu:"Menú de accesibilidad","Font size":"Tamaño de fuente",emojis:{search:"Buscar",notfound:"No se encontraron emojis",title:"Elija un emoji",categories:{search:"Resultados de la búsqueda",recent:"Usados frecuentemente",people:"Rostros y personas",nature:"Animales y naturaleza",foods:"Comida y bebida",activity:"Actividad",places:"Viajes y lugares",objects:"Objetos",symbols:"Símbolos",flags:"Banderas",custom:"Personalizados"}}},$i={shareScreen:"Deseja compartilhar a tela?",no:"Não",yes:"Sim",youmustpickastar:"Você deve escolher um grau",name:"Nome",email:"Correio eletrônico",phone:"Telefone",message:"Mensagem",sendMessage:"Enviar mensagem",newConversation:"Nova conversa",sendpunctuation:"Enviar classificação",musttypemail:"Você deve inserir seu e-mail",validemail:"Não é um e-mail válido",musttypename:"Você deve digitar seu nome",musttypemessage:"Você deve escrever uma mensagem",configuration:"Configuração",notifications:"Notificações",screenshare:"Compartilhar tela",notificationDetails:"Notificar-me sobre novas mensagens que recebo nesta conversa",close:"Fechar",cancel:"Cancelar",save:"Guardar",willclose:"Encerramento da conversa",closeconf:"Tem certeza de que deseja encerrar a conversa?",conversationend:"A conversa terminou, você deseja fechá-la?",newmessage:"Nova mensagem",typehere:"Envie uma mensagem ...",whatdoyouthink:"O que você acha do serviço prestado?",sendbymail:"Enviar conversa por e-mail",holdtimeavg:"Tempo médio de espera",holdtime:"Seu tempo de espera",messagesended:"Mensagem enviada",emailerror:"Você deve inserir um e-mail válido para continuar",fieldserror:"Verifique os campos e tente novamente",messageserror:"Ops, algo deu errado :(",message:"Escreva sua mensagem...",transfering:"Transferindo...",endchat:"Fim de papo",videocall:"Video chamada",call:"Chamada",openinextarnalwindow:"Abrir na janela externa",calling:"Ligando",callingduration:"Duraçao da chamada",mute:"Mute",allowmicrophone:"Permitir o microfone",hangup:"Aguentar",duration:"Duração",write:"Escrever",survey_title:"Esperamos tê-lo ajudado",survey_desc:"Agradecemos que você reserve um tempo para nos dizer o que pensa do serviço prestado, esses dados nos ajudam a continuar fornecendo um serviço ideal!",available:"Disponível",invalidextension:"Formato de anexo inválido",maxfilesize10mb:"Tamanho máximo do arquivo 10 MB",accessibility:"Acessibilidade",accessibilityMenu:"Menu de acessibilidade","Font size":"Tamanho da fonte",emojis:{search:"Pesquisar",notfound:"Nenhum Emoji Encontrado",title:"Escolha um Emoji",categories:{search:"Resultados da Pesquisa",recent:"Usados ​​Recentemente",people:"Rostos e Pessoas",nature:"Animais e Natureza",foods:"Comida e Bebida",activity:"Atividade",places:"Viagens e Lugares",objects:"Objetos",symbols:"Símbolos",flags:"Bandeiras",custom:"Personalizados"}}},xi={shareScreen:"Would you like to share your screen?",no:"না",yes:"হ্যা",youmustpickastar:"You must pick a calification",name:"নাম",email:"ইমেইল",phone:"ফোন",message:"আপনার কথা",sendMessage:"বার্তা পাঠান",newConversation:"নতুন কথোপকথন",sendpunctuation:"আপনার মতামত",musttypemail:"আপনার ইমেইল এড্রেসটি দেয়ার জন্য ধন্যবাদ",validemail:"ইমেইল এড্রেসটি সঠিক নয়",musttypename:"আপনার নাম দেয়ার জন্য ধন্যবাদ",musttypemessage:"আপনার মতামত বা জিজ্ঞাসা আমাদের জানান",configuration:"কনফিগারেশন",notifications:"নোটিফিকেশন",notificationDetails:"নতুন কথোপকথনগুলো আমাকে জানানো হোক",close:"শেষ",cancel:"বাদ",save:"সেভ করুন",willclose:"কথোপকথন শেষ",closeconf:"কথোপকথন শেষ হলে আবার কন্ফার্ম করুন",newmessage:"নতুন কথোপকথন",typehere:"আপনার কথা",whatdoyouthink:"আমাদের চ্যাট সার্ভিসটি আপনার কেমন লাগলো?",sendbymail:"কথোপকথনটি ইমেইলে পাঠিয়ে দিন",holdtimeavg:"অ্যাভারেজ হোল্ড টাইম",holdtime:"আপনার হোল্ড টাইম",messagesended:"আপনার কথা পাঠানো হয়েছে",emailerror:"দয়া করে সঠিক ইমেইল এড্রেস দিন",messageserror:"সাময়িক অসুবিধার জন্য আন্তরিক দুঃখিত :(",message:"আপনার কথা",transfering:"অনুগ্রহ করে অপেক্ষা করুন",endchat:"কথোপকথন শেষ",videocall:"ভিডিও কল",call:"কল",openinextarnalwindow:"নতুন উইন্ডো",calling:"কল……",callingduration:"কলের সময়",mute:"সাউন্ড বন্ধ",allowmicrophone:"মাইক্রোফোন ব্যবহারে অনুমতি দিন",hangup:"কথোপকথন শেষ",duration:"সময় ",write:"লিখুন",survey_title:"আশা করছি আমাদের সার্ভিসে আপনি আনন্দিত।",survey_desc:"আমাদের চ্যাট সার্ভিস সম্পর্কে আপনার মতামত অত্যন্ত গুরুত্বপূর্ণ। অনুগ্রহ করে আপনার মতামত এখন অথবা পরবর্তীতে জানান।",available:"Available",invalidextension:"সংযুক্তি বিন্যাস অবৈধ৷",maxfilesize10mb:"সর্বাধিক ফাইলের আকার 10 এমবি",accessiblity:"অ্যাক্সেসিবিলিটি",accessibilityMenu:"অ্যাক্সেসিবিলিটি মেনু","Font size":"ফন্টের আকার",emojis:{search:"অনুসন্ধান করুন",notfound:"কোন ইমোজি পাওয়া যায়নি",title:"একটি ইমোজি নির্বাচন করুন",categories:{search:"অনুসন্ধান ফলাফল",recent:"সাম্প্রতিকভাবে ব্যবহৃত",people:"মুখোমুখি এবং মানুষ",nature:"প্রাণী এবং প্রাকৃতিক",foods:"খাদ্য এবং পানি",activity:"কার্যক্রম",places:"ভ্রমণ এবং স্থান",objects:"বস্তু",symbols:"প্রতীক",flags:"ঝড়পাতা",custom:"কাস্টম"}}},Si={shareScreen:"Vai vēlaties koplietot savu ekrānu?",no:"Nē",yes:"Jā",youmustpickastar:"Lūdzu izvēlieties vienu no vērtējumiem",name:"Vārds",email:"E-pasts",phone:"Telefons",message:"Ziņa",sendMessage:"Sūtīt ziņu",newConversation:"Jauna saruna",sendpunctuation:"Nosūtīt atsauksmi",musttypemail:"Jums jāievada jūsu e-pasta adrese",validemail:"Ievadīta nederīga e-pasta adrese",screenshare:"Koplietot ekrānu",musttypename:"Jums jāievada jūsu vārds",musttypemessage:"Jums jāievada ziņa",configuration:"Konfigurācija",notifications:"Paziņojumi",notificationDetails:"Paziņot par jaunām ziņām šajā sarakstē",close:"Aizvērt",cancel:"Atcelt",save:"Saglabāt",willclose:"Tiek aizvērta sarakste",closeconf:"Vai tiešām vēlaties aizvērt šo saraksti ?",conversationend:"Sarakste ir beigusies, vai vēltaties to aizvērt?",newmessage:"Jauna ziņa",typehere:"Nosūtīt ziņu...",whatdoyouthink:"Kā varat novērtēt saņemto palīdzību ?",sendbymail:"Nosūtīt saraksti e-pastā",holdtimeavg:"Vidējais gaidīšanas laiks",holdtime:"Jūsu gaidīšanas laiks",messagesended:"Ziņa nosūtīta!",emailerror:"Lūdzu ievadīt derīgu e-pastu, lai turpinātu",fieldserror:"Lūdzu pārbaudīt visus aizpildītos laukus un mēģiniet vēlreiz",messageserror:"Ups, kaut kas nogāja greizi :(",message:"Ievadiet savu ziņu...",transfering:"Pārvieno...",endchat:"Beigt saraksti",videocall:"Videozvans",call:"Zvans",openinextarnalwindow:"Atvērt atsevišķā logā",calling:"Zvana",callingduration:"Zvanīšanas ilgums",mute:"Izslēgt skaņu",allowmicrophone:"Atļaut izmantot mikrofonu",hangup:"Beigt zvanu",duration:"Ilgums ",write:"Rakstīt",survey_title:"Ceram, ka esat apmierināti ar pakalpojumu",survey_desc:"Jūsu viedoklis mums ir svarīgs. Vai veltīsiet nedaudz laika, lai atstātu atsauksmi?",available:"Pieejams",invalidextension:"Pielikuma formāts nav derīgs",maxfilesize10mb:"Maksimālais faila lielums 10 MB",accessibility:"Piekļuves funkcijas",accessibilityMenu:"Piekļuves funkcijas","Font size":"Fonta lielums",emojis:{search:"Meklēt",notfound:"Nav atrasts neviens emocijzīme",title:"Izvēlieties emocijzīmi",categories:{search:"Meklēšanas rezultāti",recent:"Nesen izmantotie",people:"Sejas un cilvēki",nature:"Dzīvnieki un dabas",foods:"Ēdiens un dzēriens",activity:"Aktivitātes",places:"Ceļojumi un vietas",objects:"Objekti",symbols:"Simboli",flags:"Karogs",custom:"Pielāgoti"}}},ki={shareScreen:"Vuoi condividere il tuo schermo?",no:"No",yes:"Sì",youmustpickastar:"Devi scegliere una valutazione",name:"Nome",email:"E-mail",phone:"Telefono",message:"Messaggio",sendMessage:"Invia messaggio",newConversation:"Nuova conversazione",sendpunctuation:"Invia feedback",musttypemail:"Devi inserire la tua e-mail",validemail:"Questa non è una e-mail valida",screenshare:"Condividi schermo",musttypename:"Devi inserire il tuo nome",musttypemessage:"Devi inserire un messaggio",configuration:"Configurazione",notifications:"Notifiche",notificationDetails:"Avvisami sui nuovi messaggi che ricevo in questa chat",close:"Chiudi",cancel:"Annulla",save:"Salva",willclose:"Chiusura chat",closeconf:"Sei sicuro di voler chiudere la chat?",conversationend:"La chat è terminata, vuoi chiuderla?",newmessage:"Nuovo messaggio",typehere:"Invia un messaggio...",whatdoyouthink:"Cosa pensi del servizio che hai ricevuto?",sendbymail:"Invia conversazione via e-mail",holdtimeavg:"Tempo di attesa medio",holdtime:"Il tuo tempo di attesa",messagesended:"Messaggio inviato!",emailerror:"Inserisci una e-mail valida per continuare",fieldserror:"Controlla i campi e riprova",messageserror:"Oops, qualcosa è andato storto :(",message:"Scrivi il tuo messaggio...",transfering:"Trasferendo...",endchat:"Termina chat",videocall:"Videochiamata",call:"Chiamata",openinextarnalwindow:"Apri in una finestra esterna",calling:"Chiamata in corso",callingduration:"Durata della chiamata",mute:"Disattiva audio",allowmicrophone:"Consenti accesso al microfono",hangup:"Riaggancia",duration:"Durata",write:"Scrivi",survey_title:"Speriamo che tu sia soddisfatto del servizio",survey_desc:"Ci piacerebbe sapere di più sulla tua esperienza con il nostro supporto, pensi di poter dedicare del tempo per darci un feedback?",available:"Disponibile",invalidextension:"Formato dell'allegato non valido",maxfilesize10mb:"Dimensione massima del file 10 MB",accessibility:"Accessibilità",accessibilityMenu:"Menu di accessibilità","Font size":"Dimensione del carattere",emojis:{search:"Cerca",notfound:"Nessuna emoji trovata",title:"Scegli un'emoji",categories:{search:"Risultati della ricerca",recent:"Usati di frequente",people:"Faccine e persone",nature:"Animali e natura",foods:"Cibo e bevande",activity:"Attività",places:"Viaggi e luoghi",objects:"Oggetti",symbols:"Simboli",flags:"Bandiere",custom:"Personalizzati"}}};s["default"].use(wi["a"]);const Mi={en:yi,es:Ci,pt:$i,bn:xi,lv:Si,it:ki};let Ii=w();p.commit("setLang",Ii);var _i=new wi["a"]({locale:Ii,messages:Mi}),Wi=i("28dd"),Ti=i("7bb1"),Ei=i("ce5b"),Ai=i.n(Ei);i("bf40");s["default"].use(Ai.a);const Oi={icons:{iconfont:"mdi"}};var Ni=new Ai.a(Oi),ji=class{constructor(e){this.store=e,window.addEventListener("message",e=>{switch(e.data.action){case"ISLOWRES":this.store.commit("isLowRes",e.data.state);break;case"CURRENT_URL":this.chat.currentUrl(e.data.state);break;case"RELOAD":window.location.reload();break;case"FINISH":this.chat&&this.chat.sendFinish();break}})}susbscribeChat(e){this.chat=e}},zi=class{constructor(){this.chat=null}sendMessage(e){this.chat&&this.chat.sendOnlyText(e)}subscribeChat(e){this.chat=e}},Di=(i("cc20"),i("7869")),Pi=i.n(Di);s["default"].use(Ti["a"]),s["default"].use(Wi["a"]),s["default"].use(Pi.a),s["default"].config.productionTip=!1,s["default"].prototype.$eventsManager=new ji(p),s["default"].prototype.$eventManagerMenu=new zi,new s["default"]({vuetify:Ni,router:bi,store:p,i18n:_i,render:e=>e(ei)}).$mount("#app")},"584c":function(e,t,i){"use strict";i("ad16")},"5e6f":function(e,t,i){"use strict";i("e158")},"60cb":function(e,t,i){"use strict";i("25b5")},"6a3e":function(e,t,i){"use strict";i("6dce")},"6dce":function(e,t,i){},7032:function(e,t,i){"use strict";i("e99f")},7046:function(e,t,i){"use strict";i("85c1")},"750f":function(e,t,i){"use strict";i("d0e5")},"75ea":function(e,t,i){},"7d65":function(e,t,i){"use strict";i("75ea")},"809a":function(e,t,i){"use strict";i("199b")},"85c1":function(e,t,i){},"8abb":function(e,t,i){},"8fa4":function(e,t,i){e.exports=i.p+"img/surveyEmoji4.8c8255a9.svg"},9239:function(e,t,i){"use strict";i("0183")},a84b:function(e,t,i){e.exports=i.p+"img/surveyEmoji1.727d0cb6.svg"},aad0:function(e,t,i){},ad16:function(e,t,i){},aecc:function(e,t,i){"use strict";i("4111")},b217:function(e,t,i){e.exports=i.p+"img/surveyEmoji3.422f7756.svg"},b3bf:function(e,t,i){e.exports=i.p+"img/surveyEmoji5.ed10c83d.svg"},bc67:function(e,t,i){"use strict";i("280f")},c8d8:function(e,t,i){"use strict";i("8abb")},cfdc:function(e,t,i){},d06b:function(e,t,i){},d0e5:function(e,t,i){},d14b:function(e,t,i){},d866e:function(e,t,i){"use strict";i("15eb")},d92b:function(e,t,i){},e086:function(e,t,i){e.exports=i.p+"img/surveyEmoji2.ca32d8c2.svg"},e158:function(e,t,i){},e99f:function(e,t,i){},ee56:function(e,t,i){"use strict";i("4075")},f0ba:function(e,t,i){"use strict";i("aad0")},f6cb:function(e,t,i){e.exports=i.p+"img/surveyYes.f6d77645.svg"}}); //# sourceMappingURL=app.f5b45eb0.js.map