/* Minification failed. Returning unminified contents.
(2,7016-7017): run-time error JS1195: Expected expression: >
 */
(function(n){n.fn.emoji=function(t){var u={button:"&#x1F642;",place:"before",emojis:["&#x1F642;","&#x1F641;","&#x1f600;","&#x1f601;","&#x1f602;","&#x1f603;","&#x1f604;","&#x1f605;","&#x1f606;","&#x1f607;","&#x1f608;","&#x1f609;","&#x1f60a;","&#x1f60b;","&#x1f60c;","&#x1f60d;","&#x1f60e;","&#x1f60f;","&#x1f610;","&#x1f611;","&#x1f612;","&#x1f613;","&#x1f614;","&#x1f615;","&#x1f616;","&#x1f617;","&#x1f618;","&#x1f619;","&#x1f61a;","&#x1f61b;","&#x1f61c;","&#x1f61d;","&#x1f61e;","&#x1f61f;","&#x1f620;","&#x1f621;","&#x1f622;","&#x1f623;","&#x1f624;","&#x1f625;","&#x1f626;","&#x1f627;","&#x1f628;","&#x1f629;","&#x1f62a;","&#x1f62b;","&#x1f62c;","&#x1f62d;","&#x1f62e;","&#x1f62f;","&#x1f630;","&#x1f631;","&#x1f632;","&#x1f633;","&#x1f634;","&#x1f635;","&#x1f636;","&#x1f637;","&#x1f638;","&#x1f639;","&#x1f63a;","&#x1f63b;","&#x1f63c;","&#x1f63d;","&#x1f63e;","&#x1f63f;","&#x1f640;","&#x1f643;","&#x1f4a9;","&#x1f644;","&#x2620;","&#x1F44C;","&#x1F44D;","&#x1F44E;","&#x1F648;","&#x1F649;","&#x1F64A;"],fontSize:"20px",listCSS:{position:"absolute",border:"1px solid gray","background-color":"#fff",display:"none"},rowSize:10},i={},r;if(t)for(r in u)i[r]=t[r]?t[r]:u[r];else i=u;return this.each(function(t,r){function s(){f.show();o.focus();setTimeout(function(){n(document).on("click",h);e.off("click",s)},1)}function h(){f.hide();e.on("click",s);n(document).off("click",h)}function c(n){if(!(r.textLength>r.maxLength-2)){if(r.selectionStart||r.selectionStart=="0"){var t=r.selectionStart,i=r.selectionEnd;r.value=r.value.substring(0,t)+n.currentTarget.innerHTML+r.value.substring(i,r.value.length)}else r.value+=n.currentTarget.innerHTML;h();o.focus();r.selectionStart=t+2;r.selectionEnd=i+2}}var o=n(r),e=n("<span>",{title:"Emojis"}).html(i.button).css({cursor:"pointer","font-size":i.fontSize}).on("click",s),f=n("<div>").css(u.listCSS).css(i.listCSS);for(var t in i.emojis)t>0&&t%i.rowSize==0&&n("<br>").appendTo(f),n("<span>").html(i.emojis[t]).css({cursor:"pointer","font-size":i.fontSize}).on("click",c).appendTo(f);i.place==="before"?e.insertBefore(this):e.insertAfter(this);f.insertAfter(o)}),this}})(jQuery);;
+function(n,t){"use strict";var i=n.ContractFX=n.ContractFX||{},r;i.Controls=i.Controls||{};r=i.Controls.ERFx=i.Controls.ERFx||{};r.OnlineChat=function(i,r,u,f,e,o,s,h){var c,v,l;this.containerId=i;this.container=t("#"+i);this.chatId=r;this.isConnected=!1;this.isTheEnd=!1;this.isFirstLoad=!0;this.isLoadingMessages=!1;this.isMyMessage=!1;this.isRepliedMessageClicked=!1;this.RepliedToMessageID=0;c=this;this.isAuth=u.toLowerCase();this.channelName=e;this.ownerID=o;this.userId=s;this.moderatorId=h;this.notificationMessageId=0;this.notificationRepliesId=0;this.chat=t.connection.chatHub;this.messageCount=30;this.repliesCount=10;this.isErrorLoad=!1;this.isLoadBottomEnd=!1;this.clientTZOffset=(new Date).getTimezoneOffset();this.clientTZHour=this.clientTZOffset/60;this.months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];t(function(){function i(){var o=document.createDocumentFragment(),s=document.createElement("div"),t=document.createElement("div"),r,i,u,f,e;return t.setAttribute("class","d-flex align-items-center"),r=document.createElement("A"),r.setAttribute("href","#"),r.setAttribute("onclick","k12PopupEFX.Hide(); ShowLoginPopup(ContractFX.Controls.Auth.LoginPopup.TYPE_CLIENT); return false;"),r.setAttribute("style","margin-right: 4px; padding:10px 0; font-size: 16px;"),r.innerText="Sign In",i=document.createElement("A"),i.setAttribute("href","#"),n.location.pathname.indexOf("view")!==-1?i.setAttribute("onclick","k12PopupEFX.Hide(); window.location.href = window.location.origin + '/AttendeeReg.aspx?rs=1&view=' +   window.location.pathname.replace('/view/', '')"):i.setAttribute("onclick","k12PopupEFX.Hide(); window.location.href = window.location.origin + '/AttendeeReg.aspx'"),i.setAttribute("style","margin-left: 4px; padding: 10px 0; font-size: 16px;"),i.innerText="Sign Up ",u=document.createElement("span"),u.innerHTML="You must ",f=document.createElement("span"),f.innerHTML=" to use chat feature.",e=document.createElement("span"),e.innerText="/",t.appendChild(u),t.appendChild(i),t.appendChild(e),t.appendChild(r),t.appendChild(f),o.appendChild(t),s.appendChild(o),s.children}var f=Math.round(new Date/1e3),o=n.localStorage.getItem("Cooldown"),s,r;o>f?(s=o-f,c.StartCooldown(s)):n.localStorage.removeItem("Cooldown");u.toLowerCase()==="false"?c.container.find(".txt-message-wrapper").click(function(){k12PopupEFX.btnContinue.SetText("Ok");k12PopupEFX.Alert(i(),undefined,360)}):c.container.find(".js--txt-chat-message").emoji();c.chat.client.broadcastMessage=function(n,t){if(n.FK_OnlineChatMessageReplyTo>0)c.addRepliesToChat(n,!0,n.FK_OnlineChatMessageReplyTo,!0);else!c.isLoadBottomEnd&&c.isMyMessage?c.loadAllMessage():(c.addMessageObj(n,!1,t),n.IsQuestion&&c.addQuestionMessage(n,!1,t),c.isMyMessage&&(c.isMyMessage=!1))};c.chat.client.deleteMessage=function(n){c.deleteMessageObj(n,!1);c.isMyMessage&&(c.isMyMessage=!1)};c.chat.client.banUser=function(n){c.banUserObj(n,!1);c.isMyMessage&&(c.isMyMessage=!1)};c.chat.client.unBlockUser=function(n){c.unBlockUserObj(n,!1);c.isMyMessage&&(c.isMyMessage=!1)};c.chat.client.answer=function(n){c.answerObj(n,!1);c.isMyMessage&&(c.isMyMessage=!1)};c.chat.client.promoteUserToModerator=function(n){c.promoteUserToModeratorObj(n,!1);c.isMyMessage&&(c.isMyMessage=!1)};c.chat.client.promoteToModerator=function(n){c.promoteToModeratorObj(n,!1);c.isMyMessage&&(c.isMyMessage=!1)};c.chat.client.demoteUserFromModerator=function(n){c.demoteUserFromModeratorObj(n,!1);c.isMyMessage&&(c.isMyMessage=!1)};c.chat.client.demoteFromModerator=function(n){c.demoteFromModeratorObj(n,!1);c.isMyMessage&&(c.isMyMessage=!1)};c.chat.client.clearInput=function(t){if(c.ClearInput(),t){if(c.container.find(".js--btn-chat-send-question").hasClass("disabled-btn"))return;var i=Math.round(new Date/1e3),r=n.localStorage.getItem("Cooldown");r<i&&c.StartCooldown(90)}};c.chat.client.joined=function(n){c.isConnected=n;c.InitLoadingMessages()};c.chat.client.disabledChatFunc=function(){c.DisabledChatFuncObj()};c.chat.client.errorOccured=function(n){k12PopupEFX.Alert(n)};r=t.connection.hub.start({transport:["serverSentEvents","foreverFrame","longPolling"]});r.done(function(){c.chat.server.joinChat(c.chatId);c.container.find(".js--btn-chat-send-message").click(function(){if(c.isConnected)if(c.IsValidMessage()){c.isMyMessage=!0;let t=c.container.find(".chat-reply-to-section"),i=t.attr("data-message-id");var n=c.container.find(".js--txt-chat-message").val();n=n.replaceAll("<","&lt").replaceAll(">","&gt");c.chat.server.send(n,i,e);t.attr("data-message-id",0);t.hide()}else u.toLowerCase()==="false"?(k12PopupEFX.btnContinue.SetText("Ok"),k12PopupEFX.Alert(i(),undefined,360)):k12PopupEFX.Alert("Please, Enter Your Message.");else k12PopupEFX.btnContinue.SetText("Ok"),k12PopupEFX.Alert("Please, wait you're not connected to the server yet. <br />If you're waiting too long then try to refresh the page.")});c.container.find(".js--txt-chat-message").keypress(function(n){var r=n.keyCode?n.keyCode:n.which,t;if(r=="13"&&!n.shiftKey&&!n.ctrlKey)if(c.isConnected)if(c.IsValidMessage()){c.isMyMessage=!0;let n=c.container.find(".chat-reply-to-section"),i=n.attr("data-message-id");t=c.container.find(".js--txt-chat-message").val();t=t.replaceAll("<","&lt").replaceAll(">","&gt");c.chat.server.send(t,i,e);n.attr("data-message-id",0);n.hide()}else u.toLowerCase()==="false"?(k12PopupEFX.btnContinue.SetText("Ok"),k12PopupEFX.Alert(i(),undefined,360)):k12PopupEFX.Alert("Please, Enter Your Message.");else k12PopupEFX.btnContinue.SetText("Ok"),k12PopupEFX.Alert("Please, wait you're not connected to the server yet. <br />If you're waiting too long then try to refresh the page.")});c.container.find(".js--btn-chat-send-question").click(function(){if(c.isConnected)if(c.IsValidMessage()){c.isMyMessage=!0;var n=c.container.find(".js--txt-chat-message").val();n=n.replaceAll("<","&lt").replaceAll(">","&gt");c.chat.server.question(n,e)}else u.toLowerCase()==="false"?(k12PopupEFX.btnContinue.SetText("Ok"),k12PopupEFX.Alert(i(),undefined,360)):k12PopupEFX.Alert("Please, Enter Your Message.");else k12PopupEFX.btnContinue.SetText("Ok"),k12PopupEFX.Alert("Please, wait you're not connected to the server yet. <br />If you're waiting too long then try to refresh the page.")})});c.container.find(".scroll-to-bottom-btn").click(function(){c.isLoadBottomEnd?c.ScrollBottomAnimated():c.loadAllMessage()});r.fail(function(n){console.log(n);c.InitLoadingMessages();c.container.find(".js--btn-chat-send-message").click(function(){k12PopupEFX.btnContinue.SetText("Ok");k12PopupEFX.Alert(i(),undefined,360)});c.container.find(".js--btn-chat-send-question").click(function(){k12PopupEFX.btnContinue.SetText("Ok");k12PopupEFX.Alert(i(),undefined,360)})});let h=c.container.find(".js-chat-reply-to-cancel-btn");h.click(function(){let n=c.container.find(".chat-reply-to-section");n.attr("data-message-id","0");n.hide()})});this.timeZoneAbbreviated=function(){let n=(new Date).toString().match(/\((.+)\)/);return n.includes(" ")?n.split(" ").map(([n])=>n).join(""):n};this.getUsersLocalTime=function(n){var i=new Date,t=" "+c.clientTZHour;return t=c.clientTZHour<0?" +"+Math.abs(c.clientTZHour):c.clientTZHour==0?"":" -"+c.clientTZHour,i.getDate()==n.getDate()?this.custTime(n.getHours(),n.getMinutes(),n.getSeconds())+" (GMT"+t+")":i.getFullYear()==n.getFullYear()?n.getDate()+" "+this.months[n.getMonth()]+" "+this.custTime(n.getHours(),n.getMinutes(),n.getSeconds())+" (GMT"+t+")":n.getDate()+" "+this.months[n.getMonth()]+" "+n.getFullYear()+", "+this.custTime(n.getHours(),n.getMinutes(),n.getSeconds())+" (GMT"+t+")"};this.custTime=function(n,t,i){return("0"+n).slice(-2)+":"+("0"+t).slice(-2)+":"+("0"+i).slice(-2)};this.addMessageObj=function(n,i,r){var f=c.container.find(".js--chat-message-container"),u=c.initMessageField(n,"message"),o;if(n.IsSystemMessage||r)if(c.userId==c.ownerID||c.userId==c.moderatorId)u.find(".chat-message-text > span").addClass("messageFromServer"),u.find(".chat-message-author-name").attr("hidden","hidden"),u.find(".chat-message-sent-date").attr("hidden","hidden"),u.find(".chat-message-header-line-commands").attr("hidden","hidden");else return;let e=u.find(".chat-message-header-line-reply-to-btn");e.attr("data-message-id",n.ID);e.find(".chat-message-header-line").attr("data-user-id",n.FK_GlobalAccess);e.click(function(){let n=t(this),i=n.attr("data-message-id");c.ReplyTo(i)});let s=u.find(".js-delete-btn");s.attr("data-message-id",n.ID);s.click(function(){let n=t(this);c.deleteMessage(n)});let h=u.find(".js-ban-btn");h.attr("data-message-id",n.ID);h.click(function(){let n=t(this);c.banUser(n)});let l=u.find(".js-unblock-btn");l.attr("data-message-id",n.ID);l.click(function(){let n=t(this);c.unblockUser(n)});let a=u.find(".js-load-more-replies");a.attr("data-message-id",n.ID);a.click(function(){let n=t(this);c.loadMoreReplies(n)});let v=u.find(".js-moderator-btn");v.attr("data-message-id",n.ID);v.click(function(){let n=t(this);c.promoteToModerator(n)});let y=u.find(".js-demote-moderator-btn");y.attr("data-message-id",n.ID);y.click(function(){let n=t(this);c.demoteFromModerator(n)});n.HasReplies&&u.find(".js-chat-reply").show();o=!0;let p=u.find(".js-toggle-replies");p.click(function(){c.showReplies(n.ID,o);o=!1});u.show();c.isNoMessagesLabelVisible()&&c.HideNoMessagesLabel();i?f.prepend(u):f.append(u);(f[0].scrollHeight-f[0].scrollTop<f[0].clientHeight+250||c.isMyMessage)&&c.isLoadBottomEnd&&c.ScrollBottom()};this.addRepliesToChat=function(n,i,r,u,f){var s,e,l,h;let o=c.findMessage(r);s=o.find(".js-reply-container").first();e=c.initMessageField(n,"replies");let a=e.find(".js-delete-btn");a.attr("data-message-id",n.ID);a.click(function(){let n=t(this);c.deleteMessage(n)});let v=e.find(".js-ban-btn");v.attr("data-message-id",n.ID);v.click(function(){let n=t(this);c.banUser(n)});let y=e.find(".js-unblock-btn");y.attr("data-message-id",n.ID);y.click(function(){let n=t(this);c.unblockUser(n)});let p=e.find(".js-moderator-btn");p.attr("data-message-id",n.ID);p.click(function(){let n=t(this);c.promoteToModerator(n)});let w=e.find(".js-demote-moderator-btn");w.attr("data-message-id",n.ID);w.click(function(){let n=t(this);c.demoteFromModerator(n)});f&&o.find(".js-load-more-replies").hide();f==!1&&o.find(".js-load-more-replies").show();e.show();i?u?(o.find(".js-chat-reply").css("display")=="none"&&(o.find(".js-chat-reply").show(),o.find(".js-toggle-replies").hide()),l=o.find(".js-reply-container-fromHub").last(),l.append(e),o.find(".js-replies").show(),l.show()):(s.append(e),s.show()):s.prepend(e);h=c.container.find(".js--chat-message-container");h[0].scrollHeight-h[0].scrollTop<h[0].clientHeight+250&&c.ScrollBottom()};this.addQuestionMessage=function(n,i){var f=c.container.find(".js--chat-question-container"),r=c.container.find(".js--chat-question-base").clone();if(r.find(".chat-message-author-name > span").text(n.Author),r.find(".chat-message-text > span").html(n.MessageText),r.removeClass("js--chat-question-base"),r.attr("data-question-id",n.ID),r.find(".chat-message-header-line").attr("data-user-id",n.FK_GlobalAccess),!n.IsDeleted){let u=r.find(".chat-message-header-line-reply-to-btn");u.attr("data-message-id",n.ID);u.find(".chat-message-header-line").attr("data-user-id",n.FK_GlobalAccess);u.click(function(){let n=t(this),i=n.attr("data-message-id");c.ReplyTo(i)});let e=r.find(".js-chat-question-to-cancel-btn");e.attr("data-message-id",n.ID);e.click(function(){let i=t(this),n=i.attr("data-message-id");k12PopupEFX.Confirm("Close this question?",function(){c.isConnected?n>0?c.chat.server.answer(n,c.ownerID,c.userId):k12PopupEFX.Alert("Please, Select Message"):(k12PopupEFX.btnContinue.SetText("Ok"),k12PopupEFX.Alert("Please, wait you're not connected to the server yet. <br />If you're waiting too long then try to refresh the page."))})});let h=r.find(".chat-message-text");h.attr("data-message-id",n.ID);h.click(function(){let t=c.container.find(".chat-message[data-question-id="+n.ID+"]");t!=null&&t.length>0&&c.ScrollToMessage(n.ID)});r.show();i?f.prepend(r):f.append(r);s==o&&c.ScrollBottomQuestion();c.container.find(".chat-question-body").show()}};this.deleteMessage=function(n){let t=n.attr("data-message-id");k12PopupEFX.Confirm("Do you want to delete this message?",function(){c.isConnected?t>0?c.chat.server.delete(t,e,s):k12PopupEFX.Alert("Please, Select Message"):(k12PopupEFX.btnContinue.SetText("Ok"),k12PopupEFX.Alert("Please, wait you're not connected to the server yet. <br />If you're waiting too long then try to refresh the page."))})};this.banUser=function(n){let t=n.attr("data-message-id");k12PopupEFX.Confirm("Do you want to ban this user?",function(){c.isConnected?t>0?c.chat.server.banUser(e,t,s):k12PopupEFX.Alert("Please, Select Message"):(k12PopupEFX.btnContinue.SetText("Ok"),k12PopupEFX.Alert("Please, wait you're not connected to the server yet. <br />If you're waiting too long then try to refresh the page."))})};this.unblockUser=function(n){let t=n.attr("data-message-id");k12PopupEFX.Confirm("Unblock this user?",function(){c.isConnected?t>0?c.chat.server.unBlockUser(e,t,s):k12PopupEFX.Alert("Please, Select Message"):(k12PopupEFX.btnContinue.SetText("Ok"),k12PopupEFX.Alert("Please, wait you're not connected to the server yet. <br />If you're waiting too long then try to refresh the page."))})};this.loadMoreReplies=function(n){let i=n.attr("data-message-id"),t=c.findMessage(i),r=t.find(".js-reply-container").first();var u=r.find(".chat-message").last(),f=u.attr("data-message-id"),e=t.find(".js-reply-container-fromHub").last();e.find(".chat-message").remove();c.GetRepliedMessages(i,f,0);t.find(".js-toggle-replies-bottom").show()};this.promoteToModerator=function(n){let t=n.attr("data-message-id");k12PopupEFX.Confirm("Do you want to promote this user to moderator?",function(){c.isConnected?t>0?c.chat.server.promoteToModerator(e,t,s):k12PopupEFX.Alert("Please, Select Message"):(k12PopupEFX.btnContinue.SetText("Ok"),k12PopupEFX.Alert("Please, wait you're not connected to the server yet. <br />If you're waiting too long then try to refresh the page."))})};this.demoteFromModerator=function(n){let t=n.attr("data-message-id");k12PopupEFX.Confirm("Do you want to Demote this user from moderators?",function(){c.isConnected?t>0?c.chat.server.demoteFromModerator(e,t,s):k12PopupEFX.Alert("Please, Select Message"):(k12PopupEFX.btnContinue.SetText("Ok"),k12PopupEFX.Alert("Please, wait you're not connected to the server yet. <br />If you're waiting too long then try to refresh the page."))})};this.deleteMessageObj=function(n){let t=c.findMessage(n.ID);if(typeof t!="undefined"&&t!=null){let n=t.find(".chat-message-text > span").text();t.find(".chat-message-text > span").first().addClass("messageFromServer");t.find(".chat-message-text > span").first().text('"Deleted message"');t.find(".chat-message-header-line-reply-to-btn").first().addClass("hideButton");t.find(".js-delete-btn").first().addClass("hideButton");t.find(".js-question-icon").first().addClass("hideButton");s!=o&&c.userId!=c.moderatorId&&t.remove()}let r=c.container.find(".chat-message[data-question-id="+n.ID+"]");r.hide();let u=c.container.find(".chat-message-replied-to-section[data-reply-id="+n.ID+"]");u.find(".chat-message-replied-to-message").html('"Deleted message"');let f=c.findMessage(n.FK_OnlineChatMessageReplyTo),i=f.find(".js-chat-reply");i.find(".chat-message").length==0&&i.hide()};this.banUserObj=function(n){let t=c.container.find(".chat-message-header-line[data-user-id="+n.FK_GlobalAccess+"]");typeof t!="undefined"&&t!=null&&(t.find(".js-ban-btn").addClass("hideButton"),t.find(".js-unblock-btn").removeClass("hideButton"));s==o&&t.find(".js-moderator-btn").addClass("hideButton")};this.unBlockUserObj=function(n){let t=c.container.find(".chat-message-header-line[data-user-id="+n.FK_GlobalAccess+"]");typeof t!="undefined"&&t!=null&&(t.find(".js-ban-btn").removeClass("hideButton"),t.find(".js-unblock-btn").addClass("hideButton"));s==o&&t.find(".js-moderator-btn").removeClass("hideButton")};this.answerObj=function(n){let t=c.findMessage(n.ID);typeof t!="undefined"&&t!=null&&(t.find(".js-question-icon").addClass("hideButton"),t=c.container.find(".chat-message[data-question-id="+n.ID+"]").remove());let i=c.container.find(".js--chat-question-container");var r=i.find(".chat-message");r.length<=1&&c.container.find(".chat-question-body").hide()};this.promoteUserToModeratorObj=function(n){let t=c.container.find(".chat-message-header-line[data-user-id="+n.FK_GlobalAccess+"]"),i=c.container.find(".js-admin-icon").not(".hideButton").parents(".chat-message"),r=c.container.find(".js-moderator-icon").not(".hideButton").parents(".chat-message");c.moderatorId=c.userId;c.container.find(".js-admin-panel").show();c.container.find(".js-delete-btn").removeClass("hideButton");c.container.find(".js-question-panel").show();c.container.find(".js--btn-chat-send-question").hide();t.find(".js-admin-panel").hide();i.find(".js-delete-btn").addClass("hideButton");r.find(".js-delete-btn").addClass("hideButton")};this.promoteToModeratorObj=function(n){let t=c.container.find(".chat-message-header-line[data-user-id="+n.FK_GlobalAccess+"]"),i=c.container.find(".js-moderator-icon").not(".hideButton").parents(".chat-message");typeof t!="undefined"&&t!=null&&(t.find(".js-moderator-btn").addClass("hideButton"),t.find(".js-demote-moderator-btn").removeClass("hideButton"),t.find(".js-moderator-icon").removeClass("hideButton"));s!=o&&(t.find(".js-admin-panel").hide(),i.find(".js-admin-panel").hide())};this.demoteUserFromModeratorObj=function(n){let t=c.container.find(".chat-message-header-line[data-user-id="+n.FK_GlobalAccess+"]");c.moderatorId=0;var i=c.container.find(".js-admin-panel").hide();c.container.find(".js-delete-btn").addClass("hideButton");c.container.find(".js-question-panel").hide();c.container.find(".js--btn-chat-send-question").show();t.find(".js-delete-btn").removeClass("hideButton")};this.demoteFromModeratorObj=function(n){let t=c.container.find(".chat-message-header-line[data-user-id="+n.FK_GlobalAccess+"]");typeof t!="undefined"&&t!=null&&(t.find(".js-moderator-btn").removeClass("hideButton"),t.find(".js-demote-moderator-btn").addClass("hideButton"),t.find(".js-moderator-icon").addClass("hideButton"));c.moderatorId>0&&t.find(".js-admin-panel").show()};this.ReplyTo=function(n){let i=c.container.find(".chat-reply-to-section");i.attr("data-message-id",n);let t=c.findMessage(n);if(typeof t!="undefined"&&t!=null){let n=t.find(".chat-message-text > span").first().text();n=n.replaceAll("<","&lt").replaceAll(">","&gt");let i=t.find(".chat-message-author-name > span").first().text();typeof n!="undefined"&&n!=null&&(n.length>50&&(n=n.slice(0,50)+" ..."),c.container.find(".chat-reply-to-message > span").html(n));typeof i!="undefined"&&i!=null&&c.container.find(".js--reply-to-author-name").html(i)}c.container.find(".chat-ask-question-section").hide();c.container.find(".chat-ask-question-section").attr("data-question-message","false");i.show();let r=c.container.find(".js--txt-chat-message");r.focus()};this.IsValidMessage=function(){var n=c.container.find(".js--txt-chat-message").val();return n&&n!=null&&n.length!=null&&n.length>0&&n.replace(/^\s+|\s+$/g,"").length!=0};this.ClearInput=function(){c.container.find(".js--txt-chat-message").val("").text("").focus()};this.GetNextMessages=function(n,t,i){n==null&&(n=0);i==null&&(i=0);c.isLoadingMessages||(c.showLoadMessagesIndicator(),c.isLoadingMessages=!0,$.ajax({type:"POST",url:f+"/Services/EventsService.asmx/GetOnlineChatMessages",contentType:"application/json; charset=utf-8","async":!0,data:JSON.stringify({chatid:c.chatId,fromMessageId:n,size:c.messageCount,channel:e,notificationMessageId:i,isLoadBottom:!1}),dataType:"json",success:function(n){if(n!=null)if(typeof n.d!="undefined"&&n.d!=null&&typeof n.d.length!="undefined"&&n.d.length!=null&&n.d.length>0)c.PushMessagesToChat(n.d,!0,t),c.hideLoadMessagesIndicator();else c.isFirstLoad&&c.ShowNoMessagesLabel(),c.hideLoadMessagesIndicator(),c.isTheEnd=!0;else c.hideLoadMessagesIndicator(),c.isTheEnd=!0;c.isFirstLoad=!1;c.isLoadingMessages=!1;t&&c.scrollToNotificationMessage()},error:function(){console.error("GetOnlineChatMessages Service not Responding");c.isLoadingMessages=!1;c.isErrorLoad==!1&&(c.isErrorLoad=!0,c.GetNextMessages(null,t,null))}}))};this.GetNextMessagesToBottom=function(n,t){n==null&&(n=0);var i=c.messageCount;t==!0&&(i=100);c.isLoadingMessages||(c.showLoadMessagesIndicator(),c.isLoadingMessages=!0,$.ajax({type:"POST",url:f+"/Services/EventsService.asmx/GetOnlineChatMessages",contentType:"application/json; charset=utf-8","async":!0,data:JSON.stringify({chatid:c.chatId,fromMessageId:n,size:i,channel:e,notificationMessageId:0,isLoadBottom:!0}),dataType:"json",success:function(n){n!=null?typeof n.d!="undefined"&&n.d!=null&&typeof n.d.length!="undefined"&&n.d.length!=null&&n.d.length>0?(c.PushMessagesToChat(n.d,!1,!1),c.hideLoadMessagesIndicator()):(c.hideLoadMessagesIndicator(),c.isLoadBottomEnd=!0):(c.hideLoadMessagesIndicator(),c.isLoadBottomEnd=!0);c.isLoadingMessages=!1;t&&(c.isLoadBottomEnd?c.ScrollBottomAnimated():c.loadAllMessage())},error:function(){console.error("GetOnlineChatMessages Service not Responding");c.isLoadingMessages=!1}}))};this.GetRepliedMessages=function(n,t,i,r){var u,o;c.showLoadRepliesIndicator(n);u=!1;t>0&&(u=!0);i==null&&(i=0);o=!1;$.ajax({type:"POST",url:f+"/Services/EventsService.asmx/GetRepliedMessages",contentType:"application/json; charset=utf-8","async":!0,data:JSON.stringify({messageId:n,lastRepliesId:t,size:c.repliesCount,channel:e,notificationMessageId:i}),dataType:"json",success:function(t){if(t!=null)if(typeof t.d!="undefined"&&t.d!=null&&typeof t.d.length!="undefined"&&t.d.length!=null&&t.d.length>0)t.d.length<c.repliesCount&&(o=!0),c.PushRepliesToChat(t.d,n,u,o);else{var f=c.findMessage(n);r&&f.find(".js-chat-reply").hide();f.find(".js-load-more-replies").hide()}else c.hideLoadRepliesIndicator(n);c.hideLoadRepliesIndicator(n);i>0&&setTimeout(function(){c.ScrollToMessage(i)},500)},error:function(){c.isErrorLoad==!1&&(c.isErrorLoad=!0,c.GetRepliedMessages(n));console.error("GetOnlineChatReplies Service not Responding")}})};this.ShowNoMessagesLabel=function(){c.container.find(".js--chat-no-messages").show()};this.HideNoMessagesLabel=function(){c.container.find(".js--chat-no-messages").hide()};this.isNoMessagesLabelVisible=function(){var n=c.container.find(".js--chat-no-messages");return n.css("display")!="none"?!0:!1};this.PushMessagesToChat=function(n,t){var r,i;if(n!=null)for(r=0;r<n.length;r++)i=n[r],i!=null&&(c.addMessageObj(i,t),i.IsQuestion&&c.addQuestionMessage(i,t))};this.PushRepliesToChat=function(n,t,i,r){var u,f;for(r!=!0&&(r=!1),u=0;u<n.length;u++)f=n[u],f!=null&&c.addRepliesToChat(f,i,t,!1,r)};this.ScrollBottom=function(){let n=c.container.find(".js--chat-message-container");n.scrollTop(n[0].scrollHeight)};this.ScrollBottomAnimated=function(){let n=c.container.find(".js--chat-message-container");n.animate({scrollTop:n[0].scrollHeight})};this.ScrollBottomQuestion=function(){let n=c.container.find(".js--chat-question-container");n.scrollTop(n[0].scrollHeight)};this.scrollToMessageAnimated=function(n){let i=c.container.find(".js--chat-message-container"),t=c.findMessage(n);t.length>0&&i.animate({scrollTop:parseInt(t.offset().top-i.offset().top+i.scrollTop())},500,null,function(){t.removeClass("chat-message-highlight-out").addClass("chat-message-highlight-in");setTimeout(function(){t.removeClass("chat-message-highlight-in").addClass("chat-message-highlight-out")},1e3)})};this.ScrollToMessage=function(n){let i=c.container.find(".js--chat-message-container"),t=c.findMessage(n);t.length>0&&(i.scrollTop(parseInt(t.offset().top-i.offset().top+i.scrollTop())),t.removeClass("chat-message-highlight-out").addClass("chat-message-highlight-in"),setTimeout(function(){t.removeClass("chat-message-highlight-in").addClass("chat-message-highlight-out")},1e3))};this.scrollToNotificationMessage=function(){var n,t;if(c.notificationMessageId>0)if(c.notificationRepliesId>0){let t=c.findMessage(c.notificationMessageId);n=t.find(".js-reply-container");n.css("display")=="none"?(t=!1,c.showReplies(c.notificationMessageId,!1),c.GetRepliedMessages(c.notificationMessageId,0,c.notificationRepliesId)):setTimeout(function(){c.ScrollToMessage(c.notificationRepliesId)},1);c.notificationMessageId=0}else c.ScrollToMessage(c.notificationMessageId);else setTimeout(function(){c.ScrollBottom()},1)};this.ScrollToChatSection=function(){$([document.documentElement,document.body]).animate({scrollTop:$(".js--txt-chat-message").offset().top},500);let n=c.container.find(".js--txt-chat-message");n.focus()};this.showLoadMessagesIndicator=function(){c.container.find(".js--loading-message-indicator").show()};this.hideLoadMessagesIndicator=function(){c.container.find(".js--loading-message-indicator").hide()};this.showLoadRepliesIndicator=function(n){let t=c.findMessage(n);t.find(".js--loading-replies-indicator").show()};this.hideLoadRepliesIndicator=function(n){let t=c.findMessage(n);t.find(".js--loading-replies-indicator").hide()};this.changeViewText=function(n,t){n?(t.find(".js-toggle-replies-bottom").html("&#11165 Hide replies &#11165"),t.find(".js-toggle-replies").html("&#11165 Hide replies &#11165"),t.find(".js-replies").show()):(t.find(".js-toggle-replies").html("&#11167 View replies &#11167"),t.find(".js-toggle-replies-bottom").html("&#11167 View replies &#11167"),t.find(".js-replies").toggle("fast"))};this.DisabledFuncAfterStopStream=function(){c.chat.server.disabledFuncAfterStopStream()};this.DisabledChatFuncObj=function(){c.container.find(".chat-message-header-line-commands").addClass("disabled-icon");c.container.find(".js--btn-chat-send-message").addClass("disabled-button");c.container.find(".txt-message-wrapper span").addClass("disabled-span");c.container.find(".txt-message-wrapper .js--txt-chat-message").addClass("disabled-textarea");c.container.find(".txt-message-wrapper .js--txt-chat-message").blur();c.container.find(".js--btn-chat-send-question").addClass("disabled-button")};let a=new URLSearchParams(n.location.search);a.has("m")&&$("#divComments").hasClass("hidden-tab")?(v=$(location).attr("href"),c.notificationMessageId=a.get("m").split("/")[0],c.notificationRepliesId=a.get("m").split("/")[1]):c.isLoadBottomEnd=!0;(s==o||c.userId!=0&&c.userId==c.moderatorId)&&(c.container.find(".js-question-panel").show(),c.container.find(".js--btn-chat-send-question").hide());this.InitLoadingMessages=function(){var n=!0;c.GetNextMessages(0,n,c.notificationMessageId);let i=c.container.find(".js--chat-message-container");t(i).scroll(function(){var o=this;if($(this).scrollTop()<=300&&!c.isTheEnd&&!c.isFirstLoad&&!c.isLoadingMessages){c.showLoadMessagesIndicator();var t=c.container.find(".js--chat-message-container"),i=t.find(".chat-message:not(.js--chat-message-base)"),r=i.first(),u=r.attr("data-message-id");n=!1;c.GetNextMessages(u,n,0)}if(c.isLoadBottomEnd==!1&&$(this)[0].scrollTop>=$(this)[0].scrollHeight-700){var t=c.container.find(".js--chat-message-container"),i=t.find(".chat-message:not(.js--chat-message-base)"),f=i.last(),e=f.attr("data-message-id");c.GetNextMessagesToBottom(e,!1)}})};l=c.container.find(".js--chat-message-container");l.scroll(function(){l[0].scrollHeight-l[0].scrollTop<l[0].clientHeight+200?c.container.find(".scroll-to-bottom-btn").addClass("hideButton"):c.container.find(".scroll-to-bottom-btn").removeClass("hideButton")});this.StartCooldown=function(t){var e=Math.round(new Date/1e3)+t,u,i,r,f;n.localStorage.setItem("Cooldown",e);u=t;i=parseInt(u/60,10);r=parseInt(u%60,10);i=i<10?"0"+i:i;r=r<10?"0"+r:r;c.container.find(".js--btn-chat-send-question").addClass("disabled-btn");c.container.find(".js--btn-chat-send-question").html("To next question "+i+":"+r);f=setInterval(function(){i=parseInt(u/60,10);r=parseInt(u%60,10);i=i<10?"0"+i:i;r=r<10?"0"+r:r;c.container.find(".js--btn-chat-send-question").html("To next question "+i+":"+r);--u<0&&(clearInterval(f),c.container.find(".js--btn-chat-send-question").removeClass("disabled-btn"),c.container.find(".js--btn-chat-send-question").html("Ask Question"),n.localStorage.removeItem("Cooldown"))},1e3)};this.initMessageField=function(n,t){var i=c.container.find(".js--chat-message-base").clone();i.find(".chat-message-author-name > span").text(n.Author);i.find(".chat-message-text > span").html(n.MessageText);i.attr("data-message-id",n.ID);i.find(".chat-message-header-line").attr("data-user-id",n.FK_GlobalAccess);switch(t){case"message":try{let t=new Date(Date.parse(n.CreationDateJsFormat)).toUTCString();i.find(".chat-message-sent-date > span").text(this.getUsersLocalTime(new Date(new Date(t).getTime()-c.clientTZOffset*6e4)))}catch(r){i.find(".chat-message-sent-date > span").text(n.CreationDateStr+" (GMT)");console.log("Failed to convert time ("+n.CreationDateStr+")")}break;case"replies":i.find(".chat-message-header-line-reply-to-btn").hide();i.find(".chat-reply-sent-date").show();i.find(".js-chat-reply").remove();try{let t=new Date(Date.parse(n.CreationDateJsFormat)).toUTCString();i.find(".chat-reply-sent-date").text(this.getUsersLocalTime(new Date(new Date(t).getTime()-c.clientTZOffset*6e4)))}catch(r){i.find(".chat-reply-sent-date").text(n.CreationDateStr+" (GMT)");console.log("Failed to convert time ("+n.CreationDateStr+")")}}return(n.IsModerator||n.FK_GlobalAccess==o)&&s!=n.userId&&s!=o&&i.find(".js-delete-btn").addClass("hideButton"),n.FK_GlobalAccess!=s&&s!=o&&(s==0||s!=c.moderatorId||n.IsModerator||n.FK_GlobalAccess==o)||i.find(".js-delete-btn").removeClass("hideButton"),n.IsDeleted&&(i.find(".chat-message-text > span").addClass("messageFromServer"),i.find(".chat-message-header-line-reply-to-btn").addClass("hideButton"),i.find(".js-delete-btn").addClass("hideButton"),i.find(".js-question-icon").addClass("hideButton")),(n.FK_GlobalAccess==s||n.FK_GlobalAccess==o)&&i.find(".js-ban-btn").addClass("hideButton"),n.IsModerator&&(i.find(".js-moderator-btn").addClass("hideButton"),i.find(".js-demote-moderator-btn").removeClass("hideButton")),n.IsBanned&&(i.find(".js-ban-btn").addClass("hideButton"),i.find(".js-unblock-btn").removeClass("hideButton"),i.find(".js-moderator-btn").addClass("hideButton")),o!=s&&n.IsModerator&&c.moderatorId>0&&(i.find(".js-ban-btn").addClass("hideButton"),i.find(".js-unblock-btn").addClass("hideButton"),i.find(".js-admin-panel").hide()),n.IsQuestion&&i.find(".js-question-icon").removeClass("hideButton"),n.IsModerator&&i.find(".js-moderator-icon").removeClass("hideButton"),n.FK_GlobalAccess==o&&i.find(".js-admin-icon").removeClass("hideButton"),(s!=o||n.FK_GlobalAccess==o)&&(i.find(".js-moderator-btn").hide(),i.find(".js-demote-moderator-btn").hide()),(c.moderatorId>0||s==o)&&i.find(".js-admin-panel").show(),i.removeClass("js--chat-message-base"),i};this.showReplies=function(n,t){var i=c.findMessage(n),r;let u=i.find(".js-reply-container"),f=i.find(".js-toggle-replies");u.css("display")=="none"?(t&&(r=i.find(".js-reply-container-fromHub"),r.find(".chat-message").remove(),c.GetRepliedMessages(n,0,0,t),t=!1),c.changeViewText(!0,i)):c.changeViewText(!1,i);i.find(".js-reply-container").toggle("fast")};this.findMessage=function(n){return c.container.find(".chat-message[data-message-id="+n+"]")};this.loadAllMessage=function(){c.showLoadMessagesIndicator();var n=c.container.find(".js--chat-message-container"),t=n.find(".chat-message:not(.js--chat-message-base)"),i=t.last(),r=i.attr("data-message-id");c.GetNextMessagesToBottom(r,!0)}}}(window,jQuery,moment);;
