(window.tawkJsonp=window.tawkJsonp||[]).push([["chunk-51872844","chunk-2d0e4a7c"],{"1ba5":function(t,e,a){"use strict";a("3abb")},"24fb":function(t,e,a){"use strict";function i(t,e){var a=t[1]||"",i=t[3];if(!i)return a;if(e&&"function"==typeof btoa){var s=function(t){var e=btoa(unescape(encodeURIComponent(JSON.stringify(t)))),a="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(e);return"/*# ".concat(a," */")}(i),n=i.sources.map((function(t){return"/*# sourceURL=".concat(i.sourceRoot||"").concat(t," */")}));return[a].concat(n).concat([s]).join("\n")}return[a].join("\n")}t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var a=i(e,t);return e[2]?"@media ".concat(e[2]," {").concat(a,"}"):a})).join("")},e.i=function(t,a,i){"string"==typeof t&&(t=[[null,t,""]]);var s={};if(i)for(var n=0;na.parts.length&&(i.parts.length=a.parts.length)}else{var r=[];for(s=0;st.length)&&(e=t.length);for(var a=0,i=Array(e);a0&&("c"===this.lastMessage.senderType||"a"===this.lastMessage.senderType||"s"===this.lastMessage.senderType)}}),created:function(){this.updateConversations()},mounted:function(){this.loadHistory()},watch:{historyConversations:{handler:"updateConversations",deep:!0},lastMessage:{handler:"updateConversations",deep:!0},incomingMessage:{handler:"updateConversations",deep:!0}},methods:v(v({},Object(i.b)({loadHistory:"history/load",routerPush:"router/routerPush",showOverlay:"overlay/showOverlay"})),{},{updateConversations:function(){var t=g(this.historyConversations);if(this.lastMessage&&Object.keys(this.lastMessage).length>0&&this.lastMessage.message){var e=this.lastMessage.message||"";t.unshift({id:"active-chat",isActive:!0,snippet:e})}this.localConversations=t},loadMoreConversations:function(){this.loadHistory({loadNext:!0,limit:5})},getConversationName:function(t){return t.isActive?this.lastMessage&&this.lastMessage.name?this.lastMessage.name:this.$i18n("chat","mobile_name"):t.agentAliases&&t.agentAliases.length>0?t.agentAliases[0].displayName:"Unknown"},getConversationTime:function(t){if(t.isActive)return"now";if(!t.endedOn)return"now";var e=new Date-new Date(t.endedOn),a=Math.floor(e/864e5);if(0===a){var i=Math.floor(e/36e5);return 0===i?"now":1===i?"1h ago":"".concat(i,"h ago")}return 1===a?"yesterday":"".concat(a,"d ago")},messageTextOnly:function(t){return f.a.removeHTMLTags(f.a.removeAnchorTags(this.$TawkWindow.makeHtml(t)))},selectConversation:function(t){if(t&&t.isActive){var e=this.$store.getters["widget/isPrechatEnabled"],a=this.$store.getters["session/prechatFormSubmitted"];e&&!a?this.routerPush("prechat"):this.routerPush("chat"),this.showOverlay(!1)}else this.$store.commit("history/setSelectedChat",t),this.routerPush("history-chat"),this.showOverlay(!0)}})},C=Object(d.a)(k,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"tawk-recents-message-section"},[e("p",{staticClass:"tawk-message-title"},[t._v(t._s(t.$i18n("chat","recent")))]),t.isLoading?e("div",{staticClass:"tawk-margin-small tawk-margin-top",staticStyle:{width:"100%"},attrs:{role:"progressbar","aria-busy":"true"}},[e("tawk-loader",{staticClass:"tawk-margin-xsmall",attrs:{type:"bar",size:"large"}}),e("tawk-loader",{staticClass:"tawk-margin-xsmall",attrs:{type:"bar",size:"large"}}),e("tawk-loader",{staticClass:"tawk-margin-xsmall",attrs:{type:"bar",size:"large"}})],1):[t.localConversations.length>0?t._l(t.localConversations,(function(a,i){return e("div",{key:a.id||i,staticClass:"tawk-message-item",attrs:{role:"button",tabindex:"0"},on:{click:function(e){return t.selectConversation(a)},keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.selectConversation(a)}}},[e("div",{staticClass:"tawk-message-item-content"},[e("div",{staticClass:"tawk-message-item-header"},[e("div",{staticClass:"tawk-message-item-info"},[e("span",{staticClass:"tawk-message-item-name"},[t._v(t._s(t.getConversationName(a)))])]),e("span",{staticClass:"tawk-message-item-time"},[t._v(t._s(t.getConversationTime(a)))])]),e("div",{staticClass:"tawk-message-item-body"},[t.hasUnreadMessage&&a.isActive?e("p",{staticClass:"tawk-message-item-text tawk-message-item-text-unread"},[e("span",{staticClass:"tawk-emoji-container"},[e("tawk-emoji",{key:t.lastMessage.messageId,attrs:{emoji:t.messageTextOnly(a.snippet),enabled:t.emojiEnabled}})],1)]):e("p",{class:["tawk-message-item-text",t.isRecentConversation(a)?"":"tawk-message-item-text-secondary"]},[e("span",{staticClass:"tawk-emoji-container"},[null!=a&&a.snippet&&0!==a.snippet.length?e("tawk-emoji",{key:t.lastMessage.messageId,attrs:{emoji:t.messageTextOnly(a.snippet),enabled:t.emojiEnabled}}):e("p",{staticClass:"tawk-text-italic"},[e("tawk-icon",{attrs:{type:"attachment",size:"small"}}),t._v(" "+t._s(t.$i18n("chat","sent_file"))+" ")],1)],1)]),a.isActive&&t.unreadMessageCount>0?e("div",{staticClass:"tawk-message-item-badge"},[t._v(t._s(t.unreadMessageCount))]):t._e(),e("tawk-icon",{staticClass:"tawk-message-chevron",attrs:{type:"chevron-right"}})],1)]),e("div",{staticClass:"tawk-message-divider"})])})):[e("div",{staticClass:"tawk-margin-auto tawk-padding"},[e("p",{staticClass:"tawk-text-regular-4 tawk-text-grey-3"},[t._v(t._s(t.$i18n("home","no_recent_conversations")))])])]],t.nextListHash&&!t.isLoading?e("div",{staticClass:"tawk-text-center tawk-margin-top-small"},[e("tawk-button",{staticClass:"tawk-message-load-more-button",attrs:{label:t.$i18n("routes","load_more"),isText:!0},on:{click:t.loadMoreConversations}},[t._v(" "+t._s(t.$i18n("routes","load_more"))+" ")])],1):t._e()],2)}),[],!1,null,null,null).exports;function O(t){return(O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function S(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,i)}return a}function x(t,e,a){return(e=function(t){var e=function(t,e){if("object"!=O(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var i=a.call(t,e||"default");if("object"!=O(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==O(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var T={name:"messages",components:{BaseFrame:s.a,BaseBody:n.a,StartChat:m,Recents:C},computed:function(t){for(var e=1;e0)},isHamburgerMenuVisible:function(){return"offline"!==this.pageStatus&&("chat"===this.currentRoute||"agents"===this.currentRoute&&!this.selectedChat)},isAgentAvatarsVisible:function(){return!(!this.showAgentAvatars||"chat"!==this.currentRoute&&"agents"!==this.currentRoute||!(this.activeProfiles.length>0))},getActiveAgents:function(){if("history-chat"===this.currentView.path){for(var t=[],e=this.selectedChat.agentAliases,a=0;a5?t.isActive=!0:t.isActive=!1}))}},h=(a("1ba5"),a("2877")),d=Object(h.a)(u,(function(){var t=this,e=t._self._c;return e("div",{ref:"toolbar",class:t.wrapperClasses,style:{borderRadius:t.borderRadiusTop}},[e("div",{staticClass:"tawk-toolbar-nav",attrs:{role:"navigation","aria-label":"primary"}},[t.showBackButton?e("div",{staticClass:"tawk-route-back tawk-flex tawk-flex-middle"},[e("tawk-button",{directives:[{name:"tawk-tooltip",rawName:"v-tawk-tooltip"}],staticClass:"tawk-header-text tawk-button-hover",attrs:{isText:!0,inverse:!0,"data-text":t.$i18n("rollover","back"),"aria-label":t.$i18n("rollover","back"),tabindex:"0"},on:{click:t.routerBack}},[e("tawk-icon",{attrs:{type:"chevron-left"}})],1),t.currentView.title&&"agents"!==t.currentRoute?e("span",{staticClass:"tawk-toolbar-title tawk-text-regular-3 tawk-header-text tawk-margin-xsmall-left tawk-custom-text-color-inverse"},[t._v(" "+t._s(t.currentView.title())+" ")]):t.chatMessages&&Object.keys(t.chatMessages).length>0&&!t.isAgentAvatarsVisible&&"prechat"!==this.currentView.path?e("p",{staticClass:"tawk-toolbar-agent-name tawk-text-truncate"},[t._v(" "+t._s(t.chatMessages[Object.keys(t.chatMessages)[0]].name)+" ")]):t._e()],1):t._e(),"history-chat"===t.currentRoute?[e("div",{class:["tawk-toolbar-agent-avatars",{"tawk-margin-remove-left":1===t.selectedChat.agentAliases}],on:{click:t.toggleAgentsList}},[t.selectedChat.agentAliases.length>1?e("div",t._l(t.selectedChat.agentAliases,(function(a,i){return e("tawk-avatar",{key:i,attrs:{src:t.convertToAvatarLink(a.profileImage),alt:"".concat(t.$i18n("chat","agent_profile_image"))}})})),1):t._e(),t.selectedChat.agentAliases.length?e("div",{staticClass:"tawk-toolbar-agent-details"},[t.selectedChat.agentAliases[0].displayName?e("p",{staticClass:"tawk-toolbar-agent-name tawk-text-truncate"},[t._v(" "+t._s(t.selectedChat.agentAliases[0].displayName)+" ")]):t._e(),t.selectedChat.agentAliases[0].profileTitle?e("p",{staticClass:"tawk-toolbar-agent-title tawk-text-truncate"},[t._v(" "+t._s(t.selectedChat.agentAliases[0].profileTitle)+" ")]):t._e()]):t._e(),t.selectedChat.agentAliases.length>1?e("div",{staticClass:"tawk-margin-xsmall-left"},[e("tawk-avatar",{attrs:{count:t.selectedChat.agentAliases.length-1}})],1):t._e()])]:t._e(),t.isHome&&t.getLogoContent?e("div",{staticClass:"tawk-flex-1 tawk-padding-small",class:["tawk-text-".concat(t.getLogoContent.alignment),"right"===t.getLogoContent.alignment?"tawk-margin-xsmall-right":""]},[e("img",{staticClass:"tawk-toolbar-logo",attrs:{src:"".concat(t.logoUrl,"/").concat(t.getLogoContent.image.content),alt:"'Logo'"}})]):t._e(),e("transition",{attrs:{name:"fade",mode:"out-in"}},[t.isAgentAvatarsVisible?e("div",{class:["tawk-toolbar-agent-avatars",{"tawk-margin-remove-left":1===t.activeProfiles.length}],on:{click:t.toggleAgentsList}},[t.activeProfiles.length>1?e("div",t._l(t.getActiveAgents,(function(a,i){return e("tawk-avatar",{key:i,attrs:{src:t.convertToAvatarLink(a.profileImage),alt:"".concat(t.$i18n("chat","agent_profile_image"))}})})),1):t._e(),e("div",{staticClass:"tawk-toolbar-agent-details"},[e("p",{staticClass:"tawk-toolbar-agent-name tawk-text-truncate"},[t._v(" "+t._s(t.getActiveAgents[0].displayName)+" ")]),e("p",{staticClass:"tawk-toolbar-agent-title tawk-text-truncate"},[t._v(" "+t._s(t.getActiveAgents[0].profileTitle)+" ")])]),t.activeProfiles.length>1?e("div",{staticClass:"tawk-margin-xsmall-left"},[e("tawk-avatar",{attrs:{count:t.activeProfiles.length-1}})],1):t._e()]):t._e()])],2),e("div",{staticClass:"tawk-margin-auto-left tawk-flex-none tawk-flex tawk-flex-middle",attrs:{role:"navigation","aria-label":"secondary"}},[t.showWebrtcOptions&&!t.needConsent?e("div",[e("tawk-button",{directives:[{name:"tawk-tooltip",rawName:"v-tawk-tooltip"}],staticClass:"tawk-header-text tawk-button-hover",attrs:{isText:!0,inverse:!0,disabled:t.ongoingCall,"aria-label":t.$i18n("rollover","voice_call"),"data-text":t.$i18n("rollover","voice_call"),tabindex:"0"},on:{click:t.initiateCall}},[e("tawk-icon",{attrs:{type:"call"}})],1),t.webrtcOptions.video?e("tawk-button",{directives:[{name:"tawk-tooltip",rawName:"v-tawk-tooltip"}],staticClass:"tawk-header-text tawk-button-hover",attrs:{isText:!0,inverse:!0,disabled:t.ongoingCall,"aria-label":t.$i18n("rollover","video_call"),"data-text":t.$i18n("rollover","video_call"),tabindex:"0"},on:{click:function(e){return t.initiateCall(!0,!1)}}},[e("tawk-icon",{attrs:{type:"video-call-on"}})],1):t._e(),t.webrtcOptions.screen?e("tawk-button",{directives:[{name:"tawk-tooltip",rawName:"v-tawk-tooltip"}],staticClass:"tawk-header-text tawk-button-hover",attrs:{isText:!0,inverse:!0,disabled:t.ongoingCall,"aria-label":t.$i18n("rollover","screen_share"),"data-text":t.$i18n("rollover","screen_share"),tabindex:"0"},on:{click:function(e){return t.initiateCall(!1,!0)}}},[e("tawk-icon",{attrs:{type:"share-screen"}})],1):t._e()],1):t._e(),t.isHamburgerMenuVisible&&!t.needConsent?e("tawk-dropdown",{ref:"toolbar-menu",staticClass:"tawk-toolbar-menu",attrs:{isOpen:t.isOpen,position:t.isRTL?"left":"right",role:"menu"},on:{"update:isOpen":function(e){t.isOpen=e},"update:is-open":function(e){t.isOpen=e}}},[e("tawk-button",{directives:[{name:"tawk-tooltip",rawName:"v-tawk-tooltip"}],ref:"toolbar-button",staticClass:"tawk-header-text tawk-margin-auto-left tawk-flex-none tawk-button-hover",attrs:{isText:!0,inverse:!0,"aria-label":t.$i18n("rollover","chat_menu"),"data-text":t.$i18n("rollover","chat_menu"),tabindex:"0"},nativeOn:{click:function(e){return t.toggleDropdown.apply(null,arguments)}}},[e("tawk-icon",{attrs:{type:"menu"}})],1),e("div",{attrs:{slot:"menu"},slot:"menu"},[e("tawk-button",{staticClass:"tawk-text-left tawk-flex tawk-flex-middle",attrs:{isText:!0,size:"small",role:"button",tabindex:t.isOpen?0:-1},on:{click:t.nameForm}},[e("span",{staticStyle:{width:"25px"}},[e("tawk-icon",{staticStyle:{width:"20px"},attrs:{type:"edit",size:"small"}})],1),t._v(" "+t._s(t.$i18n("menu","change_name"))+" ")]),t.emailTranscriptEnabled?e("tawk-button",{staticClass:"tawk-text-left tawk-flex tawk-flex-middle",attrs:{isText:!0,size:"small",role:"button",tabindex:t.isOpen?0:-1},on:{click:t.emailTranscriptForm}},[e("span",{staticStyle:{width:"25px"}},[e("tawk-icon",{attrs:{type:"envelope",size:"small"}})],1),t._v(" "+t._s(t.$i18n("menu","email_transcript"))+" ")]):t._e(),e("tawk-button",{staticClass:"tawk-text-left tawk-flex tawk-flex-middle",attrs:{isText:!0,size:"small",role:"button",tabindex:t.isOpen?0:-1},on:{click:t.toggleLocalSound}},[t.isSoundEnabled&&t.localSoundEnabled?e("div",[e("span",{staticStyle:{width:"1.6rem","vertical-align":"middle"}},[e("tawk-icon",{attrs:{type:"volume-up",size:"medium"}})],1),t._v(" "+t._s(t.$i18n("menu","sound_on"))+" ")]):e("div",[e("span",{staticStyle:{width:"1.6rem","vertical-align":"middle"}},[e("tawk-icon",{attrs:{type:"mute",size:"medium"}})],1),t._v(" "+t._s(t.$i18n("menu","sound_off"))+" ")])]),t.isWindowed?t._e():e("tawk-button",{staticClass:"tawk-text-left tawk-flex tawk-flex-middle",attrs:{isText:!0,size:"small",role:"button",tabindex:t.isOpen?0:-1},on:{click:t.popoutWidget}},[e("span",{staticStyle:{width:"1.6rem"}},[e("tawk-icon",{attrs:{type:"popout",size:"medium"}})],1),t._v(t._s(t.$i18n("menu","popout_widget"))+" ")]),t.hasChatStarted?e("tawk-button",{staticClass:"tawk-text-left tawk-flex tawk-flex-middle",attrs:{isText:!0,size:"small",role:"button",tabindex:t.isOpen?0:-1},on:{click:function(e){return t.$emit("showEndChat")}}},[e("span",{staticStyle:{width:"1.6rem"}},[e("tawk-icon",{attrs:{type:"close-circle",size:"small"}})],1),t._v(" "+t._s(t.$i18n("menu","end_chat_session"))+" ")]):t._e(),t.branding&&!t.branding.whitelabeled?e("tawk-button",{staticClass:"tawk-text-left tawk-flex tawk-flex-middle",attrs:{href:t.branding.url,target:"blank",isText:!0,size:"small",role:"button",tabindex:t.isOpen?0:-1}},[e("span",{staticStyle:{width:"1.6rem"}},[e("tawk-icon",{attrs:{type:"chat-bubble",size:"small"}})],1),t._v(" "+t._s(t.$i18n("menu","add_chat_to_your_website"))+" ")]):t._e()],1)],1):t._e(),t.isWindowed||t.isRoundWidget&&!t.mobileBrowserName&&"slide"!==this.onClick?t._e():e("tawk-button",{directives:[{name:"tawk-tooltip",rawName:"v-tawk-tooltip"}],staticClass:"tawk-header-text tawk-flex-none tawk-button-hover tawk-custom-color",attrs:{isText:!0,"data-text":t.$i18n("rollover","minimize"),"aria-label":t.$i18n("rollover","minimize")},nativeOn:{click:function(e){return t.toggleWidget.apply(null,arguments)}}},[e("tawk-icon",{attrs:{type:"x"}})],1)],1)])}),[],!1,null,"70fc860f",null).exports,m=a("7f46");function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,i)}return a}function g(t){for(var e=1;etawk.to"===t&&(t=t.replace("U+26A1",''))),t&&":tawky: Add free live chat to your site"===t&&(t=t.replace(":tawky:",''))),{label:t,url:this.branding.url,textColor:this.branding.textColor}}},isChatInputBottom:function(){var t=!1,e=this.states[this.pageStatus];return e&&e.body.length&&(t="chat"===e.body[e.body.length-1].type),t},isLiveChatFeatureEnabled:function(){return!!(this.hasLiveChat||this.hasChatStarted&&this.agentsCount>0)},inputPlaceholder:function(){var t,e=this.states[this.pageStatus];if(e&&e.body&&e.body.length)for(var a=0;a",strongEnd:""}))}})]):t._e()]:t._e(),t.activeProfiles.length>1?e("base-header",{ref:"tawk-base-header"},[e("chat-agents",{attrs:{profiles:t.activeProfiles,role:"button",tabindex:"0"},nativeOn:{click:function(e){return t.changeView.apply(null,arguments)}}})],1):t._e()],2)}),[],!1,null,null,null).exports,Y=a("3519"),tt=a("3f09"),et={name:"progress-bar",props:{handle:{type:String,default:""},fileName:{type:String,default:""},fileSize:{type:String,default:""},percentage:{type:Number,default:0}},computed:{progressWidth:function(){return"width : ".concat(this.percentage,"%")}},methods:{beautifyFilename:function(t,e){var a=t.lastIndexOf("."),i=t.substring(0,a),s=".".concat(t.substring(a+1));return i.length>7&&(s=i.substring(i.length-3)+s,i=i.substring(0,i.length-3)),''.concat(i,'').concat(s,' (').concat(e,")")}}},at=Object(h.a)(et,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"file-upload-progress"},[e("div",{staticClass:"tawk-flex tawk-flex-middle",domProps:{innerHTML:t._s(t.beautifyFilename(t.fileName,t.fileSize))}}),e("div",{staticClass:"progress active tawk-margin-small-top"},[e("div",{staticClass:"progress-bar",style:t.progressWidth,attrs:{role:"progressbar"}})])])}),[],!1,null,null,null).exports;function it(t){return(it="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function st(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,i)}return a}function nt(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:function(){};if(t){var a=this.$refs["chat-body"],i=a?a.$refs[t]:null,s=this.$refs["tawk-chat-panel"];i&&i.length&&s?(void 0!==i[0].offsetTop?s.scrollTop=i[0].offsetTop-40:s.scrollTop=i[0].offsetTop,this.$refs["tawk-chat-panel"]&&this.$refs["tawk-chat-panel"].$scrollbar&&this.$refs["tawk-chat-panel"].$scrollbar.update(),e()):e(i)}},clearBarMessageId:function(){var t=this;clearTimeout(this.clearBarTimeout),this.clearBarTimeout=setTimeout((function(){t.barMessageId=null,t.barMessageRerence&&(t.barMessageRerence.showBar=!1),t.showNotification=!1,t.barMessageRerence=null}),1e3)},checkSeenMessageViewport:function(){var t,e=-1,a=this.$refs["chat-body"];if(0!==this.unseenMessages.length&&a&&this.isFocus){for(var i=0;ithis.lastMessageTimestamp){e=i;break}}-1!==e&&((t=this.unseenMessages[this.unseenMessages.length-1])&&(this.unseenMessages=[],this.$store.dispatch("session/updateVisitorChatSeen",t.timeStamp)))}},chatElementInView:function(t){var e=this.$refs["tawk-chat-panel"];return!!e&&!!(t[0].offsetTop>=e.scrollTop&&t[0].offsetTop<=e.scrollTop+e.offsetHeight&&0!==t[0].clientWidth&&0!==t[0].clientHeight)},removeAgentIsTyping:function(t){this.$delete(this.agentTyping,t)},checkBarPosition:function(){var t=this;this.$nextTick((function(){if(t.showNotification=!1,t.barMessageRerence&&t.barMessageId){var e=t.$refs[t.barMessageId],a=t.$refs["chat-body"];if(a&&a.$refs[t.barMessageId]&&(e=a.$refs[t.barMessageId]),e)if(t.chatElementInView(e))t.clearBarMessageId();else{var i=t.$refs["tawk-chat-panel"];i&&i.scrollTopt/4?this.toggleAgentAvatarToolbar(!0):this.toggleAgentAvatarToolbar(!1)}},saveScrollPosition:function(){var t=this.$refs["tawk-chat-panel"];t&&this.$store.commit("chat/setLastScrollPosition",this.isScrollBarBottom()?9999999999:t.scrollTop)},convertFileSize:function(t){return t<1024?t+"B":t0)for(var a=0,s=t.formData.questions.length;a0&&"max"!==this.chatWindowState&&this.updateChatWindowState("max"),!this.firstIncoming||this.mobileBrowserName||this.showMessagePreview||"max"===this.chatWindowState||this.updateChatWindowState("max"))},isReady:function(t,e){var a=this;t!==e&&(this.showConnected=!0,setTimeout((function(){a.showConnected=!1}),1e3))},isReconnecting:function(t,e){var a=this;t!==e&&(this.showConnected=!0,setTimeout((function(){a.showConnected=!1}),1e3))}},methods:vt(vt({},Object(i.b)({routerPush:"router/routerPush",updateRoute:"router/updateRoute",toggleWidget:"session/toggleWidget",toggleLocalSound:"widget/toggleLocalSound",showOverlay:"overlay/showOverlay",routerBack:"router/routerBack",clearHistory:"router/clearHistory",updateChatWindowState:"session/updateChatWindowState",toggleFocus:"widget/toggleFocus"})),{},{triggerClick:function(){this.$store.dispatch("session/toggleWidget")},openView:function(){if(this.initialized=!0,this.showMaxWidget(),this.mobileBrowserName){var t=document.querySelector("meta[name=viewport]")||document.querySelector("meta[name=VIEWPORT]");this.$TawkWindow.isMobileOptimizedWebsite||null===this.noZoomMetaTag||(this.$TawkWindow.metaContent||""!==this.noZoomMetaTag.content?this.$TawkWindow.metaContent&&!this.$TawkWindow.hasNoScale&&t&&t.setAttribute("content",this.$TawkWindow.metaContent+", user-scalable=no"):(this.noZoomMetaTag.content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no",this.noZoomMetaTag.parentNode||document.getElementsByTagName("head")[0].appendChild(this.noZoomMetaTag)));var e=document.body;this.originalBodyStyle=e.style.cssText;for(var a=["height","min-height","max-height","width","min-width","max-width"],i=0;ii+10&&(t.resizeHeightTo=i+10)))}),300)},handleOverlayBack:function(){this.routerBack(),"/"!==this.currentRoute&&"messages"!==this.currentRoute||this.showOverlay(!1),this.isDraggedOver=!1},checkRouteLoaded:function(){var t=this;clearTimeout(this.routeLoadedTimeout),void 0!==this.$refs["router-view"]?this.isLoaded=!0:this.routeLoadedTimeout=setTimeout((function(){t.checkRouteLoaded()}),1e3)},handleFocus:function(){this.toggleFocus(!0)},handleBlur:function(){this.toggleFocus(!1)},calculateHeight:function(){if(this.isWindowed||this.mobileBrowserName||this.isEmbedded||"slide"===this.onClick)this.iframe.height="100%";else if(this.resizeHeightTo)this.iframe.height=this.resizeHeightTo+"px";else{if(this.isRoundWidget){var t=this.minDesktop.height+this.yOffset+10;if(this.maxDimension.height+t>window.innerHeight)return void(this.iframe.height="".concat(window.innerHeight-t-10,"px"))}this.maxDimension.height>=window.innerHeight?this.iframe.height="".concat(window.innerHeight-10,"px"):this.iframe.height="".concat(this.maxDimension.height,"px")}},calculateWidth:function(){if(this.isWindowed||this.mobileBrowserName||this.isEmbedded)this.iframe.width="100%";else{if(this.isRoundWidget){var t=this.minDesktop.width+this.xOffset+10;if(this.maxDimension.width+t>window.innerWidth)return void(this.iframe.width="".concat(window.innerWidth-t-10,"px"))}this.maxDimension.width>=window.innerWidth?this.iframe.width="".concat(window.innerWidth-10,"px"):this.iframe.width=this.maxDimension.width+"px"}},calculateIframeSize:function(){this.calculateHeight(),this.calculateWidth()},showMaxWidget:function(){var t=this;this.$refs["max-widget"].$el.style.setProperty("display","block","important"),setTimeout((function(){t.isVisible=!0,t.$refs["max-widget"].$el.style.setProperty("box-shadow","10px 10px 40px 0px rgba(0, 0, 0, 0.08), 5px 14px 80px 0px rgba(26, 26, 26, 0.12)","important")}),250)},hideMaxWidget:function(){var t=this;this.$nextTick((function(){t.$refs["max-widget"].$el.style.setProperty("display","block","important"),t.isVisible=!1,t.$refs["max-widget"].$el.style.setProperty("box-shadow","none","important")})),setTimeout((function(){t.$refs["max-widget"].$el.style.setProperty("display","none","important")}),250)},injectStyleNode:function(){if(!this.mobileBrowserName&&"slide"===this.onClick){var t="-100%",e=this.$refs["max-widget"].$el.contentDocument,a=document.createElement("style");a.type="text/css",a.classList.add("tawk-dynamic-style"),this.isRight&&(t="100%"),a.appendChild(document.createTextNode("\n\t\t\t\t.tawk-max-slide-enter-active,\n\t\t\t\t.tawk-max-slide-leave-active {\n\t\t\t\t\ttransition: all 0.25s;\n\t\t\t\t\ttransition-timing-function: ease-in-out;\n\t\t\t\t}\n\n\t\t\t\t.tawk-max-slide-enter {\n\t\t\t\t\ttransform: translateX(".concat(t,");\n\t\t\t\t\topacity: 0;\n\t\t\t\t}\n\n\t\t\t\t.tawk-max-slide-enter-to {\n\t\t\t\t\ttransform: translateX(0%);\n\t\t\t\t\topacity: 1;\n\t\t\t\t}\n\n\t\t\t\t.tawk-max-slide-leave {\n\t\t\t\t\ttransform: translateX(0%);\n\t\t\t\t\topacity: 1;\n\t\t\t\t}\n\n\t\t\t\t.tawk-max-slide-leave-to {\n\t\t\t\t\ttransform: translateX(").concat(t,");\n\t\t\t\t\topacity: 0;\n\t\t\t\t}\n\t\t\t"))),e.head.appendChild(a)}},removeStyleNode:function(){var t=this.$refs["max-widget"].$el.contentDocument.querySelector(".tawk-dynamic-style");t&&t.parentNode.removeChild(t)}}),mounted:function(){var t=this;this.calculateIframeSize(),this.noZoomMetaTag=document.createElement("meta"),this.noZoomMetaTag.name="viewport",this.checkRouteLoaded(),this.$el.contentWindow.addEventListener("focus",this.handleFocus),this.$el.contentWindow.addEventListener("blur",this.handleBlur),window.addEventListener("resize",this.calculateIframeSize),this.$eventBus.$on("switchWidget",(function(){t.key=s.Helper.generateUUID(),t.calculateIframeSize(),t.$nextTick((function(){t.injectStyleNode()}))})),this.$eventBus.$on("forceUpdate",(function(){t.initialized=!1,t.$nextTick((function(){t.initialized=!0}))})),this.injectStyleNode(),this.$eventBus.$on("updateWidgetSettings",(function(){t.removeStyleNode(),t.$nextTick((function(){t.injectStyleNode()}))})),this.$store.dispatch("form/get")},beforeDestroy:function(){this.$el.contentWindow.removeEventListener("focus",this.handleFocus),this.$el.contentWindow.removeEventListener("blur",this.handleBlur),window.removeEventListener("resize",this.calculateIframeSize)}},Ct=Object(h.a)(kt,(function(){var t=this,e=t._self._c;return e("i-frame",{key:t.key,ref:"max-widget",attrs:{width:t.iframe.width,height:t.iframe.height,cssLink:t.cssLink,styleObject:t.styleObject,classString:t.classString}},[e("transition",{attrs:{tag:"div",name:"tawk-max-slide"}},[e("div",{directives:[{name:"show",rawName:"v-show",value:t.isVisible,expression:"isVisible"}],on:{"&scroll":function(e){return t.handleScroll.apply(null,arguments)}}},[t.initialized?e("div",{staticClass:"tawk-max-container tawk-flex tawk-flex-column",class:[!t.isToolbarElementsVisible&&"tawk-no-toolbar-elements"],style:t.maximizeStyle,on:{click:t.widgetFocus,keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.widgetFocus.apply(null,arguments)}}},[e("toolbar",{ref:"main-toolbar",attrs:{borderRadiusTop:t.borderRadiusTop,showBackButton:t.showBackButton,currentView:t.currentView,showWebRtcButtons:!0,showAgentAvatars:!0},on:{showEndChat:function(e){t.showEndChat=!0}}}),t.isWebrtcEnabled?e("call-widget"):t._e(),e("tawk-overlay",{ref:"view-overlay",style:{borderRadius:t.borderRadius},attrs:{isOpen:t.isOverlayOpen,title:t.currentView&&t.currentView.title?t.currentView.title():"",backTooltipText:t.$i18n("rollover","back"),headerClass:"tawk-custom-color",options:"history-chat"===t.currentRoute?{alignAllButtons:"left"}:{}},on:{goBack:t.handleOverlayBack}},[e("div",{attrs:{slot:"options"},slot:"options"},[t.isOverlayOpen?e("toolbar",{attrs:{borderRadiusTop:t.borderRadiusTop,currentView:t.currentView},on:{showEndChat:function(e){t.showEndChat=!0}}}):t._e()],1),e("div",{staticClass:"tawk-flex tawk-flex-column",staticStyle:{height:"100%",overflow:"hidden"}},[e("div",{staticClass:"tawk-flex tawk-flex-column tawk-flex-1 tawk-custom-flex-1"},[e("div",{staticClass:"tawk-router-view tawk-flex tawk-flex-1 tawk-custom-flex-1"},[e("tawk-router-view",{ref:"router-view"})],1),e("maximize-footer",{directives:[{name:"show",rawName:"v-show",value:t.isOverlayOpen,expression:"isOverlayOpen"}],ref:"overlay-footer"})],1)])]),t.isInactive?e("inactive-overlay"):t._e(),t.showEndChat&&!t.hasChatEnded?e("end-chat",{on:{cancelEnd:function(e){t.showEndChat=!1}}}):t._e(),e("div",{staticClass:"tawk-flex tawk-flex-column tawk-flex-1"},[e("div",{staticClass:"tawk-router-view tawk-flex tawk-flex-1"},[t.isLoaded?t._e():e("div",{staticClass:"tawk-flex tawk-flex-middle tawk-flex-center",style:{width:"100%",height:"100%",left:0,top:0,position:"absolute"}},[e("div",{staticClass:"tawk-spinner-loader",style:{margin:"1px"}})]),e("transition",{attrs:{name:"slide-fade",mode:"out-in"}},[!t.hasLiveChat||t.needConsent||!t.chatOrder&&!t.hasChatStarted&&t.hasHomeView?t._e():e("chat-view",{directives:[{name:"show",rawName:"v-show",value:"chat"===t.currentRoute||"agents"===t.currentRoute,expression:"currentRoute === 'chat' || currentRoute === 'agents'"}],ref:"chat-view"})],1),e("transition",{attrs:{name:"slide-fade",mode:"out-in"}},[t.hasLiveChat&&!t.needConsent&&t.isPrechatEnabled&&t.isReady&&!t.prechatFormSubmitted&&("prechat"===t.currentRoute||!t.hasHomeView||t.hasPrechatHistory&&!t.prechatFormSubmitted)?e("prechat-view",{ref:"prechat-view"}):t._e()],1),e("transition",{attrs:{name:"slide-fade",mode:"out-in"}},[t.hasHomeView||t.needConsent?e("home-view",{directives:[{name:"show",rawName:"v-show",value:t.isHomeViewVisible&&!t.isOverlayOpen,expression:"isHomeViewVisible && !isOverlayOpen"}],ref:"home-view",attrs:{isVisible:t.isHomeViewVisible&&!t.isOverlayOpen}}):t._e()],1),e("transition",{attrs:{name:"slide-fade",mode:"out-in"}},["messages"===t.currentRoute?e("messages-view",{directives:[{name:"show",rawName:"v-show",value:"messages"===t.currentRoute&&!t.isOverlayOpen,expression:"currentRoute === 'messages' && !isOverlayOpen"}],ref:"messages-view"}):t._e()],1)],1),e("maximize-footer",{ref:"main-footer"})],1),e("transition",{attrs:{name:"slide-fade"}},[t.isReconnecting?e("tawk-alert",{staticStyle:{position:"absolute",bottom:"16px",left:"16px",right:"16px",width:"auto","z-index":"10"},attrs:{title:t.$i18n("notifications","reconnecting"),status:"danger",description:"",icon:"error"}}):t._e()],1)],1):t._e()])])],1)}),[],!1,null,null,null);e.default=Ct.exports}}]);