varextend=function(e,t){for(varsint)hasProp.call(t,s)&&(e[s]=t[s]);functionn(){this.constructor=e}returnn.prototype=t.prototype,e.prototype=newn,e.__super__=t.prototype,e},hasProp={}.hasOwnProperty,bind=function(e,t){returnfunction(){returne.apply(t,arguments)}},slice=[].slice;!function(C){vars,n,o,e,i,a,r;functionl(e){vart,s,n;for(tinthis.options={},s=this.defaults)n=s[t],this.options[t]=n;for(tine)n=e[t],this.options[t]=n}functiond(e){d.__super__.constructor.call(this,e),this.log=newn({debug:this.options.debug,logPrefix:this.options.logPrefix||this.logPrefix})}functionc(){returnthis.log=bind(this.log,this),this.error=bind(this.error,this),this.notice=bind(this.notice,this),this.debug=bind(this.debug,this),c.__super__.constructor.apply(this,arguments)}functionu(){returnthis.stop=bind(this.stop,this),this.start=bind(this.start,this),u.__super__.constructor.apply(this,arguments)}functionh(){returnthis.ping=bind(this.ping,this),this.send=bind(this.send,this),this.reconnect=bind(this.reconnect,this),this.close=bind(this.close,this),this.connect=bind(this.connect,this),this.set=bind(this.set,this),h.__super__.constructor.apply(this,arguments)}functionm(e){returnthis.removeAttributes=bind(this.removeAttributes,this),this.startTimeoutObservers=bind(this.startTimeoutObservers,this),this.onCssLoaded=bind(this.onCssLoaded,this),this.setAgentOnlineState=bind(this.setAgentOnlineState,this),this.onConnectionEstablished=bind(this.onConnectionEstablished,this),this.setSessionId=bind(this.setSessionId,this),this.onConnectionReestablished=bind(this.onConnectionReestablished,this),this.reconnect=bind(this.reconnect,this),this.destroy=bind(this.destroy,this),this.onScrollHintClick=bind(this.onScrollHintClick,this),this.detectScrolledtoBottom=bind(this.detectScrolledtoBottom,this),this.onLeaveTemporary=bind(this.onLeaveTemporary,this),this.onAgentTypingEnd=bind(this.onAgentTypingEnd,this),this.onAgentTypingStart=bind(this.onAgentTypingStart,this),this.onQueue=bind(this.onQueue,this),this.onQueueScreen=bind(this.onQueueScreen,this),this.onWebSocketClose=bind(this.onWebSocketClose,this),this.onCloseAnimationEnd=bind(this.onCloseAnimationEnd,this),this.close=bind(this.close,this),this.toggle=bind(this.toggle,this),this.sessionClose=bind(this.sessionClose,this),this.onOpenAnimationEnd=bind(this.onOpenAnimationEnd,this),this.open=bind(this.open,this),this.renderMessage=bind(this.renderMessage,this),this.receiveMessage=bind(this.receiveMessage,this),this.onSubmit=bind(this.onSubmit,this),this.onInput=bind(this.onInput,this),this.onReopenSession=bind(this.onReopenSession,this),this.onError=bind(this.onError,this),this.onWebSocketMessage=bind(this.onWebSocketMessage,this),this.send=bind(this.send,this),this.onKeydown=bind(this.onKeydown,this),this.onPaste=bind(this.onPaste,this),this.onDrop=bind(this.onDrop,this),this.render=bind(this.render,this),this.view=bind(this.view,this),this.T=bind(this.T,this),m.__super__.constructor.call(this,e),"undefined"!=typeofjQuery&&this.options.targetinstanceofjQuery&&(this.log.notice("Chat: target option is a jQuery object. jQuery is not a requirement for the chat any more."),this.options.target=this.options.target.get(0)),this.isFullscreen=C.matchMedia&&C.matchMedia("(max-width: 768px)").matches,this.scrollRoot=this.getScrollRoot(),C.WebSocket&&sessionStorage?this.options.chatId?(this.options.lang||(this.options.lang=document.documentElement.getAttribute("lang")),this.options.lang&&(this.translations[this.options.lang]||(this.log.debug("lang: No "+this.options.lang+" found, try first two letters"),this.options.lang=this.options.lang.replace(/-.+?$/,"")),this.log.debug("lang: "+this.options.lang)),this.options.host||this.detectHost(),this.loadCss(),this.io=news(this.options),this.io.set({onOpen:this.render,onClose:this.onWebSocketClose,onMessage:this.onWebSocketMessage,onError:this.onError}),voidthis.io.connect()):(this.state="unsupported",voidthis.log.error("Chat: need chatId as option!")):(this.state="unsupported",voidthis.log.notice("Chat: Browser not supported!"))}e=(r=docume